@ekairos/sandbox 1.22.100-beta.development.0 → 1.22.101-beta.feature-lab-task-sandbox-beta.0
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/actions.d.ts +5 -262
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +171 -169
- package/dist/actions.js.map +1 -1
- package/dist/codex-auth.d.ts +16 -0
- package/dist/codex-auth.d.ts.map +1 -0
- package/dist/codex-auth.js +57 -0
- package/dist/codex-auth.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +16 -1
- package/dist/providers/provider.js.map +1 -1
- package/dist/public.d.ts +2 -2
- package/dist/public.d.ts.map +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/sandbox.js.map +1 -1
- package/dist/schema.d.ts +2 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +3 -0
- package/dist/service.js.map +1 -1
- package/dist/session.d.ts +59 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +471 -0
- package/dist/session.js.map +1 -0
- package/dist/types.d.ts +38 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -3
package/dist/actions.d.ts
CHANGED
|
@@ -1,263 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
[x: number]: any;
|
|
8
|
-
[x: symbol]: any;
|
|
9
|
-
}, {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
[x: number]: any;
|
|
12
|
-
[x: symbol]: any;
|
|
13
|
-
}, import("@instantdb/core").RoomsDef, {
|
|
14
|
-
createSandbox: import("@ekairos/domain").DomainActionRegistration<z.ZodType<SandboxConfig, unknown, z.core.$ZodTypeInternals<SandboxConfig, unknown>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
-
ok: z.ZodLiteral<true>;
|
|
16
|
-
data: z.ZodObject<{
|
|
17
|
-
sandboxId: z.ZodString;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
ok: z.ZodLiteral<false>;
|
|
21
|
-
error: z.ZodString;
|
|
22
|
-
}, z.core.$strip>], "ok">, {
|
|
23
|
-
db: unknown;
|
|
24
|
-
}, any>;
|
|
25
|
-
stopSandbox: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
26
|
-
sandboxId: z.ZodString;
|
|
27
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
-
ok: z.ZodLiteral<true>;
|
|
29
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
ok: z.ZodLiteral<false>;
|
|
32
|
-
error: z.ZodString;
|
|
33
|
-
}, z.core.$strip>], "ok">, {
|
|
34
|
-
db: unknown;
|
|
35
|
-
}, any>;
|
|
36
|
-
runCommand: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
37
|
-
sandboxId: z.ZodString;
|
|
38
|
-
command: z.ZodString;
|
|
39
|
-
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
-
ok: z.ZodLiteral<true>;
|
|
42
|
-
data: z.ZodType<CommandResult, unknown, z.core.$ZodTypeInternals<CommandResult, unknown>>;
|
|
43
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
-
ok: z.ZodLiteral<false>;
|
|
45
|
-
error: z.ZodString;
|
|
46
|
-
}, z.core.$strip>], "ok">, {
|
|
47
|
-
db: unknown;
|
|
48
|
-
}, any>;
|
|
49
|
-
runCommandProcess: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
50
|
-
sandboxId: z.ZodString;
|
|
51
|
-
command: z.ZodString;
|
|
52
|
-
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
54
|
-
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
56
|
-
command: "command";
|
|
57
|
-
service: "service";
|
|
58
|
-
"codex-app-server": "codex-app-server";
|
|
59
|
-
"dev-server": "dev-server";
|
|
60
|
-
"test-runner": "test-runner";
|
|
61
|
-
watcher: "watcher";
|
|
62
|
-
}>>;
|
|
63
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
64
|
-
foreground: "foreground";
|
|
65
|
-
background: "background";
|
|
66
|
-
}>>;
|
|
67
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
68
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
69
|
-
ok: z.ZodLiteral<true>;
|
|
70
|
-
data: z.ZodType<SandboxProcessRunResult, unknown, z.core.$ZodTypeInternals<SandboxProcessRunResult, unknown>>;
|
|
71
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
-
ok: z.ZodLiteral<false>;
|
|
73
|
-
error: z.ZodString;
|
|
74
|
-
}, z.core.$strip>], "ok">, {
|
|
75
|
-
db: unknown;
|
|
76
|
-
}, any>;
|
|
77
|
-
readProcessStream: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
78
|
-
processId: z.ZodString;
|
|
79
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
|
-
ok: z.ZodLiteral<true>;
|
|
81
|
-
data: z.ZodObject<{
|
|
82
|
-
chunks: z.ZodArray<z.ZodType<SandboxProcessStreamChunk, unknown, z.core.$ZodTypeInternals<SandboxProcessStreamChunk, unknown>>>;
|
|
83
|
-
byteOffset: z.ZodNumber;
|
|
84
|
-
}, z.core.$strip>;
|
|
85
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
-
ok: z.ZodLiteral<false>;
|
|
87
|
-
error: z.ZodString;
|
|
88
|
-
}, z.core.$strip>], "ok">, {
|
|
89
|
-
db: unknown;
|
|
90
|
-
}, any>;
|
|
91
|
-
startObservedProcess: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
92
|
-
sandboxId: z.ZodString;
|
|
93
|
-
command: z.ZodString;
|
|
94
|
-
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
96
|
-
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
97
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
98
|
-
command: "command";
|
|
99
|
-
service: "service";
|
|
100
|
-
"codex-app-server": "codex-app-server";
|
|
101
|
-
"dev-server": "dev-server";
|
|
102
|
-
"test-runner": "test-runner";
|
|
103
|
-
watcher: "watcher";
|
|
104
|
-
}>>;
|
|
105
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
106
|
-
foreground: "foreground";
|
|
107
|
-
background: "background";
|
|
108
|
-
}>>;
|
|
109
|
-
externalProcessId: z.ZodOptional<z.ZodString>;
|
|
110
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
111
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
112
|
-
ok: z.ZodLiteral<true>;
|
|
113
|
-
data: z.ZodType<SandboxProcessRunResult, unknown, z.core.$ZodTypeInternals<SandboxProcessRunResult, unknown>>;
|
|
114
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
-
ok: z.ZodLiteral<false>;
|
|
116
|
-
error: z.ZodString;
|
|
117
|
-
}, z.core.$strip>], "ok">, {
|
|
118
|
-
db: unknown;
|
|
119
|
-
}, any>;
|
|
120
|
-
appendObservedProcessChunk: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
121
|
-
processId: z.ZodString;
|
|
122
|
-
type: z.ZodEnum<{
|
|
123
|
-
error: "error";
|
|
124
|
-
status: "status";
|
|
125
|
-
stdout: "stdout";
|
|
126
|
-
stderr: "stderr";
|
|
127
|
-
exit: "exit";
|
|
128
|
-
heartbeat: "heartbeat";
|
|
129
|
-
metadata: "metadata";
|
|
130
|
-
}>;
|
|
131
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
132
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
|
-
ok: z.ZodLiteral<true>;
|
|
134
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
135
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
-
ok: z.ZodLiteral<false>;
|
|
137
|
-
error: z.ZodString;
|
|
138
|
-
}, z.core.$strip>], "ok">, {
|
|
139
|
-
db: unknown;
|
|
140
|
-
}, any>;
|
|
141
|
-
finishObservedProcess: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
142
|
-
processId: z.ZodString;
|
|
143
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
144
|
-
exited: "exited";
|
|
145
|
-
failed: "failed";
|
|
146
|
-
killed: "killed";
|
|
147
|
-
lost: "lost";
|
|
148
|
-
}>>;
|
|
149
|
-
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
150
|
-
errorText: z.ZodOptional<z.ZodString>;
|
|
151
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
153
|
-
ok: z.ZodLiteral<true>;
|
|
154
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
155
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
156
|
-
ok: z.ZodLiteral<false>;
|
|
157
|
-
error: z.ZodString;
|
|
158
|
-
}, z.core.$strip>], "ok">, {
|
|
159
|
-
db: unknown;
|
|
160
|
-
}, any>;
|
|
161
|
-
writeFiles: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
162
|
-
sandboxId: z.ZodString;
|
|
163
|
-
files: z.ZodArray<z.ZodObject<{
|
|
164
|
-
path: z.ZodString;
|
|
165
|
-
contentBase64: z.ZodString;
|
|
166
|
-
}, z.core.$strip>>;
|
|
167
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
168
|
-
ok: z.ZodLiteral<true>;
|
|
169
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
170
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
171
|
-
ok: z.ZodLiteral<false>;
|
|
172
|
-
error: z.ZodString;
|
|
173
|
-
}, z.core.$strip>], "ok">, {
|
|
174
|
-
db: unknown;
|
|
175
|
-
}, any>;
|
|
176
|
-
readFile: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
177
|
-
sandboxId: z.ZodString;
|
|
178
|
-
path: z.ZodString;
|
|
179
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
-
ok: z.ZodLiteral<true>;
|
|
181
|
-
data: z.ZodObject<{
|
|
182
|
-
contentBase64: z.ZodString;
|
|
183
|
-
}, z.core.$strip>;
|
|
184
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
-
ok: z.ZodLiteral<false>;
|
|
186
|
-
error: z.ZodString;
|
|
187
|
-
}, z.core.$strip>], "ok">, {
|
|
188
|
-
db: unknown;
|
|
189
|
-
}, any>;
|
|
190
|
-
installCodexAuth: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
191
|
-
sandboxId: z.ZodString;
|
|
192
|
-
codexHome: z.ZodOptional<z.ZodString>;
|
|
193
|
-
authJsonPath: z.ZodOptional<z.ZodString>;
|
|
194
|
-
credentialsJsonPath: z.ZodOptional<z.ZodString>;
|
|
195
|
-
configTomlPath: z.ZodOptional<z.ZodString>;
|
|
196
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
197
|
-
ok: z.ZodLiteral<true>;
|
|
198
|
-
data: z.ZodObject<{
|
|
199
|
-
authJson: z.ZodBoolean;
|
|
200
|
-
credentialsJson: z.ZodBoolean;
|
|
201
|
-
configToml: z.ZodBoolean;
|
|
202
|
-
}, z.core.$strip>;
|
|
203
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
-
ok: z.ZodLiteral<false>;
|
|
205
|
-
error: z.ZodString;
|
|
206
|
-
}, z.core.$strip>], "ok">, {
|
|
207
|
-
db: unknown;
|
|
208
|
-
}, any>;
|
|
209
|
-
getSandbox: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
210
|
-
sandboxId: z.ZodString;
|
|
211
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
212
|
-
ok: z.ZodLiteral<true>;
|
|
213
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
214
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
-
ok: z.ZodLiteral<false>;
|
|
216
|
-
error: z.ZodString;
|
|
217
|
-
}, z.core.$strip>], "ok">, {
|
|
218
|
-
db: unknown;
|
|
219
|
-
}, any>;
|
|
220
|
-
createCheckpoint: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
221
|
-
sandboxId: z.ZodString;
|
|
222
|
-
comment: z.ZodOptional<z.ZodString>;
|
|
223
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
-
ok: z.ZodLiteral<true>;
|
|
225
|
-
data: z.ZodObject<{
|
|
226
|
-
checkpointId: z.ZodString;
|
|
227
|
-
}, z.core.$strip>;
|
|
228
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
229
|
-
ok: z.ZodLiteral<false>;
|
|
230
|
-
error: z.ZodString;
|
|
231
|
-
}, z.core.$strip>], "ok">, {
|
|
232
|
-
db: unknown;
|
|
233
|
-
}, any>;
|
|
234
|
-
getPortUrl: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
235
|
-
sandboxId: z.ZodString;
|
|
236
|
-
port: z.ZodNumber;
|
|
237
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
238
|
-
ok: z.ZodLiteral<true>;
|
|
239
|
-
data: z.ZodObject<{
|
|
240
|
-
url: z.ZodString;
|
|
241
|
-
}, z.core.$strip>;
|
|
242
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
243
|
-
ok: z.ZodLiteral<false>;
|
|
244
|
-
error: z.ZodString;
|
|
245
|
-
}, z.core.$strip>], "ok">, {
|
|
246
|
-
db: unknown;
|
|
247
|
-
}, any>;
|
|
248
|
-
createEkairosApp: import("@ekairos/domain").DomainActionRegistration<z.ZodObject<{
|
|
249
|
-
sandboxId: z.ZodString;
|
|
250
|
-
appDir: z.ZodString;
|
|
251
|
-
packageManager: z.ZodOptional<z.ZodString>;
|
|
252
|
-
instantTokenEnvName: z.ZodOptional<z.ZodString>;
|
|
253
|
-
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
-
ok: z.ZodLiteral<true>;
|
|
255
|
-
data: z.ZodType<SandboxProcessRunResult, unknown, z.core.$ZodTypeInternals<SandboxProcessRunResult, unknown>>;
|
|
256
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
257
|
-
ok: z.ZodLiteral<false>;
|
|
258
|
-
error: z.ZodString;
|
|
259
|
-
}, z.core.$strip>], "ok">, {
|
|
260
|
-
db: unknown;
|
|
261
|
-
}, any>;
|
|
262
|
-
}, "sandbox", string>;
|
|
1
|
+
import { sandboxSchemaDomain } from "./schema.js";
|
|
2
|
+
declare function createSandboxDomain(): ReturnType<typeof sandboxSchemaDomain.withActions>;
|
|
3
|
+
export type SandboxDomain = ReturnType<typeof createSandboxDomain>;
|
|
4
|
+
export declare const sandboxDomain: SandboxDomain;
|
|
5
|
+
export {};
|
|
263
6
|
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAkCjD,iBAAS,mBAAmB,IAAI,UAAU,CAAC,OAAO,mBAAmB,CAAC,WAAW,CAAC,CAqLjF;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAClE,eAAO,MAAM,aAAa,EAAE,aAAqC,CAAA"}
|
package/dist/actions.js
CHANGED
|
@@ -24,185 +24,187 @@ const serviceVoidResult = z.discriminatedUnion("ok", [
|
|
|
24
24
|
const commandResult = sandboxCommandResultSchema;
|
|
25
25
|
const processStreamChunk = sandboxProcessStreamChunkSchema;
|
|
26
26
|
const processRunResult = sandboxProcessRunResultSchema;
|
|
27
|
-
|
|
28
|
-
.withActions({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
stopSandbox: defineAction({
|
|
58
|
-
name: "sandbox.stopSandbox",
|
|
59
|
-
input: z.object({ sandboxId: z.string() }),
|
|
60
|
-
output: serviceVoidResult,
|
|
61
|
-
execute: stopSandboxStep,
|
|
62
|
-
}),
|
|
63
|
-
runCommand: defineAction({
|
|
64
|
-
name: "sandbox.runCommand",
|
|
65
|
-
input: z.object({
|
|
66
|
-
sandboxId: z.string(),
|
|
67
|
-
command: z.string(),
|
|
68
|
-
args: z.array(z.string()).optional(),
|
|
27
|
+
function createSandboxDomain() {
|
|
28
|
+
return sandboxSchemaDomain.withActions({
|
|
29
|
+
createSandbox: defineAction({
|
|
30
|
+
name: "sandbox.createSandbox",
|
|
31
|
+
input: z.object({
|
|
32
|
+
provider: z.enum(["vercel", "daytona", "sprites"]).optional(),
|
|
33
|
+
runtime: z.string().optional(),
|
|
34
|
+
timeoutMs: z.number().optional(),
|
|
35
|
+
ports: z.array(z.number()).optional(),
|
|
36
|
+
resources: z.object({ vcpus: z.number().optional() }).passthrough().optional(),
|
|
37
|
+
purpose: z.string().optional(),
|
|
38
|
+
params: z.record(z.string(), z.unknown()).optional(),
|
|
39
|
+
env: z.record(z.string(), z.unknown()).optional(),
|
|
40
|
+
domain: z.unknown().optional(),
|
|
41
|
+
dataset: z.object({ enabled: z.boolean().optional() }).passthrough().optional(),
|
|
42
|
+
skills: z.array(z.object({
|
|
43
|
+
name: z.string(),
|
|
44
|
+
description: z.string().optional(),
|
|
45
|
+
files: z.array(z.object({
|
|
46
|
+
path: z.string(),
|
|
47
|
+
contentBase64: z.string(),
|
|
48
|
+
})),
|
|
49
|
+
})).optional(),
|
|
50
|
+
vercel: z.record(z.string(), z.unknown()).optional(),
|
|
51
|
+
daytona: z.record(z.string(), z.unknown()).optional(),
|
|
52
|
+
sprites: z.record(z.string(), z.unknown()).optional(),
|
|
53
|
+
}).passthrough(),
|
|
54
|
+
output: serviceResult(z.object({ sandboxId: z.string() })),
|
|
55
|
+
execute: createSandboxStep,
|
|
69
56
|
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
input: z.object({
|
|
76
|
-
sandboxId: z.string(),
|
|
77
|
-
command: z.string(),
|
|
78
|
-
args: z.array(z.string()).optional(),
|
|
79
|
-
cwd: z.string().optional(),
|
|
80
|
-
env: z.record(z.string(), z.unknown()).optional(),
|
|
81
|
-
kind: z.enum(SANDBOX_PROCESS_KINDS).optional(),
|
|
82
|
-
mode: z.enum(SANDBOX_PROCESS_MODES).optional(),
|
|
83
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
57
|
+
stopSandbox: defineAction({
|
|
58
|
+
name: "sandbox.stopSandbox",
|
|
59
|
+
input: z.object({ sandboxId: z.string() }),
|
|
60
|
+
output: serviceVoidResult,
|
|
61
|
+
execute: stopSandboxStep,
|
|
84
62
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
})),
|
|
95
|
-
execute: readProcessStreamStep,
|
|
96
|
-
}),
|
|
97
|
-
startObservedProcess: defineAction({
|
|
98
|
-
name: "sandbox.startObservedProcess",
|
|
99
|
-
input: z.object({
|
|
100
|
-
sandboxId: z.string(),
|
|
101
|
-
command: z.string(),
|
|
102
|
-
args: z.array(z.string()).optional(),
|
|
103
|
-
cwd: z.string().optional(),
|
|
104
|
-
env: z.record(z.string(), z.unknown()).optional(),
|
|
105
|
-
kind: z.enum(SANDBOX_PROCESS_KINDS).optional(),
|
|
106
|
-
mode: z.enum(SANDBOX_PROCESS_MODES).optional(),
|
|
107
|
-
externalProcessId: z.string().optional(),
|
|
108
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
63
|
+
runCommand: defineAction({
|
|
64
|
+
name: "sandbox.runCommand",
|
|
65
|
+
input: z.object({
|
|
66
|
+
sandboxId: z.string(),
|
|
67
|
+
command: z.string(),
|
|
68
|
+
args: z.array(z.string()).optional(),
|
|
69
|
+
}),
|
|
70
|
+
output: serviceResult(commandResult),
|
|
71
|
+
execute: runCommandStep,
|
|
109
72
|
}),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
73
|
+
runCommandProcess: defineAction({
|
|
74
|
+
name: "sandbox.runCommandProcess",
|
|
75
|
+
input: z.object({
|
|
76
|
+
sandboxId: z.string(),
|
|
77
|
+
command: z.string(),
|
|
78
|
+
args: z.array(z.string()).optional(),
|
|
79
|
+
cwd: z.string().optional(),
|
|
80
|
+
env: z.record(z.string(), z.unknown()).optional(),
|
|
81
|
+
kind: z.enum(SANDBOX_PROCESS_KINDS).optional(),
|
|
82
|
+
mode: z.enum(SANDBOX_PROCESS_MODES).optional(),
|
|
83
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
84
|
+
}),
|
|
85
|
+
output: serviceResult(processRunResult),
|
|
86
|
+
execute: runCommandProcessStep,
|
|
119
87
|
}),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
exitCode: z.number().optional(),
|
|
129
|
-
errorText: z.string().optional(),
|
|
130
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
88
|
+
readProcessStream: defineAction({
|
|
89
|
+
name: "sandbox.readProcessStream",
|
|
90
|
+
input: z.object({ processId: z.string() }),
|
|
91
|
+
output: serviceResult(z.object({
|
|
92
|
+
chunks: z.array(processStreamChunk),
|
|
93
|
+
byteOffset: z.number(),
|
|
94
|
+
})),
|
|
95
|
+
execute: readProcessStreamStep,
|
|
131
96
|
}),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
97
|
+
startObservedProcess: defineAction({
|
|
98
|
+
name: "sandbox.startObservedProcess",
|
|
99
|
+
input: z.object({
|
|
100
|
+
sandboxId: z.string(),
|
|
101
|
+
command: z.string(),
|
|
102
|
+
args: z.array(z.string()).optional(),
|
|
103
|
+
cwd: z.string().optional(),
|
|
104
|
+
env: z.record(z.string(), z.unknown()).optional(),
|
|
105
|
+
kind: z.enum(SANDBOX_PROCESS_KINDS).optional(),
|
|
106
|
+
mode: z.enum(SANDBOX_PROCESS_MODES).optional(),
|
|
107
|
+
externalProcessId: z.string().optional(),
|
|
108
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
109
|
+
}),
|
|
110
|
+
output: serviceResult(processRunResult),
|
|
111
|
+
execute: startObservedProcessStep,
|
|
112
|
+
}),
|
|
113
|
+
appendObservedProcessChunk: defineAction({
|
|
114
|
+
name: "sandbox.appendObservedProcessChunk",
|
|
115
|
+
input: z.object({
|
|
116
|
+
processId: z.string(),
|
|
117
|
+
type: z.enum(["stdout", "stderr", "status", "exit", "error", "heartbeat", "metadata"]),
|
|
118
|
+
data: z.record(z.string(), z.unknown()).optional(),
|
|
119
|
+
}),
|
|
120
|
+
output: serviceVoidResult,
|
|
121
|
+
execute: appendObservedProcessChunkStep,
|
|
122
|
+
}),
|
|
123
|
+
finishObservedProcess: defineAction({
|
|
124
|
+
name: "sandbox.finishObservedProcess",
|
|
125
|
+
input: z.object({
|
|
126
|
+
processId: z.string(),
|
|
127
|
+
status: z.enum(["exited", "failed", "killed", "lost"]).optional(),
|
|
128
|
+
exitCode: z.number().optional(),
|
|
129
|
+
errorText: z.string().optional(),
|
|
130
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
131
|
+
}),
|
|
132
|
+
output: serviceVoidResult,
|
|
133
|
+
execute: finishObservedProcessStep,
|
|
134
|
+
}),
|
|
135
|
+
writeFiles: defineAction({
|
|
136
|
+
name: "sandbox.writeFiles",
|
|
137
|
+
input: z.object({
|
|
138
|
+
sandboxId: z.string(),
|
|
139
|
+
files: z.array(z.object({
|
|
140
|
+
path: z.string(),
|
|
141
|
+
contentBase64: z.string(),
|
|
142
|
+
})),
|
|
143
|
+
}),
|
|
144
|
+
output: serviceVoidResult,
|
|
145
|
+
execute: writeFilesStep,
|
|
146
|
+
}),
|
|
147
|
+
readFile: defineAction({
|
|
148
|
+
name: "sandbox.readFile",
|
|
149
|
+
input: z.object({
|
|
150
|
+
sandboxId: z.string(),
|
|
140
151
|
path: z.string(),
|
|
141
|
-
|
|
152
|
+
}),
|
|
153
|
+
output: serviceResult(z.object({ contentBase64: z.string() })),
|
|
154
|
+
execute: readFileStep,
|
|
155
|
+
}),
|
|
156
|
+
installCodexAuth: defineAction({
|
|
157
|
+
name: "sandbox.installCodexAuth",
|
|
158
|
+
input: z.object({
|
|
159
|
+
sandboxId: z.string(),
|
|
160
|
+
codexHome: z.string().optional(),
|
|
161
|
+
authJsonPath: z.string().optional(),
|
|
162
|
+
credentialsJsonPath: z.string().optional(),
|
|
163
|
+
configTomlPath: z.string().optional(),
|
|
164
|
+
}),
|
|
165
|
+
output: serviceResult(z.object({
|
|
166
|
+
authJson: z.boolean(),
|
|
167
|
+
credentialsJson: z.boolean(),
|
|
168
|
+
configToml: z.boolean(),
|
|
142
169
|
})),
|
|
170
|
+
execute: installCodexAuthStep,
|
|
143
171
|
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
input: z.object({
|
|
150
|
-
sandboxId: z.string(),
|
|
151
|
-
path: z.string(),
|
|
172
|
+
getSandbox: defineAction({
|
|
173
|
+
name: "sandbox.getSandbox",
|
|
174
|
+
input: z.object({ sandboxId: z.string() }),
|
|
175
|
+
output: serviceResult(z.record(z.string(), z.unknown())),
|
|
176
|
+
execute: getSandboxStep,
|
|
152
177
|
}),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
authJsonPath: z.string().optional(),
|
|
162
|
-
credentialsJsonPath: z.string().optional(),
|
|
163
|
-
configTomlPath: z.string().optional(),
|
|
178
|
+
createCheckpoint: defineAction({
|
|
179
|
+
name: "sandbox.createCheckpoint",
|
|
180
|
+
input: z.object({
|
|
181
|
+
sandboxId: z.string(),
|
|
182
|
+
comment: z.string().optional(),
|
|
183
|
+
}),
|
|
184
|
+
output: serviceResult(z.object({ checkpointId: z.string() })),
|
|
185
|
+
execute: createCheckpointStep,
|
|
164
186
|
}),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
name: "sandbox.getSandbox",
|
|
174
|
-
input: z.object({ sandboxId: z.string() }),
|
|
175
|
-
output: serviceResult(z.record(z.string(), z.unknown())),
|
|
176
|
-
execute: getSandboxStep,
|
|
177
|
-
}),
|
|
178
|
-
createCheckpoint: defineAction({
|
|
179
|
-
name: "sandbox.createCheckpoint",
|
|
180
|
-
input: z.object({
|
|
181
|
-
sandboxId: z.string(),
|
|
182
|
-
comment: z.string().optional(),
|
|
187
|
+
getPortUrl: defineAction({
|
|
188
|
+
name: "sandbox.getPortUrl",
|
|
189
|
+
input: z.object({
|
|
190
|
+
sandboxId: z.string(),
|
|
191
|
+
port: z.number(),
|
|
192
|
+
}),
|
|
193
|
+
output: serviceResult(z.object({ url: z.string() })),
|
|
194
|
+
execute: getPortUrlStep,
|
|
183
195
|
}),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
createEkairosApp: defineAction({
|
|
197
|
+
name: "sandbox.createEkairosApp",
|
|
198
|
+
input: z.object({
|
|
199
|
+
sandboxId: z.string(),
|
|
200
|
+
appDir: z.string(),
|
|
201
|
+
packageManager: z.string().optional(),
|
|
202
|
+
instantTokenEnvName: z.string().optional(),
|
|
203
|
+
}),
|
|
204
|
+
output: serviceResult(processRunResult),
|
|
205
|
+
execute: createEkairosAppStep,
|
|
192
206
|
}),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
createEkairosApp: defineAction({
|
|
197
|
-
name: "sandbox.createEkairosApp",
|
|
198
|
-
input: z.object({
|
|
199
|
-
sandboxId: z.string(),
|
|
200
|
-
appDir: z.string(),
|
|
201
|
-
packageManager: z.string().optional(),
|
|
202
|
-
instantTokenEnvName: z.string().optional(),
|
|
203
|
-
}),
|
|
204
|
-
output: serviceResult(processRunResult),
|
|
205
|
-
execute: createEkairosAppStep,
|
|
206
|
-
}),
|
|
207
|
-
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
export const sandboxDomain = createSandboxDomain();
|
|
208
210
|
//# sourceMappingURL=actions.js.map
|