@otto-code/client 0.5.0
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/README.md +12 -0
- package/dist/compat/normalize-provider-models.d.ts +11 -0
- package/dist/compat/normalize-provider-models.js +42 -0
- package/dist/daemon-client-relay-e2ee-transport.d.ts +8 -0
- package/dist/daemon-client-relay-e2ee-transport.js +161 -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 +36 -0
- package/dist/daemon-client-transport-types.js +2 -0
- package/dist/daemon-client-transport-utils.d.ts +9 -0
- package/dist/daemon-client-transport-utils.js +121 -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 +8 -0
- package/dist/daemon-client-websocket-transport.js +120 -0
- package/dist/daemon-client.d.ts +1179 -0
- package/dist/daemon-client.js +4192 -0
- package/dist/index.d.ts +281 -0
- package/dist/index.js +176 -0
- package/dist/terminal-stream-router.d.ts +28 -0
- package/dist/terminal-stream-router.js +108 -0
- package/package.json +47 -0
|
@@ -0,0 +1,1179 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { type ClientCapability } from "@otto-code/protocol/client-capabilities";
|
|
3
|
+
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ServerInfoStatusPayload } from "@otto-code/protocol/messages";
|
|
4
|
+
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreateOttoWorktreeRequest, CodeListFilesResponse, CodeSymbolLocation, FileDownloadTokenResponse, FileEol, FileReplaceFileResult, FileReplaceRequest, FileReplaceResponse, FileSearchResultPayload, FileSearchSummary, FileUploadResponse, FileExplorerResponse, FileWatchEventPayload, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, PreviewListConfigResponse, PreviewStartResponse, PreviewBindTabResponse, PreviewStopResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, GitHubSearchResponse, GitHubSearchRequest, GitHostingProviderId, HostingSearchRequest, HostingSearchResponse, HostingAuthStatusResponse, DirectorySuggestionsResponse, OttoWorktreeListResponse, OttoWorktreeArchiveResponse, ProjectIconResponse, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, AgentContextGetUsageResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, OttoConfigRaw, OttoConfigRevision, WorkspaceCreateRequest } from "@otto-code/protocol/messages";
|
|
5
|
+
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@otto-code/protocol/agent-types";
|
|
6
|
+
import type { MutableDaemonConfig, MutableDaemonConfigPatch, SpeechSettingsOptions, SpeechTtsPreviewResult } from "@otto-code/protocol/messages";
|
|
7
|
+
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
|
|
8
|
+
import { type TerminalStreamEvent } from "./terminal-stream-router.js";
|
|
9
|
+
import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@otto-code/protocol/browser-automation/rpc-schemas";
|
|
10
|
+
export interface Logger {
|
|
11
|
+
debug(obj: object, msg?: string): void;
|
|
12
|
+
info(obj: object, msg?: string): void;
|
|
13
|
+
warn(obj: object, msg?: string): void;
|
|
14
|
+
error(obj: object, msg?: string): void;
|
|
15
|
+
}
|
|
16
|
+
interface ImportAgentInputBase {
|
|
17
|
+
cwd?: string;
|
|
18
|
+
labels?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
export type ImportAgentInput = (ImportAgentInputBase & {
|
|
21
|
+
providerId: string;
|
|
22
|
+
providerHandleId: string;
|
|
23
|
+
}) | (ImportAgentInputBase & {
|
|
24
|
+
provider: AgentProvider;
|
|
25
|
+
sessionId: string;
|
|
26
|
+
});
|
|
27
|
+
export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js";
|
|
28
|
+
export type { TerminalStreamEvent };
|
|
29
|
+
export type ConnectionState = {
|
|
30
|
+
status: "idle";
|
|
31
|
+
} | {
|
|
32
|
+
status: "connecting";
|
|
33
|
+
attempt: number;
|
|
34
|
+
} | {
|
|
35
|
+
status: "connected";
|
|
36
|
+
} | {
|
|
37
|
+
status: "disconnected";
|
|
38
|
+
reason?: string;
|
|
39
|
+
} | {
|
|
40
|
+
status: "disposed";
|
|
41
|
+
};
|
|
42
|
+
export type DaemonEvent = {
|
|
43
|
+
type: "agent_update";
|
|
44
|
+
agentId: string;
|
|
45
|
+
payload: Extract<SessionOutboundMessage, {
|
|
46
|
+
type: "agent_update";
|
|
47
|
+
}>["payload"];
|
|
48
|
+
} | {
|
|
49
|
+
type: "workspace_update";
|
|
50
|
+
workspaceId: string;
|
|
51
|
+
payload: Extract<SessionOutboundMessage, {
|
|
52
|
+
type: "workspace_update";
|
|
53
|
+
}>["payload"];
|
|
54
|
+
} | {
|
|
55
|
+
type: "workspace_setup_progress";
|
|
56
|
+
workspaceId: string;
|
|
57
|
+
payload: Extract<SessionOutboundMessage, {
|
|
58
|
+
type: "workspace_setup_progress";
|
|
59
|
+
}>["payload"];
|
|
60
|
+
} | {
|
|
61
|
+
type: "agent_stream";
|
|
62
|
+
agentId: string;
|
|
63
|
+
event: AgentStreamEventPayload;
|
|
64
|
+
timestamp: string;
|
|
65
|
+
seq?: number;
|
|
66
|
+
epoch?: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: "status";
|
|
69
|
+
payload: {
|
|
70
|
+
status: string;
|
|
71
|
+
} & Record<string, unknown>;
|
|
72
|
+
} | {
|
|
73
|
+
type: "agent_deleted";
|
|
74
|
+
agentId: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "agent_permission_request";
|
|
77
|
+
agentId: string;
|
|
78
|
+
request: AgentPermissionRequest;
|
|
79
|
+
} | {
|
|
80
|
+
type: "agent_permission_resolved";
|
|
81
|
+
agentId: string;
|
|
82
|
+
requestId: string;
|
|
83
|
+
resolution: AgentPermissionResponse;
|
|
84
|
+
} | {
|
|
85
|
+
type: "providers_snapshot_update";
|
|
86
|
+
payload: Extract<SessionOutboundMessage, {
|
|
87
|
+
type: "providers_snapshot_update";
|
|
88
|
+
}>["payload"];
|
|
89
|
+
} | {
|
|
90
|
+
type: "error";
|
|
91
|
+
message: string;
|
|
92
|
+
};
|
|
93
|
+
export type DaemonEventHandler = (event: DaemonEvent) => void;
|
|
94
|
+
export type BrowserAutomationExecuteRequestMessage = BrowserAutomationExecuteRequest;
|
|
95
|
+
export type BrowserAutomationExecuteResponseMessage = BrowserAutomationExecuteResponse;
|
|
96
|
+
export interface DaemonClientConfig {
|
|
97
|
+
url: string;
|
|
98
|
+
clientId: string;
|
|
99
|
+
clientType?: "mobile" | "browser" | "cli" | "mcp";
|
|
100
|
+
appVersion?: string;
|
|
101
|
+
runtimeGeneration?: number | null;
|
|
102
|
+
password?: string;
|
|
103
|
+
authHeader?: string;
|
|
104
|
+
suppressSendErrors?: boolean;
|
|
105
|
+
transportFactory?: DaemonTransportFactory;
|
|
106
|
+
webSocketFactory?: WebSocketFactory;
|
|
107
|
+
logger?: Logger;
|
|
108
|
+
connectTimeoutMs?: number;
|
|
109
|
+
e2ee?: {
|
|
110
|
+
enabled?: boolean;
|
|
111
|
+
daemonPublicKeyB64?: string;
|
|
112
|
+
};
|
|
113
|
+
reconnect?: {
|
|
114
|
+
enabled?: boolean;
|
|
115
|
+
baseDelayMs?: number;
|
|
116
|
+
maxDelayMs?: number;
|
|
117
|
+
};
|
|
118
|
+
runtimeMetricsIntervalMs?: number;
|
|
119
|
+
runtimeMetricsWindowMs?: number;
|
|
120
|
+
capabilities?: Partial<Record<ClientCapability, unknown>>;
|
|
121
|
+
}
|
|
122
|
+
export interface SendMessageOptions {
|
|
123
|
+
messageId?: string;
|
|
124
|
+
images?: Array<{
|
|
125
|
+
data: string;
|
|
126
|
+
mimeType: string;
|
|
127
|
+
}>;
|
|
128
|
+
attachments?: SendAgentMessageRequest["attachments"];
|
|
129
|
+
}
|
|
130
|
+
type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
|
|
131
|
+
export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
132
|
+
config?: AgentSessionConfig;
|
|
133
|
+
provider?: AgentProvider;
|
|
134
|
+
cwd?: string;
|
|
135
|
+
/** Optional personality id; the daemon snapshots its identity onto the agent. */
|
|
136
|
+
personality?: CreateAgentRequestMessage["personality"];
|
|
137
|
+
env?: CreateAgentRequestMessage["env"];
|
|
138
|
+
workspaceId?: string;
|
|
139
|
+
initialPrompt?: string;
|
|
140
|
+
clientMessageId?: string;
|
|
141
|
+
outputSchema?: Record<string, unknown>;
|
|
142
|
+
images?: CreateAgentRequestMessage["images"];
|
|
143
|
+
attachments?: CreateAgentRequestMessage["attachments"];
|
|
144
|
+
git?: GitSetupOptions;
|
|
145
|
+
worktree?: CreateAgentRequestMessage["worktree"];
|
|
146
|
+
autoArchive?: CreateAgentRequestMessage["autoArchive"];
|
|
147
|
+
worktreeName?: string;
|
|
148
|
+
requestId?: string;
|
|
149
|
+
labels?: Record<string, string>;
|
|
150
|
+
}
|
|
151
|
+
export interface CreateOttoWorktreeInput extends Pick<CreateOttoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "githubPrNumber"> {
|
|
152
|
+
}
|
|
153
|
+
type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
|
|
154
|
+
type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
|
|
155
|
+
type: "subscribe_checkout_diff_response";
|
|
156
|
+
}>["payload"];
|
|
157
|
+
type CheckoutDiffPayload = Omit<SubscribeCheckoutDiffPayload, "subscriptionId">;
|
|
158
|
+
type CheckoutCommitPayload = CheckoutCommitResponse["payload"];
|
|
159
|
+
type CheckoutMergePayload = CheckoutMergeResponse["payload"];
|
|
160
|
+
type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"];
|
|
161
|
+
type CheckoutPullPayload = CheckoutPullResponse["payload"];
|
|
162
|
+
type CheckoutPushPayload = CheckoutPushResponse["payload"];
|
|
163
|
+
type CheckoutRefreshPayload = CheckoutRefreshResponse["payload"];
|
|
164
|
+
type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"];
|
|
165
|
+
type CheckoutPrMergePayload = CheckoutPrMergeResponse["payload"];
|
|
166
|
+
type CheckoutGithubSetAutoMergePayload = CheckoutGithubSetAutoMergeResponse["payload"];
|
|
167
|
+
type PreviewListConfigPayload = PreviewListConfigResponse["payload"];
|
|
168
|
+
type PreviewStartPayload = PreviewStartResponse["payload"];
|
|
169
|
+
type PreviewBindTabPayload = PreviewBindTabResponse["payload"];
|
|
170
|
+
type PreviewStopPayload = PreviewStopResponse["payload"];
|
|
171
|
+
type CheckoutGithubGetCheckDetailsPayload = CheckoutGithubGetCheckDetailsResponse["payload"];
|
|
172
|
+
type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"];
|
|
173
|
+
type PullRequestTimelinePayload = PullRequestTimelineResponse["payload"];
|
|
174
|
+
type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"];
|
|
175
|
+
export type RenameBranchResult = z.infer<typeof CheckoutRenameBranchResponseSchema>["payload"];
|
|
176
|
+
type StashSavePayload = StashSaveResponse["payload"];
|
|
177
|
+
type StashPopPayload = StashPopResponse["payload"];
|
|
178
|
+
type StashListPayload = StashListResponse["payload"];
|
|
179
|
+
type ValidateBranchPayload = ValidateBranchResponse["payload"];
|
|
180
|
+
type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
|
|
181
|
+
type GitHubSearchPayload = GitHubSearchResponse["payload"];
|
|
182
|
+
export type HostingSearchPayload = HostingSearchResponse["payload"];
|
|
183
|
+
export type HostingAuthStatusPayload = HostingAuthStatusResponse["payload"];
|
|
184
|
+
type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
|
|
185
|
+
type OttoWorktreeListPayload = OttoWorktreeListResponse["payload"];
|
|
186
|
+
type OttoWorktreeArchivePayload = OttoWorktreeArchiveResponse["payload"];
|
|
187
|
+
type CreateOttoWorktreePayload = Extract<SessionOutboundMessage, {
|
|
188
|
+
type: "create_otto_worktree_response";
|
|
189
|
+
}>["payload"];
|
|
190
|
+
type WorkspaceCreatePayload = Extract<SessionOutboundMessage, {
|
|
191
|
+
type: "workspace.create.response";
|
|
192
|
+
}>["payload"];
|
|
193
|
+
type FileExplorerPayload = FileExplorerResponse["payload"];
|
|
194
|
+
export type FileExplorerDirectoryPayload = NonNullable<FileExplorerPayload["directory"]>;
|
|
195
|
+
type LegacyFileExplorerFilePayload = NonNullable<FileExplorerPayload["file"]>;
|
|
196
|
+
export interface FileReadResult {
|
|
197
|
+
bytes: Uint8Array;
|
|
198
|
+
mime: string;
|
|
199
|
+
size: number;
|
|
200
|
+
path: string;
|
|
201
|
+
kind: LegacyFileExplorerFilePayload["kind"];
|
|
202
|
+
modifiedAt: string;
|
|
203
|
+
}
|
|
204
|
+
export interface TextFileReadResult {
|
|
205
|
+
path: string;
|
|
206
|
+
content: string;
|
|
207
|
+
size: number;
|
|
208
|
+
modifiedAt: string;
|
|
209
|
+
eol: FileEol;
|
|
210
|
+
hash: string | null;
|
|
211
|
+
}
|
|
212
|
+
export interface FileWriteOptions {
|
|
213
|
+
cwd: string;
|
|
214
|
+
path: string;
|
|
215
|
+
content: string;
|
|
216
|
+
expectedModifiedAt: string;
|
|
217
|
+
expectedHash?: string;
|
|
218
|
+
/** Only the deleted-file "save re-creates" flow sets these two. */
|
|
219
|
+
allowCreate?: boolean;
|
|
220
|
+
eol?: FileEol;
|
|
221
|
+
requestId?: string;
|
|
222
|
+
}
|
|
223
|
+
export type { FileReplaceFileResult, FileSearchResultPayload, FileSearchSummary, FileWatchEventPayload, FileWriteResult, };
|
|
224
|
+
export interface FileSearchOptions {
|
|
225
|
+
cwd: string;
|
|
226
|
+
query: string;
|
|
227
|
+
caseSensitive?: boolean;
|
|
228
|
+
wholeWord?: boolean;
|
|
229
|
+
regexp?: boolean;
|
|
230
|
+
include?: string;
|
|
231
|
+
exclude?: string;
|
|
232
|
+
/** Called once per file with matches while the scan streams. */
|
|
233
|
+
onFileResult: (result: FileSearchResultPayload) => void;
|
|
234
|
+
requestId?: string;
|
|
235
|
+
}
|
|
236
|
+
export type FileReplaceFilesInput = FileReplaceRequest["files"];
|
|
237
|
+
export type FileReplaceResultPayload = FileReplaceResponse["payload"];
|
|
238
|
+
export type { CodeSymbolLocation };
|
|
239
|
+
export type CodeListFilesResultPayload = CodeListFilesResponse["payload"];
|
|
240
|
+
export interface FileUploadInput {
|
|
241
|
+
fileName: string;
|
|
242
|
+
mimeType: string;
|
|
243
|
+
bytes: Uint8Array | ArrayBuffer;
|
|
244
|
+
modifiedAt?: string;
|
|
245
|
+
requestId?: string;
|
|
246
|
+
chunkSize?: number;
|
|
247
|
+
}
|
|
248
|
+
export type FileUploadResult = FileUploadResponse["payload"];
|
|
249
|
+
type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"];
|
|
250
|
+
type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"];
|
|
251
|
+
type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"];
|
|
252
|
+
type ListProviderModesPayload = ListProviderModesResponseMessage["payload"];
|
|
253
|
+
type ListAvailableProvidersPayload = ListAvailableProvidersResponse["payload"];
|
|
254
|
+
type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"];
|
|
255
|
+
type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"];
|
|
256
|
+
type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"];
|
|
257
|
+
type ProviderUsageListPayload = ProviderUsageListResponseMessage["payload"];
|
|
258
|
+
type AgentContextGetUsagePayload = AgentContextGetUsageResponseMessage["payload"];
|
|
259
|
+
type DaemonStatusPayload = DaemonGetStatusResponse["payload"];
|
|
260
|
+
type DaemonPairingOfferPayload = DaemonGetPairingOfferResponse["payload"];
|
|
261
|
+
type DiagnosticsPayload = DiagnosticsResponse["payload"];
|
|
262
|
+
type ReadProjectConfigPayload = Extract<SessionOutboundMessage, {
|
|
263
|
+
type: "read_project_config_response";
|
|
264
|
+
}>["payload"];
|
|
265
|
+
type WriteProjectConfigPayload = Extract<SessionOutboundMessage, {
|
|
266
|
+
type: "write_project_config_response";
|
|
267
|
+
}>["payload"];
|
|
268
|
+
type ListCommandsPayload = ListCommandsResponse["payload"];
|
|
269
|
+
type ListCommandsDraftConfig = Pick<AgentSessionConfig, "provider" | "cwd" | "modeId" | "model" | "thinkingOptionId" | "featureValues">;
|
|
270
|
+
export interface WriteProjectConfigInput {
|
|
271
|
+
repoRoot: string;
|
|
272
|
+
config: OttoConfigRaw;
|
|
273
|
+
expectedRevision: OttoConfigRevision | null;
|
|
274
|
+
requestId?: string;
|
|
275
|
+
}
|
|
276
|
+
interface ListCommandsOptions {
|
|
277
|
+
agentId: string;
|
|
278
|
+
requestId?: string;
|
|
279
|
+
draftConfig?: ListCommandsDraftConfig;
|
|
280
|
+
}
|
|
281
|
+
type LegacyListCommandsOptions = Omit<ListCommandsOptions, "agentId">;
|
|
282
|
+
type SetVoiceModePayload = Extract<SessionOutboundMessage, {
|
|
283
|
+
type: "set_voice_mode_response";
|
|
284
|
+
}>["payload"];
|
|
285
|
+
type AgentPermissionResolvedPayload = AgentPermissionResolvedMessage["payload"];
|
|
286
|
+
type ListTerminalsPayload = ListTerminalsResponse["payload"];
|
|
287
|
+
type CreateTerminalPayload = CreateTerminalResponse["payload"];
|
|
288
|
+
export type RenameTerminalResult = z.infer<typeof RenameTerminalResponseSchema>["payload"];
|
|
289
|
+
type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"];
|
|
290
|
+
type CloseItemsPayload = CloseItemsResponse["payload"];
|
|
291
|
+
type KillTerminalPayload = KillTerminalResponse["payload"];
|
|
292
|
+
type CaptureTerminalPayload = CaptureTerminalResponse["payload"];
|
|
293
|
+
type ChatCreatePayload = Extract<SessionOutboundMessage, {
|
|
294
|
+
type: "chat/create/response";
|
|
295
|
+
}>["payload"];
|
|
296
|
+
type ChatListPayload = Extract<SessionOutboundMessage, {
|
|
297
|
+
type: "chat/list/response";
|
|
298
|
+
}>["payload"];
|
|
299
|
+
type ChatInspectPayload = Extract<SessionOutboundMessage, {
|
|
300
|
+
type: "chat/inspect/response";
|
|
301
|
+
}>["payload"];
|
|
302
|
+
type ChatDeletePayload = Extract<SessionOutboundMessage, {
|
|
303
|
+
type: "chat/delete/response";
|
|
304
|
+
}>["payload"];
|
|
305
|
+
type ChatPostPayload = Extract<SessionOutboundMessage, {
|
|
306
|
+
type: "chat/post/response";
|
|
307
|
+
}>["payload"];
|
|
308
|
+
type ChatReadPayload = Extract<SessionOutboundMessage, {
|
|
309
|
+
type: "chat/read/response";
|
|
310
|
+
}>["payload"];
|
|
311
|
+
type ChatWaitPayload = Extract<SessionOutboundMessage, {
|
|
312
|
+
type: "chat/wait/response";
|
|
313
|
+
}>["payload"];
|
|
314
|
+
type LoopRunPayload = Extract<SessionOutboundMessage, {
|
|
315
|
+
type: "loop/run/response";
|
|
316
|
+
}>["payload"];
|
|
317
|
+
type LoopListPayload = Extract<SessionOutboundMessage, {
|
|
318
|
+
type: "loop/list/response";
|
|
319
|
+
}>["payload"];
|
|
320
|
+
type LoopInspectPayload = Extract<SessionOutboundMessage, {
|
|
321
|
+
type: "loop/inspect/response";
|
|
322
|
+
}>["payload"];
|
|
323
|
+
type LoopLogsPayload = Extract<SessionOutboundMessage, {
|
|
324
|
+
type: "loop/logs/response";
|
|
325
|
+
}>["payload"];
|
|
326
|
+
type LoopStopPayload = Extract<SessionOutboundMessage, {
|
|
327
|
+
type: "loop/stop/response";
|
|
328
|
+
}>["payload"];
|
|
329
|
+
type ScheduleCreatePayload = Extract<SessionOutboundMessage, {
|
|
330
|
+
type: "schedule/create/response";
|
|
331
|
+
}>["payload"];
|
|
332
|
+
type ScheduleListPayload = Extract<SessionOutboundMessage, {
|
|
333
|
+
type: "schedule/list/response";
|
|
334
|
+
}>["payload"];
|
|
335
|
+
type ScheduleInspectPayload = Extract<SessionOutboundMessage, {
|
|
336
|
+
type: "schedule/inspect/response";
|
|
337
|
+
}>["payload"];
|
|
338
|
+
type ScheduleLogsPayload = Extract<SessionOutboundMessage, {
|
|
339
|
+
type: "schedule/logs/response";
|
|
340
|
+
}>["payload"];
|
|
341
|
+
type SchedulePausePayload = Extract<SessionOutboundMessage, {
|
|
342
|
+
type: "schedule/pause/response";
|
|
343
|
+
}>["payload"];
|
|
344
|
+
type ScheduleResumePayload = Extract<SessionOutboundMessage, {
|
|
345
|
+
type: "schedule/resume/response";
|
|
346
|
+
}>["payload"];
|
|
347
|
+
type ScheduleDeletePayload = Extract<SessionOutboundMessage, {
|
|
348
|
+
type: "schedule/delete/response";
|
|
349
|
+
}>["payload"];
|
|
350
|
+
type ScheduleRunOncePayload = Extract<SessionOutboundMessage, {
|
|
351
|
+
type: "schedule/run-once/response";
|
|
352
|
+
}>["payload"];
|
|
353
|
+
type ScheduleUpdatePayload = Extract<SessionOutboundMessage, {
|
|
354
|
+
type: "schedule/update/response";
|
|
355
|
+
}>["payload"];
|
|
356
|
+
type ArtifactListPayload = Extract<SessionOutboundMessage, {
|
|
357
|
+
type: "artifact.list.response";
|
|
358
|
+
}>["payload"];
|
|
359
|
+
type ArtifactCreatePayload = Extract<SessionOutboundMessage, {
|
|
360
|
+
type: "artifact.create.response";
|
|
361
|
+
}>["payload"];
|
|
362
|
+
type ArtifactUpdatePayload = Extract<SessionOutboundMessage, {
|
|
363
|
+
type: "artifact.update.response";
|
|
364
|
+
}>["payload"];
|
|
365
|
+
type ArtifactRegeneratePayload = Extract<SessionOutboundMessage, {
|
|
366
|
+
type: "artifact.regenerate.response";
|
|
367
|
+
}>["payload"];
|
|
368
|
+
type ArtifactCancelPayload = Extract<SessionOutboundMessage, {
|
|
369
|
+
type: "artifact.cancel.response";
|
|
370
|
+
}>["payload"];
|
|
371
|
+
type ArtifactDeletePayload = Extract<SessionOutboundMessage, {
|
|
372
|
+
type: "artifact.delete.response";
|
|
373
|
+
}>["payload"];
|
|
374
|
+
type ArtifactStarPayload = Extract<SessionOutboundMessage, {
|
|
375
|
+
type: "artifact.star.response";
|
|
376
|
+
}>["payload"];
|
|
377
|
+
type ArtifactGetContentPayload = Extract<SessionOutboundMessage, {
|
|
378
|
+
type: "artifact.get-content.response";
|
|
379
|
+
}>["payload"];
|
|
380
|
+
export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"];
|
|
381
|
+
export type AgentForkContextPayload = AgentForkContextResponseMessage["payload"];
|
|
382
|
+
export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"];
|
|
383
|
+
export type FetchAgentTimelineProjection = FetchAgentTimelinePayload["projection"];
|
|
384
|
+
export type FetchAgentTimelineCursor = NonNullable<FetchAgentTimelinePayload["startCursor"]>;
|
|
385
|
+
export interface FetchAgentOptions {
|
|
386
|
+
agentId: string;
|
|
387
|
+
requestId?: string;
|
|
388
|
+
timeout?: number;
|
|
389
|
+
}
|
|
390
|
+
type LegacyFetchAgentOptions = Omit<FetchAgentOptions, "agentId">;
|
|
391
|
+
export interface FetchAgentTimelineOptions {
|
|
392
|
+
direction?: FetchAgentTimelineDirection;
|
|
393
|
+
cursor?: FetchAgentTimelineCursor;
|
|
394
|
+
limit?: number;
|
|
395
|
+
projection?: FetchAgentTimelineProjection;
|
|
396
|
+
requestId?: string;
|
|
397
|
+
timeout?: number;
|
|
398
|
+
}
|
|
399
|
+
export interface AgentForkContextOptions {
|
|
400
|
+
boundaryMessageId?: string;
|
|
401
|
+
requestId?: string;
|
|
402
|
+
}
|
|
403
|
+
type AgentRefreshedStatusPayload = z.infer<typeof AgentRefreshedStatusPayloadSchema>;
|
|
404
|
+
type RestartRequestedStatusPayload = z.infer<typeof RestartRequestedStatusPayloadSchema>;
|
|
405
|
+
type ShutdownRequestedStatusPayload = z.infer<typeof ShutdownRequestedStatusPayloadSchema>;
|
|
406
|
+
export interface ShutdownServerOptions {
|
|
407
|
+
requestId?: string;
|
|
408
|
+
timeout?: number;
|
|
409
|
+
}
|
|
410
|
+
export interface DaemonStatusOptions {
|
|
411
|
+
requestId?: string;
|
|
412
|
+
timeout?: number;
|
|
413
|
+
}
|
|
414
|
+
export interface DaemonPairingOfferOptions {
|
|
415
|
+
requestId?: string;
|
|
416
|
+
timeout?: number;
|
|
417
|
+
}
|
|
418
|
+
type DaemonUpdateResponse = z.infer<typeof DaemonUpdateResponseSchema>;
|
|
419
|
+
type FetchAgentsPayload = Extract<SessionOutboundMessage, {
|
|
420
|
+
type: "fetch_agents_response";
|
|
421
|
+
}>["payload"];
|
|
422
|
+
type FetchAgentsRequest = Extract<SessionInboundMessage, {
|
|
423
|
+
type: "fetch_agents_request";
|
|
424
|
+
}>;
|
|
425
|
+
export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
|
|
426
|
+
requestId?: string;
|
|
427
|
+
timeout?: number;
|
|
428
|
+
};
|
|
429
|
+
export type FetchAgentsEntry = FetchAgentsPayload["entries"][number];
|
|
430
|
+
export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"];
|
|
431
|
+
type FetchAgentHistoryPayload = Extract<SessionOutboundMessage, {
|
|
432
|
+
type: "fetch_agent_history_response";
|
|
433
|
+
}>["payload"];
|
|
434
|
+
type FetchAgentHistoryRequest = Extract<SessionInboundMessage, {
|
|
435
|
+
type: "fetch_agent_history_request";
|
|
436
|
+
}>;
|
|
437
|
+
export type FetchAgentHistoryOptions = Omit<FetchAgentHistoryRequest, "type" | "requestId"> & {
|
|
438
|
+
requestId?: string;
|
|
439
|
+
};
|
|
440
|
+
export type FetchAgentHistoryEntry = FetchAgentHistoryPayload["entries"][number];
|
|
441
|
+
export type FetchAgentHistoryPageInfo = FetchAgentHistoryPayload["pageInfo"];
|
|
442
|
+
type FetchRecentProviderSessionsPayload = Extract<SessionOutboundMessage, {
|
|
443
|
+
type: "fetch_recent_provider_sessions_response";
|
|
444
|
+
}>["payload"];
|
|
445
|
+
type FetchRecentProviderSessionsRequest = Extract<SessionInboundMessage, {
|
|
446
|
+
type: "fetch_recent_provider_sessions_request";
|
|
447
|
+
}>;
|
|
448
|
+
export type FetchRecentProviderSessionsOptions = Omit<FetchRecentProviderSessionsRequest, "type" | "requestId"> & {
|
|
449
|
+
requestId?: string;
|
|
450
|
+
};
|
|
451
|
+
export type FetchRecentProviderSessionEntry = FetchRecentProviderSessionsPayload["entries"][number];
|
|
452
|
+
type FetchWorkspacesPayload = Extract<SessionOutboundMessage, {
|
|
453
|
+
type: "fetch_workspaces_response";
|
|
454
|
+
}>["payload"];
|
|
455
|
+
type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
|
|
456
|
+
type: "fetch_workspaces_request";
|
|
457
|
+
}>;
|
|
458
|
+
export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
|
|
459
|
+
requestId?: string;
|
|
460
|
+
};
|
|
461
|
+
export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
|
|
462
|
+
export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
|
|
463
|
+
export interface CreateChatRoomOptions {
|
|
464
|
+
name: string;
|
|
465
|
+
purpose?: string | null;
|
|
466
|
+
requestId?: string;
|
|
467
|
+
}
|
|
468
|
+
export interface InspectChatRoomOptions {
|
|
469
|
+
room: string;
|
|
470
|
+
requestId?: string;
|
|
471
|
+
}
|
|
472
|
+
export interface DeleteChatRoomOptions {
|
|
473
|
+
room: string;
|
|
474
|
+
requestId?: string;
|
|
475
|
+
}
|
|
476
|
+
export interface PostChatMessageOptions {
|
|
477
|
+
room: string;
|
|
478
|
+
body: string;
|
|
479
|
+
authorAgentId?: string;
|
|
480
|
+
replyToMessageId?: string | null;
|
|
481
|
+
requestId?: string;
|
|
482
|
+
}
|
|
483
|
+
export interface ReadChatMessagesOptions {
|
|
484
|
+
room: string;
|
|
485
|
+
limit?: number;
|
|
486
|
+
since?: string;
|
|
487
|
+
authorAgentId?: string;
|
|
488
|
+
requestId?: string;
|
|
489
|
+
timeout?: number;
|
|
490
|
+
}
|
|
491
|
+
export interface WaitForChatMessagesOptions {
|
|
492
|
+
room: string;
|
|
493
|
+
afterMessageId?: string | null;
|
|
494
|
+
timeoutMs?: number;
|
|
495
|
+
requestId?: string;
|
|
496
|
+
}
|
|
497
|
+
export interface RunLoopOptions {
|
|
498
|
+
prompt: string;
|
|
499
|
+
cwd: string;
|
|
500
|
+
provider?: string;
|
|
501
|
+
model?: string;
|
|
502
|
+
modeId?: string;
|
|
503
|
+
verifierProvider?: string;
|
|
504
|
+
verifierModel?: string;
|
|
505
|
+
verifierModeId?: string;
|
|
506
|
+
verifyPrompt?: string | null;
|
|
507
|
+
verifyChecks?: string[];
|
|
508
|
+
name?: string | null;
|
|
509
|
+
sleepMs?: number;
|
|
510
|
+
maxIterations?: number;
|
|
511
|
+
maxTimeMs?: number;
|
|
512
|
+
requestId?: string;
|
|
513
|
+
}
|
|
514
|
+
export interface InspectLoopOptions {
|
|
515
|
+
id: string;
|
|
516
|
+
requestId?: string;
|
|
517
|
+
}
|
|
518
|
+
export interface LoopLogsOptions {
|
|
519
|
+
id: string;
|
|
520
|
+
afterSeq?: number;
|
|
521
|
+
requestId?: string;
|
|
522
|
+
}
|
|
523
|
+
export interface StopLoopOptions {
|
|
524
|
+
id: string;
|
|
525
|
+
requestId?: string;
|
|
526
|
+
}
|
|
527
|
+
export interface CreateScheduleOptions {
|
|
528
|
+
prompt: string;
|
|
529
|
+
name?: string | null;
|
|
530
|
+
cadence: {
|
|
531
|
+
type: "every";
|
|
532
|
+
everyMs: number;
|
|
533
|
+
} | {
|
|
534
|
+
type: "cron";
|
|
535
|
+
expression: string;
|
|
536
|
+
timezone?: string;
|
|
537
|
+
};
|
|
538
|
+
target: {
|
|
539
|
+
type: "self";
|
|
540
|
+
agentId: string;
|
|
541
|
+
} | {
|
|
542
|
+
type: "agent";
|
|
543
|
+
agentId: string;
|
|
544
|
+
} | {
|
|
545
|
+
type: "new-agent";
|
|
546
|
+
config: {
|
|
547
|
+
provider: AgentProvider;
|
|
548
|
+
cwd: string;
|
|
549
|
+
modeId?: string;
|
|
550
|
+
model?: string;
|
|
551
|
+
thinkingOptionId?: string;
|
|
552
|
+
archiveOnFinish?: boolean;
|
|
553
|
+
isolation?: "local" | "worktree";
|
|
554
|
+
title?: string | null;
|
|
555
|
+
approvalPolicy?: string;
|
|
556
|
+
sandboxMode?: string;
|
|
557
|
+
networkAccess?: boolean;
|
|
558
|
+
webSearch?: boolean;
|
|
559
|
+
extra?: AgentSessionConfig["extra"];
|
|
560
|
+
systemPrompt?: string;
|
|
561
|
+
mcpServers?: AgentSessionConfig["mcpServers"];
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
maxRuns?: number;
|
|
565
|
+
expiresAt?: string;
|
|
566
|
+
runOnCreate?: boolean;
|
|
567
|
+
requestId?: string;
|
|
568
|
+
}
|
|
569
|
+
export interface InspectScheduleOptions {
|
|
570
|
+
id: string;
|
|
571
|
+
requestId?: string;
|
|
572
|
+
}
|
|
573
|
+
export interface UpdateScheduleNewAgentConfig {
|
|
574
|
+
provider?: string;
|
|
575
|
+
model?: string | null;
|
|
576
|
+
modeId?: string | null;
|
|
577
|
+
thinkingOptionId?: string | null;
|
|
578
|
+
archiveOnFinish?: boolean;
|
|
579
|
+
isolation?: "local" | "worktree";
|
|
580
|
+
cwd?: string;
|
|
581
|
+
}
|
|
582
|
+
export interface UpdateScheduleOptions {
|
|
583
|
+
id: string;
|
|
584
|
+
name?: string | null;
|
|
585
|
+
prompt?: string;
|
|
586
|
+
cadence?: {
|
|
587
|
+
type: "every";
|
|
588
|
+
everyMs: number;
|
|
589
|
+
} | {
|
|
590
|
+
type: "cron";
|
|
591
|
+
expression: string;
|
|
592
|
+
timezone?: string;
|
|
593
|
+
};
|
|
594
|
+
newAgentConfig?: UpdateScheduleNewAgentConfig;
|
|
595
|
+
maxRuns?: number | null;
|
|
596
|
+
expiresAt?: string | null;
|
|
597
|
+
requestId?: string;
|
|
598
|
+
}
|
|
599
|
+
export interface RenameBranchInput {
|
|
600
|
+
cwd: string;
|
|
601
|
+
branch: string;
|
|
602
|
+
requestId?: string;
|
|
603
|
+
}
|
|
604
|
+
export interface RenameTerminalInput {
|
|
605
|
+
terminalId: string;
|
|
606
|
+
title: string;
|
|
607
|
+
requestId?: string;
|
|
608
|
+
}
|
|
609
|
+
type OpenProjectPayload = OpenProjectResponseMessage["payload"];
|
|
610
|
+
type ProjectAddPayload = ProjectAddResponse["payload"];
|
|
611
|
+
type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
|
|
612
|
+
type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
|
|
613
|
+
export interface FetchAgentResult {
|
|
614
|
+
agent: AgentSnapshotPayload;
|
|
615
|
+
project: ProjectPlacementPayload | null;
|
|
616
|
+
}
|
|
617
|
+
export interface WaitForFinishResult {
|
|
618
|
+
status: "idle" | "error" | "permission" | "timeout";
|
|
619
|
+
final: AgentSnapshotPayload | null;
|
|
620
|
+
error: string | null;
|
|
621
|
+
lastMessage: string | null;
|
|
622
|
+
}
|
|
623
|
+
export declare class DaemonClient {
|
|
624
|
+
private config;
|
|
625
|
+
private transport;
|
|
626
|
+
private transportCleanup;
|
|
627
|
+
private rawMessageListeners;
|
|
628
|
+
private messageHandlers;
|
|
629
|
+
private eventListeners;
|
|
630
|
+
private waiters;
|
|
631
|
+
private checkoutStatusInFlight;
|
|
632
|
+
private connectionListeners;
|
|
633
|
+
private reconnectTimeout;
|
|
634
|
+
private connectTimeout;
|
|
635
|
+
private pendingGenericTransportErrorTimeout;
|
|
636
|
+
private reconnectAttempt;
|
|
637
|
+
private shouldReconnect;
|
|
638
|
+
private connectPromise;
|
|
639
|
+
private connectResolve;
|
|
640
|
+
private connectReject;
|
|
641
|
+
private lastErrorValue;
|
|
642
|
+
private connectionState;
|
|
643
|
+
private checkoutDiffSubscriptions;
|
|
644
|
+
private terminalDirectorySubscriptions;
|
|
645
|
+
private readonly terminalStreams;
|
|
646
|
+
private pendingBinaryFileReads;
|
|
647
|
+
private activeBinaryFileTransfers;
|
|
648
|
+
private completedBinaryFileReads;
|
|
649
|
+
private readonly fileWatchRefCounts;
|
|
650
|
+
private logger;
|
|
651
|
+
private pendingSendQueue;
|
|
652
|
+
private readonly logConnectionPath;
|
|
653
|
+
private readonly logServerId;
|
|
654
|
+
private readonly logClientIdHash;
|
|
655
|
+
private readonly logGeneration;
|
|
656
|
+
private lastServerInfoMessage;
|
|
657
|
+
private runtimeMetricsInterval;
|
|
658
|
+
private runtimeMetrics;
|
|
659
|
+
private pingProbe;
|
|
660
|
+
private livenessHeartbeatTimer;
|
|
661
|
+
private lastLivenessRttMs;
|
|
662
|
+
private consecutiveLivenessFailures;
|
|
663
|
+
constructor(config: DaemonClientConfig);
|
|
664
|
+
connect(): Promise<void>;
|
|
665
|
+
private attemptConnect;
|
|
666
|
+
private resolveConnect;
|
|
667
|
+
private rejectConnect;
|
|
668
|
+
close(): Promise<void>;
|
|
669
|
+
ensureConnected(): void;
|
|
670
|
+
getConnectionState(): ConnectionState;
|
|
671
|
+
subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void;
|
|
672
|
+
get isConnected(): boolean;
|
|
673
|
+
get isConnecting(): boolean;
|
|
674
|
+
get lastError(): string | null;
|
|
675
|
+
getLastLivenessRttMs(): number | null;
|
|
676
|
+
subscribe(handler: DaemonEventHandler): () => void;
|
|
677
|
+
subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void;
|
|
678
|
+
on<TType extends SessionOutboundMessage["type"]>(type: TType, handler: (message: Extract<SessionOutboundMessage, {
|
|
679
|
+
type: TType;
|
|
680
|
+
}>) => void): () => void;
|
|
681
|
+
on(handler: DaemonEventHandler): () => void;
|
|
682
|
+
/**
|
|
683
|
+
* Send a session message. For fire-and-forget messages (heartbeats, etc.),
|
|
684
|
+
* failures are suppressed if `suppressSendErrors` is configured.
|
|
685
|
+
* For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead.
|
|
686
|
+
*/
|
|
687
|
+
private sendSessionMessage;
|
|
688
|
+
private sendBinaryFrame;
|
|
689
|
+
/**
|
|
690
|
+
* Send a session message for RPC methods that create waiters.
|
|
691
|
+
* If the connection is still being established ("connecting"), the message
|
|
692
|
+
* is queued and will be sent once connected (or rejected after timeout).
|
|
693
|
+
* This prevents waiters from hanging forever when called during connection.
|
|
694
|
+
*/
|
|
695
|
+
private sendSessionMessageOrThrow;
|
|
696
|
+
/**
|
|
697
|
+
* Flush pending send queue - called when connection is established.
|
|
698
|
+
*/
|
|
699
|
+
private flushPendingSendQueue;
|
|
700
|
+
/**
|
|
701
|
+
* Reject all pending sends - called when connection fails or is closed.
|
|
702
|
+
*/
|
|
703
|
+
private rejectPendingSendQueue;
|
|
704
|
+
private sendRequest;
|
|
705
|
+
private sendCorrelatedRequest;
|
|
706
|
+
private sendCorrelatedSessionRequest;
|
|
707
|
+
private sendNamespacedCorrelatedSessionRequest;
|
|
708
|
+
private sendSessionMessageStrict;
|
|
709
|
+
clearAgentAttention(agentId: string | string[]): Promise<void>;
|
|
710
|
+
clearWorkspaceAttention(workspaceId: string | string[]): Promise<void>;
|
|
711
|
+
sendHeartbeat(params: {
|
|
712
|
+
deviceType: "web" | "mobile";
|
|
713
|
+
focusedAgentId: string | null;
|
|
714
|
+
focusedTerminalId?: string | null;
|
|
715
|
+
lastActivityAt: string;
|
|
716
|
+
appVisible: boolean;
|
|
717
|
+
appVisibilityChangedAt?: string;
|
|
718
|
+
}): void;
|
|
719
|
+
registerPushToken(token: string): void;
|
|
720
|
+
ping(params?: {
|
|
721
|
+
requestId?: string;
|
|
722
|
+
timeoutMs?: number;
|
|
723
|
+
}): Promise<{
|
|
724
|
+
requestId: string;
|
|
725
|
+
clientSentAt: number;
|
|
726
|
+
serverReceivedAt: number;
|
|
727
|
+
serverSentAt: number;
|
|
728
|
+
rttMs: number;
|
|
729
|
+
}>;
|
|
730
|
+
measureLatency(params?: {
|
|
731
|
+
timeoutMs?: number;
|
|
732
|
+
}): Promise<number>;
|
|
733
|
+
private livenessPing;
|
|
734
|
+
private sendPingAwaitRtt;
|
|
735
|
+
private startLivenessHeartbeat;
|
|
736
|
+
private stopLivenessHeartbeat;
|
|
737
|
+
private scheduleNextLivenessHeartbeat;
|
|
738
|
+
fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
|
|
739
|
+
fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
|
|
740
|
+
fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
|
|
741
|
+
fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
|
|
742
|
+
openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
|
|
743
|
+
addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
|
|
744
|
+
startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
745
|
+
type: "start_workspace_script_response";
|
|
746
|
+
}>["payload"]>;
|
|
747
|
+
archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
|
|
748
|
+
fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
|
|
749
|
+
fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
750
|
+
fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
|
|
751
|
+
fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
752
|
+
private resubscribeCheckoutDiffSubscriptions;
|
|
753
|
+
private resubscribeTerminalDirectorySubscriptions;
|
|
754
|
+
private resubscribeFileWatches;
|
|
755
|
+
createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
|
|
756
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
757
|
+
archiveAgent(agentId: string): Promise<{
|
|
758
|
+
archivedAt: string;
|
|
759
|
+
}>;
|
|
760
|
+
detachAgent(agentId: string): Promise<void>;
|
|
761
|
+
/**
|
|
762
|
+
* Stop a running observed subagent (Claude Task / ultracode fan-out). The
|
|
763
|
+
* daemon resolves the observed subagent to its owning provider task and calls
|
|
764
|
+
* the provider's stopTask. See projects/observed-subagents/observed-subagents.md.
|
|
765
|
+
*/
|
|
766
|
+
stopObservedSubagent(agentId: string): Promise<void>;
|
|
767
|
+
updateAgent(agentId: string, updates: {
|
|
768
|
+
name?: string;
|
|
769
|
+
labels?: Record<string, string>;
|
|
770
|
+
}): Promise<void>;
|
|
771
|
+
renameProject(projectId: string, customName: string | null, requestId?: string): Promise<{
|
|
772
|
+
customName: string | null;
|
|
773
|
+
}>;
|
|
774
|
+
removeProject(projectId: string, requestId?: string): Promise<{
|
|
775
|
+
removedWorkspaceIds: string[];
|
|
776
|
+
}>;
|
|
777
|
+
setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
|
|
778
|
+
title: string | null;
|
|
779
|
+
}>;
|
|
780
|
+
resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
|
|
781
|
+
importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
|
|
782
|
+
refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
|
|
783
|
+
fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
|
|
784
|
+
buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
|
|
785
|
+
sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
|
|
786
|
+
sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
|
|
787
|
+
rewindAgent(agentId: string, messageId: string, mode: "conversation" | "files" | "both"): Promise<AgentRewindResponseMessage["payload"]>;
|
|
788
|
+
cancelAgent(agentId: string): Promise<void>;
|
|
789
|
+
setAgentMode(agentId: string, modeId: string): Promise<AgentProviderNotice | null>;
|
|
790
|
+
setAgentModel(agentId: string, modelId: string | null): Promise<void>;
|
|
791
|
+
setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
|
|
792
|
+
setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<AgentProviderNotice | null>;
|
|
793
|
+
/**
|
|
794
|
+
* Live-switch a running agent's personality (null clears it). The daemon
|
|
795
|
+
* re-resolves the roster id against the agent's cwd and applies the full
|
|
796
|
+
* personality — system prompt, identity, model/mode/effort — restarting the
|
|
797
|
+
* provider query so the prompt takes effect on the next turn. Gate on
|
|
798
|
+
* server_info.features.setAgentPersonality.
|
|
799
|
+
*/
|
|
800
|
+
setAgentPersonality(agentId: string, personalityId: string | null): Promise<AgentProviderNotice | null>;
|
|
801
|
+
restartServer(reason?: string, requestId?: string): Promise<RestartRequestedStatusPayload>;
|
|
802
|
+
shutdownServer(options?: ShutdownServerOptions): Promise<ShutdownRequestedStatusPayload>;
|
|
803
|
+
updateDaemon(requestId?: string): Promise<DaemonUpdateResponse["payload"]>;
|
|
804
|
+
setVoiceMode(enabled: boolean, agentId?: string): Promise<SetVoiceModePayload>;
|
|
805
|
+
sendVoiceAudioChunk(audio: string, format: string, isLast?: boolean): Promise<void>;
|
|
806
|
+
startDictationStream(dictationId: string, format: string): Promise<void>;
|
|
807
|
+
sendDictationStreamChunk(dictationId: string, seq: number, audio: string, format: string): void;
|
|
808
|
+
finishDictationStream(dictationId: string, finalSeq: number): Promise<{
|
|
809
|
+
dictationId: string;
|
|
810
|
+
text: string;
|
|
811
|
+
}>;
|
|
812
|
+
cancelDictationStream(dictationId: string): void;
|
|
813
|
+
abortRequest(): Promise<void>;
|
|
814
|
+
audioPlayed(id: string): Promise<void>;
|
|
815
|
+
getCheckoutStatus(cwd: string, options?: {
|
|
816
|
+
requestId?: string;
|
|
817
|
+
}): Promise<CheckoutStatusPayload>;
|
|
818
|
+
private normalizeCheckoutDiffCompare;
|
|
819
|
+
getCheckoutDiff(cwd: string, compare: {
|
|
820
|
+
mode: "uncommitted" | "base";
|
|
821
|
+
baseRef?: string;
|
|
822
|
+
ignoreWhitespace?: boolean;
|
|
823
|
+
}, requestId?: string): Promise<CheckoutDiffPayload>;
|
|
824
|
+
subscribeCheckoutDiff(cwd: string, compare: {
|
|
825
|
+
mode: "uncommitted" | "base";
|
|
826
|
+
baseRef?: string;
|
|
827
|
+
ignoreWhitespace?: boolean;
|
|
828
|
+
}, options?: {
|
|
829
|
+
subscriptionId?: string;
|
|
830
|
+
requestId?: string;
|
|
831
|
+
}): Promise<SubscribeCheckoutDiffPayload>;
|
|
832
|
+
unsubscribeCheckoutDiff(subscriptionId: string): void;
|
|
833
|
+
checkoutCommit(cwd: string, input: {
|
|
834
|
+
message?: string;
|
|
835
|
+
addAll?: boolean;
|
|
836
|
+
}, requestId?: string): Promise<CheckoutCommitPayload>;
|
|
837
|
+
checkoutMerge(cwd: string, input: {
|
|
838
|
+
baseRef?: string;
|
|
839
|
+
strategy?: "merge" | "squash";
|
|
840
|
+
requireCleanTarget?: boolean;
|
|
841
|
+
}, requestId?: string): Promise<CheckoutMergePayload>;
|
|
842
|
+
checkoutMergeFromBase(cwd: string, input: {
|
|
843
|
+
baseRef?: string;
|
|
844
|
+
requireCleanTarget?: boolean;
|
|
845
|
+
}, requestId?: string): Promise<CheckoutMergeFromBasePayload>;
|
|
846
|
+
checkoutPull(cwd: string, requestId?: string): Promise<CheckoutPullPayload>;
|
|
847
|
+
checkoutPush(cwd: string, requestId?: string): Promise<CheckoutPushPayload>;
|
|
848
|
+
checkoutRefresh(cwd: string, requestId?: string): Promise<CheckoutRefreshPayload>;
|
|
849
|
+
checkoutPrCreate(cwd: string, input: {
|
|
850
|
+
title?: string;
|
|
851
|
+
body?: string;
|
|
852
|
+
baseRef?: string;
|
|
853
|
+
}, requestId?: string): Promise<CheckoutPrCreatePayload>;
|
|
854
|
+
checkoutPrMerge(cwd: string, input: {
|
|
855
|
+
method: CheckoutPrMergeMethod;
|
|
856
|
+
}, requestId?: string): Promise<CheckoutPrMergePayload>;
|
|
857
|
+
checkoutGithubSetAutoMerge(cwd: string, input: {
|
|
858
|
+
enabled: true;
|
|
859
|
+
method: CheckoutPrMergeMethod;
|
|
860
|
+
} | {
|
|
861
|
+
enabled: false;
|
|
862
|
+
}, requestId?: string): Promise<CheckoutGithubSetAutoMergePayload>;
|
|
863
|
+
previewListConfig(cwd: string, requestId?: string): Promise<PreviewListConfigPayload>;
|
|
864
|
+
previewStart(cwd: string, name: string, requestId?: string): Promise<PreviewStartPayload>;
|
|
865
|
+
previewBindTab(serverId: string, browserId: string, requestId?: string): Promise<PreviewBindTabPayload>;
|
|
866
|
+
previewStop(serverId: string, requestId?: string): Promise<PreviewStopPayload>;
|
|
867
|
+
checkoutGithubGetCheckDetails(input: {
|
|
868
|
+
cwd: string;
|
|
869
|
+
repoOwner: string;
|
|
870
|
+
repoName: string;
|
|
871
|
+
checkRunId: number;
|
|
872
|
+
workflowRunId?: number;
|
|
873
|
+
}, requestId?: string): Promise<CheckoutGithubGetCheckDetailsPayload>;
|
|
874
|
+
checkoutPrStatus(cwd: string, requestId?: string): Promise<CheckoutPrStatusPayload>;
|
|
875
|
+
pullRequestTimeline(input: {
|
|
876
|
+
cwd: string;
|
|
877
|
+
prNumber: number;
|
|
878
|
+
repoOwner: string;
|
|
879
|
+
repoName: string;
|
|
880
|
+
}, requestId?: string): Promise<PullRequestTimelinePayload>;
|
|
881
|
+
checkoutSwitchBranch(cwd: string, branch: string, requestId?: string): Promise<CheckoutSwitchBranchPayload>;
|
|
882
|
+
renameBranch(input: RenameBranchInput): Promise<RenameBranchResult>;
|
|
883
|
+
stashSave(cwd: string, options?: {
|
|
884
|
+
branch?: string;
|
|
885
|
+
}, requestId?: string): Promise<StashSavePayload>;
|
|
886
|
+
stashPop(cwd: string, stashIndex: number, requestId?: string): Promise<StashPopPayload>;
|
|
887
|
+
stashList(cwd: string, options?: {
|
|
888
|
+
ottoOnly?: boolean;
|
|
889
|
+
}, requestId?: string): Promise<StashListPayload>;
|
|
890
|
+
getOttoWorktreeList(input: {
|
|
891
|
+
cwd?: string;
|
|
892
|
+
repoRoot?: string;
|
|
893
|
+
}, requestId?: string): Promise<OttoWorktreeListPayload>;
|
|
894
|
+
archiveOttoWorktree(input: {
|
|
895
|
+
worktreePath?: string;
|
|
896
|
+
repoRoot?: string;
|
|
897
|
+
branchName?: string;
|
|
898
|
+
workspaceId?: string;
|
|
899
|
+
scope?: "workspace" | "worktree";
|
|
900
|
+
}, requestId?: string): Promise<OttoWorktreeArchivePayload>;
|
|
901
|
+
createOttoWorktree(input: CreateOttoWorktreeInput, requestId?: string): Promise<CreateOttoWorktreePayload>;
|
|
902
|
+
createWorkspace(input: {
|
|
903
|
+
source: WorkspaceCreateRequest["source"];
|
|
904
|
+
title?: string;
|
|
905
|
+
firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
|
|
906
|
+
}, requestId?: string): Promise<WorkspaceCreatePayload>;
|
|
907
|
+
validateBranch(options: {
|
|
908
|
+
cwd: string;
|
|
909
|
+
branchName: string;
|
|
910
|
+
}, requestId?: string): Promise<ValidateBranchPayload>;
|
|
911
|
+
getBranchSuggestions(options: {
|
|
912
|
+
cwd: string;
|
|
913
|
+
query?: string;
|
|
914
|
+
limit?: number;
|
|
915
|
+
}, requestId?: string): Promise<BranchSuggestionsPayload>;
|
|
916
|
+
searchGitHub(options: {
|
|
917
|
+
cwd: string;
|
|
918
|
+
query: string;
|
|
919
|
+
limit?: number;
|
|
920
|
+
kinds?: GitHubSearchRequest["kinds"];
|
|
921
|
+
}, requestId?: string): Promise<GitHubSearchPayload>;
|
|
922
|
+
searchHosting(options: {
|
|
923
|
+
cwd: string;
|
|
924
|
+
query: string;
|
|
925
|
+
limit?: number;
|
|
926
|
+
kinds?: HostingSearchRequest["kinds"];
|
|
927
|
+
}, requestId?: string): Promise<HostingSearchPayload>;
|
|
928
|
+
getHostingAuthStatus(options: {
|
|
929
|
+
provider: GitHostingProviderId;
|
|
930
|
+
}, requestId?: string): Promise<HostingAuthStatusPayload>;
|
|
931
|
+
getDirectorySuggestions(options: {
|
|
932
|
+
query: string;
|
|
933
|
+
limit?: number;
|
|
934
|
+
cwd?: string;
|
|
935
|
+
includeFiles?: boolean;
|
|
936
|
+
includeDirectories?: boolean;
|
|
937
|
+
matchMode?: "fuzzy" | "suffix";
|
|
938
|
+
}, requestId?: string): Promise<DirectorySuggestionsPayload>;
|
|
939
|
+
private requestFileExplorer;
|
|
940
|
+
listDirectory(cwd: string, path: string, requestId?: string): Promise<FileExplorerDirectoryPayload>;
|
|
941
|
+
readFile(cwd: string, path: string, requestId?: string): Promise<FileReadResult>;
|
|
942
|
+
/**
|
|
943
|
+
* Text-editor read: inline JSON path so the payload carries the editor's
|
|
944
|
+
* save-precondition baseline (modifiedAt, eol, hash) alongside the content.
|
|
945
|
+
*/
|
|
946
|
+
readTextFile(cwd: string, path: string, requestId?: string): Promise<TextFileReadResult>;
|
|
947
|
+
/** Conditional save — see FileWriteRequestSchema for the no-clobber contract. */
|
|
948
|
+
writeFile(options: FileWriteOptions): Promise<FileWriteResult>;
|
|
949
|
+
/**
|
|
950
|
+
* Project-wide search. Per-file results stream through onFileResult (the
|
|
951
|
+
* daemon emits them in order, before the summary response resolves); the
|
|
952
|
+
* returned summary carries the completion status and totals.
|
|
953
|
+
*/
|
|
954
|
+
searchFiles(options: FileSearchOptions): Promise<FileSearchSummary>;
|
|
955
|
+
/** Gitignore-aware workspace file listing for the fuzzy finder. */
|
|
956
|
+
listCodeFiles(cwd: string, requestId?: string): Promise<CodeListFilesResultPayload>;
|
|
957
|
+
/** Name-based go-to-definition: one hit jumps, multiple hits are a picker. */
|
|
958
|
+
findCodeSymbols(cwd: string, name: string, requestId?: string): Promise<CodeSymbolLocation[]>;
|
|
959
|
+
/** Definition symbols for a single file (document outline). */
|
|
960
|
+
getCodeOutline(cwd: string, path: string, requestId?: string): Promise<CodeSymbolLocation[]>;
|
|
961
|
+
/** Preview-first project replace — see FileReplaceRequestSchema. */
|
|
962
|
+
replaceFiles(options: {
|
|
963
|
+
cwd: string;
|
|
964
|
+
replacement: string;
|
|
965
|
+
files: FileReplaceFilesInput;
|
|
966
|
+
requestId?: string;
|
|
967
|
+
}): Promise<FileReplaceResultPayload>;
|
|
968
|
+
/**
|
|
969
|
+
* Watch a workspace file for external changes. Reference-counted per
|
|
970
|
+
* (cwd, path): the daemon subscription is created for the first watcher and
|
|
971
|
+
* torn down when the last disposer runs; events fan out to every caller.
|
|
972
|
+
*/
|
|
973
|
+
watchFile(cwd: string, path: string, onEvent: (event: FileWatchEventPayload) => void): () => void;
|
|
974
|
+
uploadFile(input: FileUploadInput): Promise<FileUploadResult>;
|
|
975
|
+
requestDownloadToken(cwd: string, path: string, requestId?: string): Promise<FileDownloadTokenPayload>;
|
|
976
|
+
requestProjectIcon(cwd: string, requestId?: string): Promise<ProjectIconResponse["payload"]>;
|
|
977
|
+
listProviderModels(provider: AgentProvider, options?: {
|
|
978
|
+
cwd?: string;
|
|
979
|
+
requestId?: string;
|
|
980
|
+
}): Promise<ListProviderModelsPayload>;
|
|
981
|
+
listProviderModes(provider: AgentProvider, options?: {
|
|
982
|
+
cwd?: string;
|
|
983
|
+
requestId?: string;
|
|
984
|
+
}): Promise<ListProviderModesPayload>;
|
|
985
|
+
listProviderFeatures(draftConfig: ListCommandsDraftConfig, options?: {
|
|
986
|
+
requestId?: string;
|
|
987
|
+
}): Promise<ListProviderFeaturesPayload>;
|
|
988
|
+
listAvailableProviders(options?: {
|
|
989
|
+
requestId?: string;
|
|
990
|
+
}): Promise<ListAvailableProvidersPayload>;
|
|
991
|
+
getProvidersSnapshot(options?: {
|
|
992
|
+
cwd?: string;
|
|
993
|
+
requestId?: string;
|
|
994
|
+
}): Promise<GetProvidersSnapshotPayload>;
|
|
995
|
+
getDaemonConfig(requestId?: string): Promise<{
|
|
996
|
+
requestId: string;
|
|
997
|
+
config: MutableDaemonConfig;
|
|
998
|
+
}>;
|
|
999
|
+
getDaemonStatus(options?: DaemonStatusOptions): Promise<DaemonStatusPayload>;
|
|
1000
|
+
getDaemonPairingOffer(options?: DaemonPairingOfferOptions): Promise<DaemonPairingOfferPayload>;
|
|
1001
|
+
collectDiagnostics(requestId?: string): Promise<DiagnosticsPayload>;
|
|
1002
|
+
patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
|
|
1003
|
+
requestId: string;
|
|
1004
|
+
config: MutableDaemonConfig;
|
|
1005
|
+
}>;
|
|
1006
|
+
getSpeechSettingsOptions(requestId?: string): Promise<{
|
|
1007
|
+
requestId: string;
|
|
1008
|
+
options: SpeechSettingsOptions;
|
|
1009
|
+
}>;
|
|
1010
|
+
previewTtsVoice(params: {
|
|
1011
|
+
text: string;
|
|
1012
|
+
voice?: {
|
|
1013
|
+
provider?: string;
|
|
1014
|
+
model?: string;
|
|
1015
|
+
name: string;
|
|
1016
|
+
};
|
|
1017
|
+
}, requestId?: string): Promise<SpeechTtsPreviewResult>;
|
|
1018
|
+
getPersonalityStats(requestId?: string): Promise<{
|
|
1019
|
+
requestId: string;
|
|
1020
|
+
stats: Record<string, number>;
|
|
1021
|
+
}>;
|
|
1022
|
+
sendBrowserAutomationExecuteResponse(response: BrowserAutomationExecuteResponse): void;
|
|
1023
|
+
readProjectConfig(repoRoot: string, requestId?: string): Promise<ReadProjectConfigPayload>;
|
|
1024
|
+
writeProjectConfig(input: WriteProjectConfigInput): Promise<WriteProjectConfigPayload>;
|
|
1025
|
+
refreshProvidersSnapshot(options?: {
|
|
1026
|
+
cwd?: string;
|
|
1027
|
+
providers?: AgentProvider[];
|
|
1028
|
+
requestId?: string;
|
|
1029
|
+
}): Promise<RefreshProvidersSnapshotPayload>;
|
|
1030
|
+
getProviderDiagnostic(provider: AgentProvider, options?: {
|
|
1031
|
+
requestId?: string;
|
|
1032
|
+
}): Promise<ProviderDiagnosticPayload>;
|
|
1033
|
+
listProviderUsage(options?: {
|
|
1034
|
+
requestId?: string;
|
|
1035
|
+
}): Promise<ProviderUsageListPayload>;
|
|
1036
|
+
getAgentContextUsage(agentId: string, options?: {
|
|
1037
|
+
requestId?: string;
|
|
1038
|
+
}): Promise<AgentContextGetUsagePayload>;
|
|
1039
|
+
listCommands(options: ListCommandsOptions): Promise<ListCommandsPayload>;
|
|
1040
|
+
listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
|
|
1041
|
+
listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise<ListCommandsPayload>;
|
|
1042
|
+
respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
|
|
1043
|
+
respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
|
|
1044
|
+
waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
|
|
1045
|
+
waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
|
|
1046
|
+
subscribeTerminals(input: {
|
|
1047
|
+
cwd: string;
|
|
1048
|
+
workspaceId?: string;
|
|
1049
|
+
}): void;
|
|
1050
|
+
unsubscribeTerminals(input: {
|
|
1051
|
+
cwd: string;
|
|
1052
|
+
workspaceId?: string;
|
|
1053
|
+
}): void;
|
|
1054
|
+
listTerminals(cwd?: string, requestId?: string, options?: {
|
|
1055
|
+
workspaceId?: string;
|
|
1056
|
+
}): Promise<ListTerminalsPayload>;
|
|
1057
|
+
createTerminal(cwd: string, name?: string, requestId?: string, options?: {
|
|
1058
|
+
agentId?: string;
|
|
1059
|
+
command?: string;
|
|
1060
|
+
args?: string[];
|
|
1061
|
+
workspaceId?: string;
|
|
1062
|
+
}): Promise<CreateTerminalPayload>;
|
|
1063
|
+
renameTerminal(input: RenameTerminalInput): Promise<RenameTerminalResult>;
|
|
1064
|
+
subscribeTerminal(terminalId: string, optionsOrRequestId?: {
|
|
1065
|
+
restore?: SubscribeTerminalRequest["restore"];
|
|
1066
|
+
requestId?: string;
|
|
1067
|
+
} | string): Promise<SubscribeTerminalPayload>;
|
|
1068
|
+
unsubscribeTerminal(terminalId: string): void;
|
|
1069
|
+
sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
|
|
1070
|
+
killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
|
|
1071
|
+
closeItems(input: {
|
|
1072
|
+
agentIds?: string[];
|
|
1073
|
+
terminalIds?: string[];
|
|
1074
|
+
}, requestId?: string): Promise<CloseItemsPayload>;
|
|
1075
|
+
captureTerminal(terminalId: string, options?: {
|
|
1076
|
+
start?: number;
|
|
1077
|
+
end?: number;
|
|
1078
|
+
stripAnsi?: boolean;
|
|
1079
|
+
}, requestId?: string): Promise<CaptureTerminalPayload>;
|
|
1080
|
+
createChatRoom(options: CreateChatRoomOptions): Promise<ChatCreatePayload>;
|
|
1081
|
+
listChatRooms(requestId?: string): Promise<ChatListPayload>;
|
|
1082
|
+
inspectChatRoom(options: InspectChatRoomOptions): Promise<ChatInspectPayload>;
|
|
1083
|
+
deleteChatRoom(options: DeleteChatRoomOptions): Promise<ChatDeletePayload>;
|
|
1084
|
+
postChatMessage(options: PostChatMessageOptions): Promise<ChatPostPayload>;
|
|
1085
|
+
readChatMessages(options: ReadChatMessagesOptions): Promise<ChatReadPayload>;
|
|
1086
|
+
waitForChatMessages(options: WaitForChatMessagesOptions): Promise<ChatWaitPayload>;
|
|
1087
|
+
scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
|
|
1088
|
+
scheduleList(requestId?: string): Promise<ScheduleListPayload>;
|
|
1089
|
+
scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
|
|
1090
|
+
scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
|
|
1091
|
+
schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
|
|
1092
|
+
scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
|
|
1093
|
+
scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
|
|
1094
|
+
scheduleRunOnce(options: InspectScheduleOptions): Promise<ScheduleRunOncePayload>;
|
|
1095
|
+
scheduleUpdate(options: UpdateScheduleOptions): Promise<ScheduleUpdatePayload>;
|
|
1096
|
+
artifactList(options?: {
|
|
1097
|
+
projectId?: string;
|
|
1098
|
+
requestId?: string;
|
|
1099
|
+
}): Promise<ArtifactListPayload>;
|
|
1100
|
+
artifactCreate(options: {
|
|
1101
|
+
name: string;
|
|
1102
|
+
description: string;
|
|
1103
|
+
projectId: string;
|
|
1104
|
+
provider: string;
|
|
1105
|
+
model?: string;
|
|
1106
|
+
modeId?: string;
|
|
1107
|
+
thinkingOptionId?: string;
|
|
1108
|
+
systemPrompt?: string;
|
|
1109
|
+
spinner?: {
|
|
1110
|
+
glowA: string;
|
|
1111
|
+
glowB: string;
|
|
1112
|
+
};
|
|
1113
|
+
requestId?: string;
|
|
1114
|
+
}): Promise<ArtifactCreatePayload>;
|
|
1115
|
+
artifactUpdate(options: {
|
|
1116
|
+
artifactId: string;
|
|
1117
|
+
name?: string;
|
|
1118
|
+
description?: string;
|
|
1119
|
+
projectId?: string;
|
|
1120
|
+
provider?: string;
|
|
1121
|
+
model?: string;
|
|
1122
|
+
thinkingOptionId?: string;
|
|
1123
|
+
requestId?: string;
|
|
1124
|
+
}): Promise<ArtifactUpdatePayload>;
|
|
1125
|
+
artifactRegenerate(options: {
|
|
1126
|
+
artifactId: string;
|
|
1127
|
+
requestId?: string;
|
|
1128
|
+
}): Promise<ArtifactRegeneratePayload>;
|
|
1129
|
+
artifactCancel(options: {
|
|
1130
|
+
artifactId: string;
|
|
1131
|
+
requestId?: string;
|
|
1132
|
+
}): Promise<ArtifactCancelPayload>;
|
|
1133
|
+
artifactDelete(options: {
|
|
1134
|
+
artifactId: string;
|
|
1135
|
+
requestId?: string;
|
|
1136
|
+
}): Promise<ArtifactDeletePayload>;
|
|
1137
|
+
artifactStar(options: {
|
|
1138
|
+
artifactId: string;
|
|
1139
|
+
starred: boolean;
|
|
1140
|
+
requestId?: string;
|
|
1141
|
+
}): Promise<ArtifactStarPayload>;
|
|
1142
|
+
artifactGetContent(options: {
|
|
1143
|
+
artifactId: string;
|
|
1144
|
+
requestId?: string;
|
|
1145
|
+
}): Promise<ArtifactGetContentPayload>;
|
|
1146
|
+
loopRun(options: RunLoopOptions): Promise<LoopRunPayload>;
|
|
1147
|
+
loopList(requestId?: string): Promise<LoopListPayload>;
|
|
1148
|
+
loopInspect(options: string | InspectLoopOptions): Promise<LoopInspectPayload>;
|
|
1149
|
+
loopLogs(options: string | LoopLogsOptions, afterSeq?: number): Promise<LoopLogsPayload>;
|
|
1150
|
+
loopStop(options: string | StopLoopOptions): Promise<LoopStopPayload>;
|
|
1151
|
+
onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
|
|
1152
|
+
waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
|
|
1153
|
+
private createRequestId;
|
|
1154
|
+
getLastServerInfoMessage(): ServerInfoStatusPayload | null;
|
|
1155
|
+
private resolveTransportUrlForAttempt;
|
|
1156
|
+
private sendHelloMessage;
|
|
1157
|
+
private disposeTransport;
|
|
1158
|
+
private cleanupTransport;
|
|
1159
|
+
private resetConnectTimeout;
|
|
1160
|
+
private handleTransportMessage;
|
|
1161
|
+
private handleJsonPayload;
|
|
1162
|
+
private tryHandleBinaryFrame;
|
|
1163
|
+
private handleFileTransferFrame;
|
|
1164
|
+
private updateConnectionState;
|
|
1165
|
+
setReconnectEnabled(enabled: boolean): void;
|
|
1166
|
+
private scheduleReconnect;
|
|
1167
|
+
private emitDisconnectedStateForReconnect;
|
|
1168
|
+
private armReconnectTimer;
|
|
1169
|
+
private resolvePingProbe;
|
|
1170
|
+
private clearPingProbe;
|
|
1171
|
+
private rejectPingProbe;
|
|
1172
|
+
private recordLivenessFailure;
|
|
1173
|
+
private handleSessionMessage;
|
|
1174
|
+
private resolveWaiters;
|
|
1175
|
+
private clearWaiters;
|
|
1176
|
+
private toEvent;
|
|
1177
|
+
private waitForWithCancel;
|
|
1178
|
+
}
|
|
1179
|
+
//# sourceMappingURL=daemon-client.d.ts.map
|