oh-my-codex 0.13.2 → 0.14.1

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 (406) hide show
  1. package/Cargo.lock +5 -5
  2. package/Cargo.toml +1 -1
  3. package/README.md +14 -8
  4. package/crates/omx-explore/src/main.rs +94 -1
  5. package/crates/omx-sparkshell/src/codex_bridge.rs +59 -12
  6. package/crates/omx-sparkshell/tests/execution.rs +48 -0
  7. package/dist/autoresearch/__tests__/skill-validation.test.d.ts +2 -0
  8. package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +1 -0
  9. package/dist/autoresearch/__tests__/skill-validation.test.js +91 -0
  10. package/dist/autoresearch/__tests__/skill-validation.test.js.map +1 -0
  11. package/dist/autoresearch/skill-validation.d.ts +13 -0
  12. package/dist/autoresearch/skill-validation.d.ts.map +1 -0
  13. package/dist/autoresearch/skill-validation.js +165 -0
  14. package/dist/autoresearch/skill-validation.js.map +1 -0
  15. package/dist/catalog/__tests__/schema.test.js +6 -0
  16. package/dist/catalog/__tests__/schema.test.js.map +1 -1
  17. package/dist/cli/__tests__/autoresearch-guided.test.js +236 -273
  18. package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -1
  19. package/dist/cli/__tests__/autoresearch.test.js +64 -653
  20. package/dist/cli/__tests__/autoresearch.test.js.map +1 -1
  21. package/dist/cli/__tests__/explore.test.js +33 -1
  22. package/dist/cli/__tests__/explore.test.js.map +1 -1
  23. package/dist/cli/__tests__/index.test.js +18 -2
  24. package/dist/cli/__tests__/index.test.js.map +1 -1
  25. package/dist/cli/__tests__/nested-help-routing.test.js +2 -1
  26. package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
  27. package/dist/cli/__tests__/package-bin-contract.test.js +5 -0
  28. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  29. package/dist/cli/__tests__/question.test.d.ts +2 -0
  30. package/dist/cli/__tests__/question.test.d.ts.map +1 -0
  31. package/dist/cli/__tests__/question.test.js +166 -0
  32. package/dist/cli/__tests__/question.test.js.map +1 -0
  33. package/dist/cli/__tests__/session-search-help.test.js +1 -1
  34. package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
  35. package/dist/cli/__tests__/setup-agents-overwrite.test.js +32 -7
  36. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  37. package/dist/cli/__tests__/setup-refresh.test.js +8 -6
  38. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  39. package/dist/cli/__tests__/setup-skills-overwrite.test.js +2 -0
  40. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
  41. package/dist/cli/__tests__/sparkshell-cli.test.js +23 -0
  42. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
  43. package/dist/cli/__tests__/uninstall.test.js +65 -5
  44. package/dist/cli/__tests__/uninstall.test.js.map +1 -1
  45. package/dist/cli/__tests__/update.test.js +360 -26
  46. package/dist/cli/__tests__/update.test.js.map +1 -1
  47. package/dist/cli/autoresearch-guided.d.ts +24 -7
  48. package/dist/cli/autoresearch-guided.d.ts.map +1 -1
  49. package/dist/cli/autoresearch-guided.js +189 -130
  50. package/dist/cli/autoresearch-guided.js.map +1 -1
  51. package/dist/cli/autoresearch.d.ts +3 -2
  52. package/dist/cli/autoresearch.d.ts.map +1 -1
  53. package/dist/cli/autoresearch.js +29 -305
  54. package/dist/cli/autoresearch.js.map +1 -1
  55. package/dist/cli/doctor.d.ts.map +1 -1
  56. package/dist/cli/doctor.js +43 -0
  57. package/dist/cli/doctor.js.map +1 -1
  58. package/dist/cli/explore.d.ts.map +1 -1
  59. package/dist/cli/explore.js +18 -3
  60. package/dist/cli/explore.js.map +1 -1
  61. package/dist/cli/index.d.ts +2 -1
  62. package/dist/cli/index.d.ts.map +1 -1
  63. package/dist/cli/index.js +15 -3
  64. package/dist/cli/index.js.map +1 -1
  65. package/dist/cli/question.d.ts +3 -0
  66. package/dist/cli/question.d.ts.map +1 -0
  67. package/dist/cli/question.js +182 -0
  68. package/dist/cli/question.js.map +1 -0
  69. package/dist/cli/setup.d.ts.map +1 -1
  70. package/dist/cli/setup.js +25 -3
  71. package/dist/cli/setup.js.map +1 -1
  72. package/dist/cli/sparkshell.d.ts.map +1 -1
  73. package/dist/cli/sparkshell.js +11 -1
  74. package/dist/cli/sparkshell.js.map +1 -1
  75. package/dist/cli/team.d.ts.map +1 -1
  76. package/dist/cli/team.js +159 -394
  77. package/dist/cli/team.js.map +1 -1
  78. package/dist/cli/uninstall.d.ts.map +1 -1
  79. package/dist/cli/uninstall.js +3 -1
  80. package/dist/cli/uninstall.js.map +1 -1
  81. package/dist/cli/update.d.ts +37 -9
  82. package/dist/cli/update.d.ts.map +1 -1
  83. package/dist/cli/update.js +204 -26
  84. package/dist/cli/update.js.map +1 -1
  85. package/dist/config/__tests__/generator-idempotent.test.js +51 -14
  86. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  87. package/dist/config/__tests__/generator-notify.test.js +35 -10
  88. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  89. package/dist/config/generator.d.ts +1 -0
  90. package/dist/config/generator.d.ts.map +1 -1
  91. package/dist/config/generator.js +61 -7
  92. package/dist/config/generator.js.map +1 -1
  93. package/dist/hooks/__tests__/analyze-routing-contract.test.js +22 -13
  94. package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +1 -1
  95. package/dist/hooks/__tests__/anti-slop-workflow.test.js +3 -3
  96. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
  97. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +2 -0
  98. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +1 -0
  99. package/dist/hooks/__tests__/code-review-skill-contract.test.js +56 -0
  100. package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -0
  101. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +2 -2
  102. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +1 -1
  103. package/dist/hooks/__tests__/deep-interview-contract.test.js +51 -5
  104. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  105. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +2 -0
  106. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +1 -0
  107. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +43 -0
  108. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +1 -0
  109. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +2 -0
  110. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +1 -0
  111. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +38 -0
  112. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +1 -0
  113. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +2 -2
  114. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -1
  115. package/dist/hooks/__tests__/keyword-detector.test.js +308 -17
  116. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  117. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +570 -2
  118. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
  119. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +717 -16
  120. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  121. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +25 -0
  122. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
  123. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +894 -1
  124. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
  125. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +34 -0
  126. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
  127. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +132 -0
  128. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
  129. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +22 -4
  130. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
  131. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +4 -2
  132. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
  133. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +1 -0
  134. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -1
  135. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +19 -1
  136. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -1
  137. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +28 -0
  138. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  139. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +5 -4
  140. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -1
  141. package/dist/hooks/__tests__/prompt-team-routing.test.js +2 -2
  142. package/dist/hooks/__tests__/prompt-team-routing.test.js.map +1 -1
  143. package/dist/hooks/__tests__/triage-config.test.d.ts +2 -0
  144. package/dist/hooks/__tests__/triage-config.test.d.ts.map +1 -0
  145. package/dist/hooks/__tests__/triage-config.test.js +211 -0
  146. package/dist/hooks/__tests__/triage-config.test.js.map +1 -0
  147. package/dist/hooks/__tests__/triage-heuristic.test.d.ts +2 -0
  148. package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +1 -0
  149. package/dist/hooks/__tests__/triage-heuristic.test.js +230 -0
  150. package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -0
  151. package/dist/hooks/__tests__/triage-state.test.d.ts +2 -0
  152. package/dist/hooks/__tests__/triage-state.test.d.ts.map +1 -0
  153. package/dist/hooks/__tests__/triage-state.test.js +426 -0
  154. package/dist/hooks/__tests__/triage-state.test.js.map +1 -0
  155. package/dist/hooks/keyword-detector.d.ts +26 -7
  156. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  157. package/dist/hooks/keyword-detector.js +97 -26
  158. package/dist/hooks/keyword-detector.js.map +1 -1
  159. package/dist/hooks/keyword-registry.d.ts.map +1 -1
  160. package/dist/hooks/keyword-registry.js +16 -9
  161. package/dist/hooks/keyword-registry.js.map +1 -1
  162. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  163. package/dist/hooks/prompt-guidance-contract.js +28 -1
  164. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  165. package/dist/hooks/triage-config.d.ts +33 -0
  166. package/dist/hooks/triage-config.d.ts.map +1 -0
  167. package/dist/hooks/triage-config.js +87 -0
  168. package/dist/hooks/triage-config.js.map +1 -0
  169. package/dist/hooks/triage-heuristic.d.ts +20 -0
  170. package/dist/hooks/triage-heuristic.d.ts.map +1 -0
  171. package/dist/hooks/triage-heuristic.js +210 -0
  172. package/dist/hooks/triage-heuristic.js.map +1 -0
  173. package/dist/hooks/triage-state.d.ts +63 -0
  174. package/dist/hooks/triage-state.d.ts.map +1 -0
  175. package/dist/hooks/triage-state.js +138 -0
  176. package/dist/hooks/triage-state.js.map +1 -0
  177. package/dist/hud/__tests__/reconcile.test.js +20 -0
  178. package/dist/hud/__tests__/reconcile.test.js.map +1 -1
  179. package/dist/hud/reconcile.d.ts +1 -0
  180. package/dist/hud/reconcile.d.ts.map +1 -1
  181. package/dist/hud/reconcile.js +2 -1
  182. package/dist/hud/reconcile.js.map +1 -1
  183. package/dist/mcp/__tests__/bootstrap.test.js +5 -24
  184. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  185. package/dist/mcp/__tests__/state-server.test.js +127 -0
  186. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  187. package/dist/mcp/bootstrap.d.ts +1 -1
  188. package/dist/mcp/bootstrap.d.ts.map +1 -1
  189. package/dist/mcp/bootstrap.js +3 -11
  190. package/dist/mcp/bootstrap.js.map +1 -1
  191. package/dist/mcp/state-server.d.ts +25 -0
  192. package/dist/mcp/state-server.d.ts.map +1 -1
  193. package/dist/mcp/state-server.js +41 -0
  194. package/dist/mcp/state-server.js.map +1 -1
  195. package/dist/modes/__tests__/base-ralph-contract.test.js +15 -0
  196. package/dist/modes/__tests__/base-ralph-contract.test.js.map +1 -1
  197. package/dist/modes/base.d.ts +1 -0
  198. package/dist/modes/base.d.ts.map +1 -1
  199. package/dist/modes/base.js +22 -6
  200. package/dist/modes/base.js.map +1 -1
  201. package/dist/notifications/__tests__/index.test.js +75 -0
  202. package/dist/notifications/__tests__/index.test.js.map +1 -1
  203. package/dist/notifications/__tests__/session-status.test.js +90 -0
  204. package/dist/notifications/__tests__/session-status.test.js.map +1 -1
  205. package/dist/notifications/index.d.ts.map +1 -1
  206. package/dist/notifications/index.js +39 -22
  207. package/dist/notifications/index.js.map +1 -1
  208. package/dist/notifications/session-status.d.ts +2 -0
  209. package/dist/notifications/session-status.d.ts.map +1 -1
  210. package/dist/notifications/session-status.js +19 -4
  211. package/dist/notifications/session-status.js.map +1 -1
  212. package/dist/openclaw/index.d.ts +5 -3
  213. package/dist/openclaw/index.d.ts.map +1 -1
  214. package/dist/openclaw/index.js +5 -3
  215. package/dist/openclaw/index.js.map +1 -1
  216. package/dist/question/__tests__/client.test.d.ts +2 -0
  217. package/dist/question/__tests__/client.test.d.ts.map +1 -0
  218. package/dist/question/__tests__/client.test.js +70 -0
  219. package/dist/question/__tests__/client.test.js.map +1 -0
  220. package/dist/question/__tests__/deep-interview.test.d.ts +2 -0
  221. package/dist/question/__tests__/deep-interview.test.d.ts.map +1 -0
  222. package/dist/question/__tests__/deep-interview.test.js +118 -0
  223. package/dist/question/__tests__/deep-interview.test.js.map +1 -0
  224. package/dist/question/__tests__/policy.test.d.ts +2 -0
  225. package/dist/question/__tests__/policy.test.d.ts.map +1 -0
  226. package/dist/question/__tests__/policy.test.js +107 -0
  227. package/dist/question/__tests__/policy.test.js.map +1 -0
  228. package/dist/question/__tests__/renderer.test.d.ts +2 -0
  229. package/dist/question/__tests__/renderer.test.d.ts.map +1 -0
  230. package/dist/question/__tests__/renderer.test.js +238 -0
  231. package/dist/question/__tests__/renderer.test.js.map +1 -0
  232. package/dist/question/__tests__/state.test.d.ts +2 -0
  233. package/dist/question/__tests__/state.test.d.ts.map +1 -0
  234. package/dist/question/__tests__/state.test.js +75 -0
  235. package/dist/question/__tests__/state.test.js.map +1 -0
  236. package/dist/question/__tests__/types.test.d.ts +2 -0
  237. package/dist/question/__tests__/types.test.d.ts.map +1 -0
  238. package/dist/question/__tests__/types.test.js +44 -0
  239. package/dist/question/__tests__/types.test.js.map +1 -0
  240. package/dist/question/__tests__/ui.test.d.ts +2 -0
  241. package/dist/question/__tests__/ui.test.d.ts.map +1 -0
  242. package/dist/question/__tests__/ui.test.js +169 -0
  243. package/dist/question/__tests__/ui.test.js.map +1 -0
  244. package/dist/question/client.d.ts +54 -0
  245. package/dist/question/client.d.ts.map +1 -0
  246. package/dist/question/client.js +77 -0
  247. package/dist/question/client.js.map +1 -0
  248. package/dist/question/deep-interview.d.ts +30 -0
  249. package/dist/question/deep-interview.d.ts.map +1 -0
  250. package/dist/question/deep-interview.js +118 -0
  251. package/dist/question/deep-interview.js.map +1 -0
  252. package/dist/question/policy.d.ts +18 -0
  253. package/dist/question/policy.d.ts.map +1 -0
  254. package/dist/question/policy.js +77 -0
  255. package/dist/question/policy.js.map +1 -0
  256. package/dist/question/renderer.d.ts +20 -0
  257. package/dist/question/renderer.d.ts.map +1 -0
  258. package/dist/question/renderer.js +190 -0
  259. package/dist/question/renderer.js.map +1 -0
  260. package/dist/question/state.d.ts +19 -0
  261. package/dist/question/state.d.ts.map +1 -0
  262. package/dist/question/state.js +108 -0
  263. package/dist/question/state.js.map +1 -0
  264. package/dist/question/types.d.ts +66 -0
  265. package/dist/question/types.d.ts.map +1 -0
  266. package/dist/question/types.js +82 -0
  267. package/dist/question/types.js.map +1 -0
  268. package/dist/question/ui.d.ts +38 -0
  269. package/dist/question/ui.d.ts.map +1 -0
  270. package/dist/question/ui.js +321 -0
  271. package/dist/question/ui.js.map +1 -0
  272. package/dist/ralph/contract.d.ts +1 -1
  273. package/dist/ralph/contract.d.ts.map +1 -1
  274. package/dist/ralph/contract.js +4 -1
  275. package/dist/ralph/contract.js.map +1 -1
  276. package/dist/ralplan/runtime.js +1 -1
  277. package/dist/ralplan/runtime.js.map +1 -1
  278. package/dist/runtime/__tests__/run-loop.test.d.ts +2 -0
  279. package/dist/runtime/__tests__/run-loop.test.d.ts.map +1 -0
  280. package/dist/runtime/__tests__/run-loop.test.js +35 -0
  281. package/dist/runtime/__tests__/run-loop.test.js.map +1 -0
  282. package/dist/runtime/__tests__/run-outcome.test.d.ts +2 -0
  283. package/dist/runtime/__tests__/run-outcome.test.d.ts.map +1 -0
  284. package/dist/runtime/__tests__/run-outcome.test.js +102 -0
  285. package/dist/runtime/__tests__/run-outcome.test.js.map +1 -0
  286. package/dist/runtime/__tests__/run-state.test.d.ts +2 -0
  287. package/dist/runtime/__tests__/run-state.test.d.ts.map +1 -0
  288. package/dist/runtime/__tests__/run-state.test.js +37 -0
  289. package/dist/runtime/__tests__/run-state.test.js.map +1 -0
  290. package/dist/runtime/run-loop.d.ts +45 -0
  291. package/dist/runtime/run-loop.d.ts.map +1 -0
  292. package/dist/runtime/run-loop.js +51 -0
  293. package/dist/runtime/run-loop.js.map +1 -0
  294. package/dist/runtime/run-outcome.d.ts +46 -0
  295. package/dist/runtime/run-outcome.d.ts.map +1 -0
  296. package/dist/runtime/run-outcome.js +285 -0
  297. package/dist/runtime/run-outcome.js.map +1 -0
  298. package/dist/runtime/run-state.d.ts +40 -0
  299. package/dist/runtime/run-state.d.ts.map +1 -0
  300. package/dist/runtime/run-state.js +120 -0
  301. package/dist/runtime/run-state.js.map +1 -0
  302. package/dist/runtime/terminal-lifecycle.d.ts +11 -0
  303. package/dist/runtime/terminal-lifecycle.d.ts.map +1 -0
  304. package/dist/runtime/terminal-lifecycle.js +52 -0
  305. package/dist/runtime/terminal-lifecycle.js.map +1 -0
  306. package/dist/scripts/__tests__/codex-native-hook.test.js +1459 -126
  307. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  308. package/dist/scripts/__tests__/postinstall.test.d.ts +2 -0
  309. package/dist/scripts/__tests__/postinstall.test.d.ts.map +1 -0
  310. package/dist/scripts/__tests__/postinstall.test.js +178 -0
  311. package/dist/scripts/__tests__/postinstall.test.js.map +1 -0
  312. package/dist/scripts/codex-native-hook.d.ts +3 -0
  313. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  314. package/dist/scripts/codex-native-hook.js +308 -61
  315. package/dist/scripts/codex-native-hook.js.map +1 -1
  316. package/dist/scripts/notify-fallback-watcher.js +81 -2
  317. package/dist/scripts/notify-fallback-watcher.js.map +1 -1
  318. package/dist/scripts/notify-hook/auto-nudge.d.ts +27 -0
  319. package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
  320. package/dist/scripts/notify-hook/auto-nudge.js +83 -20
  321. package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
  322. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
  323. package/dist/scripts/notify-hook/managed-tmux.js +64 -38
  324. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
  325. package/dist/scripts/notify-hook/ralph-session-resume.js +1 -1
  326. package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
  327. package/dist/scripts/notify-hook.js +15 -5
  328. package/dist/scripts/notify-hook.js.map +1 -1
  329. package/dist/scripts/postinstall.d.ts +22 -0
  330. package/dist/scripts/postinstall.d.ts.map +1 -0
  331. package/dist/scripts/postinstall.js +105 -0
  332. package/dist/scripts/postinstall.js.map +1 -0
  333. package/dist/scripts/sync-prompt-guidance-fragments.js +5 -0
  334. package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -1
  335. package/dist/state/__tests__/operations-ralph-phase.test.js +21 -0
  336. package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -1
  337. package/dist/state/__tests__/operations.test.js +18 -0
  338. package/dist/state/__tests__/operations.test.js.map +1 -1
  339. package/dist/state/__tests__/workflow-transition.test.js +11 -0
  340. package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
  341. package/dist/state/operations.d.ts.map +1 -1
  342. package/dist/state/operations.js +15 -0
  343. package/dist/state/operations.js.map +1 -1
  344. package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
  345. package/dist/state/workflow-transition-reconcile.js +14 -1
  346. package/dist/state/workflow-transition-reconcile.js.map +1 -1
  347. package/dist/state/workflow-transition.d.ts.map +1 -1
  348. package/dist/state/workflow-transition.js +3 -1
  349. package/dist/state/workflow-transition.js.map +1 -1
  350. package/dist/team/__tests__/followup-planner.test.js +15 -0
  351. package/dist/team/__tests__/followup-planner.test.js.map +1 -1
  352. package/dist/team/__tests__/role-router.test.js +47 -0
  353. package/dist/team/__tests__/role-router.test.js.map +1 -1
  354. package/dist/team/__tests__/runtime.test.js +108 -2
  355. package/dist/team/__tests__/runtime.test.js.map +1 -1
  356. package/dist/team/followup-planner.d.ts.map +1 -1
  357. package/dist/team/followup-planner.js +31 -9
  358. package/dist/team/followup-planner.js.map +1 -1
  359. package/dist/team/role-router.d.ts.map +1 -1
  360. package/dist/team/role-router.js +73 -0
  361. package/dist/team/role-router.js.map +1 -1
  362. package/dist/team/runtime.d.ts.map +1 -1
  363. package/dist/team/runtime.js +18 -4
  364. package/dist/team/runtime.js.map +1 -1
  365. package/dist/utils/__tests__/dep-versions.test.js +25 -8
  366. package/dist/utils/__tests__/dep-versions.test.js.map +1 -1
  367. package/dist/utils/__tests__/paths.test.js +45 -0
  368. package/dist/utils/__tests__/paths.test.js.map +1 -1
  369. package/dist/utils/paths.d.ts +2 -0
  370. package/dist/utils/paths.d.ts.map +1 -1
  371. package/dist/utils/paths.js +22 -7
  372. package/dist/utils/paths.js.map +1 -1
  373. package/dist/verification/__tests__/ci-rust-gates.test.js +1 -1
  374. package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
  375. package/package.json +4 -2
  376. package/prompts/architect.md +4 -0
  377. package/prompts/code-reviewer.md +3 -0
  378. package/prompts/dependency-expert.md +3 -0
  379. package/prompts/executor.md +5 -0
  380. package/prompts/explore.md +2 -0
  381. package/prompts/planner.md +5 -0
  382. package/prompts/product-analyst.md +8 -8
  383. package/prompts/researcher.md +78 -30
  384. package/prompts/verifier.md +4 -0
  385. package/skills/autoresearch/SKILL.md +68 -0
  386. package/skills/code-review/SKILL.md +94 -28
  387. package/skills/deep-interview/SKILL.md +100 -9
  388. package/skills/help/SKILL.md +3 -1
  389. package/skills/ralplan/SKILL.md +1 -0
  390. package/skills/team/SKILL.md +1 -0
  391. package/skills/ultrawork/SKILL.md +1 -0
  392. package/src/scripts/__tests__/codex-native-hook.test.ts +2373 -692
  393. package/src/scripts/__tests__/postinstall.test.ts +210 -0
  394. package/src/scripts/codex-native-hook.ts +365 -66
  395. package/src/scripts/notify-fallback-watcher.ts +92 -2
  396. package/src/scripts/notify-hook/auto-nudge.ts +89 -20
  397. package/src/scripts/notify-hook/managed-tmux.ts +70 -31
  398. package/src/scripts/notify-hook/ralph-session-resume.ts +1 -1
  399. package/src/scripts/notify-hook.ts +23 -5
  400. package/src/scripts/postinstall-bootstrap.js +23 -0
  401. package/src/scripts/postinstall.ts +161 -0
  402. package/src/scripts/sync-prompt-guidance-fragments.ts +4 -0
  403. package/templates/AGENTS.md +48 -37
  404. package/templates/catalog-manifest.json +7 -0
  405. package/templates/model-instructions/explore-lightweight-AGENTS.md +11 -0
  406. package/templates/model-instructions/sparkshell-lightweight-AGENTS.md +10 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Triage Feature Gate Config Reader
