@getmateo/client 0.0.0-stage → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +211 -0
- package/README.md +43 -2
- package/dist/compat/normalize-provider-models.d.ts +11 -0
- package/dist/compat/normalize-provider-models.js +51 -0
- package/dist/connection/index.d.ts +51 -0
- package/dist/connection/index.js +113 -0
- package/dist/connection/legacy-workspaces.d.ts +19 -0
- package/dist/connection/legacy-workspaces.js +161 -0
- package/dist/connection/legacy.d.ts +31 -0
- package/dist/connection/legacy.js +245 -0
- package/dist/connection/owned.d.ts +36 -0
- package/dist/connection/owned.js +210 -0
- package/dist/creation/index.d.ts +40 -0
- package/dist/creation/index.js +197 -0
- package/dist/daemon-client-relay-e2ee-transport.d.ts +10 -0
- package/dist/daemon-client-relay-e2ee-transport.js +190 -0
- package/dist/daemon-client-runtime-metrics.d.ts +39 -0
- package/dist/daemon-client-runtime-metrics.js +173 -0
- package/dist/daemon-client-transport-types.d.ts +43 -0
- package/dist/daemon-client-transport-types.js +2 -0
- package/dist/daemon-client-transport-utils.d.ts +14 -0
- package/dist/daemon-client-transport-utils.js +127 -0
- package/dist/daemon-client-transport.d.ts +5 -0
- package/dist/daemon-client-transport.js +4 -0
- package/dist/daemon-client-websocket-transport.d.ts +15 -0
- package/dist/daemon-client-websocket-transport.js +183 -0
- package/dist/daemon-client.d.ts +1507 -0
- package/dist/daemon-client.js +5465 -0
- package/dist/fleet/index.d.ts +29 -0
- package/dist/fleet/index.js +81 -0
- package/dist/hosts/index.d.ts +16 -0
- package/dist/hosts/index.js +201 -0
- package/dist/index.d.ts +430 -0
- package/dist/index.js +583 -0
- package/dist/legacy-usage-icons.d.ts +2 -0
- package/dist/legacy-usage-icons.js +16 -0
- package/dist/node/buffering.d.ts +10 -0
- package/dist/node/buffering.js +28 -0
- package/dist/node/index.d.ts +17 -0
- package/dist/node/index.js +191 -0
- package/dist/node/ssh-tunnel.d.ts +9 -0
- package/dist/node/ssh-tunnel.js +81 -0
- package/dist/provider-snapshots/index.d.ts +21 -0
- package/dist/provider-snapshots/index.js +56 -0
- package/dist/terminal-stream-router.d.ts +25 -0
- package/dist/terminal-stream-router.js +62 -0
- package/dist/terminals/index.d.ts +80 -0
- package/dist/terminals/index.js +120 -0
- package/dist/timeline-subscription/index.d.ts +25 -0
- package/dist/timeline-subscription/index.js +56 -0
- package/package.json +59 -4
|
@@ -0,0 +1,1507 @@
|
|
|
1
|
+
import { type HostRouteFrame } from "@getmateo/protocol/binary-frames/index";
|
|
2
|
+
import type { ClientDeviceDetails, DaemonAuthStatus } from "@getmateo/protocol/daemon-auth";
|
|
3
|
+
import type { FleetCredential, FleetJoinMember, FleetProject, FleetStatus } from "@getmateo/protocol/fleet";
|
|
4
|
+
import { type TimelineMessage } from "./timeline-subscription/index.js";
|
|
5
|
+
import { type OwnedSubscription, type TimelineSubscription } from "./connection/index.js";
|
|
6
|
+
import type { CreationSnapshot, WorkspaceProjectMergeInput, WorkspaceProjectMergeResult } from "@getmateo/protocol/messages";
|
|
7
|
+
import type { z } from "zod";
|
|
8
|
+
import type { SessionEventSubscription } from "@getmateo/protocol/messages";
|
|
9
|
+
import { type ClientCapability } from "@getmateo/protocol/client-capabilities";
|
|
10
|
+
import type { AgentAttentionNotificationPayload } from "@getmateo/protocol/agent-attention-notification";
|
|
11
|
+
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, DaemonRuntimeHandoffRestartResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload } from "@getmateo/protocol/messages";
|
|
12
|
+
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreateMateoWorktreeRequest, FilePreviewOpenRequest, FilePreviewReadRequest, FilePreviewCloseRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, MateoWorktreeListResponse, MateoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, UsageReportEntry, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DaemonConfigReloadResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, CountBusyTerminalsResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, MateoConfigRaw, MateoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState, PluginListItem, PluginLogEntry, PluginSourceStatusItem, PluginSourceUpdateItem, PluginUpdateSelection, PluginUpdateProposal, PluginUpdatePreview, PluginUpdateResult, AgentSkillSelection, AgentSkillsStatus, AgentSkillsSaveResult } from "@getmateo/protocol/messages";
|
|
13
|
+
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@getmateo/protocol/agent-types";
|
|
14
|
+
import type { AgentConfigApply, MutableDaemonConfig, MutableDaemonConfigPatch } from "@getmateo/protocol/messages";
|
|
15
|
+
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
|
|
16
|
+
import { type TerminalStreamEvent } from "./terminal-stream-router.js";
|
|
17
|
+
import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@getmateo/protocol/browser-automation/rpc-schemas";
|
|
18
|
+
export interface Logger {
|
|
19
|
+
debug(obj: object, msg?: string): void;
|
|
20
|
+
info(obj: object, msg?: string): void;
|
|
21
|
+
warn(obj: object, msg?: string): void;
|
|
22
|
+
error(obj: object, msg?: string): void;
|
|
23
|
+
}
|
|
24
|
+
interface ImportAgentInputBase {
|
|
25
|
+
cwd?: string;
|
|
26
|
+
workspaceId?: string;
|
|
27
|
+
labels?: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
export type ImportAgentInput = (ImportAgentInputBase & {
|
|
30
|
+
providerId: string;
|
|
31
|
+
providerHandleId: string;
|
|
32
|
+
}) | (ImportAgentInputBase & {
|
|
33
|
+
provider: AgentProvider;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
});
|
|
36
|
+
export type DaemonAuthFailureReason = "password_required" | "incorrect_password";
|
|
37
|
+
export declare class DaemonAuthenticationError extends Error {
|
|
38
|
+
readonly reason: DaemonAuthFailureReason;
|
|
39
|
+
constructor(reason: DaemonAuthFailureReason);
|
|
40
|
+
}
|
|
41
|
+
export declare function getDaemonAuthFailureReason(error: unknown): DaemonAuthFailureReason | null;
|
|
42
|
+
export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js";
|
|
43
|
+
export type { TerminalStreamEvent };
|
|
44
|
+
export type ConnectionState = {
|
|
45
|
+
status: "idle";
|
|
46
|
+
} | {
|
|
47
|
+
status: "connecting";
|
|
48
|
+
attempt: number;
|
|
49
|
+
} | {
|
|
50
|
+
status: "connected";
|
|
51
|
+
} | {
|
|
52
|
+
status: "disconnected";
|
|
53
|
+
reason?: string;
|
|
54
|
+
nextRetryAt?: string;
|
|
55
|
+
failureCode?: string;
|
|
56
|
+
} | {
|
|
57
|
+
status: "disposed";
|
|
58
|
+
};
|
|
59
|
+
export type DaemonEvent = {
|
|
60
|
+
type: "agent_update";
|
|
61
|
+
agentId: string;
|
|
62
|
+
payload: Extract<SessionOutboundMessage, {
|
|
63
|
+
type: "agent_update";
|
|
64
|
+
}>["payload"];
|
|
65
|
+
} | {
|
|
66
|
+
type: "workspace_update";
|
|
67
|
+
workspaceId: string;
|
|
68
|
+
payload: Extract<SessionOutboundMessage, {
|
|
69
|
+
type: "workspace_update";
|
|
70
|
+
}>["payload"];
|
|
71
|
+
} | {
|
|
72
|
+
type: "project.update";
|
|
73
|
+
payload: Extract<SessionOutboundMessage, {
|
|
74
|
+
type: "project.update";
|
|
75
|
+
}>["payload"];
|
|
76
|
+
} | {
|
|
77
|
+
type: "workspace_setup_progress";
|
|
78
|
+
workspaceId: string;
|
|
79
|
+
payload: Extract<SessionOutboundMessage, {
|
|
80
|
+
type: "workspace_setup_progress";
|
|
81
|
+
}>["payload"];
|
|
82
|
+
} | {
|
|
83
|
+
type: "agent_stream";
|
|
84
|
+
agentId: string;
|
|
85
|
+
event: AgentStreamEventPayload;
|
|
86
|
+
timestamp: string;
|
|
87
|
+
seq?: number;
|
|
88
|
+
epoch?: string;
|
|
89
|
+
} | {
|
|
90
|
+
type: "status";
|
|
91
|
+
payload: {
|
|
92
|
+
status: string;
|
|
93
|
+
} & Record<string, unknown>;
|
|
94
|
+
} | {
|
|
95
|
+
type: "agent_deleted";
|
|
96
|
+
agentId: string;
|
|
97
|
+
} | {
|
|
98
|
+
type: "agent_permission_request";
|
|
99
|
+
agentId: string;
|
|
100
|
+
request: AgentPermissionRequest;
|
|
101
|
+
} | {
|
|
102
|
+
type: "agent_permission_resolved";
|
|
103
|
+
agentId: string;
|
|
104
|
+
requestId: string;
|
|
105
|
+
resolution: AgentPermissionResponse;
|
|
106
|
+
} | {
|
|
107
|
+
type: "providers_snapshot_update";
|
|
108
|
+
payload: Extract<SessionOutboundMessage, {
|
|
109
|
+
type: "providers_snapshot_update";
|
|
110
|
+
}>["payload"];
|
|
111
|
+
} | {
|
|
112
|
+
type: "error";
|
|
113
|
+
message: string;
|
|
114
|
+
};
|
|
115
|
+
export type DaemonEventHandler = (event: DaemonEvent) => void;
|
|
116
|
+
export type BrowserAutomationExecuteRequestMessage = BrowserAutomationExecuteRequest;
|
|
117
|
+
export type BrowserAutomationExecuteResponseMessage = BrowserAutomationExecuteResponse;
|
|
118
|
+
/** What a client tells the host about itself in its hello. */
|
|
119
|
+
export interface DaemonClientDevice extends ClientDeviceDetails {
|
|
120
|
+
name: string;
|
|
121
|
+
platform: string;
|
|
122
|
+
}
|
|
123
|
+
export interface DaemonClientConfig {
|
|
124
|
+
/** Deliver compact bodies/hash references to a caller-owned snapshot cache.
|
|
125
|
+
* The default keeps public SDK snapshot entries expanded. */
|
|
126
|
+
providerSnapshots?: "wire";
|
|
127
|
+
/** Narrows this session below the credential's permissions; the daemon never widens them. */
|
|
128
|
+
sessionPermissions?: import("@getmateo/protocol/messages").DaemonPermission[];
|
|
129
|
+
url: string;
|
|
130
|
+
clientId: string;
|
|
131
|
+
clientType?: "mobile" | "browser" | "cli" | "mcp" | "hub";
|
|
132
|
+
appVersion?: string;
|
|
133
|
+
runtimeGeneration?: number | null;
|
|
134
|
+
password?: string;
|
|
135
|
+
/** A fleet peer credential issued by the destination for this daemon. */
|
|
136
|
+
peerCredential?: string;
|
|
137
|
+
/** A device credential this host issued when the owner kept this device signed in. */
|
|
138
|
+
deviceCredential?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Shown in the owner's session list; never used for authorization. A function is read again
|
|
141
|
+
* for every hello, so a renamed device reports its new name when it next connects.
|
|
142
|
+
*/
|
|
143
|
+
device?: DaemonClientDevice | (() => DaemonClientDevice);
|
|
144
|
+
localCredential?: () => string | undefined | Promise<string | undefined>;
|
|
145
|
+
authHeader?: string;
|
|
146
|
+
suppressSendErrors?: boolean;
|
|
147
|
+
transportFactory?: DaemonTransportFactory;
|
|
148
|
+
webSocketFactory?: WebSocketFactory;
|
|
149
|
+
logger?: Logger;
|
|
150
|
+
connectTimeoutMs?: number;
|
|
151
|
+
e2ee?: {
|
|
152
|
+
enabled?: boolean;
|
|
153
|
+
daemonPublicKeyB64?: string;
|
|
154
|
+
};
|
|
155
|
+
reconnect?: {
|
|
156
|
+
enabled?: boolean;
|
|
157
|
+
baseDelayMs?: number;
|
|
158
|
+
maxDelayMs?: number;
|
|
159
|
+
};
|
|
160
|
+
runtimeMetricsIntervalMs?: number;
|
|
161
|
+
runtimeMetricsWindowMs?: number;
|
|
162
|
+
trace?: DaemonClientTrace;
|
|
163
|
+
capabilities?: Partial<Record<ClientCapability, unknown>>;
|
|
164
|
+
}
|
|
165
|
+
export interface DaemonClientTrace {
|
|
166
|
+
isEnabled(): boolean;
|
|
167
|
+
beginSection(name: string, args?: Record<string, string>): void;
|
|
168
|
+
endSection(): void;
|
|
169
|
+
}
|
|
170
|
+
export interface SendMessageOptions {
|
|
171
|
+
sourceAgentId?: string;
|
|
172
|
+
sourceAgentServerId?: string;
|
|
173
|
+
messageId?: string;
|
|
174
|
+
/** Agent sources wait for turn end unless interrupt is explicit. Human sources default to interrupt. */
|
|
175
|
+
activeTurnBehavior?: ActiveTurnBehavior;
|
|
176
|
+
images?: Array<{
|
|
177
|
+
data: string;
|
|
178
|
+
mimeType: string;
|
|
179
|
+
}>;
|
|
180
|
+
attachments?: SendAgentMessageRequest["attachments"];
|
|
181
|
+
}
|
|
182
|
+
export interface AgentAttentionRequiredNotification {
|
|
183
|
+
agentId: string;
|
|
184
|
+
reason: "finished" | "error" | "permission";
|
|
185
|
+
timestamp: string;
|
|
186
|
+
shouldNotify: boolean;
|
|
187
|
+
notification?: AgentAttentionNotificationPayload;
|
|
188
|
+
}
|
|
189
|
+
type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
|
|
190
|
+
export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
191
|
+
agentId?: string;
|
|
192
|
+
onEvent?: (snapshot: CreationSnapshot) => void;
|
|
193
|
+
config?: AgentSessionConfig;
|
|
194
|
+
provider?: AgentProvider;
|
|
195
|
+
cwd?: string;
|
|
196
|
+
env?: CreateAgentRequestMessage["env"];
|
|
197
|
+
workspaceId?: string;
|
|
198
|
+
callerAgentId?: string;
|
|
199
|
+
initialPrompt?: string;
|
|
200
|
+
idempotencyKey?: string;
|
|
201
|
+
clientMessageId?: string;
|
|
202
|
+
outputSchema?: Record<string, unknown>;
|
|
203
|
+
images?: CreateAgentRequestMessage["images"];
|
|
204
|
+
attachments?: CreateAgentRequestMessage["attachments"];
|
|
205
|
+
/** @deprecated Use createWorkspace({ source, agent, idempotencyKey }); rejected by createAgent. */
|
|
206
|
+
git?: GitSetupOptions;
|
|
207
|
+
worktree?: CreateAgentRequestMessage["worktree"];
|
|
208
|
+
autoArchive?: CreateAgentRequestMessage["autoArchive"];
|
|
209
|
+
background?: CreateAgentRequestMessage["background"];
|
|
210
|
+
/** @deprecated Use createWorkspace({ source, agent, idempotencyKey }); rejected by createAgent. */
|
|
211
|
+
worktreeName?: string;
|
|
212
|
+
requestId?: string;
|
|
213
|
+
labels?: Record<string, string>;
|
|
214
|
+
}
|
|
215
|
+
export interface CreateWorkspaceRequestOptions {
|
|
216
|
+
source: WorkspaceCreateRequest["source"];
|
|
217
|
+
title?: string;
|
|
218
|
+
/** Workspace discovery visibility; contents retain normal durability. */
|
|
219
|
+
background?: boolean;
|
|
220
|
+
callerAgentId?: string;
|
|
221
|
+
idempotencyKey?: string;
|
|
222
|
+
workspaceId?: string;
|
|
223
|
+
agent?: Omit<CreateAgentRequestOptions, "workspaceId" | "onEvent" | "worktree" | "git" | "worktreeName" | "idempotencyKey" | "requestId">;
|
|
224
|
+
onEvent?: (snapshot: CreationSnapshot) => void;
|
|
225
|
+
firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
|
|
226
|
+
requestId?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface CreateMateoWorktreeInput extends Pick<CreateMateoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "checkoutSource" | "githubPrNumber"> {
|
|
229
|
+
}
|
|
230
|
+
type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
|
|
231
|
+
type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
|
|
232
|
+
type: "subscribe_checkout_diff_response";
|
|
233
|
+
}>["payload"];
|
|
234
|
+
type CheckoutDiffPayload = Omit<SubscribeCheckoutDiffPayload, "subscriptionId">;
|
|
235
|
+
type CheckoutCommitPayload = CheckoutCommitResponse["payload"];
|
|
236
|
+
type CheckoutMergePayload = CheckoutMergeResponse["payload"];
|
|
237
|
+
type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"];
|
|
238
|
+
type CheckoutPullPayload = CheckoutPullResponse["payload"];
|
|
239
|
+
type CheckoutPushPayload = CheckoutPushResponse["payload"];
|
|
240
|
+
type CheckoutRefreshPayload = CheckoutRefreshResponse["payload"];
|
|
241
|
+
type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"];
|
|
242
|
+
type CheckoutPrMergePayload = CheckoutPrMergeResponse["payload"];
|
|
243
|
+
type CheckoutForgeSetAutoMergePayload = CheckoutForgeSetAutoMergeResponse["payload"];
|
|
244
|
+
type CheckoutGithubSetAutoMergePayload = CheckoutGithubSetAutoMergeResponse["payload"];
|
|
245
|
+
type CheckoutForgeGetCheckDetailsPayload = CheckoutForgeGetCheckDetailsResponse["payload"];
|
|
246
|
+
type CheckoutGithubGetCheckDetailsPayload = CheckoutGithubGetCheckDetailsResponse["payload"];
|
|
247
|
+
type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"];
|
|
248
|
+
type PullRequestTimelinePayload = PullRequestTimelineResponse["payload"];
|
|
249
|
+
type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"];
|
|
250
|
+
export type RenameBranchResult = z.infer<typeof CheckoutRenameBranchResponseSchema>["payload"];
|
|
251
|
+
type StashSavePayload = StashSaveResponse["payload"];
|
|
252
|
+
type StashPopPayload = StashPopResponse["payload"];
|
|
253
|
+
type StashListPayload = StashListResponse["payload"];
|
|
254
|
+
type ValidateBranchPayload = ValidateBranchResponse["payload"];
|
|
255
|
+
type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
|
|
256
|
+
type ForgeSearchPayload = ForgeSearchResponse["payload"];
|
|
257
|
+
type GitHubSearchPayload = GitHubSearchResponse["payload"];
|
|
258
|
+
type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
|
|
259
|
+
type MateoWorktreeListPayload = MateoWorktreeListResponse["payload"];
|
|
260
|
+
type MateoWorktreeArchivePayload = MateoWorktreeArchiveResponse["payload"];
|
|
261
|
+
type CreateMateoWorktreePayload = Extract<SessionOutboundMessage, {
|
|
262
|
+
type: "create_mateo_worktree_response";
|
|
263
|
+
}>["payload"];
|
|
264
|
+
type WorkspaceCreatePayload = Extract<SessionOutboundMessage, {
|
|
265
|
+
type: "workspace.create.response";
|
|
266
|
+
}>["payload"];
|
|
267
|
+
type FileExplorerPayload = FileExplorerResponse["payload"];
|
|
268
|
+
export type FileExplorerDirectoryPayload = NonNullable<FileExplorerPayload["directory"]>;
|
|
269
|
+
type LegacyFileExplorerFilePayload = NonNullable<FileExplorerPayload["file"]>;
|
|
270
|
+
export interface FileReadResult {
|
|
271
|
+
bytes: Uint8Array;
|
|
272
|
+
mime: string;
|
|
273
|
+
size: number;
|
|
274
|
+
path: string;
|
|
275
|
+
kind: LegacyFileExplorerFilePayload["kind"];
|
|
276
|
+
modifiedAt: string;
|
|
277
|
+
revision?: string;
|
|
278
|
+
}
|
|
279
|
+
export interface FileUploadInput {
|
|
280
|
+
fileName: string;
|
|
281
|
+
mimeType: string;
|
|
282
|
+
bytes: Uint8Array | ArrayBuffer;
|
|
283
|
+
modifiedAt?: string;
|
|
284
|
+
requestId?: string;
|
|
285
|
+
chunkSize?: number;
|
|
286
|
+
}
|
|
287
|
+
export type FileUploadResult = FileUploadResponse["payload"];
|
|
288
|
+
type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"];
|
|
289
|
+
type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"];
|
|
290
|
+
type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"];
|
|
291
|
+
type ListProviderModesPayload = ListProviderModesResponseMessage["payload"];
|
|
292
|
+
type ListAvailableProvidersPayload = ListAvailableProvidersResponse["payload"];
|
|
293
|
+
type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"];
|
|
294
|
+
type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"];
|
|
295
|
+
type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"];
|
|
296
|
+
type ProviderUsageListPayload = ProviderUsageListResponseMessage["payload"];
|
|
297
|
+
interface UsageListReportsPayload {
|
|
298
|
+
requestId: string;
|
|
299
|
+
reports: UsageReportEntry[];
|
|
300
|
+
}
|
|
301
|
+
type DaemonStatusPayload = DaemonGetStatusResponse["payload"];
|
|
302
|
+
type DaemonPairingOfferPayload = DaemonGetPairingOfferResponse["payload"];
|
|
303
|
+
type DiagnosticsPayload = DiagnosticsResponse["payload"];
|
|
304
|
+
type ReadProjectConfigPayload = Extract<SessionOutboundMessage, {
|
|
305
|
+
type: "read_project_config_response";
|
|
306
|
+
}>["payload"];
|
|
307
|
+
type WriteProjectConfigPayload = Extract<SessionOutboundMessage, {
|
|
308
|
+
type: "write_project_config_response";
|
|
309
|
+
}>["payload"];
|
|
310
|
+
type ListCommandsPayload = ListCommandsResponse["payload"];
|
|
311
|
+
type ListCommandsDraftConfig = Pick<AgentSessionConfig, "provider" | "cwd" | "modeId" | "model" | "thinkingOptionId" | "featureValues">;
|
|
312
|
+
export interface WriteProjectConfigInput {
|
|
313
|
+
repoRoot: string;
|
|
314
|
+
config: MateoConfigRaw;
|
|
315
|
+
expectedRevision: MateoConfigRevision | null;
|
|
316
|
+
requestId?: string;
|
|
317
|
+
}
|
|
318
|
+
interface ListCommandsOptions {
|
|
319
|
+
agentId: string;
|
|
320
|
+
requestId?: string;
|
|
321
|
+
draftConfig?: ListCommandsDraftConfig;
|
|
322
|
+
}
|
|
323
|
+
type LegacyListCommandsOptions = Omit<ListCommandsOptions, "agentId">;
|
|
324
|
+
type AgentPermissionResolvedPayload = AgentPermissionResolvedMessage["payload"];
|
|
325
|
+
type ListTerminalsPayload = ListTerminalsResponse["payload"];
|
|
326
|
+
type CreateTerminalPayload = CreateTerminalResponse["payload"];
|
|
327
|
+
export type RenameTerminalResult = z.infer<typeof RenameTerminalResponseSchema>["payload"];
|
|
328
|
+
export type CountBusyTerminalsResult = CountBusyTerminalsResponse["payload"];
|
|
329
|
+
type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"];
|
|
330
|
+
type CloseItemsPayload = CloseItemsResponse["payload"];
|
|
331
|
+
type KillTerminalPayload = KillTerminalResponse["payload"];
|
|
332
|
+
type CaptureTerminalPayload = CaptureTerminalResponse["payload"];
|
|
333
|
+
type ScheduleCreatePayload = Extract<SessionOutboundMessage, {
|
|
334
|
+
type: "schedule/create/response";
|
|
335
|
+
}>["payload"];
|
|
336
|
+
type ScheduleListPayload = Extract<SessionOutboundMessage, {
|
|
337
|
+
type: "schedule/list/response";
|
|
338
|
+
}>["payload"];
|
|
339
|
+
type ScheduleInspectPayload = Extract<SessionOutboundMessage, {
|
|
340
|
+
type: "schedule/inspect/response";
|
|
341
|
+
}>["payload"];
|
|
342
|
+
type ScheduleLogsPayload = Extract<SessionOutboundMessage, {
|
|
343
|
+
type: "schedule/logs/response";
|
|
344
|
+
}>["payload"];
|
|
345
|
+
type SchedulePausePayload = Extract<SessionOutboundMessage, {
|
|
346
|
+
type: "schedule/pause/response";
|
|
347
|
+
}>["payload"];
|
|
348
|
+
type ScheduleResumePayload = Extract<SessionOutboundMessage, {
|
|
349
|
+
type: "schedule/resume/response";
|
|
350
|
+
}>["payload"];
|
|
351
|
+
type ScheduleDeletePayload = Extract<SessionOutboundMessage, {
|
|
352
|
+
type: "schedule/delete/response";
|
|
353
|
+
}>["payload"];
|
|
354
|
+
type ScheduleRunOncePayload = Extract<SessionOutboundMessage, {
|
|
355
|
+
type: "schedule/run-once/response";
|
|
356
|
+
}>["payload"];
|
|
357
|
+
type ScheduleUpdatePayload = Extract<SessionOutboundMessage, {
|
|
358
|
+
type: "schedule/update/response";
|
|
359
|
+
}>["payload"];
|
|
360
|
+
export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"];
|
|
361
|
+
export type AgentForkContextPayload = AgentForkContextResponseMessage["payload"];
|
|
362
|
+
export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"];
|
|
363
|
+
export type FetchAgentTimelineProjection = FetchAgentTimelinePayload["projection"];
|
|
364
|
+
export type FetchAgentTimelineCursor = NonNullable<FetchAgentTimelinePayload["startCursor"]>;
|
|
365
|
+
export interface FetchAgentOptions {
|
|
366
|
+
agentId: string;
|
|
367
|
+
requestId?: string;
|
|
368
|
+
timeout?: number;
|
|
369
|
+
}
|
|
370
|
+
type LegacyFetchAgentOptions = Omit<FetchAgentOptions, "agentId">;
|
|
371
|
+
export interface FetchAgentTimelineOptions {
|
|
372
|
+
direction?: FetchAgentTimelineDirection;
|
|
373
|
+
cursor?: FetchAgentTimelineCursor;
|
|
374
|
+
limit?: number;
|
|
375
|
+
projection?: FetchAgentTimelineProjection;
|
|
376
|
+
mergeWindow?: boolean;
|
|
377
|
+
requestId?: string;
|
|
378
|
+
timeout?: number;
|
|
379
|
+
}
|
|
380
|
+
export interface AgentTimelineSearchOptions {
|
|
381
|
+
agentId: string;
|
|
382
|
+
query: string;
|
|
383
|
+
cursor?: number;
|
|
384
|
+
}
|
|
385
|
+
export type AgentTimelineSearchPayload = Extract<SessionOutboundMessage, {
|
|
386
|
+
type: "agent.timeline.search.response";
|
|
387
|
+
}>["payload"];
|
|
388
|
+
export type AgentTimelinePromptIndexPayload = Extract<SessionOutboundMessage, {
|
|
389
|
+
type: "agent.timeline.list_prompts.response";
|
|
390
|
+
}>["payload"];
|
|
391
|
+
export type AgentShellsListPayload = Extract<SessionOutboundMessage, {
|
|
392
|
+
type: "agent.shells.list.response";
|
|
393
|
+
}>["payload"];
|
|
394
|
+
export type AgentShellsStopPayload = Extract<SessionOutboundMessage, {
|
|
395
|
+
type: "agent.shells.stop.response";
|
|
396
|
+
}>["payload"];
|
|
397
|
+
export type ProviderSubagentListPayload = Extract<SessionOutboundMessage, {
|
|
398
|
+
type: "agent.provider_subagents.list.response";
|
|
399
|
+
}>["payload"];
|
|
400
|
+
export type ProviderSubagentTimelinePayload = Extract<SessionOutboundMessage, {
|
|
401
|
+
type: "agent.provider_subagents.timeline.get.response";
|
|
402
|
+
}>["payload"];
|
|
403
|
+
export interface FetchProviderSubagentTimelineOptions {
|
|
404
|
+
direction?: ProviderSubagentTimelinePayload["direction"];
|
|
405
|
+
cursor?: FetchAgentTimelineCursor;
|
|
406
|
+
limit?: number;
|
|
407
|
+
requestId?: string;
|
|
408
|
+
timeout?: number;
|
|
409
|
+
}
|
|
410
|
+
export interface AgentForkContextOptions {
|
|
411
|
+
boundaryCursor?: FetchAgentTimelineCursor;
|
|
412
|
+
boundaryMessageId?: string;
|
|
413
|
+
requestId?: string;
|
|
414
|
+
}
|
|
415
|
+
type AgentRefreshedStatusPayload = z.infer<typeof AgentRefreshedStatusPayloadSchema>;
|
|
416
|
+
type RestartRequestedStatusPayload = z.infer<typeof RestartRequestedStatusPayloadSchema>;
|
|
417
|
+
type ShutdownRequestedStatusPayload = z.infer<typeof ShutdownRequestedStatusPayloadSchema>;
|
|
418
|
+
export interface ShutdownServerOptions {
|
|
419
|
+
requestId?: string;
|
|
420
|
+
timeout?: number;
|
|
421
|
+
}
|
|
422
|
+
export interface DaemonStatusOptions {
|
|
423
|
+
requestId?: string;
|
|
424
|
+
timeout?: number;
|
|
425
|
+
}
|
|
426
|
+
export interface DaemonPairingOfferOptions {
|
|
427
|
+
requestId?: string;
|
|
428
|
+
timeout?: number;
|
|
429
|
+
}
|
|
430
|
+
type DaemonUpdateResponse = z.infer<typeof DaemonUpdateResponseSchema>;
|
|
431
|
+
export type DaemonRuntimeHandoffRestartResult = z.infer<typeof DaemonRuntimeHandoffRestartResponseSchema>["payload"];
|
|
432
|
+
type FetchAgentsPayload = Extract<SessionOutboundMessage, {
|
|
433
|
+
type: "fetch_agents_response";
|
|
434
|
+
}>["payload"];
|
|
435
|
+
type FetchAgentsRequest = Extract<SessionInboundMessage, {
|
|
436
|
+
type: "fetch_agents_request";
|
|
437
|
+
}>;
|
|
438
|
+
export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
|
|
439
|
+
signal?: AbortSignal;
|
|
440
|
+
requestId?: string;
|
|
441
|
+
timeout?: number;
|
|
442
|
+
};
|
|
443
|
+
export type FetchAgentsEntry = FetchAgentsPayload["entries"][number];
|
|
444
|
+
export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"];
|
|
445
|
+
type FetchAgentHistoryPayload = Extract<SessionOutboundMessage, {
|
|
446
|
+
type: "fetch_agent_history_response";
|
|
447
|
+
}>["payload"];
|
|
448
|
+
type FetchAgentHistoryRequest = Extract<SessionInboundMessage, {
|
|
449
|
+
type: "fetch_agent_history_request";
|
|
450
|
+
}>;
|
|
451
|
+
export type FetchAgentHistoryOptions = Omit<FetchAgentHistoryRequest, "type" | "requestId"> & {
|
|
452
|
+
requestId?: string;
|
|
453
|
+
};
|
|
454
|
+
export type FetchAgentHistoryEntry = FetchAgentHistoryPayload["entries"][number];
|
|
455
|
+
export type FetchAgentHistoryPageInfo = FetchAgentHistoryPayload["pageInfo"];
|
|
456
|
+
type FetchRecentProviderSessionsPayload = Extract<SessionOutboundMessage, {
|
|
457
|
+
type: "fetch_recent_provider_sessions_response";
|
|
458
|
+
}>["payload"];
|
|
459
|
+
type FetchRecentProviderSessionsRequest = Extract<SessionInboundMessage, {
|
|
460
|
+
type: "fetch_recent_provider_sessions_request";
|
|
461
|
+
}>;
|
|
462
|
+
export type FetchRecentProviderSessionsOptions = Omit<FetchRecentProviderSessionsRequest, "type" | "requestId"> & {
|
|
463
|
+
requestId?: string;
|
|
464
|
+
};
|
|
465
|
+
export type FetchRecentProviderSessionEntry = FetchRecentProviderSessionsPayload["entries"][number];
|
|
466
|
+
type FetchWorkspacesPayload = Extract<SessionOutboundMessage, {
|
|
467
|
+
type: "fetch_workspaces_response";
|
|
468
|
+
}>["payload"];
|
|
469
|
+
type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
|
|
470
|
+
type: "fetch_workspaces_request";
|
|
471
|
+
}>;
|
|
472
|
+
export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
requestId?: string;
|
|
475
|
+
};
|
|
476
|
+
export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
|
|
477
|
+
export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
|
|
478
|
+
export type WorkspaceLabelListPayload = Extract<SessionOutboundMessage, {
|
|
479
|
+
type: "workspace.label.list.response";
|
|
480
|
+
}>["payload"];
|
|
481
|
+
export type WorkspaceLabelAssignmentPayload = Extract<SessionOutboundMessage, {
|
|
482
|
+
type: "workspace.label.assignment.set.response";
|
|
483
|
+
}>["payload"];
|
|
484
|
+
export type WorkspaceLabelUpdatePayload = Extract<SessionOutboundMessage, {
|
|
485
|
+
type: "workspace.label.update.response";
|
|
486
|
+
}>["payload"];
|
|
487
|
+
export type WorkspaceLabelDeletePayload = Extract<SessionOutboundMessage, {
|
|
488
|
+
type: "workspace.label.delete.response";
|
|
489
|
+
}>["payload"];
|
|
490
|
+
export type WorkspaceLabelDeleteInspectPayload = Extract<SessionOutboundMessage, {
|
|
491
|
+
type: "workspace.label.delete.inspect.response";
|
|
492
|
+
}>["payload"];
|
|
493
|
+
export type ProjectListPayload = Extract<SessionOutboundMessage, {
|
|
494
|
+
type: "project.list.response";
|
|
495
|
+
}>["payload"];
|
|
496
|
+
type ProjectListRequest = Extract<SessionInboundMessage, {
|
|
497
|
+
type: "project.list.request";
|
|
498
|
+
}>;
|
|
499
|
+
export type ProjectListOptions = Omit<ProjectListRequest, "type" | "requestId"> & {
|
|
500
|
+
requestId?: string;
|
|
501
|
+
};
|
|
502
|
+
export interface CreateScheduleOptions {
|
|
503
|
+
prompt: string;
|
|
504
|
+
name?: string | null;
|
|
505
|
+
cadence: {
|
|
506
|
+
type: "cron";
|
|
507
|
+
expression: string;
|
|
508
|
+
timezone?: string;
|
|
509
|
+
};
|
|
510
|
+
target: {
|
|
511
|
+
type: "self";
|
|
512
|
+
agentId: string;
|
|
513
|
+
} | {
|
|
514
|
+
type: "agent";
|
|
515
|
+
agentId: string;
|
|
516
|
+
} | {
|
|
517
|
+
type: "new-agent";
|
|
518
|
+
config: {
|
|
519
|
+
provider: AgentProvider;
|
|
520
|
+
cwd: string;
|
|
521
|
+
modeId?: string;
|
|
522
|
+
model?: string;
|
|
523
|
+
thinkingOptionId?: string;
|
|
524
|
+
archiveOnFinish?: boolean;
|
|
525
|
+
isolation?: "local" | "worktree";
|
|
526
|
+
title?: string | null;
|
|
527
|
+
providerOptions?: AgentSessionConfig["providerOptions"];
|
|
528
|
+
systemPrompt?: string;
|
|
529
|
+
mcpServers?: AgentSessionConfig["mcpServers"];
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
maxRuns?: number;
|
|
533
|
+
expiresAt?: string;
|
|
534
|
+
runOnCreate?: boolean;
|
|
535
|
+
requestId?: string;
|
|
536
|
+
}
|
|
537
|
+
export interface InspectScheduleOptions {
|
|
538
|
+
id: string;
|
|
539
|
+
requestId?: string;
|
|
540
|
+
}
|
|
541
|
+
export interface ScheduleRunOnceOptions extends InspectScheduleOptions {
|
|
542
|
+
runId?: string;
|
|
543
|
+
}
|
|
544
|
+
export interface UpdateScheduleNewAgentConfig {
|
|
545
|
+
provider?: string;
|
|
546
|
+
model?: string | null;
|
|
547
|
+
modeId?: string | null;
|
|
548
|
+
thinkingOptionId?: string | null;
|
|
549
|
+
archiveOnFinish?: boolean;
|
|
550
|
+
isolation?: "local" | "worktree";
|
|
551
|
+
cwd?: string;
|
|
552
|
+
}
|
|
553
|
+
export interface UpdateScheduleOptions {
|
|
554
|
+
id: string;
|
|
555
|
+
name?: string | null;
|
|
556
|
+
prompt?: string;
|
|
557
|
+
cadence?: {
|
|
558
|
+
type: "cron";
|
|
559
|
+
expression: string;
|
|
560
|
+
timezone?: string;
|
|
561
|
+
};
|
|
562
|
+
newAgentConfig?: UpdateScheduleNewAgentConfig;
|
|
563
|
+
maxRuns?: number | null;
|
|
564
|
+
expiresAt?: string | null;
|
|
565
|
+
requestId?: string;
|
|
566
|
+
}
|
|
567
|
+
export interface RenameBranchInput {
|
|
568
|
+
cwd: string;
|
|
569
|
+
branch: string;
|
|
570
|
+
requestId?: string;
|
|
571
|
+
}
|
|
572
|
+
export interface RenameTerminalInput {
|
|
573
|
+
terminalId: string;
|
|
574
|
+
title: string;
|
|
575
|
+
requestId?: string;
|
|
576
|
+
}
|
|
577
|
+
type OpenProjectPayload = OpenProjectResponseMessage["payload"];
|
|
578
|
+
type ProjectAddPayload = ProjectAddResponse["payload"];
|
|
579
|
+
export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"];
|
|
580
|
+
export type WorkspaceGithubSearchRepositoriesPayload = WorkspaceGithubSearchRepositoriesResponse["payload"];
|
|
581
|
+
type ProjectGithubClonePayload = ProjectGithubCloneResponse["payload"];
|
|
582
|
+
type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
|
|
583
|
+
type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
|
|
584
|
+
export interface FetchAgentResult {
|
|
585
|
+
agent: AgentSnapshotPayload;
|
|
586
|
+
project: ProjectPlacementPayload | null;
|
|
587
|
+
}
|
|
588
|
+
export interface WaitForFinishResult {
|
|
589
|
+
status: "idle" | "error" | "permission" | "timeout";
|
|
590
|
+
final: AgentSnapshotPayload | null;
|
|
591
|
+
error: string | null;
|
|
592
|
+
lastMessage: string | null;
|
|
593
|
+
}
|
|
594
|
+
type GetDaemonConfigResponse = Extract<SessionOutboundMessage, {
|
|
595
|
+
type: "get_daemon_config_response";
|
|
596
|
+
}>;
|
|
597
|
+
type SetDaemonConfigResponse = Extract<SessionOutboundMessage, {
|
|
598
|
+
type: "set_daemon_config_response";
|
|
599
|
+
}>;
|
|
600
|
+
type CorrelatedResponseMessage = Extract<SessionOutboundMessage, {
|
|
601
|
+
payload: {
|
|
602
|
+
requestId: string;
|
|
603
|
+
};
|
|
604
|
+
}> | Extract<SessionOutboundMessage, {
|
|
605
|
+
type: "terminals_changed";
|
|
606
|
+
}> | GetDaemonConfigResponse | SetDaemonConfigResponse;
|
|
607
|
+
type CorrelatedResponseType = CorrelatedResponseMessage["type"];
|
|
608
|
+
type CorrelatedResponsePayloads = {
|
|
609
|
+
[Message in CorrelatedResponseMessage as Message["type"]]: Message["payload"];
|
|
610
|
+
};
|
|
611
|
+
type CorrelatedResponsePayload<TType extends CorrelatedResponseType> = CorrelatedResponsePayloads[TType];
|
|
612
|
+
export declare class AgentMessageRejectedError extends Error {
|
|
613
|
+
readonly messageId: string;
|
|
614
|
+
constructor(messageId: string, message: string);
|
|
615
|
+
}
|
|
616
|
+
export declare class AgentMessageDeliveryUnknownError extends Error {
|
|
617
|
+
readonly messageId: string;
|
|
618
|
+
readonly canRetry: boolean;
|
|
619
|
+
constructor(messageId: string, canRetry: boolean, cause: unknown);
|
|
620
|
+
}
|
|
621
|
+
export declare class DaemonConnectionError extends Error {
|
|
622
|
+
readonly code: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT";
|
|
623
|
+
readonly serverId?: string;
|
|
624
|
+
/** "unknown" when the request reached the transport before the connection was lost. */
|
|
625
|
+
readonly outcome?: "unknown";
|
|
626
|
+
constructor(message: string, code?: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT", context?: {
|
|
627
|
+
serverId?: string;
|
|
628
|
+
outcome?: "unknown";
|
|
629
|
+
cause?: Error;
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
export declare class ScheduleRunOnceConnectionError extends DaemonConnectionError {
|
|
633
|
+
readonly runId: string;
|
|
634
|
+
constructor(runId: string, cause: unknown);
|
|
635
|
+
}
|
|
636
|
+
export declare class ScheduleRunOnceUnsupportedError extends Error {
|
|
637
|
+
readonly runId: string;
|
|
638
|
+
readonly code = "HOST_UPDATE_REQUIRED";
|
|
639
|
+
constructor(runId: string);
|
|
640
|
+
}
|
|
641
|
+
export declare function supportsUsageReports(features: ServerInfoStatusPayload["features"]): boolean;
|
|
642
|
+
export declare class DaemonClient {
|
|
643
|
+
private config;
|
|
644
|
+
private readonly providerSnapshotUpdates;
|
|
645
|
+
private readonly owned;
|
|
646
|
+
private transport;
|
|
647
|
+
private chunkedTransport;
|
|
648
|
+
private helloAuth;
|
|
649
|
+
private transportCleanup;
|
|
650
|
+
private rawMessageListeners;
|
|
651
|
+
private messageHandlers;
|
|
652
|
+
private eventListeners;
|
|
653
|
+
private waiters;
|
|
654
|
+
private checkoutStatusInFlight;
|
|
655
|
+
private connectionListeners;
|
|
656
|
+
private reconnectTimeout;
|
|
657
|
+
private connectTimeout;
|
|
658
|
+
private pendingGenericTransportErrorTimeout;
|
|
659
|
+
private reconnectAttempt;
|
|
660
|
+
private shouldReconnect;
|
|
661
|
+
private connectPromise;
|
|
662
|
+
private connectResolve;
|
|
663
|
+
private connectReject;
|
|
664
|
+
private lastErrorValue;
|
|
665
|
+
private destinationServerId;
|
|
666
|
+
private connectionFailure;
|
|
667
|
+
private authFailureReasonValue;
|
|
668
|
+
private connectionState;
|
|
669
|
+
private readonly terminalStreams;
|
|
670
|
+
private pendingBinaryFileReads;
|
|
671
|
+
private activeBinaryFileTransfers;
|
|
672
|
+
private completedBinaryFileReads;
|
|
673
|
+
private logger;
|
|
674
|
+
private pendingSendQueue;
|
|
675
|
+
private readonly logConnectionPath;
|
|
676
|
+
private readonly logServerId;
|
|
677
|
+
private readonly logClientIdHash;
|
|
678
|
+
private readonly logGeneration;
|
|
679
|
+
private lastServerInfoMessage;
|
|
680
|
+
private runtimeMetricsInterval;
|
|
681
|
+
private runtimeMetrics;
|
|
682
|
+
private pingProbe;
|
|
683
|
+
private connectionVerification;
|
|
684
|
+
private livenessHeartbeatTimer;
|
|
685
|
+
private lastLivenessRttMs;
|
|
686
|
+
private lastHeartbeatAt;
|
|
687
|
+
private consecutiveLivenessFailures;
|
|
688
|
+
private inboundProgress;
|
|
689
|
+
constructor(config: DaemonClientConfig);
|
|
690
|
+
connect(): Promise<void>;
|
|
691
|
+
private attemptConnect;
|
|
692
|
+
private assertEncryptedRelayAuth;
|
|
693
|
+
private resolveConnect;
|
|
694
|
+
private rejectConnect;
|
|
695
|
+
close(): Promise<void>;
|
|
696
|
+
ensureConnected(options?: {
|
|
697
|
+
verify?: boolean;
|
|
698
|
+
}): void;
|
|
699
|
+
private verifyConnection;
|
|
700
|
+
getConnectionState(): ConnectionState;
|
|
701
|
+
subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void;
|
|
702
|
+
get isConnected(): boolean;
|
|
703
|
+
/** Drain capability inherited by transports routed through this connection. */
|
|
704
|
+
get supportsDrain(): boolean;
|
|
705
|
+
get isConnecting(): boolean;
|
|
706
|
+
get lastError(): string | null;
|
|
707
|
+
get authFailureReason(): DaemonAuthFailureReason | null;
|
|
708
|
+
getLastLivenessRttMs(): number | null;
|
|
709
|
+
requireConnectedHosts(): void;
|
|
710
|
+
supportsDaemonPassword(): boolean;
|
|
711
|
+
private requireDaemonPassword;
|
|
712
|
+
getDaemonAuthStatus(): Promise<DaemonAuthStatus>;
|
|
713
|
+
/**
|
|
714
|
+
* Sets (or clears, with null) the host password. This session stays connected; the other
|
|
715
|
+
* sessions in keepSessionIds receive device credentials and every remaining session that
|
|
716
|
+
* did not authenticate with the new password is disconnected.
|
|
717
|
+
*/
|
|
718
|
+
setDaemonPassword(password: string | null, keepSessionIds?: string[]): Promise<{
|
|
719
|
+
status: DaemonAuthStatus;
|
|
720
|
+
disconnected: number;
|
|
721
|
+
}>;
|
|
722
|
+
revokeDeviceCredential(credentialId: string): Promise<DaemonAuthStatus>;
|
|
723
|
+
supportsDaemonAuthSessions(): boolean;
|
|
724
|
+
private requireDaemonAuthSessions;
|
|
725
|
+
/** Closes another session. The host refuses the caller, the local desktop, fleet peers and services. */
|
|
726
|
+
disconnectDaemonAuthSession(sessionId: string): Promise<DaemonAuthStatus>;
|
|
727
|
+
/** Observes the auth status; the host pushes it again as sessions connect and disconnect. */
|
|
728
|
+
observeDaemonAuthStatus(onStatus: (status: DaemonAuthStatus) => void): OwnedSubscription<{
|
|
729
|
+
status: DaemonAuthStatus;
|
|
730
|
+
}>;
|
|
731
|
+
/**
|
|
732
|
+
* Offers to store a device credential, which makes this session keepable when the owner
|
|
733
|
+
* changes the password. A received credential is used for later connections at once.
|
|
734
|
+
*/
|
|
735
|
+
keepSignedIn(onCredential: (credential: {
|
|
736
|
+
credentialId: string;
|
|
737
|
+
credential: string;
|
|
738
|
+
}) => void): OwnedSubscription<Record<string, never>>;
|
|
739
|
+
supportsFleet(): boolean;
|
|
740
|
+
private requireFleet;
|
|
741
|
+
getFleetStatus(): Promise<FleetStatus>;
|
|
742
|
+
/** Issues (or rotates) the scoped credential this host accepts from one named peer. */
|
|
743
|
+
issueFleetCredential(input: {
|
|
744
|
+
fleetId: string;
|
|
745
|
+
peerServerId: string;
|
|
746
|
+
peerLabel?: string;
|
|
747
|
+
}): Promise<FleetCredential>;
|
|
748
|
+
joinFleet(input: {
|
|
749
|
+
fleetId: string;
|
|
750
|
+
members: FleetJoinMember[];
|
|
751
|
+
}): Promise<FleetStatus>;
|
|
752
|
+
leaveFleet(): Promise<FleetStatus>;
|
|
753
|
+
removeFleetMember(serverId: string): Promise<FleetStatus>;
|
|
754
|
+
setFleetDispatch(enabled: boolean): Promise<FleetStatus>;
|
|
755
|
+
listFleetProjects(): Promise<{
|
|
756
|
+
acceptsDispatch: boolean;
|
|
757
|
+
projects: FleetProject[];
|
|
758
|
+
}>;
|
|
759
|
+
/** Resolves a project on this host to a workspace a dispatched agent can run in. */
|
|
760
|
+
resolveFleetWorkspace(target: {
|
|
761
|
+
projectKey: string;
|
|
762
|
+
} | {
|
|
763
|
+
workspaceId: string;
|
|
764
|
+
}): Promise<{
|
|
765
|
+
workspaceId: string;
|
|
766
|
+
cwd: string;
|
|
767
|
+
}>;
|
|
768
|
+
openHostRoute(serverId: string, scopeId: string): Promise<string>;
|
|
769
|
+
/** Opens a logical channel on a destination daemon over this authenticated link. */
|
|
770
|
+
openHostLink(channelId: string): Promise<string>;
|
|
771
|
+
acknowledgeHostLink(routeId: string, sequence: number): Promise<void>;
|
|
772
|
+
sendHostFrame(routeId: string, data: string | Uint8Array): Promise<void>;
|
|
773
|
+
private readonly hostFrameListeners;
|
|
774
|
+
subscribeHostFrames(handler: (frame: HostRouteFrame) => void): () => void;
|
|
775
|
+
cancelHostRoute(scopeId: string): void;
|
|
776
|
+
closeHostRoute(routeId: string): void;
|
|
777
|
+
subscribe(handler: DaemonEventHandler): () => void;
|
|
778
|
+
subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void;
|
|
779
|
+
on<TType extends SessionOutboundMessage["type"]>(type: TType, handler: (message: Extract<SessionOutboundMessage, {
|
|
780
|
+
type: TType;
|
|
781
|
+
}>) => void): () => void;
|
|
782
|
+
on(handler: DaemonEventHandler): () => void;
|
|
783
|
+
onAgentAttentionRequired(handler: (notification: AgentAttentionRequiredNotification) => void): () => void;
|
|
784
|
+
private beginTraceSection;
|
|
785
|
+
private endTraceSection;
|
|
786
|
+
private traceInstant;
|
|
787
|
+
private sendJsonMessage;
|
|
788
|
+
/** Marks waiters whose request reached the transport, so a lost connection reports an unknown outcome. */
|
|
789
|
+
private sendSessionPayload;
|
|
790
|
+
private sendTransportFrame;
|
|
791
|
+
/**
|
|
792
|
+
* Send a session message. For fire-and-forget messages (heartbeats, etc.),
|
|
793
|
+
* failures are suppressed if `suppressSendErrors` is configured.
|
|
794
|
+
* For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead.
|
|
795
|
+
*/
|
|
796
|
+
private sendSessionMessage;
|
|
797
|
+
private sendBinaryFrame;
|
|
798
|
+
/**
|
|
799
|
+
* Send a session message for RPC methods that create waiters.
|
|
800
|
+
* If the connection is still being established ("connecting"), the message
|
|
801
|
+
* is queued and will be sent once connected (or rejected after timeout).
|
|
802
|
+
* This prevents waiters from hanging forever when called during connection.
|
|
803
|
+
*/
|
|
804
|
+
private sendSessionMessageOrThrow;
|
|
805
|
+
/** Resolves once connected, waiting out a connection that is still being established. */
|
|
806
|
+
private whenConnected;
|
|
807
|
+
private sendWhenConnected;
|
|
808
|
+
/**
|
|
809
|
+
* Flush pending send queue - called when connection is established.
|
|
810
|
+
*/
|
|
811
|
+
private flushPendingSendQueue;
|
|
812
|
+
/**
|
|
813
|
+
* Reject all pending sends - called when connection fails or is closed.
|
|
814
|
+
*/
|
|
815
|
+
private rejectPendingSendQueue;
|
|
816
|
+
private sendRequest;
|
|
817
|
+
private sendCorrelatedRequest;
|
|
818
|
+
private sendCorrelatedSessionRequest;
|
|
819
|
+
private sendNamespacedCorrelatedSessionRequest;
|
|
820
|
+
private unavailableError;
|
|
821
|
+
private sendSessionMessageStrict;
|
|
822
|
+
clearAgentAttention(agentId: string | string[]): Promise<void>;
|
|
823
|
+
clearWorkspaceAttention(workspaceId: string | string[]): Promise<void>;
|
|
824
|
+
markWorkspaceUnread(workspaceId: string, requestId?: string): Promise<void>;
|
|
825
|
+
sendHeartbeat(params: {
|
|
826
|
+
deviceType: "web" | "mobile";
|
|
827
|
+
focusedAgentId: string | null;
|
|
828
|
+
focusedTerminalId?: string | null;
|
|
829
|
+
lastActivityAt: string;
|
|
830
|
+
appVisible: boolean;
|
|
831
|
+
appVisibilityChangedAt?: string;
|
|
832
|
+
}): void;
|
|
833
|
+
registerPushToken(token: string): void;
|
|
834
|
+
unregisterPushToken(token: string): Promise<void>;
|
|
835
|
+
ping(params?: {
|
|
836
|
+
requestId?: string;
|
|
837
|
+
timeoutMs?: number;
|
|
838
|
+
}): Promise<{
|
|
839
|
+
requestId: string;
|
|
840
|
+
clientSentAt: number;
|
|
841
|
+
serverReceivedAt: number;
|
|
842
|
+
serverSentAt: number;
|
|
843
|
+
rttMs: number;
|
|
844
|
+
}>;
|
|
845
|
+
measureLatency(params?: {
|
|
846
|
+
timeoutMs?: number;
|
|
847
|
+
}): Promise<number>;
|
|
848
|
+
private livenessPing;
|
|
849
|
+
private sendPingAwaitRtt;
|
|
850
|
+
private startLivenessHeartbeat;
|
|
851
|
+
private stopLivenessHeartbeat;
|
|
852
|
+
private scheduleNextLivenessHeartbeat;
|
|
853
|
+
private observe;
|
|
854
|
+
registerBrowserHost(registration: Omit<Extract<SessionInboundMessage, {
|
|
855
|
+
type: "browser.host.register.request";
|
|
856
|
+
}>, "type" | "requestId">, options?: {
|
|
857
|
+
signal?: AbortSignal;
|
|
858
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"browser.host.register.response">>;
|
|
859
|
+
observeEvents(events: SessionEventSubscription[], options?: {
|
|
860
|
+
signal?: AbortSignal;
|
|
861
|
+
notifications?: boolean;
|
|
862
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"session.events.set_subscription.response">>;
|
|
863
|
+
observeAgents(options?: Omit<FetchAgentsOptions, "subscribe">): OwnedSubscription<FetchAgentsPayload>;
|
|
864
|
+
observeWorkspaces(options?: Omit<FetchWorkspacesOptions, "subscribe">): OwnedSubscription<FetchWorkspacesPayload>;
|
|
865
|
+
fetchAgents(options: FetchAgentsOptions & {
|
|
866
|
+
subscribe: {};
|
|
867
|
+
}): Promise<FetchAgentsPayload & {
|
|
868
|
+
subscription: OwnedSubscription<FetchAgentsPayload>;
|
|
869
|
+
}>;
|
|
870
|
+
fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
|
|
871
|
+
fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
|
|
872
|
+
fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
|
|
873
|
+
fetchWorkspaces(options: FetchWorkspacesOptions & {
|
|
874
|
+
subscribe: {};
|
|
875
|
+
}): Promise<FetchWorkspacesPayload & {
|
|
876
|
+
subscription: OwnedSubscription<FetchWorkspacesPayload>;
|
|
877
|
+
}>;
|
|
878
|
+
fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
|
|
879
|
+
listWorkspaceLabels(options?: {
|
|
880
|
+
sync?: {
|
|
881
|
+
generation: string;
|
|
882
|
+
afterSeq: number;
|
|
883
|
+
};
|
|
884
|
+
requestId?: string;
|
|
885
|
+
}): Promise<WorkspaceLabelListPayload>;
|
|
886
|
+
observeWorkspaceLabels(options?: {
|
|
887
|
+
signal?: AbortSignal;
|
|
888
|
+
}): OwnedSubscription<WorkspaceLabelListPayload>;
|
|
889
|
+
setWorkspaceLabel(options: {
|
|
890
|
+
workspaceId: string;
|
|
891
|
+
label: Extract<SessionInboundMessage, {
|
|
892
|
+
type: "workspace.label.assignment.set.request";
|
|
893
|
+
}>["label"];
|
|
894
|
+
assigned: boolean;
|
|
895
|
+
requestId?: string;
|
|
896
|
+
}): Promise<WorkspaceLabelAssignmentPayload>;
|
|
897
|
+
updateWorkspaceLabel(options: {
|
|
898
|
+
name: string;
|
|
899
|
+
newName?: string;
|
|
900
|
+
color?: Extract<SessionInboundMessage, {
|
|
901
|
+
type: "workspace.label.update.request";
|
|
902
|
+
}>["color"];
|
|
903
|
+
requestId?: string;
|
|
904
|
+
}): Promise<WorkspaceLabelUpdatePayload>;
|
|
905
|
+
deleteWorkspaceLabel(options: {
|
|
906
|
+
name: string;
|
|
907
|
+
requestId?: string;
|
|
908
|
+
}): Promise<WorkspaceLabelDeletePayload>;
|
|
909
|
+
inspectWorkspaceLabelDelete(options: {
|
|
910
|
+
name: string;
|
|
911
|
+
requestId?: string;
|
|
912
|
+
}): Promise<WorkspaceLabelDeleteInspectPayload>;
|
|
913
|
+
listProjects(options?: string | ProjectListOptions): Promise<ProjectListPayload>;
|
|
914
|
+
openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
|
|
915
|
+
addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
|
|
916
|
+
createProjectDirectory(input: {
|
|
917
|
+
parentPath: string;
|
|
918
|
+
name: string;
|
|
919
|
+
}, requestId?: string): Promise<ProjectCreateDirectoryPayload>;
|
|
920
|
+
searchGithubRepositories(input: {
|
|
921
|
+
query: string;
|
|
922
|
+
limit?: number;
|
|
923
|
+
}, requestId?: string): Promise<WorkspaceGithubSearchRepositoriesPayload>;
|
|
924
|
+
cloneGithubProject(input: {
|
|
925
|
+
repo: string;
|
|
926
|
+
targetDirectory: string;
|
|
927
|
+
cloneProtocol?: ProjectGithubCloneProtocol;
|
|
928
|
+
}, requestId?: string): Promise<ProjectGithubClonePayload>;
|
|
929
|
+
startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
930
|
+
type: "start_workspace_script_response";
|
|
931
|
+
}>["payload"]>;
|
|
932
|
+
listWorkspaceScripts(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
933
|
+
type: "workspace.script.list.response";
|
|
934
|
+
}>["payload"]>;
|
|
935
|
+
startWorkspaceScriptWithStatus(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
936
|
+
type: "workspace.script.start.response";
|
|
937
|
+
}>["payload"]>;
|
|
938
|
+
stopWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
939
|
+
type: "workspace.script.stop.response";
|
|
940
|
+
}>["payload"]>;
|
|
941
|
+
archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
|
|
942
|
+
observeWorkspaceSetup(workspaceId: string, options?: {
|
|
943
|
+
signal?: AbortSignal;
|
|
944
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"workspace.setup.subscribe.response">>;
|
|
945
|
+
private requireWorkspaceSetupObservation;
|
|
946
|
+
fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
|
|
947
|
+
runWorkspaceSetup(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
948
|
+
type: "workspace.setup.run.response";
|
|
949
|
+
}>["payload"]>;
|
|
950
|
+
fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
951
|
+
fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
|
|
952
|
+
fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
953
|
+
private readonly creations;
|
|
954
|
+
private requireBackgroundWorkspaces;
|
|
955
|
+
supportsBackgroundWorkspaces(): boolean;
|
|
956
|
+
/** Pages the workspace list, including background workspaces, until the ID is found. */
|
|
957
|
+
findWorkspace(workspaceId: string): Promise<FetchWorkspacesEntry | null>;
|
|
958
|
+
createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
|
|
959
|
+
private createLegacyAgent;
|
|
960
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
961
|
+
archiveAgent(agentId: string): Promise<{
|
|
962
|
+
archivedAt: string;
|
|
963
|
+
}>;
|
|
964
|
+
detachAgent(agentId: string): Promise<void>;
|
|
965
|
+
updateAgent(agentId: string, updates: {
|
|
966
|
+
name?: string;
|
|
967
|
+
labels?: Record<string, string>;
|
|
968
|
+
}): Promise<void>;
|
|
969
|
+
renameProject(projectId: string, customName: string | null, requestId?: string): Promise<{
|
|
970
|
+
customName: string | null;
|
|
971
|
+
}>;
|
|
972
|
+
setProjectIcon(projectId: string, source: ProjectIconSource, requestId?: string): Promise<void>;
|
|
973
|
+
removeProject(projectId: string, requestId?: string): Promise<{
|
|
974
|
+
removedWorkspaceIds: string[];
|
|
975
|
+
}>;
|
|
976
|
+
mergeWorkspaceProject(input: WorkspaceProjectMergeInput): Promise<WorkspaceProjectMergeResult>;
|
|
977
|
+
setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
|
|
978
|
+
title: string | null;
|
|
979
|
+
}>;
|
|
980
|
+
setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{
|
|
981
|
+
pinnedAt: string | null;
|
|
982
|
+
}>;
|
|
983
|
+
inspectWorkspaceRecovery(workspaceId: string, requestId?: string): Promise<WorkspaceRecoveryState>;
|
|
984
|
+
restoreWorkspace(workspaceId: string, requestId?: string): Promise<void>;
|
|
985
|
+
resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
|
|
986
|
+
importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
|
|
987
|
+
refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
|
|
988
|
+
fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
|
|
989
|
+
appendAgentTimelineItem(agentId: string, item: Omit<import("@getmateo/protocol/agent-types").PluginTimelineItem, "pluginId">): Promise<{
|
|
990
|
+
seq: number;
|
|
991
|
+
epoch: string;
|
|
992
|
+
}>;
|
|
993
|
+
searchConversations(input: {
|
|
994
|
+
query: string;
|
|
995
|
+
cursor?: string;
|
|
996
|
+
signal?: AbortSignal;
|
|
997
|
+
}): Promise<{
|
|
998
|
+
requestId: string;
|
|
999
|
+
matches: ({
|
|
1000
|
+
kind: "registered";
|
|
1001
|
+
provider: string;
|
|
1002
|
+
agentId: string;
|
|
1003
|
+
workspaceId: string | null;
|
|
1004
|
+
title: string | null;
|
|
1005
|
+
updatedAt: string;
|
|
1006
|
+
archived: boolean;
|
|
1007
|
+
role: "assistant" | "user";
|
|
1008
|
+
snippet: string;
|
|
1009
|
+
} | {
|
|
1010
|
+
kind: "external";
|
|
1011
|
+
provider: string;
|
|
1012
|
+
sessionId: string;
|
|
1013
|
+
cwd: string;
|
|
1014
|
+
title: string | null;
|
|
1015
|
+
updatedAt: string;
|
|
1016
|
+
role: "assistant" | "user";
|
|
1017
|
+
snippet: string;
|
|
1018
|
+
})[];
|
|
1019
|
+
nextCursor: string | null;
|
|
1020
|
+
partial: boolean;
|
|
1021
|
+
}>;
|
|
1022
|
+
searchAgentTimeline({ agentId, query, cursor, }: AgentTimelineSearchOptions): Promise<AgentTimelineSearchPayload>;
|
|
1023
|
+
listAgentTimelinePrompts(agentId: string, options?: {
|
|
1024
|
+
requestId?: string;
|
|
1025
|
+
timeout?: number;
|
|
1026
|
+
}): Promise<AgentTimelinePromptIndexPayload>;
|
|
1027
|
+
listAgentShells(input: {
|
|
1028
|
+
agentId: string;
|
|
1029
|
+
outputShellId?: string;
|
|
1030
|
+
}): Promise<AgentShellsListPayload>;
|
|
1031
|
+
stopAgentShell(input: {
|
|
1032
|
+
agentId: string;
|
|
1033
|
+
shellId: string;
|
|
1034
|
+
}): Promise<AgentShellsStopPayload>;
|
|
1035
|
+
listProviderSubagents(parentAgentId: string, options?: {
|
|
1036
|
+
requestId?: string;
|
|
1037
|
+
timeout?: number;
|
|
1038
|
+
}): Promise<ProviderSubagentListPayload>;
|
|
1039
|
+
fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise<ProviderSubagentTimelinePayload>;
|
|
1040
|
+
observeTimeline(agentIds: string[], options?: {
|
|
1041
|
+
signal?: AbortSignal;
|
|
1042
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"agent.timeline.set_subscription.response">>;
|
|
1043
|
+
subscribeAgentTimeline(agentId: string, handler: (message: TimelineMessage) => void): TimelineSubscription;
|
|
1044
|
+
buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
|
|
1045
|
+
private assertAgentProvenanceSupported;
|
|
1046
|
+
sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<{
|
|
1047
|
+
deliveryStatus?: "queued";
|
|
1048
|
+
}>;
|
|
1049
|
+
sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<{
|
|
1050
|
+
deliveryStatus?: "queued";
|
|
1051
|
+
}>;
|
|
1052
|
+
rewindAgent(agentId: string, messageId: string, mode: "conversation" | "files" | "both"): Promise<AgentRewindResponseMessage["payload"]>;
|
|
1053
|
+
cancelAgent(agentId: string): Promise<void>;
|
|
1054
|
+
setAgentMode(agentId: string, modeId: string): Promise<AgentProviderNotice | null>;
|
|
1055
|
+
setAgentModel(agentId: string, modelId: string | null): Promise<void>;
|
|
1056
|
+
setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
|
|
1057
|
+
setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<AgentProviderNotice | null>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Applies a whole agent-config bundle in one request. Use this instead of
|
|
1060
|
+
* chaining the single-field setters when the values belong together so client
|
|
1061
|
+
* interruption and other mutations cannot interleave between steps. A
|
|
1062
|
+
* provider rejection can still leave earlier steps applied.
|
|
1063
|
+
* Gated on `server_info.features.agentConfigApply`.
|
|
1064
|
+
*/
|
|
1065
|
+
applyAgentConfig(agentId: string, config: AgentConfigApply): Promise<AgentProviderNotice | null>;
|
|
1066
|
+
restartServer(reason?: string, requestId?: string, options?: {
|
|
1067
|
+
timeout?: number;
|
|
1068
|
+
}): Promise<RestartRequestedStatusPayload>;
|
|
1069
|
+
shutdownServer(options?: ShutdownServerOptions): Promise<ShutdownRequestedStatusPayload>;
|
|
1070
|
+
requestRuntimeHandoffRestart(options?: {
|
|
1071
|
+
reason?: string;
|
|
1072
|
+
requestId?: string;
|
|
1073
|
+
timeout?: number;
|
|
1074
|
+
}): Promise<DaemonRuntimeHandoffRestartResult>;
|
|
1075
|
+
updateDaemon(requestId?: string): Promise<DaemonUpdateResponse["payload"]>;
|
|
1076
|
+
getCheckoutStatus(cwd: string, options?: {
|
|
1077
|
+
requestId?: string;
|
|
1078
|
+
}): Promise<CheckoutStatusPayload>;
|
|
1079
|
+
private normalizeCheckoutDiffCompare;
|
|
1080
|
+
getCheckoutDiff(cwd: string, compare: {
|
|
1081
|
+
mode: "uncommitted" | "base" | "all";
|
|
1082
|
+
baseRef?: string;
|
|
1083
|
+
ignoreWhitespace?: boolean;
|
|
1084
|
+
}, requestId?: string): Promise<CheckoutDiffPayload>;
|
|
1085
|
+
observeCheckoutDiff(cwd: string, compare: {
|
|
1086
|
+
mode: "uncommitted" | "base" | "all";
|
|
1087
|
+
baseRef?: string;
|
|
1088
|
+
ignoreWhitespace?: boolean;
|
|
1089
|
+
}, options?: {
|
|
1090
|
+
requestId?: string;
|
|
1091
|
+
signal?: AbortSignal;
|
|
1092
|
+
}): OwnedSubscription<SubscribeCheckoutDiffPayload>;
|
|
1093
|
+
checkoutCommit(cwd: string, input: {
|
|
1094
|
+
message?: string;
|
|
1095
|
+
addAll?: boolean;
|
|
1096
|
+
}, requestId?: string): Promise<CheckoutCommitPayload>;
|
|
1097
|
+
checkoutMerge(cwd: string, input: {
|
|
1098
|
+
baseRef?: string;
|
|
1099
|
+
strategy?: "merge" | "squash";
|
|
1100
|
+
requireCleanTarget?: boolean;
|
|
1101
|
+
}, requestId?: string): Promise<CheckoutMergePayload>;
|
|
1102
|
+
checkoutMergeFromBase(cwd: string, input: {
|
|
1103
|
+
baseRef?: string;
|
|
1104
|
+
requireCleanTarget?: boolean;
|
|
1105
|
+
}, requestId?: string): Promise<CheckoutMergeFromBasePayload>;
|
|
1106
|
+
checkoutPull(cwd: string, requestId?: string): Promise<CheckoutPullPayload>;
|
|
1107
|
+
checkoutPush(cwd: string, requestId?: string): Promise<CheckoutPushPayload>;
|
|
1108
|
+
checkoutRefresh(cwd: string, requestId?: string): Promise<CheckoutRefreshPayload>;
|
|
1109
|
+
listCheckoutCommits(cwd: string, requestId?: string): Promise<{
|
|
1110
|
+
baseRef: string | null;
|
|
1111
|
+
commits: CheckoutCommit[];
|
|
1112
|
+
}>;
|
|
1113
|
+
getCommitFileDiff(cwd: string, sha: string, path: string, requestId?: string): Promise<{
|
|
1114
|
+
file: ParsedDiffFile | null;
|
|
1115
|
+
}>;
|
|
1116
|
+
checkoutPrCreate(cwd: string, input: {
|
|
1117
|
+
title?: string;
|
|
1118
|
+
body?: string;
|
|
1119
|
+
baseRef?: string;
|
|
1120
|
+
}, requestId?: string): Promise<CheckoutPrCreatePayload>;
|
|
1121
|
+
checkoutPrMerge(cwd: string, input: {
|
|
1122
|
+
method: CheckoutPrMergeMethod;
|
|
1123
|
+
}, requestId?: string): Promise<CheckoutPrMergePayload>;
|
|
1124
|
+
checkoutForgeSetAutoMerge(cwd: string, input: {
|
|
1125
|
+
enabled: true;
|
|
1126
|
+
method: CheckoutPrMergeMethod;
|
|
1127
|
+
} | {
|
|
1128
|
+
enabled: false;
|
|
1129
|
+
}, requestId?: string): Promise<CheckoutForgeSetAutoMergePayload>;
|
|
1130
|
+
checkoutGithubSetAutoMerge(cwd: string, input: {
|
|
1131
|
+
enabled: true;
|
|
1132
|
+
method: CheckoutPrMergeMethod;
|
|
1133
|
+
} | {
|
|
1134
|
+
enabled: false;
|
|
1135
|
+
}, requestId?: string): Promise<CheckoutGithubSetAutoMergePayload>;
|
|
1136
|
+
checkoutForgeGetCheckDetails(input: {
|
|
1137
|
+
cwd: string;
|
|
1138
|
+
repoOwner?: string;
|
|
1139
|
+
repoName?: string;
|
|
1140
|
+
checkRunId?: number;
|
|
1141
|
+
workflowRunId?: number;
|
|
1142
|
+
changeRequestNumber?: number;
|
|
1143
|
+
}, requestId?: string): Promise<CheckoutForgeGetCheckDetailsPayload>;
|
|
1144
|
+
checkoutGithubGetCheckDetails(input: {
|
|
1145
|
+
cwd: string;
|
|
1146
|
+
repoOwner?: string;
|
|
1147
|
+
repoName?: string;
|
|
1148
|
+
checkRunId?: number;
|
|
1149
|
+
workflowRunId?: number;
|
|
1150
|
+
}, requestId?: string): Promise<CheckoutGithubGetCheckDetailsPayload>;
|
|
1151
|
+
checkoutPrStatus(cwd: string, requestId?: string): Promise<CheckoutPrStatusPayload>;
|
|
1152
|
+
pullRequestTimeline(input: {
|
|
1153
|
+
cwd: string;
|
|
1154
|
+
prNumber: number;
|
|
1155
|
+
repoOwner: string;
|
|
1156
|
+
repoName: string;
|
|
1157
|
+
}, requestId?: string): Promise<PullRequestTimelinePayload>;
|
|
1158
|
+
checkoutSwitchBranch(cwd: string, branch: string, requestId?: string): Promise<CheckoutSwitchBranchPayload>;
|
|
1159
|
+
renameBranch(input: RenameBranchInput): Promise<RenameBranchResult>;
|
|
1160
|
+
stashSave(cwd: string, options?: {
|
|
1161
|
+
branch?: string;
|
|
1162
|
+
}, requestId?: string): Promise<StashSavePayload>;
|
|
1163
|
+
stashPop(cwd: string, stashIndex: number, requestId?: string): Promise<StashPopPayload>;
|
|
1164
|
+
stashList(cwd: string, options?: {
|
|
1165
|
+
mateoOnly?: boolean;
|
|
1166
|
+
}, requestId?: string): Promise<StashListPayload>;
|
|
1167
|
+
getMateoWorktreeList(input: {
|
|
1168
|
+
cwd?: string;
|
|
1169
|
+
repoRoot?: string;
|
|
1170
|
+
}, requestId?: string): Promise<MateoWorktreeListPayload>;
|
|
1171
|
+
archiveMateoWorktree(input: {
|
|
1172
|
+
worktreePath?: string;
|
|
1173
|
+
repoRoot?: string;
|
|
1174
|
+
branchName?: string;
|
|
1175
|
+
workspaceId?: string;
|
|
1176
|
+
scope?: "workspace" | "worktree";
|
|
1177
|
+
}, requestId?: string): Promise<MateoWorktreeArchivePayload>;
|
|
1178
|
+
createMateoWorktree(input: CreateMateoWorktreeInput, requestId?: string): Promise<CreateMateoWorktreePayload>;
|
|
1179
|
+
createWorkspace(input: CreateWorkspaceRequestOptions, requestId?: string): Promise<WorkspaceCreatePayload>;
|
|
1180
|
+
private createLegacyWorkspace;
|
|
1181
|
+
validateBranch(options: {
|
|
1182
|
+
cwd: string;
|
|
1183
|
+
branchName: string;
|
|
1184
|
+
}, requestId?: string): Promise<ValidateBranchPayload>;
|
|
1185
|
+
getBranchSuggestions(options: {
|
|
1186
|
+
cwd: string;
|
|
1187
|
+
query?: string;
|
|
1188
|
+
limit?: number;
|
|
1189
|
+
}, requestId?: string): Promise<BranchSuggestionsPayload>;
|
|
1190
|
+
searchForge(options: {
|
|
1191
|
+
cwd: string;
|
|
1192
|
+
query: string;
|
|
1193
|
+
limit?: number;
|
|
1194
|
+
kinds?: ForgeSearchRequest["kinds"];
|
|
1195
|
+
}, requestId?: string): Promise<ForgeSearchPayload>;
|
|
1196
|
+
searchGitHub(options: {
|
|
1197
|
+
cwd: string;
|
|
1198
|
+
query: string;
|
|
1199
|
+
limit?: number;
|
|
1200
|
+
kinds?: GitHubSearchRequest["kinds"];
|
|
1201
|
+
}, requestId?: string): Promise<GitHubSearchPayload>;
|
|
1202
|
+
getDirectorySuggestions(options: {
|
|
1203
|
+
query: string;
|
|
1204
|
+
limit?: number;
|
|
1205
|
+
cwd?: string;
|
|
1206
|
+
includeFiles?: boolean;
|
|
1207
|
+
includeDirectories?: boolean;
|
|
1208
|
+
matchMode?: "fuzzy" | "suffix";
|
|
1209
|
+
}, requestId?: string): Promise<DirectorySuggestionsPayload>;
|
|
1210
|
+
private requestFileExplorer;
|
|
1211
|
+
listDirectory(cwd: string, path: string, requestId?: string): Promise<FileExplorerDirectoryPayload>;
|
|
1212
|
+
/**
|
|
1213
|
+
* `timeout` bounds the whole transfer, not each frame. `0` disables the timer (as
|
|
1214
|
+
* `workspace.create` does) for files that legitimately take longer than the default over a
|
|
1215
|
+
* slow link; a dead connection still rejects on disconnect.
|
|
1216
|
+
*/
|
|
1217
|
+
readFile(cwd: string, path: string, requestId?: string, maxBytes?: number, timeout?: number): Promise<FileReadResult>;
|
|
1218
|
+
observeFile(input: {
|
|
1219
|
+
cwd: string;
|
|
1220
|
+
path: string;
|
|
1221
|
+
signal?: AbortSignal;
|
|
1222
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
|
|
1223
|
+
subscribeFile(input: {
|
|
1224
|
+
cwd: string;
|
|
1225
|
+
path: string;
|
|
1226
|
+
signal?: AbortSignal;
|
|
1227
|
+
}, onUpdate: (version: FileVersion) => void): Promise<{
|
|
1228
|
+
initial: FileVersion;
|
|
1229
|
+
subscription: OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
|
|
1230
|
+
unsubscribe: () => Promise<void>;
|
|
1231
|
+
}>;
|
|
1232
|
+
writeFile(input: {
|
|
1233
|
+
cwd: string;
|
|
1234
|
+
path: string;
|
|
1235
|
+
content: string;
|
|
1236
|
+
expectedModifiedAt: string;
|
|
1237
|
+
expectedRevision?: string;
|
|
1238
|
+
}): Promise<FileWriteResult>;
|
|
1239
|
+
createFileEntry(input: {
|
|
1240
|
+
cwd: string;
|
|
1241
|
+
parentPath: string;
|
|
1242
|
+
name: string;
|
|
1243
|
+
kind: "file" | "directory";
|
|
1244
|
+
}): Promise<CorrelatedResponsePayload<"fs.entry.create.response">>;
|
|
1245
|
+
renameFileEntry(input: {
|
|
1246
|
+
cwd: string;
|
|
1247
|
+
path: string;
|
|
1248
|
+
name: string;
|
|
1249
|
+
}): Promise<CorrelatedResponsePayload<"fs.entry.rename.response">>;
|
|
1250
|
+
duplicateFileEntry(input: {
|
|
1251
|
+
cwd: string;
|
|
1252
|
+
path: string;
|
|
1253
|
+
}): Promise<CorrelatedResponsePayload<"fs.entry.duplicate.response">>;
|
|
1254
|
+
deleteFileEntry(input: {
|
|
1255
|
+
cwd: string;
|
|
1256
|
+
path: string;
|
|
1257
|
+
}): Promise<CorrelatedResponsePayload<"fs.entry.delete.response">>;
|
|
1258
|
+
checkoutDiscardChanges(cwd: string, input: {
|
|
1259
|
+
paths: string[];
|
|
1260
|
+
}): Promise<CorrelatedResponsePayload<"checkout.discard_changes.response">>;
|
|
1261
|
+
uploadFile(input: FileUploadInput): Promise<FileUploadResult>;
|
|
1262
|
+
openFilePreview(input: Pick<FilePreviewOpenRequest, "cwd" | "path">): Promise<CorrelatedResponsePayload<"workspace.file.preview.open.response">>;
|
|
1263
|
+
readFilePreview(input: Pick<FilePreviewReadRequest, "previewId" | "offset" | "length">): Promise<CorrelatedResponsePayload<"workspace.file.preview.read.response">>;
|
|
1264
|
+
closeFilePreview(input: Pick<FilePreviewCloseRequest, "previewId">): Promise<CorrelatedResponsePayload<"workspace.file.preview.close.response">>;
|
|
1265
|
+
requestDownloadToken(cwd: string, path: string, requestId?: string): Promise<FileDownloadTokenPayload>;
|
|
1266
|
+
requestProjectIcon(cwd: string, requestId?: string): Promise<ProjectIconResponse["payload"]>;
|
|
1267
|
+
getProjectIcon(projectId: string, requestId?: string): Promise<ProjectIconGetResponse["payload"]>;
|
|
1268
|
+
listProviderModels(provider: AgentProvider, options?: {
|
|
1269
|
+
cwd?: string;
|
|
1270
|
+
requestId?: string;
|
|
1271
|
+
}): Promise<ListProviderModelsPayload>;
|
|
1272
|
+
listProviderModes(provider: AgentProvider, options?: {
|
|
1273
|
+
cwd?: string;
|
|
1274
|
+
requestId?: string;
|
|
1275
|
+
}): Promise<ListProviderModesPayload>;
|
|
1276
|
+
listProviderFeatures(draftConfig: ListCommandsDraftConfig, options?: {
|
|
1277
|
+
requestId?: string;
|
|
1278
|
+
}): Promise<ListProviderFeaturesPayload>;
|
|
1279
|
+
listAvailableProviders(options?: {
|
|
1280
|
+
requestId?: string;
|
|
1281
|
+
}): Promise<ListAvailableProvidersPayload>;
|
|
1282
|
+
getProvidersSnapshot(options?: {
|
|
1283
|
+
cwd?: string;
|
|
1284
|
+
ifNoneMatch?: string;
|
|
1285
|
+
requestId?: string;
|
|
1286
|
+
}): Promise<GetProvidersSnapshotPayload>;
|
|
1287
|
+
private requestProvidersSnapshot;
|
|
1288
|
+
getDaemonConfig(requestId?: string): Promise<{
|
|
1289
|
+
requestId: string;
|
|
1290
|
+
config: MutableDaemonConfig;
|
|
1291
|
+
}>;
|
|
1292
|
+
getDaemonStatus(options?: DaemonStatusOptions): Promise<DaemonStatusPayload>;
|
|
1293
|
+
reloadDaemonConfig(requestId?: string): Promise<DaemonConfigReloadResponse["payload"]>;
|
|
1294
|
+
connectHub(hubUrl: string, token: string, permissions?: readonly string[], requestId?: string): Promise<{
|
|
1295
|
+
requestId: string;
|
|
1296
|
+
status: {
|
|
1297
|
+
state: "connecting" | "not_connected" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1298
|
+
daemonId: string | null;
|
|
1299
|
+
hubOrigin: string | null;
|
|
1300
|
+
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute" | "agent.dispatch")[];
|
|
1301
|
+
connectedAt: string | null;
|
|
1302
|
+
lastError: string | null;
|
|
1303
|
+
};
|
|
1304
|
+
}>;
|
|
1305
|
+
updateHubPermissions(input: {
|
|
1306
|
+
grant?: readonly string[];
|
|
1307
|
+
revoke?: readonly string[];
|
|
1308
|
+
}, requestId?: string): Promise<{
|
|
1309
|
+
requestId: string;
|
|
1310
|
+
status: {
|
|
1311
|
+
state: "connecting" | "not_connected" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1312
|
+
daemonId: string | null;
|
|
1313
|
+
hubOrigin: string | null;
|
|
1314
|
+
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute" | "agent.dispatch")[];
|
|
1315
|
+
connectedAt: string | null;
|
|
1316
|
+
lastError: string | null;
|
|
1317
|
+
};
|
|
1318
|
+
}>;
|
|
1319
|
+
getHubStatus(requestId?: string): Promise<{
|
|
1320
|
+
requestId: string;
|
|
1321
|
+
status: {
|
|
1322
|
+
state: "connecting" | "not_connected" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1323
|
+
daemonId: string | null;
|
|
1324
|
+
hubOrigin: string | null;
|
|
1325
|
+
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute" | "agent.dispatch")[];
|
|
1326
|
+
connectedAt: string | null;
|
|
1327
|
+
lastError: string | null;
|
|
1328
|
+
};
|
|
1329
|
+
}>;
|
|
1330
|
+
disconnectHub(force?: boolean, requestId?: string): Promise<{
|
|
1331
|
+
requestId: string;
|
|
1332
|
+
status: {
|
|
1333
|
+
state: "connecting" | "not_connected" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1334
|
+
daemonId: string | null;
|
|
1335
|
+
hubOrigin: string | null;
|
|
1336
|
+
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute" | "agent.dispatch")[];
|
|
1337
|
+
connectedAt: string | null;
|
|
1338
|
+
lastError: string | null;
|
|
1339
|
+
};
|
|
1340
|
+
warning?: string | undefined;
|
|
1341
|
+
}>;
|
|
1342
|
+
getDaemonPairingOffer(options?: DaemonPairingOfferOptions): Promise<DaemonPairingOfferPayload>;
|
|
1343
|
+
collectDiagnostics(requestId?: string): Promise<DiagnosticsPayload>;
|
|
1344
|
+
patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
|
|
1345
|
+
requestId: string;
|
|
1346
|
+
config: MutableDaemonConfig;
|
|
1347
|
+
}>;
|
|
1348
|
+
sendBrowserAutomationExecuteResponse(response: BrowserAutomationExecuteResponse): void;
|
|
1349
|
+
readProjectConfig(repoRoot: string, requestId?: string): Promise<ReadProjectConfigPayload>;
|
|
1350
|
+
writeProjectConfig(input: WriteProjectConfigInput): Promise<WriteProjectConfigPayload>;
|
|
1351
|
+
refreshProvidersSnapshot(options?: {
|
|
1352
|
+
cwd?: string;
|
|
1353
|
+
providers?: AgentProvider[];
|
|
1354
|
+
requestId?: string;
|
|
1355
|
+
}): Promise<RefreshProvidersSnapshotPayload>;
|
|
1356
|
+
getProviderDiagnostic(provider: AgentProvider, options?: {
|
|
1357
|
+
requestId?: string;
|
|
1358
|
+
}): Promise<ProviderDiagnosticPayload>;
|
|
1359
|
+
listProviderUsage(options?: {
|
|
1360
|
+
requestId?: string;
|
|
1361
|
+
}): Promise<ProviderUsageListPayload>;
|
|
1362
|
+
listUsageReports(options?: {
|
|
1363
|
+
agentId?: string;
|
|
1364
|
+
requestId?: string;
|
|
1365
|
+
forceRefresh?: boolean;
|
|
1366
|
+
reportIds?: string[];
|
|
1367
|
+
}, onReport?: (report: UsageReportEntry) => void): Promise<UsageListReportsPayload>;
|
|
1368
|
+
listCommands(options: ListCommandsOptions): Promise<ListCommandsPayload>;
|
|
1369
|
+
listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
|
|
1370
|
+
listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise<ListCommandsPayload>;
|
|
1371
|
+
respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
|
|
1372
|
+
getPluginCatalog(): Promise<{
|
|
1373
|
+
id: string;
|
|
1374
|
+
clientBundle: string;
|
|
1375
|
+
requirements?: {
|
|
1376
|
+
mateo?: string | undefined;
|
|
1377
|
+
} | undefined;
|
|
1378
|
+
}[]>;
|
|
1379
|
+
listPlugins(options?: {
|
|
1380
|
+
includeBuiltin?: boolean;
|
|
1381
|
+
}): Promise<PluginListItem[]>;
|
|
1382
|
+
getPluginLogs(pluginId: string): Promise<PluginLogEntry[]>;
|
|
1383
|
+
getAgentSkillsStatus(): Promise<AgentSkillsStatus>;
|
|
1384
|
+
reconcileAgentSkills(): Promise<AgentSkillsStatus>;
|
|
1385
|
+
uninstallAgentSkills(): Promise<AgentSkillsStatus>;
|
|
1386
|
+
saveAgentSkillsSelection(selection: AgentSkillSelection, confirmedRemovals?: readonly string[]): Promise<AgentSkillsSaveResult>;
|
|
1387
|
+
importLegacyAgentSkillsSelection(selection: AgentSkillSelection): Promise<{
|
|
1388
|
+
imported: boolean;
|
|
1389
|
+
selection: AgentSkillSelection;
|
|
1390
|
+
}>;
|
|
1391
|
+
installDirectoryPlugin(path: string, id?: string): Promise<PluginListItem>;
|
|
1392
|
+
installPluginSource(input: {
|
|
1393
|
+
source: string;
|
|
1394
|
+
id?: string;
|
|
1395
|
+
ref?: string;
|
|
1396
|
+
}): Promise<PluginListItem>;
|
|
1397
|
+
getPluginSourceStatus(pluginId?: string): Promise<PluginSourceStatusItem[]>;
|
|
1398
|
+
private requirePluginUpdates;
|
|
1399
|
+
previewPluginUpdates(input?: {
|
|
1400
|
+
pluginId?: string;
|
|
1401
|
+
target?: PluginUpdateSelection;
|
|
1402
|
+
}): Promise<PluginUpdatePreview[]>;
|
|
1403
|
+
applyPluginUpdates(proposals: PluginUpdateProposal[]): Promise<PluginUpdateResult[]>;
|
|
1404
|
+
updatePluginSources(pluginId?: string): Promise<PluginSourceUpdateItem[]>;
|
|
1405
|
+
inspectDirectoryPlugin(path: string): Promise<{
|
|
1406
|
+
id: string;
|
|
1407
|
+
}>;
|
|
1408
|
+
reloadPlugin(pluginId: string): Promise<PluginListItem>;
|
|
1409
|
+
enablePlugin(pluginId: string): Promise<PluginListItem>;
|
|
1410
|
+
disablePlugin(pluginId: string): Promise<PluginListItem>;
|
|
1411
|
+
removePlugin(pluginId: string): Promise<void>;
|
|
1412
|
+
private managePlugin;
|
|
1413
|
+
invokePluginRpc(pluginId: string, method: string, input: unknown): Promise<unknown>;
|
|
1414
|
+
respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
|
|
1415
|
+
waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
|
|
1416
|
+
waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
|
|
1417
|
+
observeTerminals(input: {
|
|
1418
|
+
cwd: string;
|
|
1419
|
+
workspaceId?: string;
|
|
1420
|
+
signal?: AbortSignal;
|
|
1421
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"terminals_changed">>;
|
|
1422
|
+
listTerminals(cwd?: string, requestId?: string, options?: {
|
|
1423
|
+
workspaceId?: string;
|
|
1424
|
+
}): Promise<ListTerminalsPayload>;
|
|
1425
|
+
createTerminal(cwd: string, name?: string, requestId?: string, options?: {
|
|
1426
|
+
agentId?: string;
|
|
1427
|
+
command?: string;
|
|
1428
|
+
args?: string[];
|
|
1429
|
+
workspaceId?: string;
|
|
1430
|
+
size?: {
|
|
1431
|
+
rows: number;
|
|
1432
|
+
cols: number;
|
|
1433
|
+
};
|
|
1434
|
+
}): Promise<CreateTerminalPayload>;
|
|
1435
|
+
renameTerminal(input: RenameTerminalInput): Promise<RenameTerminalResult>;
|
|
1436
|
+
countBusyTerminals(): Promise<CountBusyTerminalsResult>;
|
|
1437
|
+
/**
|
|
1438
|
+
* Snapshot/restore and output arrive in receive. Subscribe to the returned handle
|
|
1439
|
+
* for terminal_stream_exit: payload.error means observation failure, not PTY exit.
|
|
1440
|
+
* Either outcome detaches this slot and releases the handle automatically.
|
|
1441
|
+
*/
|
|
1442
|
+
observeTerminal(terminalId: string, receive: (event: TerminalStreamEvent) => void, options?: {
|
|
1443
|
+
restore?: SubscribeTerminalRequest["restore"];
|
|
1444
|
+
signal?: AbortSignal;
|
|
1445
|
+
requestId?: string;
|
|
1446
|
+
}): OwnedSubscription<SubscribeTerminalPayload>;
|
|
1447
|
+
subscribeTerminal(terminalId: string, options?: {
|
|
1448
|
+
restore?: SubscribeTerminalRequest["restore"];
|
|
1449
|
+
signal?: AbortSignal;
|
|
1450
|
+
requestId?: string;
|
|
1451
|
+
}): Promise<SubscribeTerminalPayload & {
|
|
1452
|
+
subscription: OwnedSubscription<SubscribeTerminalPayload>;
|
|
1453
|
+
}>;
|
|
1454
|
+
sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
|
|
1455
|
+
killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
|
|
1456
|
+
closeItems(input: {
|
|
1457
|
+
agentIds?: string[];
|
|
1458
|
+
terminalIds?: string[];
|
|
1459
|
+
}, requestId?: string): Promise<CloseItemsPayload>;
|
|
1460
|
+
captureTerminal(terminalId: string, options?: {
|
|
1461
|
+
start?: number;
|
|
1462
|
+
end?: number;
|
|
1463
|
+
stripAnsi?: boolean;
|
|
1464
|
+
}, requestId?: string): Promise<CaptureTerminalPayload>;
|
|
1465
|
+
scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
|
|
1466
|
+
scheduleList(requestId?: string): Promise<ScheduleListPayload>;
|
|
1467
|
+
scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
|
|
1468
|
+
scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
|
|
1469
|
+
schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
|
|
1470
|
+
scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
|
|
1471
|
+
scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
|
|
1472
|
+
scheduleRunOnce(options: ScheduleRunOnceOptions): Promise<ScheduleRunOncePayload>;
|
|
1473
|
+
private waitForScheduleRunConnection;
|
|
1474
|
+
scheduleUpdate(options: UpdateScheduleOptions): Promise<ScheduleUpdatePayload>;
|
|
1475
|
+
onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
|
|
1476
|
+
waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
|
|
1477
|
+
private createRequestId;
|
|
1478
|
+
getLastServerInfoMessage(): ServerInfoStatusPayload | null;
|
|
1479
|
+
private requireHubRelationshipSupport;
|
|
1480
|
+
private requireDaemonConfigReloadSupport;
|
|
1481
|
+
private resolveTransportUrlForAttempt;
|
|
1482
|
+
private sendHelloMessage;
|
|
1483
|
+
private disposeTransport;
|
|
1484
|
+
private cleanupTransport;
|
|
1485
|
+
private resetConnectTimeout;
|
|
1486
|
+
private recordInboundProgress;
|
|
1487
|
+
private handleTransportMessage;
|
|
1488
|
+
private handleJsonPayload;
|
|
1489
|
+
private tryHandleBinaryFrame;
|
|
1490
|
+
private handleFileTransferFrame;
|
|
1491
|
+
private updateConnectionState;
|
|
1492
|
+
setReconnectEnabled(enabled: boolean): void;
|
|
1493
|
+
private scheduleReconnect;
|
|
1494
|
+
private emitDisconnectedStateForReconnect;
|
|
1495
|
+
private armReconnectTimer;
|
|
1496
|
+
private resolvePingProbe;
|
|
1497
|
+
private rejectPingProbe;
|
|
1498
|
+
private recordLivenessFailure;
|
|
1499
|
+
private handleSessionMessage;
|
|
1500
|
+
private deliverSessionMessage;
|
|
1501
|
+
private resolveWaiters;
|
|
1502
|
+
private rejectWaitersForRequestId;
|
|
1503
|
+
private clearWaiters;
|
|
1504
|
+
private toEvent;
|
|
1505
|
+
private waitForWithCancel;
|
|
1506
|
+
}
|
|
1507
|
+
//# sourceMappingURL=daemon-client.d.ts.map
|