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 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
- /** @description Whether the agent's required provider credentials are available */
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
- FileAction: "read" | "write" | "patch";
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
- ItemDeltaData: {
391
- delta: string;
392
- item_id: string;
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: components["schemas"]["McpCommand"];
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?: components["schemas"]["McpOAuthConfigOrDisabled"] | null;
168
+ oauth?: Record<string, unknown> | null | null;
435
169
  /** Format: int64 */
436
170
  timeoutMs?: number | null;
437
- transport?: components["schemas"]["McpRemoteTransport"] | null;
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
- ReasoningVisibility: "public" | "private";
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
- StderrOutput: {
554
- /** @description First N lines of stderr (if truncated) or full stderr (if not truncated) */
555
- head?: string | null;
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 List of available agents */
216
+ /** @description Active ACP server instances */
615
217
  200: {
616
218
  content: {
617
- "application/json": components["schemas"]["AgentListResponse"];
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 Agent id */
630
- agent: string;
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 Agent installed */
640
- 204: {
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 Agent not found */
242
+ /** @description Unknown ACP server */
650
243
  404: {
651
244
  content: {
652
245
  "application/json": components["schemas"]["ProblemDetails"];
653
246
  };
654
247
  };
655
- /** @description Installation failed */
656
- 500: {
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 Agent id */
671
- agent: string;
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 Available models */
273
+ /** @description JSON-RPC response envelope */
676
274
  200: {
677
275
  content: {
678
- "application/json": components["schemas"]["AgentModelsResponse"];
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 Agent not found */
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
- * List Agent Modes
691
- * @description Returns the available interaction modes for an agent.
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
- responses: {
701
- /** @description Available modes */
702
- 200: {
301
+ /** @description ACP server bound to different agent */
302
+ 409: {
703
303
  content: {
704
- "application/json": components["schemas"]["AgentModesResponse"];
304
+ "application/json": components["schemas"]["ProblemDetails"];
705
305
  };
706
306
  };
707
- /** @description Invalid request */
708
- 400: {
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
- query?: {
722
- /** @description Path to list (relative or absolute) */
723
- path?: string | null;
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 Directory listing */
730
- 200: {
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 File or directory path */
745
- path: string;
746
- /** @description Session id for relative paths */
747
- session_id?: string | null;
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 Delete result */
345
+ /** @description List of v1 agents */
754
346
  200: {
755
347
  content: {
756
- "application/json": components["schemas"]["FsActionResponse"];
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 File path (relative or absolute) */
769
- path: string;
770
- /** @description Session id for relative paths */
771
- session_id?: string | null;
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 File content */
373
+ /** @description Agent info */
776
374
  200: {
777
375
  content: {
778
- "application/octet-stream": string;
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
- query: {
790
- /** @description File path (relative or absolute) */
791
- path: string;
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/octet-stream": string;
402
+ "application/json": components["schemas"]["AgentInstallRequest"];
799
403
  };
800
404
  };
801
405
  responses: {
802
- /** @description Write result */
406
+ /** @description Agent install result */
803
407
  200: {
804
408
  content: {
805
- "application/json": components["schemas"]["FsWriteResponse"];
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 Directory path to create */
818
- path: string;
819
- /** @description Session id for relative paths */
820
- session_id?: string | null;
429
+ /** @description Target directory */
430
+ directory: string;
431
+ /** @description MCP entry name */
432
+ mcpName: string;
821
433
  };
822
434
  };
823
435
  responses: {
824
- /** @description Directory created */
436
+ /** @description MCP entry */
825
437
  200: {
826
438
  content: {
827
- "application/json": components["schemas"]["FsActionResponse"];
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 Session id for relative paths */
840
- session_id?: string | null;
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"]["FsMoveRequest"];
461
+ "application/json": components["schemas"]["McpServerConfig"];
846
462
  };
847
463
  };
848
464
  responses: {
849
- /** @description Move result */
850
- 200: {
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 Path to stat */
865
- path: string;
866
- /** @description Session id for relative paths */
867
- session_id?: string | null;
474
+ /** @description Target directory */
475
+ directory: string;
476
+ /** @description MCP entry name */
477
+ mcpName: string;
868
478
  };
869
479
  };
870
480
  responses: {
871
- /** @description File metadata */
872
- 200: {
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 Destination directory for extraction */
887
- path?: string | null;
888
- /** @description Session id for relative paths */
889
- session_id?: string | null;
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 Server is healthy */
497
+ /** @description Skills entry */
913
498
  200: {
914
499
  content: {
915
- "application/json": components["schemas"]["HealthResponse"];
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"]["SessionListResponse"];
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
- path: {
941
- /** @description Client session id */
942
- session_id: string;
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"]["CreateSessionRequest"];
522
+ "application/json": components["schemas"]["SkillsConfig"];
948
523
  };
949
524
  };
950
525
  responses: {
951
- /** @description Session created */
952
- 200: {
953
- content: {
954
- "application/json": components["schemas"]["CreateSessionResponse"];
955
- };
526
+ /** @description Stored */
527
+ 204: {
528
+ content: never;
956
529
  };
957
- /** @description Invalid request */
958
- 400: {
959
- content: {
960
- "application/json": components["schemas"]["ProblemDetails"];
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
- /** @description Session already exists */
964
- 409: {
965
- content: {
966
- "application/json": components["schemas"]["ProblemDetails"];
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 Last seen event sequence (exclusive) */
979
- offset?: number | null;
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 Session events */
556
+ /** @description Directory entries */
992
557
  200: {
993
558
  content: {
994
- "application/json": components["schemas"]["EventsResponse"];
559
+ "application/json": components["schemas"]["FsEntry"][];
995
560
  };
996
561
  };
997
- /** @description Session not found */
998
- 404: {
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"]["ProblemDetails"];
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 Last seen event sequence (exclusive) */
1013
- offset?: number | null;
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 SSE event stream */
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
- path: {
1036
- /** @description Session id */
1037
- session_id: string;
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
- "application/json": components["schemas"]["MessageRequest"];
606
+ "text/plain": string;
1043
607
  };
1044
608
  };
1045
609
  responses: {
1046
- /** @description Message accepted */
1047
- 204: {
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"]["ProblemDetails"];
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 Include raw provider payloads */
1066
- include_raw?: boolean | null;
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 SSE event stream */
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"]["ProblemDetails"];
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"]["PermissionReplyRequest"];
637
+ "application/json": components["schemas"]["FsMoveRequest"];
1107
638
  };
1108
639
  };
1109
640
  responses: {
1110
- /** @description Permission reply accepted */
1111
- 204: {
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"]["ProblemDetails"];
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
- path: {
1129
- /** @description Session id */
1130
- session_id: string;
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 Question rejected */
1137
- 204: {
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"]["ProblemDetails"];
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
- path: {
1155
- /** @description Session id */
1156
- session_id: string;
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
- "application/json": components["schemas"]["QuestionReplyRequest"];
675
+ "text/plain": string;
1164
676
  };
1165
677
  };
1166
678
  responses: {
1167
- /** @description Question answered */
1168
- 204: {
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"]["ProblemDetails"];
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 Session terminated */
1192
- 204: {
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"]["ProblemDetails"];
692
+ "application/json": components["schemas"]["HealthResponse"];
1199
693
  };
1200
694
  };
1201
695
  };
1202
696
  };
1203
697
  }
1204
698
 
1205
- type S = components["schemas"];
1206
- type AgentCapabilities = S["AgentCapabilities"];
1207
- type AgentInfo = S["AgentInfo"];
1208
- type AgentInstallRequest = S["AgentInstallRequest"];
1209
- type AgentListResponse = S["AgentListResponse"];
1210
- type AgentModelInfo = S["AgentModelInfo"];
1211
- type AgentModelsResponse = S["AgentModelsResponse"];
1212
- type AgentModeInfo = S["AgentModeInfo"];
1213
- type AgentModesResponse = S["AgentModesResponse"];
1214
- type AgentUnparsedData = S["AgentUnparsedData"];
1215
- type ContentPart = S["ContentPart"];
1216
- type CreateSessionRequest = S["CreateSessionRequest"];
1217
- type CreateSessionResponse = S["CreateSessionResponse"];
1218
- type ErrorData = S["ErrorData"];
1219
- type EventSource = S["EventSource"];
1220
- type EventsQuery = S["EventsQuery"];
1221
- type EventsResponse = S["EventsResponse"];
1222
- type FileAction = S["FileAction"];
1223
- type FsActionResponse = S["FsActionResponse"];
1224
- type FsDeleteQuery = S["FsDeleteQuery"];
1225
- type FsEntriesQuery = S["FsEntriesQuery"];
1226
- type FsEntry = S["FsEntry"];
1227
- type FsEntryType = S["FsEntryType"];
1228
- type FsMoveRequest = S["FsMoveRequest"];
1229
- type FsMoveResponse = S["FsMoveResponse"];
1230
- type FsPathQuery = S["FsPathQuery"];
1231
- type FsSessionQuery = S["FsSessionQuery"];
1232
- type FsStat = S["FsStat"];
1233
- type FsUploadBatchQuery = S["FsUploadBatchQuery"];
1234
- type FsUploadBatchResponse = S["FsUploadBatchResponse"];
1235
- type FsWriteResponse = S["FsWriteResponse"];
1236
- type HealthResponse = S["HealthResponse"];
1237
- type ItemDeltaData = S["ItemDeltaData"];
1238
- type ItemEventData = S["ItemEventData"];
1239
- type ItemKind = S["ItemKind"];
1240
- type ItemRole = S["ItemRole"];
1241
- type ItemStatus = S["ItemStatus"];
1242
- type MessageRequest = S["MessageRequest"];
1243
- type MessageAttachment = S["MessageAttachment"];
1244
- type PermissionEventData = S["PermissionEventData"];
1245
- type PermissionReply = S["PermissionReply"];
1246
- type PermissionReplyRequest = S["PermissionReplyRequest"];
1247
- type PermissionStatus = S["PermissionStatus"];
1248
- type ProblemDetails = S["ProblemDetails"];
1249
- type QuestionEventData = S["QuestionEventData"];
1250
- type QuestionReplyRequest = S["QuestionReplyRequest"];
1251
- type QuestionStatus = S["QuestionStatus"];
1252
- type ReasoningVisibility = S["ReasoningVisibility"];
1253
- type SessionEndReason = S["SessionEndReason"];
1254
- type SessionEndedData = S["SessionEndedData"];
1255
- type SessionInfo = S["SessionInfo"];
1256
- type SessionListResponse = S["SessionListResponse"];
1257
- type SessionStartedData = S["SessionStartedData"];
1258
- type TerminatedBy = S["TerminatedBy"];
1259
- type TurnStreamQuery = S["TurnStreamQuery"];
1260
- type UniversalEvent = S["UniversalEvent"];
1261
- type UniversalEventData = S["UniversalEventData"];
1262
- type UniversalEventType = S["UniversalEventType"];
1263
- type UniversalItem = S["UniversalItem"];
1264
- type McpServerConfig = S["McpServerConfig"];
1265
- type McpCommand = S["McpCommand"];
1266
- type McpRemoteTransport = S["McpRemoteTransport"];
1267
- type McpOAuthConfig = S["McpOAuthConfig"];
1268
- type McpOAuthConfigOrDisabled = S["McpOAuthConfigOrDisabled"];
1269
- type SkillSource = S["SkillSource"];
1270
- type SkillsConfig = S["SkillsConfig"];
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 constructor();
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
- listAgents(): Promise<AgentListResponse>;
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
- installAgent(agent: string, request?: AgentInstallRequest): Promise<void>;
1301
- getAgentModes(agent: string): Promise<AgentModesResponse>;
1302
- getAgentModels(agent: string): Promise<AgentModelsResponse>;
1303
- createSession(sessionId: string, request: CreateSessionRequest): Promise<CreateSessionResponse>;
1304
- listSessions(): Promise<SessionListResponse>;
1305
- postMessage(sessionId: string, request: MessageRequest): Promise<void>;
1306
- getEvents(sessionId: string, query?: EventsQuery): Promise<EventsResponse>;
1307
- getEventsSse(sessionId: string, query?: EventsQuery, signal?: AbortSignal): Promise<Response>;
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, query?: FsSessionQuery): Promise<FsMoveResponse>;
924
+ moveFs(request: FsMoveRequest): Promise<FsMoveResponse>;
1321
925
  statFs(query: FsPathQuery): Promise<FsStat>;
1322
926
  uploadFsBatch(body: BodyInit, query?: FsUploadBatchQuery): Promise<FsUploadBatchResponse>;
1323
- dispose(): Promise<void>;
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 AgentCapabilities, type AgentInfo, type AgentInstallRequest, type AgentListResponse, type AgentModeInfo, type AgentModelInfo, type AgentModelsResponse, type AgentModesResponse, type AgentUnparsedData, type ContentPart, type CreateSessionRequest, type CreateSessionResponse, type ErrorData, type EventSource, type EventsQuery, type EventsResponse, type FileAction, type FsActionResponse, type FsDeleteQuery, type FsEntriesQuery, type FsEntry, type FsEntryType, type FsMoveRequest, type FsMoveResponse, type FsPathQuery, type FsSessionQuery, type FsStat, type FsUploadBatchQuery, type FsUploadBatchResponse, type FsWriteResponse, type HealthResponse, type InspectorUrlOptions, type ItemDeltaData, type ItemEventData, type ItemKind, type ItemRole, type ItemStatus, type McpCommand, type McpOAuthConfig, type McpOAuthConfigOrDisabled, type McpRemoteTransport, type McpServerConfig, type MessageAttachment, type MessageRequest, type PermissionEventData, type PermissionReply, type PermissionReplyRequest, type PermissionStatus, type ProblemDetails, type QuestionEventData, type QuestionReplyRequest, type QuestionStatus, type ReasoningVisibility, SandboxAgent, type SandboxAgentConnectOptions, SandboxAgentError, type SandboxAgentSpawnLogMode, type SandboxAgentSpawnOptions, type SandboxAgentStartOptions, type SessionEndReason, type SessionEndedData, type SessionInfo, type SessionListResponse, type SessionStartedData, type SkillSource, type SkillsConfig, type TerminatedBy, type TurnStreamQuery, type UniversalEvent, type UniversalEventData, type UniversalEventType, type UniversalItem, buildInspectorUrl, type components, type paths };
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 };