@getmateo/client 0.0.0-stage → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +211 -0
  2. package/README.md +43 -2
  3. package/dist/compat/normalize-provider-models.d.ts +11 -0
  4. package/dist/compat/normalize-provider-models.js +51 -0
  5. package/dist/connection/index.d.ts +51 -0
  6. package/dist/connection/index.js +113 -0
  7. package/dist/connection/legacy-workspaces.d.ts +19 -0
  8. package/dist/connection/legacy-workspaces.js +161 -0
  9. package/dist/connection/legacy.d.ts +31 -0
  10. package/dist/connection/legacy.js +245 -0
  11. package/dist/connection/owned.d.ts +36 -0
  12. package/dist/connection/owned.js +210 -0
  13. package/dist/creation/index.d.ts +40 -0
  14. package/dist/creation/index.js +197 -0
  15. package/dist/daemon-client-relay-e2ee-transport.d.ts +10 -0
  16. package/dist/daemon-client-relay-e2ee-transport.js +190 -0
  17. package/dist/daemon-client-runtime-metrics.d.ts +39 -0
  18. package/dist/daemon-client-runtime-metrics.js +173 -0
  19. package/dist/daemon-client-transport-types.d.ts +43 -0
  20. package/dist/daemon-client-transport-types.js +2 -0
  21. package/dist/daemon-client-transport-utils.d.ts +14 -0
  22. package/dist/daemon-client-transport-utils.js +127 -0
  23. package/dist/daemon-client-transport.d.ts +5 -0
  24. package/dist/daemon-client-transport.js +4 -0
  25. package/dist/daemon-client-websocket-transport.d.ts +15 -0
  26. package/dist/daemon-client-websocket-transport.js +183 -0
  27. package/dist/daemon-client.d.ts +1507 -0
  28. package/dist/daemon-client.js +5465 -0
  29. package/dist/fleet/index.d.ts +29 -0
  30. package/dist/fleet/index.js +81 -0
  31. package/dist/hosts/index.d.ts +16 -0
  32. package/dist/hosts/index.js +201 -0
  33. package/dist/index.d.ts +430 -0
  34. package/dist/index.js +583 -0
  35. package/dist/legacy-usage-icons.d.ts +2 -0
  36. package/dist/legacy-usage-icons.js +16 -0
  37. package/dist/node/buffering.d.ts +10 -0
  38. package/dist/node/buffering.js +28 -0
  39. package/dist/node/index.d.ts +17 -0
  40. package/dist/node/index.js +191 -0
  41. package/dist/node/ssh-tunnel.d.ts +9 -0
  42. package/dist/node/ssh-tunnel.js +81 -0
  43. package/dist/provider-snapshots/index.d.ts +21 -0
  44. package/dist/provider-snapshots/index.js +56 -0
  45. package/dist/terminal-stream-router.d.ts +25 -0
  46. package/dist/terminal-stream-router.js +62 -0
  47. package/dist/terminals/index.d.ts +80 -0
  48. package/dist/terminals/index.js +120 -0
  49. package/dist/timeline-subscription/index.d.ts +25 -0
  50. package/dist/timeline-subscription/index.js +56 -0
  51. package/package.json +59 -4
