open-multi-agent-kit 0.95.1 → 0.96.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 (306) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +16 -1
  3. package/dist/approvals/approval-receipt-store.d.ts +18 -0
  4. package/dist/approvals/approval-receipt-store.d.ts.map +1 -0
  5. package/dist/approvals/approval-receipt-store.js +194 -0
  6. package/dist/approvals/approval-receipt-store.js.map +1 -0
  7. package/dist/approvals/approval-receipt.d.ts +43 -0
  8. package/dist/approvals/approval-receipt.d.ts.map +1 -0
  9. package/dist/approvals/approval-receipt.js +208 -0
  10. package/dist/approvals/approval-receipt.js.map +1 -0
  11. package/dist/approvals/approval-verifier.d.ts +17 -0
  12. package/dist/approvals/approval-verifier.d.ts.map +1 -0
  13. package/dist/approvals/approval-verifier.js +23 -0
  14. package/dist/approvals/approval-verifier.js.map +1 -0
  15. package/dist/approvals/plannotator-approval-bridge.d.ts +58 -0
  16. package/dist/approvals/plannotator-approval-bridge.d.ts.map +1 -0
  17. package/dist/approvals/plannotator-approval-bridge.js +169 -0
  18. package/dist/approvals/plannotator-approval-bridge.js.map +1 -0
  19. package/dist/cli/args.d.ts.map +1 -1
  20. package/dist/cli/args.js +2 -0
  21. package/dist/cli/args.js.map +1 -1
  22. package/dist/commands/package-doctor-cli.d.ts +13 -0
  23. package/dist/commands/package-doctor-cli.d.ts.map +1 -0
  24. package/dist/commands/package-doctor-cli.js +80 -0
  25. package/dist/commands/package-doctor-cli.js.map +1 -0
  26. package/dist/commands/router-feedback-cli.d.ts +11 -0
  27. package/dist/commands/router-feedback-cli.d.ts.map +1 -0
  28. package/dist/commands/router-feedback-cli.js +99 -0
  29. package/dist/commands/router-feedback-cli.js.map +1 -0
  30. package/dist/commands/stats-cli.d.ts +20 -0
  31. package/dist/commands/stats-cli.d.ts.map +1 -0
  32. package/dist/commands/stats-cli.js +99 -0
  33. package/dist/commands/stats-cli.js.map +1 -0
  34. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  35. package/dist/core/agent-session-runtime.js +4 -1
  36. package/dist/core/agent-session-runtime.js.map +1 -1
  37. package/dist/core/agent-session.d.ts +99 -31
  38. package/dist/core/agent-session.d.ts.map +1 -1
  39. package/dist/core/agent-session.js +624 -216
  40. package/dist/core/agent-session.js.map +1 -1
  41. package/dist/core/bash-executor.d.ts.map +1 -1
  42. package/dist/core/bash-executor.js +8 -2
  43. package/dist/core/bash-executor.js.map +1 -1
  44. package/dist/core/compaction/transaction.d.ts +9 -0
  45. package/dist/core/compaction/transaction.d.ts.map +1 -1
  46. package/dist/core/compaction/transaction.js +17 -2
  47. package/dist/core/compaction/transaction.js.map +1 -1
  48. package/dist/core/context-budget-governor-v2.d.ts +1 -1
  49. package/dist/core/context-budget-governor-v2.d.ts.map +1 -1
  50. package/dist/core/context-budget-governor-v2.js +1 -1
  51. package/dist/core/context-budget-governor-v2.js.map +1 -1
  52. package/dist/core/context-budget-system-prompt.d.ts.map +1 -1
  53. package/dist/core/context-budget-system-prompt.js +18 -2
  54. package/dist/core/context-budget-system-prompt.js.map +1 -1
  55. package/dist/core/context-budget-v2-cache-disk.d.ts +109 -0
  56. package/dist/core/context-budget-v2-cache-disk.d.ts.map +1 -0
  57. package/dist/core/context-budget-v2-cache-disk.js +343 -0
  58. package/dist/core/context-budget-v2-cache-disk.js.map +1 -0
  59. package/dist/core/context-budget-v2-cache-keys.d.ts +22 -0
  60. package/dist/core/context-budget-v2-cache-keys.d.ts.map +1 -1
  61. package/dist/core/context-budget-v2-cache-keys.js +4 -4
  62. package/dist/core/context-budget-v2-cache-keys.js.map +1 -1
  63. package/dist/core/context-budget-v2-cache.d.ts +1 -0
  64. package/dist/core/context-budget-v2-cache.d.ts.map +1 -1
  65. package/dist/core/context-budget-v2-cache.js +1 -0
  66. package/dist/core/context-budget-v2-cache.js.map +1 -1
  67. package/dist/core/context-budget-v2-planner.d.ts.map +1 -1
  68. package/dist/core/context-budget-v2-planner.js +17 -14
  69. package/dist/core/context-budget-v2-planner.js.map +1 -1
  70. package/dist/core/context-budget-v2-types.d.ts +1 -0
  71. package/dist/core/context-budget-v2-types.d.ts.map +1 -1
  72. package/dist/core/context-budget-v2-types.js.map +1 -1
  73. package/dist/core/extensions/loader.d.ts.map +1 -1
  74. package/dist/core/extensions/loader.js +45 -22
  75. package/dist/core/extensions/loader.js.map +1 -1
  76. package/dist/core/extensions/types.d.ts +4 -0
  77. package/dist/core/extensions/types.d.ts.map +1 -1
  78. package/dist/core/extensions/types.js.map +1 -1
  79. package/dist/core/mcp/client.d.ts +105 -0
  80. package/dist/core/mcp/client.d.ts.map +1 -0
  81. package/dist/core/mcp/client.js +198 -0
  82. package/dist/core/mcp/client.js.map +1 -0
  83. package/dist/core/mcp/config.d.ts +23 -0
  84. package/dist/core/mcp/config.d.ts.map +1 -0
  85. package/dist/core/mcp/config.js +89 -0
  86. package/dist/core/mcp/config.js.map +1 -0
  87. package/dist/core/mcp/index.d.ts +15 -0
  88. package/dist/core/mcp/index.d.ts.map +1 -0
  89. package/dist/core/mcp/index.js +15 -0
  90. package/dist/core/mcp/index.js.map +1 -0
  91. package/dist/core/mcp/manager.d.ts +84 -0
  92. package/dist/core/mcp/manager.d.ts.map +1 -0
  93. package/dist/core/mcp/manager.js +173 -0
  94. package/dist/core/mcp/manager.js.map +1 -0
  95. package/dist/core/mcp/protocol.d.ts +59 -0
  96. package/dist/core/mcp/protocol.d.ts.map +1 -0
  97. package/dist/core/mcp/protocol.js +103 -0
  98. package/dist/core/mcp/protocol.js.map +1 -0
  99. package/dist/core/mcp/stdio-transport.d.ts +63 -0
  100. package/dist/core/mcp/stdio-transport.d.ts.map +1 -0
  101. package/dist/core/mcp/stdio-transport.js +132 -0
  102. package/dist/core/mcp/stdio-transport.js.map +1 -0
  103. package/dist/core/mcp/tools.d.ts +47 -0
  104. package/dist/core/mcp/tools.d.ts.map +1 -0
  105. package/dist/core/mcp/tools.js +102 -0
  106. package/dist/core/mcp/tools.js.map +1 -0
  107. package/dist/core/package-archive.d.ts +3 -0
  108. package/dist/core/package-archive.d.ts.map +1 -0
  109. package/dist/core/package-archive.js +161 -0
  110. package/dist/core/package-archive.js.map +1 -0
  111. package/dist/core/package-doctor-source-scan.d.ts +13 -0
  112. package/dist/core/package-doctor-source-scan.d.ts.map +1 -0
  113. package/dist/core/package-doctor-source-scan.js +124 -0
  114. package/dist/core/package-doctor-source-scan.js.map +1 -0
  115. package/dist/core/package-doctor.d.ts +41 -0
  116. package/dist/core/package-doctor.d.ts.map +1 -0
  117. package/dist/core/package-doctor.js +145 -0
  118. package/dist/core/package-doctor.js.map +1 -0
  119. package/dist/core/package-manager.d.ts +10 -1
  120. package/dist/core/package-manager.d.ts.map +1 -1
  121. package/dist/core/package-manager.js +175 -42
  122. package/dist/core/package-manager.js.map +1 -1
  123. package/dist/core/package-manifest.d.ts +26 -0
  124. package/dist/core/package-manifest.d.ts.map +1 -0
  125. package/dist/core/package-manifest.js +85 -0
  126. package/dist/core/package-manifest.js.map +1 -0
  127. package/dist/core/pi-compat.d.ts +5 -0
  128. package/dist/core/pi-compat.d.ts.map +1 -0
  129. package/dist/core/pi-compat.js +18 -0
  130. package/dist/core/pi-compat.js.map +1 -0
  131. package/dist/core/provider-resilience.d.ts +7 -0
  132. package/dist/core/provider-resilience.d.ts.map +1 -1
  133. package/dist/core/provider-resilience.js +11 -0
  134. package/dist/core/provider-resilience.js.map +1 -1
  135. package/dist/core/reasoning-router-bias.d.ts +10 -14
  136. package/dist/core/reasoning-router-bias.d.ts.map +1 -1
  137. package/dist/core/reasoning-router-bias.js +22 -15
  138. package/dist/core/reasoning-router-bias.js.map +1 -1
  139. package/dist/core/reasoning-router-v4.d.ts +9 -1
  140. package/dist/core/reasoning-router-v4.d.ts.map +1 -1
  141. package/dist/core/reasoning-router-v4.js +20 -5
  142. package/dist/core/reasoning-router-v4.js.map +1 -1
  143. package/dist/core/redaction.d.ts +2 -5
  144. package/dist/core/redaction.d.ts.map +1 -1
  145. package/dist/core/redaction.js +14 -1
  146. package/dist/core/redaction.js.map +1 -1
  147. package/dist/core/repository-learning-scope.d.ts +10 -0
  148. package/dist/core/repository-learning-scope.d.ts.map +1 -0
  149. package/dist/core/repository-learning-scope.js +42 -0
  150. package/dist/core/repository-learning-scope.js.map +1 -0
  151. package/dist/core/resource-loader.d.ts.map +1 -1
  152. package/dist/core/resource-loader.js +16 -1
  153. package/dist/core/resource-loader.js.map +1 -1
  154. package/dist/core/router-feedback-collector.d.ts +2 -1
  155. package/dist/core/router-feedback-collector.d.ts.map +1 -1
  156. package/dist/core/router-feedback-collector.js +2 -2
  157. package/dist/core/router-feedback-collector.js.map +1 -1
  158. package/dist/core/runtime-provenance.d.ts +54 -0
  159. package/dist/core/runtime-provenance.d.ts.map +1 -0
  160. package/dist/core/runtime-provenance.js +115 -0
  161. package/dist/core/runtime-provenance.js.map +1 -0
  162. package/dist/core/sandbox/backend.d.ts.map +1 -1
  163. package/dist/core/sandbox/backend.js +39 -21
  164. package/dist/core/sandbox/backend.js.map +1 -1
  165. package/dist/core/sandbox/default-policy.d.ts +4 -5
  166. package/dist/core/sandbox/default-policy.d.ts.map +1 -1
  167. package/dist/core/sandbox/default-policy.js +9 -11
  168. package/dist/core/sandbox/default-policy.js.map +1 -1
  169. package/dist/core/session-bash-runtime.d.ts +4 -4
  170. package/dist/core/session-bash-runtime.d.ts.map +1 -1
  171. package/dist/core/session-bash-runtime.js +6 -5
  172. package/dist/core/session-bash-runtime.js.map +1 -1
  173. package/dist/core/session-compaction-service.d.ts.map +1 -1
  174. package/dist/core/session-compaction-service.js +7 -7
  175. package/dist/core/session-compaction-service.js.map +1 -1
  176. package/dist/core/session-manager.d.ts +4 -1
  177. package/dist/core/session-manager.d.ts.map +1 -1
  178. package/dist/core/session-manager.js +47 -7
  179. package/dist/core/session-manager.js.map +1 -1
  180. package/dist/core/settings-manager.d.ts +7 -4
  181. package/dist/core/settings-manager.d.ts.map +1 -1
  182. package/dist/core/settings-manager.js +11 -3
  183. package/dist/core/settings-manager.js.map +1 -1
  184. package/dist/core/subagent-orchestration.d.ts.map +1 -1
  185. package/dist/core/subagent-orchestration.js +4 -2
  186. package/dist/core/subagent-orchestration.js.map +1 -1
  187. package/dist/core/system-prompt.d.ts +9 -1
  188. package/dist/core/system-prompt.d.ts.map +1 -1
  189. package/dist/core/system-prompt.js +10 -4
  190. package/dist/core/system-prompt.js.map +1 -1
  191. package/dist/core/tools/bash.d.ts +2 -2
  192. package/dist/core/tools/bash.d.ts.map +1 -1
  193. package/dist/core/tools/bash.js +2 -1
  194. package/dist/core/tools/bash.js.map +1 -1
  195. package/dist/core/tools/diagnostics.d.ts.map +1 -1
  196. package/dist/core/tools/diagnostics.js +8 -2
  197. package/dist/core/tools/diagnostics.js.map +1 -1
  198. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  199. package/dist/core/tools/tool-definition-wrapper.js +15 -0
  200. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  201. package/dist/core/turn-metrics.d.ts +135 -0
  202. package/dist/core/turn-metrics.d.ts.map +1 -0
  203. package/dist/core/turn-metrics.js +261 -0
  204. package/dist/core/turn-metrics.js.map +1 -0
  205. package/dist/core/verified-bash-runtime.d.ts.map +1 -1
  206. package/dist/core/verified-bash-runtime.js +10 -4
  207. package/dist/core/verified-bash-runtime.js.map +1 -1
  208. package/dist/guardrails/evidence-protocol.d.ts +10 -0
  209. package/dist/guardrails/evidence-protocol.d.ts.map +1 -0
  210. package/dist/guardrails/evidence-protocol.js +34 -0
  211. package/dist/guardrails/evidence-protocol.js.map +1 -0
  212. package/dist/guardrails/evidence-system.d.ts +3 -1
  213. package/dist/guardrails/evidence-system.d.ts.map +1 -1
  214. package/dist/guardrails/evidence-system.js +22 -14
  215. package/dist/guardrails/evidence-system.js.map +1 -1
  216. package/dist/guardrails/replay-ledger-lock-owner.d.ts +7 -0
  217. package/dist/guardrails/replay-ledger-lock-owner.d.ts.map +1 -1
  218. package/dist/guardrails/replay-ledger-lock-owner.js +42 -1
  219. package/dist/guardrails/replay-ledger-lock-owner.js.map +1 -1
  220. package/dist/guardrails/replay-payload-hash.d.ts +6 -0
  221. package/dist/guardrails/replay-payload-hash.d.ts.map +1 -0
  222. package/dist/guardrails/replay-payload-hash.js +24 -0
  223. package/dist/guardrails/replay-payload-hash.js.map +1 -0
  224. package/dist/index.d.ts +8 -2
  225. package/dist/index.d.ts.map +1 -1
  226. package/dist/index.js +7 -1
  227. package/dist/index.js.map +1 -1
  228. package/dist/main.d.ts.map +1 -1
  229. package/dist/main.js +18 -0
  230. package/dist/main.js.map +1 -1
  231. package/dist/modes/interactive/components/control-panel-layout.d.ts.map +1 -1
  232. package/dist/modes/interactive/components/control-panel-layout.js +2 -2
  233. package/dist/modes/interactive/components/control-panel-layout.js.map +1 -1
  234. package/dist/modes/interactive/components/footer.d.ts +3 -0
  235. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  236. package/dist/modes/interactive/components/footer.js +40 -12
  237. package/dist/modes/interactive/components/footer.js.map +1 -1
  238. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  239. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  240. package/dist/modes/interactive/components/settings-selector.js +10 -0
  241. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  242. package/dist/modes/interactive/components/status-sidebar.d.ts +14 -2
  243. package/dist/modes/interactive/components/status-sidebar.d.ts.map +1 -1
  244. package/dist/modes/interactive/components/status-sidebar.js +106 -19
  245. package/dist/modes/interactive/components/status-sidebar.js.map +1 -1
  246. package/dist/modes/interactive/interactive-mode.d.ts +10 -1
  247. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  248. package/dist/modes/interactive/interactive-mode.js +104 -17
  249. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  250. package/dist/modes/interactive/theme/dark.json +1 -1
  251. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  252. package/dist/modes/interactive/theme/theme.js +1 -0
  253. package/dist/modes/interactive/theme/theme.js.map +1 -1
  254. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  255. package/dist/modes/rpc/rpc-mode.js +1 -1
  256. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  257. package/dist/types/evidence.d.ts +11 -3
  258. package/dist/types/evidence.d.ts.map +1 -1
  259. package/dist/types/evidence.js.map +1 -1
  260. package/docs/book-to-skill.md +79 -0
  261. package/docs/compaction.md +35 -3
  262. package/docs/containerization.md +14 -2
  263. package/docs/docs.json +16 -0
  264. package/docs/environment-variables.md +1 -1
  265. package/docs/extensions.md +75 -16
  266. package/docs/index.md +3 -0
  267. package/docs/mcp.md +97 -0
  268. package/docs/metrics.md +87 -0
  269. package/docs/models.md +12 -0
  270. package/docs/packages.md +25 -4
  271. package/docs/provider-resilience.md +37 -56
  272. package/docs/providers.md +5 -1
  273. package/docs/run-protocol.md +72 -0
  274. package/docs/sdk.md +40 -6
  275. package/docs/sessions.md +6 -0
  276. package/docs/settings.md +10 -7
  277. package/docs/skills.md +9 -1
  278. package/docs/usage.md +14 -4
  279. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  280. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  281. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  282. package/examples/extensions/gondolin/package-lock.json +2 -2
  283. package/examples/extensions/gondolin/package.json +1 -1
  284. package/examples/extensions/plannotator-approval-bridge.ts +83 -0
  285. package/examples/extensions/sandbox/package-lock.json +2 -2
  286. package/examples/extensions/sandbox/package.json +1 -1
  287. package/examples/extensions/subagent/README.md +21 -11
  288. package/examples/extensions/subagent/adaptive-agent-runtime.ts +9 -3
  289. package/examples/extensions/subagent/agents/planner.md +0 -2
  290. package/examples/extensions/subagent/agents/reviewer.md +0 -2
  291. package/examples/extensions/subagent/agents/scout.md +0 -2
  292. package/examples/extensions/subagent/agents/worker.md +0 -1
  293. package/examples/extensions/subagent/agents.test.ts +9 -0
  294. package/examples/extensions/subagent/agents.ts +11 -4
  295. package/examples/extensions/subagent/deadline-budget.test.ts +32 -0
  296. package/examples/extensions/subagent/deadline-budget.ts +25 -1
  297. package/examples/extensions/subagent/fixtures/fake-omk-json.mjs +10 -0
  298. package/examples/extensions/subagent/index.ts +234 -55
  299. package/examples/extensions/subagent/subagent-execution-policy.test.ts +27 -0
  300. package/examples/extensions/subagent/subagent-extension-smoke.test.ts +167 -2
  301. package/examples/extensions/subagent/workflow-graph.test.ts +80 -0
  302. package/examples/extensions/subagent/workflow-graph.ts +89 -0
  303. package/examples/extensions/with-deps/package-lock.json +2 -2
  304. package/examples/extensions/with-deps/package.json +1 -1
  305. package/npm-shrinkwrap.json +275 -439
  306. package/package.json +11 -8
