@agentuity/server 0.0.105 → 0.0.107
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,269 @@
|
|
|
1
|
+
import { sandboxCreate } from './create';
|
|
2
|
+
import { sandboxDestroy } from './destroy';
|
|
3
|
+
import { sandboxGet } from './get';
|
|
4
|
+
import { SandboxResponseError, writeAndDrain } from './util';
|
|
5
|
+
import { getServiceUrls } from '../../config';
|
|
6
|
+
const POLL_INTERVAL_MS = 500;
|
|
7
|
+
const MAX_POLL_ATTEMPTS = 7200;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a sandbox, executes a command, and waits for completion.
|
|
10
|
+
*
|
|
11
|
+
* This is a high-level convenience function that handles the full lifecycle:
|
|
12
|
+
* creating a sandbox, streaming I/O, polling for completion, and cleanup.
|
|
13
|
+
*
|
|
14
|
+
* @param client - The API client to use for the request
|
|
15
|
+
* @param params - Parameters including command options, I/O streams, and timeout settings
|
|
16
|
+
* @returns The run result including exit code and duration
|
|
17
|
+
* @throws {SandboxResponseError} If sandbox creation fails, execution times out, or is cancelled
|
|
18
|
+
*/
|
|
19
|
+
export async function sandboxRun(client, params) {
|
|
20
|
+
const { options, orgId, region, apiKey, signal, stdin, stdout, stderr, logger } = params;
|
|
21
|
+
const started = Date.now();
|
|
22
|
+
let stdinStreamId;
|
|
23
|
+
let stdinStreamUrl;
|
|
24
|
+
// If stdin is provided and has data, create a stream for it
|
|
25
|
+
if (stdin && region && apiKey) {
|
|
26
|
+
const streamResult = await createStdinStream(region, apiKey, orgId, logger);
|
|
27
|
+
stdinStreamId = streamResult.id;
|
|
28
|
+
stdinStreamUrl = streamResult.url;
|
|
29
|
+
logger?.debug('created stdin stream: %s', stdinStreamId);
|
|
30
|
+
}
|
|
31
|
+
const createResponse = await sandboxCreate(client, {
|
|
32
|
+
options: {
|
|
33
|
+
...options,
|
|
34
|
+
command: {
|
|
35
|
+
exec: options.command.exec,
|
|
36
|
+
files: options.command.files,
|
|
37
|
+
mode: 'oneshot',
|
|
38
|
+
},
|
|
39
|
+
stream: {
|
|
40
|
+
...options.stream,
|
|
41
|
+
stdin: stdinStreamId,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
orgId,
|
|
45
|
+
});
|
|
46
|
+
const sandboxId = createResponse.sandboxId;
|
|
47
|
+
const stdoutStreamUrl = createResponse.stdoutStreamUrl;
|
|
48
|
+
const stderrStreamUrl = createResponse.stderrStreamUrl;
|
|
49
|
+
logger?.debug('sandbox created: %s, stdoutUrl: %s, stderrUrl: %s', sandboxId, stdoutStreamUrl ?? 'none', stderrStreamUrl ?? 'none');
|
|
50
|
+
const abortController = new AbortController();
|
|
51
|
+
const streamPromises = [];
|
|
52
|
+
try {
|
|
53
|
+
// Start stdin streaming if we have stdin and a stream URL
|
|
54
|
+
if (stdin && stdinStreamUrl && apiKey) {
|
|
55
|
+
const stdinPromise = streamStdinToUrl(stdin, stdinStreamUrl, apiKey, abortController.signal, logger);
|
|
56
|
+
streamPromises.push(stdinPromise);
|
|
57
|
+
}
|
|
58
|
+
// Check if stdout and stderr are the same stream (combined output)
|
|
59
|
+
const isCombinedOutput = stdoutStreamUrl && stderrStreamUrl && stdoutStreamUrl === stderrStreamUrl;
|
|
60
|
+
if (isCombinedOutput) {
|
|
61
|
+
// Stream combined output to stdout only to avoid duplicates
|
|
62
|
+
if (stdout) {
|
|
63
|
+
logger?.debug('using combined output stream (stdout === stderr)');
|
|
64
|
+
const combinedPromise = streamUrlToWritable(stdoutStreamUrl, stdout, abortController.signal, logger);
|
|
65
|
+
streamPromises.push(combinedPromise);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// Start stdout streaming
|
|
70
|
+
if (stdoutStreamUrl && stdout) {
|
|
71
|
+
const stdoutPromise = streamUrlToWritable(stdoutStreamUrl, stdout, abortController.signal, logger);
|
|
72
|
+
streamPromises.push(stdoutPromise);
|
|
73
|
+
}
|
|
74
|
+
// Start stderr streaming
|
|
75
|
+
if (stderrStreamUrl && stderr) {
|
|
76
|
+
const stderrPromise = streamUrlToWritable(stderrStreamUrl, stderr, abortController.signal, logger);
|
|
77
|
+
streamPromises.push(stderrPromise);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Poll for sandbox completion in parallel with streaming
|
|
81
|
+
let attempts = 0;
|
|
82
|
+
let finalStatus = null;
|
|
83
|
+
while (attempts < MAX_POLL_ATTEMPTS) {
|
|
84
|
+
if (signal?.aborted) {
|
|
85
|
+
abortController.abort();
|
|
86
|
+
throw new SandboxResponseError({
|
|
87
|
+
message: 'Sandbox execution cancelled',
|
|
88
|
+
sandboxId,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
await sleep(POLL_INTERVAL_MS);
|
|
92
|
+
attempts++;
|
|
93
|
+
try {
|
|
94
|
+
const sandboxInfo = await sandboxGet(client, { sandboxId, orgId });
|
|
95
|
+
if (sandboxInfo.status === 'terminated') {
|
|
96
|
+
finalStatus = 'terminated';
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (sandboxInfo.status === 'failed') {
|
|
100
|
+
finalStatus = 'failed';
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Ignore polling errors, continue
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Sandbox completed - wait for streams to complete naturally (EOF)
|
|
110
|
+
// Pulse closes streams when the sandbox terminates, so streams should EOF
|
|
111
|
+
// We must wait for streams to fully drain before returning
|
|
112
|
+
logger?.debug('waiting for streams to complete...');
|
|
113
|
+
await Promise.allSettled(streamPromises);
|
|
114
|
+
logger?.debug('streams completed');
|
|
115
|
+
if (finalStatus === 'terminated') {
|
|
116
|
+
return {
|
|
117
|
+
sandboxId,
|
|
118
|
+
exitCode: 0,
|
|
119
|
+
durationMs: Date.now() - started,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (finalStatus === 'failed') {
|
|
123
|
+
return {
|
|
124
|
+
sandboxId,
|
|
125
|
+
exitCode: 1,
|
|
126
|
+
durationMs: Date.now() - started,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
throw new SandboxResponseError({
|
|
130
|
+
message: 'Sandbox execution polling timed out',
|
|
131
|
+
sandboxId,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
abortController.abort();
|
|
136
|
+
try {
|
|
137
|
+
await sandboxDestroy(client, { sandboxId, orgId });
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Ignore cleanup errors
|
|
141
|
+
}
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async function createStdinStream(region, apiKey, orgId, logger) {
|
|
146
|
+
const urls = getServiceUrls(region);
|
|
147
|
+
const streamBaseUrl = urls.stream;
|
|
148
|
+
// Build URL with orgId query param for CLI token validation
|
|
149
|
+
const queryParams = new URLSearchParams();
|
|
150
|
+
if (orgId) {
|
|
151
|
+
queryParams.set('orgId', orgId);
|
|
152
|
+
}
|
|
153
|
+
const queryString = queryParams.toString();
|
|
154
|
+
const url = `${streamBaseUrl}${queryString ? `?${queryString}` : ''}`;
|
|
155
|
+
logger?.trace('creating stdin stream: %s', url);
|
|
156
|
+
const response = await fetch(url, {
|
|
157
|
+
method: 'POST',
|
|
158
|
+
headers: {
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
Authorization: `Bearer ${apiKey}`,
|
|
161
|
+
},
|
|
162
|
+
body: JSON.stringify({
|
|
163
|
+
name: `sandbox-stdin-${Date.now()}`,
|
|
164
|
+
}),
|
|
165
|
+
});
|
|
166
|
+
if (!response.ok) {
|
|
167
|
+
throw new Error(`Failed to create stdin stream: ${response.status} ${response.statusText}`);
|
|
168
|
+
}
|
|
169
|
+
const data = (await response.json());
|
|
170
|
+
logger?.debug('created stdin stream: %s', data.id);
|
|
171
|
+
// Include orgId in the URL for subsequent PUT requests (needed for CLI token auth)
|
|
172
|
+
const putQueryString = orgId ? `?orgId=${encodeURIComponent(orgId)}` : '';
|
|
173
|
+
return {
|
|
174
|
+
id: data.id,
|
|
175
|
+
url: `${streamBaseUrl}/${data.id}${putQueryString}`,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
async function streamStdinToUrl(stdin, url, apiKey, signal, logger) {
|
|
179
|
+
try {
|
|
180
|
+
logger?.debug('streaming stdin to: %s', url);
|
|
181
|
+
// Convert Node.js Readable to a web ReadableStream for fetch body
|
|
182
|
+
let controllerClosed = false;
|
|
183
|
+
const webStream = new ReadableStream({
|
|
184
|
+
start(controller) {
|
|
185
|
+
stdin.on('data', (chunk) => {
|
|
186
|
+
if (!signal.aborted && !controllerClosed) {
|
|
187
|
+
controller.enqueue(chunk);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
stdin.on('end', () => {
|
|
191
|
+
if (!controllerClosed) {
|
|
192
|
+
controllerClosed = true;
|
|
193
|
+
controller.close();
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
stdin.on('error', (err) => {
|
|
197
|
+
if (!controllerClosed) {
|
|
198
|
+
controllerClosed = true;
|
|
199
|
+
controller.error(err);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
signal.addEventListener('abort', () => {
|
|
203
|
+
if (!controllerClosed) {
|
|
204
|
+
controllerClosed = true;
|
|
205
|
+
controller.close();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
const response = await fetch(url, {
|
|
211
|
+
method: 'PUT',
|
|
212
|
+
headers: {
|
|
213
|
+
Authorization: `Bearer ${apiKey}`,
|
|
214
|
+
},
|
|
215
|
+
body: webStream,
|
|
216
|
+
signal,
|
|
217
|
+
duplex: 'half',
|
|
218
|
+
});
|
|
219
|
+
if (!response.ok) {
|
|
220
|
+
logger?.debug('stdin stream PUT failed: %d', response.status);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
logger?.debug('stdin stream completed');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
228
|
+
logger?.debug('stdin stream aborted (expected on completion)');
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
logger?.debug('stdin stream error: %s', err);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async function streamUrlToWritable(url, writable, signal, logger) {
|
|
236
|
+
try {
|
|
237
|
+
logger?.debug('fetching stream: %s', url);
|
|
238
|
+
const response = await fetch(url, { signal });
|
|
239
|
+
logger?.debug('stream response status: %d', response.status);
|
|
240
|
+
if (!response.ok || !response.body) {
|
|
241
|
+
logger?.debug('stream response not ok or no body');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const reader = response.body.getReader();
|
|
245
|
+
// Read until EOF - Pulse will block until data is available
|
|
246
|
+
while (true) {
|
|
247
|
+
const { done, value } = await reader.read();
|
|
248
|
+
if (done) {
|
|
249
|
+
logger?.debug('stream EOF');
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
if (value) {
|
|
253
|
+
logger?.debug('stream chunk: %d bytes', value.length);
|
|
254
|
+
await writeAndDrain(writable, value);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
catch (err) {
|
|
259
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
260
|
+
logger?.debug('stream aborted');
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
logger?.debug('stream error: %s', err);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function sleep(ms) {
|
|
267
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/api/sandbox/run.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAc/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,MAAiB,EACjB,MAAwB;IAExB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzF,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE3B,IAAI,aAAiC,CAAC;IACtC,IAAI,cAAkC,CAAC;IAEvC,4DAA4D;IAC5D,IAAI,KAAK,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;QAC/B,MA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
}
|
|
6
|
+
export interface SnapshotInfo {
|
|
7
|
+
snapshotId: string;
|
|
8
|
+
sandboxId: string;
|
|
9
|
+
tag?: string | null;
|
|
10
|
+
sizeBytes: number;
|
|
11
|
+
fileCount: number;
|
|
12
|
+
parentSnapshotId?: string | null;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
downloadUrl?: string;
|
|
15
|
+
files?: SnapshotFileInfo[];
|
|
16
|
+
}
|
|
17
|
+
export interface SnapshotCreateParams {
|
|
18
|
+
sandboxId: string;
|
|
19
|
+
tag?: string;
|
|
20
|
+
orgId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SnapshotGetParams {
|
|
23
|
+
snapshotId: string;
|
|
24
|
+
orgId?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SnapshotListParams {
|
|
27
|
+
sandboxId?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
orgId?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SnapshotListResponse {
|
|
33
|
+
snapshots: SnapshotInfo[];
|
|
34
|
+
total: number;
|
|
35
|
+
}
|
|
36
|
+
export interface SnapshotDeleteParams {
|
|
37
|
+
snapshotId: string;
|
|
38
|
+
orgId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SnapshotTagParams {
|
|
41
|
+
snapshotId: string;
|
|
42
|
+
tag: string | null;
|
|
43
|
+
orgId?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates a snapshot of a sandbox's current state.
|
|
47
|
+
*
|
|
48
|
+
* @param client - The API client to use for the request
|
|
49
|
+
* @param params - Parameters including sandbox ID and optional tag
|
|
50
|
+
* @returns The created snapshot information
|
|
51
|
+
* @throws {SandboxResponseError} If the snapshot creation fails
|
|
52
|
+
*/
|
|
53
|
+
export declare function snapshotCreate(client: APIClient, params: SnapshotCreateParams): Promise<SnapshotInfo>;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves detailed information about a specific snapshot.
|
|
56
|
+
*
|
|
57
|
+
* @param client - The API client to use for the request
|
|
58
|
+
* @param params - Parameters including the snapshot ID
|
|
59
|
+
* @returns Snapshot information including files and download URL
|
|
60
|
+
* @throws {SandboxResponseError} If the snapshot is not found or request fails
|
|
61
|
+
*/
|
|
62
|
+
export declare function snapshotGet(client: APIClient, params: SnapshotGetParams): Promise<SnapshotInfo>;
|
|
63
|
+
/**
|
|
64
|
+
* Lists snapshots with optional filtering and pagination.
|
|
65
|
+
*
|
|
66
|
+
* @param client - The API client to use for the request
|
|
67
|
+
* @param params - Optional parameters for filtering by sandbox and pagination
|
|
68
|
+
* @returns Paginated list of snapshots with total count
|
|
69
|
+
* @throws {SandboxResponseError} If the request fails
|
|
70
|
+
*/
|
|
71
|
+
export declare function snapshotList(client: APIClient, params?: SnapshotListParams): Promise<SnapshotListResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Deletes a snapshot and releases its storage.
|
|
74
|
+
*
|
|
75
|
+
* @param client - The API client to use for the request
|
|
76
|
+
* @param params - Parameters including the snapshot ID to delete
|
|
77
|
+
* @throws {SandboxResponseError} If the snapshot is not found or deletion fails
|
|
78
|
+
*/
|
|
79
|
+
export declare function snapshotDelete(client: APIClient, params: SnapshotDeleteParams): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Updates or removes the tag on a snapshot.
|
|
82
|
+
*
|
|
83
|
+
* @param client - The API client to use for the request
|
|
84
|
+
* @param params - Parameters including snapshot ID and new tag (or null to remove)
|
|
85
|
+
* @returns Updated snapshot information
|
|
86
|
+
* @throws {SandboxResponseError} If the snapshot is not found or update fails
|
|
87
|
+
*/
|
|
88
|
+
export declare function snapshotTag(client: APIClient, params: SnapshotTagParams): Promise<SnapshotInfo>;
|
|
89
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,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;;;;;GAOG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,oBAAoB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAqBvB;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,iBAAiB,GACvB,OAAO,CAAC,YAAY,CAAC,CAevB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,GAAE,kBAAuB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAe/B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,oBAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,iBAAiB,GACvB,OAAO,CAAC,YAAY,CAAC,CAgBvB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
3
|
+
import { SandboxResponseError } from './util';
|
|
4
|
+
const SNAPSHOT_API_VERSION = '2025-06-26';
|
|
5
|
+
const SnapshotFileInfoSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
path: z.string().describe('File path within the snapshot'),
|
|
8
|
+
size: z.number().describe('File size in bytes'),
|
|
9
|
+
})
|
|
10
|
+
.describe('Information about a file in a snapshot');
|
|
11
|
+
const SnapshotInfoSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
snapshotId: z.string().describe('Unique identifier for the snapshot'),
|
|
14
|
+
sandboxId: z.string().describe('ID of the sandbox this snapshot was created from'),
|
|
15
|
+
tag: z.string().nullable().optional().describe('User-defined tag for the snapshot'),
|
|
16
|
+
sizeBytes: z.number().describe('Total size of the snapshot in bytes'),
|
|
17
|
+
fileCount: z.number().describe('Number of files in the snapshot'),
|
|
18
|
+
parentSnapshotId: z
|
|
19
|
+
.string()
|
|
20
|
+
.nullable()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('ID of the parent snapshot (for incremental snapshots)'),
|
|
23
|
+
createdAt: z.string().describe('ISO timestamp when the snapshot was created'),
|
|
24
|
+
downloadUrl: z.string().optional().describe('URL to download the snapshot archive'),
|
|
25
|
+
files: z.array(SnapshotFileInfoSchema).optional().describe('List of files in the snapshot'),
|
|
26
|
+
})
|
|
27
|
+
.describe('Detailed information about a snapshot');
|
|
28
|
+
const SnapshotCreateResponseSchema = APIResponseSchema(SnapshotInfoSchema);
|
|
29
|
+
const SnapshotGetResponseSchema = APIResponseSchema(SnapshotInfoSchema);
|
|
30
|
+
const SnapshotListDataSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
snapshots: z.array(SnapshotInfoSchema).describe('List of snapshot entries'),
|
|
33
|
+
total: z.number().describe('Total number of snapshots matching the query'),
|
|
34
|
+
})
|
|
35
|
+
.describe('Paginated list of snapshots');
|
|
36
|
+
const SnapshotListResponseSchema = APIResponseSchema(SnapshotListDataSchema);
|
|
37
|
+
const SnapshotDeleteResponseSchema = APIResponseSchemaNoData();
|
|
38
|
+
function buildQueryString(params) {
|
|
39
|
+
const query = new URLSearchParams();
|
|
40
|
+
for (const [key, value] of Object.entries(params)) {
|
|
41
|
+
if (value !== undefined) {
|
|
42
|
+
query.set(key, String(value));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const str = query.toString();
|
|
46
|
+
return str ? `?${str}` : '';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a snapshot of a sandbox's current state.
|
|
50
|
+
*
|
|
51
|
+
* @param client - The API client to use for the request
|
|
52
|
+
* @param params - Parameters including sandbox ID and optional tag
|
|
53
|
+
* @returns The created snapshot information
|
|
54
|
+
* @throws {SandboxResponseError} If the snapshot creation fails
|
|
55
|
+
*/
|
|
56
|
+
export async function snapshotCreate(client, params) {
|
|
57
|
+
const { sandboxId, tag, orgId } = params;
|
|
58
|
+
const queryString = buildQueryString({ orgId });
|
|
59
|
+
const url = `/sandbox/${SNAPSHOT_API_VERSION}/${sandboxId}/snapshot${queryString}`;
|
|
60
|
+
const body = {};
|
|
61
|
+
if (tag) {
|
|
62
|
+
body.tag = tag;
|
|
63
|
+
}
|
|
64
|
+
const resp = await client.post(url, body, SnapshotCreateResponseSchema);
|
|
65
|
+
if (resp.success) {
|
|
66
|
+
return resp.data;
|
|
67
|
+
}
|
|
68
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves detailed information about a specific snapshot.
|
|
72
|
+
*
|
|
73
|
+
* @param client - The API client to use for the request
|
|
74
|
+
* @param params - Parameters including the snapshot ID
|
|
75
|
+
* @returns Snapshot information including files and download URL
|
|
76
|
+
* @throws {SandboxResponseError} If the snapshot is not found or request fails
|
|
77
|
+
*/
|
|
78
|
+
export async function snapshotGet(client, params) {
|
|
79
|
+
const { snapshotId, orgId } = params;
|
|
80
|
+
const queryString = buildQueryString({ orgId });
|
|
81
|
+
const url = `/sandbox/${SNAPSHOT_API_VERSION}/snapshots/${snapshotId}${queryString}`;
|
|
82
|
+
const resp = await client.get(url, SnapshotGetResponseSchema);
|
|
83
|
+
if (resp.success) {
|
|
84
|
+
return resp.data;
|
|
85
|
+
}
|
|
86
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Lists snapshots with optional filtering and pagination.
|
|
90
|
+
*
|
|
91
|
+
* @param client - The API client to use for the request
|
|
92
|
+
* @param params - Optional parameters for filtering by sandbox and pagination
|
|
93
|
+
* @returns Paginated list of snapshots with total count
|
|
94
|
+
* @throws {SandboxResponseError} If the request fails
|
|
95
|
+
*/
|
|
96
|
+
export async function snapshotList(client, params = {}) {
|
|
97
|
+
const { sandboxId, limit, offset, orgId } = params;
|
|
98
|
+
const queryString = buildQueryString({ sandboxId, limit, offset, orgId });
|
|
99
|
+
const url = `/sandbox/${SNAPSHOT_API_VERSION}/snapshots${queryString}`;
|
|
100
|
+
const resp = await client.get(url, SnapshotListResponseSchema);
|
|
101
|
+
if (resp.success) {
|
|
102
|
+
return resp.data;
|
|
103
|
+
}
|
|
104
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Deletes a snapshot and releases its storage.
|
|
108
|
+
*
|
|
109
|
+
* @param client - The API client to use for the request
|
|
110
|
+
* @param params - Parameters including the snapshot ID to delete
|
|
111
|
+
* @throws {SandboxResponseError} If the snapshot is not found or deletion fails
|
|
112
|
+
*/
|
|
113
|
+
export async function snapshotDelete(client, params) {
|
|
114
|
+
const { snapshotId, orgId } = params;
|
|
115
|
+
const queryString = buildQueryString({ orgId });
|
|
116
|
+
const url = `/sandbox/${SNAPSHOT_API_VERSION}/snapshots/${snapshotId}${queryString}`;
|
|
117
|
+
const resp = await client.delete(url, SnapshotDeleteResponseSchema);
|
|
118
|
+
if (!resp.success) {
|
|
119
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Updates or removes the tag on a snapshot.
|
|
124
|
+
*
|
|
125
|
+
* @param client - The API client to use for the request
|
|
126
|
+
* @param params - Parameters including snapshot ID and new tag (or null to remove)
|
|
127
|
+
* @returns Updated snapshot information
|
|
128
|
+
* @throws {SandboxResponseError} If the snapshot is not found or update fails
|
|
129
|
+
*/
|
|
130
|
+
export async function snapshotTag(client, params) {
|
|
131
|
+
const { snapshotId, tag, orgId } = params;
|
|
132
|
+
const queryString = buildQueryString({ orgId });
|
|
133
|
+
const url = `/sandbox/${SNAPSHOT_API_VERSION}/snapshots/${snapshotId}${queryString}`;
|
|
134
|
+
const resp = await client.patch(url, { tag }, SnapshotGetResponseSchema);
|
|
135
|
+
if (resp.success) {
|
|
136
|
+
return resp.data;
|
|
137
|
+
}
|
|
138
|
+
throw new SandboxResponseError({ message: resp.message });
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../src/api/sandbox/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAE1C,MAAM,sBAAsB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAC/C,CAAC;KACD,QAAQ,CAAC,wCAAwC,CAAC,CAAC;AAErD,MAAM,kBAAkB,GAAG,CAAC;KAC1B,MAAM,CAAC;IACP,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACrE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IAClF,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACnF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACrE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACjE,gBAAgB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAA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E,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;AACF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,MAAiB,EACjB,MAAyB;IAEzB,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAC1C,MAAM,WAAW,GAAG,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,YAAY,oBAAoB,cAAc,UAAU,GAAG,WAAW,EAAE,CAAC;IAErF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAC9B,GAAG,EACH,EAAE,GAAG,EAAE,EACP,yBAAyB,CACzB,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { EventEmitter } from 'node:events';
|
|
2
|
+
interface WritableWithDrain extends EventEmitter {
|
|
3
|
+
write(chunk: Uint8Array): boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Error thrown when a sandbox API request fails.
|
|
7
|
+
*
|
|
8
|
+
* Includes optional context about which sandbox or execution caused the error.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SandboxResponseError: {
|
|
11
|
+
new (args?: ({
|
|
12
|
+
/** The sandbox ID associated with the error, if applicable */
|
|
13
|
+
sandboxId?: string;
|
|
14
|
+
/** The execution ID associated with the error, if applicable */
|
|
15
|
+
executionId?: string;
|
|
16
|
+
} & {
|
|
17
|
+
message?: string;
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
}) | undefined): import("@agentuity/core").RichError & {
|
|
20
|
+
readonly _tag: "SandboxResponseError";
|
|
21
|
+
} & Readonly<{
|
|
22
|
+
/** The sandbox ID associated with the error, if applicable */
|
|
23
|
+
sandboxId?: string;
|
|
24
|
+
/** The execution ID associated with the error, if applicable */
|
|
25
|
+
executionId?: string;
|
|
26
|
+
}>;
|
|
27
|
+
readonly defaultMessage?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Current sandbox API version */
|
|
30
|
+
export declare const API_VERSION = "2025-03-17";
|
|
31
|
+
/**
|
|
32
|
+
* Write a chunk to a writable stream and wait for it to drain if necessary.
|
|
33
|
+
* Properly cleans up event listeners to avoid memory leaks.
|
|
34
|
+
*/
|
|
35
|
+
export declare function writeAndDrain(writable: WritableWithDrain, chunk: Uint8Array): Promise<void>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/api/sandbox/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,UAAU,iBAAkB,SAAQ,YAAY;IAC/C,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;CAClC;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;QAChC,8DAA8D;oBAClD,MAAM;QAClB,gEAAgE;sBAClD,MAAM;;;;;;;QAHpB,8DAA8D;oBAClD,MAAM;QAClB,gEAAgE;sBAClD,MAAM;;;CACjB,CAAC;AAEL,kCAAkC;AAClC,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B3F"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StructuredError } from '@agentuity/core';
|
|
2
|
+
/**
|
|
3
|
+
* Error thrown when a sandbox API request fails.
|
|
4
|
+
*
|
|
5
|
+
* Includes optional context about which sandbox or execution caused the error.
|
|
6
|
+
*/
|
|
7
|
+
export const SandboxResponseError = StructuredError('SandboxResponseError')();
|
|
8
|
+
/** Current sandbox API version */
|
|
9
|
+
export const API_VERSION = '2025-03-17';
|
|
10
|
+
/**
|
|
11
|
+
* Write a chunk to a writable stream and wait for it to drain if necessary.
|
|
12
|
+
* Properly cleans up event listeners to avoid memory leaks.
|
|
13
|
+
*/
|
|
14
|
+
export function writeAndDrain(writable, chunk) {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
let needsDrain;
|
|
17
|
+
try {
|
|
18
|
+
needsDrain = !writable.write(chunk);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
reject(err);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (needsDrain) {
|
|
25
|
+
const cleanup = () => {
|
|
26
|
+
writable.removeListener('drain', onDrain);
|
|
27
|
+
writable.removeListener('error', onError);
|
|
28
|
+
};
|
|
29
|
+
const onDrain = () => {
|
|
30
|
+
cleanup();
|
|
31
|
+
resolve();
|
|
32
|
+
};
|
|
33
|
+
const onError = (err) => {
|
|
34
|
+
cleanup();
|
|
35
|
+
reject(err);
|
|
36
|
+
};
|
|
37
|
+
writable.once('drain', onDrain);
|
|
38
|
+
writable.once('error', onError);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/api/sandbox/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAOlD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,sBAAsB,CAAC,EAKvE,CAAC;AAEL,kCAAkC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAA2B,EAAE,KAAiB;IAC3E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAI,UAAmB,CAAC;QACxB,IAAI,CAAC;YACJ,UAAU,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,CAAC,GAAG,CAAC,CAAC;YACZ,OAAO;QACR,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,GAAG,EAAE;gBACpB,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC1C,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC3C,CAAC,CAAC;YACF,MAAM,OAAO,GAAG,GAAG,EAAE;gBACpB,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;YACX,CAAC,CAAC;YACF,MAAM,OAAO,GAAG,CAAC,GAAU,EAAE,EAAE;gBAC9B,OAAO,EAAE,CAAC;gBACV,MAAM,CAAC,GAAG,CAAC,CAAC;YACb,CAAC,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACX,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAW3D"}
|
package/dist/config.js
CHANGED
|
@@ -9,6 +9,7 @@ export function getServiceUrls(region) {
|
|
|
9
9
|
vector: process.env.AGENTUITY_VECTOR_URL || transportUrl,
|
|
10
10
|
catalyst: process.env.AGENTUITY_CATALYST_URL || transportUrl,
|
|
11
11
|
otel: process.env.AGENTUITY_OTLP_URL || buildRegionalURL(region, 'otel'),
|
|
12
|
+
sandbox: process.env.AGENTUITY_SANDBOX_URL || transportUrl,
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
function getDomainSuffix(region) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAEjG,OAAO;QACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;QAC5D,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC;QAC/E,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,YAAY;QACxD,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;QAC5D,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC;QACxE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,YAAY;KAC1D,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAe;IACvC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,cAAc,CAAC;IACvB,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAe,EAAE,QAAiB;IAC3D,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,WAAW,QAAQ,IAAI,MAAM,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,WAAW,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bootstrap.d.ts","sourceRoot":"","sources":["../src/runtime-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"runtime-bootstrap.d.ts","sourceRoot":"","sources":["../src/runtime-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B,GAAG,IAAI,CA0C/E"}
|