@arnilo/prism-hosts 0.0.0-stage → 0.13.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 (322) hide show
  1. package/CHANGELOG.md +394 -0
  2. package/LICENSE +21 -0
  3. package/README.md +34 -2
  4. package/acp/README.md +87 -0
  5. package/acp/src/capabilities.ts +184 -0
  6. package/acp/src/errors.ts +24 -0
  7. package/acp/src/host.ts +36 -0
  8. package/acp/src/index.ts +25 -0
  9. package/acp/src/limits.ts +49 -0
  10. package/acp/src/mapper.ts +419 -0
  11. package/acp/src/permission.ts +37 -0
  12. package/acp/src/projection.ts +39 -0
  13. package/acp/src/prompt.ts +170 -0
  14. package/acp/src/serve.ts +345 -0
  15. package/acp/src/session-map.ts +49 -0
  16. package/ag-ui/README.md +56 -0
  17. package/ag-ui/src/a2ui.ts +570 -0
  18. package/ag-ui/src/ag-ui-mapper.ts +507 -0
  19. package/ag-ui/src/encrypted-value.ts +40 -0
  20. package/ag-ui/src/errors.ts +29 -0
  21. package/ag-ui/src/handler.ts +642 -0
  22. package/ag-ui/src/index.ts +177 -0
  23. package/ag-ui/src/input.ts +190 -0
  24. package/ag-ui/src/limits.ts +279 -0
  25. package/ag-ui/src/mcp-apps.ts +256 -0
  26. package/ag-ui/src/mcp.ts +94 -0
  27. package/ag-ui/src/projection.ts +201 -0
  28. package/ag-ui/src/projectors.ts +272 -0
  29. package/ag-ui/src/renderer/bind.ts +152 -0
  30. package/ag-ui/src/renderer/core.ts +270 -0
  31. package/ag-ui/src/renderer/index.ts +165 -0
  32. package/ag-ui/src/replay.ts +189 -0
  33. package/ag-ui/src/types.ts +66 -0
  34. package/channels/README.md +139 -0
  35. package/channels/src/admission.ts +8 -0
  36. package/channels/src/approvals.ts +262 -0
  37. package/channels/src/checkpoint-contract.ts +97 -0
  38. package/channels/src/delivery.ts +116 -0
  39. package/channels/src/host-ui.ts +356 -0
  40. package/channels/src/identity.ts +46 -0
  41. package/channels/src/index.ts +82 -0
  42. package/channels/src/limits.ts +49 -0
  43. package/channels/src/memory-stores.ts +112 -0
  44. package/channels/src/pairing.ts +178 -0
  45. package/channels/src/runtime-admit.ts +389 -0
  46. package/channels/src/runtime-core.ts +621 -0
  47. package/channels/src/runtime-reconcile.ts +299 -0
  48. package/channels/src/runtime-turn.ts +664 -0
  49. package/channels/src/runtime-types.ts +95 -0
  50. package/channels/src/runtime.ts +86 -0
  51. package/channels/src/secret-ref.ts +42 -0
  52. package/channels/src/signal.ts +790 -0
  53. package/channels/src/state.ts +355 -0
  54. package/channels/src/telegram.ts +1317 -0
  55. package/channels/src/types.ts +442 -0
  56. package/devtools/README.md +92 -0
  57. package/devtools/bin/prism-devtools.ts +63 -0
  58. package/devtools/src/args.ts +71 -0
  59. package/devtools/src/bun.d.ts +27 -0
  60. package/devtools/src/compare.ts +190 -0
  61. package/devtools/src/errors.ts +15 -0
  62. package/devtools/src/index.ts +25 -0
  63. package/devtools/src/replay.ts +36 -0
  64. package/devtools/src/security.ts +80 -0
  65. package/devtools/src/serve.ts +259 -0
  66. package/devtools/src/ui/assets.ts +108 -0
  67. package/devtools/src/ui/inspector.ts +182 -0
  68. package/driver-process/README.md +197 -0
  69. package/driver-process/src/abort.ts +74 -0
  70. package/driver-process/src/adapter.ts +211 -0
  71. package/driver-process/src/driver.ts +303 -0
  72. package/driver-process/src/errors.ts +17 -0
  73. package/driver-process/src/extend.ts +72 -0
  74. package/driver-process/src/index.ts +5 -0
  75. package/driver-process/src/inspect.ts +33 -0
  76. package/driver-process/src/session.ts +72 -0
  77. package/driver-process/src/testing.ts +394 -0
  78. package/driver-process/src/transports/json-rpc.ts +147 -0
  79. package/driver-process/src/transports/jsonl-stream.ts +12 -0
  80. package/driver-process/src/transports/types.ts +11 -0
  81. package/driver-process/src/turn.ts +106 -0
  82. package/evals/README.md +843 -0
  83. package/evals/src/calibration.ts +179 -0
  84. package/evals/src/citation-integrity.ts +98 -0
  85. package/evals/src/citations.ts +45 -0
  86. package/evals/src/compare-experiments.ts +153 -0
  87. package/evals/src/comparison.ts +230 -0
  88. package/evals/src/curate.ts +257 -0
  89. package/evals/src/dataset.ts +81 -0
  90. package/evals/src/erp-invariants.ts +163 -0
  91. package/evals/src/errors.ts +23 -0
  92. package/evals/src/experiment.ts +537 -0
  93. package/evals/src/failure-injection.ts +77 -0
  94. package/evals/src/feedback.ts +53 -0
  95. package/evals/src/index.ts +198 -0
  96. package/evals/src/injection.ts +247 -0
  97. package/evals/src/judge-panel.ts +109 -0
  98. package/evals/src/judge.ts +89 -0
  99. package/evals/src/limits.ts +50 -0
  100. package/evals/src/report-record.ts +47 -0
  101. package/evals/src/rubric-judge.ts +334 -0
  102. package/evals/src/scenario-runner.ts +317 -0
  103. package/evals/src/scenarios.ts +81 -0
  104. package/evals/src/score.ts +328 -0
  105. package/evals/src/scorer.ts +21 -0
  106. package/evals/src/state-match.ts +130 -0
  107. package/evals/src/stats.ts +635 -0
  108. package/evals/src/threshold.ts +117 -0
  109. package/evals/src/timeline.ts +38 -0
  110. package/evals/src/toolless-session.ts +33 -0
  111. package/evals/src/trace.ts +80 -0
  112. package/evals/src/trajectory.ts +623 -0
  113. package/evals/src/types.ts +672 -0
  114. package/evals/src/user-simulator.ts +101 -0
  115. package/evals/src/util.ts +207 -0
  116. package/headless/README.md +172 -0
  117. package/headless/src/answers.ts +91 -0
  118. package/headless/src/authority.ts +32 -0
  119. package/headless/src/errors.ts +36 -0
  120. package/headless/src/index.ts +17 -0
  121. package/headless/src/limits.ts +11 -0
  122. package/headless/src/pending.ts +16 -0
  123. package/headless/src/policy.ts +36 -0
  124. package/headless/src/resume.ts +103 -0
  125. package/headless/src/route.ts +153 -0
  126. package/headless/src/scheduler/clock.ts +22 -0
  127. package/headless/src/scheduler/cron.ts +19 -0
  128. package/headless/src/scheduler/firing.ts +58 -0
  129. package/headless/src/scheduler/index.ts +399 -0
  130. package/headless/src/scheduler/lease.ts +38 -0
  131. package/headless/src/scheduler/missed.ts +12 -0
  132. package/headless/src/scheduler/state.ts +132 -0
  133. package/host-builder/README.md +251 -0
  134. package/host-builder/bin/prism-host-builder.ts +169 -0
  135. package/host-builder/data/api.json +6167 -0
  136. package/host-builder/data/errors.json +546 -0
  137. package/host-builder/data/examples/acp.ts +63 -0
  138. package/host-builder/data/examples/adapters/conformance.ts +34 -0
  139. package/host-builder/data/examples/adapters/fixtures/rpc-server.json +26 -0
  140. package/host-builder/data/examples/adapters/fixtures/stream-cli.json +27 -0
  141. package/host-builder/data/examples/adapters/fixtures/workspace-config.json +28 -0
  142. package/host-builder/data/examples/adapters/rpc-server.dialect.ts +218 -0
  143. package/host-builder/data/examples/adapters/rpc-server.ts +309 -0
  144. package/host-builder/data/examples/adapters/stream-cli.dialect.ts +165 -0
  145. package/host-builder/data/examples/adapters/stream-cli.ts +256 -0
  146. package/host-builder/data/examples/adapters/workspace-config.dialect.ts +172 -0
  147. package/host-builder/data/examples/adapters/workspace-config.ts +251 -0
  148. package/host-builder/data/examples/advisor.ts +94 -0
  149. package/host-builder/data/examples/ag-ui-a2ui.ts +80 -0
  150. package/host-builder/data/examples/ag-ui-mcp-apps.ts +44 -0
  151. package/host-builder/data/examples/ag-ui-server.ts +118 -0
  152. package/host-builder/data/examples/agent-durable-approval.ts +43 -0
  153. package/host-builder/data/examples/api-key-auth.ts +23 -0
  154. package/host-builder/data/examples/approval.ts +92 -0
  155. package/host-builder/data/examples/attention-compiler.ts +81 -0
  156. package/host-builder/data/examples/autonomous-coding-loop.ts +343 -0
  157. package/host-builder/data/examples/behavior-evaluation.ts +303 -0
  158. package/host-builder/data/examples/build-workflow.ts +334 -0
  159. package/host-builder/data/examples/cache-aware-prompt-assembly.ts +139 -0
  160. package/host-builder/data/examples/caveman-ponytail.ts +197 -0
  161. package/host-builder/data/examples/cli.ts +31 -0
  162. package/host-builder/data/examples/coding-approval.ts +115 -0
  163. package/host-builder/data/examples/coding-browser-evaluation.ts +208 -0
  164. package/host-builder/data/examples/coding-compaction.ts +30 -0
  165. package/host-builder/data/examples/coding-goal-verify.ts +121 -0
  166. package/host-builder/data/examples/coding-tools-capability-gaps.ts +75 -0
  167. package/host-builder/data/examples/compaction.ts +36 -0
  168. package/host-builder/data/examples/connected-slack-mcp.ts +67 -0
  169. package/host-builder/data/examples/context.ts +29 -0
  170. package/host-builder/data/examples/custom-adapter.ts +256 -0
  171. package/host-builder/data/examples/custom-builders.ts +66 -0
  172. package/host-builder/data/examples/custom-loop.ts +89 -0
  173. package/host-builder/data/examples/custom-provider.ts +70 -0
  174. package/host-builder/data/examples/custom-session-store.ts +72 -0
  175. package/host-builder/data/examples/custom-tools-skills-context.ts +97 -0
  176. package/host-builder/data/examples/decision-models.ts +98 -0
  177. package/host-builder/data/examples/define-package.ts +188 -0
  178. package/host-builder/data/examples/delegate.ts +200 -0
  179. package/host-builder/data/examples/discover-skills.ts +65 -0
  180. package/host-builder/data/examples/drive-rag-sync.ts +44 -0
  181. package/host-builder/data/examples/durable-approval.ts +139 -0
  182. package/host-builder/data/examples/durable-investigation.ts +93 -0
  183. package/host-builder/data/examples/durable-loops-and-approvals.ts +94 -0
  184. package/host-builder/data/examples/enterprise-identity.ts +21 -0
  185. package/host-builder/data/examples/enterprise-policy-audit.ts +50 -0
  186. package/host-builder/data/examples/enterprise-work-connectors.ts +103 -0
  187. package/host-builder/data/examples/eval-injection.ts +73 -0
  188. package/host-builder/data/examples/eval-judges.ts +145 -0
  189. package/host-builder/data/examples/evals.ts +86 -0
  190. package/host-builder/data/examples/evaluation-gate.ts +40 -0
  191. package/host-builder/data/examples/execution-timeline.ts +173 -0
  192. package/host-builder/data/examples/external-agent.ts +541 -0
  193. package/host-builder/data/examples/external-app-db-backed.ts +344 -0
  194. package/host-builder/data/examples/governance-deny.ts +122 -0
  195. package/host-builder/data/examples/guardrail-packs.ts +240 -0
  196. package/host-builder/data/examples/headless-host.ts +245 -0
  197. package/host-builder/data/examples/hooks-audit-command.mjs +31 -0
  198. package/host-builder/data/examples/hooks-json.ts +87 -0
  199. package/host-builder/data/examples/host-builder-agent.ts +150 -0
  200. package/host-builder/data/examples/host-hooks.ts +71 -0
  201. package/host-builder/data/examples/host-step-loop-timeline.ts +212 -0
  202. package/host-builder/data/examples/hosted-sandbox.ts +48 -0
  203. package/host-builder/data/examples/instruction-injection.ts +127 -0
  204. package/host-builder/data/examples/jsonl-stores-branching.ts +49 -0
  205. package/host-builder/data/examples/long-term-memory.ts +158 -0
  206. package/host-builder/data/examples/manifest.ts +112 -0
  207. package/host-builder/data/examples/mcp-server.ts +48 -0
  208. package/host-builder/data/examples/mcp-trust.ts +173 -0
  209. package/host-builder/data/examples/memory-and-wiki.ts +315 -0
  210. package/host-builder/data/examples/memory-lifecycle.ts +302 -0
  211. package/host-builder/data/examples/memory-system.ts +252 -0
  212. package/host-builder/data/examples/messaging-agent.ts +70 -0
  213. package/host-builder/data/examples/minimal-host-app.ts +41 -0
  214. package/host-builder/data/examples/model-router-aggregate-budgets.ts +364 -0
  215. package/host-builder/data/examples/model-router.ts +106 -0
  216. package/host-builder/data/examples/obscura.ts +48 -0
  217. package/host-builder/data/examples/observability.ts +116 -0
  218. package/host-builder/data/examples/open-connector-sidecar.ts +105 -0
  219. package/host-builder/data/examples/openai-compatible.ts +70 -0
  220. package/host-builder/data/examples/package-skills.ts +85 -0
  221. package/host-builder/data/examples/phase9-coding-intelligence.ts +221 -0
  222. package/host-builder/data/examples/provider-registration.ts +29 -0
  223. package/host-builder/data/examples/provider-resolver.ts +39 -0
  224. package/host-builder/data/examples/rag.ts +40 -0
  225. package/host-builder/data/examples/remote-agent-server.ts +45 -0
  226. package/host-builder/data/examples/remote-agent.ts +124 -0
  227. package/host-builder/data/examples/research-ledger.ts +79 -0
  228. package/host-builder/data/examples/revocation-propagation.ts +287 -0
  229. package/host-builder/data/examples/run-feedback.ts +93 -0
  230. package/host-builder/data/examples/scanned-document-rag.ts +48 -0
  231. package/host-builder/data/examples/sdk-basics.ts +21 -0
  232. package/host-builder/data/examples/secure-agent.ts +55 -0
  233. package/host-builder/data/examples/semantic-memory.ts +52 -0
  234. package/host-builder/data/examples/serve-tools.ts +495 -0
  235. package/host-builder/data/examples/session-memory.ts +317 -0
  236. package/host-builder/data/examples/session-search.ts +131 -0
  237. package/host-builder/data/examples/session.ts +52 -0
  238. package/host-builder/data/examples/side-call.ts +64 -0
  239. package/host-builder/data/examples/signal-agent.ts +9 -0
  240. package/host-builder/data/examples/skills-progressive-disclosure.ts +88 -0
  241. package/host-builder/data/examples/skills.ts +19 -0
  242. package/host-builder/data/examples/sqlite-resume.ts +147 -0
  243. package/host-builder/data/examples/system-project-prompts.ts +74 -0
  244. package/host-builder/data/examples/system-prompts.ts +19 -0
  245. package/host-builder/data/examples/telegram-agent.ts +30 -0
  246. package/host-builder/data/examples/tool-narrowing-planes.ts +99 -0
  247. package/host-builder/data/examples/tools.ts +29 -0
  248. package/host-builder/data/examples/validator.ts +67 -0
  249. package/host-builder/data/examples/web-no-key.ts +85 -0
  250. package/host-builder/data/examples/web-research.ts +35 -0
  251. package/host-builder/data/examples/workflow-event-sink.ts +114 -0
  252. package/host-builder/data/examples/workflow-loop.ts +93 -0
  253. package/host-builder/data/examples/workflow-multimodal-document.ts +94 -0
  254. package/host-builder/data/examples/workflow-parallel-research.ts +111 -0
  255. package/host-builder/data/examples/workflow-postgres-resume.ts +75 -0
  256. package/host-builder/data/examples/workflow-research-and-review.ts +98 -0
  257. package/host-builder/data/examples/workflow-sqlite-resume.ts +163 -0
  258. package/host-builder/data/examples.json +130 -0
  259. package/host-builder/skills/prism-host-builder/SKILL.md +85 -0
  260. package/host-builder/skills/prism-host-builder/references/choosing.md +101 -0
  261. package/host-builder/skills/prism-host-builder/references/layout.md +52 -0
  262. package/host-builder/skills/prism-host-builder/references/pitfalls.md +50 -0
  263. package/host-builder/skills/prism-host-builder/references/recipes.md +129 -0
  264. package/host-builder/skills/prism-host-builder/references/security.md +52 -0
  265. package/host-builder/skills/prism-host-builder/references/upgrading.md +67 -0
  266. package/host-builder/skills/prism-host-builder/references/verification.md +108 -0
  267. package/host-builder/src/check/child.ts +108 -0
  268. package/host-builder/src/check/conformance.ts +13 -0
  269. package/host-builder/src/check/inspect.ts +20 -0
  270. package/host-builder/src/check/manifest.ts +23 -0
  271. package/host-builder/src/check/runner.ts +181 -0
  272. package/host-builder/src/check/targets.ts +65 -0
  273. package/host-builder/src/errors.ts +35 -0
  274. package/host-builder/src/index.ts +25 -0
  275. package/host-builder/src/indexes.ts +145 -0
  276. package/host-builder/src/install/install.ts +400 -0
  277. package/host-builder/src/install/targets.ts +50 -0
  278. package/host-builder/src/lookup/api.ts +127 -0
  279. package/host-builder/src/lookup/bound.ts +38 -0
  280. package/host-builder/src/lookup/docs.ts +238 -0
  281. package/host-builder/src/lookup/errors.ts +92 -0
  282. package/host-builder/src/lookup/examples.ts +117 -0
  283. package/host-builder/src/lookup/text.ts +60 -0
  284. package/host-builder/src/server.ts +300 -0
  285. package/host-builder/src/version.ts +38 -0
  286. package/mcp-server/README.md +219 -0
  287. package/mcp-server/src/bounds.ts +23 -0
  288. package/mcp-server/src/host.ts +31 -0
  289. package/mcp-server/src/index.ts +27 -0
  290. package/mcp-server/src/serve-tools.ts +408 -0
  291. package/mcp-server/src/serve.ts +329 -0
  292. package/mcp-server/src/server.ts +331 -0
  293. package/mcp-server/src/session-map.ts +47 -0
  294. package/mcp-server/src/skill-resources.ts +85 -0
  295. package/mcp-server/src/types.ts +215 -0
  296. package/package.json +130 -4
  297. package/remote/README.md +244 -0
  298. package/remote/src/attribution.ts +22 -0
  299. package/remote/src/auth.ts +30 -0
  300. package/remote/src/bun-module.d.ts +34 -0
  301. package/remote/src/channel.ts +86 -0
  302. package/remote/src/connect.ts +212 -0
  303. package/remote/src/dispatcher.ts +282 -0
  304. package/remote/src/errors.ts +59 -0
  305. package/remote/src/host-ui.ts +152 -0
  306. package/remote/src/http-gate.ts +43 -0
  307. package/remote/src/index.ts +53 -0
  308. package/remote/src/jsonl.ts +69 -0
  309. package/remote/src/limits.ts +43 -0
  310. package/remote/src/mirror.ts +90 -0
  311. package/remote/src/pending.ts +22 -0
  312. package/remote/src/protocol.ts +107 -0
  313. package/remote/src/serve.ts +560 -0
  314. package/remote/src/session-proxy.ts +219 -0
  315. package/remote/src/sse.ts +38 -0
  316. package/remote/src/stdio-client.ts +41 -0
  317. package/remote/src/testing-fixtures/serve-stdio.ts +32 -0
  318. package/remote/src/testing.ts +230 -0
  319. package/remote/src/transport.ts +139 -0
  320. package/remote/src/transports/client.ts +126 -0
  321. package/remote/src/transports/network.ts +268 -0
  322. package/remote/src/wire.ts +244 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,394 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ Consolidate ten host and driver workspaces into `@arnilo/prism-hosts` subpaths. Preserve library exports, protocol caps, authentication, sandboxing and both executable bins. Host-builder indexes and the installer use bundle specifiers. Versions remain in lockstep with the kernel.