package/docs/mcp.md ADDED
@@ -0,0 +1,97 @@
1
+ # MCP
2
+
3
+ OMK speaks the [Model Context Protocol](https://modelcontextprotocol.io) as a
4
+ **client**: it starts configured servers, lists their tools, and exposes those
5
+ tools to the model alongside the built-in ones.
6
+
7
+ Two separate surfaces exist, and they are easy to confuse:
8
+
9
+ | Surface | Module | What it does |
10
+ | --- | --- | --- |
11
+ | Inventory / health | `core/mcp-inventory.ts` | Reads configuration read-only for `omk doctor` and the MCP health view. **Never starts a server.** Env *values* are stripped. |
12
+ | Runtime client | `core/mcp/` | Starts servers, performs the handshake, and registers their tools for a session. |
13
+
14
+ ## Configuration
15
+
16
+ Servers are read from three files, later wins on a name collision:
17
+
18
+ 1. `~/.kimi/mcp.json`
19
+ 2. `~/.omk/mcp.json`
20
+ 3. `<cwd>/.omk/mcp.json`
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "playwright": {
26
+ "command": "npx",
27
+ "args": ["-y", "@playwright/mcp@latest"],
28
+ "startup_timeout_sec": 60
29
+ },
30
+ "serena": {
31
+ "command": "uvx",
32
+ "args": ["--from", "git+https://github.com/oraios/serena", "serena"],
33
+ "env": { "SERENA_LOG_LEVEL": "error" }
34
+ },
35
+ "retired": { "command": "npx", "args": ["-y", "old-server"], "disabled": true }
36
+ }
37
+ }
38
+ ```
39
+
40
+ | Field | Meaning |
41
+ | --- | --- |
42
+ | `command`, `args` | Executable to spawn. **Required** — entries with only a `url` are skipped, since stdio is the supported transport. |
43
+ | `env` | Extra environment for the child. Merged over the parent environment. Values are runtime-only and are never rendered or logged. |
44
+ | `cwd` | Working directory. Defaults to the session's cwd. |
45
+ | `disabled` / `enabled: false` | Skip without deleting the entry. |
46
+ | `startup_timeout_sec` | Handshake deadline. Raise it for `npx -y …@latest` servers whose first run downloads a package. |
47
+
48
+ ## Using it
49
+
50
+ ```ts
51
+ const status = await session.attachMcpServers();
52
+ // [{ name: "playwright", state: "ready", toolCount: 24, serverVersion: "1.62.0" }]
53
+
54
+ session.getToolDefinition("playwright__navigate");
55
+ ```
56
+
57
+ - **Nothing is spawned until `attachMcpServers()` is called.** A workspace can
58
+ configure 25 servers without paying for them at startup.
59
+ - Tools are exposed as `<server>__<tool>`, truncated to 64 characters with the
60
+ server prefix preserved.
61
+ - A built-in tool always wins a name collision; MCP can never shadow `bash`.
62
+ - Calling `attachMcpServers()` again replaces the previous MCP tools rather than
63
+ duplicating them.
64
+ - `session.dispose()` terminates every server it started.
65
+
66
+ ### Failure behavior
67
+
68
+ Failures are isolated by design, because one broken server must not cost a
69
+ session:
70
+
71
+ | Failure | Result |
72
+ | --- | --- |
73
+ | Server exits during startup | That server is `failed` with its stderr tail; every other server still contributes tools. |
74
+ | Handshake exceeds `startup_timeout_sec` | Same — reported as a timeout, session unaffected. |
75
+ | Server dies mid-session | In-flight requests reject; later calls to its tools return a tool-level error instead of throwing. |
76
+ | Tool returns an MCP error | Surfaces as a normal tool result with `isError: true`, so the model sees the server's own message. |
77
+ | Server emits a non-JSON line | The line is dropped and decoding resynchronizes at the next newline. |
78
+
79
+ ## Checking your configuration
80
+
81
+ ```bash
82
+ node scripts/mcp-smoke.mjs # connect everything, print status
83
+ node scripts/mcp-smoke.mjs github playwright # only these
84
+ OMK_MCP_SMOKE_HANDSHAKE_MS=120000 node scripts/mcp-smoke.mjs # override slow handshakes
85
+ ```
86
+
87
+ The script prints server state, tool counts, and versions. It never prints env
88
+ values.
89
+
90
+ ## Scope
91
+
92
+ Implemented: `initialize`, `notifications/initialized`, `tools/list`,
93
+ `tools/call` over stdio.
94
+
95
+ Not implemented: HTTP/SSE transports, resources, prompts, sampling, and
96
+ server-initiated requests. Every OMK-configured server today is stdio, and
97
+ adding a surface nothing calls would be dead weight.
@@ -0,0 +1,87 @@
1
+ # Turn metrics
2
+
3
+ OMK records one JSON line per agent turn so harness changes can be measured
4
+ instead of guessed.
5
+
6
+ This is separate from the two things that already existed:
7
+
8
+ | Surface | Purpose |
9
+ | --- | --- |
10
+ | `core/run-journal.ts` | Hash-chained **integrity** log (run started/finished/recovered, tool timeout). Answers "was this run tampered with or abandoned". |
11
+ | `core/telemetry.ts` | Install-time opt-in flag. Nothing else. |
12
+ | `core/turn-metrics.ts` | **Performance and quality**: cost, latency, tool failure rates, cache effectiveness. |
13
+
14
+ ## Where it goes
15
+
16
+ `<cwd>/.omk/metrics/turns.jsonl`, append-only, rotated once past 8 MB
17
+ (`turns.jsonl.1`), file mode `600`.
18
+
19
+ | Variable | Effect |
20
+ | --- | --- |
21
+ | `OMK_TURN_METRICS=0` | Disable recording entirely. |
22
+ | `OMK_TURN_METRICS_DIR` | Write somewhere else. |
23
+
24
+ ## Reading it
25
+
26
+ ```bash
27
+ omk stats # aggregate report for the current project
28
+ omk stats --dir <path> # a different metrics directory
29
+ omk stats --json # machine-readable summary
30
+ ```
31
+
32
+ ```text
33
+ Turn metrics — 412 turns across 27 session(s)
34
+ models anthropic/claude-sonnet-4-5
35
+ turn duration p50 4.2s · p95 31.8s
36
+ input 91,204 · output 22,880 · cacheRead 1,904,551 · cacheWrite 88,100
37
+ cache read share 95.4% of prompt-side usage
38
+ cost $4.8812
39
+ compactions 6 · failovers 1 · ctx plan hit 41.2%
40
+
41
+ tool calls fail% p50 p95 total
42
+ bash 688 4.2% 210ms 3.1s 4.1m
43
+ edit 201 9.0% 38ms 140ms 12.4s
44
+ ```
45
+
46
+ ## What is recorded
47
+
48
+ Counts, durations, ids, and error *classes*:
49
+
50
+ ```json
51
+ {
52
+ "schemaVersion": "omk-turn-metrics-1",
53
+ "sessionId": "…", "turnIndex": 12,
54
+ "provider": "anthropic", "model": "claude-sonnet-4-5",
55
+ "startedAtEpochMs": 1, "endedAtEpochMs": 2, "durationMs": 1,
56
+ "usage": { "input": 100, "output": 20, "cacheRead": 900, "cacheWrite": 10, "costUsd": 0.0125 },
57
+ "stopReason": "toolUse",
58
+ "toolCalls": [{ "name": "bash", "durationMs": 120, "ok": false, "error": "exit 1" }],
59
+ "toolCallCount": 1, "toolFailureCount": 1
60
+ }
61
+ ```
62
+
63
+ **Never recorded:** prompt text, tool arguments, tool output, file contents, or
64
+ environment values. Tool error strings are whitespace-collapsed and truncated to
65
+ 200 characters — enough to tell failure modes apart, too short to carry a
66
+ payload.
67
+
68
+ Metrics are advisory. A failed write is counted and dropped; it can never make a
69
+ turn fail.
70
+
71
+ ## Capability baseline
72
+
73
+ Runtime metrics tell you what a session cost, not whether the harness can solve
74
+ tasks. For that, `scripts/tb-mini-suite.mjs` selects a deterministic,
75
+ difficulty-balanced Terminal-Bench 2.1 subset so scores are comparable across
76
+ runs:
77
+
78
+ ```bash
79
+ node scripts/tb-mini-suite.mjs # human-readable selection
80
+ node scripts/tb-mini-suite.mjs --json # feed a runner
81
+ node scripts/tb-mini-suite.mjs --seed 7 # a different fixed subset
82
+ ```
83
+
84
+ Selection is a pure function of (tasks directory, seed, size): the same inputs
85
+ always produce the same task list, which is the whole point of using it as a
86
+ regression gate. The scoring run itself requires Docker, `harbor`, and real
87
+ model spend — it is deliberately not wired into `npm run check`.
package/docs/models.md CHANGED
@@ -4,6 +4,7 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.omk/a
4
4
 
5
5
  ## Table of Contents
6
6
 
7
+ - [Built-in NVIDIA GLM-5.2](#built-in-nvidia-glm-52)
7
8
  - [Minimal Example](#minimal-example)
8
9
  - [Full Example](#full-example)
9
10
  - [Supported APIs](#supported-apis)
@@ -14,6 +15,10 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.omk/a
14
15
  - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
15
16
  - [OpenAI Compatibility](#openai-compatibility)
16
17
 
18
+ ## Built-in NVIDIA GLM-5.2
19
+
20
+ With `NVIDIA_API_KEY` configured, `nvidia/z-ai/glm-5.2` supports OMK thinking levels through NVIDIA NIM. Its generated metadata explicitly enables `reasoning_effort`, so `/thinking max` is sent as `reasoning_effort: "max"`. Other NVIDIA models do not inherit that capability automatically.
21
+
17
22
  ## Minimal Example
18
23
 
19
24
  For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
@@ -146,22 +151,29 @@ Set `api` at provider level (default for all models) or model level (override pe
146
151
  The `apiKey` and `headers` fields support command execution, environment interpolation, and literals:
147
152
 
148
153
  - **Shell command:** `"!command"` at the start executes the whole value as a command and uses stdout
154
+
149
155
  ```json
