@botbotgo/agent-harness 0.0.475 → 0.0.476

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 (227) hide show
  1. package/README.md +3 -1234
  2. package/README.zh.md +3 -1191
  3. package/dist/acp.js +1 -1
  4. package/dist/api.js +1 -404
  5. package/dist/benchmark/checkpoint-resume-cost-benchmark.js +1 -55
  6. package/dist/benchmark/deepagent-local-model-benchmark.js +2 -35
  7. package/dist/benchmark/upstream-runtime-ab-benchmark.js +1 -179
  8. package/dist/cli/chat-interactive.js +25 -244
  9. package/dist/cli/chat-rendering.js +6 -100
  10. package/dist/cli/chat-stream.js +23 -512
  11. package/dist/cli/chat-ui.js +21 -199
  12. package/dist/cli/chat-workspace.js +2 -210
  13. package/dist/cli/main.js +21 -428
  14. package/dist/cli/managed-service-commands.js +9 -63
  15. package/dist/cli/managed-service.js +2 -137
  16. package/dist/cli/options-init-chat.js +1 -108
  17. package/dist/cli/options-runtime.js +1 -158
  18. package/dist/cli/options-serve.js +1 -282
  19. package/dist/cli/options.js +2 -19
  20. package/dist/cli/process-guards.js +1 -139
  21. package/dist/cli/request-tree.js +7 -296
  22. package/dist/cli/runtime-commands.js +12 -258
  23. package/dist/cli/runtime-output.js +16 -155
  24. package/dist/cli/server-commands.js +16 -270
  25. package/dist/cli/workspace.js +1 -67
  26. package/dist/cli.js +1 -7
  27. package/dist/client/acp.js +1 -1
  28. package/dist/client/in-process.js +1 -67
  29. package/dist/client/index.js +1 -2
  30. package/dist/client/types.js +0 -1
  31. package/dist/client.js +1 -1
  32. package/dist/contracts/core.js +1 -1
  33. package/dist/contracts/runtime-evaluation.js +0 -1
  34. package/dist/contracts/runtime-memory.js +0 -1
  35. package/dist/contracts/runtime-observability.js +0 -1
  36. package/dist/contracts/runtime-requests.js +0 -1
  37. package/dist/contracts/runtime-scheduling.js +0 -1
  38. package/dist/contracts/runtime.js +1 -27
  39. package/dist/contracts/types.js +1 -3
  40. package/dist/contracts/workspace.js +0 -1
  41. package/dist/flow/build-flow-graph.js +1 -50
  42. package/dist/flow/export-mermaid.js +2 -464
  43. package/dist/flow/export-sequence-mermaid.js +2 -325
  44. package/dist/flow/flow-graph-normalization.js +1 -214
  45. package/dist/flow/flow-graph-runtime.js +1 -107
  46. package/dist/flow/flow-graph-upstream.js +1 -494
  47. package/dist/flow/index.js +1 -3
  48. package/dist/flow/types.js +0 -1
  49. package/dist/index.js +1 -5
  50. package/dist/init-project.js +1 -1
  51. package/dist/knowledge/config.js +1 -32
  52. package/dist/knowledge/contracts.js +0 -1
  53. package/dist/knowledge/index.js +1 -2
  54. package/dist/knowledge/module.js +12 -909
  55. package/dist/knowledge/procedural/config.js +1 -125
  56. package/dist/knowledge/procedural/index.js +1 -2
  57. package/dist/knowledge/procedural/manager.js +9 -345
  58. package/dist/mcp.js +1 -2
  59. package/dist/package-version.d.ts +1 -1
  60. package/dist/package-version.js +1 -2
  61. package/dist/persistence/file-store.js +3 -758
  62. package/dist/persistence/sqlite-request-context-store.js +5 -54
  63. package/dist/persistence/sqlite-request-queue-store.js +10 -108
  64. package/dist/persistence/sqlite-runtime.js +1 -86
  65. package/dist/persistence/sqlite-store.js +62 -810
  66. package/dist/persistence/types.js +0 -1
  67. package/dist/projections/presentation.js +37 -206
  68. package/dist/projections/request-events.js +2 -502
  69. package/dist/projections/upstream-events.js +1 -201
  70. package/dist/protocol/a2a/http-discovery.js +1 -178
  71. package/dist/protocol/a2a/http-rpc.js +6 -622
  72. package/dist/protocol/a2a/http.js +1 -138
  73. package/dist/protocol/a2a/task-state.js +3 -317
  74. package/dist/protocol/acp/client.js +8 -294
  75. package/dist/protocol/acp/harness-client.js +1 -218
  76. package/dist/protocol/acp/http.js +5 -130
  77. package/dist/protocol/acp/server.js +1 -310
  78. package/dist/protocol/acp/stdio.js +2 -69
  79. package/dist/protocol/ag-ui/http.js +3 -378
  80. package/dist/protocol/mcp/server.js +1 -428
  81. package/dist/resource/backend/workspace-scoped-backend.js +1 -319
  82. package/dist/resource/isolation.js +1 -237
  83. package/dist/resource/mcp/tool-support.js +3 -296
  84. package/dist/resource/mcp-tool-support.js +1 -2
  85. package/dist/resource/providers/resource-provider.js +1 -215
  86. package/dist/resource/resource-impl.js +1 -3
  87. package/dist/resource/resource-types.js +0 -1
  88. package/dist/resource/resource.js +1 -1
  89. package/dist/resource/sources.js +1 -247
  90. package/dist/resource/tools/function-tool-resolver.js +2 -272
  91. package/dist/runtime/adapter/compat/deepagent-compat.js +1 -29
  92. package/dist/runtime/adapter/compat/openai-compatible.js +1 -55
  93. package/dist/runtime/adapter/direct-builtin-utility.js +2 -90
  94. package/dist/runtime/adapter/flow/execution-context.js +1 -71
  95. package/dist/runtime/adapter/flow/invocation-flow.js +8 -425
  96. package/dist/runtime/adapter/flow/invoke-runtime.js +1 -20
  97. package/dist/runtime/adapter/flow/stream-runtime.js +11 -1395
  98. package/dist/runtime/adapter/invocation-result.js +2 -473
  99. package/dist/runtime/adapter/local-tool-invocation.js +6 -638
  100. package/dist/runtime/adapter/middleware/context-hygiene.js +1 -83
  101. package/dist/runtime/adapter/middleware-assembly.js +5 -477
  102. package/dist/runtime/adapter/model/invocation-request.js +3 -183
  103. package/dist/runtime/adapter/model/message-assembly.js +1 -28
  104. package/dist/runtime/adapter/model/model-providers.js +23 -1115
  105. package/dist/runtime/adapter/model/prompted-json-tool-call-capture.js +1 -40
  106. package/dist/runtime/adapter/model/prompted-json-tool-policy.js +1 -22
  107. package/dist/runtime/adapter/resilience.js +1 -104
  108. package/dist/runtime/adapter/runtime-adapter-support.js +3 -141
  109. package/dist/runtime/adapter/runtime-shell.js +5 -166
  110. package/dist/runtime/adapter/stream-event-projection.js +2 -622
  111. package/dist/runtime/adapter/stream-text-consumption.js +1 -18
  112. package/dist/runtime/adapter/terminal-status.js +2 -67
  113. package/dist/runtime/adapter/tool/builtin-middleware-tools.js +6 -627
  114. package/dist/runtime/adapter/tool/declared-middleware.js +1 -154
  115. package/dist/runtime/adapter/tool/interrupt-policy.js +1 -34
  116. package/dist/runtime/adapter/tool/provider-tool.js +1 -25
  117. package/dist/runtime/adapter/tool/resolved-tool.js +1 -225
  118. package/dist/runtime/adapter/tool/tool-arguments.js +3 -486
  119. package/dist/runtime/adapter/tool/tool-hitl.js +1 -346
  120. package/dist/runtime/adapter/tool/tool-name-mapping.js +1 -128
  121. package/dist/runtime/adapter/tool/tool-output-artifacts.js +2 -88
  122. package/dist/runtime/adapter/tool/tool-replay.js +1 -37
  123. package/dist/runtime/adapter/tool-resolution.js +1 -86
  124. package/dist/runtime/adapter/upstream-configurable-keys.js +1 -2
  125. package/dist/runtime/agent-runtime-adapter.js +60 -2338
  126. package/dist/runtime/agent-runtime-assembly.js +7 -249
  127. package/dist/runtime/env/runtime-env.js +1 -62
  128. package/dist/runtime/harness/background-runtime.js +1 -8
  129. package/dist/runtime/harness/bindings.js +1 -58
  130. package/dist/runtime/harness/events/event-bus.js +1 -16
  131. package/dist/runtime/harness/events/event-sink.js +1 -61
  132. package/dist/runtime/harness/events/events.js +1 -80
  133. package/dist/runtime/harness/events/listener-runtime.js +1 -13
  134. package/dist/runtime/harness/events/runtime-event-operations.js +1 -9
  135. package/dist/runtime/harness/events/streaming.js +1 -100
  136. package/dist/runtime/harness/events/timeline.js +1 -52
  137. package/dist/runtime/harness/public-shapes.js +1 -186
  138. package/dist/runtime/harness/run/artifact-paths.js +1 -15
  139. package/dist/runtime/harness/run/governance.js +1 -295
  140. package/dist/runtime/harness/run/helpers.js +1 -71
  141. package/dist/runtime/harness/run/inspection.js +1 -409
  142. package/dist/runtime/harness/run/operator-overview.js +1 -80
  143. package/dist/runtime/harness/run/queue-diagnostics.js +1 -15
  144. package/dist/runtime/harness/run/recovery.js +1 -162
  145. package/dist/runtime/harness/run/resources.js +1 -60
  146. package/dist/runtime/harness/run/resume.js +1 -56
  147. package/dist/runtime/harness/run/routing.js +1 -48
  148. package/dist/runtime/harness/run/run-lifecycle.js +1 -66
  149. package/dist/runtime/harness/run/run-operations.js +1 -217
  150. package/dist/runtime/harness/run/run-queue.js +1 -43
  151. package/dist/runtime/harness/run/run-slot-acquisition.js +1 -157
  152. package/dist/runtime/harness/run/session-records.js +1 -97
  153. package/dist/runtime/harness/run/start-run.js +1 -120
  154. package/dist/runtime/harness/run/startup-runtime.js +1 -69
  155. package/dist/runtime/harness/run/stream-run.js +8 -1418
  156. package/dist/runtime/harness/run/surface-semantics.js +1 -79
  157. package/dist/runtime/harness/runtime-defaults.js +1 -39
  158. package/dist/runtime/harness/system/boundary-analysis.js +1 -234
  159. package/dist/runtime/harness/system/health-monitor.js +1 -258
  160. package/dist/runtime/harness/system/inventory.js +1 -129
  161. package/dist/runtime/harness/system/mem0-ingestion-sync.js +5 -345
  162. package/dist/runtime/harness/system/policy-engine.js +1 -175
  163. package/dist/runtime/harness/system/runtime-memory-candidates.js +4 -110
  164. package/dist/runtime/harness/system/runtime-memory-consolidation.js +1 -51
  165. package/dist/runtime/harness/system/runtime-memory-manager.js +10 -693
  166. package/dist/runtime/harness/system/runtime-memory-policy.js +1 -155
  167. package/dist/runtime/harness/system/runtime-memory-records.js +11 -577
  168. package/dist/runtime/harness/system/runtime-memory-sync.js +5 -206
  169. package/dist/runtime/harness/system/session-memory-sync.js +3 -113
  170. package/dist/runtime/harness/system/skill-requirements.js +1 -112
  171. package/dist/runtime/harness/system/store.js +9 -365
  172. package/dist/runtime/harness/tool-gateway/index.js +1 -2
  173. package/dist/runtime/harness/tool-gateway/policy.js +1 -45
  174. package/dist/runtime/harness/tool-gateway/validation.js +1 -176
  175. package/dist/runtime/harness/tool-schema.js +1 -3
  176. package/dist/runtime/harness.js +3 -1490
  177. package/dist/runtime/index.js +1 -3
  178. package/dist/runtime/layout/runtime-layout.js +1 -31
  179. package/dist/runtime/maintenance/checkpoint-maintenance.js +2 -178
  180. package/dist/runtime/maintenance/file-checkpoint-saver.js +1 -106
  181. package/dist/runtime/maintenance/runtime-record-maintenance.js +2 -169
  182. package/dist/runtime/maintenance/sqlite-checkpoint-saver.js +4 -289
  183. package/dist/runtime/parsing/output-content.js +10 -550
  184. package/dist/runtime/parsing/output-parsing.js +1 -4
  185. package/dist/runtime/parsing/output-recovery.js +3 -213
  186. package/dist/runtime/parsing/output-tool-args.js +7 -663
  187. package/dist/runtime/parsing/stream-event-parsing.js +3 -362
  188. package/dist/runtime/prompts/runtime-prompts.js +4 -73
  189. package/dist/runtime/scheduling/system-schedule-manager.js +11 -532
  190. package/dist/runtime/skills/skill-metadata.js +1 -197
  191. package/dist/runtime/startup-tracing.js +2 -37
  192. package/dist/runtime/support/compiled-binding.js +1 -290
  193. package/dist/runtime/support/embedding-models.js +1 -118
  194. package/dist/runtime/support/harness-support.js +5 -137
  195. package/dist/runtime/support/llamaindex.js +1 -108
  196. package/dist/runtime/support/runtime-adapter-options.js +1 -29
  197. package/dist/runtime/support/runtime-factories.js +1 -51
  198. package/dist/runtime/support/vector-stores.js +9 -270
  199. package/dist/scaffold/init-project.js +54 -233
  200. package/dist/tooling/extensions.js +1 -311
  201. package/dist/tooling/module-loader.js +1 -55
  202. package/dist/tools.js +1 -176
  203. package/dist/utils/agent-display.js +1 -18
  204. package/dist/utils/bundled-text.js +4 -39
  205. package/dist/utils/compiled-binding.js +1 -33
  206. package/dist/utils/fs.js +2 -45
  207. package/dist/utils/id.js +1 -9
  208. package/dist/utils/message-content.js +1 -30
  209. package/dist/utils/object.js +1 -6
  210. package/dist/workspace/agent-binding-compiler.js +3 -613
  211. package/dist/workspace/compile.js +1 -472
  212. package/dist/workspace/framework-contract-validation.js +2 -322
  213. package/dist/workspace/index.js +1 -1
  214. package/dist/workspace/object-loader-paths.js +1 -71
  215. package/dist/workspace/object-loader-readers.js +1 -187
  216. package/dist/workspace/object-loader.js +1 -754
  217. package/dist/workspace/resource-compilers.js +1 -374
  218. package/dist/workspace/support/agent-capabilities.js +1 -37
  219. package/dist/workspace/support/agent-execution-config.js +1 -44
  220. package/dist/workspace/support/discovery.js +1 -147
  221. package/dist/workspace/support/source-collectors.js +1 -30
  222. package/dist/workspace/support/source-protocols.js +2 -192
  223. package/dist/workspace/support/workspace-ref-utils.js +1 -362
  224. package/dist/workspace/tool-hydration.js +1 -280
  225. package/dist/workspace/validate.js +1 -99
  226. package/dist/workspace/yaml-object-reader.js +1 -285
  227. package/package.json +7 -3