6
+
7
+ ### ./mcp-server history
8
+
9
+ ## [Unreleased]
10
+
11
+ ### Fixed
12
+
13
+ - **`serveTools` returns a tool's value, not only its text (plan 192 Task 3).** A `tools/call` answer now carries the `ToolResult`'s text blocks **and**, when `value` is a JSON object within `limits.resultBytes`, `structuredContent` — until now the value was dropped whenever the tool also authored text, so a caller that reads structure lost it. A result with no text block falls back to a clipped-JSON text block, an error answers `isError: true` with `<code>: <message>`, and an untrusted result answers with the kernel's envelope (`formatUntrustedToolText`) so a vendor agent sees the same bytes the internal loop would; non-text blocks follow the envelope, and `structuredContent` still carries the redacted value. An over-cap value is not structured: the clipped text is the whole answer. The value is the kernel-redacted one, so a secret placeholder survives and no raw secret leaves.
14
+
15
+ ### Added
16
+
17
+ - **`skillResources(skills, servedToolNames)` (plan 215 Task 10).** A helper next to `serveTools` that turns the skills tied to the lent tools into `serveTools` resources, so a vendor agent reads them over the same bounded resource channel (no new transport or option). A skill is lent only when its `requiresTools` is non-empty and a subset of the served tools; a skill with no `requiresTools`, or no body, is not. Each resource is `prism-skill://<name>`, `text/markdown`, holding the skill as a standard `SKILL.md` (frontmatter and body, rendered from the loaded skill, never from its path). A skill over the 256 KiB resource bound is left out and returned in `skipped` (`{ name, reason: "oversized", bytes }`), never truncated. Pure and deterministic. New exports: `skillResources`, `SkillResources`, `SkippedSkillResource`. `examples/serve-tools.ts` passes it to `serveTools`.
18
+ - **`examples/serve-tools.ts`: serving a run's tools to an external agent (plan 165 Task 8).** The Phase 14 end-to-end example, offline. Inside one `session.run` an inline `defineDriver` driver binds a `workspace` worktree for the run's session, writes the vendor's MCP configuration into it with `excludeOverlay`, and serves `read`, `edit`, and the permission tool with `serveTools` over `loopback-http` and then `stdio-relay`, driving the scripted `jsonl-stream` CLI as the vendor binary through `--mcp-endpoint`. It shows an allowed `edit` that changes the file in the worktree, a declined `edit` under `@arnilo/prism-approval` in `ask` mode, the permission tool's deny and allow, an unserved name as a JSON-RPC error, a call after `close()` refused, the served calls' `origin` on the run's events, the worktree diff with the overlay excluded, and a conflicting `merge` reported unresolved.
19
+ - `serveTools`'s permission tool (plan 165 Task 5): `options.permissionTool` (`{ name, effects?, rewrite?, codec? }`) serves one more tool, `prefix + name`, backed by `run.ask`. Its neutral input is `{ toolName, input, toolCallId? }` and its output text is JSON `{ behavior, updatedInput?, message? }`; a driver whose vendor has a permission-prompt hook (`claude --permission-prompt-tool`) supplies a `codec` (`decode`/`encode`) to map the vendor shape, the only vendor-shape hook in the package. Each call is one `run.ask` (`effects` defaults to every effect, `rewrite` to `false`) and appends one bounded, redacted `prism.permissions` `external_state` entry `{ toolName, toolCallId, behavior, reason }` — never the input. A `deny` is a normal result carrying the decision JSON, not `isError`. An `approval_pending` answer closes the served tools. It fails closed: a throwing `decode`, gate, or `encode`, and a decision that cannot be recorded, each deny. New `ServeToolsError` code `serve_tools_permission_conflict`; new exported types `PermissionRequest`, `PermissionDecision`, `PermissionCodec`, `ServeToolsPermissionTool`.
20
+ - `serveTools(run, options)` (plan 165 Task 4): bridge an allow-listed subset of a run's `ToolDefinition[]` to an external agent over the run's callback broker, so the vendor's own agent loop calls Prism tools through the same `tool.call` gate the internal loop uses. `tools/list` lists `prefix + name`; `tools/call` runs `bridgeTools` → `executeTools`, maps the `ToolResult` to MCP `content` (redacted by the kernel, truncated to `limits.resultBytes`), and returns `isError` with the deny text for a denied or approval-pending result. Static `resources` are served bounded to 256 KiB. Two transports: `loopback-http` (`endpoint.url` = `broker.url + "/mcp"`, token in `env[headerEnv]`) and `stdio-relay` (`endpoint` spawns `prism relay mcp --run <dir>`). `limits.maxConcurrentCalls` bounds in-flight calls (a call over the cap is a JSON-RPC error, never queued); `close()` unregisters the route, runs on `run.signal` abort and after an `approval_pending`, and a late call is refused. New `ServeToolsError` codes `serve_tools_empty`, `serve_tools_transport`, `serve_tools_resource_bytes`.
21
+ - `serveMcp(agent, options)` and `mcpHost()` (plan 161 Task 5): serve a Prism agent over MCP as one `prompt` tool (`toolName` to rename) plus `agent.commands` as MCP prompts. Exactly one transport — `{ stdio: true }`, `{ transport }`, or `{ http }` — over the existing `servePrismMcpStdio`/`createPrismMcpWebHandler` helpers. Approvals suspend (`interactive: false`) and resume through the SDK's multi-round-trip `input_required` elicitation when the client advertises `elicitation.form`; without elicitation the call fails closed with `ERR_PRISM_MCP_APPROVAL_REQUIRED` naming the pending approval.
22
+ - `servePrismMcpStdio` accepts a caller-owned `transport`, and both transport helpers take an `McpServerFactory` and forward its request context (era, authInfo).
23
+
24
+ ### Changed
25
+
26
+ - `serveTools`'s `ServeToolsHandle.tools` now also lists the permission tool name when `permissionTool` is set (plan 165 Task 5). `CallbackBroker.route("mcp", handler | undefined)` (plan 165 Task 4): `undefined` removes the route, so `serveTools.close()` can unregister it. The bound/redaction/truncation helpers moved to `src/bounds.ts` (`bounded`, `truncateUtf8`), shared by `serve`, `server`, and `serve-tools`. `serveMcp`'s doc comment now points at `serveTools`.
27
+ - `@arnilo/prism-mcp-server` (plan 159 Task 3): Host library serving Prism tools, resources, and prompts over MCP stdio and Streamable HTTP transports. Extracted from `@arnilo/prism-mcp` with 0.12 API intact (`createPrismMcpServer`, `createPrismMcpWebHandler`, `servePrismMcpStdio`).
28
+
29
+ ### Removed
30
+
31
+ - `createPrismMcpServer`, `CreatePrismMcpServerOptions`, `PrismMcpCacheHints`, `PrismMcpCacheableMethod`, `PrismMcpAgentRunExposure`, `PrismMcpResource`, `PrismMcpPrompt`, and `PrismMcpAuthorization.identity` (plan 161 Task 5). The server's direct `dispatchToolCall`/`assertPermission`/`createToolRegistry`/`createRunLimitTracker` path bypassed the run's approval and governance, so tool serving waits for `serveTools` (plan 165 Task 4, now shipped). The `@arnilo/prism-governance` dependency is gone: identity enforcement belongs to the agent's own governance hooks, and `authorize` stays.
32
+
33
+ ## [0.1.0] - 2026-08-09
34
+
35
+ ### Added
36
+
37
+ - Lockstep package scaffold.
38
+
39
+ ## [0.0.28] - 2026-08-08
40
+
41
+ ### Added
42
+
43
+ - Lockstep package scaffold.
44
+
45
+ ### ./acp history
46
+
47
+ ## [Unreleased]
48
+
49
+ ### Added
50
+
51
+ - `@arnilo/prism-acp`: `serveAcp(agent, …)` and `acpHost()` (plan 161 Task 2). Serves an existing agent over ACP v1. Approvals suspend and resume through `session/request_permission`.
52
+
53
+ ## [0.1.0] - 2026-08-09
54
+
55
+ ### Added
56
+
57
+ - Lockstep package scaffold.
58
+
59
+ ## [0.0.28] - 2026-08-08
60
+
61
+ ### Added
62
+
63
+ - Lockstep package scaffold.
64
+
65
+ ### ./ag-ui history
66
+
67
+ ## [Unreleased]
68
+
69
+ ### Changed
70
+
71
+ - `createAgUiHandler(agent, options?)` now takes a Prism `Agent` and drives the public `Session` API (plan 161 Task 4): `threadId` selects `agent.session({ id, create: true })`, the run streams `session.stream(input, { interactive: false })`, a suspension ends in a `RUN_FINISHED` interrupt (one per pending decision), `resume` maps `ResumeEntry` (`status: "cancelled"` → `reject_once`, a resolved payload `{ outcome }`) to `session.resume(decisions)`, and a client disconnect aborts through `session.abort()`. `authorize` is now optional and defaults to deny.
72
+ - Moved to `packages/hosts/ag-ui` and ships TypeScript source (`exports: { ".": "./src/index.ts", "./renderer": "./src/renderer/index.ts" }`). No build step.
73
+
74
+ ### Removed
75
+
76
+ - `effect-recovery.ts` (`reconcileAppEffect`, `deriveAppEffectKey`, `hashJson`) and the `AgUiMcpAppHandlerOptions.effectStore`/`effectContext` claim path. The MCP Apps proxy no longer retries an approved UI mutation.
77
+ - The handler's `sessionFactory`, `lifecycle`, `resolveRun`, `interrupts`, `onSuspended`, `replay`, `mcp`, `input`, and `inputPolicy` options, and the `AgUiRunResolutionRequest`/`AgUiInterrupt*` types.
78
+ - The unused `AgUiProjection.lifecycle`/`fileDiff` hooks (no caller); the `@arnilo/prism-tools-coding` and `@arnilo/prism-governance` dependencies.
79
+ - The `./acp` subpath and `packages/ag-ui/src/acp/**` (plan 161 Task 3). ACP v1 serving moved to `@arnilo/prism-acp`: `serveAcp(agent, …)` and `acpHost()`, plus the event mapper. `createPrismAcpAgent`, `createAcpClientFilesystem`, `createAcpClientTerminals`, the modes/config/session-store seams, and the coding projection are gone.
80
+
81
+ ## [0.4.0] - 2026-09-01
82
+
83
+ - Plan 054: family ships as part of the 11-package 0.4 lockstep; peer `@arnilo/prism@^0.4.0`.
84
+
85
+ # Changelog
86
+
87
+ ## [0.3.0] - 2026-08-20
88
+
89
+ ### Added
90
+
91
+ - `createCodingToolProjection()` now projects successful `delete` and `move` results as bounded path locations; moves use destination metadata with a source fallback and never emit diffs.
92
+
93
+ ## [0.2.8] - 2026-08-18
94
+
95
+ ### Added
96
+ - ACP adoption fixes (plan 028): `createCodingToolProjection`, image `toolResult`, slash-command seam, usage/title/transcript seams, `ERR_PRISM_ACP_RUN`, `acpImageBytes`/`acpCommandsPerUpdate`.
97
+
98
+ ## [0.2.6] - unreleased
99
+
100
+ ### Added
101
+ - **Durable ACP run recovery** (plan 026 Task 5): optional `recovery` seam (`checkpoints` + `leases` + `ownerId`, all three together; partial config fails closed) plus the existing `sessionStore` persist a bounded `activeRun` ref on `PersistedAcpSession` (frozen 512-byte cap, additive optional field — 0.1.6 records remain readable) while a durable run is live: running on first event, suspended with the durable version on approvals, terminal on finish/deny/error. Restore re-attaches the ref; `createAcpRunRecovery` (new export) re-resolves it against `AgentRunLifecycle.status` — suspended runs preserve pending approval ids, terminal runs report terminal, unprovable in-flight streams report `unknown` (never a restarted prompt). Durable cancellation is ownership/version/fence checked, terminal/idempotent, aborts no unrelated run, and never replays a pending/dispatched tool; `session/cancel` writes the marker for restored runs (new `prism.coding-agent.cancel.v1` namespace, CAS + lease fenced). Errors `ERR_PRISM_RECOVERY_*`; corrupt/oversized refs and markers fail closed.
102
+
103
+ ## [0.1.6] - 2026-08-11
104
+
105
+ ### Changed
106
+ - **Durable ACP session store** (plan 018 closeout `acp-session-store`): additive host-owned `AcpSessionStore` seam on `CreatePrismAcpAgentOptions` (`save` on session/new + set_mode + set_config_option, lazy ownership-scoped `loadAll` once per agent instance, `evict` on close/delete). Persisted entry shape `{sessionId, ownership, modeId, configValues, cwd, additionalDirectories, updatedAt}` — never ephemeral stream state or pending decisions; restored entries re-validate modes/config options and cwd, drop corrupt/oversized entries fail-closed, keep the in-memory registry caps (32 default / 128 hard); cross-tenant restore refuses `ERR_PRISM_ACP_INPUT`; the whole entry rides the optional `SecretRedactor` at the save boundary. Absent seam = byte-identical 0.1.5 behavior.
107
+
108
+ ## [0.1.1] - 2026-08-10
109
+
110
+ ### Changed
111
+ - ACP modes/config persistence guidance ([docs/acp.md](acp/README.md) "Persistence and ownership"): the agent never persists `modeId`/`configValues`; host stores MUST key by `sessions.ownership` and refuse cross-tenant restores (`ERR_PRISM_ACP_INPUT`). New tests in `src/__tests__/acp-modes-config.test.ts`: ownership-scoped host-store refusal, agent-stays-thin regression guard, cross-tenant `authorize`-seam refusal.
112
+
113
+ ## [0.1.0] - 2026-08-09
114
+
115
+ ### Changed
116
+ - Released with exact 0.1.0 graph.
117
+
118
+ ## [0.0.28] - 2026-08-08
119
+
120
+ ### Changed
121
+ - Released with exact 0.0.28 graph.
122
+
123
+ ## [0.0.27] - 2026-08-07
124
+
125
+ ### Added
126
+ - Truthful ACP capability negotiation (Phase 10): `resolveAcpAgentCapabilities(options)` — pure, O(1) function of host-wired seams; absent seam omits the capability key (never an empty stub). `loadSession` iff `sessions.load`, `sessionCapabilities.{list,delete,resume,additionalDirectories}` iff matching `sessions.*` seam, `promptCapabilities.{image,audio,embeddedContext}` iff `capabilities.prompt.{media,embedded}` gate, `mcpCapabilities.{http,sse}` iff `mcp.select` + matching `mcp.transports`; `close` always; UNSTABLE cells (`mcpCapabilities.acp`, `sessionCapabilities.fork`, `auth`, `providers`, `nes`, `positionEncoding`) never advertised. Client `fs`/`terminal`/`session.configOptions.boolean`/`elicitation` advertisements are read from the initialize request into a closed-default `ResolvedAcpClientCapabilities` that gates later client-method use.
127
+ - `createPrismAcpAgent` options `sessions`, `mcp`, `capabilities` (seam presence drives advertisement); `initialize` now returns `agentInfo.version` from the package.json (single version source via JSON import attribute, `resolveJsonModule`), replacing the stale hard-coded version.
128
+ - Client filesystem and terminal adapters (Phase 10): `createAcpClientFilesystem(client, sessionId, options?)` wraps `fs/read_text_file` / `fs/write_text_file` behind a minimal read/write interface (payloads capped at AG-UI `maxTextBytes`; `readTextFile`/`writeTextFile` option masks fail closed with `ERR_PRISM_ACP_CAPABILITY`). `createAcpClientTerminals(client, sessionId, options?)` maps `terminal/create|output|wait_for_exit|kill|release` onto `ProcessSession`-flavored semantics (pull-based; no stdin) with output payloads capped at the frozen Phase 9 `process.outputChunkBytes` constants (requested as client-side `outputByteLimit` and verified per response).
129
+ - `AcpCodingSeams` option on `createPrismAcpAgent` (`filesystem`/`processes` host factories) — the agent calls a seam only when the client advertised the matching capability at initialize, builds `AcpCodingContext` (`filesystem`/`processes` adapters), and passes it plus a pre-generated ACP `sessionId` to `sessionFactory` (id asserted on return when seams are wired, so `terminal/*`/`fs/*` requests correlate).
130
+ - `AcpError` with frozen codes `ERR_PRISM_ACP_INPUT` / `LIMIT` / `POLICY` / `CAPABILITY` / `MCP`; new dependency `@arnilo/prism-coding-agent` (workspace) for the Phase 9 output-chunk caps.
131
+ - ACP session lifecycle (Phase 10): `session/load`, `session/resume`, `session/list`, `session/delete` handlers wired only when the matching `sessions.*` seam exists (absent seam ⇒ method not registered). Load/resume register the binding in the session registry (bounded by new `acpSessions` cap, default 32/hard 128, fixing the unbounded Map) and accept the same `additionalDirectories` + `mcpServers` gates as `session/new`; list pages the host's ordered summaries with an opaque numeric cursor at `acpSessionListPage` (default 20/hard 100) and forwards the `cwd` filter.
132
+ - Session inputs (Phase 10): `session/new`/`load`/`resume` now validate client-supplied `additionalDirectories` (count + path-byte caps, policy seam returns the allowed subset; non-empty request without the advertised seam rejected `ERR_PRISM_ACP_POLICY`) and `mcpServers` (`validateMcpServers`: count/per-config/header-value caps, UNSTABLE `acp` transport rejected unconditionally, http/sse accepted only when advertised via `mcp.transports`, stdio accepted, all run through `mcp.select` before forwarding; nothing reaches the host unvetted). Policy-checked `cwd`, `additionalDirectories`, and approved `mcpServers` are forwarded to `sessionFactory`.
133
+ - New caps: `acpSessions` 32/128, `acpAdditionalDirectories` 8/32, `acpAdditionalDirectoryPathBytes` 4 KiB/16 KiB, `acpMcpServersPerSession` 8/32, `acpMcpServerConfigBytes` 16 KiB/256 KiB, `acpMcpHeaderValueBytes` 4 KiB/64 KiB, `acpSessionListPage` 20/100 (freeze `caps.acp`). `AcpSessionStoreSeams` finalized: `load`/`resume` take `{ sessionId, cwd, signal }`, `list` returns `AcpSessionSummary[]` (`{ sessionId, cwd, additionalDirectories?, title?, updatedAt? }`).
134
+ - Session modes (Phase 10): `modes: AcpModesSeam` option (`modes: AcpSessionMode[]` + optional `defaultModeId`, defaulting to the first mode) — `session/new`, `load`, and `resume` return `SessionModeState`; `session/set_mode` validates the id (unknown ⇒ `ERR_PRISM_ACP_INPUT` fail-closed), runs the host `apply` hook (`{ sessionId, fromModeId, modeId, signal }` — a pure host-side contribution overlay over its own tools/write/approval policy; no ACP-only policy engine), persists the mode per session, and emits `current_mode_update`. Tables bounded at `acpModesPerSession` 16/64, duplicate ids and unknown defaults rejected at creation.
135
+ - Session config options (Phase 10): `configOptions: AcpConfigOptionsSeam` option — returned on `new`/`load`/`resume` only when the client advertised `session.configOptions.boolean` at initialize (else omitted; `session/set_config_option` rejects with `ERR_PRISM_ACP_CAPABILITY`); values validated against the declared `boolean`/`select` type (unknown id/value ⇒ `ERR_PRISM_ACP_INPUT`), `onChange` hook runs after validation, the full set with `currentValue` is returned and broadcast as `config_option_update`. Tables bounded at `acpConfigOptions` 16/64, duplicate ids rejected at creation.
136
+ - Rich prompt content (Phase 10): `projectAcpPrompt` replaces the text-only prompt guard — text + `resource_link` baseline always accepted (links become `[resource_link: name (uri)]` markers), `image`/`audio` blocks accepted only when the agent advertised `promptCapabilities.image/audio` (host `capabilities.prompt.media` seam) and the live policy re-approves, `resource` embedded blocks only with `embeddedContext` (text resources join the prompt text, blobs become media parts); MIME prefix (`image/*`, `audio/*`), base64 shape, part count (`maxInputMediaParts` 16/64), and decoded byte budget (`maxInputMediaBytes` 64 KiB/1 MiB) are validated fail-closed with `ERR_PRISM_ACP_CAPABILITY`/`POLICY`/`LIMIT`/`INPUT`; `session/prompt` now streams a prism user `Message` (text + media content blocks) instead of a plain string, so media reaches the host session.
137
+ - Tool-call diffs and locations (Phase 10): `AgUiProjection` gains `toolLocations`/`toolDiff` allow-list hooks (default omit); the ACP mapper attaches `locations` (count-capped at `acpLocationsPerUpdate` 32/128, invalid entries dropped) and one `diff` content block (redacted, byte-capped at `acpDiffBytes` 64 KiB/1 MiB) to `tool_call_update` — never raw tool I/O. Available-commands/plan updates stay omitted (no frozen consumer).
138
+ - Coding lifecycle → ACP updates (Phase 10): `createAcpLifecycleMapper` + `AcpLifecycleMapper` (freeze `lifecycleEventMapping`): `file_changed` → locations-only `tool_call_update` (dropped without the event's `toolCallId`; diff only via the new `AgUiProjection.fileDiff` allow-list, capped at `acpDiffBytes`); `worktree_changed` + `process_started`/`exited`/`killed` → `agent_message_chunk` only via the new `AgUiProjection.lifecycle` allow-list (deny-by-default); `permission_denied` → `tool_call_update` status failed (never raw args; synthesized `prism:denied:<approvalId>` id when untargetable); `configuration_changed` → agent-wired `config_option_update` broadcast with the full per-session set. `AcpCodingSeams.lifecycle` accepts the host `CodingLifecycleEmitter`; updates are delivered only to sessions with an active prompt stream and count against that session's shared per-run notification budget.
139
+ - Elicitation (Phase 10): when the client advertised `elicitation` at initialize and the suspension is an all-elicitation batch, each pending decision surfaces as `elicitation/create` (form mode, bounded schema + redacted reason); accept carries the typed payload as `Decision.elicitation`, decline/cancel/errors deny (`reject_once`) — no widening of the approval vocabulary. Without the advertisement, elicitation decisions stay on the shared approval path (four options). Permission parity unchanged and locked by existing tests: four-outcome mapping, sticky `allow_for_run`/`reject_for_run`, cancel → deny, unrecognized ids deny.
140
+ - Conformance, smoke, example, benchmarks (Phase 10): `scripts/phase10-conformance.test.mjs` (in `npm test`) runs a composed scenario (initialize matrix, session/new with dirs+MCP+modes+config, fs/terminal client methods, lifecycle updates, four-outcome permission, mode/config switches, duplicate-resume rejection, reconnect load/resume, list paging, delete) plus adversarial cases (unadvertised methods → method-not-found, UNSTABLE acp MCP transport, host select denial, oversize config, garbage cursor, unknown mode, oversize media, secret redaction) over the real `@arnilo/prism-ag-ui/acp` subpath. `scripts/acp-client-smoke.mjs` is an operator-gated real-transport smoke (`PRISM_TEST_ACP_CLIENT=1`; fails closed without it) that drives the agent over the SDK's ndJsonStream stdio transport — read-only prompt, one edit via `allow_once`, narrowing mode switch, reconnect load — with policy never disabled. `examples/acp-coding-host.ts` demonstrates the full host seam set (runs in the demo gate). `scripts/benchmark-0.0.27.mjs` records p95 for fs round trip, terminal chunk ack, mode switch, prompt first update, and prompt end; `scripts/budgets.json` gains the `phase10` section (freeze p95Targets) and `budget-gate.test.mjs` checks the recorded `scripts/benchmark-0.0.27.json` evidence.
141
+ - Documentation (Phase 10): new `docs/acp.md` is the full ACP coding-host reference (seam = capability, event mapping table, caps, security); `docs/ag-ui.md` shrinks ACP to a summary + link; `docs/migration.md` gains the 0.0.26 → 0.0.27 section; `docs/index.md` lists ACP under frontend interoperability; `docs/agent-events.md`, `docs/coding-agent-tools.md`, `docs/coding-security.md`, `docs/mcp-tools.md`, `docs/host-security.md` gain ACP pointers; package README ACP section updated.
142
+ - A2UI renderer core values exported from the `@arnilo/prism-ag-ui/renderer` subpath entry (host FR): `A2UiSurfaceState`, `reduceA2UiOps`, `readA2UiBatch`, `resolvePointer`, `A2UI_VERSION` — framework hosts can drive the validated DOM-free surface state machine without mounting a renderer or importing `dist/` directly; `createA2UiRenderer` behavior and the frozen A2UI limits unchanged.
143
+
144
+ ## [0.0.26] - 2026-08-06
145
+
146
+ ## [0.0.26] - 2026-08-06
147
+
148
+ ### Added
149
+ - `createReasoningEncryptedValue` (FR-3): bounded `AgUiReasoningProjection.encryptedValue` fragment for the `reasoning` projection callback from a host-owned `encrypt` function; fails closed on missing/throwing/non-string `encrypt`, never infers an encrypted value from a Prism reasoning signature, truncates to `maxBytes` (default `DEFAULT_MAX_REASONING_BYTES`, clamped to `HARD_MAX_REASONING_BYTES`). See [ag-ui docs](ag-ui/README.md).
150
+ - MCP Apps UI-initiated mutation retry (FR-4): `createAgUiMcpAppHandler` accepts optional `effectStore` + `effectContext`; every approved `tools/call` records `begin` → `markDispatched` → `complete`/`fail`/`markUnknown` (abort/transport loss → `unknown`). New `reconcileAppEffect` / `deriveAppEffectKey` / `hashJson` exports let the host resolve unknown records against the actual outcome (claim/CAS); retries replay completed results idempotently, other states fail closed with `409` until reconciled. The proxy never auto-retries; absent `effectStore` keeps 0.0.25 behavior.
151
+ - A2A server-side exposure (Task 13): `createAgUiA2AServer({ card, authorize, sessionFactory, input?, projection?, redactor?, a2ui?, durable?, tasks?, push?, parts?, endpointPath?, limits?, a2aLimits?, selectTaskId? })` fronts a local AG-UI agent as an A2A 1.0 server over supervisor's `createA2AHandler`; `SendMessage`/`SendStreamingMessage` stream text/activity/state as bounded artifact updates with a terminal task; `run.suspended` → `TASK_STATE_INPUT_REQUIRED`; bounded live task registry for `GetTask`/`ListTasks`/`CancelTask`; optional `durable` replays finished runs from an `AgentEventSource` with cursor event ids; text parts become the AG-UI user message and other parts arrive in `forwardedProps.a2a` for `input.project`. Lazy optional-peer import — the supervisor peer is required only when the factory is called. See [A2A interoperability](ag-ui/README.md).
152
+ - Reference frontend renderer (Task 14): new `@arnilo/prism-ag-ui/renderer` subpath export — `createA2UiRenderer({ stream, catalog?, limits?, onAction?, onError?, dom? })` consumes an AG-UI event stream (SSE or in-memory `AsyncIterable`) and renders `a2ui-surface` snapshots/deltas into DOM surfaces from a host component catalog. DOM-free `reduceA2UiOps` core (surface/component/data-model state machine, JSON-Pointer bindings, snapshot replace / delta append); thin DOM binding with a built-in default Text/Container/Column/Row/Button catalog; server-side A2UI caps enforced client-side (ops/message, op bytes, surfaces/run, component depth); invalid/oversized ops drop closed with a bounded `prism.a2ui.error` event; unknown components render explicit placeholders; never executes remote HTML (no HTML-string assignment, no dynamic code evaluation). No new dependency, no host build step, no jsdom. See [ag-ui docs](ag-ui/README.md).
153
+
154
+ ### Changed
155
+ - Released with exact 0.0.26 graph.
156
+
157
+ ## [0.0.25] - 2026-08-06
158
+
159
+ ### Added
160
+ - Opt-in A2UI painting middleware (`a2ui` handler option) and standard projectors (`createMessagesFromSessionProjection`, `createStateFromStoreProjection`, `createActivityFromToolProgressProjection`, `composeAgUiProjections`).
161
+ - Batch interrupt/resume via shared `Decision[]`; ACP four-outcome permission mapping.
162
+
163
+ ### Changed
164
+ - Publishable graph remains **47** manifests at **0.0.25**; peers and lockfile move together.
165
+
166
+ See [migration guide](../../docs/migration.md) for the 0.0.24 → 0.0.25 notes.
167
+
168
+ ## [0.0.24] - 2026-08-04
169
+
170
+ ### Added
171
+ - Durable `AgentEventSource` (memory + PostgreSQL LISTEN/NOTIFY), recoverable `ToolEffectStore`, and AG-UI MCP/MCP Apps/A2A fronting for Phase 7.
172
+
173
+ ### Changed
174
+ - Publishable graph remains **47** manifests at **0.0.24**; peers and lockfile move together.
175
+
176
+ See [migration guide](../../docs/migration.md) for the 0.0.23 → 0.0.24 notes.
177
+
178
+ ## [0.0.23] - 2026-08-03
179
+
180
+ ### Changed
181
+ - Released with exact 0.0.23 graph.
182
+
183
+ ## [0.0.22] - 2026-07-31
184
+
185
+ ### Changed
186
+ - Released with exact 0.0.22 graph.
187
+
188
+ ## [0.0.21] - 2026-07-31
189
+
190
+ ### Changed
191
+ - Released with exact 0.0.21 graph.
192
+
193
+ ## [0.0.20] - 2026-07-31
194
+
195
+ ### Changed
196
+ - Released with exact 0.0.20 graph.
197
+
198
+ ## [0.0.19] - 2026-07-30
199
+
200
+ ### Changed
201
+ - Released with exact 0.0.19 graph.
202
+
203
+ ## [0.0.18] - 2026-07-30
204
+
205
+ ### Changed
206
+ - Released with exact 0.0.18 graph.
207
+
208
+ ## [0.0.17] - 2026-07-29
209
+
210
+ ### Changed
211
+ - Released with exact 0.0.17 graph.
212
+
213
+ ## [0.0.16] - 2026-07-26
214
+
215
+ ### Changed
216
+ - Released with exact 0.0.16 graph.
217
+
218
+ ## [0.0.15] - 2026-07-26
219
+
220
+ ## [0.0.14] - 2026-07-26
221
+
222
+ ### Added
223
+
224
+ - Co-work events: `mapCoWork` (AG-UI + ACP parity), co-work projection/replay, and handler co-work context threading for artifact progress/approval/download-link, connector drafts, and redacted browser snapshots (Plan 077 Task 4).
225
+
226
+ ## [0.0.13] - 2026-07-24
227
+
228
+ ### Changed
229
+
230
+ - Released with exact 0.0.13 graph.
231
+
232
+ ## [0.0.12] - 2026-07-22
233
+
234
+ ### Changed
235
+
236
+ - Released with exact 0.0.12 graph.
237
+
238
+ - Added optional bounded AG-UI event mapping over redacted Prism agent events.
239
+ - Added authorized Web handler, durable interrupt/resume, and redacted bounded replay adapters.
240
+ - Added stable ACP v1 sibling mapper and agent builder with bounded permission-to-resume flow.
241
+
242
+ ### ./channels history
243
+
244
+ ## [Unreleased] (Phase 10 Task 2)
245
+
246
+ ### Added
247
+ - `channelHostUi` routes confirm, select, input and notify requests to a consumed pairing with explicit authorization, bounded expiring waiters, CAS reply tokens and journaled prompt delivery. Input answers never enter the journal or an agent turn. Connections accept the existing runtime `limits`; `ChannelPairingStore.resolve` resolves confirmed pairing references.
248
+
249
+ ### Changed
250
+ - The `checkpoints`/`leases` store shapes this package accepts are declared locally in `src/checkpoint-contract.ts` instead of imported from `@arnilo/prism` (plan 168 Task 4), so channels gains no dependency on the workflows engine. Structural match with the `checkpoints`/`leases` service contracts, so the memory defaults, a store package's services, and the old kernel copies all satisfy them. No behavior change.
251
+ - **Direct Agent host bindings**: `connectTelegram(agent, options)` and `connectSignal(agent, options)` bind one host-configured Prism `Agent` directly to messaging channels, returning `{ handle(update), start(), close(), stop(), drain(options) }`.
252
+ - Chat bindings now run turns through `agent.session({ id })` via `session.run(text, { interactive: false })`.
253
+ - Suspended runs (`RunResult.pending`) prompt for operator approval via the approval store, and the chat response resolves the suspension via `session.resume(decisions, { interactive: false })`.
254
+ - Telegram bot tokens and Signal account credentials are now strict references (`env:` or `keyring:`); literal values throw `ChannelTokenLiteralError` (`ERR_PRISM_CHANNEL_TOKEN_LITERAL`). Secret values are automatically redacted from messages, errors, and traces.
255
+ - Package moved to `packages/hosts/channels` as a TypeScript-source package (`name: "@arnilo/prism-channels"`).
256
+
257
+ ### Removed
258
+ - `createMessagingRuntime`, `resolveAgent`, and agent aliases have been removed in favor of single-agent `connect*` bindings.
259
+ - `createAgentRunLifecycle` usage has been deleted.
260
+
261
+ ## [Unreleased] (plan 079 Task 4)
262
+
263
+ ### Added
264
+ - **New family package `@arnilo/prism-channels`**: the messaging-channel runtime moves out of `@arnilo/prism-core` into its own tarball so transports can grow without touching the core package's release cadence, export budget or peer set. The move is behavior-preserving: same export names, same semantics, same tests.
265
+ - Root export `.` ships the transport-neutral contracts, `createMessagingRuntime`, the durable journal (`createChannelStateStore`, `createChannelDeliveryJournal`), pairing (`createChannelPairingStore`), limits and the recovery API (`reconcile`/`listUnresolved`/`prune`).
266
+ - `./telegram` now ships `createTelegramAdapter` and `createTelegramWebhookHandler`: explicit lease-fenced long polling or host-mounted webhook admission, native-fetch plain-text sends, server-issued approval callback buttons, fixed endpoint/redirect protection, Unicode-safe chunks and ambiguous-delivery handling.
267
+ - `./signal` (experimental) ships `createSignalAdapter` plus `SIGNAL_CLI_VERSION`: a Node-only private-Unix-socket client for an externally supervised signal-cli v0.14.8 daemon (`subscribeReceive` / `unsubscribeReceive` / `send` only, manual `params.result.envelope` parsing). Construction rejects without an explicit operator acceptable-use/GPL `policy` attestation and a matching `signalCliVersion`; receipt waits for durable-writer readiness, admits only selected-account direct UUID text, pauses on account mismatch / storage / lease loss with bounded backoff reconnect, sends only to the authorized bound UUID with `/approve` / `/deny` command rendering, and never spawns, links, registers, trusts identities or opens TCP/HTTP.
268
+ - Durable one-use `allow_once` / `reject_once` controls resume one core pending decision through `AgentRunLifecycle.resumeStream`; exact principal, chat, session, run, approval id, version, current grant/agent revision and expiry are verified before side effects. `/status` survives a suspended restart and `/cancel` uses core terminal denial.
269
+ - Host examples and fault injection (Task 8): `examples/messaging-agent.ts` (sqlite + mock), Telegram webhook mount helper, SIGKILL restart worker, sqlite reopen/lease-fence/capacity end-to-end suite, and opt-in `telegram-live` / `signal-live` matrix probes that skip without operator credentials and never create contacts or accounts.
270
+ - Packaging/current-contract (Task 9): packed `.` / `./telegram` / `./signal` imports, root/telegram isolation from Signal socket code, no third-party peers, wiki-structured `/docs` pages and options-index entries.
271
+ - Peer `@arnilo/prism@^0.7.0` is the only runtime dependency: Prism primitives are consumed through the public entry, never through `@arnilo/prism-core` internals. `@arnilo/prism-core` is a dev dependency for the SQLite/PostgreSQL journal-conformance legs.
272
+ - Group and topic ownership (plan 080 Task 4): `TelegramAdapterOptions.allowGroups` (and the same option on `TelegramWebhookHandlerOptions`) opts group/supergroup text into parsing, with the signed group `chat.id` as `externalConversationId`, `from.id` as `externalActorId`, and `message_thread_id` as `threadId`. Chat titles, bots, `sender_chat` (channel posts/anonymous admins) and non-text updates stay dropped; forwarded messages are admitted but flagged in `claims`. Admission is still the host `authorize` decision on the exact observed `(chat, thread?, sender)`, replies post back to the bound topic, and Signal remains direct-message only.
273
+ - Streaming previews (plan 080 Task 5): `MessagingRuntimeOptions.onAssistantDelta` forwards the cumulative redacted assistant text of the running turn as `ChannelAssistantDelta`. The runtime only subscribes (bounded) when a host supplies the callback, so hosts that do not see no behavior change; previews stop at cancel/`stop()`, reset per assistant message, never enter the journal, and can never fail a turn. `TelegramAdapterOptions.sendDrafts` (default off) opts the Telegram subpath in: `TelegramAdapter.sendDraft` posts `sendMessageDraft` with a fixed per-chat draft id, one request in flight with the latest partial winning, text capped to the last 3,500 UTF-16 units, and skipped for group chats (Bot API drafts are private-chat only). The experimental Signal subpath has no draft equivalent and ignores the callback.
274
+ - Bounded attachments and voice (plan 080 Task 6): `ChannelInboundEvent.attachments` carries `ChannelAttachmentRef` values (`image` | `document` | `voice`, transport file id, optional mime/size/name) and `ChannelLimits.maxAttachmentBytes` (default 1 MiB, hard 4 MiB) bounds every fetch. The Telegram subpath parses `photo` (largest size), `voice` and `document` plus captions, resolves voice/document text through the host `transcribe`/`extractDocumentText` hooks before `admit`, and exposes `TelegramAdapter.fetchAttachment` (`getFile` + bounded download, redirects forbidden, token never logged) which the runtime calls as `MessagingRuntimeOptions.fetchAttachment` only for an event image when the resolved model declares `image` input. Declared sizes over the cap are denied `oversized` before a fetch, anything else unprocessable settles `unsupported_media` with a bounded notice and no model call, `synthesize` adds an optional `sendVoice` next to `final` text (OGG/OPUS, MP3, M4A; failures never fail the reply), and no media bytes, URLs or refs beyond the event reach the journal. Signal stays DM-text-only.
275
+ - Proactive opt-in notifications (plan 080 Task 7): `ChannelAction` adds `"notify"`, `ChannelAuthorization.notifications` (missing = false) opts an actor into host notices, and `MessagingRuntime.notify` sends one `notice` to one already-bound conversation/thread pair. It never runs the agent, never allocates a binding, never enqueues a turn and never broadcasts: `authorize` is called with `action: "notify"` and empty text, the grant's alias must match the binding, the caller identity's principal and ownership scope must match the grant, and the existing binding is loaded (never created). The notice is redacted, bounded by the reply cap, journaled as an operation of kind `notify` with the caller `notifyId` as the idempotency key (no cursor move; a repeat is a duplicate) and staged through the same reply journal as an answer, so delivery failures stay recorded instead of retried. Several bindings for one pair resolve to the current alias selection and otherwise fail closed; unbound, foreign, revoked, ungranted and capacity-denied cases produce a bounded reason. Signal stays unicast to an existing DM binding.
276
+
277
+ ### Removed
278
+ - `@arnilo/prism-core/integrations/channels` — the subpath and its 25+38 exports are gone from `@arnilo/prism-core`; use `@arnilo/prism-channels`.
279
+
280
+ ## [0.7.0] - 2026-09-15 (plan 079 Tasks 2–3, as `@arnilo/prism-core/integrations/channels`)
281
+
282
+ - Transport-neutral messaging runtime, durable bindings/journal/pairing, SQLite+PostgreSQL conformance (35 tests). Moved to this package by plan 079 Task 4.
283
+
284
+ ### ./evals history
285
+
286
+ All notable changes to `@arnilo/prism-evals` will be documented in this file.
287
+
288
+ ## [Unreleased]
289
+
290
+ - **Host library `@arnilo/prism-evals`**: evaluations machinery moved out of `@arnilo/prism-core/governance/evals` into `packages/hosts/evals` as a host library.
291
+ - **Controlled failure injection reshaped**: `wrapAgentWithFailureInjection` deleted in favor of `failureInjection(options)` (`AgentConfig.hooks` function using `tool.call` deny and `tool.execute` around for unknown-effect) and `failingStore(store)` wrapping `SessionStore`.
292
+ - **Factory-based scenario runner**: `runScenario` supports host agent factories `(extra) => createAgent({ ...extra })`, avoiding agent construction or object spread inside evals.
293
+
294
+ ## [0.1.0] - 2026-08-09
295
+
296
+ ### Added
297
+
298
+ - Lockstep package scaffold.
299
+
300
+ ## [0.0.28] - 2026-08-08
301
+
302
+ ### Added
303
+
304
+ - Lockstep package scaffold.
305
+
306
+ ### ./devtools history
307
+
308
+ All notable changes to `@arnilo/prism-devtools` will be documented in this file.
309
+
310
+ ## [Unreleased]
311
+
312
+ - **Host library `@arnilo/prism-devtools`** (plan 162 Task 4): the developer inspector moved out of `@arnilo/prism-coding-tools/dev` into `packages/hosts/devtools`. `serveDevtools(agent, { port, hostname, token })` serves the page and its JSON routes on `Bun.serve` over the public `Agent` API.
313
+ - **`prism-devtools` bin**: serves a manifest-built agent (`--root`, `--model provider/model`, `--trust-project`, `--port`) on loopback.
314
+ - **Security**: loopback by default; a non-loopback `hostname` requires a `token` ref (`env:NAME`); a literal token is refused; a bearer token guards every route when set; every JSON body and SSE event passes the agent's redactor.
315
+ - **Removed from the 0.12 inspector**: the `prism dev` subcommand, `createPrismDevInspector`, `createDevRouter`, `runDevCli`, the `PrismRequestHandler` dependency, the prompt and decision panels, and the timeline panel (the projector stays in `@arnilo/prism-core` until Phase 16). No alias is kept.
316
+
317
+ ## [0.1.0] - 2026-08-09
318
+
319
+ ### Added
320
+
321
+ - Lockstep package scaffold.
322
+
323
+ ## [0.0.28] - 2026-08-08
324
+
325
+ ### Added
326
+
327
+ - Lockstep package scaffold.
328
+
329
+ ### ./remote history
330
+
331
+ ## [Unreleased]
332
+
333
+ - Added optional host-owned `resumeAuthority` for coordination with other resume entry points.
334
+
335
+ ### Added
336
+
337
+ - `@arnilo/prism-remote`: protocol `prism.remote/1` (JSON-RPC 2.0 method table, capability negotiation, bounded frame dispatcher, memory and stdio transports) (plan 170 Task 2).
338
+ - `@arnilo/prism-remote`: `serveAgent` and `remoteHostUi` — sessions, runs, steering, commands, and durable suspension on disconnect (plan 170 Task 3).
339
+ - `@arnilo/prism-remote`: `connectAgent` — an `Agent` proxy over stdio or an in-process transport, with `origin.remote` attribution, `executedBy: "external"` tool events, local `host.ui` routing, and optional session mirroring (plan 170 Task 4).
340
+
341
+ ## [0.1.0] - 2026-08-09
342
+
343
+ ### Added
344
+
345
+ - Lockstep package scaffold.
346
+
347
+ ## [0.0.28] - 2026-08-08
348
+
349
+ ### Added
350
+
351
+ - Lockstep package scaffold.
352
+
353
+ ### ./headless history
354
+
355
+ ## [Unreleased]
356
+
357
+ ### Added
358
+
359
+ - Added a `command` scheduler target: `{ kind: "command", agent, command, input }` runs one registered package command on the schedule session with no model turn, no prompt, and no agent loop, so a maintenance-style pass (`memory:maintain`) can be scheduled like any other job. The firing status comes from the command's result (`status` from the run vocabulary, else `ok: false` ⇒ `failed`, else `completed`); a throw records `failed` without persisting the error or the result. Registration fails closed with the new `unknown_command` when the command is not registered on the target agent.
360
+
361
+ - Added `resumeWhenAnswered`, `createResumeAuthority`, authoritative branch-tip recovery, and guarded remote/router resume composition.
362
+
363
+ ### Added
364
+
365
+ - Ordered `routeHostUi` routing with explicit kind limits, timeouts, a fail-closed `policyDefault`, and bounded, value-free answer logging with optional ownership-scoped checkpoint persistence.
366
+
367
+ ### ./host-builder history
368
+
369
+ All notable changes to `@arnilo/prism-host-builder` will be documented in this file.
370
+
371
+ ## [Unreleased]
372
+
373
+ - **Host library `@arnilo/prism-host-builder`** (plan 215 Task 14): version-exact reference indexes for building a Prism host. `data/api.json` lists every public name per package and `exports` subpath with its kind, signature, summary, the docs that mention it and the examples that import it. `data/errors.json` lists the `ERR_PRISM_*` codes and the short error codes with their owner, declaration, class, meaning and a sample message. `data/examples.json` lists the CI-tested examples, and `data/examples/` holds their sources. `bun scripts/host-builder-index.mjs` regenerates them from the same declaration model the compat gate uses; `--check` fails on stale data.
374
+ - **Interface and class members in the API index** (plan 215 Task 20): `data/api.json` entries for interfaces and classes carry `members` (field and method declarations, comments removed, at most 60 per type), and `prism_api` returns them. The Task 20 evaluation showed builders guessed field names such as `call.arguments` for `call.args`, because the index held only `export interface X`. The skill gained a "Mistakes the compiler cannot catch" section (a host that runs tools needs a `principal`; deleting a retired field is not an upgrade; types are not behavior), the upgrade map gained the `extensions`, `identity`, `store`, `provider`/`model` and `tools.use` rows (and no longer calls `identity` a valid config name), and `recipes.md` gained a coding-tools recipe.
375
+ - **Skill `prism-host-builder`** (plan 215 Task 15): `skills/prism-host-builder/SKILL.md` and seven references (`choosing`, `layout`, `recipes`, `pitfalls`, `security`, `verification`, `upgrading`) for a coding agent that builds, changes, upgrades or debugs a host. Judgment and pointers only; every doc, example and error-code reference is checked by `host_builder_kit_matches_surface`, and the skill passes `package_skills_conform`. The package does not register it into agents.
376
+ - **MCP server** (plan 215 Task 16): `prism-host-builder mcp [--root <dir>] [--allow-version-mismatch]` serves four read-only tools (`prism_api`, `prism_errors`, `prism_examples`, `prism_docs`), `prism-docs://` resources for the installed docs and READMEs, and the `build-host`, `add-capability` and `upgrade-host` prompts over stdio. Each tool call fails with `ERR_PRISM_HOST_BUILDER_VERSION` when the installed `@arnilo/prism` is not the indexed version (or warns with `--allow-version-mismatch`). Results are bounded at 64 KiB and marked when cut. New dependencies `@modelcontextprotocol/server` and `zod`, the same versions `@arnilo/prism-mcp-server` pins.
377
+ - **`prism-host-builder` bin**: `info` prints the Prism version and the size of each index; `--help` prints usage; an unknown command exits 2.
378
+ - **API**: `loadHostBuilderIndex(name)` loads an index lazily and caches it; `readExampleSource(path)` returns an indexed example's source and refuses a path the index does not list.
379
+ - **Host checks** (plan 215 Task 17): `prism-host-builder mcp` takes `--entry <file>#<export>` and `--package <file>#<export>` (repeatable), `--trust-project`, `--check-timeout <seconds>` (default 30, at most 120) and `--pass-env <NAME>`, and serves three tools that run the host's own code in one bounded `bun` child process: `prism_inspect_host` (returns `agent.inspect()` and disposes the agent), `prism_check_manifest` (what `prism verify` does; project packages are imported only with `--trust-project`) and `prism_check_package` (`packageConformance`). Targets come only from the start flags and must resolve inside `--root` (`ERR_PRISM_HOST_BUILDER_ENTRY`, exit 1). The child sees `PATH`, `HOME`, `TMPDIR`, `PRISM_HOME`, the `--pass-env` names and `PRISM_HOST_BUILDER_CHECK=1`; results and each output stream are capped at 1 MiB, the process group is killed on timeout and after exit, and `--pass-env` values are masked. A factory that runs a session or makes an outbound request fails with `ERR_PRISM_HOST_BUILDER_CHECK_MODEL_CALL`. The four lookup tools stay read-only; the server now lists seven tools.
380
+ - **Installer** (plan 215 Task 18): `prism-host-builder install --target <claude|codex|cursor|agents|prism> [--mcp] [--root <dir>] [--force] [--dry-run]` copies `skills/prism-host-builder/` into the target's project skill directory (`.claude/skills`, or `.agents/skills`, which Codex, Cursor and Prism's `contextFiles` also read) and writes a `.prism-host-builder.json` stamp (version, content hash, file list). A re-install of the same version is a no-op; a newer version replaces the copy only while its files still match the stamp, otherwise `ERR_PRISM_HOST_BUILDER_INSTALL_CONFLICT` unless `--force`. With `--mcp`, a JSON target (`.mcp.json`, `.cursor/mcp.json`) gets `prism: { command: "bunx", args: ["prism-host-builder", "mcp"] }` merged under `mcpServers` with the file's own indent; the Codex TOML config is printed, not written; the `prism` target prints the `contextFiles` and `@arnilo/prism-mcp` packages a Prism builder agent lists. Every path is realpath-checked inside `--root` (`ERR_PRISM_HOST_BUILDER_INSTALL_ROOT`), a malformed config is refused (`ERR_PRISM_HOST_BUILDER_INSTALL_CONFIG`), conflicts are found before the first write, nothing global is touched and no package manager runs.
381
+
382
+ ### ./driver-process history
383
+
384
+ ## [Unreleased]
385
+
386
+ - Add `extendAdapter` with explicit function replacement/wrapping, shallow data merges, narrowing-only auth policy, and complete inspection ancestry (plan 166 Task 7).
387
+
388
+ - Add bounded process abort ladders, graceful transcript flushing, store/vendor/none resume strategies, and binary-major/adapter-revision checks; make stdin disposal safe after child shutdown (plan 166 Task 6).
389
+
390
+ - Add the adapter contract, process-driver package, per-run materialization and broker pipeline, JSONL transport, and inspection metadata (plan 166 Task 3).
391
+
392
+ - Route gating, stop continuations, steering, unmapped capture, and vendor limit classification through shared ordered run state (plan 166 Task 4).
393
+
394
+ - Add JSON-RPC stdio transport, ordered initialization and result decoding, bounded concurrent server requests, gated approvals/client tools, and host UI routing (plan 166 Task 5).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Prism contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,35 @@
1
- # Temporary Holding Version
1
+ # @arnilo/prism-hosts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Prism host libraries and the process driver. Versions stay in lockstep with `@arnilo/prism` because the host-builder indexes describe that exact kernel version.
4
+
5
+ ```sh
6
+ bun add @arnilo/prism @arnilo/prism-hosts
7
+ bunx --package @arnilo/prism-hosts prism-host-builder install --target agents
8
+ bunx --package @arnilo/prism-hosts prism-devtools --model provider/model
9
+ ```
10
+
11
+ Import only the subpath your host uses; there is no root barrel.
12
+
13
+ | Subpath | Purpose |
14
+ | --- | --- |
15
+ | [acp](acp/README.md) | Agent Client Protocol |
16
+ | [ag-ui](ag-ui/README.md), `ag-ui/renderer` | AG-UI serving and reference renderer |
17
+ | [channels](channels/README.md), `channels/telegram`, `channels/signal` | Messaging channels |
18
+ | [devtools](devtools/README.md) | Local developer inspector |
19
+ | [evals](evals/README.md) | Datasets, scorers and experiments |
20
+ | [headless](headless/README.md) | HostUi routing and durable scheduling |
21
+ | [host-builder](host-builder/README.md) | Version-exact indexes, skill and MCP server |
22
+ | [mcp-server](mcp-server/README.md) | MCP stdio and HTTP serving |
23
+ | [remote](remote/README.md), `remote/testing` | Remote agent serving and clients |
24
+ | [driver-process](driver-process/README.md), `driver-process/testing` | External-agent process driver and conformance |
25
+
26
+ Protocol SDKs are optional peers. Install them for the entrypoint your host uses:
27
+
28
+ | Entry | Peers | Installed size |
29
+ | --- | --- | --- |
30
+ | `acp` | `@agentclientprotocol/sdk@1.4.0` | 5.8 M |
31
+ | `ag-ui` | `@ag-ui/core@1.0.4`, `zod@^4.6.6` | 1.1 M + 6.1 M |
32
+ | `ag-ui/renderer` | `@ag-ui/core@1.0.4` | 1.1 M |
33
+ | `mcp-server`, host-builder MCP command | `@modelcontextprotocol/server@^2.3.0`, `zod@^4.6.6` | 7.0 M + 6.1 M |
34
+
35
+ Protocol entrypoints require their peers and fail at import if they are absent. The host-builder `info`, `install` and `help` commands and devtools work without those peers. Importing `headless` loads no protocol SDK. The required extensions bundle supplies workflows, codecs and observability. The bundle has no install script.
package/acp/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # @arnilo/prism-hosts/acp
2
+
3
+ Host library that serves one existing Prism `Agent` over ACP v1. It does not construct an agent.
4
+
5
+ ## What it does
6
+
7
+ `serveAcp(agent, options)` speaks ACP on stdio or an in-memory `Stream`. Prompts call `session.stream` with `interactive: false`. An approval suspends the run. The library sends one `session/request_permission` per pending decision and continues with `session.resume`.
8
+
9
+ `acpHost()` is the optional `HostPort` for package `host.ui` requests. Kernel asks (no `package` field) answer `unavailable`, so they take the permission path instead of a boolean confirm.
10
+
11
+ ## When to use it
12
+
13
+ A process that already has an `Agent` and needs an ACP client (an editor, a test, the retired `prism` ACP adapter) to drive it.
14
+
15
+ ## Inputs / request
16
+
17
+ ```ts
18
+ serveAcp(agent, { stdio: true });
19
+ serveAcp(agent, { stream, authorize? });
20
+ ```
21
+
22
+ `authorize` returning false is a JSON-RPC error. No session is created. The default allows the peer.
23
+
24
+ `session/new` and `session/load` accept `mcpServers: []`. A non-empty list is a JSON-RPC error and creates no session. This library does not advertise `mcpCapabilities`.
25
+
26
+ ## Outputs / response / events
27
+
28
+ `serveAcp` returns `{ closed, close() }`. A prompt resolves with an ACP `StopReason`:
29
+
30
+ | Run | StopReason |
31
+ | --- | --- |
32
+ | completed, or no finish reason | `end_turn` |
33
+ | `token_limit` | `max_tokens` |
34
+ | `turn_limit` | `max_turn_requests` |
35
+ | `refusal`, `denied` | `refusal` |
36
+ | `hook_stop`, `hook_limit` | `end_turn` |
37
+ | abort or `session/cancel` | `cancelled` |
38
+ | failed | JSON-RPC error, not a fake `end_turn` |
39
+
40
+ Approval kinds:
41
+
42
+ | ACP `kind` | `ApprovalOutcome` |
43
+ | --- | --- |
44
+ | `allow_once` | `allow_once` |
45
+ | `allow_always` | `allow_for_run` |
46
+ | `reject_once` | `reject_once` |
47
+ | `reject_always` | `reject_for_run` |
48
+ | cancelled, unknown option | `reject_once` |
49
+
50
+ HostUi kind:
51
+
52
+ | Kind | ACP |
53
+ | --- | --- |
54
+ | kernel ask `confirm` (no `package`) | `unavailable`, then `session/request_permission` |
55
+ | package `confirm` / `select` / `input` | `elicitation/create` when the client advertised elicitation, else `unavailable` |
56
+ | `notify` / `open-url` | `session/update` text |
57
+ | `secret` / `terminal` | `unavailable` |
58
+ | unbound session | `unavailable` |
59
+
60
+ ## Implementation example
61
+
62
+ ```ts
63
+ import { createAgent } from "@arnilo/prism";
64
+ import { acpHost, serveAcp } from "@arnilo/prism-hosts/acp";
65
+ import approval from "@arnilo/prism-extensions/approval";
66
+
67
+ const agent = await createAgent({
68
+ model,
69
+ packages: [approval({ mode: "ask" })],
70
+ host: acpHost(),
71
+ });
72
+ const server = serveAcp(agent, { stdio: true });
73
+ await server.closed;
74
+ ```
75
+
76
+ ## Security and performance notes
77
+
78
+ Unknown session, rejected or cancelled permission, a client without elicitation, and `authorize: false` fail closed. Nothing is allowed by default. Package titles and elicitation text are sent as plain text. Events pass through the agent's redactor.
79
+
80
+ No work per connection beyond the agent's own runs. Notification text is capped at 64 KiB (`maxTextBytes`). A prompt stops forwarding after 10,000 updates (`maxStreamEvents`). Load replays at most 100 message chunks (`maxReplayEvents`). Diffs are capped at 64 KiB, images at 256 KiB, and command lists at 32. These are the `packages/ag-ui/src/limits.ts` defaults.
81
+
82
+ ## Related APIs
83
+
84
+ - `session.resume`: continues a suspended approval
85
+ - `@arnilo/prism-extensions/approval`: ask mode that suspends when the host cannot confirm inline
86
+
87
+ Protocol dependencies are optional peers of `@arnilo/prism-hosts`. Install `@agentclientprotocol/sdk@1.4.0`. Protocol entrypoints require these peers; see the [bundle dependency table](../README.md).