open-multi-agent-kit 0.96.0 → 0.96.2

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 (351) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +34 -6
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +1 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/commands/doctor-provider.d.ts.map +1 -1
  7. package/dist/commands/doctor-provider.js +15 -20
  8. package/dist/commands/doctor-provider.js.map +1 -1
  9. package/dist/commands/resource-doctor-cli.d.ts +22 -0
  10. package/dist/commands/resource-doctor-cli.d.ts.map +1 -0
  11. package/dist/commands/resource-doctor-cli.js +98 -0
  12. package/dist/commands/resource-doctor-cli.js.map +1 -0
  13. package/dist/commands/sdk-session-cli.d.ts +24 -0
  14. package/dist/commands/sdk-session-cli.d.ts.map +1 -0
  15. package/dist/commands/sdk-session-cli.js +225 -0
  16. package/dist/commands/sdk-session-cli.js.map +1 -0
  17. package/dist/core/advisory-judge-model.d.ts +18 -0
  18. package/dist/core/advisory-judge-model.d.ts.map +1 -0
  19. package/dist/core/advisory-judge-model.js +168 -0
  20. package/dist/core/advisory-judge-model.js.map +1 -0
  21. package/dist/core/advisory-judge-response.d.ts +8 -0
  22. package/dist/core/advisory-judge-response.d.ts.map +1 -0
  23. package/dist/core/advisory-judge-response.js +61 -0
  24. package/dist/core/advisory-judge-response.js.map +1 -0
  25. package/dist/core/advisory-judge-types.d.ts +53 -0
  26. package/dist/core/advisory-judge-types.d.ts.map +1 -0
  27. package/dist/core/advisory-judge-types.js +2 -0
  28. package/dist/core/advisory-judge-types.js.map +1 -0
  29. package/dist/core/advisory-judge.d.ts +8 -0
  30. package/dist/core/advisory-judge.d.ts.map +1 -0
  31. package/dist/core/advisory-judge.js +178 -0
  32. package/dist/core/advisory-judge.js.map +1 -0
  33. package/dist/core/agent-session-services.d.ts +1 -0
  34. package/dist/core/agent-session-services.d.ts.map +1 -1
  35. package/dist/core/agent-session-services.js +1 -0
  36. package/dist/core/agent-session-services.js.map +1 -1
  37. package/dist/core/agent-session.d.ts +41 -2
  38. package/dist/core/agent-session.d.ts.map +1 -1
  39. package/dist/core/agent-session.js +396 -179
  40. package/dist/core/agent-session.js.map +1 -1
  41. package/dist/core/auth-storage.d.ts.map +1 -1
  42. package/dist/core/auth-storage.js +28 -4
  43. package/dist/core/auth-storage.js.map +1 -1
  44. package/dist/core/compaction-gate.d.ts +28 -0
  45. package/dist/core/compaction-gate.d.ts.map +1 -0
  46. package/dist/core/compaction-gate.js +34 -0
  47. package/dist/core/compaction-gate.js.map +1 -0
  48. package/dist/core/completion-sound.d.ts +109 -0
  49. package/dist/core/completion-sound.d.ts.map +1 -0
  50. package/dist/core/completion-sound.js +165 -0
  51. package/dist/core/completion-sound.js.map +1 -0
  52. package/dist/core/context-budget-system-prompt-items.d.ts.map +1 -1
  53. package/dist/core/context-budget-system-prompt-items.js +5 -3
  54. package/dist/core/context-budget-system-prompt-items.js.map +1 -1
  55. package/dist/core/domain-loadouts.d.ts.map +1 -1
  56. package/dist/core/domain-loadouts.js +2 -2
  57. package/dist/core/domain-loadouts.js.map +1 -1
  58. package/dist/core/durable-goal-checkpoint.d.ts +6 -0
  59. package/dist/core/durable-goal-checkpoint.d.ts.map +1 -0
  60. package/dist/core/durable-goal-checkpoint.js +195 -0
  61. package/dist/core/durable-goal-checkpoint.js.map +1 -0
  62. package/dist/core/durable-goal-parse.d.ts +3 -0
  63. package/dist/core/durable-goal-parse.d.ts.map +1 -0
  64. package/dist/core/durable-goal-parse.js +86 -0
  65. package/dist/core/durable-goal-parse.js.map +1 -0
  66. package/dist/core/durable-goal-reducer.d.ts +3 -0
  67. package/dist/core/durable-goal-reducer.d.ts.map +1 -0
  68. package/dist/core/durable-goal-reducer.js +175 -0
  69. package/dist/core/durable-goal-reducer.js.map +1 -0
  70. package/dist/core/durable-goal-store.d.ts +19 -0
  71. package/dist/core/durable-goal-store.d.ts.map +1 -0
  72. package/dist/core/durable-goal-store.js +126 -0
  73. package/dist/core/durable-goal-store.js.map +1 -0
  74. package/dist/core/durable-goal.d.ts +92 -0
  75. package/dist/core/durable-goal.d.ts.map +1 -0
  76. package/dist/core/durable-goal.js +62 -0
  77. package/dist/core/durable-goal.js.map +1 -0
  78. package/dist/core/extensions/builtin/goal-controller.d.ts +3 -0
  79. package/dist/core/extensions/builtin/goal-controller.d.ts.map +1 -0
  80. package/dist/core/extensions/builtin/goal-controller.js +125 -0
  81. package/dist/core/extensions/builtin/goal-controller.js.map +1 -0
  82. package/dist/core/extensions/builtin/identical-loop.d.ts +3 -0
  83. package/dist/core/extensions/builtin/identical-loop.d.ts.map +1 -0
  84. package/dist/core/extensions/builtin/identical-loop.js +31 -0
  85. package/dist/core/extensions/builtin/identical-loop.js.map +1 -0
  86. package/dist/core/extensions/builtin/prompt-preset.d.ts +3 -0
  87. package/dist/core/extensions/builtin/prompt-preset.d.ts.map +1 -0
  88. package/dist/core/extensions/builtin/prompt-preset.js +13 -0
  89. package/dist/core/extensions/builtin/prompt-preset.js.map +1 -0
  90. package/dist/core/extensions/builtin/tool-pair-repair.d.ts +3 -0
  91. package/dist/core/extensions/builtin/tool-pair-repair.d.ts.map +1 -0
  92. package/dist/core/extensions/builtin/tool-pair-repair.js +12 -0
  93. package/dist/core/extensions/builtin/tool-pair-repair.js.map +1 -0
  94. package/dist/core/extensions/types.d.ts +6 -2
  95. package/dist/core/extensions/types.d.ts.map +1 -1
  96. package/dist/core/extensions/types.js.map +1 -1
  97. package/dist/core/goal-continuation.d.ts +13 -0
  98. package/dist/core/goal-continuation.d.ts.map +1 -0
  99. package/dist/core/goal-continuation.js +10 -0
  100. package/dist/core/goal-continuation.js.map +1 -0
  101. package/dist/core/grok-harness.d.ts +1 -1
  102. package/dist/core/grok-harness.d.ts.map +1 -1
  103. package/dist/core/grok-harness.js +1 -1
  104. package/dist/core/grok-harness.js.map +1 -1
  105. package/dist/core/grok-playbook.d.ts +1 -1
  106. package/dist/core/grok-playbook.d.ts.map +1 -1
  107. package/dist/core/grok-playbook.js +1 -1
  108. package/dist/core/grok-playbook.js.map +1 -1
  109. package/dist/core/host-resource-probe.d.ts +63 -0
  110. package/dist/core/host-resource-probe.d.ts.map +1 -0
  111. package/dist/core/host-resource-probe.js +126 -0
  112. package/dist/core/host-resource-probe.js.map +1 -0
  113. package/dist/core/host-resource-snapshot.d.ts +54 -0
  114. package/dist/core/host-resource-snapshot.d.ts.map +1 -0
  115. package/dist/core/host-resource-snapshot.js +139 -0
  116. package/dist/core/host-resource-snapshot.js.map +1 -0
  117. package/dist/core/identical-loop.d.ts +15 -0
  118. package/dist/core/identical-loop.d.ts.map +1 -0
  119. package/dist/core/identical-loop.js +34 -0
  120. package/dist/core/identical-loop.js.map +1 -0
  121. package/dist/core/index.d.ts +1 -1
  122. package/dist/core/index.d.ts.map +1 -1
  123. package/dist/core/index.js +1 -1
  124. package/dist/core/index.js.map +1 -1
  125. package/dist/core/model-prompt-policy.d.ts +11 -0
  126. package/dist/core/model-prompt-policy.d.ts.map +1 -0
  127. package/dist/core/model-prompt-policy.js +17 -0
  128. package/dist/core/model-prompt-policy.js.map +1 -0
  129. package/dist/core/model-registry.d.ts.map +1 -1
  130. package/dist/core/model-registry.js +16 -4
  131. package/dist/core/model-registry.js.map +1 -1
  132. package/dist/core/model-resolver.d.ts.map +1 -1
  133. package/dist/core/model-resolver.js +2 -2
  134. package/dist/core/model-resolver.js.map +1 -1
  135. package/dist/core/prompt-budget.d.ts +21 -0
  136. package/dist/core/prompt-budget.d.ts.map +1 -0
  137. package/dist/core/prompt-budget.js +51 -0
  138. package/dist/core/prompt-budget.js.map +1 -0
  139. package/dist/core/prompt-cache.d.ts +14 -0
  140. package/dist/core/prompt-cache.d.ts.map +1 -0
  141. package/dist/core/prompt-cache.js +16 -0
  142. package/dist/core/prompt-cache.js.map +1 -0
  143. package/dist/core/prompt-preset.d.ts +8 -0
  144. package/dist/core/prompt-preset.d.ts.map +1 -0
  145. package/dist/core/prompt-preset.js +56 -0
  146. package/dist/core/prompt-preset.js.map +1 -0
  147. package/dist/core/prompt-settlement.d.ts +81 -0
  148. package/dist/core/prompt-settlement.d.ts.map +1 -0
  149. package/dist/core/prompt-settlement.js +84 -0
  150. package/dist/core/prompt-settlement.js.map +1 -0
  151. package/dist/core/provider-resilience.d.ts +16 -0
  152. package/dist/core/provider-resilience.d.ts.map +1 -1
  153. package/dist/core/provider-resilience.js +24 -2
  154. package/dist/core/provider-resilience.js.map +1 -1
  155. package/dist/core/provider-retry.d.ts +36 -0
  156. package/dist/core/provider-retry.d.ts.map +1 -0
  157. package/dist/core/provider-retry.js +73 -0
  158. package/dist/core/provider-retry.js.map +1 -0
  159. package/dist/core/provider-usage.d.ts +16 -2
  160. package/dist/core/provider-usage.d.ts.map +1 -1
  161. package/dist/core/provider-usage.js +150 -8
  162. package/dist/core/provider-usage.js.map +1 -1
  163. package/dist/core/reasoning-router-resolver.d.ts.map +1 -1
  164. package/dist/core/reasoning-router-resolver.js +1 -1
  165. package/dist/core/reasoning-router-resolver.js.map +1 -1
  166. package/dist/core/resource-admission-config.d.ts +55 -0
  167. package/dist/core/resource-admission-config.d.ts.map +1 -0
  168. package/dist/core/resource-admission-config.js +97 -0
  169. package/dist/core/resource-admission-config.js.map +1 -0
  170. package/dist/core/resource-admission.d.ts +81 -0
  171. package/dist/core/resource-admission.d.ts.map +1 -0
  172. package/dist/core/resource-admission.js +128 -0
  173. package/dist/core/resource-admission.js.map +1 -0
  174. package/dist/core/resource-governor-format.d.ts +50 -0
  175. package/dist/core/resource-governor-format.d.ts.map +1 -0
  176. package/dist/core/resource-governor-format.js +113 -0
  177. package/dist/core/resource-governor-format.js.map +1 -0
  178. package/dist/core/resource-governor-settings.d.ts +56 -0
  179. package/dist/core/resource-governor-settings.d.ts.map +1 -0
  180. package/dist/core/resource-governor-settings.js +89 -0
  181. package/dist/core/resource-governor-settings.js.map +1 -0
  182. package/dist/core/resource-loader.d.ts.map +1 -1
  183. package/dist/core/resource-loader.js +32 -0
  184. package/dist/core/resource-loader.js.map +1 -1
  185. package/dist/core/resource-observation-journal.d.ts +74 -0
  186. package/dist/core/resource-observation-journal.d.ts.map +1 -0
  187. package/dist/core/resource-observation-journal.js +198 -0
  188. package/dist/core/resource-observation-journal.js.map +1 -0
  189. package/dist/core/resource-safety-gate.d.ts +54 -0
  190. package/dist/core/resource-safety-gate.d.ts.map +1 -0
  191. package/dist/core/resource-safety-gate.js +51 -0
  192. package/dist/core/resource-safety-gate.js.map +1 -0
  193. package/dist/core/run-journal.d.ts.map +1 -1
  194. package/dist/core/run-journal.js +13 -1
  195. package/dist/core/run-journal.js.map +1 -1
  196. package/dist/core/run-resource-lease.d.ts +73 -0
  197. package/dist/core/run-resource-lease.d.ts.map +1 -0
  198. package/dist/core/run-resource-lease.js +78 -0
  199. package/dist/core/run-resource-lease.js.map +1 -0
  200. package/dist/core/sandbox/backend.d.ts +12 -0
  201. package/dist/core/sandbox/backend.d.ts.map +1 -1
  202. package/dist/core/sandbox/backend.js +52 -42
  203. package/dist/core/sandbox/backend.js.map +1 -1
  204. package/dist/core/sandbox/policy.d.ts +2 -0
  205. package/dist/core/sandbox/policy.d.ts.map +1 -1
  206. package/dist/core/sandbox/policy.js +2 -1
  207. package/dist/core/sandbox/policy.js.map +1 -1
  208. package/dist/core/sdk.d.ts +2 -0
  209. package/dist/core/sdk.d.ts.map +1 -1
  210. package/dist/core/sdk.js +1 -0
  211. package/dist/core/sdk.js.map +1 -1
  212. package/dist/core/session-bash-service.d.ts +12 -0
  213. package/dist/core/session-bash-service.d.ts.map +1 -1
  214. package/dist/core/session-bash-service.js +14 -0
  215. package/dist/core/session-bash-service.js.map +1 -1
  216. package/dist/core/session-system-prompt.d.ts +30 -0
  217. package/dist/core/session-system-prompt.d.ts.map +1 -0
  218. package/dist/core/session-system-prompt.js +39 -0
  219. package/dist/core/session-system-prompt.js.map +1 -0
  220. package/dist/core/session-termination.d.ts +7 -2
  221. package/dist/core/session-termination.d.ts.map +1 -1
  222. package/dist/core/session-termination.js +29 -1
  223. package/dist/core/session-termination.js.map +1 -1
  224. package/dist/core/settings-manager.d.ts +12 -0
  225. package/dist/core/settings-manager.d.ts.map +1 -1
  226. package/dist/core/settings-manager.js +36 -0
  227. package/dist/core/settings-manager.js.map +1 -1
  228. package/dist/core/slash-commands.d.ts.map +1 -1
  229. package/dist/core/slash-commands.js +1 -0
  230. package/dist/core/slash-commands.js.map +1 -1
  231. package/dist/core/strict-record.d.ts +2 -0
  232. package/dist/core/strict-record.d.ts.map +1 -0
  233. package/dist/core/strict-record.js +9 -0
  234. package/dist/core/strict-record.js.map +1 -0
  235. package/dist/core/subagent-lane-launcher.d.ts +64 -0
  236. package/dist/core/subagent-lane-launcher.d.ts.map +1 -0
  237. package/dist/core/subagent-lane-launcher.js +107 -0
  238. package/dist/core/subagent-lane-launcher.js.map +1 -0
  239. package/dist/core/system-cpu-sampler.d.ts +45 -0
  240. package/dist/core/system-cpu-sampler.d.ts.map +1 -0
  241. package/dist/core/system-cpu-sampler.js +95 -0
  242. package/dist/core/system-cpu-sampler.js.map +1 -0
  243. package/dist/core/system-prompt.d.ts.map +1 -1
  244. package/dist/core/system-prompt.js +5 -8
  245. package/dist/core/system-prompt.js.map +1 -1
  246. package/dist/core/tool-pair-repair.d.ts +11 -0
  247. package/dist/core/tool-pair-repair.d.ts.map +1 -0
  248. package/dist/core/tool-pair-repair.js +38 -0
  249. package/dist/core/tool-pair-repair.js.map +1 -0
  250. package/dist/core/tools/artifact-spill.d.ts +13 -0
  251. package/dist/core/tools/artifact-spill.d.ts.map +1 -0
  252. package/dist/core/tools/artifact-spill.js +26 -0
  253. package/dist/core/tools/artifact-spill.js.map +1 -0
  254. package/dist/core/tools/bash.d.ts +7 -4
  255. package/dist/core/tools/bash.d.ts.map +1 -1
  256. package/dist/core/tools/bash.js +8 -7
  257. package/dist/core/tools/bash.js.map +1 -1
  258. package/dist/core/tools/index.d.ts +1 -1
  259. package/dist/core/tools/index.d.ts.map +1 -1
  260. package/dist/core/tools/index.js.map +1 -1
  261. package/dist/core/tools/read.d.ts +1 -0
  262. package/dist/core/tools/read.d.ts.map +1 -1
  263. package/dist/core/tools/read.js +10 -1
  264. package/dist/core/tools/read.js.map +1 -1
  265. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  266. package/dist/core/tools/tool-definition-wrapper.js +2 -0
  267. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  268. package/dist/core/workload-classifier.d.ts +32 -0
  269. package/dist/core/workload-classifier.d.ts.map +1 -0
  270. package/dist/core/workload-classifier.js +66 -0
  271. package/dist/core/workload-classifier.js.map +1 -0
  272. package/dist/core/workload-family-matcher.d.ts +3 -0
  273. package/dist/core/workload-family-matcher.d.ts.map +1 -0
  274. package/dist/core/workload-family-matcher.js +126 -0
  275. package/dist/core/workload-family-matcher.js.map +1 -0
  276. package/dist/core/workload-permit-pool.d.ts +78 -0
  277. package/dist/core/workload-permit-pool.d.ts.map +1 -0
  278. package/dist/core/workload-permit-pool.js +138 -0
  279. package/dist/core/workload-permit-pool.js.map +1 -0
  280. package/dist/core/workload-shard-executor.d.ts +68 -0
  281. package/dist/core/workload-shard-executor.d.ts.map +1 -0
  282. package/dist/core/workload-shard-executor.js +156 -0
  283. package/dist/core/workload-shard-executor.js.map +1 -0
  284. package/dist/core/workload-shard-plan.d.ts +81 -0
  285. package/dist/core/workload-shard-plan.d.ts.map +1 -0
  286. package/dist/core/workload-shard-plan.js +183 -0
  287. package/dist/core/workload-shard-plan.js.map +1 -0
  288. package/dist/core/workload-shard-runner.d.ts +11 -0
  289. package/dist/core/workload-shard-runner.d.ts.map +1 -0
  290. package/dist/core/workload-shard-runner.js +98 -0
  291. package/dist/core/workload-shard-runner.js.map +1 -0
  292. package/dist/core/workload-shard-store.d.ts +44 -0
  293. package/dist/core/workload-shard-store.d.ts.map +1 -0
  294. package/dist/core/workload-shard-store.js +189 -0
  295. package/dist/core/workload-shard-store.js.map +1 -0
  296. package/dist/core/workload-sharders.d.ts +47 -0
  297. package/dist/core/workload-sharders.d.ts.map +1 -0
  298. package/dist/core/workload-sharders.js +162 -0
  299. package/dist/core/workload-sharders.js.map +1 -0
  300. package/dist/core/workload-shell-scan.d.ts +12 -0
  301. package/dist/core/workload-shell-scan.d.ts.map +1 -0
  302. package/dist/core/workload-shell-scan.js +79 -0
  303. package/dist/core/workload-shell-scan.js.map +1 -0
  304. package/dist/index.d.ts +18 -1
  305. package/dist/index.d.ts.map +1 -1
  306. package/dist/index.js +18 -0
  307. package/dist/index.js.map +1 -1
  308. package/dist/main.d.ts.map +1 -1
  309. package/dist/main.js +14 -0
  310. package/dist/main.js.map +1 -1
  311. package/dist/modes/interactive/interactive-mode.d.ts +4 -0
  312. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  313. package/dist/modes/interactive/interactive-mode.js +81 -0
  314. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  315. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  316. package/dist/modes/interactive/theme/theme.js +14 -3
  317. package/dist/modes/interactive/theme/theme.js.map +1 -1
  318. package/docs/adaptorch-preview-spec.md +1 -1
  319. package/docs/adaptorch-preview.md +2 -2
  320. package/docs/book-to-skill.md +1 -1
  321. package/docs/containerization.md +9 -0
  322. package/docs/docs.json +11 -3
  323. package/docs/environment-variables.md +11 -4
  324. package/docs/extensions.md +14 -1
  325. package/docs/grok-harness.md +35 -12
  326. package/docs/index.md +7 -6
  327. package/docs/loadout-domains/grok-harness.md +2 -2
  328. package/docs/models.md +10 -9
  329. package/docs/provider-resilience.md +9 -3
  330. package/docs/providers.md +9 -4
  331. package/docs/run-protocol.md +32 -0
  332. package/docs/sdk.md +100 -3
  333. package/docs/security.md +22 -32
  334. package/docs/sessions.md +14 -0
  335. package/docs/settings.md +64 -2
  336. package/docs/skills.md +16 -0
  337. package/docs/usage.md +37 -15
  338. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  339. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  340. package/examples/extensions/custom-provider-gitlab-duo/index.ts +6 -1
  341. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  342. package/examples/extensions/gondolin/package-lock.json +2 -2
  343. package/examples/extensions/gondolin/package.json +1 -1
  344. package/examples/extensions/sandbox/package-lock.json +2 -2
  345. package/examples/extensions/sandbox/package.json +1 -1
  346. package/examples/extensions/subagent/agent-capability-router.test.ts +7 -0
  347. package/examples/extensions/subagent/domain-profiles.ts +0 -1
  348. package/examples/extensions/with-deps/package-lock.json +2 -2
  349. package/examples/extensions/with-deps/package.json +1 -1
  350. package/npm-shrinkwrap.json +18 -18
  351. package/package.json +7 -9
