sandbox-agent 0.0.1 → 0.1.0-test.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/dist/index.d.ts +725 -0
- package/dist/index.js +239 -0
- package/dist/index.js.map +1 -0
- package/dist/spawn-BT4YX7BC.js +168 -0
- package/dist/spawn-BT4YX7BC.js.map +1 -0
- package/package.json +34 -4
- package/index.js +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
type SandboxAgentSpawnLogMode = "inherit" | "pipe" | "silent";
|
|
2
|
+
type SandboxAgentSpawnOptions = {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
host?: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
token?: string;
|
|
7
|
+
binaryPath?: string;
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
log?: SandboxAgentSpawnLogMode;
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
|
|
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
|
+
get: operations["list_agents"];
|
|
20
|
+
};
|
|
21
|
+
"/v1/agents/{agent}/install": {
|
|
22
|
+
post: operations["install_agent"];
|
|
23
|
+
};
|
|
24
|
+
"/v1/agents/{agent}/modes": {
|
|
25
|
+
get: operations["get_agent_modes"];
|
|
26
|
+
};
|
|
27
|
+
"/v1/health": {
|
|
28
|
+
get: operations["get_health"];
|
|
29
|
+
};
|
|
30
|
+
"/v1/sessions": {
|
|
31
|
+
get: operations["list_sessions"];
|
|
32
|
+
};
|
|
33
|
+
"/v1/sessions/{session_id}": {
|
|
34
|
+
post: operations["create_session"];
|
|
35
|
+
};
|
|
36
|
+
"/v1/sessions/{session_id}/events": {
|
|
37
|
+
get: operations["get_events"];
|
|
38
|
+
};
|
|
39
|
+
"/v1/sessions/{session_id}/events/sse": {
|
|
40
|
+
get: operations["get_events_sse"];
|
|
41
|
+
};
|
|
42
|
+
"/v1/sessions/{session_id}/messages": {
|
|
43
|
+
post: operations["post_message"];
|
|
44
|
+
};
|
|
45
|
+
"/v1/sessions/{session_id}/messages/stream": {
|
|
46
|
+
post: operations["post_message_stream"];
|
|
47
|
+
};
|
|
48
|
+
"/v1/sessions/{session_id}/permissions/{permission_id}/reply": {
|
|
49
|
+
post: operations["reply_permission"];
|
|
50
|
+
};
|
|
51
|
+
"/v1/sessions/{session_id}/questions/{question_id}/reject": {
|
|
52
|
+
post: operations["reject_question"];
|
|
53
|
+
};
|
|
54
|
+
"/v1/sessions/{session_id}/questions/{question_id}/reply": {
|
|
55
|
+
post: operations["reply_question"];
|
|
56
|
+
};
|
|
57
|
+
"/v1/sessions/{session_id}/terminate": {
|
|
58
|
+
post: operations["terminate_session"];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
interface components {
|
|
62
|
+
schemas: {
|
|
63
|
+
AgentCapabilities: {
|
|
64
|
+
commandExecution: boolean;
|
|
65
|
+
errorEvents: boolean;
|
|
66
|
+
fileAttachments: boolean;
|
|
67
|
+
fileChanges: boolean;
|
|
68
|
+
images: boolean;
|
|
69
|
+
itemStarted: boolean;
|
|
70
|
+
mcpTools: boolean;
|
|
71
|
+
permissions: boolean;
|
|
72
|
+
planMode: boolean;
|
|
73
|
+
questions: boolean;
|
|
74
|
+
reasoning: boolean;
|
|
75
|
+
sessionLifecycle: boolean;
|
|
76
|
+
/** @description Whether this agent uses a shared long-running server process (vs per-turn subprocess) */
|
|
77
|
+
sharedProcess: boolean;
|
|
78
|
+
status: boolean;
|
|
79
|
+
streamingDeltas: boolean;
|
|
80
|
+
textMessages: boolean;
|
|
81
|
+
toolCalls: boolean;
|
|
82
|
+
toolResults: boolean;
|
|
83
|
+
};
|
|
84
|
+
AgentError: {
|
|
85
|
+
agent?: string | null;
|
|
86
|
+
details?: unknown;
|
|
87
|
+
message: string;
|
|
88
|
+
session_id?: string | null;
|
|
89
|
+
type: components["schemas"]["ErrorType"];
|
|
90
|
+
};
|
|
91
|
+
AgentInfo: {
|
|
92
|
+
capabilities: components["schemas"]["AgentCapabilities"];
|
|
93
|
+
id: string;
|
|
94
|
+
installed: boolean;
|
|
95
|
+
path?: string | null;
|
|
96
|
+
serverStatus?: components["schemas"]["ServerStatusInfo"] | null;
|
|
97
|
+
version?: string | null;
|
|
98
|
+
};
|
|
99
|
+
AgentInstallRequest: {
|
|
100
|
+
reinstall?: boolean | null;
|
|
101
|
+
};
|
|
102
|
+
AgentListResponse: {
|
|
103
|
+
agents: components["schemas"]["AgentInfo"][];
|
|
104
|
+
};
|
|
105
|
+
AgentModeInfo: {
|
|
106
|
+
description: string;
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
AgentModesResponse: {
|
|
111
|
+
modes: components["schemas"]["AgentModeInfo"][];
|
|
112
|
+
};
|
|
113
|
+
AgentUnparsedData: {
|
|
114
|
+
error: string;
|
|
115
|
+
location: string;
|
|
116
|
+
raw_hash?: string | null;
|
|
117
|
+
};
|
|
118
|
+
ContentPart: {
|
|
119
|
+
text: string;
|
|
120
|
+
/** @enum {string} */
|
|
121
|
+
type: "text";
|
|
122
|
+
} | {
|
|
123
|
+
json: unknown;
|
|
124
|
+
/** @enum {string} */
|
|
125
|
+
type: "json";
|
|
126
|
+
} | {
|
|
127
|
+
arguments: string;
|
|
128
|
+
call_id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
/** @enum {string} */
|
|
131
|
+
type: "tool_call";
|
|
132
|
+
} | {
|
|
133
|
+
call_id: string;
|
|
134
|
+
output: string;
|
|
135
|
+
/** @enum {string} */
|
|
136
|
+
type: "tool_result";
|
|
137
|
+
} | ({
|
|
138
|
+
action: components["schemas"]["FileAction"];
|
|
139
|
+
diff?: string | null;
|
|
140
|
+
path: string;
|
|
141
|
+
/** @enum {string} */
|
|
142
|
+
type: "file_ref";
|
|
143
|
+
}) | {
|
|
144
|
+
text: string;
|
|
145
|
+
/** @enum {string} */
|
|
146
|
+
type: "reasoning";
|
|
147
|
+
visibility: components["schemas"]["ReasoningVisibility"];
|
|
148
|
+
} | ({
|
|
149
|
+
mime?: string | null;
|
|
150
|
+
path: string;
|
|
151
|
+
/** @enum {string} */
|
|
152
|
+
type: "image";
|
|
153
|
+
}) | ({
|
|
154
|
+
detail?: string | null;
|
|
155
|
+
label: string;
|
|
156
|
+
/** @enum {string} */
|
|
157
|
+
type: "status";
|
|
158
|
+
});
|
|
159
|
+
CreateSessionRequest: {
|
|
160
|
+
agent: string;
|
|
161
|
+
agentMode?: string | null;
|
|
162
|
+
agentVersion?: string | null;
|
|
163
|
+
model?: string | null;
|
|
164
|
+
permissionMode?: string | null;
|
|
165
|
+
variant?: string | null;
|
|
166
|
+
};
|
|
167
|
+
CreateSessionResponse: {
|
|
168
|
+
error?: components["schemas"]["AgentError"] | null;
|
|
169
|
+
healthy: boolean;
|
|
170
|
+
nativeSessionId?: string | null;
|
|
171
|
+
};
|
|
172
|
+
ErrorData: {
|
|
173
|
+
code?: string | null;
|
|
174
|
+
details?: unknown;
|
|
175
|
+
message: string;
|
|
176
|
+
};
|
|
177
|
+
/** @enum {string} */
|
|
178
|
+
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";
|
|
179
|
+
/** @enum {string} */
|
|
180
|
+
EventSource: "agent" | "daemon";
|
|
181
|
+
EventsQuery: {
|
|
182
|
+
includeRaw?: boolean | null;
|
|
183
|
+
/** Format: int64 */
|
|
184
|
+
limit?: number | null;
|
|
185
|
+
/** Format: int64 */
|
|
186
|
+
offset?: number | null;
|
|
187
|
+
};
|
|
188
|
+
EventsResponse: {
|
|
189
|
+
events: components["schemas"]["UniversalEvent"][];
|
|
190
|
+
hasMore: boolean;
|
|
191
|
+
};
|
|
192
|
+
/** @enum {string} */
|
|
193
|
+
FileAction: "read" | "write" | "patch";
|
|
194
|
+
HealthResponse: {
|
|
195
|
+
status: string;
|
|
196
|
+
};
|
|
197
|
+
ItemDeltaData: {
|
|
198
|
+
delta: string;
|
|
199
|
+
item_id: string;
|
|
200
|
+
native_item_id?: string | null;
|
|
201
|
+
};
|
|
202
|
+
ItemEventData: {
|
|
203
|
+
item: components["schemas"]["UniversalItem"];
|
|
204
|
+
};
|
|
205
|
+
/** @enum {string} */
|
|
206
|
+
ItemKind: "message" | "tool_call" | "tool_result" | "system" | "status" | "unknown";
|
|
207
|
+
/** @enum {string} */
|
|
208
|
+
ItemRole: "user" | "assistant" | "system" | "tool";
|
|
209
|
+
/** @enum {string} */
|
|
210
|
+
ItemStatus: "in_progress" | "completed" | "failed";
|
|
211
|
+
MessageRequest: {
|
|
212
|
+
message: string;
|
|
213
|
+
};
|
|
214
|
+
PermissionEventData: {
|
|
215
|
+
action: string;
|
|
216
|
+
metadata?: unknown;
|
|
217
|
+
permission_id: string;
|
|
218
|
+
status: components["schemas"]["PermissionStatus"];
|
|
219
|
+
};
|
|
220
|
+
/** @enum {string} */
|
|
221
|
+
PermissionReply: "once" | "always" | "reject";
|
|
222
|
+
PermissionReplyRequest: {
|
|
223
|
+
reply: components["schemas"]["PermissionReply"];
|
|
224
|
+
};
|
|
225
|
+
/** @enum {string} */
|
|
226
|
+
PermissionStatus: "requested" | "approved" | "denied";
|
|
227
|
+
ProblemDetails: {
|
|
228
|
+
detail?: string | null;
|
|
229
|
+
instance?: string | null;
|
|
230
|
+
/** Format: int32 */
|
|
231
|
+
status: number;
|
|
232
|
+
title: string;
|
|
233
|
+
type: string;
|
|
234
|
+
[key: string]: unknown;
|
|
235
|
+
};
|
|
236
|
+
QuestionEventData: {
|
|
237
|
+
options: string[];
|
|
238
|
+
prompt: string;
|
|
239
|
+
question_id: string;
|
|
240
|
+
response?: string | null;
|
|
241
|
+
status: components["schemas"]["QuestionStatus"];
|
|
242
|
+
};
|
|
243
|
+
QuestionReplyRequest: {
|
|
244
|
+
answers: string[][];
|
|
245
|
+
};
|
|
246
|
+
/** @enum {string} */
|
|
247
|
+
QuestionStatus: "requested" | "answered" | "rejected";
|
|
248
|
+
/** @enum {string} */
|
|
249
|
+
ReasoningVisibility: "public" | "private";
|
|
250
|
+
/**
|
|
251
|
+
* @description Status of a shared server process for an agent
|
|
252
|
+
* @enum {string}
|
|
253
|
+
*/
|
|
254
|
+
ServerStatus: "running" | "stopped" | "error";
|
|
255
|
+
ServerStatusInfo: {
|
|
256
|
+
baseUrl?: string | null;
|
|
257
|
+
lastError?: string | null;
|
|
258
|
+
/** Format: int64 */
|
|
259
|
+
restartCount: number;
|
|
260
|
+
status: components["schemas"]["ServerStatus"];
|
|
261
|
+
/** Format: int64 */
|
|
262
|
+
uptimeMs?: number | null;
|
|
263
|
+
};
|
|
264
|
+
/** @enum {string} */
|
|
265
|
+
SessionEndReason: "completed" | "error" | "terminated";
|
|
266
|
+
SessionEndedData: {
|
|
267
|
+
reason: components["schemas"]["SessionEndReason"];
|
|
268
|
+
terminated_by: components["schemas"]["TerminatedBy"];
|
|
269
|
+
};
|
|
270
|
+
SessionInfo: {
|
|
271
|
+
agent: string;
|
|
272
|
+
agentMode: string;
|
|
273
|
+
ended: boolean;
|
|
274
|
+
/** Format: int64 */
|
|
275
|
+
eventCount: number;
|
|
276
|
+
model?: string | null;
|
|
277
|
+
nativeSessionId?: string | null;
|
|
278
|
+
permissionMode: string;
|
|
279
|
+
sessionId: string;
|
|
280
|
+
variant?: string | null;
|
|
281
|
+
};
|
|
282
|
+
SessionListResponse: {
|
|
283
|
+
sessions: components["schemas"]["SessionInfo"][];
|
|
284
|
+
};
|
|
285
|
+
SessionStartedData: {
|
|
286
|
+
metadata?: unknown;
|
|
287
|
+
};
|
|
288
|
+
/** @enum {string} */
|
|
289
|
+
TerminatedBy: "agent" | "daemon";
|
|
290
|
+
TurnStreamQuery: {
|
|
291
|
+
includeRaw?: boolean | null;
|
|
292
|
+
};
|
|
293
|
+
UniversalEvent: {
|
|
294
|
+
data: components["schemas"]["UniversalEventData"];
|
|
295
|
+
event_id: string;
|
|
296
|
+
native_session_id?: string | null;
|
|
297
|
+
raw?: unknown;
|
|
298
|
+
/** Format: int64 */
|
|
299
|
+
sequence: number;
|
|
300
|
+
session_id: string;
|
|
301
|
+
source: components["schemas"]["EventSource"];
|
|
302
|
+
synthetic: boolean;
|
|
303
|
+
time: string;
|
|
304
|
+
type: components["schemas"]["UniversalEventType"];
|
|
305
|
+
};
|
|
306
|
+
UniversalEventData: components["schemas"]["SessionStartedData"] | components["schemas"]["SessionEndedData"] | components["schemas"]["ItemEventData"] | components["schemas"]["ItemDeltaData"] | components["schemas"]["ErrorData"] | components["schemas"]["PermissionEventData"] | components["schemas"]["QuestionEventData"] | components["schemas"]["AgentUnparsedData"];
|
|
307
|
+
/** @enum {string} */
|
|
308
|
+
UniversalEventType: "session.started" | "session.ended" | "item.started" | "item.delta" | "item.completed" | "error" | "permission.requested" | "permission.resolved" | "question.requested" | "question.resolved" | "agent.unparsed";
|
|
309
|
+
UniversalItem: {
|
|
310
|
+
content: components["schemas"]["ContentPart"][];
|
|
311
|
+
item_id: string;
|
|
312
|
+
kind: components["schemas"]["ItemKind"];
|
|
313
|
+
native_item_id?: string | null;
|
|
314
|
+
parent_id?: string | null;
|
|
315
|
+
role?: components["schemas"]["ItemRole"] | null;
|
|
316
|
+
status: components["schemas"]["ItemStatus"];
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
responses: never;
|
|
320
|
+
parameters: never;
|
|
321
|
+
requestBodies: never;
|
|
322
|
+
headers: never;
|
|
323
|
+
pathItems: never;
|
|
324
|
+
}
|
|
325
|
+
interface operations {
|
|
326
|
+
list_agents: {
|
|
327
|
+
responses: {
|
|
328
|
+
200: {
|
|
329
|
+
content: {
|
|
330
|
+
"application/json": components["schemas"]["AgentListResponse"];
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
install_agent: {
|
|
336
|
+
parameters: {
|
|
337
|
+
path: {
|
|
338
|
+
/** @description Agent id */
|
|
339
|
+
agent: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
requestBody: {
|
|
343
|
+
content: {
|
|
344
|
+
"application/json": components["schemas"]["AgentInstallRequest"];
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
responses: {
|
|
348
|
+
/** @description Agent installed */
|
|
349
|
+
204: {
|
|
350
|
+
content: never;
|
|
351
|
+
};
|
|
352
|
+
400: {
|
|
353
|
+
content: {
|
|
354
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
404: {
|
|
358
|
+
content: {
|
|
359
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
500: {
|
|
363
|
+
content: {
|
|
364
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
get_agent_modes: {
|
|
370
|
+
parameters: {
|
|
371
|
+
path: {
|
|
372
|
+
/** @description Agent id */
|
|
373
|
+
agent: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
responses: {
|
|
377
|
+
200: {
|
|
378
|
+
content: {
|
|
379
|
+
"application/json": components["schemas"]["AgentModesResponse"];
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
400: {
|
|
383
|
+
content: {
|
|
384
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
get_health: {
|
|
390
|
+
responses: {
|
|
391
|
+
200: {
|
|
392
|
+
content: {
|
|
393
|
+
"application/json": components["schemas"]["HealthResponse"];
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
list_sessions: {
|
|
399
|
+
responses: {
|
|
400
|
+
200: {
|
|
401
|
+
content: {
|
|
402
|
+
"application/json": components["schemas"]["SessionListResponse"];
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
create_session: {
|
|
408
|
+
parameters: {
|
|
409
|
+
path: {
|
|
410
|
+
/** @description Client session id */
|
|
411
|
+
session_id: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
requestBody: {
|
|
415
|
+
content: {
|
|
416
|
+
"application/json": components["schemas"]["CreateSessionRequest"];
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
responses: {
|
|
420
|
+
200: {
|
|
421
|
+
content: {
|
|
422
|
+
"application/json": components["schemas"]["CreateSessionResponse"];
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
400: {
|
|
426
|
+
content: {
|
|
427
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
409: {
|
|
431
|
+
content: {
|
|
432
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
get_events: {
|
|
438
|
+
parameters: {
|
|
439
|
+
query?: {
|
|
440
|
+
/** @description Last seen event sequence (exclusive) */
|
|
441
|
+
offset?: number | null;
|
|
442
|
+
/** @description Max events to return */
|
|
443
|
+
limit?: number | null;
|
|
444
|
+
/** @description Include raw provider payloads */
|
|
445
|
+
include_raw?: boolean | null;
|
|
446
|
+
};
|
|
447
|
+
path: {
|
|
448
|
+
/** @description Session id */
|
|
449
|
+
session_id: string;
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
responses: {
|
|
453
|
+
200: {
|
|
454
|
+
content: {
|
|
455
|
+
"application/json": components["schemas"]["EventsResponse"];
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
404: {
|
|
459
|
+
content: {
|
|
460
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
get_events_sse: {
|
|
466
|
+
parameters: {
|
|
467
|
+
query?: {
|
|
468
|
+
/** @description Last seen event sequence (exclusive) */
|
|
469
|
+
offset?: number | null;
|
|
470
|
+
/** @description Include raw provider payloads */
|
|
471
|
+
include_raw?: boolean | null;
|
|
472
|
+
};
|
|
473
|
+
path: {
|
|
474
|
+
/** @description Session id */
|
|
475
|
+
session_id: string;
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
responses: {
|
|
479
|
+
/** @description SSE event stream */
|
|
480
|
+
200: {
|
|
481
|
+
content: never;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
post_message: {
|
|
486
|
+
parameters: {
|
|
487
|
+
path: {
|
|
488
|
+
/** @description Session id */
|
|
489
|
+
session_id: string;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
requestBody: {
|
|
493
|
+
content: {
|
|
494
|
+
"application/json": components["schemas"]["MessageRequest"];
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
responses: {
|
|
498
|
+
/** @description Message accepted */
|
|
499
|
+
204: {
|
|
500
|
+
content: never;
|
|
501
|
+
};
|
|
502
|
+
404: {
|
|
503
|
+
content: {
|
|
504
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
post_message_stream: {
|
|
510
|
+
parameters: {
|
|
511
|
+
query?: {
|
|
512
|
+
/** @description Include raw provider payloads */
|
|
513
|
+
include_raw?: boolean | null;
|
|
514
|
+
};
|
|
515
|
+
path: {
|
|
516
|
+
/** @description Session id */
|
|
517
|
+
session_id: string;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
requestBody: {
|
|
521
|
+
content: {
|
|
522
|
+
"application/json": components["schemas"]["MessageRequest"];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
responses: {
|
|
526
|
+
/** @description SSE event stream */
|
|
527
|
+
200: {
|
|
528
|
+
content: never;
|
|
529
|
+
};
|
|
530
|
+
404: {
|
|
531
|
+
content: {
|
|
532
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
reply_permission: {
|
|
538
|
+
parameters: {
|
|
539
|
+
path: {
|
|
540
|
+
/** @description Session id */
|
|
541
|
+
session_id: string;
|
|
542
|
+
/** @description Permission id */
|
|
543
|
+
permission_id: string;
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
requestBody: {
|
|
547
|
+
content: {
|
|
548
|
+
"application/json": components["schemas"]["PermissionReplyRequest"];
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
responses: {
|
|
552
|
+
/** @description Permission reply accepted */
|
|
553
|
+
204: {
|
|
554
|
+
content: never;
|
|
555
|
+
};
|
|
556
|
+
404: {
|
|
557
|
+
content: {
|
|
558
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
reject_question: {
|
|
564
|
+
parameters: {
|
|
565
|
+
path: {
|
|
566
|
+
/** @description Session id */
|
|
567
|
+
session_id: string;
|
|
568
|
+
/** @description Question id */
|
|
569
|
+
question_id: string;
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
responses: {
|
|
573
|
+
/** @description Question rejected */
|
|
574
|
+
204: {
|
|
575
|
+
content: never;
|
|
576
|
+
};
|
|
577
|
+
404: {
|
|
578
|
+
content: {
|
|
579
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
reply_question: {
|
|
585
|
+
parameters: {
|
|
586
|
+
path: {
|
|
587
|
+
/** @description Session id */
|
|
588
|
+
session_id: string;
|
|
589
|
+
/** @description Question id */
|
|
590
|
+
question_id: string;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
requestBody: {
|
|
594
|
+
content: {
|
|
595
|
+
"application/json": components["schemas"]["QuestionReplyRequest"];
|
|
596
|
+
};
|
|
597
|
+
};
|
|
598
|
+
responses: {
|
|
599
|
+
/** @description Question answered */
|
|
600
|
+
204: {
|
|
601
|
+
content: never;
|
|
602
|
+
};
|
|
603
|
+
404: {
|
|
604
|
+
content: {
|
|
605
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
terminate_session: {
|
|
611
|
+
parameters: {
|
|
612
|
+
path: {
|
|
613
|
+
/** @description Session id */
|
|
614
|
+
session_id: string;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
responses: {
|
|
618
|
+
/** @description Session terminated */
|
|
619
|
+
204: {
|
|
620
|
+
content: never;
|
|
621
|
+
};
|
|
622
|
+
404: {
|
|
623
|
+
content: {
|
|
624
|
+
"application/json": components["schemas"]["ProblemDetails"];
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
type S = components["schemas"];
|
|
632
|
+
type AgentCapabilities = S["AgentCapabilities"];
|
|
633
|
+
type AgentInfo = S["AgentInfo"];
|
|
634
|
+
type AgentInstallRequest = S["AgentInstallRequest"];
|
|
635
|
+
type AgentListResponse = S["AgentListResponse"];
|
|
636
|
+
type AgentModeInfo = S["AgentModeInfo"];
|
|
637
|
+
type AgentModesResponse = S["AgentModesResponse"];
|
|
638
|
+
type AgentUnparsedData = S["AgentUnparsedData"];
|
|
639
|
+
type ContentPart = S["ContentPart"];
|
|
640
|
+
type CreateSessionRequest = S["CreateSessionRequest"];
|
|
641
|
+
type CreateSessionResponse = S["CreateSessionResponse"];
|
|
642
|
+
type ErrorData = S["ErrorData"];
|
|
643
|
+
type EventSource = S["EventSource"];
|
|
644
|
+
type EventsQuery = S["EventsQuery"];
|
|
645
|
+
type EventsResponse = S["EventsResponse"];
|
|
646
|
+
type FileAction = S["FileAction"];
|
|
647
|
+
type HealthResponse = S["HealthResponse"];
|
|
648
|
+
type ItemDeltaData = S["ItemDeltaData"];
|
|
649
|
+
type ItemEventData = S["ItemEventData"];
|
|
650
|
+
type ItemKind = S["ItemKind"];
|
|
651
|
+
type ItemRole = S["ItemRole"];
|
|
652
|
+
type ItemStatus = S["ItemStatus"];
|
|
653
|
+
type MessageRequest = S["MessageRequest"];
|
|
654
|
+
type PermissionEventData = S["PermissionEventData"];
|
|
655
|
+
type PermissionReply = S["PermissionReply"];
|
|
656
|
+
type PermissionReplyRequest = S["PermissionReplyRequest"];
|
|
657
|
+
type PermissionStatus = S["PermissionStatus"];
|
|
658
|
+
type ProblemDetails = S["ProblemDetails"];
|
|
659
|
+
type QuestionEventData = S["QuestionEventData"];
|
|
660
|
+
type QuestionReplyRequest = S["QuestionReplyRequest"];
|
|
661
|
+
type QuestionStatus = S["QuestionStatus"];
|
|
662
|
+
type ReasoningVisibility = S["ReasoningVisibility"];
|
|
663
|
+
type SessionEndReason = S["SessionEndReason"];
|
|
664
|
+
type SessionEndedData = S["SessionEndedData"];
|
|
665
|
+
type SessionInfo = S["SessionInfo"];
|
|
666
|
+
type SessionListResponse = S["SessionListResponse"];
|
|
667
|
+
type SessionStartedData = S["SessionStartedData"];
|
|
668
|
+
type TerminatedBy = S["TerminatedBy"];
|
|
669
|
+
type TurnStreamQuery = S["TurnStreamQuery"];
|
|
670
|
+
type UniversalEvent = S["UniversalEvent"];
|
|
671
|
+
type UniversalEventData = S["UniversalEventData"];
|
|
672
|
+
type UniversalEventType = S["UniversalEventType"];
|
|
673
|
+
type UniversalItem = S["UniversalItem"];
|
|
674
|
+
|
|
675
|
+
interface SandboxAgentConnectOptions {
|
|
676
|
+
baseUrl: string;
|
|
677
|
+
token?: string;
|
|
678
|
+
fetch?: typeof fetch;
|
|
679
|
+
headers?: HeadersInit;
|
|
680
|
+
}
|
|
681
|
+
interface SandboxAgentStartOptions {
|
|
682
|
+
spawn?: SandboxAgentSpawnOptions | boolean;
|
|
683
|
+
fetch?: typeof fetch;
|
|
684
|
+
headers?: HeadersInit;
|
|
685
|
+
}
|
|
686
|
+
declare class SandboxAgentError extends Error {
|
|
687
|
+
readonly status: number;
|
|
688
|
+
readonly problem?: ProblemDetails;
|
|
689
|
+
readonly response: Response;
|
|
690
|
+
constructor(status: number, problem: ProblemDetails | undefined, response: Response);
|
|
691
|
+
}
|
|
692
|
+
declare class SandboxAgent {
|
|
693
|
+
private readonly baseUrl;
|
|
694
|
+
private readonly token?;
|
|
695
|
+
private readonly fetcher;
|
|
696
|
+
private readonly defaultHeaders?;
|
|
697
|
+
private spawnHandle?;
|
|
698
|
+
private constructor();
|
|
699
|
+
static connect(options: SandboxAgentConnectOptions): Promise<SandboxAgent>;
|
|
700
|
+
static start(options?: SandboxAgentStartOptions): Promise<SandboxAgent>;
|
|
701
|
+
listAgents(): Promise<AgentListResponse>;
|
|
702
|
+
getHealth(): Promise<HealthResponse>;
|
|
703
|
+
installAgent(agent: string, request?: AgentInstallRequest): Promise<void>;
|
|
704
|
+
getAgentModes(agent: string): Promise<AgentModesResponse>;
|
|
705
|
+
createSession(sessionId: string, request: CreateSessionRequest): Promise<CreateSessionResponse>;
|
|
706
|
+
listSessions(): Promise<SessionListResponse>;
|
|
707
|
+
postMessage(sessionId: string, request: MessageRequest): Promise<void>;
|
|
708
|
+
getEvents(sessionId: string, query?: EventsQuery): Promise<EventsResponse>;
|
|
709
|
+
getEventsSse(sessionId: string, query?: EventsQuery, signal?: AbortSignal): Promise<Response>;
|
|
710
|
+
postMessageStream(sessionId: string, request: MessageRequest, query?: TurnStreamQuery, signal?: AbortSignal): Promise<Response>;
|
|
711
|
+
streamEvents(sessionId: string, query?: EventsQuery, signal?: AbortSignal): AsyncGenerator<UniversalEvent, void, void>;
|
|
712
|
+
streamTurn(sessionId: string, request: MessageRequest, query?: TurnStreamQuery, signal?: AbortSignal): AsyncGenerator<UniversalEvent, void, void>;
|
|
713
|
+
replyQuestion(sessionId: string, questionId: string, request: QuestionReplyRequest): Promise<void>;
|
|
714
|
+
rejectQuestion(sessionId: string, questionId: string): Promise<void>;
|
|
715
|
+
replyPermission(sessionId: string, permissionId: string, request: PermissionReplyRequest): Promise<void>;
|
|
716
|
+
terminateSession(sessionId: string): Promise<void>;
|
|
717
|
+
dispose(): Promise<void>;
|
|
718
|
+
private requestJson;
|
|
719
|
+
private requestRaw;
|
|
720
|
+
private buildUrl;
|
|
721
|
+
private readProblem;
|
|
722
|
+
private parseSseStream;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export { type AgentCapabilities, type AgentInfo, type AgentInstallRequest, type AgentListResponse, type AgentModeInfo, type AgentModesResponse, type AgentUnparsedData, type ContentPart, type CreateSessionRequest, type CreateSessionResponse, type ErrorData, type EventSource, type EventsQuery, type EventsResponse, type FileAction, type HealthResponse, type ItemDeltaData, type ItemEventData, type ItemKind, type ItemRole, type ItemStatus, 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 TerminatedBy, type TurnStreamQuery, type UniversalEvent, type UniversalEventData, type UniversalEventType, type UniversalItem, type components, type paths };
|