@@ -0,0 +1,430 @@
1
+ import type { AgentAddress } from "@getmateo/protocol/addresses";
2
+ export type { AgentAddress } from "@getmateo/protocol/addresses";
3
+ import { type MateoHostActions } from "./hosts/index.js";
4
+ export type { MateoHostActions } from "./hosts/index.js";
5
+ export { enrollFleet, fleetConnection, removeFleetMember, FleetEnrollmentError, type FleetEnrollmentOptions, type FleetCredential, type FleetMember, type FleetStatus, type FleetProject, } from "./fleet/index.js";
6
+ import type { OwnedSubscription } from "./connection/index.js";
7
+ export type { OwnedSubscription, SubscriptionObserver } from "./connection/index.js";
8
+ import type { DaemonClientConfig } from "./daemon-client.js";
9
+ import type { AgentPermissionResponse } from "@getmateo/protocol/agent-types";
10
+ import type { AgentSnapshotPayload, CreationSnapshot, CreateAgentRequestMessage, FetchWorkspacesRequestMessage, FetchWorkspacesResponseMessage, GetProvidersSnapshotResponseMessage, ListAvailableProvidersResponse, ListCommandsResponse, ListProviderFeaturesRequestMessage, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ProjectListRequestMessage, ProjectListResponseMessage, ListProviderModesResponseMessage, MutableDaemonConfig, MutableDaemonConfigPatch, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, ProjectPlacementPayload, WorkspaceProjectDescriptorPayload, WorkspaceProjectMergeInput, WorkspaceProjectMergeResult, RefreshProvidersSnapshotResponseMessage, SessionOutboundMessage, WorkspaceDescriptorPayload, WorkspaceCreateRequest } from "@getmateo/protocol/messages";
11
+ import { DaemonClient } from "./daemon-client.js";
12
+ import { type MateoTerminalActions, type MateoWorkspaceTerminalActions } from "./terminals/index.js";
13
+ export type { MateoTerminal, MateoTerminalActions, MateoTerminalHandle, MateoTerminalCreateOptions, MateoGlobalTerminalCreateOptions, MateoTerminalListOptions, MateoTerminalListResult, MateoTerminalCaptureOptions, MateoTerminalCaptureResult, MateoWorkspaceTerminalActions, } from "./terminals/index.js";
14
+ import type { PluginTimelineItem } from "@getmateo/protocol/agent-types";
15
+ import type { FetchAgentsEntry, FetchAgentsOptions, FetchAgentsPageInfo, FetchAgentTimelineCursor, FetchAgentTimelineDirection, FetchAgentTimelinePayload, FetchAgentTimelineProjection, SendMessageOptions, WaitForFinishResult } from "./daemon-client.js";
16
+ export type ConnectionState = {
17
+ status: "idle";
18
+ } | {
19
+ status: "connecting";
20
+ attempt: number;
21
+ } | {
22
+ status: "connected";
23
+ } | {
24
+ status: "disconnected";
25
+ reason?: string;
26
+ } | {
27
+ status: "disposed";
28
+ };
29
+ export interface MateoLogger {
30
+ debug(obj: object, msg?: string): void;
31
+ info(obj: object, msg?: string): void;
32
+ warn(obj: object, msg?: string): void;
33
+ error(obj: object, msg?: string): void;
34
+ }
35
+ export interface MateoClientConfig {
36
+ capabilities?: DaemonClientConfig["capabilities"];
37
+ url: string;
38
+ clientId?: string;
39
+ appVersion?: string;
40
+ runtimeGeneration?: number | null;
41
+ password?: string;
42
+ authHeader?: string;
43
+ suppressSendErrors?: boolean;
44
+ logger?: MateoLogger;
45
+ connectTimeoutMs?: number;
46
+ e2ee?: {
47
+ enabled?: boolean;
48
+ daemonPublicKeyB64?: string;
49
+ };
50
+ reconnect?: {
51
+ enabled?: boolean;
52
+ baseDelayMs?: number;
53
+ maxDelayMs?: number;
54
+ };
55
+ runtimeMetricsIntervalMs?: number;
56
+ runtimeMetricsWindowMs?: number;
57
+ }
58
+ export type MateoWorkspace = WorkspaceDescriptorPayload;
59
+ export type MateoAgent = AgentSnapshotPayload;
60
+ export type MateoAgentListOptions = FetchAgentsOptions;
61
+ export type MateoProject = WorkspaceProjectDescriptorPayload;
62
+ export type MateoProjectListOptions = Omit<ProjectListRequestMessage, "type" | "requestId"> & {
63
+ requestId?: string;
64
+ };
65
+ export type MateoProjectListResult = ProjectListResponseMessage["payload"];
66
+ export type MateoProjectUpdate = Extract<SessionOutboundMessage, {
67
+ type: "project.update";
68
+ }>["payload"];
69
+ export type MateoProjectUpdateHandler = (update: MateoProjectUpdate) => void;
70
+ export interface MateoAgentListResult {
71
+ subscription?: OwnedSubscription<MateoAgentListResult>;
72
+ requestId: string;
73
+ subscriptionId?: string | null;
74
+ entries: FetchAgentsEntry[];
75
+ pageInfo: FetchAgentsPageInfo;
76
+ }
77
+ export type MateoWorkspaceListOptions = Omit<FetchWorkspacesRequestMessage, "type" | "requestId"> & {
78
+ requestId?: string;
79
+ };
80
+ export interface MateoWorkspaceListResult {
81
+ subscription?: OwnedSubscription<MateoWorkspaceListResult>;
82
+ requestId: string;
83
+ subscriptionId?: string | null;
84
+ entries: MateoWorkspace[];
85
+ pageInfo: FetchWorkspacesResponseMessage["payload"]["pageInfo"];
86
+ }
87
+ export interface MateoWorkspaceOpenOptions {
88
+ cwd: string;
89
+ requestId?: string;
90
+ }
91
+ export type MateoWorkspaceCreateOptions = Omit<WorkspaceCreateRequest, "type" | "requestId" | "agent" | "subscribe"> & {
92
+ requestId?: string;
93
+ agent?: Omit<MateoAgentCreateOptions, "worktree" | "git" | "onEvent" | "idempotencyKey" | "requestId">;
94
+ onEvent?: (snapshot: CreationSnapshot) => void;
95
+ };
96
+ export interface MateoWorkspaceArchiveResult {
97
+ requestId: string;
98
+ workspaceId: string;
99
+ archivedAt: string | null;
100
+ error: string | null;
101
+ }
102
+ export type MateoWorkspaceUpdate = Extract<SessionOutboundMessage, {
103
+ type: "workspace_update";
104
+ }>["payload"];
105
+ export type MateoWorkspaceUpdateHandler = (update: MateoWorkspaceUpdate) => void;
106
+ export interface MateoWorkspaceHandle {
107
+ readonly id: string;
108
+ readonly projectId: string | null;
109
+ readonly directory: string | null;
110
+ readonly name: string | null;
111
+ readonly status: MateoWorkspace["status"] | null;
112
+ readonly agents: {
113
+ create(options: MateoWorkspaceAgentCreateOptions): Promise<MateoAgentHandle>;
114
+ };
115
+ readonly terminals: MateoWorkspaceTerminalActions;
116
+ current(): MateoWorkspace | null;
117
+ refresh(options?: {
118
+ requestId?: string;
119
+ }): Promise<MateoWorkspace | null>;
120
+ setTitle(title: string | null, requestId?: string): Promise<{
121
+ title: string | null;
122
+ }>;
123
+ archive(requestId?: string): Promise<MateoWorkspaceArchiveResult>;
124
+ /**
125
+ * Subscribes to already-emitted daemon workspace_update events for this id.
126
+ * This returns a local unsubscribe function; it does not own app cache state or
127
+ * send a daemon unsubscribe RPC. Call `workspaces.list({ subscribe: {} })` when
128
+ * the daemon should start streaming workspace directory updates.
129
+ */
130
+ subscribe(handler: (update: MateoWorkspaceUpdate) => void): () => void;
131
+ }
132
+ export interface MateoProjectAddOptions {
133
+ path: string;
134
+ requestId?: string;
135
+ }
136
+ export interface MateoProjectActions {
137
+ /** Register an existing directory as a Project without creating a Workspace. */
138
+ add(options: MateoProjectAddOptions): Promise<MateoProject>;
139
+ list(options?: MateoProjectListOptions): Promise<MateoProjectListResult>;
140
+ subscribe(handler: MateoProjectUpdateHandler): () => void;
141
+ }
142
+ export interface MateoWorkspaceActions {
143
+ mergeProject(input: WorkspaceProjectMergeInput): Promise<WorkspaceProjectMergeResult>;
144
+ list(options: MateoWorkspaceListOptions & {
145
+ subscribe: {};
146
+ }): Promise<MateoWorkspaceListResult & {
147
+ subscriptionId: string;
148
+ subscription: OwnedSubscription<MateoWorkspaceListResult>;
149
+ }>;
150
+ list(options?: MateoWorkspaceListOptions): Promise<MateoWorkspaceListResult>;
151
+ ref(workspace: string | MateoWorkspace): MateoWorkspaceHandle;
152
+ open(input: string | MateoWorkspaceOpenOptions, requestId?: string): Promise<MateoWorkspaceHandle>;
153
+ create(options: MateoWorkspaceCreateOptions): Promise<MateoWorkspaceHandle>;
154
+ archive(workspace: string | MateoWorkspaceHandle, requestId?: string): Promise<MateoWorkspaceArchiveResult>;
155
+ /**
156
+ * Local event subscription over the low-level driver's workspace_update stream.
157
+ * The returned function only removes this SDK listener.
158
+ */
159
+ subscribe(handler: MateoWorkspaceUpdateHandler): () => void;
160
+ }
161
+ type MateoAgentSessionConfig = CreateAgentRequestMessage["config"];
162
+ export type MateoAgentProvider = MateoAgentSessionConfig["provider"];
163
+ export type MateoProviderFeatureValues = Record<string, unknown>;
164
+ export interface MateoAgentConfig {
165
+ /** Provider and model in `provider/model` format. */
166
+ provider: string;
167
+ modeId?: MateoAgentSessionConfig["modeId"];
168
+ thinkingOptionId?: MateoAgentSessionConfig["thinkingOptionId"];
169
+ featureValues?: MateoProviderFeatureValues;
170
+ /** JSON-safe provider-native settings, validated by the selected provider. */
171
+ options?: MateoAgentSessionConfig["providerOptions"];
172
+ systemPrompt?: MateoAgentSessionConfig["systemPrompt"];
173
+ toolPolicy?: MateoAgentSessionConfig["toolPolicy"];
174
+ mcpServers?: MateoAgentSessionConfig["mcpServers"];
175
+ }
176
+ export interface MateoAgentCreateOptions {
177
+ idempotencyKey?: string;
178
+ agentId?: string;
179
+ onEvent?: (snapshot: CreationSnapshot) => void;
180
+ config: MateoAgentConfig;
181
+ cwd: string;
182
+ parent?: string | AgentAddress | MateoAgentHandle;
183
+ title?: MateoAgentSessionConfig["title"];
184
+ env?: CreateAgentRequestMessage["env"];
185
+ prompt?: string;
186
+ clientMessageId?: string;
187
+ outputSchema?: Record<string, unknown>;
188
+ images?: CreateAgentRequestMessage["images"];
189
+ attachments?: CreateAgentRequestMessage["attachments"];
190
+ git?: CreateAgentRequestMessage["git"];
191
+ worktree?: CreateAgentRequestMessage["worktree"];
192
+ autoArchive?: CreateAgentRequestMessage["autoArchive"];
193
+ /** Visibility intent for a NEW workspace. Existing targets reject this option. */
194
+ background?: CreateAgentRequestMessage["background"];
195
+ requestId?: string;
196
+ labels?: Record<string, string>;
197
+ }
198
+ export type MateoWorkspaceAgentCreateOptions = Omit<MateoAgentCreateOptions, "cwd">;
199
+ export interface MateoAgentRefetchResult {
200
+ agent: MateoAgent;
201
+ project: ProjectPlacementPayload | null;
202
+ }
203
+ export interface MateoAgentTimelineRefetchOptions {
204
+ direction?: FetchAgentTimelineDirection;
205
+ cursor?: FetchAgentTimelineCursor;
206
+ limit?: number;
207
+ projection?: FetchAgentTimelineProjection;
208
+ requestId?: string;
209
+ }
210
+ export type MateoAgentSendOptions = SendMessageOptions;
211
+ export interface MateoAgentRunOptions extends MateoAgentSendOptions {
212
+ timeoutMs?: number;
213
+ }
214
+ export type MateoAgentRunResult = WaitForFinishResult;
215
+ export type MateoAgentPermissionResponse = AgentPermissionResponse;
216
+ export interface MateoAgentRespondToPermissionOptions {
217
+ requestId: string;
218
+ response: MateoAgentPermissionResponse;
219
+ }
220
+ export interface MateoAgentCommandsOptions {
221
+ requestId?: string;
222
+ }
223
+ export type MateoAgentCommandsResult = ListCommandsResponse["payload"];
224
+ export type MateoAgentUpdate = Extract<SessionOutboundMessage, {
225
+ type: "agent_update";
226
+ }>["payload"];
227
+ export type MateoAgentStream = Extract<SessionOutboundMessage, {
228
+ type: "agent_stream";
229
+ }>["payload"];
230
+ export type MateoAgentUpdateHandler = (update: MateoAgentUpdate) => void;
231
+ export type MateoAgentTimelineEvent = MateoAgentStream | {
232
+ agentId: string;
233
+ event: {
234
+ type: "replacement";
235
+ epoch: string;
236
+ };
237
+ } | {
238
+ agentId: string;
239
+ subscriptionId: string;
240
+ event: {
241
+ type: "subscription_restored";
242
+ };
243
+ } | {
244
+ agentId: string;
245
+ event: {
246
+ type: "error";
247
+ error: string;
248
+ };
249
+ };
250
+ export type MateoAgentTimelineSubscription = ReturnType<DaemonClient["subscribeAgentTimeline"]>;
251
+ export interface MateoAgentTimelineHandle {
252
+ append(item: Omit<PluginTimelineItem, "pluginId">): Promise<{
253
+ seq: number;
254
+ epoch: string;
255
+ }>;
256
+ /**
257
+ * Fetches a fresh timeline page through the existing daemon RPC. If the daemon
258
+ * includes an agent snapshot in the response, the parent handle is updated to
259
+ * that value.
260
+ */
261
+ refetch(options?: MateoAgentTimelineRefetchOptions): Promise<FetchAgentTimelinePayload>;
262
+ /**
263
+ * Delivers live events only. After reconnect, subscription_restored precedes
264
+ * subsequent updates. History may have been missed; use refetch() to request
265
+ * the range you need. No history is fetched automatically. A replacement event
266
+ * invalidates the previous epoch. Subscription errors release this observation.
267
+ * Await the returned unsubscribe function's `ready` promise before starting
268
+ * work that must be observed. It rejects if establishment fails.
269
+ */
270
+ subscribe(handler: (event: MateoAgentTimelineEvent) => void): MateoAgentTimelineSubscription;
271
+ }
272
+ export interface MateoAgentHandle {
273
+ readonly id: string;
274
+ /** The agent qualified by its host. Throws until the client has connected to that host. */
275
+ readonly address: AgentAddress;
276
+ /**
277
+ * `workspaceId` through `archivedAt` mirror the last snapshot this handle
278
+ * observed. A handle from `ref()` reads `null` for all of them until
279
+ * `refresh()`, `run()`, `waitForFinish()`, a timeline refetch, or
280
+ * `subscribe()` delivers a snapshot. Optional snapshot values also read as
281
+ * `null`; use `current()` when you need to distinguish those states.
282
+ */
283
+ readonly workspaceId: string | null;
284
+ readonly cwd: string | null;
285
+ readonly status: MateoAgent["status"] | null;
286
+ readonly capabilities: MateoAgent["capabilities"] | null;
287
+ readonly availableModes: MateoAgent["availableModes"] | null;
288
+ readonly pendingPermissions: MateoAgent["pendingPermissions"] | null;
289
+ readonly activeTurn: NonNullable<MateoAgent["activeTurn"]> | null;
290
+ readonly lastUsage: NonNullable<MateoAgent["lastUsage"]> | null;
291
+ readonly lastError: NonNullable<MateoAgent["lastError"]> | null;
292
+ readonly features: NonNullable<MateoAgent["features"]> | null;
293
+ readonly runtimeInfo: NonNullable<MateoAgent["runtimeInfo"]> | null;
294
+ readonly archivedAt: NonNullable<MateoAgent["archivedAt"]> | null;
295
+ readonly timeline: MateoAgentTimelineHandle;
296
+ current(): MateoAgent | null;
297
+ refresh(requestId?: string): Promise<MateoAgentRefetchResult | null>;
298
+ send(text: string, options?: MateoAgentSendOptions): Promise<void>;
299
+ respondToPermission(options: MateoAgentRespondToPermissionOptions): Promise<void>;
300
+ /** Sends a prompt and resolves when that turn finishes or needs attention. */
301
+ run(text: string, options?: MateoAgentRunOptions): Promise<MateoAgentRunResult>;
302
+ /** Waits for the current turn, including one started with `prompt`. */
303
+ waitForFinish(timeoutMs?: number): Promise<MateoAgentRunResult>;
304
+ /**
305
+ * Asks the running session for the slash commands and skills it actually
306
+ * loaded. Providers answer from the live session, so this sees built-in and
307
+ * bundled entries that no directory scan can find. The payload carries its own
308
+ * `error` string; a provider that cannot answer reports it there rather than
309
+ * rejecting.
310
+ */
311
+ commands(options?: MateoAgentCommandsOptions): Promise<MateoAgentCommandsResult>;
312
+ archive(): Promise<{
313
+ archivedAt: string;
314
+ }>;
315
+ detach(): Promise<void>;
316
+ subscribe(handler: (update: MateoAgentUpdate) => void): () => void;
317
+ }
318
+ export interface MateoAgentActions {
319
+ list(options: MateoAgentListOptions & {
320
+ subscribe: {};
321
+ }): Promise<MateoAgentListResult & {
322
+ subscriptionId: string;
323
+ subscription: OwnedSubscription<MateoAgentListResult>;
324
+ }>;
325
+ list(options?: MateoAgentListOptions): Promise<MateoAgentListResult>;
326
+ ref(agent: string | MateoAgent): MateoAgentHandle;
327
+ create(options: MateoAgentCreateOptions): Promise<MateoAgentHandle>;
328
+ /**
329
+ * Local event subscription over the low-level driver's agent_update stream.
330
+ * The returned function only removes this SDK listener.
331
+ */
332
+ subscribe(handler: MateoAgentUpdateHandler): () => void;
333
+ }
334
+ export type MateoProviderModelsResult = ListProviderModelsResponseMessage["payload"];
335
+ export type MateoProviderModesResult = ListProviderModesResponseMessage["payload"];
336
+ type MateoProviderFeaturesDraft = ListProviderFeaturesRequestMessage["draftConfig"];
337
+ export interface MateoProviderFeaturesInput extends Omit<MateoProviderFeaturesDraft, "provider" | "model"> {
338
+ /** Provider and model in `provider/model` format. */
339
+ provider: string;
340
+ }
341
+ export type MateoProviderFeaturesResult = ListProviderFeaturesResponseMessage["payload"];
342
+ export type MateoProviderAvailabilityResult = ListAvailableProvidersResponse["payload"];
343
+ export type MateoProviderSnapshotResult = GetProvidersSnapshotResponseMessage["payload"];
344
+ export type MateoProviderSnapshotUpdate = Extract<SessionOutboundMessage, {
345
+ type: "providers_snapshot_update";
346
+ }>["payload"];
347
+ export type MateoProviderRefreshResult = RefreshProvidersSnapshotResponseMessage["payload"];
348
+ export type MateoProviderDiagnosticResult = ProviderDiagnosticResponseMessage["payload"];
349
+ export type MateoProviderUsageResult = ProviderUsageListResponseMessage["payload"];
350
+ export interface MateoProviderUsageOptions {
351
+ requestId?: string;
352
+ }
353
+ export interface MateoProviderListOptions {
354
+ cwd?: string;
355
+ requestId?: string;
356
+ }
357
+ export interface MateoProviderRefreshOptions {
358
+ cwd?: string;
359
+ providers?: MateoAgentProvider[];
360
+ requestId?: string;
361
+ }
362
+ export interface MateoProviderWaitOptions extends MateoProviderListOptions {
363
+ timeoutMs?: number;
364
+ }
365
+ export interface MateoProviderActions {
366
+ listModels(provider: MateoAgentProvider, options?: MateoProviderListOptions): Promise<MateoProviderModelsResult>;
367
+ listModes(provider: MateoAgentProvider, options?: MateoProviderListOptions): Promise<MateoProviderModesResult>;
368
+ listFeatures(draftConfig: MateoProviderFeaturesInput, options?: {
369
+ requestId?: string;
370
+ }): Promise<MateoProviderFeaturesResult>;
371
+ listAvailable(options?: {
372
+ requestId?: string;
373
+ }): Promise<MateoProviderAvailabilityResult>;
374
+ snapshot(options?: MateoProviderListOptions): Promise<MateoProviderSnapshotResult>;
375
+ /** Resolves after the daemon's lazy provider discovery has finished. */
376
+ waitForReady(options?: MateoProviderWaitOptions): Promise<MateoProviderSnapshotResult>;
377
+ refresh(options?: MateoProviderRefreshOptions): Promise<MateoProviderRefreshResult>;
378
+ diagnostic(provider: MateoAgentProvider, options?: {
379
+ requestId?: string;
380
+ }): Promise<MateoProviderDiagnosticResult>;
381
+ listUsage(options?: MateoProviderUsageOptions): Promise<MateoProviderUsageResult>;
382
+ subscribe(handler: (update: MateoProviderSnapshotUpdate) => void): () => void;
383
+ }
384
+ export interface MateoConfigActions {
385
+ /**
386
+ * Reads daemon config through the existing config RPC. Provider profiles,
387
+ * custom provider entries, keys/env, custom binaries, and provider enablement
388
+ * are currently config-file-shaped daemon state, so the SDK exposes this raw
389
+ * typed surface instead of pretending there are higher-level provider-settings
390
+ * RPCs.
391
+ */
392
+ get(requestId?: string): Promise<{
393
+ requestId: string;
394
+ config: MutableDaemonConfig;
395
+ }>;
396
+ /**
397
+ * Patches daemon config through the existing config RPC. The daemon validates
398
+ * and persists supported fields; unsupported provider/settings workflows remain
399
+ * daemon gaps until first-class RPCs exist.
400
+ */
401
+ patch(config: MutableDaemonConfigPatch, requestId?: string): Promise<{
402
+ requestId: string;
403
+ config: MutableDaemonConfig;
404
+ }>;
405
+ }
406
+ export interface MateoApi {
407
+ readonly hosts: MateoHostActions;
408
+ dispose(): Promise<void>;
409
+ observeEvents: DaemonClient["observeEvents"];
410
+ readonly terminals: MateoTerminalActions;
411
+ readonly workspaces: MateoWorkspaceActions;
412
+ readonly projects: MateoProjectActions;
413
+ readonly checkouts: {
414
+ status: DaemonClient["getCheckoutStatus"];
415
+ };
416
+ readonly agents: MateoAgentActions;
417
+ readonly providers: MateoProviderActions;
418
+ readonly config: MateoConfigActions;
419
+ }
420
+ export interface MateoClient extends MateoApi {
421
+ connect(): Promise<void>;
422
+ close(): Promise<void>;
423
+ ensureConnected(): void;
424
+ getConnectionState(): ConnectionState;
425
+ }
426
+ export declare function createMateoClient(config: MateoClientConfig): MateoClient;
427
+ export declare function createMateoApi(daemonClient: DaemonClient, scopeOptions?: {
428
+ signal?: AbortSignal;
429
+ }): MateoApi;
430
+ //# sourceMappingURL=index.d.ts.map