@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
package/dist/index.d.ts CHANGED
@@ -1,6 +1,13 @@
1
- import type { AgentSnapshotPayload, CreateAgentRequestMessage, FetchWorkspacesRequestMessage, FetchWorkspacesResponseMessage, GetProvidersSnapshotResponseMessage, ListAvailableProvidersResponse, ListProviderFeaturesRequestMessage, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, MutableDaemonConfig, MutableDaemonConfigPatch, ProviderDiagnosticResponseMessage, ProjectPlacementPayload, RefreshProvidersSnapshotResponseMessage, SendAgentMessageRequest, ProvidersReloadConfigPayload, SessionOutboundMessage, WorkspaceDescriptorPayload } from "@hyperdrive.bot/fleet-protocol/messages";
1
+ import type { OwnedSubscription } from "./connection/index.js";
2
+ export type { OwnedSubscription, SubscriptionObserver } from "./connection/index.js";
3
+ import type { DaemonClientConfig } from "./daemon-client.js";
4
+ import type { AgentPermissionResponse } from "@hyperdrive.bot/fleet-protocol/agent-types";
5
+ import type { AgentSnapshotPayload, CreationSnapshot, CreateAgentRequestMessage, FetchWorkspacesRequestMessage, FetchWorkspacesResponseMessage, GetProvidersSnapshotResponseMessage, ListAvailableProvidersResponse, ListCommandsResponse, ListProviderFeaturesRequestMessage, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ProjectListRequestMessage, ProjectListResponseMessage, ListProviderModesResponseMessage, MutableDaemonConfig, MutableDaemonConfigPatch, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, ProjectPlacementPayload, WorkspaceProjectDescriptorPayload, RefreshProvidersSnapshotResponseMessage, ProvidersReloadConfigPayload, SessionOutboundMessage, WorkspaceDescriptorPayload, WorkspaceCreateRequest } from "@hyperdrive.bot/fleet-protocol/messages";
2
6
  import { DaemonClient } from "./daemon-client.js";
3
- import type { FetchAgentTimelineCursor, FetchAgentTimelineDirection, FetchAgentTimelinePayload, FetchAgentTimelineProjection } from "./daemon-client.js";
7
+ import { type PaseoTerminalActions, type PaseoWorkspaceTerminalActions } from "./terminals/index.js";
8
+ export type { PaseoTerminal, PaseoTerminalActions, PaseoTerminalHandle, PaseoTerminalCreateOptions, PaseoTerminalListOptions, PaseoTerminalListResult, PaseoTerminalCaptureOptions, PaseoTerminalCaptureResult, PaseoWorkspaceTerminalActions, } from "./terminals/index.js";
9
+ import type { PluginTimelineItem } from "@hyperdrive.bot/fleet-protocol/agent-types";
10
+ import type { FetchAgentsEntry, FetchAgentsOptions, FetchAgentsPageInfo, FetchAgentTimelineCursor, FetchAgentTimelineDirection, FetchAgentTimelinePayload, FetchAgentTimelineProjection, SendMessageOptions, WaitForFinishResult } from "./daemon-client.js";
4
11
  export { DaemonClient };
5
12
  export { DirectorySuggestionsSupersededError, UploadCancelledError, UploadCapExceededError, UploadFailedError, } from "./daemon-client.js";
6
13
  export type { DaemonClientConfig, DaemonEvent, DaemonRequestCompletion, BrowserAutomationExecuteRequestMessage, BrowserAutomationExecuteResponseMessage, WebSocketFactory, WebSocketLike, } from "./daemon-client.js";
@@ -24,6 +31,7 @@ export interface PaseoLogger {
24
31
  error(obj: object, msg?: string): void;
25
32
  }
