sandbox-agent 0.1.11 → 0.2.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/dist/index.d.ts +508 -892
- package/dist/index.js +807 -147
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { NewSessionRequest, AnyMessage, AcpEnvelopeDirection, NewSessionResponse, PromptRequest, PromptResponse } from 'acp-http-client';
|
|
2
|
+
export { AcpRpcError } from 'acp-http-client';
|
|
3
|
+
|
|
1
4
|
type SandboxAgentSpawnLogMode = "inherit" | "pipe" | "silent";
|
|
2
5
|
type SandboxAgentSpawnOptions = {
|
|
3
6
|
enabled?: boolean;
|
|
@@ -10,173 +13,28 @@ type SandboxAgentSpawnOptions = {
|
|
|
10
13
|
env?: Record<string, string>;
|
|
11
14
|
};
|
|
12
15
|
|
|
13
|
-
/**
|
|
14
|
-
* This file was auto-generated by openapi-typescript.
|
|
15
|
-
* Do not make direct changes to the file.
|
|
16
|
-
*/
|
|
17
|
-
interface paths {
|
|
18
|
-
"/v1/agents": {
|
|
19
|
-
/**
|
|
20
|
-
* List Agents
|
|
21
|
-
* @description Returns all available coding agents and their installation status.
|
|
22
|
-
*/
|
|
23
|
-
get: operations["list_agents"];
|
|
24
|
-
};
|
|
25
|
-
"/v1/agents/{agent}/install": {
|
|
26
|
-
/**
|
|
27
|
-
* Install Agent
|
|
28
|
-
* @description Installs or updates a coding agent (e.g. claude, codex, opencode, amp).
|
|
29
|
-
*/
|
|
30
|
-
post: operations["install_agent"];
|
|
31
|
-
};
|
|
32
|
-
"/v1/agents/{agent}/models": {
|
|
33
|
-
/**
|
|
34
|
-
* List Agent Models
|
|
35
|
-
* @description Returns the available LLM models for an agent.
|
|
36
|
-
*/
|
|
37
|
-
get: operations["get_agent_models"];
|
|
38
|
-
};
|
|
39
|
-
"/v1/agents/{agent}/modes": {
|
|
40
|
-
/**
|
|
41
|
-
* List Agent Modes
|
|
42
|
-
* @description Returns the available interaction modes for an agent.
|
|
43
|
-
*/
|
|
44
|
-
get: operations["get_agent_modes"];
|
|
45
|
-
};
|
|
46
|
-
"/v1/fs/entries": {
|
|
47
|
-
/**
|
|
48
|
-
* List Directory
|
|
49
|
-
* @description Lists files and directories at the given path.
|
|
50
|
-
*/
|
|
51
|
-
get: operations["fs_entries"];
|
|
52
|
-
};
|
|
53
|
-
"/v1/fs/entry": {
|
|
54
|
-
/**
|
|
55
|
-
* Delete Entry
|
|
56
|
-
* @description Deletes a file or directory.
|
|
57
|
-
*/
|
|
58
|
-
delete: operations["fs_delete_entry"];
|
|
59
|
-
};
|
|
60
|
-
"/v1/fs/file": {
|
|
61
|
-
/**
|
|
62
|
-
* Read File
|
|
63
|
-
* @description Reads the raw bytes of a file.
|
|
64
|
-
*/
|
|
65
|
-
get: operations["fs_read_file"];
|
|
66
|
-
/**
|
|
67
|
-
* Write File
|
|
68
|
-
* @description Writes raw bytes to a file, creating it if it doesn't exist.
|
|
69
|
-
*/
|
|
70
|
-
put: operations["fs_write_file"];
|
|
71
|
-
};
|
|
72
|
-
"/v1/fs/mkdir": {
|
|
73
|
-
/**
|
|
74
|
-
* Create Directory
|
|
75
|
-
* @description Creates a directory, including any missing parent directories.
|
|
76
|
-
*/
|
|
77
|
-
post: operations["fs_mkdir"];
|
|
78
|
-
};
|
|
79
|
-
"/v1/fs/move": {
|
|
80
|
-
/**
|
|
81
|
-
* Move Entry
|
|
82
|
-
* @description Moves or renames a file or directory.
|
|
83
|
-
*/
|
|
84
|
-
post: operations["fs_move"];
|
|
85
|
-
};
|
|
86
|
-
"/v1/fs/stat": {
|
|
87
|
-
/**
|
|
88
|
-
* Get File Info
|
|
89
|
-
* @description Returns metadata (size, timestamps, type) for a path.
|
|
90
|
-
*/
|
|
91
|
-
get: operations["fs_stat"];
|
|
92
|
-
};
|
|
93
|
-
"/v1/fs/upload-batch": {
|
|
94
|
-
/**
|
|
95
|
-
* Upload Files
|
|
96
|
-
* @description Uploads a tar.gz archive and extracts it to the destination directory.
|
|
97
|
-
*/
|
|
98
|
-
post: operations["fs_upload_batch"];
|
|
99
|
-
};
|
|
100
|
-
"/v1/health": {
|
|
101
|
-
/**
|
|
102
|
-
* Health Check
|
|
103
|
-
* @description Returns the server health status.
|
|
104
|
-
*/
|
|
105
|
-
get: operations["get_health"];
|
|
106
|
-
};
|
|
107
|
-
"/v1/sessions": {
|
|
108
|
-
/**
|
|
109
|
-
* List Sessions
|
|
110
|
-
* @description Returns all active sessions.
|
|
111
|
-
*/
|
|
112
|
-
get: operations["list_sessions"];
|
|
113
|
-
};
|
|
114
|
-
"/v1/sessions/{session_id}": {
|
|
115
|
-
/**
|
|
116
|
-
* Create Session
|
|
117
|
-
* @description Creates a new agent session with the given configuration.
|
|
118
|
-
*/
|
|
119
|
-
post: operations["create_session"];
|
|
120
|
-
};
|
|
121
|
-
"/v1/sessions/{session_id}/events": {
|
|
122
|
-
/**
|
|
123
|
-
* Get Events
|
|
124
|
-
* @description Returns session events with optional offset-based pagination.
|
|
125
|
-
*/
|
|
126
|
-
get: operations["get_events"];
|
|
127
|
-
};
|
|
128
|
-
"/v1/sessions/{session_id}/events/sse": {
|
|
129
|
-
/**
|
|
130
|
-
* Subscribe to Events (SSE)
|
|
131
|
-
* @description Opens an SSE stream for real-time session events.
|
|
132
|
-
*/
|
|
133
|
-
get: operations["get_events_sse"];
|
|
134
|
-
};
|
|
135
|
-
"/v1/sessions/{session_id}/messages": {
|
|
136
|
-
/**
|
|
137
|
-
* Send Message
|
|
138
|
-
* @description Sends a message to a session and returns immediately.
|
|
139
|
-
*/
|
|
140
|
-
post: operations["post_message"];
|
|
141
|
-
};
|
|
142
|
-
"/v1/sessions/{session_id}/messages/stream": {
|
|
143
|
-
/**
|
|
144
|
-
* Send Message (Streaming)
|
|
145
|
-
* @description Sends a message and returns an SSE event stream of the agent's response.
|
|
146
|
-
*/
|
|
147
|
-
post: operations["post_message_stream"];
|
|
148
|
-
};
|
|
149
|
-
"/v1/sessions/{session_id}/permissions/{permission_id}/reply": {
|
|
150
|
-
/**
|
|
151
|
-
* Reply to Permission
|
|
152
|
-
* @description Approves or denies a permission request from the agent.
|
|
153
|
-
*/
|
|
154
|
-
post: operations["reply_permission"];
|
|
155
|
-
};
|
|
156
|
-
"/v1/sessions/{session_id}/questions/{question_id}/reject": {
|
|
157
|
-
/**
|
|
158
|
-
* Reject Question
|
|
159
|
-
* @description Rejects a human-in-the-loop question from the agent.
|
|
160
|
-
*/
|
|
161
|
-
post: operations["reject_question"];
|
|
162
|
-
};
|
|
163
|
-
"/v1/sessions/{session_id}/questions/{question_id}/reply": {
|
|
164
|
-
/**
|
|
165
|
-
* Reply to Question
|
|
166
|
-
* @description Replies to a human-in-the-loop question from the agent.
|
|
167
|
-
*/
|
|
168
|
-
post: operations["reply_question"];
|
|
169
|
-
};
|
|
170
|
-
"/v1/sessions/{session_id}/terminate": {
|
|
171
|
-
/**
|
|
172
|
-
* Terminate Session
|
|
173
|
-
* @description Terminates a running session and cleans up resources.
|
|
174
|
-
*/
|
|
175
|
-
post: operations["terminate_session"];
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
16
|
interface components {
|
|
179
17
|
schemas: {
|
|
18
|
+
AcpEnvelope: {
|
|
19
|
+
error?: unknown;
|
|
20
|
+
id?: unknown;
|
|
21
|
+
jsonrpc: string;
|
|
22
|
+
method?: string | null;
|
|
23
|
+
params?: unknown;
|
|
24
|
+
result?: unknown;
|
|
25
|
+
};
|
|
26
|
+
AcpPostQuery: {
|
|
27
|
+
agent?: string | null;
|
|
28
|
+
};
|
|
29
|
+
AcpServerInfo: {
|
|
30
|
+
agent: string;
|
|
31
|
+
/** Format: int64 */
|
|
32
|
+
createdAtMs: number;
|
|
33
|
+
serverId: string;
|
|
34
|
+
};
|
|
35
|
+
AcpServerListResponse: {
|
|
36
|
+
servers: components["schemas"]["AcpServerInfo"][];
|
|
37
|
+
};
|
|
180
38
|
AgentCapabilities: {
|
|
181
39
|
commandExecution: boolean;
|
|
182
40
|
errorEvents: boolean;
|
|
@@ -190,7 +48,6 @@ interface components {
|
|
|
190
48
|
questions: boolean;
|
|
191
49
|
reasoning: boolean;
|
|
192
50
|
sessionLifecycle: boolean;
|
|
193
|
-
/** @description Whether this agent uses a shared long-running server process (vs per-turn subprocess) */
|
|
194
51
|
sharedProcess: boolean;
|
|
195
52
|
status: boolean;
|
|
196
53
|
streamingDeltas: boolean;
|
|
@@ -198,16 +55,10 @@ interface components {
|
|
|
198
55
|
toolCalls: boolean;
|
|
199
56
|
toolResults: boolean;
|
|
200
57
|
};
|
|
201
|
-
AgentError: {
|
|
202
|
-
agent?: string | null;
|
|
203
|
-
details?: unknown;
|
|
204
|
-
message: string;
|
|
205
|
-
session_id?: string | null;
|
|
206
|
-
type: components["schemas"]["ErrorType"];
|
|
207
|
-
};
|
|
208
58
|
AgentInfo: {
|
|
209
59
|
capabilities: components["schemas"]["AgentCapabilities"];
|
|
210
|
-
|
|
60
|
+
configError?: string | null;
|
|
61
|
+
configOptions?: unknown[] | null;
|
|
211
62
|
credentialsAvailable: boolean;
|
|
212
63
|
id: string;
|
|
213
64
|
installed: boolean;
|
|
@@ -215,128 +66,35 @@ interface components {
|
|
|
215
66
|
serverStatus?: components["schemas"]["ServerStatusInfo"] | null;
|
|
216
67
|
version?: string | null;
|
|
217
68
|
};
|
|
69
|
+
AgentInstallArtifact: {
|
|
70
|
+
kind: string;
|
|
71
|
+
path: string;
|
|
72
|
+
source: string;
|
|
73
|
+
version?: string | null;
|
|
74
|
+
};
|
|
218
75
|
AgentInstallRequest: {
|
|
76
|
+
agentProcessVersion?: string | null;
|
|
77
|
+
agentVersion?: string | null;
|
|
219
78
|
reinstall?: boolean | null;
|
|
220
79
|
};
|
|
80
|
+
AgentInstallResponse: {
|
|
81
|
+
already_installed: boolean;
|
|
82
|
+
artifacts: components["schemas"]["AgentInstallArtifact"][];
|
|
83
|
+
};
|
|
221
84
|
AgentListResponse: {
|
|
222
85
|
agents: components["schemas"]["AgentInfo"][];
|
|
223
86
|
};
|
|
224
|
-
AgentModeInfo: {
|
|
225
|
-
description: string;
|
|
226
|
-
id: string;
|
|
227
|
-
name: string;
|
|
228
|
-
};
|
|
229
|
-
AgentModelInfo: {
|
|
230
|
-
defaultVariant?: string | null;
|
|
231
|
-
id: string;
|
|
232
|
-
name?: string | null;
|
|
233
|
-
variants?: string[] | null;
|
|
234
|
-
};
|
|
235
|
-
AgentModelsResponse: {
|
|
236
|
-
defaultModel?: string | null;
|
|
237
|
-
models: components["schemas"]["AgentModelInfo"][];
|
|
238
|
-
};
|
|
239
|
-
AgentModesResponse: {
|
|
240
|
-
modes: components["schemas"]["AgentModeInfo"][];
|
|
241
|
-
};
|
|
242
|
-
AgentUnparsedData: {
|
|
243
|
-
error: string;
|
|
244
|
-
location: string;
|
|
245
|
-
raw_hash?: string | null;
|
|
246
|
-
};
|
|
247
|
-
ContentPart: {
|
|
248
|
-
text: string;
|
|
249
|
-
/** @enum {string} */
|
|
250
|
-
type: "text";
|
|
251
|
-
} | {
|
|
252
|
-
json: unknown;
|
|
253
|
-
/** @enum {string} */
|
|
254
|
-
type: "json";
|
|
255
|
-
} | {
|
|
256
|
-
arguments: string;
|
|
257
|
-
call_id: string;
|
|
258
|
-
name: string;
|
|
259
|
-
/** @enum {string} */
|
|
260
|
-
type: "tool_call";
|
|
261
|
-
} | {
|
|
262
|
-
call_id: string;
|
|
263
|
-
output: string;
|
|
264
|
-
/** @enum {string} */
|
|
265
|
-
type: "tool_result";
|
|
266
|
-
} | ({
|
|
267
|
-
action: components["schemas"]["FileAction"];
|
|
268
|
-
diff?: string | null;
|
|
269
|
-
path: string;
|
|
270
|
-
/** @enum {string} */
|
|
271
|
-
type: "file_ref";
|
|
272
|
-
}) | {
|
|
273
|
-
text: string;
|
|
274
|
-
/** @enum {string} */
|
|
275
|
-
type: "reasoning";
|
|
276
|
-
visibility: components["schemas"]["ReasoningVisibility"];
|
|
277
|
-
} | ({
|
|
278
|
-
mime?: string | null;
|
|
279
|
-
path: string;
|
|
280
|
-
/** @enum {string} */
|
|
281
|
-
type: "image";
|
|
282
|
-
}) | ({
|
|
283
|
-
detail?: string | null;
|
|
284
|
-
label: string;
|
|
285
|
-
/** @enum {string} */
|
|
286
|
-
type: "status";
|
|
287
|
-
});
|
|
288
|
-
CreateSessionRequest: {
|
|
289
|
-
agent: string;
|
|
290
|
-
agentMode?: string | null;
|
|
291
|
-
agentVersion?: string | null;
|
|
292
|
-
directory?: string | null;
|
|
293
|
-
mcp?: {
|
|
294
|
-
[key: string]: components["schemas"]["McpServerConfig"];
|
|
295
|
-
} | null;
|
|
296
|
-
model?: string | null;
|
|
297
|
-
permissionMode?: string | null;
|
|
298
|
-
skills?: components["schemas"]["SkillsConfig"] | null;
|
|
299
|
-
title?: string | null;
|
|
300
|
-
variant?: string | null;
|
|
301
|
-
};
|
|
302
|
-
CreateSessionResponse: {
|
|
303
|
-
error?: components["schemas"]["AgentError"] | null;
|
|
304
|
-
healthy: boolean;
|
|
305
|
-
nativeSessionId?: string | null;
|
|
306
|
-
};
|
|
307
|
-
ErrorData: {
|
|
308
|
-
code?: string | null;
|
|
309
|
-
details?: unknown;
|
|
310
|
-
message: string;
|
|
311
|
-
};
|
|
312
|
-
/** @enum {string} */
|
|
313
|
-
ErrorType: "invalid_request" | "unsupported_agent" | "agent_not_installed" | "install_failed" | "agent_process_exited" | "token_invalid" | "permission_denied" | "session_not_found" | "session_already_exists" | "mode_not_supported" | "stream_error" | "timeout";
|
|
314
|
-
/** @enum {string} */
|
|
315
|
-
EventSource: "agent" | "daemon";
|
|
316
|
-
EventsQuery: {
|
|
317
|
-
includeRaw?: boolean | null;
|
|
318
|
-
/** Format: int64 */
|
|
319
|
-
limit?: number | null;
|
|
320
|
-
/** Format: int64 */
|
|
321
|
-
offset?: number | null;
|
|
322
|
-
};
|
|
323
|
-
EventsResponse: {
|
|
324
|
-
events: components["schemas"]["UniversalEvent"][];
|
|
325
|
-
hasMore: boolean;
|
|
326
|
-
};
|
|
327
87
|
/** @enum {string} */
|
|
328
|
-
|
|
88
|
+
ErrorType: "invalid_request" | "conflict" | "unsupported_agent" | "agent_not_installed" | "install_failed" | "agent_process_exited" | "token_invalid" | "permission_denied" | "not_acceptable" | "unsupported_media_type" | "session_not_found" | "session_already_exists" | "mode_not_supported" | "stream_error" | "timeout";
|
|
329
89
|
FsActionResponse: {
|
|
330
90
|
path: string;
|
|
331
91
|
};
|
|
332
92
|
FsDeleteQuery: {
|
|
333
93
|
path: string;
|
|
334
94
|
recursive?: boolean | null;
|
|
335
|
-
sessionId?: string | null;
|
|
336
95
|
};
|
|
337
96
|
FsEntriesQuery: {
|
|
338
97
|
path?: string | null;
|
|
339
|
-
sessionId?: string | null;
|
|
340
98
|
};
|
|
341
99
|
FsEntry: {
|
|
342
100
|
entryType: components["schemas"]["FsEntryType"];
|
|
@@ -359,10 +117,6 @@ interface components {
|
|
|
359
117
|
};
|
|
360
118
|
FsPathQuery: {
|
|
361
119
|
path: string;
|
|
362
|
-
sessionId?: string | null;
|
|
363
|
-
};
|
|
364
|
-
FsSessionQuery: {
|
|
365
|
-
sessionId?: string | null;
|
|
366
120
|
};
|
|
367
121
|
FsStat: {
|
|
368
122
|
entryType: components["schemas"]["FsEntryType"];
|
|
@@ -373,7 +127,6 @@ interface components {
|
|
|
373
127
|
};
|
|
374
128
|
FsUploadBatchQuery: {
|
|
375
129
|
path?: string | null;
|
|
376
|
-
sessionId?: string | null;
|
|
377
130
|
};
|
|
378
131
|
FsUploadBatchResponse: {
|
|
379
132
|
paths: string[];
|
|
@@ -387,32 +140,13 @@ interface components {
|
|
|
387
140
|
HealthResponse: {
|
|
388
141
|
status: string;
|
|
389
142
|
};
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
native_item_id?: string | null;
|
|
394
|
-
};
|
|
395
|
-
ItemEventData: {
|
|
396
|
-
item: components["schemas"]["UniversalItem"];
|
|
143
|
+
McpConfigQuery: {
|
|
144
|
+
directory: string;
|
|
145
|
+
mcpName: string;
|
|
397
146
|
};
|
|
398
|
-
/** @enum {string} */
|
|
399
|
-
ItemKind: "message" | "tool_call" | "tool_result" | "system" | "status" | "unknown";
|
|
400
|
-
/** @enum {string} */
|
|
401
|
-
ItemRole: "user" | "assistant" | "system" | "tool";
|
|
402
|
-
/** @enum {string} */
|
|
403
|
-
ItemStatus: "in_progress" | "completed" | "failed";
|
|
404
|
-
McpCommand: string | string[];
|
|
405
|
-
McpOAuthConfig: {
|
|
406
|
-
clientId?: string | null;
|
|
407
|
-
clientSecret?: string | null;
|
|
408
|
-
scope?: string | null;
|
|
409
|
-
};
|
|
410
|
-
McpOAuthConfigOrDisabled: components["schemas"]["McpOAuthConfig"] | boolean;
|
|
411
|
-
/** @enum {string} */
|
|
412
|
-
McpRemoteTransport: "http" | "sse";
|
|
413
147
|
McpServerConfig: ({
|
|
414
148
|
args?: string[];
|
|
415
|
-
command:
|
|
149
|
+
command: string;
|
|
416
150
|
cwd?: string | null;
|
|
417
151
|
enabled?: boolean | null;
|
|
418
152
|
env?: {
|
|
@@ -431,36 +165,14 @@ interface components {
|
|
|
431
165
|
headers?: {
|
|
432
166
|
[key: string]: string;
|
|
433
167
|
} | null;
|
|
434
|
-
oauth?:
|
|
168
|
+
oauth?: Record<string, unknown> | null | null;
|
|
435
169
|
/** Format: int64 */
|
|
436
170
|
timeoutMs?: number | null;
|
|
437
|
-
transport?:
|
|
171
|
+
transport?: string | null;
|
|
438
172
|
/** @enum {string} */
|
|
439
173
|
type: "remote";
|
|
440
174
|
url: string;
|
|
441
175
|
});
|
|
442
|
-
MessageAttachment: {
|
|
443
|
-
filename?: string | null;
|
|
444
|
-
mime?: string | null;
|
|
445
|
-
path: string;
|
|
446
|
-
};
|
|
447
|
-
MessageRequest: {
|
|
448
|
-
attachments?: components["schemas"]["MessageAttachment"][];
|
|
449
|
-
message: string;
|
|
450
|
-
};
|
|
451
|
-
PermissionEventData: {
|
|
452
|
-
action: string;
|
|
453
|
-
metadata?: unknown;
|
|
454
|
-
permission_id: string;
|
|
455
|
-
status: components["schemas"]["PermissionStatus"];
|
|
456
|
-
};
|
|
457
|
-
/** @enum {string} */
|
|
458
|
-
PermissionReply: "once" | "always" | "reject";
|
|
459
|
-
PermissionReplyRequest: {
|
|
460
|
-
reply: components["schemas"]["PermissionReply"];
|
|
461
|
-
};
|
|
462
|
-
/** @enum {string} */
|
|
463
|
-
PermissionStatus: "requested" | "accept" | "accept_for_session" | "reject";
|
|
464
176
|
ProblemDetails: {
|
|
465
177
|
detail?: string | null;
|
|
466
178
|
instance?: string | null;
|
|
@@ -470,76 +182,13 @@ interface components {
|
|
|
470
182
|
type: string;
|
|
471
183
|
[key: string]: unknown;
|
|
472
184
|
};
|
|
473
|
-
QuestionEventData: {
|
|
474
|
-
options: string[];
|
|
475
|
-
prompt: string;
|
|
476
|
-
question_id: string;
|
|
477
|
-
response?: string | null;
|
|
478
|
-
status: components["schemas"]["QuestionStatus"];
|
|
479
|
-
};
|
|
480
|
-
QuestionReplyRequest: {
|
|
481
|
-
answers: string[][];
|
|
482
|
-
};
|
|
483
|
-
/** @enum {string} */
|
|
484
|
-
QuestionStatus: "requested" | "answered" | "rejected";
|
|
485
185
|
/** @enum {string} */
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* @description Status of a shared server process for an agent
|
|
489
|
-
* @enum {string}
|
|
490
|
-
*/
|
|
491
|
-
ServerStatus: "running" | "stopped" | "error";
|
|
186
|
+
ServerStatus: "running" | "stopped";
|
|
492
187
|
ServerStatusInfo: {
|
|
493
|
-
baseUrl?: string | null;
|
|
494
|
-
lastError?: string | null;
|
|
495
|
-
/** Format: int64 */
|
|
496
|
-
restartCount: number;
|
|
497
188
|
status: components["schemas"]["ServerStatus"];
|
|
498
189
|
/** Format: int64 */
|
|
499
190
|
uptimeMs?: number | null;
|
|
500
191
|
};
|
|
501
|
-
/** @enum {string} */
|
|
502
|
-
SessionEndReason: "completed" | "error" | "terminated";
|
|
503
|
-
SessionEndedData: {
|
|
504
|
-
/**
|
|
505
|
-
* Format: int32
|
|
506
|
-
* @description Process exit code when reason is Error
|
|
507
|
-
*/
|
|
508
|
-
exit_code?: number | null;
|
|
509
|
-
/** @description Error message when reason is Error */
|
|
510
|
-
message?: string | null;
|
|
511
|
-
reason: components["schemas"]["SessionEndReason"];
|
|
512
|
-
stderr?: components["schemas"]["StderrOutput"] | null;
|
|
513
|
-
terminated_by: components["schemas"]["TerminatedBy"];
|
|
514
|
-
};
|
|
515
|
-
SessionInfo: {
|
|
516
|
-
agent: string;
|
|
517
|
-
agentMode: string;
|
|
518
|
-
/** Format: int64 */
|
|
519
|
-
createdAt: number;
|
|
520
|
-
directory?: string | null;
|
|
521
|
-
ended: boolean;
|
|
522
|
-
/** Format: int64 */
|
|
523
|
-
eventCount: number;
|
|
524
|
-
mcp?: {
|
|
525
|
-
[key: string]: components["schemas"]["McpServerConfig"];
|
|
526
|
-
} | null;
|
|
527
|
-
model?: string | null;
|
|
528
|
-
nativeSessionId?: string | null;
|
|
529
|
-
permissionMode: string;
|
|
530
|
-
sessionId: string;
|
|
531
|
-
skills?: components["schemas"]["SkillsConfig"] | null;
|
|
532
|
-
title?: string | null;
|
|
533
|
-
/** Format: int64 */
|
|
534
|
-
updatedAt: number;
|
|
535
|
-
variant?: string | null;
|
|
536
|
-
};
|
|
537
|
-
SessionListResponse: {
|
|
538
|
-
sessions: components["schemas"]["SessionInfo"][];
|
|
539
|
-
};
|
|
540
|
-
SessionStartedData: {
|
|
541
|
-
metadata?: unknown;
|
|
542
|
-
};
|
|
543
192
|
SkillSource: {
|
|
544
193
|
ref?: string | null;
|
|
545
194
|
skills?: string[] | null;
|
|
@@ -550,52 +199,9 @@ interface components {
|
|
|
550
199
|
SkillsConfig: {
|
|
551
200
|
sources: components["schemas"]["SkillSource"][];
|
|
552
201
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
/** @description Last N lines of stderr (only present if truncated) */
|
|
557
|
-
tail?: string | null;
|
|
558
|
-
/** @description Total number of lines in stderr */
|
|
559
|
-
total_lines?: number | null;
|
|
560
|
-
/** @description Whether the output was truncated */
|
|
561
|
-
truncated: boolean;
|
|
562
|
-
};
|
|
563
|
-
/** @enum {string} */
|
|
564
|
-
TerminatedBy: "agent" | "daemon";
|
|
565
|
-
TurnEventData: {
|
|
566
|
-
metadata?: unknown;
|
|
567
|
-
phase: components["schemas"]["TurnPhase"];
|
|
568
|
-
turn_id?: string | null;
|
|
569
|
-
};
|
|
570
|
-
/** @enum {string} */
|
|
571
|
-
TurnPhase: "started" | "ended";
|
|
572
|
-
TurnStreamQuery: {
|
|
573
|
-
includeRaw?: boolean | null;
|
|
574
|
-
};
|
|
575
|
-
UniversalEvent: {
|
|
576
|
-
data: components["schemas"]["UniversalEventData"];
|
|
577
|
-
event_id: string;
|
|
578
|
-
native_session_id?: string | null;
|
|
579
|
-
raw?: unknown;
|
|
580
|
-
/** Format: int64 */
|
|
581
|
-
sequence: number;
|
|
582
|
-
session_id: string;
|
|
583
|
-
source: components["schemas"]["EventSource"];
|
|
584
|
-
synthetic: boolean;
|
|
585
|
-
time: string;
|
|
586
|
-
type: components["schemas"]["UniversalEventType"];
|
|
587
|
-
};
|
|
588
|
-
UniversalEventData: components["schemas"]["TurnEventData"] | components["schemas"]["SessionStartedData"] | components["schemas"]["SessionEndedData"] | components["schemas"]["ItemEventData"] | components["schemas"]["ItemDeltaData"] | components["schemas"]["ErrorData"] | components["schemas"]["PermissionEventData"] | components["schemas"]["QuestionEventData"] | components["schemas"]["AgentUnparsedData"];
|
|
589
|
-
/** @enum {string} */
|
|
590
|
-
UniversalEventType: "session.started" | "session.ended" | "turn.started" | "turn.ended" | "item.started" | "item.delta" | "item.completed" | "error" | "permission.requested" | "permission.resolved" | "question.requested" | "question.resolved" | "agent.unparsed";
|
|
591
|
-
UniversalItem: {
|
|
592
|
-
content: components["schemas"]["ContentPart"][];
|
|
593
|
-
item_id: string;
|
|
594
|
-
kind: components["schemas"]["ItemKind"];
|
|
595
|
-
native_item_id?: string | null;
|
|
596
|
-
parent_id?: string | null;
|
|
597
|
-
role?: components["schemas"]["ItemRole"] | null;
|
|
598
|
-
status: components["schemas"]["ItemStatus"];
|
|
202
|
+
SkillsConfigQuery: {
|
|
203
|
+
directory: string;
|
|
204
|
+
skillName: string;
|
|
599
205
|
};
|
|
600
206
|
};
|
|
601
207
|
responses: never;
|
|
@@ -605,39 +211,26 @@ interface components {
|
|
|
605
211
|
pathItems: never;
|
|
606
212
|
}
|
|
607
213
|
interface operations {
|
|
608
|
-
|
|
609
|
-
* List Agents
|
|
610
|
-
* @description Returns all available coding agents and their installation status.
|
|
611
|
-
*/
|
|
612
|
-
list_agents: {
|
|
214
|
+
get_v1_acp_servers: {
|
|
613
215
|
responses: {
|
|
614
|
-
/** @description
|
|
216
|
+
/** @description Active ACP server instances */
|
|
615
217
|
200: {
|
|
616
218
|
content: {
|
|
617
|
-
"application/json": components["schemas"]["
|
|
219
|
+
"application/json": components["schemas"]["AcpServerListResponse"];
|
|
618
220
|
};
|
|
619
221
|
};
|
|
620
222
|
};
|
|
621
223
|
};
|
|
622
|
-
|
|
623
|
-
* Install Agent
|
|
624
|
-
* @description Installs or updates a coding agent (e.g. claude, codex, opencode, amp).
|
|
625
|
-
*/
|
|
626
|
-
install_agent: {
|
|
224
|
+
get_v1_acp: {
|
|
627
225
|
parameters: {
|
|
628
226
|
path: {
|
|
629
|
-
/** @description
|
|
630
|
-
|
|
631
|
-
};
|
|
632
|
-
};
|
|
633
|
-
requestBody: {
|
|
634
|
-
content: {
|
|
635
|
-
"application/json": components["schemas"]["AgentInstallRequest"];
|
|
227
|
+
/** @description Client-defined ACP server id */
|
|
228
|
+
server_id: string;
|
|
636
229
|
};
|
|
637
230
|
};
|
|
638
231
|
responses: {
|
|
639
|
-
/** @description
|
|
640
|
-
|
|
232
|
+
/** @description SSE stream of ACP envelopes */
|
|
233
|
+
200: {
|
|
641
234
|
content: never;
|
|
642
235
|
};
|
|
643
236
|
/** @description Invalid request */
|
|
@@ -646,686 +239,709 @@ interface operations {
|
|
|
646
239
|
"application/json": components["schemas"]["ProblemDetails"];
|
|
647
240
|
};
|
|
648
241
|
};
|
|
649
|
-
/** @description
|
|
242
|
+
/** @description Unknown ACP server */
|
|
650
243
|
404: {
|
|
651
244
|
content: {
|
|
652
245
|
"application/json": components["schemas"]["ProblemDetails"];
|
|
653
246
|
};
|
|
654
247
|
};
|
|
655
|
-
/** @description
|
|
656
|
-
|
|
248
|
+
/** @description Client does not accept SSE responses */
|
|
249
|
+
406: {
|
|
657
250
|
content: {
|
|
658
251
|
"application/json": components["schemas"]["ProblemDetails"];
|
|
659
252
|
};
|
|
660
253
|
};
|
|
661
254
|
};
|
|
662
255
|
};
|
|
663
|
-
|
|
664
|
-
* List Agent Models
|
|
665
|
-
* @description Returns the available LLM models for an agent.
|
|
666
|
-
*/
|
|
667
|
-
get_agent_models: {
|
|
256
|
+
post_v1_acp: {
|
|
668
257
|
parameters: {
|
|
258
|
+
query?: {
|
|
259
|
+
/** @description Agent id required for first POST */
|
|
260
|
+
agent?: string | null;
|
|
261
|
+
};
|
|
669
262
|
path: {
|
|
670
|
-
/** @description
|
|
671
|
-
|
|
263
|
+
/** @description Client-defined ACP server id */
|
|
264
|
+
server_id: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
requestBody: {
|
|
268
|
+
content: {
|
|
269
|
+
"application/json": components["schemas"]["AcpEnvelope"];
|
|
672
270
|
};
|
|
673
271
|
};
|
|
674
272
|
responses: {
|
|
675
|
-
/** @description
|
|
273
|
+
/** @description JSON-RPC response envelope */
|
|
676
274
|
200: {
|
|
677
275
|
content: {
|
|
678
|
-
"application/json": components["schemas"]["
|
|
276
|
+
"application/json": components["schemas"]["AcpEnvelope"];
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
/** @description JSON-RPC notification accepted */
|
|
280
|
+
202: {
|
|
281
|
+
content: never;
|
|
282
|
+
};
|
|
283
|
+
/** @description Invalid ACP envelope */
|
|
284
|
+
400: {
|
|
285
|
+
content: {
|
|
286
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
679
287
|
};
|
|
680
288
|
};
|
|
681
|
-
/** @description
|
|
289
|
+
/** @description Unknown ACP server */
|
|
682
290
|
404: {
|
|
683
291
|
content: {
|
|
684
292
|
"application/json": components["schemas"]["ProblemDetails"];
|
|
685
293
|
};
|
|
686
294
|
};
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
*/
|
|
693
|
-
get_agent_modes: {
|
|
694
|
-
parameters: {
|
|
695
|
-
path: {
|
|
696
|
-
/** @description Agent id */
|
|
697
|
-
agent: string;
|
|
295
|
+
/** @description Client does not accept JSON responses */
|
|
296
|
+
406: {
|
|
297
|
+
content: {
|
|
298
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
299
|
+
};
|
|
698
300
|
};
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
/** @description Available modes */
|
|
702
|
-
200: {
|
|
301
|
+
/** @description ACP server bound to different agent */
|
|
302
|
+
409: {
|
|
703
303
|
content: {
|
|
704
|
-
"application/json": components["schemas"]["
|
|
304
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
705
305
|
};
|
|
706
306
|
};
|
|
707
|
-
/** @description
|
|
708
|
-
|
|
307
|
+
/** @description Unsupported media type */
|
|
308
|
+
415: {
|
|
309
|
+
content: {
|
|
310
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
/** @description ACP agent process response timeout */
|
|
314
|
+
504: {
|
|
709
315
|
content: {
|
|
710
316
|
"application/json": components["schemas"]["ProblemDetails"];
|
|
711
317
|
};
|
|
712
318
|
};
|
|
713
319
|
};
|
|
714
320
|
};
|
|
715
|
-
|
|
716
|
-
* List Directory
|
|
717
|
-
* @description Lists files and directories at the given path.
|
|
718
|
-
*/
|
|
719
|
-
fs_entries: {
|
|
321
|
+
delete_v1_acp: {
|
|
720
322
|
parameters: {
|
|
721
|
-
|
|
722
|
-
/** @description
|
|
723
|
-
|
|
724
|
-
/** @description Session id for relative paths */
|
|
725
|
-
session_id?: string | null;
|
|
323
|
+
path: {
|
|
324
|
+
/** @description Client-defined ACP server id */
|
|
325
|
+
server_id: string;
|
|
726
326
|
};
|
|
727
327
|
};
|
|
728
328
|
responses: {
|
|
729
|
-
/** @description
|
|
730
|
-
|
|
731
|
-
content:
|
|
732
|
-
"application/json": components["schemas"]["FsEntry"][];
|
|
733
|
-
};
|
|
329
|
+
/** @description ACP server closed */
|
|
330
|
+
204: {
|
|
331
|
+
content: never;
|
|
734
332
|
};
|
|
735
333
|
};
|
|
736
334
|
};
|
|
737
|
-
|
|
738
|
-
* Delete Entry
|
|
739
|
-
* @description Deletes a file or directory.
|
|
740
|
-
*/
|
|
741
|
-
fs_delete_entry: {
|
|
335
|
+
get_v1_agents: {
|
|
742
336
|
parameters: {
|
|
743
|
-
query
|
|
744
|
-
/** @description
|
|
745
|
-
|
|
746
|
-
/** @description
|
|
747
|
-
|
|
748
|
-
/** @description Delete directories recursively */
|
|
749
|
-
recursive?: boolean | null;
|
|
337
|
+
query?: {
|
|
338
|
+
/** @description When true, include version/path/configOptions (slower) */
|
|
339
|
+
config?: boolean | null;
|
|
340
|
+
/** @description When true, bypass version cache */
|
|
341
|
+
no_cache?: boolean | null;
|
|
750
342
|
};
|
|
751
343
|
};
|
|
752
344
|
responses: {
|
|
753
|
-
/** @description
|
|
345
|
+
/** @description List of v1 agents */
|
|
754
346
|
200: {
|
|
755
347
|
content: {
|
|
756
|
-
"application/json": components["schemas"]["
|
|
348
|
+
"application/json": components["schemas"]["AgentListResponse"];
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
/** @description Authentication required */
|
|
352
|
+
401: {
|
|
353
|
+
content: {
|
|
354
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
757
355
|
};
|
|
758
356
|
};
|
|
759
357
|
};
|
|
760
358
|
};
|
|
761
|
-
|
|
762
|
-
* Read File
|
|
763
|
-
* @description Reads the raw bytes of a file.
|
|
764
|
-
*/
|
|
765
|
-
fs_read_file: {
|
|
359
|
+
get_v1_agent: {
|
|
766
360
|
parameters: {
|
|
767
|
-
query
|
|
768
|
-
/** @description
|
|
769
|
-
|
|
770
|
-
/** @description
|
|
771
|
-
|
|
361
|
+
query?: {
|
|
362
|
+
/** @description When true, include version/path/configOptions (slower) */
|
|
363
|
+
config?: boolean | null;
|
|
364
|
+
/** @description When true, bypass version cache */
|
|
365
|
+
no_cache?: boolean | null;
|
|
366
|
+
};
|
|
367
|
+
path: {
|
|
368
|
+
/** @description Agent id */
|
|
369
|
+
agent: string;
|
|
772
370
|
};
|
|
773
371
|
};
|
|
774
372
|
responses: {
|
|
775
|
-
/** @description
|
|
373
|
+
/** @description Agent info */
|
|
776
374
|
200: {
|
|
777
375
|
content: {
|
|
778
|
-
"application/
|
|
376
|
+
"application/json": components["schemas"]["AgentInfo"];
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
/** @description Unknown agent */
|
|
380
|
+
400: {
|
|
381
|
+
content: {
|
|
382
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
/** @description Authentication required */
|
|
386
|
+
401: {
|
|
387
|
+
content: {
|
|
388
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
779
389
|
};
|
|
780
390
|
};
|
|
781
391
|
};
|
|
782
392
|
};
|
|
783
|
-
|
|
784
|
-
* Write File
|
|
785
|
-
* @description Writes raw bytes to a file, creating it if it doesn't exist.
|
|
786
|
-
*/
|
|
787
|
-
fs_write_file: {
|
|
393
|
+
post_v1_agent_install: {
|
|
788
394
|
parameters: {
|
|
789
|
-
|
|
790
|
-
/** @description
|
|
791
|
-
|
|
792
|
-
/** @description Session id for relative paths */
|
|
793
|
-
session_id?: string | null;
|
|
395
|
+
path: {
|
|
396
|
+
/** @description Agent id */
|
|
397
|
+
agent: string;
|
|
794
398
|
};
|
|
795
399
|
};
|
|
796
400
|
requestBody: {
|
|
797
401
|
content: {
|
|
798
|
-
"application/
|
|
402
|
+
"application/json": components["schemas"]["AgentInstallRequest"];
|
|
799
403
|
};
|
|
800
404
|
};
|
|
801
405
|
responses: {
|
|
802
|
-
/** @description
|
|
406
|
+
/** @description Agent install result */
|
|
803
407
|
200: {
|
|
804
408
|
content: {
|
|
805
|
-
"application/json": components["schemas"]["
|
|
409
|
+
"application/json": components["schemas"]["AgentInstallResponse"];
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
/** @description Invalid request */
|
|
413
|
+
400: {
|
|
414
|
+
content: {
|
|
415
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
/** @description Install failed */
|
|
419
|
+
500: {
|
|
420
|
+
content: {
|
|
421
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
806
422
|
};
|
|
807
423
|
};
|
|
808
424
|
};
|
|
809
425
|
};
|
|
810
|
-
|
|
811
|
-
* Create Directory
|
|
812
|
-
* @description Creates a directory, including any missing parent directories.
|
|
813
|
-
*/
|
|
814
|
-
fs_mkdir: {
|
|
426
|
+
get_v1_config_mcp: {
|
|
815
427
|
parameters: {
|
|
816
428
|
query: {
|
|
817
|
-
/** @description
|
|
818
|
-
|
|
819
|
-
/** @description
|
|
820
|
-
|
|
429
|
+
/** @description Target directory */
|
|
430
|
+
directory: string;
|
|
431
|
+
/** @description MCP entry name */
|
|
432
|
+
mcpName: string;
|
|
821
433
|
};
|
|
822
434
|
};
|
|
823
435
|
responses: {
|
|
824
|
-
/** @description
|
|
436
|
+
/** @description MCP entry */
|
|
825
437
|
200: {
|
|
826
438
|
content: {
|
|
827
|
-
"application/json": components["schemas"]["
|
|
439
|
+
"application/json": components["schemas"]["McpServerConfig"];
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
/** @description Entry not found */
|
|
443
|
+
404: {
|
|
444
|
+
content: {
|
|
445
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
828
446
|
};
|
|
829
447
|
};
|
|
830
448
|
};
|
|
831
449
|
};
|
|
832
|
-
|
|
833
|
-
* Move Entry
|
|
834
|
-
* @description Moves or renames a file or directory.
|
|
835
|
-
*/
|
|
836
|
-
fs_move: {
|
|
450
|
+
put_v1_config_mcp: {
|
|
837
451
|
parameters: {
|
|
838
|
-
query
|
|
839
|
-
/** @description
|
|
840
|
-
|
|
452
|
+
query: {
|
|
453
|
+
/** @description Target directory */
|
|
454
|
+
directory: string;
|
|
455
|
+
/** @description MCP entry name */
|
|
456
|
+
mcpName: string;
|
|
841
457
|
};
|
|
842
458
|
};
|
|
843
459
|
requestBody: {
|
|
844
460
|
content: {
|
|
845
|
-
"application/json": components["schemas"]["
|
|
461
|
+
"application/json": components["schemas"]["McpServerConfig"];
|
|
846
462
|
};
|
|
847
463
|
};
|
|
848
464
|
responses: {
|
|
849
|
-
/** @description
|
|
850
|
-
|
|
851
|
-
content:
|
|
852
|
-
"application/json": components["schemas"]["FsMoveResponse"];
|
|
853
|
-
};
|
|
465
|
+
/** @description Stored */
|
|
466
|
+
204: {
|
|
467
|
+
content: never;
|
|
854
468
|
};
|
|
855
469
|
};
|
|
856
470
|
};
|
|
857
|
-
|
|
858
|
-
* Get File Info
|
|
859
|
-
* @description Returns metadata (size, timestamps, type) for a path.
|
|
860
|
-
*/
|
|
861
|
-
fs_stat: {
|
|
471
|
+
delete_v1_config_mcp: {
|
|
862
472
|
parameters: {
|
|
863
473
|
query: {
|
|
864
|
-
/** @description
|
|
865
|
-
|
|
866
|
-
/** @description
|
|
867
|
-
|
|
474
|
+
/** @description Target directory */
|
|
475
|
+
directory: string;
|
|
476
|
+
/** @description MCP entry name */
|
|
477
|
+
mcpName: string;
|
|
868
478
|
};
|
|
869
479
|
};
|
|
870
480
|
responses: {
|
|
871
|
-
/** @description
|
|
872
|
-
|
|
873
|
-
content:
|
|
874
|
-
"application/json": components["schemas"]["FsStat"];
|
|
875
|
-
};
|
|
481
|
+
/** @description Deleted */
|
|
482
|
+
204: {
|
|
483
|
+
content: never;
|
|
876
484
|
};
|
|
877
485
|
};
|
|
878
486
|
};
|
|
879
|
-
|
|
880
|
-
* Upload Files
|
|
881
|
-
* @description Uploads a tar.gz archive and extracts it to the destination directory.
|
|
882
|
-
*/
|
|
883
|
-
fs_upload_batch: {
|
|
487
|
+
get_v1_config_skills: {
|
|
884
488
|
parameters: {
|
|
885
|
-
query
|
|
886
|
-
/** @description
|
|
887
|
-
|
|
888
|
-
/** @description
|
|
889
|
-
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
|
-
requestBody: {
|
|
893
|
-
content: {
|
|
894
|
-
"application/octet-stream": string;
|
|
895
|
-
};
|
|
896
|
-
};
|
|
897
|
-
responses: {
|
|
898
|
-
/** @description Upload result */
|
|
899
|
-
200: {
|
|
900
|
-
content: {
|
|
901
|
-
"application/json": components["schemas"]["FsUploadBatchResponse"];
|
|
902
|
-
};
|
|
489
|
+
query: {
|
|
490
|
+
/** @description Target directory */
|
|
491
|
+
directory: string;
|
|
492
|
+
/** @description Skill entry name */
|
|
493
|
+
skillName: string;
|
|
903
494
|
};
|
|
904
495
|
};
|
|
905
|
-
};
|
|
906
|
-
/**
|
|
907
|
-
* Health Check
|
|
908
|
-
* @description Returns the server health status.
|
|
909
|
-
*/
|
|
910
|
-
get_health: {
|
|
911
496
|
responses: {
|
|
912
|
-
/** @description
|
|
497
|
+
/** @description Skills entry */
|
|
913
498
|
200: {
|
|
914
499
|
content: {
|
|
915
|
-
"application/json": components["schemas"]["
|
|
500
|
+
"application/json": components["schemas"]["SkillsConfig"];
|
|
916
501
|
};
|
|
917
502
|
};
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* List Sessions
|
|
922
|
-
* @description Returns all active sessions.
|
|
923
|
-
*/
|
|
924
|
-
list_sessions: {
|
|
925
|
-
responses: {
|
|
926
|
-
/** @description List of active sessions */
|
|
927
|
-
200: {
|
|
503
|
+
/** @description Entry not found */
|
|
504
|
+
404: {
|
|
928
505
|
content: {
|
|
929
|
-
"application/json": components["schemas"]["
|
|
506
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
930
507
|
};
|
|
931
508
|
};
|
|
932
509
|
};
|
|
933
510
|
};
|
|
934
|
-
|
|
935
|
-
* Create Session
|
|
936
|
-
* @description Creates a new agent session with the given configuration.
|
|
937
|
-
*/
|
|
938
|
-
create_session: {
|
|
511
|
+
put_v1_config_skills: {
|
|
939
512
|
parameters: {
|
|
940
|
-
|
|
941
|
-
/** @description
|
|
942
|
-
|
|
513
|
+
query: {
|
|
514
|
+
/** @description Target directory */
|
|
515
|
+
directory: string;
|
|
516
|
+
/** @description Skill entry name */
|
|
517
|
+
skillName: string;
|
|
943
518
|
};
|
|
944
519
|
};
|
|
945
520
|
requestBody: {
|
|
946
521
|
content: {
|
|
947
|
-
"application/json": components["schemas"]["
|
|
522
|
+
"application/json": components["schemas"]["SkillsConfig"];
|
|
948
523
|
};
|
|
949
524
|
};
|
|
950
525
|
responses: {
|
|
951
|
-
/** @description
|
|
952
|
-
|
|
953
|
-
content:
|
|
954
|
-
"application/json": components["schemas"]["CreateSessionResponse"];
|
|
955
|
-
};
|
|
526
|
+
/** @description Stored */
|
|
527
|
+
204: {
|
|
528
|
+
content: never;
|
|
956
529
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
delete_v1_config_skills: {
|
|
533
|
+
parameters: {
|
|
534
|
+
query: {
|
|
535
|
+
/** @description Target directory */
|
|
536
|
+
directory: string;
|
|
537
|
+
/** @description Skill entry name */
|
|
538
|
+
skillName: string;
|
|
962
539
|
};
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
540
|
+
};
|
|
541
|
+
responses: {
|
|
542
|
+
/** @description Deleted */
|
|
543
|
+
204: {
|
|
544
|
+
content: never;
|
|
968
545
|
};
|
|
969
546
|
};
|
|
970
547
|
};
|
|
971
|
-
|
|
972
|
-
* Get Events
|
|
973
|
-
* @description Returns session events with optional offset-based pagination.
|
|
974
|
-
*/
|
|
975
|
-
get_events: {
|
|
548
|
+
get_v1_fs_entries: {
|
|
976
549
|
parameters: {
|
|
977
550
|
query?: {
|
|
978
|
-
/** @description
|
|
979
|
-
|
|
980
|
-
/** @description Max events to return */
|
|
981
|
-
limit?: number | null;
|
|
982
|
-
/** @description Include raw provider payloads */
|
|
983
|
-
include_raw?: boolean | null;
|
|
984
|
-
};
|
|
985
|
-
path: {
|
|
986
|
-
/** @description Session id */
|
|
987
|
-
session_id: string;
|
|
551
|
+
/** @description Directory path */
|
|
552
|
+
path?: string | null;
|
|
988
553
|
};
|
|
989
554
|
};
|
|
990
555
|
responses: {
|
|
991
|
-
/** @description
|
|
556
|
+
/** @description Directory entries */
|
|
992
557
|
200: {
|
|
993
558
|
content: {
|
|
994
|
-
"application/json": components["schemas"]["
|
|
559
|
+
"application/json": components["schemas"]["FsEntry"][];
|
|
995
560
|
};
|
|
996
561
|
};
|
|
997
|
-
|
|
998
|
-
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
delete_v1_fs_entry: {
|
|
565
|
+
parameters: {
|
|
566
|
+
query: {
|
|
567
|
+
/** @description File or directory path */
|
|
568
|
+
path: string;
|
|
569
|
+
/** @description Delete directory recursively */
|
|
570
|
+
recursive?: boolean | null;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
responses: {
|
|
574
|
+
/** @description Delete result */
|
|
575
|
+
200: {
|
|
999
576
|
content: {
|
|
1000
|
-
"application/json": components["schemas"]["
|
|
577
|
+
"application/json": components["schemas"]["FsActionResponse"];
|
|
1001
578
|
};
|
|
1002
579
|
};
|
|
1003
580
|
};
|
|
1004
581
|
};
|
|
1005
|
-
|
|
1006
|
-
* Subscribe to Events (SSE)
|
|
1007
|
-
* @description Opens an SSE stream for real-time session events.
|
|
1008
|
-
*/
|
|
1009
|
-
get_events_sse: {
|
|
582
|
+
get_v1_fs_file: {
|
|
1010
583
|
parameters: {
|
|
1011
|
-
query
|
|
1012
|
-
/** @description
|
|
1013
|
-
|
|
1014
|
-
/** @description Include raw provider payloads */
|
|
1015
|
-
include_raw?: boolean | null;
|
|
1016
|
-
};
|
|
1017
|
-
path: {
|
|
1018
|
-
/** @description Session id */
|
|
1019
|
-
session_id: string;
|
|
584
|
+
query: {
|
|
585
|
+
/** @description File path */
|
|
586
|
+
path: string;
|
|
1020
587
|
};
|
|
1021
588
|
};
|
|
1022
589
|
responses: {
|
|
1023
|
-
/** @description
|
|
590
|
+
/** @description File content */
|
|
1024
591
|
200: {
|
|
1025
592
|
content: never;
|
|
1026
593
|
};
|
|
1027
594
|
};
|
|
1028
595
|
};
|
|
1029
|
-
|
|
1030
|
-
* Send Message
|
|
1031
|
-
* @description Sends a message to a session and returns immediately.
|
|
1032
|
-
*/
|
|
1033
|
-
post_message: {
|
|
596
|
+
put_v1_fs_file: {
|
|
1034
597
|
parameters: {
|
|
1035
|
-
|
|
1036
|
-
/** @description
|
|
1037
|
-
|
|
598
|
+
query: {
|
|
599
|
+
/** @description File path */
|
|
600
|
+
path: string;
|
|
1038
601
|
};
|
|
1039
602
|
};
|
|
603
|
+
/** @description Raw file bytes */
|
|
1040
604
|
requestBody: {
|
|
1041
605
|
content: {
|
|
1042
|
-
"
|
|
606
|
+
"text/plain": string;
|
|
1043
607
|
};
|
|
1044
608
|
};
|
|
1045
609
|
responses: {
|
|
1046
|
-
/** @description
|
|
1047
|
-
|
|
1048
|
-
content: never;
|
|
1049
|
-
};
|
|
1050
|
-
/** @description Session not found */
|
|
1051
|
-
404: {
|
|
610
|
+
/** @description Write result */
|
|
611
|
+
200: {
|
|
1052
612
|
content: {
|
|
1053
|
-
"application/json": components["schemas"]["
|
|
613
|
+
"application/json": components["schemas"]["FsWriteResponse"];
|
|
1054
614
|
};
|
|
1055
615
|
};
|
|
1056
616
|
};
|
|
1057
617
|
};
|
|
1058
|
-
|
|
1059
|
-
* Send Message (Streaming)
|
|
1060
|
-
* @description Sends a message and returns an SSE event stream of the agent's response.
|
|
1061
|
-
*/
|
|
1062
|
-
post_message_stream: {
|
|
618
|
+
post_v1_fs_mkdir: {
|
|
1063
619
|
parameters: {
|
|
1064
|
-
query
|
|
1065
|
-
/** @description
|
|
1066
|
-
|
|
1067
|
-
};
|
|
1068
|
-
path: {
|
|
1069
|
-
/** @description Session id */
|
|
1070
|
-
session_id: string;
|
|
1071
|
-
};
|
|
1072
|
-
};
|
|
1073
|
-
requestBody: {
|
|
1074
|
-
content: {
|
|
1075
|
-
"application/json": components["schemas"]["MessageRequest"];
|
|
620
|
+
query: {
|
|
621
|
+
/** @description Directory path */
|
|
622
|
+
path: string;
|
|
1076
623
|
};
|
|
1077
624
|
};
|
|
1078
625
|
responses: {
|
|
1079
|
-
/** @description
|
|
626
|
+
/** @description Directory created */
|
|
1080
627
|
200: {
|
|
1081
|
-
content: never;
|
|
1082
|
-
};
|
|
1083
|
-
/** @description Session not found */
|
|
1084
|
-
404: {
|
|
1085
628
|
content: {
|
|
1086
|
-
"application/json": components["schemas"]["
|
|
629
|
+
"application/json": components["schemas"]["FsActionResponse"];
|
|
1087
630
|
};
|
|
1088
631
|
};
|
|
1089
632
|
};
|
|
1090
633
|
};
|
|
1091
|
-
|
|
1092
|
-
* Reply to Permission
|
|
1093
|
-
* @description Approves or denies a permission request from the agent.
|
|
1094
|
-
*/
|
|
1095
|
-
reply_permission: {
|
|
1096
|
-
parameters: {
|
|
1097
|
-
path: {
|
|
1098
|
-
/** @description Session id */
|
|
1099
|
-
session_id: string;
|
|
1100
|
-
/** @description Permission id */
|
|
1101
|
-
permission_id: string;
|
|
1102
|
-
};
|
|
1103
|
-
};
|
|
634
|
+
post_v1_fs_move: {
|
|
1104
635
|
requestBody: {
|
|
1105
636
|
content: {
|
|
1106
|
-
"application/json": components["schemas"]["
|
|
637
|
+
"application/json": components["schemas"]["FsMoveRequest"];
|
|
1107
638
|
};
|
|
1108
639
|
};
|
|
1109
640
|
responses: {
|
|
1110
|
-
/** @description
|
|
1111
|
-
|
|
1112
|
-
content: never;
|
|
1113
|
-
};
|
|
1114
|
-
/** @description Session or permission not found */
|
|
1115
|
-
404: {
|
|
641
|
+
/** @description Move result */
|
|
642
|
+
200: {
|
|
1116
643
|
content: {
|
|
1117
|
-
"application/json": components["schemas"]["
|
|
644
|
+
"application/json": components["schemas"]["FsMoveResponse"];
|
|
1118
645
|
};
|
|
1119
646
|
};
|
|
1120
647
|
};
|
|
1121
648
|
};
|
|
1122
|
-
|
|
1123
|
-
* Reject Question
|
|
1124
|
-
* @description Rejects a human-in-the-loop question from the agent.
|
|
1125
|
-
*/
|
|
1126
|
-
reject_question: {
|
|
649
|
+
get_v1_fs_stat: {
|
|
1127
650
|
parameters: {
|
|
1128
|
-
|
|
1129
|
-
/** @description
|
|
1130
|
-
|
|
1131
|
-
/** @description Question id */
|
|
1132
|
-
question_id: string;
|
|
651
|
+
query: {
|
|
652
|
+
/** @description Path to stat */
|
|
653
|
+
path: string;
|
|
1133
654
|
};
|
|
1134
655
|
};
|
|
1135
656
|
responses: {
|
|
1136
|
-
/** @description
|
|
1137
|
-
|
|
1138
|
-
content: never;
|
|
1139
|
-
};
|
|
1140
|
-
/** @description Session or question not found */
|
|
1141
|
-
404: {
|
|
657
|
+
/** @description Path metadata */
|
|
658
|
+
200: {
|
|
1142
659
|
content: {
|
|
1143
|
-
"application/json": components["schemas"]["
|
|
660
|
+
"application/json": components["schemas"]["FsStat"];
|
|
1144
661
|
};
|
|
1145
662
|
};
|
|
1146
663
|
};
|
|
1147
664
|
};
|
|
1148
|
-
|
|
1149
|
-
* Reply to Question
|
|
1150
|
-
* @description Replies to a human-in-the-loop question from the agent.
|
|
1151
|
-
*/
|
|
1152
|
-
reply_question: {
|
|
665
|
+
post_v1_fs_upload_batch: {
|
|
1153
666
|
parameters: {
|
|
1154
|
-
|
|
1155
|
-
/** @description
|
|
1156
|
-
|
|
1157
|
-
/** @description Question id */
|
|
1158
|
-
question_id: string;
|
|
667
|
+
query?: {
|
|
668
|
+
/** @description Destination path */
|
|
669
|
+
path?: string | null;
|
|
1159
670
|
};
|
|
1160
671
|
};
|
|
672
|
+
/** @description tar archive body */
|
|
1161
673
|
requestBody: {
|
|
1162
674
|
content: {
|
|
1163
|
-
"
|
|
675
|
+
"text/plain": string;
|
|
1164
676
|
};
|
|
1165
677
|
};
|
|
1166
678
|
responses: {
|
|
1167
|
-
/** @description
|
|
1168
|
-
|
|
1169
|
-
content: never;
|
|
1170
|
-
};
|
|
1171
|
-
/** @description Session or question not found */
|
|
1172
|
-
404: {
|
|
679
|
+
/** @description Upload/extract result */
|
|
680
|
+
200: {
|
|
1173
681
|
content: {
|
|
1174
|
-
"application/json": components["schemas"]["
|
|
682
|
+
"application/json": components["schemas"]["FsUploadBatchResponse"];
|
|
1175
683
|
};
|
|
1176
684
|
};
|
|
1177
685
|
};
|
|
1178
686
|
};
|
|
1179
|
-
|
|
1180
|
-
* Terminate Session
|
|
1181
|
-
* @description Terminates a running session and cleans up resources.
|
|
1182
|
-
*/
|
|
1183
|
-
terminate_session: {
|
|
1184
|
-
parameters: {
|
|
1185
|
-
path: {
|
|
1186
|
-
/** @description Session id */
|
|
1187
|
-
session_id: string;
|
|
1188
|
-
};
|
|
1189
|
-
};
|
|
687
|
+
get_v1_health: {
|
|
1190
688
|
responses: {
|
|
1191
|
-
/** @description
|
|
1192
|
-
|
|
1193
|
-
content: never;
|
|
1194
|
-
};
|
|
1195
|
-
/** @description Session not found */
|
|
1196
|
-
404: {
|
|
689
|
+
/** @description Service health response */
|
|
690
|
+
200: {
|
|
1197
691
|
content: {
|
|
1198
|
-
"application/json": components["schemas"]["
|
|
692
|
+
"application/json": components["schemas"]["HealthResponse"];
|
|
1199
693
|
};
|
|
1200
694
|
};
|
|
1201
695
|
};
|
|
1202
696
|
};
|
|
1203
697
|
}
|
|
1204
698
|
|
|
1205
|
-
type
|
|
1206
|
-
type
|
|
1207
|
-
type
|
|
1208
|
-
type
|
|
1209
|
-
type
|
|
1210
|
-
type
|
|
1211
|
-
type
|
|
1212
|
-
type
|
|
1213
|
-
type
|
|
1214
|
-
type
|
|
1215
|
-
type
|
|
1216
|
-
type
|
|
1217
|
-
type
|
|
1218
|
-
type
|
|
1219
|
-
type
|
|
1220
|
-
type
|
|
1221
|
-
type
|
|
1222
|
-
type
|
|
1223
|
-
type
|
|
1224
|
-
type
|
|
1225
|
-
type
|
|
1226
|
-
type
|
|
1227
|
-
type
|
|
1228
|
-
type
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
type
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
699
|
+
type ProblemDetails = components["schemas"]["ProblemDetails"];
|
|
700
|
+
type HealthResponse = JsonResponse<operations["get_v1_health"], 200>;
|
|
701
|
+
type AgentListResponse = JsonResponse<operations["get_v1_agents"], 200>;
|
|
702
|
+
type AgentInfo = components["schemas"]["AgentInfo"];
|
|
703
|
+
type AgentInstallRequest = JsonRequestBody<operations["post_v1_agent_install"]>;
|
|
704
|
+
type AgentInstallResponse = JsonResponse<operations["post_v1_agent_install"], 200>;
|
|
705
|
+
type AcpEnvelope = components["schemas"]["AcpEnvelope"];
|
|
706
|
+
type AcpServerInfo = components["schemas"]["AcpServerInfo"];
|
|
707
|
+
type AcpServerListResponse = JsonResponse<operations["get_v1_acp_servers"], 200>;
|
|
708
|
+
type FsEntriesQuery = QueryParams<operations["get_v1_fs_entries"]>;
|
|
709
|
+
type FsEntry = components["schemas"]["FsEntry"];
|
|
710
|
+
type FsPathQuery = QueryParams<operations["get_v1_fs_file"]>;
|
|
711
|
+
type FsDeleteQuery = QueryParams<operations["delete_v1_fs_entry"]>;
|
|
712
|
+
type FsUploadBatchQuery = QueryParams<operations["post_v1_fs_upload_batch"]>;
|
|
713
|
+
type FsWriteResponse = JsonResponse<operations["put_v1_fs_file"], 200>;
|
|
714
|
+
type FsActionResponse = JsonResponse<operations["delete_v1_fs_entry"], 200>;
|
|
715
|
+
type FsMoveRequest = JsonRequestBody<operations["post_v1_fs_move"]>;
|
|
716
|
+
type FsMoveResponse = JsonResponse<operations["post_v1_fs_move"], 200>;
|
|
717
|
+
type FsStat = JsonResponse<operations["get_v1_fs_stat"], 200>;
|
|
718
|
+
type FsUploadBatchResponse = JsonResponse<operations["post_v1_fs_upload_batch"], 200>;
|
|
719
|
+
type McpConfigQuery = QueryParams<operations["get_v1_config_mcp"]>;
|
|
720
|
+
type McpServerConfig = components["schemas"]["McpServerConfig"];
|
|
721
|
+
type SkillsConfigQuery = QueryParams<operations["get_v1_config_skills"]>;
|
|
722
|
+
type SkillsConfig = components["schemas"]["SkillsConfig"];
|
|
723
|
+
interface SessionRecord {
|
|
724
|
+
id: string;
|
|
725
|
+
agent: string;
|
|
726
|
+
agentSessionId: string;
|
|
727
|
+
lastConnectionId: string;
|
|
728
|
+
createdAt: number;
|
|
729
|
+
destroyedAt?: number;
|
|
730
|
+
sessionInit?: Omit<NewSessionRequest, "_meta">;
|
|
731
|
+
}
|
|
732
|
+
type SessionEventSender = "client" | "agent";
|
|
733
|
+
interface SessionEvent {
|
|
734
|
+
id: string;
|
|
735
|
+
eventIndex: number;
|
|
736
|
+
sessionId: string;
|
|
737
|
+
createdAt: number;
|
|
738
|
+
connectionId: string;
|
|
739
|
+
sender: SessionEventSender;
|
|
740
|
+
payload: AnyMessage;
|
|
741
|
+
}
|
|
742
|
+
interface ListPageRequest {
|
|
743
|
+
cursor?: string;
|
|
744
|
+
limit?: number;
|
|
745
|
+
}
|
|
746
|
+
interface ListPage<T> {
|
|
747
|
+
items: T[];
|
|
748
|
+
nextCursor?: string;
|
|
749
|
+
}
|
|
750
|
+
interface ListEventsRequest extends ListPageRequest {
|
|
751
|
+
sessionId: string;
|
|
752
|
+
}
|
|
753
|
+
interface SessionPersistDriver {
|
|
754
|
+
getSession(id: string): Promise<SessionRecord | null>;
|
|
755
|
+
listSessions(request?: ListPageRequest): Promise<ListPage<SessionRecord>>;
|
|
756
|
+
updateSession(session: SessionRecord): Promise<void>;
|
|
757
|
+
listEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
|
|
758
|
+
insertEvent(event: SessionEvent): Promise<void>;
|
|
759
|
+
}
|
|
760
|
+
interface InMemorySessionPersistDriverOptions {
|
|
761
|
+
maxSessions?: number;
|
|
762
|
+
maxEventsPerSession?: number;
|
|
763
|
+
}
|
|
764
|
+
declare class InMemorySessionPersistDriver implements SessionPersistDriver {
|
|
765
|
+
private readonly maxSessions;
|
|
766
|
+
private readonly maxEventsPerSession;
|
|
767
|
+
private readonly sessions;
|
|
768
|
+
private readonly eventsBySession;
|
|
769
|
+
constructor(options?: InMemorySessionPersistDriverOptions);
|
|
770
|
+
getSession(id: string): Promise<SessionRecord | null>;
|
|
771
|
+
listSessions(request?: ListPageRequest): Promise<ListPage<SessionRecord>>;
|
|
772
|
+
updateSession(session: SessionRecord): Promise<void>;
|
|
773
|
+
listEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
|
|
774
|
+
insertEvent(event: SessionEvent): Promise<void>;
|
|
775
|
+
}
|
|
776
|
+
type ResponsesOf<T> = T extends {
|
|
777
|
+
responses: infer R;
|
|
778
|
+
} ? R : never;
|
|
779
|
+
type JsonResponse<T, StatusCode extends keyof ResponsesOf<T>> = ResponsesOf<T>[StatusCode] extends {
|
|
780
|
+
content: {
|
|
781
|
+
"application/json": infer B;
|
|
782
|
+
};
|
|
783
|
+
} ? B : never;
|
|
784
|
+
type JsonRequestBody<T> = T extends {
|
|
785
|
+
requestBody: {
|
|
786
|
+
content: {
|
|
787
|
+
"application/json": infer B;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
} ? B : never;
|
|
791
|
+
type QueryParams<T> = T extends {
|
|
792
|
+
parameters: {
|
|
793
|
+
query: infer Q;
|
|
794
|
+
};
|
|
795
|
+
} ? Q : T extends {
|
|
796
|
+
parameters: {
|
|
797
|
+
query?: infer Q;
|
|
798
|
+
};
|
|
799
|
+
} ? Q : never;
|
|
1271
800
|
|
|
1272
801
|
interface SandboxAgentConnectOptions {
|
|
1273
802
|
baseUrl: string;
|
|
1274
803
|
token?: string;
|
|
1275
804
|
fetch?: typeof fetch;
|
|
1276
805
|
headers?: HeadersInit;
|
|
806
|
+
persist?: SessionPersistDriver;
|
|
807
|
+
replayMaxEvents?: number;
|
|
808
|
+
replayMaxChars?: number;
|
|
1277
809
|
}
|
|
1278
|
-
interface SandboxAgentStartOptions {
|
|
810
|
+
interface SandboxAgentStartOptions extends Omit<SandboxAgentConnectOptions, "baseUrl" | "token"> {
|
|
1279
811
|
spawn?: SandboxAgentSpawnOptions | boolean;
|
|
1280
|
-
fetch?: typeof fetch;
|
|
1281
|
-
headers?: HeadersInit;
|
|
1282
812
|
}
|
|
813
|
+
interface SessionCreateRequest {
|
|
814
|
+
id?: string;
|
|
815
|
+
agent: string;
|
|
816
|
+
sessionInit?: Omit<NewSessionRequest, "_meta">;
|
|
817
|
+
}
|
|
818
|
+
interface SessionResumeOrCreateRequest {
|
|
819
|
+
id: string;
|
|
820
|
+
agent: string;
|
|
821
|
+
sessionInit?: Omit<NewSessionRequest, "_meta">;
|
|
822
|
+
}
|
|
823
|
+
interface SessionSendOptions {
|
|
824
|
+
notification?: boolean;
|
|
825
|
+
}
|
|
826
|
+
type SessionEventListener = (event: SessionEvent) => void;
|
|
1283
827
|
declare class SandboxAgentError extends Error {
|
|
1284
828
|
readonly status: number;
|
|
1285
829
|
readonly problem?: ProblemDetails;
|
|
1286
830
|
readonly response: Response;
|
|
1287
831
|
constructor(status: number, problem: ProblemDetails | undefined, response: Response);
|
|
1288
832
|
}
|
|
833
|
+
declare class Session {
|
|
834
|
+
private record;
|
|
835
|
+
private readonly sandbox;
|
|
836
|
+
constructor(sandbox: SandboxAgent, record: SessionRecord);
|
|
837
|
+
get id(): string;
|
|
838
|
+
get agent(): string;
|
|
839
|
+
get agentSessionId(): string;
|
|
840
|
+
get lastConnectionId(): string;
|
|
841
|
+
get createdAt(): number;
|
|
842
|
+
get destroyedAt(): number | undefined;
|
|
843
|
+
refresh(): Promise<Session>;
|
|
844
|
+
send(method: string, params?: Record<string, unknown>, options?: SessionSendOptions): Promise<unknown>;
|
|
845
|
+
prompt(prompt: PromptRequest["prompt"]): Promise<PromptResponse>;
|
|
846
|
+
onEvent(listener: SessionEventListener): () => void;
|
|
847
|
+
toRecord(): SessionRecord;
|
|
848
|
+
apply(record: SessionRecord): void;
|
|
849
|
+
}
|
|
850
|
+
declare class LiveAcpConnection {
|
|
851
|
+
readonly connectionId: string;
|
|
852
|
+
readonly agent: string;
|
|
853
|
+
private readonly acp;
|
|
854
|
+
private readonly sessionByLocalId;
|
|
855
|
+
private readonly localByAgentSessionId;
|
|
856
|
+
private readonly pendingNewSessionLocals;
|
|
857
|
+
private readonly pendingRequestSessionById;
|
|
858
|
+
private readonly pendingReplayByLocalSessionId;
|
|
859
|
+
private readonly onObservedEnvelope;
|
|
860
|
+
private constructor();
|
|
861
|
+
static create(options: {
|
|
862
|
+
baseUrl: string;
|
|
863
|
+
token?: string;
|
|
864
|
+
fetcher: typeof fetch;
|
|
865
|
+
headers?: HeadersInit;
|
|
866
|
+
agent: string;
|
|
867
|
+
serverId: string;
|
|
868
|
+
onObservedEnvelope: (connection: LiveAcpConnection, envelope: AnyMessage, direction: AcpEnvelopeDirection, localSessionId: string | null) => void;
|
|
869
|
+
}): Promise<LiveAcpConnection>;
|
|
870
|
+
close(): Promise<void>;
|
|
871
|
+
hasBoundSession(localSessionId: string, agentSessionId?: string): boolean;
|
|
872
|
+
bindSession(localSessionId: string, agentSessionId: string): void;
|
|
873
|
+
queueReplay(localSessionId: string, replayText: string | null): void;
|
|
874
|
+
createRemoteSession(localSessionId: string, sessionInit: Omit<NewSessionRequest, "_meta">): Promise<NewSessionResponse>;
|
|
875
|
+
sendSessionMethod(localSessionId: string, method: string, params: Record<string, unknown>, options: SessionSendOptions): Promise<unknown>;
|
|
876
|
+
private handleEnvelope;
|
|
877
|
+
private resolveSessionId;
|
|
878
|
+
private localFromEnvelopeParams;
|
|
879
|
+
}
|
|
1289
880
|
declare class SandboxAgent {
|
|
1290
881
|
private readonly baseUrl;
|
|
1291
882
|
private readonly token?;
|
|
1292
883
|
private readonly fetcher;
|
|
1293
884
|
private readonly defaultHeaders?;
|
|
885
|
+
private readonly persist;
|
|
886
|
+
private readonly replayMaxEvents;
|
|
887
|
+
private readonly replayMaxChars;
|
|
1294
888
|
private spawnHandle?;
|
|
1295
|
-
private
|
|
889
|
+
private readonly liveConnections;
|
|
890
|
+
private readonly sessionHandles;
|
|
891
|
+
private readonly eventListeners;
|
|
892
|
+
private readonly nextSessionEventIndexBySession;
|
|
893
|
+
private readonly seedSessionEventIndexBySession;
|
|
894
|
+
constructor(options: SandboxAgentConnectOptions);
|
|
1296
895
|
static connect(options: SandboxAgentConnectOptions): Promise<SandboxAgent>;
|
|
1297
896
|
static start(options?: SandboxAgentStartOptions): Promise<SandboxAgent>;
|
|
1298
|
-
|
|
897
|
+
dispose(): Promise<void>;
|
|
898
|
+
listSessions(request?: ListPageRequest): Promise<ListPage<Session>>;
|
|
899
|
+
getSession(id: string): Promise<Session | null>;
|
|
900
|
+
getEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
|
|
901
|
+
createSession(request: SessionCreateRequest): Promise<Session>;
|
|
902
|
+
resumeSession(id: string): Promise<Session>;
|
|
903
|
+
resumeOrCreateSession(request: SessionResumeOrCreateRequest): Promise<Session>;
|
|
904
|
+
destroySession(id: string): Promise<Session>;
|
|
905
|
+
sendSessionMethod(sessionId: string, method: string, params: Record<string, unknown>, options?: SessionSendOptions): Promise<{
|
|
906
|
+
session: Session;
|
|
907
|
+
response: unknown;
|
|
908
|
+
}>;
|
|
909
|
+
onSessionEvent(sessionId: string, listener: SessionEventListener): () => void;
|
|
1299
910
|
getHealth(): Promise<HealthResponse>;
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
postMessageStream(sessionId: string, request: MessageRequest, query?: TurnStreamQuery, signal?: AbortSignal): Promise<Response>;
|
|
1309
|
-
streamEvents(sessionId: string, query?: EventsQuery, signal?: AbortSignal): AsyncGenerator<UniversalEvent, void, void>;
|
|
1310
|
-
streamTurn(sessionId: string, request: MessageRequest, query?: TurnStreamQuery, signal?: AbortSignal): AsyncGenerator<UniversalEvent, void, void>;
|
|
1311
|
-
replyQuestion(sessionId: string, questionId: string, request: QuestionReplyRequest): Promise<void>;
|
|
1312
|
-
rejectQuestion(sessionId: string, questionId: string): Promise<void>;
|
|
1313
|
-
replyPermission(sessionId: string, permissionId: string, request: PermissionReplyRequest): Promise<void>;
|
|
1314
|
-
terminateSession(sessionId: string): Promise<void>;
|
|
911
|
+
listAgents(options?: {
|
|
912
|
+
config?: boolean;
|
|
913
|
+
}): Promise<AgentListResponse>;
|
|
914
|
+
getAgent(agent: string, options?: {
|
|
915
|
+
config?: boolean;
|
|
916
|
+
}): Promise<AgentInfo>;
|
|
917
|
+
installAgent(agent: string, request?: AgentInstallRequest): Promise<AgentInstallResponse>;
|
|
918
|
+
listAcpServers(): Promise<AcpServerListResponse>;
|
|
1315
919
|
listFsEntries(query?: FsEntriesQuery): Promise<FsEntry[]>;
|
|
1316
920
|
readFsFile(query: FsPathQuery): Promise<Uint8Array>;
|
|
1317
921
|
writeFsFile(query: FsPathQuery, body: BodyInit): Promise<FsWriteResponse>;
|
|
1318
922
|
deleteFsEntry(query: FsDeleteQuery): Promise<FsActionResponse>;
|
|
1319
923
|
mkdirFs(query: FsPathQuery): Promise<FsActionResponse>;
|
|
1320
|
-
moveFs(request: FsMoveRequest
|
|
924
|
+
moveFs(request: FsMoveRequest): Promise<FsMoveResponse>;
|
|
1321
925
|
statFs(query: FsPathQuery): Promise<FsStat>;
|
|
1322
926
|
uploadFsBatch(body: BodyInit, query?: FsUploadBatchQuery): Promise<FsUploadBatchResponse>;
|
|
1323
|
-
|
|
927
|
+
getMcpConfig(query: McpConfigQuery): Promise<McpServerConfig>;
|
|
928
|
+
setMcpConfig(query: McpConfigQuery, config: McpServerConfig): Promise<void>;
|
|
929
|
+
deleteMcpConfig(query: McpConfigQuery): Promise<void>;
|
|
930
|
+
getSkillsConfig(query: SkillsConfigQuery): Promise<SkillsConfig>;
|
|
931
|
+
setSkillsConfig(query: SkillsConfigQuery, config: SkillsConfig): Promise<void>;
|
|
932
|
+
deleteSkillsConfig(query: SkillsConfigQuery): Promise<void>;
|
|
933
|
+
private getLiveConnection;
|
|
934
|
+
private persistObservedEnvelope;
|
|
935
|
+
private allocateSessionEventIndex;
|
|
936
|
+
private ensureSessionEventIndexSeeded;
|
|
937
|
+
private findMaxPersistedSessionEventIndex;
|
|
938
|
+
private collectReplayEvents;
|
|
939
|
+
private upsertSessionHandle;
|
|
940
|
+
private requireSessionRecord;
|
|
1324
941
|
private requestJson;
|
|
1325
942
|
private requestRaw;
|
|
943
|
+
private buildHeaders;
|
|
1326
944
|
private buildUrl;
|
|
1327
|
-
private readProblem;
|
|
1328
|
-
private parseSseStream;
|
|
1329
945
|
}
|
|
1330
946
|
|
|
1331
947
|
interface InspectorUrlOptions {
|
|
@@ -1349,4 +965,4 @@ interface InspectorUrlOptions {
|
|
|
1349
965
|
*/
|
|
1350
966
|
declare function buildInspectorUrl(options: InspectorUrlOptions): string;
|
|
1351
967
|
|
|
1352
|
-
export { type
|
|
968
|
+
export { type AcpEnvelope, type AcpServerInfo, type AcpServerListResponse, type AgentInfo, type AgentInstallRequest, type AgentInstallResponse, type AgentListResponse, type FsActionResponse, type FsDeleteQuery, type FsEntriesQuery, type FsEntry, type FsMoveRequest, type FsMoveResponse, type FsPathQuery, type FsStat, type FsUploadBatchQuery, type FsUploadBatchResponse, type FsWriteResponse, type HealthResponse, InMemorySessionPersistDriver, type InMemorySessionPersistDriverOptions, type InspectorUrlOptions, type ListEventsRequest, type ListPage, type ListPageRequest, LiveAcpConnection, type McpConfigQuery, type McpServerConfig, type ProblemDetails, SandboxAgent, type SandboxAgentConnectOptions, SandboxAgentError, type SandboxAgentSpawnLogMode, type SandboxAgentSpawnOptions, type SandboxAgentStartOptions, Session, type SessionCreateRequest, type SessionEvent, type SessionEventListener, type SessionPersistDriver, type SessionRecord, type SessionResumeOrCreateRequest, type SessionSendOptions, type SkillsConfig, type SkillsConfigQuery, buildInspectorUrl };
|