@@ -1,6 +1,6 @@
1
1
  # Grok harness
2
2
 
3
- This page is the project-local operator guide for running OMK with the xAI OAuth proxy. The canonical Grok playbook remains `~/.omk/agent/grok.md`; keep this page as a short routing and preset reference, not a duplicate source of truth.
3
+ This page is the canonical operator guide for the native `xai` provider. Use `/login` for xAI subscription OAuth or `XAI_API_KEY` for xAI Platform API billing. A user-local `~/.omk/agent/grok.md` may add operator notes, but it is not the portable product contract.
4
4
 
5
5
  ## Presets
6
6
 
@@ -8,27 +8,50 @@ Project presets live in `.omk/presets.json` and are consumed by the preset exten
8
8
 
9
9
  | Preset | Provider | Model | Thinking | Use |
10
10
  | --- | --- | --- | --- | --- |
11
- | `grok-verified` | `grok-oauth-proxy` | `grok-4.5` | `high` | Default Grok text-chat baseline (local OAuth proxy). |
12
- | `grok-adaptorch-prod` | `grok-oauth-proxy` | `grok-4.5` | `high` | Same baseline, with AdaptOrch reserved for explicit DAG routing, synthesis, or consistency-verification lanes. |
11
+ | `grok-verified` | `xai` | `grok-4.5` | `high` | Default native xAI text-chat baseline. |
12
+ | `grok-adaptorch-prod` | `xai` | `grok-4.5` | `high` | Same baseline, with AdaptOrch reserved for explicit DAG routing, synthesis, or consistency-verification lanes. |
13
13
 
