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