@hyperdrive.bot/fleet-client 0.3.218 → 0.3.221

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.
Files changed (37) hide show
  1. package/README.md +39 -7
  2. package/dist/compat/normalize-provider-models.d.ts +2 -2
  3. package/dist/compat/normalize-provider-models.js +13 -4
  4. package/dist/connection/index.d.ts +50 -0
  5. package/dist/connection/index.js +119 -0
  6. package/dist/connection/legacy-workspaces.d.ts +19 -0
  7. package/dist/connection/legacy-workspaces.js +160 -0
  8. package/dist/connection/legacy.d.ts +31 -0
  9. package/dist/connection/legacy.js +245 -0
  10. package/dist/connection/owned.d.ts +36 -0
  11. package/dist/connection/owned.js +210 -0
  12. package/dist/creation/index.d.ts +40 -0
  13. package/dist/creation/index.js +197 -0
  14. package/dist/daemon-client-relay-e2ee-transport.d.ts +1 -0
  15. package/dist/daemon-client-relay-e2ee-transport.js +10 -6
  16. package/dist/daemon-client-transport-types.d.ts +1 -1
  17. package/dist/daemon-client-transport-utils.d.ts +5 -1
  18. package/dist/daemon-client-transport-utils.js +8 -6
  19. package/dist/daemon-client-transport.d.ts +2 -2
  20. package/dist/daemon-client-transport.js +2 -2
  21. package/dist/daemon-client-websocket-transport.d.ts +4 -0
  22. package/dist/daemon-client-websocket-transport.js +23 -3
  23. package/dist/daemon-client.d.ts +1372 -925
  24. package/dist/daemon-client.js +4073 -2691
  25. package/dist/index.d.ts +197 -66
  26. package/dist/index.js +435 -72
  27. package/dist/legacy-usage-icons.d.ts +2 -0
  28. package/dist/legacy-usage-icons.js +16 -0
  29. package/dist/provider-snapshots/index.d.ts +21 -0
  30. package/dist/provider-snapshots/index.js +56 -0
  31. package/dist/terminal-stream-router.d.ts +7 -10
  32. package/dist/terminal-stream-router.js +41 -87
  33. package/dist/terminals/index.d.ts +69 -0
  34. package/dist/terminals/index.js +103 -0
  35. package/dist/timeline-subscription/index.d.ts +25 -0
  36. package/dist/timeline-subscription/index.js +56 -0
  37. package/package.json +10 -6
@@ -1,16 +1,16 @@
1
+ import { type TimelineMessage } from "./timeline-subscription/index.js";
2
+ import { type OwnedSubscription, type TimelineSubscription } from "./connection/index.js";
3
+ import { type CreationSnapshot, type SessionEventSubscription, AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload, type AgentStreamEventPayload, type AgentSnapshotPayload, type ProjectPlacementPayload, type AgentPermissionResolvedMessage, type CreateAgentRequestMessage, type CreatePaseoWorktreeRequest, type FileDownloadTokenResponse, type FileUploadResponse, type FileExplorerResponse, type FileVersion, type FileWriteResult, type FetchAgentTimelineResponseMessage, type AgentForkContextResponseMessage, type GitSetupOptions, type CheckoutStatusResponse, type CheckoutCommit, type ParsedDiffFile, type CheckoutCommitResponse, type CheckoutMergeResponse, type CheckoutMergeFromBaseResponse, type CheckoutPullResponse, type CheckoutPushResponse, type CheckoutRefreshResponse, type CheckoutPrCreateResponse, type CheckoutPrMergeResponse, type CheckoutPrMergeMethod, type CheckoutForgeSetAutoMergeResponse, type CheckoutGithubSetAutoMergeResponse, type CheckoutForgeGetCheckDetailsResponse, type CheckoutGithubGetCheckDetailsResponse, type CheckoutPrStatusResponse, type PullRequestTimelineResponse, type CheckoutSwitchBranchResponse, type StashSaveResponse, type StashPopResponse, type StashListResponse, type ValidateBranchResponse, type BranchSuggestionsResponse, type ForgeSearchResponse, type ForgeSearchRequest, type GitHubSearchResponse, type GitHubSearchRequest, type DirectorySuggestionsResponse, type PaseoWorktreeListResponse, type PaseoWorktreeArchiveResponse, type ProjectIconSource, type ProjectIconResponse, type ProjectIconGetResponse, type ProjectAddResponse, type ProjectCreateDirectoryResponse, type OpenProjectResponseMessage, type WorkspaceGithubSearchRepositoriesResponse, type ProjectGithubCloneProtocol, type ProjectGithubCloneResponse, type ArchiveWorkspaceResponseMessage, type WorkspaceSetupStatusResponseMessage, type ListCommandsResponse, type ListProviderFeaturesResponseMessage, type ListProviderModelsResponseMessage, type ListProviderModesResponseMessage, type ListAvailableProvidersResponse, type GetProvidersSnapshotResponseMessage, type RefreshProvidersSnapshotResponseMessage, type ProviderDiagnosticResponseMessage, type ProviderUsageListResponseMessage, type UsageListReportsResponseMessage, type DaemonGetStatusResponse, type DaemonGetPairingOfferResponse, type DaemonConfigReloadResponse, type DiagnosticsResponse, type AgentRewindResponseMessage, type ListTerminalsResponse, type CreateTerminalResponse, type SubscribeTerminalResponse, type SubscribeTerminalRequest, type CloseItemsResponse, type KillTerminalResponse, type CaptureTerminalResponse, type TerminalInput, type SessionInboundMessage, type SessionOutboundMessage, type SendAgentMessageRequest, type PaseoConfigRaw, type PaseoConfigRevision, type WorkspaceCreateRequest, type WorkspaceRecoveryState, type PluginListItem, type PluginLogEntry, type PluginSourceStatusItem, type PluginSourceUpdateItem, type PluginUpdateSelection, type PluginUpdateProposal, type PluginUpdatePreview, type PluginUpdateResult, type AgentSkillSelection, type AgentSkillsStatus, type AgentSkillsSaveResult, type AgentConfigApply, type MutableDaemonConfig, type MutableDaemonConfigPatch, type AgentSnoozeState, type InstalledExtension, type CaptureAgentPaneResponse, type ProjectRenameResponse, type BackgroundTaskPayload, type ReferenceEnrichment, type SessionDigest, type SessionDigestLink, type WatchNotificationActionMessage, type WatchSessionSearchMessage, type WatchComposerDictateMessage, type WorkflowAgentPreset, type WorkflowSnapshot, type WorkflowStatus, type WorkflowTaskGraph, type PendingDecision, type ExpiredDecisionRow, type ProvidersReloadConfigPayload, type FileUploadErrorCode } from "@hyperdrive.bot/fleet-protocol/messages";
1
4
  import type { z } from "zod";
2
- import { type ClientCapability } from "@hyperdrive.bot/fleet-protocol/client-capabilities";
3
- import { type AgentSnoozeState, AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ServerInfoStatusPayload } from "@hyperdrive.bot/fleet-protocol/messages";
4
- import type { SourceKind } from "@hyperdrive.bot/fleet-protocol/ingestion/types";
5
- import type { FilterDraft, FilterPatch } from "@hyperdrive.bot/fleet-protocol/ingestion/rpc-schemas";
6
- import type { ScheduleCadence } from "@hyperdrive.bot/fleet-protocol/schedule/types";
7
- import type { AgentStreamEventPayload, InstalledExtension, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileExplorerResponse, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconResponse, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureAgentPaneResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, ProjectRenameResponse, BackgroundTaskPayload, ReferenceEnrichment, SessionDigest, SessionDigestLink, WatchNotificationActionMessage, WatchSessionSearchMessage, WatchComposerDictateMessage, WorkflowAgentPreset, WorkflowSnapshot, WorkflowStatus, WorkflowTaskGraph, WorkspaceCreateRequest, PendingDecision, ExpiredDecisionRow } from "@hyperdrive.bot/fleet-protocol/messages";
5
+ import type { ClientCapability } from "@hyperdrive.bot/fleet-protocol/client-capabilities";
6
+ import type { AgentAttentionNotificationPayload } from "@hyperdrive.bot/fleet-protocol/agent-attention-notification";
8
7
  import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@hyperdrive.bot/fleet-protocol/agent-types";
9
- import type { MutableDaemonConfig, MutableDaemonConfigPatch, ProvidersReloadConfigPayload } from "@hyperdrive.bot/fleet-protocol/messages";
10
- import type { FileUploadErrorCode } from "@hyperdrive.bot/fleet-protocol/messages";
11
8
  import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
12
9
  import { type TerminalStreamEvent } from "./terminal-stream-router.js";
13
10
  import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@hyperdrive.bot/fleet-protocol/browser-automation/rpc-schemas";