150
156
  "apiKey": "!security find-generic-password -ws 'anthropic'"
151
157
  "apiKey": "!op read 'op://vault/item/credential'"
152
158
  ```
159
+
153
160
  - **Environment interpolation:** `"$ENV_VAR"` or `"${ENV_VAR}"` uses the value of the named variable. Interpolation works inside larger literals.
161
+
154
162
  ```json
155
163
  "apiKey": "$MY_API_KEY"
156
164
  "apiKey": "${KEY_PREFIX}_${KEY_SUFFIX}"
157
165
  ```
166
+
158
167
  `$FOO_BAR` is the variable `FOO_BAR`; use `${FOO}_BAR` when `BAR` is literal text. Missing environment variables make the value unresolved.
159
168
  - **Escapes:** `"$$"` emits a literal `"$"`; `"$!"` emits a literal `"!"` without triggering command execution.
169
+
160
170
  ```json
161
171
  "apiKey": "$$literal-dollar-prefix"
162
172
  "apiKey": "$!literal-bang-prefix"
163
173
  ```
174
+
164
175
  - **Literal value:** Used directly
176
+
165
177
  ```json
166
178
  "apiKey": "sk-..."
167
179
  ```
package/docs/packages.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  # OMK Packages
4
4
 
5
- OMK packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `omk` key, or use conventional directories.
5
+ OMK packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under `omk` or the compatible `pi` key, or use conventional directories.
6
6
 
7
7
  ## Table of Contents
8
8
 
9
9
  - [Install and Manage](#install-and-manage)
10
+ - [Pi Compatibility and Package Doctor](#pi-compatibility-and-package-doctor)
10
11
  - [Package Sources](#package-sources)
11
12
  - [Creating a OMK Package](#creating-a-omk-package)
12
13
  - [Package Structure](#package-structure)
@@ -28,6 +29,7 @@ omk install ./relative/path/to/package
28
29
 
29
30
  omk remove npm:@foo/bar
30
31
  omk list # show installed packages from settings
32
+ omk package doctor npm:@foo/bar@1.0.0 # static compatibility report as JSON
31
33
  omk update # update omk, update packages, and reconcile pinned git refs
32
34
  omk update --extensions # update packages and reconcile pinned git refs only
33
35
  omk update --self # update omk only
@@ -47,6 +49,24 @@ omk -e npm:@foo/bar
47
49
  omk -e git:github.com/user/repo
48
50
  ```