26
33
  export interface PaseoClientConfig {
34
+ capabilities?: DaemonClientConfig["capabilities"];
27
35
  url: string;
28
36
  clientId?: string;
29
37
  appVersion?: string;
@@ -47,10 +55,28 @@ export interface PaseoClientConfig {
47
55
  }
48
56
  export type PaseoWorkspace = WorkspaceDescriptorPayload;
49
57
  export type PaseoAgent = AgentSnapshotPayload;
58
+ export type PaseoAgentListOptions = FetchAgentsOptions;
59
+ export type PaseoProject = WorkspaceProjectDescriptorPayload;
60
+ export type PaseoProjectListOptions = Omit<ProjectListRequestMessage, "type" | "requestId"> & {
61
+ requestId?: string;
62
+ };
63
+ export type PaseoProjectListResult = ProjectListResponseMessage["payload"];
64
+ export type PaseoProjectUpdate = Extract<SessionOutboundMessage, {
65
+ type: "project.update";
66
+ }>["payload"];
67
+ export type PaseoProjectUpdateHandler = (update: PaseoProjectUpdate) => void;
68
+ export interface PaseoAgentListResult {
69
+ subscription?: OwnedSubscription<PaseoAgentListResult>;
70
+ requestId: string;
71
+ subscriptionId?: string | null;
72
+ entries: FetchAgentsEntry[];
73
+ pageInfo: FetchAgentsPageInfo;
74
+ }
50
75
  export type PaseoWorkspaceListOptions = Omit<FetchWorkspacesRequestMessage, "type" | "requestId"> & {
51
76
  requestId?: string;
52
77
  };
53
78
  export interface PaseoWorkspaceListResult {
79
+ subscription?: OwnedSubscription<PaseoWorkspaceListResult>;
54
80
  requestId: string;
55
81
  subscriptionId?: string | null;
56
82
  entries: PaseoWorkspace[];
@@ -60,11 +86,11 @@ export interface PaseoWorkspaceOpenOptions {
60
86
  cwd: string;
61
87
  requestId?: string;
62
88
  }
63
- export interface PaseoWorkspaceOpenResult {
64
- requestId: string;
65
- workspace: PaseoWorkspaceHandle | null;
66
- error: string | null;
67
- }
89
+ export type PaseoWorkspaceCreateOptions = Omit<WorkspaceCreateRequest, "type" | "requestId" | "agent" | "subscribe"> & {
90
+ requestId?: string;
91
+ agent?: Omit<PaseoAgentCreateOptions, "worktree" | "git" | "onEvent" | "idempotencyKey" | "requestId">;
92
+ onEvent?: (snapshot: CreationSnapshot) => void;
93
+ };
68
94
  export interface PaseoWorkspaceArchiveResult {
69
95
  requestId: string;
70
96
  workspaceId: string;
@@ -75,21 +101,23 @@ export type PaseoWorkspaceUpdate = Extract<SessionOutboundMessage, {
75
101
  type: "workspace_update";
76
102
  }>["payload"];
77
103
  export type PaseoWorkspaceUpdateHandler = (update: PaseoWorkspaceUpdate) => void;
78
- /**
79
- * A handle is a stable typed reference to a daemon resource. Its identity is the
80
- * daemon id, and `latest()` only returns the most recent snapshot this handle has
81
- * seen through construction, `refetch()`, or this handle's local subscription.
82
- */
83
104
  export interface PaseoWorkspaceHandle {
84
105
  readonly id: string;
85
- latest(): PaseoWorkspace | null;
86
- /**
87
- * Fetches a fresh workspace snapshot through the existing workspace list RPC,
88
- * exact-matches this handle id from the result, and updates `latest()`.
89
- */
90
- refetch(options?: {
106
+ readonly projectId: string | null;
107
+ readonly directory: string | null;
108
+ readonly name: string | null;
109
+ readonly status: PaseoWorkspace["status"] | null;
110
+ readonly agents: {
111
+ create(options: PaseoWorkspaceAgentCreateOptions): Promise<PaseoAgentHandle>;
112
+ };
113
+ readonly terminals: PaseoWorkspaceTerminalActions;
114
+ current(): PaseoWorkspace | null;
115
+ refresh(options?: {
91
116
  requestId?: string;
92
117
  }): Promise<PaseoWorkspace | null>;
118
+ setTitle(title: string | null, requestId?: string): Promise<{
119
+ title: string | null;
120
+ }>;
93
121
  archive(requestId?: string): Promise<PaseoWorkspaceArchiveResult>;
94
122
  /**
95
123
  * Subscribes to already-emitted daemon workspace_update events for this id.
@@ -99,11 +127,21 @@ export interface PaseoWorkspaceHandle {
99
127
  */
100
128
  subscribe(handler: (update: PaseoWorkspaceUpdate) => void): () => void;
101
129
  }
130
+ export interface PaseoProjectActions {
131
+ list(options?: PaseoProjectListOptions): Promise<PaseoProjectListResult>;
132
+ subscribe(handler: PaseoProjectUpdateHandler): () => void;
133
+ }
102
134
  export interface PaseoWorkspaceActions {
135
+ list(options: PaseoWorkspaceListOptions & {
136
+ subscribe: {};
137
+ }): Promise<PaseoWorkspaceListResult & {
138
+ subscriptionId: string;
139
+ subscription: OwnedSubscription<PaseoWorkspaceListResult>;
140
+ }>;
103
141
  list(options?: PaseoWorkspaceListOptions): Promise<PaseoWorkspaceListResult>;
104
142
  ref(workspace: string | PaseoWorkspace): PaseoWorkspaceHandle;
105
- open(input: string | PaseoWorkspaceOpenOptions, requestId?: string): Promise<PaseoWorkspaceOpenResult>;
106
- create(input: string | PaseoWorkspaceOpenOptions, requestId?: string): Promise<PaseoWorkspaceOpenResult>;
143
+ open(input: string | PaseoWorkspaceOpenOptions, requestId?: string): Promise<PaseoWorkspaceHandle>;
144
+ create(options: PaseoWorkspaceCreateOptions): Promise<PaseoWorkspaceHandle>;
107
145
  archive(workspace: string | PaseoWorkspaceHandle, requestId?: string): Promise<PaseoWorkspaceArchiveResult>;
108
146
  /**
109
147
  * Local event subscription over the low-level driver's workspace_update stream.
@@ -112,23 +150,41 @@ export interface PaseoWorkspaceActions {
112
150
  subscribe(handler: PaseoWorkspaceUpdateHandler): () => void;
113
151
  }
114
152
  type PaseoAgentSessionConfig = CreateAgentRequestMessage["config"];
115
- type PaseoAgentProvider = PaseoAgentSessionConfig["provider"];
116
- type PaseoAgentConfigOverrides = Partial<Omit<PaseoAgentSessionConfig, "provider" | "cwd">>;
117
- export interface PaseoAgentCreateOptions extends PaseoAgentConfigOverrides {
118
- config?: PaseoAgentSessionConfig;
119
- provider?: CreateAgentRequestMessage["config"]["provider"];
120
- cwd?: string;
121
- workspaceId?: string;
122
- initialPrompt?: string;
153
+ export type PaseoAgentProvider = PaseoAgentSessionConfig["provider"];
154
+ export type PaseoProviderFeatureValues = Record<string, unknown>;
155
+ export interface PaseoAgentConfig {
156
+ /** Provider and model in `provider/model` format. */
157
+ provider: string;
158
+ modeId?: PaseoAgentSessionConfig["modeId"];
159
+ thinkingOptionId?: PaseoAgentSessionConfig["thinkingOptionId"];
160
+ featureValues?: PaseoProviderFeatureValues;
161
+ /** JSON-safe provider-native settings, validated by the selected provider. */
162
+ options?: PaseoAgentSessionConfig["providerOptions"];
163
+ systemPrompt?: PaseoAgentSessionConfig["systemPrompt"];
164
+ toolPolicy?: PaseoAgentSessionConfig["toolPolicy"];
165
+ mcpServers?: PaseoAgentSessionConfig["mcpServers"];
166
+ }
167
+ export interface PaseoAgentCreateOptions {
168
+ idempotencyKey?: string;
169
+ agentId?: string;
170
+ onEvent?: (snapshot: CreationSnapshot) => void;
171
+ config: PaseoAgentConfig;
172
+ cwd: string;
173
+ parent?: string | PaseoAgentHandle;
174
+ title?: PaseoAgentSessionConfig["title"];
175
+ env?: CreateAgentRequestMessage["env"];
176
+ prompt?: string;
123
177
  clientMessageId?: string;
124
178
  outputSchema?: Record<string, unknown>;
125
179
  images?: CreateAgentRequestMessage["images"];
126
180
  attachments?: CreateAgentRequestMessage["attachments"];
127
181
  git?: CreateAgentRequestMessage["git"];
128
- worktreeName?: string;
182
+ worktree?: CreateAgentRequestMessage["worktree"];
183
+ autoArchive?: CreateAgentRequestMessage["autoArchive"];
129
184
  requestId?: string;
130
185
  labels?: Record<string, string>;
131
186
  }
187
+ export type PaseoWorkspaceAgentCreateOptions = Omit<PaseoAgentCreateOptions, "cwd">;
132
188
  export interface PaseoAgentRefetchResult {
133
189
  agent: PaseoAgent;
134
190
  project: ProjectPlacementPayload | null;
@@ -140,14 +196,20 @@ export interface PaseoAgentTimelineRefetchOptions {
140
196
  projection?: FetchAgentTimelineProjection;
141
197
  requestId?: string;
142
198
  }
143
- export interface PaseoAgentSendOptions {
144
- messageId?: string;
145
- images?: Array<{
146
- data: string;
147
- mimeType: string;
148
- }>;
149
- attachments?: SendAgentMessageRequest["attachments"];
199
+ export type PaseoAgentSendOptions = SendMessageOptions;
200
+ export interface PaseoAgentRunOptions extends PaseoAgentSendOptions {
201
+ timeoutMs?: number;
202
+ }
203
+ export type PaseoAgentRunResult = WaitForFinishResult;
204
+ export type PaseoAgentPermissionResponse = AgentPermissionResponse;
205
+ export interface PaseoAgentRespondToPermissionOptions {
206
+ requestId: string;
207
+ response: PaseoAgentPermissionResponse;
208
+ }
209
+ export interface PaseoAgentCommandsOptions {
210
+ requestId?: string;
150
211
  }
212
+ export type PaseoAgentCommandsResult = ListCommandsResponse["payload"];
151
213
  export type PaseoAgentUpdate = Extract<SessionOutboundMessage, {
152
214
  type: "agent_update";
153
215
  }>["payload"];
@@ -155,31 +217,85 @@ export type PaseoAgentStream = Extract<SessionOutboundMessage, {
155
217
  type: "agent_stream";
156
218
  }>["payload"];
157
219
  export type PaseoAgentUpdateHandler = (update: PaseoAgentUpdate) => void;
220
+ export type PaseoAgentTimelineEvent = PaseoAgentStream | {
221
+ agentId: string;
222
+ event: {
223
+ type: "replacement";
224
+ epoch: string;
225
+ };
226
+ } | {
227
+ agentId: string;
228
+ subscriptionId: string;
229
+ event: {
230
+ type: "subscription_restored";
231
+ };
232
+ } | {
233
+ agentId: string;
234
+ event: {
235
+ type: "error";
236
+ error: string;
237
+ };
238
+ };
239
+ export type PaseoAgentTimelineSubscription = ReturnType<DaemonClient["subscribeAgentTimeline"]>;
158
240
  export interface PaseoAgentTimelineHandle {
241
+ append(item: Omit<PluginTimelineItem, "pluginId">): Promise<{
242
+ seq: number;
243
+ epoch: string;
244
+ }>;
159
245
  /**
160
246
  * Fetches a fresh timeline page through the existing daemon RPC. If the daemon
161
- * includes an agent snapshot in the response, the parent handle's `latest()`
162
- * is updated to that snapshot.
247
+ * includes an agent snapshot in the response, the parent handle is updated to
248
+ * that value.
163
249
  */
164
250
  refetch(options?: PaseoAgentTimelineRefetchOptions): Promise<FetchAgentTimelinePayload>;
165
251
  /**
166
- * Local listener for agent_stream events matching this handle id. It does not
167
- * retain timeline entries or own application cache state.
252
+ * Delivers live events only. After reconnect, subscription_restored precedes
253
+ * subsequent updates. History may have been missed; use refetch() to request
254
+ * the range you need. No history is fetched automatically. A replacement event
255
+ * invalidates the previous epoch. Subscription errors release this observation.
256
+ * Await the returned unsubscribe function's `ready` promise before starting
257
+ * work that must be observed. It rejects if establishment fails.
168
258
  */
169
- subscribe(handler: (event: PaseoAgentStream) => void): () => void;
259
+ subscribe(handler: (event: PaseoAgentTimelineEvent) => void): PaseoAgentTimelineSubscription;
170
260
  }
171
- /**
172
- * Agent handles follow the same identity/snapshot rule as workspace handles:
173
- * `id` is stable, while `latest()` is only the newest snapshot observed by this
174
- * handle through construction, `refetch()`, timeline refetch, archive, or local
175
- * agent_update subscription.
176
- */
177
261
  export interface PaseoAgentHandle {
178
262
  readonly id: string;
263
+ /**
264
+ * `workspaceId` through `archivedAt` mirror the last snapshot this handle
265
+ * observed. A handle from `ref()` reads `null` for all of them until
266
+ * `refresh()`, `run()`, `waitForFinish()`, a timeline refetch, or
267
+ * `subscribe()` delivers a snapshot. Optional snapshot values also read as
268
+ * `null`; use `current()` when you need to distinguish those states.
269
+ */
270
+ readonly workspaceId: string | null;
271
+ readonly cwd: string | null;
272
+ readonly status: PaseoAgent["status"] | null;
273
+ readonly capabilities: PaseoAgent["capabilities"] | null;
274
+ readonly availableModes: PaseoAgent["availableModes"] | null;
275
+ readonly pendingPermissions: PaseoAgent["pendingPermissions"] | null;
276
+ readonly activeTurn: NonNullable<PaseoAgent["activeTurn"]> | null;
277
+ readonly lastUsage: NonNullable<PaseoAgent["lastUsage"]> | null;
278
+ readonly lastError: NonNullable<PaseoAgent["lastError"]> | null;
279
+ readonly features: NonNullable<PaseoAgent["features"]> | null;
280
+ readonly runtimeInfo: NonNullable<PaseoAgent["runtimeInfo"]> | null;
281
+ readonly archivedAt: NonNullable<PaseoAgent["archivedAt"]> | null;
179
282
  readonly timeline: PaseoAgentTimelineHandle;
180
- latest(): PaseoAgent | null;
181
- refetch(requestId?: string): Promise<PaseoAgentRefetchResult | null>;
283
+ current(): PaseoAgent | null;
284
+ refresh(requestId?: string): Promise<PaseoAgentRefetchResult | null>;
182
285
  send(text: string, options?: PaseoAgentSendOptions): Promise<void>;
286
+ respondToPermission(options: PaseoAgentRespondToPermissionOptions): Promise<void>;
287
+ /** Sends a prompt and resolves when that turn finishes or needs attention. */
288
+ run(text: string, options?: PaseoAgentRunOptions): Promise<PaseoAgentRunResult>;
289
+ /** Waits for the current turn, including one started with `prompt`. */
290
+ waitForFinish(timeoutMs?: number): Promise<PaseoAgentRunResult>;
291
+ /**
292
+ * Asks the running session for the slash commands and skills it actually
293
+ * loaded. Providers answer from the live session, so this sees built-in and
294
+ * bundled entries that no directory scan can find. The payload carries its own
295
+ * `error` string; a provider that cannot answer reports it there rather than
296
+ * rejecting.
297
+ */
298
+ commands(options?: PaseoAgentCommandsOptions): Promise<PaseoAgentCommandsResult>;
183
299
  archive(): Promise<{
184
300
  archivedAt: string;
185
301
  }>;
@@ -187,6 +303,13 @@ export interface PaseoAgentHandle {
187
303
  subscribe(handler: (update: PaseoAgentUpdate) => void): () => void;
188
304
  }
189
305
  export interface PaseoAgentActions {
306
+ list(options: PaseoAgentListOptions & {
307
+ subscribe: {};
308
+ }): Promise<PaseoAgentListResult & {
309
+ subscriptionId: string;
310
+ subscription: OwnedSubscription<PaseoAgentListResult>;
311
+ }>;
312
+ list(options?: PaseoAgentListOptions): Promise<PaseoAgentListResult>;
190
313
  ref(agent: string | PaseoAgent): PaseoAgentHandle;
191
314
  create(options: PaseoAgentCreateOptions): Promise<PaseoAgentHandle>;
192
315
  /**
@@ -195,19 +318,13 @@ export interface PaseoAgentActions {
195
318
  */
196
319
  subscribe(handler: PaseoAgentUpdateHandler): () => void;
197
320
  }
198
- export interface PaseoProviderConfig extends PaseoProviderConfigInput {
199
- provider: PaseoAgentProvider;
200
- }
201
- export type PaseoProviderFeatureValues = Record<string, unknown>;
202
- export interface PaseoProviderConfigInput {
203
- model?: string;
204
- modeId?: string;
205
- thinkingOptionId?: string;
206
- featureValues?: PaseoProviderFeatureValues;
207
- }
208
321
  export type PaseoProviderModelsResult = ListProviderModelsResponseMessage["payload"];
209
322
  export type PaseoProviderModesResult = ListProviderModesResponseMessage["payload"];
210
- export type PaseoProviderFeaturesInput = ListProviderFeaturesRequestMessage["draftConfig"];
323
+ type PaseoProviderFeaturesDraft = ListProviderFeaturesRequestMessage["draftConfig"];
324
+ export interface PaseoProviderFeaturesInput extends Omit<PaseoProviderFeaturesDraft, "provider" | "model"> {
325
+ /** Provider and model in `provider/model` format. */
326
+ provider: string;
327
+ }
211
328
  export type PaseoProviderFeaturesResult = ListProviderFeaturesResponseMessage["payload"];
212
329
  export type PaseoProviderAvailabilityResult = ListAvailableProvidersResponse["payload"];
213
330
  export type PaseoProviderSnapshotResult = GetProvidersSnapshotResponseMessage["payload"];
@@ -216,6 +333,10 @@ export type PaseoProviderSnapshotUpdate = Extract<SessionOutboundMessage, {
216
333
  }>["payload"];
217
334
  export type PaseoProviderRefreshResult = RefreshProvidersSnapshotResponseMessage["payload"];
218
335
  export type PaseoProviderDiagnosticResult = ProviderDiagnosticResponseMessage["payload"];
336
+ export type PaseoProviderUsageResult = ProviderUsageListResponseMessage["payload"];
337
+ export interface PaseoProviderUsageOptions {
338
+ requestId?: string;
339
+ }
219
340
  export interface PaseoProviderListOptions {
220
341
  cwd?: string;
221
342
  requestId?: string;
@@ -225,12 +346,10 @@ export interface PaseoProviderRefreshOptions {
225
346
  providers?: PaseoAgentProvider[];
226
347
  requestId?: string;
227
348
  }
349
+ export interface PaseoProviderWaitOptions extends PaseoProviderListOptions {
350
+ timeoutMs?: number;
351
+ }
228
352
  export interface PaseoProviderActions {
229
- codex(input?: PaseoProviderConfigInput): PaseoProviderConfig;
230
- claude(input?: PaseoProviderConfigInput): PaseoProviderConfig;
231
- opencode(input?: PaseoProviderConfigInput): PaseoProviderConfig;
232
- copilot(input?: PaseoProviderConfigInput): PaseoProviderConfig;
233
- config(provider: PaseoAgentProvider, input?: PaseoProviderConfigInput): PaseoProviderConfig;
234
353
  listModels(provider: PaseoAgentProvider, options?: PaseoProviderListOptions): Promise<PaseoProviderModelsResult>;
235
354
  listModes(provider: PaseoAgentProvider, options?: PaseoProviderListOptions): Promise<PaseoProviderModesResult>;
236
355
  listFeatures(draftConfig: PaseoProviderFeaturesInput, options?: {
@@ -240,6 +359,8 @@ export interface PaseoProviderActions {
240
359
  requestId?: string;
241
360
  }): Promise<PaseoProviderAvailabilityResult>;
242
361
  snapshot(options?: PaseoProviderListOptions): Promise<PaseoProviderSnapshotResult>;
362
+ /** Resolves after the daemon's lazy provider discovery has finished. */
363
+ waitForReady(options?: PaseoProviderWaitOptions): Promise<PaseoProviderSnapshotResult>;
243
364
  refresh(options?: PaseoProviderRefreshOptions): Promise<PaseoProviderRefreshResult>;
244
365
  /**
245
366
  * Re-read `agents.providers` from the daemon's config.json into its live
@@ -253,6 +374,7 @@ export interface PaseoProviderActions {
253
374
  diagnostic(provider: PaseoAgentProvider, options?: {
254
375
  requestId?: string;
255
376
  }): Promise<PaseoProviderDiagnosticResult>;
377
+ listUsage(options?: PaseoProviderUsageOptions): Promise<PaseoProviderUsageResult>;
256
378
  subscribe(handler: (update: PaseoProviderSnapshotUpdate) => void): () => void;
257
379
  }
258
380
  export interface PaseoConfigActions {
@@ -277,15 +399,24 @@ export interface PaseoConfigActions {
277
399
  config: MutableDaemonConfig;
278
400
  }>;
279
401
  }
280
- export interface PaseoClient {
402
+ export interface PaseoApi {
403
+ dispose(): Promise<void>;
404
+ observeEvents: DaemonClient["observeEvents"];
405
+ readonly terminals: PaseoTerminalActions;
281
406
  readonly workspaces: PaseoWorkspaceActions;
407
+ readonly projects: PaseoProjectActions;
282
408
  readonly agents: PaseoAgentActions;
283
409
  readonly providers: PaseoProviderActions;
284
410
  readonly config: PaseoConfigActions;
411
+ }
412
+ export interface PaseoClient extends PaseoApi {
285
413
  connect(): Promise<void>;
286
414
  close(): Promise<void>;
287
415
  ensureConnected(): void;
288
416
  getConnectionState(): ConnectionState;
289
417
  }
290
418
  export declare function createPaseoClient(config: PaseoClientConfig): PaseoClient;
419
+ export declare function createPaseoApi(daemonClient: DaemonClient, scopeOptions?: {
420
+ signal?: AbortSignal;
421
+ }): PaseoApi;
291
422
  //# sourceMappingURL=index.d.ts.map