@automatalabs/acp-agents 1.2.7 → 1.3.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.
Files changed (66) hide show
  1. package/README.md +67 -3
  2. package/dist/acp-client.d.ts +21 -1
  3. package/dist/acp-client.d.ts.map +1 -1
  4. package/dist/acp-client.js +29 -5
  5. package/dist/agent/acp-agent.d.ts +141 -0
  6. package/dist/agent/acp-agent.d.ts.map +1 -0
  7. package/dist/agent/acp-agent.js +832 -0
  8. package/dist/agent/errors.d.ts +17 -0
  9. package/dist/agent/errors.d.ts.map +1 -0
  10. package/dist/agent/errors.js +37 -0
  11. package/dist/agent/events.d.ts +26 -0
  12. package/dist/agent/events.d.ts.map +1 -0
  13. package/dist/agent/events.js +165 -0
  14. package/dist/agent/fork.d.ts +27 -0
  15. package/dist/agent/fork.d.ts.map +1 -0
  16. package/dist/agent/fork.js +28 -0
  17. package/dist/agent/probe.d.ts +14 -0
  18. package/dist/agent/probe.d.ts.map +1 -0
  19. package/dist/agent/probe.js +87 -0
  20. package/dist/agent/process-registry.d.ts +9 -0
  21. package/dist/agent/process-registry.d.ts.map +1 -0
  22. package/dist/agent/process-registry.js +28 -0
  23. package/dist/agent/queue.d.ts +19 -0
  24. package/dist/agent/queue.d.ts.map +1 -0
  25. package/dist/agent/queue.js +90 -0
  26. package/dist/agent/routing.d.ts +27 -0
  27. package/dist/agent/routing.d.ts.map +1 -0
  28. package/dist/agent/routing.js +87 -0
  29. package/dist/agent/structured.d.ts +47 -0
  30. package/dist/agent/structured.d.ts.map +1 -0
  31. package/dist/agent/structured.js +90 -0
  32. package/dist/agent/turn.d.ts +65 -0
  33. package/dist/agent/turn.d.ts.map +1 -0
  34. package/dist/agent/turn.js +187 -0
  35. package/dist/agent/types.d.ts +221 -0
  36. package/dist/agent/types.d.ts.map +1 -0
  37. package/dist/agent/types.js +9 -0
  38. package/dist/backend.d.ts +6 -0
  39. package/dist/backend.d.ts.map +1 -1
  40. package/dist/backends/claude.d.ts +1 -0
  41. package/dist/backends/claude.d.ts.map +1 -1
  42. package/dist/backends/claude.js +5 -0
  43. package/dist/config-catalog.d.ts +173 -0
  44. package/dist/config-catalog.d.ts.map +1 -0
  45. package/dist/config-catalog.js +408 -0
  46. package/dist/index.d.ts +10 -3
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +10 -1
  49. package/dist/protocol-coverage.d.ts +56 -0
  50. package/dist/protocol-coverage.d.ts.map +1 -1
  51. package/dist/protocol-coverage.js +52 -0
  52. package/dist/registry.d.ts +12 -0
  53. package/dist/registry.d.ts.map +1 -1
  54. package/dist/registry.js +22 -0
  55. package/dist/routing.d.ts +14 -0
  56. package/dist/routing.d.ts.map +1 -0
  57. package/dist/routing.js +53 -0
  58. package/dist/runner.d.ts.map +1 -1
  59. package/dist/runner.js +3 -64
  60. package/dist/session-ref.d.ts +8 -0
  61. package/dist/session-ref.d.ts.map +1 -0
  62. package/dist/session-ref.js +21 -0
  63. package/dist/structured-tool.d.ts +4 -0
  64. package/dist/structured-tool.d.ts.map +1 -1
  65. package/dist/structured-tool.js +5 -0
  66. package/package.json +3 -3
package/README.md CHANGED
@@ -6,7 +6,7 @@ This is the layer `@automatalabs/workflows` and `@automatalabs/mcp-server` are b
6
6
 
7
7
  ## Most users want `@automatalabs/workflows`
8
8
 
