@camerontaylor/paseo-client 0.8.0-fork.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1245 @@
1
+ import { type TimelineSubscription } from "./connection/index.js";
2
+ import type { CreationSnapshot } from "@camerontaylor/paseo-protocol/messages";
3
+ import type { z } from "zod";
4
+ import { type ClientCapability } from "@camerontaylor/paseo-protocol/client-capabilities";
5
+ import type { AgentAttentionNotificationPayload } from "@camerontaylor/paseo-protocol/agent-attention-notification";
6
+ import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload } from "@camerontaylor/paseo-protocol/messages";
7
+ import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DaemonConfigReloadResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState, PluginListItem, PluginLogEntry, PluginSourceStatusItem, PluginSourceUpdateItem, AgentSkillSelection, AgentSkillsStatus, AgentSkillsSaveResult } from "@camerontaylor/paseo-protocol/messages";
8
+ import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@camerontaylor/paseo-protocol/agent-types";
9
+ import type { AgentConfigApply, MutableDaemonConfig, MutableDaemonConfigPatch } from "@camerontaylor/paseo-protocol/messages";
10
+ import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
11
+ import { type TerminalStreamEvent } from "./terminal-stream-router.js";
12
+ import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@camerontaylor/paseo-protocol/browser-automation/rpc-schemas";
13
+ export interface Logger {
14
+ debug(obj: object, msg?: string): void;
15
+ info(obj: object, msg?: string): void;
16
+ warn(obj: object, msg?: string): void;
17
+ error(obj: object, msg?: string): void;
18
+ }
19
+ interface ImportAgentInputBase {
20
+ cwd?: string;
21
+ workspaceId?: string;
22
+ labels?: Record<string, string>;
23
+ }
24
+ export type ImportAgentInput = (ImportAgentInputBase & {
25
+ providerId: string;
26
+ providerHandleId: string;
27
+ }) | (ImportAgentInputBase & {
28
+ provider: AgentProvider;
29
+ sessionId: string;
30
+ });
31
+ export type { DaemonTransport, DaemonTransportFactory, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport.js";
32
+ export type { TerminalStreamEvent };
33
+ export type ConnectionState = {
34
+ status: "idle";
35
+ } | {
36
+ status: "connecting";
37
+ attempt: number;
38
+ } | {
39
+ status: "connected";
40
+ } | {
41
+ status: "disconnected";
42
+ reason?: string;
43
+ } | {
44
+ status: "disposed";
45
+ };
46
+ export type DaemonEvent = {
47
+ type: "agent_update";
48
+ agentId: string;
49
+ payload: Extract<SessionOutboundMessage, {
50
+ type: "agent_update";
51
+ }>["payload"];
52
+ } | {
53
+ type: "workspace_update";
54
+ workspaceId: string;
55
+ payload: Extract<SessionOutboundMessage, {
56
+ type: "workspace_update";
57
+ }>["payload"];
58
+ } | {
59
+ type: "project.update";
60
+ payload: Extract<SessionOutboundMessage, {
61
+ type: "project.update";
62
+ }>["payload"];
63
+ } | {
64
+ type: "workspace_setup_progress";
65
+ workspaceId: string;
66
+ payload: Extract<SessionOutboundMessage, {
67
+ type: "workspace_setup_progress";
68
+ }>["payload"];
69
+ } | {
70
+ type: "agent_stream";
71
+ agentId: string;
72
+ event: AgentStreamEventPayload;
73
+ timestamp: string;
74
+ seq?: number;
75
+ epoch?: string;
76
+ } | {
77
+ type: "status";
78
+ payload: {
79
+ status: string;
80
+ } & Record<string, unknown>;
81
+ } | {
82
+ type: "agent_deleted";
83
+ agentId: string;
84
+ } | {
85
+ type: "agent_permission_request";
86
+ agentId: string;
87
+ request: AgentPermissionRequest;
88
+ } | {
89
+ type: "agent_permission_resolved";
90
+ agentId: string;
91
+ requestId: string;
92
+ resolution: AgentPermissionResponse;
93
+ } | {
94
+ type: "providers_snapshot_update";
95
+ payload: Extract<SessionOutboundMessage, {
96
+ type: "providers_snapshot_update";
97
+ }>["payload"];
98
+ } | {
99
+ type: "error";
100
+ message: string;
101
+ };
102
+ export type DaemonEventHandler = (event: DaemonEvent) => void;
103
+ export type BrowserAutomationExecuteRequestMessage = BrowserAutomationExecuteRequest;
104
+ export type BrowserAutomationExecuteResponseMessage = BrowserAutomationExecuteResponse;
105
+ export interface DaemonClientConfig {
106
+ /** Deliver compact bodies/hash references to a caller-owned snapshot cache.
107
+ * The default keeps public SDK snapshot entries expanded. */
108
+ providerSnapshots?: "wire";
109
+ url: string;
110
+ clientId: string;
111
+ clientType?: "mobile" | "browser" | "cli" | "mcp" | "hub";
112
+ appVersion?: string;
113
+ runtimeGeneration?: number | null;
114
+ password?: string;
115
+ authHeader?: string;
116
+ suppressSendErrors?: boolean;
117
+ transportFactory?: DaemonTransportFactory;
118
+ webSocketFactory?: WebSocketFactory;
119
+ logger?: Logger;
120
+ connectTimeoutMs?: number;
121
+ e2ee?: {
122
+ enabled?: boolean;
123
+ daemonPublicKeyB64?: string;
124
+ };
125
+ reconnect?: {
126
+ enabled?: boolean;
127
+ baseDelayMs?: number;
128
+ maxDelayMs?: number;
129
+ };
130
+ runtimeMetricsIntervalMs?: number;
131
+ runtimeMetricsWindowMs?: number;
132
+ trace?: DaemonClientTrace;
133
+ capabilities?: Partial<Record<ClientCapability, unknown>>;
134
+ }
135
+ export interface DaemonClientTrace {
136
+ isEnabled(): boolean;
137
+ beginSection(name: string, args?: Record<string, string>): void;
138
+ endSection(): void;
139
+ }
140
+ export interface SendMessageOptions {
141
+ messageId?: string;
142
+ activeTurnBehavior?: ActiveTurnBehavior;
143
+ images?: Array<{
144
+ data: string;
145
+ mimeType: string;
146
+ }>;
147
+ attachments?: SendAgentMessageRequest["attachments"];
148
+ }
149
+ export interface AgentAttentionRequiredNotification {
150
+ agentId: string;
151
+ reason: "finished" | "error" | "permission";
152
+ timestamp: string;
153
+ shouldNotify: boolean;
154
+ notification?: AgentAttentionNotificationPayload;
155
+ }
156
+ type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
157
+ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
158
+ agentId?: string;
159
+ onEvent?: (snapshot: CreationSnapshot) => void;
160
+ config?: AgentSessionConfig;
161
+ provider?: AgentProvider;
162
+ cwd?: string;
163
+ env?: CreateAgentRequestMessage["env"];
164
+ workspaceId?: string;
165
+ callerAgentId?: string;
166
+ initialPrompt?: string;
167
+ idempotencyKey?: string;
168
+ clientMessageId?: string;
169
+ outputSchema?: Record<string, unknown>;
170
+ images?: CreateAgentRequestMessage["images"];
171
+ attachments?: CreateAgentRequestMessage["attachments"];
172
+ git?: GitSetupOptions;
173
+ worktree?: CreateAgentRequestMessage["worktree"];
174
+ autoArchive?: CreateAgentRequestMessage["autoArchive"];
175
+ worktreeName?: string;
176
+ requestId?: string;
177
+ labels?: Record<string, string>;
178
+ }
179
+ export interface CreateWorkspaceRequestOptions {
180
+ source: WorkspaceCreateRequest["source"];
181
+ title?: string;
182
+ idempotencyKey?: string;
183
+ workspaceId?: string;
184
+ agent?: Omit<CreateAgentRequestOptions, "workspaceId" | "onEvent" | "worktree" | "git" | "worktreeName" | "idempotencyKey" | "requestId">;
185
+ onEvent?: (snapshot: CreationSnapshot) => void;
186
+ firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
187
+ requestId?: string;
188
+ }
189
+ export interface CreatePaseoWorktreeInput extends Pick<CreatePaseoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "checkoutSource" | "githubPrNumber"> {
190
+ }
191
+ type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
192
+ type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
193
+ type: "subscribe_checkout_diff_response";
194
+ }>["payload"];
195
+ type CheckoutDiffPayload = Omit<SubscribeCheckoutDiffPayload, "subscriptionId">;
196
+ type CheckoutCommitPayload = CheckoutCommitResponse["payload"];
197
+ type CheckoutMergePayload = CheckoutMergeResponse["payload"];
198
+ type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"];
199
+ type CheckoutPullPayload = CheckoutPullResponse["payload"];
200
+ type CheckoutPushPayload = CheckoutPushResponse["payload"];
201
+ type CheckoutRefreshPayload = CheckoutRefreshResponse["payload"];
202
+ type CheckoutPrCreatePayload = CheckoutPrCreateResponse["payload"];
203
+ type CheckoutPrMergePayload = CheckoutPrMergeResponse["payload"];
204
+ type CheckoutForgeSetAutoMergePayload = CheckoutForgeSetAutoMergeResponse["payload"];
205
+ type CheckoutGithubSetAutoMergePayload = CheckoutGithubSetAutoMergeResponse["payload"];
206
+ type CheckoutForgeGetCheckDetailsPayload = CheckoutForgeGetCheckDetailsResponse["payload"];
207
+ type CheckoutGithubGetCheckDetailsPayload = CheckoutGithubGetCheckDetailsResponse["payload"];
208
+ type CheckoutPrStatusPayload = CheckoutPrStatusResponse["payload"];
209
+ type PullRequestTimelinePayload = PullRequestTimelineResponse["payload"];
210
+ type CheckoutSwitchBranchPayload = CheckoutSwitchBranchResponse["payload"];
211
+ export type RenameBranchResult = z.infer<typeof CheckoutRenameBranchResponseSchema>["payload"];
212
+ type StashSavePayload = StashSaveResponse["payload"];
213
+ type StashPopPayload = StashPopResponse["payload"];
214
+ type StashListPayload = StashListResponse["payload"];
215
+ type ValidateBranchPayload = ValidateBranchResponse["payload"];
216
+ type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
217
+ type ForgeSearchPayload = ForgeSearchResponse["payload"];
218
+ type GitHubSearchPayload = GitHubSearchResponse["payload"];
219
+ type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
220
+ type PaseoWorktreeListPayload = PaseoWorktreeListResponse["payload"];
221
+ type PaseoWorktreeArchivePayload = PaseoWorktreeArchiveResponse["payload"];
222
+ type CreatePaseoWorktreePayload = Extract<SessionOutboundMessage, {
223
+ type: "create_paseo_worktree_response";
224
+ }>["payload"];
225
+ type WorkspaceCreatePayload = Extract<SessionOutboundMessage, {
226
+ type: "workspace.create.response";
227
+ }>["payload"];
228
+ type FileExplorerPayload = FileExplorerResponse["payload"];
229
+ export type FileExplorerDirectoryPayload = NonNullable<FileExplorerPayload["directory"]>;
230
+ type LegacyFileExplorerFilePayload = NonNullable<FileExplorerPayload["file"]>;
231
+ export interface FileReadResult {
232
+ bytes: Uint8Array;
233
+ mime: string;
234
+ size: number;
235
+ path: string;
236
+ kind: LegacyFileExplorerFilePayload["kind"];
237
+ modifiedAt: string;
238
+ revision?: string;
239
+ }
240
+ export interface FileUploadInput {
241
+ fileName: string;
242
+ mimeType: string;
243
+ bytes: Uint8Array | ArrayBuffer;
244
+ modifiedAt?: string;
245
+ requestId?: string;
246
+ chunkSize?: number;
247
+ }
248
+ export type FileUploadResult = FileUploadResponse["payload"];
249
+ type FileDownloadTokenPayload = FileDownloadTokenResponse["payload"];
250
+ type ListProviderFeaturesPayload = ListProviderFeaturesResponseMessage["payload"];
251
+ type ListProviderModelsPayload = ListProviderModelsResponseMessage["payload"];
252
+ type ListProviderModesPayload = ListProviderModesResponseMessage["payload"];
253
+ type ListAvailableProvidersPayload = ListAvailableProvidersResponse["payload"];
254
+ type GetProvidersSnapshotPayload = GetProvidersSnapshotResponseMessage["payload"];
255
+ type RefreshProvidersSnapshotPayload = RefreshProvidersSnapshotResponseMessage["payload"];
256
+ type ProviderDiagnosticPayload = ProviderDiagnosticResponseMessage["payload"];
257
+ type ProviderUsageListPayload = ProviderUsageListResponseMessage["payload"];
258
+ type DaemonStatusPayload = DaemonGetStatusResponse["payload"];
259
+ type DaemonPairingOfferPayload = DaemonGetPairingOfferResponse["payload"];
260
+ type DiagnosticsPayload = DiagnosticsResponse["payload"];
261
+ type ReadProjectConfigPayload = Extract<SessionOutboundMessage, {
262
+ type: "read_project_config_response";
263
+ }>["payload"];
264
+ type WriteProjectConfigPayload = Extract<SessionOutboundMessage, {
265
+ type: "write_project_config_response";
266
+ }>["payload"];
267
+ type ListCommandsPayload = ListCommandsResponse["payload"];
268
+ type ListCommandsDraftConfig = Pick<AgentSessionConfig, "provider" | "cwd" | "modeId" | "model" | "thinkingOptionId" | "featureValues">;
269
+ export interface WriteProjectConfigInput {
270
+ repoRoot: string;
271
+ config: PaseoConfigRaw;
272
+ expectedRevision: PaseoConfigRevision | null;
273
+ requestId?: string;
274
+ }
275
+ interface ListCommandsOptions {
276
+ agentId: string;
277
+ requestId?: string;
278
+ draftConfig?: ListCommandsDraftConfig;
279
+ }
280
+ type LegacyListCommandsOptions = Omit<ListCommandsOptions, "agentId">;
281
+ type SetVoiceModePayload = Extract<SessionOutboundMessage, {
282
+ type: "set_voice_mode_response";
283
+ }>["payload"];
284
+ type AgentPermissionResolvedPayload = AgentPermissionResolvedMessage["payload"];
285
+ type ListTerminalsPayload = ListTerminalsResponse["payload"];
286
+ type CreateTerminalPayload = CreateTerminalResponse["payload"];
287
+ export type RenameTerminalResult = z.infer<typeof RenameTerminalResponseSchema>["payload"];
288
+ type SubscribeTerminalPayload = SubscribeTerminalResponse["payload"];
289
+ type CloseItemsPayload = CloseItemsResponse["payload"];
290
+ type KillTerminalPayload = KillTerminalResponse["payload"];
291
+ type CaptureTerminalPayload = CaptureTerminalResponse["payload"];
292
+ type ScheduleCreatePayload = Extract<SessionOutboundMessage, {
293
+ type: "schedule/create/response";
294
+ }>["payload"];
295
+ type ScheduleListPayload = Extract<SessionOutboundMessage, {
296
+ type: "schedule/list/response";
297
+ }>["payload"];
298
+ type ScheduleInspectPayload = Extract<SessionOutboundMessage, {
299
+ type: "schedule/inspect/response";
300
+ }>["payload"];
301
+ type ScheduleLogsPayload = Extract<SessionOutboundMessage, {
302
+ type: "schedule/logs/response";
303
+ }>["payload"];
304
+ type SchedulePausePayload = Extract<SessionOutboundMessage, {
305
+ type: "schedule/pause/response";
306
+ }>["payload"];
307
+ type ScheduleResumePayload = Extract<SessionOutboundMessage, {
308
+ type: "schedule/resume/response";
309
+ }>["payload"];
310
+ type ScheduleDeletePayload = Extract<SessionOutboundMessage, {
311
+ type: "schedule/delete/response";
312
+ }>["payload"];
313
+ type ScheduleRunOncePayload = Extract<SessionOutboundMessage, {
314
+ type: "schedule/run-once/response";
315
+ }>["payload"];
316
+ type ScheduleUpdatePayload = Extract<SessionOutboundMessage, {
317
+ type: "schedule/update/response";
318
+ }>["payload"];
319
+ export type FetchAgentTimelinePayload = FetchAgentTimelineResponseMessage["payload"];
320
+ export type AgentForkContextPayload = AgentForkContextResponseMessage["payload"];
321
+ export type FetchAgentTimelineDirection = FetchAgentTimelinePayload["direction"];
322
+ export type FetchAgentTimelineProjection = FetchAgentTimelinePayload["projection"];
323
+ export type FetchAgentTimelineCursor = NonNullable<FetchAgentTimelinePayload["startCursor"]>;
324
+ export interface FetchAgentOptions {
325
+ agentId: string;
326
+ requestId?: string;
327
+ timeout?: number;
328
+ }
329
+ type LegacyFetchAgentOptions = Omit<FetchAgentOptions, "agentId">;
330
+ export interface FetchAgentTimelineOptions {
331
+ direction?: FetchAgentTimelineDirection;
332
+ cursor?: FetchAgentTimelineCursor;
333
+ limit?: number;
334
+ projection?: FetchAgentTimelineProjection;
335
+ mergeWindow?: boolean;
336
+ requestId?: string;
337
+ timeout?: number;
338
+ }
339
+ export type AgentTimelinePromptIndexPayload = Extract<SessionOutboundMessage, {
340
+ type: "agent.timeline.list_prompts.response";
341
+ }>["payload"];
342
+ export type ProviderSubagentListPayload = Extract<SessionOutboundMessage, {
343
+ type: "agent.provider_subagents.list.response";
344
+ }>["payload"];
345
+ export type ProviderSubagentTimelinePayload = Extract<SessionOutboundMessage, {
346
+ type: "agent.provider_subagents.timeline.get.response";
347
+ }>["payload"];
348
+ export type SideConversationAskPayload = Extract<SessionOutboundMessage, {
349
+ type: "agent.side_conversation.ask.response";
350
+ }>["payload"];
351
+ export type SideConversationTimelinePayload = Extract<SessionOutboundMessage, {
352
+ type: "agent.side_conversation.timeline.get.response";
353
+ }>["payload"];
354
+ export type SideConversationListPayload = Extract<SessionOutboundMessage, {
355
+ type: "agent.side_conversation.list.response";
356
+ }>["payload"];
357
+ export interface FetchProviderSubagentTimelineOptions {
358
+ direction?: ProviderSubagentTimelinePayload["direction"];
359
+ cursor?: FetchAgentTimelineCursor;
360
+ limit?: number;
361
+ requestId?: string;
362
+ timeout?: number;
363
+ }
364
+ export interface AgentForkContextOptions {
365
+ boundaryCursor?: FetchAgentTimelineCursor;
366
+ boundaryMessageId?: string;
367
+ requestId?: string;
368
+ }
369
+ type AgentRefreshedStatusPayload = z.infer<typeof AgentRefreshedStatusPayloadSchema>;
370
+ type RestartRequestedStatusPayload = z.infer<typeof RestartRequestedStatusPayloadSchema>;
371
+ type ShutdownRequestedStatusPayload = z.infer<typeof ShutdownRequestedStatusPayloadSchema>;
372
+ export interface ShutdownServerOptions {
373
+ requestId?: string;
374
+ timeout?: number;
375
+ }
376
+ export interface DaemonStatusOptions {
377
+ requestId?: string;
378
+ timeout?: number;
379
+ }
380
+ export interface DaemonPairingOfferOptions {
381
+ requestId?: string;
382
+ timeout?: number;
383
+ }
384
+ type DaemonUpdateResponse = z.infer<typeof DaemonUpdateResponseSchema>;
385
+ type FetchAgentsPayload = Extract<SessionOutboundMessage, {
386
+ type: "fetch_agents_response";
387
+ }>["payload"];
388
+ type FetchAgentsRequest = Extract<SessionInboundMessage, {
389
+ type: "fetch_agents_request";
390
+ }>;
391
+ export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
392
+ requestId?: string;
393
+ timeout?: number;
394
+ };
395
+ export type FetchAgentsEntry = FetchAgentsPayload["entries"][number];
396
+ export type FetchAgentsPageInfo = FetchAgentsPayload["pageInfo"];
397
+ type FetchAgentHistoryPayload = Extract<SessionOutboundMessage, {
398
+ type: "fetch_agent_history_response";
399
+ }>["payload"];
400
+ type FetchAgentHistoryRequest = Extract<SessionInboundMessage, {
401
+ type: "fetch_agent_history_request";
402
+ }>;
403
+ export type FetchAgentHistoryOptions = Omit<FetchAgentHistoryRequest, "type" | "requestId"> & {
404
+ requestId?: string;
405
+ };
406
+ export type FetchAgentHistoryEntry = FetchAgentHistoryPayload["entries"][number];
407
+ export type FetchAgentHistoryPageInfo = FetchAgentHistoryPayload["pageInfo"];
408
+ type FetchRecentProviderSessionsPayload = Extract<SessionOutboundMessage, {
409
+ type: "fetch_recent_provider_sessions_response";
410
+ }>["payload"];
411
+ type FetchRecentProviderSessionsRequest = Extract<SessionInboundMessage, {
412
+ type: "fetch_recent_provider_sessions_request";
413
+ }>;
414
+ export type FetchRecentProviderSessionsOptions = Omit<FetchRecentProviderSessionsRequest, "type" | "requestId"> & {
415
+ requestId?: string;
416
+ };
417
+ export type FetchRecentProviderSessionEntry = FetchRecentProviderSessionsPayload["entries"][number];
418
+ type FetchWorkspacesPayload = Extract<SessionOutboundMessage, {
419
+ type: "fetch_workspaces_response";
420
+ }>["payload"];
421
+ type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
422
+ type: "fetch_workspaces_request";
423
+ }>;
424
+ export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
425
+ requestId?: string;
426
+ };
427
+ export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
428
+ export type FetchWorkspacesPageInfo = FetchWorkspacesPayload["pageInfo"];
429
+ export type WorkspaceLabelListPayload = Extract<SessionOutboundMessage, {
430
+ type: "workspace.label.list.response";
431
+ }>["payload"];
432
+ export type WorkspaceLabelAssignmentPayload = Extract<SessionOutboundMessage, {
433
+ type: "workspace.label.assignment.set.response";
434
+ }>["payload"];
435
+ export type WorkspaceLabelUpdatePayload = Extract<SessionOutboundMessage, {
436
+ type: "workspace.label.update.response";
437
+ }>["payload"];
438
+ export type WorkspaceLabelDeletePayload = Extract<SessionOutboundMessage, {
439
+ type: "workspace.label.delete.response";
440
+ }>["payload"];
441
+ export type WorkspaceLabelDeleteInspectPayload = Extract<SessionOutboundMessage, {
442
+ type: "workspace.label.delete.inspect.response";
443
+ }>["payload"];
444
+ export type ProjectListPayload = Extract<SessionOutboundMessage, {
445
+ type: "project.list.response";
446
+ }>["payload"];
447
+ type ProjectListRequest = Extract<SessionInboundMessage, {
448
+ type: "project.list.request";
449
+ }>;
450
+ export type ProjectListOptions = Omit<ProjectListRequest, "type" | "requestId"> & {
451
+ requestId?: string;
452
+ };
453
+ export interface CreateScheduleOptions {
454
+ prompt: string;
455
+ name?: string | null;
456
+ cadence: {
457
+ type: "cron";
458
+ expression: string;
459
+ timezone?: string;
460
+ };
461
+ target: {
462
+ type: "self";
463
+ agentId: string;
464
+ } | {
465
+ type: "agent";
466
+ agentId: string;
467
+ } | {
468
+ type: "new-agent";
469
+ config: {
470
+ provider: AgentProvider;
471
+ cwd: string;
472
+ modeId?: string;
473
+ model?: string;
474
+ thinkingOptionId?: string;
475
+ archiveOnFinish?: boolean;
476
+ isolation?: "local" | "worktree";
477
+ title?: string | null;
478
+ providerOptions?: AgentSessionConfig["providerOptions"];
479
+ systemPrompt?: string;
480
+ mcpServers?: AgentSessionConfig["mcpServers"];
481
+ };
482
+ };
483
+ maxRuns?: number;
484
+ expiresAt?: string;
485
+ runOnCreate?: boolean;
486
+ requestId?: string;
487
+ }
488
+ export interface InspectScheduleOptions {
489
+ id: string;
490
+ requestId?: string;
491
+ }
492
+ export interface UpdateScheduleNewAgentConfig {
493
+ provider?: string;
494
+ model?: string | null;
495
+ modeId?: string | null;
496
+ thinkingOptionId?: string | null;
497
+ archiveOnFinish?: boolean;
498
+ isolation?: "local" | "worktree";
499
+ cwd?: string;
500
+ }
501
+ export interface UpdateScheduleOptions {
502
+ id: string;
503
+ name?: string | null;
504
+ prompt?: string;
505
+ cadence?: {
506
+ type: "cron";
507
+ expression: string;
508
+ timezone?: string;
509
+ };
510
+ newAgentConfig?: UpdateScheduleNewAgentConfig;
511
+ maxRuns?: number | null;
512
+ expiresAt?: string | null;
513
+ requestId?: string;
514
+ }
515
+ export interface RenameBranchInput {
516
+ cwd: string;
517
+ branch: string;
518
+ requestId?: string;
519
+ }
520
+ export interface RenameTerminalInput {
521
+ terminalId: string;
522
+ title: string;
523
+ requestId?: string;
524
+ }
525
+ type OpenProjectPayload = OpenProjectResponseMessage["payload"];
526
+ type ProjectAddPayload = ProjectAddResponse["payload"];
527
+ export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"];
528
+ export type WorkspaceGithubSearchRepositoriesPayload = WorkspaceGithubSearchRepositoriesResponse["payload"];
529
+ type ProjectGithubClonePayload = ProjectGithubCloneResponse["payload"];
530
+ type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
531
+ type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
532
+ export interface FetchAgentResult {
533
+ agent: AgentSnapshotPayload;
534
+ project: ProjectPlacementPayload | null;
535
+ }
536
+ export interface WaitForFinishResult {
537
+ status: "idle" | "error" | "permission" | "timeout";
538
+ final: AgentSnapshotPayload | null;
539
+ error: string | null;
540
+ lastMessage: string | null;
541
+ }
542
+ type GetDaemonConfigResponse = Extract<SessionOutboundMessage, {
543
+ type: "get_daemon_config_response";
544
+ }>;
545
+ type SetDaemonConfigResponse = Extract<SessionOutboundMessage, {
546
+ type: "set_daemon_config_response";
547
+ }>;
548
+ type CorrelatedResponseMessage = Extract<SessionOutboundMessage, {
549
+ payload: {
550
+ requestId: string;
551
+ };
552
+ }> | GetDaemonConfigResponse | SetDaemonConfigResponse;
553
+ type CorrelatedResponseType = CorrelatedResponseMessage["type"];
554
+ type CorrelatedResponsePayload<TType extends CorrelatedResponseType> = Extract<CorrelatedResponseMessage, {
555
+ type: TType;
556
+ }>["payload"];
557
+ export declare class DaemonClient {
558
+ private config;
559
+ private readonly providerSnapshotUpdates;
560
+ private readonly subscriptions;
561
+ private transport;
562
+ private transportCleanup;
563
+ private rawMessageListeners;
564
+ private messageHandlers;
565
+ private eventListeners;
566
+ private waiters;
567
+ private checkoutStatusInFlight;
568
+ private connectionListeners;
569
+ private reconnectTimeout;
570
+ private connectTimeout;
571
+ private pendingGenericTransportErrorTimeout;
572
+ private reconnectAttempt;
573
+ private shouldReconnect;
574
+ private connectPromise;
575
+ private connectResolve;
576
+ private connectReject;
577
+ private lastErrorValue;
578
+ private connectionState;
579
+ private checkoutDiffSubscriptions;
580
+ private terminalDirectorySubscriptions;
581
+ private fileSubscriptions;
582
+ private readonly terminalStreams;
583
+ private pendingBinaryFileReads;
584
+ private activeBinaryFileTransfers;
585
+ private completedBinaryFileReads;
586
+ private logger;
587
+ private pendingSendQueue;
588
+ private readonly logConnectionPath;
589
+ private readonly logServerId;
590
+ private readonly logClientIdHash;
591
+ private readonly logGeneration;
592
+ private lastServerInfoMessage;
593
+ private runtimeMetricsInterval;
594
+ private runtimeMetrics;
595
+ private pingProbe;
596
+ private livenessHeartbeatTimer;
597
+ private lastLivenessRttMs;
598
+ private consecutiveLivenessFailures;
599
+ constructor(config: DaemonClientConfig);
600
+ connect(): Promise<void>;
601
+ private attemptConnect;
602
+ private resolveConnect;
603
+ private rejectConnect;
604
+ close(): Promise<void>;
605
+ ensureConnected(): void;
606
+ getConnectionState(): ConnectionState;
607
+ subscribeConnectionStatus(listener: (status: ConnectionState) => void): () => void;
608
+ get isConnected(): boolean;
609
+ get isConnecting(): boolean;
610
+ get lastError(): string | null;
611
+ getLastLivenessRttMs(): number | null;
612
+ subscribe(handler: DaemonEventHandler): () => void;
613
+ subscribeRawMessages(handler: (message: SessionOutboundMessage) => void): () => void;
614
+ on<TType extends SessionOutboundMessage["type"]>(type: TType, handler: (message: Extract<SessionOutboundMessage, {
615
+ type: TType;
616
+ }>) => void): () => void;
617
+ on(handler: DaemonEventHandler): () => void;
618
+ onAgentAttentionRequired(handler: (notification: AgentAttentionRequiredNotification) => void): () => void;
619
+ private beginTraceSection;
620
+ private endTraceSection;
621
+ private traceInstant;
622
+ private sendJsonMessage;
623
+ private sendTransportFrame;
624
+ /**
625
+ * Send a session message. For fire-and-forget messages (heartbeats, etc.),
626
+ * failures are suppressed if `suppressSendErrors` is configured.
627
+ * For RPC methods that wait for responses, use `sendSessionMessageOrThrow` instead.
628
+ */
629
+ private sendSessionMessage;
630
+ private sendBinaryFrame;
631
+ /**
632
+ * Send a session message for RPC methods that create waiters.
633
+ * If the connection is still being established ("connecting"), the message
634
+ * is queued and will be sent once connected (or rejected after timeout).
635
+ * This prevents waiters from hanging forever when called during connection.
636
+ */
637
+ private sendSessionMessageOrThrow;
638
+ /**
639
+ * Flush pending send queue - called when connection is established.
640
+ */
641
+ private flushPendingSendQueue;
642
+ /**
643
+ * Reject all pending sends - called when connection fails or is closed.
644
+ */
645
+ private rejectPendingSendQueue;
646
+ private sendRequest;
647
+ private sendCorrelatedRequest;
648
+ private sendCorrelatedSessionRequest;
649
+ private sendNamespacedCorrelatedSessionRequest;
650
+ private sendSessionMessageStrict;
651
+ clearAgentAttention(agentId: string | string[]): Promise<void>;
652
+ clearWorkspaceAttention(workspaceId: string | string[]): Promise<void>;
653
+ markWorkspaceUnread(workspaceId: string, requestId?: string): Promise<void>;
654
+ sendHeartbeat(params: {
655
+ deviceType: "web" | "mobile";
656
+ focusedAgentId: string | null;
657
+ focusedTerminalId?: string | null;
658
+ lastActivityAt: string;
659
+ appVisible: boolean;
660
+ appVisibilityChangedAt?: string;
661
+ }): void;
662
+ registerPushToken(token: string): void;
663
+ unregisterPushToken(token: string): Promise<void>;
664
+ ping(params?: {
665
+ requestId?: string;
666
+ timeoutMs?: number;
667
+ }): Promise<{
668
+ requestId: string;
669
+ clientSentAt: number;
670
+ serverReceivedAt: number;
671
+ serverSentAt: number;
672
+ rttMs: number;
673
+ }>;
674
+ measureLatency(params?: {
675
+ timeoutMs?: number;
676
+ }): Promise<number>;
677
+ private livenessPing;
678
+ private sendPingAwaitRtt;
679
+ private startLivenessHeartbeat;
680
+ private stopLivenessHeartbeat;
681
+ private scheduleNextLivenessHeartbeat;
682
+ fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
683
+ fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
684
+ fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
685
+ fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
686
+ listWorkspaceLabels(options: {
687
+ subscriptionId: string;
688
+ sync?: {
689
+ generation: string;
690
+ afterSeq: number;
691
+ };
692
+ requestId?: string;
693
+ }): Promise<WorkspaceLabelListPayload>;
694
+ setWorkspaceLabel(options: {
695
+ workspaceId: string;
696
+ label: Extract<SessionInboundMessage, {
697
+ type: "workspace.label.assignment.set.request";
698
+ }>["label"];
699
+ assigned: boolean;
700
+ requestId?: string;
701
+ }): Promise<WorkspaceLabelAssignmentPayload>;
702
+ updateWorkspaceLabel(options: {
703
+ name: string;
704
+ newName?: string;
705
+ color?: Extract<SessionInboundMessage, {
706
+ type: "workspace.label.update.request";
707
+ }>["color"];
708
+ requestId?: string;
709
+ }): Promise<WorkspaceLabelUpdatePayload>;
710
+ deleteWorkspaceLabel(options: {
711
+ name: string;
712
+ requestId?: string;
713
+ }): Promise<WorkspaceLabelDeletePayload>;
714
+ inspectWorkspaceLabelDelete(options: {
715
+ name: string;
716
+ requestId?: string;
717
+ }): Promise<WorkspaceLabelDeleteInspectPayload>;
718
+ listProjects(options?: string | ProjectListOptions): Promise<ProjectListPayload>;
719
+ openProject(cwd: string, requestId?: string): Promise<OpenProjectPayload>;
720
+ addProject(cwd: string, requestId?: string): Promise<ProjectAddPayload>;
721
+ createProjectDirectory(input: {
722
+ parentPath: string;
723
+ name: string;
724
+ }, requestId?: string): Promise<ProjectCreateDirectoryPayload>;
725
+ searchGithubRepositories(input: {
726
+ query: string;
727
+ limit?: number;
728
+ }, requestId?: string): Promise<WorkspaceGithubSearchRepositoriesPayload>;
729
+ cloneGithubProject(input: {
730
+ repo: string;
731
+ targetDirectory: string;
732
+ cloneProtocol?: ProjectGithubCloneProtocol;
733
+ }, requestId?: string): Promise<ProjectGithubClonePayload>;
734
+ startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
735
+ type: "start_workspace_script_response";
736
+ }>["payload"]>;
737
+ listWorkspaceScripts(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
738
+ type: "workspace.script.list.response";
739
+ }>["payload"]>;
740
+ startWorkspaceScriptWithStatus(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
741
+ type: "workspace.script.start.response";
742
+ }>["payload"]>;
743
+ stopWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
744
+ type: "workspace.script.stop.response";
745
+ }>["payload"]>;
746
+ archiveWorkspace(workspaceId: string, requestId?: string): Promise<ArchiveWorkspacePayload>;
747
+ fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
748
+ runWorkspaceSetup(workspaceId: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
749
+ type: "workspace.setup.run.response";
750
+ }>["payload"]>;
751
+ fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
752
+ fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
753
+ fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
754
+ private resubscribeCheckoutDiffSubscriptions;
755
+ private resubscribeTerminalDirectorySubscriptions;
756
+ private resubscribeFileSubscriptions;
757
+ private readonly creations;
758
+ createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
759
+ private createLegacyAgent;
760
+ private requireAgentRequestReceipts;
761
+ deleteAgent(agentId: string): Promise<void>;
762
+ archiveAgent(agentId: string): Promise<{
763
+ archivedAt: string;
764
+ }>;
765
+ detachAgent(agentId: string): Promise<void>;
766
+ updateAgent(agentId: string, updates: {
767
+ name?: string;
768
+ labels?: Record<string, string>;
769
+ }): Promise<void>;
770
+ renameProject(projectId: string, customName: string | null, requestId?: string): Promise<{
771
+ customName: string | null;
772
+ }>;
773
+ setProjectIcon(projectId: string, source: ProjectIconSource, requestId?: string): Promise<void>;
774
+ removeProject(projectId: string, requestId?: string): Promise<{
775
+ removedWorkspaceIds: string[];
776
+ }>;
777
+ setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
778
+ title: string | null;
779
+ }>;
780
+ setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{
781
+ pinnedAt: string | null;
782
+ }>;
783
+ inspectWorkspaceRecovery(workspaceId: string, requestId?: string): Promise<WorkspaceRecoveryState>;
784
+ restoreWorkspace(workspaceId: string, requestId?: string): Promise<void>;
785
+ resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
786
+ importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
787
+ refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
788
+ fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
789
+ appendAgentTimelineItem(agentId: string, item: Omit<import("@camerontaylor/paseo-protocol/agent-types").PluginTimelineItem, "pluginId">): Promise<{
790
+ seq: number;
791
+ epoch: string;
792
+ }>;
793
+ listAgentTimelinePrompts(agentId: string, options?: {
794
+ requestId?: string;
795
+ timeout?: number;
796
+ }): Promise<AgentTimelinePromptIndexPayload>;
797
+ listProviderSubagents(parentAgentId: string, options?: {
798
+ requestId?: string;
799
+ timeout?: number;
800
+ }): Promise<ProviderSubagentListPayload>;
801
+ fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise<ProviderSubagentTimelinePayload>;
802
+ askSideConversation(parentAgentId: string, threadId: string, question: string, options?: {
803
+ requestId?: string;
804
+ timeout?: number;
805
+ }): Promise<SideConversationAskPayload>;
806
+ fetchSideConversationTimeline(parentAgentId: string, threadId: string, options?: {
807
+ requestId?: string;
808
+ timeout?: number;
809
+ }): Promise<SideConversationTimelinePayload>;
810
+ listSideConversations(parentAgentId: string, options?: {
811
+ requestId?: string;
812
+ timeout?: number;
813
+ }): Promise<SideConversationListPayload>;
814
+ setAgentTimelineSubscription(agentIds: string[]): Promise<void>;
815
+ subscribeAgentTimeline(agentId: string, handler: (message: Extract<SessionOutboundMessage, {
816
+ type: "agent_stream" | "agent.timeline.replacement";
817
+ }>) => void): TimelineSubscription;
818
+ private updateEventSubscriptions;
819
+ private sendEventSubscription;
820
+ private sendTimelineSubscription;
821
+ buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
822
+ sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
823
+ sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
824
+ rewindAgent(agentId: string, messageId: string, mode: "conversation" | "files" | "both"): Promise<AgentRewindResponseMessage["payload"]>;
825
+ cancelAgent(agentId: string): Promise<void>;
826
+ setAgentMode(agentId: string, modeId: string): Promise<AgentProviderNotice | null>;
827
+ setAgentModel(agentId: string, modelId: string | null): Promise<void>;
828
+ setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
829
+ setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<AgentProviderNotice | null>;
830
+ /**
831
+ * Applies a whole agent-config bundle in one request. Use this instead of
832
+ * chaining the single-field setters when the values belong together so client
833
+ * interruption and other mutations cannot interleave between steps. A
834
+ * provider rejection can still leave earlier steps applied.
835
+ * Gated on `server_info.features.agentConfigApply`.
836
+ */
837
+ applyAgentConfig(agentId: string, config: AgentConfigApply): Promise<AgentProviderNotice | null>;
838
+ restartServer(reason?: string, requestId?: string): Promise<RestartRequestedStatusPayload>;
839
+ shutdownServer(options?: ShutdownServerOptions): Promise<ShutdownRequestedStatusPayload>;
840
+ updateDaemon(requestId?: string): Promise<DaemonUpdateResponse["payload"]>;
841
+ setVoiceMode(enabled: boolean, agentId?: string): Promise<SetVoiceModePayload>;
842
+ sendVoiceAudioChunk(audio: string, format: string, isLast?: boolean): Promise<void>;
843
+ startDictationStream(dictationId: string, format: string): Promise<void>;
844
+ sendDictationStreamChunk(dictationId: string, seq: number, audio: string, format: string): void;
845
+ finishDictationStream(dictationId: string, finalSeq: number): Promise<{
846
+ dictationId: string;
847
+ text: string;
848
+ }>;
849
+ cancelDictationStream(dictationId: string): void;
850
+ abortRequest(): Promise<void>;
851
+ audioPlayed(id: string): Promise<void>;
852
+ getCheckoutStatus(cwd: string, options?: {
853
+ requestId?: string;
854
+ }): Promise<CheckoutStatusPayload>;
855
+ private normalizeCheckoutDiffCompare;
856
+ getCheckoutDiff(cwd: string, compare: {
857
+ mode: "uncommitted" | "base";
858
+ baseRef?: string;
859
+ ignoreWhitespace?: boolean;
860
+ }, requestId?: string): Promise<CheckoutDiffPayload>;
861
+ subscribeCheckoutDiff(cwd: string, compare: {
862
+ mode: "uncommitted" | "base";
863
+ baseRef?: string;
864
+ ignoreWhitespace?: boolean;
865
+ }, options?: {
866
+ subscriptionId?: string;
867
+ requestId?: string;
868
+ }): Promise<SubscribeCheckoutDiffPayload>;
869
+ unsubscribeCheckoutDiff(subscriptionId: string): void;
870
+ checkoutCommit(cwd: string, input: {
871
+ message?: string;
872
+ addAll?: boolean;
873
+ }, requestId?: string): Promise<CheckoutCommitPayload>;
874
+ checkoutMerge(cwd: string, input: {
875
+ baseRef?: string;
876
+ strategy?: "merge" | "squash";
877
+ requireCleanTarget?: boolean;
878
+ }, requestId?: string): Promise<CheckoutMergePayload>;
879
+ checkoutMergeFromBase(cwd: string, input: {
880
+ baseRef?: string;
881
+ requireCleanTarget?: boolean;
882
+ }, requestId?: string): Promise<CheckoutMergeFromBasePayload>;
883
+ checkoutPull(cwd: string, requestId?: string): Promise<CheckoutPullPayload>;
884
+ checkoutPush(cwd: string, requestId?: string): Promise<CheckoutPushPayload>;
885
+ checkoutRefresh(cwd: string, requestId?: string): Promise<CheckoutRefreshPayload>;
886
+ listCheckoutCommits(cwd: string, requestId?: string): Promise<{
887
+ baseRef: string | null;
888
+ commits: CheckoutCommit[];
889
+ }>;
890
+ getCommitFileDiff(cwd: string, sha: string, path: string, requestId?: string): Promise<{
891
+ file: ParsedDiffFile | null;
892
+ }>;
893
+ checkoutPrCreate(cwd: string, input: {
894
+ title?: string;
895
+ body?: string;
896
+ baseRef?: string;
897
+ }, requestId?: string): Promise<CheckoutPrCreatePayload>;
898
+ checkoutPrMerge(cwd: string, input: {
899
+ method: CheckoutPrMergeMethod;
900
+ }, requestId?: string): Promise<CheckoutPrMergePayload>;
901
+ checkoutForgeSetAutoMerge(cwd: string, input: {
902
+ enabled: true;
903
+ method: CheckoutPrMergeMethod;
904
+ } | {
905
+ enabled: false;
906
+ }, requestId?: string): Promise<CheckoutForgeSetAutoMergePayload>;
907
+ checkoutGithubSetAutoMerge(cwd: string, input: {
908
+ enabled: true;
909
+ method: CheckoutPrMergeMethod;
910
+ } | {
911
+ enabled: false;
912
+ }, requestId?: string): Promise<CheckoutGithubSetAutoMergePayload>;
913
+ checkoutForgeGetCheckDetails(input: {
914
+ cwd: string;
915
+ repoOwner?: string;
916
+ repoName?: string;
917
+ checkRunId?: number;
918
+ workflowRunId?: number;
919
+ changeRequestNumber?: number;
920
+ }, requestId?: string): Promise<CheckoutForgeGetCheckDetailsPayload>;
921
+ checkoutGithubGetCheckDetails(input: {
922
+ cwd: string;
923
+ repoOwner?: string;
924
+ repoName?: string;
925
+ checkRunId?: number;
926
+ workflowRunId?: number;
927
+ }, requestId?: string): Promise<CheckoutGithubGetCheckDetailsPayload>;
928
+ checkoutPrStatus(cwd: string, requestId?: string): Promise<CheckoutPrStatusPayload>;
929
+ pullRequestTimeline(input: {
930
+ cwd: string;
931
+ prNumber: number;
932
+ repoOwner: string;
933
+ repoName: string;
934
+ }, requestId?: string): Promise<PullRequestTimelinePayload>;
935
+ checkoutSwitchBranch(cwd: string, branch: string, requestId?: string): Promise<CheckoutSwitchBranchPayload>;
936
+ renameBranch(input: RenameBranchInput): Promise<RenameBranchResult>;
937
+ stashSave(cwd: string, options?: {
938
+ branch?: string;
939
+ }, requestId?: string): Promise<StashSavePayload>;
940
+ stashPop(cwd: string, stashIndex: number, requestId?: string): Promise<StashPopPayload>;
941
+ stashList(cwd: string, options?: {
942
+ paseoOnly?: boolean;
943
+ }, requestId?: string): Promise<StashListPayload>;
944
+ getPaseoWorktreeList(input: {
945
+ cwd?: string;
946
+ repoRoot?: string;
947
+ }, requestId?: string): Promise<PaseoWorktreeListPayload>;
948
+ archivePaseoWorktree(input: {
949
+ worktreePath?: string;
950
+ repoRoot?: string;
951
+ branchName?: string;
952
+ workspaceId?: string;
953
+ scope?: "workspace" | "worktree";
954
+ }, requestId?: string): Promise<PaseoWorktreeArchivePayload>;
955
+ createPaseoWorktree(input: CreatePaseoWorktreeInput, requestId?: string): Promise<CreatePaseoWorktreePayload>;
956
+ createWorkspace(input: CreateWorkspaceRequestOptions, requestId?: string): Promise<WorkspaceCreatePayload>;
957
+ private createLegacyWorkspace;
958
+ validateBranch(options: {
959
+ cwd: string;
960
+ branchName: string;
961
+ }, requestId?: string): Promise<ValidateBranchPayload>;
962
+ getBranchSuggestions(options: {
963
+ cwd: string;
964
+ query?: string;
965
+ limit?: number;
966
+ }, requestId?: string): Promise<BranchSuggestionsPayload>;
967
+ searchForge(options: {
968
+ cwd: string;
969
+ query: string;
970
+ limit?: number;
971
+ kinds?: ForgeSearchRequest["kinds"];
972
+ }, requestId?: string): Promise<ForgeSearchPayload>;
973
+ searchGitHub(options: {
974
+ cwd: string;
975
+ query: string;
976
+ limit?: number;
977
+ kinds?: GitHubSearchRequest["kinds"];
978
+ }, requestId?: string): Promise<GitHubSearchPayload>;
979
+ getDirectorySuggestions(options: {
980
+ query: string;
981
+ limit?: number;
982
+ cwd?: string;
983
+ includeFiles?: boolean;
984
+ includeDirectories?: boolean;
985
+ matchMode?: "fuzzy" | "suffix";
986
+ }, requestId?: string): Promise<DirectorySuggestionsPayload>;
987
+ private requestFileExplorer;
988
+ listDirectory(cwd: string, path: string, requestId?: string): Promise<FileExplorerDirectoryPayload>;
989
+ readFile(cwd: string, path: string, requestId?: string, maxBytes?: number): Promise<FileReadResult>;
990
+ subscribeFile(input: {
991
+ cwd: string;
992
+ path: string;
993
+ }, onUpdate: (version: FileVersion) => void): Promise<{
994
+ initial: FileVersion;
995
+ unsubscribe: () => void;
996
+ }>;
997
+ writeFile(input: {
998
+ cwd: string;
999
+ path: string;
1000
+ content: string;
1001
+ expectedModifiedAt: string;
1002
+ expectedRevision?: string;
1003
+ }): Promise<FileWriteResult>;
1004
+ createFileEntry(input: {
1005
+ cwd: string;
1006
+ parentPath: string;
1007
+ name: string;
1008
+ kind: "file" | "directory";
1009
+ }): Promise<CorrelatedResponsePayload<"fs.entry.create.response">>;
1010
+ renameFileEntry(input: {
1011
+ cwd: string;
1012
+ path: string;
1013
+ name: string;
1014
+ }): Promise<CorrelatedResponsePayload<"fs.entry.rename.response">>;
1015
+ duplicateFileEntry(input: {
1016
+ cwd: string;
1017
+ path: string;
1018
+ }): Promise<CorrelatedResponsePayload<"fs.entry.duplicate.response">>;
1019
+ deleteFileEntry(input: {
1020
+ cwd: string;
1021
+ path: string;
1022
+ }): Promise<CorrelatedResponsePayload<"fs.entry.delete.response">>;
1023
+ checkoutDiscardChanges(cwd: string, input: {
1024
+ paths: string[];
1025
+ }): Promise<CorrelatedResponsePayload<"checkout.discard_changes.response">>;
1026
+ uploadFile(input: FileUploadInput): Promise<FileUploadResult>;
1027
+ requestDownloadToken(cwd: string, path: string, requestId?: string): Promise<FileDownloadTokenPayload>;
1028
+ requestProjectIcon(cwd: string, requestId?: string): Promise<ProjectIconResponse["payload"]>;
1029
+ getProjectIcon(projectId: string, requestId?: string): Promise<ProjectIconGetResponse["payload"]>;
1030
+ listProviderModels(provider: AgentProvider, options?: {
1031
+ cwd?: string;
1032
+ requestId?: string;
1033
+ }): Promise<ListProviderModelsPayload>;
1034
+ listProviderModes(provider: AgentProvider, options?: {
1035
+ cwd?: string;
1036
+ requestId?: string;
1037
+ }): Promise<ListProviderModesPayload>;
1038
+ listProviderFeatures(draftConfig: ListCommandsDraftConfig, options?: {
1039
+ requestId?: string;
1040
+ }): Promise<ListProviderFeaturesPayload>;
1041
+ listAvailableProviders(options?: {
1042
+ requestId?: string;
1043
+ }): Promise<ListAvailableProvidersPayload>;
1044
+ getProvidersSnapshot(options?: {
1045
+ cwd?: string;
1046
+ ifNoneMatch?: string;
1047
+ requestId?: string;
1048
+ }): Promise<GetProvidersSnapshotPayload>;
1049
+ private requestProvidersSnapshot;
1050
+ getDaemonConfig(requestId?: string): Promise<{
1051
+ requestId: string;
1052
+ config: MutableDaemonConfig;
1053
+ }>;
1054
+ getDaemonStatus(options?: DaemonStatusOptions): Promise<DaemonStatusPayload>;
1055
+ reloadDaemonConfig(requestId?: string): Promise<DaemonConfigReloadResponse["payload"]>;
1056
+ connectHub(hubUrl: string, token: string, permissions?: readonly string[], requestId?: string): Promise<{
1057
+ requestId: string;
1058
+ status: {
1059
+ state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
1060
+ daemonId: string | null;
1061
+ hubOrigin: string | null;
1062
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1063
+ connectedAt: string | null;
1064
+ lastError: string | null;
1065
+ };
1066
+ }>;
1067
+ updateHubPermissions(input: {
1068
+ grant?: readonly string[];
1069
+ revoke?: readonly string[];
1070
+ }, requestId?: string): Promise<{
1071
+ requestId: string;
1072
+ status: {
1073
+ state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
1074
+ daemonId: string | null;
1075
+ hubOrigin: string | null;
1076
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1077
+ connectedAt: string | null;
1078
+ lastError: string | null;
1079
+ };
1080
+ }>;
1081
+ getHubStatus(requestId?: string): Promise<{
1082
+ requestId: string;
1083
+ status: {
1084
+ state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
1085
+ daemonId: string | null;
1086
+ hubOrigin: string | null;
1087
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1088
+ connectedAt: string | null;
1089
+ lastError: string | null;
1090
+ };
1091
+ }>;
1092
+ disconnectHub(force?: boolean, requestId?: string): Promise<{
1093
+ requestId: string;
1094
+ status: {
1095
+ state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
1096
+ daemonId: string | null;
1097
+ hubOrigin: string | null;
1098
+ permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
1099
+ connectedAt: string | null;
1100
+ lastError: string | null;
1101
+ };
1102
+ warning?: string | undefined;
1103
+ }>;
1104
+ getDaemonPairingOffer(options?: DaemonPairingOfferOptions): Promise<DaemonPairingOfferPayload>;
1105
+ collectDiagnostics(requestId?: string): Promise<DiagnosticsPayload>;
1106
+ patchDaemonConfig(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
1107
+ requestId: string;
1108
+ config: MutableDaemonConfig;
1109
+ }>;
1110
+ sendBrowserAutomationExecuteResponse(response: BrowserAutomationExecuteResponse): void;
1111
+ readProjectConfig(repoRoot: string, requestId?: string): Promise<ReadProjectConfigPayload>;
1112
+ writeProjectConfig(input: WriteProjectConfigInput): Promise<WriteProjectConfigPayload>;
1113
+ refreshProvidersSnapshot(options?: {
1114
+ cwd?: string;
1115
+ providers?: AgentProvider[];
1116
+ requestId?: string;
1117
+ }): Promise<RefreshProvidersSnapshotPayload>;
1118
+ getProviderDiagnostic(provider: AgentProvider, options?: {
1119
+ requestId?: string;
1120
+ }): Promise<ProviderDiagnosticPayload>;
1121
+ listProviderUsage(options?: {
1122
+ requestId?: string;
1123
+ }): Promise<ProviderUsageListPayload>;
1124
+ listCommands(options: ListCommandsOptions): Promise<ListCommandsPayload>;
1125
+ listCommands(agentId: string, requestId?: string): Promise<ListCommandsPayload>;
1126
+ listCommands(agentId: string, options?: LegacyListCommandsOptions): Promise<ListCommandsPayload>;
1127
+ respondToPermission(agentId: string, requestId: string, response: AgentPermissionResponse): Promise<void>;
1128
+ getPluginCatalog(): Promise<{
1129
+ id: string;
1130
+ clientBundle: string;
1131
+ requirements?: {
1132
+ paseo?: string | undefined;
1133
+ } | undefined;
1134
+ }[]>;
1135
+ listPlugins(): Promise<PluginListItem[]>;
1136
+ getPluginLogs(pluginId: string): Promise<PluginLogEntry[]>;
1137
+ getAgentSkillsStatus(): Promise<AgentSkillsStatus>;
1138
+ reconcileAgentSkills(): Promise<AgentSkillsStatus>;
1139
+ uninstallAgentSkills(): Promise<AgentSkillsStatus>;
1140
+ saveAgentSkillsSelection(selection: AgentSkillSelection, confirmedRemovals?: readonly string[]): Promise<AgentSkillsSaveResult>;
1141
+ importLegacyAgentSkillsSelection(selection: AgentSkillSelection): Promise<{
1142
+ imported: boolean;
1143
+ selection: AgentSkillSelection;
1144
+ }>;
1145
+ installDirectoryPlugin(path: string, id?: string): Promise<PluginListItem>;
1146
+ installPluginSource(input: {
1147
+ source: string;
1148
+ id?: string;
1149
+ ref?: string;
1150
+ }): Promise<PluginListItem>;
1151
+ getPluginSourceStatus(pluginId?: string): Promise<PluginSourceStatusItem[]>;
1152
+ updatePluginSources(pluginId?: string): Promise<PluginSourceUpdateItem[]>;
1153
+ inspectDirectoryPlugin(path: string): Promise<{
1154
+ id: string;
1155
+ }>;
1156
+ reloadPlugin(pluginId: string): Promise<PluginListItem>;
1157
+ enablePlugin(pluginId: string): Promise<PluginListItem>;
1158
+ disablePlugin(pluginId: string): Promise<PluginListItem>;
1159
+ removePlugin(pluginId: string): Promise<void>;
1160
+ private managePlugin;
1161
+ invokePluginRpc(pluginId: string, method: string, input: unknown): Promise<unknown>;
1162
+ respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
1163
+ waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
1164
+ waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
1165
+ subscribeTerminals(input: {
1166
+ cwd: string;
1167
+ workspaceId?: string;
1168
+ }): void;
1169
+ unsubscribeTerminals(input: {
1170
+ cwd: string;
1171
+ workspaceId?: string;
1172
+ }): void;
1173
+ listTerminals(cwd?: string, requestId?: string, options?: {
1174
+ workspaceId?: string;
1175
+ }): Promise<ListTerminalsPayload>;
1176
+ createTerminal(cwd: string, name?: string, requestId?: string, options?: {
1177
+ agentId?: string;
1178
+ command?: string;
1179
+ args?: string[];
1180
+ workspaceId?: string;
1181
+ size?: {
1182
+ rows: number;
1183
+ cols: number;
1184
+ };
1185
+ }): Promise<CreateTerminalPayload>;
1186
+ renameTerminal(input: RenameTerminalInput): Promise<RenameTerminalResult>;
1187
+ subscribeTerminal(terminalId: string, optionsOrRequestId?: {
1188
+ restore?: SubscribeTerminalRequest["restore"];
1189
+ requestId?: string;
1190
+ } | string): Promise<SubscribeTerminalPayload>;
1191
+ unsubscribeTerminal(terminalId: string): void;
1192
+ sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
1193
+ killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
1194
+ closeItems(input: {
1195
+ agentIds?: string[];
1196
+ terminalIds?: string[];
1197
+ }, requestId?: string): Promise<CloseItemsPayload>;
1198
+ captureTerminal(terminalId: string, options?: {
1199
+ start?: number;
1200
+ end?: number;
1201
+ stripAnsi?: boolean;
1202
+ }, requestId?: string): Promise<CaptureTerminalPayload>;
1203
+ scheduleCreate(options: CreateScheduleOptions): Promise<ScheduleCreatePayload>;
1204
+ scheduleList(requestId?: string): Promise<ScheduleListPayload>;
1205
+ scheduleInspect(options: InspectScheduleOptions): Promise<ScheduleInspectPayload>;
1206
+ scheduleLogs(options: InspectScheduleOptions): Promise<ScheduleLogsPayload>;
1207
+ schedulePause(options: InspectScheduleOptions): Promise<SchedulePausePayload>;
1208
+ scheduleResume(options: InspectScheduleOptions): Promise<ScheduleResumePayload>;
1209
+ scheduleDelete(options: InspectScheduleOptions): Promise<ScheduleDeletePayload>;
1210
+ scheduleRunOnce(options: InspectScheduleOptions): Promise<ScheduleRunOncePayload>;
1211
+ scheduleUpdate(options: UpdateScheduleOptions): Promise<ScheduleUpdatePayload>;
1212
+ onTerminalStreamEvent(handler: (event: TerminalStreamEvent) => void): () => void;
1213
+ waitForTerminalStreamEvent(predicate: (event: TerminalStreamEvent) => boolean, timeout?: number): Promise<TerminalStreamEvent>;
1214
+ private createRequestId;
1215
+ getLastServerInfoMessage(): ServerInfoStatusPayload | null;
1216
+ private requireHubRelationshipSupport;
1217
+ private requireDaemonConfigReloadSupport;
1218
+ private requireSideConversationSupport;
1219
+ private resolveTransportUrlForAttempt;
1220
+ private sendHelloMessage;
1221
+ private disposeTransport;
1222
+ private cleanupTransport;
1223
+ private resetConnectTimeout;
1224
+ private handleTransportMessage;
1225
+ private handleJsonPayload;
1226
+ private tryHandleBinaryFrame;
1227
+ private handleFileTransferFrame;
1228
+ private updateConnectionState;
1229
+ setReconnectEnabled(enabled: boolean): void;
1230
+ private scheduleReconnect;
1231
+ private emitDisconnectedStateForReconnect;
1232
+ private armReconnectTimer;
1233
+ private resolvePingProbe;
1234
+ private clearPingProbe;
1235
+ private rejectPingProbe;
1236
+ private recordLivenessFailure;
1237
+ private handleSessionMessage;
1238
+ private deliverSessionMessage;
1239
+ private resolveWaiters;
1240
+ private rejectWaitersForRequestId;
1241
+ private clearWaiters;
1242
+ private toEvent;
1243
+ private waitForWithCancel;
1244
+ }
1245
+ //# sourceMappingURL=daemon-client.d.ts.map