@automatalabs/workflows 0.4.1 → 0.5.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/README.md CHANGED
@@ -138,9 +138,11 @@ try {
138
138
 
139
139
  `run(prompt, options?)` accepts the seam's `RunOptions`: `schema`, `model`, `tier`, `cwd`,
140
140
  `instructions`, `label`, `toolNames` / `disallowedToolNames`, `signal`, `mcpServers`,
141
- `baseInstructions` / `developerInstructions` (Codex-only), and the out-of-band telemetry callbacks
142
- `onUsage` / `onModelResolved` / `onModelFallback` / `onHistory`. Token/cost usage is delivered via
143
- `onUsage` (it may never fire ACP usage is experimental), never via the return value.
141
+ `meta` / `promptMeta` (generic ACP `_meta` passthroughs merged into `session/new` /
142
+ `session/prompt`), `baseInstructions` / `developerInstructions` (Codex-only), and the out-of-band
143
+ telemetry callbacks `onUsage` / `onModelResolved` / `onModelFallback` / `onHistory`. Token/cost
144
+ usage is delivered via `onUsage` (it may never fire — ACP usage is experimental), never via the
145
+ return value.
144
146
 
145
147
  > **Codex session instructions.** When the run routes to the Codex backend, `baseInstructions`
146
148
  > **replaces** Codex's built-in base system prompt and `developerInstructions` adds developer-role
@@ -160,6 +162,22 @@ try {
160
162
  > closes one **session** on it. Call `dispose()` once at shutdown to tear the pool down. Pool size
161
163
  > is `AcpPoolOptions.size` (default 1) or `AGENTPRISM_ACP_POOL_SIZE`.
162
164
 
165
+ > **Custom backends.** Any ACP agent can serve `run()` / `agent()` calls — register it by name and
166
+ > route to it with `model`:
167
+ >
168
+ > ```ts
169
+ > const runner = createAcpRunner({
170
+ > backends: { browser: { command: "node", args: ["/abs/browser-acp.js"] } },
171
+ > });
172
+ > await runner.run("Verify the checkout flow.", { model: "browser" });
173
+ > ```
174
+ >
175
+ > `model: "browser/vision-large"` additionally selects `vision-large` from the agent's config-option
176
+ > catalog. The same registry can be declared via `AGENTPRISM_BACKENDS` (JSON env var; the
177
+ > programmatic option wins per name). A `schema` is forwarded to custom backends as turn-level
178
+ > `_meta.outputSchema` and the result is JSON-parsed off the final message — agents that ignore the
179
+ > schema channel still work via the validate/re-prompt ladder.
180
+
163
181
  ### c) `WorkflowManager` — stateful / resumable runs
164
182
 
165
183
  `runDynamicWorkflow` is a thin wrapper over a fresh `WorkflowManager`. Construct one yourself to
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import type { AgentRunner, WorkflowRunResult } from "@automatalabs/shared-types"
3
3
  export { runWorkflow, parseWorkflowScript, WorkflowManager } from "@automatalabs/workflow-engine";
4
4
  export type { WorkflowRunOptions, AgentOptions, ExecOptions, WorkflowManagerOptions, CheckpointOptions, WorkflowRunResult, WorkflowSnapshot, } from "@automatalabs/workflow-engine";
5
5
  export { WorkflowError, WorkflowErrorCode, isWorkflowError, isProviderUsageLimit, } from "@automatalabs/workflow-engine";
6
- export { createAcpRunner, AcpAgentRunner, selectBackend, ClaudeBackend, CodexBackend, toJsonSchema, toStrictJsonSchema, } from "@automatalabs/acp-agents";
7
- export type { AcpPoolOptions } from "@automatalabs/acp-agents";
6
+ export { createAcpRunner, AcpAgentRunner, selectBackend, ClaudeBackend, CodexBackend, CustomAcpBackend, resolveBackendRegistry, BACKENDS_ENV, toJsonSchema, toStrictJsonSchema, } from "@automatalabs/acp-agents";
7
+ export type { AcpPoolOptions, AcpRunnerOptions, BackendRegistry, CustomBackendConfig, RegisteredBackend, } from "@automatalabs/acp-agents";
8
8
  export { TypedEventEmitter } from "@automatalabs/acp-agents";
9
9
  export type { AcpRunnerEventMap, AcpEventName, AcpEventListener, AcpEventContext, AcpSessionUpdate, AcpUpdateKind, AcpPermissionEvent, AcpRawMessageEvent, AcpBackendErrorEvent, } from "@automatalabs/acp-agents";
10
10
  export type { AgentRunner, RunOptions, AgentResult, AgentUsage } from "@automatalabs/shared-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,E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IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kGAAkG;IAClG,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAE5B"}
package/dist/index.js CHANGED
@@ -16,8 +16,11 @@ import { WorkflowManager } from "@automatalabs/workflow-engine";
16
16
  export { runWorkflow, parseWorkflowScript, WorkflowManager } from "@automatalabs/workflow-engine";
17
17
  export { WorkflowError, WorkflowErrorCode, isWorkflowError, isProviderUsageLimit, } from "@automatalabs/workflow-engine";
18
18
  // ── ACP backend: the default AgentRunner implementation, backend selection, the
19
- // concrete backends, the pool options, and the JSON-Schema helpers. ──
20
- export { createAcpRunner, AcpAgentRunner, selectBackend, ClaudeBackend, CodexBackend, toJsonSchema, toStrictJsonSchema, } from "@automatalabs/acp-agents";
19
+ // concrete backends (built-in + custom registry), the pool/runner options, and the
20
+ // JSON-Schema helpers. Custom backends let ANY ACP agent serve agent() calls:
21
+ // `createAcpRunner({ backends: { browser: { command: "…" } } })` (or the
22
+ // AGENTPRISM_BACKENDS env var), then route with `agent(p, { model: "browser" })`. ──
23
+ export { createAcpRunner, AcpAgentRunner, selectBackend, ClaudeBackend, CodexBackend, CustomAcpBackend, resolveBackendRegistry, BACKENDS_ENV, toJsonSchema, toStrictJsonSchema, } from "@automatalabs/acp-agents";
21
24
  // ── Live ACP events: `createAcpRunner().on("tool_call", evt => …)` to listen in on the
22
25
  // stream of a run. The event map keys are ACP `sessionUpdate` discriminants plus a few
23
26
  // cross-cutting events; each payload carries a `{ sessionId, backendId, label?, runId? }`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automatalabs/workflows",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,9 +24,9 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@automatalabs/shared-types": "0.3.1",
28
- "@automatalabs/workflow-engine": "0.1.5",
29
- "@automatalabs/acp-agents": "0.4.1"
27
+ "@automatalabs/shared-types": "0.4.0",
28
+ "@automatalabs/workflow-engine": "0.2.0",
29
+ "@automatalabs/acp-agents": "0.5.0"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc -b",