14
- Register the provider in `~/.omk/agent/models.json` with `baseUrl: http://127.0.0.1:9996/v1` and chat models including `grok-4.5` (and optional fallbacks such as `grok-4.3`). Loopback proxy accepts a dummy `apiKey`; do not put OAuth tokens in models.json. Confirm proxy health with `curl -fsS http://127.0.0.1:9996/health` before long sessions.
14
+ ## Authentication and weekly usage
15
15
 
16
- Suggested TUI flow:
16
+ Both authentication methods use provider ID `xai`. See [Providers](providers.md#xai-grok) for the authoritative OAuth, API-key, credential-storage, and weekly-usage behavior. Do not put OAuth access or refresh tokens in `models.json`.
17
17
 
18
- 1. Run `/grok` to inject the pointer to `~/.omk/agent/grok.md`.
18
+ ## Thinking tiers
19
+
20
+ OMK sends the mapped value as xAI `reasoning_effort`.
21
+
22
+ | OMK tier | `grok-4.6` | `grok-4.5` | `grok-4.3` |
23
+ | --- | --- | --- | --- |
24
+ | `off` | unavailable | unavailable | `none` |
25
+ | `minimal` | unavailable | unavailable | unavailable |
26
+ | `low` | `low` | `low` | `low` |
27
+ | `medium` | `medium` | `medium` | `medium` |
28
+ | `high` | `high` | `high` | `high` |
29
+ | `xhigh` | `xhigh` | unavailable | unavailable |
30
+ | `max` | `xhigh` | `high` | `high` |
31
+ | `ultra` | `xhigh` | `high` | `high` |
32
+
33
+ Grok 4.6 and 4.5 cannot disable reasoning. Grok 4.3 supports `off` by sending `reasoning_effort: "none"`.
34
+
35
+ ## Migration from `grok-oauth-proxy`
36
+
37
+ The proxy provider is retired. Remove stale `grok-oauth-proxy` entries from `models.json` and `auth.json`, then use native `xai`. OMK ignores stale entries during migration.
38
+
39
+ ## Suggested TUI flow
40
+
41
+ 1. Run `/grok` only when you want to load the optional local operator overlay.
19
42
  2. Select `/preset grok-verified` for normal chat/coding work.
20
43
  3. Select `/preset grok-adaptorch-prod` only when the task has an explicit DAG, routing, or synthesis objective.
21
44
  4. Keep credentials and OAuth material out of preset JSON.
22
45
 
23
46
  ## Domain routing
24
47
 
25
- Domain routing is opt-in. Start OMK with `OMK_DOMAIN_ROUTING=1` when you want the domain router to compose the role loadout with a domain profile before dispatch. With the variable unset or any value other than `1`, the domain dispatch layer does not apply a domain access policy.
48
+ Selecting the native `xai` provider auto-applies the `grok-harness` loadout by default; this does not require `OMK_DOMAIN_ROUTING=1`. Set `OMK_GROK_HARNESS=0` to disable that provider-specific dispatch.
26
49
 
27
- The router selects one of the documented domain profiles under [`loadout-domains/`](loadout-domains/README.md), then composes that profile with the active role loadout. Grok presets do not replace this mechanism; they only set provider, model, thinking level, and instruction pointers.
50
+ General prompt-based domain routing is separate and opt-in through `OMK_DOMAIN_ROUTING=1`. It selects one of the profiles under [`loadout-domains/`](loadout-domains/README.md) and composes it with the active role loadout. Grok presets only set provider, model, thinking level, and instruction pointers.
28
51
 
29
- ## Composer model
52
+ ## Chat model selection
30
53
 
31
- `grok-composer-2.5-fast` is a valid Grok chat model, but the project presets keep `grok-4.5` as the default. Use Composer only for explicit Composer validation or comparison work. `grok-4.3` remains a supported fallback chat model. Do not use `grok-imagine-*` ids as chat models; session `setModel` / `prompt` reject them on `grok-oauth-proxy`.
54
+ The native `xai` catalog includes `grok-4.6`, `grok-4.5`, and `grok-4.3`. Use `/model` or `omk --list-models xai` for the current complete list. Project presets intentionally pin the verified `grok-4.5` baseline, and `grok-4.3` remains a fallback. Do not use `grok-imagine-*` IDs as chat models.
32
55
 
33
56
  ## Imagine tools
34
57
 
@@ -58,6 +81,6 @@ Use the normal OMK lane grant model: grant the smallest skill and MCP surface th
58
81
 
59
82
  Relevant evidence hooks for Grok lanes are `pre-shell-guard`, `protect-secrets`, `typecheck-after-edit`, and `stop-verify`. Hook output is incremental evidence; code changes still need the project's required final verification command before claiming type/lint cleanliness.
60
83
 
61
- ## Canonical reference
84
+ ## Local overlay
62
85
 
63
- For proxy health checks, chat model rules, Imagine tool behavior, Hermes parity, Telegram behavior, and unsafe `GROK.MD` handling, read `~/.omk/agent/grok.md`.
86
+ `/grok` may load `~/.omk/agent/grok.md` for host-specific Hermes, Telegram, or Imagine notes. Treat that file as optional local configuration; this page and the current provider documentation remain authoritative.
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OMK Documentation
2
2
 
3
- OMK is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and omk packages.
3
+ OMK is a provider-neutral coding agent with multi-agent orchestration, durable harness controls, replayable sessions, SDK/RPC integration, and evidence-backed verification. Its core stays small while extensions, skills, prompts, themes, and packages add workflows.
4
4
 
5
5
  ## Quick start
6
6
 
@@ -33,12 +33,13 @@ For the full first-run flow, see [Quickstart](quickstart.md).
33
33
  ## Start here
34
34
 
35
35
  - [Quickstart](quickstart.md) - install, authenticate, and run a first session.
36
- - [Using OMK](usage.md) - interactive mode, slash commands, context files, and CLI reference.
36
+ - [Using OMK](usage.md) - interactive mode, `/goal`, default harness safeguards, context files, and CLI reference.
37
37
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
38
38
  - [Provider Resilience](provider-resilience.md) - retry, failover, quota, and safety-stop recovery.
39
+ - [Native xAI Grok](grok-harness.md) - authentication, weekly SuperGrok usage, presets, and thinking tiers.
39
40
  - [Containerization](containerization.md) - sandbox omk with OpenShell, Gondolin, or Docker.
40
41
  - [Settings](settings.md) - global and project settings.
41
- - [Environment Variables](environment-variables.md) - process configuration and bash-tool session environment.
42
+ - [Environment Variables](environment-variables.md) - process configuration, harness opt-outs, and bash-tool session environment.
42
43
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
43
44
  - [Sessions](sessions.md) - session management, branching, and tree navigation.
44
45
  - [Compaction](compaction.md) - context compaction and branch summarization.
@@ -54,10 +55,10 @@ For the full first-run flow, see [Quickstart](quickstart.md).
54
55
  - [Custom models](models.md) - add model entries for supported provider APIs.
55
56
  - [Custom providers](custom-provider.md) - implement custom APIs and OAuth flows.
56
57
 
57
- ## Programmatic usage
58
+ ## Automation and control
58
59
 
59
- - [SDK](sdk.md) - embed omk in Node.js applications.
60
- - [Run Protocol v1](run-protocol.md) - canonical task, attempt, observation, evaluation, decision, and waiver contracts.
60
+ - [SDK and Session Control](sdk.md) - embed omk, reuse policy helpers, or inspect stored sessions from scripts.
61
+ - [Run Protocol and Durable Goals](run-protocol.md) - canonical run contracts and the durable-goal lifecycle.
61
62
  - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
62
63
  - [JSON event stream mode](json.md) - print mode with structured events.
63
64
  - [TUI components](tui.md) - build custom terminal UI for extensions.
@@ -21,7 +21,7 @@ DOMAIN: Grok xAI Harness. You are operating in a Grok/xAI integration lane.
21
21
  Prioritize the Grok operational playbook, small capability loadouts, and evidence-bound provider/tool routing.
22
22
 
23
23
  SEQUENCE:
24
- 1. Before implementing or routing Grok/xAI provider work, read and enforce ~/.omk/agent/grok.md. Treat it as the required Grok playbook for chat models vs Imagine tools, proxy health, tool-use/loop discipline, and Telegram parity unless higher-priority instructions conflict.
24
+ 1. Before implementing or routing Grok/xAI provider work, read packages/coding-agent/docs/grok-harness.md as the canonical playbook. Treat ~/.omk/agent/grok.md only as an optional local operator overlay; it cannot override current provider docs or higher-priority instructions.
25
25
  2. Keep text chat flows and Imagine/media tool flows separate. Text work uses Grok chat/OAuth/provider surfaces; image/video/Imagine work routes through explicit Imagine tools only. Never conflate model ids with Imagine tool names.
26
26
  3. Capability discipline: load at most 2-3 skills for any lane. The allowed skill gate is packages, headroom, programming, debugging, adaptorch-route, adaptorch-synthesize, and understand-anything; choose the smallest subset and add headroom only under context pressure.
27
27
  4. Adaptorch is advisory only. Use adaptorch-route for routing/decomposition advice and adaptorch-synthesize for evidence synthesis, but do not treat Adaptorch as an automatic executor, source of truth, permission grant, or substitute for explicit tests.
@@ -29,7 +29,7 @@ SEQUENCE:
29
29
  6. Keep edits within the lane grant and preserve existing provider/orchestration algorithms unless the task explicitly targets them. Never route through legacy KIMICLI or deleted wrappers.
30
30
  7. Verification: run the narrowest relevant test/typecheck after edits. Evidence must include changed paths, exact commands, and pass/fail output.
31
31
 
32
- HARD RULES: grok.md is mandatory context for Grok/xAI harness work; text chat surfaces and Imagine tools are distinct; maximum 2-3 active skills; Adaptorch is advisory route/synthesis support only; never log OAuth tokens, cookies, or proxy credentials; protect-secrets applies.
32
+ HARD RULES: the packaged Grok harness doc is mandatory context; a local grok.md is optional; text chat surfaces and Imagine tools are distinct; maximum 2-3 active skills; Adaptorch is advisory route/synthesis support only; never log OAuth tokens, cookies, or proxy credentials; protect-secrets applies.
33
33
  ```
34
34
 
35
35
  ## Curated skills (7)
package/docs/models.md CHANGED
@@ -11,13 +11,14 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.omk/a
11
11
  - [Provider Configuration](#provider-configuration)
12
12
  - [Model Configuration](#model-configuration)
13
13
  - [Overriding Built-in Providers](#overriding-built-in-providers)
14
+ - [Thinking Level Map](#thinking-level-map)
14
15
  - [Per-model Overrides](#per-model-overrides)
15
16
  - [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
16
17
  - [OpenAI Compatibility](#openai-compatibility)
17
18
 
18
19
  ## Built-in NVIDIA GLM-5.2
19
20
 
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
+ 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 `/think max` is sent as `reasoning_effort: "max"`. Other NVIDIA models do not inherit that capability automatically.
21
22
 
22
23
  ## Minimal Example
23
24
 
@@ -226,17 +227,17 @@ Current behavior:
226
227
 
227
228
  ### Thinking Level Map
228
229
 
229
- Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are omk thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
230
-
231
- Values are tristate:
230
+ Use `thinkingLevelMap` on a model to describe model-specific thinking controls. `models.json` accepts `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Built-in metadata can also expose the `ultra` CLI tier, but the current `models.json` schema has no `ultra` key.
232
231
 
233
232
  | Value | Meaning |
234
- |-------|---------|
235
- | omitted | Level is supported and uses the provider's default mapping |
236
- | string | Level is supported and this value is sent to the provider |
237
- | `null` | Level is unsupported and hidden/skipped/clamped away |
233
+ | --- | --- |
234
+ | omitted | `off` through `high` use provider defaults; top tiers appear only when explicitly mapped |
235
+ | string | The level is supported and this value is sent to the provider |
236
+ | `null` | The level is unsupported and hidden or skipped during clamping |
237
+
238
+ See [Grok harness](grok-harness.md) for the exact built-in Grok mappings.
238
239
 
239
- Example for a model that only supports off, high, and max reasoning:
240
+ Example for a model that exposes OMK `high` and `xhigh`, with `xhigh` sent to the provider as `max`:
240
241
 
241
242
  ```json
242
243
  {
@@ -28,12 +28,18 @@ Configure resilience in `~/.omk/agent/settings.json` or `.omk/settings.json`:
28
28
 
29
29
  | Setting | Default | Behavior |
30
30
  |---|---:|---|
31
- | `blockStickySafetyModels` | `true` | Rejects models known to produce sticky false-positive safety stops. |
31
+ | `blockStickySafetyModels` | `true` | Blocks interactive and automatic activation of models known to produce sticky false-positive safety stops. The catalog still lists them; set this to `false` to use an interactive or saved selection. |
32
32
  | `autoFailoverOnSafetyStop` | `true` | Enables failover for safety stops and quota/billing exhaustion. |
33
33
  | `failoverCandidates` | built-in chain | Ordered models considered before an automatic retry. |
34
34
 
35
35
  Automatic recovery also requires `retry.enabled: true` and available retry budget.
36
36
 
37
+ An explicit `--model` or `--provider`/`--model` pin keeps automatic resilience from replacing that model. A later manual model selection can still change it.
38
+ Safety-stop failover and sticky-model eject do not run on a pinned model.
39
+ Claude Fable, Opus, and Sonnet also stay on-model after a content/safety stop,
40
+ even without `--model` and even when skills are loaded. Those refusals are not
41
+ retried on DeepSeek or Kimi.
42
+
37
43
  ## Failover behavior
38
44
 
39
45
  For a safety stop or recognized quota/billing error, OMK:
@@ -43,7 +49,7 @@ For a safety stop or recognized quota/billing error, OMK:
43
49
  3. selects the first non-sticky candidate that exists and has configured authentication;
44
50
  4. switches models before retrying with a short delay.
45
51
 
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.
52
+ A content/safety stop gets at most one automatic retry, including a retry that switches model, regardless of the larger transport retry budget. Other transient failures keep the configured retry policy and backoff. Plain authentication errors remain non-retryable and do not trigger failover.
47
53
 
48
54
  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.
49
55
 
@@ -51,7 +57,7 @@ The default candidate order is:
51
57
 
52
58
  1. `kimi-coding/k3`
53
59
  2. `modelstudio-maas/qwen3.8-max-preview`
54
- 3. `grok-oauth-proxy/grok-4.5`
60
+ 3. `xai/grok-4.5`
55
61
  4. `deepseek/deepseek-v4-pro`
56
62
  5. `deepseek/deepseek-v4-flash`
57
63
  6. `modelstudio-maas/deepseek-v4-pro`
package/docs/providers.md CHANGED
@@ -18,16 +18,19 @@ Use `/login` in interactive mode, then select a provider:
18
18
  - ChatGPT Plus/Pro (Codex)
19
19
  - Claude Pro/Max
20
20
  - GitHub Copilot
21
+ - xAI Grok subscription OAuth
21
22
 
22
23
  Run `/login` and choose a configured subscription provider to open its account picker. Select an existing account by its ChatGPT, Claude, or Google email when available, or choose **Add another account** to sign in with a new one. OMK keeps and refreshes each account independently, pins the provider to the account you select, and does not silently fail over to another subscription. `/model` remains dedicated to model selection.
23
24
 
24
25
  Use `/logout` to clear all stored accounts for a provider. Tokens are stored in `~/.omk/agent/auth.json` and auto-refresh when expired.
25
26
 
26
- When the status sidebar is pinned, its **USAGE** section lists every configured subscription provider, with the active provider first. OMK reads quota windows from fixed provider endpoints for Codex, Claude, Kimi Code, and GLM/ZAI Coding Plan, caches the result, and displays each percentage and reset countdown separately. Claude also passively merges the official `anthropic-ratelimit-unified-*` response headers used by Claude Code. If Anthropic's usage endpoint is rate limited and no complete recent snapshot exists, OMK mirrors Claude Code's own startup quota check with one fixed-endpoint Haiku request capped at one output token, no more than once per OAuth credential per hour. This fallback consumes a small amount of Claude plan quota.
27
+ When the status sidebar is pinned, its **USAGE** section lists every configured subscription provider, with the active provider first. OMK reads quota windows from fixed provider endpoints for Codex, Claude, Kimi Code, GLM/ZAI Coding Plan, and native xAI SuperGrok, caches the result, and displays each percentage and reset countdown separately. Claude also passively merges the official `anthropic-ratelimit-unified-*` response headers used by Claude Code. If Anthropic's usage endpoint is rate limited and no complete recent snapshot exists, OMK mirrors Claude Code's own startup quota check with one fixed-endpoint Haiku request capped at one output token, no more than once per OAuth credential per hour. This fallback consumes a small amount of Claude plan quota.
27
28
 
28
29
  Codex streaming passively merges `x-codex-primary-*`, `x-codex-secondary-*`, and `codex.rate_limits` signals through the non-blocking `StreamOptions.onRateLimit` observer. These signals supplement missing polling windows only when the Codex service returns them; OMK does not infer a missing 5-hour value from a 7-day value.
29
30
 
30
- Alibaba Model Studio Token Plan is recognized as **QWEN TOKEN PLAN** but shows `console-only quota`. Its [official usage page](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=plan&commonbuy=1&orderType=buy#/efm/subscription/token-plan) obtains `per5HourPercentage`, `per5HourResetTime`, `per1WeekPercentage`, and `per1WeekResetTime` through an authenticated Alibaba Cloud console gateway. The plan-specific `sk-sp-*` key does not authorize that console endpoint, and compatible-mode model responses expose token counts but no quota headers. OMK therefore does not copy browser cookies or estimate quota from token counts. Qwen OAuth and Grok remain explicit `quota API unavailable`.
31
+ Alibaba Model Studio Token Plan is recognized as **QWEN TOKEN PLAN** and reads its 7-day window through the official [QwenCloud management CLI](https://docs.qwencloud.com/api-reference/preparation/cli): when `qwencloud` is installed and logged in (`npm i -g @qwencloud/qwencloud-cli && qwencloud auth login`), OMK runs `qwencloud usage summary --format json` (override the binary with `QWENCLOUD_CLI`) and shows `token_plan.usedPct` plus the reset countdown. The CLI holds its own OAuth management credential; OMK never sends the plan's `sk-*` inference key anywhere for quota. Without the CLI the entry shows a `connect:` hint instead the [console usage page](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=plan#/efm/subscription/token-plan/personal) requires an Alibaba Cloud console session that OMK deliberately does not scrape, and OMK still never copies browser cookies or estimates quota from token counts. Qwen OAuth remains explicit `quota API unavailable`.
32
+
33
+ With a stored native `xai` OAuth credential, OMK reads `GET https://cli-chat-proxy.grok.com/v1/billing?format=credits` and shows the weekly SuperGrok pool from `config.creditUsagePercent` plus its reset from `config.currentPeriod.end`. `XAI_API_KEY` is a separate API-billing credential and does not authorize this subscription endpoint.
31
34
 
32
35
  ### OpenAI Codex
33
36
 
@@ -49,9 +52,11 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
49
52
  - Press Enter for github.com, or enter your GitHub Enterprise Server domain
50
53
  - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
51
54
 
52
- ### Grok harness presets
55
+ ### xAI Grok
56
+
57
+ Both authentication modes use the built-in `xai` provider. Run `/login` for subscription OAuth, or set `XAI_API_KEY` for xAI Platform API billing. Do not configure a second Grok provider.
53
58
 
54
- For `grok-oauth-proxy` project presets, Composer routing, and Imagine tool guidance, see [Grok harness](grok-harness.md).
59
+ For project presets, Imagine guidance, and the exact `grok-4.6`, `grok-4.5`, and `grok-4.3` thinking mappings, see [Grok harness](grok-harness.md).
55
60
 
56
61
  ## API Keys
57
62
 
@@ -24,6 +24,30 @@ The first v1 slice is available under `packages/protocol` with schema version `o
24
24
 
25
25
  Every top-level record carries `schemaVersion`. Parsers reject unsupported versions, malformed timestamps, duplicate claim IDs, invalid JSON facts, and empty logical conditions.
26
26
 
27
+ ## Durable goal lifecycle
28
+
29
+ A durable goal is working-directory state, not a session-file field or a `TaskSpec`. `/goal <objective>` creates or edits `.omk/goals/current.json`; `/goal` without arguments shows its status and round count.
30
+
31
+ Goals created by `/goal` use an eight-round cap. The controller queues another turn only while the goal is active, no message is pending, and the cap has not been reached. Reaching the cap stops automatic continuation; the controller does not infer or mark completion.
32
+
33
+ For programmatic lifecycle control, import `createDurableGoal`, `parseDurableGoalSnapshot`, `applyDurableGoalCommand`, and `DurableGoalStore` from `open-multi-agent-kit`. The reducer supports edit, pause, resume, block, round advancement, evidence attachment, completion, and clear transitions.
34
+
35
+ Every mutation consumes the current revisioned `GoalRef`; stale revisions are rejected. Editing the objective or round limit, or advancing a round, starts a new semantic generation and invalidates earlier completion evidence. Completion requires lowercase SHA-256 evidence captured during the current generation.
36
+
37
+ ### Seam checkpoints
38
+
39
+ A durable goal can carry one bounded `Goal / Core / Verified / Open / Next` seam checkpoint. The checkpoint is another revision in `.omk/goals/current.json`, not a separate state tree. It is bound to the goal generation and referenced evidence IDs, forced-redacted before persistence, and correlated by a content digest. The digest is unkeyed: it detects accidental mismatch but does not authenticate workspace state against a same-user editor.
40
+
41
+ Use the interactive command with strict JSON:
42
+
43
+ ```text
44
+ /goal checkpoint {"core":["Keep deterministic gates authoritative"],"verified":["focused-tests"],"open":["Historical calibration"],"next":"Run the package checks"}
45
+ ```
46
+
47
+ `verified` may name only fresh evidence already attached to the current goal generation. A round advance carries the checkpoint record forward but does not make its evidence current-round proof. The built-in controller injects checkpoint prose only when the user recorded it through `/goal checkpoint` in the current process. A checkpoint loaded from mutable workspace state is noted by digest and its prose is not promoted to user authority. Editing the objective or round limit clears it. The session stores only a `goal_checkpoint` entry containing the goal ID, revision, and checkpoint digest; complete content remains in the existing durable-goal journal.
48
+
49
+ Programmatic callers use the `record-checkpoint` command with `applyDurableGoalCommand()` or `DurableGoalStore.transition()`. `parseDurableGoalCheckpointCommand()` parses the interactive JSON shape; `formatDurableGoalCheckpoint()` renders the five fields.
50
+
27
51
  ## Evaluation model
28
52
 
29
53
  `evaluateTask()` is a pure `TaskSpec + ExecutionAttempt + Observation[] + WaiverRecord[] -> EvaluationResult` reducer. It does not mutate its inputs or stored evidence.
@@ -39,6 +63,14 @@ Required, unwaived violations reduce to `fail`. Required, unwaived missing obser
39
63
 
40
64
  `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
65
 
66
+ ### Advisory best-of-N judge
67
+
68
+ `chooseWithAdvisoryJudge()` is an optional selection sidecar, not a protocol verdict producer. It validates each `EvaluationResult`, admits only candidates whose semantic verdict is `pass`, and lets a judge score only that eligible set. Zero eligible candidates produce no selection; one skips the model; multiple candidates use weighted 0–4 rubric scores.
69
+
70
+ Candidate material, the task goal, and rubric descriptions are forced-redacted and bounded before the judge receives them. The model adapter uses a tool-free prompt, treats candidate text as untrusted data, disables retries and cache retention, and accepts only a complete matrix of known candidate and criterion IDs. A provider error, timeout, malformed JSON, unknown ID, or incomplete score matrix selects the existing deterministic first choice and reports a sanitized fallback reason.
71
+
72
+ The sidecar never creates an `Observation`, changes `EvaluationResult.semanticVerdict`, supplies independent-verifier evidence, waives a claim, or changes `RuntimeDecision`. Run fresh tests, integrity checks, security gates, and evidence freshness checks after applying the selected candidate.
73
+
42
74
  ## Waivers
43
75
 
44
76
  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.
package/docs/sdk.md CHANGED
@@ -14,6 +14,19 @@ The SDK provides programmatic access to omk's agent capabilities. Use it to embe
14
14
 
15
15
  See [examples/sdk/](../examples/sdk/) for working examples from minimal to full control.
16
16
 
17
+ ## Inspect persisted sessions from the CLI
18
+
19
+ Use `omk sdk session` to inspect or append to stored JSONL sessions without starting the TUI:
20
+
21
+ ```bash
22
+ omk sdk session status [id] [--cwd <path>] [--session-dir <path>] [--json]
23
+ omk sdk session tail [id] [--cwd <path>] [--session-dir <path>] [--limit <n>]
24
+ omk sdk session inspect [id] [--cwd <path>] [--session-dir <path>]
25
+ omk sdk session send <id> "<message>" [--cwd <path>] [--session-dir <path>]
26
+ ```
27
+
28
+ `status` without an ID lists sessions for the selected working directory. `tail` and `inspect` without an ID select the most recently modified session; `tail` defaults to 20 entries. `send` requires an exact ID, appends a user-message entry only when the session has no active owner, and does not wake or execute an agent. `status` is human-readable unless `--json` is passed; the other actions emit JSON. Exit codes are `0` for success, `1` when no target exists or the session is active, and `2` for invalid usage.
29
+
17
30
  ## Quick Start
18
31
 
19
32
  ```typescript
@@ -134,6 +147,20 @@ interface AgentSession {
134
147
 
135
148
  Session replacement APIs such as new-session, resume, fork, and import live on `AgentSessionRuntime`, not on `AgentSession`.
136
149
 
150
+ ### AgentSession policy seams
151
+
152
+ The package root exports focused policy helpers for custom runtimes and tests:
153
+
154
+ | Exports | Purpose |
155
+ | --- | --- |
156
+ | `shouldSkipCompactionCheck`, `isSessionModelOverflow` | Compaction eligibility and overflow ownership |
157
+ | `isRetryableAssistantError`, `nextRetryAttempt`, `computeRetryDelayMs`, `isFailoverTriggerError`, `failoverModelKey` | Retry and failover decisions |
158
+ | `computePromptTokenBudget`, `computeResponseReserveTokens` | Prompt and response token budgets |
159
+ | `classifyPromptCacheTransition` | Cache establishment, reuse, change, or bypass |
160
+ | `assembleSessionSystemPrompt` | System-prompt options, text, and cache boundary |
161
+
162
+ The decision and arithmetic helpers perform no I/O. `assembleSessionSystemPrompt()` delegates to the system-prompt planner, which incorporates the current date and installation paths.
163
+
137
164
  ### createAgentSessionRuntime() and AgentSessionRuntime
138
165
 
139
166
  Use the runtime API when you need to replace the active session and rebuild cwd-bound runtime state.
@@ -228,10 +255,14 @@ interface PromptOptions {
228
255
  images?: ImageContent[];
229
256
  streamingBehavior?: "steer" | "followUp";
230
257
  source?: InputSource;
258
+ activeSkillNames?: readonly string[];
259
+ activeSkillSource?: string;
231
260
  preflightResult?: (success: boolean) => void;
232
261
  }
233
262
  ```
234
263
 
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.
265
+
235
266
  `preflightResult` is called once per `prompt()` invocation:
236
267
 
237
268
  - `true` when the prompt was accepted, queued, or handled immediately
@@ -534,10 +565,12 @@ The `edit` tool returns `details.diff` for OMK's TUI display and `details.patch`
534
565
 
535
566
  The `diagnostics` tool runs the project's own checkers and normalizes the result — `tsc --noEmit` for TypeScript, `pyright`/`ruff` for Python, `go vet` for Go, `cargo check` for Rust. Missing checkers or project markers are reported as `skipped` in the tool result instead of failing. Output is capped at 50 diagnostics and cached for 5 s.
536
567
 
568
+ With default OMP seams, truncated `read` output does not create a sidecar. With `OMK_OMP_SEAMS=0`, legacy truncation may write the selected window to `<absolute-source-path>.omk-spill.txt`; `ReadToolDetails.fullOutputPath` reports the path when present. A first line that alone exceeds the byte cap is clipped without a sidecar. The exported `spillTruncatedOutput()` helper provides the preview-plus-path contract for custom tools.
569
+
537
570
  ```typescript
538
571
  import { createAgentSession } from "open-multi-agent-kit";
539
572
 
540
- // Read-only mode
573
+ // Enable inspection tools; legacy read mode may create a spill sidecar
541
574
  const { session } = await createAgentSession({
542
575
  tools: ["read", "grep", "find", "ls"],
543
576
  });
@@ -1159,9 +1192,11 @@ Execution-bound evidence records a declared verification command and reported ou
1159
1192
 
1160
1193
  **Default path (opt-out):** when an AgentSession has a replay ledger (persisted sessions create one automatically), LLM-callable `bash` and interactive/RPC `executeBash` bind through `executeVerifiedBash` with `executor: "bash-tool"` and receipts under `<sessionFile>.evidence/receipts` (or `cwd/.omk/session-evidence/<goalId>/receipts` for ephemeral sessions). Session workspace scope is git-aware: inside a worktree, the receipt binds the toplevel plus up to 32 sorted dirty file paths (1 s TTL). Git status expands ordinary untracked directories to files; untracked nested repositories remain outside the parent scope. Set `OMK_VERIFIED_BASH=0` to restore the legacy unverified path. Custom `createBashTool()` calls stay unverified unless the caller wraps operations with `createVerifiedBashOperations()`. CI still runs release-consistency through `executeVerifiedLocalBash()` with `executor: "ci-runner"`.
1161
1194
 
1162
- **Default sandbox (opt-out):** session bash defaults to `enforce`. Every built-in local spawn is wrapped by macOS `sandbox-exec` or Linux `bwrap`, writes are limited to the session workspace and OS temp directory, and network access is disabled. If the platform is unsupported or the backend is unavailable, the spawn fails closed with `sandbox.backend_missing`. Set `OMK_BASH_SANDBOX=audit` only for an unwrapped compatibility path that records each decision as a `sandbox_audit` replay event; set `OMK_BASH_SANDBOX=0` to disable the preflight entirely. Unknown values resolve to `enforce`.
1195
+ **Default AgentSession sandbox (opt-out):** built-in local bash defaults to `enforce`. Local spawns use macOS `sandbox-exec` or Linux `bwrap`, writes are limited to the session workspace and OS temp directory, and network access is disabled. Unsupported platforms and unavailable backends fail closed with `sandbox.backend_missing`. Explicit `audit` keeps the unwrapped ledger-only path; `0` or `off` disables the preflight. Unknown values resolve to `enforce`.
1196
+
1197
+ Automatic backend probing is lazy and cached. An AgentSession probes at most once during its lifetime; each `createLocalBashOperations({ sandboxPolicy })` instance also probes at most once when its preflight omits `backend`. The denial reason identifies missing `bwrap` or `sandbox-exec`, disabled user namespaces, both Linux failures, or an unsupported platform.
1163
1198
 
1164
- This boundary applies to AgentSession's built-in local bash operations. Custom `createBashTool()` calls remain unsandboxed unless they receive a `sandboxPolicy`, and injected or remote `BashOperations` own their own isolation. The default workspace-write profile is not a read-confidentiality boundary or whole-process container; use [Containerization](containerization.md) when every tool and extension must be isolated.
1199
+ This boundary applies only to AgentSession's built-in local bash operations. Custom `createBashTool()` calls remain unsandboxed unless they receive a `sandboxPolicy`; injected or remote `BashOperations` own their isolation. The profile is not read-confidentiality or whole-process containment. `executeVerifiedLocalBash()` remains an evidence adapter, not an OS sandbox. See [Containerization](containerization.md).
1165
1200
 
1166
1201
  ### Recorded and invoked inputs
1167
1202
 
@@ -1222,6 +1257,63 @@ New integrations should use `TaskSpec`, `ExecutionAttempt`, `Observation`, `Eval
1222
1257
 
1223
1258
  `evidenceReceiptToObservation(receipt, attemptId)` validates the receipt core digest and emits immutable execution facts for protocol evaluation. It does not replace ledger, attestation, freshness, or sandbox checks.
1224
1259
 
1260
+ ### Advisory best-of-N selection
1261
+
1262
+ Use the advisory judge only after deterministic evaluation. `chooseWithAdvisoryJudge()` validates every `EvaluationResult` and excludes `fail` and `inconclusive` candidates before any model call. The judge cannot revive them or alter protocol, evidence, loop, or security gates.
1263
+
1264
+ ```typescript
1265
+ import {
1266
+ chooseWithAdvisoryJudge,
1267
+ createModelAdvisoryJudge,
1268
+ } from "open-multi-agent-kit";
1269
+
1270
+ const model = modelRegistry.find("xai", "grok-4.5");
1271
+ if (!model) throw new Error("judge model is not registered");
1272
+
1273
+ const judge = createModelAdvisoryJudge({ model, modelRegistry });
1274
+ const decision = await chooseWithAdvisoryJudge({
1275
+ taskGoal: task.goal,
1276
+ judgeId: "reviewer-v1",
1277
+ judge,
1278
+ rubric: [
1279
+ { id: "correctness", description: "Satisfies required behavior and evidence", weight: 3 },
1280
+ { id: "safety", description: "Preserves security and deterministic gates", weight: 2 },
1281
+ ],
1282
+ candidates: [
1283
+ { id: "attempt-a", deterministicRank: 0, material: outputA, evaluation: evaluationA },
1284
+ { id: "attempt-b", deterministicRank: 1, material: outputB, evaluation: evaluationB },
1285
+ ],
1286
+ });
1287
+ ```
1288
+
1289
+ 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.
1290
+
1291
+ `createModelAdvisoryJudge()` resolves current auth through `ModelRegistry` for each explicit call, uses no cache retention, and performs no model retry. Tests can inject `AdvisoryJudgeCompletion`; production defaults to `completeSimple()`.
1292
+
1293
+ ### Durable-goal seam checkpoints
1294
+
1295
+ Use the existing durable-goal journal for `Goal / Core / Verified / Open / Next` continuity:
1296
+
1297
+ ```typescript
1298
+ const current = await goalStore.current();
1299
+ if (!current) throw new Error("durable goal is missing");
1300
+
1301
+ const now = new Date().toISOString();
1302
+ const checkpointed = await goalStore.transition({
1303
+ kind: "record-checkpoint",
1304
+ ref: current.ref,
1305
+ checkpoint: {
1306
+ core: ["Keep the protocol verdict authoritative"],
1307
+ verifiedEvidenceIds: ["focused-tests"],
1308
+ open: ["Historical calibration"],
1309
+ next: "Run the full package checks",
1310
+ capturedAt: now,
1311
+ },
1312
+ }, now);
1313
+ ```
1314
+
1315
+ The reducer rejects stale refs and evidence outside the current generation. Text is bounded and forced-redacted before persistence; the checkpoint digest correlates its content and generation but is unkeyed and does not authenticate a same-user workspace. `/goal checkpoint {"core":[],"verified":[],"open":[],"next":"..."}` exposes the same transition interactively. The built-in controller carries prose into the next round only for a checkpoint explicitly recorded through that command in the current process. On resume, mutable workspace checkpoint prose is not promoted to user authority; only its digest is noted. Editing the goal definition clears the checkpoint. No `.jspace/` or second state system is created.
1316
+
1225
1317
  ### Receipt policy
1226
1318
 
1227
1319
  `EvidenceGate` (default `receiptMode: "prefer"`) gates the legacy `TaskContract` against its satisfied receipts. Pass `executor.createGateOptions()` so the gate resolves receipts, ledger events, and workspace fingerprints from the same store and ledger.
@@ -1336,6 +1428,11 @@ createContextCacheInvalidationSnapshot, serializeContextCacheSnapshot,
1336
1428
  CONTEXT_BUDGET_POLICY_VERSION_V2
1337
1429
  computeReservedTokenBudget, estimateToolResultReserve, ReservedTokenBudgetError
1338
1430
 
1431
+ // Advisory selection and durable goals
1432
+ chooseWithAdvisoryJudge, createModelAdvisoryJudge, AdvisoryJudgeInputError, AdvisoryJudgeModelError
1433
+ createDurableGoal, applyDurableGoalCommand, parseDurableGoalSnapshot, DurableGoalStore
1434
+ createDurableGoalCheckpoint, parseDurableGoalCheckpoint, formatDurableGoalCheckpoint
1435
+
1339
1436
  // Run journal and session termination
1340
1437
  RunJournalStore, appendRunJournalRecordDurably, writeQuarantineBytesDurably,
1341
1438
  classifySessionTermination, formatSessionTermination, SessionTerminationError
package/docs/security.md CHANGED
@@ -1,12 +1,12 @@
1
- # Extension Full-Access Threat Model
1
+ # Extension Runtime Threat Model
2
2
 
3
- > **Scope**: This document analyzes the security implications of OMK extensions that request `full-access` permissions. It applies to the OMK (Open Multi-Agent Kit) coding agent CLI and its extension runtime.
3
+ > **Scope**: This document covers every OMK extension. OMK does not currently provide extension permission tiers or an extension-specific OS sandbox.
4
4
  >
5
- > **Version**: 0.80.3
5
+ > **Version**: 0.96.1
6
6
 
7
7
  ## 1. Overview
8
8
 
9
- OMK extensions can operate at different permission levels. The `full-access` level grants an extension unrestricted access to the OMK runtime, including the ability to:
9
+ Extensions execute as trusted code inside the OMK process with the host user's permissions. Treat every loaded extension as capable of:
10
10
 
11
11
  - Read and modify the agent's configuration (`~/.omk/agent/`)
12
12
  - Intercept and mutate tool calls and their results
@@ -23,20 +23,20 @@ This document outlines the threat model for such extensions and provides guidanc
23
23
  | Malicious Extension Author | Data exfiltration, credential theft, supply-chain compromise | Distributes a seemingly benign extension with hidden malicious logic |
24
24
  | Compromised Extension Dependency | Indirect compromise via a dependency of a legitimate extension | Injects malicious code into a trusted extension's dependency tree |
25
25
  | Insider Threat | Espionage, sabotage, unauthorized data access | Installs or modifies an extension on a target's machine |
26
- | User (Self-Inflicted) | Accidental misconfiguration | Grants `full-access` to an untrusted extension without review |
26
+ | User (Self-Inflicted) | Accidental misconfiguration | Loads an untrusted extension without review |
27
27
 
28
28
  ## 3. Attack Scenarios
29
29
 
30
30
  ### 3.1 Configuration Exfiltration
31
31
 
32
- A `full-access` extension can read `~/.omk/agent/auth.json`, which contains API keys and OAuth tokens for LLM providers (e.g., `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`).
32
+ An extension can read `~/.omk/agent/auth.json`, which contains API keys and OAuth tokens for LLM providers.
33
33
 
34
34
  **Impact**: Credential theft leading to unauthorized LLM API usage, financial loss, or data leakage through the compromised API account.
35
35
 
36
36
  **Mitigation**:
37
37
  - Store auth credentials in OS keychain or encrypted vault rather than plaintext `auth.json` where possible.
38
- - Audit extensions before granting `full-access`.
39
- - Run extensions with restricted permissions if full access is not strictly required.
38
+ - Audit extensions before loading them.
39
+ - Run the whole OMK process inside an isolated environment when the extension is not fully trusted.
40
40
 
41
41
  ### 3.2 Session Hijacking
42
42
 
@@ -51,7 +51,7 @@ A malicious extension can intercept session `.jsonl` files in `~/.omk/agent/sess
51
51
 
52
52
  ### 3.3 Tool Call Interception and Mutation
53
53
 
54
- Extensions with `full-access` can wrap built-in tools (e.g., `bash`, `read`, `write`). A malicious wrapper could:
54
+ Extensions can wrap built-in tools (e.g., `bash`, `read`, `write`). A malicious wrapper could:
55
55
  - Log all `bash` commands and their outputs to a remote server.
56
56
  - Modify `write` tool calls to inject backdoors into source files.
57
57
  - Block `read` operations on sensitive files to hide evidence of tampering.
@@ -59,19 +59,19 @@ Extensions with `full-access` can wrap built-in tools (e.g., `bash`, `read`, `wr
59
59
  **Impact**: Supply-chain compromise, data integrity loss, covert surveillance.
60
60
 
61
61
  **Mitigation**:
62
- - Use the `--no-extensions` flag when working with highly sensitive codebases.
62
+ - Use `--no-extensions` to disable discovered third-party extensions when working with highly sensitive codebases.
63
63
  - Pin extension versions and review diffs on updates.
64
64
  - Run extensions in an isolated environment (container, VM) where feasible.
65
65
 
66
66
  ### 3.4 Privilege Escalation via Custom Tools
67
67
 
68
- A `full-access` extension can register new tools that appear in the agent's tool list. These tools execute with the same privileges as the OMK process.
68
+ An extension can register new tools that appear in the agent's tool list. These tools execute with the same privileges as the OMK process.
69
69
 
70
70
  **Impact**: Arbitrary code execution, system compromise if the agent process has elevated privileges.
71
71
 
72
72
  **Mitigation**:
73
73
  - Never run OMK as root or with sudo.
74
- - Use OS-level sandboxing (e.g., `sandbox-exec` on macOS, `seccomp` on Linux) for the OMK process.
74
+ - Run the whole OMK process in a container, VM, or other verified OS sandbox when containment is required.
75
75
  - Review the full source code of any extension before installation.
76
76
 
77
77
  ### 3.5 Telemetry and Data Leakage
@@ -83,40 +83,30 @@ Extensions can silently exfiltrate data via DNS queries, HTTP requests, or by wr
83
83
  **Mitigation**:
84
84
  - Block outbound network access for the OMK process using a firewall or network namespace.
85
85
  - Monitor DNS and network traffic for anomalies.
86
- - Use offline mode (`--offline`) when extensions are not required to fetch remote resources.
86
+ - Do not treat `--offline` as a network sandbox; it disables OMK startup network operations, not arbitrary extension traffic.
87
87
 
88
- ## 4. Default Sandbox Path
88
+ ## 4. Actual Isolation Boundary
89
89
 
90
- OMK provides a default sandbox path for extensions that do not explicitly request `full-access`. This path restricts the extension to:
90
+ OMK does not sandbox extension JavaScript separately. Extension code, extension tools, custom code, and the OMK process run with the host user's permissions.
91
91
 
92
- - A dedicated subdirectory under `~/.omk/agent/extensions/<extension-name>/`
93
- - Read-only access to the project workspace (current working directory)
94
- - No access to `~/.omk/agent/auth.json`, `~/.omk/agent/mcp.json`, or session files
95
- - No network access (unless explicitly granted via extension manifest)
96
-
97
- **Default Sandbox Directory**: `~/.omk/agent/extensions/<extension-id>/`
98
-
99
- Extensions operating within this sandbox cannot:
100
- - Access files outside the project workspace and their own extension directory.
101
- - Intercept tool calls from other extensions or the core agent.
102
- - Read or write global agent configuration.
92
+ AgentSession's built-in local bash sandbox wraps only built-in local bash child processes. It does not contain extension callbacks, custom tools, OMK file tools, or the OMK process. For broader isolation, run the whole process inside a container or VM, or route every relevant tool through an isolated backend. See [Containerization](containerization.md).
103
93
 
104
94
  ## 5. Security Checklist for Users
105
95
 
106
- Before installing or upgrading a `full-access` extension, verify:
96
+ Before installing or upgrading an extension, verify:
107
97
 
108
98
  - [ ] The extension source code is available and has been reviewed.
109
99
  - [ ] The extension is from a trusted author or has been audited by a third party.
110
100
  - [ ] The extension's `package.json` or manifest does not include unexpected dependencies.
111
- - [ ] The extension's network permissions (if any) are justified by its functionality.
101
+ - [ ] The extension's network behavior is justified by its functionality.
112
102
  - [ ] You have a backup of `~/.omk/agent/` (especially `auth.json` and sessions).
113
103
  - [ ] You have considered running the extension in a sandboxed environment.
114
104
 
115
105
  ## 6. Security Checklist for Extension Developers
116
106
 
117
- When building a `full-access` extension, adhere to:
107
+ When building an extension, adhere to:
118
108
 
119
- - [ ] **Principle of Least Privilege**: Only request `full-access` if absolutely necessary. Use the default sandbox for everything else.
109
+ - [ ] **Principle of Least Privilege**: Keep the extension's file, process, network, and credential access to the minimum required, even though OMK does not enforce a per-extension tier.
120
110
  - [ ] **No Credential Access**: Never read `auth.json` or environment variables containing API keys unless the extension's core purpose is authentication management.
121
111
  - [ ] **Transparent Logging**: Log all file system and network operations to a user-visible location.
122
112
  - [ ] **Minimal Dependencies**: Keep the dependency tree small to reduce supply-chain risk.
@@ -125,7 +115,7 @@ When building a `full-access` extension, adhere to:
125
115
 
126
116
  ## 7. Incident Response
127
117
 
128
- If a malicious or compromised `full-access` extension is suspected:
118
+ If a malicious or compromised extension is suspected:
129
119
 
130
120
  1. **Immediately revoke** any exposed API keys (check `auth.json` and provider dashboards).
131
121
  2. **Remove** the extension directory from `~/.omk/agent/extensions/`.
@@ -142,4 +132,4 @@ If a malicious or compromised `full-access` extension is suspected:
142
132
 
143
133
  ---
144
134
 
145
- *Last updated: 2026-06-25*
135
+ *Last updated: 2026-08-19*