open-multi-agent-kit 0.98.3 → 0.98.5

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 (468) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +12 -2
  3. package/dist/cli/args.d.ts +1 -0
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +14 -0
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/help.d.ts.map +1 -1
  8. package/dist/cli/help.js +3 -0
  9. package/dist/cli/help.js.map +1 -1
  10. package/dist/cli/mcp-attach.d.ts +3 -3
  11. package/dist/cli/mcp-attach.d.ts.map +1 -1
  12. package/dist/cli/mcp-attach.js +5 -4
  13. package/dist/cli/mcp-attach.js.map +1 -1
  14. package/dist/cli/model-contract.d.ts +5 -0
  15. package/dist/cli/model-contract.d.ts.map +1 -0
  16. package/dist/cli/model-contract.js +45 -0
  17. package/dist/cli/model-contract.js.map +1 -0
  18. package/dist/commands/adaptorch-doctor-cli.d.ts.map +1 -1
  19. package/dist/commands/adaptorch-doctor-cli.js +32 -10
  20. package/dist/commands/adaptorch-doctor-cli.js.map +1 -1
  21. package/dist/commands/init-cli.d.ts +12 -0
  22. package/dist/commands/init-cli.d.ts.map +1 -0
  23. package/dist/commands/init-cli.js +76 -0
  24. package/dist/commands/init-cli.js.map +1 -0
  25. package/dist/commands/provider-sync-cli.d.ts +27 -0
  26. package/dist/commands/provider-sync-cli.d.ts.map +1 -0
  27. package/dist/commands/provider-sync-cli.js +177 -0
  28. package/dist/commands/provider-sync-cli.js.map +1 -0
  29. package/dist/commands/run-command.d.ts +9 -0
  30. package/dist/commands/run-command.d.ts.map +1 -0
  31. package/dist/commands/run-command.js +34 -0
  32. package/dist/commands/run-command.js.map +1 -0
  33. package/dist/commands/verified-run-cli.d.ts +6 -0
  34. package/dist/commands/verified-run-cli.d.ts.map +1 -0
  35. package/dist/commands/verified-run-cli.js +190 -0
  36. package/dist/commands/verified-run-cli.js.map +1 -0
  37. package/dist/core/active-skill-state.d.ts +7 -0
  38. package/dist/core/active-skill-state.d.ts.map +1 -0
  39. package/dist/core/active-skill-state.js +25 -0
  40. package/dist/core/active-skill-state.js.map +1 -0
  41. package/dist/core/agent-session-services.d.ts +10 -1
  42. package/dist/core/agent-session-services.d.ts.map +1 -1
  43. package/dist/core/agent-session-services.js +43 -0
  44. package/dist/core/agent-session-services.js.map +1 -1
  45. package/dist/core/agent-session.d.ts +7 -9
  46. package/dist/core/agent-session.d.ts.map +1 -1
  47. package/dist/core/agent-session.js +91 -126
  48. package/dist/core/agent-session.js.map +1 -1
  49. package/dist/core/codex-chatgpt-web-bridge.d.ts +99 -0
  50. package/dist/core/codex-chatgpt-web-bridge.d.ts.map +1 -0
  51. package/dist/core/codex-chatgpt-web-bridge.js +192 -0
  52. package/dist/core/codex-chatgpt-web-bridge.js.map +1 -0
  53. package/dist/core/codex-chatgpt-web-sync.d.ts +50 -0
  54. package/dist/core/codex-chatgpt-web-sync.d.ts.map +1 -0
  55. package/dist/core/codex-chatgpt-web-sync.js +119 -0
  56. package/dist/core/codex-chatgpt-web-sync.js.map +1 -0
  57. package/dist/core/compaction/compaction-headroom.d.ts +30 -0
  58. package/dist/core/compaction/compaction-headroom.d.ts.map +1 -0
  59. package/dist/core/compaction/compaction-headroom.js +48 -0
  60. package/dist/core/compaction/compaction-headroom.js.map +1 -0
  61. package/dist/core/compaction/compaction.d.ts +2 -29
  62. package/dist/core/compaction/compaction.d.ts.map +1 -1
  63. package/dist/core/compaction/compaction.js +19 -47
  64. package/dist/core/compaction/compaction.js.map +1 -1
  65. package/dist/core/compaction/overflow-retry-guard.d.ts +20 -0
  66. package/dist/core/compaction/overflow-retry-guard.d.ts.map +1 -0
  67. package/dist/core/compaction/overflow-retry-guard.js +38 -0
  68. package/dist/core/compaction/overflow-retry-guard.js.map +1 -0
  69. package/dist/core/context-budget-headroom-types.d.ts.map +1 -1
  70. package/dist/core/context-budget-headroom-types.js +1 -1
  71. package/dist/core/context-budget-headroom-types.js.map +1 -1
  72. package/dist/core/context-budget-token-counter-types.d.ts +27 -0
  73. package/dist/core/context-budget-token-counter-types.d.ts.map +1 -0
  74. package/dist/core/context-budget-token-counter-types.js +2 -0
  75. package/dist/core/context-budget-token-counter-types.js.map +1 -0
  76. package/dist/core/context-budget-token-counter.d.ts +2 -26
  77. package/dist/core/context-budget-token-counter.d.ts.map +1 -1
  78. package/dist/core/context-budget-token-counter.js +2 -0
  79. package/dist/core/context-budget-token-counter.js.map +1 -1
  80. package/dist/core/context-budget-v2-scoring.d.ts.map +1 -1
  81. package/dist/core/context-budget-v2-scoring.js +14 -10
  82. package/dist/core/context-budget-v2-scoring.js.map +1 -1
  83. package/dist/core/domain-router.d.ts.map +1 -1
  84. package/dist/core/domain-router.js +1 -1
  85. package/dist/core/domain-router.js.map +1 -1
  86. package/dist/core/grok-harness-dispatch.d.ts +4 -0
  87. package/dist/core/grok-harness-dispatch.d.ts.map +1 -1
  88. package/dist/core/grok-harness-dispatch.js +20 -3
  89. package/dist/core/grok-harness-dispatch.js.map +1 -1
  90. package/dist/core/grok-harness.d.ts +15 -9
  91. package/dist/core/grok-harness.d.ts.map +1 -1
  92. package/dist/core/grok-harness.js +34 -8
  93. package/dist/core/grok-harness.js.map +1 -1
  94. package/dist/core/mcp/tools.d.ts +2 -2
  95. package/dist/core/mcp/tools.d.ts.map +1 -1
  96. package/dist/core/mcp/tools.js +29 -3
  97. package/dist/core/mcp/tools.js.map +1 -1
  98. package/dist/core/model-registry-schema.d.ts +1081 -0
  99. package/dist/core/model-registry-schema.d.ts.map +1 -0
  100. package/dist/core/model-registry-schema.js +148 -0
  101. package/dist/core/model-registry-schema.js.map +1 -0
  102. package/dist/core/model-registry.d.ts.map +1 -1
  103. package/dist/core/model-registry.js +1 -146
  104. package/dist/core/model-registry.js.map +1 -1
  105. package/dist/core/model-resolver.d.ts +2 -1
  106. package/dist/core/model-resolver.d.ts.map +1 -1
  107. package/dist/core/model-resolver.js +2 -1
  108. package/dist/core/model-resolver.js.map +1 -1
  109. package/dist/core/prompt-preset.d.ts +1 -1
  110. package/dist/core/prompt-preset.d.ts.map +1 -1
  111. package/dist/core/prompt-preset.js +16 -1
  112. package/dist/core/prompt-preset.js.map +1 -1
  113. package/dist/core/prompt-settlement.d.ts +4 -3
  114. package/dist/core/prompt-settlement.d.ts.map +1 -1
  115. package/dist/core/prompt-settlement.js.map +1 -1
  116. package/dist/core/provider-display-names.d.ts.map +1 -1
  117. package/dist/core/provider-display-names.js +1 -0
  118. package/dist/core/provider-display-names.js.map +1 -1
  119. package/dist/core/provider-resilience.d.ts +8 -0
  120. package/dist/core/provider-resilience.d.ts.map +1 -1
  121. package/dist/core/provider-resilience.js +20 -3
  122. package/dist/core/provider-resilience.js.map +1 -1
  123. package/dist/core/provider-usage-types.d.ts +42 -0
  124. package/dist/core/provider-usage-types.d.ts.map +1 -0
  125. package/dist/core/provider-usage-types.js +2 -0
  126. package/dist/core/provider-usage-types.js.map +1 -0
  127. package/dist/core/provider-usage.d.ts +2 -31
  128. package/dist/core/provider-usage.d.ts.map +1 -1
  129. package/dist/core/provider-usage.js +4 -0
  130. package/dist/core/provider-usage.js.map +1 -1
  131. package/dist/core/redaction.d.ts.map +1 -1
  132. package/dist/core/redaction.js +18 -2
  133. package/dist/core/redaction.js.map +1 -1
  134. package/dist/core/run-budget-policy.d.ts +18 -0
  135. package/dist/core/run-budget-policy.d.ts.map +1 -0
  136. package/dist/core/run-budget-policy.js +52 -0
  137. package/dist/core/run-budget-policy.js.map +1 -0
  138. package/dist/core/run-budget.d.ts +33 -0
  139. package/dist/core/run-budget.d.ts.map +1 -0
  140. package/dist/core/run-budget.js +89 -0
  141. package/dist/core/run-budget.js.map +1 -0
  142. package/dist/core/run-execution-api.d.ts +15 -0
  143. package/dist/core/run-execution-api.d.ts.map +1 -0
  144. package/dist/core/run-execution-api.js +7 -0
  145. package/dist/core/run-execution-api.js.map +1 -0
  146. package/dist/core/run-journal.d.ts.map +1 -1
  147. package/dist/core/run-journal.js +30 -208
  148. package/dist/core/run-journal.js.map +1 -1
  149. package/dist/core/sandbox/policy-merge.d.ts +6 -0
  150. package/dist/core/sandbox/policy-merge.d.ts.map +1 -0
  151. package/dist/core/sandbox/policy-merge.js +74 -0
  152. package/dist/core/sandbox/policy-merge.js.map +1 -0
  153. package/dist/core/sandbox/policy-paths.d.ts +4 -0
  154. package/dist/core/sandbox/policy-paths.d.ts.map +1 -0
  155. package/dist/core/sandbox/policy-paths.js +21 -0
  156. package/dist/core/sandbox/policy-paths.js.map +1 -0
  157. package/dist/core/sandbox/policy-types.d.ts +75 -0
  158. package/dist/core/sandbox/policy-types.d.ts.map +1 -0
  159. package/dist/core/sandbox/policy-types.js +2 -0
  160. package/dist/core/sandbox/policy-types.js.map +1 -0
  161. package/dist/core/sandbox/policy.d.ts +3 -77
  162. package/dist/core/sandbox/policy.d.ts.map +1 -1
  163. package/dist/core/sandbox/policy.js +3 -98
  164. package/dist/core/sandbox/policy.js.map +1 -1
  165. package/dist/core/sdk-provider-stream.d.ts +14 -0
  166. package/dist/core/sdk-provider-stream.d.ts.map +1 -0
  167. package/dist/core/sdk-provider-stream.js +38 -0
  168. package/dist/core/sdk-provider-stream.js.map +1 -0
  169. package/dist/core/sdk.d.ts +5 -1
  170. package/dist/core/sdk.d.ts.map +1 -1
  171. package/dist/core/sdk.js +17 -33
  172. package/dist/core/sdk.js.map +1 -1
  173. package/dist/core/session-bash-service.d.ts +2 -2
  174. package/dist/core/session-bash-service.d.ts.map +1 -1
  175. package/dist/core/session-bash-service.js +21 -9
  176. package/dist/core/session-bash-service.js.map +1 -1
  177. package/dist/core/session-failure-cause.d.ts.map +1 -1
  178. package/dist/core/session-failure-cause.js +15 -3
  179. package/dist/core/session-failure-cause.js.map +1 -1
  180. package/dist/core/session-prompt-lifecycle.d.ts +25 -0
  181. package/dist/core/session-prompt-lifecycle.d.ts.map +1 -0
  182. package/dist/core/session-prompt-lifecycle.js +87 -0
  183. package/dist/core/session-prompt-lifecycle.js.map +1 -0
  184. package/dist/core/session-run-budget.d.ts +28 -0
  185. package/dist/core/session-run-budget.d.ts.map +1 -0
  186. package/dist/core/session-run-budget.js +127 -0
  187. package/dist/core/session-run-budget.js.map +1 -0
  188. package/dist/core/session-run-termination.d.ts +18 -0
  189. package/dist/core/session-run-termination.d.ts.map +1 -0
  190. package/dist/core/session-run-termination.js +72 -0
  191. package/dist/core/session-run-termination.js.map +1 -0
  192. package/dist/core/session-termination-types.d.ts +97 -0
  193. package/dist/core/session-termination-types.d.ts.map +1 -0
  194. package/dist/core/session-termination-types.js +26 -0
  195. package/dist/core/session-termination-types.js.map +1 -0
  196. package/dist/core/session-termination.d.ts +3 -97
  197. package/dist/core/session-termination.d.ts.map +1 -1
  198. package/dist/core/session-termination.js +25 -29
  199. package/dist/core/session-termination.js.map +1 -1
  200. package/dist/core/skill-selector.d.ts +40 -0
  201. package/dist/core/skill-selector.d.ts.map +1 -0
  202. package/dist/core/skill-selector.js +102 -0
  203. package/dist/core/skill-selector.js.map +1 -0
  204. package/dist/core/slash-commands.d.ts.map +1 -1
  205. package/dist/core/slash-commands.js +1 -0
  206. package/dist/core/slash-commands.js.map +1 -1
  207. package/dist/core/subagent-lane-launcher.d.ts +3 -2
  208. package/dist/core/subagent-lane-launcher.d.ts.map +1 -1
  209. package/dist/core/subagent-lane-launcher.js +24 -13
  210. package/dist/core/subagent-lane-launcher.js.map +1 -1
  211. package/dist/core/tools/render-utils.d.ts.map +1 -1
  212. package/dist/core/tools/render-utils.js +2 -4
  213. package/dist/core/tools/render-utils.js.map +1 -1
  214. package/dist/core/turn-metrics-record.d.ts +55 -0
  215. package/dist/core/turn-metrics-record.d.ts.map +1 -0
  216. package/dist/core/turn-metrics-record.js +149 -0
  217. package/dist/core/turn-metrics-record.js.map +1 -0
  218. package/dist/core/turn-metrics.d.ts +4 -56
  219. package/dist/core/turn-metrics.d.ts.map +1 -1
  220. package/dist/core/turn-metrics.js +12 -60
  221. package/dist/core/turn-metrics.js.map +1 -1
  222. package/dist/core/verified-run/broker.d.ts +26 -0
  223. package/dist/core/verified-run/broker.d.ts.map +1 -0
  224. package/dist/core/verified-run/broker.js +210 -0
  225. package/dist/core/verified-run/broker.js.map +1 -0
  226. package/dist/core/verified-run/candidate.d.ts +24 -0
  227. package/dist/core/verified-run/candidate.d.ts.map +1 -0
  228. package/dist/core/verified-run/candidate.js +167 -0
  229. package/dist/core/verified-run/candidate.js.map +1 -0
  230. package/dist/core/verified-run/check-receipt.d.ts +18 -0
  231. package/dist/core/verified-run/check-receipt.d.ts.map +1 -0
  232. package/dist/core/verified-run/check-receipt.js +92 -0
  233. package/dist/core/verified-run/check-receipt.js.map +1 -0
  234. package/dist/core/verified-run/coordinator.d.ts +39 -0
  235. package/dist/core/verified-run/coordinator.d.ts.map +1 -0
  236. package/dist/core/verified-run/coordinator.js +190 -0
  237. package/dist/core/verified-run/coordinator.js.map +1 -0
  238. package/dist/core/verified-run/dag-candidates.d.ts +8 -0
  239. package/dist/core/verified-run/dag-candidates.d.ts.map +1 -0
  240. package/dist/core/verified-run/dag-candidates.js +65 -0
  241. package/dist/core/verified-run/dag-candidates.js.map +1 -0
  242. package/dist/core/verified-run/dag-phase.d.ts +7 -0
  243. package/dist/core/verified-run/dag-phase.d.ts.map +1 -0
  244. package/dist/core/verified-run/dag-phase.js +92 -0
  245. package/dist/core/verified-run/dag-phase.js.map +1 -0
  246. package/dist/core/verified-run/dag-projection.d.ts +7 -0
  247. package/dist/core/verified-run/dag-projection.d.ts.map +1 -0
  248. package/dist/core/verified-run/dag-projection.js +90 -0
  249. package/dist/core/verified-run/dag-projection.js.map +1 -0
  250. package/dist/core/verified-run/dag-recovery.d.ts +13 -0
  251. package/dist/core/verified-run/dag-recovery.d.ts.map +1 -0
  252. package/dist/core/verified-run/dag-recovery.js +98 -0
  253. package/dist/core/verified-run/dag-recovery.js.map +1 -0
  254. package/dist/core/verified-run/dag-retry-projection.d.ts +9 -0
  255. package/dist/core/verified-run/dag-retry-projection.d.ts.map +1 -0
  256. package/dist/core/verified-run/dag-retry-projection.js +43 -0
  257. package/dist/core/verified-run/dag-retry-projection.js.map +1 -0
  258. package/dist/core/verified-run/dag-types.d.ts +47 -0
  259. package/dist/core/verified-run/dag-types.d.ts.map +1 -0
  260. package/dist/core/verified-run/dag-types.js +2 -0
  261. package/dist/core/verified-run/dag-types.js.map +1 -0
  262. package/dist/core/verified-run/event-parser.d.ts +3 -0
  263. package/dist/core/verified-run/event-parser.d.ts.map +1 -0
  264. package/dist/core/verified-run/event-parser.js +153 -0
  265. package/dist/core/verified-run/event-parser.js.map +1 -0
  266. package/dist/core/verified-run/events.d.ts +4 -0
  267. package/dist/core/verified-run/events.d.ts.map +1 -0
  268. package/dist/core/verified-run/events.js +3 -0
  269. package/dist/core/verified-run/events.js.map +1 -0
  270. package/dist/core/verified-run/evidence-binding.d.ts +18 -0
  271. package/dist/core/verified-run/evidence-binding.d.ts.map +1 -0
  272. package/dist/core/verified-run/evidence-binding.js +81 -0
  273. package/dist/core/verified-run/evidence-binding.js.map +1 -0
  274. package/dist/core/verified-run/evidence.d.ts +27 -0
  275. package/dist/core/verified-run/evidence.d.ts.map +1 -0
  276. package/dist/core/verified-run/evidence.js +100 -0
  277. package/dist/core/verified-run/evidence.js.map +1 -0
  278. package/dist/core/verified-run/journal.d.ts +32 -0
  279. package/dist/core/verified-run/journal.d.ts.map +1 -0
  280. package/dist/core/verified-run/journal.js +103 -0
  281. package/dist/core/verified-run/journal.js.map +1 -0
  282. package/dist/core/verified-run/namespace-identity.d.ts +11 -0
  283. package/dist/core/verified-run/namespace-identity.d.ts.map +1 -0
  284. package/dist/core/verified-run/namespace-identity.js +77 -0
  285. package/dist/core/verified-run/namespace-identity.js.map +1 -0
  286. package/dist/core/verified-run/owned-execution.d.ts +21 -0
  287. package/dist/core/verified-run/owned-execution.d.ts.map +1 -0
  288. package/dist/core/verified-run/owned-execution.js +43 -0
  289. package/dist/core/verified-run/owned-execution.js.map +1 -0
  290. package/dist/core/verified-run/phase-context.d.ts +9 -0
  291. package/dist/core/verified-run/phase-context.d.ts.map +1 -0
  292. package/dist/core/verified-run/phase-context.js +2 -0
  293. package/dist/core/verified-run/phase-context.js.map +1 -0
  294. package/dist/core/verified-run/process-gate.d.ts +5 -0
  295. package/dist/core/verified-run/process-gate.d.ts.map +1 -0
  296. package/dist/core/verified-run/process-gate.js +31 -0
  297. package/dist/core/verified-run/process-gate.js.map +1 -0
  298. package/dist/core/verified-run/projection.d.ts +4 -0
  299. package/dist/core/verified-run/projection.d.ts.map +1 -0
  300. package/dist/core/verified-run/projection.js +219 -0
  301. package/dist/core/verified-run/projection.js.map +1 -0
  302. package/dist/core/verified-run/recovery-clock.d.ts +19 -0
  303. package/dist/core/verified-run/recovery-clock.d.ts.map +1 -0
  304. package/dist/core/verified-run/recovery-clock.js +69 -0
  305. package/dist/core/verified-run/recovery-clock.js.map +1 -0
  306. package/dist/core/verified-run/recovery-command.d.ts +11 -0
  307. package/dist/core/verified-run/recovery-command.d.ts.map +1 -0
  308. package/dist/core/verified-run/recovery-command.js +73 -0
  309. package/dist/core/verified-run/recovery-command.js.map +1 -0
  310. package/dist/core/verified-run/recovery-projection.d.ts +12 -0
  311. package/dist/core/verified-run/recovery-projection.d.ts.map +1 -0
  312. package/dist/core/verified-run/recovery-projection.js +88 -0
  313. package/dist/core/verified-run/recovery-projection.js.map +1 -0
  314. package/dist/core/verified-run/recovery.d.ts +12 -0
  315. package/dist/core/verified-run/recovery.d.ts.map +1 -0
  316. package/dist/core/verified-run/recovery.js +115 -0
  317. package/dist/core/verified-run/recovery.js.map +1 -0
  318. package/dist/core/verified-run/run-types.d.ts +103 -0
  319. package/dist/core/verified-run/run-types.d.ts.map +1 -0
  320. package/dist/core/verified-run/run-types.js +2 -0
  321. package/dist/core/verified-run/run-types.js.map +1 -0
  322. package/dist/core/verified-run/scripted-writer.d.ts +15 -0
  323. package/dist/core/verified-run/scripted-writer.d.ts.map +1 -0
  324. package/dist/core/verified-run/scripted-writer.js +94 -0
  325. package/dist/core/verified-run/scripted-writer.js.map +1 -0
  326. package/dist/core/verified-run/session-port.d.ts +27 -0
  327. package/dist/core/verified-run/session-port.d.ts.map +1 -0
  328. package/dist/core/verified-run/session-port.js +2 -0
  329. package/dist/core/verified-run/session-port.js.map +1 -0
  330. package/dist/core/verified-run/storage.d.ts +15 -0
  331. package/dist/core/verified-run/storage.d.ts.map +1 -0
  332. package/dist/core/verified-run/storage.js +96 -0
  333. package/dist/core/verified-run/storage.js.map +1 -0
  334. package/dist/core/verified-run/verification-phase.d.ts +5 -0
  335. package/dist/core/verified-run/verification-phase.d.ts.map +1 -0
  336. package/dist/core/verified-run/verification-phase.js +56 -0
  337. package/dist/core/verified-run/verification-phase.js.map +1 -0
  338. package/dist/core/verified-run/work-recovery.d.ts +8 -0
  339. package/dist/core/verified-run/work-recovery.d.ts.map +1 -0
  340. package/dist/core/verified-run/work-recovery.js +44 -0
  341. package/dist/core/verified-run/work-recovery.js.map +1 -0
  342. package/dist/core/verified-run/writer-completion.d.ts +4 -0
  343. package/dist/core/verified-run/writer-completion.d.ts.map +1 -0
  344. package/dist/core/verified-run/writer-completion.js +27 -0
  345. package/dist/core/verified-run/writer-completion.js.map +1 -0
  346. package/dist/core/verified-run/writer-phase.d.ts +8 -0
  347. package/dist/core/verified-run/writer-phase.d.ts.map +1 -0
  348. package/dist/core/verified-run/writer-phase.js +76 -0
  349. package/dist/core/verified-run/writer-phase.js.map +1 -0
  350. package/dist/core/verified-run/writer-projection.d.ts +11 -0
  351. package/dist/core/verified-run/writer-projection.d.ts.map +1 -0
  352. package/dist/core/verified-run/writer-projection.js +70 -0
  353. package/dist/core/verified-run/writer-projection.js.map +1 -0
  354. package/dist/core/verified-run/writer-recovery.d.ts +16 -0
  355. package/dist/core/verified-run/writer-recovery.d.ts.map +1 -0
  356. package/dist/core/verified-run/writer-recovery.js +107 -0
  357. package/dist/core/verified-run/writer-recovery.js.map +1 -0
  358. package/dist/core/workload-permit-pool.d.ts +1 -3
  359. package/dist/core/workload-permit-pool.d.ts.map +1 -1
  360. package/dist/core/workload-permit-pool.js +11 -11
  361. package/dist/core/workload-permit-pool.js.map +1 -1
  362. package/dist/guardrails/evidence-system.d.ts +1 -1
  363. package/dist/guardrails/evidence-system.d.ts.map +1 -1
  364. package/dist/guardrails/evidence-system.js +18 -29
  365. package/dist/guardrails/evidence-system.js.map +1 -1
  366. package/dist/guardrails/merge-gate-result.d.ts +4 -0
  367. package/dist/guardrails/merge-gate-result.d.ts.map +1 -0
  368. package/dist/guardrails/merge-gate-result.js +32 -0
  369. package/dist/guardrails/merge-gate-result.js.map +1 -0
  370. package/dist/index.d.ts +3 -2
  371. package/dist/index.d.ts.map +1 -1
  372. package/dist/index.js +2 -2
  373. package/dist/index.js.map +1 -1
  374. package/dist/main.d.ts.map +1 -1
  375. package/dist/main.js +17 -23
  376. package/dist/main.js.map +1 -1
  377. package/dist/modes/interactive/components/session-failure.d.ts +13 -0
  378. package/dist/modes/interactive/components/session-failure.d.ts.map +1 -0
  379. package/dist/modes/interactive/components/session-failure.js +81 -0
  380. package/dist/modes/interactive/components/session-failure.js.map +1 -0
  381. package/dist/modes/interactive/interactive-login-options.d.ts +27 -0
  382. package/dist/modes/interactive/interactive-login-options.d.ts.map +1 -0
  383. package/dist/modes/interactive/interactive-login-options.js +54 -0
  384. package/dist/modes/interactive/interactive-login-options.js.map +1 -0
  385. package/dist/modes/interactive/interactive-mode.d.ts +8 -4
  386. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  387. package/dist/modes/interactive/interactive-mode.js +183 -171
  388. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  389. package/dist/modes/interactive/interactive-resume-command.d.ts +3 -0
  390. package/dist/modes/interactive/interactive-resume-command.d.ts.map +1 -0
  391. package/dist/modes/interactive/interactive-resume-command.js +24 -0
  392. package/dist/modes/interactive/interactive-resume-command.js.map +1 -0
  393. package/dist/modes/interactive/interactive-tool-result.d.ts +32 -0
  394. package/dist/modes/interactive/interactive-tool-result.d.ts.map +1 -0
  395. package/dist/modes/interactive/interactive-tool-result.js +59 -0
  396. package/dist/modes/interactive/interactive-tool-result.js.map +1 -0
  397. package/dist/modes/interactive/tui-diagnostics.d.ts +36 -0
  398. package/dist/modes/interactive/tui-diagnostics.d.ts.map +1 -0
  399. package/dist/modes/interactive/tui-diagnostics.js +105 -0
  400. package/dist/modes/interactive/tui-diagnostics.js.map +1 -0
  401. package/dist/modes/interactive/tui-runtime-info.d.ts +20 -0
  402. package/dist/modes/interactive/tui-runtime-info.d.ts.map +1 -0
  403. package/dist/modes/interactive/tui-runtime-info.js +76 -0
  404. package/dist/modes/interactive/tui-runtime-info.js.map +1 -0
  405. package/dist/modes/print-mode.d.ts.map +1 -1
  406. package/dist/modes/print-mode.js +22 -0
  407. package/dist/modes/print-mode.js.map +1 -1
  408. package/dist/utils/clipboard-image.d.ts.map +1 -1
  409. package/dist/utils/clipboard-image.js +10 -60
  410. package/dist/utils/clipboard-image.js.map +1 -1
  411. package/dist/utils/terminal-links.d.ts +13 -0
  412. package/dist/utils/terminal-links.d.ts.map +1 -0
  413. package/dist/utils/terminal-links.js +68 -0
  414. package/dist/utils/terminal-links.js.map +1 -0
  415. package/dist/utils/windows-clipboard-image.d.ts +16 -0
  416. package/dist/utils/windows-clipboard-image.d.ts.map +1 -0
  417. package/dist/utils/windows-clipboard-image.js +87 -0
  418. package/dist/utils/windows-clipboard-image.js.map +1 -0
  419. package/docs/adaptorch-onboarding.md +80 -0
  420. package/docs/containerization.md +12 -0
  421. package/docs/context-files.md +97 -0
  422. package/docs/correctness-wall.md +8 -0
  423. package/docs/custom-provider.md +35 -0
  424. package/docs/development.md +28 -3
  425. package/docs/environment-variables.md +2 -0
  426. package/docs/grok-harness.md +4 -0
  427. package/docs/harness-boundaries.md +154 -0
  428. package/docs/harness-improvements.md +90 -0
  429. package/docs/json.md +19 -0
  430. package/docs/keybindings.md +2 -2
  431. package/docs/mcp.md +22 -2
  432. package/docs/metrics.md +66 -16
  433. package/docs/model-catalog-refresh.md +190 -0
  434. package/docs/model-contract.md +168 -0
  435. package/docs/models.md +21 -4
  436. package/docs/provider-resilience.md +5 -3
  437. package/docs/providers.md +68 -1
  438. package/docs/quickstart.md +4 -0
  439. package/docs/release-audit-0.98.4.md +112 -0
  440. package/docs/release-audit-0.98.5.md +84 -0
  441. package/docs/review-bundle-followup.md +195 -0
  442. package/docs/run-protocol.md +33 -1
  443. package/docs/runtime-algorithms.md +45 -0
  444. package/docs/sdk.md +204 -2
  445. package/docs/sessions.md +1 -1
  446. package/docs/settings.md +17 -1
  447. package/docs/skills.md +2 -0
  448. package/docs/tb21-audit.md +131 -0
  449. package/docs/terminal-setup.md +20 -0
  450. package/docs/usage.md +77 -1
  451. package/docs/verified-run-testing.md +417 -0
  452. package/docs/verified-run.md +388 -0
  453. package/docs/windows.md +48 -0
  454. package/examples/README.md +4 -0
  455. package/examples/context/AGENTS.md +64 -0
  456. package/examples/context/CLAUDE.md +17 -0
  457. package/examples/context/INTERNET.md +42 -0
  458. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  459. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  460. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  461. package/examples/extensions/gondolin/package-lock.json +2 -2
  462. package/examples/extensions/gondolin/package.json +1 -1
  463. package/examples/extensions/sandbox/package-lock.json +2 -2
  464. package/examples/extensions/sandbox/package.json +1 -1
  465. package/examples/extensions/with-deps/package-lock.json +2 -2
  466. package/examples/extensions/with-deps/package.json +1 -1
  467. package/npm-shrinkwrap.json +18 -18
  468. package/package.json +6 -6
