inngest 4.23.0 → 4.24.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/components/Inngest.cjs.map +1 -1
  3. package/components/Inngest.d.cts +5 -1
  4. package/components/Inngest.d.cts.map +1 -1
  5. package/components/Inngest.d.ts +5 -1
  6. package/components/Inngest.d.ts.map +1 -1
  7. package/components/Inngest.js.map +1 -1
  8. package/components/realtime/types.d.cts +4 -4
  9. package/components/realtime/types.d.cts.map +1 -1
  10. package/components/realtime/types.d.ts +4 -4
  11. package/components/realtime/types.d.ts.map +1 -1
  12. package/components/sandbox/durable.cjs +27 -5
  13. package/components/sandbox/durable.cjs.map +1 -1
  14. package/components/sandbox/durable.js +27 -5
  15. package/components/sandbox/durable.js.map +1 -1
  16. package/components/sandbox/group.cjs +56 -0
  17. package/components/sandbox/group.cjs.map +1 -0
  18. package/components/sandbox/group.d.cts +16 -0
  19. package/components/sandbox/group.d.cts.map +1 -0
  20. package/components/sandbox/group.d.ts +16 -0
  21. package/components/sandbox/group.d.ts.map +1 -0
  22. package/components/sandbox/group.js +56 -0
  23. package/components/sandbox/group.js.map +1 -0
  24. package/components/sandbox/middleware.cjs +10 -2
  25. package/components/sandbox/middleware.cjs.map +1 -1
  26. package/components/sandbox/middleware.d.cts +5 -0
  27. package/components/sandbox/middleware.d.cts.map +1 -1
  28. package/components/sandbox/middleware.d.ts +5 -0
  29. package/components/sandbox/middleware.d.ts.map +1 -1
  30. package/components/sandbox/middleware.js +11 -3
  31. package/components/sandbox/middleware.js.map +1 -1
  32. package/components/sandbox/types.cjs.map +1 -1
  33. package/components/sandbox/types.d.cts +8 -1
  34. package/components/sandbox/types.d.cts.map +1 -1
  35. package/components/sandbox/types.d.ts +8 -1
  36. package/components/sandbox/types.d.ts.map +1 -1
  37. package/components/sandbox/types.js.map +1 -1
  38. package/components/sandbox/validation.cjs +5 -9
  39. package/components/sandbox/validation.cjs.map +1 -1
  40. package/components/sandbox/validation.js +5 -8
  41. package/components/sandbox/validation.js.map +1 -1
  42. package/experimental.d.cts +2 -1
  43. package/experimental.d.ts +2 -1
  44. package/helpers/duration.cjs +46 -0
  45. package/helpers/duration.cjs.map +1 -0
  46. package/helpers/duration.d.cts +25 -0
  47. package/helpers/duration.d.cts.map +1 -0
  48. package/helpers/duration.d.ts +25 -0
  49. package/helpers/duration.d.ts.map +1 -0
  50. package/helpers/duration.js +44 -0
  51. package/helpers/duration.js.map +1 -0
  52. package/index.cjs +2 -0
  53. package/index.d.cts +2 -1
  54. package/index.d.ts +2 -1
  55. package/index.js +2 -1
  56. package/package.json +1 -1
  57. package/types.cjs.map +1 -1
  58. package/types.d.cts +16 -13
  59. package/types.d.cts.map +1 -1
  60. package/types.d.ts +16 -13
  61. package/types.d.ts.map +1 -1
  62. package/types.js.map +1 -1
  63. package/version.cjs +1 -1
  64. package/version.cjs.map +1 -1
  65. package/version.d.cts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.js.map +1 -1
@@ -0,0 +1,56 @@
1
+ import { NonRetriableError } from "../NonRetriableError.js";
2
+ import { getAsyncCtxSync } from "../execution/als.js";
3
+ import { withSpan } from "../InngestStepTools.js";
4
+ import { StepError } from "../StepError.js";
5
+
6
+ //#region src/components/sandbox/group.ts
7
+ /**
8
+ * @module
9
+ * `group.sandbox()`: a sandbox that lives for the length of a callback, shown
10
+ * as one `sandbox` group in the trace.
11
+ */
12
+ const retriesRemain = () => {
13
+ const ctx = getAsyncCtxSync()?.execution?.ctx;
14
+ return !ctx?.maxAttempts || ctx.attempt < ctx.maxAttempts - 1;
15
+ };
16
+ /**
17
+ * Whether an error ends the sandbox. A final error, or any error on the last
18
+ * attempt, does. Any other error is about to be retried, and the retry replays
19
+ * the memoized creation, so the sandbox must stay alive for it.
20
+ */
21
+ const isFinal = (error) => {
22
+ return error instanceof StepError || error instanceof NonRetriableError || !retriesRemain();
23
+ };
24
+ /**
25
+ * Build `group.sandbox()` on top of `step.sandbox.create()`.
26
+ */
27
+ const createGroupSandbox = (tools) => {
28
+ return (idOrOptions, callback) => {
29
+ const { id, ...options } = typeof idOrOptions === "string" ? {
30
+ id: idOrOptions,
31
+ name: `${getAsyncCtxSync()?.execution?.ctx.runId}-${idOrOptions}`,
32
+ vcpu: 2,
33
+ memoryMb: 2048
34
+ } : idOrOptions;
35
+ return withSpan({
36
+ id,
37
+ name: `Sandbox ${id}`,
38
+ kind: "sandbox"
39
+ }, async () => {
40
+ const sandbox = await tools.create(id, options);
41
+ let failure;
42
+ try {
43
+ return await callback(sandbox);
44
+ } catch (error) {
45
+ failure = { error };
46
+ throw error;
47
+ } finally {
48
+ if (!failure || isFinal(failure.error)) await sandbox[Symbol.asyncDispose]();
49
+ }
50
+ });
51
+ };
52
+ };
53
+
54
+ //#endregion
55
+ export { createGroupSandbox };
56
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.js","names":["failure: { error: unknown } | undefined"],"sources":["../../../src/components/sandbox/group.ts"],"sourcesContent":["/**\n * @module\n * `group.sandbox()`: a sandbox that lives for the length of a callback, shown\n * as one `sandbox` group in the trace.\n */\n\nimport { getAsyncCtxSync } from \"../execution/als.ts\";\nimport { withSpan } from \"../InngestStepTools.ts\";\nimport { NonRetriableError } from \"../NonRetriableError.ts\";\nimport { StepError } from \"../StepError.ts\";\nimport type {\n DurableSandbox,\n DurableSandboxTools,\n SandboxCreateOptions,\n} from \"./types.ts\";\n\n/**\n * The options of `step.sandbox.create()`, plus the ID of the group and of its\n * create step.\n */\nexport type GroupSandboxOptions = SandboxCreateOptions & { id: string };\n\nexport type GroupSandboxOptionsOrId = string | GroupSandboxOptions;\n\nexport type GroupSandbox = <T>(\n idOrOptions: GroupSandboxOptionsOrId,\n callback: (sandbox: DurableSandbox) => Promise<T>,\n) => Promise<T>;\n\nconst retriesRemain = (): boolean => {\n const ctx = getAsyncCtxSync()?.execution?.ctx;\n\n return !ctx?.maxAttempts || ctx.attempt < ctx.maxAttempts - 1;\n};\n\n/**\n * Whether an error ends the sandbox. A final error, or any error on the last\n * attempt, does. Any other error is about to be retried, and the retry replays\n * the memoized creation, so the sandbox must stay alive for it.\n */\nconst isFinal = (error: unknown): boolean => {\n return (\n error instanceof StepError ||\n error instanceof NonRetriableError ||\n !retriesRemain()\n );\n};\n\n/**\n * Build `group.sandbox()` on top of `step.sandbox.create()`.\n */\nexport const createGroupSandbox = (\n tools: DurableSandboxTools,\n): GroupSandbox => {\n return (idOrOptions, callback) => {\n const { id, ...options } =\n typeof idOrOptions === \"string\"\n ? {\n id: idOrOptions,\n // A run's sandboxes need names that no other run shares\n name: `${getAsyncCtxSync()?.execution?.ctx.runId}-${idOrOptions}`,\n vcpu: 2,\n memoryMb: 2048,\n }\n : idOrOptions;\n\n return withSpan(\n { id, name: `Sandbox ${id}`, kind: \"sandbox\" },\n async () => {\n const sandbox = await tools.create(id, options);\n let failure: { error: unknown } | undefined;\n\n try {\n return await callback(sandbox);\n } catch (error) {\n failure = { error };\n\n throw error;\n } finally {\n if (!failure || isFinal(failure.error)) {\n await sandbox[Symbol.asyncDispose]();\n }\n }\n },\n );\n };\n};\n"],"mappings":";;;;;;;;;;;AA6BA,MAAM,sBAA+B;CACnC,MAAM,MAAM,iBAAiB,EAAE,WAAW;AAE1C,QAAO,CAAC,KAAK,eAAe,IAAI,UAAU,IAAI,cAAc;;;;;;;AAQ9D,MAAM,WAAW,UAA4B;AAC3C,QACE,iBAAiB,aACjB,iBAAiB,qBACjB,CAAC,eAAe;;;;;AAOpB,MAAa,sBACX,UACiB;AACjB,SAAQ,aAAa,aAAa;EAChC,MAAM,EAAE,IAAI,GAAG,YACb,OAAO,gBAAgB,WACnB;GACE,IAAI;GAEJ,MAAM,GAAG,iBAAiB,EAAE,WAAW,IAAI,MAAM,GAAG;GACpD,MAAM;GACN,UAAU;GACX,GACD;AAEN,SAAO,SACL;GAAE;GAAI,MAAM,WAAW;GAAM,MAAM;GAAW,EAC9C,YAAY;GACV,MAAM,UAAU,MAAM,MAAM,OAAO,IAAI,QAAQ;GAC/C,IAAIA;AAEJ,OAAI;AACF,WAAO,MAAM,SAAS,QAAQ;YACvB,OAAO;AACd,cAAU,EAAE,OAAO;AAEnB,UAAM;aACE;AACR,QAAI,CAAC,WAAW,QAAQ,QAAQ,MAAM,CACpC,OAAM,QAAQ,OAAO,eAAe;;IAI3C"}
@@ -4,6 +4,7 @@ const require_middleware = require('../middleware/middleware.cjs');
4
4
  const require_types = require('./types.cjs');
5
5
  const require_protocol = require('./protocol.cjs');
6
6
  const require_durable = require('./durable.cjs');
7
+ const require_group = require('./group.cjs');
7
8
  const require_trace = require('./trace.cjs');
8
9
 
9
10
  //#region src/components/sandbox/middleware.ts
@@ -16,7 +17,9 @@ const describeStep = (operation, outcome) => {
16
17
  const execution = require_als.getAsyncCtxSync()?.execution;
17
18
  const stepId = execution?.executingStep?.id;
18
19
  if (!execution || !stepId) return;
19
- execution.instance.addMetadata(stepId, require_trace.sandboxMetadataKind, "step", "merge", require_trace.sandboxTraceMetadata(require_protocol.parseSandboxOperation(operation), "result" in outcome ? outcome : { error: require_protocol.getSandboxError(outcome.error) }));
20
+ const parsed = require_protocol.parseSandboxOperation(operation);
21
+ execution.instance.addMetadata(stepId, require_trace.sandboxMetadataKind, "step", "merge", require_trace.sandboxTraceMetadata(parsed, "result" in outcome ? outcome : { error: require_protocol.getSandboxError(outcome.error) }));
22
+ if ("error" in outcome && parsed.action === "destroy") execution.instance.addMetadata(stepId, "inngest.warnings", "step", "set", { "sdk.sandbox.destroy": `Sandbox ${require_protocol.operationSandboxId(parsed)} couldn't be destroyed: ${outcome.error instanceof Error ? outcome.error.message : String(outcome.error)}` });
20
23
  } catch {}
21
24
  };
