@agent-compose/sdk 0.5.6 → 0.5.8

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 (44) hide show
  1. package/README.md +4 -4
  2. package/dist/agent/__tests__/run-agent-liveness.test.d.ts +17 -0
  3. package/dist/agent/agent-context.d.ts +67 -0
  4. package/dist/agent/agent-loop-contract.test.d.ts +1 -0
  5. package/dist/agent/agent-loop.d.ts +2 -1
  6. package/dist/client.d.ts +129 -24
  7. package/dist/index.d.ts +9 -4
  8. package/dist/index.js +553 -89
  9. package/dist/pause/wrappers.d.ts +7 -11
  10. package/dist/runtimes/claude.d.ts +9 -1
  11. package/dist/runtimes/openai-desktop.js +548 -89
  12. package/dist/sandbox-errors.d.ts +49 -0
  13. package/dist/sandbox.d.ts +92 -13
  14. package/dist/step-invocation/protocol.d.ts +6 -0
  15. package/dist/step-invocation/types.d.ts +1 -1
  16. package/dist/types/execution-context.d.ts +1 -3
  17. package/dist/types/sandbox-environment.d.ts +1 -10
  18. package/dist/types/sandbox.d.ts +27 -3
  19. package/dist/types/workflow-metadata.d.ts +81 -13
  20. package/dist/types/workflow.d.ts +45 -10
  21. package/dist/utils/bundler.d.ts +40 -9
  22. package/dist/workflow-steps/workflow.d.ts +4 -3
  23. package/package.json +2 -2
  24. package/src/agent/agent-context.ts +212 -0
  25. package/src/agent/agent-loop.ts +78 -10
  26. package/src/agent/run-agent.ts +37 -1
  27. package/src/client.ts +232 -26
  28. package/src/index.ts +9 -4
  29. package/src/pause/wrappers.ts +7 -21
  30. package/src/runtimes/claude.ts +66 -8
  31. package/src/sandbox-errors.ts +53 -0
  32. package/src/sandbox.ts +438 -61
  33. package/src/step-invocation/invoker.ts +66 -8
  34. package/src/step-invocation/protocol.ts +9 -0
  35. package/src/step-invocation/server.ts +27 -4
  36. package/src/step-invocation/types.ts +1 -1
  37. package/src/types/execution-context.ts +1 -3
  38. package/src/types/sandbox-environment.ts +1 -11
  39. package/src/types/sandbox.ts +28 -3
  40. package/src/types/workflow-metadata.ts +91 -16
  41. package/src/types/workflow.ts +45 -12
  42. package/src/utils/bundler.ts +46 -13
  43. package/src/workflow-steps/workflow.ts +4 -3
  44. package/src/workflows/invoke-child.ts +7 -1
@@ -23,7 +23,7 @@ import type { z } from "zod";
23
23
  import type { Step, Workflow } from "./types.js";
24
24
  import { WORKFLOW_BRAND } from "./types.js";
25
25
  import { extractMetadata } from "../types/workflow-metadata.js";
26
- import type { SnapshotConfig, WorkflowMemoryConfig } from "../types/workflow-metadata.js";
26
+ import type { SnapshotConfig, SandboxResources } from "../types/workflow-metadata.js";
27
27
  import type { SandboxNetworkPolicy } from "../sandbox.js";
28
28
  import type { Processor } from "../processors/processor.js";
29
29
 
@@ -51,8 +51,9 @@ export interface StepWorkflowDefinition<TInput, TOutput> {
51
51
  networkPolicy?: SandboxNetworkPolicy;
52
52
  placeholders?: Record<string, string>;
53
53
  snapshots?: SnapshotConfig;
54
- memory?: WorkflowMemoryConfig;
55
- postRunHooks?: readonly string[];
54
+ /** Sandbox machine size — small (default) | medium | large. Vercel maps
55
+ * it to vCPUs; E2B sizing is template-defined. Omit → small. */
56
+ resources?: SandboxResources;
56
57
  processors?: readonly Processor[];
57
58
  }
58
59
 
@@ -24,6 +24,12 @@ export function buildInvokeChild(
24
24
  return (name, input, childOpts) => getChildClient().invokeAndWait(name, input, {
25
25
  ...childOpts,
26
26
  parentRunId: runId,
27
- factorySlug: childOpts?.factorySlug ?? opts.defaultFactorySlug ?? process.env.AGENT_COMPOSE_FACTORY_SLUG ?? "default",
27
+ // The runner sets `AGENT_COMPOSE_FACTORY` (the run's factory slug — see
28
+ // activities.ts loadRunnerEnvs). Default the child to it so it lands in the
29
+ // SAME factory as the parent — the per-run API key is factory-scoped, so a
30
+ // child dispatched into another factory 403s. (Was reading the never-set
31
+ // `AGENT_COMPOSE_FACTORY_SLUG`, silently falling back to "default".)
32
+ factorySlug: childOpts?.factorySlug ?? opts.defaultFactorySlug
33
+ ?? process.env.AGENT_COMPOSE_FACTORY ?? process.env.AGENT_COMPOSE_FACTORY_SLUG ?? "default",
28
34
  });
29
35
  }