@agentuity/sandbox 3.0.12 → 3.1.1

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.
Files changed (122) hide show
  1. package/AGENTS.md +3 -3
  2. package/dist/api-reference.d.ts +1221 -0
  3. package/dist/api-reference.d.ts.map +1 -0
  4. package/dist/api-reference.js +1046 -0
  5. package/dist/api-reference.js.map +1 -0
  6. package/dist/base64.d.ts +2 -0
  7. package/dist/base64.d.ts.map +1 -0
  8. package/dist/base64.js +14 -0
  9. package/dist/base64.js.map +1 -0
  10. package/dist/client.d.ts +431 -0
  11. package/dist/client.d.ts.map +1 -0
  12. package/dist/client.js +632 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/create.d.ts +203 -0
  15. package/dist/create.d.ts.map +1 -0
  16. package/dist/create.js +235 -0
  17. package/dist/create.js.map +1 -0
  18. package/dist/destroy.d.ts +23 -0
  19. package/dist/destroy.d.ts.map +1 -0
  20. package/dist/destroy.js +30 -0
  21. package/dist/destroy.js.map +1 -0
  22. package/dist/disk-checkpoint.d.ts +108 -0
  23. package/dist/disk-checkpoint.d.ts.map +1 -0
  24. package/dist/disk-checkpoint.js +124 -0
  25. package/dist/disk-checkpoint.js.map +1 -0
  26. package/dist/events.d.ts +56 -0
  27. package/dist/events.d.ts.map +1 -0
  28. package/dist/events.js +54 -0
  29. package/dist/events.js.map +1 -0
  30. package/dist/execute.d.ts +99 -0
  31. package/dist/execute.d.ts.map +1 -0
  32. package/dist/execute.js +138 -0
  33. package/dist/execute.js.map +1 -0
  34. package/dist/execution.d.ts +150 -0
  35. package/dist/execution.d.ts.map +1 -0
  36. package/dist/execution.js +120 -0
  37. package/dist/execution.js.map +1 -0
  38. package/dist/files.d.ts +283 -0
  39. package/dist/files.d.ts.map +1 -0
  40. package/dist/files.js +471 -0
  41. package/dist/files.js.map +1 -0
  42. package/dist/get.d.ts +288 -0
  43. package/dist/get.d.ts.map +1 -0
  44. package/dist/get.js +256 -0
  45. package/dist/get.js.map +1 -0
  46. package/dist/getStatus.d.ts +23 -0
  47. package/dist/getStatus.d.ts.map +1 -0
  48. package/dist/getStatus.js +53 -0
  49. package/dist/getStatus.js.map +1 -0
  50. package/dist/index.d.ts +42 -1
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +22 -1
  53. package/dist/index.js.map +1 -1
  54. package/dist/job.d.ts +227 -0
  55. package/dist/job.d.ts.map +1 -0
  56. package/dist/job.js +109 -0
  57. package/dist/job.js.map +1 -0
  58. package/dist/list.d.ts +330 -0
  59. package/dist/list.d.ts.map +1 -0
  60. package/dist/list.js +209 -0
  61. package/dist/list.js.map +1 -0
  62. package/dist/pause.d.ts +39 -0
  63. package/dist/pause.d.ts.map +1 -0
  64. package/dist/pause.js +48 -0
  65. package/dist/pause.js.map +1 -0
  66. package/dist/resolve.d.ts +75 -0
  67. package/dist/resolve.d.ts.map +1 -0
  68. package/dist/resolve.js +76 -0
  69. package/dist/resolve.js.map +1 -0
  70. package/dist/resume.d.ts +23 -0
  71. package/dist/resume.d.ts.map +1 -0
  72. package/dist/resume.js +30 -0
  73. package/dist/resume.js.map +1 -0
  74. package/dist/run.d.ts +73 -0
  75. package/dist/run.d.ts.map +1 -0
  76. package/dist/run.js +568 -0
  77. package/dist/run.js.map +1 -0
  78. package/dist/runtime.d.ts +94 -0
  79. package/dist/runtime.d.ts.map +1 -0
  80. package/dist/runtime.js +82 -0
  81. package/dist/runtime.js.map +1 -0
  82. package/dist/snapshot-build.d.ts +48 -0
  83. package/dist/snapshot-build.d.ts.map +1 -0
  84. package/dist/snapshot-build.js +72 -0
  85. package/dist/snapshot-build.js.map +1 -0
  86. package/dist/snapshot.d.ts +596 -0
  87. package/dist/snapshot.d.ts.map +1 -0
  88. package/dist/snapshot.js +612 -0
  89. package/dist/snapshot.js.map +1 -0
  90. package/dist/types.d.ts +1010 -0
  91. package/dist/types.d.ts.map +1 -0
  92. package/dist/types.js +853 -0
  93. package/dist/types.js.map +1 -0
  94. package/dist/util.d.ts +296 -0
  95. package/dist/util.d.ts.map +1 -0
  96. package/dist/util.js +234 -0
  97. package/dist/util.js.map +1 -0
  98. package/package.json +7 -2
  99. package/src/api-reference.ts +1094 -0
  100. package/src/base64.ts +14 -0
  101. package/src/client.ts +998 -0
  102. package/src/create.ts +273 -0
  103. package/src/destroy.ts +43 -0
  104. package/src/disk-checkpoint.ts +184 -0
  105. package/src/events.ts +72 -0
  106. package/src/execute.ts +167 -0
  107. package/src/execution.ts +152 -0
  108. package/src/files.ts +637 -0
  109. package/src/get.ts +291 -0
  110. package/src/getStatus.ts +72 -0
  111. package/src/index.ts +252 -18
  112. package/src/job.ts +161 -0
  113. package/src/list.ts +239 -0
  114. package/src/pause.ts +75 -0
  115. package/src/resolve.ts +96 -0
  116. package/src/resume.ts +41 -0
  117. package/src/run.ts +783 -0
  118. package/src/runtime.ts +106 -0
  119. package/src/snapshot-build.ts +94 -0
  120. package/src/snapshot.ts +791 -0
  121. package/src/types.ts +1033 -0
  122. package/src/util.ts +280 -0
