@automatalabs/workflows 0.37.1 → 0.38.1

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/README.md CHANGED
@@ -6,7 +6,7 @@ The programmatic **SDK** for AgentPrism — run dynamic, multi-agent **workflow
6
6
 
7
7
  You author a small JavaScript **script** (a string), the engine runs it in a deterministic,
8
8
  journaled, resumable realm, and every `agent()` call inside it is fanned out to a pooled ACP
9
- backend — **Claude** (`claude-agent-acp`), **Codex** (`codex-acp`), **OpenCode** (`opencode acp`),
9
+ backend — **Claude** (`claude-agent-acp`), **Codex** (`codex-acp`), **OpenCode** (`opencode acp`), **pi** (`pi-acp`),
10
10
  or a registered custom ACP agent — driving the actual subprocess to completion.
11
11
 
12
12
  This package is the **canonical SDK** that the stdio MCP server
@@ -28,7 +28,7 @@ through this SDK's workflow/runner APIs rather than MCP server schemas.
28
28
  pnpm add @automatalabs/workflows
29
29
  ```
30
30
 
31
- > The Claude and Codex ACP servers ship as transitive dependencies and are spawned on demand.
31
+ > The Claude, Codex, and pi ACP servers ship as transitive dependencies and are spawned on demand.
32
32
  > OpenCode is host-resolved: install `opencode-ai` or make `opencode` available on `PATH` before
33
33
  > routing a call to it.
34
34
 
@@ -43,6 +43,7 @@ pnpm add @automatalabs/workflows
43
43
  environment.
44
44
  - **Codex** — a logged-in Codex install (`~/.codex`).
45
45
  - **OpenCode** — credentials configured for the provider OpenCode will use.
46
+ - **pi** — a selected provider API key or credentials in `~/.pi/agent/auth.json`.
46
47
 
47
48
  You only need auth for the backend(s) your scripts actually route to. The default backend is
48
49
  Claude (override with `AGENTPRISM_DEFAULT_BACKEND`; see [Backend selection](#backend-selection)).
@@ -667,7 +668,7 @@ npx @automatalabs/workflows config codex opencode # only the named harnesses
667
668
  npx @automatalabs/workflows config claude --json # machine-readable report
668
669
  ```
669
670
 
670
- Harness names are the routing names: built-in `claude` / `codex` / `opencode` plus any custom
671
+ Harness names are the routing names: built-in `claude` / `codex` / `opencode` / `pi` plus any custom
671
672
  backend registered via `AGENTPRISM_BACKENDS` (registered customs also join the no-argument
672
673
  default set). Each harness opens one session without a prompt — zero tokens — and reports its
673
674
  advertised config-option catalog verbatim: model ids (including bracket variants), effort
@@ -696,7 +697,7 @@ formatHarnessConfigReport(report); // the CLI's human table
696
697
 
697
698
  Pass a JSON Schema to `agent({ schema })` (in a script) or `runner.run(prompt, { schema })` (direct)
698
699
  and the result is a **validated object** instead of text. The backend constrains output natively
