@ekairos/sandbox 1.22.35-beta.development.0 → 1.22.35

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 (57) hide show
  1. package/dist/action-steps.d.ts +156 -0
  2. package/dist/action-steps.d.ts.map +1 -0
  3. package/dist/action-steps.js +153 -0
  4. package/dist/action-steps.js.map +1 -0
  5. package/dist/actions.d.ts +263 -0
  6. package/dist/actions.d.ts.map +1 -0
  7. package/dist/actions.js +208 -0
  8. package/dist/actions.js.map +1 -0
  9. package/dist/contract.d.ts +86 -0
  10. package/dist/contract.d.ts.map +1 -0
  11. package/dist/contract.js +83 -0
  12. package/dist/contract.js.map +1 -0
  13. package/dist/domain.d.ts +2 -0
  14. package/dist/domain.d.ts.map +1 -0
  15. package/dist/domain.js +2 -0
  16. package/dist/domain.js.map +1 -0
  17. package/dist/index.d.ts +7 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +5 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/providers/daytona.d.ts +14 -0
  22. package/dist/providers/daytona.d.ts.map +1 -0
  23. package/dist/providers/daytona.js +153 -0
  24. package/dist/providers/daytona.js.map +1 -0
  25. package/dist/providers/provider.d.ts +3 -0
  26. package/dist/providers/provider.d.ts.map +1 -0
  27. package/dist/providers/provider.js +18 -0
  28. package/dist/providers/provider.js.map +1 -0
  29. package/dist/providers/sprites.d.ts +39 -0
  30. package/dist/providers/sprites.d.ts.map +1 -0
  31. package/dist/providers/sprites.js +234 -0
  32. package/dist/providers/sprites.js.map +1 -0
  33. package/dist/providers/types.d.ts +15 -0
  34. package/dist/providers/types.d.ts.map +1 -0
  35. package/dist/providers/types.js +9 -0
  36. package/dist/providers/types.js.map +1 -0
  37. package/dist/providers/vercel.d.ts +26 -0
  38. package/dist/providers/vercel.d.ts.map +1 -0
  39. package/dist/providers/vercel.js +182 -0
  40. package/dist/providers/vercel.js.map +1 -0
  41. package/dist/public.d.ts +56 -0
  42. package/dist/public.d.ts.map +1 -0
  43. package/dist/public.js +37 -0
  44. package/dist/public.js.map +1 -0
  45. package/dist/sandbox.d.ts +76 -0
  46. package/dist/sandbox.d.ts.map +1 -0
  47. package/dist/sandbox.js +154 -0
  48. package/dist/sandbox.js.map +1 -0
  49. package/dist/schema.d.ts +18 -172
  50. package/dist/schema.d.ts.map +1 -1
  51. package/dist/schema.js +10 -270
  52. package/dist/schema.js.map +1 -1
  53. package/dist/service.d.ts +10 -44
  54. package/dist/service.d.ts.map +1 -1
  55. package/dist/service.js +41 -566
  56. package/dist/service.js.map +1 -1
  57. package/package.json +37 -5