49
51
 
52
+ ## Pi Compatibility and Package Doctor
53
+
54
+ OMK reads package manifests in strict priority order: `omk`, then `pi`, then conventional directories. The first present manifest is authoritative. If it is malformed, OMK reports the error instead of silently falling back. When both keys exist, `omk` wins and the doctor reports that `pi` was shadowed.
55
+
56
+ A Pi extension directory entry such as `"extensions": ["./"]` resolves to its `index.ts`, `index.js`, `index.mjs`, or `index.cjs`. It is not recursively treated as a directory of independent extensions.
57
+
58
+ Inspect a local, npm, or git source before installing it:
59
+
60
+ ```bash
61
+ omk package doctor ./local-package
62
+ omk package doctor npm:@scope/package@1.2.3 > package-doctor.json
63
+ omk package doctor git:github.com/user/repo@v1
64
+ ```
65
+
66
+ The command emits a versioned JSON report and returns `0` when no compatibility error is found, `1` for an incompatible package or inspection failure, and `2` for invalid CLI usage. It checks manifest precedence, declared resources, legacy Pi runtime imports, `.pi` storage paths, lifecycle event names, headless UI guards, and resume signals.
67
+
68
+ The doctor never imports extension modules. For npm sources it downloads the registry tarball with `npm pack --ignore-scripts` and extracts bounded regular files without installing dependencies. Git inspection clones without running `npm install`. These static checks are advisory and do not make third-party code trusted.
69
+
50
70
  ## Package Sources