package/docs/sdk.md CHANGED
@@ -147,6 +147,208 @@ interface AgentSession {
147
147
 
148
148
  Session replacement APIs such as new-session, resume, fork, and import live on `AgentSessionRuntime`, not on `AgentSession`.
149
149
 
150
+ ### Model dispatch policy
151
+
152
+ Pass `modelContract` to `createAgentSession()` or `createAgentSessionFromServices()`
153
+ to restrict logical model/provider, reasoning, and output-limit choices. The SDK
154
+ stream also checks first-party summaries using `session.agent.streamFn`.
155
+ The CLI equivalent is `--model-contract <file>`. This is opt-in dispatch control,
156
+ not final-wire or billing attestation. See [Model dispatch contracts](model-contract.md)
157
+ for the JSON shape, events, hook restrictions, and uncovered paths.
158
+
159
+ ### Isolated command runs (SDK, opt-in)
160
+
161
+ `planVerifiedRun()` and `createRunCoordinator()` provide three experimental profiles:
162
+ `linux-command-v1` executes an approved command, `linux-scripted-agent-v1` drives
163
+ approved steps through the real `AgentSession` and the offline Faux adapter, and
164
+ `linux-command-dag-v1` executes a bounded command DAG serially.
165
+ Commands run in private sandboxes; native EvidenceReceipt v3 cores and a supervisor
166
+ attestation bind the checked candidate before artifact retrieval.
167
+
168
+ The high-level factory injects the closed session runtime through a host-only port;
169
+ low-level `new RunCoordinator(root)` needs no session port for command execution or
170
+ candidate-only recovery. `inspectRecovery(runId)` is read-only; `resume(command,
171
+ approval)` acquires a new generation and rechecks the exact frozen candidate under
172
+ the original boot-relative deadline. It never restarts the writer or model and
173
+ refuses missing process identity, stale refs, unavailable clocks and expired budget.
174
+
175
+ `inspectWriterRecovery(runId)` and `restartWriter(command, approval)` separately
176
+ restart an interrupted local writer from its durable input checkpoint. They preserve
177
+ spent requests and the original work deadline, use a fresh private directory, and
178
+ never continue from partial output or a changed original workspace.
179
+
180
+ For the command DAG, `inspectTaskRecovery(runId)` returns read-only readiness and
181
+ `retryTasks(command, approval)` acquires a new generation for selected failed or
182
+ interrupted tasks. `RunTaskRetryCommand` pins `baseDigest` and `taskIds` alongside the
183
+ contract/revision/generation fields; an empty selection only continues pending work.
184
+ Successful checkpoints are revalidated against their complete ancestor inputs before
185
+ adoption. Final integration verification always uses fresh native receipts. The
186
+ profile supports at most 16 tasks and two preapproved commands per task; it does not
187
+ synthesize a repair or accept overlapping task write scopes. `RunProjection.tasks`
188
+ exposes task attempts and checkpoint digests; a blocked DAG returns `execution: "paused"`.
189
+ All recovery actions share the generation cap, original budget and command-id fence.
190
+
191
+ This does not enable live-model task generation, opaque remote replay, parallel
192
+ frontier scheduling, plan amendment, or host application. See [Verified Run](verified-run.md) for contracts and trust boundaries.
193
+
194
+ ### Shared run budgets (SDK, opt-in)
195
+
196
+ Pass `runBudget` to `session.prompt()` to bound one prompt's logical model
197
+ requests. The budget starts before prompt preflight and stays shared across
198
+ provider retries, continuations, and first-party summaries using that session's
199
+ `agent.streamFn` while the prompt is active.
200
+
201
+ ```typescript
202
+ import { RunBudgetExceededError } from "open-multi-agent-kit";
203
+
204
+ try {
205
+ await session.prompt("Implement the selected change and run its focused tests", {
206
+ runBudget: { timeoutMs: 120_000, maxRequests: 12, maxConcurrentRequests: 2 },
207
+ });
208
+ } catch (error) {
209
+ if (!(error instanceof RunBudgetExceededError)) throw error;
210
+ console.log(error.code); // deadline, requests, concurrency, or closed
211
+ }
212
+ console.log(session.getRunBudgetSnapshot());
213
+ ```
214
+
215
+ | Limit | Meaning |
216
+ | --- | --- |
217
+ | `timeoutMs` | One monotonic work deadline, including preflight and retry waiting; at most 2,147,483,647 ms. |
218
+ | `maxRequests` | Total entries into the scoped stream-dispatch boundary. Failed requests also consume this allowance. |
219
+ | `maxConcurrentRequests` | Outstanding logical streams. Returning a stream object does not release its reservation; terminal metadata does. |
220
+
221
+ Limits must be non-negative safe integers. Zero denies the corresponding
222
+ admission; omitted limits are unbounded. Supply at least one limit. Unknown
223
+ fields, accessors, inherited fields, and malformed values raise
224
+ `RunBudgetPolicyError`. The policy is copied before asynchronous work, so later
225
+ caller mutation cannot enlarge it.
226
+
227
+ Exhaustion latches, requests cancellation through the existing provider, tool,
228
+ retry, compaction, and branch-summary paths, and rejects with
229
+ `RunBudgetExceededError`. Termination records use `kind: "budget_exhausted"` and
230
+ `causeCode: "budget.deadline"`, `"budget.requests"`, or `"budget.concurrency"`;
231
+ these are not automatic-retry or model-failover instructions. A separate prompt
232
+ cannot borrow or reset an active budget. Preflight ownership also applies when
233
+ the first prompt has no budget, preventing a competing budgeted prompt from
234
+ changing its stream or aborting it. Explicit steering/follow-up messages join the
235
+ running prompt without receiving a new allowance; registered commands retain
236
+ their existing streaming path.
237
+
238
+ `getRunBudgetSnapshot()` returns the active or most recent budget's immutable
239
+ limits, started-request count, outstanding-stream count, remaining time, closed
240
+ state, and optional exhaustion reason. It returns `undefined` when no budget has
241
+ been used. Missing terminal metadata retains an outstanding reservation; an
242
+ abort request alone does not release it. Outstanding streams block admission of
243
+ a new bounded or unbounded prompt even after the scope closes. Once terminal
244
+ metadata arrives, that reservation drains and new work can proceed. The original
245
+ stream and core credential resolver are restored unless another owner replaced
246
+ them. Captured old wrappers reject further dispatch after closure.
247
+
248
+ The core credential resolver and compaction-auth preflight now check admission
249
+ before consulting credentials. This is a pre-check, not a reservation: logical
250
+ request counts are still reserved at stream dispatch. Cancellation or expiry
251
+ during credential lookup is checked again before continuing.
252
+
253
+ **Limits of this slice:** request counts are not HTTP-attempt or billing counts.
254
+ The wrapper requests `maxRetries: 0` to disable adapter retries, but cannot attest
255
+ that every provider honors it. Independent context/auth hooks, remote work, detached
256
+ children, direct `omk-ai` calls, and replacement of the stream wrapper remain
257
+ outside that dispatch-count guarantee. In-process plugins are trusted. Deadline
258
+ cancellation is cooperative: synchronous blocking code, an uncooperative hook,
259
+ or a remote service can outlive the signal. This is not an OS kill/join boundary
260
+ or a guaranteed wall-clock return time. There is no financial/output-token cap,
261
+ verification/cleanup reserve, persisted budget recovery, CLI flag, or global
262
+ setting in this slice. Restart does not reconstruct an in-flight budget.
263
+
264
+ Regression tests: `test/run-budget.test.ts`, `test/run-budget-scope.test.ts`,
265
+ `test/suite/agent-session-run-budget.test.ts`, and
266
+ `test/suite/agent-session-admission.test.ts`.
267
+
268
+ ### Prompt settlement
269
+
270
+ **Working-tree hardening:** a timeout/abort result is not proof that the tool stopped.
271
+
272
+ | Signal | Meaning |
273
+ | --- | --- |
274
+ | `tool_execution_end` | A result was committed; a timeout/abort can win before the tool stops. |
275
+ | `session_termination` | One agent-loop attempt ended; retries may follow. |
276
+ | `prompt()` resolves | The outer loop returned. A timed-out or aborted tool may remain active. |
277
+ | `prompt_settled` | The prompt producer closed, registered local tool promises ended, and streaming/queues no longer block settlement. |
278
+
279
+ The session retains a per-prompt owner across retries and continuations. Tools
280
+ selected through its registry receive unique runtime tokens, independent of
281
+ model tool-call IDs. Actual promise completion removes only its own token;
282
+ duplicate flushes and an earlier run's finish callback cannot settle another run.
283
+
284
+ After timeout or cancellation, the session withholds `prompt_settled` and its
285
+ resource-lease release while registered tool promises remain active. Another
286
+ ordinary prompt is rejected before model dispatch. Clearing a leftover queue
287
+ rechecks settlement, so a drained run can release its owner and accept new work.
288
+ Default late-settlement handling triggers a fresh settlement check after the workspace-mutation audit.
289
+ With explicit `lateSettlement: "ignore"`, actual completion triggers that check
290
+ without inventing an audit. Durations and the core tool-timeout teardown window
291
+ use a monotonic clock; wall-clock adjustments cannot extend or shorten that window.
292
+
293
+ User cancellation during tool execution remains an abort even when the last
294
+ assistant message says `toolUse`. Timeout text reports cancellation requested,
295
+ not process termination confirmed. Late success never replaces the failed or
296
+ aborted result. **`prompt_settled` is a UX signal, not semantic verification.**
297
+
298
+ This safeguard is session-local. It does not persist ownership, join detached
299
+ work, prove remote cancellation, or fence writers across replacement/disposal,
300
+ restart, or workspace reuse. Direct `Agent` calls, replacing
301
+ `session.agent.state.tools`, independent interactive bash, and plugin-created
302
+ background work are not automatically enrolled. In-process plugins remain trusted.
303
+
304
+ #### Independent bash commands
305
+
306
+ `executeBash()` owns one cancellation controller per invocation, including permit
307
+ waiting. Concurrent commands never share or overwrite that controller. Completion
308
+ removes only its own entry, so `isBashRunning` remains true while another command
309
+ is active. `abortBash()` signals every owned command and does not declare them
310
+ terminated. Cancellation observed after permit admission prevents backend dispatch.
311
+
312
+ These commands remain independent of prompt settlement and its model-request
313
+ budget. Backend promises still own actual termination; detached processes and
314
+ remote completion are not inferred from cancellation. Regression:
315
+ `test/suite/agent-session-bash-ownership.test.ts`.
316
+
317
+ #### Shared permits and internal lanes
318
+
319
+ `WorkloadPermitPool` captures request identity, weight, and signal before waiting;
320
+ caller mutation cannot alter a later release. Per-permit release latches replace
321
+ the unbounded retired-ID set. Removing a cancelled/expired FIFO head immediately
322
+ reconsiders the next request. Explicit pool `capacity: 0` denies grants and
323
+ `maxQueue: 0` denies waiting; lowering capacity never revokes held permits.
324
+
325
+ Internal `launchSubagentLanes()` preserves computed zero width as
326
+ `admission-deferred`, observes run-specific heavy caps, defers marked heavy lanes
327
+ under `defer-heavy`, and rechecks abort after acquiring a permit. It forwards the
328
+ parent signal and awaits the callback before release. Parent cancellation reports
329
+ `cancelled`; failures use a fixed diagnostic rather than arbitrary child error
330
+ text. The existing configured lane setting `0 = unlimited` remains distinct from
331
+ computed admission zero. `heavyLaneIds` is a trusted caller classification.
332
+ This does not activate a live task DAG or a detached-process join adapter.
333
+
334
+ Regression checks from the repository root:
335
+
336
+ ```bash
337
+ LIVE_E2E=0 node node_modules/vitest/dist/cli.js --run \
338
+ packages/coding-agent/test/session-prompt-lifecycle.test.ts \
339
+ packages/coding-agent/test/suite/agent-session-owned-settlement.test.ts \
340
+ packages/coding-agent/test/suite/agent-session-child-settlement.test.ts \
341
+ packages/coding-agent/test/workload-permit-pool-admission.test.ts \
342
+ packages/coding-agent/test/subagent-lane-ownership.test.ts
343
+ npm run check
344
+ ```
345
+
346
+ The child test observes a local Node process closing before settlement and lease
347
+ restoration. These are not paid-provider, crash-recovery, or coding-quality benchmarks.
348
+ Shared logical request budgets are available through the opt-in SDK path above.
349
+ Verification/cleanup reserves, protected candidate/verifier binding, effect recovery,
350
+ and approval-bound application remain prerequisites for a durable verified run.
351
+
150
352
  ### AgentSession policy seams
151
353
 
152
354
  The package root exports focused policy helpers for custom runtimes and tests:
@@ -261,7 +463,7 @@ interface PromptOptions {
261
463
  }
262
464
  ```
263
465
 
264
- `activeSkillNames` marks additional discovered skills active for this turn; `activeSkillSource` labels their provenance. They merge with global `defaultActiveSkills`, prioritize matching inventory entries, and do not expand authorization or inline full skill instructions.
466
+ `activeSkillNames` marks additional discovered skills active for this turn; `activeSkillSource` labels their provenance. They merge with global `defaultActiveSkills`, prioritize matching inventory entries, and do not expand authorization or inline full skill instructions. When the active provider is native `xai` and `OMK_GROK_HARNESS` is enabled, each non-queued `AgentSession.prompt()` request also derives up to three request-scoped matches from the live skill inventory after ordinary prompt-template expansion. Explicit-only skills are excluded from automatic selection, while explicit SDK/settings/bang selections remain authoritative additions. Queued steering and follow-up messages reuse the active run's system prompt and therefore do not perform another automatic skill-selection pass.
265
467
 
266
468
  `preflightResult` is called once per `prompt()` invocation:
267
469
 
@@ -1307,7 +1509,7 @@ const decision = await chooseWithAdvisoryJudge({
1307
1509
  });
1308
1510
  ```
1309
1511
 
1310
- The sidecar makes no call when zero or one candidate passes. For multiple passing candidates it sends only bounded, forced-redacted material through a tool-free request and requires a complete 0–4 score matrix. Invalid output or provider failure returns `status: "fallback"` with the deterministic first candidate and a sanitized reason. It never persists model prose. Re-run fresh deterministic gates after applying the selected result.
1512
+ The sidecar makes no call when zero or one candidate passes. For multiple passing candidates it sends only bounded, forced-redacted material through a tool-free request and requires a complete 0–4 score matrix. Invalid output or provider failure returns `status: "fallback"` with the deterministic first eligible candidate and a sanitized reason. It never persists model prose. Re-run fresh deterministic gates after applying the selected result.
1311
1513
 
1312
1514
  **Since v0.98.3:** the first-party `createModelAdvisoryJudge()` adapter requires an explicit normal `stop`; valid JSON from truncated, aborted or missing completion metadata cannot supply scores. The chooser checks cancellation before and after judge work. Top-score ties retain the caller's deterministic rank but report `judge-tied` / `deterministic`. Additive `diagnostics` preserve submitted/eligible/excluded counts and distinguish unmeasured comparisons from scored ties. See [Advisory selection integrity](advisory-selection.md).
1313
1515
 
package/docs/sessions.md CHANGED
@@ -34,7 +34,7 @@ For the JSONL file format and SessionManager API, see [Session Format](session-f
34
34
 
35
35
  Each provider attempt writes its own `run_started`/`run_finished` journal pair and emits `session_termination`. A retryable termination is attempt-level when `auto_retry_start` follows it; consumers should not treat that event alone as the end of the outer `prompt()` call.
36
36
 
37
- If a retry or failover succeeds, the later attempt emits `completed` and becomes `session.lastTermination`. If retry budget is exhausted, the last provider failure remains final. Quota and billing-cycle exhaustion are classified as `provider.rate_limit` and can switch through the configured provider-resilience chain before retrying. See [Provider Resilience](provider-resilience.md).
37
+ If a retry or failover succeeds, the later attempt emits `completed` and becomes `session.lastTermination`. If retry budget is exhausted, the last provider failure remains final. Quota, billing-cycle exhaustion, and provider-capacity waits (`at capacity`, Anthropic `overloaded_error`) are classified as `provider.rate_limit` and can switch through the configured provider-resilience chain before retrying. A Codex ChatGPT-account unsupported-model 400 or Anthropic `claude_code_version_too_old` is `configuration.invalid`: `/new session` will not grant access; switch with `/model`. See [Provider Resilience](provider-resilience.md).
38
38
 
39
39
  ## Session Commands
40
40
 
package/docs/settings.md CHANGED
@@ -139,15 +139,31 @@ All numeric token reserves must be non-negative safe integers. Ratios must be fi
139
139
  | Setting | Type | Default | Description |
140
140
  |---------|------|---------|-------------|
141
141
  | `contextBudget.enabled` | boolean | `false` | Globally enable prompt resource budgeting; representation entries persist per workspace by default while plan entries stay in session memory |
142
+ | `contextBudget.openwiki` | boolean | `false` | Offer the workspace's `openwiki/` pages as budget candidates, ranked against each turn's query. Requires `contextBudget.enabled` |
142
143
 
143
144
  ```json
144
145
  {
145
- "contextBudget": { "enabled": true }
146
+ "contextBudget": { "enabled": true, "openwiki": true }
146
147
  }
147
148
  ```
148
149
 
149
150
  This setting is global-only: `.omk/settings.json` cannot enable or disable it. Use `OMK_CONTEXT_GOVERNOR=1` to force it on for one process or `OMK_CONTEXT_GOVERNOR=0` to force it off for a baseline run. When enabled, content-addressed representation and negative-result entries persist under `.omk/cache/context-budget-v2`; plan entries stay in session memory. Set `OMK_CONTEXT_GOVERNOR_CACHE=memory` to keep every entry in session memory or `OMK_CONTEXT_GOVERNOR_CACHE_DIR` to relocate the representation snapshot.
150
151
 
152
+ #### Repository wiki retrieval
153
+
154
+ `contextBudget.openwiki` lets a generated [`openwiki/`](https://github.com/dmae97/omk/blob/main/README.md#repository-understanding) corpus take part in prompt budgeting. The corpus is loaded once per session and never enters the prompt directly: each page becomes a low-priority `evidence` candidate that the governor ranks against the turn's query, so pages compete for leftover budget and can never displace instructions or skills.
155
+
156
+ A corpus is admitted only on the same terms `scripts/check-openwiki.mjs` applies, because generated prose about a repository is exactly the kind of content that is expensive to be wrong about:
157
+
158
+ | Generator state | Result |
159
+ |---|---|
160
+ | `complete`, generated at the current `HEAD` | Page titles, declared symbols, and bounded page text are all offered |
161
+ | `complete`, but `HEAD` has moved | Titles and symbols only. Page text is withheld, and entries are marked stale |
162
+ | `interrupted`, with `openwiki/.manual-review.json` bound to the exact corpus digest | Treated as complete |
163
+ | `interrupted` without that review, unknown status, missing `gitHead`, or unreadable state | Refused; no page reaches the prompt |
164
+
165
+ A corpus over 200 pages or 4 MiB is refused rather than truncated, so the runtime and the gate always agree on the digest of the same directory. Symlinked pages are skipped. Source code and tests stay authoritative over every page; the pages are leads to verify, not claims to repeat.
166
+
151
167
  ### Agent Tool Execution
152
168
 
153
169
  | Setting | Type | Default | Description |
package/docs/skills.md CHANGED
@@ -93,6 +93,8 @@ OMK adds a compact active-skills marker containing names and, for explicit-only
93
93
 
94
94
  This file is an explicit operator choice, so it may activate a skill whose frontmatter otherwise requires direct invocation. Active skills do not expand authorization and apply only when relevant. Keep the list focused because overlapping language or workflow instructions can conflict.
95
95
 
96
+ When the native `xai` Grok harness is enabled, OMK may additionally mark up to three matching, non-explicit-only skills active for a non-queued top-level `prompt()` request. It scores the live discovered descriptions and does not persist those automatic selections into the next turn; operator and bang selections still merge normally.
97
+
96
98
  ## Skill Commands
97
99
 
98
100
  Skills register as `/skill:name` commands and interactive `!` launcher entries:
@@ -0,0 +1,131 @@
1
+ # TB 2.1 오프라인 결과 감사
2
+
3
+ `scripts/tb21-audit.mjs`는 명시한 두 Harbor job의 **기록된 결과**를 검증한다.
4
+ 모델·Harbor를 실행하지 않으며 입력 파일이나 기존 요약을 수정하지 않는다.
5
+ 저장소 checkout과 Node.js 22.19 이상이 필요하다. 공개 npm CLI의 하위 명령은 아니다.
6
+
7
+ ## 사용
8
+
9
+ ```bash
10
+ node scripts/tb21-audit.mjs \
11
+ --manifest /path/to/evidence/manifest.json \
12
+ --expect-manifest-sha256 <사전에-고정한-64자리-SHA256>
13
+ ```
14
+
15
+ 두 옵션 모두 필수다. 알 수 없는 옵션·중복 옵션·위치 인수는 거부한다.
16
+ manifest의 **원본 바이트**를 해싱하므로 줄바꿈이나 공백 변경도 digest를 바꾼다.
17
+ 불일치를 없애려고 변경된 manifest의 해시를 자동으로 다시 승인하지 않는다.
18
+ 해시 고정은 내용 식별 수단이지 서명, 실행 승인, 사전 등록의 증명이 아니다.
19
+
20
+ 성공하면 JSON을 stdout에 출력한다. 실패하면 stdout은 비우고 stderr에
21
+ `{"status":"incomplete","code":"missing_cost"}` 같은 진단만 출력한다.
22
+ 경로·JSON 파서의 원문·provider 오류 메시지는 진단에 복사하지 않는다.
23
+
24
+ | 종료 코드 | 의미 |
25
+ | --- | --- |
26
+ | 0 | 모든 입력 결과가 아래 계약을 충족함. 실제 전송·비교 조건 검증은 아님 |
27
+ | 1 | 파일·digest·결과 무결성 오류 또는 예기치 않은 내부 오류 |
28
+ | 2 | 옵션 오류 또는 manifest 스키마 오류 |
29
+
30
+ ## Manifest v1
31
+
32
+ 다음은 **합성 예시**다. 반복 문자 해시를 실제 평가의 provenance로 쓰지 않는다.
33
+
34
+ ```json
35
+ {
36
+ "schemaVersion": "omk-tb21-manifest-1",
37
+ "runId": "example-run",
38
+ "datasetRevision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
39
+ "conditionsSha256": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
40
+ "tasks": [
41
+ {
42
+ "id": "example-task",
43
+ "checksum": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
44
+ }
45
+ ],
46
+ "arms": {
47
+ "A": {
48
+ "job": "arm-a",
49
+ "modelName": "gateway/model-one",
50
+ "harnessSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
51
+ "adapterSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
52
+ },
53
+ "B": {
54
+ "job": "arm-b",
55
+ "modelName": "compatible/model-one",
56
+ "harnessSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
57
+ "adapterSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ - `tasks`는 1~1000개이며 중복 ID를 허용하지 않는다. ID는 영문·숫자로 시작하는
64
+ 128자 이하의 영문·숫자·`.`·`_`·`-` 문자열이다.
65
+ - `datasetRevision`은 전체 40자리 소문자 Git SHA, 나머지 해시는 64자리 소문자 SHA-256이다.
66
+ - `job`은 manifest 디렉터리 아래의 상대 경로다. 절대 경로, `..`, 역슬래시,
67
+ 빈 경로 조각, 동일한 두 job 경로와 심볼릭 링크를 거부한다.
68
+ - `modelName`은 각 arm의 Harbor `config.agent.model_name`과 정확히 비교한다.
69
+ 호환 공급자 이름이 다를 수 있으므로 두 라벨의 동일성이 실제 모델 동일성을 뜻하지 않는다.
70
+ - manifest의 모든 객체는 지정된 필드만 허용한다. 자격증명·환경 값·프롬프트를 넣지 않는다.
71
+ - `conditionsSha256`, `harnessSha256`, `adapterSha256`, `datasetRevision`은 **선언값**이다.
72
+ 이 도구가 조건 파일·실행 바이너리·컨테이너·데이터셋 저장소를 열어 대조하는 것은 아니다.
73
+
74
+ ## 읽는 파일과 검증 규칙
75
+
76
+ ```text
77
+ manifest.json
78
+ arm-a/
79
+ trial-a/result.json
80
+ arm-b/
81
+ trial-b/result.json
82
+ ```
83
+
84
+ 각 job의 바로 아래 디렉터리는 모두 trial로 간주한다. 별도 산출물 디렉터리는
85
+ job 바깥에 둔다. job 루트의 일반 파일(예: `config.json`, 전체 `result.json`)은
86
+ 개별 trial 집계에 사용하지 않는다. 최신 job 검색이나 시간창 기반 원장 귀속은 없다.
87
+
88
+ 각 task는 각 arm에 정확히 한 번 있어야 한다. v1은 재시도·다회 반복 집계를 지원하지
89
+ 않으므로 추가 attempt를 거부한다. 마지막 결과로 덮어쓰거나 가장 좋은 시행을 고르지 않는다.
90
+ `trial_name`은 디렉터리 이름과 일치해야 하며 `id`는 두 arm 전체에서 유일해야 한다.
91
+ Harbor가 절대 task 경로를 기록한 경우 마지막 경로 조각을 manifest ID와 비교하고,
92
+ `task_checksum`도 고정된 task checksum과 대조한다.
93
+
94
+ `verifier_result.rewards.reward`는 숫자 0 또는 1이어야 한다. 값이 없거나 null이면
95
+ 명시적인 `exception_info.exception_type`이 있을 때만 미해결로 집계한다.
96
+ 성공 보상 1과 예외가 함께 있으면 모순으로 거부한다. `exception_info` 필드 자체가
97
+ 없으면 예외 여부를 추측하지 않는다. timeout도 분모에 남는다.
98
+
99
+ `agent_result.cost_usd`는 0 이상의 유한한 숫자여야 한다. 누락·null은 **0이 아니라
100
+ 미확인**이며 요약을 거부한다. 합산 overflow도 거부한다. 해결 task가 0개이면
101
+ `costPerSolved`는 null이다. 비용 단가·캐시 할인·실제 청구서 정합성은 별도 확인 대상이다.
102
+
103
+ manifest는 최대 256 KiB, 개별 결과는 최대 8 MiB까지 읽는다. 파일 읽기는 크기를
104
+ 제한하고 일반 파일만 허용한다. 실행이 끝나고 쓰기가 멈춘 자료를 입력해야 한다.
105
+ 이 검사는 같은 호스트의 동시 경로 교체를 격리하는 OS sandbox가 아니다.
106
+
107
+ ## 보고서의 주장 범위
108
+
109
+ 출력에는 arm별 task·해결·예외 수, 비용 합계·해결당 비용, 쌍대 성공표와 차이(pp),
110
+ manifest와 결과 파일의 해시가 포함된다. 원본 trial ID·task 절대 경로·kwargs·예외
111
+ 메시지는 내보내지 않는다. 출력의 run/task ID는 manifest에서 승인한 식별자를 사용한다.
112
+
113
+ 항상 `modelVerification: "configuration-only"`, `costSource: "harbor-agent-result"`를
114
+ 표시한다. 설정이 같다는 사실로 실제 모든 provider 전송이 같았다고 추론하지 않는다.
115
+ Gateway 원장으로만 비용을 알 수 있는 과거 trial은 비용을 지어내지 않고 `missing_cost`로
116
+ 거부한다. 신뢰할 수 있는 request ID별 원장 결합은 로드맵 R3의 후속 작업이다.
117
+
118
+ 이 도구는 실제 실행을 증명하는 attestator나 통계적 우열 검정기가 아니다. 공개하기 전
119
+ 식별자·가격·자료 보유 권한을 검토하고 [비교 계약](metrics.md)을 적용한다.
120
+
121
+ ## 검사
122
+
123
+ 저장소 루트에서 공급자·다운로드 없이 실행한다.
124
+
125
+ ```bash
126
+ node --test --test-concurrency=1 scripts/test/tb21-audit.test.mjs scripts/test/tb21-audit-inputs.test.mjs
127
+ node node_modules/typescript/bin/tsc --noEmit --allowJs --checkJs --strict --target ES2022 --module NodeNext --skipLibCheck --types node scripts/tb21-audit.mjs scripts/lib/tb21-input.mjs scripts/lib/tb21-audit.mjs
128
+ ```
129
+
130
+ 프로젝트 Biome 설정은 기본적으로 `.mjs`를 포함하지 않는다. 실제 파일이 검사됐는지
131
+ 확인하며, 빈 검사 결과를 통과 증거로 쓰지 않는다.
@@ -94,6 +94,26 @@ Add to `settings.json` (Ctrl+Shift+, or Settings → Open JSON file) to forward
94
94
 
95
95
  If you already have an `actions` array, add the objects to it. If the old fullscreen behavior persists, fully close and reopen Windows Terminal.
96
96
 
97
+ ### Windows screenshots into a WSL prompt
98
+
99
+ Capture with **Win+Shift+S**, return to OMK, and press **Alt+V**. The image is added
100
+ to the prompt attachment strip; submit the prompt when ready. **Ctrl+V** also works
101
+ when the terminal forwards that key to OMK. Windows Terminal normally handles Ctrl+V
102
+ itself and pastes text, so an image-only clipboard may appear to do nothing.
103
+
104
+ To deliberately forward Ctrl+V instead, add this action to Windows Terminal's
105
+ existing settings (this changes Ctrl+V behavior for that terminal):
106
+
107
+ ```json
108
+ { "command": { "action": "sendInput", "input": "\u0016" }, "keys": "ctrl+v" }
109
+ ```
110
+
111
+ Use the terminal's normal text-paste shortcut, commonly Ctrl+Shift+V, for clipboard
112
+ text after this opt-in. OMK does not change terminal settings automatically.
113
+ See [Windows setup](windows.md#windows-screenshot-paste) for clipboard prerequisites
114
+ and error behavior. Inline image rendering is terminal-dependent; an attachment
115
+ chip does not require the terminal to display image pixels.
116
+
97
117
  ## xfce4-terminal, terminator
98
118
 
99
119
  These terminals have limited escape sequence support. Modified Enter keys like `Ctrl+Enter` and `Shift+Enter` cannot be distinguished from plain `Enter`, preventing custom keybindings such as `submit: ["ctrl+enter"]` from working.
package/docs/usage.md CHANGED
@@ -46,6 +46,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
46
46
  | `/name <name>` | Set session display name |
47
47
  | `/session` | Show session file, ID, messages, tokens, and cost |
48
48
  | `/resource [probe\|policy]` | Show resource pressure and effective concurrency for this run |
49
+ | `/debug [save]` | Preview runtime diagnostics; explicitly save a metadata-only local report |
49
50
  | `/goal [objective]` | Show or set the durable goal for the current working directory |
50
51
  | `/tree` | Jump to any point in the session and continue from there |
51
52
  | `/fork` | Create a new session from a previous user message |
@@ -61,6 +62,59 @@ Type `/` in the editor to open command completion. Extensions can register custo
61
62
  | `/star` | Open the OMK GitHub repository |
62
63
  | `/quit` | Quit omk |
63
64
 
65
+ ### Diagnostics and failure details
66
+
67
+ `/debug` previews runtime identity, terminal state and the latest typed outcome
68
+ without saving or contacting a provider. The existing TUI debug shortcut opens
69
+ the same preview instead of dumping the transcript.
70
+
71
+ `/debug save` explicitly creates a new `omk-debug-*/diagnostics.json` under the OS
72
+ temporary directory and prints its path. It does not upload or overwrite a report.
73
+ POSIX directory/file permissions are `0700`/`0600`; Windows access follows the
74
+ temporary directory's ACLs. Delete that directory when it is no longer needed.
75
+
76
+ The version-1 JSON report contains approved metadata fields only. It excludes
77
+ messages, prompts, images, tool output, rendered screen text, raw errors,
78
+ configuration, environment values, credentials, local paths, session/run IDs and
79
+ provider/model/tool names. Launch and UI module paths are visible locally, not
80
+ saved. Metadata such as timestamps and message counts can still describe your
81
+ workload; review a report before sharing it.
82
+
83
+ There is no raw-transcript option in this command. Old `omk-debug.log` files are
84
+ not deleted or rewritten and may contain private transcripts. Explicit raw ANSI
85
+ capture via `OMK_TUI_WRITE_LOG` remains a separate, sensitive debugging facility;
86
+ see [TUI components](tui.md#debug-logging).
87
+
88
+ **Runtime identity:** The UI entry file's SHA-256 is observed at module initialization
89
+ and compared with the same file during inspection. Missing, oversized, virtual or
90
+ unreadable files are `unavailable`, not healthy. This is a single-file observation,
91
+ not a fingerprint of all dependencies or proof of the exact executed bytes.
92
+ An unchanged entry does not establish that a build includes current source changes.
93
+ The package has no embedded build-to-commit binding, so build revision is reported
94
+ as unavailable rather than inferred from checkout `HEAD`.
95
+
96
+ `/reload` refreshes resources, not core JavaScript modules. Its last completion time
97
+ is shown separately. Core changes need an authorized build where applicable and a
98
+ restarted process. Source-mode QA does not update an installed launcher.
99
+
100
+ **Failure cards:** Cause, impact and next action appear before technical fields.
101
+ Ctrl+O (or the configured `app.tools.expand` binding) expands kind/phase/cause code,
102
+ observation source, retry flags, run ID, timestamp and route. Credential-shaped
103
+ values are masked even when input redaction is disabled; terminal controls are
104
+ removed. These local details are not the saved report.
105
+
106
+ Cards never retry, repair or approve effects. Retryability and automatic-retry
107
+ safety stay separate; possible/confirmed side effects require inspection before
108
+ repeating work. Duplicate delivery of the same termination is coalesced; separate
109
+ failed attempts remain visible. Completed runs stay quiet, and compaction
110
+ cancellation retains its concise status. Journal, print, JSON and RPC termination
111
+ contracts are unchanged.
112
+
113
+ Focused regression tests: `test/interactive-mode-diagnostics.test.ts` and
114
+ `test/tui-diagnostics.test.ts` in `packages/coding-agent`. These cover the real
115
+ command adapter, sensitive-field exclusion, private report creation, runtime file
116
+ changes/unavailability, forced masking, narrow-terminal wrapping and theme changes.
117
+
64
118
  ### Durable Goals
65
119
 
66
120
  Use `/goal <objective>` to create or update the durable goal for the current working directory; `/goal` without arguments shows its status. See [Run Protocol](run-protocol.md#durable-goal-lifecycle) for the authoritative persistence, round-limit, continuation, and SDK lifecycle rules.
@@ -73,13 +127,35 @@ Use `/goal <objective>` to create or update the durable goal for the current wor
73
127
  | --- | --- | --- |
74
128
  | Identical-loop guard | Warns from the third consecutive identical tool call and blocks the sixth | `OMK_IDENTICAL_LOOP=0` |
75
129
  | Tool-pair repair | Removes unmatched tool-use and tool-result blocks from outbound context | `OMK_TOOL_PAIR_REPAIR=0` |
76
- | Model prompt presets | Adds model-specific execution guidance for supported Claude, Kimi, GLM, and Grok models | `OMK_PROMPT_PRESET=0` |
130
+ | Model prompt presets | Adds model-specific execution guidance for GPT-6 Astra and supported Claude, Kimi, GLM, and Grok models | `OMK_PROMPT_PRESET=0` |
77
131
  | Goal controller | Registers `/goal` and continues active goals within their round limit | `OMK_GOAL_CONTROLLER=0` |
78
132
 
79
133
  These built-ins remain active with `--no-extensions`. A custom `ResourceLoader` owns its own extension set and does not receive them automatically.
80
134
 
81
135
  Claude models use a clean prompt context by default: OMK keeps tools, skills, and the Claude preset but omits discovered `AGENTS.md` and `CLAUDE.md` files. This avoids provider false positives caused by unrelated instruction text. Set `OMK_CLAUDE_CONTEXT_FILES=1` to restore those files for Claude.
82
136
 
137
+ ### GPT-6 Astra
138
+
139
+ When the resolved model ID is exactly `gpt-6-astra`, the built-in preset appends
140
+ `<model_preset id="gpt-6-astra">` at `before_agent_start`. Provider-qualified IDs
141
+ such as `openai/gpt-6-astra` and `openrouter/openai/gpt-6-astra` match the same
142
+ model. Similar names, dated variants, and other GPT models do not select this
143
+ preset. Select the configured model through `/model`; the preset does not add
144
+ model availability to an account.
145
+
146
+ The Astra guidance encourages completing authorized work, asking only material
147
+ clarifying questions, explaining any skill instruction that blocks progress,
148
+ writing concise prose, delegating independent work when permitted, and using
149
+ focused verification without unnecessary repeat runs. Explicit user requests
150
+ outrank advisory skill guidance within higher-priority instructions and runtime
151
+ permissions. Pending tool results must be accounted for before claiming completion.
152
+
153
+ Each new request selects guidance from its current model and fresh base prompt;
154
+ switching models does not carry the Astra preset into the next request.
155
+ `OMK_PROMPT_PRESET=0` disables the existing model-preset built-in, including Astra.
156
+ API parameters and transport capabilities remain controlled by the provider/runtime
157
+ configuration.
158
+
83
159
  ## Automatic Thinking Level Routing
84
160
 
85
161
  `/think <level>` sets the thinking level manually. Manual levels always win: choosing a concrete level leaves auto routing, so no auto router runs.