699
- (Claude `outputFormat`; Codex strict `outputSchema`; prompt/tool-assisted JSON for OpenCode and
700
+ (Claude `outputFormat`; Codex strict `outputSchema`; pi native `_meta.outputSchema`; prompt/tool-assisted JSON for OpenCode and
700
701
  custom agents), then the value is coerced and validated client-side (typebox `Convert` → `Check`); on a miss the runner re-prompts a bounded number of
701
702
  times before failing with a non-recoverable `SCHEMA_NONCOMPLIANCE`.
702
703
 
@@ -734,7 +735,7 @@ toStrictJsonSchema(schema); // OpenAI-strict-normalized (Codex outputSchema)
734
735
 
735
736
  The backend for each agent is chosen from its effective `model` (preferred) or `tier` string. Split
736
737
  the string on its first `/`. If the first segment, ASCII-case-insensitively, is `claude`, `codex`,
737
- `opencode`, or a registered custom backend name, it selects that harness and is stripped exactly
738
+ `opencode`, `pi`, or a registered custom backend name, it selects that harness and is stripped exactly
738
739
  once; a custom registration wins on a built-in-name collision. A registered harness name alone is
739
740
  backend-only and preserves that harness's configured default model. Any other first segment sends
740
741
  the entire authored string unchanged to `AGENTPRISM_DEFAULT_BACKEND` (default `claude`). Omitting
@@ -746,6 +747,7 @@ import { selectBackend } from "@automatalabs/workflows";
746
747
  selectBackend({ model: "claude/opus[1m]" }).id; // "claude"
747
748
  selectBackend({ model: "codex/gpt-5.6-sol" }).id; // "codex"
748
749
  selectBackend({ model: "opencode/zai/glm-5.2" }).id; // "opencode"
750
+ selectBackend({ model: "pi/openrouter/vendor/model" }).id; // "pi"
749
751
  ```
750
752
 
751
753
  When an id remains after routing, it becomes the exact ACP `session/set_config_option` value
@@ -788,7 +790,7 @@ createAcpRunner, // () => AcpAgentRunner (the default AgentRunner;
788
790
  AcpAgentRunner, // class — implements AgentRunner over ACP
789
791
  InteractiveSession, // held-open multi-turn ACP session returned by openSession()
790
792
  selectBackend, // pick a built-in/custom backend from a model/tier spec
791
- ClaudeBackend, CodexBackend, CustomAcpBackend,
793
+ ClaudeBackend, CodexBackend, OpenCodeBackend, PiBackend, CustomAcpBackend,
792
794
  resolveBackendRegistry, BACKENDS_ENV,
793
795
  AGENT_METHODS, CLIENT_METHODS, ACP_AUTH_REQUIRED_ERROR_CODE,
794
796
  clientCapabilitiesFor, adaptPromptContent,
package/dist/cli.js CHANGED
@@ -75,7 +75,7 @@ and every other session option — by opening one no-prompt session per harness.
75
75
  tokens. Run this BEFORE authoring a workflow so \`model\` / \`configOptions\` values come
76
76
  from the live catalog instead of guesswork (or a throwaway probe workflow).
77
77
 
78
- Harnesses: the built-in names (claude, codex, opencode) and any custom backend
78
+ Harnesses: the built-in names (claude, codex, opencode, pi) and any custom backend
79
79
  registered via the AGENTPRISM_BACKENDS env var. Default: all of them. A harness that
80
80
  cannot spawn or authenticate reports \`probed: false\` with the reason and never blocks
81
81
  the others.
package/dist/config.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { CustomBackendConfig } from "@automatalabs/acp-agents";
2
2
  import type { ValidateHarnessOptions } from "./validate.js";
3
3
  export interface ProbeHarnessConfigOptions {
4
- /** Harness names to probe (built-in `claude` / `codex` / `opencode` or a registered
4
+ /** Harness names to probe (built-in `claude` / `codex` / `opencode` / `pi` or a registered
5
5
  * custom name; any model spec routes like an agent() call's). Default: every routable
6
- * harness — the three built-ins plus each registered custom backend. */
6
+ * harness — the four built-ins plus each registered custom backend. */
7
7
  harnesses?: string[];
8
8
  /** Programmatic custom-backend registry, merged over the AGENTPRISM_BACKENDS env var
9
9
  * exactly like `createAcpRunner({ backends })`. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC;;6EAEyE;IACzE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;wDACoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC/C;yEACqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;+CAC2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,EAAE,EAAE,OAAO,CAAC;IACZ,qDAAqD;IACrD,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,2FAA2F;IAC3F,cAAc,EAAE,sBAAsB,EAAE,CAAC;CAC1C;AAKD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,mBAAmB,CAAC,CAoC9B;AAED,+FAA+F;AAC/F,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAU7E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC;;4EAEwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;wDACoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC/C;yEACqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;+CAC2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,EAAE,EAAE,OAAO,CAAC;IACZ,qDAAqD;IACrD,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,2FAA2F;IAC3F,cAAc,EAAE,sBAAsB,EAAE,CAAC;CAC1C;AAKD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,mBAAmB,CAAC,CAoC9B;AAED,+FAA+F;AAC/F,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAU7E"}
package/dist/config.js CHANGED
@@ -9,7 +9,7 @@ import { redactText } from "@automatalabs/workflow-engine";
9
9
  import { resolveBackendRegistry } from "@automatalabs/acp-agents";
10
10
  import { createValidateProbeRunner } from "./validate-internal.js";
11
11
  import { renderHarnessOptionLines } from "./validate.js";
12
- const BUILTIN_HARNESSES = ["claude", "codex", "opencode"];
12
+ const BUILTIN_HARNESSES = ["claude", "codex", "opencode", "pi"];
13
13
  const DEFAULT_PROBE_TIMEOUT_MS = 60_000;
14
14
  /**
15
15
  * Probe each requested harness's advertised config-option catalog. A per-harness
@@ -67,7 +67,7 @@ export interface ValidatedAgentCall {
67
67
  mode?: string;
68
68
  /** The verbatim session config options authored for this call. */
69
69
  configOptions?: Record<string, string | boolean>;
70
- /** Which concrete backend the spec routes to: "claude" | "codex" | "opencode" | a custom
70
+ /** Which concrete backend the spec routes to: "claude" | "codex" | "opencode" | "pi" | a custom
71
71
  * backend name (suffixed " (script-declared)" when it comes from meta.backends). */
72
72
  backend: string;
73
73
  /** True when the call requested structured output. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automatalabs/workflows",
3
- "version": "0.37.1",
3
+ "version": "0.38.1",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -33,7 +33,7 @@
33
33
  "typebox": "1.3.2",
34
34
  "@automatalabs/shared-types": "0.24.0",
35
35
  "@automatalabs/workflow-engine": "0.26.0",
36
- "@automatalabs/acp-agents": "0.29.0"
36
+ "@automatalabs/acp-agents": "0.30.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsc -b",