9
- If you are orchestrating a workflow, use [`@automatalabs/workflows`](../workflows) instead — it re-exports `createAcpRunner` and wires it into the engine for you. Reach for this package directly only when you want to drive a **single** ACP agent yourself or need the low-level auth/session lifecycle APIs.
9
+ If you are orchestrating a workflow, use [`@automatalabs/workflows`](../workflows) instead — it re-exports `createAcpRunner` and wires it into the engine for you. Reach for this package directly only when you want to drive a **single** ACP agent yourself (`run()`, or the held-open [`AcpAgent` SDK](#acpagent--the-sdk-front-door)) or need the low-level auth/session lifecycle APIs.
10
10
 
11
11
  ```bash
12
12
  npm install @automatalabs/acp-agents
@@ -228,6 +228,43 @@ try {
228
228
  }
229
229
  ```
230
230
 
231
+ ## AcpAgent — the SDK front door
232
+
233
+ `AcpAgent` is the held-open counterpart of `run()`: one **dedicated** ACP process per agent (and per fork), a lazy constructor that spawns nothing until the first call, turns that serialize in a per-agent FIFO, live `fork()`s that see everything the parent committed so far, and cold reopen of a recorded session from its `AgentSessionRef`. It composes the same primitives as the runner and `InteractiveSession` (`PooledConnection`, `SessionHandle`, the backends, the routing grammar, the structured-output tool host) and owns no pool, so a parent's `close()` never affects its forks. The full reference — options, the turn shape, the abort table, forks, cold reopen, structured output, events, discovery, errors — is [docs/api.md — AcpAgent SDK](../../docs/api.md#acpagent-sdk).
234
+
235
+ ```ts
236
+ import { AcpAgent } from "@automatalabs/acp-agents";
237
+
238
+ const catalog = await AcpAgent.probe({ modelFilter: "opus" }); // no-prompt catalog, one process per target
239
+ const primary = new AcpAgent({ cwd: "/abs/path/to/worktree", model: "claude/opus[1m]" }); // spawns nothing yet
240
+ primary.on("agent_message_chunk", (e) => { // this agent's events only
241
+ if (e.content.type === "text") process.stdout.write(e.content.text);
242
+ });
243
+
244
+ const turn = await primary.prompt("Investigate the failing test.");
245
+ turn.response; // the verbatim PromptResponse, `_meta` intact
246
+ turn.updates; turn.raw; turn.toolCalls; // every update / vendor notification / folded tool call of the turn
247
+ turn.usage.turn; turn.usage.session; // this turn's tokens; the agent's running sum
248
+
249
+ const planner = await primary.fork(); // a NEW process seeded with the transcript so far
250
+ const plan = await planner.prompt("Plan the smallest fix.", {
251
+ mode: "plan", // sticky: applies to this and every later turn of `planner`
252
+ meta: { trace: "plan-1" }, // turn `_meta`, passed through verbatim
253
+ });
254
+ await primary.prompt("Meanwhile, list the callers."); // the parent keeps going, unaffected
255
+
256
+ await planner.close();
257
+ await primary.close({ keep: true }); // process disposed; the session stays re-openable
258
+ // The same session on a fresh process: the ref carries no model, so pass the agent's back. `resume` replays
259
+ // nothing (history/text start empty) — `AcpAgent.load(ref)` replays the transcript instead.
260
+ const again = await AcpAgent.resume(primary.sessionRef!, { model: primary.model });
261
+ await again.close();
262
+ ```
263
+
264
+ `prompt`, `fork`, `setMode`, `setConfigOptions`, and `close` run FIFO per agent, so a fork always sees a quiescent, fully persisted parent transcript. `steer()` and `cancel()` overlap the queue: `steer()` injects into the turn in flight (`_session/steering`) and rejects when nothing is in flight; `cancel()` sends one `session/cancel` for the turn whose `session/prompt` is on the wire (a turn that has started but is still opening the session or applying its per-turn options is not reached — a per-call `signal` covers that window) and, when the agent ignores it for the grace period, disposes the process **without** a wire `session/close` so `sessionRef` stays re-openable. `prompt()` resolves a turn for every `PromptResponse` the wire returned — no `stopReason` is thrown on — and rejects only on a wire rejection, validation, abort (`signal.reason` untouched), a closed agent, or a typed session failure (then with the complete turn attached as `error.turn`; narrow with `isAcpAgentTurnError`).
265
+
266
+ `fork()` follows the backend's `FORK_SESSION_TRAITS` row ([the table under Session handoff](#what-a-sessionfork-response-is-fork_session_traits)) instead of probing: on the `id-only` backends (Claude, Codex) the child releases the bare fork handle with `keepOpen` and reattaches the new id (`session/resume`, else `session/load`) before its first turn, so the wire order is always `session/fork` < `session/resume` < `session/prompt`; on the `live` backends (pi, OpenCode) the fork handle is the session. Claude forks must keep the source cwd; a custom entry wrapping claude-agent-acp or codex-acp must declare `fork: { disposition: "id-only" }`. A per-turn `schema` is accepted only on Codex (whose schema rides each turn's `_meta.outputSchema`); every other backend binds the schema at session open, so pass it to the constructor. `AcpAgent.probe()` returns the same `HarnessConfigReport` as `probeHarnessConfig` plus a `models` view, and keeps the bare harness catalog next to a failed exact-model probe.
267
+
231
268
  ## Authentication lifecycle
232
269
 
233
270
  The built-in runner is auth-capable without widening the minimal `AgentRunner` interface.
@@ -260,6 +297,29 @@ transcript usage is baselined away, so only continuation-turn usage is reported.
260
297
  never opens the fresh fallback. The runner also exposes `listSessions()` and `deleteSession()` where
261
298
  advertised; inspect `reopen` rather than assuming every ACP agent persists state.
262
299
 
300
+ ### What a `session/fork` response is (`FORK_SESSION_TRAITS`)
301
+
302
+ `forkSession()` returns whatever the agent answered, and the answer differs per adapter. `FORK_SESSION_TRAITS`
303
+ pins each built-in's disposition from its source: `id-only` forks (Claude, Codex) name a persisted copy that is
304
+ not live — Claude answers `{ sessionId }` alone and prompting it fails with "Session not found"; Codex installs
305
+ state but unsubscribes the forked thread — so they must be reopened (`session/resume`, else `session/load`)
306
+ before their first turn; `live` forks (pi; OpenCode by live verification) are the session. `fork cwd` says
307
+ whether the fork may re-home (Claude's transcript store is keyed by the source cwd).
308
+
309
+ | agent | `session/fork` disposition | reattach | fork cwd |
310
+ |---|---|---|---|
311
+ | `claude` | `id-only` | `resume-or-load` | `source-only` |
312
+ | `codex` | `id-only` | `resume-or-load` | `free` |
313
+ | `opencode` | `live` | `none` | `free` |
314
+ | `pi` | `live` | `none` | `free` |
315
+
316
+ `forkSessionTrait(agent, declared?)` resolves a row — a built-in's own, the row a custom backend's `fork`
317
+ declaration describes (a declaration always wins over a name that shadows a built-in), else
318
+ `FORK_SESSION_TRAIT_DEFAULT` (`live` / `free`, the plain ACP contract). Custom entries that wrap
319
+ claude-agent-acp or codex-acp must declare `fork: { disposition: "id-only" }`.
320
+
321
+ `PROMPT_USAGE_SCOPES` pins that `PromptResponse.usage` is per-turn on every built-in (the SDK's `Usage` doc says "across session"; the installed adapters report the turn), so a session total is your own running sum of turn reports — `UsageAccumulator.recordPromptUsage` replaces, never sums. `promptUsageScope(agent)` answers `"turn"` for built-ins and custom agents alike. Both tables are probed in the installed Claude/Codex/pi dists by the protocol coverage suite.
322
+
263
323
  ## Listening in: live ACP events
264
324
 
265
325
  `AcpAgentRunner` is also a typed event bus — `runner.on(name, listener)` bubbles up the live ACP stream of every run (streaming text, tool calls, usage, permissions, elicitations). Event names are the ACP `sessionUpdate` discriminants (`agent_message_chunk`, `tool_call`, `usage_update`, …) plus the cross-cutting `session_update` (catch-all), `permission_pending`, `permission_request`, `elicitation_pending`, `elicitation_request`, `elicitation_complete`, `raw_message`, `steering`, `session_open` / `session_close`, and `backend_error`. Each payload carries a `{ sessionId, backendId, label?, runId?, callIndex?, initializeMeta? }` context envelope (a pooled runner multiplexes many runs at once). `steering` carries `{ response }` with the complete raw server response after a resolved request, never the request prompt content or request metadata. `permission_pending` / `elicitation_pending` are resolver-only and carry `{ request }` before the host resolver is invoked; `permission_request` / `elicitation_request` fire exactly once with the final `{ request, outcome }` returned to the agent; `elicitation_complete` carries `{ notification }` for URL completions. `on()` / `once()` return an unsubscribe thunk; `off()` and `removeAllListeners()` round it out. Listeners are best-effort observers — a throwing listener never affects the run.
@@ -294,17 +354,21 @@ From [`src/index.ts`](./src/index.ts):
294
354
  - **Auth/provider lifecycle methods** — `describeAuthMethods()`, `completeAuth()`, `runner.auth`, `authMethods()`, `authenticate()`, `listProviders()`, `setProvider()`, `disableProvider()`, and `logout()`; see [docs/api.md](../../docs/api.md) for capability gating and installed adapter support. A successful `setProvider()` records a durable routing intent (`ProviderStore`) replayed on every fresh connection's `initialize` — provider config is in-process agent state for e.g. codex-acp, so record → recycle → replay is what makes it stick across the pool.
295
355
  - **Session lifecycle methods** — `listSessions()`, `deleteSession()`, `loadSession()`, `resumeSession()`, and `forkSession()` for backends that advertise session persistence; see [docs/api.md](../../docs/api.md).
296
356
  - **`InteractiveSession` / `InteractiveSessionOptions` / `InteractiveTurn` / `SteeringResponse`** — the held-open multi-turn session surface returned by `openSession()`; `InteractiveSession.steer()` is available only while its original `prompt()` is in flight and returns the raw extension response.
357
+ - **`AcpAgent`** (+ `AcpAgentOptions`, `AcpAgentPromptOptions`, `AcpAgentTurn`, `AcpAgentForkOptions`, `AcpAgentReopenOptions`, `AcpAgentProbeOptions`, `AcpAgentCatalog`, `AcpAgentState`, `AcpAgentTurnError` / `isAcpAgentTurnError`) — the SDK-style front door: one dedicated ACP process per agent, a per-agent FIFO (`prompt`/`fork`/`setMode`/`setConfigOptions`/`close` serialize behind the in-flight turn; `steer`/`cancel` overlap it), verbatim per-turn results (`turn.response` incl. `_meta`, every `updates`/`raw` record, folded `toolCalls`, per-turn `usage`), live `fork()` on a new process following the backend's `FORK_SESSION_TRAITS` row (id-only backends are reattached before their first turn), `close({ keep })`, `Symbol.asyncDispose`, the cold statics `AcpAgent.resume/load/fork(ref)` routed by `ref.backendId` (never the default backend), and `AcpAgent.probe()` — the same catalog `probeHarnessConfig` produces, on one disposed process per target. A typed session failure rejects `prompt()` with the runner's mapped `WorkflowError` carrying the complete turn as `error.turn`. Quick start above; full reference in [docs/api.md](../../docs/api.md#acpagent-sdk). `@automatalabs/workflows` re-exports the class, `isAcpAgentTurnError`, and the types.
297
358
  - **`ProbeConfigOptionsOptions` / `ProbedConfigOptions` / `SessionConfigOption`** — the no-prompt probe controls, routed result, and verbatim ACP advertised-option wire shape.
359
+ - **`probeHarnessConfig` / `buildHarnessModelsView` / `buildHarnessConfigSummary`** — the token-free harness config catalog (moved here from `@automatalabs/workflows`, which re-exports it): one no-prompt session per requested harness resolving to a `HarnessConfigReport` (`ValidateHarnessOptions[]` plus the bounded `authoringSummary`), the `--models` view builders (`buildModelFilter`, `selectChoicePairs`, `summarizeSelectChoices`), `formatHarnessConfigSummary`, and the `ValidateProbeRunner` seam a host passes as `probeRunner` to reuse its own live runner.
298
360
  - **`BUILTIN_BACKENDS` / `ThoughtLevelDomainSemantics`** — the built-in registry declares whether each backend's thought-level values are an `"ordered"` ladder (Claude, Codex, Pi) or an `"exact-set"` (OpenCode). `builtinThoughtLevelDomainSemantics(id)` performs an exact lookup; an absent row means a custom/unknown backend and must be handled as `"exact-set"`.
299
361
  - **`AcpRunnerOptions.onElicitation`** — runner-wide ACP elicitation responder; sessions can override with `InteractiveSessionOptions.onElicitation`.
300
362
  - **`selectBackend({ model, tier }, registry?)`** — deterministic first-segment routing; registered custom names take priority, then the four built-ins, otherwise the configured default.
363
+ - **`resolveModelRoute(spec, registry?)` / `ModelRoute`** — the same routing with the verbatim model value kept: `{ backend, modelSpec }`, where `modelSpec` is the text after the routed first segment (`undefined` for a backend-only spec) or the whole spec when nothing routed. `selectBackend` is `resolveModelRoute(model ?? tier).backend`.
301
364
  - **`ClaudeBackend` / `CodexBackend` / `OpenCodeBackend` / `PiBackend`** — the four built-in backend strategies (spawn config + per-backend schema/auth wiring). OpenCode is host-resolved rather than bundled; pi uses bundled `@automatalabs/pi-acp`.
302
- - **`CustomAcpBackend` / `resolveBackendRegistry` / `BACKENDS_ENV`** — the custom-backend registry: run **any** ACP agent as a named backend via `createAcpRunner({ backends: { name: { command, args?, env?, sessionMeta?, structuredOutputTool? } } })` or the `AGENTPRISM_BACKENDS` env var (JSON, same shape; the option wins per name; names may shadow built-ins). Custom backends carry a `schema` as turn-level `_meta.outputSchema` and read the result off the final message as JSON. No host-side vendor capability declaration is required.
365
+ - **`CustomAcpBackend` / `resolveBackendRegistry` / `BACKENDS_ENV`** — the custom-backend registry: run **any** ACP agent as a named backend via `createAcpRunner({ backends: { name: { command, args?, env?, sessionMeta?, structuredOutputTool?, fork? } } })` or the `AGENTPRISM_BACKENDS` env var (JSON, same shape; the option wins per name; names may shadow built-ins). `fork?` (`CustomBackendForkConfig`, `{ disposition: "id-only" | "live", cwd?: "source-only" | "free" }`) declares how the agent answers `session/fork` — see `FORK_SESSION_TRAITS` above; omitted means `live`/`free`. Custom backends carry a `schema` as turn-level `_meta.outputSchema` and read the result off the final message as JSON. No host-side vendor capability declaration is required.
303
366
  - **Auth contracts and lifecycle** — `AuthStore`, `BackendAuthMachine`, `buildAuthDescriptors`, the built-in auth profiles, and the `AuthContext` / `AuthResolution` / `AuthMethodDescriptor` / `AuthCapableRunner` types.
304
367
  - **Permission APIs** — `PermissionResolver` parks a request for an async host decision; `selectPermissionOption(request, optionId)` validates one exact advertised option. `decidePermission` remains the SDK/headless auto-policy. Provider effects and persistence are never inferred from labels, `kind`, or response metadata.
305
368
  - **`clientCapabilitiesFor` + the `ClientHandlers` / `FsHandlers` / `TerminalHandlers` / `AcpSessionContext` types** — the client-side fs/terminal interposition surface (see above).
306
369
  - **`negotiateCapabilities` / `adaptPromptContent` / `unsupportedMcpServer` + `NegotiatedCapabilities`** — the standard ACP capability-negotiation primitives; the negotiated record for a live connection is exposed on `PooledConnection.capabilities`, with vendor initialize metadata retained only as raw `initializeMeta`.
307
370
  - **`AGENT_METHOD_COVERAGE` / `CLIENT_METHOD_COVERAGE` / `ACP_EXTENSION_SUPPORT_MATRIX`** — manifests classifying the installed ACP SDK method surface and documenting built-in vendor-extension advertisements. The extension matrix is evidence for probes and never routes runtime behavior.
371
+ - **`FORK_SESSION_TRAITS` / `FORK_SESSION_TRAIT_DEFAULT` / `forkSessionTrait(agent, declared?)`** and **`PROMPT_USAGE_SCOPES` / `promptUsageScope(agent)`** — the per-built-in `session/fork` disposition table and the per-turn `PromptResponse.usage` scope pin (see [Session handoff](#session-handoff)); both also ride each `BUILTIN_PROTOCOL_COVERAGE` row as `fork` / `promptUsage`. Executable data probed in the installed adapter dists, never a runtime branch.
308
372
  - **`toJsonSchema(schema)` / `toStrictJsonSchema(schema)`** — turn a typebox schema into on-the-wire shapes: plain JSON Schema for Claude and the Pi/OpenCode injected HTTP MCP tool, and an OpenAI-strict-normalized schema for Codex `outputSchema`. Pi retains the common prompt/validated-last-text fallback.
309
373
 
310
374
  Also exported: `AcpAgentPool` / `resolvePoolSize` (including the same deadline-only `forceKill()` emergency path), `PooledConnection` / `SessionHandle`, `decidePermission`, `UsageAccumulator`, `resolveStructuredOutput` / `extractValidated` / `findJsonBlock` / `validateValue`, `errorText` / `mapThrownError`, and the event surface `TypedEventEmitter` / `AcpRunnerEventMap` / `AcpEventName` / `AcpEventListener` / `AcpEventContext` / `AcpSessionUpdate` (+ the per-event payload types, including `AcpPermissionPendingEvent`), plus their associated types.
@@ -314,7 +378,7 @@ Also exported: `AcpAgentPool` / `resolvePoolSize` (including the same deadline-o
314
378
  | Variable | Effect |
315
379
  | --- | --- |
316
380
  | `AGENTPRISM_DEFAULT_BACKEND` | Backend for specs whose first segment is not registered (`claude`, `codex`, `opencode`, `pi`, or a registered custom name; unknown values fall back to Claude). |
317
- | `AGENTPRISM_BACKENDS` | Custom ACP backends as JSON: `{"<name>": {"command": "…", "args": […], "env": {…}, "sessionMeta": {…}, "structuredOutputTool": true}}`. |
381
+ | `AGENTPRISM_BACKENDS` | Custom ACP backends as JSON: `{"<name>": {"command": "…", "args": […], "env": {…}, "sessionMeta": {…}, "structuredOutputTool": true, "fork": { "disposition": "id-only" }}}` (`fork` optional; declare `id-only` for entries wrapping claude-agent-acp or codex-acp). |
318
382
  | `AGENTPRISM_ACP_INIT_TIMEOUT_MS` | Deadline (default `60000`) for a backend's one-time ACP `initialize` handshake — a non-ACP command fails fast instead of hanging. |
319
383
  | `AGENTPRISM_ACP_POOL_SIZE` | Long-lived processes to keep per backend (default `1`). |
320
384
  | `AGENTPRISM_CLAUDE_ACP_CMD` / `AGENTPRISM_CLAUDE_ACP_ARGS` | Override the command (and args) used to spawn the Claude ACP server. |
@@ -174,6 +174,10 @@ declare class SessionState {
174
174
  /** The turn's assistant text with the §5 message joiner: deltas of one
175
175
  * message concatenate verbatim; distinct messages join with "\n\n". */
176
176
  foldedTurnText(): string;
177
+ /** The whole retained log folded the same way (`foldedTurnText()` from
178
+ * index 0): every retained assistant message, a replayed transcript
179
+ * included, with distinct messages joined by "\n\n". */
180
+ foldedText(): string;
177
181
  private foldedTextFrom;
178
182
  private markAssistantMessageBoundary;
179
183
  private beginAssistantMessageChunk;
@@ -635,7 +639,18 @@ export declare class SessionHandle implements StructuredSource {
635
639
  private applyConfigOption;
636
640
  /** Switch the session's operating mode through ACP's strict confinement channel. */
637
641
  setMode(modeId: string): Promise<void>;
638
- /** Send a prompt turn and drain it; returns the final PromptResponse. */
642
+ /**
643
+ * The wire outcome of a prompt turn: the verbatim `PromptResponse` plus the terminal typed
644
+ * session failure it carried, if any. Never throws for a typed failure — the response (its
645
+ * `_meta`, `usage`, `stopReason`) is handed back alongside the parsed failure so a caller can
646
+ * keep everything the turn produced. `prompt()` is this plus the throw the runner relies on.
647
+ */
648
+ promptOutcome(content: string | ContentBlock[], promptMeta?: Record<string, unknown>): Promise<{
649
+ response: PromptResponse;
650
+ failure?: TypedSessionFailure;
651
+ }>;
652
+ /** Send a prompt turn and drain it; returns the final PromptResponse. A terminal typed session
653
+ * failure is raised as the mapped `WorkflowError` (see `promptOutcome` for the non-throwing split). */
639
654
  prompt(content: string | ContentBlock[], promptMeta?: Record<string, unknown>): Promise<PromptResponse>;
640
655
  /**
641
656
  * The typed session failure that ended this turn, if any (codex-acp's negotiated extension —
@@ -667,6 +682,11 @@ export declare class SessionHandle implements StructuredSource {
667
682
  * assistant MESSAGES join with "\n\n" (the result fold the runner
668
683
  * returns; consecutive chunks of one message join with ""). */
669
684
  foldedTurnText(): string;
685
+ /** The retained session log's assistant text with the same message
686
+ * joiner as `foldedTurnText()`, over the whole log (a `session/load`
687
+ * replay included). What `AcpAgent.text` reads; `text` stays the raw
688
+ * chunk concatenation. */
689
+ foldedText(): string;
670
690
  /** StructuredSource — the latest turn's FINAL assistant message (see SessionState). */
671
691
  finalMessageText(): string;
672
692
  /** StructuredSource — Claude's raw structured_output for the latest turn, if any. */
@@ -1 +1 @@
1
- {"version":3,"file":"acp-client.d.ts","sourceRoot":"","sources":["../src/acp-client.ts"],"names":[],"mappings":"AAyBA,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAQf,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAGlC,KAAK,oBAAoB,EAEzB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAK5B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAG1B,KAAK,aAAa,EAClB,KAAK,cAAc,EAMnB,KAAK,aAAa,EAClB,KAAK,cAAc,EAMnB,KAAK,yBAAyB,EAG9B,KAAK,kBAAkB,EACv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AAmB,GAAG,OAAO,CAAA;KAAE;IAIlG;;;4DAGwD;IACxD,gBAAgB,IAAI,IAAI;IAIxB,2EAA2E;IAC3E,iBAAiB,IAAI;QACnB,MAAM,EAAE,OAAO,CAAC;QAChB,cAAc,EAAE,OAAO,CAAC;QACxB,mBAAmB,EAAE,mBAAmB,GAAG,OAAO,CAAC;QACnD,wBAAwB,EAAE,OAAO,CAAC;KACnC;IAID;;0EAEsE;IACtE,cAAc,IAAI,MAAM;IAIxB;;uDAEmD;IACnD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAIlD;;uDAEmD;IACnD,cAAc,IAAI,MAAM;IAIxB;;;iEAG6D;IAC7D,oBAAoB,IAAI;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;IAIjG;;;;0BAIsB;IACtB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAI1D;iGAC6F;IACvF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAU7B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,qBAAqB;YAOf,iBAAiB;YAKjB,mBAAmB;IAOjC;;sFAEkF;IAClF,OAAO,CAAC,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAK9C,YAAY;CAU3B"}
@@ -325,6 +325,12 @@ class SessionState {
325
325
  foldedTurnText() {
326
326
  return this.foldedTextFrom(this.turnStartIndex);
327
327
  }
328
+ /** The whole retained log folded the same way (`foldedTurnText()` from
329
+ * index 0): every retained assistant message, a replayed transcript
330
+ * included, with distinct messages joined by "\n\n". */
331
+ foldedText() {
332
+ return this.foldedTextFrom(0);
333
+ }
328
334
  foldedTextFrom(startIndex) {
329
335
  let folded = "";
330
336
  for (let index = startIndex; index < this.textChunks.length; index += 1) {
@@ -2260,8 +2266,13 @@ export class SessionHandle {
2260
2266
  }
2261
2267
  this.state.modes = modeStateFromConfigOption(modeOption, modeId);
2262
2268
  }
2263
- /** Send a prompt turn and drain it; returns the final PromptResponse. */
2264
- async prompt(content, promptMeta) {
2269
+ /**
2270
+ * The wire outcome of a prompt turn: the verbatim `PromptResponse` plus the terminal typed
2271
+ * session failure it carried, if any. Never throws for a typed failure — the response (its
2272
+ * `_meta`, `usage`, `stopReason`) is handed back alongside the parsed failure so a caller can
2273
+ * keep everything the turn produced. `prompt()` is this plus the throw the runner relies on.
2274
+ */
2275
+ async promptOutcome(content, promptMeta) {
2265
2276
  this.opts.signal?.throwIfAborted();
2266
2277
  this.state.beginTurn();
2267
2278
  let resolveEnded;
@@ -2284,9 +2295,7 @@ export class SessionHandle {
2284
2295
  const response = await this.pooled.prompt(request);
2285
2296
  this.state.usage.recordPromptUsage(response.usage);
2286
2297
  const failure = this.terminalTypedSessionFailure(response);
2287
- if (failure)
2288
- throw this.typedSessionFailureError(failure);
2289
- return response;
2298
+ return failure ? { response, failure } : { response };
2290
2299
  }
2291
2300
  finally {
2292
2301
  if (this.activeTurn === turn)
@@ -2294,6 +2303,14 @@ export class SessionHandle {
2294
2303
  turn.resolveEnded();
2295
2304
  }
2296
2305
  }
2306
+ /** Send a prompt turn and drain it; returns the final PromptResponse. A terminal typed session
2307
+ * failure is raised as the mapped `WorkflowError` (see `promptOutcome` for the non-throwing split). */
2308
+ async prompt(content, promptMeta) {
2309
+ const { response, failure } = await this.promptOutcome(content, promptMeta);
2310
+ if (failure)
2311
+ throw this.typedSessionFailureError(failure);
2312
+ return response;
2313
+ }
2297
2314
  /**
2298
2315
  * The typed session failure that ended this turn, if any (codex-acp's negotiated extension —
2299
2316
  * see typed-failures.ts). Two channels, in priority order:
@@ -2355,6 +2372,13 @@ export class SessionHandle {
2355
2372
  foldedTurnText() {
2356
2373
  return this.state.foldedTurnText();
2357
2374
  }
2375
+ /** The retained session log's assistant text with the same message
2376
+ * joiner as `foldedTurnText()`, over the whole log (a `session/load`
2377
+ * replay included). What `AcpAgent.text` reads; `text` stays the raw
2378
+ * chunk concatenation. */
2379
+ foldedText() {
2380
+ return this.state.foldedText();
2381
+ }
2358
2382
  /** StructuredSource — the latest turn's FINAL assistant message (see SessionState). */
2359
2383
  finalMessageText() {
2360
2384
  return this.state.finalMessageText();
@@ -0,0 +1,141 @@
1
+ import type { ContentBlock, SessionConfigOption, SessionModeState } from "@agentclientprotocol/sdk";
2
+ import type { AgentHistoryEntry, AgentSessionRef, AgentUsage } from "@automatalabs/shared-types";
3
+ import type { TSchema } from "typebox";
4
+ import { type SteeringResponse } from "../acp-client.js";
5
+ import type { NegotiatedCapabilities } from "../capabilities.js";
6
+ import { type AcpAgentCatalog, type AcpAgentCloseOptions, type AcpAgentEventListener, type AcpAgentEventName, type AcpAgentForkOptions, type AcpAgentOptions, type AcpAgentProbeOptions, type AcpAgentPromptOptions, type AcpAgentReopenOptions, type AcpAgentState, type AcpAgentSteerOptions, type AcpAgentTurn, type AcpAgentUpdateRecord } from "./types.js";
7
+ /** Package-internal test seam for the ignored-cancel escalation grace. Not barrel-exported. */
8
+ export declare function setCancelGraceForTests(ms: number): () => void;
9
+ /**
10
+ * One ACP agent session on its own dedicated backend process.
11
+ *
12
+ * Lazy: the constructor validates (cwd, `configOptions`, the registry, `clientHandlers`) and
13
+ * routes the backend synchronously but spawns nothing; the first queued operation (an explicit
14
+ * `ready()` or an implicit `prompt()`) opens the session. `state` walks
15
+ * `idle → opening → ready ⇄ busy → closed`.
16
+ */
17
+ export declare class AcpAgent {
18
+ #private;
19
+ /** The session's absolute working directory (sent on session/new|fork|resume|load). */
20
+ readonly cwd: string;
21
+ /** The human label stamped on event contexts and error `agentLabel`; never on the wire. */
22
+ readonly label: string | undefined;
23
+ /** The model this agent selects at open, as a routing spec that leads back to the same backend
24
+ * (`<backendId>/<model id>`, e.g. `"claude/opus[1m]"`), or `undefined` when no model was
25
+ * selected (the backend's default). Inherited by forks. An `AgentSessionRef` carries no model,
26
+ * so a cold reopen keeps it only when told: `AcpAgent.resume(agent.sessionRef!, { model: agent.model })`. */
27
+ readonly model: string | undefined;
28
+ /**
29
+ * Lazy: validates cwd/configOptions/registry/clientHandlers synchronously, routes the backend,
30
+ * spawns nothing. This is the ONLY public constructor signature — seeded agents (forks, cold
31
+ * reopen) are built by the statics through a module-private factory.
32
+ */
33
+ constructor(options: AcpAgentOptions);
34
+ /** `new AcpAgent(options)` + `ready()`; on failure the agent is closed and the mapped error rethrown. */
35
+ static open(options: AcpAgentOptions): Promise<AcpAgent>;
36
+ /** No-prompt catalog discovery: the same `HarnessConfigReport` the MCP `action:"config"` is
37
+ * projected from, plus the per-harness `models` view. Never throws for a per-harness failure
38
+ * (`probed: false`); one disposed process per target. */
39
+ static probe(options?: AcpAgentProbeOptions): Promise<AcpAgentCatalog>;
40
+ /** `session/resume` of `ref.sessionId` on a fresh dedicated process of `ref.backendId`
41
+ * (routed by name — never the default backend — and pool-key checked). `cwd` defaults to
42
+ * `ref.cwd`; `model` must stay on the ref's backend. */
43
+ static resume(ref: AgentSessionRef, options?: AcpAgentReopenOptions): Promise<AcpAgent>;
44
+ /** `session/load`: the agent replays the transcript before the response; it lands in
45
+ * `history`/`text`/`replay` (the statics return after the fact, so the replay is observable
46
+ * only there, not through `on()`). */
47
+ static load(ref: AgentSessionRef, options?: AcpAgentReopenOptions): Promise<AcpAgent>;
48
+ /** Cold fork of a recorded session: the trait-driven choreography without a history seed
49
+ * (`history` starts empty on id-only backends unless the reattach fell back to `session/load`).
50
+ * To seed the fork with the transcript: `const src = await AcpAgent.load(ref); await src.fork()`. */
51
+ static fork(ref: AgentSessionRef, options?: AcpAgentReopenOptions): Promise<AcpAgent>;
52
+ /** The resolved backend id (built-in id or registered custom name). */
53
+ get backendId(): string;
54
+ /** `idle` → `opening` → `ready` ⇄ `busy` → `closed` (set the instant `close()` is called,
55
+ * the constructor signal aborts, or the process dies). */
56
+ get state(): AcpAgentState;
57
+ /** The ACP session id once open; retained after close. */
58
+ get sessionId(): string | undefined;
59
+ /** The re-attach handle computed at open (drives `AcpAgent.resume/load/fork`); retained after close. */
60
+ get sessionRef(): AgentSessionRef | undefined;
61
+ /** Capabilities negotiated on this agent's dedicated connection. */
62
+ get capabilities(): NegotiatedCapabilities | undefined;
63
+ /** The latest echoed session config-option catalog (verbatim ACP wire shapes). */
64
+ get configOptions(): readonly SessionConfigOption[];
65
+ /** The agent-advertised mode catalog plus the current mode, when supported. */
66
+ get modes(): SessionModeState | null | undefined;
67
+ /** `[...seed, ...session history]` (copies on read). The seed is the parent's snapshot for a
68
+ * live fork; a `session/load` replay lands in the session history itself. */
69
+ get history(): readonly AgentHistoryEntry[];
70
+ /** Verbatim session/update records received before the session was ready (a fork's
71
+ * pre-response replay, a load's replay), adopted from the acquisition buffer. */
72
+ get replay(): ReadonlyArray<AcpAgentUpdateRecord>;
73
+ /** The retained assistant text — the parent's seed (live fork) and this session's messages —
74
+ * folded exactly like `turn.text`: chunks of one message concatenate, distinct messages join
75
+ * with "\n\n". */
76
+ get text(): string;
77
+ /** Running per-field sum of every turn this agent ran; `ZERO_USAGE` before the first turn. */
78
+ get usage(): AgentUsage;
79
+ /** The session-level structured-output contract, if any. */
80
+ get schema(): TSchema | undefined;
81
+ /** Subscribe. `session_open` is sticky: a listener registered after the session opened receives
82
+ * it once (next microtask); a listener that saw it live never sees it twice. Returns the
83
+ * unsubscribe thunk; after close it is a no-op. */
84
+ on<K extends AcpAgentEventName>(name: K, listener: AcpAgentEventListener<K>): () => void;
85
+ once<K extends AcpAgentEventName>(name: K, listener: AcpAgentEventListener<K>): () => void;
86
+ off<K extends AcpAgentEventName>(name: K, listener: AcpAgentEventListener<K>): void;
87
+ /** Spawn + initialize + session/new|resume|load|fork (idempotent; memoized). The implicit
88
+ * open of the first `prompt()` shares the same promise. */
89
+ ready(): Promise<void>;
90
+ /**
91
+ * One prompt turn, FIFO behind every earlier queued operation. Resolves an `AcpAgentTurn` for
92
+ * EVERY `PromptResponse` the wire returned (no `stopReason` is thrown on — refusal, max_tokens,
93
+ * cancelled included). Rejects only on a wire rejection (mapped like the runner), validation,
94
+ * abort (`signal.reason` untouched), a closed agent, or a typed session failure (the mapped
95
+ * `WorkflowError` carrying the complete turn as `error.turn`; see `isAcpAgentTurnError`).
96
+ * `configOptions`/`mode` are applied before the turn and stick for the session. To stop a
97
+ * specific turn use `options.signal`: it rejects while queued or before the turn reached the
98
+ * wire (nothing is sent) and sends one `session/cancel` once in flight — `cancel()` reaches only
99
+ * a turn already on the wire.
100
+ */
101
+ prompt(content: string | ContentBlock[], options?: AcpAgentPromptOptions): Promise<AcpAgentTurn>;
102
+ /** Inject content into the turn in flight (`_session/steering`). Overlaps the FIFO; requires a
103
+ * `prompt()` in flight (SCRIPT_VALIDATION_ERROR otherwise). The complete raw response is returned. */
104
+ steer(content: string | ContentBlock[], options?: AcpAgentSteerOptions): Promise<SteeringResponse>;
105
+ /** ONE `session/cancel` for the turn whose `session/prompt` is on the wire (no-op otherwise).
106
+ * Resolves at the notify boundary; the in-flight `prompt()` then resolves with
107
+ * `stopReason: "cancelled"` when the agent honors it. A turn that ignores the cancel for the
108
+ * grace period ends in process disposal WITHOUT a wire `session/close` (the session stays
109
+ * re-openable through `sessionRef`); the turn then rejects and the agent is closed. Queued
110
+ * turns are untouched, and so is a turn that has started (`state === "busy"`) but has not
111
+ * reached the wire yet — the lazy first open, or its per-turn `configOptions`/`mode` — a
112
+ * `cancel()` in that window is a no-op the turn never sees. A per-call `signal` covers every
113
+ * window (rejects with the reason before anything is sent; `session/cancel` once in flight). */
114
+ cancel(): Promise<void>;
115
+ /**
116
+ * Fork this agent onto a NEW dedicated process (queued: it runs only when no turn is in flight,
117
+ * so the parent's persisted transcript is complete). Inherits every constructor option except
118
+ * `label` (suffixed `/fork-<n>`) and `signal`; `overrides` may change anything but the backend
119
+ * (`backends`, `authStore`, `providerStore`, `clientHandlers` are typed out; a `model` override
120
+ * must route to the same backend; a `cwd` override is rejected on `source-only` backends). The
121
+ * child's `history`/`text` are seeded from the parent's snapshot on backends whose fork response
122
+ * has no replay. The parent keeps going, unaffected; closing either side never affects the other.
123
+ */
124
+ fork(overrides?: AcpAgentForkOptions): Promise<AcpAgent>;
125
+ /** `session/set_mode` (queued; strict — an unadvertised id is a SCRIPT_VALIDATION_ERROR). */
126
+ setMode(modeId: string): Promise<void>;
127
+ /** `session/set_config_option` per id in ascending order (queued; sticky; `"model"` reserved;
128
+ * unknown ids rejected against the advertised catalog). */
129
+ setConfigOptions(options: Record<string, string | boolean>): Promise<void>;
130
+ /**
131
+ * Close: `state` becomes `closed` immediately (no new work is admitted), the teardown waits
132
+ * behind queued work, releases the session (`keep: true` skips the wire `session/close` so the
133
+ * agent-persisted session stays re-openable via `sessionRef`), disposes the dedicated process,
134
+ * and releases the structured-output tool. Idempotent (same promise); never throws for an
135
+ * already-dead process; rethrows only a `child_cleanup_error` (mapped, non-recoverable).
136
+ */
137
+ close(options?: AcpAgentCloseOptions): Promise<void>;
138
+ /** `await using agent = …` — equivalent to `close()`. */
139
+ [Symbol.asyncDispose](): Promise<void>;
140
+ }
141
+ //# sourceMappingURL=acp-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../../src/agent/acp-agent.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,sBAAsB,EAAE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