@@ -0,0 +1,156 @@
1
+ import type { CommandResult } from "./commands.js";
2
+ import { type SandboxProcessRunResult, type SandboxProcessStreamChunk } from "./service.js";
3
+ import type { SandboxConfig } from "./types.js";
4
+ type ServiceResult<T = unknown> = {
5
+ ok: true;
6
+ data: T;
7
+ } | {
8
+ ok: false;
9
+ error: string;
10
+ };
11
+ type SandboxRuntime = {
12
+ db: unknown;
13
+ };
14
+ type SandboxFileInput = {
15
+ path: string;
16
+ contentBase64: string;
17
+ };
18
+ export declare function createSandboxStep({ runtime, input, }: {
19
+ runtime: SandboxRuntime;
20
+ input: SandboxConfig;
21
+ }): Promise<ServiceResult<{
22
+ sandboxId: string;
23
+ }>>;
24
+ export declare function stopSandboxStep({ runtime, input, }: {
25
+ runtime: SandboxRuntime;
26
+ input: {
27
+ sandboxId: string;
28
+ };
29
+ }): Promise<ServiceResult<void>>;
30
+ export declare function runCommandStep({ runtime, input, }: {
31
+ runtime: SandboxRuntime;
32
+ input: {
33
+ sandboxId: string;
34
+ command: string;
35
+ args?: string[];
36
+ };
37
+ }): Promise<ServiceResult<CommandResult>>;
38
+ export declare function runCommandProcessStep({ runtime, input, }: {
39
+ runtime: SandboxRuntime;
40
+ input: {
41
+ sandboxId: string;
42
+ command: string;
43
+ args?: string[];
44
+ cwd?: string;
45
+ env?: Record<string, unknown>;
46
+ kind?: "command" | "service" | "codex-app-server" | "dev-server" | "test-runner" | "watcher";
47
+ mode?: "foreground" | "background";
48
+ metadata?: Record<string, unknown>;
49
+ };
50
+ }): Promise<ServiceResult<SandboxProcessRunResult>>;
51
+ export declare function readProcessStreamStep({ runtime, input, }: {
52
+ runtime: SandboxRuntime;
53
+ input: {
54
+ processId: string;
55
+ };
56
+ }): Promise<ServiceResult<{
57
+ chunks: SandboxProcessStreamChunk[];
58
+ byteOffset: number;
59
+ }>>;
60
+ export declare function startObservedProcessStep({ runtime, input, }: {
61
+ runtime: SandboxRuntime;
62
+ input: {
63
+ sandboxId: string;
64
+ command: string;
65
+ args?: string[];
66
+ cwd?: string;
67
+ env?: Record<string, unknown>;
68
+ kind?: "command" | "service" | "codex-app-server" | "dev-server" | "test-runner" | "watcher";
69
+ mode?: "foreground" | "background";
70
+ externalProcessId?: string;
71
+ metadata?: Record<string, unknown>;
72
+ };
73
+ }): Promise<ServiceResult<SandboxProcessRunResult>>;
74
+ export declare function appendObservedProcessChunkStep({ runtime, input, }: {
75
+ runtime: SandboxRuntime;
76
+ input: {
77
+ processId: string;
78
+ type: "stdout" | "stderr" | "status" | "exit" | "error" | "heartbeat" | "metadata";
79
+ data?: Record<string, unknown>;
80
+ };
81
+ }): Promise<ServiceResult<void>>;
82
+ export declare function finishObservedProcessStep({ runtime, input, }: {
83
+ runtime: SandboxRuntime;
84
+ input: {
85
+ processId: string;
86
+ status?: "exited" | "failed" | "killed" | "lost";
87
+ exitCode?: number;
88
+ errorText?: string;
89
+ metadata?: Record<string, unknown>;
90
+ };
91
+ }): Promise<ServiceResult<void>>;
92
+ export declare function writeFilesStep({ runtime, input, }: {
93
+ runtime: SandboxRuntime;
94
+ input: {
95
+ sandboxId: string;
96
+ files: SandboxFileInput[];
97
+ };
98
+ }): Promise<ServiceResult<void>>;
99
+ export declare function readFileStep({ runtime, input, }: {
100
+ runtime: SandboxRuntime;
101
+ input: {
102
+ sandboxId: string;
103
+ path: string;
104
+ };
105
+ }): Promise<ServiceResult<{
106
+ contentBase64: string;
107
+ }>>;
108
+ export declare function installCodexAuthStep({ runtime, input, }: {
109
+ runtime: SandboxRuntime;
110
+ input: {
111
+ sandboxId: string;
112
+ codexHome?: string;
113
+ authJsonPath?: string;
114
+ credentialsJsonPath?: string;
115
+ configTomlPath?: string;
116
+ };
117
+ }): Promise<ServiceResult<{
118
+ authJson: boolean;
119
+ credentialsJson: boolean;
120
+ configToml: boolean;
121
+ }>>;
122
+ export declare function getSandboxStep({ runtime, input, }: {
123
+ runtime: SandboxRuntime;
124
+ input: {
125
+ sandboxId: string;
126
+ };
127
+ }): Promise<ServiceResult<Record<string, unknown>>>;
128
+ export declare function createCheckpointStep({ runtime, input, }: {
129
+ runtime: SandboxRuntime;
130
+ input: {
131
+ sandboxId: string;
132
+ comment?: string;
133
+ };
134
+ }): Promise<ServiceResult<{
135
+ checkpointId: string;
136
+ }>>;
137
+ export declare function getPortUrlStep({ runtime, input, }: {
138
+ runtime: SandboxRuntime;
139
+ input: {
140
+ sandboxId: string;
141
+ port: number;
142
+ };
143
+ }): Promise<ServiceResult<{
144
+ url: string;
145
+ }>>;
146
+ export declare function createEkairosAppStep({ runtime, input, }: {
147
+ runtime: SandboxRuntime;
148
+ input: {
149
+ sandboxId: string;
150
+ appDir: string;
151
+ packageManager?: string;
152
+ instantTokenEnvName?: string;
153
+ };
154
+ }): Promise<ServiceResult<SandboxProcessRunResult>>;
155
+ export {};
156
+ //# sourceMappingURL=action-steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-steps.d.ts","sourceRoot":"","sources":["../src/action-steps.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,KAAK,aAAa,CAAC,CAAC,GAAG,OAA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CAAA;IACvB,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C,GAAG,OAAO,CAAC,aAAa,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAI1C;AAED,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,KAAK,GACN,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,EAAE;QACL,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,CAAA;QACd,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAC7B,CAAA;CACF,GAAG,OAAO,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAgClD"}
@@ -0,0 +1,153 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { SandboxService, } from "./service.js";
5
+ function shSingleQuote(value) {
6
+ return `'${String(value).replace(/'/g, `'\"'\"'`)}'`;
7
+ }
8
+ export async function createSandboxStep({ runtime, input, }) {
9
+ "use step";
10
+ return await new SandboxService(runtime.db).createSandbox(input);
11
+ }
12
+ export async function stopSandboxStep({ runtime, input, }) {
13
+ "use step";
14
+ return await new SandboxService(runtime.db).stopSandbox(input.sandboxId);
15
+ }
16
+ export async function runCommandStep({ runtime, input, }) {
17
+ "use step";
18
+ return await new SandboxService(runtime.db).runCommand(input.sandboxId, input.command, input.args ?? []);
19
+ }
20
+ export async function runCommandProcessStep({ runtime, input, }) {
21
+ "use step";
22
+ return await new SandboxService(runtime.db).runCommandWithProcessStream(input.sandboxId, input.command, input.args ?? [], {
23
+ cwd: input.cwd,
24
+ env: input.env,
25
+ kind: input.kind,
26
+ mode: input.mode,
27
+ metadata: input.metadata,
28
+ });
29
+ }
30
+ export async function readProcessStreamStep({ runtime, input, }) {
31
+ "use step";
32
+ return await new SandboxService(runtime.db).readProcessStream(input.processId);
33
+ }
34
+ export async function startObservedProcessStep({ runtime, input, }) {
35
+ "use step";
36
+ return await new SandboxService(runtime.db).startObservedProcess(input.sandboxId, input);
37
+ }
38
+ export async function appendObservedProcessChunkStep({ runtime, input, }) {
39
+ "use step";
40
+ return await new SandboxService(runtime.db).appendObservedProcessChunk(input.processId, input.type, input.data);
41
+ }
42
+ export async function finishObservedProcessStep({ runtime, input, }) {
43
+ "use step";
44
+ return await new SandboxService(runtime.db).finishObservedProcess(input.processId, {
45
+ status: input.status,
46
+ exitCode: input.exitCode,
47
+ errorText: input.errorText,
48
+ metadata: input.metadata,
49
+ });
50
+ }
51
+ export async function writeFilesStep({ runtime, input, }) {
52
+ "use step";
53
+ return await new SandboxService(runtime.db).writeFiles(input.sandboxId, input.files);
54
+ }
55
+ export async function readFileStep({ runtime, input, }) {
56
+ "use step";
57
+ return await new SandboxService(runtime.db).readFile(input.sandboxId, input.path);
58
+ }
59
+ export async function installCodexAuthStep({ runtime, input, }) {
60
+ "use step";
61
+ const codexHome = String(input.codexHome ?? "/home/sprite/.codex").trim() || "/home/sprite/.codex";
62
+ const localCodexHome = String(process.env.CODEX_HOME ?? "").trim() || join(homedir(), ".codex");
63
+ const candidates = {
64
+ authJson: String(input.authJsonPath ?? "").trim() || join(localCodexHome, "auth.json"),
65
+ credentialsJson: String(input.credentialsJsonPath ?? "").trim() || join(localCodexHome, ".credentials.json"),
66
+ configToml: String(input.configTomlPath ?? "").trim() || join(localCodexHome, "config.toml"),
67
+ };
68
+ const files = [];
69
+ const copied = { authJson: false, credentialsJson: false, configToml: false };
70
+ if (existsSync(candidates.authJson)) {
71
+ files.push({
72
+ path: `${codexHome}/auth.json`,
73
+ contentBase64: readFileSync(candidates.authJson).toString("base64"),
74
+ });
75
+ copied.authJson = true;
76
+ }
77
+ if (existsSync(candidates.credentialsJson)) {
78
+ files.push({
79
+ path: `${codexHome}/.credentials.json`,
80
+ contentBase64: readFileSync(candidates.credentialsJson).toString("base64"),
81
+ });
82
+ copied.credentialsJson = true;
83
+ }
84
+ if (existsSync(candidates.configToml)) {
85
+ files.push({
86
+ path: `${codexHome}/config.toml`,
87
+ contentBase64: readFileSync(candidates.configToml).toString("base64"),
88
+ });
89
+ copied.configToml = true;
90
+ }
91
+ if (!copied.authJson && !copied.credentialsJson) {
92
+ return { ok: false, error: "codex_auth_file_not_found" };
93
+ }
94
+ const wrote = await new SandboxService(runtime.db).writeFiles(input.sandboxId, files);
95
+ if (!wrote.ok)
96
+ return wrote;
97
+ return { ok: true, data: copied };
98
+ }
99
+ export async function getSandboxStep({ runtime, input, }) {
100
+ "use step";
101
+ const result = await runtime.db.query({
102
+ sandbox_sandboxes: { $: { where: { id: input.sandboxId }, limit: 1 } },
103
+ });
104
+ const row = result?.sandbox_sandboxes?.[0];
105
+ if (!row)
106
+ return { ok: false, error: "sandbox_not_found" };
107
+ return { ok: true, data: row };
108
+ }
109
+ export async function createCheckpointStep({ runtime, input, }) {
110
+ "use step";
111
+ return await new SandboxService(runtime.db).createCheckpoint(input.sandboxId, {
112
+ comment: input.comment,
113
+ });
114
+ }
115
+ export async function getPortUrlStep({ runtime, input, }) {
116
+ "use step";
117
+ return await new SandboxService(runtime.db).getPortUrl(input.sandboxId, input.port);
118
+ }
119
+ export async function createEkairosAppStep({ runtime, input, }) {
120
+ "use step";
121
+ const service = new SandboxService(runtime.db);
122
+ const appDir = String(input.appDir ?? "").trim() || "/workspace/ekairos-app";
123
+ const tokenEnv = String(input.instantTokenEnvName ?? "INSTANT_PERSONAL_ACCESS_TOKEN").trim();
124
+ const instantToken = String(process.env[tokenEnv] ?? "").trim();
125
+ if (!instantToken)
126
+ return { ok: false, error: `instant_token_env_missing:${tokenEnv}` };
127
+ const tokenPath = `/tmp/ekairos-instant-token-${Date.now()}-${Math.random().toString(36).slice(2)}`;
128
+ const wrote = await service.writeFiles(input.sandboxId, [
129
+ {
130
+ path: tokenPath,
131
+ contentBase64: Buffer.from(instantToken, "utf8").toString("base64"),
132
+ },
133
+ ]);
134
+ if (!wrote.ok)
135
+ return wrote;
136
+ const resultPath = `/tmp/ekairos-create-app-${Date.now()}.json`;
137
+ const packageManager = String(input.packageManager ?? "pnpm").trim() || "pnpm";
138
+ const command = [
139
+ "set -euo pipefail",
140
+ `TOKEN="$(cat ${shSingleQuote(tokenPath)})"`,
141
+ `rm -f ${shSingleQuote(tokenPath)}`,
142
+ `rm -rf ${shSingleQuote(appDir)}`,
143
+ `npx -y @ekairos/domain@beta create-app ${shSingleQuote(appDir)} --next --no-install --json --package-manager=${shSingleQuote(packageManager)} --instantToken="$TOKEN" > ${shSingleQuote(resultPath)}`,
144
+ `node -e 'const fs=require("fs"); const p=require(${JSON.stringify(`${appDir}/package.json`)}); const r=JSON.parse(fs.readFileSync(${JSON.stringify(resultPath)}, "utf8")); console.log(JSON.stringify({ok:r.ok, provisioned:r.data?.provisioned, appId:r.data?.appId, packageName:p.name, ekairosDomain:p.dependencies?.["@ekairos/domain"], workflow:p.dependencies?.workflow}))'`,
145
+ "echo sandbox_create_ekairos_app_ok",
146
+ ].join("\n");
147
+ return await service.runCommandWithProcessStream(input.sandboxId, "sh", ["-lc", command], {
148
+ kind: "command",
149
+ mode: "foreground",
150
+ metadata: { source: "sandbox.domain", label: "create-ekairos-app" },
151
+ });
152
+ }
153
+ //# sourceMappingURL=action-steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-steps.js","sourceRoot":"","sources":["../src/action-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EACL,cAAc,GAGf,MAAM,cAAc,CAAA;AAOrB,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAA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QACjC,0CAA0C,aAAa,CAAC,MAAM,CAAC,iDAAiD,aAAa,CAAC,cAAc,CAAC,8BAA8B,aAAa,CAAC,UAAU,CAAC,EAAE;QACtM,oDAAoD,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,eAAe,CAAC,yCAAyC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,qNAAqN;QACpX,oCAAoC;KACrC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACZ,OAAO,MAAM,OAAO,CAAC,2BAA2B,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;QACxF,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE;KACpE,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,263 @@
1
+ import { z } from "zod";
2
+ import type { CommandResult } from "./commands.js";
3
+ import { type SandboxProcessRunResult, type SandboxProcessStreamChunk } from "./service.js";
4
+ import type { SandboxConfig } from "./types.js";
5
+ export declare const sandboxDomain: import("@ekairos/domain").DomainSchemaResult<{
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>;
263
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AA0BlD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AA6B/C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoLtB,CAAA"}