package/README.md CHANGED
@@ -1,1246 +1,15 @@
1
- <p align="center">
2
- <img
3
- src="https://agent-harness.easynet.world/assets/readme-banner.png"
4
- alt="botbotgo runtime banner"
5
- width="1100"
6
- height="495"
7
- />
8
- </p>
9
-
10
- <p align="center">
11
- <strong>English</strong> · <a href="./README.zh.md">中文</a>
12
- </p>
13
-
14
1
  # @botbotgo/agent-harness
15
2
 
16
- <p align="center">
17
- <strong>Build enterprise-grade multi-agent runtimes that are ready to launch and ready to operate.</strong>
18
- </p>
19
-
20
- <p align="center">
21
- <strong>Ship quickly: one workspace assembles into one production-ready product runtime.</strong>
22
- </p>
23
-
24
- <p align="center">
25
- <a href="https://agent-harness.easynet.world/">Product website</a>
26
- (static page in <code>docs/</code>, self-hosted docs site; EN / 中文 toggle)
27
- </p>
28
-
29
- <p align="center">
30
- <a href="https://agent-harness.easynet.world/development/">Developer docs</a>
31
- (<code>docs/development/</code>, English / 中文)
32
- </p>
33
-
34
- <p align="center">
35
- <a href="./LICENSE">License</a> · <a href="./CONTRIBUTING.md">Contributing</a> ·
36
- <a href="./SECURITY.md">Security</a> · <a href="./CODE_OF_CONDUCT.md">Code of Conduct</a>
37
- · <a href="https://github.com/sponsors/botbotgo">Sponsorship</a>
38
- </p>
39
-
40
- <p align="center">
41
- <em
42
- >For AI solutions and help shipping a product idea, contact
43
- <a href="mailto:info@easynet.world">info@easynet.world</a>.</em
44
- >
45
- </p>
46
-
47
- <a id="readme-en-start"></a>
48
-
49
- ## Start in a few lines
50
-
51
- You can boot an agent runtime in a few lines of code:
52
-
53
- ```ts
54
- import { createAgentHarness, request, stop } from "@botbotgo/agent-harness";
55
-
56
- const runtime = await createAgentHarness("/absolute/path/to/workspace");
57
-
58
- try {
59
- const result = await request(runtime, {
60
- agentId: "auto",
61
- input: "Explain what this workspace is for.",
62
- });
63
-
64
- console.log(result.output);
65
- } finally {
66
- await stop(runtime);
67
- }
68
- ```
69
-
70
- The goal is an **operable** runtime: approvals, recovery, inspection, and governance—ready for production operations.
71
- `agent-harness` adds the product runtime layer around your existing agents, tools, and workflows without forcing a
72
- rewrite of the execution stack behind them.
73
-
74
- The repository default also ships a starter runtime, not an empty shell:
75
-
76
- - one default host agent: `orchestra`
77
- - a workspace-local `resources/tools/` path for runtime-owned tools such as file inspection, runtime inspection, approvals, and schedules
78
- - no preloaded bootstrap memory or behavior skills on the default host, so first-run local chat stays responsive; add `memory:` files and `skills:` refs when your runtime really needs them
79
-
80
- If you want the fastest first-run demo, start the chat shell and try one of these:
81
-
82
- ```bash
83
- botbotgo
84
- # or
85
- botbotgo "Inspect this workspace and explain the main entry points."
86
- # or
87
- agent-harness "Inspect this workspace and explain the main entry points."
88
- ```
89
-
90
- - `Inspect this workspace and explain the main entry points.`
91
- - `Review this project structure before making any edits.`
92
- - `Update README.md to make the setup steps clearer.`
93
- - `Find the likeliest config issue in this workspace and propose the smallest fix.`
94
-
95
- When the runtime emits request-scoped `plan-state` updates and safe `progress.commentary` deltas, the chat shell now renders live todo-board and progress status updates directly in the terminal, so you can watch planning and execution status change during the run instead of waiting for the final response.
96
- Those progress callouts now stay tied to stable runtime surfaces such as plan-state, tool start/completion, memory recall, and agent delegation, so the operator sees Codex-style intermediate status without exposing private model reasoning.
97
- Streaming data listeners also receive structured `plan.state`, per-item `plan.step`, and normalized `execution.step` events, so applications can render every planning and execution transition without parsing assistant text or raw upstream debug events.
98
- The bundled runtime now also provides a generic `response-format/default-report` structured-output default for agents; workspaces can replace it through `Runtime.spec.defaults.agent.config.responseFormatRef`, individual agents can extend it with inline `responseFormat`, replace it with `responseFormatRef`, or set `responseFormat: null`.
99
- The repository default `orchestra` host is also instructed to start real multi-step execution from the task you already gave it, call `write_todos` before non-trivial tool work, and keep that todo board updated while it runs.
100
- Durable-memory writes now also retrieve related existing records through the configured vector store before model reconciliation, then merge those semantic hits with deterministic matching so updates and deletes can target the right knowledge identity instead of creating nearby duplicate facts.
101
-
102
- <a id="readme-en-docs-path"></a>
103
-
104
- ## Documentation Paths
105
-
106
- Choose an entry point that matches what you need:
107
-
108
- - **Technology:** capability comparison, runtime model, protocol surfaces, API, recovery, approvals, and operator control
109
- - **Product:** what the stable runtime surface already is, which product scenarios it fits, and why it is not another agent framework
110
- - **Commercial:** pricing, engagement process, and scoped services for deployment help, launch hardening, and team handoff
111
-
112
- Recommended entry points:
113
-
114
- - [Developer docs portal](./docs/development/index.html)
115
- - [Side-by-side comparison](./docs/development/comparison.html)
116
- - [API reference](./docs/development/api-reference.html)
117
- - [Protocol surfaces](./docs/development/protocol-surfaces.html)
118
- - [Release notes](./docs/development/release-notes.html) (English: `RELEASE_NOTES.md`; Chinese: [`zh/release-notes`](./docs/development/zh/release-notes.html) / `RELEASE_NOTES.zh.md`)
119
- - [Commercial service offerings](./docs/commercial-pricing.md)
120
- - [Topical docs index](./docs/README.md) (all `docs/*.md` in one table)
121
-
122
- ### How to use this README
123
-
124
- This file is both a quickstart and a long reference—you do not need to read it top to bottom.
125
-
126
- | If you have… | Read this first | Then |
127
- | --- | --- | --- |
128
- | **~5 minutes** | [Start in a few lines](#readme-en-start) and [Documentation Paths](#readme-en-docs-path) | Open [Getting started](./docs/development/getting-started.html) in the developer docs. |
129
- | **First real integration** | [Quick Start](#readme-en-quickstart) → [How To Configure](#readme-en-config) | [Workspace and YAML](./docs/development/workspace-and-yaml.html) · [Topic index](./docs/README.md) · feature guides under [`docs/`](./docs/) |
130
- | **Operations / governance** | [Runtime capabilities at a glance](#readme-en-runtime-glance) → [Primary use cases](#readme-en-use-cases) | [Runtime operations](./docs/development/runtime-operations.html) and [`docs/tool-execution-policy.md`](./docs/tool-execution-policy.md). |
131
- | **API lookup** | Skip to [API Summary](#readme-en-api-summary) | Use it as a bookmarked index; the [API reference](./docs/development/api-reference.html) has fuller detail. |
132
-
133
- ## Repository Source Layout
134
-
135
- When you work on the open-source package itself, treat `src/` as a layered tree instead of one flat folder:
136
-
137
- - top-level `src/*.ts` files should stay as stable public entrypoints or compatibility shims
138
- - public API implementation belongs under `src/public/`
139
- - protocol servers and transports belong under `src/protocol/**`
140
- - terminal, projection, and rendering helpers belong under `src/surface/` or `src/cli/`
141
- - scaffolding and bootstrap generation belong under `src/scaffold/`
142
- - extension and tool-definition machinery belong under `src/tooling/`
143
- - runtime internals stay under `src/runtime/`, persistence under `src/persistence/`, and workspace assembly under `src/workspace/`
144
-
145
- For new code, prefer the domain folder first. Only add a new top-level `src/*.ts` file when it is intentionally part of the package entry surface.
146
-
147
- ## License & Commercial Support
148
-
149
- This project is licensed under **Apache License 2.0**.
150
- [LICENSE](./LICENSE)
151
-
152
- Core runtime is open source: inspect and run it freely.
153
- Commercial support focuses on helping teams reach a production-ready handoff, including:
154
-
155
- - Deployment and integration guidance for your environment
156
- - Initial deployment setup and launch assistance
157
- - Priority issue triage and troubleshooting
158
- - Runtime governance, approval flow, and recovery hardening support
159
- - Custom tools, connectors, and protocol integrations
160
- - Operator runbooks and handoff guidance for your team
161
-
162
- Production operations, managed hosting, on-call coverage, and long-term run-the-system support are not included by default.
163
- If a team wants us to take on that responsibility, we scope it separately based on environment complexity and SLA expectations.
164
-
165
- If your team needs a scalable enterprise setup, please contact:
166
- **[info@easynet.world](mailto:info@easynet.world)**.
167
-
168
- Additional docs:
169
-
170
- - [Commercial service offerings](./docs/commercial-pricing.md)
171
- - [Commercial engagement process](./docs/enterprise-process.md)
172
-
173
- ## Easy to start · Full runtime · Configure and extend
174
-
175
- **At a glance:** onboarding stays thin, the runtime ships as a full layer, and day-to-day work lives in **YAML** plus **extensions** (local tools, SKILL packages, MCP)—not bespoke runtime plumbing.
176
-
177
- - **Easy to start:** `createAgentHarness` → `request` → `stop`, plus inspection helpers such as `subscribe`, `listSessions`, `listApprovals`, and `resolveApproval`.
178
- - **Reusable client surface:** `createAgentHarnessClient` / `createInProcessHarnessClient` bind the same runtime-owned request, session, approval, and event APIs into one frontend-facing client contract that terminal shells, desktop apps, and other embedded UIs can share.
179
- - **ACP client path for out-of-process UIs:** `createAcpHarnessClient`, `createAcpStdioHarnessClient`, and `createAcpHttpHarnessClient` let a UI consume the same `HarnessClient` contract over ACP when the UI and runtime live in different processes, while keeping `request(...)` as the one request entrypoint for streamed state snapshots plus delta data.
180
- - **Configure:** routing, models, tools, stores, backends, MCP, recovery, and maintenance in declarative workspace YAML (see [Quick Start](#readme-en-quickstart) and [How To Configure](#readme-en-config)).
181
- - **Extend:** drop `tool({...})` modules and SKILL trees under `resources/`, wire shared tools and MCP in catalogs, and let agents whitelist what they use.
182
- - **Built into the runtime:** persisted `requests`, `sessions`, `approvals`, and `events`; recovery and queueing; streaming listeners; MCP in/out; and backend adapters—so you do not rebuild that layer per app.
183
-
184
- <a id="readme-en-runtime-glance"></a>
185
-
186
- ## Runtime capabilities at a glance
187
-
188
- The public API spans a full product runtime—persistent records, memory and evidence, protocol surfaces, and governance—not only a thin bootstrap around YAML and tools.
189
-
190
- - **Core runtime API:** `createAgentHarness`, `request`, `subscribe`, `resolveApproval`, `recordArtifact`, inspection helpers, and stable persisted runtime records for `requests`, `sessions`, `approvals`, `events`, and artifacts.
191
- - **Frontend/client entrypoints:** `createAgentHarnessClient`, `createInProcessHarnessClient`, `createAcpHarnessClient`, `createAcpStdioHarnessClient`, `createAcpHttpHarnessClient`, and `HarnessClient` let product shells consume the runtime through one reusable client layer instead of re-binding runtime calls per UI. `request(...)` is the streamed request entrypoint; `subscribe(...)` is the runtime lifecycle observer surface.
192
- - **Runtime memory and evidence:** `memorize`, `recall`, `listMemories`, memory policy hooks, `recordArtifact`, `listArtifacts`, `getArtifact`, `exportEvaluationBundle`, `replayEvaluationBundle`, and request/session evidence export helpers.
193
- - **Protocol and transport surfaces:** `createAcpServer`, `createAcpStdioClient`, `serveAcpStdio`, `serveAcpHttp`, `serveA2aHttp`, `serveAgUiHttp`, and `createRuntimeMcpServer` / `serveRuntimeMcpOverStdio`.
194
- - **Governed workspace runtime:** YAML-owned routing, concurrency, maintenance, MCP policy, runtime governance bundles, and approval defaults for sensitive memory or MCP tools with declared write access.
195
- - **Policy-shaped approvals:** governed tools can stay on manual review, auto-approve, or auto-reject / deny-and-continue modes while the runtime keeps one inspectable governance decision surface.
196
-
197
- If you integrate external clients, treat `deepagents-acp` as the primary protocol direction: clients connect through that surface while `agent-harness` keeps persistence, recovery, approvals, and operator control on the runtime side.
198
- Keep the standard stack split explicit: MCP connects agents to resources and tools, A2A bridges task exchange between agent platforms, ACP is the client-to-runtime boundary, AG-UI is the UI event surface, and runtime MCP exposes the operator control plane.
199
-
200
- ## The problem this solves
201
-
202
- In one line: `agent-harness` productizes the runtime work that usually appears after the demo.
203
-
204
- If your team already has agents, prompts, tools, and workflows, the missing layer is usually not more execution. The missing layer is the runtime that makes those pieces operable, inspectable, and recoverable in production.
205
-
206
- What you get on day one:
207
-
208
- - a runtime that keeps `requests`, `sessions`, `approvals`, and `events` as inspectable product records
209
- - a recovery path that survives interruption, restart, and operator decisions
210
- - stable request correlation and continuity metadata so operators can join one persisted request to logs, traces, and fallback transitions
211
- - approval defaults for sensitive durable memory writes and MCP tools with declared write access instead of relying on tool names or descriptions to imply governance
212
- - one workspace-shaped assembly model instead of app-specific runtime glue
213
- - one stable runtime contract even when execution backends change underneath
214
-
215
- AI makes it much easier to generate agent logic, tool calls, and workflow code. The harder problem shifts to operations.
216
-
217
- Once the demo works, the real software problem changes shape:
218
-
219
- - more generated logic creates more execution paths to inspect, interrupt, retry, and recover
220
- - natural-language entrypoints turn approvals and policy boundaries into runtime requirements
221
- - backend, prompt, and tool changes happen faster, but product-facing behavior still needs one stable control surface
222
- - MCP and provider-native tooling expand what agents can reach, which raises the bar for governance
223
-
224
- Teams still need clear answers to the runtime questions that appear after that shift:
225
-
226
- - how approvals are resolved and audited
227
- - how requests, sessions, and events stay inspectable
228
- - how execution recovers after interruption, failure, or restart
229
- - how routing, concurrency, and maintenance policy stay consistent
230
- - how backend churn does not leak into the product model
231
-
232
- `agent-harness` solves that layer. It keeps agent execution upstream while turning the application runtime into something teams can operate, recover, and govern.
233
-
234
- In short:
235
-
236
- - you bring the workspace, agents, tools, and prompts
237
- - `agent-harness` brings persisted `requests`, `sessions`, `approvals`, `events`, recovery, and operator visibility
238
- - your application gets one stable runtime contract instead of backend-specific runtime plumbing
239
-
240
- In concrete terms:
241
-
242
- - a product-facing approval and operator surface instead of backend-specific middleware state
243
- - persisted `requests`, `sessions`, `approvals`, and `events` as stable runtime records
244
- - runtime-owned inspection fields such as tracing correlation ids and continuity metadata instead of provider-private observability handles
245
- - restart-safe recovery and continuation as system-managed behavior
246
- - default runtime governance for high-risk memory and MCP side effects
247
- - YAML-owned routing, concurrency, maintenance, and recovery policy
248
- - adapter isolation so backend replacement does not redefine the public runtime model
249
-
250
- ## Product Overview
251
-
252
- `@botbotgo/agent-harness` is a workspace-shaped application runtime for real multi-agent products.
253
-
254
- It is not a new agent framework. It is the runtime layer around your existing execution stack that turns one workspace into one operable application runtime.
255
-
256
- The positioning is simple:
257
-
258
- - Codex, Claude Code, and Cursor are products for people using agents
259
- - execution frameworks define agent execution semantics
260
- - `agent-harness` is the runtime product layer for operating, recovering, approving, and governing multi-agent applications
261
-
262
- The product boundary is strict:
263
-
264
- - execution backends own agent execution semantics
265
- - application-level orchestration and lifecycle management stays in the harness
266
-
267
- That means:
268
-
269
- - public API stays small
270
- - complex setup and operating policy live in YAML
271
- - runtime lifecycle stays stable even if backend implementations change
272
- - backend internals stay behind adapters
273
-
274
- The runtime provides:
275
-
276
- - `createAgentHarness(workspaceRoot)`, `request(...)`, `memorize(...)`, `recall(...)`, `listMemories(...)`, `updateMemory(...)`, `removeMemory(...)`, `resolveApproval(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
277
- - YAML-defined workspace assembly for routing, models, tools, stores, backends, MCP, recovery, and maintenance
278
- - backend-adapted execution behind the runtime contract
279
- - local `resources/tools/` `tool({...})` modules and `resources/skills/` discovery
280
- - persisted sessions, requests, approvals, events, queue state, and recovery metadata
281
-
282
- In practice, the harness exists for the parts that are expensive and repetitive to rebuild inside every agent app:
283
-
284
- - approval inboxes and human decision flow
285
- - persisted requests, sessions, and inspectable event history
286
- - request correlation, continuity, and recovery inspection that still works after a stream fallback or restart
287
- - runtime-managed recovery after interrupts, failures, or process restart
288
- - queueing, concurrency, maintenance, and operational policy
289
- - stable runtime records that stay usable even if the backend changes
290
-
291
- The default workspace configuration shipped with the package is deliberately full-shaped. The bundled YAML keeps explicit defaults for important runtime and agent knobs so teams can start from concrete configuration instead of reverse-engineering adapter behavior from source.
292
-
293
- The default rule is:
294
-
295
- - if the execution backend already has the feature, map it in YAML and adapt it internally
296
- - do not add a new public runtime API unless the problem is truly runtime-owned
297
-
298
- Start with these user-facing docs:
299
-
300
- - `docs/development/index.html`
301
- - `docs/development/getting-started.html`
302
- - `docs/development/comparison.html`
303
- - `docs/development/api-reference.html`
304
- - `docs/development/protocol-surfaces.html`
305
- - `docs/development/cookbook.html`
306
- - `docs/development/release-notes.html`
307
- - `docs/runtime-inspection-contract.md`
308
- - `docs/tool-execution-policy.md`
309
- - `docs/long-running-coding.md`
310
- - `docs/long-term-memory.md`
311
- - `docs/memory-policy-reference.md`
312
-
313
- Deeper design notes and boundary discussions ship alongside the package for advanced readers; everyday integration and operations rely on the README, developer docs, and topical references above.
314
-
315
- `deepagents-acp` is the required external protocol direction when external tools need a standard runtime boundary. The harness should conform to `deepagents-acp` semantics at that boundary while keeping runtime lifecycle, persistence, recovery, and governance harness-owned.
316
-
317
- Recommended orchestration shape for long-running flows:
318
-
319
- - let callers select the host agent explicitly whenever possible
320
- - use `backend: deepagent` when you want high-level execution semantics with minimal application wiring
321
- - keep `backend: langchain-v1` for lighter direct-response or explicitly chosen V1 agent shapes
322
-
323
- ## What Makes It Different
324
-
325
- - It treats `requests`, `sessions`, `approvals`, `events`, and recovery as first-class product records
326
- - It gives operators a runtime control surface instead of exposing raw backend internals
327
- - It keeps observability and governance runtime-owned with trace correlation, continuity metadata, and approval defaults for sensitive side effects
328
- - It keeps checkpoint resume system-managed instead of promoting checkpoint internals into the primary API
329
- - It lets YAML own assembly and operating policy while code keeps a small, stable surface
330
- - It goes deep on runtime concerns that upstream libraries do not fully productize
331
-
332
- <a id="readme-en-use-cases"></a>
333
-
334
- ## Primary use cases
335
-
336
- These scenarios map most directly to what the runtime is built for:
337
-
338
- - Enterprise internal agent runtime: approvals, restart-safe recovery, operator evidence, and policy-owned MCP access.
339
- - Code modernization runtime: long-running coding flows, approval checkpoints, resumable requests, and exported evidence packages.
340
- - Agent-ops and remediation workflow runtime: parallel agent attempts, human review gates, durable evidence, and operator visibility for security or maintenance work.
341
- - Protocol bridge runtime: ACP, A2A, AG-UI, and runtime MCP on one stable control plane instead of bespoke per-surface glue.
342
-
343
- Typical runtime governance defaults now look like:
344
-
345
- ```yaml
346
- governance:
347
- remoteMcp:
348
- denyTrustTiers: ["untrusted"]
349
- denyTenantScopes: ["cross-tenant"]
350
- denyPromptInjectionRisks: ["high"]
351
- requireApprovalTransports: ["websocket"]
352
- ```
353
-
354
- ## When To Use It
355
-
356
- Use `agent-harness` when:
357
-
358
- - you already know your product needs agents, tools, prompts, or MCP access, but the missing layer is runtime operations
359
- - you need approvals, restart recovery, queueing, or inspectable request records as part of the shipped product
360
- - you want one workspace-shaped assembly model instead of hand-written runtime bootstrapping in every app
361
- - you want to keep backend execution semantics upstream while holding the product contract stable
362
-
363
- Do not reach for it when:
364
-
365
- - you only need a single short-lived agent call with no approvals, no persistence, and no operational control surface
366
- - you are looking for a workflow builder or low-code automation canvas
367
- - you want to replace the execution backend's semantics rather than operate around them
368
-
369
- <a id="readme-en-quickstart"></a>
370
-
371
- ## Quick Start
372
-
373
3
  Install:
374
4
 
375
5
  ```bash
376
6
  npm install @botbotgo/agent-harness
377
7
  ```
378
8
 
379
- If you want the CLI on your `PATH`, install it globally and run it from your own workspace root:
9
+ Usage:
380
10
 
381
11
  ```bash
382
- npm install -g @botbotgo/agent-harness
383
- cd /path/to/your-workspace
384
- botbotgo
385
- botbotgo "Inspect this workspace and explain the main entry points."
386
- botbotgo -w /path/to/another-workspace "Summarize this project."
387
- ```
388
-
389
- `botbotgo` treats the current directory as the workspace root. You can now run it from any folder: if `./config/` is absent, the CLI falls back to the bundled system defaults and bundled resources; if `./config/` or `./resources/` exists, the runtime overlays your workspace-defined config and resources on top of those defaults.
390
-
391
- Development tip: repository-owned Ollama workspaces now default to `http://127.0.0.1:11434` for release-friendly local behavior. During development, point them at a shared remote Ollama by exporting `AGENT_HARNESS_OLLAMA_BASE_URL=https://ollama-rtx-4070.easynet.world` or `AGENT_HARNESS_OPENAI_COMPATIBLE_BASE_URL=https://ollama-rtx-4070.easynet.world/v1` before starting the runtime.
392
-
393
- For CPU-only hosts with large RAM, run `llama.cpp` as an OpenAI-compatible server and use the existing `openai-compatible` provider:
394
-
395
- ```yaml
396
- apiVersion: agent-harness/v1alpha1
397
- kind: Models
398
- spec:
399
- - name: default
400
- provider: openai-compatible
401
- model: local-model
402
- baseUrl: ${env:AGENT_HARNESS_LLAMA_CPP_BASE_URL:-http://127.0.0.1:8080/v1}
403
- apiKey: dummy
404
- toolCallingMode: prompted-json
405
- ```
406
-
407
- Start the model separately with `llama-server -m /path/to/model.gguf --host 127.0.0.1 --port 8080`. `apiKey: dummy` uses the existing OpenAI-compatible auth-omission path, so the runtime does not send bearer auth to local `llama-server`.
408
-
409
- Workspace layout:
410
-
411
- ```text
412
- your-workspace/
413
- config/
414
- models.yaml
415
- agent-context.md
416
- runtime/
417
- workspace.yaml
418
- runtime-memory.yaml
419
- catalogs/
420
- embedding-models.yaml
421
- vector-stores.yaml
422
- stores.yaml
423
- backends.yaml
424
- tools.yaml
425
- mcp.yaml
426
- agents/
427
- direct.yaml
428
- orchestra.yaml
429
- resources/
430
- package.json
431
- tools/
432
- skills/
433
- ```
434
-
435
- Minimal usage:
436
-
437
- ```ts
438
- import { createAgentHarness, request, stop } from "@botbotgo/agent-harness";
439
-
440
- const runtime = await createAgentHarness("/absolute/path/to/workspace");
441
-
442
- try {
443
- const result = await request(runtime, {
444
- agentId: "auto",
445
- input: "Explain what this workspace is for.",
446
- });
447
-
448
- console.log(result.output);
449
- } finally {
450
- await stop(runtime);
451
- }
452
- ```
453
-
454
- Three-minute mental model:
455
-
456
- 1. Point `createAgentHarness(...)` at a workspace root.
457
- 2. Call `request(runtime, { ... })` to execute one request.
458
- 3. Inspect persisted runtime records instead of treating the final answer as the only product artifact.
459
-
460
- In brief:
461
-
462
- - your team builds the agent app
463
- - `agent-harness` makes that app operable
464
-
465
- If you want the shortest possible mental model:
466
-
467
- - one workspace becomes one runtime
468
- - YAML defines assembly and policy
469
- - `request(runtime, { ... })` executes requests against that runtime
470
- - the runtime owns lifecycle, inspection, and recovery
471
-
472
- ## Feature List
473
-
474
- - Workspace runtime for multi-agent applications
475
- - Small public runtime contract
476
- - YAML-defined host routing and runtime policy
477
- - Backend adaptation behind one runtime contract
478
- - Auto-discovered local `tool({...})` tools and SKILL packages
479
- - provider-native tools, MCP tools, and workspace-local tool modules
480
- - persisted sessions, requests, approvals, lifecycle events, and queued requests
481
- - runtime-managed recovery and checkpoint maintenance
482
- - structured output and multimodal content preservation in request results
483
- - MCP bridge support for agent-declared MCP servers
484
- - MCP server support for exposing harness tools outward
485
- - optional `mem0` semantic recall augmentation over canonical SQLite durable memory
486
-
487
- ### Runtime Strengths
488
-
489
- - Stable product-facing API even when backend details evolve
490
- - Strong separation between public runtime contract and backend adapter contract
491
- - Clear YAML ownership for routing, topology, policy, and infrastructure objects
492
- - Better fit for long-running, approval-heavy, multi-agent products than a thin agent loop wrapper
493
-
494
- ## How To Use
495
-
496
- ### Create A Runtime
497
-
498
- ```ts
499
- import { AgentHarnessRuntime, createAgentHarness } from "@botbotgo/agent-harness";
500
-
501
- const runtime: AgentHarnessRuntime = await createAgentHarness("/absolute/path/to/workspace");
502
- ```
503
-
504
- `createAgentHarness(...)` loads the workspace, resolves workspace sources, initializes persistence under `runtimeRoot`, and starts runtime maintenance.
505
-
506
- `runtime.spec.sources` is the primary public discovery surface for local tools, package tools, and skill packages.
507
-
508
- ```yaml
509
- apiVersion: agent-harness/v1alpha1
510
- kind: Runtime
511
- metadata:
512
- name: default
513
- spec:
514
- sources:
515
- tools:
516
- - file://./resources/tools
517
- - file://../shared-tools
518
- - npm://@acme/agent-tools
519
- skills:
520
- - file://./resources/skills
521
- - npm://@acme/agent-skills
522
- - https://example.com/skills/review/SKILL.md
523
- ```
524
-
525
- Tool-source rules:
526
-
527
- - `file://...` scans only the configured folder
528
- - `npm://...` resolves one package, auto-installs it when missing, and discovers tools from `package/tools/`
529
- - tool discovery never traverses `node_modules/**`
530
-
531
- Skill-source rules:
532
-
533
- - `file://...` accepts a skill collection folder, a single skill root, or a direct `SKILL.md` path
534
- - `npm://...` resolves one package, auto-installs it when missing, and discovers skills from `package/skills/`
535
- - `http://...` and `https://...` currently accept a single remote `SKILL.md`
536
-
537
- `runtime.spec.resources` remains supported as a compatibility path for attached resource packages.
538
-
539
- `createAgentHarness(..., { load })` accepts workspace loading controls.
540
-
541
- Merge order is deterministic:
542
-
543
- - framework defaults
544
- - each `overlayRoots` entry in order
545
- - workspace root
546
-
547
- Later values always override earlier values. Arrays are replaced, while plain objects are deep-merged.
548
-
549
- ```ts
550
- import { createAgentHarness } from "@botbotgo/agent-harness";
551
-
552
- const runtime = await createAgentHarness("/path/to/workspace", {
553
- load: {
554
- overlayRoots: ["/path/to/framework-defaults", "/path/to/product-overrides"],
555
- frameworkContractValidation: "warn",
556
- },
557
- });
558
- ```
559
-
560
- Framework contract validation modes:
561
-
562
- - `off` keeps startup behavior unchanged
563
- - `warn` loads the workspace and emits contract-quality warnings for workspace-owned agents, skills, and tools
564
- - `error` fails startup when those workspace-owned definitions drift away from the framework contract
565
-
566
- You can also control the same startup behavior with `AGENT_HARNESS_FRAMEWORK_CONTRACT_VALIDATION=warn|error|off`.
567
-
568
- ### Run A Request
569
-
570
- ```ts
571
- import { request } from "@botbotgo/agent-harness";
572
-
573
- const result = await request(runtime, {
574
- agentId: "orchestra",
575
- input: "Summarize the runtime design.",
576
- invocation: {
577
- context: {
578
- requestId: "req-123",
579
- },
580
- inputs: {
581
- visitCount: 1,
582
- },
583
- attachments: {
584
- "/tmp/spec.md": { content: "draft" },
585
- },
586
- },
587
- });
12
+ botbotgo --help
588
13
  ```
589
14
 
590
- `request(runtime, { ... })` creates or continues a persisted session and returns `sessionId`, `requestId`, `state`, and compact text `output`. Richer upstream result shapes stay available through `outputContent`, `contentBlocks`, and `structuredResponse`.
591
-
592
- Use `listRequests(runtime)` and `getRequest(runtime, requestId)` when a product needs a request-centric operations surface such as a review queue or execution dashboard.
593
-
594
- Use `invocation` as the runtime-facing request envelope:
595
-
596
- - `invocation.context` for request-scoped execution context
597
- - `invocation.inputs` for structured runtime inputs
598
- - `invocation.attachments` for auxiliary invocation-scoped attachment payloads that the active backend can interpret
599
-
600
- For multimodal chat turns, keep the user-visible content in `input`.
601
-
602
- - if the product would show the image or text in the chat transcript, it belongs in `input`
603
- - if the payload is auxiliary request-scoped data rather than the chat turn itself, it belongs in `invocation.attachments`
604
- - persistence, replay, and transcript inspection should treat `input` as the source of truth for user-visible multimodal chat content
605
-
606
- ```ts
607
- import { normalizeUserChatInput, request } from "@botbotgo/agent-harness";
608
-
609
- const result = await request(
610
- runtime,
611
- {
612
- agentId: "orchestra",
613
- ...normalizeUserChatInput({
614
- role: "user",
615
- content: [
616
- { type: "text", text: "Describe the image and call out any risks." },
617
- { type: "image_url", image_url: "data:image/png;base64,..." },
618
- ],
619
- }),
620
- },
621
- );
622
- ```
623
-
624
- Use `normalizeUserChatInput(...)` when a product already has chat-style user messages and wants to project one user turn onto the stable `request(..., { input, invocation })` surface without introducing a separate harness-owned chat API.
625
-
626
- ### Store And Recall Durable Runtime Memory
627
-
628
- ```ts
629
- import { memorize, recall } from "@botbotgo/agent-harness";
630
-
631
- await memorize(runtime, {
632
- sessionId: "session-123",
633
- records: [
634
- {
635
- content: "The release checklist requires a smoke test before publish.",
636
- summary: "Run a smoke test before publish",
637
- scope: "workspace",
638
- kind: "procedural",
639
- sourceRef: "docs/release-checklist.md",
640
- },
641
- ],
642
- });
643
-
644
- const recalled = await recall(runtime, {
645
- query: "What does the release checklist require?",
646
- scopes: ["workspace"],
647
- });
648
- ```
649
-
650
- Use `memorize(...)`, `recall(...)`, `listMemories(...)`, `updateMemory(...)`, and `removeMemory(...)` when an application needs a stable public runtime memory surface without importing internal `runtime/harness/system/*` modules.
651
-
652
- - `memorize(...)` returns stable `MemoryRecord` and `MemoryDecision` results while leaving merge, review, archive, and storage layout runtime-managed
653
- - `recall(...)` returns ranked `MemoryRecord` items filtered by runtime memory scope and kind
654
- - `listMemories(...)` returns stable `MemoryRecord` items for inspection and admin workflows, defaulting to `active` records unless status filters are provided
655
- - `updateMemory(...)` edits one durable memory record by `memoryId` without exposing internal store namespaces
656
- - `removeMemory(...)` deletes one durable memory record by `memoryId` and rebuilds runtime-managed projections
657
- - app-specific knowledge taxonomy, review UI, and admin surfaces still belong in the application layer
658
-
659
- ### Let The Runtime Route
660
-
661
- ```ts
662
- const result = await request(runtime, {
663
- agentId: "auto",
664
- input: "Inspect the repository and explain the release flow.",
665
- });
666
- ```
667
-
668
- `agentId: "auto"` evaluates ordered routing rules in `config/runtime/workspace.yaml`, then `routing.defaultAgentId`, and otherwise falls back to the default runtime entry host.
669
-
670
- ### Stream Output And Events
671
-
672
- ```ts
673
- const result = await request(runtime, {
674
- agentId: "orchestra",
675
- input: "Inspect the workspace and explain the available tools.",
676
- eventListener(snapshot) {
677
- console.log(snapshot.state, snapshot.plan.items);
678
- },
679
- dataListener(event) {
680
- if (event.type === "output.text.delta") {
681
- process.stdout.write(event.text);
682
- }
683
- if (event.type === "tool.result") {
684
- console.log(event.toolName, event.output);
685
- }
686
- },
687
- });
688
- ```
689
-
690
- `eventListener(...)` receives the latest full request snapshot, including request state, the live todo board, approval state, and current output.
691
- `dataListener(...)` receives append-only deltas such as text output, progress commentary, content blocks, tool results, and upstream debug items.
692
-
693
- `subscribe(...)` is the read-only observer surface over stored lifecycle events.
694
-
695
- The runtime event stream includes:
696
-
697
- - `request.created`
698
- - `request.queued`
699
- - `request.dequeued`
700
- - `request.state.changed`
701
- - `approval.requested`
702
- - `approval.resolved`
703
- - `output.delta`
704
-
705
- ### Inspect Sessions And Approvals
706
-
707
- ```ts
708
- import {
709
- deleteSession,
710
- getSession,
711
- getApproval,
712
- listSessions,
713
- listApprovals,
714
- resolveApproval,
715
- } from "@botbotgo/agent-harness";
716
-
717
- const sessions = await listSessions(runtime);
718
- const session = await getSession(runtime, sessions[0]!.sessionId);
719
- const approvals = await listApprovals(runtime, { status: "pending" });
720
- const approval = approvals[0] ? await getApproval(runtime, approvals[0].approvalId) : null;
721
-
722
- if (approval) {
723
- await resolveApproval(runtime, {
724
- approvalId: approval.approvalId,
725
- decision: "approve",
726
- });
727
- }
728
-
729
- if (session && session.currentState === "completed") {
730
- await deleteSession(runtime, session.sessionId);
731
- }
732
- ```
733
-
734
- These methods return runtime-facing records, not raw checkpoint or backend objects.
735
-
736
- ### Expose And Consume MCP
737
-
738
- Bridge MCP servers into agents:
739
-
740
- ```yaml
741
- apiVersion: agent-harness/v1alpha1
742
- kind: Agent
743
- metadata:
744
- name: orchestra
745
- spec:
746
- backend: deepagent
747
- modelRef: model/default
748
- mcpServers:
749
- - name: browser
750
- command: node
751
- args: ["./mcp-browser-server.mjs"]
752
- ```
753
-
754
- Expose harness tools as an MCP server:
755
-
756
- ```ts
757
- import { createToolMcpServer, serveToolsOverStdio } from "@botbotgo/agent-harness";
758
-
759
- const server = await createToolMcpServer(runtime, { agentId: "orchestra" });
760
- await serveToolsOverStdio(runtime, { agentId: "orchestra" });
761
- ```
762
-
763
- ### Stop The Runtime
764
-
765
- ```ts
766
- import { stop } from "@botbotgo/agent-harness";
767
-
768
- await stop(runtime);
769
- ```
770
-
771
- <a id="readme-en-config"></a>
772
-
773
- ## How To Configure
774
-
775
- Use Kubernetes-style YAML:
776
-
777
- - collection files use `apiVersion`, plural `kind`, and `spec: []`
778
- - singleton files use `apiVersion`, singular `kind`, `metadata`, and `spec`
779
-
780
- Core workspace files:
781
-
782
- - `config/runtime/workspace.yaml`
783
- - `config/agent-context.md`
784
- - `config/models.yaml`
785
- - `config/catalogs/embedding-models.yaml`
786
- - `config/catalogs/vector-stores.yaml`
787
- - `config/catalogs/stores.yaml`
788
- - `config/knowledge/knowledge-runtime.yaml`
789
- - `config/knowledge/procedural-memory-runtime.yaml`
790
- - `config/runtime/runtime-memory.yaml`
791
- - `config/catalogs/backends.yaml`
792
- - `config/catalogs/tools.yaml`
793
- - `config/catalogs/mcp.yaml`
794
- - `config/agents/direct.yaml`
795
- - `config/agents/orchestra.yaml`
796
- - `resources/tools/`
797
- - `resources/skills/`
798
-
799
- Discovery rules:
800
-
801
- - every YAML document under `config/**` is discovered recursively; filenames and subfolders are organizational only
802
- - YAML object semantics come from `kind`, `metadata.name` or `id`, and object content rather than the file path
803
- - `Runtime.spec.sources.tools` defaults to `file://./resources/tools`
804
- - `Runtime.spec.sources.skills` defaults to `file://./resources/skills`
805
- - local file-based tools are auto-discovered from each configured tool folder when modules export `tool({...})`
806
- - file-based skills are auto-discovered from each configured skill source
807
- - a minimal workspace can start with only `config/models.yaml`; the repository defaults provide the `Runtime`, the default `orchestra` host, and runtime-managed durable memory with `enabled: true`
808
- - when you do not override runtime placement, harness-owned generated state is written under `./.botbotgo/`
809
-
810
- Example workspaces:
811
-
812
- - prefixes indicate complexity order, where `00_` is the simplest starting point
813
- - `examples/00_local-tools-and-skills/` is the Local Tools and Skills Example: the smallest local tool + skill workspace
814
- - `examples/01_multimodal-request/` is the Multimodal Request Example: the smallest image-plus-PDF request flow
815
- - `examples/02_subagent-planning/` is the Subagent Planning Example: a compact planning flow with one subagent, tools, and trace output
816
- - `examples/03_protocol-surfaces/` is the Protocol Surfaces Example: the same minimal direct agent wired to ACP, ACP stdio, A2A, AG-UI, and runtime MCP
817
- - `examples/04_local-model-tool-calling/` is the Local Model Tool Calling Example: one local GGUF-backed task loop plus one local tool
818
- - `examples/05_runtime-trace-export/` is the Runtime Trace Export Example: one real request plus Mermaid flow export from runtime and upstream events
819
- - `examples/06_repository-analysis/` is the Repository Analysis Example: repo analysis around one workspace-local tool plus embedding-backed indexing
820
- - `examples/07_multi-agent-research/` is the Multi-Agent Research Example: the most complete multi-agent research workspace with reusable backends, skills, and local tools
821
- - `examples/08_long-term-memory-learning/` is the Long-Term Memory Learning Example: repeated requests that store durable memory, inspect recall, and make later answers more context-aware
822
- - `examples/09_long-running-coding-harness/` is the Long-Running Coding Harness Example: a host agent plus app-owned planning/evaluation roles, Playwright MCP wiring, and evaluation-bundle export for long coding sessions
823
- - `examples/10_playwright-mcp-browser/` is the Playwright CLI Browser Example: the smallest browser-capable workspace that follows the official Playwright coding-agent recommendation with `playwright-cli` plus a local skill
824
-
825
- Workspace-local tool modules in `resources/tools/` should be exported with `tool({...})`.
826
- Any other local module shape is not supported, and unsupported shapes are rejected at load time.
827
- When a local function tool declares its schema in the module, runtime governance treats that module-defined schema as the source of truth; duplicating it into YAML `inputSchema.ref` is optional rather than required for schema-bound metadata.
828
- When local tools use Zod-authored schemas, keep the workspace or isolated `resources` package on `zod@^4` so raw-shape validators and runtime parsing stay on one supported major version.
829
- If you want runtime-owned product tools such as `list_files`, `search_files`, `run_command`, `schedule_task`, request inspection, or artifact inspection, author them as normal `resources/tools/*.mjs` modules and whitelist them from agent YAML like any other workspace tool.
830
- For DeepAgents-backed agents, the runtime still keeps an internal compatibility layer for the upstream helper tools that DeepAgents expects during long multi-step execution. That compatibility set currently includes `write_todos`, `read_todos`, `ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`, `task`, and `execute` when the selected backend implements sandbox command execution. Treat those helper names as adapter-internal execution compatibility, not as the primary product-facing workspace tool surface.
831
-
832
- Default wiring guidance:
833
-
834
- - let `Runtime.spec.sources` declare the tool and skill roots the workspace owns
835
- - let workspace startup scan only those declared sources into one registry
836
- - let workspace startup scan local and attached `resources` packages into one registry when compatibility paths are still in use
837
- - let agents whitelist tools and skills by name
838
- - keep `config/catalogs/tools.yaml` for reusable shared tools
839
- - keep `config/catalogs/mcp.yaml` for shared MCP server definitions
840
- - let agents select MCP tools and apply per-usage MCP overrides where needed
841
-
842
- There are three main configuration layers:
843
-
844
- - runtime policy in `config/runtime/workspace.yaml`
845
- - reusable object catalogs in `config/catalogs/*.yaml`
846
- - agent assembly in `config/**/*.yaml`
847
-
848
- ### Backend Guidance
849
-
850
- At the moment, the most stable path for complex production-style requests is `backend: deepagent`.
851
-
852
- Current temporary limits on the `backend: langchain-v1` path are:
853
-
854
- - approval-gated side-effect tools are less reliable on the lighter direct-response path under real remote models
855
- - long multi-agent or orchestration-heavy flows are not the recommended default path
856
- - the package now treats the planner-first backend as the default execution path for complex runtime coverage, and the lighter direct-response backend should be selected explicitly when a workspace truly wants that behavior
857
-
858
- Practical guidance:
859
-
860
- - use `backend: deepagent` for approvals, resume, multi-agent orchestration, rich memory flows, and heavier tool chains
861
- - keep `backend: langchain-v1` for lighter direct-response or explicitly chosen V1 agent shapes while this upstream behavior settles
862
-
863
- Local GGUF note:
864
-
865
- - `provider: node-llama-cpp` now exposes a LangChain-style tool-binding shim, so local GGUF models can enter the standard tool-calling path without an app-owned model wrapper
866
- - `provider: openai-compatible` targets an external `llama-server` endpoint when the model process should be tuned or supervised outside Node.js
867
- - `backend: langchain-v1` is the straightforward local GGUF path and is the currently verified default for `node-llama-cpp` tool use
868
- - `backend: deepagent` can also reach the same tool-calling path, but final reliability still depends on the selected model following upstream tool schemas correctly
869
- - `agent-harness` does not try to normalize every model-specific argument drift or malformed tool payload; once the runtime hands a call to upstream tools, schema fidelity is a model responsibility
870
-
871
- ### `config/runtime/workspace.yaml`
872
-
873
- Use this file for workspace-wide runtime policy.
874
-
875
- Important fields:
876
-
877
- - `runtimeRoot`
878
- - `concurrency.maxConcurrentRequests`
879
- - `sources.tools`
880
- - `sources.skills`
881
- - `routing.defaultAgentId`
882
- - `routing.rules`
883
- - `toolModuleDiscovery.scope`
884
- - `maintenance.checkpoints`
885
- - `maintenance.records`
886
- - `recovery.enabled`
887
- - `recovery.resumeResumingRequestsOnStartup`
888
- - `recovery.maxRecoveryAttempts`
889
-
890
- `recovery.resumeResumingRequestsOnStartup` keeps checkpoint resume a runtime-owned lifecycle behavior instead of exposing checkpoint orchestration as public API.
891
-
892
- `maintenance.checkpoints` and `maintenance.records` are separate retention layers:
893
-
894
- - `maintenance.checkpoints` trims backend checkpoint state used for resume/recovery
895
- - `maintenance.records` trims harness-owned terminal session/request records stored in `runtime.sqlite`
896
-
897
- `sources.tools` controls which tool roots or packages participate in workspace discovery:
898
-
899
- - `file://...` for folder scanning
900
- - `npm://...` for package discovery under `tools/` plus auto-install when missing
901
-
902
- `sources.skills` controls which skill folders or skill documents participate in workspace discovery:
903
-
904
- - `file://...` for local folders, skill roots, or direct `SKILL.md`
905
- - `npm://...` for package discovery under `skills/` plus auto-install when missing
906
- - `http://...` / `https://...` for one remote `SKILL.md`
907
-
908
- `toolModuleDiscovery.scope` controls how local `resources/tools/`-style file discovery walks tool directories:
909
-
910
- - `recursive` is the default and keeps scanning nested folders
911
- - `top-level` limits module discovery to files directly under each tool root while leaving YAML catalogs recursive
912
-
913
- When libSQL reports an error against harness runtime persistence, the message is prefixed with the absolute path to `runtime.sqlite`. For constraint-class failures (or whenever you set `AGENT_HARNESS_RUNTIME_SQLITE_DEBUG=1`), the message also includes a truncated copy of the failing SQL so you can tell harness persistence apart from other SQLite databases in the same process.
914
-
915
- Example:
916
-
917
- ```yaml
918
- apiVersion: agent-harness/v1alpha1
919
- kind: Runtime
920
- metadata:
921
- name: default
922
- spec:
923
- dataRoot: ./.botbotgo
924
- toolModuleDiscovery:
925
- scope: top-level
926
- concurrency:
927
- maxConcurrentRuns: 3
928
- routing:
929
- defaultAgentId: orchestra
930
- maintenance:
931
- checkpoints:
932
- enabled: true
933
- records:
934
- enabled: false
935
- recovery:
936
- enabled: true
937
- resumeResumingRequestsOnStartup: true
938
- maxRecoveryAttempts: 3
939
- ```
940
-
941
- ### `config/agent-context.md`
942
-
943
- Use this file for shared bootstrap memory loaded at agent construction time.
944
-
945
- Keep stable project context here. Treat it as startup context, not mutable long-term memory.
946
-
947
- ### Models Catalogs In `config/**`
948
-
949
- Use named chat-model presets:
950
-
951
- ```yaml
952
- apiVersion: agent-harness/v1alpha1
953
- kind: Models
954
- spec:
955
- - name: default
956
- provider: openai
957
- model: gpt-4.1
958
- temperature: 0.2
959
- ```
960
-
961
- These load as `model/default`.
962
-
963
- You can place `kind: Models` catalogs anywhere under `config/`; the repository default now keeps `models.yaml` at the `config/` root, and file paths remain organizational only.
964
-
965
- ### Embedding Model Catalogs In `config/**`
966
-
967
- Use named embedding-model presets for retrieval-oriented tools.
968
-
969
- ### `config/catalogs/vector-stores.yaml`
970
-
971
- Use named vector-store presets referenced by retrieval tools.
972
-
973
- ### `config/catalogs/stores.yaml`
974
-
975
- Use reusable store and checkpointer presets:
976
-
977
- ```yaml
978
- apiVersion: agent-harness/v1alpha1
979
- kind: Stores
980
- spec:
981
- - kind: Store
982
- name: default
983
- storeKind: SqliteStore
984
- path: store.sqlite
985
- - kind: Checkpointer
986
- name: default
987
- checkpointerKind: SqliteSaver
988
- path: runtime/checkpoints.sqlite
989
- ```
990
-
991
- ### `config/runtime/runtime-memory.yaml`
992
-
993
- Use this singleton file for runtime-owned durable long-term memory defaults.
994
-
995
- Keep bootstrap context in `config/agent-context.md`. Keep resumable execution state in the checkpointer. Use `RuntimeMemory` for durable memory policy and retrieval defaults.
996
-
997
- `RuntimeMemory` also carries LangMem-style formation defaults:
998
-
999
- - `formation.hotPath` for immediate write-time capture
1000
- - `formation.manager` for rule-driven or model-driven candidate normalization before persistence
1001
- - `formation.background` for reflection after request completion or approval resolution
1002
-
1003
- ### `config/knowledge/knowledge-runtime.yaml`
1004
-
1005
- Use this singleton when the same durable-memory policy should also run outside `AgentHarnessRuntime`, such as a standalone knowledge worker or knowledge server.
1006
-
1007
- `KnowledgeRuntime` mirrors the durable policy shape on purpose. Keep `RuntimeMemory` for runtime-owned defaults, and keep `KnowledgeRuntime` as the externalizable mirror when a separate knowledge service needs the same memorize/recall policy. Use it for fast explicit writes plus background durable-knowledge formation and maintenance.
1008
-
1009
- ### `config/knowledge/procedural-memory-runtime.yaml`
1010
-
1011
- Use this singleton when the workspace wants a separate background experience-memory layer, such as a ReMe-backed procedural memory pool.
1012
-
1013
- `ProceduralMemoryRuntime` is intentionally separate from `KnowledgeRuntime`:
1014
-
1015
- - keep `KnowledgeRuntime` for durable facts, preferences, rules, and confirmed decisions
1016
- - keep `ProceduralMemoryRuntime` for workflows, debugging lessons, tactics, and reusable procedures
1017
- - keep both stores under the same `knowledge/` directory, but do not force them into one logical store
1018
-
1019
- The default repository shape uses:
1020
-
1021
- - `KnowledgeRuntime`: hot path + background formation + long-term maintenance
1022
- - `ProceduralMemoryRuntime`: background formation + scheduled or idle maintenance
1023
-
1024
- In the shipped runtime, explicit durable facts such as “remember I moved to the United States” still go to `KnowledgeRuntime` and land in `knowledge/knowledge.sqlite`. Background procedural learning writes its own store and state files under the same data root, such as `knowledge/procedural-memory.sqlite` and `knowledge/procedural-memory-state.json`.
1025
-
1026
- For DeepAgents-backed workspaces, keep upstream context compaction upstream-owned and use procedural memory only as a background learning layer.
1027
-
1028
- ### `config/catalogs/backends.yaml`
1029
-
1030
- Use reusable backend presets so filesystem and `/memories/*` topology stays in YAML:
1031
-
1032
- ```yaml
1033
- apiVersion: agent-harness/v1alpha1
1034
- kind: Backends
1035
- spec:
1036
- - kind: Backend
1037
- name: default
1038
- backendKind: CompositeBackend
1039
- state:
1040
- kind: VfsSandbox
1041
- rootDir: .
1042
- virtualMode: true
1043
- timeout: 600
1044
- routes:
1045
- /memories/:
1046
- kind: StoreBackend
1047
- ```
1048
-
1049
- ### `config/catalogs/tools.yaml`
1050
-
1051
- Use this file for reusable tool objects.
1052
-
1053
- Built-in tool families include function tools, backend tools, MCP tools, bundles, and provider-native tools. Provider-native tools are declared in YAML and resolved directly to upstream factories.
1054
-
1055
- Keep `config/catalogs/tools.yaml` for reusable shared tool objects rather than making it the default path for every local tool. Workspace-owned function tools should normally be discovered from `resources/tools/` and then whitelisted by name in each agent.
1056
-
1057
- ### `config/catalogs/mcp.yaml`
1058
-
1059
- Use this file for named MCP server presets.
1060
-
1061
- MCP servers are usually heavier shared resources than local function tools. Keep shared MCP connection details here, then let each agent choose the remote tools it wants and apply per-usage overrides at the agent usage point.
1062
-
1063
- Example:
1064
-
1065
- ```yaml
1066
- apiVersion: agent-harness/v1alpha1
1067
- kind: McpServers
1068
- spec:
1069
- - name: browser
1070
- transport: stdio
1071
- command: node
1072
- args:
1073
- - ./mcp-browser-server.mjs
1074
- ```
1075
-
1076
- `spec[].kind` can be omitted here; catalog entries default to `McpServer`.
1077
-
1078
- ### Agents In `config/**`
1079
-
1080
- Agents always use `kind: Agent` plus `spec.backend`.
1081
-
1082
- Agent YAML can live anywhere under `config/`; `config/agents/*.yaml` is the recommended layout, not a loader requirement.
1083
-
1084
- Use two sections:
1085
-
1086
- - `spec.runtime` for agent-specific runtime placement overrides such as `spec.runtime.runtimeRoot`
1087
- - top-level `spec` fields for upstream execution semantics and adapter-facing config
1088
-
1089
- Example direct host:
1090
-
1091
- ```yaml
1092
- apiVersion: agent-harness/v1alpha1
1093
- kind: Agent
1094
- metadata:
1095
- name: direct
1096
- spec:
1097
- backend: langchain-v1
1098
- modelRef: model/default
1099
- tools:
1100
- - write_file:
1101
- subprocess: true
1102
- skills:
1103
- - code-review
1104
- memory: []
1105
- subagents: []
1106
- mcpServers: []
1107
- config:
1108
- checkpointer: default
1109
- store: default
1110
- interruptOn: {}
1111
- filesystem:
1112
- rootDir: .
1113
- virtualMode: true
1114
- maxFileSizeMb: 10
1115
- sessionStorage:
1116
- enabled: true
1117
- rootDir: "{runtimeRoot}/sessions/{sessionId}/filesystem"
1118
- middleware: []
1119
- systemPrompt:
1120
- path: ../prompts/direct-system.md
1121
- ```
1122
-
1123
- Keep long prompts in checked-in prompt files such as `config/prompts/*.md` and point `systemPrompt` at them with a path relative to the agent YAML file. This keeps prompt text out of source code and makes prompt edits reviewable as normal content changes.
1124
-
1125
- When `config.filesystem.sessionStorage.enabled: true` is set for a LangChain binding, the runtime keeps one filesystem root per persisted session and reuses the same runnable cache entry for repeated work on that session instead of collapsing every request onto one shared workspace directory.
1126
-
1127
- Example orchestra host:
1128
-
1129
- ```yaml
1130
- apiVersion: agent-harness/v1alpha1
1131
- kind: Agent
1132
- metadata:
1133
- name: orchestra
1134
- spec:
1135
- backend: deepagent
1136
- modelRef: model/default
1137
- memory:
1138
- - path: config/agent-context.md
1139
- tools:
1140
- - stock_snapshot
1141
- skills:
1142
- - stock-research
1143
- subagents: []
1144
- mcpServers: []
1145
- config:
1146
- store: default
1147
- checkpointer: default
1148
- backend: default
1149
- interruptOn: {}
1150
- middleware: []
1151
- ```
1152
-
1153
- For backend-specific options, prefer the upstream concept directly inside `spec.config`. Keep the public runtime contract in the main developer docs and API reference rather than relying only on informal comparison notes.
1154
-
1155
- ## Design Notes
1156
-
1157
- - `agent-harness` is not a third agent framework
1158
- - public runtime contract stays generic and small
1159
- - application-level orchestration and lifecycle management stays in the harness
1160
- - the external protocol boundary should strictly conform to `deepagents-acp` instead of a parallel harness-only protocol
1161
- - upstream execution-backend concepts should be expressed as directly as possible in YAML
1162
- - when a feature can be expressed in YAML, prefer YAML over expanding the public API
1163
- - recovery, approvals, sessions, requests, and events are runtime concepts, not backend escape hatches
1164
- - application task centers should be built on the existing store plus runtime ids instead of expanding the public runtime contract
1165
- - new backend-specific config should land in YAML mapping and tests before adding public runtime APIs
1166
-
1167
- In short, the product model stays stable while the execution semantics remain upstream-owned.
1168
-
1169
- <a id="readme-en-api-summary"></a>
1170
-
1171
- ## API Summary
1172
-
1173
- Primary exports:
1174
-
1175
- - `createAgentHarness`
1176
- - `AgentHarnessRuntime`
1177
- - `request`
1178
- - `resolveApproval`
1179
- - `subscribe`
1180
- - `listRequests`
1181
- - `getRequest`
1182
- - `listSessions`
1183
- - `getSession`
1184
- - `deleteSession`
1185
- - `listApprovals`
1186
- - `getApproval`
1187
- - `listArtifacts`
1188
- - `getArtifact`
1189
- - `listRequestEvents`
1190
- - `listRequestTraceItems`
1191
- - `exportRequestPackage`
1192
- - `exportSessionPackage`
1193
- - `exportEvaluationBundle`
1194
- - `replayEvaluationBundle`
1195
- - `createAcpServer`
1196
- - `createAcpStdioClient`
1197
- - `serveAcpHttp`
1198
- - `serveAcpStdio`
1199
- - `serveA2aHttp`
1200
- - `serveAgUiHttp`
1201
- - `createRuntimeMcpServer`
1202
- - `serveRuntimeMcpOverStdio`
1203
- - `createToolMcpServer`
1204
- - `serveToolsOverStdio`
1205
- - `stop`
1206
- - `createUpstreamTimelineReducer`
1207
- - `exportFlow`
1208
- - `exportSequence`
1209
-
1210
- Inspection helpers:
1211
-
1212
- - `createUpstreamTimelineReducer()` reduces raw upstream model/tool/chain events into ordered step-like projections for inspection and visualization.
1213
- - `listRequestTraceItems(runtime, { sessionId, requestId })` returns the persisted request trace items that back runtime diagrams and post-request inspection. Each trace item carries the normalized runtime surface record plus the source upstream event.
1214
- - `exportFlow(runtime, { sessionId, requestId })` loads one persisted request record from the runtime and renders it as Mermaid flowchart text. It uses the built-in product view defaults for direction, grouping, and visible kinds so callers do not need to carry visualization options in normal product code.
1215
- - `exportSequence(runtime, { sessionId, requestId })` loads the same persisted request record and renders it as a Mermaid sequence diagram for the same persisted trace-backed request.
1216
-
1217
- These helpers are visualization and inspection utilities. They do not introduce a canonical harness-owned execution protocol.
1218
-
1219
- ACP transport notes:
1220
-
1221
- - `serveAcpStdio(runtime)` exposes newline-delimited JSON-RPC over stdio for local IDE, CLI, or subprocess clients.
1222
- - `serveAcpHttp(runtime)` exposes JSON-RPC over HTTP plus SSE runtime events so remote operator surfaces can connect without importing the runtime in-process.
1223
- - ACP transport validation now covers the reference-client core flow: capability discovery, request submit, session lookup, request lookup, invalid-JSON handling, notification calls without response ids, stdio JSON-RPC, and HTTP plus SSE runtime notifications.
1224
- - Cross-protocol conformance now has an explicit regression gate as well: ACP submission, A2A task lookup and continuation, and runtime MCP inspection must all project the same persisted `sessionId` / `requestId` runtime records instead of drifting into surface-specific identifiers or side stores.
1225
- - For the thinnest editor or CLI starter, begin with `agent-harness acp serve --workspace . --transport stdio` and mirror the `examples/03_protocol-surfaces/app/acp-stdio/main.mjs` wire shape. Applications that want an in-process reference client can use `createAcpStdioClient(...)` to issue JSON-RPC requests and route runtime notifications without hand-rolling line parsing.
1226
- - For the shortest local operator workflow, `botbotgo start --workspace .` now starts ACP, A2A, runtime MCP, and AG-UI together as managed local services, and `botbotgo stop --workspace .` stops the same set. `--services acp,mcp` narrows the set when one workspace only needs part of the local protocol surface.
1227
- - When a local ACP HTTP endpoint should stay up beyond one foreground shell, use `botbotgo acp start --workspace . --host 127.0.0.1 --port 8787` and later `botbotgo acp stop --workspace .`. The CLI records the managed process under `.botbotgo/services/` so local operators can start and stop it without a second process manager.
1228
- - `botbotgo` is the shortest local terminal entrypoint for a published install. It defaults the workspace to the current directory, so teams can `cd` into their own runtime workspace and run `botbotgo` or `botbotgo "..."` directly. `agent-harness` keeps the same implicit-chat behavior, and `-w/--workspace` still lets one shell point at another workspace when needed.
1229
- - `agent-harness chat --workspace .` still acts as a local terminal shell over the shared `HarnessClient` contract when you want the explicit subcommand form: the default `stdio` path runs directly in-process against the workspace runtime, while `--transport http --host <host> --port <port>` can still target an already-running ACP HTTP endpoint. One-shot use can pass `--message`, while interactive mode supports `/context`, `/new`, `/agent <agentId>`, `/sessions`, `/requests`, `/resume <sessionId>`, `/approvals`, `/approve`, `/reject`, `/cancel`, `/events`, `/trace`, `/health`, `/overview`, `/session`, `/request [requestId]`, and `/exit`. `/resume` now validates the target session, restores its latest request id, and rehydrates the active agent context; `/request <requestId>` can switch the active request context to a persisted request; `/new` clears the current session/request context without leaving the shell. Terminal chat now keeps one operator-facing flow: it streams tool and progress events as they happen and still prints the full final answer, instead of switching to a separate request-tree-only mode.
1230
- - Local repo usage differs from the published binary on purpose. After cloning the repo, use `npm run chat -- --workspace ./config` or `npm run agent-harness -- chat --workspace ./config`. The extra `--` matters: without it, npm treats `--workspace` as npm's own workspace flag. The standalone `agent-harness ...` command only works after the package has been installed or linked so the `bin` entry is on your `PATH`.
1231
- - Interactive chat now opens with a large ASCII startup banner that prints the active workspace, transport, and current override context before the command help so the shell feels like a dedicated runtime console instead of a raw REPL.
1232
- - When the workspace model/provider cannot be reached, chat now expands generic failures such as `runtime_error=fetch failed` into operator-facing diagnostics that include the configured provider, model, endpoint, and a concrete recovery hint, instead of leaving the shell at an opaque transport error.
1233
- - Chat startup now also performs a lightweight workspace-model preflight for the local Ollama path. If the configured endpoint is unreachable or responds with `404 page not found`, the shell prints that warning before the first prompt so endpoint mismatches show up immediately instead of only after the first failed message.
1234
- - The interactive prompt now carries the live `agent`, `session`, and short `request` identifier together, so after each reply and during shell-history navigation the user stays anchored to the current runtime turn instead of dropping back to a bare input prompt.
1235
- - `serveA2aHttp(runtime)` exposes an A2A-compatible HTTP JSON-RPC bridge plus agent card discovery, mapping both existing methods such as `message/send` and A2A v1.0 PascalCase methods such as `SendMessage`, `SendStreamingMessage`, `GetTask`, `ListTasks`, `CancelTask`, `SubscribeToTask`, `GetAgentCard`, `GetExtendedAgentCard`, and task push-notification config methods onto the existing session/request runtime surface. The bridge now advertises both `1.0` and `0.3` JSON-RPC interfaces, answers `HEAD` / `OPTIONS` discovery on the agent-card path, sets supported-version discovery headers, can optionally expose registry URLs plus detached signed-card metadata for surrounding discovery systems, validates `A2A-Version`, records `A2A-Extensions` into runtime invocation metadata, publishes `TASK_STATE_*` statuses plus the `{ task }` `SendMessage` wrapper, streams an initial `{ task }` snapshot plus later `{ statusUpdate }` payloads over SSE for v1 streaming methods, and can send best-effort webhook task snapshots for configured push notification receivers.
1236
- - For a managed local bridge, use `botbotgo a2a start --workspace . --host 127.0.0.1 --port 8080` and later `botbotgo a2a stop --workspace .`. This uses the same `.botbotgo/services/` state directory as ACP so both local protocol bridges follow one terminal-first workflow.
1237
- - `serveAgUiHttp(runtime)` exposes an AG-UI-compatible HTTP SSE bridge that projects runtime lifecycle, safe progress commentary, text output, upstream thinking, step progress, and tool calls onto `RUN_*`, `STATUS_UPDATE`, `TEXT_MESSAGE_*`, `THINKING_TEXT_MESSAGE_*`, `STEP_*`, and `TOOL_CALL_*` events for UI clients. `botbotgo ag-ui start|stop` now manages that HTTP bridge in the same workspace-local service registry as ACP, A2A, and runtime MCP.
1238
- - `createRuntimeMcpServer(runtime)`, `serveRuntimeMcpOverStdio(runtime)`, and `serveRuntimeMcpOverStreamableHttp(runtime)` expose the persisted runtime control surface itself as MCP tools, including sessions, requests, approvals, artifacts, events, and package export helpers. `botbotgo mcp serve --transport streamable-http --host 127.0.0.1 --port 8090` serves the same tool surface over Streamable HTTP, and `botbotgo mcp start|stop` manages that background endpoint for one workspace.
1239
- - `listRequestEvents(...)`, `listRequestTraceItems(...)`, and `exportRequestPackage(...)` are the request-first inspection helpers.
1240
- - `analyzeBoundaries(runtime)` returns a workspace boundary report covering agent, subagent, tool, and skill surfaces, including structural findings such as missing subagent references, unreferenced tools or skills, and skill allow-lists that do not match the owning agent's exposed tools.
1241
- - `exportRequestPackage(...)` and `exportSessionPackage(...)` package stable runtime records, transcript, approvals, events, artifacts, and governance evidence for operator tooling without reaching into persistence internals.
1242
- - `runtime/default.governance.remoteMcp` can now deny or allow specific MCP servers, raise approval requirements by transport, and stamp transport-based risk tiers into runtime governance bundles. MCP server catalogs can also declare trust tier, access mode, tenant scope, approval policy, prompt-injection risk, and OAuth scope metadata so governance bundles capture why one remote tool is treated as high-risk. Tool policy overrides can also set `decisionMode: manual | auto-approve | auto-reject | deny-and-continue` so operator evidence and execution behavior stay aligned.
1243
- - Protocol responsibilities stay split on purpose: ACP is the primary editor/client runtime boundary, A2A is the streaming-capable agent-platform bridge with polling compatibility, AG-UI is the UI event surface, and runtime MCP is the operator-facing control plane exported as MCP tools.
1244
- - `runtime/default.observability.tracing` can now describe exporter metadata such as OTLP endpoints and propagation mode, so frozen runtime snapshots keep trace-correlation plus operator-visible export context without exposing backend-private span internals.
1245
- - `agent-harness runtime overview`, `agent-harness runtime boundaries`, `agent-harness runtime health`, `agent-harness runtime approvals list|watch`, `agent-harness runtime requests list|tail`, and `agent-harness runtime export request|session` provide a thin operator CLI over workspace boundary analysis, persisted runtime health, queue pressure, governance risk, approval queues, active request state, and audit-ready evidence packages.
1246
- - detailed A2A adapter guidance lives in [`docs/a2a-bridge.md`](docs/a2a-bridge.md)
15
+ Docs: https://agent-harness.easynet.world/