Repository navigation
Expand file tree
/
Copy pathexecution-runtime.ts
More file actions
65 lines (60 loc) · 2.97 KB
/
Copy pathexecution-runtime.ts
File metadata and controls
65 lines (60 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import type { AgentIntegration } from './integration.js';
import type { ExecutorCallOptions } from './resources.js';
import type { ExecutionFilesService } from './files.js';
import type { ExecutionGitService, ExecutionGhService } from './git.js';
import type { ExecutionTerminalService } from './terminals.js';
import type { ExecutorPath } from '@garcon/common/executor-path';
import type { TicketProjectDefault } from '@garcon/common/tickets';
import type { ProjectResolution } from '@garcon/common/project-resolution';
import type { ApiProtocol, ModelDiscoveryKind, ApiProviderModelDiscoveryResponse } from '@garcon/common/api-providers';
export interface ApiProviderDiscoveryRequest {
readonly protocol: ApiProtocol;
readonly baseUrl: string;
readonly apiKey?: string;
readonly modelDiscovery: ModelDiscoveryKind;
}
export interface ExecutionProjectService {
ticketProjectDefault(request: { readonly projectPath: ExecutorPath }, options?: ExecutorCallOptions): Promise<TicketProjectDefault>;
inspect(request: {
readonly projectPath: ExecutorPath;
readonly includeGitRepository?: boolean;
}, options?: ExecutorCallOptions): Promise<{
readonly resolution: ProjectResolution;
readonly isGitRepository?: boolean;
}>;
resolveFileMentions(request: {
readonly projectPath: ExecutorPath;
readonly command: string;
}, options?: ExecutorCallOptions): Promise<string>;
}
// `reconnecting` is a remote executor whose connection dropped while its
// transcript bindings may still resume; it becomes `offline` when they cannot.
export type ExecutorAvailability = 'ready' | 'reconnecting' | 'offline' | 'disposed';
export interface ExecutorInfo {
readonly executorId: string;
readonly instanceId: string;
readonly integrationIds: readonly string[];
readonly projectBasePath: ExecutorPath;
readonly services: {
readonly files: boolean;
readonly git: boolean;
readonly gh: boolean;
readonly terminals: boolean;
/** Whether the file service can create directories without a path-based race. */
readonly directoryCreation: boolean;
};
}
export interface ExecutionRuntimeApi {
readonly id: string;
readonly availability: ExecutorAvailability;
getInfo(options?: ExecutorCallOptions): Promise<ExecutorInfo>;
getAgentIntegration(agentId: string, options?: ExecutorCallOptions): Promise<AgentIntegration>;
getProjectService(options?: ExecutorCallOptions): Promise<ExecutionProjectService>;
discoverApiProviderModels(request: ApiProviderDiscoveryRequest, options?: ExecutorCallOptions): Promise<ApiProviderModelDiscoveryResponse>;
getFilesService(options?: ExecutorCallOptions): Promise<ExecutionFilesService>;
getGitService(options?: ExecutorCallOptions): Promise<ExecutionGitService>;
getGhService(options?: ExecutorCallOptions): Promise<ExecutionGhService>;
getTerminalService(options?: ExecutorCallOptions): Promise<ExecutionTerminalService>;
onAvailabilityChanged(listener: (value: ExecutorAvailability) => void): () => void;
dispose(): Promise<void>;
}