@mono-agent/agent-runtime 0.17.1 → 0.18.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/MIGRATION.md CHANGED
@@ -63,9 +63,35 @@ the configuration schema.
63
63
  authoritative and the runtime emits a bounded
64
64
  `live_input_callback_failed` warning.
65
65
 
66
+ ## 0.18.x
67
+
68
+ - `acp:<profile-id>` is now a canonical runtime model reference when paired
69
+ with `executionMode: "acp"`. Hosts must provide `resolveAcpProfile`; profiles
70
+ define direct argv/environment values, client-versus-agent ownership,
71
+ capability policy, session configuration, and bounded process policy.
72
+ - `onAcpInteractionRequest` is the host rendezvous for ACP permission and
73
+ elicitation requests. Hosts must echo only advertised permission option ids,
74
+ keep submitted form values out of durable logs, and fail closed on abort.
75
+ - ACP profile callbacks never receive raw protocol `sessionId`, `_meta`, or
76
+ copied raw-id strings. Use the optional opaque
77
+ `AcpCallbackContext.providerSessionId` for safe session correlation.
78
+ - ACP provider-session ids and session-list cursors are opaque, profile-bound
79
+ runtime handles. Preserve the complete value returned by the runtime for
80
+ resume, pagination, validation, and delete operations; do not parse or
81
+ substitute the remote agent's raw session id or cursor. Raw ACP transport
82
+ connections are internal; use the high-level management helpers.
83
+ - The stable ACP update stream is preserved as typed `acp_session_update`
84
+ events and normalized assistant, thought, tool, plan, and cumulative usage
85
+ events. Stable usage comes from `usage_update`, not experimental prompt
86
+ response fields.
87
+ - ACP management helpers (`probeAcpProfile`, `authenticateAcpProfile`,
88
+ `logoutAcpProfile`, `listAcpSessions`, and `deleteAcpSession`) use the same
89
+ resolver and callback boundary as turns. Authentication always requires an
90
+ explicitly selected advertised method id.
91
+
66
92
  ## 0.17.x baseline
67
93
 
68
- This is the current published baseline. It carries the 0.16.x contract forward
94
+ This prior baseline carries the 0.16.x contract forward
69
95
  and adds a host-only, request-scoped `toolEnvironment` boundary. Hosts may pass
70
96
  validated values and PATH prefixes through the request, harness, and runtime;
71
97
  the runtime applies them only when Bash, Exec, or a nested subagent process is
@@ -370,7 +396,7 @@ now a loud failure (guarded by `scripts/verify-deep-imports.mjs`).
370
396
  <!-- public-api-js-subpaths:start -->
371
397
  <!-- Generated by scripts/generate-public-api-docs.mjs. Do not edit by hand. -->
372
398
 
373
- The package exposes **21 named deep `.js` subpaths**:
399
+ The package exposes **22 named deep `.js` subpaths**:
374
400
 