11
+ import type { SourceKind } from "@hyperdrive.bot/fleet-protocol/ingestion/types";
12
+ import type { FilterDraft, FilterPatch } from "@hyperdrive.bot/fleet-protocol/ingestion/rpc-schemas";
13
+ import type { ScheduleCadence } from "@hyperdrive.bot/fleet-protocol/schedule/types";
14
14
  export interface Logger {
15
15
  debug(obj: object, msg?: string): void;
16
16
  info(obj: object, msg?: string): void;
@@ -19,6 +19,7 @@ export interface Logger {
19
19
  }
20
20
  interface ImportAgentInputBase {
21
21
  cwd?: string;
22
+ workspaceId?: string;
22
23
  labels?: Record<string, string>;
23
24
  }
24
25
  export type ImportAgentInput = (ImportAgentInputBase & {
@@ -28,6 +29,12 @@ export type ImportAgentInput = (ImportAgentInputBase & {
28
29
  provider: AgentProvider;
29
30
  sessionId: string;
30
31
  });
32
+ export type DaemonAuthFailureReason = "password_required" | "incorrect_password";
33
+ export declare class DaemonAuthenticationError extends Error {
34
+ readonly reason: DaemonAuthFailureReason;
35
+ constructor(reason: DaemonAuthFailureReason);
36
+ }
37
+ export declare function getDaemonAuthFailureReason(error: unknown): DaemonAuthFailureReason | null;
31
38
  export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js";
32
39
  export type { TerminalStreamEvent };
33
40
  export type ConnectionState = {
@@ -55,6 +62,11 @@ export type DaemonEvent = {
55
62
  payload: Extract<SessionOutboundMessage, {
56
63
  type: "workspace_update";
57
64
  }>["payload"];
65
+ } | {
66
+ type: "project.update";
67
+ payload: Extract<SessionOutboundMessage, {
68
+ type: "project.update";
69
+ }>["payload"];
58
70
  } | {
59
71
  type: "workspace_setup_progress";
60
72
  workspaceId: string;
@@ -98,12 +110,22 @@ export type DaemonEventHandler = (event: DaemonEvent) => void;
98
110
  export type BrowserAutomationExecuteRequestMessage = BrowserAutomationExecuteRequest;
99
111
  export type BrowserAutomationExecuteResponseMessage = BrowserAutomationExecuteResponse;
100
112
  export interface DaemonClientConfig {
113
+ /**
114
+ * Fork setting: how long a message queued while the transport is still
115
+ * connecting waits before it rejects. Lets a caller fail fast when the
116
+ * daemon is unreachable instead of blocking for the full RPC timeout.
117
+ */
118
+ defaultSendQueueTimeoutMs?: number;
119
+ /** Deliver compact bodies/hash references to a caller-owned snapshot cache.
120
+ * The default keeps public SDK snapshot entries expanded. */
121
+ providerSnapshots?: "wire";
101
122
  url: string;
102
123
  clientId: string;
103
- clientType?: "mobile" | "browser" | "cli" | "mcp";
124
+ clientType?: "mobile" | "browser" | "cli" | "mcp" | "hub";
104
125
  appVersion?: string;
105
126
  runtimeGeneration?: number | null;
106
127
  password?: string;
128
+ localCredential?: () => string | undefined | Promise<string | undefined>;
107
129
  authHeader?: string;
108
130
  suppressSendErrors?: boolean;
109
131
  transportFactory?: DaemonTransportFactory;
@@ -121,15 +143,7 @@ export interface DaemonClientConfig {
121
143
  };
122
144
  runtimeMetricsIntervalMs?: number;
123
145
  runtimeMetricsWindowMs?: number;
124
- /**
125
- * Override for how long a queued message waits for the WebSocket connection
126
- * before its send is rejected with "Timed out waiting for connection".
127
- * Defaults to {@link DEFAULT_SEND_QUEUE_TIMEOUT_MS} (10s). The mobile/host
128
- * runtime ships a 2s override (Story B.2 / FR2.2) so the UI can render a
129
- * "Reconnecting to daemon…" Suspense fallback quickly when the daemon is
130
- * unreachable, instead of blocking the JS thread for ~10s per failing RPC.
131
- */
132
- defaultSendQueueTimeoutMs?: number;
146
+ trace?: DaemonClientTrace;
133
147
  capabilities?: Partial<Record<ClientCapability, unknown>>;
134
148
  /**
135
149
  * Called once per request/response round trip that goes through the shared
@@ -139,30 +153,40 @@ export interface DaemonClientConfig {
139
153
  */
140
154
  onRequestComplete?: (event: DaemonRequestCompletion) => void;
141
155
  }
142
- export interface DaemonRequestCompletion {
143
- requestType: SessionInboundMessage["type"];
144
- durationMs: number;
145
- outcome: "ok" | "error" | "timeout";
146
- request: SessionInboundMessage;
147
- /** The selected response value on `ok`, otherwise undefined. */
148
- response?: unknown;
156
+ export interface DaemonClientTrace {
157
+ isEnabled(): boolean;
158
+ beginSection(name: string, args?: Record<string, string>): void;
159
+ endSection(): void;
149
160
  }
150
161
  export interface SendMessageOptions {
151
162
  messageId?: string;
163
+ /** What happens when the agent is mid-turn. The daemon interrupts the turn when omitted. */
164
+ activeTurnBehavior?: ActiveTurnBehavior;
152
165
  images?: Array<{
153
166
  data: string;
154
167
  mimeType: string;
155
168
  }>;
156
169
  attachments?: SendAgentMessageRequest["attachments"];
157
170
  }
171
+ export interface AgentAttentionRequiredNotification {
172
+ agentId: string;
173
+ reason: "finished" | "error" | "permission";
174
+ timestamp: string;
175
+ shouldNotify: boolean;
176
+ notification?: AgentAttentionNotificationPayload;
177
+ }
158
178
  type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
159
179
  export interface CreateAgentRequestOptions extends AgentConfigOverrides {
180
+ agentId?: string;
181
+ onEvent?: (snapshot: CreationSnapshot) => void;
160
182
  config?: AgentSessionConfig;
161
183
  provider?: AgentProvider;
162
184
  cwd?: string;
163
185
  env?: CreateAgentRequestMessage["env"];
164
186
  workspaceId?: string;
187
+ callerAgentId?: string;
165
188
  initialPrompt?: string;
189
+ idempotencyKey?: string;
166
190
  clientMessageId?: string;
167
191
  outputSchema?: Record<string, unknown>;
168
192
  images?: CreateAgentRequestMessage["images"];
@@ -176,7 +200,17 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
176
200
  resumeSessionId?: string;
177
201
  routine?: CreateAgentRequestMessage["routine"];
178
202
  }
179
- export interface CreatePaseoWorktreeInput extends Pick<CreatePaseoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "githubPrNumber"> {
203
+ export interface CreateWorkspaceRequestOptions {
204
+ source: WorkspaceCreateRequest["source"];
205
+ title?: string;
206
+ idempotencyKey?: string;
207
+ workspaceId?: string;
208
+ agent?: Omit<CreateAgentRequestOptions, "workspaceId" | "onEvent" | "worktree" | "git" | "worktreeName" | "idempotencyKey" | "requestId">;
209
+ onEvent?: (snapshot: CreationSnapshot) => void;
210
+ firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
211
+ requestId?: string;
212
+ }
213
+ export interface CreatePaseoWorktreeInput extends Pick<CreatePaseoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "checkoutSource" | "githubPrNumber"> {
180
214
  }
181
215
  type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
182
216
  type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
@@ -191,24 +225,20 @@ type CheckoutPushPayload = CheckoutPushResponse["payload"];
191
225
  type CheckoutRefreshPayload = CheckoutRefreshResponse["payload"];
192
226
  type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"];
193
227
  type CheckoutPrMergePayload = CheckoutPrMergeResponse["payload"];
228
+ type CheckoutForgeSetAutoMergePayload = CheckoutForgeSetAutoMergeResponse["payload"];
194
229
  type CheckoutGithubSetAutoMergePayload = CheckoutGithubSetAutoMergeResponse["payload"];
230
+ type CheckoutForgeGetCheckDetailsPayload = CheckoutForgeGetCheckDetailsResponse["payload"];
195
231
  type CheckoutGithubGetCheckDetailsPayload = CheckoutGithubGetCheckDetailsResponse["payload"];
196
232
  type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"];
197
233
  type PullRequestTimelinePayload = PullRequestTimelineResponse["payload"];
198
234
  type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"];
199
- export interface AgentDecisionsExpireResult {
200
- dryRun: boolean;
201
- expired: ExpiredDecisionRow[];
202
- agents: number;
203
- archivedAgents: number;
204
- written: number;
205
- }
206
235
  export type RenameBranchResult = z.infer<typeof CheckoutRenameBranchResponseSchema>["payload"];
207
236
  type StashSavePayload = StashSaveResponse["payload"];
208
237
  type StashPopPayload = StashPopResponse["payload"];
209
238
  type StashListPayload = StashListResponse["payload"];
210
239
  type ValidateBranchPayload = ValidateBranchResponse["payload"];
211
240
  type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
241
+ type ForgeSearchPayload = ForgeSearchResponse["payload"];
212
242
  type GitHubSearchPayload = GitHubSearchResponse["payload"];
213
243
  type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
214
244
  type PaseoWorktreeListPayload = PaseoWorktreeListResponse["payload"];
@@ -229,7 +259,17 @@ export interface FileReadResult {
229
259
  path: string;
230
260
  kind: LegacyFileExplorerFilePayload["kind"];
231
261
  modifiedAt: string;
262
+ revision?: string;
263
+ }
264
+ export interface FileUploadInput {
265
+ fileName: string;
266
+ mimeType: string;
267
+ bytes: Uint8Array | ArrayBuffer;
268
+ modifiedAt?: string;
269
+ requestId?: string;
270
+ chunkSize?: number;
232
271
  }
272
+ export type FileUploadResult = FileUploadResponse["payload"];
233
273
  type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"];
234
274
  type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"];
235
275
  type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"];
@@ -239,6 +279,7 @@ type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"
239
279
  type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"];
240
280
  type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"];
241
281
  type ProviderUsageListPayload = ProviderUsageListResponseMessage["payload"];
282
+ type UsageListReportsPayload = UsageListReportsResponseMessage["payload"];
242
283
  type DaemonStatusPayload = DaemonGetStatusResponse["payload"];
243
284
  type DaemonPairingOfferPayload = DaemonGetPairingOfferResponse["payload"];
244
285
  type DiagnosticsPayload = DiagnosticsResponse["payload"];
@@ -273,167 +314,12 @@ type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"];
273
314
  type CloseItemsPayload = CloseItemsResponse["payload"];
274
315
  type KillTerminalPayload = KillTerminalResponse["payload"];
275
316
  type CaptureTerminalPayload = CaptureTerminalResponse["payload"];
276
- type CaptureAgentPanePayload = CaptureAgentPaneResponse["payload"];
277
- type ChatCreatePayload = Extract<SessionOutboundMessage, {
278
- type: "chat/create/response";
279
- }>["payload"];
280
- type ChatListPayload = Extract<SessionOutboundMessage, {
281
- type: "chat/list/response";
282
- }>["payload"];
283
- type ChatInspectPayload = Extract<SessionOutboundMessage, {
284
- type: "chat/inspect/response";
285
- }>["payload"];
286
- type ChatDeletePayload = Extract<SessionOutboundMessage, {
287
- type: "chat/delete/response";
288
- }>["payload"];
289
- type ChatPostPayload = Extract<SessionOutboundMessage, {
290
- type: "chat/post/response";
291
- }>["payload"];
292
- type ChatReadPayload = Extract<SessionOutboundMessage, {
293
- type: "chat/read/response";
294
- }>["payload"];
295
- type ChatWaitPayload = Extract<SessionOutboundMessage, {
296
- type: "chat/wait/response";
297
- }>["payload"];
298
- type LoopRunPayload = Extract<SessionOutboundMessage, {
299
- type: "loop/run/response";
300
- }>["payload"];
301
- type LoopListPayload = Extract<SessionOutboundMessage, {
302
- type: "loop/list/response";
303
- }>["payload"];
304
- type LoopInspectPayload = Extract<SessionOutboundMessage, {
305
- type: "loop/inspect/response";
306
- }>["payload"];
307
- type LoopLogsPayload = Extract<SessionOutboundMessage, {
308
- type: "loop/logs/response";
309
- }>["payload"];
310
- type LoopStopPayload = Extract<SessionOutboundMessage, {
311
- type: "loop/stop/response";
312
- }>["payload"];
313
- type FleetListPayload = Extract<SessionOutboundMessage, {
314
- type: "fleet/list/response";
315
- }>["payload"];
316
- type FleetInspectPayload = Extract<SessionOutboundMessage, {
317
- type: "fleet/inspect/response";
318
- }>["payload"];
319
- type FleetRunNowPayload = Extract<SessionOutboundMessage, {
320
- type: "fleet/run-now/response";
321
- }>["payload"];
322
- type FleetPausePayload = Extract<SessionOutboundMessage, {
323
- type: "fleet/pause/response";
324
- }>["payload"];
325
- type FleetResumePayload = Extract<SessionOutboundMessage, {
326
- type: "fleet/resume/response";
327
- }>["payload"];
328
- type FleetAskPayload = Extract<SessionOutboundMessage, {
329
- type: "fleet/ask/response";
330
- }>["payload"];
331
- type FleetDecisionsPayload = Extract<SessionOutboundMessage, {
332
- type: "fleet/decisions/response";
333
- }>["payload"];
334
- type FleetResolveDecisionPayload = Extract<SessionOutboundMessage, {
335
- type: "fleet/resolve-decision/response";
336
- }>["payload"];
337
- type FleetSetParamsPayload = Extract<SessionOutboundMessage, {
338
- type: "fleet/set-params/response";
339
- }>["payload"];
340
- type FleetSetModePayload = Extract<SessionOutboundMessage, {
341
- type: "fleet/set-mode/response";
342
- }>["payload"];
343
- type FleetCreatePayload = Extract<SessionOutboundMessage, {
344
- type: "fleet/create/response";
345
- }>["payload"];
346
- type FleetExecutionsPayload = Extract<SessionOutboundMessage, {
347
- type: "fleet/executions/response";
348
- }>["payload"];
349
- export interface InspectFleetLoopOptions {
350
- requestId?: string;
351
- name: string;
352
- }
353
- export interface SetFleetLoopModeOptions {
354
- requestId?: string;
355
- name: string;
356
- mode: "live" | "dry-run";
357
- }
358
- export interface AskFleetDecisionOptions {
359
- requestId?: string;
360
- name: string;
361
- kind: "gate-approval" | "action-approval" | "outcome-review";
362
- question: string;
363
- posture: "blocking" | "deferring" | "advisory";
364
- options: Array<{
365
- id: string;
366
- label: string;
367
- effect: {
368
- kind: "act" | "rehearse" | "defer" | "suppress";
369
- reversibility: "reversible" | "compensable" | "irreversible";
370
- compensatingAction?: string;
371
- };
372
- }>;
373
- runId?: string;
374
- itemKey?: string;
375
- evidence?: string;
376
- onExpiry?: string;
377
- expiresInMs?: number;
378
- }
379
- export interface ListFleetDecisionsOptions {
380
- requestId?: string;
381
- name?: string;
382
- includeResolved?: boolean;
383
- }
384
- export interface ResolveFleetDecisionOptions {
385
- requestId?: string;
386
- decisionId: string;
387
- optionId: string;
388
- }
389
- export interface SetFleetLoopParamsOptions {
390
- requestId?: string;
391
- name: string;
392
- values: Record<string, string | number | boolean | string[]>;
393
- }
394
- export interface CreateFleetLoopOptions {
395
- requestId?: string;
396
- name: string;
397
- description: string;
398
- cron: string;
399
- action: string;
400
- mode?: "live" | "dry-run";
401
- rails?: string;
402
- allowed?: string;
403
- }
404
317
  type ScheduleCreatePayload = Extract<SessionOutboundMessage, {
405
318
  type: "schedule/create/response";
406
319
  }>["payload"];
407
320
  type ScheduleListPayload = Extract<SessionOutboundMessage, {
408
321
  type: "schedule/list/response";
409
322
  }>["payload"];
410
- type IngestionBackfillPayload = Extract<SessionOutboundMessage, {
411
- type: "ingestion/backfill/response";
412
- }>["payload"];
413
- export type IngestionApplyPayload = Extract<SessionOutboundMessage, {
414
- type: "ingestion/apply/response";
415
- }>["payload"];
416
- export type IngestionCohortInspectPayload = Extract<SessionOutboundMessage, {
417
- type: "ingestion/cohort/inspect/response";
418
- }>["payload"];
419
- export type IngestionCohortCancelPayload = Extract<SessionOutboundMessage, {
420
- type: "ingestion/cohort/cancel/response";
421
- }>["payload"];
422
- /** Exported because `packages/app` (Story 6.3) renders this payload directly. */
423
- export type IngestionRunsPayload = Extract<SessionOutboundMessage, {
424
- type: "ingestion/runs/response";
425
- }>["payload"];
426
- export interface IngestionRunsOptions {
427
- requestId?: string;
428
- filterId: string;
429
- /**
430
- * Include the runs reconciliation has closed. Defaults to false at the daemon.
431
- *
432
- * Omit it. The Inbox wants open obligations, and the daemon's default is the
433
- * one that cannot render a stale row by accident.
434
- */
435
- includeClosed?: boolean;
436
- }
437
323
  type ScheduleInspectPayload = Extract<SessionOutboundMessage, {
438
324
  type: "schedule/inspect/response";
439
325
  }>["payload"];
@@ -455,66 +341,6 @@ type ScheduleRunOncePayload = Extract<SessionOutboundMessage, {
455
341
  type ScheduleUpdatePayload = Extract<SessionOutboundMessage, {
456
342
  type: "schedule/update/response";
457
343
  }>["payload"];
458
- type SourceCataloguePayload = Extract<SessionOutboundMessage, {
459
- type: "source/catalogue/response";
460
- }>["payload"];
461
- type SourceConnectPayload = Extract<SessionOutboundMessage, {
462
- type: "source/connect/response";
463
- }>["payload"];
464
- type SourceListPayload = Extract<SessionOutboundMessage, {
465
- type: "source/list/response";
466
- }>["payload"];
467
- type SourceCheckPayload = Extract<SessionOutboundMessage, {
468
- type: "source/check/response";
469
- }>["payload"];
470
- export type SourceTriggersPayload = Extract<SessionOutboundMessage, {
471
- type: "source/triggers/response";
472
- }>["payload"];
473
- export type SourceSubscribePayload = Extract<SessionOutboundMessage, {
474
- type: "source/subscribe/response";
475
- }>["payload"];
476
- export type SourceActionsPayload = Extract<SessionOutboundMessage, {
477
- type: "source/actions/response";
478
- }>["payload"];
479
- export type SourceRunPayload = Extract<SessionOutboundMessage, {
480
- type: "source/run/response";
481
- }>["payload"];
482
- export type SourceDisconnectPayload = Extract<SessionOutboundMessage, {
483
- type: "source/disconnect/response";
484
- }>["payload"];
485
- export type SourceRenamePayload = Extract<SessionOutboundMessage, {
486
- type: "source/rename/response";
487
- }>["payload"];
488
- export type SourceAccountsPayload = Extract<SessionOutboundMessage, {
489
- type: "source/accounts/response";
490
- }>["payload"];
491
- export type SourceAssignPayload = Extract<SessionOutboundMessage, {
492
- type: "source/assign/response";
493
- }>["payload"];
494
- export type SourceAddCustomPayload = Extract<SessionOutboundMessage, {
495
- type: "source/add-custom/response";
496
- }>["payload"];
497
- export type SourceTestCustomPayload = Extract<SessionOutboundMessage, {
498
- type: "source/test-custom/response";
499
- }>["payload"];
500
- export type SourceSetSecretPayload = Extract<SessionOutboundMessage, {
501
- type: "source/set-secret/response";
502
- }>["payload"];
503
- export type SourceItemsPayload = Extract<SessionOutboundMessage, {
504
- type: "source/items/response";
505
- }>["payload"];
506
- export type IngestionFilterListPayload = Extract<SessionOutboundMessage, {
507
- type: "ingestion/filter/list/response";
508
- }>["payload"];
509
- export type IngestionFilterCreatePayload = Extract<SessionOutboundMessage, {
510
- type: "ingestion/filter/create/response";
511
- }>["payload"];
512
- export type IngestionFilterUpdatePayload = Extract<SessionOutboundMessage, {
513
- type: "ingestion/filter/update/response";
514
- }>["payload"];
515
- export type IngestionFilterDeletePayload = Extract<SessionOutboundMessage, {
516
- type: "ingestion/filter/delete/response";
517
- }>["payload"];
518
344
  export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"];
519
345
  export type AgentForkContextPayload = AgentForkContextResponseMessage["payload"];
520
346
  export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"];
@@ -531,11 +357,37 @@ export interface FetchAgentTimelineOptions {
531
357
  cursor?: FetchAgentTimelineCursor;
532
358
  limit?: number;
533
359
  projection?: FetchAgentTimelineProjection;
360
+ mergeWindow?: boolean;
534
361
  requestId?: string;
535
362
  timeout?: number;
536
363
  }
537
- export interface AgentForkContextOptions {
538
- boundaryMessageId?: string;
364
+ export interface AgentTimelineSearchOptions {
365
+ agentId: string;
366
+ query: string;
367
+ cursor?: number;
368
+ }
369
+ export type AgentTimelineSearchPayload = Extract<SessionOutboundMessage, {
370
+ type: "agent.timeline.search.response";
371
+ }>["payload"];
372
+ export type AgentTimelinePromptIndexPayload = Extract<SessionOutboundMessage, {
373
+ type: "agent.timeline.list_prompts.response";
374
+ }>["payload"];
375
+ export type ProviderSubagentListPayload = Extract<SessionOutboundMessage, {
376
+ type: "agent.provider_subagents.list.response";
377
+ }>["payload"];
378
+ export type ProviderSubagentTimelinePayload = Extract<SessionOutboundMessage, {
379
+ type: "agent.provider_subagents.timeline.get.response";
380
+ }>["payload"];
381
+ export interface FetchProviderSubagentTimelineOptions {
382
+ direction?: ProviderSubagentTimelinePayload["direction"];
383
+ cursor?: FetchAgentTimelineCursor;
384
+ limit?: number;
385
+ requestId?: string;
386
+ timeout?: number;
387
+ }
388
+ export interface AgentForkContextOptions {
389
+ boundaryCursor?: FetchAgentTimelineCursor;
390
+ boundaryMessageId?: string;
539
391
  requestId?: string;
540
392
  }
541
393
  type AgentRefreshedStatusPayload = z.infer<typeof AgentRefreshedStatusPayloadSchema>;
@@ -561,13 +413,11 @@ type FetchAgentsRequest = Extract<SessionInboundMessage, {
561
413
  type: "fetch_agents_request";
562
414
  }>;
563
415
  export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
416
+ signal?: AbortSignal;
564
417
  requestId?: string;
565
418
  timeout?: number;
566
419
  };
567
420
  export type FetchAgentsEntry = FetchAgentsPayload["entries"][number];
568
- export type GetAgentsByIdsPayload = Extract<SessionOutboundMessage, {
569
- type: "get_agents_by_ids_response";
570
- }>["payload"];
571
421
  export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"];
572
422
  type FetchAgentHistoryPayload = Extract<SessionOutboundMessage, {
573
423
  type: "fetch_agent_history_response";
@@ -597,74 +447,35 @@ type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
597
447
  type: "fetch_workspaces_request";
598
448
  }>;
599
449
  export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
450
+ signal?: AbortSignal;
600
451
  requestId?: string;
601
452
  };
602
453
  export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
603
454
  export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
604
- export interface CreateChatRoomOptions {
605
- name: string;
606
- purpose?: string | null;
607
- requestId?: string;
608
- }
609
- export interface InspectChatRoomOptions {
610
- room: string;
611
- requestId?: string;
612
- }
613
- export interface DeleteChatRoomOptions {
614
- room: string;
615
- requestId?: string;
616
- }
617
- export interface PostChatMessageOptions {
618
- room: string;
619
- body: string;
620
- authorAgentId?: string;
621
- replyToMessageId?: string | null;
622
- requestId?: string;
623
- }
624
- export interface ReadChatMessagesOptions {
625
- room: string;
626
- limit?: number;
627
- since?: string;
628
- authorAgentId?: string;
629
- requestId?: string;
630
- timeout?: number;
631
- }
632
- export interface WaitForChatMessagesOptions {
633
- room: string;
634
- afterMessageId?: string | null;
635
- timeoutMs?: number;
636
- requestId?: string;
637
- }
638
- export interface RunLoopOptions {
639
- prompt: string;
640
- cwd: string;
641
- provider?: string;
642
- model?: string;
643
- modeId?: string;
644
- verifierProvider?: string;
645
- verifierModel?: string;
646
- verifierModeId?: string;
647
- verifyPrompt?: string | null;
648
- verifyChecks?: string[];
649
- name?: string | null;
650
- sleepMs?: number;
651
- maxIterations?: number;
652
- maxTimeMs?: number;
653
- requestId?: string;
654
- }
655
- export interface InspectLoopOptions {
656
- id: string;
657
- requestId?: string;
658
- }
659
- export interface LoopLogsOptions {
660
- id: string;
661
- afterSeq?: number;
662
- requestId?: string;
663
- }
664
- export interface StopLoopOptions {
665
- id: string;
455
+ export type WorkspaceLabelListPayload = Extract<SessionOutboundMessage, {
456
+ type: "workspace.label.list.response";
457
+ }>["payload"];
458
+ export type WorkspaceLabelAssignmentPayload = Extract<SessionOutboundMessage, {
459
+ type: "workspace.label.assignment.set.response";
460
+ }>["payload"];
461
+ export type WorkspaceLabelUpdatePayload = Extract<SessionOutboundMessage, {
462
+ type: "workspace.label.update.response";
463
+ }>["payload"];
464
+ export type WorkspaceLabelDeletePayload = Extract<SessionOutboundMessage, {
465
+ type: "workspace.label.delete.response";
466
+ }>["payload"];
467
+ export type WorkspaceLabelDeleteInspectPayload = Extract<SessionOutboundMessage, {
468
+ type: "workspace.label.delete.inspect.response";
469
+ }>["payload"];
470
+ export type ProjectListPayload = Extract<SessionOutboundMessage, {
471
+ type: "project.list.response";
472
+ }>["payload"];
473
+ type ProjectListRequest = Extract<SessionInboundMessage, {
474
+ type: "project.list.request";
475
+ }>;
476
+ export type ProjectListOptions = Omit<ProjectListRequest, "type" | "requestId"> & {
666
477
  requestId?: string;
667
- }
478
+ };
668
479
  export interface CreateScheduleOptions {
669
480
  prompt: string;
670
481
  name?: string | null;
@@ -683,12 +494,10 @@ export interface CreateScheduleOptions {
683
494
  modeId?: string;
684
495
  model?: string;
685
496
  thinkingOptionId?: string;
497
+ archiveOnFinish?: boolean;
498
+ isolation?: "local" | "worktree";
686
499
  title?: string | null;
687
- approvalPolicy?: string;
688
- sandboxMode?: string;
689
- networkAccess?: boolean;
690
- webSearch?: boolean;
691
- extra?: AgentSessionConfig["extra"];
500
+ providerOptions?: AgentSessionConfig["providerOptions"];
692
501
  systemPrompt?: string;
693
502
  mcpServers?: AgentSessionConfig["mcpServers"];
694
503
  };
@@ -702,116 +511,13 @@ export interface InspectScheduleOptions {
702
511
  id: string;
703
512
  requestId?: string;
704
513
  }
705
- export interface SourceCatalogueOptions {
706
- kind: SourceKind;
707
- query: string;
708
- /** Opaque aggregator cursor from a previous page. Pass it back untouched, never parse it. */
709
- cursor?: string;
710
- requestId?: string;
711
- }
712
- export interface SourceConnectOptions {
713
- kind: SourceKind;
714
- appSlug: string;
715
- /**
716
- * A custom OAuth client for the authorization (Pipedream `oa_...`). Check
717
- * `server_info.features.sourceConnectOauthApp` first: an older daemon drops it.
718
- */
719
- oauthAppId?: string;
720
- requestId?: string;
721
- }
722
- export interface SourceCheckOptions {
723
- sourceId: string;
724
- requestId?: string;
725
- }
726
- export interface SourceSubscribeOptions {
727
- sourceId: string;
728
- componentId?: string;
729
- /** Values for the trigger's own props, by name (e.g. `{ drive: "My Drive" }`). */
730
- props?: Record<string, unknown>;
731
- requestId?: string;
732
- }
733
- export interface SourceDisconnectOptions {
734
- sourceId: string;
735
- requestId?: string;
736
- }
737
- export interface SourceRenameOptions {
738
- sourceId: string;
739
- /** Null clears the name, and so does a blank string (the daemon trims). */
740
- nickname: string | null;
741
- requestId?: string;
742
- }
743
- export interface SourceAccountsOptions {
744
- sourceId: string;
745
- requestId?: string;
746
- }
747
- export interface SourceActionsOptions {
748
- sourceId: string;
749
- requestId?: string;
750
- }
751
- export interface SourceRunOptions {
752
- sourceId: string;
753
- /** The action component id, as `source/actions` lists it (e.g. "gmail-send-email"). */
754
- actionId: string;
755
- /** The action's own input. The account is never part of it. */
756
- props: Record<string, unknown>;
757
- requestId?: string;
758
- }
759
- export interface SourceAssignOptions {
760
- sourceId: string;
761
- /** The aggregator account id, as `source/accounts` reports it. */
762
- accountId: string;
763
- requestId?: string;
764
- }
765
- /** An HTTPS API to add or test as a custom source. */
766
- export interface SourceCustomApiOptions {
767
- appSlug: "gitlab" | "github" | "jira" | "generic";
768
- baseUrl: string;
769
- auth: {
770
- scheme: "none";
771
- } | {
772
- scheme: "bearer";
773
- } | {
774
- scheme: "basic";
775
- } | {
776
- scheme: "header";
777
- name: string;
778
- };
779
- /** A generic API's probe path, relative to `baseUrl`. */
780
- probePath?: string;
781
- /** Write-only: the daemon keeps it and no response ever carries it back. */
782
- secret?: string | null;
783
- requestId?: string;
784
- }
785
- export interface SourceItemsOptions {
786
- sourceId: string;
787
- /** Epoch ms, inclusive. Nothing older comes back. */
788
- sinceMs: number;
789
- /** Events read from each deployed trigger. Absent means the daemon's default. */
790
- perTriggerLimit?: number;
791
- requestId?: string;
792
- }
793
- export interface IngestionFilterListOptions {
794
- /** Absent means every filter on the daemon. */
795
- sourceId?: string;
796
- requestId?: string;
797
- }
798
- export interface IngestionFilterCreateOptions {
799
- draft: FilterDraft;
800
- requestId?: string;
801
- }
802
- export interface IngestionFilterUpdateOptions {
803
- filterId: string;
804
- patch: FilterPatch;
805
- requestId?: string;
806
- }
807
- export interface IngestionFilterDeleteOptions {
808
- filterId: string;
809
- requestId?: string;
810
- }
811
514
  export interface UpdateScheduleNewAgentConfig {
812
515
  provider?: string;
813
516
  model?: string | null;
814
517
  modeId?: string | null;
518
+ thinkingOptionId?: string | null;
519
+ archiveOnFinish?: boolean;
520
+ isolation?: "local" | "worktree";
815
521
  cwd?: string;
816
522
  }
817
523
  export interface UpdateScheduleOptions {
@@ -836,6 +542,9 @@ export interface RenameTerminalInput {
836
542
  }
837
543
  type OpenProjectPayload = OpenProjectResponseMessage["payload"];
838
544
  type ProjectAddPayload = ProjectAddResponse["payload"];
545
+ export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"];
546
+ export type WorkspaceGithubSearchRepositoriesPayload = WorkspaceGithubSearchRepositoriesResponse["payload"];
547
+ type ProjectGithubClonePayload = ProjectGithubCloneResponse["payload"];
839
548
  type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
840
549
  type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
841
550
  export interface FetchAgentResult {
@@ -848,39 +557,436 @@ export interface WaitForFinishResult {
848
557
  error: string | null;
849
558
  lastMessage: string | null;
850
559
  }
851
- /**
852
- * Thrown when an in-flight `uploadFile()` is cancelled via its `AbortSignal`.
853
- * Distinct from {@link UploadCapExceededError} and {@link UploadFailedError} so
854
- * Epic 5's attachment-chip UI can render the "cancelled" state specifically.
855
- */
856
- export declare class UploadCancelledError extends Error {
857
- readonly uploadId: string;
858
- constructor(uploadId: string);
560
+ type GetDaemonConfigResponse = Extract<SessionOutboundMessage, {
561
+ type: "get_daemon_config_response";
562
+ }>;
563
+ type SetDaemonConfigResponse = Extract<SessionOutboundMessage, {
564
+ type: "set_daemon_config_response";
565
+ }>;
566
+ type CorrelatedResponseMessage = Extract<SessionOutboundMessage, {
567
+ payload: {
568
+ requestId: string;
569
+ };
570
+ }> | Extract<SessionOutboundMessage, {
571
+ type: "terminals_changed";
572
+ }> | GetDaemonConfigResponse | SetDaemonConfigResponse;
573
+ type CorrelatedResponseType = CorrelatedResponseMessage["type"];
574
+ type CorrelatedResponsePayloads = {
575
+ [Message in CorrelatedResponseMessage as Message["type"]]: Message["payload"];
576
+ };
577
+ type CorrelatedResponsePayload<TType extends CorrelatedResponseType> = CorrelatedResponsePayloads[TType];
578
+ export declare class DaemonConnectionError extends Error {
579
+ readonly code: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT";
580
+ constructor(message: string, code?: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT");
859
581
  }
860
- /**
861
- * Thrown when the daemon rejects an upload because it exceeds the size cap —
862
- * either the declared-size early reject at begin, or an incremental reject
863
- * mid-stream (story 2.2). Carries the `too_large` code and any daemon detail.
864
- */
865
- export declare class UploadCapExceededError extends Error {
866
- readonly uploadId: string;
867
- readonly code: Extract<FileUploadErrorCode, "too_large">;
868
- constructor(uploadId: string, detail?: string);
582
+ export declare function supportsUsageReports(features: ServerInfoStatusPayload["features"]): boolean;
583
+ export interface AgentDecisionsExpireResult {
584
+ dryRun: boolean;
585
+ expired: ExpiredDecisionRow[];
586
+ agents: number;
587
+ archivedAgents: number;
588
+ written: number;
869
589
  }
870
- /**
871
- * Thrown for any other upload failure — transport error, `write_failed`,
872
- * `checksum_mismatch`, or an unexpected daemon error. The third distinguishable
873
- * reject path alongside cancelled and cap-exceeded.
874
- */
875
- export declare class UploadFailedError extends Error {
876
- readonly uploadId: string;
877
- readonly code?: FileUploadErrorCode;
878
- constructor(uploadId: string, message: string, code?: FileUploadErrorCode);
590
+ export interface AskFleetDecisionOptions {
591
+ requestId?: string;
592
+ name: string;
593
+ kind: "gate-approval" | "action-approval" | "outcome-review";
594
+ question: string;
595
+ posture: "blocking" | "deferring" | "advisory";
596
+ options: Array<{
597
+ id: string;
598
+ label: string;
599
+ effect: {
600
+ kind: "act" | "rehearse" | "defer" | "suppress";
601
+ reversibility: "reversible" | "compensable" | "irreversible";
602
+ compensatingAction?: string;
603
+ };
604
+ }>;
605
+ runId?: string;
606
+ itemKey?: string;
607
+ evidence?: string;
608
+ onExpiry?: string;
609
+ expiresInMs?: number;
879
610
  }
880
- /**
881
- * A directory-suggestions request that a later keystroke replaced before it finished.
882
- *
883
- * Not a failure of anything: the answer was simply abandoned because it is no longer the
611
+ type CaptureAgentPanePayload = CaptureAgentPaneResponse["payload"];
612
+ type ChatCreatePayload = Extract<SessionOutboundMessage, {
613
+ type: "chat/create/response";
614
+ }>["payload"];
615
+ type ChatDeletePayload = Extract<SessionOutboundMessage, {
616
+ type: "chat/delete/response";
617
+ }>["payload"];
618
+ type ChatInspectPayload = Extract<SessionOutboundMessage, {
619
+ type: "chat/inspect/response";
620
+ }>["payload"];
621
+ type ChatListPayload = Extract<SessionOutboundMessage, {
622
+ type: "chat/list/response";
623
+ }>["payload"];
624
+ type ChatPostPayload = Extract<SessionOutboundMessage, {
625
+ type: "chat/post/response";
626
+ }>["payload"];
627
+ type ChatReadPayload = Extract<SessionOutboundMessage, {
628
+ type: "chat/read/response";
629
+ }>["payload"];
630
+ type ChatWaitPayload = Extract<SessionOutboundMessage, {
631
+ type: "chat/wait/response";
632
+ }>["payload"];
633
+ export interface CreateChatRoomOptions {
634
+ name: string;
635
+ purpose?: string | null;
636
+ requestId?: string;
637
+ }
638
+ export interface CreateFleetLoopOptions {
639
+ requestId?: string;
640
+ name: string;
641
+ description: string;
642
+ cron: string;
643
+ action: string;
644
+ mode?: "live" | "dry-run";
645
+ rails?: string;
646
+ allowed?: string;
647
+ }
648
+ export interface DaemonRequestCompletion {
649
+ requestType: SessionInboundMessage["type"];
650
+ durationMs: number;
651
+ outcome: "ok" | "error" | "timeout";
652
+ request: SessionInboundMessage;
653
+ /** The selected response value on `ok`, otherwise undefined. */
654
+ response?: unknown;
655
+ }
656
+ export interface DeleteChatRoomOptions {
657
+ room: string;
658
+ requestId?: string;
659
+ }
660
+ type FleetAskPayload = Extract<SessionOutboundMessage, {
661
+ type: "fleet/ask/response";
662
+ }>["payload"];
663
+ type FleetCreatePayload = Extract<SessionOutboundMessage, {
664
+ type: "fleet/create/response";
665
+ }>["payload"];
666
+ type FleetDecisionsPayload = Extract<SessionOutboundMessage, {
667
+ type: "fleet/decisions/response";
668
+ }>["payload"];
669
+ type FleetExecutionsPayload = Extract<SessionOutboundMessage, {
670
+ type: "fleet/executions/response";
671
+ }>["payload"];
672
+ type FleetInspectPayload = Extract<SessionOutboundMessage, {
673
+ type: "fleet/inspect/response";
674
+ }>["payload"];
675
+ type FleetListPayload = Extract<SessionOutboundMessage, {
676
+ type: "fleet/list/response";
677
+ }>["payload"];
678
+ type FleetPausePayload = Extract<SessionOutboundMessage, {
679
+ type: "fleet/pause/response";
680
+ }>["payload"];
681
+ type FleetResolveDecisionPayload = Extract<SessionOutboundMessage, {
682
+ type: "fleet/resolve-decision/response";
683
+ }>["payload"];
684
+ type FleetResumePayload = Extract<SessionOutboundMessage, {
685
+ type: "fleet/resume/response";
686
+ }>["payload"];
687
+ type FleetRunNowPayload = Extract<SessionOutboundMessage, {
688
+ type: "fleet/run-now/response";
689
+ }>["payload"];
690
+ type FleetSetModePayload = Extract<SessionOutboundMessage, {
691
+ type: "fleet/set-mode/response";
692
+ }>["payload"];
693
+ type FleetSetParamsPayload = Extract<SessionOutboundMessage, {
694
+ type: "fleet/set-params/response";
695
+ }>["payload"];
696
+ export type GetAgentsByIdsPayload = Extract<SessionOutboundMessage, {
697
+ type: "get_agents_by_ids_response";
698
+ }>["payload"];
699
+ export type IngestionApplyPayload = Extract<SessionOutboundMessage, {
700
+ type: "ingestion/apply/response";
701
+ }>["payload"];
702
+ type IngestionBackfillPayload = Extract<SessionOutboundMessage, {
703
+ type: "ingestion/backfill/response";
704
+ }>["payload"];
705
+ export type IngestionCohortCancelPayload = Extract<SessionOutboundMessage, {
706
+ type: "ingestion/cohort/cancel/response";
707
+ }>["payload"];
708
+ export type IngestionCohortInspectPayload = Extract<SessionOutboundMessage, {
709
+ type: "ingestion/cohort/inspect/response";
710
+ }>["payload"];
711
+ export interface IngestionFilterCreateOptions {
712
+ draft: FilterDraft;
713
+ requestId?: string;
714
+ }
715
+ export type IngestionFilterCreatePayload = Extract<SessionOutboundMessage, {
716
+ type: "ingestion/filter/create/response";
717
+ }>["payload"];
718
+ export interface IngestionFilterDeleteOptions {
719
+ filterId: string;
720
+ requestId?: string;
721
+ }
722
+ export type IngestionFilterDeletePayload = Extract<SessionOutboundMessage, {
723
+ type: "ingestion/filter/delete/response";
724
+ }>["payload"];
725
+ export interface IngestionFilterListOptions {
726
+ /** Absent means every filter on the daemon. */
727
+ sourceId?: string;
728
+ requestId?: string;
729
+ }
730
+ export type IngestionFilterListPayload = Extract<SessionOutboundMessage, {
731
+ type: "ingestion/filter/list/response";
732
+ }>["payload"];
733
+ export interface IngestionFilterUpdateOptions {
734
+ filterId: string;
735
+ patch: FilterPatch;
736
+ requestId?: string;
737
+ }
738
+ export type IngestionFilterUpdatePayload = Extract<SessionOutboundMessage, {
739
+ type: "ingestion/filter/update/response";
740
+ }>["payload"];
741
+ export interface IngestionRunsOptions {
742
+ requestId?: string;
743
+ filterId: string;
744
+ /**
745
+ * Include the runs reconciliation has closed. Defaults to false at the daemon.
746
+ *
747
+ * Omit it. The Inbox wants open obligations, and the daemon's default is the
748
+ * one that cannot render a stale row by accident.
749
+ */
750
+ includeClosed?: boolean;
751
+ }
752
+ /** Exported because `packages/app` (Story 6.3) renders this payload directly. */
753
+ export type IngestionRunsPayload = Extract<SessionOutboundMessage, {
754
+ type: "ingestion/runs/response";
755
+ }>["payload"];
756
+ export interface InspectChatRoomOptions {
757
+ room: string;
758
+ requestId?: string;
759
+ }
760
+ export interface InspectFleetLoopOptions {
761
+ requestId?: string;
762
+ name: string;
763
+ }
764
+ export interface InspectLoopOptions {
765
+ id: string;
766
+ requestId?: string;
767
+ }
768
+ export interface ListFleetDecisionsOptions {
769
+ requestId?: string;
770
+ name?: string;
771
+ includeResolved?: boolean;
772
+ }
773
+ type LoopInspectPayload = Extract<SessionOutboundMessage, {
774
+ type: "loop/inspect/response";
775
+ }>["payload"];
776
+ type LoopListPayload = Extract<SessionOutboundMessage, {
777
+ type: "loop/list/response";
778
+ }>["payload"];
779
+ export interface LoopLogsOptions {
780
+ id: string;
781
+ afterSeq?: number;
782
+ requestId?: string;
783
+ }
784
+ type LoopLogsPayload = Extract<SessionOutboundMessage, {
785
+ type: "loop/logs/response";
786
+ }>["payload"];
787
+ type LoopRunPayload = Extract<SessionOutboundMessage, {
788
+ type: "loop/run/response";
789
+ }>["payload"];
790
+ type LoopStopPayload = Extract<SessionOutboundMessage, {
791
+ type: "loop/stop/response";
792
+ }>["payload"];
793
+ export interface PostChatMessageOptions {
794
+ room: string;
795
+ body: string;
796
+ authorAgentId?: string;
797
+ replyToMessageId?: string | null;
798
+ requestId?: string;
799
+ }
800
+ export interface ReadChatMessagesOptions {
801
+ room: string;
802
+ limit?: number;
803
+ since?: string;
804
+ authorAgentId?: string;
805
+ requestId?: string;
806
+ timeout?: number;
807
+ }
808
+ export interface ResolveFleetDecisionOptions {
809
+ requestId?: string;
810
+ decisionId: string;
811
+ optionId: string;
812
+ }
813
+ export interface RunLoopOptions {
814
+ prompt: string;
815
+ cwd: string;
816
+ provider?: string;
817
+ model?: string;
818
+ modeId?: string;
819
+ verifierProvider?: string;
820
+ verifierModel?: string;
821
+ verifierModeId?: string;
822
+ verifyPrompt?: string | null;
823
+ verifyChecks?: string[];
824
+ name?: string | null;
825
+ sleepMs?: number;
826
+ maxIterations?: number;
827
+ maxTimeMs?: number;
828
+ requestId?: string;
829
+ }
830
+ export interface SetFleetLoopModeOptions {
831
+ requestId?: string;
832
+ name: string;
833
+ mode: "live" | "dry-run";
834
+ }
835
+ export interface SetFleetLoopParamsOptions {
836
+ requestId?: string;
837
+ name: string;
838
+ values: Record<string, string | number | boolean | string[]>;
839
+ }
840
+ export interface SourceAccountsOptions {
841
+ sourceId: string;
842
+ requestId?: string;
843
+ }
844
+ export type SourceAccountsPayload = Extract<SessionOutboundMessage, {
845
+ type: "source/accounts/response";
846
+ }>["payload"];
847
+ export interface SourceActionsOptions {
848
+ sourceId: string;
849
+ requestId?: string;
850
+ }
851
+ export type SourceActionsPayload = Extract<SessionOutboundMessage, {
852
+ type: "source/actions/response";
853
+ }>["payload"];
854
+ export interface SourceAssignOptions {
855
+ sourceId: string;
856
+ /** The aggregator account id, as `source/accounts` reports it. */
857
+ accountId: string;
858
+ requestId?: string;
859
+ }
860
+ export type SourceAssignPayload = Extract<SessionOutboundMessage, {
861
+ type: "source/assign/response";
862
+ }>["payload"];
863
+ export type SourceAddCustomPayload = Extract<SessionOutboundMessage, {
864
+ type: "source/add-custom/response";
865
+ }>["payload"];
866
+ export type SourceTestCustomPayload = Extract<SessionOutboundMessage, {
867
+ type: "source/test-custom/response";
868
+ }>["payload"];
869
+ export type SourceSetSecretPayload = Extract<SessionOutboundMessage, {
870
+ type: "source/set-secret/response";
871
+ }>["payload"];
872
+ /** An HTTPS API to add or test as a custom source. */
873
+ export interface SourceCustomApiOptions {
874
+ appSlug: "gitlab" | "github" | "jira" | "generic";
875
+ baseUrl: string;
876
+ auth: {
877
+ scheme: "none";
878
+ } | {
879
+ scheme: "bearer";
880
+ } | {
881
+ scheme: "basic";
882
+ } | {
883
+ scheme: "header";
884
+ name: string;
885
+ };
886
+ /** A generic API's probe path, relative to `baseUrl`. */
887
+ probePath?: string;
888
+ /** Write-only: the daemon keeps it and no response ever carries it back. */
889
+ secret?: string | null;
890
+ requestId?: string;
891
+ }
892
+ export interface SourceCatalogueOptions {
893
+ kind: SourceKind;
894
+ query: string;
895
+ /** Opaque aggregator cursor from a previous page. Pass it back untouched, never parse it. */
896
+ cursor?: string;
897
+ requestId?: string;
898
+ }
899
+ type SourceCataloguePayload = Extract<SessionOutboundMessage, {
900
+ type: "source/catalogue/response";
901
+ }>["payload"];
902
+ export interface SourceCheckOptions {
903
+ sourceId: string;
904
+ requestId?: string;
905
+ }
906
+ type SourceCheckPayload = Extract<SessionOutboundMessage, {
907
+ type: "source/check/response";
908
+ }>["payload"];
909
+ export interface SourceConnectOptions {
910
+ kind: SourceKind;
911
+ appSlug: string;
912
+ /**
913
+ * A custom OAuth client for the authorization (Pipedream `oa_...`). Check
914
+ * `server_info.features.sourceConnectOauthApp` first: an older daemon drops it.
915
+ */
916
+ oauthAppId?: string;
917
+ requestId?: string;
918
+ }
919
+ type SourceConnectPayload = Extract<SessionOutboundMessage, {
920
+ type: "source/connect/response";
921
+ }>["payload"];
922
+ export interface SourceDisconnectOptions {
923
+ sourceId: string;
924
+ requestId?: string;
925
+ }
926
+ export type SourceDisconnectPayload = Extract<SessionOutboundMessage, {
927
+ type: "source/disconnect/response";
928
+ }>["payload"];
929
+ export interface SourceItemsOptions {
930
+ sourceId: string;
931
+ /** Epoch ms, inclusive. Nothing older comes back. */
932
+ sinceMs: number;
933
+ /** Events read from each deployed trigger. Absent means the daemon's default. */
934
+ perTriggerLimit?: number;
935
+ requestId?: string;
936
+ }
937
+ export type SourceItemsPayload = Extract<SessionOutboundMessage, {
938
+ type: "source/items/response";
939
+ }>["payload"];
940
+ type SourceListPayload = Extract<SessionOutboundMessage, {
941
+ type: "source/list/response";
942
+ }>["payload"];
943
+ export interface SourceRenameOptions {
944
+ sourceId: string;
945
+ /** Null clears the name, and so does a blank string (the daemon trims). */
946
+ nickname: string | null;
947
+ requestId?: string;
948
+ }
949
+ export type SourceRenamePayload = Extract<SessionOutboundMessage, {
950
+ type: "source/rename/response";
951
+ }>["payload"];
952
+ export interface SourceRunOptions {
953
+ sourceId: string;
954
+ /** The action component id, as `source/actions` lists it (e.g. "gmail-send-email"). */
955
+ actionId: string;
956
+ /** The action's own input. The account is never part of it. */
957
+ props: Record<string, unknown>;
958
+ requestId?: string;
959
+ }
960
+ export type SourceRunPayload = Extract<SessionOutboundMessage, {
961
+ type: "source/run/response";
962
+ }>["payload"];
963
+ export interface SourceSubscribeOptions {
964
+ sourceId: string;
965
+ componentId?: string;
966
+ /** Values for the trigger's own props, by name (e.g. `{ drive: "My Drive" }`). */
967
+ props?: Record<string, unknown>;
968
+ requestId?: string;
969
+ }
970
+ export type SourceSubscribePayload = Extract<SessionOutboundMessage, {
971
+ type: "source/subscribe/response";
972
+ }>["payload"];
973
+ export type SourceTriggersPayload = Extract<SessionOutboundMessage, {
974
+ type: "source/triggers/response";
975
+ }>["payload"];
976
+ export interface StopLoopOptions {
977
+ id: string;
978
+ requestId?: string;
979
+ }
980
+ export interface WaitForChatMessagesOptions {
981
+ room: string;
982
+ afterMessageId?: string | null;
983
+ timeoutMs?: number;
984
+ requestId?: string;
985
+ }
986
+ /**
987
+ * A directory-suggestions request that a later keystroke replaced before it finished.
988
+ *
989
+ * Not a failure of anything: the answer was simply abandoned because it is no longer the
884
990
  * question being asked. It is an error rather than an empty result so that a caller
885
991
  * caching by query text cannot store the abandoned walk's truncated list as the answer for
886
992
  * that prefix. See `DaemonClient.getDirectorySuggestions`.
@@ -888,9 +994,41 @@ export declare class UploadFailedError extends Error {
888
994
  export declare class DirectorySuggestionsSupersededError extends Error {
889
995
  constructor();
890
996
  }
997
+ /**
998
+ * Thrown when an in-flight `uploadFile()` is cancelled via its `AbortSignal`.
999
+ * Distinct from {@link UploadCapExceededError} and {@link UploadFailedError} so
1000
+ * Epic 5's attachment-chip UI can render the "cancelled" state specifically.
1001
+ */
1002
+ export declare class UploadCancelledError extends Error {
1003
+ readonly uploadId: string;
1004
+ constructor(uploadId: string);
1005
+ }
1006
+ /**
1007
+ * Thrown when the daemon rejects an upload because it exceeds the size cap —
1008
+ * either the declared-size early reject at begin, or an incremental reject
1009
+ * mid-stream (story 2.2). Carries the `too_large` code and any daemon detail.
1010
+ */
1011
+ export declare class UploadCapExceededError extends Error {
1012
+ readonly uploadId: string;
1013
+ readonly code: Extract<FileUploadErrorCode, "too_large">;
1014
+ constructor(uploadId: string, detail?: string);
1015
+ }
1016
+ /**
1017
+ * Thrown for any other upload failure — transport error, `write_failed`,
1018
+ * `checksum_mismatch`, or an unexpected daemon error. The third distinguishable
1019
+ * reject path alongside cancelled and cap-exceeded.
1020
+ */
1021
+ export declare class UploadFailedError extends Error {
1022
+ readonly uploadId: string;
1023
+ readonly code?: FileUploadErrorCode;
1024
+ constructor(uploadId: string, message: string, code?: FileUploadErrorCode);
1025
+ }
891
1026
  export declare class DaemonClient {
892
1027
  private config;
1028
+ private readonly providerSnapshotUpdates;
1029
+ private readonly owned;
893
1030
  private transport;
1031
+ private helloAuth;
894
1032
  private transportCleanup;
895
1033
  private rawMessageListeners;
896
1034
  private messageHandlers;
@@ -907,9 +1045,8 @@ export declare class DaemonClient {
907
1045
  private connectResolve;
908
1046
  private connectReject;
909
1047
  private lastErrorValue;
1048
+ private authFailureReasonValue;
910
1049
  private connectionState;
911
- private checkoutDiffSubscriptions;
912
- private terminalDirectorySubscriptions;
913
1050
  private readonly terminalStreams;
914
1051
  private pendingBinaryFileReads;
915
1052
  private activeBinaryFileTransfers;
@@ -924,21 +1061,27 @@ export declare class DaemonClient {
924
1061
  private runtimeMetricsInterval;
925
1062
  private runtimeMetrics;
926
1063
  private pingProbe;
1064
+ private connectionVerification;
927
1065
  private livenessHeartbeatTimer;
928
1066
  private lastLivenessRttMs;
929
1067
  private consecutiveLivenessFailures;
930
1068
  constructor(config: DaemonClientConfig);
931
1069
  connect(): Promise<void>;
932
1070
  private attemptConnect;
1071
+ private assertEncryptedRelayAuth;
933
1072
  private resolveConnect;
934
1073
  private rejectConnect;
935
1074
  close(): Promise<void>;
936
- ensureConnected(): void;
1075
+ ensureConnected(options?: {
1076
+ verify?: boolean;
1077
+ }): void;
1078
+ private verifyConnection;
937
1079
  getConnectionState(): ConnectionState;
938
1080
  subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void;
939
1081
  get isConnected(): boolean;
940
1082
  get isConnecting(): boolean;
941
1083
  get lastError(): string | null;
1084
+ get authFailureReason(): DaemonAuthFailureReason | null;
942
1085
  getLastLivenessRttMs(): number | null;
943
1086
  subscribe(handler: DaemonEventHandler): () => void;
944
1087
  subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void;
@@ -946,13 +1089,18 @@ export declare class DaemonClient {
946
1089
  type: TType;
947
1090
  }>) => void): () => void;
948
1091
  on(handler: DaemonEventHandler): () => void;
1092
+ onAgentAttentionRequired(handler: (notification: AgentAttentionRequiredNotification) => void): () => void;
1093
+ private beginTraceSection;
1094
+ private endTraceSection;
1095
+ private traceInstant;
1096
+ private sendJsonMessage;
1097
+ private sendTransportFrame;
949
1098
  /**
950
1099
  * Send a session message. For fire-and-forget messages (heartbeats, etc.),
951
1100
  * failures are suppressed if `suppressSendErrors` is configured.
952
1101
  * For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead.
953
1102
  */
954
1103
  private sendSessionMessage;
955
- private sendBinaryFrame;
956
1104
  /**
957
1105
  * Send a session message for RPC methods that create waiters.
958
1106
  * If the connection is still being established ("connecting"), the message
@@ -960,6 +1108,7 @@ export declare class DaemonClient {
960
1108
  * This prevents waiters from hanging forever when called during connection.
961
1109
  */
962
1110
  private sendSessionMessageOrThrow;
1111
+ private sendWhenConnected;
963
1112
  /**
964
1113
  * Flush pending send queue - called when connection is established.
965
1114
  */
@@ -968,22 +1117,11 @@ export declare class DaemonClient {
968
1117
  * Reject all pending sends - called when connection fails or is closed.
969
1118
  */
970
1119
  private rejectPendingSendQueue;
971
- protected sendRequest<T>(params: {
972
- requestId: string;
973
- message: SessionInboundMessage;
974
- timeout?: number;
975
- select: (msg: SessionOutboundMessage) => T | null;
976
- options?: {
977
- skipQueue?: boolean;
978
- };
979
- }): Promise<T>;
980
- private reportRequestCompletion;
981
- private sendCorrelatedRequest;
982
- private sendCorrelatedSessionRequest;
983
- private sendNamespacedCorrelatedSessionRequest;
1120
+ private sendRequest;
984
1121
  private sendSessionMessageStrict;
985
1122
  clearAgentAttention(agentId: string | string[]): Promise<void>;
986
1123
  clearWorkspaceAttention(workspaceId: string | string[]): Promise<void>;
1124
+ markWorkspaceUnread(workspaceId: string, requestId?: string): Promise<void>;
987
1125
  sendHeartbeat(params: {
988
1126
  deviceType: "web" | "mobile";
989
1127
  focusedAgentId: string | null;
@@ -1000,7 +1138,7 @@ export declare class DaemonClient {
1000
1138
  * private `sendSessionMessage` path (`{ type: "session", message }`) — never
1001
1139
  * an HTTP route, never a response-waiting RPC.
1002
1140
  */
1003
- sendWatchAction(message: WatchNotificationActionMessage | WatchSessionSearchMessage | WatchComposerDictateMessage): void;
1141
+ unregisterPushToken(token: string): Promise<void>;
1004
1142
  ping(params?: {
1005
1143
  requestId?: string;
1006
1144
  timeoutMs?: number;
@@ -1019,281 +1157,179 @@ export declare class DaemonClient {
1019
1157
  private startLivenessHeartbeat;
1020
1158
  private stopLivenessHeartbeat;
1021
1159
  private scheduleNextLivenessHeartbeat;
1160
+ private observe;
1161
+ registerBrowserHost(registration: Omit<Extract<SessionInboundMessage, {
1162
+ type: "browser.host.register.request";
1163
+ }>, "type" | "requestId">, options?: {
1164
+ signal?: AbortSignal;
1165
+ }): OwnedSubscription<CorrelatedResponsePayload<"browser.host.register.response">>;
1166
+ observeEvents(events: SessionEventSubscription[], options?: {
1167
+ signal?: AbortSignal;
1168
+ notifications?: boolean;
1169
+ }): OwnedSubscription<CorrelatedResponsePayload<"session.events.set_subscription.response">>;
1170
+ observeAgents(options?: Omit<FetchAgentsOptions, "subscribe">): OwnedSubscription<FetchAgentsPayload>;
1171
+ observeWorkspaces(options?: Omit<FetchWorkspacesOptions, "subscribe">): OwnedSubscription<FetchWorkspacesPayload>;
1172
+ fetchAgents(options: FetchAgentsOptions & {
1173
+ subscribe: {};
1174
+ }): Promise<FetchAgentsPayload & {
1175
+ subscription: OwnedSubscription<FetchAgentsPayload>;
1176
+ }>;
1022
1177
  fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
1023
- /**
1024
- * Resolve up to 200 agents by id without a list load. Requires
1025
- * server_info.features.agentDirectoryDelta.
1026
- */
1027
- getAgentsByIds(ids: string[], options?: {
1028
- requestId?: string;
1029
- timeout?: number;
1030
- fields?: FetchAgentsOptions["fields"];
1031
- scope?: "active";
1032
- }): Promise<GetAgentsByIdsPayload>;
1033
1178
  fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
1034
1179
  fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
1035
- fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
1036
- openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
1037
- addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
1038
- startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1039
- type: "start_workspace_script_response";
1040
- }>["payload"]>;
1041
- archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
1042
- /**
1043
- * Set or clear the user's custom project name override. Pass `null` (or an
1044
- * empty/whitespace string, which the server normalizes to `null`) to clear
1045
- * the override and fall back to the derived project name.
1046
- */
1047
- renameProject(projectId: string, customName: string | null, requestId?: string): Promise<ProjectRenameResponse["payload"]>;
1048
- fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
1049
- fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
1050
- fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
1051
- fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
1052
- private resubscribeCheckoutDiffSubscriptions;
1053
- private resubscribeTerminalDirectorySubscriptions;
1054
- createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
1055
- /**
1056
- * Create an agent and its standing routine in ONE request.
1057
- *
1058
- * Split from `createAgent` only because the caller needs the scheduleId back:
1059
- * `createAgent`'s return type has always been the bare snapshot, and widening
1060
- * it would ripple through every call site for a field almost none of them
1061
- * want. Both go through the same request, so there is no second code path for
1062
- * the daemon to disagree with.
1063
- */
1064
- createAgentWithRoutine(options: CreateAgentRequestOptions & {
1065
- routine: NonNullable<CreateAgentRequestOptions["routine"]>;
1066
- }): Promise<{
1067
- agent: AgentSnapshotPayload;
1068
- routine: {
1069
- scheduleId: string;
1070
- nextRunAt: string | null;
1071
- };
1072
- }>;
1073
- private createAgentRequest;
1074
- deleteAgent(agentId: string): Promise<void>;
1075
- archiveAgent(agentId: string): Promise<{
1076
- archivedAt: string;
1077
- }>;
1078
- /**
1079
- * Dismiss a live background shell. For Claude Code agents this drives the
1080
- * CLI's own `ctrl+x ctrl+k` kill chord over the PTY (kills it inside Claude
1081
- * Code). Resolves to whether the dismiss was delivered.
1082
- */
1083
- /**
1084
- * List background shells -- one agent's, or every agent's when `agentId` is
1085
- * omitted. These are commands the provider launched with `run_in_background`
1086
- * so they outlive the turn; the rows carry the command, status and start time
1087
- * so the client can show what is running and for how long.
1088
- */
1089
- listBackgroundTasks(agentId?: string): Promise<BackgroundTaskPayload[]>;
1090
- /**
1091
- * Record session context (links + non-live credentials) onto an agent's
1092
- * digest. Used by the context hook, which runs beside an agent rather than
1093
- * inside it and so cannot reach the agent-scoped `set_session_digest` MCP
1094
- * tool.
1095
- *
1096
- * Returns how many secrets the daemon had to mask, so a caller can report
1097
- * that it handed over something it should not have.
1098
- */
1099
- setAgentContext(input: {
1100
- agentId: string;
1101
- links?: {
1102
- kind: SessionDigestLink["kind"];
1103
- url: string;
1104
- label?: string;
1105
- }[];
1106
- secrets?: {
1107
- label: string;
1108
- value: string;
1109
- source?: string;
1110
- }[];
1111
- }): Promise<{
1112
- digest: SessionDigest | null;
1113
- maskedCount: number;
1114
- error?: string;
1115
- }>;
1116
- /**
1117
- * Ask the daemon what it can see about external reference URLs -- a GitLab
1118
- * pipeline's status, a merge request's state, a Jira issue's column.
1119
- *
1120
- * The provider credentials live on the daemon, so the app never holds one.
1121
- * An entry the daemon could not look up still comes back, carrying
1122
- * `unavailableReason`, so a card can say what it could not see instead of
1123
- * spinning. See docs/session-context-rail.md.
1124
- */
1125
- enrichReferences(urls: string[]): Promise<ReferenceEnrichment[]>;
1126
- /**
1127
- * Read a background shell's captured output. Resolves with `text: null` when
1128
- * the daemon does not know the shell or it captured nothing. The daemon tails
1129
- * and redacts before sending.
1130
- */
1131
- readBackgroundTaskOutput(agentId: string, taskId: string, options?: {
1132
- maxBytes?: number;
1133
- }): Promise<{
1134
- text: string | null;
1135
- truncated: boolean;
1136
- byteSize: number;
1137
- }>;
1138
- dismissBackgroundTask(agentId: string, taskId: string): Promise<{
1139
- dismissed: boolean;
1140
- }>;
1141
- detachAgent(agentId: string): Promise<void>;
1142
- /**
1143
- * `labels` is a PATCH: a string sets the key, `null` DELETES it, and an absent
1144
- * key is left untouched. Never pass a rebuilt whole bag - the daemon owns keys
1145
- * the client does not know about (schedules, loops, workflows, kanban).
1146
- *
1147
- * This method is the compat boundary. Callers get one coherent patch; the wire
1148
- * carries the deletions in a separate additive `labelsRemove` array, so an
1149
- * older daemon strips them instead of rejecting the whole request. Keeping the
1150
- * split here means no UI code has to know the encoding.
1151
- */
1152
- updateAgent(agentId: string, updates: {
1153
- name?: string;
1154
- labels?: Record<string, string | null>;
1155
- }): Promise<void>;
1156
- rewindSession(agentId: string, turnId: string): Promise<{
1157
- newSessionId: string;
1158
- }>;
1159
- editMessage(agentId: string, turnId: string, newContent: string): Promise<{
1160
- newSessionId: string;
1161
- adopted: boolean;
1180
+ fetchWorkspaces(options: FetchWorkspacesOptions & {
1181
+ subscribe: {};
1182
+ }): Promise<FetchWorkspacesPayload & {
1183
+ subscription: OwnedSubscription<FetchWorkspacesPayload>;
1162
1184
  }>;
1163
- listWorkspaceSessions(workspaceId: string, options?: {
1164
- signal?: AbortSignal;
1165
- }): Promise<Array<{
1166
- sid: string;
1167
- title: string | null;
1168
- lastActivity: string;
1169
- cwd: string;
1170
- agentName: string | null;
1171
- }>>;
1172
- subscribePush(subscription: {
1173
- type: "expo";
1174
- token: string;
1175
- } | {
1176
- type: "web";
1177
- subscription: {
1178
- endpoint: string;
1179
- keys: {
1180
- p256dh: string;
1181
- auth: string;
1182
- };
1183
- expirationTime?: number | null;
1185
+ fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
1186
+ listWorkspaceLabels(options?: {
1187
+ sync?: {
1188
+ generation: string;
1189
+ afterSeq: number;
1184
1190
  };
1185
- }): Promise<{
1186
- ok: boolean;
1187
- vapidPublicKey?: string;
1188
- }>;
1189
- getVapidPublicKey(): Promise<string | null>;
1190
- listAllSessions(options?: {
1191
+ requestId?: string;
1192
+ }): Promise<WorkspaceLabelListPayload>;
1193
+ observeWorkspaceLabels(options?: {
1191
1194
  signal?: AbortSignal;
1192
- }): Promise<Array<{
1193
- sid: string;
1194
- title: string | null;
1195
- lastActivity: string;
1196
- cwd: string;
1197
- agentName: string | null;
1198
- }>>;
1199
- listWorkflows(): Promise<WorkflowSnapshot[]>;
1200
- getWorkflow(workflowId: string): Promise<WorkflowSnapshot | null>;
1201
- cancelWorkflow(workflowId: string): Promise<WorkflowSnapshot>;
1202
- startWorkflow(input: {
1203
- graph: WorkflowTaskGraph;
1204
- provider: string;
1205
- cwd: string;
1206
- model?: string;
1207
- title?: string;
1208
- labels?: Record<string, string>;
1209
- agentPresets?: Record<string, WorkflowAgentPreset>;
1210
- }): Promise<{
1211
- workflowId: string;
1212
- childAgentIds: string[];
1213
- status: WorkflowStatus;
1214
- }>;
1215
- listExtensions(): Promise<InstalledExtension[]>;
1216
- executeExtensionCommand(commandId: string, args?: unknown[]): Promise<unknown>;
1217
- searchSessions(params: {
1195
+ }): OwnedSubscription<WorkspaceLabelListPayload>;
1196
+ setWorkspaceLabel(options: {
1197
+ workspaceId: string;
1198
+ label: Extract<SessionInboundMessage, {
1199
+ type: "workspace.label.assignment.set.request";
1200
+ }>["label"];
1201
+ assigned: boolean;
1202
+ requestId?: string;
1203
+ }): Promise<WorkspaceLabelAssignmentPayload>;
1204
+ updateWorkspaceLabel(options: {
1205
+ name: string;
1206
+ newName?: string;
1207
+ color?: Extract<SessionInboundMessage, {
1208
+ type: "workspace.label.update.request";
1209
+ }>["color"];
1210
+ requestId?: string;
1211
+ }): Promise<WorkspaceLabelUpdatePayload>;
1212
+ deleteWorkspaceLabel(options: {
1213
+ name: string;
1214
+ requestId?: string;
1215
+ }): Promise<WorkspaceLabelDeletePayload>;
1216
+ inspectWorkspaceLabelDelete(options: {
1217
+ name: string;
1218
+ requestId?: string;
1219
+ }): Promise<WorkspaceLabelDeleteInspectPayload>;
1220
+ listProjects(options?: string | ProjectListOptions): Promise<ProjectListPayload>;
1221
+ openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
1222
+ addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
1223
+ createProjectDirectory(input: {
1224
+ parentPath: string;
1225
+ name: string;
1226
+ }, requestId?: string): Promise<ProjectCreateDirectoryPayload>;
1227
+ searchGithubRepositories(input: {
1218
1228
  query: string;
1219
1229
  limit?: number;
1220
- sources?: readonly string[];
1221
- signal?: AbortSignal;
1222
- }): Promise<Array<{
1223
- sid: string;
1224
- source: string;
1225
- cwd: string;
1226
- timestamp: string;
1227
- snippet: string;
1228
- resumeCommand: string;
1229
- }>>;
1230
+ }, requestId?: string): Promise<WorkspaceGithubSearchRepositoriesPayload>;
1231
+ cloneGithubProject(input: {
1232
+ repo: string;
1233
+ targetDirectory: string;
1234
+ cloneProtocol?: ProjectGithubCloneProtocol;
1235
+ }, requestId?: string): Promise<ProjectGithubClonePayload>;
1236
+ startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1237
+ type: "start_workspace_script_response";
1238
+ }>["payload"]>;
1239
+ listWorkspaceScripts(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1240
+ type: "workspace.script.list.response";
1241
+ }>["payload"]>;
1242
+ startWorkspaceScriptWithStatus(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1243
+ type: "workspace.script.start.response";
1244
+ }>["payload"]>;
1245
+ stopWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1246
+ type: "workspace.script.stop.response";
1247
+ }>["payload"]>;
1248
+ archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
1230
1249
  /**
1231
- * Derive the daemon's HTTP base URL from the WebSocket URL we connected with.
1232
- * Works for direct (ws://host:port/ws) and same-origin (web served by
1233
- * daemon). For relay-mode (wss://relay.../ws), HTTP routes against the
1234
- * daemon are not addressable — throws so callers fall back gracefully.
1250
+ * Set or clear the user's custom project name override. Pass `null` (or an
1251
+ * empty/whitespace string, which the server normalizes to `null`) to clear
1252
+ * the override and fall back to the derived project name.
1235
1253
  */
1236
- private getHttpBaseUrl;
1237
- private buildAuthHeader;
1238
- private daemonHttpJson;
1239
- removeProject(projectId: string, requestId?: string): Promise<{
1240
- removedWorkspaceIds: string[];
1241
- }>;
1242
- setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
1243
- title: string | null;
1254
+ fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
1255
+ runWorkspaceSetup(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
1256
+ type: "workspace.setup.run.response";
1257
+ }>["payload"]>;
1258
+ fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
1259
+ fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
1260
+ fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
1261
+ private readonly creations;
1262
+ createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
1263
+ private createLegacyAgent;
1264
+ deleteAgent(agentId: string): Promise<void>;
1265
+ archiveAgent(agentId: string): Promise<{
1266
+ archivedAt: string;
1244
1267
  }>;
1245
1268
  /**
1246
- * Answer a decision the agent parked on its digest. `optionId: null` with a
1247
- * note is a free-text answer — an option the agent did not list.
1248
- *
1249
- * Pass the `revision` of the decision you showed the user. The daemon refuses
1250
- * the answer if the agent reworded the decision since, instead of recording a
1251
- * choice against text the user never read. Appended after `requestId` so
1252
- * existing positional callers keep working.
1269
+ * Dismiss a live background shell. For Claude Code agents this drives the
1270
+ * CLI's own `ctrl+x ctrl+k` kill chord over the PTY (kills it inside Claude
1271
+ * Code). Resolves to whether the dismiss was delivered.
1253
1272
  */
1254
- answerAgentDecision(agentId: string, decisionId: string, optionId: string | null, note: string | null, requestId?: string, revision?: string | null): Promise<{
1255
- decision: PendingDecision | null;
1256
- }>;
1257
1273
  /**
1258
- * Expire decisions nobody answered, recorded as `answeredBy: "timeout"` with a
1259
- * note. Unlike `answerAgentDecision` this never records the user as the
1260
- * writer and never prompts the agent. Pass `agentId` + `decisionId` for one
1261
- * decision (any age), or neither to sweep every stored agent past
1262
- * `olderThanMs`. `dryRun` reports without writing.
1274
+ * List background shells -- one agent's, or every agent's when `agentId` is
1275
+ * omitted. These are commands the provider launched with `run_in_background`
1276
+ * so they outlive the turn; the rows carry the command, status and start time
1277
+ * so the client can show what is running and for how long.
1263
1278
  */
1264
- expireAgentDecisions(input: {
1265
- olderThanMs?: number | null;
1266
- agentId?: string | null;
1267
- decisionId?: string | null;
1268
- dryRun?: boolean;
1269
- note?: string | null;
1270
- }, requestId?: string): Promise<AgentDecisionsExpireResult>;
1279
+ detachAgent(agentId: string): Promise<void>;
1271
1280
  /**
1272
- * Fold sessions into one that already exists: the winner keeps its transcript,
1273
- * the sources are linked both ways and then archived.
1281
+ * `labels` is a PATCH: a string sets the key, `null` DELETES it, and an absent
1282
+ * key is left untouched. Never pass a rebuilt whole bag - the daemon owns keys
1283
+ * the client does not know about (schedules, loops, workflows, kanban).
1274
1284
  *
1275
- * One call rather than a client-side loop, because a half-consolidated fleet
1276
- * is worse than either end state.
1285
+ * This method is the compat boundary. Callers get one coherent patch; the wire
1286
+ * carries the deletions in a separate additive `labelsRemove` array, so an
1287
+ * older daemon strips them instead of rejecting the whole request. Keeping the
1288
+ * split here means no UI code has to know the encoding.
1277
1289
  */
1278
- consolidateAgents(winnerId: string, sourceIds: string[], requestId?: string): Promise<{
1279
- archivedIds: string[];
1290
+ updateAgent(agentId: string, updates: {
1291
+ name?: string;
1292
+ labels?: Record<string, string | null>;
1293
+ }): Promise<void>;
1294
+ renameProject(projectId: string, customName: string | null, requestId?: string): Promise<ProjectRenameResponse["payload"]>;
1295
+ setProjectIcon(projectId: string, source: ProjectIconSource, requestId?: string): Promise<void>;
1296
+ removeProject(projectId: string, requestId?: string): Promise<{
1297
+ removedWorkspaceIds: string[];
1298
+ }>;
1299
+ setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
1300
+ title: string | null;
1280
1301
  }>;
1281
1302
  /**
1282
- * Snooze a session out of the triage ring until a time, or clear it with
1283
- * `until: null`.
1284
- *
1285
- * The three fields are the whole point: a time alone is "later". `untilWhat`
1286
- * names the event, `why` names what is missing. The daemon accepts a
1287
- * time-only snooze, because a CLI caller making that call is still deciding;
1288
- * requiring the other two is a client policy that escalates with the count.
1303
+ * Answer a decision the agent parked on its digest. `optionId: null` with a
1304
+ * note is a free-text answer — an option the agent did not list.
1289
1305
  */
1290
- snoozeAgent(agentId: string, until: string | null, untilWhat?: string | null, why?: string | null, requestId?: string): Promise<{
1291
- snooze: AgentSnoozeState | null;
1306
+ setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{
1307
+ pinnedAt: string | null;
1292
1308
  }>;
1309
+ inspectWorkspaceRecovery(workspaceId: string, requestId?: string): Promise<WorkspaceRecoveryState>;
1310
+ restoreWorkspace(workspaceId: string, requestId?: string): Promise<void>;
1293
1311
  resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
1294
1312
  importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
1295
1313
  refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
1296
1314
  fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
1315
+ appendAgentTimelineItem(agentId: string, item: Omit<import("@hyperdrive.bot/fleet-protocol/agent-types").PluginTimelineItem, "pluginId">): Promise<{
1316
+ seq: number;
1317
+ epoch: string;
1318
+ }>;
1319
+ searchAgentTimeline({ agentId, query, cursor, }: AgentTimelineSearchOptions): Promise<AgentTimelineSearchPayload>;
1320
+ listAgentTimelinePrompts(agentId: string, options?: {
1321
+ requestId?: string;
1322
+ timeout?: number;
1323
+ }): Promise<AgentTimelinePromptIndexPayload>;
1324
+ listProviderSubagents(parentAgentId: string, options?: {
1325
+ requestId?: string;
1326
+ timeout?: number;
1327
+ }): Promise<ProviderSubagentListPayload>;
1328
+ fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise<ProviderSubagentTimelinePayload>;
1329
+ observeTimeline(agentIds: string[], options?: {
1330
+ signal?: AbortSignal;
1331
+ }): OwnedSubscription<CorrelatedResponsePayload<"agent.timeline.set_subscription.response">>;
1332
+ subscribeAgentTimeline(agentId: string, handler: (message: TimelineMessage) => void): TimelineSubscription;
1297
1333
  buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
1298
1334
  sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
1299
1335
  sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
@@ -1306,13 +1342,19 @@ export declare class DaemonClient {
1306
1342
  * Claude (Pool)). Throws if the swap is rejected by the daemon (incompatible
1307
1343
  * wireFamily, target not in compatibleProviders list, target unavailable).
1308
1344
  */
1309
- swapAgentProvider(agentId: string, newProviderId: string, overrides?: {
1310
- model?: string | null;
1311
- modeId?: string;
1312
- }): Promise<void>;
1313
1345
  setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
1314
1346
  setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<AgentProviderNotice | null>;
1315
- restartServer(reason?: string, requestId?: string): Promise<RestartRequestedStatusPayload>;
1347
+ /**
1348
+ * Applies a whole agent-config bundle in one request. Use this instead of
1349
+ * chaining the single-field setters when the values belong together so client
1350
+ * interruption and other mutations cannot interleave between steps. A
1351
+ * provider rejection can still leave earlier steps applied.
1352
+ * Gated on `server_info.features.agentConfigApply`.
1353
+ */
1354
+ applyAgentConfig(agentId: string, config: AgentConfigApply): Promise<AgentProviderNotice | null>;
1355
+ restartServer(reason?: string, requestId?: string, options?: {
1356
+ timeout?: number;
1357
+ }): Promise<RestartRequestedStatusPayload>;
1316
1358
  shutdownServer(options?: ShutdownServerOptions): Promise<ShutdownRequestedStatusPayload>;
1317
1359
  updateDaemon(requestId?: string): Promise<DaemonUpdateResponse["payload"]>;
1318
1360
  setVoiceMode(enabled: boolean, agentId?: string, language?: string): Promise<SetVoiceModePayload>;
@@ -1335,15 +1377,14 @@ export declare class DaemonClient {
1335
1377
  baseRef?: string;
1336
1378
  ignoreWhitespace?: boolean;
1337
1379
  }, requestId?: string): Promise<CheckoutDiffPayload>;
1338
- subscribeCheckoutDiff(cwd: string, compare: {
1380
+ observeCheckoutDiff(cwd: string, compare: {
1339
1381
  mode: "uncommitted" | "base";
1340
1382
  baseRef?: string;
1341
1383
  ignoreWhitespace?: boolean;
1342
1384
  }, options?: {
1343
- subscriptionId?: string;
1344
1385
  requestId?: string;
1345
- }): Promise<SubscribeCheckoutDiffPayload>;
1346
- unsubscribeCheckoutDiff(subscriptionId: string): void;
1386
+ signal?: AbortSignal;
1387
+ }): OwnedSubscription<SubscribeCheckoutDiffPayload>;
1347
1388
  checkoutCommit(cwd: string, input: {
1348
1389
  message?: string;
1349
1390
  addAll?: boolean;
@@ -1360,6 +1401,13 @@ export declare class DaemonClient {
1360
1401
  checkoutPull(cwd: string, requestId?: string): Promise<CheckoutPullPayload>;
1361
1402
  checkoutPush(cwd: string, requestId?: string): Promise<CheckoutPushPayload>;
1362
1403
  checkoutRefresh(cwd: string, requestId?: string): Promise<CheckoutRefreshPayload>;
1404
+ listCheckoutCommits(cwd: string, requestId?: string): Promise<{
1405
+ baseRef: string | null;
1406
+ commits: CheckoutCommit[];
1407
+ }>;
1408
+ getCommitFileDiff(cwd: string, sha: string, path: string, requestId?: string): Promise<{
1409
+ file: ParsedDiffFile | null;
1410
+ }>;
1363
1411
  checkoutPrCreate(cwd: string, input: {
1364
1412
  title?: string;
1365
1413
  body?: string;
@@ -1368,17 +1416,31 @@ export declare class DaemonClient {
1368
1416
  checkoutPrMerge(cwd: string, input: {
1369
1417
  method: CheckoutPrMergeMethod;
1370
1418
  }, requestId?: string): Promise<CheckoutPrMergePayload>;
1419
+ checkoutForgeSetAutoMerge(cwd: string, input: {
1420
+ enabled: true;
1421
+ method: CheckoutPrMergeMethod;
1422
+ } | {
1423
+ enabled: false;
1424
+ }, requestId?: string): Promise<CheckoutForgeSetAutoMergePayload>;
1371
1425
  checkoutGithubSetAutoMerge(cwd: string, input: {
1372
1426
  enabled: true;
1373
1427
  method: CheckoutPrMergeMethod;
1374
1428
  } | {
1375
1429
  enabled: false;
1376
1430
  }, requestId?: string): Promise<CheckoutGithubSetAutoMergePayload>;
1431
+ checkoutForgeGetCheckDetails(input: {
1432
+ cwd: string;
1433
+ repoOwner?: string;
1434
+ repoName?: string;
1435
+ checkRunId?: number;
1436
+ workflowRunId?: number;
1437
+ changeRequestNumber?: number;
1438
+ }, requestId?: string): Promise<CheckoutForgeGetCheckDetailsPayload>;
1377
1439
  checkoutGithubGetCheckDetails(input: {
1378
1440
  cwd: string;
1379
- repoOwner: string;
1380
- repoName: string;
1381
- checkRunId: number;
1441
+ repoOwner?: string;
1442
+ repoName?: string;
1443
+ checkRunId?: number;
1382
1444
  workflowRunId?: number;
1383
1445
  }, requestId?: string): Promise<CheckoutGithubGetCheckDetailsPayload>;
1384
1446
  checkoutPrStatus(cwd: string, requestId?: string): Promise<CheckoutPrStatusPayload>;
@@ -1409,11 +1471,8 @@ export declare class DaemonClient {
1409
1471
  scope?: "workspace" | "worktree";
1410
1472
  }, requestId?: string): Promise<PaseoWorktreeArchivePayload>;
1411
1473
  createPaseoWorktree(input: CreatePaseoWorktreeInput, requestId?: string): Promise<CreatePaseoWorktreePayload>;
1412
- createWorkspace(input: {
1413
- source: WorkspaceCreateRequest["source"];
1414
- title?: string;
1415
- firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
1416
- }, requestId?: string): Promise<WorkspaceCreatePayload>;
1474
+ createWorkspace(input: CreateWorkspaceRequestOptions, requestId?: string): Promise<WorkspaceCreatePayload>;
1475
+ private createLegacyWorkspace;
1417
1476
  validateBranch(options: {
1418
1477
  cwd: string;
1419
1478
  branchName: string;
@@ -1423,6 +1482,12 @@ export declare class DaemonClient {
1423
1482
  query?: string;
1424
1483
  limit?: number;
1425
1484
  }, requestId?: string): Promise<BranchSuggestionsPayload>;
1485
+ searchForge(options: {
1486
+ cwd: string;
1487
+ query: string;
1488
+ limit?: number;
1489
+ kinds?: ForgeSearchRequest["kinds"];
1490
+ }, requestId?: string): Promise<ForgeSearchPayload>;
1426
1491
  searchGitHub(options: {
1427
1492
  cwd: string;
1428
1493
  query: string;
@@ -1439,9 +1504,68 @@ export declare class DaemonClient {
1439
1504
  }, requestId?: string): Promise<DirectorySuggestionsPayload>;
1440
1505
  private requestFileExplorer;
1441
1506
  listDirectory(cwd: string, path: string, requestId?: string): Promise<FileExplorerDirectoryPayload>;
1442
- readFile(cwd: string, path: string, requestId?: string): Promise<FileReadResult>;
1507
+ readFile(cwd: string, path: string, requestId?: string, maxBytes?: number): Promise<FileReadResult>;
1508
+ observeFile(input: {
1509
+ cwd: string;
1510
+ path: string;
1511
+ signal?: AbortSignal;
1512
+ }): OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
1513
+ subscribeFile(input: {
1514
+ cwd: string;
1515
+ path: string;
1516
+ signal?: AbortSignal;
1517
+ }, onUpdate: (version: FileVersion) => void): Promise<{
1518
+ initial: FileVersion;
1519
+ subscription: OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
1520
+ unsubscribe: () => Promise<void>;
1521
+ }>;
1522
+ writeFile(input: {
1523
+ cwd: string;
1524
+ path: string;
1525
+ content: string;
1526
+ expectedModifiedAt: string;
1527
+ expectedRevision?: string;
1528
+ }): Promise<FileWriteResult>;
1529
+ createFileEntry(input: {
1530
+ cwd: string;
1531
+ parentPath: string;
1532
+ name: string;
1533
+ kind: "file" | "directory";
1534
+ }): Promise<CorrelatedResponsePayload<"fs.entry.create.response">>;
1535
+ renameFileEntry(input: {
1536
+ cwd: string;
1537
+ path: string;
1538
+ name: string;
1539
+ }): Promise<CorrelatedResponsePayload<"fs.entry.rename.response">>;
1540
+ duplicateFileEntry(input: {
1541
+ cwd: string;
1542
+ path: string;
1543
+ }): Promise<CorrelatedResponsePayload<"fs.entry.duplicate.response">>;
1544
+ deleteFileEntry(input: {
1545
+ cwd: string;
1546
+ path: string;
1547
+ }): Promise<CorrelatedResponsePayload<"fs.entry.delete.response">>;
1548
+ checkoutDiscardChanges(cwd: string, input: {
1549
+ paths: string[];
1550
+ }): Promise<CorrelatedResponsePayload<"checkout.discard_changes.response">>;
1551
+ uploadFile(file: {
1552
+ bytes: Uint8Array;
1553
+ path: string;
1554
+ mime: string;
1555
+ modifiedAt: string;
1556
+ }, opts: {
1557
+ agentId: string;
1558
+ onProgress?: (bytesSent: number, totalBytes: number) => void;
1559
+ signal?: AbortSignal;
1560
+ }): Promise<{
1561
+ fileId: string;
1562
+ path: string;
1563
+ size: number;
1564
+ mimeType: string;
1565
+ }>;
1443
1566
  requestDownloadToken(cwd: string, path: string, requestId?: string): Promise<FileDownloadTokenPayload>;
1444
1567
  requestProjectIcon(cwd: string, requestId?: string): Promise<ProjectIconResponse["payload"]>;
1568
+ getProjectIcon(projectId: string, requestId?: string): Promise<ProjectIconGetResponse["payload"]>;
1445
1569
  listProviderModels(provider: AgentProvider, options?: {
1446
1570
  cwd?: string;
1447
1571
  requestId?: string;
@@ -1458,20 +1582,64 @@ export declare class DaemonClient {
1458
1582
  }): Promise<ListAvailableProvidersPayload>;
1459
1583
  getProvidersSnapshot(options?: {
1460
1584
  cwd?: string;
1585
+ ifNoneMatch?: string;
1461
1586
  requestId?: string;
1462
1587
  }): Promise<GetProvidersSnapshotPayload>;
1463
- /**
1464
- * Re-read `agents.providers` from the daemon's config.json into its live
1465
- * provider registry. No restart. Returns the add/update/remove diff.
1466
- */
1467
- reloadProviderConfig(options?: {
1468
- requestId?: string;
1469
- }): Promise<ProvidersReloadConfigPayload>;
1588
+ private requestProvidersSnapshot;
1470
1589
  getDaemonConfig(requestId?: string): Promise<{
1471
1590
  requestId: string;
1472
1591
  config: MutableDaemonConfig;
1473
1592
  }>;
1474
1593
  getDaemonStatus(options?: DaemonStatusOptions): Promise<DaemonStatusPayload>;
1594
+ reloadDaemonConfig(requestId?: string): Promise<DaemonConfigReloadResponse["payload"]>;
1595
+ connectHub(hubUrl: string, token: string, permissions?: readonly string[], requestId?: string): Promise<{
1596
+ requestId: string;
1597
+ status: {
1598
+ state: "connecting" | "revoked" | "not_connected" | "connected" | "reconnecting" | "disconnecting";
1599
+ daemonId: string | null;
1600
+ hubOrigin: string | null;
1601
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1602
+ connectedAt: string | null;
1603
+ lastError: string | null;
1604
+ };
1605
+ }>;
1606
+ updateHubPermissions(input: {
1607
+ grant?: readonly string[];
1608
+ revoke?: readonly string[];
1609
+ }, requestId?: string): Promise<{
1610
+ requestId: string;
1611
+ status: {
1612
+ state: "connecting" | "revoked" | "not_connected" | "connected" | "reconnecting" | "disconnecting";
1613
+ daemonId: string | null;
1614
+ hubOrigin: string | null;
1615
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1616
+ connectedAt: string | null;
1617
+ lastError: string | null;
1618
+ };
1619
+ }>;
1620
+ getHubStatus(requestId?: string): Promise<{
1621
+ requestId: string;
1622
+ status: {
1623
+ state: "connecting" | "revoked" | "not_connected" | "connected" | "reconnecting" | "disconnecting";
1624
+ daemonId: string | null;
1625
+ hubOrigin: string | null;
1626
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1627
+ connectedAt: string | null;
1628
+ lastError: string | null;
1629
+ };
1630
+ }>;
1631
+ disconnectHub(force?: boolean, requestId?: string): Promise<{
1632
+ requestId: string;
1633
+ status: {
1634
+ state: "connecting" | "revoked" | "not_connected" | "connected" | "reconnecting" | "disconnecting";
1635
+ daemonId: string | null;
1636
+ hubOrigin: string | null;
1637
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1638
+ connectedAt: string | null;
1639
+ lastError: string | null;
1640
+ };
1641
+ warning?: string | undefined;
1642
+ }>;
1475
1643
  getDaemonPairingOffer(options?: DaemonPairingOfferOptions): Promise<DaemonPairingOfferPayload>;
1476
1644
  collectDiagnostics(requestId?: string): Promise<DiagnosticsPayload>;
1477
1645
  patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
@@ -1492,21 +1660,63 @@ export declare class DaemonClient {
1492
1660
  listProviderUsage(options?: {
1493
1661
  requestId?: string;
1494
1662
  }): Promise<ProviderUsageListPayload>;
1663
+ listUsageReports(options?: {
1664
+ requestId?: string;
1665
+ forceRefresh?: boolean;
1666
+ reportIds?: string[];
1667
+ }): Promise<UsageListReportsPayload>;
1495
1668
  listCommands(options: ListCommandsOptions): Promise<ListCommandsPayload>;
1496
1669
  listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
1497
1670
  listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise<ListCommandsPayload>;
1498
1671
  respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
1672
+ getPluginCatalog(): Promise<{
1673
+ id: string;
1674
+ clientBundle: string;
1675
+ requirements?: {
1676
+ paseo?: string | undefined;
1677
+ } | undefined;
1678
+ }[]>;
1679
+ listPlugins(): Promise<PluginListItem[]>;
1680
+ getPluginLogs(pluginId: string): Promise<PluginLogEntry[]>;
1681
+ getAgentSkillsStatus(): Promise<AgentSkillsStatus>;
1682
+ reconcileAgentSkills(): Promise<AgentSkillsStatus>;
1683
+ uninstallAgentSkills(): Promise<AgentSkillsStatus>;
1684
+ saveAgentSkillsSelection(selection: AgentSkillSelection, confirmedRemovals?: readonly string[]): Promise<AgentSkillsSaveResult>;
1685
+ importLegacyAgentSkillsSelection(selection: AgentSkillSelection): Promise<{
1686
+ imported: boolean;
1687
+ selection: AgentSkillSelection;
1688
+ }>;
1689
+ installDirectoryPlugin(path: string, id?: string): Promise<PluginListItem>;
1690
+ installPluginSource(input: {
1691
+ source: string;
1692
+ id?: string;
1693
+ ref?: string;
1694
+ }): Promise<PluginListItem>;
1695
+ getPluginSourceStatus(pluginId?: string): Promise<PluginSourceStatusItem[]>;
1696
+ private requirePluginUpdates;
1697
+ previewPluginUpdates(input?: {
1698
+ pluginId?: string;
1699
+ target?: PluginUpdateSelection;
1700
+ }): Promise<PluginUpdatePreview[]>;
1701
+ applyPluginUpdates(proposals: PluginUpdateProposal[]): Promise<PluginUpdateResult[]>;
1702
+ updatePluginSources(pluginId?: string): Promise<PluginSourceUpdateItem[]>;
1703
+ inspectDirectoryPlugin(path: string): Promise<{
1704
+ id: string;
1705
+ }>;
1706
+ reloadPlugin(pluginId: string): Promise<PluginListItem>;
1707
+ enablePlugin(pluginId: string): Promise<PluginListItem>;
1708
+ disablePlugin(pluginId: string): Promise<PluginListItem>;
1709
+ removePlugin(pluginId: string): Promise<void>;
1710
+ private managePlugin;
1711
+ invokePluginRpc(pluginId: string, method: string, input: unknown): Promise<unknown>;
1499
1712
  respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
1500
1713
  waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
1501
1714
  waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
1502
- subscribeTerminals(input: {
1503
- cwd: string;
1504
- workspaceId?: string;
1505
- }): void;
1506
- unsubscribeTerminals(input: {
1715
+ observeTerminals(input: {
1507
1716
  cwd: string;
1508
1717
  workspaceId?: string;
1509
- }): void;
1718
+ signal?: AbortSignal;
1719
+ }): OwnedSubscription<CorrelatedResponsePayload<"terminals_changed">>;
1510
1720
  listTerminals(cwd?: string, requestId?: string, options?: {
1511
1721
  workspaceId?: string;
1512
1722
  }): Promise<ListTerminalsPayload>;
@@ -1515,13 +1725,29 @@ export declare class DaemonClient {
1515
1725
  command?: string;
1516
1726
  args?: string[];
1517
1727
  workspaceId?: string;
1728
+ size?: {
1729
+ rows: number;
1730
+ cols: number;
1731
+ };
1518
1732
  }): Promise<CreateTerminalPayload>;
1519
1733
  renameTerminal(input: RenameTerminalInput): Promise<RenameTerminalResult>;
1520
- subscribeTerminal(terminalId: string, optionsOrRequestId?: {
1734
+ /**
1735
+ * Snapshot/restore and output arrive in receive. Subscribe to the returned handle
1736
+ * for terminal_stream_exit: payload.error means observation failure, not PTY exit.
1737
+ * Either outcome detaches this slot and releases the handle automatically.
1738
+ */
1739
+ observeTerminal(terminalId: string, receive: (event: TerminalStreamEvent) => void, options?: {
1740
+ restore?: SubscribeTerminalRequest["restore"];
1741
+ signal?: AbortSignal;
1742
+ requestId?: string;
1743
+ }): OwnedSubscription<SubscribeTerminalPayload>;
1744
+ subscribeTerminal(terminalId: string, options?: {
1521
1745
  restore?: SubscribeTerminalRequest["restore"];
1746
+ signal?: AbortSignal;
1522
1747
  requestId?: string;
1523
- } | string): Promise<SubscribeTerminalPayload>;
1524
- unsubscribeTerminal(terminalId: string): void;
1748
+ }): Promise<SubscribeTerminalPayload & {
1749
+ subscription: OwnedSubscription<SubscribeTerminalPayload>;
1750
+ }>;
1525
1751
  sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
1526
1752
  killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
1527
1753
  closeItems(input: {
@@ -1534,33 +1760,196 @@ export declare class DaemonClient {
1534
1760
  stripAnsi?: boolean;
1535
1761
  }, requestId?: string): Promise<CaptureTerminalPayload>;
1536
1762
  /**
1537
- * Read an agent's rendered terminal screen.
1763
+ * Read an agent's rendered terminal screen.
1764
+ *
1765
+ * `payload.screen` is null when the agent has no readable pane (SDK transport, or a PTY
1766
+ * without tmux). That is the normal negative answer, not an error, so callers branch on it
1767
+ * rather than catching.
1768
+ */
1769
+ scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
1770
+ scheduleList(requestId?: string): Promise<ScheduleListPayload>;
1771
+ /**
1772
+ * Preview what a filter would have matched over a window of its source's
1773
+ * history. A READ: the daemon side of this arms nothing, mints no session and
1774
+ * writes no ledger row.
1775
+ *
1776
+ * `payload.result` and `payload.error` are both nullable and exactly one is
1777
+ * populated, so a caller can tell "the window held nothing" from "the read
1778
+ * failed" - a distinction a bare empty array would destroy.
1779
+ */
1780
+ scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
1781
+ scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
1782
+ schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
1783
+ scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
1784
+ scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
1785
+ scheduleRunOnce(options: InspectScheduleOptions): Promise<ScheduleRunOncePayload>;
1786
+ scheduleUpdate(options: UpdateScheduleOptions): Promise<ScheduleUpdatePayload>;
1787
+ onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
1788
+ waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
1789
+ /**
1790
+ * Upload a file to an agent's workspace as a windowed, cancellable,
1791
+ * progress-reporting stream of {@link UPLOAD_CHUNK_SIZE_BYTES} `FileChunk`
1792
+ * frames with ack-based flow control. Resolves `{ fileId, path, size,
1793
+ * mimeType }` once the daemon finalizes the file.
1794
+ *
1795
+ * Purely additive over the receive path (`activeBinaryFileTransfers`): this
1796
+ * method only sends. It never buffers more than {@link UPLOAD_WINDOW_SIZE}
1797
+ * chunks in flight, so it cannot approach the relay's `MAX_PENDING_SENDS`
1798
+ * ceiling.
1799
+ *
1800
+ * @throws {UploadCancelledError} when `opts.signal` aborts
1801
+ * @throws {UploadCapExceededError} when the daemon rejects on the size cap
1802
+ * @throws {UploadFailedError} for any other transfer failure
1803
+ */
1804
+ protected createRequestId(requestId?: string): string;
1805
+ getLastServerInfoMessage(): ServerInfoStatusPayload | null;
1806
+ private requireHubRelationshipSupport;
1807
+ private requireDaemonConfigReloadSupport;
1808
+ private resolveTransportUrlForAttempt;
1809
+ private sendHelloMessage;
1810
+ private disposeTransport;
1811
+ private cleanupTransport;
1812
+ private resetConnectTimeout;
1813
+ private handleTransportMessage;
1814
+ private handleJsonPayload;
1815
+ private tryHandleBinaryFrame;
1816
+ private handleFileTransferFrame;
1817
+ private updateConnectionState;
1818
+ setReconnectEnabled(enabled: boolean): void;
1819
+ private scheduleReconnect;
1820
+ private emitDisconnectedStateForReconnect;
1821
+ private armReconnectTimer;
1822
+ private resolvePingProbe;
1823
+ private clearPingProbe;
1824
+ private rejectPingProbe;
1825
+ private recordLivenessFailure;
1826
+ private handleSessionMessage;
1827
+ private deliverSessionMessage;
1828
+ private resolveWaiters;
1829
+ private rejectWaitersForRequestId;
1830
+ private clearWaiters;
1831
+ private toEvent;
1832
+ private waitForWithCancel;
1833
+ /**
1834
+ * Answer a decision the agent parked on its digest. `optionId: null` with a
1835
+ * note is a free-text answer, an option the agent did not list.
1538
1836
  *
1539
- * `payload.screen` is null when the agent has no readable pane (SDK transport, or a PTY
1540
- * without tmux). That is the normal negative answer, not an error, so callers branch on it
1541
- * rather than catching.
1837
+ * Pass the `revision` of the decision you showed the user. The daemon refuses
1838
+ * the answer if the agent reworded the decision since, instead of recording a
1839
+ * choice against text the user never read. Appended after `requestId` so
1840
+ * existing positional callers keep working.
1841
+ */
1842
+ answerAgentDecision(agentId: string, decisionId: string, optionId: string | null, note: string | null, requestId?: string, revision?: string | null): Promise<{
1843
+ decision: PendingDecision | null;
1844
+ }>;
1845
+ /**
1846
+ * Expire decisions nobody answered, recorded as `answeredBy: "timeout"` with a
1847
+ * note. Unlike `answerAgentDecision` this never records the user as the
1848
+ * writer and never prompts the agent. Pass `agentId` + `decisionId` for one
1849
+ * decision (any age), or neither to sweep every stored agent past
1850
+ * `olderThanMs`. `dryRun` reports without writing.
1542
1851
  */
1852
+ private buildAuthHeader;
1853
+ cancelWorkflow(workflowId: string): Promise<WorkflowSnapshot>;
1543
1854
  captureAgentPane(agentId: string, options?: {
1544
1855
  ansi?: boolean;
1545
1856
  scrollbackLines?: number;
1546
1857
  }, requestId?: string): Promise<CaptureAgentPanePayload>;
1858
+ private checkoutDiffSubscriptions;
1859
+ consolidateAgents(winnerId: string, sourceIds: string[], requestId?: string): Promise<{
1860
+ archivedIds: string[];
1861
+ }>;
1862
+ /**
1863
+ * Snooze a session out of the triage ring until a time, or clear it with
1864
+ * `until: null`.
1865
+ *
1866
+ * The three fields are the whole point: a time alone is "later". `untilWhat`
1867
+ * names the event, `why` names what is missing. The daemon accepts a
1868
+ * time-only snooze, because a CLI caller making that call is still deciding;
1869
+ * requiring the other two is a client policy that escalates with the count.
1870
+ */
1871
+ private createAgentRequest;
1872
+ createAgentWithRoutine(options: CreateAgentRequestOptions & {
1873
+ routine: NonNullable<CreateAgentRequestOptions["routine"]>;
1874
+ }): Promise<{
1875
+ agent: AgentSnapshotPayload;
1876
+ routine: {
1877
+ scheduleId: string;
1878
+ nextRunAt: string | null;
1879
+ };
1880
+ }>;
1547
1881
  createChatRoom(options: CreateChatRoomOptions): Promise<ChatCreatePayload>;
1548
- listChatRooms(requestId?: string): Promise<ChatListPayload>;
1549
- inspectChatRoom(options: InspectChatRoomOptions): Promise<ChatInspectPayload>;
1882
+ private daemonHttpJson;
1550
1883
  deleteChatRoom(options: DeleteChatRoomOptions): Promise<ChatDeletePayload>;
1551
- postChatMessage(options: PostChatMessageOptions): Promise<ChatPostPayload>;
1552
- readChatMessages(options: ReadChatMessagesOptions): Promise<ChatReadPayload>;
1553
- waitForChatMessages(options: WaitForChatMessagesOptions): Promise<ChatWaitPayload>;
1554
- scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
1555
- scheduleList(requestId?: string): Promise<ScheduleListPayload>;
1884
+ dismissBackgroundTask(agentId: string, taskId: string): Promise<{
1885
+ dismissed: boolean;
1886
+ }>;
1887
+ editMessage(agentId: string, turnId: string, newContent: string): Promise<{
1888
+ newSessionId: string;
1889
+ adopted: boolean;
1890
+ }>;
1891
+ enrichReferences(urls: string[]): Promise<ReferenceEnrichment[]>;
1556
1892
  /**
1557
- * Preview what a filter would have matched over a window of its source's
1558
- * history. A READ: the daemon side of this arms nothing, mints no session and
1559
- * writes no ledger row.
1893
+ * Read a background shell's captured output. Resolves with `text: null` when
1894
+ * the daemon does not know the shell or it captured nothing. The daemon tails
1895
+ * and redacts before sending.
1896
+ */
1897
+ executeExtensionCommand(commandId: string, args?: unknown[]): Promise<unknown>;
1898
+ expireAgentDecisions(input: {
1899
+ olderThanMs?: number | null;
1900
+ agentId?: string | null;
1901
+ decisionId?: string | null;
1902
+ dryRun?: boolean;
1903
+ note?: string | null;
1904
+ }, requestId?: string): Promise<AgentDecisionsExpireResult>;
1905
+ /**
1906
+ * Fold sessions into one that already exists: the winner keeps its transcript,
1907
+ * the sources are linked both ways and then archived.
1560
1908
  *
1561
- * `payload.result` and `payload.error` are both nullable and exactly one is
1562
- * populated, so a caller can tell "the window held nothing" from "the read
1563
- * failed" - a distinction a bare empty array would destroy.
1909
+ * One call rather than a client-side loop, because a half-consolidated fleet
1910
+ * is worse than either end state.
1911
+ */
1912
+ fleetAsk(options: AskFleetDecisionOptions): Promise<FleetAskPayload>;
1913
+ /** Decisions loops are waiting on a person for, most urgent first. */
1914
+ fleetCreate(options: CreateFleetLoopOptions): Promise<FleetCreatePayload>;
1915
+ fleetDecisions(options?: ListFleetDecisionsOptions): Promise<FleetDecisionsPayload>;
1916
+ /** Answer one decision as the human. */
1917
+ fleetExecutions(options: InspectFleetLoopOptions): Promise<FleetExecutionsPayload>;
1918
+ fleetInspect(options: InspectFleetLoopOptions): Promise<FleetInspectPayload>;
1919
+ fleetList(requestId?: string): Promise<FleetListPayload>;
1920
+ fleetPause(options: InspectFleetLoopOptions): Promise<FleetPausePayload>;
1921
+ /** Raise a typed question from a loop. */
1922
+ fleetResolveDecision(options: ResolveFleetDecisionOptions): Promise<FleetResolveDecisionPayload>;
1923
+ /** Persist a loop's declared parameters. */
1924
+ fleetResume(options: InspectFleetLoopOptions): Promise<FleetResumePayload>;
1925
+ fleetRunNow(options: InspectFleetLoopOptions): Promise<FleetRunNowPayload>;
1926
+ fleetSetMode(options: SetFleetLoopModeOptions): Promise<FleetSetModePayload>;
1927
+ fleetSetParams(options: SetFleetLoopParamsOptions): Promise<FleetSetParamsPayload>;
1928
+ /** Promote a loop to live, or demote it to dry-run. */
1929
+ getAgentsByIds(ids: string[], options?: {
1930
+ requestId?: string;
1931
+ timeout?: number;
1932
+ fields?: FetchAgentsOptions["fields"];
1933
+ scope?: "active";
1934
+ }): Promise<GetAgentsByIdsPayload>;
1935
+ getFileUploadsCapability(): boolean;
1936
+ private getHttpBaseUrl;
1937
+ getVapidPublicKey(): Promise<string | null>;
1938
+ getWorkflow(workflowId: string): Promise<WorkflowSnapshot | null>;
1939
+ ingestionApply(options: {
1940
+ requestId?: string;
1941
+ filterId: string;
1942
+ itemKeys: string[];
1943
+ mode: "dry-run" | "apply";
1944
+ confirmedGroups?: number;
1945
+ }): Promise<IngestionApplyPayload>;
1946
+ /**
1947
+ * Read one cohort's progress. A READ, and the only way to get one.
1948
+ *
1949
+ * `payload.cohort` and `payload.error` are both nullable and their pairing is
1950
+ * the message: a null cohort with a null error means this cohort does not
1951
+ * exist, and a null cohort with an error means the read failed. A caller that
1952
+ * cannot tell those apart renders a broken daemon as a finished batch.
1564
1953
  */
1565
1954
  ingestionBackfill(options: {
1566
1955
  filterId: string;
@@ -1577,74 +1966,161 @@ export declare class DaemonClient {
1577
1966
  * adjusts it - the daemon recomputes on arrival and answers `stale-plan` on any
1578
1967
  * mismatch, which is the whole point of sending it.
1579
1968
  */
1580
- ingestionApply(options: {
1969
+ ingestionCohortCancel(options: {
1970
+ cohortId: string;
1581
1971
  requestId?: string;
1582
- filterId: string;
1583
- itemKeys: string[];
1584
- mode: "dry-run" | "apply";
1585
- confirmedGroups?: number;
1586
- }): Promise<IngestionApplyPayload>;
1972
+ }): Promise<IngestionCohortCancelPayload>;
1973
+ /**
1974
+ * The STORED verification state of one filter's ingestion runs.
1975
+ *
1976
+ * A read, and only a read: the daemon answers from the ledger and issues no
1977
+ * source round-trip, so this is safe to call on a render. `runs: []` with
1978
+ * `error: null` is a real answer meaning "this filter has no source
1979
+ * schedule"; `[]` beside a non-null error means the read failed. A caller
1980
+ * that collapses the two shows a broken daemon as an idle filter.
1981
+ */
1982
+ ingestionCohortInspect(options: {
1983
+ cohortId: string;
1984
+ requestId?: string;
1985
+ }): Promise<IngestionCohortInspectPayload>;
1986
+ /**
1987
+ * Cancel a cohort's PENDING groups. Never its running ones.
1988
+ *
1989
+ * There is no field here through which a caller could ask for a live session to
1990
+ * be interrupted, because a running group may be mid-write to Gmail or GitLab
1991
+ * and the half-drafted email is the failure this whole path exists to avoid.
1992
+ * The response's `stillRunning` is the receipt for what was left alone.
1993
+ */
1994
+ ingestionFilterCreate(options: IngestionFilterCreateOptions): Promise<IngestionFilterCreatePayload>;
1995
+ ingestionFilterDelete(options: IngestionFilterDeleteOptions): Promise<IngestionFilterDeletePayload>;
1996
+ /**
1997
+ * Forget a source locally. The aggregator keeps the grant; `sourceAssign`
1998
+ * can point a later source at it, and a new connect never adopts it alone.
1999
+ */
2000
+ /** Deploy a trigger so the source actually emits events a filter can match. */
2001
+ ingestionFilterList(options?: IngestionFilterListOptions): Promise<IngestionFilterListPayload>;
2002
+ ingestionFilterUpdate(options: IngestionFilterUpdateOptions): Promise<IngestionFilterUpdatePayload>;
2003
+ ingestionRuns(options: IngestionRunsOptions): Promise<IngestionRunsPayload>;
2004
+ inspectChatRoom(options: InspectChatRoomOptions): Promise<ChatInspectPayload>;
2005
+ listAllSessions(options?: {
2006
+ signal?: AbortSignal;
2007
+ }): Promise<Array<{
2008
+ sid: string;
2009
+ title: string | null;
2010
+ lastActivity: string;
2011
+ cwd: string;
2012
+ agentName: string | null;
2013
+ }>>;
2014
+ listBackgroundTasks(agentId?: string): Promise<BackgroundTaskPayload[]>;
2015
+ /**
2016
+ * Record session context (links + non-live credentials) onto an agent's
2017
+ * digest. Used by the context hook, which runs beside an agent rather than
2018
+ * inside it and so cannot reach the agent-scoped `set_session_digest` MCP
2019
+ * tool.
2020
+ *
2021
+ * Returns how many secrets the daemon had to mask, so a caller can report
2022
+ * that it handed over something it should not have.
2023
+ */
2024
+ listChatRooms(requestId?: string): Promise<ChatListPayload>;
2025
+ listExtensions(): Promise<InstalledExtension[]>;
2026
+ listWorkflows(): Promise<WorkflowSnapshot[]>;
2027
+ listWorkspaceSessions(workspaceId: string, options?: {
2028
+ signal?: AbortSignal;
2029
+ }): Promise<Array<{
2030
+ sid: string;
2031
+ title: string | null;
2032
+ lastActivity: string;
2033
+ cwd: string;
2034
+ agentName: string | null;
2035
+ }>>;
2036
+ loopInspect(options: string | InspectLoopOptions): Promise<LoopInspectPayload>;
2037
+ loopList(requestId?: string): Promise<LoopListPayload>;
2038
+ loopLogs(options: string | LoopLogsOptions, afterSeq?: number): Promise<LoopLogsPayload>;
2039
+ loopRun(options: RunLoopOptions): Promise<LoopRunPayload>;
2040
+ loopStop(options: string | StopLoopOptions): Promise<LoopStopPayload>;
2041
+ postChatMessage(options: PostChatMessageOptions): Promise<ChatPostPayload>;
2042
+ readBackgroundTaskOutput(agentId: string, taskId: string, options?: {
2043
+ maxBytes?: number;
2044
+ }): Promise<{
2045
+ text: string | null;
2046
+ truncated: boolean;
2047
+ byteSize: number;
2048
+ }>;
2049
+ readChatMessages(options: ReadChatMessagesOptions): Promise<ChatReadPayload>;
2050
+ reloadProviderConfig(options?: {
2051
+ requestId?: string;
2052
+ }): Promise<ProvidersReloadConfigPayload>;
2053
+ private reportRequestCompletion;
2054
+ private sendCorrelatedRequest;
2055
+ private sendCorrelatedSessionRequest;
2056
+ private sendNamespacedCorrelatedSessionRequest;
2057
+ private resubscribeCheckoutDiffSubscriptions;
2058
+ private resubscribeTerminalDirectorySubscriptions;
2059
+ rewindSession(agentId: string, turnId: string): Promise<{
2060
+ newSessionId: string;
2061
+ }>;
2062
+ searchSessions(params: {
2063
+ query: string;
2064
+ limit?: number;
2065
+ sources?: readonly string[];
2066
+ signal?: AbortSignal;
2067
+ }): Promise<Array<{
2068
+ sid: string;
2069
+ source: string;
2070
+ cwd: string;
2071
+ timestamp: string;
2072
+ snippet: string;
2073
+ resumeCommand: string;
2074
+ }>>;
1587
2075
  /**
1588
- * Read one cohort's progress. A READ, and the only way to get one.
1589
- *
1590
- * `payload.cohort` and `payload.error` are both nullable and their pairing is
1591
- * the message: a null cohort with a null error means this cohort does not
1592
- * exist, and a null cohort with an error means the read failed. A caller that
1593
- * cannot tell those apart renders a broken daemon as a finished batch.
2076
+ * Derive the daemon's HTTP base URL from the WebSocket URL we connected with.
2077
+ * Works for direct (ws://host:port/ws) and same-origin (web served by
2078
+ * daemon). For relay-mode (wss://relay.../ws), HTTP routes against the
2079
+ * daemon are not addressable — throws so callers fall back gracefully.
1594
2080
  */
1595
- ingestionCohortInspect(options: {
1596
- cohortId: string;
1597
- requestId?: string;
1598
- }): Promise<IngestionCohortInspectPayload>;
2081
+ sendWatchAction(message: WatchNotificationActionMessage | WatchSessionSearchMessage | WatchComposerDictateMessage): void;
2082
+ setAgentContext(input: {
2083
+ agentId: string;
2084
+ links?: {
2085
+ kind: SessionDigestLink["kind"];
2086
+ url: string;
2087
+ label?: string;
2088
+ }[];
2089
+ secrets?: {
2090
+ label: string;
2091
+ value: string;
2092
+ source?: string;
2093
+ }[];
2094
+ }): Promise<{
2095
+ digest: SessionDigest | null;
2096
+ maskedCount: number;
2097
+ error?: string;
2098
+ }>;
1599
2099
  /**
1600
- * Cancel a cohort's PENDING groups. Never its running ones.
2100
+ * Ask the daemon what it can see about external reference URLs -- a GitLab
2101
+ * pipeline's status, a merge request's state, a Jira issue's column.
1601
2102
  *
1602
- * There is no field here through which a caller could ask for a live session to
1603
- * be interrupted, because a running group may be mid-write to Gmail or GitLab
1604
- * and the half-drafted email is the failure this whole path exists to avoid.
1605
- * The response's `stillRunning` is the receipt for what was left alone.
2103
+ * The provider credentials live on the daemon, so the app never holds one.
2104
+ * An entry the daemon could not look up still comes back, carrying
2105
+ * `unavailableReason`, so a card can say what it could not see instead of
2106
+ * spinning. See docs/session-context-rail.md.
1606
2107
  */
1607
- ingestionCohortCancel(options: {
1608
- cohortId: string;
1609
- requestId?: string;
1610
- }): Promise<IngestionCohortCancelPayload>;
2108
+ snoozeAgent(agentId: string, until: string | null, untilWhat?: string | null, why?: string | null, requestId?: string): Promise<{
2109
+ snooze: AgentSnoozeState | null;
2110
+ }>;
2111
+ sourceAccounts(options: SourceAccountsOptions): Promise<SourceAccountsPayload>;
2112
+ /** Point a source at one of those accounts. A refusal comes back as `reason`. */
2113
+ sourceActions(options: SourceActionsOptions): Promise<SourceActionsPayload>;
2114
+ /** Run one action as the source's bound account. Not idempotent: never retry blindly. */
2115
+ sourceAssign(options: SourceAssignOptions): Promise<SourceAssignPayload>;
1611
2116
  /**
1612
- * The STORED verification state of one filter's ingestion runs.
2117
+ * The recent items of one source, payloads included. Read-only: the daemon
2118
+ * side creates, writes, arms and spawns nothing.
1613
2119
  *
1614
- * A read, and only a read: the daemon answers from the ledger and issues no
1615
- * source round-trip, so this is safe to call on a render. `runs: []` with
1616
- * `error: null` is a real answer meaning "this filter has no source
1617
- * schedule"; `[]` beside a non-null error means the read failed. A caller
1618
- * that collapses the two shows a broken daemon as an idle filter.
2120
+ * A failed read resolves with `payload.error` set rather than rejecting, so a
2121
+ * caller can tell an empty window from a read that never happened.
1619
2122
  */
1620
- ingestionRuns(options: IngestionRunsOptions): Promise<IngestionRunsPayload>;
1621
- fleetList(requestId?: string): Promise<FleetListPayload>;
1622
- fleetInspect(options: InspectFleetLoopOptions): Promise<FleetInspectPayload>;
1623
- fleetRunNow(options: InspectFleetLoopOptions): Promise<FleetRunNowPayload>;
1624
- fleetPause(options: InspectFleetLoopOptions): Promise<FleetPausePayload>;
1625
- /** Raise a typed question from a loop. */
1626
- fleetAsk(options: AskFleetDecisionOptions): Promise<FleetAskPayload>;
1627
- /** Decisions loops are waiting on a person for, most urgent first. */
1628
- fleetDecisions(options?: ListFleetDecisionsOptions): Promise<FleetDecisionsPayload>;
1629
- /** Answer one decision as the human. */
1630
- fleetResolveDecision(options: ResolveFleetDecisionOptions): Promise<FleetResolveDecisionPayload>;
1631
- /** Persist a loop's declared parameters. */
1632
- fleetSetParams(options: SetFleetLoopParamsOptions): Promise<FleetSetParamsPayload>;
1633
- /** Promote a loop to live, or demote it to dry-run. */
1634
- fleetSetMode(options: SetFleetLoopModeOptions): Promise<FleetSetModePayload>;
1635
- fleetResume(options: InspectFleetLoopOptions): Promise<FleetResumePayload>;
1636
- fleetCreate(options: CreateFleetLoopOptions): Promise<FleetCreatePayload>;
1637
- fleetExecutions(options: InspectFleetLoopOptions): Promise<FleetExecutionsPayload>;
1638
- scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
1639
- scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
1640
- schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
1641
- scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
1642
- scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
1643
- scheduleRunOnce(options: InspectScheduleOptions): Promise<ScheduleRunOncePayload>;
1644
- scheduleUpdate(options: UpdateScheduleOptions): Promise<ScheduleUpdatePayload>;
1645
2123
  sourceCatalogue(options: SourceCatalogueOptions): Promise<SourceCataloguePayload>;
1646
- sourceConnect(options: SourceConnectOptions): Promise<SourceConnectPayload>;
1647
- sourceList(requestId?: string): Promise<SourceListPayload>;
1648
2124
  sourceCheck(options: SourceCheckOptions): Promise<SourceCheckPayload>;
1649
2125
  /**
1650
2126
  * FILTER AUTHORING (Epic 7).
@@ -1655,31 +2131,8 @@ export declare class DaemonClient {
1655
2131
  * absent. Every shipped daemon lacked it, so that control has been disabled
1656
2132
  * on every host that exists. This is the method it was waiting for.
1657
2133
  */
1658
- ingestionFilterList(options?: IngestionFilterListOptions): Promise<IngestionFilterListPayload>;
1659
- ingestionFilterCreate(options: IngestionFilterCreateOptions): Promise<IngestionFilterCreatePayload>;
1660
- ingestionFilterUpdate(options: IngestionFilterUpdateOptions): Promise<IngestionFilterUpdatePayload>;
1661
- ingestionFilterDelete(options: IngestionFilterDeleteOptions): Promise<IngestionFilterDeletePayload>;
1662
- /**
1663
- * Forget a source locally. The aggregator keeps the grant; `sourceAssign`
1664
- * can point a later source at it, and a new connect never adopts it alone.
1665
- */
1666
- /** Deploy a trigger so the source actually emits events a filter can match. */
1667
- sourceTriggers(options: {
1668
- sourceId: string;
1669
- requestId?: string;
1670
- }): Promise<SourceTriggersPayload>;
1671
- /** The actions this source's app offers. Read-only. */
1672
- sourceActions(options: SourceActionsOptions): Promise<SourceActionsPayload>;
1673
- /** Run one action as the source's bound account. Not idempotent: never retry blindly. */
1674
- sourceRun(options: SourceRunOptions): Promise<SourceRunPayload>;
1675
- sourceSubscribe(options: SourceSubscribeOptions): Promise<SourceSubscribePayload>;
2134
+ sourceConnect(options: SourceConnectOptions): Promise<SourceConnectPayload>;
1676
2135
  sourceDisconnect(options: SourceDisconnectOptions): Promise<SourceDisconnectPayload>;
1677
- /** Give a source the user's own name, or clear it. Local only. */
1678
- sourceRename(options: SourceRenameOptions): Promise<SourceRenamePayload>;
1679
- /** Every account the aggregator holds for this source's app. Read-only. */
1680
- sourceAccounts(options: SourceAccountsOptions): Promise<SourceAccountsPayload>;
1681
- /** Point a source at one of those accounts. A refusal comes back as `reason`. */
1682
- sourceAssign(options: SourceAssignOptions): Promise<SourceAssignPayload>;
1683
2136
  /**
1684
2137
  * Add an HTTPS API as a custom source. Gated on the daemon's
1685
2138
  * `sourceCustomApi` feature by the caller. A refusal comes back as `reason`.
@@ -1695,76 +2148,70 @@ export declare class DaemonClient {
1695
2148
  secret: string;
1696
2149
  requestId?: string;
1697
2150
  }): Promise<SourceSetSecretPayload>;
1698
- /**
1699
- * The recent items of one source, payloads included. Read-only: the daemon
1700
- * side creates, writes, arms and spawns nothing.
1701
- *
1702
- * A failed read resolves with `payload.error` set rather than rejecting, so a
1703
- * caller can tell an empty window from a read that never happened.
1704
- */
1705
2151
  sourceItems(options: SourceItemsOptions): Promise<SourceItemsPayload>;
1706
- loopRun(options: RunLoopOptions): Promise<LoopRunPayload>;
1707
- loopList(requestId?: string): Promise<LoopListPayload>;
1708
- loopInspect(options: string | InspectLoopOptions): Promise<LoopInspectPayload>;
1709
- loopLogs(options: string | LoopLogsOptions, afterSeq?: number): Promise<LoopLogsPayload>;
1710
- loopStop(options: string | StopLoopOptions): Promise<LoopStopPayload>;
1711
- onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
1712
- waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
1713
- /**
1714
- * Upload a file to an agent's workspace as a windowed, cancellable,
1715
- * progress-reporting stream of {@link UPLOAD_CHUNK_SIZE_BYTES} `FileChunk`
1716
- * frames with ack-based flow control. Resolves `{ fileId, path, size,
1717
- * mimeType }` once the daemon finalizes the file.
1718
- *
1719
- * Purely additive over the receive path (`activeBinaryFileTransfers`): this
1720
- * method only sends. It never buffers more than {@link UPLOAD_WINDOW_SIZE}
1721
- * chunks in flight, so it cannot approach the relay's `MAX_PENDING_SENDS`
1722
- * ceiling.
1723
- *
1724
- * @throws {UploadCancelledError} when `opts.signal` aborts
1725
- * @throws {UploadCapExceededError} when the daemon rejects on the size cap
1726
- * @throws {UploadFailedError} for any other transfer failure
1727
- */
1728
- uploadFile(file: {
1729
- bytes: Uint8Array;
1730
- path: string;
1731
- mime: string;
1732
- modifiedAt: string;
1733
- }, opts: {
1734
- agentId: string;
1735
- onProgress?: (bytesSent: number, totalBytes: number) => void;
1736
- signal?: AbortSignal;
2152
+ sourceList(requestId?: string): Promise<SourceListPayload>;
2153
+ /** Give a source the user's own name, or clear it. Local only. */
2154
+ sourceRename(options: SourceRenameOptions): Promise<SourceRenamePayload>;
2155
+ /** Every account the aggregator holds for this source's app. Read-only. */
2156
+ sourceRun(options: SourceRunOptions): Promise<SourceRunPayload>;
2157
+ sourceSubscribe(options: SourceSubscribeOptions): Promise<SourceSubscribePayload>;
2158
+ sourceTriggers(options: {
2159
+ sourceId: string;
2160
+ requestId?: string;
2161
+ }): Promise<SourceTriggersPayload>;
2162
+ /** The actions this source's app offers. Read-only. */
2163
+ startWorkflow(input: {
2164
+ graph: WorkflowTaskGraph;
2165
+ provider: string;
2166
+ cwd: string;
2167
+ model?: string;
2168
+ title?: string;
2169
+ labels?: Record<string, string>;
2170
+ agentPresets?: Record<string, WorkflowAgentPreset>;
1737
2171
  }): Promise<{
1738
- fileId: string;
1739
- path: string;
1740
- size: number;
1741
- mimeType: string;
2172
+ workflowId: string;
2173
+ childAgentIds: string[];
2174
+ status: WorkflowStatus;
1742
2175
  }>;
1743
- protected createRequestId(requestId?: string): string;
1744
- getLastServerInfoMessage(): ServerInfoStatusPayload | null;
1745
- getFileUploadsCapability(): boolean;
1746
- private resolveTransportUrlForAttempt;
1747
- private sendHelloMessage;
1748
- private disposeTransport;
1749
- private cleanupTransport;
1750
- private resetConnectTimeout;
1751
- private handleTransportMessage;
1752
- private handleJsonPayload;
1753
- private tryHandleBinaryFrame;
1754
- private handleFileTransferFrame;
1755
- private updateConnectionState;
1756
- setReconnectEnabled(enabled: boolean): void;
1757
- private scheduleReconnect;
1758
- private emitDisconnectedStateForReconnect;
1759
- private armReconnectTimer;
1760
- private resolvePingProbe;
1761
- private clearPingProbe;
1762
- private rejectPingProbe;
1763
- private recordLivenessFailure;
1764
- private handleSessionMessage;
1765
- private resolveWaiters;
1766
- private clearWaiters;
1767
- private toEvent;
1768
- private waitForWithCancel;
2176
+ subscribeCheckoutDiff(cwd: string, compare: {
2177
+ mode: "uncommitted" | "base";
2178
+ baseRef?: string;
2179
+ ignoreWhitespace?: boolean;
2180
+ }, options?: {
2181
+ subscriptionId?: string;
2182
+ requestId?: string;
2183
+ }): Promise<SubscribeCheckoutDiffPayload>;
2184
+ subscribePush(subscription: {
2185
+ type: "expo";
2186
+ token: string;
2187
+ } | {
2188
+ type: "web";
2189
+ subscription: {
2190
+ endpoint: string;
2191
+ keys: {
2192
+ p256dh: string;
2193
+ auth: string;
2194
+ };
2195
+ expirationTime?: number | null;
2196
+ };
2197
+ }): Promise<{
2198
+ ok: boolean;
2199
+ vapidPublicKey?: string;
2200
+ }>;
2201
+ subscribeTerminals(input: {
2202
+ cwd: string;
2203
+ workspaceId?: string;
2204
+ }): void;
2205
+ swapAgentProvider(agentId: string, newProviderId: string, overrides?: {
2206
+ model?: string | null;
2207
+ modeId?: string;
2208
+ }): Promise<void>;
2209
+ private terminalDirectorySubscriptions;
2210
+ unsubscribeCheckoutDiff(subscriptionId: string): void;
2211
+ unsubscribeTerminals(input: {
2212
+ cwd: string;
2213
+ workspaceId?: string;
2214
+ }): void;
2215
+ waitForChatMessages(options: WaitForChatMessagesOptions): Promise<ChatWaitPayload>;
1769
2216
  }
1770
2217
  //# sourceMappingURL=daemon-client.d.ts.map