@agentuity/server 0.0.105 → 0.0.106
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/api/api.d.ts +11 -6
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +21 -13
- package/dist/api/api.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/project/deploy.d.ts +0 -6
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +0 -2
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/project/get.d.ts +2 -1
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +10 -2
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/region/create.d.ts +2 -0
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +1 -0
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/region/delete.d.ts +12 -2
- package/dist/api/region/delete.d.ts.map +1 -1
- package/dist/api/region/delete.js +6 -1
- package/dist/api/region/delete.js.map +1 -1
- package/dist/api/region/resources.d.ts +4 -0
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +2 -0
- package/dist/api/region/resources.js.map +1 -1
- package/dist/api/sandbox/client.d.ts +125 -0
- package/dist/api/sandbox/client.d.ts.map +1 -0
- package/dist/api/sandbox/client.js +202 -0
- package/dist/api/sandbox/client.js.map +1 -0
- package/dist/api/sandbox/create.d.ts +24 -0
- package/dist/api/sandbox/create.d.ts.map +1 -0
- package/dist/api/sandbox/create.js +133 -0
- package/dist/api/sandbox/create.js.map +1 -0
- package/dist/api/sandbox/destroy.d.ts +14 -0
- package/dist/api/sandbox/destroy.d.ts.map +1 -0
- package/dist/api/sandbox/destroy.js +25 -0
- package/dist/api/sandbox/destroy.js.map +1 -0
- package/dist/api/sandbox/execute.d.ts +18 -0
- package/dist/api/sandbox/execute.d.ts.map +1 -0
- package/dist/api/sandbox/execute.js +77 -0
- package/dist/api/sandbox/execute.js.map +1 -0
- package/dist/api/sandbox/execution.d.ts +46 -0
- package/dist/api/sandbox/execution.d.ts.map +1 -0
- package/dist/api/sandbox/execution.js +101 -0
- package/dist/api/sandbox/execution.js.map +1 -0
- package/dist/api/sandbox/files.d.ts +41 -0
- package/dist/api/sandbox/files.d.ts.map +1 -0
- package/dist/api/sandbox/files.js +91 -0
- package/dist/api/sandbox/files.js.map +1 -0
- package/dist/api/sandbox/get.d.ts +16 -0
- package/dist/api/sandbox/get.d.ts.map +1 -0
- package/dist/api/sandbox/get.js +57 -0
- package/dist/api/sandbox/get.js.map +1 -0
- package/dist/api/sandbox/index.d.ts +22 -0
- package/dist/api/sandbox/index.d.ts.map +1 -0
- package/dist/api/sandbox/index.js +12 -0
- package/dist/api/sandbox/index.js.map +1 -0
- package/dist/api/sandbox/list.d.ts +15 -0
- package/dist/api/sandbox/list.d.ts.map +1 -0
- package/dist/api/sandbox/list.js +75 -0
- package/dist/api/sandbox/list.js.map +1 -0
- package/dist/api/sandbox/run.d.ts +28 -0
- package/dist/api/sandbox/run.d.ts.map +1 -0
- package/dist/api/sandbox/run.js +269 -0
- package/dist/api/sandbox/run.js.map +1 -0
- package/dist/api/sandbox/snapshot.d.ts +89 -0
- package/dist/api/sandbox/snapshot.d.ts.map +1 -0
- package/dist/api/sandbox/snapshot.js +140 -0
- package/dist/api/sandbox/snapshot.js.map +1 -0
- package/dist/api/sandbox/util.d.ts +37 -0
- package/dist/api/sandbox/util.d.ts.map +1 -0
- package/dist/api/sandbox/util.js +45 -0
- package/dist/api/sandbox/util.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/runtime-bootstrap.d.ts.map +1 -1
- package/dist/runtime-bootstrap.js +3 -0
- package/dist/runtime-bootstrap.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +33 -13
- package/src/api/index.ts +1 -0
- package/src/api/project/deploy.ts +0 -2
- package/src/api/project/get.ts +10 -2
- package/src/api/region/create.ts +1 -0
- package/src/api/region/delete.ts +9 -2
- package/src/api/region/resources.ts +2 -0
- package/src/api/sandbox/client.ts +349 -0
- package/src/api/sandbox/create.ts +166 -0
- package/src/api/sandbox/destroy.ts +41 -0
- package/src/api/sandbox/execute.ts +102 -0
- package/src/api/sandbox/execution.ts +154 -0
- package/src/api/sandbox/files.ts +138 -0
- package/src/api/sandbox/get.ts +74 -0
- package/src/api/sandbox/index.ts +35 -0
- package/src/api/sandbox/list.ts +94 -0
- package/src/api/sandbox/run.ts +360 -0
- package/src/api/sandbox/snapshot.ts +247 -0
- package/src/api/sandbox/util.ts +55 -0
- package/src/config.ts +2 -0
- package/src/runtime-bootstrap.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/api/sandbox/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,oBAAoB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACzE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACxF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAChF,MAAM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AO,EAAE,CAAC;QAClB,OAAO;YACN,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YAClC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAyB;YAC3C,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;YAC5B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAChC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAC1C,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;SAC1C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { APIClient } from '../api';
|
|
2
|
+
import type { ExecutionStatus } from '@agentuity/core';
|
|
3
|
+
export interface ExecutionInfo {
|
|
4
|
+
executionId: string;
|
|
5
|
+
sandboxId: string;
|
|
6
|
+
status: ExecutionStatus;
|
|
7
|
+
command?: string[];
|
|
8
|
+
exitCode?: number;
|
|
9
|
+
durationMs?: number;
|
|
10
|
+
startedAt?: string;
|
|
11
|
+
completedAt?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
stdoutStreamUrl?: string;
|
|
14
|
+
stderrStreamUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ExecutionGetParams {
|
|
17
|
+
executionId: string;
|
|
18
|
+
orgId?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves detailed information about a specific execution.
|
|
22
|
+
*
|
|
23
|
+
* @param client - The API client to use for the request
|
|
24
|
+
* @param params - Parameters including the execution ID
|
|
25
|
+
* @returns Detailed execution information including status, timing, and errors
|
|
26
|
+
* @throws {SandboxResponseError} If the execution is not found or request fails
|
|
27
|
+
*/
|
|
28
|
+
export declare function executionGet(client: APIClient, params: ExecutionGetParams): Promise<ExecutionInfo>;
|
|
29
|
+
export interface ExecutionListParams {
|
|
30
|
+
sandboxId: string;
|
|
31
|
+
orgId?: string;
|
|
32
|
+
limit?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ExecutionListResponse {
|
|
35
|
+
executions: ExecutionInfo[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Lists all executions for a specific sandbox.
|
|
39
|
+
*
|
|
40
|
+
* @param client - The API client to use for the request
|
|
41
|
+
* @param params - Parameters including the sandbox ID and optional limit
|
|
42
|
+
* @returns List of execution information for the sandbox
|
|
43
|
+
* @throws {SandboxResponseError} If the sandbox is not found or request fails
|
|
44
|
+
*/
|
|
45
|
+
export declare function executionList(client: APIClient, params: ExecutionListParams): Promise<ExecutionListResponse>;
|
|
46
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA8BvD,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,kBAAkB,GACxB,OAAO,CAAC,aAAa,CAAC,CA+BxB;AAED,MAAM,WAAW,mBAAmB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACrC,UAAU,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,mBAAmB,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema } from '../api';
|
|
3
|
+
import { SandboxResponseError, API_VERSION } from './util';
|
|
4
|
+
const ExecutionInfoSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
executionId: z.string().describe('Unique identifier for the execution'),
|
|
7
|
+
sandboxId: z.string().describe('ID of the sandbox where the execution ran'),
|
|
8
|
+
status: z
|
|
9
|
+
.enum(['queued', 'running', 'completed', 'failed', 'timeout', 'cancelled'])
|
|
10
|
+
.describe('Current status of the execution'),
|
|
11
|
+
command: z.array(z.string()).optional().describe('Command that was executed'),
|
|
12
|
+
exitCode: z.number().optional().describe('Exit code of the executed command'),
|
|
13
|
+
durationMs: z.number().optional().describe('Execution duration in milliseconds'),
|
|
14
|
+
startedAt: z.string().optional().describe('ISO timestamp when execution started'),
|
|
15
|
+
completedAt: z.string().optional().describe('ISO timestamp when execution completed'),
|
|
16
|
+
error: z.string().optional().describe('Error message if execution failed'),
|
|
17
|
+
stdoutStreamUrl: z.string().optional().describe('URL to stream stdout output'),
|
|
18
|
+
stderrStreamUrl: z.string().optional().describe('URL to stream stderr output'),
|
|
19
|
+
})
|
|
20
|
+
.describe('Detailed information about a command execution');
|
|
21
|
+
const ExecutionGetResponseSchema = APIResponseSchema(ExecutionInfoSchema);
|
|
22
|
+
const ExecutionListDataSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
executions: z.array(ExecutionInfoSchema).describe('List of executions'),
|
|
25
|
+
})
|
|
26
|
+
.describe('List of executions for a sandbox');
|
|
27
|
+
const ExecutionListResponseSchema = APIResponseSchema(ExecutionListDataSchema);
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves detailed information about a specific execution.
|
|
30
|
+
*
|
|
31
|
+
* @param client - The API client to use for the request
|
|
32
|
+
* @param params - Parameters including the execution ID
|
|
33
|
+
* @returns Detailed execution information including status, timing, and errors
|
|
34
|
+
* @throws {SandboxResponseError} If the execution is not found or request fails
|
|
35
|
+
*/
|
|
36
|
+
export async function executionGet(client, params) {
|
|
37
|
+
const { executionId, orgId } = params;
|
|
38
|
+
const queryParams = new URLSearchParams();
|
|
39
|
+
if (orgId) {
|
|
40
|
+
queryParams.set('orgId', orgId);
|
|
41
|
+
}
|
|
42
|
+
const queryString = queryParams.toString();
|
|
43
|
+
const url = `/sandbox/${API_VERSION}/execution/${executionId}${queryString ? `?${queryString}` : ''}`;
|
|
44
|
+
const resp = await client.get(url, ExecutionGetResponseSchema);
|
|
45
|
+
if (resp.success) {
|
|
46
|
+
return {
|
|
47
|
+
executionId: resp.data.executionId,
|
|
48
|
+
sandboxId: resp.data.sandboxId,
|
|
49
|
+
status: resp.data.status,
|
|
50
|
+
command: resp.data.command,
|
|
51
|
+
exitCode: resp.data.exitCode,
|
|
52
|
+
durationMs: resp.data.durationMs,
|
|
53
|
+
startedAt: resp.data.startedAt,
|
|
54
|
+
completedAt: resp.data.completedAt,
|
|
55
|
+
error: resp.data.error,
|
|
56
|
+
stdoutStreamUrl: resp.data.stdoutStreamUrl,
|
|
57
|
+
stderrStreamUrl: resp.data.stderrStreamUrl,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
throw new SandboxResponseError({ message: resp.message, executionId });
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Lists all executions for a specific sandbox.
|
|
64
|
+
*
|
|
65
|
+
* @param client - The API client to use for the request
|
|
66
|
+
* @param params - Parameters including the sandbox ID and optional limit
|
|
67
|
+
* @returns List of execution information for the sandbox
|
|
68
|
+
* @throws {SandboxResponseError} If the sandbox is not found or request fails
|
|
69
|
+
*/
|
|
70
|
+
export async function executionList(client, params) {
|
|
71
|
+
const { sandboxId, orgId, limit } = params;
|
|
72
|
+
const queryParams = new URLSearchParams();
|
|
73
|
+
if (orgId) {
|
|
74
|
+
queryParams.set('orgId', orgId);
|
|
75
|
+
}
|
|
76
|
+
if (limit !== undefined) {
|
|
77
|
+
queryParams.set('limit', String(limit));
|
|
78
|
+
}
|
|
79
|
+
const queryString = queryParams.toString();
|
|
80
|
+
const url = `/sandbox/${API_VERSION}/sandboxes/${sandboxId}/executions${queryString ? `?${queryString}` : ''}`;
|
|
81
|
+
const resp = await client.get(url, ExecutionListResponseSchema);
|
|
82
|
+
if (resp.success) {
|
|
83
|
+
return {
|
|
84
|
+
executions: resp.data.executions.map((exec) => ({
|
|
85
|
+
executionId: exec.executionId,
|
|
86
|
+
sandboxId: exec.sandboxId,
|
|
87
|
+
status: exec.status,
|
|
88
|
+
command: exec.command,
|
|
89
|
+
exitCode: exec.exitCode,
|
|
90
|
+
durationMs: exec.durationMs,
|
|
91
|
+
startedAt: exec.startedAt,
|
|
92
|
+
completedAt: exec.completedAt,
|
|
93
|
+
error: exec.error,
|
|
94
|
+
stdoutStreamUrl: exec.stdoutStreamUrl,
|
|
95
|
+
stderrStreamUrl: exec.stderrStreamUrl,
|
|
96
|
+
})),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
throw new SandboxResponseError({ message: resp.message, sandboxId });
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../src/api/sandb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C5B,GAAG,EACH,2BAA2B,CAC3B,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO;YACN,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC/C,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAyB;gBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,eAAe,EAAE,IAAI,CAAC,eAAe;aACrC,CAAC,CAAC;SACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIClient } from '../api';
|
|
3
|
+
import type { FileToWrite } from '@agentuity/core';
|
|
4
|
+
export declare const FileToWriteSchema: z.ZodObject<{
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
content: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export interface WriteFilesParams {
|
|
9
|
+
sandboxId: string;
|
|
10
|
+
files: FileToWrite[];
|
|
11
|
+
orgId?: string;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
export interface WriteFilesResult {
|
|
15
|
+
filesWritten: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Writes files to a sandbox workspace.
|
|
19
|
+
*
|
|
20
|
+
* @param client - The API client to use for the request
|
|
21
|
+
* @param params - Parameters including sandbox ID and files to write
|
|
22
|
+
* @returns The result including number of files written
|
|
23
|
+
* @throws {SandboxResponseError} If the write request fails
|
|
24
|
+
*/
|
|
25
|
+
export declare function sandboxWriteFiles(client: APIClient, params: WriteFilesParams): Promise<WriteFilesResult>;
|
|
26
|
+
export interface ReadFileParams {
|
|
27
|
+
sandboxId: string;
|
|
28
|
+
path: string;
|
|
29
|
+
orgId?: string;
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reads a file from a sandbox workspace.
|
|
34
|
+
*
|
|
35
|
+
* @param client - The API client to use for the request
|
|
36
|
+
* @param params - Parameters including sandbox ID and file path
|
|
37
|
+
* @returns A ReadableStream of the file contents
|
|
38
|
+
* @throws {SandboxResponseError} If the read request fails
|
|
39
|
+
*/
|
|
40
|
+
export declare function sandboxReadFile(client: APIClient, params: ReadFileParams): Promise<ReadableStream<Uint8Array>>;
|
|
41
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AA0BH,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAChC,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAgC3B;AAED,MAAM,WAAW,cAAc;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,cAAc,GACpB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CA6BrC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SandboxResponseError, API_VERSION } from './util';
|
|
3
|
+
export const FileToWriteSchema = z.object({
|
|
4
|
+
path: z.string().describe('Path to the file relative to the sandbox workspace'),
|
|
5
|
+
content: z.string().describe('Base64-encoded file content'),
|
|
6
|
+
});
|
|
7
|
+
const WriteFilesRequestSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
files: z.array(FileToWriteSchema).describe('Array of files to write'),
|
|
10
|
+
})
|
|
11
|
+
.describe('Request body for writing files to a sandbox');
|
|
12
|
+
const WriteFilesDataSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
filesWritten: z.number().describe('Number of files successfully written'),
|
|
15
|
+
})
|
|
16
|
+
.describe('Response data from writing files');
|
|
17
|
+
const WriteFilesResponseSchema = z.discriminatedUnion('success', [
|
|
18
|
+
z.object({
|
|
19
|
+
success: z.literal(false),
|
|
20
|
+
message: z.string().describe('the error message'),
|
|
21
|
+
}),
|
|
22
|
+
z.object({
|
|
23
|
+
success: z.literal(true),
|
|
24
|
+
data: WriteFilesDataSchema.optional(),
|
|
25
|
+
filesWritten: z.number().optional(),
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Writes files to a sandbox workspace.
|
|
30
|
+
*
|
|
31
|
+
* @param client - The API client to use for the request
|
|
32
|
+
* @param params - Parameters including sandbox ID and files to write
|
|
33
|
+
* @returns The result including number of files written
|
|
34
|
+
* @throws {SandboxResponseError} If the write request fails
|
|
35
|
+
*/
|
|
36
|
+
export async function sandboxWriteFiles(client, params) {
|
|
37
|
+
const { sandboxId, files, orgId, signal } = params;
|
|
38
|
+
const body = {
|
|
39
|
+
files: files.map((f) => ({
|
|
40
|
+
path: f.path,
|
|
41
|
+
content: f.content.toString('base64'),
|
|
42
|
+
})),
|
|
43
|
+
};
|
|
44
|
+
const queryParams = new URLSearchParams();
|
|
45
|
+
if (orgId) {
|
|
46
|
+
queryParams.set('orgId', orgId);
|
|
47
|
+
}
|
|
48
|
+
const queryString = queryParams.toString();
|
|
49
|
+
const url = `/fs/${API_VERSION}/${sandboxId}${queryString ? `?${queryString}` : ''}`;
|
|
50
|
+
const resp = await client.post(url, body, WriteFilesResponseSchema, WriteFilesRequestSchema, signal);
|
|
51
|
+
if (resp.success) {
|
|
52
|
+
return {
|
|
53
|
+
filesWritten: resp.data?.filesWritten ?? resp.filesWritten ?? 0,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
throw new SandboxResponseError({ message: resp.message, sandboxId });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads a file from a sandbox workspace.
|
|
60
|
+
*
|
|
61
|
+
* @param client - The API client to use for the request
|
|
62
|
+
* @param params - Parameters including sandbox ID and file path
|
|
63
|
+
* @returns A ReadableStream of the file contents
|
|
64
|
+
* @throws {SandboxResponseError} If the read request fails
|
|
65
|
+
*/
|
|
66
|
+
export async function sandboxReadFile(client, params) {
|
|
67
|
+
const { sandboxId, path, orgId, signal } = params;
|
|
68
|
+
const queryParams = new URLSearchParams();
|
|
69
|
+
queryParams.set('path', path);
|
|
70
|
+
if (orgId) {
|
|
71
|
+
queryParams.set('orgId', orgId);
|
|
72
|
+
}
|
|
73
|
+
const queryString = queryParams.toString();
|
|
74
|
+
const url = `/fs/${API_VERSION}/${sandboxId}?${queryString}`;
|
|
75
|
+
const response = await client.rawGet(url, signal);
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
const text = await response.text().catch(() => 'Unknown error');
|
|
78
|
+
throw new SandboxResponseError({
|
|
79
|
+
message: `Failed to read file: ${response.status} ${text}`,
|
|
80
|
+
sandboxId,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (!response.body) {
|
|
84
|
+
throw new SandboxResponseError({
|
|
85
|
+
message: 'No response body',
|
|
86
|
+
sandboxId,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return response.body;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/api/sandbox/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC/E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CAC3D,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACrE,CAAC;KACD,QAAQ,CAAC,6CAA6C,CAAC,CAAC;AAE1D,MAAM,oBAAoB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACP,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sC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wB,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;YAC1D,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,oBAAoB,CAAC;YAC9B,OAAO,EAAE,kBAAkB;YAC3B,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { APIClient } from '../api';
|
|
2
|
+
import type { SandboxInfo } from '@agentuity/core';
|
|
3
|
+
export interface SandboxGetParams {
|
|
4
|
+
sandboxId: string;
|
|
5
|
+
orgId?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves information about a specific sandbox.
|
|
9
|
+
*
|
|
10
|
+
* @param client - The API client to use for the request
|
|
11
|
+
* @param params - Parameters including the sandbox ID
|
|
12
|
+
* @returns Sandbox information including status, creation time, and execution count
|
|
13
|
+
* @throws {SandboxResponseError} If the sandbox is not found or request fails
|
|
14
|
+
*/
|
|
15
|
+
export declare function sandboxGet(client: APIClient, params: SandboxGetParams): Promise<SandboxInfo>;
|
|
16
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAwBlE,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,WAAW,CAAC,CA8BtB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema } from '../api';
|
|
3
|
+
import { SandboxResponseError, API_VERSION } from './util';
|
|
4
|
+
const SandboxInfoDataSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
sandboxId: z.string().describe('Unique identifier for the sandbox'),
|
|
7
|
+
status: z
|
|
8
|
+
.enum(['creating', 'idle', 'running', 'terminated', 'failed'])
|
|
9
|
+
.describe('Current status of the sandbox'),
|
|
10
|
+
createdAt: z.string().describe('ISO timestamp when the sandbox was created'),
|
|
11
|
+
region: z.string().optional().describe('Region where the sandbox is running'),
|
|
12
|
+
snapshotId: z.string().optional().describe('Snapshot ID this sandbox was created from'),
|
|
13
|
+
snapshotTag: z.string().optional().describe('Snapshot tag this sandbox was created from'),
|
|
14
|
+
executions: z.number().describe('Total number of executions in this sandbox'),
|
|
15
|
+
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
16
|
+
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
17
|
+
dependencies: z
|
|
18
|
+
.array(z.string())
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Apt packages installed in the sandbox'),
|
|
21
|
+
})
|
|
22
|
+
.describe('Detailed information about a sandbox');
|
|
23
|
+
const SandboxGetResponseSchema = APIResponseSchema(SandboxInfoDataSchema);
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves information about a specific sandbox.
|
|
26
|
+
*
|
|
27
|
+
* @param client - The API client to use for the request
|
|
28
|
+
* @param params - Parameters including the sandbox ID
|
|
29
|
+
* @returns Sandbox information including status, creation time, and execution count
|
|
30
|
+
* @throws {SandboxResponseError} If the sandbox is not found or request fails
|
|
31
|
+
*/
|
|
32
|
+
export async function sandboxGet(client, params) {
|
|
33
|
+
const { sandboxId, orgId } = params;
|
|
34
|
+
const queryParams = new URLSearchParams();
|
|
35
|
+
if (orgId) {
|
|
36
|
+
queryParams.set('orgId', orgId);
|
|
37
|
+
}
|
|
38
|
+
const queryString = queryParams.toString();
|
|
39
|
+
const url = `/sandbox/${API_VERSION}/${sandboxId}${queryString ? `?${queryString}` : ''}`;
|
|
40
|
+
const resp = await client.get(url, SandboxGetResponseSchema);
|
|
41
|
+
if (resp.success) {
|
|
42
|
+
return {
|
|
43
|
+
sandboxId: resp.data.sandboxId,
|
|
44
|
+
status: resp.data.status,
|
|
45
|
+
createdAt: resp.data.createdAt,
|
|
46
|
+
region: resp.data.region,
|
|
47
|
+
snapshotId: resp.data.snapshotId,
|
|
48
|
+
snapshotTag: resp.data.snapshotTag,
|
|
49
|
+
executions: resp.data.executions,
|
|
50
|
+
stdoutStreamUrl: resp.data.stdoutStreamUrl,
|
|
51
|
+
stderrStreamUrl: resp.data.stderrStreamUrl,
|
|
52
|
+
dependencies: resp.data.dependencies,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
throw new SandboxResponseError({ message: resp.message, sandboxId });
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/api/sandbox/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG3D,MAAM,qBAAqB,GAAG,CAAC;KAC7B,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACnE,MAAM,EAAE,CAAC;SACP,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;SAC7D,QAAQ,CAAC,+BAA+B,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAA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AC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAE1F,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAC5B,GAAG,EACH,wBAAwB,CACxB,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO;YACN,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAuB;YACzC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;YACxB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAChC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YAClC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAChC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAC1C,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAC1C,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY;SACpC,CAAC;IACH,CAAC;IAED,MAAM,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { sandboxCreate } from './create';
|
|
2
|
+
export type { SandboxCreateResponse, SandboxCreateParams } from './create';
|
|
3
|
+
export { sandboxExecute } from './execute';
|
|
4
|
+
export type { SandboxExecuteParams } from './execute';
|
|
5
|
+
export { sandboxGet } from './get';
|
|
6
|
+
export type { SandboxGetParams } from './get';
|
|
7
|
+
export { sandboxList } from './list';
|
|
8
|
+
export type { SandboxListParams } from './list';
|
|
9
|
+
export { sandboxDestroy } from './destroy';
|
|
10
|
+
export type { SandboxDestroyParams } from './destroy';
|
|
11
|
+
export { sandboxRun } from './run';
|
|
12
|
+
export type { SandboxRunParams } from './run';
|
|
13
|
+
export { executionGet, executionList } from './execution';
|
|
14
|
+
export type { ExecutionInfo, ExecutionGetParams, ExecutionListParams, ExecutionListResponse, } from './execution';
|
|
15
|
+
export { SandboxResponseError, writeAndDrain } from './util';
|
|
16
|
+
export { SandboxClient } from './client';
|
|
17
|
+
export type { SandboxClientOptions, SandboxInstance, ExecuteOptions } from './client';
|
|
18
|
+
export { sandboxWriteFiles, sandboxReadFile } from './files';
|
|
19
|
+
export type { WriteFilesParams, WriteFilesResult, ReadFileParams } from './files';
|
|
20
|
+
export { snapshotCreate, snapshotGet, snapshotList, snapshotDelete, snapshotTag } from './snapshot';
|
|
21
|
+
export type { SnapshotInfo, SnapshotFileInfo, SnapshotCreateParams, SnapshotGetParams, SnapshotListParams, SnapshotListResponse, SnapshotDeleteParams, SnapshotTagParams, } from './snapshot';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpG,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { sandboxCreate } from './create';
|
|
2
|
+
export { sandboxExecute } from './execute';
|
|
3
|
+
export { sandboxGet } from './get';
|
|
4
|
+
export { sandboxList } from './list';
|
|
5
|
+
export { sandboxDestroy } from './destroy';
|
|
6
|
+
export { sandboxRun } from './run';
|
|
7
|
+
export { executionGet, executionList } from './execution';
|
|
8
|
+
export { SandboxResponseError, writeAndDrain } from './util';
|
|
9
|
+
export { SandboxClient } from './client';
|
|
10
|
+
export { sandboxWriteFiles, sandboxReadFile } from './files';
|
|
11
|
+
export { snapshotCreate, snapshotGet, snapshotList, snapshotDelete, snapshotTag } from './snapshot';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/sandbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO1D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { APIClient } from '../api';
|
|
2
|
+
import type { ListSandboxesParams, ListSandboxesResponse } from '@agentuity/core';
|
|
3
|
+
export interface SandboxListParams extends ListSandboxesParams {
|
|
4
|
+
orgId?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Lists sandboxes with optional filtering and pagination.
|
|
8
|
+
*
|
|
9
|
+
* @param client - The API client to use for the request
|
|
10
|
+
* @param params - Optional parameters for filtering by project, status, and pagination
|
|
11
|
+
* @returns Paginated list of sandboxes with total count
|
|
12
|
+
* @throws {SandboxResponseError} If the request fails
|
|
13
|
+
*/
|
|
14
|
+
export declare function sandboxList(client: APIClient, params?: SandboxListParams): Promise<ListSandboxesResponse>;
|
|
15
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,QAAQ,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAiB,MAAM,iBAAiB,CAAC;AA2BjG,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,qBAAqB,CAAC,CAgDhC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema } from '../api';
|
|
3
|
+
import { SandboxResponseError, API_VERSION } from './util';
|
|
4
|
+
const SandboxInfoSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
sandboxId: z.string().describe('Unique identifier for the sandbox'),
|
|
7
|
+
status: z
|
|
8
|
+
.enum(['creating', 'idle', 'running', 'terminated', 'failed'])
|
|
9
|
+
.describe('Current status of the sandbox'),
|
|
10
|
+
createdAt: z.string().describe('ISO timestamp when the sandbox was created'),
|
|
11
|
+
region: z.string().optional().describe('Region where the sandbox is running'),
|
|
12
|
+
snapshotId: z.string().optional().describe('Snapshot ID this sandbox was created from'),
|
|
13
|
+
snapshotTag: z.string().optional().describe('Snapshot tag this sandbox was created from'),
|
|
14
|
+
executions: z.number().describe('Total number of executions in this sandbox'),
|
|
15
|
+
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
16
|
+
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
17
|
+
})
|
|
18
|
+
.describe('Summary information about a sandbox');
|
|
19
|
+
const ListSandboxesDataSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
sandboxes: z.array(SandboxInfoSchema).describe('List of sandbox entries'),
|
|
22
|
+
total: z.number().describe('Total number of sandboxes matching the query'),
|
|
23
|
+
})
|
|
24
|
+
.describe('Paginated list of sandboxes');
|
|
25
|
+
const ListSandboxesResponseSchema = APIResponseSchema(ListSandboxesDataSchema);
|
|
26
|
+
/**
|
|
27
|
+
* Lists sandboxes with optional filtering and pagination.
|
|
28
|
+
*
|
|
29
|
+
* @param client - The API client to use for the request
|
|
30
|
+
* @param params - Optional parameters for filtering by project, status, and pagination
|
|
31
|
+
* @returns Paginated list of sandboxes with total count
|
|
32
|
+
* @throws {SandboxResponseError} If the request fails
|
|
33
|
+
*/
|
|
34
|
+
export async function sandboxList(client, params) {
|
|
35
|
+
const queryParams = new URLSearchParams();
|
|
36
|
+
if (params?.orgId) {
|
|
37
|
+
queryParams.set('orgId', params.orgId);
|
|
38
|
+
}
|
|
39
|
+
if (params?.projectId) {
|
|
40
|
+
queryParams.set('projectId', params.projectId);
|
|
41
|
+
}
|
|
42
|
+
if (params?.snapshotId) {
|
|
43
|
+
queryParams.set('snapshotId', params.snapshotId);
|
|
44
|
+
}
|
|
45
|
+
if (params?.status) {
|
|
46
|
+
queryParams.set('status', params.status);
|
|
47
|
+
}
|
|
48
|
+
if (params?.limit !== undefined) {
|
|
49
|
+
queryParams.set('limit', params.limit.toString());
|
|
50
|
+
}
|
|
51
|
+
if (params?.offset !== undefined) {
|
|
52
|
+
queryParams.set('offset', params.offset.toString());
|
|
53
|
+
}
|
|
54
|
+
const queryString = queryParams.toString();
|
|
55
|
+
const url = `/sandbox/${API_VERSION}${queryString ? `?${queryString}` : ''}`;
|
|
56
|
+
const resp = await client.get(url, ListSandboxesResponseSchema);
|
|
57
|
+
if (resp.success) {
|
|
58
|
+
return {
|
|
59
|
+
sandboxes: resp.data.sandboxes.map((s) => ({
|
|
60
|
+
sandboxId: s.sandboxId,
|
|
61
|
+
status: s.status,
|
|
62
|
+
createdAt: s.createdAt,
|
|
63
|
+
region: s.region,
|
|
64
|
+
snapshotId: s.snapshotId,
|
|
65
|
+
snapshotTag: s.snapshotTag,
|
|
66
|
+
executions: s.executions,
|
|
67
|
+
stdoutStreamUrl: s.stdoutStreamUrl,
|
|
68
|
+
stderrStreamUrl: s.stderrStreamUrl,
|
|
69
|
+
})),
|
|
70
|
+
total: resp.data.total,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/api/sandbox/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG3D,MAAM,iBAAiB,GAAG,CAAC;KACzB,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACnE,MAAM,EAAE,CAAC;SACP,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;SAC7D,QAAQ,CAAC,+BAA+B,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAC5E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC7E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACvF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAA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AED,MAAM,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Logger } from '@agentuity/core';
|
|
2
|
+
import type { Readable, Writable } from 'node:stream';
|
|
3
|
+
import { APIClient } from '../api';
|
|
4
|
+
import type { SandboxRunOptions, SandboxRunResult } from '@agentuity/core';
|
|
5
|
+
export interface SandboxRunParams {
|
|
6
|
+
options: SandboxRunOptions;
|
|
7
|
+
orgId?: string;
|
|
8
|
+
region?: string;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
stdin?: Readable;
|
|
12
|
+
stdout?: Writable;
|
|
13
|
+
stderr?: Writable;
|
|
14
|
+
logger?: Logger;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a sandbox, executes a command, and waits for completion.
|
|
18
|
+
*
|
|
19
|
+
* This is a high-level convenience function that handles the full lifecycle:
|
|
20
|
+
* creating a sandbox, streaming I/O, polling for completion, and cleanup.
|
|
21
|
+
*
|
|
22
|
+
* @param client - The API client to use for the request
|
|
23
|
+
* @param params - Parameters including command options, I/O streams, and timeout settings
|
|
24
|
+
* @returns The run result including exit code and duration
|
|
25
|
+
* @throws {SandboxResponseError} If sandbox creation fails, execution times out, or is cancelled
|
|
26
|
+
*/
|
|
27
|
+
export declare function sandboxRun(client: APIClient, params: SandboxRunParams): Promise<SandboxRunResult>;
|
|
28
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAKnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAM3E,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC/B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,gBAAgB,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAwK3B"}
|