@agentuity/server 0.1.16 → 0.1.17
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 +19 -12
- 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/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/queue/analytics.d.ts +108 -0
- package/dist/api/queue/analytics.d.ts.map +1 -0
- package/dist/api/queue/analytics.js +245 -0
- package/dist/api/queue/analytics.js.map +1 -0
- package/dist/api/queue/destinations.d.ts +108 -0
- package/dist/api/queue/destinations.d.ts.map +1 -0
- package/dist/api/queue/destinations.js +238 -0
- package/dist/api/queue/destinations.js.map +1 -0
- package/dist/api/queue/dlq.d.ts +100 -0
- package/dist/api/queue/dlq.d.ts.map +1 -0
- package/dist/api/queue/dlq.js +204 -0
- package/dist/api/queue/dlq.js.map +1 -0
- package/dist/api/queue/index.d.ts +55 -0
- package/dist/api/queue/index.d.ts.map +1 -0
- package/dist/api/queue/index.js +86 -0
- package/dist/api/queue/index.js.map +1 -0
- package/dist/api/queue/messages.d.ts +332 -0
- package/dist/api/queue/messages.d.ts.map +1 -0
- package/dist/api/queue/messages.js +637 -0
- package/dist/api/queue/messages.js.map +1 -0
- package/dist/api/queue/queues.d.ts +153 -0
- package/dist/api/queue/queues.d.ts.map +1 -0
- package/dist/api/queue/queues.js +319 -0
- package/dist/api/queue/queues.js.map +1 -0
- package/dist/api/queue/sources.d.ts +132 -0
- package/dist/api/queue/sources.d.ts.map +1 -0
- package/dist/api/queue/sources.js +285 -0
- package/dist/api/queue/sources.js.map +1 -0
- package/dist/api/queue/types.d.ts +1129 -0
- package/dist/api/queue/types.d.ts.map +1 -0
- package/dist/api/queue/types.js +949 -0
- package/dist/api/queue/types.js.map +1 -0
- package/dist/api/queue/util.d.ts +262 -0
- package/dist/api/queue/util.d.ts.map +1 -0
- package/dist/api/queue/util.js +171 -0
- package/dist/api/queue/util.js.map +1 -0
- package/dist/api/queue/validation.d.ts +247 -0
- package/dist/api/queue/validation.d.ts.map +1 -0
- package/dist/api/queue/validation.js +513 -0
- package/dist/api/queue/validation.js.map +1 -0
- package/dist/api/sandbox/get.d.ts.map +1 -1
- package/dist/api/sandbox/get.js +5 -0
- package/dist/api/sandbox/get.js.map +1 -1
- package/dist/api/sandbox/index.d.ts +3 -3
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +1 -1
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/run.d.ts.map +1 -1
- package/dist/api/sandbox/run.js +5 -2
- package/dist/api/sandbox/run.js.map +1 -1
- package/dist/api/sandbox/snapshot-build.d.ts +2 -0
- package/dist/api/sandbox/snapshot-build.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot-build.js +4 -0
- package/dist/api/sandbox/snapshot-build.js.map +1 -1
- package/dist/api/sandbox/snapshot.d.ts +44 -1
- package/dist/api/sandbox/snapshot.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot.js +77 -4
- package/dist/api/sandbox/snapshot.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +62 -13
- package/src/api/index.ts +1 -0
- package/src/api/org/env-delete.ts +1 -4
- package/src/api/org/env-get.ts +1 -4
- package/src/api/org/env-update.ts +1 -4
- package/src/api/queue/analytics.ts +313 -0
- package/src/api/queue/destinations.ts +321 -0
- package/src/api/queue/dlq.ts +283 -0
- package/src/api/queue/index.ts +261 -0
- package/src/api/queue/messages.ts +875 -0
- package/src/api/queue/queues.ts +448 -0
- package/src/api/queue/sources.ts +384 -0
- package/src/api/queue/types.ts +1253 -0
- package/src/api/queue/util.ts +204 -0
- package/src/api/queue/validation.ts +560 -0
- package/src/api/sandbox/get.ts +5 -0
- package/src/api/sandbox/index.ts +9 -1
- package/src/api/sandbox/run.ts +5 -2
- package/src/api/sandbox/snapshot-build.ts +4 -0
- package/src/api/sandbox/snapshot.ts +96 -5
|
@@ -6,6 +6,9 @@ const SnapshotFileInfoSchema = z
|
|
|
6
6
|
.object({
|
|
7
7
|
path: z.string().describe('File path within the snapshot'),
|
|
8
8
|
size: z.number().describe('File size in bytes'),
|
|
9
|
+
sha256: z.string().describe('SHA256 hash of the file contents'),
|
|
10
|
+
contentType: z.string().describe('MIME type of the file'),
|
|
11
|
+
mode: z.number().describe('Unix file mode/permissions (e.g., 0o644)'),
|
|
9
12
|
})
|
|
10
13
|
.describe('Information about a file in a snapshot');
|
|
11
14
|
|
|
@@ -22,6 +25,10 @@ const SnapshotInfoSchema = z
|
|
|
22
25
|
.describe(
|
|
23
26
|
'Display name for the snapshot (URL-safe: letters, numbers, underscores, dashes)'
|
|
24
27
|
),
|
|
28
|
+
fullName: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Full name with org slug for public snapshots (@slug/name:tag)'),
|
|
25
32
|
description: z.string().nullable().optional().describe('Description of the snapshot'),
|
|
26
33
|
tag: z.string().nullable().optional().describe('Tag for the snapshot (defaults to "latest")'),
|
|
27
34
|
sizeBytes: z.number().describe('Total size of the snapshot in bytes'),
|
|
@@ -31,6 +38,9 @@ const SnapshotInfoSchema = z
|
|
|
31
38
|
.nullable()
|
|
32
39
|
.optional()
|
|
33
40
|
.describe('ID of the parent snapshot (for incremental snapshots)'),
|
|
41
|
+
public: z.boolean().optional().describe('Whether the snapshot is publicly accessible'),
|
|
42
|
+
orgName: z.string().optional().describe('Organization name (for public snapshots)'),
|
|
43
|
+
orgSlug: z.string().optional().describe('Organization slug (for public snapshots)'),
|
|
34
44
|
createdAt: z.string().describe('ISO timestamp when the snapshot was created'),
|
|
35
45
|
downloadUrl: z.string().optional().describe('URL to download the snapshot archive'),
|
|
36
46
|
files: z
|
|
@@ -67,6 +77,10 @@ const _SnapshotCreateParamsSchema = z
|
|
|
67
77
|
name: z.string().optional().describe('Display name for the snapshot'),
|
|
68
78
|
description: z.string().optional().describe('Description of the snapshot'),
|
|
69
79
|
tag: z.string().optional().describe('Tag for the snapshot'),
|
|
80
|
+
public: z
|
|
81
|
+
.boolean()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('Whether to make the snapshot publicly accessible (default: false)'),
|
|
70
84
|
orgId: z.string().optional().describe('Organization ID'),
|
|
71
85
|
})
|
|
72
86
|
.describe('Parameters for creating a snapshot');
|
|
@@ -131,11 +145,11 @@ export async function snapshotCreate(
|
|
|
131
145
|
client: APIClient,
|
|
132
146
|
params: SnapshotCreateParams
|
|
133
147
|
): Promise<SnapshotInfo> {
|
|
134
|
-
const { sandboxId, name, description, tag, orgId } = params;
|
|
148
|
+
const { sandboxId, name, description, tag, public: isPublic, orgId } = params;
|
|
135
149
|
const queryString = buildQueryString({ orgId });
|
|
136
150
|
const url = `/sandbox/${API_VERSION}/${sandboxId}/snapshot${queryString}`;
|
|
137
151
|
|
|
138
|
-
const body: Record<string, string> = {};
|
|
152
|
+
const body: Record<string, string | boolean> = {};
|
|
139
153
|
if (name) {
|
|
140
154
|
body.name = name;
|
|
141
155
|
}
|
|
@@ -145,6 +159,9 @@ export async function snapshotCreate(
|
|
|
145
159
|
if (tag) {
|
|
146
160
|
body.tag = tag;
|
|
147
161
|
}
|
|
162
|
+
if (isPublic !== undefined) {
|
|
163
|
+
body.public = isPublic;
|
|
164
|
+
}
|
|
148
165
|
|
|
149
166
|
const resp = await client.post<z.infer<typeof SnapshotCreateResponseSchema>>(
|
|
150
167
|
url,
|
|
@@ -283,6 +300,10 @@ const _SnapshotBuildInitParamsSchema = z
|
|
|
283
300
|
.describe('SHA-256 hash of snapshot content for change detection'),
|
|
284
301
|
force: z.boolean().optional().describe('Force rebuild even if content is unchanged'),
|
|
285
302
|
encrypt: z.boolean().optional().describe('Request encryption for the snapshot archive'),
|
|
303
|
+
public: z
|
|
304
|
+
.boolean()
|
|
305
|
+
.optional()
|
|
306
|
+
.describe('Make snapshot public (enables virus scanning, disables encryption)'),
|
|
286
307
|
orgId: z.string().optional().describe('Organization ID'),
|
|
287
308
|
})
|
|
288
309
|
.describe('Parameters for initializing a snapshot build');
|
|
@@ -293,8 +314,7 @@ const SnapshotBuildInitResponseSchema = z
|
|
|
293
314
|
uploadUrl: z
|
|
294
315
|
.string()
|
|
295
316
|
.optional()
|
|
296
|
-
.describe('Pre-signed URL for uploading the snapshot archive'),
|
|
297
|
-
s3Key: z.string().optional().describe('S3 key where the snapshot will be stored'),
|
|
317
|
+
.describe('Pre-signed URL for uploading the snapshot archive (private snapshots only)'),
|
|
298
318
|
publicKey: z
|
|
299
319
|
.string()
|
|
300
320
|
.optional()
|
|
@@ -340,7 +360,8 @@ export async function snapshotBuildInit(
|
|
|
340
360
|
client: APIClient,
|
|
341
361
|
params: SnapshotBuildInitParams
|
|
342
362
|
): Promise<SnapshotBuildInitResponse> {
|
|
343
|
-
const { runtime, name, description, tag, contentHash, force, encrypt, orgId } =
|
|
363
|
+
const { runtime, name, description, tag, contentHash, force, encrypt, public: isPublic, orgId } =
|
|
364
|
+
params;
|
|
344
365
|
const queryString = buildQueryString({ orgId });
|
|
345
366
|
const url = `/sandbox/${API_VERSION}/snapshots/build${queryString}`;
|
|
346
367
|
|
|
@@ -351,6 +372,7 @@ export async function snapshotBuildInit(
|
|
|
351
372
|
if (contentHash) body.contentHash = contentHash;
|
|
352
373
|
if (force) body.force = force;
|
|
353
374
|
if (encrypt) body.encrypt = encrypt;
|
|
375
|
+
if (isPublic !== undefined) body.public = isPublic;
|
|
354
376
|
|
|
355
377
|
const resp = await client.post<z.infer<typeof SnapshotBuildInitAPIResponseSchema>>(
|
|
356
378
|
url,
|
|
@@ -402,3 +424,72 @@ export async function snapshotBuildFinalize(
|
|
|
402
424
|
|
|
403
425
|
throw new SandboxResponseError({ message: resp.message });
|
|
404
426
|
}
|
|
427
|
+
|
|
428
|
+
// ===== Snapshot Upload API (for public snapshots) =====
|
|
429
|
+
|
|
430
|
+
const SnapshotUploadResponseSchema = z
|
|
431
|
+
.object({
|
|
432
|
+
success: z.boolean().describe('Whether the upload was successful'),
|
|
433
|
+
scanned: z.boolean().describe('Whether the upload was virus scanned'),
|
|
434
|
+
message: z.string().optional().describe('Optional message'),
|
|
435
|
+
})
|
|
436
|
+
.describe('Response from snapshot upload API');
|
|
437
|
+
|
|
438
|
+
const _SnapshotUploadAPIResponseSchema = APIResponseSchema(SnapshotUploadResponseSchema);
|
|
439
|
+
|
|
440
|
+
export type SnapshotUploadResponse = z.infer<typeof SnapshotUploadResponseSchema>;
|
|
441
|
+
|
|
442
|
+
export interface SnapshotUploadParams {
|
|
443
|
+
snapshotId: string;
|
|
444
|
+
body: Uint8Array | ArrayBuffer | ReadableStream<Uint8Array> | string | Blob;
|
|
445
|
+
contentLength: number;
|
|
446
|
+
orgId?: string;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Upload a public snapshot archive via Catalyst (with virus scanning).
|
|
451
|
+
* This should only be used when snapshotBuildInit returns no uploadUrl.
|
|
452
|
+
*
|
|
453
|
+
* @param client - The API client to use for the request
|
|
454
|
+
* @param params - Parameters including snapshotId and the archive body
|
|
455
|
+
* @returns Upload result with scan status
|
|
456
|
+
* @throws {SandboxResponseError} If the upload fails or malware is detected
|
|
457
|
+
*/
|
|
458
|
+
export async function snapshotUpload(
|
|
459
|
+
client: APIClient,
|
|
460
|
+
params: SnapshotUploadParams
|
|
461
|
+
): Promise<SnapshotUploadResponse> {
|
|
462
|
+
const { snapshotId, body, contentLength, orgId } = params;
|
|
463
|
+
const queryString = buildQueryString({ orgId });
|
|
464
|
+
const url = `/sandbox/${API_VERSION}/snapshots/${snapshotId}/upload${queryString}`;
|
|
465
|
+
|
|
466
|
+
const response = await client.rawPut(url, body, 'application/gzip', undefined, {
|
|
467
|
+
'Content-Length': String(contentLength),
|
|
468
|
+
Accept: 'application/json',
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
if (!response.ok) {
|
|
472
|
+
const text = await response.text();
|
|
473
|
+
let message = `Upload failed: ${response.status} ${response.statusText}`;
|
|
474
|
+
try {
|
|
475
|
+
const json = JSON.parse(text);
|
|
476
|
+
if (json.message) {
|
|
477
|
+
message = json.message;
|
|
478
|
+
} else if (json.error) {
|
|
479
|
+
message = typeof json.error === 'string' ? json.error : JSON.stringify(json.error);
|
|
480
|
+
}
|
|
481
|
+
} catch {
|
|
482
|
+
if (text) {
|
|
483
|
+
message = text;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
throw new SandboxResponseError({ message });
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const data = (await response.json()) as z.infer<typeof _SnapshotUploadAPIResponseSchema>;
|
|
490
|
+
if (data.success) {
|
|
491
|
+
return data.data;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
throw new SandboxResponseError({ message: data.message });
|
|
495
|
+
}
|