@@ -0,0 +1,203 @@
1
+ import { z } from 'zod';
2
+ import { type APIClient } from '@agentuity/api';
3
+ export declare const SandboxCreateRequestSchema: z.ZodObject<{
4
+ projectId: z.ZodOptional<z.ZodString>;
5
+ runtime: z.ZodOptional<z.ZodString>;
6
+ runtimeId: z.ZodOptional<z.ZodString>;
7
+ name: z.ZodOptional<z.ZodString>;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ resources: z.ZodOptional<z.ZodObject<{
10
+ memory: z.ZodOptional<z.ZodString>;
11
+ cpu: z.ZodOptional<z.ZodString>;
12
+ disk: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>>;
14
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ network: z.ZodOptional<z.ZodObject<{
16
+ enabled: z.ZodOptional<z.ZodBoolean>;
17
+ port: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>>;
19
+ stream: z.ZodOptional<z.ZodObject<{
20
+ stdout: z.ZodOptional<z.ZodString>;
21
+ stderr: z.ZodOptional<z.ZodString>;
22
+ stdin: z.ZodOptional<z.ZodString>;
23
+ timestamps: z.ZodOptional<z.ZodBoolean>;
24
+ }, z.core.$strip>>;
25
+ timeout: z.ZodOptional<z.ZodObject<{
26
+ idle: z.ZodOptional<z.ZodString>;
27
+ execution: z.ZodOptional<z.ZodString>;
28
+ paused: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>>;
30
+ command: z.ZodOptional<z.ZodObject<{
31
+ exec: z.ZodArray<z.ZodString>;
32
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ path: z.ZodString;
34
+ content: z.ZodString;
35
+ }, z.core.$strip>>>;
36
+ mode: z.ZodOptional<z.ZodEnum<{
37
+ interactive: "interactive";
38
+ oneshot: "oneshot";
39
+ }>>;
40
+ }, z.core.$strip>>;
41
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
+ path: z.ZodString;
43
+ content: z.ZodString;
44
+ }, z.core.$strip>>>;
45
+ snapshot: z.ZodOptional<z.ZodString>;
46
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ }, z.core.$strip>;
51
+ export declare const SandboxCreateDataSchema: z.ZodObject<{
52
+ sandboxId: z.ZodString;
53
+ status: z.ZodEnum<{
54
+ creating: "creating";
55
+ failed: "failed";
56
+ idle: "idle";
57
+ paused: "paused";
58
+ running: "running";
59
+ stopping: "stopping";
60
+ suspended: "suspended";
61
+ terminated: "terminated";
62
+ }>;
63
+ executionId: z.ZodOptional<z.ZodString>;
64
+ url: z.ZodOptional<z.ZodString>;
65
+ stdoutStreamId: z.ZodOptional<z.ZodString>;
66
+ stdoutStreamUrl: z.ZodOptional<z.ZodString>;
67
+ stderrStreamId: z.ZodOptional<z.ZodString>;
68
+ stderrStreamUrl: z.ZodOptional<z.ZodString>;
69
+ auditStreamId: z.ZodOptional<z.ZodString>;
70
+ auditStreamUrl: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>;
72
+ export declare const SandboxCreateResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
73
+ success: z.ZodLiteral<false>;
74
+ message: z.ZodString;
75
+ code: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strip>, z.ZodObject<{
77
+ success: z.ZodLiteral<true>;
78
+ data: z.ZodObject<{
79
+ sandboxId: z.ZodString;
80
+ status: z.ZodEnum<{
81
+ creating: "creating";
82
+ failed: "failed";
83
+ idle: "idle";
84
+ paused: "paused";
85
+ running: "running";
86
+ stopping: "stopping";
87
+ suspended: "suspended";
88
+ terminated: "terminated";
89
+ }>;
90
+ executionId: z.ZodOptional<z.ZodString>;
91
+ url: z.ZodOptional<z.ZodString>;
92
+ stdoutStreamId: z.ZodOptional<z.ZodString>;
93
+ stdoutStreamUrl: z.ZodOptional<z.ZodString>;
94
+ stderrStreamId: z.ZodOptional<z.ZodString>;
95
+ stderrStreamUrl: z.ZodOptional<z.ZodString>;
96
+ auditStreamId: z.ZodOptional<z.ZodString>;
97
+ auditStreamUrl: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strip>;
99
+ }, z.core.$strip>], "success">;
100
+ export type SandboxCreateResponse = z.infer<typeof SandboxCreateDataSchema>;
101
+ export declare const SandboxCreateParamsSchema: z.ZodObject<{
102
+ options: z.ZodOptional<z.ZodCustom<{
103
+ projectId?: string | undefined;
104
+ runtime?: string | undefined;
105
+ runtimeId?: string | undefined;
106
+ name?: string | undefined;
107
+ description?: string | undefined;
108
+ resources?: {
109
+ memory?: string | undefined;
110
+ cpu?: string | undefined;
111
+ disk?: string | undefined;
112
+ } | undefined;
113
+ env?: Record<string, string> | undefined;
114
+ network?: {
115
+ enabled?: boolean | undefined;
116
+ port?: number | undefined;
117
+ } | undefined;
118
+ stream?: {
119
+ stdout?: string | undefined;
120
+ stderr?: string | undefined;
121
+ stdin?: string | undefined;
122
+ timestamps?: boolean | undefined;
123
+ } | undefined;
124
+ timeout?: {
125
+ idle?: string | undefined;
126
+ execution?: string | undefined;
127
+ paused?: string | undefined;
128
+ } | undefined;
129
+ command?: {
130
+ exec: string[];
131
+ files?: {
132
+ path: string;
133
+ content: Uint8Array<ArrayBuffer>;
134
+ }[] | undefined;
135
+ mode?: "interactive" | "oneshot" | undefined;
136
+ } | undefined;
137
+ files?: {
138
+ path: string;
139
+ content: Uint8Array<ArrayBuffer>;
140
+ }[] | undefined;
141
+ snapshot?: string | undefined;
142
+ dependencies?: string[] | undefined;
143
+ packages?: string[] | undefined;
144
+ metadata?: Record<string, unknown> | undefined;
145
+ scopes?: string[] | undefined;
146
+ }, {
147
+ projectId?: string | undefined;
148
+ runtime?: string | undefined;
149
+ runtimeId?: string | undefined;
150
+ name?: string | undefined;
151
+ description?: string | undefined;
152
+ resources?: {
153
+ memory?: string | undefined;
154
+ cpu?: string | undefined;
155
+ disk?: string | undefined;
156
+ } | undefined;
157
+ env?: Record<string, string> | undefined;
158
+ network?: {
159
+ enabled?: boolean | undefined;
160
+ port?: number | undefined;
161
+ } | undefined;
162
+ stream?: {
163
+ stdout?: string | undefined;
164
+ stderr?: string | undefined;
165
+ stdin?: string | undefined;
166
+ timestamps?: boolean | undefined;
167
+ } | undefined;
168
+ timeout?: {
169
+ idle?: string | undefined;
170
+ execution?: string | undefined;
171
+ paused?: string | undefined;
172
+ } | undefined;
173
+ command?: {
174
+ exec: string[];
175
+ files?: {
176
+ path: string;
177
+ content: Uint8Array<ArrayBuffer>;
178
+ }[] | undefined;
179
+ mode?: "interactive" | "oneshot" | undefined;
180
+ } | undefined;
181
+ files?: {
182
+ path: string;
183
+ content: Uint8Array<ArrayBuffer>;
184
+ }[] | undefined;
185
+ snapshot?: string | undefined;
186
+ dependencies?: string[] | undefined;
187
+ packages?: string[] | undefined;
188
+ metadata?: Record<string, unknown> | undefined;
189
+ scopes?: string[] | undefined;
190
+ }>>;
191
+ orgId: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ export type SandboxCreateParams = z.infer<typeof SandboxCreateParamsSchema>;
194
+ /**
195
+ * Creates a new sandbox instance.
196
+ *
197
+ * @param client - The API client to use for the request
198
+ * @param params - Parameters for creating the sandbox
199
+ * @returns The created sandbox response including sandbox ID and stream URLs
200
+ * @throws {SandboxResponseError} If the sandbox creation fails
201
+ */
202
+ export declare function sandboxCreate(client: APIClient, params?: SandboxCreateParams): Promise<SandboxCreateResponse>;
203
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAKnE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4Hc,CAAC;AAEtD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;iBA8Ba,CAAC;AAElD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAA6C,CAAC;AAEtF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,MAAM,GAAE,mBAAwB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAqFhC"}
package/dist/create.js ADDED
@@ -0,0 +1,235 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema } from '@agentuity/api';
3
+ import { NPM_PACKAGE_NAME_PATTERN } from './snapshot-build.js';
4
+ import { throwSandboxError } from './util.js';
5
+ import { base64Encode } from './base64.js';
6
+ export const SandboxCreateRequestSchema = z
7
+ .object({
8
+ projectId: z.string().optional().describe('Project ID to associate the sandbox with'),
9
+ runtime: z.string().optional().describe('Runtime name (e.g., "bun:1", "python:3.14")'),
10
+ runtimeId: z.string().optional().describe('Runtime ID (e.g., "srt_xxx")'),
11
+ name: z.string().optional().describe('Optional sandbox name'),
12
+ description: z.string().optional().describe('Optional sandbox description'),
13
+ resources: z
14
+ .object({
15
+ memory: z.string().optional().describe('Memory limit (e.g., "512Mi", "1Gi")'),
16
+ cpu: z.string().optional().describe('CPU limit (e.g., "0.5", "1")'),
17
+ disk: z.string().optional().describe('Disk size limit (e.g., "1Gi", "10Gi")'),
18
+ })
19
+ .optional()
20
+ .describe('Resource constraints for the sandbox'),
21
+ env: z
22
+ .record(z.string(), z.string())
23
+ .optional()
24
+ .describe('Environment variables to set in the sandbox'),
25
+ network: z
26
+ .object({
27
+ enabled: z.boolean().optional().describe('Whether network access is enabled'),
28
+ port: z
29
+ .number()
30
+ .int()
31
+ .min(1024)
32
+ .max(65535)
33
+ .optional()
34
+ .describe('Port to expose from the sandbox (1024-65535)'),
35
+ })
36
+ .optional()
37
+ .describe('Network configuration for the sandbox'),
38
+ stream: z
39
+ .object({
40
+ stdout: z.string().optional().describe('Stream ID for stdout output'),
41
+ stderr: z.string().optional().describe('Stream ID for stderr output'),
42
+ stdin: z.string().optional().describe('Stream ID for stdin input'),
43
+ timestamps: z.boolean().optional().describe('Whether to include timestamps in output'),
44
+ })
45
+ .optional()
46
+ .describe('Stream configuration for I/O redirection'),
47
+ timeout: z
48
+ .object({
49
+ idle: z.string().optional().describe('Idle timeout duration (e.g., "5m", "1h")'),
50
+ execution: z.string().optional().describe('Maximum execution time (e.g., "30m", "2h")'),
51
+ paused: z
52
+ .string()
53
+ .optional()
54
+ .describe('Maximum time sandbox can remain paused before termination (e.g., "24h", "0s" for infinite)'),
55
+ })
56
+ .optional()
57
+ .describe('Timeout settings for the sandbox'),
58
+ command: z
59
+ .object({
60
+ exec: z.array(z.string()).describe('Command and arguments to execute'),
61
+ files: z
62
+ .array(z.object({
63
+ path: z
64
+ .string()
65
+ .describe('Path to the file relative to the sandbox workspace'),
66
+ content: z.string().describe('Base64-encoded file content'),
67
+ }))
68
+ .optional()
69
+ .describe('Files to write before execution (deprecated: use top-level files)'),
70
+ mode: z
71
+ .enum(['oneshot', 'interactive'])
72
+ .optional()
73
+ .describe('Execution mode: oneshot runs once, interactive keeps running'),
74
+ })
75
+ .optional()
76
+ .describe('Initial command to run in the sandbox'),
77
+ files: z
78
+ .array(z.object({
79
+ path: z.string().describe('Path to the file relative to the sandbox workspace'),
80
+ content: z.string().describe('Base64-encoded file content'),
81
+ }))
82
+ .optional()
83
+ .describe('Files to write to sandbox on creation'),
84
+ snapshot: z.string().optional().describe('Snapshot ID to restore the sandbox from'),
85
+ dependencies: z
86
+ .array(z.string())
87
+ .optional()
88
+ .describe('Apt packages to install when creating the sandbox'),
89
+ packages: z
90
+ .array(z
91
+ .string()
92
+ .regex(NPM_PACKAGE_NAME_PATTERN, 'Invalid npm/bun package specifier: must not contain whitespace, semicolons, backticks, pipes, or dollar signs'))
93
+ .optional()
94
+ .describe('npm/bun packages to install globally when creating the sandbox'),
95
+ metadata: z
96
+ .record(z.string(), z.unknown())
97
+ .optional()
98
+ .describe('Optional user-defined metadata to associate with the sandbox'),
99
+ scopes: z
100
+ .array(z.string())
101
+ .optional()
102
+ .describe('Permission scopes for automatic service access (e.g., "services:read", "services:write").'),
103
+ })
104
+ .refine((data) => {
105
+ // If snapshot is provided, runtime and runtimeId must not be provided
106
+ if (data.snapshot) {
107
+ return !data.runtime && !data.runtimeId;
108
+ }
109
+ return true;
110
+ }, {
111
+ message: 'cannot specify both snapshot and runtime; snapshot includes its own runtime',
112
+ path: ['snapshot'],
113
+ })
114
+ .describe('Request body for creating a new sandbox');
115
+ export const SandboxCreateDataSchema = z
116
+ .object({
117
+ sandboxId: z.string().describe('Unique identifier for the created sandbox'),
118
+ status: z
119
+ .enum([
120
+ 'creating',
121
+ 'idle',
122
+ 'running',
123
+ 'paused',
124
+ 'stopping',
125
+ 'suspended',
126
+ 'terminated',
127
+ 'failed',
128
+ ])
129
+ .describe('Current status of the sandbox'),
130
+ executionId: z
131
+ .string()
132
+ .optional()
133
+ .describe('Initial execution identifier for oneshot sandbox creation'),
134
+ url: z
135
+ .string()
136
+ .optional()
137
+ .describe('Public URL for the sandbox (only set when a network port is configured)'),
138
+ stdoutStreamId: z.string().optional().describe('Stream ID for reading stdout'),
139
+ stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
140
+ stderrStreamId: z.string().optional().describe('Stream ID for reading stderr'),
141
+ stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
142
+ auditStreamId: z.string().optional().describe('Stream ID for reading audit events'),
143
+ auditStreamUrl: z.string().optional().describe('URL for streaming audit events'),
144
+ })
145
+ .describe('Response data from sandbox creation');
146
+ export const SandboxCreateResponseSchema = APIResponseSchema(SandboxCreateDataSchema);
147
+ export const SandboxCreateParamsSchema = z.object({
148
+ options: z.custom().optional().describe('Optional sandbox create options'),
149
+ orgId: z.string().optional().describe('Optional org id for CLI auth context'),
150
+ });
151
+ /**
152
+ * Creates a new sandbox instance.
153
+ *
154
+ * @param client - The API client to use for the request
155
+ * @param params - Parameters for creating the sandbox
156
+ * @returns The created sandbox response including sandbox ID and stream URLs
157
+ * @throws {SandboxResponseError} If the sandbox creation fails
158
+ */
159
+ export async function sandboxCreate(client, params = {}) {
160
+ const { options = {}, orgId } = params;
161
+ const body = {};
162
+ if (options.projectId) {
163
+ body.projectId = options.projectId;
164
+ }
165
+ if (options.runtime) {
166
+ body.runtime = options.runtime;
167
+ }
168
+ if (options.runtimeId) {
169
+ body.runtimeId = options.runtimeId;
170
+ }
171
+ if (options.name) {
172
+ body.name = options.name;
173
+ }
174
+ if (options.description) {
175
+ body.description = options.description;
176
+ }
177
+ if (options.resources) {
178
+ body.resources = options.resources;
179
+ }
180
+ if (options.env) {
181
+ body.env = options.env;
182
+ }
183
+ if (options.network) {
184
+ body.network = options.network;
185
+ }
186
+ if (options.stream) {
187
+ body.stream = options.stream;
188
+ }
189
+ if (options.timeout) {
190
+ body.timeout = options.timeout;
191
+ }
192
+ if (options.command) {
193
+ body.command = {
194
+ exec: options.command.exec,
195
+ mode: options.command.mode,
196
+ files: options.command.files?.map((f) => ({
197
+ path: f.path,
198
+ content: base64Encode(f.content),
199
+ })),
200
+ };
201
+ }
202
+ if (options.files && options.files.length > 0) {
203
+ body.files = options.files.map((f) => ({
204
+ path: f.path,
205
+ content: base64Encode(f.content),
206
+ }));
207
+ }
208
+ if (options.snapshot) {
209
+ body.snapshot = options.snapshot;
210
+ }
211
+ if (options.dependencies && options.dependencies.length > 0) {
212
+ body.dependencies = options.dependencies;
213
+ }
214
+ if (options.packages && options.packages.length > 0) {
215
+ body.packages = options.packages;
216
+ }
217
+ if (options.metadata) {
218
+ body.metadata = options.metadata;
219
+ }
220
+ if (options.scopes && options.scopes.length > 0) {
221
+ body.scopes = options.scopes;
222
+ }
223
+ const queryParams = new URLSearchParams();
224
+ if (orgId) {
225
+ queryParams.set('orgId', orgId);
226
+ }
227
+ const queryString = queryParams.toString();
228
+ const url = `/sandbox${queryString ? `?${queryString}` : ''}`;
229
+ const resp = await client.post(url, body, SandboxCreateResponseSchema, SandboxCreateRequestSchema);
230
+ if (resp.success) {
231
+ return resp.data;
232
+ }
233
+ throwSandboxError(resp, {});
234
+ }
235
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"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G,OAAO,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;IAC1C,IAAI,KAAK,EAAE,CAAC;QACX,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC3C,MAAM,GAAG,GAAG,WAAW,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAE9D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAC7B,GAAG,EACH,IAAI,EACJ,2BAA2B,EAC3B,0BAA0B,CAC1B,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { type APIClient } from '@agentuity/api';
3
+ export declare const DestroyResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ success: z.ZodLiteral<false>;
5
+ message: z.ZodString;
6
+ code: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>, z.ZodObject<{
8
+ success: z.ZodLiteral<true>;
9
+ }, z.core.$strip>], "success">;
10
+ export declare const SandboxDestroyParamsSchema: z.ZodObject<{
11
+ sandboxId: z.ZodString;
12
+ orgId: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export type SandboxDestroyParams = z.infer<typeof SandboxDestroyParamsSchema>;
15
+ /**
16
+ * Destroys a sandbox and releases all associated resources.
17
+ *
18
+ * @param client - The API client to use for the request
19
+ * @param params - Parameters including the sandbox ID to destroy
20
+ * @throws {SandboxResponseError} If the sandbox is not found or destruction fails
21
+ */
22
+ export declare function sandboxDestroy(client: APIClient, params: SandboxDestroyParams): Promise<void>;
23
+ //# sourceMappingURL=destroy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../src/destroy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,gBAAgB,CAAC;AAGzE,eAAO,MAAM,qBAAqB;;;;;;8BAA4B,CAAC;AAE/D,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,oBAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAmBf"}
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchemaNoData } from '@agentuity/api';
3
+ import { throwSandboxError } from './util.js';
4
+ export const DestroyResponseSchema = APIResponseSchemaNoData();
5
+ export const SandboxDestroyParamsSchema = z.object({
6
+ sandboxId: z.string().describe('Sandbox ID to destroy'),
7
+ orgId: z.string().optional().describe('Optional org id for CLI auth context'),
8
+ });
9
+ /**
10
+ * Destroys a sandbox and releases all associated resources.
11
+ *
12
+ * @param client - The API client to use for the request
13
+ * @param params - Parameters including the sandbox ID to destroy
14
+ * @throws {SandboxResponseError} If the sandbox is not found or destruction fails
15
+ */
16
+ export async function sandboxDestroy(client, params) {
17
+ const { sandboxId, orgId } = params;
18
+ const queryParams = new URLSearchParams();
19
+ if (orgId) {
20
+ queryParams.set('orgId', orgId);
21
+ }
22
+ const queryString = queryParams.toString();
23
+ const url = `/sandbox/${sandboxId}${queryString ? `?${queryString}` : ''}`;
24
+ const resp = await client.delete(url, DestroyResponseSchema);
25
+ if (resp.success) {
26
+ return;
27
+ }
28
+ throwSandboxError(resp, { sandboxId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EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,108 @@
1
+ import type { z as zType } from 'zod';
2
+ import { z } from 'zod';
3
+ import { type APIClient } from '@agentuity/api';
4
+ export declare const DiskCheckpointInfoSchema: zType.ZodObject<{
5
+ id: zType.ZodString;
6
+ name: zType.ZodString;
7
+ createdAt: zType.ZodString;
8
+ parent: zType.ZodString;
9
+ }, zType.core.$strip>;
10
+ export type DiskCheckpointInfo = z.infer<typeof DiskCheckpointInfoSchema>;
11
+ export declare const CreateDiskCheckpointResponseSchema: zType.ZodDiscriminatedUnion<[zType.ZodObject<{
12
+ success: z.ZodLiteral<false>;
13
+ message: z.ZodString;
14
+ code: z.ZodOptional<z.ZodString>;
15
+ }, zType.core.$strip>, zType.ZodObject<{
16
+ success: z.ZodLiteral<true>;
17
+ data: zType.ZodObject<{
18
+ id: zType.ZodString;
19
+ name: zType.ZodString;
20
+ createdAt: zType.ZodString;
21
+ parent: zType.ZodString;
22
+ }, zType.core.$strip>;
23
+ }, zType.core.$strip>], "success">;
24
+ export declare const ListDiskCheckpointsResponseSchema: zType.ZodDiscriminatedUnion<[zType.ZodObject<{
25
+ success: z.ZodLiteral<false>;
26
+ message: z.ZodString;
27
+ code: z.ZodOptional<z.ZodString>;
28
+ }, zType.core.$strip>, zType.ZodObject<{
29
+ success: z.ZodLiteral<true>;
30
+ data: zType.ZodObject<{
31
+ checkpoints: zType.ZodArray<zType.ZodObject<{
32
+ id: zType.ZodString;
33
+ name: zType.ZodString;
34
+ createdAt: zType.ZodString;
35
+ parent: zType.ZodString;
36
+ }, zType.core.$strip>>;
37
+ }, zType.core.$strip>;
38
+ }, zType.core.$strip>], "success">;
39
+ export declare const RestoreDiskCheckpointResponseSchema: zType.ZodDiscriminatedUnion<[zType.ZodObject<{
40
+ success: z.ZodLiteral<false>;
41
+ message: z.ZodString;
42
+ code: z.ZodOptional<z.ZodString>;
43
+ }, zType.core.$strip>, zType.ZodObject<{
44
+ success: z.ZodLiteral<true>;
45
+ }, zType.core.$strip>], "success">;
46
+ export declare const DeleteDiskCheckpointResponseSchema: zType.ZodDiscriminatedUnion<[zType.ZodObject<{
47
+ success: z.ZodLiteral<false>;
48
+ message: z.ZodString;
49
+ code: z.ZodOptional<z.ZodString>;
50
+ }, zType.core.$strip>, zType.ZodObject<{
51
+ success: z.ZodLiteral<true>;
52
+ }, zType.core.$strip>], "success">;
53
+ export declare const DiskCheckpointCreateParamsSchema: zType.ZodObject<{
54
+ sandboxId: zType.ZodString;
55
+ name: zType.ZodString;
56
+ orgId: zType.ZodOptional<zType.ZodString>;
57
+ }, zType.core.$strip>;
58
+ export declare const DiskCheckpointListParamsSchema: zType.ZodObject<{
59
+ sandboxId: zType.ZodString;
60
+ orgId: zType.ZodOptional<zType.ZodString>;
61
+ }, zType.core.$strip>;
62
+ export declare const DiskCheckpointRestoreParamsSchema: zType.ZodObject<{
63
+ sandboxId: zType.ZodString;
64
+ checkpointId: zType.ZodString;
65
+ orgId: zType.ZodOptional<zType.ZodString>;
66
+ }, zType.core.$strip>;
67
+ export declare const DiskCheckpointDeleteParamsSchema: zType.ZodObject<{
68
+ sandboxId: zType.ZodString;
69
+ checkpointId: zType.ZodString;
70
+ orgId: zType.ZodOptional<zType.ZodString>;
71
+ }, zType.core.$strip>;
72
+ export type DiskCheckpointCreateParams = z.infer<typeof DiskCheckpointCreateParamsSchema>;
73
+ export type DiskCheckpointListParams = z.infer<typeof DiskCheckpointListParamsSchema>;
74
+ export type DiskCheckpointRestoreParams = z.infer<typeof DiskCheckpointRestoreParamsSchema>;
75
+ export type DiskCheckpointDeleteParams = z.infer<typeof DiskCheckpointDeleteParamsSchema>;
76
+ /**
77
+ * Creates a new disk checkpoint for a sandbox.
78
+ *
79
+ * @param client - The API client to use for the request
80
+ * @param params - Parameters including the sandbox ID and checkpoint name
81
+ * @throws {SandboxResponseError} If the sandbox is not found or checkpoint creation fails
82
+ */
83
+ export declare function diskCheckpointCreate(client: APIClient, params: DiskCheckpointCreateParams): Promise<DiskCheckpointInfo>;
84
+ /**
85
+ * Lists all disk checkpoints for a sandbox.
86
+ *
87
+ * @param client - The API client to use for the request
88
+ * @param params - Parameters including the sandbox ID
89
+ * @throws {SandboxResponseError} If the sandbox is not found or listing fails
90
+ */
91
+ export declare function diskCheckpointList(client: APIClient, params: DiskCheckpointListParams): Promise<DiskCheckpointInfo[]>;
92
+ /**
93
+ * Restores a sandbox to a specific disk checkpoint.
94
+ *
95
+ * @param client - The API client to use for the request
96
+ * @param params - Parameters including the sandbox ID and checkpoint ID
97
+ * @throws {SandboxResponseError} If the sandbox or checkpoint is not found, or restore fails
98
+ */
99
+ export declare function diskCheckpointRestore(client: APIClient, params: DiskCheckpointRestoreParams): Promise<void>;
100
+ /**
101
+ * Deletes a disk checkpoint from a sandbox.
102
+ *
103
+ * @param client - The API client to use for the request
104
+ * @param params - Parameters including the sandbox ID and checkpoint ID
105
+ * @throws {SandboxResponseError} If the sandbox or checkpoint is not found, or deletion fails
106
+ */
107
+ export declare function diskCheckpointDelete(client: APIClient, params: DiskCheckpointDeleteParams): Promise<void>;
108
+ //# sourceMappingURL=disk-checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disk-checkpoint.d.ts","sourceRoot":"","sources":["../src/disk-checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,IAAI,KAAK,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAA8C,MAAM,gBAAgB,CAAC;AAK5F,eAAO,MAAM,wBAAwB;;;;;qBAKnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG1E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;kCAAoD,CAAC;AAKpG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;kCA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