3
+ *
4
+ * Reads promptRouting.triage.enabled from codexHome()/.omx-config.json.
5
+ * Defaults to enabled when the config file is absent or the triage flag is
6
+ * omitted from an otherwise valid config object (rollout default).
7
+ * Fails closed (enabled: false) when the file exists but is malformed.
8
+ */
9
+ export type TriageConfigStatus = "enabled" | "disabled" | "defaulted" | "invalid";
10
+ export interface TriageConfig {
11
+ enabled: boolean;
12
+ status: TriageConfigStatus;
13
+ source: "default" | "file" | "invalid";
14
+ path: string;
15
+ }
16
+ /**
17
+ * Read and cache the triage feature gate config.
18
+ *
19
+ * Source: promptRouting.triage.enabled in codexHome()/.omx-config.json
20
+ *
21
+ * - Missing file → enabled: true, status: "defaulted" (rollout default)
22
+ * - Valid object that omits promptRouting.triage.enabled → enabled: true, status: "defaulted"
23
+ * - File with enabled: true → enabled: true, status: "enabled"
24
+ * - File with enabled: false → enabled: false, status: "disabled"
25
+ * - Malformed JSON or wrong shape → enabled: false, status: "invalid" (fail closed)
26
+ * - Caches result for the process lifetime
27
+ */
28
+ export declare function readTriageConfig(): TriageConfig;
29
+ /**
30
+ * Clear the cached triage config. Call in tests to reset state.
31
+ */
32
+ export declare function resetTriageConfigCache(): void;
33
+ //# sourceMappingURL=triage-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-config.d.ts","sourceRoot":"","sources":["../../src/hooks/triage-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAElF,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,CA4D/C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Triage Feature Gate Config Reader
3
+ *
4
+ * Reads promptRouting.triage.enabled from codexHome()/.omx-config.json.
5
+ * Defaults to enabled when the config file is absent or the triage flag is
6
+ * omitted from an otherwise valid config object (rollout default).
7
+ * Fails closed (enabled: false) when the file exists but is malformed.
8
+ */
9
+ import { readFileSync, existsSync } from "fs";
10
+ import { join } from "path";
11
+ import { codexHome } from "../utils/paths.js";
12
+ /** Cached triage config. `undefined` = not yet read. */
13
+ let cachedTriageConfig;
14
+ /**
15
+ * Read and cache the triage feature gate config.
16
+ *
17
+ * Source: promptRouting.triage.enabled in codexHome()/.omx-config.json
18
+ *
19
+ * - Missing file → enabled: true, status: "defaulted" (rollout default)
20
+ * - Valid object that omits promptRouting.triage.enabled → enabled: true, status: "defaulted"
21
+ * - File with enabled: true → enabled: true, status: "enabled"
22
+ * - File with enabled: false → enabled: false, status: "disabled"
23
+ * - Malformed JSON or wrong shape → enabled: false, status: "invalid" (fail closed)
24
+ * - Caches result for the process lifetime
25
+ */
26
+ export function readTriageConfig() {
27
+ if (cachedTriageConfig !== undefined)
28
+ return cachedTriageConfig;
29
+ const path = join(codexHome(), ".omx-config.json");
30
+ if (!existsSync(path)) {
31
+ cachedTriageConfig = { enabled: true, status: "defaulted", source: "default", path };
32
+ return cachedTriageConfig;
33
+ }
34
+ try {
35
+ const raw = JSON.parse(readFileSync(path, "utf-8"));
36
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
37
+ cachedTriageConfig = { enabled: false, status: "invalid", source: "invalid", path };
38
+ return cachedTriageConfig;
39
+ }
40
+ const root = raw;
41
+ const promptRouting = root["promptRouting"];
42
+ if (promptRouting === undefined) {
43
+ cachedTriageConfig = { enabled: true, status: "defaulted", source: "default", path };
44
+ return cachedTriageConfig;
45
+ }
46
+ if (!promptRouting || typeof promptRouting !== "object" || Array.isArray(promptRouting)) {
47
+ cachedTriageConfig = { enabled: false, status: "invalid", source: "invalid", path };
48
+ return cachedTriageConfig;
49
+ }
50
+ const triage = promptRouting["triage"];
51
+ if (triage === undefined) {
52
+ cachedTriageConfig = { enabled: true, status: "defaulted", source: "default", path };
53
+ return cachedTriageConfig;
54
+ }
55
+ if (!triage || typeof triage !== "object" || Array.isArray(triage)) {
56
+ cachedTriageConfig = { enabled: false, status: "invalid", source: "invalid", path };
57
+ return cachedTriageConfig;
58
+ }
59
+ const triageEnabled = triage["enabled"];
60
+ if (triageEnabled === undefined) {
61
+ cachedTriageConfig = { enabled: true, status: "defaulted", source: "default", path };
62
+ return cachedTriageConfig;
63
+ }
64
+ if (typeof triageEnabled !== "boolean") {
65
+ cachedTriageConfig = { enabled: false, status: "invalid", source: "invalid", path };
66
+ return cachedTriageConfig;
67
+ }
68
+ cachedTriageConfig = {
69
+ enabled: triageEnabled,
70
+ status: triageEnabled ? "enabled" : "disabled",
71
+ source: "file",
72
+ path,
73
+ };
74
+ return cachedTriageConfig;
75
+ }
76
+ catch {
77
+ cachedTriageConfig = { enabled: false, status: "invalid", source: "invalid", path };
78
+ return cachedTriageConfig;
79
+ }
80
+ }
81
+ /**
82
+ * Clear the cached triage config. Call in tests to reset state.
83
+ */
84
+ export function resetTriageConfigCache() {
85
+ cachedTriageConfig = undefined;
86
+ }
87
+ //# sourceMappingURL=triage-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-config.js","sourceRoot":"","sources":["../../src/hooks/triage-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAW9C,wDAAwD;AACxD,IAAI,kBAA4C,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,kBAAkB,KAAK,SAAS;QAAE,OAAO,kBAAkB,CAAC;IAEhE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAEnD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,kBAAkB,GAAG,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AsB;IACpC,kBAAkB,GAAG,SAAS,CAAC;AACjC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Triage Heuristic
3
+ *
4
+ * Pure, synchronous classifier for a 3-lane prompt triage system.
5
+ * Advisory-only — never activates workflows, never touches state or fs.
6
+ *
7
+ * Lanes:
8
+ * PASS — trivial acknowledgements, explicit opt-out phrases, or ambiguous short prompts
9
+ * LIGHT — single-agent destination: explore | executor | designer
10
+ * HEAVY — autopilot; longer goal-shaped imperative prompts
11
+ */
12
+ export type TriageLane = "HEAVY" | "LIGHT" | "PASS";
13
+ export type LightDestination = "explore" | "executor" | "designer";
14
+ export interface TriageDecision {
15
+ lane: TriageLane;
16
+ destination?: LightDestination | "autopilot";
17
+ reason: string;
18
+ }
19
+ export declare function triagePrompt(prompt: string): TriageDecision;
20
+ //# sourceMappingURL=triage-heuristic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-heuristic.d.ts","sourceRoot":"","sources":["../../src/hooks/triage-heuristic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAuJD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAyE3D"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Triage Heuristic
3
+ *
4
+ * Pure, synchronous classifier for a 3-lane prompt triage system.
5
+ * Advisory-only — never activates workflows, never touches state or fs.
6
+ *
7
+ * Lanes:
8
+ * PASS — trivial acknowledgements, explicit opt-out phrases, or ambiguous short prompts
9
+ * LIGHT — single-agent destination: explore | executor | designer
10
+ * HEAVY — autopilot; longer goal-shaped imperative prompts
11
+ */
12
+ // ---------------------------------------------------------------------------
13
+ // Module-scope constants (precompiled once)
14
+ // ---------------------------------------------------------------------------
15
+ /** Prompts that are trivially empty acknowledgements */
16
+ const TRIVIAL_PATTERNS = [
17
+ /^(?:hi+|hey|hello|thanks?|thank\s+you|yes|no|ok(?:ay)?|sure|great|good|got\s+it|sounds?\s+good|yep|yup|nope|cool|awesome|perfect)\.?$/,
18
+ ];
19
+ /** Explicit opt-out substrings — checked as case-insensitive includes */
20
+ const OPT_OUT_PHRASES = [
21
+ "just chat",
22
+ "plain answer",
23
+ "no workflow",
24
+ "don't route",
25
+ "do not route",
26
+ "don't use a skill",
27
+ "do not use a skill",
28
+ "talk through",
29
+ "explain only",
30
+ ];
31
+ /** Starters that indicate an explanatory / question prompt → LIGHT/explore */
32
+ const EXPLORE_STARTERS = [
33
+ "explain ",
34
+ "what ",
35
+ "where ",
36
+ "why ",
37
+ "how does ",
38
+ "how do ",
39
+ "how is ",
40
+ "tell me about ",
41
+ "describe ",
42
+ "show me how ",
43
+ "can you explain ",
44
+ "could you explain ",
45
+ ];
46
+ /** Starters / keywords for visual / styling prompts → LIGHT/designer */
47
+ const DESIGNER_STARTERS = [
48
+ "make the button",
49
+ "style ",
50
+ "color ",
51
+ "adjust spacing",
52
+ "ui ",
53
+ "change the color",
54
+ "change the font",
55
+ "change the style",
56
+ "update the style",
57
+ "update the design",
58
+ "change the design",
59
+ "change the layout",
60
+ "update the layout",
61
+ ];
62
+ /**
63
+ * Terms that make broad design verbs visual/UI-specific enough for designer.
64
+ * Keep these intentionally concrete so product, architecture, auth, and
65
+ * deployment redesign prompts can continue to reach the safer HEAVY path.
66
+ */
67
+ const VISUAL_DESIGN_TERMS = [
68
+ /\b(?:ui|ux|visual|style|styling|css|layout|spacing|color|font|typography)\b/,
69
+ /\b(?:button|page|screen|panel|modal|form|navbar|sidebar|header|footer|card|component)\b/,
70
+ ];
71
+ const BROAD_DESIGN_STARTERS = [
72
+ "redesign ",
73
+ ];
74
+ const STRUCTURAL_REDESIGN_TERMS = [
75
+ /\b(?:auth|authentication|authorization|flow|pipeline|deployment|deploy|architecture|system|api|backend|database|data|schema|orm|infra|infrastructure)\b/,
76
+ ];
77
+ /**
78
+ * Patterns that indicate a short, anchored edit → LIGHT/executor
79
+ * Anchors: file path (src/...), line reference, rename/fix-typo phrase.
80
+ */
81
+ const EXECUTOR_ANCHOR_PATTERNS = [
82
+ // file path pattern: word chars / word chars . ext
83
+ /\bsrc\/[\w./\-]+\.\w+\b/,
84
+ /\blib\/[\w./\-]+\.\w+\b/,
85
+ /\btest\/[\w./\-]+\.\w+\b/,
86
+ /\bspec\/[\w./\-]+\.\w+\b/,
87
+ // line number reference
88
+ /\bline\s+\d+\b/,
89
+ // rename in file
90
+ /\brename\b.+\bin\b/,
91
+ // fix typo in
92
+ /\bfix\s+typo\s+in\b/,
93
+ // add X to line / add null check to line
94
+ /\badd\b.+\bto\s+line\s+\d+\b/,
95
+ ];
96
+ /**
97
+ * Imperative verbs that, combined with sufficient word count and no anchor,
98
+ * signal a HEAVY goal-shaped prompt.
99
+ */
100
+ const HEAVY_IMPERATIVE_VERBS = [
101
+ "add ",
102
+ "implement ",
103
+ "refactor ",
104
+ "build ",
105
+ "create ",
106
+ "migrate ",
107
+ "rewrite ",
108
+ "redesign ",
109
+ "integrate ",
110
+ "set up ",
111
+ "configure ",
112
+ "extract ",
113
+ "split ",
114
+ "merge ",
115
+ "update ",
116
+ "remove ",
117
+ "delete ",
118
+ "replace ",
119
+ "convert ",
120
+ "generate ",
121
+ "scaffold ",
122
+ "deploy ",
123
+ "automate ",
124
+ ];
125
+ /**
126
+ * Word count threshold: prompts with MORE than this many words that start with
127
+ * an imperative verb are classified HEAVY. Set to 5 so that 6+ word imperative
128
+ * prompts (e.g. "add dark mode toggle to the settings page" = 8 words) route
129
+ * correctly while ultra-short imperatives (≤5 words) fall through to PASS.
130
+ */
131
+ const HEAVY_WORD_THRESHOLD = 5;
132
+ /**
133
+ * Upper bound (inclusive) on word count for a short "?"-ending prompt to still
134
+ * count as an exploration question. Longer interrogative prompts fall through
135
+ * to later rules (which may classify them as HEAVY or PASS).
136
+ */
137
+ const SHORT_QUESTION_WORD_LIMIT = 10;
138
+ /**
139
+ * Upper bound (inclusive) on word count for a prompt to still qualify as a
140
+ * short anchored edit (LIGHT/executor). Longer anchored prompts are treated as
141
+ * goal-shaped work and may be classified HEAVY by later rules instead.
142
+ */
143
+ const ANCHORED_EDIT_WORD_LIMIT = 15;
144
+ // ---------------------------------------------------------------------------
145
+ // Main classifier
146
+ // ---------------------------------------------------------------------------
147
+ export function triagePrompt(prompt) {
148
+ const normalized = prompt.trim().toLowerCase();
149
+ const wordCount = normalized.length === 0 ? 0 : normalized.split(/\s+/).length;
150
+ // ── Rule 1: Empty / trivial acknowledgements → PASS ──────────────────────
151
+ if (normalized.length === 0) {
152
+ return { lane: "PASS", reason: "empty_input" };
153
+ }
154
+ for (const pattern of TRIVIAL_PATTERNS) {
155
+ if (pattern.test(normalized)) {
156
+ return { lane: "PASS", reason: "trivial_acknowledgement" };
157
+ }
158
+ }
159
+ // ── Rule 2: Explicit opt-out → PASS ──────────────────────────────────────
160
+ for (const phrase of OPT_OUT_PHRASES) {
161
+ if (normalized.includes(phrase)) {
162
+ return { lane: "PASS", reason: "explicit_opt_out" };
163
+ }
164
+ }
165
+ // ── Rule 3: Obvious question / explanation → LIGHT/explore ───────────────
166
+ for (const starter of EXPLORE_STARTERS) {
167
+ if (normalized.startsWith(starter)) {
168
+ return { lane: "LIGHT", destination: "explore", reason: "question_or_explanation" };
169
+ }
170
+ }
171
+ // Short prompt ending with "?" is also an exploration signal
172
+ if (wordCount <= SHORT_QUESTION_WORD_LIMIT && normalized.endsWith("?")) {
173
+ return { lane: "LIGHT", destination: "explore", reason: "short_question" };
174
+ }
175
+ // ── Rule 4: Structural redesign goals → HEAVY ────────────────────────────
176
+ if (BROAD_DESIGN_STARTERS.some((starter) => normalized.startsWith(starter)) &&
177
+ STRUCTURAL_REDESIGN_TERMS.some((pattern) => pattern.test(normalized))) {
178
+ return { lane: "HEAVY", destination: "autopilot", reason: "structural_redesign_goal" };
179
+ }
180
+ // ── Rule 5: Obvious visual / styling → LIGHT/designer ────────────────────
181
+ for (const starter of DESIGNER_STARTERS) {
182
+ if (normalized.startsWith(starter)) {
183
+ return { lane: "LIGHT", destination: "designer", reason: "visual_styling_prompt" };
184
+ }
185
+ }
186
+ for (const starter of BROAD_DESIGN_STARTERS) {
187
+ if (normalized.startsWith(starter) && VISUAL_DESIGN_TERMS.some((pattern) => pattern.test(normalized))) {
188
+ return { lane: "LIGHT", destination: "designer", reason: "visual_styling_prompt" };
189
+ }
190
+ }
191
+ // ── Rule 6: Short anchored edit → LIGHT/executor ─────────────────────────
192
+ if (wordCount <= ANCHORED_EDIT_WORD_LIMIT) {
193
+ for (const pattern of EXECUTOR_ANCHOR_PATTERNS) {
194
+ if (pattern.test(normalized)) {
195
+ return { lane: "LIGHT", destination: "executor", reason: "anchored_edit" };
196
+ }
197
+ }
198
+ }
199
+ // ── Rule 7: Longer goal-shaped imperative → HEAVY ────────────────────────
200
+ if (wordCount > HEAVY_WORD_THRESHOLD) {
201
+ for (const verb of HEAVY_IMPERATIVE_VERBS) {
202
+ if (normalized.startsWith(verb)) {
203
+ return { lane: "HEAVY", destination: "autopilot", reason: "long_imperative_goal" };
204
+ }
205
+ }
206
+ }
207
+ // ── Rule 8: Fallback → PASS ───────────────────────────────────────────────
208
+ return { lane: "PASS", reason: "ambiguous_short_prompt" };
209
+ }
210
+ //# sourceMappingURL=triage-heuristic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-heuristic.js","sourceRoot":"","sources":["../../src/hooks/triage-heuristic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,8EAA8E;AAC9E,4CAA4C;AAC5C,8EAA8E;AAE9E,wDAAwD;AACxD,MAAM,gBAAgB,GAAa;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AO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;QACrF,CAAC;IACH,CAAC;IAED,4EAA4E;IAC5E,IAAI,SAAS,IAAI,wBAAwB,EAAE,CAAC;QAC1C,KAAK,MAAM,OAAO,IAAI,wBAAwB,EAAE,CAAC;YAC/C,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC;IACH,CAAC;IAED,4EAA4E;IAC5E,IAAI,SAAS,GAAG,oBAAoB,EAAE,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,sBAAsB,EAAE,CAAC;YAC1C,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;YACrF,CAAC;QACH,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Triage State
3
+ *
4
+ * Session-scoped state helper for prompt-routing triage.
5
+ * Independent of workflow mode state (ralph-state.json, skill-active-state.json, etc.).
6
+ *
7
+ * File location:
8
+ * With session id : .omx/state/sessions/<session_id>/prompt-routing-state.json
9
+ * Without session id: .omx/state/prompt-routing-state.json
10
+ *
11
+ * Rules:
12
+ * - Write ONLY for HEAVY/LIGHT decisions (never for PASS).
13
+ * - Keyword routing must not write triage state (caller's responsibility).
14
+ * - Missing or malformed file returns null from readTriageState, never throws.
15
+ */
16
+ export interface TriageStateFile {
17
+ version: 1;
18
+ last_triage: {
19
+ lane: "HEAVY" | "LIGHT";
20
+ destination: "autopilot" | "explore" | "executor" | "designer";
21
+ reason: string;
22
+ /** sha256 of the normalized prompt, prefixed with "sha256:" */
23
+ prompt_signature: string;
24
+ /** Best-effort turn marker; ISO timestamp or monotonic counter */
25
+ turn_id: string;
26
+ /** ISO timestamp */
27
+ created_at: string;
28
+ } | null;
29
+ suppress_followup: boolean;
30
+ }
31
+ export interface ReadTriageStateArgs {
32
+ sessionId?: string | null;
33
+ cwd?: string;
34
+ }
35
+ export declare function readTriageState(args: ReadTriageStateArgs): TriageStateFile | null;
36
+ export interface WriteTriageStateArgs extends ReadTriageStateArgs {
37
+ state: TriageStateFile;
38
+ }
39
+ export declare function writeTriageState(args: WriteTriageStateArgs): void;
40
+ /**
41
+ * Returns a sha256 hex digest of the normalized prompt, prefixed with "sha256:".
42
+ */
43
+ export declare function promptSignature(normalizedPrompt: string): string;
44
+ export interface ShouldSuppressArgs {
45
+ previous: TriageStateFile | null;
46
+ /** Normalized prompt: trim + lowercase */
47
+ currentPrompt: string;
48
+ /** Keyword routing always bypasses suppression */
49
+ currentHasKeyword: boolean;
50
+ }
51
+ /**
52
+ * Returns true when the current prompt should suppress triage re-injection
53
+ * because it looks like a short follow-up to a prior HEAVY/LIGHT triage turn.
54
+ *
55
+ * Suppression conditions (all must hold):
56
+ * 1. A prior triage exists (previous?.last_triage != null).
57
+ * 2. previous.suppress_followup === true.
58
+ * 3. currentHasKeyword === false (keywords always bypass triage).
59
+ * 4. The current prompt looks like a clarifying reply and starts with a
60
+ * known clarifying token. Short length alone is not enough.
61
+ */
62
+ export declare function shouldSuppressFollowup(args: ShouldSuppressArgs): boolean;
63
+ //# sourceMappingURL=triage-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-state.d.ts","sourceRoot":"","sources":["../../src/hooks/triage-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,WAAW,EAAE;QACX,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QACxB,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;QAC/D,MAAM,EAAE,MAAM,CAAC;QACf,+DAA+D;QAC/D,gBAAgB,EAAE,MAAM,CAAC;QACzB,kEAAkE;QAClE,OAAO,EAAE,MAAM,CAAC;QAChB,oBAAoB;QACpB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,IAAI,CAAC;IACT,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAsBD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,GAAG,IAAI,CAWjF;AAMD,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAgBjE;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEhE;AAMD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAWxE"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Triage State
3
+ *
4
+ * Session-scoped state helper for prompt-routing triage.
5
+ * Independent of workflow mode state (ralph-state.json, skill-active-state.json, etc.).
6
+ *
7
+ * File location:
8
+ * With session id : .omx/state/sessions/<session_id>/prompt-routing-state.json
9
+ * Without session id: .omx/state/prompt-routing-state.json
10
+ *
11
+ * Rules:
12
+ * - Write ONLY for HEAVY/LIGHT decisions (never for PASS).
13
+ * - Keyword routing must not write triage state (caller's responsibility).
14
+ * - Missing or malformed file returns null from readTriageState, never throws.
15
+ */
16
+ import { createHash } from 'crypto';
17
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'fs';
18
+ import { dirname, join } from 'path';
19
+ import { SESSION_ID_PATTERN, getStateDir } from '../mcp/state-paths.js';
20
+ // ---------------------------------------------------------------------------
21
+ // Path resolution
22
+ // ---------------------------------------------------------------------------
23
+ const STATE_FILENAME = 'prompt-routing-state.json';
24
+ function resolveStatePath(workingDirectory, sessionId) {
25
+ if (typeof sessionId === 'string' && !SESSION_ID_PATTERN.test(sessionId)) {
26
+ return null;
27
+ }
28
+ // getStateDir returns .omx/state/sessions/<sessionId>/ when sessionId is provided,
29
+ // or .omx/state/ as the root fallback — exactly the paths we need.
30
+ const stateDir = getStateDir(workingDirectory ?? undefined, sessionId ?? undefined);
31
+ return join(stateDir, STATE_FILENAME);
32
+ }
33
+ export function readTriageState(args) {
34
+ try {
35
+ const filePath = resolveStatePath(args.cwd, args.sessionId);
36
+ if (!filePath)
37
+ return null;
38
+ const raw = readFileSync(filePath, 'utf-8');
39
+ const parsed = JSON.parse(raw);
40
+ if (!isTriageStateFile(parsed))
41
+ return null;
42
+ return parsed;
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ }
48
+ export function writeTriageState(args) {
49
+ try {
50
+ const filePath = resolveStatePath(args.cwd, args.sessionId);
51
+ if (!filePath)
52
+ return;
53
+ const dir = dirname(filePath);
54
+ mkdirSync(dir, { recursive: true });
55
+ const content = JSON.stringify(args.state, null, 2);
56
+ // Atomic-ish write: write to temp file, then rename.
57
+ const tmpPath = `${filePath}.tmp`;
58
+ writeFileSync(tmpPath, content, 'utf-8');
59
+ renameSync(tmpPath, filePath);
60
+ }
61
+ catch {
62
+ // Swallow filesystem errors — a broken state file must never break the hook.
63
+ }
64
+ }
65
+ // ---------------------------------------------------------------------------
66
+ // Prompt signature
67
+ // ---------------------------------------------------------------------------
68
+ /**
69
+ * Returns a sha256 hex digest of the normalized prompt, prefixed with "sha256:".
70
+ */
71
+ export function promptSignature(normalizedPrompt) {
72
+ return 'sha256:' + createHash('sha256').update(normalizedPrompt, 'utf-8').digest('hex');
73
+ }
74
+ /** Clarifying tokens that indicate a short follow-up reply */
75
+ const CLARIFYING_STARTERS = [
76
+ 'yes',
77
+ 'no',
78
+ 'yeah',
79
+ 'nope',
80
+ 'ok',
81
+ 'okay',
82
+ 'the ',
83
+ 'that',
84
+ 'those',
85
+ 'it',
86
+ ];
87
+ /**
88
+ * Returns true when the current prompt should suppress triage re-injection
89
+ * because it looks like a short follow-up to a prior HEAVY/LIGHT triage turn.
90
+ *
91
+ * Suppression conditions (all must hold):
92
+ * 1. A prior triage exists (previous?.last_triage != null).
93
+ * 2. previous.suppress_followup === true.
94
+ * 3. currentHasKeyword === false (keywords always bypass triage).
95
+ * 4. The current prompt looks like a clarifying reply and starts with a
96
+ * known clarifying token. Short length alone is not enough.
97
+ */
98
+ export function shouldSuppressFollowup(args) {
99
+ if (args.currentHasKeyword)
100
+ return false;
101
+ if (!args.previous?.last_triage)
102
+ return false;
103
+ if (!args.previous.suppress_followup)
104
+ return false;
105
+ const prompt = args.currentPrompt; // already normalized (trim + lowercase)
106
+ for (const token of CLARIFYING_STARTERS) {
107
+ if (prompt.startsWith(token))
108
+ return true;
109
+ }
110
+ return false;
111
+ }
112
+ // ---------------------------------------------------------------------------
113
+ // Runtime type guard
114
+ // ---------------------------------------------------------------------------
115
+ function isTriageStateFile(value) {
116
+ if (typeof value !== 'object' || value === null)
117
+ return false;
118
+ const v = value;
119
+ if (v['version'] !== 1)
120
+ return false;
121
+ if (typeof v['suppress_followup'] !== 'boolean')
122
+ return false;
123
+ if (v['last_triage'] === null)
124
+ return true;
125
+ if (typeof v['last_triage'] !== 'object' || v['last_triage'] === null)
126
+ return false;
127
+ const lt = v['last_triage'];
128
+ return ((lt['lane'] === 'HEAVY' || lt['lane'] === 'LIGHT') &&
129
+ (lt['destination'] === 'autopilot' ||
130
+ lt['destination'] === 'explore' ||
131
+ lt['destination'] === 'executor' ||
132
+ lt['destination'] === 'designer') &&
133
+ typeof lt['reason'] === 'string' &&
134
+ typeof lt['prompt_signature'] === 'string' &&
135
+ typeof lt['turn_id'] === 'string' &&
136
+ typeof lt['created_at'] === 'string');
137
+ }
138
+ //# sourceMappingURL=triage-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage-state.js","sourceRoot":"","sources":["../../src/hooks/triage-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAsBxE,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD,SAAS,gBAAgB,CAAC,gBAAyB,EAAE,SAAyB;IAC5E,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACzE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,mFAAmF;IACnF,mEAAmE;IACnE,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,IAAI,SAAS,EAAE,SAAS,IAAI,SAAS,CAAC,CAAC;IACpF,OAAO,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACxC,CAAC;AAWD,MAAM,UAAU,eAAe,CAAC,IAAyB;IACvD,IAAI,CAAC;QACH,MAAM,QAA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,aAAa,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,aAAa,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpF,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,CAA4B,CAAC;IAEvD,OAAO,CACL,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,OAAO,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;QAClD,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,WAAW;YAChC,EAAE,CAAC,aAAa,CAAC,KAAK,SAAS;YAC/B,EAAE,CAAC,aAAa,CAAC,KAAK,UAAU;YAChC,EAAE,CAAC,aAAa,CAAC,KAAK,UAAU,CAAC;QACnC,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,QAAQ;QAChC,OAAO,EAAE,CAAC,kBAAkB,CAAC,KAAK,QAAQ;QAC1C,OAAO,EAAE,CAAC,SAAS,CAAC,KAAK,QAAQ;QACjC,OAAO,EAAE,CAAC,YAAY,CAAC,KAAK,QAAQ,CACrC,CAAC;AACJ,CAAC"}
@@ -35,6 +35,26 @@ describe('reconcileHudForPromptSubmit', () => {
35
35
  assert.equal(resized.length, 1);
36
36
  assert.equal(resized[0]?.heightLines, 3);
37
37
  });
38
+ it('prefers an explicit session override when recreating HUD', async () => {
39
+ const created = [];
40
+ const result = await reconcileHudForPromptSubmit('/repo', {
41
+ env: { TMUX: '1', TMUX_PANE: '%1', OMX_SESSION_ID: 'sess-stale' },
42
+ sessionId: 'sess-canonical',
43
+ listCurrentWindowPanes: () => [
44
+ { paneId: '%1', currentCommand: 'codex', startCommand: 'codex' },
45
+ ],
46
+ createHudWatchPane: (_cwd, cmd) => {
47
+ created.push({ cmd });
48
+ return '%9';
49
+ },
50
+ resizeTmuxPane: () => true,
51
+ resolveOmxCliEntryPath: () => '/repo/dist/cli/omx.js',
52
+ });
53
+ assert.equal(result.status, 'recreated');
54
+ assert.equal(created.length, 1);
55
+ assert.match(created[0]?.cmd || '', /^OMX_SESSION_ID='sess-canonical' node '.*omx\.js' hud --watch/);
56
+ assert.doesNotMatch(created[0]?.cmd || '', /sess-stale/);
57
+ });
38
58
  it('kills duplicate HUD panes and recreates one full-width pane', async () => {
39
59
  const killed = [];
40
60
  const result = await reconcileHudForPromptSubmit('/repo', {
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile.test.js","sourceRoot":"","sources":["../../../src/hud/__tests__/reconcile.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,MAAM,EAAE;YACvD,GAAG,EAAE,EAAE;SACR,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,OAAO,GAAiG,EAAE,CAAC;QACjH,MAAM,OAAO,GAAmD,EAAE,CAAC;QAEnE,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,OAAO,EAAE;YACxD,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;YACnC,sBAAsB,EAAE,GAAG,EAAE,CAAC;gBAC5B,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE;aACjE;YACD,kBAAkB,EAAE,CAAC,GAAG,EAAE,GA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C,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -9,6 +9,7 @@ export interface ReconcileHudForPromptSubmitResult {
9
9
  }
10
10
  export interface ReconcileHudForPromptSubmitDeps {
11
11
  env?: NodeJS.ProcessEnv;
12
+ sessionId?: string;
12
13
  listCurrentWindowPanes?: () => TmuxPaneSnapshot[];
13
14
  createHudWatchPane?: (cwd: string, hudCmd: string, options?: {
14
15
  heightLines?: number;