375
401
  ```text
376
402
  @mono-agent/agent-runtime/agent/allowlists.js
@@ -384,6 +410,7 @@ The package exposes **21 named deep `.js` subpaths**:
384
410
  @mono-agent/agent-runtime/ai/failure.js
385
411
  @mono-agent/agent-runtime/ai/file-change-stats.js
386
412
  @mono-agent/agent-runtime/ai/live-input-prompt.js
413
+ @mono-agent/agent-runtime/ai/providers/acp.js
387
414
  @mono-agent/agent-runtime/ai/providers/claude-cli.js
388
415
  @mono-agent/agent-runtime/ai/providers/claude-sdk-discovery.js
389
416
  @mono-agent/agent-runtime/ai/providers/claude-sdk.js
@@ -407,7 +434,7 @@ a compatibility subpath.
407
434
 
408
435
  ## Version
409
436
 
410
- This guide describes the published `0.17.x` package contract. Keep
437
+ This guide describes the published `0.18.x` package contract. Keep
411
438
  `@mono-agent/agent-runtime`, `@mono-agent/runtime-adapter`, and other
412
439
  `@mono-agent/*` packages on the same lockstep version when upgrading. The paired
413
440
  runtime adapter no longer exposes `piReasoningSummary` in its run-options type.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @mono-agent/agent-runtime
2
2
 
3
3
  Use this package when you need direct, capability-aware access to mono-agent's
4
- five built-in model runtime bridges.
4
+ six built-in model runtime bridges, including product-neutral ACP v1 agents.
5
5
 
6
6
  ## Category
7
7
 
@@ -10,13 +10,13 @@ five built-in model runtime bridges.
10
10
 
11
11
  Category: `runtime`
12
12
  Tier: `core`
13
- Catalog responsibility: Provides five runtime bridges (Claude SDK, Claude Code CLI, Codex app-server, OpenCode app-server, Pi SDK); direct OpenCode requires stable CLI >=1.15.0 on PATH.
13
+ Catalog responsibility: Provides six runtime bridges (ACP v1, Claude SDK, Claude Code CLI, Codex app-server, OpenCode app-server, Pi SDK); direct OpenCode requires stable CLI >=1.15.0 on PATH.
14
14
 
15
15
  <!-- package-metadata:end -->
16
16
 
17
17
  ## Responsibility
18
18
 
19
- Provides five runtime bridges (Claude SDK, Claude Code CLI, Codex app-server, OpenCode app-server, Pi SDK), with capabilities declared per bridge. This is the runtime layer that `@mono-agent/runtime-adapter` wraps behind runtime contracts. Pi enforces optional mono-agent sandbox policy for runtime-owned tools through an injectable `RuntimeSandbox` seam (a fail-closed passthrough by default; `@mono-agent/runtime-adapter` injects the real implementation). The router supports a compatibility-preserving uniform contract or explicit isolated per-route-native contracts; no provider route silently drops required capabilities.
19
+ Provides six runtime bridges (ACP v1, Claude SDK, Claude Code CLI, Codex app-server, OpenCode app-server, Pi SDK), with capabilities declared per bridge. This is the runtime layer that `@mono-agent/runtime-adapter` wraps behind runtime contracts. Pi and ACP-owned stdio children enforce optional mono-agent sandbox policy through an injectable `RuntimeSandbox` seam (a fail-closed passthrough by default; `@mono-agent/runtime-adapter` injects the real implementation). The router supports a compatibility-preserving uniform contract or explicit isolated per-route-native contracts; no provider route silently drops required capabilities.
20
20
 
21
21
  ## Install / Usage
22
22
 
@@ -61,7 +61,7 @@ only after a run selects a matching model reference and execution mode:
61
61
  ### Data flow
62
62
 
63
63
  1. `createRuntime()` binds host callbacks and creates an isolated tool context.
64
- 2. `resolveRuntimeBridge()` checks the five static bridge descriptors in order.
64
+ 2. `resolveRuntimeBridge()` checks the six static bridge descriptors in order.
65
65
  3. The selected descriptor lazily imports its provider implementation.
66
66
  4. The bridge prepares the runtime inputs it supports, including managed or MCP
67
67
  tools only where that bridge can represent them, streams normalized events,
@@ -75,7 +75,7 @@ only after a run selects a matching model reference and execution mode:
75
75
  | --- | --- |
76
76
  | `src/runtime.js` | Host binding, per-instance tool context, bridge dispatch, and observer flushing |
77
77
  | `src/ai/runtime/` | Model-reference parsing, the lazy bridge registry, capabilities, sessions, and fallback routing |
78
- | `src/ai/providers/` | Claude SDK/CLI, Codex app-server, OpenCode app-server, and Pi SDK integrations |
78
+ | `src/ai/providers/` | ACP v1, Claude SDK/CLI, Codex app-server, OpenCode app-server, and Pi SDK integrations |
79
79
  | `src/agent/tools/` | Managed tools, MCP adaptation, output limits, and the injectable sandbox seam |
80
80
  | `src/agent/` | Approvals, allowlists, transcript snapshots, and compaction policy helpers |
81
81
 
@@ -89,9 +89,10 @@ the [architecture guide](https://github.com/robertsreberski/mono-agent/blob/main
89
89
  | API | Use it for |
90
90
  | --- | --- |
91
91
  | `createRuntime()` | Run one model bridge with host-owned credentials, observers, tools, and lifecycle callbacks |
92
+ | `probeAcpProfile()` / ACP management helpers | Probe, authenticate, log out, list sessions, validate opaque handles, or delete an ACP provider session |
92
93
  | `createRouterRuntime()` | Retry an ordered model chain while preserving explicit route-safety contracts |
93
- | `parseRuntimeModelReference()` | Convert a canonical `claude:`, `codex:`, `opencode:`, or `pi:` string into the object required by `run()` |
94
- | `listRuntimeBridges()` / `runtimeCapabilities()` | Inspect the five built-in bridge descriptors without loading provider implementations |
94
+ | `parseRuntimeModelReference()` | Convert a canonical `acp:`, `claude:`, `codex:`, `opencode:`, or `pi:` string into the object required by `run()` |
95
+ | `listRuntimeBridges()` / `runtimeCapabilities()` | Inspect the six built-in bridge descriptors without loading provider implementations |
95
96
  | `createPiOAuthApiKeyResolver()` | Bind a host-owned Pi auth file with refresh-safe writes |
96
97
  | `listPiBuiltinModels()` / `getPiBuiltinModel()` | Read cloned snapshots from the runtime-owned, exact-pinned Pi model catalog without importing Pi directly |
97
98
  | `resolvePiOAuthApiKey()` / `loginPiOAuth()` | Use the runtime-owned Pi OAuth implementation without importing Pi's mutable provider registry |
@@ -109,10 +110,18 @@ Every symbol exported by each public code entrypoint is listed below.
109
110
  **`@mono-agent/agent-runtime`**
110
111
 
111
112
  ```text
113
+ ACP_PROTOCOL_VERSION
112
114
  ACTIVE_RUNTIME_KINDS
113
115
  ALLOWLIST_MODE_ALL
114
116
  ALLOWLIST_MODE_CUSTOM
115
117
  APPROVAL_DECISIONS
118
+ AcpCallbackContext
119
+ AcpClientError
120
+ AcpClientHostOptions
121
+ AcpInteractionRequest
122
+ AcpListedSession
123
+ AcpProfileDescriptor
124
+ AcpSessionListResult
116
125
  BINARY_BLOAT_TOOLS
117
126
  BridgeSpec
118
127
  CLAUDE_SDK_CATALOG_VERSION
@@ -127,6 +136,8 @@ RuntimeBridgeDescriptor
127
136
  RuntimeBridgeId
128
137
  RuntimeModelRef
129
138
  UNKNOWN_CAPABILITY
139
+ acpRuntimeBridge
140
+ authenticateAcpProfile
130
141
  buildCapabilitiesUsed
131
142
  buildTranscriptTailSnapshot
132
143
  canonicalizeLegacyModelReference
@@ -140,19 +151,23 @@ createRouterRuntime
140
151
  createRuntime
141
152
  createSessionRegistry
142
153
  curatedClaudeSdkModels
154
+ deleteAcpSession
143
155
  discoverClaudeSdkModels
144
156
  disposeAllProviderSessions
145
157
  disposeProviderSession
146
158
  executionModeIncompatibilityReason
159
+ generateAcpResponse
147
160
  generatePiNativeResponse
148
161
  getPiBuiltinModel
149
162
  inferAllowlistMode
150
163
  invalidateProviderSession
151
164
  isLikelyContextTermination
152
165
  isModelCompatibleWithExecutionMode
166
+ listAcpSessions
153
167
  listPiBuiltinModels
154
168
  listRuntimeBridges
155
169
  loginPiOAuth
170
+ logoutAcpProfile
156
171
  normalizeAllowlistMode
157
172
  normalizeClaudeSdkCatalog
158
173
  normalizeClaudeSdkModelId
@@ -161,6 +176,7 @@ normalizeRuntimeModelReference
161
176
  parseRuntimeModelReference
162
177
  parseStoredAllowlist
163
178
  piNativeRuntimeBridge
179
+ probeAcpProfile
164
180
  readRuntimeBrand
165
181
  readToolRuntime
166
182
  reasoningLevelsForPiModel
@@ -178,6 +194,8 @@ sdkFromModelReference
178
194
  storedAllowlistMode
179
195
  syncProviderSession
180
196
  toolCompactionAppliedFromWarnings
197
+ validateAcpProfileId
198
+ validateAcpProviderSessionId
181
199
  wrapToolsWithApprovalGate
182
200
  ```
183
201
 
@@ -302,7 +320,15 @@ renderResumeSnapshot
302
320
  **`@mono-agent/agent-runtime/ai`**
303
321
 
304
322
  ```text
323
+ ACP_PROTOCOL_VERSION
305
324
  ACTIVE_RUNTIME_KINDS
325
+ AcpCallbackContext
326
+ AcpClientError
327
+ AcpClientHostOptions
328
+ AcpInteractionRequest
329
+ AcpListedSession
330
+ AcpProfileDescriptor
331
+ AcpSessionListResult
306
332
  BridgeSpec
307
333
  CLAUDE_SDK_CATALOG_VERSION
308
334
  RESERVED_RUNTIME_KINDS
@@ -312,6 +338,8 @@ RuntimeBridgeDescriptor
312
338
  RuntimeBridgeId
313
339
  RuntimeModelRef
314
340
  UNKNOWN_CAPABILITY
341
+ acpRuntimeBridge
342
+ authenticateAcpProfile
315
343
  buildCapabilitiesUsed
316
344
  canonicalizeLegacyModelReference
317
345
  createClaudeSdkDiscoveryIsolation
@@ -319,22 +347,27 @@ createMetricsObserver
319
347
  createObserverHub
320
348
  createSessionRegistry
321
349
  curatedClaudeSdkModels
350
+ deleteAcpSession
322
351
  discoverClaudeSdkModels
323
352
  disposeAllProviderSessions
324
353
  disposeProviderSession
325
354
  executionModeIncompatibilityReason
355
+ generateAcpResponse
326
356
  generatePiNativeResponse
327
357
  getPiBuiltinModel
328
358
  invalidateProviderSession
329
359
  isModelCompatibleWithExecutionMode
360
+ listAcpSessions
330
361
  listPiBuiltinModels
331
362
  listRuntimeBridges
332
363
  loginPiOAuth
364
+ logoutAcpProfile
333
365
  normalizeClaudeSdkCatalog
334
366
  normalizeClaudeSdkModelId
335
367
  normalizeRuntimeModelReference
336
368
  parseRuntimeModelReference
337
369
  piNativeRuntimeBridge
370
+ probeAcpProfile
338
371
  reasoningLevelsForPiModel
339
372
  refreshProviderSession
340
373
  resolvePiOAuthApiKey
@@ -343,6 +376,8 @@ runtimeCapabilities
343
376
  sdkFromModelReference
344
377
  syncProviderSession
345
378
  toolCompactionAppliedFromWarnings
379
+ validateAcpProfileId
380
+ validateAcpProviderSessionId
346
381
  ```
347
382
 
348
383
  **`@mono-agent/agent-runtime/ai/cost.js`**
@@ -390,6 +425,13 @@ statsForCompletedChange
390
425
  formatLiveInputGuidance
391
426
  ```
392
427
 
428
+ **`@mono-agent/agent-runtime/ai/providers/acp.js`**
429
+
430
+ ```text
431
+ acpRuntimeBridge
432
+ generateAcpResponse
433
+ ```
434
+
393
435
  **`@mono-agent/agent-runtime/ai/providers/claude-cli.js`**
394
436
 
395
437
  ```text
@@ -499,7 +541,7 @@ normalizeCodexItemType
499
541
  `@mono-agent/agent-runtime` is purpose-built for **autonomous, long-running agent work** with provider portability and operational resilience as first-class concerns. It is *not* a streaming-chat UI kit. Where each peer fits:
500
542
 
501
543
  - **Vercel AI SDK** — best when you're building a chat / generative-UI experience inside a React or Next.js app. `useChat`, `useCompletion`, streaming server components, and edge-runtime compatibility are their strengths. Their provider list is curated (Anthropic, OpenAI, Google, etc., via `@ai-sdk/*` packages); there's no Pi gateway, no Claude Code CLI, no Codex CLI app-server, and no per-call provider fallback. If you're rendering a streaming chat into a browser, use them. If you're orchestrating multi-turn autonomous work that must survive a rate-limited primary provider, use us.
502
- - **Claude Agent SDK** (`@anthropic-ai/claude-agent-sdk`) — first-party Anthropic SDK. Tight integration with Claude features (canUseTool, sub-agents, hooks, MCP). We *wrap* it as one of our five bridges and add transcript-resume across provider drops, a structured failure taxonomy, a tool-bloat guard with artifact persistence, and a provider fallback router. Context/window handling remains bridge-specific; the pi-native bridge drives its own compaction recovery. Reach for the bare Anthropic SDK when you only ever talk to Claude and don't need cross-provider portability or resume.
544
+ - **Claude Agent SDK** (`@anthropic-ai/claude-agent-sdk`) — first-party Anthropic SDK. Tight integration with Claude features (canUseTool, sub-agents, hooks, MCP). We *wrap* it as one of our six bridges and add transcript-resume across provider drops, a structured failure taxonomy, a tool-bloat guard with artifact persistence, and a provider fallback router. Context/window handling remains bridge-specific; the pi-native bridge drives its own compaction recovery. Reach for the bare Anthropic SDK when you only ever talk to Claude and don't need cross-provider portability or resume.
503
545
  - **Mastra** — a workflow engine + memory + RAG stack. Different category: it's the layer *above* a runtime. You can layer Mastra workflows on top of `@mono-agent/agent-runtime` if you want both.
504
546
  - **OpenAI Agents SDK** — first-party OpenAI SDK. Same trade-off as the Claude Agent SDK: tight integration with OpenAI, no other providers. Pi providers in our runtime cover OpenAI plus a dozen others through a single API.
505
547
  - **LangChain.js** — kitchen sink with deep abstraction stacks. We're deliberately lean; if you want chains, agents, vector stores, and parsers under one umbrella, LangChain is built for that. If you want a focused runtime kernel, use us.
@@ -510,6 +552,7 @@ normalizeCodexItemType
510
552
  - Anthropic Claude via the `claude` Code CLI binary.
511
553
  - OpenAI's Codex via the `codex` app-server CLI.
512
554
  - OpenCode providers via an isolated, password-authenticated `opencode` app-server.
555
+ - Any ACP v1 stdio agent resolved by the host from an `acp:<profile-id>` reference.
513
556
  - OpenAI, Google Gemini, AWS Bedrock, OpenRouter, xAI, Groq, Mistral, Perplexity, DeepSeek, Ollama, LlamaCPP, GLM, Vercel AI Gateway, GitHub Copilot, Gemini CLI — all through the Pi (`@earendil-works/pi-ai`) provider gateway, which our SDK adapter speaks directly.
514
557
 
515
558
  **At-a-glance:**
@@ -517,7 +560,7 @@ normalizeCodexItemType
517
560
  | Need | Use this | Use Vercel AI SDK | Use Claude Agent SDK |
518
561
  |---|---|---|---|
519
562
  | Streaming chat UI in React/Next | ✗ | ✓ | ✗ |
520
- | Multi-provider portability | ✓ (5 bridges, 15+ providers) | partial | ✗ |
563
+ | Multi-provider portability | ✓ (6 bridges, 15+ providers) | partial | ✗ |
521
564
  | CLI providers (claude/codex/opencode binaries) | ✓ | ✗ | ✗ |
522
565
  | Provider fallback on rate limit / overload | ✓ (`createRouterRuntime`) | ✗ | ✗ |
523
566
  | Context handling delegated to the provider (no host auto-summarization) | ✓ | ✓ | ✓ |
@@ -541,11 +584,47 @@ The runtime picks a backend from `options.model` + `options.executionMode`:
541
584
  | `"pi"` | `"sdk"` (or omitted) | Pi SDK |
542
585
  | `"codex"` | `"cli"` | Codex app-server CLI |
543
586
  | `"opencode"` | `"cli"` | Isolated OpenCode app-server CLI |
587
+ | `"acp"` | `"acp"` | ACP v1 stdio client |
544
588
 
545
589
  A `model` is a parsed `{ sdk, model, provider? }` object. Convert canonical
546
590
  strings such as `"pi:openai:gpt-5.5"` with
547
591
  `parseRuntimeModelReference()` before calling `run()`.
548
592
 
593
+ #### ACP v1 host contract
594
+
595
+ ACP references are canonical `acp:<profile-id>` strings and always use the
596
+ dedicated `executionMode: "acp"`. The host supplies
597
+ `resolveAcpProfile(profileId, context)` either to `createRuntime()` or per run;
598
+ per-run callbacks win. A profile contains an absolute executable command,
599
+ literal arguments, an exact child environment, ownership declarations for
600
+ configuration/workspace/MCP, explicit capability policy, and bounded process
601
+ limits. The runtime never invokes a shell or inherits `process.env`.
602
+
603
+ Client-owned filesystem, terminal, permission, and elicitation behavior must be
604
+ provided as callbacks and is advertised only when enabled. The runtime-adapter
605
+ facade injects mono-agent's real sandbox implementation; direct kernel callers
606
+ must provide their own when policy requires it. Every owned stdio bridge is
607
+ closed after the operation with stdin close, TERM, then bounded KILL escalation.
608
+ Callback payloads retain their typed operation fields but omit raw protocol
609
+ session ids, extension metadata, and copied raw-id strings. Session-scoped
610
+ callbacks receive the corresponding opaque handle as
611
+ `AcpCallbackContext.providerSessionId`; request ids are opaque host correlation
612
+ tokens as well.
613
+ Session-update dispatch reads only validated own protocol fields. If a valid
614
+ transport frame is too structurally complex for the bounded host sanitizer,
615
+ the turn fails explicitly as `provider_protocol` instead of emitting a partial
616
+ tool, plan, or message event.
617
+
618
+ ACP provider-session ids and list cursors are opaque, profile-bound runtime
619
+ handles. Preserve them byte-for-byte and pass them back only to the matching
620
+ high-level resume, list, validation, or delete operation; raw protocol session
621
+ ids, cursors, and transport connections are private runtime state. Under the
622
+ default `auto` recovery policy, the client prefers `session/resume`, then
623
+ `session/load`, and finally a fresh session when neither capability is
624
+ advertised. Explicit `resume` or `load` policies fail closed if missing. Stable
625
+ usage comes from the latest typed `usage_update` notification; unstable
626
+ `PromptResponse.usage` is ignored.
627
+
549
628
  ### `createRuntime(host)`
550
629
 
551
630
  Pass host-level integration once at boot. All keys are optional.
@@ -555,6 +634,8 @@ createRuntime({
555
634
  // -- host callbacks --
556
635
  resolveCustomPricing, // (parsed) => NormalizedPricing | null
557
636
  resolvePiApiKey, // async (provider) => string | undefined
637
+ resolveAcpProfile, // async (profileId, context) => AcpProfileDescriptor
638
+ onAcpInteractionRequest, // async permission/elicitation fallback callback
558
639
  persistArtifact, // ({ filename, buffer, toolName, toolUseId }) => path | null
559
640
  onCompactionRecorded, // (compactionRow) => void — fired when the pi bridge
560
641
  // runs an automatic compaction (proactive or reactive
@@ -652,7 +733,7 @@ Per-call options (a non-exhaustive selection):
652
733
  | Option | Type | Notes |
653
734
  |---|---|---|
654
735
  | `model` | `RuntimeModelRef` | **Required.** Pass the object returned by `parseRuntimeModelReference()`; `run()` does not parse strings. |
655
- | `executionMode` | `"sdk" \| "cli"` | Default `"sdk"`. |
736
+ | `executionMode` | `"sdk" \| "cli" \| "acp"` | Default `"sdk"`; ACP references require `"acp"`. |
656
737
  | `messages` | `Message[]` | Conversation history. |
657
738
  | `cwd` | `string` | Working directory for the agent's tools. |
658
739
  | `allowedTools` | `string[]` | Built-in tool allowlist. Default: all. |
@@ -1010,7 +1091,7 @@ These are stable but treated as advanced API. Most consumers should reach for `c
1010
1091
  ## Dependency Boundary
1011
1092
 
1012
1093
  This package has zero `@mono-agent/*` workspace dependencies. Its runtime
1013
- dependencies are `@anthropic-ai/claude-agent-sdk`, `@anthropic-ai/sdk`,
1094
+ dependencies are `@agentclientprotocol/sdk`, `@anthropic-ai/claude-agent-sdk`, `@anthropic-ai/sdk`,
1014
1095
  `@earendil-works/pi-agent-core`, `@earendil-works/pi-ai`,
1015
1096
  `@modelcontextprotocol/sdk`, `@opencode-ai/sdk`, `@vscode/ripgrep`,
1016
1097
  `cross-spawn`, and `zod`.
@@ -1047,7 +1128,7 @@ runtime fails closed.
1047
1128
  - [Runtime and providers](https://mono-agent-docs.vercel.app/runtime/) explains the
1048
1129
  config-first model and backend choices.
1049
1130
  - [Backends and model references](https://mono-agent-docs.vercel.app/runtime/backends/)
1050
- documents all five bridges and their execution modes.
1131
+ documents the built-in bridges and their execution modes.
1051
1132
  - [Programmatic approvals and structured output](https://mono-agent-docs.vercel.app/programmatic/approval-and-structured-output/)
1052
1133
  shows the code-only host hooks.
1053
1134
  - [Local-first web research](https://mono-agent-docs.vercel.app/tools/web-research/)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mono-agent/agent-runtime",
3
- "version": "0.17.1",
4
- "description": "Agent runtime supporting Claude SDK/CLI, Codex, OpenCode, and Pi SDK bridges out of the box",
3
+ "version": "0.18.0",
4
+ "description": "Agent runtime supporting Claude SDK/CLI, Codex, OpenCode, Pi SDK, and ACP v1 bridges out of the box",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0-only",
7
7
  "repository": {
@@ -87,6 +87,10 @@
87
87
  "types": "./types/ai/providers/opencode-discovery.d.ts",
88
88
  "default": "./src/ai/providers/opencode-discovery.js"
89
89
  },
90
+ "./ai/providers/acp.js": {
91
+ "types": "./types/ai/providers/acp.d.ts",
92
+ "default": "./src/ai/providers/acp.js"
93
+ },
90
94
  "./agent/tools/index.js": {
91
95
  "types": "./types/agent/tools/index.d.ts",
92
96
  "default": "./src/agent/tools/index.js"
@@ -131,6 +135,7 @@
131
135
  "node": ">=22.19.0"
132
136
  },
133
137
  "dependencies": {
138
+ "@agentclientprotocol/sdk": "1.3.0",
134
139
  "@anthropic-ai/claude-agent-sdk": "0.3.206",
135
140
  "@anthropic-ai/sdk": "^0.110.0",
136
141
  "@earendil-works/pi-agent-core": "0.83.0",
package/src/ai/failure.js CHANGED
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * @typedef {"spawn" | "timeout" | "stall" | "context_limit" | "usage_limit" | "invalid_result"
12
12
  * | "invalid_delegation" | "tool_failure" | "provider_unavailable"
13
- * | "provider_unavailable_exhausted" | "provider_auth"
13
+ * | "provider_unavailable_exhausted" | "provider_auth" | "provider_protocol"
14
14
  * | "skipped_capability_mismatch" | "cancelled" | "cancelled_user"
15
15
  * | "cancelled_shutdown" | "cancelled_signal" | "abandoned"
16
16
  * | "session_not_found" | "session_busy" | (string & {})} FailureKind
@@ -49,6 +49,7 @@ export const FAILURE_KINDS = [
49
49
  "provider_unavailable",
50
50
  "provider_unavailable_exhausted",
51
51
  "provider_auth",
52
+ "provider_protocol",
52
53
  "skipped_capability_mismatch",
53
54
  "child_failed",
54
55
  "budget_exceeded",
package/src/ai/index.js CHANGED
@@ -12,6 +12,8 @@ export {
12
12
  } from "./runtime/sessions.js";
13
13
  export { createMetricsObserver, createObserverHub } from "./observer.js";
14
14
  export { generatePiNativeResponse, piNativeRuntimeBridge } from "./providers/pi-native.js";
15
+ export { generateAcpResponse, acpRuntimeBridge } from "./providers/acp.js";
16
+ export * from "./providers/acp-public.js";
15
17
  export {
16
18
  getPiBuiltinModel,
17
19
  listPiBuiltinModels,