@smithers-orchestrator/graph 0.20.4 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/graph",
3
- "version": "0.20.4",
3
+ "version": "0.21.0",
4
4
  "description": "Framework-neutral Smithers workflow graph model and extraction helpers",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "drizzle-orm": "^0.45.2",
24
24
  "zod": "^4.3.6",
25
- "@smithers-orchestrator/errors": "0.20.4"
25
+ "@smithers-orchestrator/errors": "0.21.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/bun": "latest",
@@ -398,7 +398,8 @@ export function extractFromHost(root, opts) {
398
398
  : undefined;
399
399
  const parallelGroup = nextParallelStack[nextParallelStack.length - 1];
400
400
  const topWorktree = nextWorktreeStack[nextWorktreeStack.length - 1];
401
- const runtime = raw.__smithersSandboxRuntime ?? raw.runtime ?? "bubblewrap";
401
+ const runtime = raw.__smithersSandboxRuntime ?? raw.runtime;
402
+ const provider = raw.__smithersSandboxProvider ?? raw.provider;
402
403
  const workflowDef = raw.__smithersSandboxWorkflow ??
403
404
  raw.workflow;
404
405
  const descriptor = {
@@ -431,23 +432,27 @@ export function extractFromHost(root, opts) {
431
432
  const [
432
433
  { executeSandbox },
433
434
  { executeChildWorkflow },
435
+ { applyDiffBundle },
434
436
  ] = await Promise.all([
435
437
  loadRuntimeModule("@smithers-orchestrator/sandbox/execute"),
436
438
  loadRuntimeModule("@smithers-orchestrator/engine/child-workflow"),
439
+ loadRuntimeModule("@smithers-orchestrator/engine/effect/diff-bundle"),
437
440
  ]);
438
441
  if (!workflowDef) {
439
442
  throw new SmithersError("INVALID_INPUT", `Sandbox ${nodeId} is missing workflow definition.`, { nodeId });
440
443
  }
441
444
  return executeSandbox({
442
- parentWorkflow: workflowDef && typeof workflowDef === "object" && "build" in workflowDef
443
- ? workflowDef
444
- : undefined,
445
+ parentWorkflow: undefined,
445
446
  sandboxId: nodeId,
446
- runtime: runtime === "docker" || runtime === "codeplane" || runtime === "bubblewrap"
447
+ provider,
448
+ runtime: runtime === undefined || runtime === "docker" || runtime === "codeplane" || runtime === "bubblewrap"
447
449
  ? runtime
448
- : "bubblewrap",
450
+ : (() => {
451
+ throw new SmithersError("INVALID_INPUT", `Unsupported sandbox runtime: ${String(runtime)}`, { runtime });
452
+ })(),
449
453
  workflow: workflowDef,
450
454
  executeChildWorkflow,
455
+ applyDiffBundle,
451
456
  input: raw.__smithersSandboxInput ?? raw.input,
452
457
  rootDir: topWorktree?.path ?? process.cwd(),
453
458
  allowNetwork: Boolean(raw.allowNetwork),
@@ -455,6 +460,7 @@ export function extractFromHost(root, opts) {
455
460
  toolTimeoutMs: 60_000,
456
461
  reviewDiffs: raw.reviewDiffs,
457
462
  autoAcceptDiffs: raw.autoAcceptDiffs,
463
+ allowNested: Boolean(raw.__smithersSandboxAllowNested ?? raw.allowNested),
458
464
  config: {
459
465
  image: raw.image,
460
466
  env: raw.env,
@@ -472,7 +478,23 @@ export function extractFromHost(root, opts) {
472
478
  ...raw.meta,
473
479
  __sandbox: true,
474
480
  __sandboxRuntime: runtime,
481
+ __sandboxProvider: provider,
482
+ __sandboxWorkflow: workflowDef,
475
483
  __sandboxInput: raw.__smithersSandboxInput ?? raw.input,
484
+ __sandboxAllowNetwork: Boolean(raw.allowNetwork),
485
+ __sandboxReviewDiffs: raw.reviewDiffs,
486
+ __sandboxAutoAcceptDiffs: raw.autoAcceptDiffs,
487
+ __sandboxAllowNested: raw.__smithersSandboxAllowNested ?? raw.allowNested,
488
+ __sandboxConfig: {
489
+ image: raw.image,
490
+ env: raw.env,
491
+ ports: raw.ports,
492
+ volumes: raw.volumes,
493
+ memoryLimit: raw.memoryLimit,
494
+ cpuLimit: raw.cpuLimit,
495
+ command: raw.command,
496
+ workspace: raw.workspace,
497
+ },
476
498
  },
477
499
  parallelGroupId: parallelGroup?.id,
478
500
  parallelMaxConcurrency: parallelGroup?.max,
package/src/extract.js CHANGED
@@ -431,7 +431,7 @@ export function extractGraph(root, opts) {
431
431
  requireOutput(raw, nodeId, "Sandbox");
432
432
  const { retries, retryPolicy } = resolveRetryConfig(raw);
433
433
  const output = resolveOutput(raw);
434
- const runtime = raw.__smithersSandboxRuntime ?? raw.runtime ?? "bubblewrap";
434
+ const runtime = raw.__smithersSandboxRuntime ?? raw.runtime;
435
435
  addDescriptor(raw, nodeId, {
436
436
  ...common,
437
437
  ...output,
@@ -452,7 +452,23 @@ export function extractGraph(root, opts) {
452
452
  : {}),
453
453
  __sandbox: true,
454
454
  __sandboxRuntime: runtime,
455
+ __sandboxProvider: raw.__smithersSandboxProvider ?? raw.provider,
456
+ __sandboxWorkflow: raw.__smithersSandboxWorkflow ?? raw.workflow,
455
457
  __sandboxInput: raw.__smithersSandboxInput ?? raw.input,
458
+ __sandboxAllowNetwork: Boolean(raw.allowNetwork),
459
+ __sandboxReviewDiffs: raw.reviewDiffs,
460
+ __sandboxAutoAcceptDiffs: raw.autoAcceptDiffs,
461
+ __sandboxAllowNested: raw.__smithersSandboxAllowNested ?? raw.allowNested,
462
+ __sandboxConfig: {
463
+ image: raw.image,
464
+ env: raw.env,
465
+ ports: raw.ports,
466
+ volumes: raw.volumes,
467
+ memoryLimit: raw.memoryLimit,
468
+ cpuLimit: raw.cpuLimit,
469
+ command: raw.command,
470
+ workspace: raw.workspace,
471
+ },
456
472
  },
457
473
  });
458
474
  return;