@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
@@ -1,12 +1,16 @@
1
1
  /**
2
- * The three opinionated pause wrappers (ADR-0006 §"SDK surface"), each a thin
2
+ * The two opinionated pause wrappers (ADR-0006 §"SDK surface"), each a thin
3
3
  * closure over `ctx.pause`:
4
4
  *
5
- * - `requestDecision` — pause for a typed human/agent decision (schema required).
6
5
  * - `sleep` — a lightweight timed pause; resolves on its own TTL,
7
6
  * skips the snapshot, returns void.
8
7
  * - `waitForEvent` — pause until an event resumes by correlation key.
9
8
  *
9
+ * A typed human/agent decision is NOT a wrapper — it's a plain `ctx.pause`
10
+ * with a `schema` (and `payload.options` for the dashboard's answer UI). The
11
+ * pause primitive carries the reason (the ask) and the resume value (the
12
+ * resolution); there is no separate `requestDecision`.
13
+ *
10
14
  * Built from a `PauseFn` so the wrapper logic lives in one place and the step
11
15
  * runner just spreads them onto the context next to `pause`.
12
16
  */
@@ -16,16 +20,9 @@ import type { PauseRequest } from "./pause-core.js";
16
20
  /** The public `ctx.pause` callable (always `kind: "custom"`). */
17
21
  export type PauseFn = <T = unknown>(req: PauseRequest<T>) => Promise<T>;
18
22
  /** Internal: pause with an explicit wire `kind`. The wrappers stamp
19
- * `decision`/`sleep`/`event` through this; the public `ctx.pause` is always
23
+ * `sleep`/`event` through this; the public `ctx.pause` is always
20
24
  * `custom` and never exposes it. */
21
25
  export type KindedPauseFn = <T = unknown>(req: PauseRequest<T>, kind: StepPauseRequest["kind"]) => Promise<T>;
22
- export interface RequestDecisionRequest<T> {
23
- reason: string;
24
- payload?: Record<string, unknown>;
25
- /** Required — a decision is always validated against a shape. */
26
- schema: z.ZodType<T>;
27
- ttlMs?: number;
28
- }
29
26
  export interface WaitForEventRequest<T> {
30
27
  reason: string;
31
28
  /** Required — the by-key resume route targets this. */
@@ -34,7 +31,6 @@ export interface WaitForEventRequest<T> {
34
31
  ttlMs?: number;
35
32
  }
36
33
  export interface PauseWrappers {
37
- requestDecision<T>(req: RequestDecisionRequest<T>): Promise<T>;
38
34
  sleep(durationMs: number): Promise<void>;
39
35
  waitForEvent<T = unknown>(req: WaitForEventRequest<T>): Promise<T>;
40
36
  }
@@ -7,7 +7,11 @@ export interface ClaudeRuntimeConfig {
7
7
  claudeMdContent?: string;
8
8
  /** Env overrides for Agent SDK provider routing. */
9
9
  env?: Record<string, string>;
10
- /** Model to use. Defaults to DEFAULT_CLAUDE_MODEL. */
10
+ /** Model to use. Accepts a caliber shorthand — "fable" (most capable),
11
+ * "opus", "sonnet", "haiku" (fastest/cheapest) — or an exact model id.
12
+ * Defaults to DEFAULT_CLAUDE_MODEL (Fable). Orchestrators pick a caliber
13
+ * per agent: fable/opus for planning + implementation, sonnet for focused
14
+ * single-responsibility work, haiku for mechanical tasks. */
11
15
  model?: string;
12
16
  /** MCP servers to configure for the Agent SDK. */
13
17
  mcpServers?: Record<string, {
@@ -21,6 +25,10 @@ export interface ClaudeRuntimeConfig {
21
25
  thinking?: ThinkingConfig;
22
26
  /** Reasoning effort hint for models that support adaptive thinking. */
23
27
  effort?: "low" | "medium" | "high" | "xhigh" | "max";
28
+ /** Skills to enable for the agent (the Agent SDK's `skills` option — also
29
+ * auto-adds the `Skill` tool). The agent-env bakes the `/ac:*` skills via
30
+ * `agentc init`; default `"all"` makes them usable. Pass `[]` to disable. */
31
+ skills?: string[] | "all";
24
32
  }
25
33
  export declare class ClaudeRunner implements ModelExecutionContract {
26
34
  private readonly options;