51
71
 
52
72
  OMK accepts three source types in settings and `omk install`.
@@ -91,6 +111,7 @@ ssh://git@github.com/user/repo@v1
91
111
  - When reconciliation changes the checkout, omk resets and cleans the clone, then runs `npm install` if `package.json` exists.
92
112
 
93
113
  **SSH examples:**
114
+
94
115
  ```bash
95
116
  # git@host:path shorthand (requires git: prefix)
96
117
  omk install git:git@github.com:user/repo
@@ -113,7 +134,7 @@ Local paths point to files or directories on disk and are added to settings with
113
134
 
114
135
  ## Creating a OMK Package
115
136
 
116
- Add a `omk` manifest to `package.json` or use conventional directories. Include the `omk-package` keyword for discoverability.
137
+ Add an `omk` manifest to `package.json` or use conventional directories. OMK also reads a Pi-compatible `pi` manifest when `omk` is absent. Include the `omk-package` keyword for discoverability.
117
138
 
118
139
  ```json
119
140
  {
@@ -155,7 +176,7 @@ If both are set, video takes precedence.
155
176
 
156
177
  ### Convention Directories
157
178
 
158
- If no `omk` manifest is present, omk auto-discovers resources from these directories:
179
+ If neither an `omk` nor a `pi` manifest is present, omk auto-discovers resources from these directories:
159
180
 
160
181
  - `extensions/` loads `.ts` and `.js` files
161
182
  - `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
@@ -164,7 +185,7 @@ If no `omk` manifest is present, omk auto-discovers resources from these directo
164
185
 
165
186
  ## Dependencies
166
187
 
167
- Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When omk installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
188
+ Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. Normal npm and git installation installs runtime dependencies automatically. `omk package doctor` is different: it does not install dependencies or execute lifecycle scripts.
168
189
 
169
190
  OMK bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `omk-ai`, `omk-agent-core`, `open-multi-agent-kit`, `omk-tui`, `typebox`.
170
191
 
@@ -1,87 +1,68 @@
1
- # Provider resilience (root-level)
1
+ # Provider Resilience
2
2
 
3
- Built into OMK core not an optional extension.
3
+ OMK can recover an agent turn from provider failures that are unlikely to succeed unchanged:
4
4
 
5
- ## What it does
5
+ - content or safety stops reported as errors
6
+ - billing-cycle or quota exhaustion
7
+ - orphaned `tool_call_id` protocol errors
8
+ - transient transport and server failures
6
9
 
7
- 1. **Blocks sticky safety models** (e.g. `claude-fable-5`) from being selected as the session chat model.
8
- 2. **Ejects** them at prompt time if a resumed session still has one loaded.
9
- 3. On **content/safety stop** (`stop_reason=refusal`), **auto-failovers** to `k3 → grok-4.5 → deepseek` before retry.
10
- 4. Works with message sanitize (`transform-messages` orphan `tool_call_id` drop) so K3 protocol 400s can heal on retry.
10
+ This is availability behavior, not a safety bypass. Provider safety policy and the user's configured model access remain authoritative.
11
11
 
12
- This is session survival engineering, not a jailbreak.
12
+ ## Settings
13
13
 
14
- ## Settings (`~/.omk/agent/settings.json`)
14
+ Configure resilience in `~/.omk/agent/settings.json` or `.omk/settings.json`:
15
15
 
16
16
  ```json
17
17
  {
18
- "defaultProvider": "kimi-coding",
19
- "defaultModel": "k3",
20
18
  "providerResilience": {
21
19
  "blockStickySafetyModels": true,
22
20
  "autoFailoverOnSafetyStop": true,
23
21
  "failoverCandidates": [
24
22
  { "provider": "kimi-coding", "id": "k3" },
25
- { "provider": "grok-oauth-proxy", "id": "grok-4.5" },
26
- { "provider": "deepseek", "id": "deepseek-v4-pro" }
23
+ { "provider": "modelstudio-maas", "id": "qwen3.8-max-preview" }
27
24
  ]
28
25
  }
29
26
  }
30
27
  ```
31
28
 
32
- | Key | Default | Meaning |
33
- |---|---|---|
34
- | `blockStickySafetyModels` | `true` | Refuse `setModel` / initial pick of Fable-class ids |
35
- | `autoFailoverOnSafetyStop` | `true` | Switch model before auto-retry on safety stop |
36
- | `failoverCandidates` | k3→grok→deepseek… | Ordered targets |
29
+ | Setting | Default | Behavior |
30
+ |---|---:|---|
31
+ | `blockStickySafetyModels` | `true` | Rejects models known to produce sticky false-positive safety stops. |
32
+ | `autoFailoverOnSafetyStop` | `true` | Enables failover for safety stops and quota/billing exhaustion. |
33
+ | `failoverCandidates` | built-in chain | Ordered models considered before an automatic retry. |
37
34
 
38
- Disable only if you intentionally want Fable:
35
+ Automatic recovery also requires `retry.enabled: true` and available retry budget.
39
36
 
40
- ```json
41
- "providerResilience": { "blockStickySafetyModels": false, "autoFailoverOnSafetyStop": false }
42
- ```
37
+ ## Failover behavior
43
38
 
44
- ## Code
39
+ For a safety stop or recognized quota/billing error, OMK:
45
40
 
46
- | Module | Role |
47
- |---|---|
48
- | `src/core/provider-resilience.ts` | Shared detectors + failover pick |
49
- | `src/core/agent-session.ts` | eject / failover / retry wiring |
50
- | `src/core/model-resolver.ts` | skip sticky on initial model pick |
51
- | `src/core/settings-manager.ts` | `providerResilience` settings |
52
- | `packages/ai/.../transform-messages.ts` | drop orphan tool results |
41
+ 1. classifies the failed provider attempt;
42
+ 2. excludes the current model and models already failed during this retry sequence;
43
+ 3. selects the first non-sticky candidate that exists and has configured authentication;
44
+ 4. switches models before retrying with a short delay.
53
45
 
54
- ## How Fable is neutralized (not "jailbroken")
46
+ If no candidate qualifies, the normal same-model retry policy and backoff apply. Plain authentication errors remain non-retryable and do not trigger failover.
55
47
 
56
- Server-side content/safety stops cannot be removed by OAuth RE or local patches.
57
- OMK **deletes Fable from the operational surface**:
48
+ Recognized quota shapes include billing-cycle usage limits, `insufficient_quota`, exhausted balances, `GoUsageLimitError`, `FreeUsageLimitError`, and out-of-budget responses. These are classified as `provider.rate_limit`, even when a provider wraps them in HTTP 403.
58
49
 
59
- | Layer | Kill switch |
60
- |---|---|
61
- | `models.json` | `claude-fable-5` removed from anthropic catalog |
62
- | `model-registry.loadModels` | `/fable/i` filtered unless `OMK_ALLOW_STICKY_SAFETY_MODELS=1` |
63
- | `model-resolver` | sticky skipped; k3 preferred |
64
- | `setModel` | throws if sticky + block on |
65
- | `cycleModel` (scoped + available) | sticky filtered; goes through `setModel` |
66
- | prompt boundary | ejects leftover Fable session model → k3 |
67
- | safety-stop retry | failover chain before continue |
50
+ The default candidate order is:
68
51
 
69
- **You don't fight Fable. You never load it.**
52
+ 1. `kimi-coding/k3`
53
+ 2. `modelstudio-maas/qwen3.8-max-preview`
54
+ 3. `grok-oauth-proxy/grok-4.5`
55
+ 4. `deepseek/deepseek-v4-pro`
56
+ 5. `deepseek/deepseek-v4-flash`
57
+ 6. `modelstudio-maas/deepseek-v4-pro`
58
+ 7. `kimi-coding/kimi-for-coding`
70
59
 
71
- ## Operator
60
+ ## Retry and termination events
72
61
 
73
- ```
74
- # after rebuild — restart OMK session (required)
62
+ Each provider attempt is journaled separately and emits `session_termination`. A retryable failure is attempt-level when an `auto_retry_start` event follows it. A recovered retry later emits a `completed` termination; an exhausted retry budget leaves the last provider failure as the final termination.
75
63
 
76
- /model k3 # if still on a bad model
77
- /new # if transcript is corrupted (orphan tool ids)
78
-
79
- # emergency re-enable Fable (not recommended)
80
- OMK_ALLOW_STICKY_SAFETY_MODELS=1 omk
81
- # and settings: providerResilience.blockStickySafetyModels=false
82
- ```
64
+ See [Sessions](sessions.md#retries-and-termination-events) for consumer guidance.
83
65
 
84
- ## arXiv note (2026-07)
66
+ ## Protocol recovery
85
67
 
86
- Recent cs.CL hits on refusal/jailbreak are mostly attack-ASR / weight-edit / prefill studies.
87
- No immediate ops patch beyond routing+sanitize already in-tree. Skip theory-only papers.
68
+ For orphaned `tool_call_id` errors, OMK removes the failed assistant message from the live retry context. The standard message transform then drops tool results whose originating call is absent. Persisted session history remains unchanged for auditability.
package/docs/providers.md CHANGED
@@ -33,7 +33,7 @@ Alibaba Model Studio Token Plan is recognized as **QWEN TOKEN PLAN** but shows `
33
33
 
34
34
  - Requires ChatGPT Plus or Pro subscription
35
35
  - Officially endorsed by OpenAI: [Codex for OSS](https://developers.openai.com/community/codex-for-oss)
36
- - `gpt-5.6-moa` is a tool-free virtual model that runs bounded GPT-5.6 Sol and Terra advisers concurrently, then streams a Sol synthesis. It performs three inference calls per turn, caps adviser/synthesis output independently, and is intended for analysis, review, and answer synthesis; use Sol or Terra directly when tools are required.
36
+ - `gpt-5.6-moa` runs bounded, tool-free GPT-5.6 Sol and Terra advisers concurrently, then streams a Sol synthesis with the active tools and tool history. Synthesis tool calls enter the normal agent loop; each follow-up model turn repeats the three-call workflow. Adviser and synthesis output remain independently capped.
37
37
  - The Codex backend accepts `xhigh` as its highest literal reasoning effort. OMK's `max` and `ultra` tiers map to `xhigh`; `ultra` on the MoA model additionally represents the Sol/Terra delegation workflow.
38
38
 
39
39
  ```bash
@@ -99,6 +99,10 @@ omk
99
99
 
100
100
  Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/dmae97/omk/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/dmae97/omk/blob/main/packages/ai/src/env-api-keys.ts).
101
101
 
102
+ #### NVIDIA NIM
103
+
104
+ Set `NVIDIA_API_KEY` and select an NVIDIA model with `/model`. The built-in `nvidia/z-ai/glm-5.2` entry sends `reasoning_effort`, including the `max` level. Other NVIDIA models keep conservative compatibility defaults unless their model metadata explicitly enables reasoning effort.
105
+
102
106
  #### Zyloo
103
107
 
104
108
  Zyloo is an OpenAI-compatible unified API gateway. Set `ZYLOO_API_KEY` and use any Zyloo-hosted model:
@@ -0,0 +1,72 @@
1
+ # OMK Run Protocol v1
2
+
3
+ The OMK Run Protocol defines one versioned contract for task execution and evaluation:
4
+
5
+ ```text
6
+ TaskSpec -> ExecutionAttempt -> Observation -> EvaluationResult -> RuntimeDecision
7
+ ```
8
+
9
+ `omk-protocol` owns these records and the pure reducers that connect them. Tool execution, persistence, scheduling, routing, and topology remain outside the package.
10
+
11
+ ## Implemented scope
12
+
13
+ The first v1 slice is available under `packages/protocol` with schema version `omk.run.v1`.
14
+
15
+ | Contract | Purpose |
16
+ | --- | --- |
17
+ | `TaskSpec` | Goal and required or advisory `ClaimPredicate` records |
18
+ | `ExecutionAttempt` | One completed initial, retry, failover, or resumed execution |
19
+ | `Observation` | Immutable facts tied to a task and attempt |
20
+ | `ClaimEvaluation` | Derived `satisfied`, `violated`, or `inconclusive` claim result |
21
+ | `EvaluationResult` | Claim evaluations plus one semantic `pass`, `fail`, or `inconclusive` verdict |
22
+ | `RuntimeDecision` | Pure `continue`, `retry`, `failover`, or `stop` decision |
23
+ | `WaiverRecord` | Explicit, scoped, attributable, and optionally expiring exception |
24
+
25
+ Every top-level record carries `schemaVersion`. Parsers reject unsupported versions, malformed timestamps, duplicate claim IDs, invalid JSON facts, and empty logical conditions.
26
+
27
+ ## Evaluation model
28
+
29
+ `evaluateTask()` is a pure `TaskSpec + ExecutionAttempt + Observation[] + WaiverRecord[] -> EvaluationResult` reducer. It does not mutate its inputs or stored evidence.
30
+
31
+ An observation condition selects facts by observation kind and task or attempt scope. Its expected facts are a recursive object subset; arrays match exactly.
32
+
33
+ - no candidate observation: `inconclusive`
34
+ - candidate with matching facts: `satisfied`
35
+ - candidates present but none match: `violated`
36
+ - `all`, `any`, and `not` compose conditions without adding evaluator state
37
+
38
+ Required, unwaived violations reduce to `fail`. Required, unwaived missing observations reduce to `inconclusive`. Otherwise the semantic verdict is `pass`. Advisory claims are reported but do not block. A task with no required claims is `inconclusive`.
39
+
40
+ `reduceRuntimeDecision()` then maps the semantic verdict through an explicit runtime policy. `pass` always stops successfully; fail and inconclusive behavior is supplied as `onFail` and `onInconclusive`. Retry and failover counters are not fields: consumers derive them from `ExecutionAttempt` records.
41
+
42
+ ## Waivers
43
+
44
+ A waiver names one task and claim, the approver, approval time, rationale, and evidence references. It may be limited to one attempt and may expire. Evaluation fails closed for cross-task, unknown-claim, future-approved, expired, duplicate, or advisory-claim waivers. The underlying claim result remains visible; `waiverId` records why it did not block.
45
+
46
+ ## EvidenceReceipt v3 bridge
47
+
48
+ `EvidenceReceipt v3` remains the integrity layer. `evidenceReceiptToObservation()` from `open-multi-agent-kit` validates the immutable core digest, then projects only execution facts into an `Observation`:
49
+
50
+ - receipt schema version and claim text
51
+ - exit code, timeout flag, and abort flag
52
+ - duration and executor
53
+ - a digest-bound receipt reference
54
+
55
+ The adapter deliberately omits the legacy mutable evidence status. Receipt digest validation does not prove ledger membership, trusted attestation, runner honesty, freshness, or OS isolation; apply those checks separately before trusting the observation.
56
+
57
+ ```typescript
58
+ import { evaluateTask, reduceRuntimeDecision } from "omk-protocol";
59
+ import { evidenceReceiptToObservation } from "open-multi-agent-kit";
60
+ ```
61
+
62
+ The legacy `TaskContract`, `EvidenceStatus`, `TaskContractBuilder.setVerdict()`, and `updateEvidenceStatus()` remain for compatibility and are deprecated. New code should append observations and recompute evaluation.
63
+
64
+ ## Authority boundaries
65
+
66
+ This slice does not change runtime ownership:
67
+
68
+ - the coding-agent still owns provider retry and failover execution;
69
+ - AdaptOrch WPL still owns its existing work-packet state machine and adjudication types;
70
+ - scheduler and router separation, topology validation, background-task durability, and algorithm-isolation work remain follow-up migrations.
71
+
72
+ Those components should consume `omk-protocol` rather than define new task, attempt, observation, or semantic-verdict types.