22
25
  const executeAsStep = async (client, operation) => {
@@ -67,13 +70,18 @@ var SandboxMiddleware = class extends require_middleware.Middleware.BaseMiddlewa
67
70
  id = "inngest:sandbox";
68
71
  transformFunctionInput(arg) {
69
72
  const rawTool = (idOrOptions, operation) => arg.ctx.step.run(idOrOptions, (input) => executeAsStep(this.client, input), operation);
73
+ const sandbox = require_durable.createSandboxTools(() => rawTool);
70
74
  return {
71
75
  ...arg,
72
76
  ctx: {
73
77
  ...arg.ctx,
74
78
  step: {
75
79
  ...arg.ctx.step,
76
- sandbox: require_durable.createSandboxTools(() => rawTool)
80
+ sandbox
81
+ },
82
+ group: {
83
+ ...arg.ctx.group,
84
+ sandbox: require_group.createGroupSandbox(sandbox)
77
85
  }
78
86
  }
79
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.cjs","names":["getAsyncCtxSync","sandboxMetadataKind","sandboxTraceMetadata","parseSandboxOperation","getSandboxError","executeSandboxOperation","SandboxError","NonRetriableError","SandboxValidationError","sandboxProtocolVersion","Middleware","rawTool: SandboxRawTool","createSandboxTools"],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":["import { getAsyncCtxSync } from \"../execution/als.ts\";\nimport type { Inngest } from \"../Inngest.ts\";\nimport { Middleware } from \"../middleware/middleware.ts\";\nimport { NonRetriableError } from \"../NonRetriableError.ts\";\nimport { createSandboxTools, executeSandboxOperation } from \"./durable.ts\";\nimport {\n getSandboxError,\n parseSandboxOperation,\n type SandboxOperationResultV1,\n type SandboxRawTool,\n} from \"./protocol.ts\";\nimport { sandboxMetadataKind, sandboxTraceMetadata } from \"./trace.ts\";\nimport {\n type DurableSandboxTools,\n SandboxError,\n SandboxValidationError,\n sandboxProtocolVersion,\n} from \"./types.ts\";\n\ntype SandboxStepExtension = {\n sandbox: DurableSandboxTools;\n};\n\n/**\n * Attach `inngest.sandbox` metadata to the step that's executing, describing\n * the sandbox action for the trace. Tracing must never fail the step.\n */\nconst describeStep = (\n operation: unknown,\n outcome: { result: SandboxOperationResultV1 } | { error: unknown },\n): void => {\n try {\n const execution = getAsyncCtxSync()?.execution;\n const stepId = execution?.executingStep?.id;\n if (!execution || !stepId) {\n return;\n }\n\n execution.instance.addMetadata(\n stepId,\n sandboxMetadataKind,\n \"step\",\n \"merge\",\n sandboxTraceMetadata(\n parseSandboxOperation(operation),\n \"result\" in outcome\n ? outcome\n : { error: getSandboxError(outcome.error) },\n ),\n );\n } catch {\n // An operation that fails validation has nothing to describe.\n }\n};\n\nconst executeAsStep = async (\n client: Inngest.Any,\n operation: unknown,\n): Promise<unknown> => {\n try {\n const result = await executeSandboxOperation(client.sandboxes, operation);\n describeStep(operation, { result });\n return result;\n } catch (error) {\n describeStep(operation, { error });\n if (error instanceof SandboxError) {\n const cause = {\n protocolVersion: error.protocolVersion,\n action: error.action,\n code: error.code,\n message: error.message,\n ...(error.status !== undefined && { status: error.status }),\n ...(error.sandboxId !== undefined && {\n sandboxId: error.sandboxId,\n }),\n ...(error.processId !== undefined && {\n processId: error.processId,\n }),\n ...(error.snapshotId !== undefined && {\n snapshotId: error.snapshotId,\n }),\n ambiguous: error.ambiguous,\n retryable: error.retryable,\n ...(error.requestId !== undefined && {\n requestId: error.requestId,\n }),\n details: [...error.details],\n };\n if (error.retryable) {\n const retryableError = new Error(error.message, { cause });\n retryableError.name = error.name;\n throw retryableError;\n }\n throw new NonRetriableError(error.message, { cause });\n }\n if (error instanceof SandboxValidationError) {\n throw new NonRetriableError(error.message, {\n cause: {\n protocolVersion: sandboxProtocolVersion,\n type: \"sandbox_validation_error\" as const,\n message: error.message,\n },\n });\n }\n throw error;\n }\n};\n\n/**\n * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.\n *\n * The executor only sees a normal planned step. Its handler calls the same REST\n * client exposed as `inngest.sandboxes`, then returns JSON-safe wire data for\n * replay.\n */\nexport class SandboxMiddleware extends Middleware.BaseMiddleware {\n readonly id = \"inngest:sandbox\";\n\n override transformFunctionInput(\n arg: Middleware.TransformFunctionInputArgs,\n ): Middleware.TransformFunctionInputArgs & {\n ctx: Middleware.TransformFunctionInputArgs[\"ctx\"] & {\n step: Middleware.TransformFunctionInputArgs[\"ctx\"][\"step\"] &\n SandboxStepExtension;\n };\n } {\n const rawTool: SandboxRawTool = (idOrOptions, operation) =>\n arg.ctx.step.run(\n idOrOptions,\n (input) => executeAsStep(this.client, input),\n operation,\n );\n\n return {\n ...arg,\n ctx: {\n ...arg.ctx,\n step: {\n ...arg.ctx.step,\n sandbox: createSandboxTools(() => rawTool),\n },\n },\n };\n }\n}\n\n/**\n * EXPERIMENTAL: This API is not yet stable and may change in the future without\n * a major version bump.\n *\n * Middleware that enables the experimental durable `step.sandbox` API.\n *\n * The direct `inngest.sandboxes` client does not require this middleware.\n *\n * @example\n * ```ts\n * import { sandboxMiddleware } from \"inngest/experimental\";\n *\n * const inngest = new Inngest({\n * id: \"my-app\",\n * middleware: [sandboxMiddleware()],\n * });\n * ```\n */\nexport const sandboxMiddleware = () => SandboxMiddleware;\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,gBACJ,WACA,YACS;AACT,KAAI;EACF,MAAM,YAAYA,6BAAiB,EAAE;EACrC,MAAM,SAAS,WAAW,eAAe;AACzC,MAAI,CAAC,aAAa,CAAC,OACjB;AAGF,YAAU,SAAS,YACjB,QACAC,mCACA,QACA,SACAC,mCACEC,uCAAsB,UAAU,EAChC,YAAY,UACR,UACA,EAAE,OAAOC,iCAAgB,QAAQ,MAAM,EAAE,CAC9C,CACF;SACK;;AAKV,MAAM,gBAAgB,OACpB,QACA,cACqB;AACrB,KAAI;EACF,MAAM,SAAS,MAAMC,wCAAwB,OAAO,WAAW,UAAU;AACzE,eAAa,WAAW,EAAE,QAAQ,CAAC;AACnC,SAAO;UACA,OAAO;AACd,eAAa,WAAW,EAAE,OAAO,CAAC;AAClC,MAAI,iBAAiBC,4BAAc;GACjC,MAAM,QAAQ;IACZ,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,SAAS,MAAM;IACf,GAAI,MAAM,WAAW,UAAa,EAAE,QAAQ,MAAM,QAAQ;IAC1D,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,eAAe,UAAa,EACpC,YAAY,MAAM,YACnB;IACD,WAAW,MAAM;IACjB,WAAW,MAAM;IACjB,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,SAAS,CAAC,GAAG,MAAM,QAAQ;IAC5B;AACD,OAAI,MAAM,WAAW;IACnB,MAAM,iBAAiB,IAAI,MAAM,MAAM,SAAS,EAAE,OAAO,CAAC;AAC1D,mBAAe,OAAO,MAAM;AAC5B,UAAM;;AAER,SAAM,IAAIC,4CAAkB,MAAM,SAAS,EAAE,OAAO,CAAC;;AAEvD,MAAI,iBAAiBC,qCACnB,OAAM,IAAID,4CAAkB,MAAM,SAAS,EACzC,OAAO;GACL,iBAAiBE;GACjB,MAAM;GACN,SAAS,MAAM;GAChB,EACF,CAAC;AAEJ,QAAM;;;;;;;;;;AAWV,IAAa,oBAAb,cAAuCC,8BAAW,eAAe;CAC/D,AAAS,KAAK;CAEd,AAAS,uBACP,KAMA;EACA,MAAMC,WAA2B,aAAa,cAC5C,IAAI,IAAI,KAAK,IACX,cACC,UAAU,cAAc,KAAK,QAAQ,MAAM,EAC5C,UACD;AAEH,SAAO;GACL,GAAG;GACH,KAAK;IACH,GAAG,IAAI;IACP,MAAM;KACJ,GAAG,IAAI,IAAI;KACX,SAASC,yCAAyB,QAAQ;KAC3C;IACF;GACF;;;;;;;;;;;;;;;;;;;;;AAsBL,MAAa,0BAA0B"}
1
+ {"version":3,"file":"middleware.cjs","names":["getAsyncCtxSync","parseSandboxOperation","sandboxMetadataKind","sandboxTraceMetadata","getSandboxError","operationSandboxId","executeSandboxOperation","SandboxError","NonRetriableError","SandboxValidationError","sandboxProtocolVersion","Middleware","rawTool: SandboxRawTool","createSandboxTools","createGroupSandbox"],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":["import { getAsyncCtxSync } from \"../execution/als.ts\";\nimport type { Inngest } from \"../Inngest.ts\";\nimport { Middleware } from \"../middleware/middleware.ts\";\nimport { NonRetriableError } from \"../NonRetriableError.ts\";\nimport { createSandboxTools, executeSandboxOperation } from \"./durable.ts\";\nimport { createGroupSandbox, type GroupSandbox } from \"./group.ts\";\nimport {\n getSandboxError,\n operationSandboxId,\n parseSandboxOperation,\n type SandboxOperationResultV1,\n type SandboxRawTool,\n} from \"./protocol.ts\";\nimport { sandboxMetadataKind, sandboxTraceMetadata } from \"./trace.ts\";\nimport {\n type DurableSandboxTools,\n SandboxError,\n SandboxValidationError,\n sandboxProtocolVersion,\n} from \"./types.ts\";\n\ntype SandboxStepExtension = {\n sandbox: DurableSandboxTools;\n};\n\ntype SandboxGroupExtension = {\n sandbox: GroupSandbox;\n};\n\n/**\n * Attach `inngest.sandbox` metadata to the step that's executing, describing\n * the sandbox action for the trace. Tracing must never fail the step.\n */\nconst describeStep = (\n operation: unknown,\n outcome: { result: SandboxOperationResultV1 } | { error: unknown },\n): void => {\n try {\n const execution = getAsyncCtxSync()?.execution;\n const stepId = execution?.executingStep?.id;\n if (!execution || !stepId) {\n return;\n }\n\n const parsed = parseSandboxOperation(operation);\n\n execution.instance.addMetadata(\n stepId,\n sandboxMetadataKind,\n \"step\",\n \"merge\",\n sandboxTraceMetadata(\n parsed,\n \"result\" in outcome\n ? outcome\n : { error: getSandboxError(outcome.error) },\n ),\n );\n\n if (\"error\" in outcome && parsed.action === \"destroy\") {\n execution.instance.addMetadata(\n stepId,\n \"inngest.warnings\",\n \"step\",\n \"set\",\n {\n \"sdk.sandbox.destroy\": `Sandbox ${operationSandboxId(parsed)} couldn't be destroyed: ${\n outcome.error instanceof Error\n ? outcome.error.message\n : String(outcome.error)\n }`,\n },\n );\n }\n } catch {\n // An operation that fails validation has nothing to describe.\n }\n};\n\nconst executeAsStep = async (\n client: Inngest.Any,\n operation: unknown,\n): Promise<unknown> => {\n try {\n const result = await executeSandboxOperation(client.sandboxes, operation);\n describeStep(operation, { result });\n return result;\n } catch (error) {\n describeStep(operation, { error });\n if (error instanceof SandboxError) {\n const cause = {\n protocolVersion: error.protocolVersion,\n action: error.action,\n code: error.code,\n message: error.message,\n ...(error.status !== undefined && { status: error.status }),\n ...(error.sandboxId !== undefined && {\n sandboxId: error.sandboxId,\n }),\n ...(error.processId !== undefined && {\n processId: error.processId,\n }),\n ...(error.snapshotId !== undefined && {\n snapshotId: error.snapshotId,\n }),\n ambiguous: error.ambiguous,\n retryable: error.retryable,\n ...(error.requestId !== undefined && {\n requestId: error.requestId,\n }),\n details: [...error.details],\n };\n if (error.retryable) {\n const retryableError = new Error(error.message, { cause });\n retryableError.name = error.name;\n throw retryableError;\n }\n throw new NonRetriableError(error.message, { cause });\n }\n if (error instanceof SandboxValidationError) {\n throw new NonRetriableError(error.message, {\n cause: {\n protocolVersion: sandboxProtocolVersion,\n type: \"sandbox_validation_error\" as const,\n message: error.message,\n },\n });\n }\n throw error;\n }\n};\n\n/**\n * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.\n *\n * The executor only sees a normal planned step. Its handler calls the same REST\n * client exposed as `inngest.sandboxes`, then returns JSON-safe wire data for\n * replay.\n */\nexport class SandboxMiddleware extends Middleware.BaseMiddleware {\n readonly id = \"inngest:sandbox\";\n\n override transformFunctionInput(\n arg: Middleware.TransformFunctionInputArgs,\n ): Middleware.TransformFunctionInputArgs & {\n ctx: Middleware.TransformFunctionInputArgs[\"ctx\"] & {\n step: Middleware.TransformFunctionInputArgs[\"ctx\"][\"step\"] &\n SandboxStepExtension;\n group: Middleware.TransformFunctionInputArgs[\"ctx\"][\"group\"] &\n SandboxGroupExtension;\n };\n } {\n const rawTool: SandboxRawTool = (idOrOptions, operation) =>\n arg.ctx.step.run(\n idOrOptions,\n (input) => executeAsStep(this.client, input),\n operation,\n );\n\n const sandbox = createSandboxTools(() => rawTool);\n\n return {\n ...arg,\n ctx: {\n ...arg.ctx,\n step: { ...arg.ctx.step, sandbox },\n group: { ...arg.ctx.group, sandbox: createGroupSandbox(sandbox) },\n },\n };\n }\n}\n\n/**\n * EXPERIMENTAL: This API is not yet stable and may change in the future without\n * a major version bump.\n *\n * Middleware that enables the experimental durable `step.sandbox` API.\n *\n * The direct `inngest.sandboxes` client does not require this middleware.\n *\n * @example\n * ```ts\n * import { sandboxMiddleware } from \"inngest/experimental\";\n *\n * const inngest = new Inngest({\n * id: \"my-app\",\n * middleware: [sandboxMiddleware()],\n * });\n * ```\n */\nexport const sandboxMiddleware = () => SandboxMiddleware;\n"],"mappings":";;;;;;;;;;;;;;AAiCA,MAAM,gBACJ,WACA,YACS;AACT,KAAI;EACF,MAAM,YAAYA,6BAAiB,EAAE;EACrC,MAAM,SAAS,WAAW,eAAe;AACzC,MAAI,CAAC,aAAa,CAAC,OACjB;EAGF,MAAM,SAASC,uCAAsB,UAAU;AAE/C,YAAU,SAAS,YACjB,QACAC,mCACA,QACA,SACAC,mCACE,QACA,YAAY,UACR,UACA,EAAE,OAAOC,iCAAgB,QAAQ,MAAM,EAAE,CAC9C,CACF;AAED,MAAI,WAAW,WAAW,OAAO,WAAW,UAC1C,WAAU,SAAS,YACjB,QACA,oBACA,QACA,OACA,EACE,uBAAuB,WAAWC,oCAAmB,OAAO,CAAC,0BAC3D,QAAQ,iBAAiB,QACrB,QAAQ,MAAM,UACd,OAAO,QAAQ,MAAM,IAE5B,CACF;SAEG;;AAKV,MAAM,gBAAgB,OACpB,QACA,cACqB;AACrB,KAAI;EACF,MAAM,SAAS,MAAMC,wCAAwB,OAAO,WAAW,UAAU;AACzE,eAAa,WAAW,EAAE,QAAQ,CAAC;AACnC,SAAO;UACA,OAAO;AACd,eAAa,WAAW,EAAE,OAAO,CAAC;AAClC,MAAI,iBAAiBC,4BAAc;GACjC,MAAM,QAAQ;IACZ,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,SAAS,MAAM;IACf,GAAI,MAAM,WAAW,UAAa,EAAE,QAAQ,MAAM,QAAQ;IAC1D,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,eAAe,UAAa,EACpC,YAAY,MAAM,YACnB;IACD,WAAW,MAAM;IACjB,WAAW,MAAM;IACjB,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,SAAS,CAAC,GAAG,MAAM,QAAQ;IAC5B;AACD,OAAI,MAAM,WAAW;IACnB,MAAM,iBAAiB,IAAI,MAAM,MAAM,SAAS,EAAE,OAAO,CAAC;AAC1D,mBAAe,OAAO,MAAM;AAC5B,UAAM;;AAER,SAAM,IAAIC,4CAAkB,MAAM,SAAS,EAAE,OAAO,CAAC;;AAEvD,MAAI,iBAAiBC,qCACnB,OAAM,IAAID,4CAAkB,MAAM,SAAS,EACzC,OAAO;GACL,iBAAiBE;GACjB,MAAM;GACN,SAAS,MAAM;GAChB,EACF,CAAC;AAEJ,QAAM;;;;;;;;;;AAWV,IAAa,oBAAb,cAAuCC,8BAAW,eAAe;CAC/D,AAAS,KAAK;CAEd,AAAS,uBACP,KAQA;EACA,MAAMC,WAA2B,aAAa,cAC5C,IAAI,IAAI,KAAK,IACX,cACC,UAAU,cAAc,KAAK,QAAQ,MAAM,EAC5C,UACD;EAEH,MAAM,UAAUC,yCAAyB,QAAQ;AAEjD,SAAO;GACL,GAAG;GACH,KAAK;IACH,GAAG,IAAI;IACP,MAAM;KAAE,GAAG,IAAI,IAAI;KAAM;KAAS;IAClC,OAAO;KAAE,GAAG,IAAI,IAAI;KAAO,SAASC,iCAAmB,QAAQ;KAAE;IAClE;GACF;;;;;;;;;;;;;;;;;;;;;AAsBL,MAAa,0BAA0B"}
@@ -1,10 +1,14 @@
1
1
  import { Middleware } from "../middleware/middleware.cjs";
2
2
  import { DurableSandboxTools } from "./types.cjs";
3
+ import { GroupSandbox } from "./group.cjs";
3
4
 
4
5
  //#region src/components/sandbox/middleware.d.ts
5
6
  type SandboxStepExtension = {
6
7
  sandbox: DurableSandboxTools;
7
8
  };
9
+ type SandboxGroupExtension = {
10
+ sandbox: GroupSandbox;
11
+ };
8
12
  /**
9
13
  * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.
10
14
  *
@@ -17,6 +21,7 @@ declare class SandboxMiddleware extends Middleware.BaseMiddleware {
17
21
  transformFunctionInput(arg: Middleware.TransformFunctionInputArgs): Middleware.TransformFunctionInputArgs & {
18
22
  ctx: Middleware.TransformFunctionInputArgs["ctx"] & {
19
23
  step: Middleware.TransformFunctionInputArgs["ctx"]["step"] & SandboxStepExtension;
24
+ group: Middleware.TransformFunctionInputArgs["ctx"]["group"] & SandboxGroupExtension;
20
25
  };
21
26
  };
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.cts","names":[],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":[],"mappings":";;;;KAmBK,oBAAA;WACM;AAHS,CAAA;AAkGpB;;;;;;;AAAuC,cAA1B,iBAAA,SAA0B,UAAA,CAAW,cAAA,CAAA;EAAc,SAAA,EAAA,GAAA,iBAAA;EAiDnD,sBAA2C,CAAA,GAAA,EA7C/C,UAAA,CAAW,0BA6CoC,CAAA,EA5CnD,UAAA,CAAW,0BA4CwC,GAAA;SA3C/C,UAAA,CAAW;YACR,UAAA,CAAW,4CACf;;;;;;;;;;;;;;;;;;;;;;cAyCK,gCAAiB"}
1
+ {"version":3,"file":"middleware.d.cts","names":[],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":[],"mappings":";;;;;KAqBK,oBAAA;WACM;AAHS,CAAA;AAGU,KAGzB,qBAAA,GAAqB;EAkHb,OAAA,EAjHF,YAiHoB;CAAA;;;;;;;;AAAQ,cAA1B,iBAAA,SAA0B,UAAA,CAAW,cAAA,CAAA;EAAc,SAAA,EAAA,GAAA,iBAAA;EAmDnD,sBAA2C,CAAA,GAAA,EA/C/C,UAAA,CAAW,0BA+CoC,CAAA,EA9CnD,UAAA,CAAW,0BA8CwC,GAAA;SA7C/C,UAAA,CAAW;YACR,UAAA,CAAW,4CACf;aACK,UAAA,CAAW,6CAChB;;;;;;;;;;;;;;;;;;;;;;cAyCK,gCAAiB"}
@@ -1,10 +1,14 @@
1
1
  import { Middleware } from "../middleware/middleware.js";
2
2
  import { DurableSandboxTools } from "./types.js";
3
+ import { GroupSandbox } from "./group.js";
3
4
 
4
5
  //#region src/components/sandbox/middleware.d.ts
5
6
  type SandboxStepExtension = {
6
7
  sandbox: DurableSandboxTools;
7
8
  };
9
+ type SandboxGroupExtension = {
10
+ sandbox: GroupSandbox;
11
+ };
8
12
  /**
9
13
  * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.
10
14
  *
@@ -17,6 +21,7 @@ declare class SandboxMiddleware extends Middleware.BaseMiddleware {
17
21
  transformFunctionInput(arg: Middleware.TransformFunctionInputArgs): Middleware.TransformFunctionInputArgs & {
18
22
  ctx: Middleware.TransformFunctionInputArgs["ctx"] & {
19
23
  step: Middleware.TransformFunctionInputArgs["ctx"]["step"] & SandboxStepExtension;
24
+ group: Middleware.TransformFunctionInputArgs["ctx"]["group"] & SandboxGroupExtension;
20
25
  };
21
26
  };
22
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","names":[],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":[],"mappings":";;;;KAmBK,oBAAA;WACM;AAHS,CAAA;AAkGpB;;;;;;;AAAuC,cAA1B,iBAAA,SAA0B,UAAA,CAAW,cAAA,CAAA;EAAc,SAAA,EAAA,GAAA,iBAAA;EAiDnD,sBAA2C,CAAA,GAAA,EA7C/C,UAAA,CAAW,0BA6CoC,CAAA,EA5CnD,UAAA,CAAW,0BA4CwC,GAAA;SA3C/C,UAAA,CAAW;YACR,UAAA,CAAW,4CACf;;;;;;;;;;;;;;;;;;;;;;cAyCK,gCAAiB"}
1
+ {"version":3,"file":"middleware.d.ts","names":[],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":[],"mappings":";;;;;KAqBK,oBAAA;WACM;AAHS,CAAA;AAGU,KAGzB,qBAAA,GAAqB;EAkHb,OAAA,EAjHF,YAiHoB;CAAA;;;;;;;;AAAQ,cAA1B,iBAAA,SAA0B,UAAA,CAAW,cAAA,CAAA;EAAc,SAAA,EAAA,GAAA,iBAAA;EAmDnD,sBAA2C,CAAA,GAAA,EA/C/C,UAAA,CAAW,0BA+CoC,CAAA,EA9CnD,UAAA,CAAW,0BA8CwC,GAAA;SA7C/C,UAAA,CAAW;YACR,UAAA,CAAW,4CACf;aACK,UAAA,CAAW,6CAChB;;;;;;;;;;;;;;;;;;;;;;cAyCK,gCAAiB"}
@@ -2,8 +2,9 @@ import { NonRetriableError } from "../NonRetriableError.js";
2
2
  import { getAsyncCtxSync } from "../execution/als.js";
3
3
  import { Middleware } from "../middleware/middleware.js";
4
4
  import { SandboxError, SandboxValidationError, sandboxProtocolVersion } from "./types.js";
5
- import { getSandboxError, parseSandboxOperation } from "./protocol.js";
5
+ import { getSandboxError, operationSandboxId, parseSandboxOperation } from "./protocol.js";
6
6
  import { createSandboxTools, executeSandboxOperation } from "./durable.js";
7
+ import { createGroupSandbox } from "./group.js";
7
8
  import { sandboxMetadataKind, sandboxTraceMetadata } from "./trace.js";
8
9
 
9
10
  //#region src/components/sandbox/middleware.ts
@@ -16,7 +17,9 @@ const describeStep = (operation, outcome) => {
16
17
  const execution = getAsyncCtxSync()?.execution;
17
18
  const stepId = execution?.executingStep?.id;
18
19
  if (!execution || !stepId) return;
19
- execution.instance.addMetadata(stepId, sandboxMetadataKind, "step", "merge", sandboxTraceMetadata(parseSandboxOperation(operation), "result" in outcome ? outcome : { error: getSandboxError(outcome.error) }));
20
+ const parsed = parseSandboxOperation(operation);
21
+ execution.instance.addMetadata(stepId, sandboxMetadataKind, "step", "merge", sandboxTraceMetadata(parsed, "result" in outcome ? outcome : { error: getSandboxError(outcome.error) }));
22
+ if ("error" in outcome && parsed.action === "destroy") execution.instance.addMetadata(stepId, "inngest.warnings", "step", "set", { "sdk.sandbox.destroy": `Sandbox ${operationSandboxId(parsed)} couldn't be destroyed: ${outcome.error instanceof Error ? outcome.error.message : String(outcome.error)}` });
20
23
  } catch {}
21
24
  };
22
25
  const executeAsStep = async (client, operation) => {
@@ -67,13 +70,18 @@ var SandboxMiddleware = class extends Middleware.BaseMiddleware {
67
70
  id = "inngest:sandbox";
68
71
  transformFunctionInput(arg) {
69
72
  const rawTool = (idOrOptions, operation) => arg.ctx.step.run(idOrOptions, (input) => executeAsStep(this.client, input), operation);
73
+ const sandbox = createSandboxTools(() => rawTool);
70
74
  return {
71
75
  ...arg,
72
76
  ctx: {
73
77
  ...arg.ctx,
74
78
  step: {
75
79
  ...arg.ctx.step,
76
- sandbox: createSandboxTools(() => rawTool)
80
+ sandbox
81
+ },
82
+ group: {
83
+ ...arg.ctx.group,
84
+ sandbox: createGroupSandbox(sandbox)
77
85
  }
78
86
  }
79
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","names":["rawTool: SandboxRawTool"],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":["import { getAsyncCtxSync } from \"../execution/als.ts\";\nimport type { Inngest } from \"../Inngest.ts\";\nimport { Middleware } from \"../middleware/middleware.ts\";\nimport { NonRetriableError } from \"../NonRetriableError.ts\";\nimport { createSandboxTools, executeSandboxOperation } from \"./durable.ts\";\nimport {\n getSandboxError,\n parseSandboxOperation,\n type SandboxOperationResultV1,\n type SandboxRawTool,\n} from \"./protocol.ts\";\nimport { sandboxMetadataKind, sandboxTraceMetadata } from \"./trace.ts\";\nimport {\n type DurableSandboxTools,\n SandboxError,\n SandboxValidationError,\n sandboxProtocolVersion,\n} from \"./types.ts\";\n\ntype SandboxStepExtension = {\n sandbox: DurableSandboxTools;\n};\n\n/**\n * Attach `inngest.sandbox` metadata to the step that's executing, describing\n * the sandbox action for the trace. Tracing must never fail the step.\n */\nconst describeStep = (\n operation: unknown,\n outcome: { result: SandboxOperationResultV1 } | { error: unknown },\n): void => {\n try {\n const execution = getAsyncCtxSync()?.execution;\n const stepId = execution?.executingStep?.id;\n if (!execution || !stepId) {\n return;\n }\n\n execution.instance.addMetadata(\n stepId,\n sandboxMetadataKind,\n \"step\",\n \"merge\",\n sandboxTraceMetadata(\n parseSandboxOperation(operation),\n \"result\" in outcome\n ? outcome\n : { error: getSandboxError(outcome.error) },\n ),\n );\n } catch {\n // An operation that fails validation has nothing to describe.\n }\n};\n\nconst executeAsStep = async (\n client: Inngest.Any,\n operation: unknown,\n): Promise<unknown> => {\n try {\n const result = await executeSandboxOperation(client.sandboxes, operation);\n describeStep(operation, { result });\n return result;\n } catch (error) {\n describeStep(operation, { error });\n if (error instanceof SandboxError) {\n const cause = {\n protocolVersion: error.protocolVersion,\n action: error.action,\n code: error.code,\n message: error.message,\n ...(error.status !== undefined && { status: error.status }),\n ...(error.sandboxId !== undefined && {\n sandboxId: error.sandboxId,\n }),\n ...(error.processId !== undefined && {\n processId: error.processId,\n }),\n ...(error.snapshotId !== undefined && {\n snapshotId: error.snapshotId,\n }),\n ambiguous: error.ambiguous,\n retryable: error.retryable,\n ...(error.requestId !== undefined && {\n requestId: error.requestId,\n }),\n details: [...error.details],\n };\n if (error.retryable) {\n const retryableError = new Error(error.message, { cause });\n retryableError.name = error.name;\n throw retryableError;\n }\n throw new NonRetriableError(error.message, { cause });\n }\n if (error instanceof SandboxValidationError) {\n throw new NonRetriableError(error.message, {\n cause: {\n protocolVersion: sandboxProtocolVersion,\n type: \"sandbox_validation_error\" as const,\n message: error.message,\n },\n });\n }\n throw error;\n }\n};\n\n/**\n * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.\n *\n * The executor only sees a normal planned step. Its handler calls the same REST\n * client exposed as `inngest.sandboxes`, then returns JSON-safe wire data for\n * replay.\n */\nexport class SandboxMiddleware extends Middleware.BaseMiddleware {\n readonly id = \"inngest:sandbox\";\n\n override transformFunctionInput(\n arg: Middleware.TransformFunctionInputArgs,\n ): Middleware.TransformFunctionInputArgs & {\n ctx: Middleware.TransformFunctionInputArgs[\"ctx\"] & {\n step: Middleware.TransformFunctionInputArgs[\"ctx\"][\"step\"] &\n SandboxStepExtension;\n };\n } {\n const rawTool: SandboxRawTool = (idOrOptions, operation) =>\n arg.ctx.step.run(\n idOrOptions,\n (input) => executeAsStep(this.client, input),\n operation,\n );\n\n return {\n ...arg,\n ctx: {\n ...arg.ctx,\n step: {\n ...arg.ctx.step,\n sandbox: createSandboxTools(() => rawTool),\n },\n },\n };\n }\n}\n\n/**\n * EXPERIMENTAL: This API is not yet stable and may change in the future without\n * a major version bump.\n *\n * Middleware that enables the experimental durable `step.sandbox` API.\n *\n * The direct `inngest.sandboxes` client does not require this middleware.\n *\n * @example\n * ```ts\n * import { sandboxMiddleware } from \"inngest/experimental\";\n *\n * const inngest = new Inngest({\n * id: \"my-app\",\n * middleware: [sandboxMiddleware()],\n * });\n * ```\n */\nexport const sandboxMiddleware = () => SandboxMiddleware;\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,gBACJ,WACA,YACS;AACT,KAAI;EACF,MAAM,YAAY,iBAAiB,EAAE;EACrC,MAAM,SAAS,WAAW,eAAe;AACzC,MAAI,CAAC,aAAa,CAAC,OACjB;AAGF,YAAU,SAAS,YACjB,QACA,qBACA,QACA,SACA,qBACE,sBAAsB,UAAU,EAChC,YAAY,UACR,UACA,EAAE,OAAO,gBAAgB,QAAQ,MAAM,EAAE,CAC9C,CACF;SACK;;AAKV,MAAM,gBAAgB,OACpB,QACA,cACqB;AACrB,KAAI;EACF,MAAM,SAAS,MAAM,wBAAwB,OAAO,WAAW,UAAU;AACzE,eAAa,WAAW,EAAE,QAAQ,CAAC;AACnC,SAAO;UACA,OAAO;AACd,eAAa,WAAW,EAAE,OAAO,CAAC;AAClC,MAAI,iBAAiB,cAAc;GACjC,MAAM,QAAQ;IACZ,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,SAAS,MAAM;IACf,GAAI,MAAM,WAAW,UAAa,EAAE,QAAQ,MAAM,QAAQ;IAC1D,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,eAAe,UAAa,EACpC,YAAY,MAAM,YACnB;IACD,WAAW,MAAM;IACjB,WAAW,MAAM;IACjB,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,SAAS,CAAC,GAAG,MAAM,QAAQ;IAC5B;AACD,OAAI,MAAM,WAAW;IACnB,MAAM,iBAAiB,IAAI,MAAM,MAAM,SAAS,EAAE,OAAO,CAAC;AAC1D,mBAAe,OAAO,MAAM;AAC5B,UAAM;;AAER,SAAM,IAAI,kBAAkB,MAAM,SAAS,EAAE,OAAO,CAAC;;AAEvD,MAAI,iBAAiB,uBACnB,OAAM,IAAI,kBAAkB,MAAM,SAAS,EACzC,OAAO;GACL,iBAAiB;GACjB,MAAM;GACN,SAAS,MAAM;GAChB,EACF,CAAC;AAEJ,QAAM;;;;;;;;;;AAWV,IAAa,oBAAb,cAAuC,WAAW,eAAe;CAC/D,AAAS,KAAK;CAEd,AAAS,uBACP,KAMA;EACA,MAAMA,WAA2B,aAAa,cAC5C,IAAI,IAAI,KAAK,IACX,cACC,UAAU,cAAc,KAAK,QAAQ,MAAM,EAC5C,UACD;AAEH,SAAO;GACL,GAAG;GACH,KAAK;IACH,GAAG,IAAI;IACP,MAAM;KACJ,GAAG,IAAI,IAAI;KACX,SAAS,yBAAyB,QAAQ;KAC3C;IACF;GACF;;;;;;;;;;;;;;;;;;;;;AAsBL,MAAa,0BAA0B"}
1
+ {"version":3,"file":"middleware.js","names":["rawTool: SandboxRawTool"],"sources":["../../../src/components/sandbox/middleware.ts"],"sourcesContent":["import { getAsyncCtxSync } from \"../execution/als.ts\";\nimport type { Inngest } from \"../Inngest.ts\";\nimport { Middleware } from \"../middleware/middleware.ts\";\nimport { NonRetriableError } from \"../NonRetriableError.ts\";\nimport { createSandboxTools, executeSandboxOperation } from \"./durable.ts\";\nimport { createGroupSandbox, type GroupSandbox } from \"./group.ts\";\nimport {\n getSandboxError,\n operationSandboxId,\n parseSandboxOperation,\n type SandboxOperationResultV1,\n type SandboxRawTool,\n} from \"./protocol.ts\";\nimport { sandboxMetadataKind, sandboxTraceMetadata } from \"./trace.ts\";\nimport {\n type DurableSandboxTools,\n SandboxError,\n SandboxValidationError,\n sandboxProtocolVersion,\n} from \"./types.ts\";\n\ntype SandboxStepExtension = {\n sandbox: DurableSandboxTools;\n};\n\ntype SandboxGroupExtension = {\n sandbox: GroupSandbox;\n};\n\n/**\n * Attach `inngest.sandbox` metadata to the step that's executing, describing\n * the sandbox action for the trace. Tracing must never fail the step.\n */\nconst describeStep = (\n operation: unknown,\n outcome: { result: SandboxOperationResultV1 } | { error: unknown },\n): void => {\n try {\n const execution = getAsyncCtxSync()?.execution;\n const stepId = execution?.executingStep?.id;\n if (!execution || !stepId) {\n return;\n }\n\n const parsed = parseSandboxOperation(operation);\n\n execution.instance.addMetadata(\n stepId,\n sandboxMetadataKind,\n \"step\",\n \"merge\",\n sandboxTraceMetadata(\n parsed,\n \"result\" in outcome\n ? outcome\n : { error: getSandboxError(outcome.error) },\n ),\n );\n\n if (\"error\" in outcome && parsed.action === \"destroy\") {\n execution.instance.addMetadata(\n stepId,\n \"inngest.warnings\",\n \"step\",\n \"set\",\n {\n \"sdk.sandbox.destroy\": `Sandbox ${operationSandboxId(parsed)} couldn't be destroyed: ${\n outcome.error instanceof Error\n ? outcome.error.message\n : String(outcome.error)\n }`,\n },\n );\n }\n } catch {\n // An operation that fails validation has nothing to describe.\n }\n};\n\nconst executeAsStep = async (\n client: Inngest.Any,\n operation: unknown,\n): Promise<unknown> => {\n try {\n const result = await executeSandboxOperation(client.sandboxes, operation);\n describeStep(operation, { result });\n return result;\n } catch (error) {\n describeStep(operation, { error });\n if (error instanceof SandboxError) {\n const cause = {\n protocolVersion: error.protocolVersion,\n action: error.action,\n code: error.code,\n message: error.message,\n ...(error.status !== undefined && { status: error.status }),\n ...(error.sandboxId !== undefined && {\n sandboxId: error.sandboxId,\n }),\n ...(error.processId !== undefined && {\n processId: error.processId,\n }),\n ...(error.snapshotId !== undefined && {\n snapshotId: error.snapshotId,\n }),\n ambiguous: error.ambiguous,\n retryable: error.retryable,\n ...(error.requestId !== undefined && {\n requestId: error.requestId,\n }),\n details: [...error.details],\n };\n if (error.retryable) {\n const retryableError = new Error(error.message, { cause });\n retryableError.name = error.name;\n throw retryableError;\n }\n throw new NonRetriableError(error.message, { cause });\n }\n if (error instanceof SandboxValidationError) {\n throw new NonRetriableError(error.message, {\n cause: {\n protocolVersion: sandboxProtocolVersion,\n type: \"sandbox_validation_error\" as const,\n message: error.message,\n },\n });\n }\n throw error;\n }\n};\n\n/**\n * Adds the durable `step.sandbox` facade using ordinary `step.run` calls.\n *\n * The executor only sees a normal planned step. Its handler calls the same REST\n * client exposed as `inngest.sandboxes`, then returns JSON-safe wire data for\n * replay.\n */\nexport class SandboxMiddleware extends Middleware.BaseMiddleware {\n readonly id = \"inngest:sandbox\";\n\n override transformFunctionInput(\n arg: Middleware.TransformFunctionInputArgs,\n ): Middleware.TransformFunctionInputArgs & {\n ctx: Middleware.TransformFunctionInputArgs[\"ctx\"] & {\n step: Middleware.TransformFunctionInputArgs[\"ctx\"][\"step\"] &\n SandboxStepExtension;\n group: Middleware.TransformFunctionInputArgs[\"ctx\"][\"group\"] &\n SandboxGroupExtension;\n };\n } {\n const rawTool: SandboxRawTool = (idOrOptions, operation) =>\n arg.ctx.step.run(\n idOrOptions,\n (input) => executeAsStep(this.client, input),\n operation,\n );\n\n const sandbox = createSandboxTools(() => rawTool);\n\n return {\n ...arg,\n ctx: {\n ...arg.ctx,\n step: { ...arg.ctx.step, sandbox },\n group: { ...arg.ctx.group, sandbox: createGroupSandbox(sandbox) },\n },\n };\n }\n}\n\n/**\n * EXPERIMENTAL: This API is not yet stable and may change in the future without\n * a major version bump.\n *\n * Middleware that enables the experimental durable `step.sandbox` API.\n *\n * The direct `inngest.sandboxes` client does not require this middleware.\n *\n * @example\n * ```ts\n * import { sandboxMiddleware } from \"inngest/experimental\";\n *\n * const inngest = new Inngest({\n * id: \"my-app\",\n * middleware: [sandboxMiddleware()],\n * });\n * ```\n */\nexport const sandboxMiddleware = () => SandboxMiddleware;\n"],"mappings":";;;;;;;;;;;;;;AAiCA,MAAM,gBACJ,WACA,YACS;AACT,KAAI;EACF,MAAM,YAAY,iBAAiB,EAAE;EACrC,MAAM,SAAS,WAAW,eAAe;AACzC,MAAI,CAAC,aAAa,CAAC,OACjB;EAGF,MAAM,SAAS,sBAAsB,UAAU;AAE/C,YAAU,SAAS,YACjB,QACA,qBACA,QACA,SACA,qBACE,QACA,YAAY,UACR,UACA,EAAE,OAAO,gBAAgB,QAAQ,MAAM,EAAE,CAC9C,CACF;AAED,MAAI,WAAW,WAAW,OAAO,WAAW,UAC1C,WAAU,SAAS,YACjB,QACA,oBACA,QACA,OACA,EACE,uBAAuB,WAAW,mBAAmB,OAAO,CAAC,0BAC3D,QAAQ,iBAAiB,QACrB,QAAQ,MAAM,UACd,OAAO,QAAQ,MAAM,IAE5B,CACF;SAEG;;AAKV,MAAM,gBAAgB,OACpB,QACA,cACqB;AACrB,KAAI;EACF,MAAM,SAAS,MAAM,wBAAwB,OAAO,WAAW,UAAU;AACzE,eAAa,WAAW,EAAE,QAAQ,CAAC;AACnC,SAAO;UACA,OAAO;AACd,eAAa,WAAW,EAAE,OAAO,CAAC;AAClC,MAAI,iBAAiB,cAAc;GACjC,MAAM,QAAQ;IACZ,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACd,MAAM,MAAM;IACZ,SAAS,MAAM;IACf,GAAI,MAAM,WAAW,UAAa,EAAE,QAAQ,MAAM,QAAQ;IAC1D,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,GAAI,MAAM,eAAe,UAAa,EACpC,YAAY,MAAM,YACnB;IACD,WAAW,MAAM;IACjB,WAAW,MAAM;IACjB,GAAI,MAAM,cAAc,UAAa,EACnC,WAAW,MAAM,WAClB;IACD,SAAS,CAAC,GAAG,MAAM,QAAQ;IAC5B;AACD,OAAI,MAAM,WAAW;IACnB,MAAM,iBAAiB,IAAI,MAAM,MAAM,SAAS,EAAE,OAAO,CAAC;AAC1D,mBAAe,OAAO,MAAM;AAC5B,UAAM;;AAER,SAAM,IAAI,kBAAkB,MAAM,SAAS,EAAE,OAAO,CAAC;;AAEvD,MAAI,iBAAiB,uBACnB,OAAM,IAAI,kBAAkB,MAAM,SAAS,EACzC,OAAO;GACL,iBAAiB;GACjB,MAAM;GACN,SAAS,MAAM;GAChB,EACF,CAAC;AAEJ,QAAM;;;;;;;;;;AAWV,IAAa,oBAAb,cAAuC,WAAW,eAAe;CAC/D,AAAS,KAAK;CAEd,AAAS,uBACP,KAQA;EACA,MAAMA,WAA2B,aAAa,cAC5C,IAAI,IAAI,KAAK,IACX,cACC,UAAU,cAAc,KAAK,QAAQ,MAAM,EAC5C,UACD;EAEH,MAAM,UAAU,yBAAyB,QAAQ;AAEjD,SAAO;GACL,GAAG;GACH,KAAK;IACH,GAAG,IAAI;IACP,MAAM;KAAE,GAAG,IAAI,IAAI;KAAM;KAAS;IAClC,OAAO;KAAE,GAAG,IAAI,IAAI;KAAO,SAAS,mBAAmB,QAAQ;KAAE;IAClE;GACF;;;;;;;;;;;;;;;;;;;;;AAsBL,MAAa,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../../src/components/sandbox/types.ts"],"sourcesContent":["import type { DurationLike } from \"../../helpers/temporal.ts\";\nimport type { StepOptionsOrId } from \"../../types.ts\";\n\nexport const sandboxProtocolVersion = 1 as const;\n\nexport type SandboxDuration = number | string | DurationLike;\n\nexport type SandboxStatus =\n | \"PENDING\"\n | \"STARTING\"\n | \"PAUSING\"\n | \"RUNNING\"\n | \"PAUSED\"\n | \"RESUMING\"\n | \"TERMINATING\"\n | \"TERMINATED\"\n | \"FAILED\";\n\nexport interface SandboxResources {\n readonly vcpu: number;\n readonly memoryMb: number;\n}\n\nexport interface SandboxResource {\n id: string;\n name: string;\n status: SandboxStatus;\n vpcId: string;\n imageRef: string;\n resources: SandboxResources;\n createdAt: string;\n startedAt?: string;\n endedAt?: string;\n error?: string;\n}\n\nexport interface SandboxRef extends SandboxResource {\n kind: \"inngest/sandbox\";\n version: 1;\n}\n\ninterface SandboxCreateBaseOptions {\n /**\n * Stable identity for an active sandbox. Creating the same name again with\n * the same configuration returns the existing sandbox. Names are\n * case-sensitive and may contain up to 255 characters.\n */\n name: string;\n\n /**\n * How long to wait for the sandbox to reach RUNNING after Create succeeds.\n *\n * Defaults to 120 seconds. Set this to `false` to return as soon as Create is\n * accepted, with either STARTING or RUNNING status.\n *\n * @example\n * ```ts\n * const sandbox = await inngest.sandboxes.create({\n * ...options,\n * runningTimeout: \"30s\",\n * });\n * ```\n *\n * @example Return immediately without waiting\n * ```ts\n * const sandbox = await inngest.sandboxes.create({\n * ...options,\n * runningTimeout: false,\n * });\n * ```\n */\n runningTimeout?: SandboxDuration | false;\n}\n\nexport interface SandboxCreateFreshOptions extends SandboxCreateBaseOptions {\n vcpu: number;\n memoryMb: number;\n\n /**\n * Literal environment inherited by commands and managed processes. Values\n * are persisted as sandbox configuration. Use `secrets` for workspace secret\n * references. Guest defaults are retained, and operation-specific values\n * override matching keys.\n */\n environment?: Record<string, string>;\n\n /**\n * Exact workspace secret names, each injected under that same environment\n * variable name, e.g. `[\"OPENAI_API_KEY\"]`. Save the secret as OPENAI_API_KEY\n * to make it available under that name. Names are resolved once when\n * creating the sandbox; create retries keep the original secret identities.\n * Archiving and recreating a name affects only new sandboxes. Selected\n * values are fetched at launch with short-lived authorization and inherited\n * by commands and managed processes. Delivered values remain in snapshots.\n * Names must be unique, valid environment keys, and must not overlap with\n * environment. Selection order does not affect sandbox identity.\n */\n secrets?: string[];\n\n snapshotId?: never;\n}\n\nexport interface SandboxCreateFromSnapshotOptions\n extends SandboxCreateBaseOptions {\n snapshotId: string;\n vcpu?: never;\n memoryMb?: never;\n environment?: never;\n secrets?: never;\n}\n\nexport type SandboxCreateOptions =\n | SandboxCreateFreshOptions\n | SandboxCreateFromSnapshotOptions;\n\nexport interface SandboxWaitUntilRunningOptions {\n timeout: SandboxDuration;\n}\n\nexport interface SandboxListOptions {\n cursor?: string;\n limit?: number;\n}\n\nexport interface SandboxPageInfo {\n cursor?: string;\n hasMore: boolean;\n limit: number;\n}\n\nexport interface SandboxListResult<TSandbox = SandboxRef> {\n items: TSandbox[];\n page: SandboxPageInfo;\n fetchedAt: string;\n}\n\n/**\n * A shell command string or an argv array for direct execution.\n *\n * Strings run as `[\"/bin/sh\", \"-c\", command]`. They are passed to the shell\n * unchanged, so normal shell quoting, variables, pipes, redirects, and\n * chaining apply. Arrays bypass the shell and must begin with an absolute\n * executable path.\n */\nexport type SandboxCommand = string | readonly string[];\n\nexport interface SandboxCommandOptions {\n /**\n * Overrides matching sandbox environment values for this command.\n * Omitted or empty inherits the sandbox environment unchanged.\n */\n environment?: Record<string, string>;\n cwd?: string;\n timeout?: SandboxDuration;\n}\n\nexport type SandboxCommandOutputMetadata =\n | {\n truncated: false;\n }\n | {\n truncated: true;\n strategy: \"tail\";\n originalBytes: {\n stdout: number;\n stderr: number;\n };\n retainedBytes: {\n stdout: number;\n stderr: number;\n };\n };\n\nexport interface SandboxCommandResult {\n /**\n * Captured stdout decoded as UTF-8. Invalid or truncated byte sequences are\n * represented by the Unicode replacement character.\n */\n stdout: string;\n /**\n * Captured stderr decoded as UTF-8. Invalid or truncated byte sequences are\n * represented by the Unicode replacement character.\n */\n stderr: string;\n exitCode: number;\n output: SandboxCommandOutputMetadata;\n}\n\nexport type SandboxDestroyResult =\n | {\n status: \"TERMINATING\";\n sandbox: SandboxRef;\n }\n | {\n status: \"TERMINATED\";\n sandbox: null;\n };\n\nexport type SandboxProcessState =\n | \"STARTING\"\n | \"RUNNING\"\n | \"EXITED\"\n | \"KILLED\"\n | \"FAILED\"\n | \"LOST\";\n\nexport interface SandboxProcessResource {\n id: string;\n command: readonly string[];\n pid?: number;\n state: SandboxProcessState;\n exitCode?: number;\n terminationSignal?: number;\n startedAt?: string;\n endedAt?: string;\n}\n\nexport interface SandboxProcessRef extends SandboxProcessResource {\n kind: \"inngest/sandbox.process\";\n version: 1;\n sandboxId: string;\n}\n\nexport interface SandboxProcessStartOptions {\n command: SandboxCommand;\n\n /**\n * Overrides matching sandbox environment values for this process.\n * Omitted or empty inherits the sandbox environment unchanged.\n */\n environment?: Record<string, string>;\n cwd?: string;\n}\n\nexport interface SandboxProcessSignalOptions {\n signal: number;\n /**\n * Also signal the process's descendants. Defaults to `true` so shell-backed\n * commands do not leave their child processes running.\n */\n includeChildren?: boolean;\n}\n\nexport interface SandboxProcessWaitOptions {\n timeout?: SandboxDuration;\n}\n\nexport interface SandboxProcessOutputOptions {\n tailBytes?: number;\n}\n\nexport type SandboxProcessListOptions = SandboxListOptions;\nexport type SandboxProcessListResult<TProcess = SandboxProcessRef> =\n SandboxListResult<TProcess>;\n\nexport interface SandboxOutputChunk {\n stream: \"STDOUT\" | \"STDERR\";\n data: Uint8Array;\n at?: string;\n}\n\nexport interface SandboxProcessOutput {\n chunks: SandboxOutputChunk[];\n}\n\nexport interface SandboxLogStreamOptions {\n follow?: boolean;\n}\n\nexport interface SandboxFileUploadOptions {\n path: string;\n data: BodyInit;\n mode?: number;\n}\n\nexport interface SandboxFileUploadResult {\n path: string;\n bytesWritten: number;\n}\n\nexport interface SandboxFileDownloadOptions {\n path: string;\n}\n\nexport type SandboxSnapshotStatus =\n | \"CREATING\"\n | \"READY\"\n | \"DELETING\"\n | \"DELETED\"\n | \"FAILED\"\n | \"LOST\";\n\nexport interface SandboxSnapshotResource {\n id: string;\n /**\n * The name given when the snapshot was created, if any.\n */\n name?: string;\n sourceImageId: string;\n status: SandboxSnapshotStatus;\n compatibilityId?: string;\n resources: SandboxResources;\n memoryPackCount: number;\n diskPackCount: number;\n storedBytes: number;\n createdAt: string;\n updatedAt: string;\n expiresAt: string;\n error?: string;\n}\n\nexport interface SandboxSnapshotRef extends SandboxSnapshotResource {\n kind: \"inngest/sandbox.snapshot\";\n version: 1;\n}\n\nexport interface SandboxSnapshotWaitOptions {\n timeout: SandboxDuration;\n}\n\nexport interface SandboxLifecycleOptions {\n timeout?: SandboxDuration;\n signal?: AbortSignal;\n}\n\nexport interface SandboxSnapshotCreateOptions {\n /**\n * Optional name for the snapshot. A name is held by at most one CREATING or\n * unexpired READY snapshot at a time; creating another snapshot with a held\n * name fails with `sandbox_snapshot_name_taken`. Names follow the same rules\n * as sandbox names: case-sensitive, up to 255 characters, no control\n * characters, and no leading or trailing whitespace.\n */\n name?: string;\n}\n\nexport interface SandboxSnapshotCloneOptions {\n name: string;\n runningTimeout?: SandboxDuration;\n}\n\nexport interface SandboxSnapshotListOptions extends SandboxListOptions {\n /**\n * Only return snapshots with exactly this name, newest first.\n */\n name?: string;\n}\nexport type SandboxSnapshotListResult<TSnapshot = SandboxSnapshotRef> =\n SandboxListResult<TSnapshot>;\n\nexport type SandboxAction =\n | \"create\"\n | \"list\"\n | \"get\"\n | \"waitUntilRunning\"\n | \"exec\"\n | \"destroy\"\n | \"pause\"\n | \"resume\"\n | \"process.start\"\n | \"process.list\"\n | \"process.get\"\n | \"process.signal\"\n | \"process.wait\"\n | \"process.output\"\n | \"process.stream\"\n | \"logs.stream\"\n | \"file.upload\"\n | \"file.download\"\n | \"snapshot.create\"\n | \"snapshot.list\"\n | \"snapshot.get\"\n | \"snapshot.waitUntilReady\"\n | \"snapshot.delete\";\n\nexport type SandboxErrorCode =\n | \"access_denied\"\n | \"compute_unavailable\"\n | \"internal_error\"\n | \"invalid_field_format\"\n | \"invalid_request\"\n | \"missing_field\"\n | \"operation_ambiguous\"\n | \"rate_limited\"\n | \"sandbox_exec_output_too_large\"\n | \"sandbox_exec_timed_out\"\n | \"sandbox_name_taken\"\n | \"sandbox_not_found\"\n | \"sandbox_start_failed\"\n | \"sandbox_start_timed_out\"\n | \"sandbox_process_not_found\"\n | \"sandbox_process_output_not_retained\"\n | \"sandbox_process_wait_timed_out\"\n | \"sandbox_snapshot_limit_exceeded\"\n | \"sandbox_snapshot_name_taken\"\n | \"sandbox_snapshot_not_found\"\n | \"sandbox_snapshot_not_ready\"\n | \"sandbox_snapshot_wait_timed_out\"\n | (string & {});\n\nexport type SandboxErrorDetail = Record<string, unknown>;\n\nexport interface SandboxErrorOptions {\n action: SandboxAction;\n code: SandboxErrorCode;\n message: string;\n status?: number;\n sandboxId?: string;\n processId?: string;\n snapshotId?: string;\n ambiguous?: boolean;\n retryable?: boolean;\n requestId?: string;\n details?: readonly SandboxErrorDetail[];\n cause?: unknown;\n}\n\nexport class SandboxValidationError extends Error {\n public override readonly cause?: unknown;\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message);\n this.name = \"SandboxValidationError\";\n this.cause = options?.cause;\n }\n}\n\nexport class SandboxError extends Error {\n public readonly protocolVersion = sandboxProtocolVersion;\n public readonly action: SandboxAction;\n public readonly code: SandboxErrorCode;\n public readonly status?: number;\n public readonly sandboxId?: string;\n public readonly processId?: string;\n public readonly snapshotId?: string;\n public readonly ambiguous: boolean;\n public readonly retryable: boolean;\n public readonly requestId?: string;\n public readonly details: readonly SandboxErrorDetail[];\n public override readonly cause?: unknown;\n\n constructor(options: SandboxErrorOptions) {\n super(options.message);\n this.name = \"SandboxError\";\n this.action = options.action;\n this.code = options.code;\n this.status = options.status;\n this.sandboxId = options.sandboxId;\n this.processId = options.processId;\n this.snapshotId = options.snapshotId;\n this.ambiguous =\n options.ambiguous ?? options.code === \"operation_ambiguous\";\n this.retryable = options.retryable ?? false;\n this.requestId = options.requestId;\n this.details = options.details ?? [];\n this.cause = options.cause;\n }\n}\n\nexport interface Sandbox {\n readonly kind: \"inngest/sandbox\";\n readonly version: 1;\n readonly id: string;\n readonly name: string;\n readonly status: SandboxStatus;\n readonly vpcId: string;\n readonly imageRef: string;\n readonly resources: SandboxResources;\n readonly createdAt: string;\n readonly startedAt?: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly commands: {\n run(\n command: SandboxCommand,\n options?: SandboxCommandOptions,\n ): Promise<SandboxCommandResult>;\n };\n readonly logs: {\n stream(\n options?: SandboxLogStreamOptions,\n ): Promise<ReadableStream<SandboxOutputChunk>>;\n };\n readonly files: {\n upload(options: SandboxFileUploadOptions): Promise<SandboxFileUploadResult>;\n download(options: SandboxFileDownloadOptions): Promise<Response>;\n };\n readonly processes: {\n start(options: SandboxProcessStartOptions): Promise<SandboxProcess>;\n list(\n options?: SandboxProcessListOptions,\n ): Promise<SandboxProcessListResult<SandboxProcess>>;\n get(processId: string): Promise<SandboxProcess | null>;\n };\n waitUntilRunning(options: SandboxWaitUntilRunningOptions): Promise<Sandbox>;\n pause(options?: SandboxLifecycleOptions): Promise<Sandbox>;\n resume(options?: SandboxLifecycleOptions): Promise<Sandbox>;\n snapshot(\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<SandboxSnapshot>;\n destroy(): Promise<SandboxDestroyResult>;\n}\n\nexport interface SandboxProcess {\n readonly kind: \"inngest/sandbox.process\";\n readonly version: 1;\n readonly sandboxId: string;\n readonly id: string;\n readonly command: readonly string[];\n readonly pid?: number;\n readonly state: SandboxProcessState;\n readonly exitCode?: number;\n readonly terminationSignal?: number;\n readonly startedAt?: string;\n readonly endedAt?: string;\n signal(options: SandboxProcessSignalOptions): Promise<void>;\n wait(options?: SandboxProcessWaitOptions): Promise<SandboxProcess>;\n getOutput(\n options?: SandboxProcessOutputOptions,\n ): Promise<SandboxProcessOutput>;\n streamOutput(\n options?: SandboxProcessOutputOptions,\n ): Promise<ReadableStream<SandboxOutputChunk>>;\n}\n\nexport interface SandboxSnapshot extends Readonly<SandboxSnapshotRef> {\n clone(\n options: SandboxSnapshotCloneOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<Sandbox>;\n delete(): Promise<void>;\n}\n\nexport interface SandboxClient {\n create(options: SandboxCreateFreshOptions): Promise<Sandbox>;\n list(options?: SandboxListOptions): Promise<SandboxListResult<Sandbox>>;\n get(sandboxId: string): Promise<Sandbox | null>;\n readonly snapshots: {\n list(\n options?: SandboxSnapshotListOptions,\n ): Promise<SandboxSnapshotListResult<SandboxSnapshot>>;\n get(snapshotId: string): Promise<SandboxSnapshot | null>;\n };\n}\n\nexport interface DurableSandbox {\n readonly kind: \"inngest/sandbox\";\n readonly version: 1;\n readonly id: string;\n readonly name: string;\n readonly status: SandboxStatus;\n readonly vpcId: string;\n readonly imageRef: string;\n readonly resources: SandboxResources;\n readonly createdAt: string;\n readonly startedAt?: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly commands: {\n run(\n idOrOptions: StepOptionsOrId,\n command: SandboxCommand,\n options?: SandboxCommandOptions,\n ): Promise<SandboxCommandResult>;\n };\n readonly processes: {\n start(\n idOrOptions: StepOptionsOrId,\n options: SandboxProcessStartOptions,\n ): Promise<DurableSandboxProcess>;\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessListOptions,\n ): Promise<SandboxProcessListResult<DurableSandboxProcess>>;\n get(\n idOrOptions: StepOptionsOrId,\n processId: string,\n ): Promise<DurableSandboxProcess | null>;\n };\n readonly snapshots: {\n create(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandboxSnapshot>;\n };\n snapshot(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandboxSnapshot>;\n pause(\n idOrOptions: StepOptionsOrId,\n options?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n resume(\n idOrOptions: StepOptionsOrId,\n options?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n waitUntilRunning(\n idOrOptions: StepOptionsOrId,\n options: SandboxWaitUntilRunningOptions,\n ): Promise<DurableSandbox>;\n destroy(idOrOptions: StepOptionsOrId): Promise<SandboxDestroyResult>;\n}\n\nexport interface DurableSandboxSnapshot {\n readonly kind: \"inngest/sandbox.snapshot\";\n readonly version: 1;\n readonly id: string;\n readonly name?: string;\n readonly sourceImageId: string;\n readonly status: SandboxSnapshotStatus;\n readonly compatibilityId?: string;\n readonly resources: SandboxResources;\n readonly memoryPackCount: number;\n readonly diskPackCount: number;\n readonly storedBytes: number;\n readonly createdAt: string;\n readonly updatedAt: string;\n readonly expiresAt: string;\n readonly error?: string;\n waitUntilReady(\n idOrOptions: StepOptionsOrId,\n options: SandboxSnapshotWaitOptions,\n ): Promise<DurableSandboxSnapshot>;\n delete(idOrOptions: StepOptionsOrId): Promise<void>;\n clone(\n idOrOptions: StepOptionsOrId,\n options: SandboxSnapshotCloneOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n}\n\nexport interface DurableSandboxProcess {\n readonly kind: \"inngest/sandbox.process\";\n readonly version: 1;\n readonly sandboxId: string;\n readonly id: string;\n readonly command: readonly string[];\n readonly pid?: number;\n readonly state: SandboxProcessState;\n readonly exitCode?: number;\n readonly terminationSignal?: number;\n readonly startedAt?: string;\n readonly endedAt?: string;\n signal(\n idOrOptions: StepOptionsOrId,\n options: SandboxProcessSignalOptions,\n ): Promise<void>;\n wait(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessWaitOptions,\n ): Promise<DurableSandboxProcess>;\n getOutput(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessOutputOptions,\n ): Promise<SandboxProcessOutput>;\n}\n\nexport interface DurableSandboxTools {\n create(\n idOrOptions: StepOptionsOrId,\n options: SandboxCreateOptions,\n ): Promise<DurableSandbox>;\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxListOptions,\n ): Promise<SandboxListResult<DurableSandbox>>;\n get(\n idOrOptions: StepOptionsOrId,\n sandboxId: string,\n ): Promise<DurableSandbox | null>;\n readonly snapshots: {\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotListOptions,\n ): Promise<SandboxSnapshotListResult<DurableSandboxSnapshot>>;\n get(\n idOrOptions: StepOptionsOrId,\n snapshotId: string,\n ): Promise<DurableSandboxSnapshot | null>;\n };\n}\n"],"mappings":";;AAGA,MAAa,yBAAyB;AA8ZtC,IAAa,yBAAb,cAA4C,MAAM;CAChD,AAAyB;CAEzB,YAAY,SAAiB,SAA+B;AAC1D,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,QAAQ,SAAS;;;AAI1B,IAAa,eAAb,cAAkC,MAAM;CACtC,AAAgB,kBAAkB;CAClC,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAyB;CAEzB,YAAY,SAA8B;AACxC,QAAM,QAAQ,QAAQ;AACtB,OAAK,OAAO;AACZ,OAAK,SAAS,QAAQ;AACtB,OAAK,OAAO,QAAQ;AACpB,OAAK,SAAS,QAAQ;AACtB,OAAK,YAAY,QAAQ;AACzB,OAAK,YAAY,QAAQ;AACzB,OAAK,aAAa,QAAQ;AAC1B,OAAK,YACH,QAAQ,aAAa,QAAQ,SAAS;AACxC,OAAK,YAAY,QAAQ,aAAa;AACtC,OAAK,YAAY,QAAQ;AACzB,OAAK,UAAU,QAAQ,WAAW,EAAE;AACpC,OAAK,QAAQ,QAAQ"}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../../src/components/sandbox/types.ts"],"sourcesContent":["import type { DurationLike } from \"../../helpers/temporal.ts\";\nimport type { StepOptionsOrId } from \"../../types.ts\";\n\nexport const sandboxProtocolVersion = 1 as const;\n\nexport type SandboxDuration = number | string | DurationLike;\n\nexport type SandboxStatus =\n | \"PENDING\"\n | \"STARTING\"\n | \"PAUSING\"\n | \"RUNNING\"\n | \"PAUSED\"\n | \"RESUMING\"\n | \"TERMINATING\"\n | \"TERMINATED\"\n | \"FAILED\";\n\nexport interface SandboxResources {\n readonly vcpu: number;\n readonly memoryMb: number;\n}\n\nexport interface SandboxResource {\n id: string;\n name: string;\n status: SandboxStatus;\n vpcId: string;\n imageRef: string;\n resources: SandboxResources;\n createdAt: string;\n startedAt?: string;\n endedAt?: string;\n error?: string;\n}\n\nexport interface SandboxRef extends SandboxResource {\n kind: \"inngest/sandbox\";\n version: 1;\n}\n\ninterface SandboxCreateBaseOptions {\n /**\n * Stable identity for an active sandbox. Creating the same name again with\n * the same configuration returns the existing sandbox. Names are\n * case-sensitive and may contain up to 255 characters.\n */\n name: string;\n\n /**\n * How long to wait for the sandbox to reach RUNNING after Create succeeds.\n *\n * Defaults to 120 seconds. Set this to `false` to return as soon as Create is\n * accepted, with either STARTING or RUNNING status.\n *\n * @example\n * ```ts\n * const sandbox = await inngest.sandboxes.create({\n * ...options,\n * runningTimeout: \"30s\",\n * });\n * ```\n *\n * @example Return immediately without waiting\n * ```ts\n * const sandbox = await inngest.sandboxes.create({\n * ...options,\n * runningTimeout: false,\n * });\n * ```\n */\n runningTimeout?: SandboxDuration | false;\n}\n\nexport interface SandboxCreateFreshOptions extends SandboxCreateBaseOptions {\n vcpu: number;\n memoryMb: number;\n\n /**\n * Literal environment inherited by commands and managed processes. Values\n * are persisted as sandbox configuration. Use `secrets` for workspace secret\n * references. Guest defaults are retained, and operation-specific values\n * override matching keys.\n */\n environment?: Record<string, string>;\n\n /**\n * Exact workspace secret names, each injected under that same environment\n * variable name, e.g. `[\"OPENAI_API_KEY\"]`. Save the secret as OPENAI_API_KEY\n * to make it available under that name. Names are resolved once when\n * creating the sandbox; create retries keep the original secret identities.\n * Archiving and recreating a name affects only new sandboxes. Selected\n * values are fetched at launch with short-lived authorization and inherited\n * by commands and managed processes. Delivered values remain in snapshots.\n * Names must be unique, valid environment keys, and must not overlap with\n * environment. Selection order does not affect sandbox identity.\n */\n secrets?: string[];\n\n snapshotId?: never;\n}\n\nexport interface SandboxCreateFromSnapshotOptions\n extends SandboxCreateBaseOptions {\n snapshotId: string;\n vcpu?: never;\n memoryMb?: never;\n environment?: never;\n secrets?: never;\n}\n\nexport type SandboxCreateOptions =\n | SandboxCreateFreshOptions\n | SandboxCreateFromSnapshotOptions;\n\nexport interface SandboxWaitUntilRunningOptions {\n timeout: SandboxDuration;\n}\n\nexport interface SandboxListOptions {\n cursor?: string;\n limit?: number;\n}\n\nexport interface SandboxPageInfo {\n cursor?: string;\n hasMore: boolean;\n limit: number;\n}\n\nexport interface SandboxListResult<TSandbox = SandboxRef> {\n items: TSandbox[];\n page: SandboxPageInfo;\n fetchedAt: string;\n}\n\n/**\n * A shell command string or an argv array for direct execution.\n *\n * Strings run as `[\"/bin/sh\", \"-c\", command]`. They are passed to the shell\n * unchanged, so normal shell quoting, variables, pipes, redirects, and\n * chaining apply. Arrays bypass the shell and must begin with an absolute\n * executable path.\n */\nexport type SandboxCommand = string | readonly string[];\n\nexport interface SandboxCommandOptions {\n /**\n * Overrides matching sandbox environment values for this command.\n * Omitted or empty inherits the sandbox environment unchanged.\n */\n environment?: Record<string, string>;\n cwd?: string;\n timeout?: SandboxDuration;\n}\n\nexport type SandboxCommandOutputMetadata =\n | {\n truncated: false;\n }\n | {\n truncated: true;\n strategy: \"tail\";\n originalBytes: {\n stdout: number;\n stderr: number;\n };\n retainedBytes: {\n stdout: number;\n stderr: number;\n };\n };\n\nexport interface SandboxCommandResult {\n /**\n * Captured stdout decoded as UTF-8. Invalid or truncated byte sequences are\n * represented by the Unicode replacement character.\n */\n stdout: string;\n /**\n * Captured stderr decoded as UTF-8. Invalid or truncated byte sequences are\n * represented by the Unicode replacement character.\n */\n stderr: string;\n exitCode: number;\n output: SandboxCommandOutputMetadata;\n}\n\nexport type SandboxDestroyResult =\n | {\n status: \"TERMINATING\";\n sandbox: SandboxRef;\n }\n | {\n status: \"TERMINATED\";\n sandbox: null;\n };\n\nexport type SandboxProcessState =\n | \"STARTING\"\n | \"RUNNING\"\n | \"EXITED\"\n | \"KILLED\"\n | \"FAILED\"\n | \"LOST\";\n\nexport interface SandboxProcessResource {\n id: string;\n command: readonly string[];\n pid?: number;\n state: SandboxProcessState;\n exitCode?: number;\n terminationSignal?: number;\n startedAt?: string;\n endedAt?: string;\n}\n\nexport interface SandboxProcessRef extends SandboxProcessResource {\n kind: \"inngest/sandbox.process\";\n version: 1;\n sandboxId: string;\n}\n\nexport interface SandboxProcessStartOptions {\n command: SandboxCommand;\n\n /**\n * Overrides matching sandbox environment values for this process.\n * Omitted or empty inherits the sandbox environment unchanged.\n */\n environment?: Record<string, string>;\n cwd?: string;\n}\n\nexport interface SandboxProcessSignalOptions {\n signal: number;\n /**\n * Also signal the process's descendants. Defaults to `true` so shell-backed\n * commands do not leave their child processes running.\n */\n includeChildren?: boolean;\n}\n\nexport interface SandboxProcessWaitOptions {\n timeout?: SandboxDuration;\n}\n\nexport interface SandboxProcessOutputOptions {\n tailBytes?: number;\n}\n\nexport type SandboxProcessListOptions = SandboxListOptions;\nexport type SandboxProcessListResult<TProcess = SandboxProcessRef> =\n SandboxListResult<TProcess>;\n\nexport interface SandboxOutputChunk {\n stream: \"STDOUT\" | \"STDERR\";\n data: Uint8Array;\n at?: string;\n}\n\nexport interface SandboxProcessOutput {\n chunks: SandboxOutputChunk[];\n}\n\nexport interface SandboxLogStreamOptions {\n follow?: boolean;\n}\n\nexport interface SandboxFileUploadOptions {\n path: string;\n data: BodyInit;\n mode?: number;\n}\n\nexport interface SandboxFileUploadResult {\n path: string;\n bytesWritten: number;\n}\n\nexport interface SandboxFileDownloadOptions {\n path: string;\n}\n\nexport type SandboxSnapshotStatus =\n | \"CREATING\"\n | \"READY\"\n | \"DELETING\"\n | \"DELETED\"\n | \"FAILED\"\n | \"LOST\";\n\nexport interface SandboxSnapshotResource {\n id: string;\n /**\n * The name given when the snapshot was created, if any.\n */\n name?: string;\n sourceImageId: string;\n status: SandboxSnapshotStatus;\n compatibilityId?: string;\n resources: SandboxResources;\n memoryPackCount: number;\n diskPackCount: number;\n storedBytes: number;\n createdAt: string;\n updatedAt: string;\n expiresAt: string;\n error?: string;\n}\n\nexport interface SandboxSnapshotRef extends SandboxSnapshotResource {\n kind: \"inngest/sandbox.snapshot\";\n version: 1;\n}\n\nexport interface SandboxSnapshotWaitOptions {\n timeout: SandboxDuration;\n}\n\nexport interface SandboxLifecycleOptions {\n timeout?: SandboxDuration;\n signal?: AbortSignal;\n}\n\nexport interface SandboxSnapshotCreateOptions {\n /**\n * Optional name for the snapshot. A name is held by at most one CREATING or\n * unexpired READY snapshot at a time; creating another snapshot with a held\n * name fails with `sandbox_snapshot_name_taken`. Names follow the same rules\n * as sandbox names: case-sensitive, up to 255 characters, no control\n * characters, and no leading or trailing whitespace.\n */\n name?: string;\n}\n\nexport interface SandboxSnapshotCloneOptions {\n name: string;\n runningTimeout?: SandboxDuration;\n}\n\nexport interface SandboxSnapshotListOptions extends SandboxListOptions {\n /**\n * Only return snapshots with exactly this name, newest first.\n */\n name?: string;\n}\nexport type SandboxSnapshotListResult<TSnapshot = SandboxSnapshotRef> =\n SandboxListResult<TSnapshot>;\n\nexport type SandboxAction =\n | \"create\"\n | \"list\"\n | \"get\"\n | \"waitUntilRunning\"\n | \"exec\"\n | \"destroy\"\n | \"pause\"\n | \"resume\"\n | \"process.start\"\n | \"process.list\"\n | \"process.get\"\n | \"process.signal\"\n | \"process.wait\"\n | \"process.output\"\n | \"process.stream\"\n | \"logs.stream\"\n | \"file.upload\"\n | \"file.download\"\n | \"snapshot.create\"\n | \"snapshot.list\"\n | \"snapshot.get\"\n | \"snapshot.waitUntilReady\"\n | \"snapshot.delete\";\n\nexport type SandboxErrorCode =\n | \"access_denied\"\n | \"compute_unavailable\"\n | \"internal_error\"\n | \"invalid_field_format\"\n | \"invalid_request\"\n | \"missing_field\"\n | \"operation_ambiguous\"\n | \"rate_limited\"\n | \"sandbox_exec_output_too_large\"\n | \"sandbox_exec_timed_out\"\n | \"sandbox_name_taken\"\n | \"sandbox_not_found\"\n | \"sandbox_start_failed\"\n | \"sandbox_start_timed_out\"\n | \"sandbox_process_not_found\"\n | \"sandbox_process_output_not_retained\"\n | \"sandbox_process_wait_timed_out\"\n | \"sandbox_snapshot_limit_exceeded\"\n | \"sandbox_snapshot_name_taken\"\n | \"sandbox_snapshot_not_found\"\n | \"sandbox_snapshot_not_ready\"\n | \"sandbox_snapshot_wait_timed_out\"\n | (string & {});\n\nexport type SandboxErrorDetail = Record<string, unknown>;\n\nexport interface SandboxErrorOptions {\n action: SandboxAction;\n code: SandboxErrorCode;\n message: string;\n status?: number;\n sandboxId?: string;\n processId?: string;\n snapshotId?: string;\n ambiguous?: boolean;\n retryable?: boolean;\n requestId?: string;\n details?: readonly SandboxErrorDetail[];\n cause?: unknown;\n}\n\nexport class SandboxValidationError extends Error {\n public override readonly cause?: unknown;\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message);\n this.name = \"SandboxValidationError\";\n this.cause = options?.cause;\n }\n}\n\nexport class SandboxError extends Error {\n public readonly protocolVersion = sandboxProtocolVersion;\n public readonly action: SandboxAction;\n public readonly code: SandboxErrorCode;\n public readonly status?: number;\n public readonly sandboxId?: string;\n public readonly processId?: string;\n public readonly snapshotId?: string;\n public readonly ambiguous: boolean;\n public readonly retryable: boolean;\n public readonly requestId?: string;\n public readonly details: readonly SandboxErrorDetail[];\n public override readonly cause?: unknown;\n\n constructor(options: SandboxErrorOptions) {\n super(options.message);\n this.name = \"SandboxError\";\n this.action = options.action;\n this.code = options.code;\n this.status = options.status;\n this.sandboxId = options.sandboxId;\n this.processId = options.processId;\n this.snapshotId = options.snapshotId;\n this.ambiguous =\n options.ambiguous ?? options.code === \"operation_ambiguous\";\n this.retryable = options.retryable ?? false;\n this.requestId = options.requestId;\n this.details = options.details ?? [];\n this.cause = options.cause;\n }\n}\n\nexport interface Sandbox {\n readonly kind: \"inngest/sandbox\";\n readonly version: 1;\n readonly id: string;\n readonly name: string;\n readonly status: SandboxStatus;\n readonly vpcId: string;\n readonly imageRef: string;\n readonly resources: SandboxResources;\n readonly createdAt: string;\n readonly startedAt?: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly commands: {\n run(\n command: SandboxCommand,\n options?: SandboxCommandOptions,\n ): Promise<SandboxCommandResult>;\n };\n readonly logs: {\n stream(\n options?: SandboxLogStreamOptions,\n ): Promise<ReadableStream<SandboxOutputChunk>>;\n };\n readonly files: {\n upload(options: SandboxFileUploadOptions): Promise<SandboxFileUploadResult>;\n download(options: SandboxFileDownloadOptions): Promise<Response>;\n };\n readonly processes: {\n start(options: SandboxProcessStartOptions): Promise<SandboxProcess>;\n list(\n options?: SandboxProcessListOptions,\n ): Promise<SandboxProcessListResult<SandboxProcess>>;\n get(processId: string): Promise<SandboxProcess | null>;\n };\n waitUntilRunning(options: SandboxWaitUntilRunningOptions): Promise<Sandbox>;\n pause(options?: SandboxLifecycleOptions): Promise<Sandbox>;\n resume(options?: SandboxLifecycleOptions): Promise<Sandbox>;\n snapshot(\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<SandboxSnapshot>;\n destroy(): Promise<SandboxDestroyResult>;\n}\n\nexport interface SandboxProcess {\n readonly kind: \"inngest/sandbox.process\";\n readonly version: 1;\n readonly sandboxId: string;\n readonly id: string;\n readonly command: readonly string[];\n readonly pid?: number;\n readonly state: SandboxProcessState;\n readonly exitCode?: number;\n readonly terminationSignal?: number;\n readonly startedAt?: string;\n readonly endedAt?: string;\n signal(options: SandboxProcessSignalOptions): Promise<void>;\n wait(options?: SandboxProcessWaitOptions): Promise<SandboxProcess>;\n getOutput(\n options?: SandboxProcessOutputOptions,\n ): Promise<SandboxProcessOutput>;\n streamOutput(\n options?: SandboxProcessOutputOptions,\n ): Promise<ReadableStream<SandboxOutputChunk>>;\n}\n\nexport interface SandboxSnapshot extends Readonly<SandboxSnapshotRef> {\n clone(\n options: SandboxSnapshotCloneOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<Sandbox>;\n delete(): Promise<void>;\n}\n\nexport interface SandboxClient {\n create(options: SandboxCreateFreshOptions): Promise<Sandbox>;\n list(options?: SandboxListOptions): Promise<SandboxListResult<Sandbox>>;\n get(sandboxId: string): Promise<Sandbox | null>;\n readonly snapshots: {\n list(\n options?: SandboxSnapshotListOptions,\n ): Promise<SandboxSnapshotListResult<SandboxSnapshot>>;\n get(snapshotId: string): Promise<SandboxSnapshot | null>;\n };\n}\n\nexport interface DurableSandbox {\n readonly kind: \"inngest/sandbox\";\n readonly version: 1;\n readonly id: string;\n readonly name: string;\n readonly status: SandboxStatus;\n readonly vpcId: string;\n readonly imageRef: string;\n readonly resources: SandboxResources;\n readonly createdAt: string;\n readonly startedAt?: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly commands: {\n run(\n idOrOptions: StepOptionsOrId,\n command: SandboxCommand,\n options?: SandboxCommandOptions,\n ): Promise<SandboxCommandResult>;\n };\n readonly processes: {\n start(\n idOrOptions: StepOptionsOrId,\n options: SandboxProcessStartOptions,\n ): Promise<DurableSandboxProcess>;\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessListOptions,\n ): Promise<SandboxProcessListResult<DurableSandboxProcess>>;\n get(\n idOrOptions: StepOptionsOrId,\n processId: string,\n ): Promise<DurableSandboxProcess | null>;\n };\n readonly snapshots: {\n create(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandboxSnapshot>;\n };\n snapshot(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotCreateOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandboxSnapshot>;\n pause(\n idOrOptions: StepOptionsOrId,\n options?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n resume(\n idOrOptions: StepOptionsOrId,\n options?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n waitUntilRunning(\n idOrOptions: StepOptionsOrId,\n options: SandboxWaitUntilRunningOptions,\n ): Promise<DurableSandbox>;\n destroy(idOrOptions: StepOptionsOrId): Promise<SandboxDestroyResult>;\n}\n\nexport interface DurableSandboxSnapshot {\n readonly kind: \"inngest/sandbox.snapshot\";\n readonly version: 1;\n readonly id: string;\n readonly name?: string;\n readonly sourceImageId: string;\n readonly status: SandboxSnapshotStatus;\n readonly compatibilityId?: string;\n readonly resources: SandboxResources;\n readonly memoryPackCount: number;\n readonly diskPackCount: number;\n readonly storedBytes: number;\n readonly createdAt: string;\n readonly updatedAt: string;\n readonly expiresAt: string;\n readonly error?: string;\n waitUntilReady(\n idOrOptions: StepOptionsOrId,\n options: SandboxSnapshotWaitOptions,\n ): Promise<DurableSandboxSnapshot>;\n delete(idOrOptions: StepOptionsOrId): Promise<void>;\n clone(\n idOrOptions: StepOptionsOrId,\n options: SandboxSnapshotCloneOptions,\n waitOptions?: SandboxLifecycleOptions,\n ): Promise<DurableSandbox>;\n}\n\nexport interface DurableSandboxProcess {\n readonly kind: \"inngest/sandbox.process\";\n readonly version: 1;\n readonly sandboxId: string;\n readonly id: string;\n readonly command: readonly string[];\n readonly pid?: number;\n readonly state: SandboxProcessState;\n readonly exitCode?: number;\n readonly terminationSignal?: number;\n readonly startedAt?: string;\n readonly endedAt?: string;\n signal(\n idOrOptions: StepOptionsOrId,\n options: SandboxProcessSignalOptions,\n ): Promise<void>;\n wait(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessWaitOptions,\n ): Promise<DurableSandboxProcess>;\n getOutput(\n idOrOptions: StepOptionsOrId,\n options?: SandboxProcessOutputOptions,\n ): Promise<SandboxProcessOutput>;\n}\n\nexport interface DurableSandboxTools {\n /**\n * Create a sandbox. With `await using`, the sandbox is destroyed when the\n * scope ends, in a memoized `<id>:destroy` step.\n *\n * Disposing can't see why the scope ended, so it also destroys before a retry.\n */\n create(\n idOrOptions: StepOptionsOrId,\n options: SandboxCreateOptions,\n ): Promise<DurableSandbox & AsyncDisposable>;\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxListOptions,\n ): Promise<SandboxListResult<DurableSandbox>>;\n get(\n idOrOptions: StepOptionsOrId,\n sandboxId: string,\n ): Promise<DurableSandbox | null>;\n readonly snapshots: {\n list(\n idOrOptions: StepOptionsOrId,\n options?: SandboxSnapshotListOptions,\n ): Promise<SandboxSnapshotListResult<DurableSandboxSnapshot>>;\n get(\n idOrOptions: StepOptionsOrId,\n snapshotId: string,\n ): Promise<DurableSandboxSnapshot | null>;\n };\n}\n"],"mappings":";;AAGA,MAAa,yBAAyB;AA8ZtC,IAAa,yBAAb,cAA4C,MAAM;CAChD,AAAyB;CAEzB,YAAY,SAAiB,SAA+B;AAC1D,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,QAAQ,SAAS;;;AAI1B,IAAa,eAAb,cAAkC,MAAM;CACtC,AAAgB,kBAAkB;CAClC,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAgB;CAChB,AAAyB;CAEzB,YAAY,SAA8B;AACxC,QAAM,QAAQ,QAAQ;AACtB,OAAK,OAAO;AACZ,OAAK,SAAS,QAAQ;AACtB,OAAK,OAAO,QAAQ;AACpB,OAAK,SAAS,QAAQ;AACtB,OAAK,YAAY,QAAQ;AACzB,OAAK,YAAY,QAAQ;AACzB,OAAK,aAAa,QAAQ;AAC1B,OAAK,YACH,QAAQ,aAAa,QAAQ,SAAS;AACxC,OAAK,YAAY,QAAQ,aAAa;AACtC,OAAK,YAAY,QAAQ;AACzB,OAAK,UAAU,QAAQ,WAAW,EAAE;AACpC,OAAK,QAAQ,QAAQ"}
@@ -1,3 +1,4 @@
1
+ /// <reference lib="esnext.disposable" />
1
2
  import { DurationLike } from "../../helpers/temporal.cjs";
2
3
  import { StepOptionsOrId } from "../../types.cjs";
3
4
 
@@ -441,7 +442,13 @@ interface DurableSandboxProcess {
441
442
  getOutput(idOrOptions: StepOptionsOrId, options?: SandboxProcessOutputOptions): Promise<SandboxProcessOutput>;
442
443
  }
443
444
  interface DurableSandboxTools {
444
- create(idOrOptions: StepOptionsOrId, options: SandboxCreateOptions): Promise<DurableSandbox>;
445
+ /**
446
+ * Create a sandbox. With `await using`, the sandbox is destroyed when the
447
+ * scope ends, in a memoized `<id>:destroy` step.
448
+ *
449
+ * Disposing can't see why the scope ended, so it also destroys before a retry.
450
+ */
451
+ create(idOrOptions: StepOptionsOrId, options: SandboxCreateOptions): Promise<DurableSandbox & AsyncDisposable>;
445
452
  list(idOrOptions: StepOptionsOrId, options?: SandboxListOptions): Promise<SandboxListResult<DurableSandbox>>;
446
453
  get(idOrOptions: StepOptionsOrId, sandboxId: string): Promise<DurableSandbox | null>;
447
454
  readonly snapshots: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/sandbox/types.ts"],"sourcesContent":[],"mappings":";;;;KAKY,eAAA,qBAAoC;AAApC,KAEA,aAAA,GAFe,SAAqB,GAAA,UAAY,GAAA,SAAA,GAAA,SAAA,GAAA,QAAA,GAAA,UAAA,GAAA,aAAA,GAAA,YAAA,GAAA,QAAA;AAEhD,UAWK,gBAAA,CAXQ;EAWR,SAAA,IAAA,EAAA,MAAgB;EAKhB,SAAA,QAAA,EAAe,MAAA;;AAGtB,UAHO,eAAA,CAGP;MAGG,MAAA;EAAgB,IAAA,EAAA,MAAA;EAOZ,MAAA,EAVP,aAUkB;EAKlB,KAAA,EAAA,MAAA;EAiCO,QAAA,EAAA,MAAA;EAA0B,SAAA,EA7C9B,gBA6C8B;WAU3B,EAAA,MAAA;WAVmC,CAAA,EAAA,MAAA;EAAwB,OAAA,CAAA,EAAA,MAAA;EA4B1D,KAAA,CAAA,EAAA,MAAA;AASjB;AAAgC,UA3Ef,UAAA,SAAmB,eA2EJ,CAAA;MAC5B,EA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S,kBAAkB;qBAEvB,0BACJ,2CACK,0BACb,QAAQ;;UAGI,qBAAA;;;;;;;kBAOC;;;;;sBAMD,0BACJ,8BACR;oBAEY,2BACH,4BACT,QAAQ;yBAEI,2BACH,8BACT,QAAQ;;UAGI,mBAAA;;;;;;;sBAQA,0BACJ,uBACR,QAAQ,iBAAiB;oBAEb,2BACH,qBACT,QAAQ,kBAAkB;mBAEd,qCAEZ,QAAQ;;sBAGM,2BACH,6BACT,QAAQ,0BAA0B;qBAEtB,sCAEZ,QAAQ"}
@@ -1,3 +1,4 @@
1
+ /// <reference lib="esnext.disposable" />
1
2
  import { DurationLike } from "../../helpers/temporal.js";
2
3
  import { StepOptionsOrId } from "../../types.js";
3
4
 
@@ -441,7 +442,13 @@ interface DurableSandboxProcess {
441
442
  getOutput(idOrOptions: StepOptionsOrId, options?: SandboxProcessOutputOptions): Promise<SandboxProcessOutput>;
442
443
  }
443
444
  interface DurableSandboxTools {
444
- create(idOrOptions: StepOptionsOrId, options: SandboxCreateOptions): Promise<DurableSandbox>;
445
+ /**
446
+ * Create a sandbox. With `await using`, the sandbox is destroyed when the
447
+ * scope ends, in a memoized `<id>:destroy` step.
448
+ *
449
+ * Disposing can't see why the scope ended, so it also destroys before a retry.
450
+ */
451
+ create(idOrOptions: StepOptionsOrId, options: SandboxCreateOptions): Promise<DurableSandbox & AsyncDisposable>;
445
452
  list(idOrOptions: StepOptionsOrId, options?: SandboxListOptions): Promise<SandboxListResult<DurableSandbox>>;
446
453
  get(idOrOptions: StepOptionsOrId, sandboxId: string): Promise<DurableSandbox | null>;
447
454
  readonly snapshots: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/sandbox/types.ts"],"sourcesContent":[],"mappings":";;;;KAKY,eAAA,qBAAoC;AAApC,KAEA,aAAA,GAFe,SAAqB,GAAA,UAAY,GAAA,SAAA,GAAA,SAAA,GAAA,QAAA,GAAA,UAAA,GAAA,aAAA,GAAA,YAAA,GAAA,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