oh-my-codex-pennix 0.18.13

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 (3061) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/Cargo.lock +185 -0
  3. package/Cargo.toml +24 -0
  4. package/README.md +445 -0
  5. package/crates/omx-api/Cargo.toml +19 -0
  6. package/crates/omx-api/src/lib.rs +2997 -0
  7. package/crates/omx-api/src/main.rs +10 -0
  8. package/crates/omx-api/tests/cli.rs +558 -0
  9. package/crates/omx-explore/Cargo.toml +14 -0
  10. package/crates/omx-explore/src/main.rs +2972 -0
  11. package/crates/omx-mux/Cargo.toml +11 -0
  12. package/crates/omx-mux/src/lib.rs +91 -0
  13. package/crates/omx-mux/src/tmux.rs +282 -0
  14. package/crates/omx-mux/src/types.rs +306 -0
  15. package/crates/omx-runtime/Cargo.toml +13 -0
  16. package/crates/omx-runtime/src/main.rs +125 -0
  17. package/crates/omx-runtime/tests/execution.rs +212 -0
  18. package/crates/omx-runtime-core/Cargo.toml +13 -0
  19. package/crates/omx-runtime-core/src/authority.rs +239 -0
  20. package/crates/omx-runtime-core/src/dispatch.rs +330 -0
  21. package/crates/omx-runtime-core/src/engine.rs +853 -0
  22. package/crates/omx-runtime-core/src/lib.rs +653 -0
  23. package/crates/omx-runtime-core/src/mailbox.rs +261 -0
  24. package/crates/omx-runtime-core/src/replay.rs +104 -0
  25. package/crates/omx-sparkshell/Cargo.lock +7 -0
  26. package/crates/omx-sparkshell/Cargo.toml +14 -0
  27. package/crates/omx-sparkshell/src/codex_bridge.rs +768 -0
  28. package/crates/omx-sparkshell/src/error.rs +45 -0
  29. package/crates/omx-sparkshell/src/exec.rs +241 -0
  30. package/crates/omx-sparkshell/src/main.rs +1133 -0
  31. package/crates/omx-sparkshell/src/prompt.rs +364 -0
  32. package/crates/omx-sparkshell/src/redaction.rs +241 -0
  33. package/crates/omx-sparkshell/src/registry/c_cpp.rs +9 -0
  34. package/crates/omx-sparkshell/src/registry/csharp.rs +10 -0
  35. package/crates/omx-sparkshell/src/registry/generic_shell.rs +11 -0
  36. package/crates/omx-sparkshell/src/registry/git.rs +10 -0
  37. package/crates/omx-sparkshell/src/registry/go.rs +9 -0
  38. package/crates/omx-sparkshell/src/registry/java_kotlin.rs +9 -0
  39. package/crates/omx-sparkshell/src/registry/mod.rs +85 -0
  40. package/crates/omx-sparkshell/src/registry/node_js.rs +9 -0
  41. package/crates/omx-sparkshell/src/registry/python.rs +9 -0
  42. package/crates/omx-sparkshell/src/registry/ruby.rs +9 -0
  43. package/crates/omx-sparkshell/src/registry/rust.rs +9 -0
  44. package/crates/omx-sparkshell/src/registry/swift.rs +10 -0
  45. package/crates/omx-sparkshell/src/test_support.rs +10 -0
  46. package/crates/omx-sparkshell/src/threshold.rs +75 -0
  47. package/crates/omx-sparkshell/tests/execution.rs +986 -0
  48. package/crates/omx-sparkshell/tests/registry.rs +99 -0
  49. package/dist/adapt/__tests__/foundation.test.d.ts +2 -0
  50. package/dist/adapt/__tests__/foundation.test.d.ts.map +1 -0
  51. package/dist/adapt/__tests__/foundation.test.js +171 -0
  52. package/dist/adapt/__tests__/foundation.test.js.map +1 -0
  53. package/dist/adapt/__tests__/hermes.test.d.ts +2 -0
  54. package/dist/adapt/__tests__/hermes.test.d.ts.map +1 -0
  55. package/dist/adapt/__tests__/hermes.test.js +137 -0
  56. package/dist/adapt/__tests__/hermes.test.js.map +1 -0
  57. package/dist/adapt/contracts.d.ts +157 -0
  58. package/dist/adapt/contracts.d.ts.map +1 -0
  59. package/dist/adapt/contracts.js +10 -0
  60. package/dist/adapt/contracts.js.map +1 -0
  61. package/dist/adapt/hermes.d.ts +83 -0
  62. package/dist/adapt/hermes.d.ts.map +1 -0
  63. package/dist/adapt/hermes.js +371 -0
  64. package/dist/adapt/hermes.js.map +1 -0
  65. package/dist/adapt/index.d.ts +14 -0
  66. package/dist/adapt/index.d.ts.map +1 -0
  67. package/dist/adapt/index.js +293 -0
  68. package/dist/adapt/index.js.map +1 -0
  69. package/dist/adapt/openclaw.d.ts +7 -0
  70. package/dist/adapt/openclaw.d.ts.map +1 -0
  71. package/dist/adapt/openclaw.js +299 -0
  72. package/dist/adapt/openclaw.js.map +1 -0
  73. package/dist/adapt/paths.d.ts +3 -0
  74. package/dist/adapt/paths.d.ts.map +1 -0
  75. package/dist/adapt/paths.js +15 -0
  76. package/dist/adapt/paths.js.map +1 -0
  77. package/dist/adapt/registry.d.ts +4 -0
  78. package/dist/adapt/registry.d.ts.map +1 -0
  79. package/dist/adapt/registry.js +48 -0
  80. package/dist/adapt/registry.js.map +1 -0
  81. package/dist/agents/__tests__/definitions.test.d.ts +2 -0
  82. package/dist/agents/__tests__/definitions.test.d.ts.map +1 -0
  83. package/dist/agents/__tests__/definitions.test.js +96 -0
  84. package/dist/agents/__tests__/definitions.test.js.map +1 -0
  85. package/dist/agents/__tests__/native-config.test.d.ts +2 -0
  86. package/dist/agents/__tests__/native-config.test.d.ts.map +1 -0
  87. package/dist/agents/__tests__/native-config.test.js +398 -0
  88. package/dist/agents/__tests__/native-config.test.js.map +1 -0
  89. package/dist/agents/definitions.d.ts +35 -0
  90. package/dist/agents/definitions.d.ts.map +1 -0
  91. package/dist/agents/definitions.js +371 -0
  92. package/dist/agents/definitions.js.map +1 -0
  93. package/dist/agents/native-config.d.ts +56 -0
  94. package/dist/agents/native-config.d.ts.map +1 -0
  95. package/dist/agents/native-config.js +285 -0
  96. package/dist/agents/native-config.js.map +1 -0
  97. package/dist/agents/policy.d.ts +10 -0
  98. package/dist/agents/policy.d.ts.map +1 -0
  99. package/dist/agents/policy.js +61 -0
  100. package/dist/agents/policy.js.map +1 -0
  101. package/dist/auth/__tests__/config-sessions.test.d.ts +2 -0
  102. package/dist/auth/__tests__/config-sessions.test.d.ts.map +1 -0
  103. package/dist/auth/__tests__/config-sessions.test.js +48 -0
  104. package/dist/auth/__tests__/config-sessions.test.js.map +1 -0
  105. package/dist/auth/__tests__/quota-rotation.test.d.ts +2 -0
  106. package/dist/auth/__tests__/quota-rotation.test.d.ts.map +1 -0
  107. package/dist/auth/__tests__/quota-rotation.test.js +33 -0
  108. package/dist/auth/__tests__/quota-rotation.test.js.map +1 -0
  109. package/dist/auth/__tests__/redact.test.d.ts +2 -0
  110. package/dist/auth/__tests__/redact.test.d.ts.map +1 -0
  111. package/dist/auth/__tests__/redact.test.js +20 -0
  112. package/dist/auth/__tests__/redact.test.js.map +1 -0
  113. package/dist/auth/__tests__/storage.test.d.ts +2 -0
  114. package/dist/auth/__tests__/storage.test.d.ts.map +1 -0
  115. package/dist/auth/__tests__/storage.test.js +108 -0
  116. package/dist/auth/__tests__/storage.test.js.map +1 -0
  117. package/dist/auth/config.d.ts +9 -0
  118. package/dist/auth/config.d.ts.map +1 -0
  119. package/dist/auth/config.js +77 -0
  120. package/dist/auth/config.js.map +1 -0
  121. package/dist/auth/hotswap.d.ts +36 -0
  122. package/dist/auth/hotswap.d.ts.map +1 -0
  123. package/dist/auth/hotswap.js +159 -0
  124. package/dist/auth/hotswap.js.map +1 -0
  125. package/dist/auth/index.d.ts +8 -0
  126. package/dist/auth/index.d.ts.map +1 -0
  127. package/dist/auth/index.js +8 -0
  128. package/dist/auth/index.js.map +1 -0
  129. package/dist/auth/paths.d.ts +12 -0
  130. package/dist/auth/paths.d.ts.map +1 -0
  131. package/dist/auth/paths.js +78 -0
  132. package/dist/auth/paths.js.map +1 -0
  133. package/dist/auth/quota-detector.d.ts +10 -0
  134. package/dist/auth/quota-detector.d.ts.map +1 -0
  135. package/dist/auth/quota-detector.js +40 -0
  136. package/dist/auth/quota-detector.js.map +1 -0
  137. package/dist/auth/redact.d.ts +2 -0
  138. package/dist/auth/redact.d.ts.map +1 -0
  139. package/dist/auth/redact.js +26 -0
  140. package/dist/auth/redact.js.map +1 -0
  141. package/dist/auth/rotation.d.ts +9 -0
  142. package/dist/auth/rotation.d.ts.map +1 -0
  143. package/dist/auth/rotation.js +26 -0
  144. package/dist/auth/rotation.js.map +1 -0
  145. package/dist/auth/sessions.d.ts +15 -0
  146. package/dist/auth/sessions.d.ts.map +1 -0
  147. package/dist/auth/sessions.js +62 -0
  148. package/dist/auth/sessions.js.map +1 -0
  149. package/dist/auth/storage.d.ts +27 -0
  150. package/dist/auth/storage.d.ts.map +1 -0
  151. package/dist/auth/storage.js +111 -0
  152. package/dist/auth/storage.js.map +1 -0
  153. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +2 -0
  154. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +1 -0
  155. package/dist/autopilot/__tests__/deep-interview-gate.test.js +215 -0
  156. package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +1 -0
  157. package/dist/autopilot/__tests__/fsm.test.d.ts +2 -0
  158. package/dist/autopilot/__tests__/fsm.test.d.ts.map +1 -0
  159. package/dist/autopilot/__tests__/fsm.test.js +78 -0
  160. package/dist/autopilot/__tests__/fsm.test.js.map +1 -0
  161. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +2 -0
  162. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +1 -0
  163. package/dist/autopilot/__tests__/ralplan-gate.test.js +274 -0
  164. package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -0
  165. package/dist/autopilot/completion-gate.d.ts +10 -0
  166. package/dist/autopilot/completion-gate.d.ts.map +1 -0
  167. package/dist/autopilot/completion-gate.js +154 -0
  168. package/dist/autopilot/completion-gate.js.map +1 -0
  169. package/dist/autopilot/deep-interview-gate.d.ts +18 -0
  170. package/dist/autopilot/deep-interview-gate.d.ts.map +1 -0
  171. package/dist/autopilot/deep-interview-gate.js +396 -0
  172. package/dist/autopilot/deep-interview-gate.js.map +1 -0
  173. package/dist/autopilot/fsm.d.ts +13 -0
  174. package/dist/autopilot/fsm.d.ts.map +1 -0
  175. package/dist/autopilot/fsm.js +70 -0
  176. package/dist/autopilot/fsm.js.map +1 -0
  177. package/dist/autopilot/ralplan-gate.d.ts +17 -0
  178. package/dist/autopilot/ralplan-gate.d.ts.map +1 -0
  179. package/dist/autopilot/ralplan-gate.js +68 -0
  180. package/dist/autopilot/ralplan-gate.js.map +1 -0
  181. package/dist/autoresearch/__tests__/contracts.test.d.ts +2 -0
  182. package/dist/autoresearch/__tests__/contracts.test.d.ts.map +1 -0
  183. package/dist/autoresearch/__tests__/contracts.test.js +127 -0
  184. package/dist/autoresearch/__tests__/contracts.test.js.map +1 -0
  185. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts +2 -0
  186. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts.map +1 -0
  187. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js +349 -0
  188. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js.map +1 -0
  189. package/dist/autoresearch/__tests__/runtime.test.d.ts +2 -0
  190. package/dist/autoresearch/__tests__/runtime.test.d.ts.map +1 -0
  191. package/dist/autoresearch/__tests__/runtime.test.js +211 -0
  192. package/dist/autoresearch/__tests__/runtime.test.js.map +1 -0
  193. package/dist/autoresearch/__tests__/skill-validation.test.d.ts +2 -0
  194. package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +1 -0
  195. package/dist/autoresearch/__tests__/skill-validation.test.js +91 -0
  196. package/dist/autoresearch/__tests__/skill-validation.test.js.map +1 -0
  197. package/dist/autoresearch/contracts.d.ts +31 -0
  198. package/dist/autoresearch/contracts.d.ts.map +1 -0
  199. package/dist/autoresearch/contracts.js +197 -0
  200. package/dist/autoresearch/contracts.js.map +1 -0
  201. package/dist/autoresearch/goal.d.ts +90 -0
  202. package/dist/autoresearch/goal.d.ts.map +1 -0
  203. package/dist/autoresearch/goal.js +237 -0
  204. package/dist/autoresearch/goal.js.map +1 -0
  205. package/dist/autoresearch/runtime.d.ts +132 -0
  206. package/dist/autoresearch/runtime.d.ts.map +1 -0
  207. package/dist/autoresearch/runtime.js +1022 -0
  208. package/dist/autoresearch/runtime.js.map +1 -0
  209. package/dist/autoresearch/skill-validation.d.ts +14 -0
  210. package/dist/autoresearch/skill-validation.d.ts.map +1 -0
  211. package/dist/autoresearch/skill-validation.js +172 -0
  212. package/dist/autoresearch/skill-validation.js.map +1 -0
  213. package/dist/catalog/__tests__/generator.test.d.ts +2 -0
  214. package/dist/catalog/__tests__/generator.test.d.ts.map +1 -0
  215. package/dist/catalog/__tests__/generator.test.js +60 -0
  216. package/dist/catalog/__tests__/generator.test.js.map +1 -0
  217. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
  218. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
  219. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +108 -0
  220. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
  221. package/dist/catalog/__tests__/schema.test.d.ts +2 -0
  222. package/dist/catalog/__tests__/schema.test.d.ts.map +1 -0
  223. package/dist/catalog/__tests__/schema.test.js +84 -0
  224. package/dist/catalog/__tests__/schema.test.js.map +1 -0
  225. package/dist/catalog/installable.d.ts +5 -0
  226. package/dist/catalog/installable.d.ts.map +1 -0
  227. package/dist/catalog/installable.js +13 -0
  228. package/dist/catalog/installable.js.map +1 -0
  229. package/dist/catalog/reader.d.ts +19 -0
  230. package/dist/catalog/reader.d.ts.map +1 -0
  231. package/dist/catalog/reader.js +63 -0
  232. package/dist/catalog/reader.js.map +1 -0
  233. package/dist/catalog/schema.d.ts +32 -0
  234. package/dist/catalog/schema.d.ts.map +1 -0
  235. package/dist/catalog/schema.js +107 -0
  236. package/dist/catalog/schema.js.map +1 -0
  237. package/dist/catalog/skill-mirror.d.ts +20 -0
  238. package/dist/catalog/skill-mirror.d.ts.map +1 -0
  239. package/dist/catalog/skill-mirror.js +104 -0
  240. package/dist/catalog/skill-mirror.js.map +1 -0
  241. package/dist/cli/__tests__/adapt-help.test.d.ts +2 -0
  242. package/dist/cli/__tests__/adapt-help.test.d.ts.map +1 -0
  243. package/dist/cli/__tests__/adapt-help.test.js +39 -0
  244. package/dist/cli/__tests__/adapt-help.test.js.map +1 -0
  245. package/dist/cli/__tests__/adapt.test.d.ts +2 -0
  246. package/dist/cli/__tests__/adapt.test.d.ts.map +1 -0
  247. package/dist/cli/__tests__/adapt.test.js +62 -0
  248. package/dist/cli/__tests__/adapt.test.js.map +1 -0
  249. package/dist/cli/__tests__/agents-init.test.d.ts +2 -0
  250. package/dist/cli/__tests__/agents-init.test.d.ts.map +1 -0
  251. package/dist/cli/__tests__/agents-init.test.js +184 -0
  252. package/dist/cli/__tests__/agents-init.test.js.map +1 -0
  253. package/dist/cli/__tests__/agents.test.d.ts +2 -0
  254. package/dist/cli/__tests__/agents.test.d.ts.map +1 -0
  255. package/dist/cli/__tests__/agents.test.js +137 -0
  256. package/dist/cli/__tests__/agents.test.js.map +1 -0
  257. package/dist/cli/__tests__/api.test.d.ts +2 -0
  258. package/dist/cli/__tests__/api.test.d.ts.map +1 -0
  259. package/dist/cli/__tests__/api.test.js +175 -0
  260. package/dist/cli/__tests__/api.test.js.map +1 -0
  261. package/dist/cli/__tests__/ask.test.d.ts +2 -0
  262. package/dist/cli/__tests__/ask.test.d.ts.map +1 -0
  263. package/dist/cli/__tests__/ask.test.js +332 -0
  264. package/dist/cli/__tests__/ask.test.js.map +1 -0
  265. package/dist/cli/__tests__/auth.test.d.ts +2 -0
  266. package/dist/cli/__tests__/auth.test.d.ts.map +1 -0
  267. package/dist/cli/__tests__/auth.test.js +203 -0
  268. package/dist/cli/__tests__/auth.test.js.map +1 -0
  269. package/dist/cli/__tests__/autoresearch-goal.test.d.ts +2 -0
  270. package/dist/cli/__tests__/autoresearch-goal.test.d.ts.map +1 -0
  271. package/dist/cli/__tests__/autoresearch-goal.test.js +207 -0
  272. package/dist/cli/__tests__/autoresearch-goal.test.js.map +1 -0
  273. package/dist/cli/__tests__/autoresearch-guided.test.d.ts +2 -0
  274. package/dist/cli/__tests__/autoresearch-guided.test.d.ts.map +1 -0
  275. package/dist/cli/__tests__/autoresearch-guided.test.js +365 -0
  276. package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -0
  277. package/dist/cli/__tests__/autoresearch.test.d.ts +2 -0
  278. package/dist/cli/__tests__/autoresearch.test.d.ts.map +1 -0
  279. package/dist/cli/__tests__/autoresearch.test.js +155 -0
  280. package/dist/cli/__tests__/autoresearch.test.js.map +1 -0
  281. package/dist/cli/__tests__/catalog-contract.test.d.ts +2 -0
  282. package/dist/cli/__tests__/catalog-contract.test.d.ts.map +1 -0
  283. package/dist/cli/__tests__/catalog-contract.test.js +18 -0
  284. package/dist/cli/__tests__/catalog-contract.test.js.map +1 -0
  285. package/dist/cli/__tests__/cleanup.test.d.ts +2 -0
  286. package/dist/cli/__tests__/cleanup.test.d.ts.map +1 -0
  287. package/dist/cli/__tests__/cleanup.test.js +527 -0
  288. package/dist/cli/__tests__/cleanup.test.js.map +1 -0
  289. package/dist/cli/__tests__/codex-feature-probe.test.d.ts +2 -0
  290. package/dist/cli/__tests__/codex-feature-probe.test.d.ts.map +1 -0
  291. package/dist/cli/__tests__/codex-feature-probe.test.js +46 -0
  292. package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -0
  293. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
  294. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
  295. package/dist/cli/__tests__/codex-plugin-layout.test.js +778 -0
  296. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
  297. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +2 -0
  298. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +1 -0
  299. package/dist/cli/__tests__/doctor-context-window-warning.test.js +122 -0
  300. package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -0
  301. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts +2 -0
  302. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts.map +1 -0
  303. package/dist/cli/__tests__/doctor-invalid-config.test.js +52 -0
  304. package/dist/cli/__tests__/doctor-invalid-config.test.js.map +1 -0
  305. package/dist/cli/__tests__/doctor-spark-routing.test.d.ts +2 -0
  306. package/dist/cli/__tests__/doctor-spark-routing.test.d.ts.map +1 -0
  307. package/dist/cli/__tests__/doctor-spark-routing.test.js +79 -0
  308. package/dist/cli/__tests__/doctor-spark-routing.test.js.map +1 -0
  309. package/dist/cli/__tests__/doctor-team.test.d.ts +2 -0
  310. package/dist/cli/__tests__/doctor-team.test.d.ts.map +1 -0
  311. package/dist/cli/__tests__/doctor-team.test.js +299 -0
  312. package/dist/cli/__tests__/doctor-team.test.js.map +1 -0
  313. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts +2 -0
  314. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts.map +1 -0
  315. package/dist/cli/__tests__/doctor-warning-copy.test.js +1312 -0
  316. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -0
  317. package/dist/cli/__tests__/error-handling-warnings.test.d.ts +2 -0
  318. package/dist/cli/__tests__/error-handling-warnings.test.d.ts.map +1 -0
  319. package/dist/cli/__tests__/error-handling-warnings.test.js +52 -0
  320. package/dist/cli/__tests__/error-handling-warnings.test.js.map +1 -0
  321. package/dist/cli/__tests__/exec.test.d.ts +2 -0
  322. package/dist/cli/__tests__/exec.test.d.ts.map +1 -0
  323. package/dist/cli/__tests__/exec.test.js +213 -0
  324. package/dist/cli/__tests__/exec.test.js.map +1 -0
  325. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts +2 -0
  326. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts.map +1 -0
  327. package/dist/cli/__tests__/explore-windows-diagnostics.test.js +17 -0
  328. package/dist/cli/__tests__/explore-windows-diagnostics.test.js.map +1 -0
  329. package/dist/cli/__tests__/explore.test.d.ts +2 -0
  330. package/dist/cli/__tests__/explore.test.d.ts.map +1 -0
  331. package/dist/cli/__tests__/explore.test.js +104 -0
  332. package/dist/cli/__tests__/explore.test.js.map +1 -0
  333. package/dist/cli/__tests__/hooks.test.d.ts +2 -0
  334. package/dist/cli/__tests__/hooks.test.d.ts.map +1 -0
  335. package/dist/cli/__tests__/hooks.test.js +55 -0
  336. package/dist/cli/__tests__/hooks.test.js.map +1 -0
  337. package/dist/cli/__tests__/imagegen-continuation.test.d.ts +2 -0
  338. package/dist/cli/__tests__/imagegen-continuation.test.d.ts.map +1 -0
  339. package/dist/cli/__tests__/imagegen-continuation.test.js +135 -0
  340. package/dist/cli/__tests__/imagegen-continuation.test.js.map +1 -0
  341. package/dist/cli/__tests__/index.test.d.ts +2 -0
  342. package/dist/cli/__tests__/index.test.d.ts.map +1 -0
  343. package/dist/cli/__tests__/index.test.js +3619 -0
  344. package/dist/cli/__tests__/index.test.js.map +1 -0
  345. package/dist/cli/__tests__/install-docs-contract.test.d.ts +2 -0
  346. package/dist/cli/__tests__/install-docs-contract.test.d.ts.map +1 -0
  347. package/dist/cli/__tests__/install-docs-contract.test.js +55 -0
  348. package/dist/cli/__tests__/install-docs-contract.test.js.map +1 -0
  349. package/dist/cli/__tests__/launch-fallback.test.d.ts +2 -0
  350. package/dist/cli/__tests__/launch-fallback.test.d.ts.map +1 -0
  351. package/dist/cli/__tests__/launch-fallback.test.js +1285 -0
  352. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -0
  353. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts +2 -0
  354. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts.map +1 -0
  355. package/dist/cli/__tests__/lifecycle-notifications.test.js +48 -0
  356. package/dist/cli/__tests__/lifecycle-notifications.test.js.map +1 -0
  357. package/dist/cli/__tests__/list.test.d.ts +2 -0
  358. package/dist/cli/__tests__/list.test.d.ts.map +1 -0
  359. package/dist/cli/__tests__/list.test.js +38 -0
  360. package/dist/cli/__tests__/list.test.js.map +1 -0
  361. package/dist/cli/__tests__/mcp-parity.test.d.ts +2 -0
  362. package/dist/cli/__tests__/mcp-parity.test.d.ts.map +1 -0
  363. package/dist/cli/__tests__/mcp-parity.test.js +228 -0
  364. package/dist/cli/__tests__/mcp-parity.test.js.map +1 -0
  365. package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
  366. package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
  367. package/dist/cli/__tests__/mcp-serve.test.js +68 -0
  368. package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
  369. package/dist/cli/__tests__/native-assets.test.d.ts +2 -0
  370. package/dist/cli/__tests__/native-assets.test.d.ts.map +1 -0
  371. package/dist/cli/__tests__/native-assets.test.js +296 -0
  372. package/dist/cli/__tests__/native-assets.test.js.map +1 -0
  373. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts +2 -0
  374. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts.map +1 -0
  375. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js +11 -0
  376. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js.map +1 -0
  377. package/dist/cli/__tests__/nested-help-routing.test.d.ts +2 -0
  378. package/dist/cli/__tests__/nested-help-routing.test.d.ts.map +1 -0
  379. package/dist/cli/__tests__/nested-help-routing.test.js +63 -0
  380. package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -0
  381. package/dist/cli/__tests__/package-bin-contract.test.d.ts +2 -0
  382. package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +1 -0
  383. package/dist/cli/__tests__/package-bin-contract.test.js +190 -0
  384. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -0
  385. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts +3 -0
  386. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts.map +1 -0
  387. package/dist/cli/__tests__/packaged-explore-harness-lock.js +67 -0
  388. package/dist/cli/__tests__/packaged-explore-harness-lock.js.map +1 -0
  389. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts +2 -0
  390. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts.map +1 -0
  391. package/dist/cli/__tests__/packaged-script-resolution.test.js +19 -0
  392. package/dist/cli/__tests__/packaged-script-resolution.test.js.map +1 -0
  393. package/dist/cli/__tests__/performance-goal.test.d.ts +2 -0
  394. package/dist/cli/__tests__/performance-goal.test.d.ts.map +1 -0
  395. package/dist/cli/__tests__/performance-goal.test.js +144 -0
  396. package/dist/cli/__tests__/performance-goal.test.js.map +1 -0
  397. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts +2 -0
  398. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts.map +1 -0
  399. package/dist/cli/__tests__/prompt-skill-sanitization.test.js +48 -0
  400. package/dist/cli/__tests__/prompt-skill-sanitization.test.js.map +1 -0
  401. package/dist/cli/__tests__/question.test.d.ts +2 -0
  402. package/dist/cli/__tests__/question.test.d.ts.map +1 -0
  403. package/dist/cli/__tests__/question.test.js +850 -0
  404. package/dist/cli/__tests__/question.test.js.map +1 -0
  405. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts +2 -0
  406. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts.map +1 -0
  407. package/dist/cli/__tests__/ralph-deslop-contract.test.js +28 -0
  408. package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -0
  409. package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts +2 -0
  410. package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts.map +1 -0
  411. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +49 -0
  412. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -0
  413. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts +2 -0
  414. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts.map +1 -0
  415. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +25 -0
  416. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -0
  417. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts +2 -0
  418. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts.map +1 -0
  419. package/dist/cli/__tests__/ralph-prd-smoke.test.js +174 -0
  420. package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +1 -0
  421. package/dist/cli/__tests__/ralph.test.d.ts +2 -0
  422. package/dist/cli/__tests__/ralph.test.d.ts.map +1 -0
  423. package/dist/cli/__tests__/ralph.test.js +256 -0
  424. package/dist/cli/__tests__/ralph.test.js.map +1 -0
  425. package/dist/cli/__tests__/resume.test.d.ts +2 -0
  426. package/dist/cli/__tests__/resume.test.d.ts.map +1 -0
  427. package/dist/cli/__tests__/resume.test.js +133 -0
  428. package/dist/cli/__tests__/resume.test.js.map +1 -0
  429. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts +2 -0
  430. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts.map +1 -0
  431. package/dist/cli/__tests__/session-scoped-runtime.test.js +247 -0
  432. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -0
  433. package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
  434. package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
  435. package/dist/cli/__tests__/session-search-help.test.js +37 -0
  436. package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
  437. package/dist/cli/__tests__/session-search.test.d.ts +2 -0
  438. package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
  439. package/dist/cli/__tests__/session-search.test.js +77 -0
  440. package/dist/cli/__tests__/session-search.test.js.map +1 -0
  441. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts +2 -0
  442. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts.map +1 -0
  443. package/dist/cli/__tests__/setup-agents-overwrite.test.js +776 -0
  444. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -0
  445. package/dist/cli/__tests__/setup-gh-star.test.d.ts +2 -0
  446. package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +1 -0
  447. package/dist/cli/__tests__/setup-gh-star.test.js +67 -0
  448. package/dist/cli/__tests__/setup-gh-star.test.js.map +1 -0
  449. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts +2 -0
  450. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts.map +1 -0
  451. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +202 -0
  452. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -0
  453. package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
  454. package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
  455. package/dist/cli/__tests__/setup-install-mode.test.js +2103 -0
  456. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
  457. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts +2 -0
  458. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts.map +1 -0
  459. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +191 -0
  460. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -0
  461. package/dist/cli/__tests__/setup-refresh.test.d.ts +2 -0
  462. package/dist/cli/__tests__/setup-refresh.test.d.ts.map +1 -0
  463. package/dist/cli/__tests__/setup-refresh.test.js +779 -0
  464. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -0
  465. package/dist/cli/__tests__/setup-scope.test.d.ts +2 -0
  466. package/dist/cli/__tests__/setup-scope.test.d.ts.map +1 -0
  467. package/dist/cli/__tests__/setup-scope.test.js +367 -0
  468. package/dist/cli/__tests__/setup-scope.test.js.map +1 -0
  469. package/dist/cli/__tests__/setup-skill-validation.test.d.ts +2 -0
  470. package/dist/cli/__tests__/setup-skill-validation.test.d.ts.map +1 -0
  471. package/dist/cli/__tests__/setup-skill-validation.test.js +44 -0
  472. package/dist/cli/__tests__/setup-skill-validation.test.js.map +1 -0
  473. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts +2 -0
  474. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts.map +1 -0
  475. package/dist/cli/__tests__/setup-skills-overwrite.test.js +292 -0
  476. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -0
  477. package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
  478. package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
  479. package/dist/cli/__tests__/sidecar.test.js +24 -0
  480. package/dist/cli/__tests__/sidecar.test.js.map +1 -0
  481. package/dist/cli/__tests__/sparkshell-cli.test.d.ts +2 -0
  482. package/dist/cli/__tests__/sparkshell-cli.test.d.ts.map +1 -0
  483. package/dist/cli/__tests__/sparkshell-cli.test.js +471 -0
  484. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -0
  485. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts +2 -0
  486. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts.map +1 -0
  487. package/dist/cli/__tests__/sparkshell-packaging.test.js +105 -0
  488. package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -0
  489. package/dist/cli/__tests__/star-prompt.test.d.ts +2 -0
  490. package/dist/cli/__tests__/star-prompt.test.d.ts.map +1 -0
  491. package/dist/cli/__tests__/star-prompt.test.js +172 -0
  492. package/dist/cli/__tests__/star-prompt.test.js.map +1 -0
  493. package/dist/cli/__tests__/state.test.d.ts +2 -0
  494. package/dist/cli/__tests__/state.test.d.ts.map +1 -0
  495. package/dist/cli/__tests__/state.test.js +160 -0
  496. package/dist/cli/__tests__/state.test.js.map +1 -0
  497. package/dist/cli/__tests__/team-decompose.test.d.ts +2 -0
  498. package/dist/cli/__tests__/team-decompose.test.d.ts.map +1 -0
  499. package/dist/cli/__tests__/team-decompose.test.js +138 -0
  500. package/dist/cli/__tests__/team-decompose.test.js.map +1 -0
  501. package/dist/cli/__tests__/team.test.d.ts +2 -0
  502. package/dist/cli/__tests__/team.test.d.ts.map +1 -0
  503. package/dist/cli/__tests__/team.test.js +2897 -0
  504. package/dist/cli/__tests__/team.test.js.map +1 -0
  505. package/dist/cli/__tests__/ultragoal.test.d.ts +2 -0
  506. package/dist/cli/__tests__/ultragoal.test.d.ts.map +1 -0
  507. package/dist/cli/__tests__/ultragoal.test.js +599 -0
  508. package/dist/cli/__tests__/ultragoal.test.js.map +1 -0
  509. package/dist/cli/__tests__/uninstall.test.d.ts +2 -0
  510. package/dist/cli/__tests__/uninstall.test.d.ts.map +1 -0
  511. package/dist/cli/__tests__/uninstall.test.js +865 -0
  512. package/dist/cli/__tests__/uninstall.test.js.map +1 -0
  513. package/dist/cli/__tests__/update.test.d.ts +2 -0
  514. package/dist/cli/__tests__/update.test.d.ts.map +1 -0
  515. package/dist/cli/__tests__/update.test.js +1182 -0
  516. package/dist/cli/__tests__/update.test.js.map +1 -0
  517. package/dist/cli/__tests__/version-sync-contract.test.d.ts +2 -0
  518. package/dist/cli/__tests__/version-sync-contract.test.d.ts.map +1 -0
  519. package/dist/cli/__tests__/version-sync-contract.test.js +47 -0
  520. package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -0
  521. package/dist/cli/__tests__/version.test.d.ts +2 -0
  522. package/dist/cli/__tests__/version.test.d.ts.map +1 -0
  523. package/dist/cli/__tests__/version.test.js +21 -0
  524. package/dist/cli/__tests__/version.test.js.map +1 -0
  525. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts +2 -0
  526. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts.map +1 -0
  527. package/dist/cli/__tests__/windows-popup-loop-contract.test.js +31 -0
  528. package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -0
  529. package/dist/cli/adapt.d.ts +6 -0
  530. package/dist/cli/adapt.d.ts.map +1 -0
  531. package/dist/cli/adapt.js +135 -0
  532. package/dist/cli/adapt.js.map +1 -0
  533. package/dist/cli/agents-init.d.ts +14 -0
  534. package/dist/cli/agents-init.d.ts.map +1 -0
  535. package/dist/cli/agents-init.js +274 -0
  536. package/dist/cli/agents-init.js.map +1 -0
  537. package/dist/cli/agents.d.ts +14 -0
  538. package/dist/cli/agents.d.ts.map +1 -0
  539. package/dist/cli/agents.js +267 -0
  540. package/dist/cli/agents.js.map +1 -0
  541. package/dist/cli/api.d.ts +26 -0
  542. package/dist/cli/api.d.ts.map +1 -0
  543. package/dist/cli/api.js +153 -0
  544. package/dist/cli/api.js.map +1 -0
  545. package/dist/cli/ask.d.ts +13 -0
  546. package/dist/cli/ask.d.ts.map +1 -0
  547. package/dist/cli/ask.js +178 -0
  548. package/dist/cli/ask.js.map +1 -0
  549. package/dist/cli/auth.d.ts +4 -0
  550. package/dist/cli/auth.d.ts.map +1 -0
  551. package/dist/cli/auth.js +113 -0
  552. package/dist/cli/auth.js.map +1 -0
  553. package/dist/cli/autoresearch-goal.d.ts +3 -0
  554. package/dist/cli/autoresearch-goal.d.ts.map +1 -0
  555. package/dist/cli/autoresearch-goal.js +175 -0
  556. package/dist/cli/autoresearch-goal.js.map +1 -0
  557. package/dist/cli/autoresearch-guided.d.ts +43 -0
  558. package/dist/cli/autoresearch-guided.d.ts.map +1 -0
  559. package/dist/cli/autoresearch-guided.js +282 -0
  560. package/dist/cli/autoresearch-guided.js.map +1 -0
  561. package/dist/cli/autoresearch-intake.d.ts +62 -0
  562. package/dist/cli/autoresearch-intake.d.ts.map +1 -0
  563. package/dist/cli/autoresearch-intake.js +336 -0
  564. package/dist/cli/autoresearch-intake.js.map +1 -0
  565. package/dist/cli/autoresearch.d.ts +16 -0
  566. package/dist/cli/autoresearch.d.ts.map +1 -0
  567. package/dist/cli/autoresearch.js +91 -0
  568. package/dist/cli/autoresearch.js.map +1 -0
  569. package/dist/cli/catalog-contract.d.ts +10 -0
  570. package/dist/cli/catalog-contract.d.ts.map +1 -0
  571. package/dist/cli/catalog-contract.js +34 -0
  572. package/dist/cli/catalog-contract.js.map +1 -0
  573. package/dist/cli/cleanup.d.ts +58 -0
  574. package/dist/cli/cleanup.d.ts.map +1 -0
  575. package/dist/cli/cleanup.js +444 -0
  576. package/dist/cli/cleanup.js.map +1 -0
  577. package/dist/cli/codex-feature-probe.d.ts +17 -0
  578. package/dist/cli/codex-feature-probe.d.ts.map +1 -0
  579. package/dist/cli/codex-feature-probe.js +50 -0
  580. package/dist/cli/codex-feature-probe.js.map +1 -0
  581. package/dist/cli/codex-home.d.ts +7 -0
  582. package/dist/cli/codex-home.d.ts.map +1 -0
  583. package/dist/cli/codex-home.js +26 -0
  584. package/dist/cli/codex-home.js.map +1 -0
  585. package/dist/cli/constants.d.ts +11 -0
  586. package/dist/cli/constants.d.ts.map +1 -0
  587. package/dist/cli/constants.js +11 -0
  588. package/dist/cli/constants.js.map +1 -0
  589. package/dist/cli/doctor.d.ts +43 -0
  590. package/dist/cli/doctor.d.ts.map +1 -0
  591. package/dist/cli/doctor.js +1956 -0
  592. package/dist/cli/doctor.js.map +1 -0
  593. package/dist/cli/explore.d.ts +14 -0
  594. package/dist/cli/explore.d.ts.map +1 -0
  595. package/dist/cli/explore.js +72 -0
  596. package/dist/cli/explore.js.map +1 -0
  597. package/dist/cli/hooks.d.ts +4 -0
  598. package/dist/cli/hooks.d.ts.map +1 -0
  599. package/dist/cli/hooks.js +201 -0
  600. package/dist/cli/hooks.js.map +1 -0
  601. package/dist/cli/index.d.ts +247 -0
  602. package/dist/cli/index.d.ts.map +1 -0
  603. package/dist/cli/index.js +4590 -0
  604. package/dist/cli/index.js.map +1 -0
  605. package/dist/cli/list.d.ts +2 -0
  606. package/dist/cli/list.d.ts.map +1 -0
  607. package/dist/cli/list.js +40 -0
  608. package/dist/cli/list.js.map +1 -0
  609. package/dist/cli/mcp-parity.d.ts +22 -0
  610. package/dist/cli/mcp-parity.d.ts.map +1 -0
  611. package/dist/cli/mcp-parity.js +251 -0
  612. package/dist/cli/mcp-parity.js.map +1 -0
  613. package/dist/cli/mcp-serve.d.ts +13 -0
  614. package/dist/cli/mcp-serve.d.ts.map +1 -0
  615. package/dist/cli/mcp-serve.js +75 -0
  616. package/dist/cli/mcp-serve.js.map +1 -0
  617. package/dist/cli/native-assets.d.ts +52 -0
  618. package/dist/cli/native-assets.d.ts.map +1 -0
  619. package/dist/cli/native-assets.js +302 -0
  620. package/dist/cli/native-assets.js.map +1 -0
  621. package/dist/cli/omx.d.ts +3 -0
  622. package/dist/cli/omx.d.ts.map +1 -0
  623. package/dist/cli/omx.js +25 -0
  624. package/dist/cli/omx.js.map +1 -0
  625. package/dist/cli/performance-goal.d.ts +3 -0
  626. package/dist/cli/performance-goal.d.ts.map +1 -0
  627. package/dist/cli/performance-goal.js +186 -0
  628. package/dist/cli/performance-goal.js.map +1 -0
  629. package/dist/cli/plugin-marketplace.d.ts +54 -0
  630. package/dist/cli/plugin-marketplace.d.ts.map +1 -0
  631. package/dist/cli/plugin-marketplace.js +369 -0
  632. package/dist/cli/plugin-marketplace.js.map +1 -0
  633. package/dist/cli/question.d.ts +3 -0
  634. package/dist/cli/question.d.ts.map +1 -0
  635. package/dist/cli/question.js +376 -0
  636. package/dist/cli/question.js.map +1 -0
  637. package/dist/cli/ralph.d.ts +17 -0
  638. package/dist/cli/ralph.d.ts.map +1 -0
  639. package/dist/cli/ralph.js +330 -0
  640. package/dist/cli/ralph.js.map +1 -0
  641. package/dist/cli/session-search.d.ts +8 -0
  642. package/dist/cli/session-search.d.ts.map +1 -0
  643. package/dist/cli/session-search.js +133 -0
  644. package/dist/cli/session-search.js.map +1 -0
  645. package/dist/cli/setup-preferences.d.ts +26 -0
  646. package/dist/cli/setup-preferences.d.ts.map +1 -0
  647. package/dist/cli/setup-preferences.js +82 -0
  648. package/dist/cli/setup-preferences.js.map +1 -0
  649. package/dist/cli/setup.d.ts +60 -0
  650. package/dist/cli/setup.d.ts.map +1 -0
  651. package/dist/cli/setup.js +2748 -0
  652. package/dist/cli/setup.js.map +1 -0
  653. package/dist/cli/sparkshell.d.ts +39 -0
  654. package/dist/cli/sparkshell.d.ts.map +1 -0
  655. package/dist/cli/sparkshell.js +299 -0
  656. package/dist/cli/sparkshell.js.map +1 -0
  657. package/dist/cli/star-prompt.d.ts +31 -0
  658. package/dist/cli/star-prompt.d.ts.map +1 -0
  659. package/dist/cli/star-prompt.js +97 -0
  660. package/dist/cli/star-prompt.js.map +1 -0
  661. package/dist/cli/state.d.ts +8 -0
  662. package/dist/cli/state.d.ts.map +1 -0
  663. package/dist/cli/state.js +149 -0
  664. package/dist/cli/state.js.map +1 -0
  665. package/dist/cli/team.d.ts +49 -0
  666. package/dist/cli/team.d.ts.map +1 -0
  667. package/dist/cli/team.js +1453 -0
  668. package/dist/cli/team.js.map +1 -0
  669. package/dist/cli/tmux-hook.d.ts +3 -0
  670. package/dist/cli/tmux-hook.d.ts.map +1 -0
  671. package/dist/cli/tmux-hook.js +403 -0
  672. package/dist/cli/tmux-hook.js.map +1 -0
  673. package/dist/cli/ultragoal.d.ts +3 -0
  674. package/dist/cli/ultragoal.d.ts.map +1 -0
  675. package/dist/cli/ultragoal.js +494 -0
  676. package/dist/cli/ultragoal.js.map +1 -0
  677. package/dist/cli/uninstall.d.ts +15 -0
  678. package/dist/cli/uninstall.d.ts.map +1 -0
  679. package/dist/cli/uninstall.js +476 -0
  680. package/dist/cli/uninstall.js.map +1 -0
  681. package/dist/cli/update.d.ts +86 -0
  682. package/dist/cli/update.d.ts.map +1 -0
  683. package/dist/cli/update.js +754 -0
  684. package/dist/cli/update.js.map +1 -0
  685. package/dist/cli/version.d.ts +2 -0
  686. package/dist/cli/version.d.ts.map +1 -0
  687. package/dist/cli/version.js +13 -0
  688. package/dist/cli/version.js.map +1 -0
  689. package/dist/compat/__tests__/doctor-contract.test.d.ts +2 -0
  690. package/dist/compat/__tests__/doctor-contract.test.d.ts.map +1 -0
  691. package/dist/compat/__tests__/doctor-contract.test.js +122 -0
  692. package/dist/compat/__tests__/doctor-contract.test.js.map +1 -0
  693. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts +2 -0
  694. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts.map +1 -0
  695. package/dist/compat/__tests__/rust-runtime-compat.test.js +218 -0
  696. package/dist/compat/__tests__/rust-runtime-compat.test.js.map +1 -0
  697. package/dist/config/__tests__/codex-feature-flags.test.d.ts +2 -0
  698. package/dist/config/__tests__/codex-feature-flags.test.d.ts.map +1 -0
  699. package/dist/config/__tests__/codex-feature-flags.test.js +45 -0
  700. package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -0
  701. package/dist/config/__tests__/codex-hooks.test.d.ts +2 -0
  702. package/dist/config/__tests__/codex-hooks.test.d.ts.map +1 -0
  703. package/dist/config/__tests__/codex-hooks.test.js +524 -0
  704. package/dist/config/__tests__/codex-hooks.test.js.map +1 -0
  705. package/dist/config/__tests__/commit-lore-guard.test.d.ts +2 -0
  706. package/dist/config/__tests__/commit-lore-guard.test.d.ts.map +1 -0
  707. package/dist/config/__tests__/commit-lore-guard.test.js +20 -0
  708. package/dist/config/__tests__/commit-lore-guard.test.js.map +1 -0
  709. package/dist/config/__tests__/deep-interview.test.d.ts +2 -0
  710. package/dist/config/__tests__/deep-interview.test.d.ts.map +1 -0
  711. package/dist/config/__tests__/deep-interview.test.js +240 -0
  712. package/dist/config/__tests__/deep-interview.test.js.map +1 -0
  713. package/dist/config/__tests__/generator-idempotent.test.d.ts +2 -0
  714. package/dist/config/__tests__/generator-idempotent.test.d.ts.map +1 -0
  715. package/dist/config/__tests__/generator-idempotent.test.js +1150 -0
  716. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -0
  717. package/dist/config/__tests__/generator-notify.test.d.ts +2 -0
  718. package/dist/config/__tests__/generator-notify.test.d.ts.map +1 -0
  719. package/dist/config/__tests__/generator-notify.test.js +512 -0
  720. package/dist/config/__tests__/generator-notify.test.js.map +1 -0
  721. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
  722. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
  723. package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
  724. package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
  725. package/dist/config/__tests__/mcp-registry.test.d.ts +2 -0
  726. package/dist/config/__tests__/mcp-registry.test.d.ts.map +1 -0
  727. package/dist/config/__tests__/mcp-registry.test.js +190 -0
  728. package/dist/config/__tests__/mcp-registry.test.js.map +1 -0
  729. package/dist/config/__tests__/models.test.d.ts +2 -0
  730. package/dist/config/__tests__/models.test.d.ts.map +1 -0
  731. package/dist/config/__tests__/models.test.js +241 -0
  732. package/dist/config/__tests__/models.test.js.map +1 -0
  733. package/dist/config/__tests__/wiki-config-contract.test.d.ts +2 -0
  734. package/dist/config/__tests__/wiki-config-contract.test.d.ts.map +1 -0
  735. package/dist/config/__tests__/wiki-config-contract.test.js +23 -0
  736. package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -0
  737. package/dist/config/codex-feature-flags.d.ts +25 -0
  738. package/dist/config/codex-feature-flags.d.ts.map +1 -0
  739. package/dist/config/codex-feature-flags.js +60 -0
  740. package/dist/config/codex-feature-flags.js.map +1 -0
  741. package/dist/config/codex-hooks.d.ts +79 -0
  742. package/dist/config/codex-hooks.d.ts.map +1 -0
  743. package/dist/config/codex-hooks.js +578 -0
  744. package/dist/config/codex-hooks.js.map +1 -0
  745. package/dist/config/commit-lore-guard.d.ts +4 -0
  746. package/dist/config/commit-lore-guard.d.ts.map +1 -0
  747. package/dist/config/commit-lore-guard.js +35 -0
  748. package/dist/config/commit-lore-guard.js.map +1 -0
  749. package/dist/config/deep-interview.d.ts +22 -0
  750. package/dist/config/deep-interview.d.ts.map +1 -0
  751. package/dist/config/deep-interview.js +161 -0
  752. package/dist/config/deep-interview.js.map +1 -0
  753. package/dist/config/generator.d.ts +141 -0
  754. package/dist/config/generator.d.ts.map +1 -0
  755. package/dist/config/generator.js +1845 -0
  756. package/dist/config/generator.js.map +1 -0
  757. package/dist/config/mcp-registry.d.ts +35 -0
  758. package/dist/config/mcp-registry.d.ts.map +1 -0
  759. package/dist/config/mcp-registry.js +159 -0
  760. package/dist/config/mcp-registry.js.map +1 -0
  761. package/dist/config/models.d.ts +80 -0
  762. package/dist/config/models.d.ts.map +1 -0
  763. package/dist/config/models.js +251 -0
  764. package/dist/config/models.js.map +1 -0
  765. package/dist/config/omx-first-party-mcp.d.ts +21 -0
  766. package/dist/config/omx-first-party-mcp.d.ts.map +1 -0
  767. package/dist/config/omx-first-party-mcp.js +86 -0
  768. package/dist/config/omx-first-party-mcp.js.map +1 -0
  769. package/dist/config/team-mode.d.ts +12 -0
  770. package/dist/config/team-mode.d.ts.map +1 -0
  771. package/dist/config/team-mode.js +91 -0
  772. package/dist/config/team-mode.js.map +1 -0
  773. package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
  774. package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
  775. package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
  776. package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
  777. package/dist/document-refresh/config.d.ts +9 -0
  778. package/dist/document-refresh/config.d.ts.map +1 -0
  779. package/dist/document-refresh/config.js +70 -0
  780. package/dist/document-refresh/config.js.map +1 -0
  781. package/dist/document-refresh/enforcer.d.ts +43 -0
  782. package/dist/document-refresh/enforcer.d.ts.map +1 -0
  783. package/dist/document-refresh/enforcer.js +329 -0
  784. package/dist/document-refresh/enforcer.js.map +1 -0
  785. package/dist/exec/followup.d.ts +45 -0
  786. package/dist/exec/followup.d.ts.map +1 -0
  787. package/dist/exec/followup.js +355 -0
  788. package/dist/exec/followup.js.map +1 -0
  789. package/dist/goal-workflows/__tests__/artifacts.test.d.ts +2 -0
  790. package/dist/goal-workflows/__tests__/artifacts.test.d.ts.map +1 -0
  791. package/dist/goal-workflows/__tests__/artifacts.test.js +96 -0
  792. package/dist/goal-workflows/__tests__/artifacts.test.js.map +1 -0
  793. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts +2 -0
  794. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts.map +1 -0
  795. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +75 -0
  796. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -0
  797. package/dist/goal-workflows/artifacts.d.ts +62 -0
  798. package/dist/goal-workflows/artifacts.d.ts.map +1 -0
  799. package/dist/goal-workflows/artifacts.js +132 -0
  800. package/dist/goal-workflows/artifacts.js.map +1 -0
  801. package/dist/goal-workflows/codex-goal-snapshot.d.ts +32 -0
  802. package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -0
  803. package/dist/goal-workflows/codex-goal-snapshot.js +157 -0
  804. package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -0
  805. package/dist/goal-workflows/handoff.d.ts +10 -0
  806. package/dist/goal-workflows/handoff.d.ts.map +1 -0
  807. package/dist/goal-workflows/handoff.js +31 -0
  808. package/dist/goal-workflows/handoff.js.map +1 -0
  809. package/dist/goal-workflows/validation.d.ts +13 -0
  810. package/dist/goal-workflows/validation.d.ts.map +1 -0
  811. package/dist/goal-workflows/validation.js +36 -0
  812. package/dist/goal-workflows/validation.js.map +1 -0
  813. package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
  814. package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
  815. package/dist/hooks/__tests__/agents-overlay.test.js +761 -0
  816. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
  817. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts +2 -0
  818. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts.map +1 -0
  819. package/dist/hooks/__tests__/analyze-routing-contract.test.js +45 -0
  820. package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +1 -0
  821. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts +2 -0
  822. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts.map +1 -0
  823. package/dist/hooks/__tests__/analyze-skill-contract.test.js +48 -0
  824. package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -0
  825. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts +2 -0
  826. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts.map +1 -0
  827. package/dist/hooks/__tests__/anti-slop-workflow.test.js +165 -0
  828. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -0
  829. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +2 -0
  830. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +1 -0
  831. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +90 -0
  832. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -0
  833. package/dist/hooks/__tests__/best-practice-research-skill.test.d.ts +2 -0
  834. package/dist/hooks/__tests__/best-practice-research-skill.test.d.ts.map +1 -0
  835. package/dist/hooks/__tests__/best-practice-research-skill.test.js +39 -0
  836. package/dist/hooks/__tests__/best-practice-research-skill.test.js.map +1 -0
  837. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts +2 -0
  838. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts.map +1 -0
  839. package/dist/hooks/__tests__/clawhip-event-contract.test.js +37 -0
  840. package/dist/hooks/__tests__/clawhip-event-contract.test.js.map +1 -0
  841. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +2 -0
  842. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +1 -0
  843. package/dist/hooks/__tests__/code-review-skill-contract.test.js +77 -0
  844. package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -0
  845. package/dist/hooks/__tests__/codebase-map.test.d.ts +8 -0
  846. package/dist/hooks/__tests__/codebase-map.test.d.ts.map +1 -0
  847. package/dist/hooks/__tests__/codebase-map.test.js +218 -0
  848. package/dist/hooks/__tests__/codebase-map.test.js.map +1 -0
  849. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +18 -0
  850. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -0
  851. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +266 -0
  852. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -0
  853. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts +2 -0
  854. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts.map +1 -0
  855. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +20 -0
  856. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +1 -0
  857. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts +2 -0
  858. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts.map +1 -0
  859. package/dist/hooks/__tests__/deep-interview-contract.test.js +309 -0
  860. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -0
  861. package/dist/hooks/__tests__/design-skill.test.d.ts +2 -0
  862. package/dist/hooks/__tests__/design-skill.test.d.ts.map +1 -0
  863. package/dist/hooks/__tests__/design-skill.test.js +55 -0
  864. package/dist/hooks/__tests__/design-skill.test.js.map +1 -0
  865. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +2 -0
  866. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +1 -0
  867. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +43 -0
  868. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +1 -0
  869. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +2 -0
  870. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +1 -0
  871. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +38 -0
  872. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +1 -0
  873. package/dist/hooks/__tests__/explore-routing.test.d.ts +2 -0
  874. package/dist/hooks/__tests__/explore-routing.test.d.ts.map +1 -0
  875. package/dist/hooks/__tests__/explore-routing.test.js +38 -0
  876. package/dist/hooks/__tests__/explore-routing.test.js.map +1 -0
  877. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts +2 -0
  878. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts.map +1 -0
  879. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +67 -0
  880. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -0
  881. package/dist/hooks/__tests__/foreground-isolation-contract.test.d.ts +2 -0
  882. package/dist/hooks/__tests__/foreground-isolation-contract.test.d.ts.map +1 -0
  883. package/dist/hooks/__tests__/foreground-isolation-contract.test.js +28 -0
  884. package/dist/hooks/__tests__/foreground-isolation-contract.test.js.map +1 -0
  885. package/dist/hooks/__tests__/keyword-detector.test.d.ts +2 -0
  886. package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +1 -0
  887. package/dist/hooks/__tests__/keyword-detector.test.js +3323 -0
  888. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -0
  889. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts +2 -0
  890. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts.map +1 -0
  891. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +3956 -0
  892. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -0
  893. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts +2 -0
  894. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts.map +1 -0
  895. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +786 -0
  896. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -0
  897. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts +2 -0
  898. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts.map +1 -0
  899. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +2602 -0
  900. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -0
  901. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts +2 -0
  902. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts.map +1 -0
  903. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +161 -0
  904. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -0
  905. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts +2 -0
  906. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts.map +1 -0
  907. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +1178 -0
  908. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -0
  909. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts +9 -0
  910. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts.map +1 -0
  911. package/dist/hooks/__tests__/notify-hook-modules.test.js +529 -0
  912. package/dist/hooks/__tests__/notify-hook-modules.test.js.map +1 -0
  913. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts +2 -0
  914. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts.map +1 -0
  915. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js +14 -0
  916. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js.map +1 -0
  917. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts +2 -0
  918. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts.map +1 -0
  919. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js +176 -0
  920. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js.map +1 -0
  921. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts +2 -0
  922. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts.map +1 -0
  923. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +890 -0
  924. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -0
  925. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts +9 -0
  926. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts.map +1 -0
  927. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +255 -0
  928. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -0
  929. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts +2 -0
  930. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts.map +1 -0
  931. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +162 -0
  932. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +1 -0
  933. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts +2 -0
  934. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts.map +1 -0
  935. package/dist/hooks/__tests__/notify-hook-session-scope.test.js +304 -0
  936. package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -0
  937. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts +2 -0
  938. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts.map +1 -0
  939. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +1511 -0
  940. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -0
  941. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +2 -0
  942. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +1 -0
  943. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +2911 -0
  944. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -0
  945. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts +2 -0
  946. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts.map +1 -0
  947. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +261 -0
  948. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -0
  949. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
  950. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
  951. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
  952. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
  953. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts +2 -0
  954. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts.map +1 -0
  955. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +1854 -0
  956. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -0
  957. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts +10 -0
  958. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts.map +1 -0
  959. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
  960. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -0
  961. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts +11 -0
  962. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts.map +1 -0
  963. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js +266 -0
  964. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +1 -0
  965. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts +2 -0
  966. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts.map +1 -0
  967. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +895 -0
  968. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -0
  969. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts +2 -0
  970. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts.map +1 -0
  971. package/dist/hooks/__tests__/openclaw-setup-contract.test.js +61 -0
  972. package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +1 -0
  973. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts +2 -0
  974. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts.map +1 -0
  975. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +40 -0
  976. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -0
  977. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +2 -0
  978. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +1 -0
  979. package/dist/hooks/__tests__/prometheus-strict-contract.test.js +320 -0
  980. package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +1 -0
  981. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts +2 -0
  982. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts.map +1 -0
  983. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +11 -0
  984. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +1 -0
  985. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts +2 -0
  986. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts.map +1 -0
  987. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +38 -0
  988. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -0
  989. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +2 -0
  990. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +1 -0
  991. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +48 -0
  992. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -0
  993. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts +2 -0
  994. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts.map +1 -0
  995. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +11 -0
  996. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +1 -0
  997. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +5 -0
  998. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -0
  999. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +34 -0
  1000. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -0
  1001. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts +2 -0
  1002. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts.map +1 -0
  1003. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +81 -0
  1004. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -0
  1005. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +2 -0
  1006. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +1 -0
  1007. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +38 -0
  1008. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -0
  1009. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
  1010. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
  1011. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
  1012. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
  1013. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts +2 -0
  1014. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts.map +1 -0
  1015. package/dist/hooks/__tests__/prompt-team-routing.test.js +49 -0
  1016. package/dist/hooks/__tests__/prompt-team-routing.test.js.map +1 -0
  1017. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts +2 -0
  1018. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts.map +1 -0
  1019. package/dist/hooks/__tests__/research-workflow-boundaries.test.js +35 -0
  1020. package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -0
  1021. package/dist/hooks/__tests__/session.test.d.ts +2 -0
  1022. package/dist/hooks/__tests__/session.test.d.ts.map +1 -0
  1023. package/dist/hooks/__tests__/session.test.js +504 -0
  1024. package/dist/hooks/__tests__/session.test.js.map +1 -0
  1025. package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts +2 -0
  1026. package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts.map +1 -0
  1027. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +84 -0
  1028. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -0
  1029. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts +2 -0
  1030. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts.map +1 -0
  1031. package/dist/hooks/__tests__/skill-guidance-contract.test.js +89 -0
  1032. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -0
  1033. package/dist/hooks/__tests__/task-size-detector.test.d.ts +2 -0
  1034. package/dist/hooks/__tests__/task-size-detector.test.d.ts.map +1 -0
  1035. package/dist/hooks/__tests__/task-size-detector.test.js +330 -0
  1036. package/dist/hooks/__tests__/task-size-detector.test.js.map +1 -0
  1037. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
  1038. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
  1039. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
  1040. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
  1041. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts +2 -0
  1042. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts.map +1 -0
  1043. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js +24 -0
  1044. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js.map +1 -0
  1045. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts +2 -0
  1046. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts.map +1 -0
  1047. package/dist/hooks/__tests__/tmux-hook-engine.test.js +403 -0
  1048. package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -0
  1049. package/dist/hooks/__tests__/triage-config.test.d.ts +2 -0
  1050. package/dist/hooks/__tests__/triage-config.test.d.ts.map +1 -0
  1051. package/dist/hooks/__tests__/triage-config.test.js +211 -0
  1052. package/dist/hooks/__tests__/triage-config.test.js.map +1 -0
  1053. package/dist/hooks/__tests__/triage-heuristic.test.d.ts +2 -0
  1054. package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +1 -0
  1055. package/dist/hooks/__tests__/triage-heuristic.test.js +285 -0
  1056. package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -0
  1057. package/dist/hooks/__tests__/triage-state.test.d.ts +2 -0
  1058. package/dist/hooks/__tests__/triage-state.test.d.ts.map +1 -0
  1059. package/dist/hooks/__tests__/triage-state.test.js +426 -0
  1060. package/dist/hooks/__tests__/triage-state.test.js.map +1 -0
  1061. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
  1062. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
  1063. package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
  1064. package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
  1065. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts +2 -0
  1066. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts.map +1 -0
  1067. package/dist/hooks/__tests__/visual-verdict-loop.test.js +31 -0
  1068. package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -0
  1069. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts +2 -0
  1070. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts.map +1 -0
  1071. package/dist/hooks/__tests__/wiki-docs-contract.test.js +35 -0
  1072. package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -0
  1073. package/dist/hooks/agents-overlay.d.ts +51 -0
  1074. package/dist/hooks/agents-overlay.d.ts.map +1 -0
  1075. package/dist/hooks/agents-overlay.js +547 -0
  1076. package/dist/hooks/agents-overlay.js.map +1 -0
  1077. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts +2 -0
  1078. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts.map +1 -0
  1079. package/dist/hooks/code-simplifier/__tests__/index.test.js +187 -0
  1080. package/dist/hooks/code-simplifier/__tests__/index.test.js.map +1 -0
  1081. package/dist/hooks/code-simplifier/index.d.ts +80 -0
  1082. package/dist/hooks/code-simplifier/index.d.ts.map +1 -0
  1083. package/dist/hooks/code-simplifier/index.js +172 -0
  1084. package/dist/hooks/code-simplifier/index.js.map +1 -0
  1085. package/dist/hooks/codebase-map.d.ts +23 -0
  1086. package/dist/hooks/codebase-map.d.ts.map +1 -0
  1087. package/dist/hooks/codebase-map.js +234 -0
  1088. package/dist/hooks/codebase-map.js.map +1 -0
  1089. package/dist/hooks/deep-interview-config-instruction.d.ts +3 -0
  1090. package/dist/hooks/deep-interview-config-instruction.d.ts.map +1 -0
  1091. package/dist/hooks/deep-interview-config-instruction.js +47 -0
  1092. package/dist/hooks/deep-interview-config-instruction.js.map +1 -0
  1093. package/dist/hooks/explore-routing.d.ts +5 -0
  1094. package/dist/hooks/explore-routing.d.ts.map +1 -0
  1095. package/dist/hooks/explore-routing.js +37 -0
  1096. package/dist/hooks/explore-routing.js.map +1 -0
  1097. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts +2 -0
  1098. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts.map +1 -0
  1099. package/dist/hooks/extensibility/__tests__/dispatcher.test.js +265 -0
  1100. package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -0
  1101. package/dist/hooks/extensibility/__tests__/events.test.d.ts +2 -0
  1102. package/dist/hooks/extensibility/__tests__/events.test.d.ts.map +1 -0
  1103. package/dist/hooks/extensibility/__tests__/events.test.js +125 -0
  1104. package/dist/hooks/extensibility/__tests__/events.test.js.map +1 -0
  1105. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts +2 -0
  1106. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts.map +1 -0
  1107. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js +153 -0
  1108. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js.map +1 -0
  1109. package/dist/hooks/extensibility/__tests__/loader.test.d.ts +2 -0
  1110. package/dist/hooks/extensibility/__tests__/loader.test.d.ts.map +1 -0
  1111. package/dist/hooks/extensibility/__tests__/loader.test.js +254 -0
  1112. package/dist/hooks/extensibility/__tests__/loader.test.js.map +1 -0
  1113. package/dist/hooks/extensibility/__tests__/logging.test.d.ts +2 -0
  1114. package/dist/hooks/extensibility/__tests__/logging.test.d.ts.map +1 -0
  1115. package/dist/hooks/extensibility/__tests__/logging.test.js +74 -0
  1116. package/dist/hooks/extensibility/__tests__/logging.test.js.map +1 -0
  1117. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts +2 -0
  1118. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts.map +1 -0
  1119. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +344 -0
  1120. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +1 -0
  1121. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts +2 -0
  1122. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts.map +1 -0
  1123. package/dist/hooks/extensibility/__tests__/runtime.test.js +198 -0
  1124. package/dist/hooks/extensibility/__tests__/runtime.test.js.map +1 -0
  1125. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts +2 -0
  1126. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts.map +1 -0
  1127. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js +32 -0
  1128. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js.map +1 -0
  1129. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts +2 -0
  1130. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts.map +1 -0
  1131. package/dist/hooks/extensibility/__tests__/sdk.test.js +479 -0
  1132. package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -0
  1133. package/dist/hooks/extensibility/dispatcher.d.ts +4 -0
  1134. package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -0
  1135. package/dist/hooks/extensibility/dispatcher.js +302 -0
  1136. package/dist/hooks/extensibility/dispatcher.js.map +1 -0
  1137. package/dist/hooks/extensibility/events.d.ts +18 -0
  1138. package/dist/hooks/extensibility/events.d.ts.map +1 -0
  1139. package/dist/hooks/extensibility/events.js +53 -0
  1140. package/dist/hooks/extensibility/events.js.map +1 -0
  1141. package/dist/hooks/extensibility/index.d.ts +6 -0
  1142. package/dist/hooks/extensibility/index.d.ts.map +1 -0
  1143. package/dist/hooks/extensibility/index.js +6 -0
  1144. package/dist/hooks/extensibility/index.js.map +1 -0
  1145. package/dist/hooks/extensibility/loader.d.ts +14 -0
  1146. package/dist/hooks/extensibility/loader.d.ts.map +1 -0
  1147. package/dist/hooks/extensibility/loader.js +117 -0
  1148. package/dist/hooks/extensibility/loader.js.map +1 -0
  1149. package/dist/hooks/extensibility/logging.d.ts +4 -0
  1150. package/dist/hooks/extensibility/logging.d.ts.map +1 -0
  1151. package/dist/hooks/extensibility/logging.js +22 -0
  1152. package/dist/hooks/extensibility/logging.js.map +1 -0
  1153. package/dist/hooks/extensibility/plugin-runner-stdin.d.ts +2 -0
  1154. package/dist/hooks/extensibility/plugin-runner-stdin.d.ts.map +1 -0
  1155. package/dist/hooks/extensibility/plugin-runner-stdin.js +16 -0
  1156. package/dist/hooks/extensibility/plugin-runner-stdin.js.map +1 -0
  1157. package/dist/hooks/extensibility/plugin-runner.d.ts +2 -0
  1158. package/dist/hooks/extensibility/plugin-runner.d.ts.map +1 -0
  1159. package/dist/hooks/extensibility/plugin-runner.js +63 -0
  1160. package/dist/hooks/extensibility/plugin-runner.js.map +1 -0
  1161. package/dist/hooks/extensibility/runtime.d.ts +3 -0
  1162. package/dist/hooks/extensibility/runtime.d.ts.map +1 -0
  1163. package/dist/hooks/extensibility/runtime.js +42 -0
  1164. package/dist/hooks/extensibility/runtime.js.map +1 -0
  1165. package/dist/hooks/extensibility/sdk/logging.d.ts +6 -0
  1166. package/dist/hooks/extensibility/sdk/logging.d.ts.map +1 -0
  1167. package/dist/hooks/extensibility/sdk/logging.js +32 -0
  1168. package/dist/hooks/extensibility/sdk/logging.js.map +1 -0
  1169. package/dist/hooks/extensibility/sdk/paths.d.ts +7 -0
  1170. package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -0
  1171. package/dist/hooks/extensibility/sdk/paths.js +23 -0
  1172. package/dist/hooks/extensibility/sdk/paths.js.map +1 -0
  1173. package/dist/hooks/extensibility/sdk/plugin-state.d.ts +5 -0
  1174. package/dist/hooks/extensibility/sdk/plugin-state.d.ts.map +1 -0
  1175. package/dist/hooks/extensibility/sdk/plugin-state.js +66 -0
  1176. package/dist/hooks/extensibility/sdk/plugin-state.js.map +1 -0
  1177. package/dist/hooks/extensibility/sdk/runtime-state.d.ts +3 -0
  1178. package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -0
  1179. package/dist/hooks/extensibility/sdk/runtime-state.js +47 -0
  1180. package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -0
  1181. package/dist/hooks/extensibility/sdk/tmux.d.ts +10 -0
  1182. package/dist/hooks/extensibility/sdk/tmux.d.ts.map +1 -0
  1183. package/dist/hooks/extensibility/sdk/tmux.js +181 -0
  1184. package/dist/hooks/extensibility/sdk/tmux.js.map +1 -0
  1185. package/dist/hooks/extensibility/sdk.d.ts +11 -0
  1186. package/dist/hooks/extensibility/sdk.d.ts.map +1 -0
  1187. package/dist/hooks/extensibility/sdk.js +21 -0
  1188. package/dist/hooks/extensibility/sdk.js.map +1 -0
  1189. package/dist/hooks/extensibility/types.d.ts +175 -0
  1190. package/dist/hooks/extensibility/types.d.ts.map +1 -0
  1191. package/dist/hooks/extensibility/types.js +2 -0
  1192. package/dist/hooks/extensibility/types.js.map +1 -0
  1193. package/dist/hooks/keyword-detector.d.ts +170 -0
  1194. package/dist/hooks/keyword-detector.d.ts.map +1 -0
  1195. package/dist/hooks/keyword-detector.js +1363 -0
  1196. package/dist/hooks/keyword-detector.js.map +1 -0
  1197. package/dist/hooks/keyword-registry.d.ts +15 -0
  1198. package/dist/hooks/keyword-registry.d.ts.map +1 -0
  1199. package/dist/hooks/keyword-registry.js +56 -0
  1200. package/dist/hooks/keyword-registry.js.map +1 -0
  1201. package/dist/hooks/prompt-guidance-contract.d.ts +20 -0
  1202. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -0
  1203. package/dist/hooks/prompt-guidance-contract.js +380 -0
  1204. package/dist/hooks/prompt-guidance-contract.js.map +1 -0
  1205. package/dist/hooks/session.d.ts +83 -0
  1206. package/dist/hooks/session.d.ts.map +1 -0
  1207. package/dist/hooks/session.js +412 -0
  1208. package/dist/hooks/session.js.map +1 -0
  1209. package/dist/hooks/task-size-detector.d.ts +72 -0
  1210. package/dist/hooks/task-size-detector.d.ts.map +1 -0
  1211. package/dist/hooks/task-size-detector.js +203 -0
  1212. package/dist/hooks/task-size-detector.js.map +1 -0
  1213. package/dist/hooks/triage-config.d.ts +33 -0
  1214. package/dist/hooks/triage-config.d.ts.map +1 -0
  1215. package/dist/hooks/triage-config.js +87 -0
  1216. package/dist/hooks/triage-config.js.map +1 -0
  1217. package/dist/hooks/triage-heuristic.d.ts +20 -0
  1218. package/dist/hooks/triage-heuristic.d.ts.map +1 -0
  1219. package/dist/hooks/triage-heuristic.js +287 -0
  1220. package/dist/hooks/triage-heuristic.js.map +1 -0
  1221. package/dist/hooks/triage-state.d.ts +63 -0
  1222. package/dist/hooks/triage-state.d.ts.map +1 -0
  1223. package/dist/hooks/triage-state.js +139 -0
  1224. package/dist/hooks/triage-state.js.map +1 -0
  1225. package/dist/hud/__tests__/authority.test.d.ts +2 -0
  1226. package/dist/hud/__tests__/authority.test.d.ts.map +1 -0
  1227. package/dist/hud/__tests__/authority.test.js +527 -0
  1228. package/dist/hud/__tests__/authority.test.js.map +1 -0
  1229. package/dist/hud/__tests__/colors.test.d.ts +2 -0
  1230. package/dist/hud/__tests__/colors.test.d.ts.map +1 -0
  1231. package/dist/hud/__tests__/colors.test.js +92 -0
  1232. package/dist/hud/__tests__/colors.test.js.map +1 -0
  1233. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +10 -0
  1234. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +1 -0
  1235. package/dist/hud/__tests__/hud-tmux-injection.test.js +185 -0
  1236. package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -0
  1237. package/dist/hud/__tests__/index.test.d.ts +2 -0
  1238. package/dist/hud/__tests__/index.test.d.ts.map +1 -0
  1239. package/dist/hud/__tests__/index.test.js +684 -0
  1240. package/dist/hud/__tests__/index.test.js.map +1 -0
  1241. package/dist/hud/__tests__/reconcile.test.d.ts +2 -0
  1242. package/dist/hud/__tests__/reconcile.test.d.ts.map +1 -0
  1243. package/dist/hud/__tests__/reconcile.test.js +1621 -0
  1244. package/dist/hud/__tests__/reconcile.test.js.map +1 -0
  1245. package/dist/hud/__tests__/render.test.d.ts +2 -0
  1246. package/dist/hud/__tests__/render.test.d.ts.map +1 -0
  1247. package/dist/hud/__tests__/render.test.js +983 -0
  1248. package/dist/hud/__tests__/render.test.js.map +1 -0
  1249. package/dist/hud/__tests__/resource-leak-watch.test.d.ts +2 -0
  1250. package/dist/hud/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  1251. package/dist/hud/__tests__/resource-leak-watch.test.js +28 -0
  1252. package/dist/hud/__tests__/resource-leak-watch.test.js.map +1 -0
  1253. package/dist/hud/__tests__/state.test.d.ts +2 -0
  1254. package/dist/hud/__tests__/state.test.d.ts.map +1 -0
  1255. package/dist/hud/__tests__/state.test.js +1212 -0
  1256. package/dist/hud/__tests__/state.test.js.map +1 -0
  1257. package/dist/hud/__tests__/tmux.test.d.ts +2 -0
  1258. package/dist/hud/__tests__/tmux.test.d.ts.map +1 -0
  1259. package/dist/hud/__tests__/tmux.test.js +679 -0
  1260. package/dist/hud/__tests__/tmux.test.js.map +1 -0
  1261. package/dist/hud/__tests__/types.test.d.ts +2 -0
  1262. package/dist/hud/__tests__/types.test.d.ts.map +1 -0
  1263. package/dist/hud/__tests__/types.test.js +79 -0
  1264. package/dist/hud/__tests__/types.test.js.map +1 -0
  1265. package/dist/hud/__tests__/watch.test.d.ts +2 -0
  1266. package/dist/hud/__tests__/watch.test.d.ts.map +1 -0
  1267. package/dist/hud/__tests__/watch.test.js +63 -0
  1268. package/dist/hud/__tests__/watch.test.js.map +1 -0
  1269. package/dist/hud/authority.d.ts +22 -0
  1270. package/dist/hud/authority.d.ts.map +1 -0
  1271. package/dist/hud/authority.js +377 -0
  1272. package/dist/hud/authority.js.map +1 -0
  1273. package/dist/hud/colors.d.ts +20 -0
  1274. package/dist/hud/colors.d.ts.map +1 -0
  1275. package/dist/hud/colors.js +60 -0
  1276. package/dist/hud/colors.js.map +1 -0
  1277. package/dist/hud/constants.d.ts +16 -0
  1278. package/dist/hud/constants.d.ts.map +1 -0
  1279. package/dist/hud/constants.js +25 -0
  1280. package/dist/hud/constants.js.map +1 -0
  1281. package/dist/hud/index.d.ts +79 -0
  1282. package/dist/hud/index.d.ts.map +1 -0
  1283. package/dist/hud/index.js +384 -0
  1284. package/dist/hud/index.js.map +1 -0
  1285. package/dist/hud/reconcile.d.ts +37 -0
  1286. package/dist/hud/reconcile.d.ts.map +1 -0
  1287. package/dist/hud/reconcile.js +326 -0
  1288. package/dist/hud/reconcile.js.map +1 -0
  1289. package/dist/hud/render.d.ts +15 -0
  1290. package/dist/hud/render.d.ts.map +1 -0
  1291. package/dist/hud/render.js +453 -0
  1292. package/dist/hud/render.js.map +1 -0
  1293. package/dist/hud/state.d.ts +27 -0
  1294. package/dist/hud/state.d.ts.map +1 -0
  1295. package/dist/hud/state.js +477 -0
  1296. package/dist/hud/state.js.map +1 -0
  1297. package/dist/hud/tmux.d.ts +87 -0
  1298. package/dist/hud/tmux.d.ts.map +1 -0
  1299. package/dist/hud/tmux.js +572 -0
  1300. package/dist/hud/tmux.js.map +1 -0
  1301. package/dist/hud/types.d.ts +165 -0
  1302. package/dist/hud/types.d.ts.map +1 -0
  1303. package/dist/hud/types.js +14 -0
  1304. package/dist/hud/types.js.map +1 -0
  1305. package/dist/imagegen/continuation.d.ts +44 -0
  1306. package/dist/imagegen/continuation.d.ts.map +1 -0
  1307. package/dist/imagegen/continuation.js +220 -0
  1308. package/dist/imagegen/continuation.js.map +1 -0
  1309. package/dist/index.d.ts +19 -0
  1310. package/dist/index.d.ts.map +1 -0
  1311. package/dist/index.js +19 -0
  1312. package/dist/index.js.map +1 -0
  1313. package/dist/mcp/__tests__/bootstrap.test.d.ts +2 -0
  1314. package/dist/mcp/__tests__/bootstrap.test.d.ts.map +1 -0
  1315. package/dist/mcp/__tests__/bootstrap.test.js +372 -0
  1316. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -0
  1317. package/dist/mcp/__tests__/code-intel-server.test.d.ts +2 -0
  1318. package/dist/mcp/__tests__/code-intel-server.test.d.ts.map +1 -0
  1319. package/dist/mcp/__tests__/code-intel-server.test.js +70 -0
  1320. package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -0
  1321. package/dist/mcp/__tests__/hermes-bridge.test.d.ts +2 -0
  1322. package/dist/mcp/__tests__/hermes-bridge.test.d.ts.map +1 -0
  1323. package/dist/mcp/__tests__/hermes-bridge.test.js +651 -0
  1324. package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -0
  1325. package/dist/mcp/__tests__/memory-server.test.d.ts +2 -0
  1326. package/dist/mcp/__tests__/memory-server.test.d.ts.map +1 -0
  1327. package/dist/mcp/__tests__/memory-server.test.js +36 -0
  1328. package/dist/mcp/__tests__/memory-server.test.js.map +1 -0
  1329. package/dist/mcp/__tests__/memory-validation.test.d.ts +2 -0
  1330. package/dist/mcp/__tests__/memory-validation.test.d.ts.map +1 -0
  1331. package/dist/mcp/__tests__/memory-validation.test.js +29 -0
  1332. package/dist/mcp/__tests__/memory-validation.test.js.map +1 -0
  1333. package/dist/mcp/__tests__/path-traversal.test.d.ts +2 -0
  1334. package/dist/mcp/__tests__/path-traversal.test.d.ts.map +1 -0
  1335. package/dist/mcp/__tests__/path-traversal.test.js +83 -0
  1336. package/dist/mcp/__tests__/path-traversal.test.js.map +1 -0
  1337. package/dist/mcp/__tests__/server-lifecycle.test.d.ts +2 -0
  1338. package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +1 -0
  1339. package/dist/mcp/__tests__/server-lifecycle.test.js +308 -0
  1340. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -0
  1341. package/dist/mcp/__tests__/state-paths.test.d.ts +2 -0
  1342. package/dist/mcp/__tests__/state-paths.test.d.ts.map +1 -0
  1343. package/dist/mcp/__tests__/state-paths.test.js +477 -0
  1344. package/dist/mcp/__tests__/state-paths.test.js.map +1 -0
  1345. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts +2 -0
  1346. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts.map +1 -0
  1347. package/dist/mcp/__tests__/state-server-ralph-phase.test.js +109 -0
  1348. package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -0
  1349. package/dist/mcp/__tests__/state-server-schema.test.d.ts +2 -0
  1350. package/dist/mcp/__tests__/state-server-schema.test.d.ts.map +1 -0
  1351. package/dist/mcp/__tests__/state-server-schema.test.js +29 -0
  1352. package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -0
  1353. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +2 -0
  1354. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +1 -0
  1355. package/dist/mcp/__tests__/state-server-team-tools.test.js +35 -0
  1356. package/dist/mcp/__tests__/state-server-team-tools.test.js.map +1 -0
  1357. package/dist/mcp/__tests__/state-server.test.d.ts +2 -0
  1358. package/dist/mcp/__tests__/state-server.test.d.ts.map +1 -0
  1359. package/dist/mcp/__tests__/state-server.test.js +1318 -0
  1360. package/dist/mcp/__tests__/state-server.test.js.map +1 -0
  1361. package/dist/mcp/__tests__/trace-server.test.d.ts +2 -0
  1362. package/dist/mcp/__tests__/trace-server.test.d.ts.map +1 -0
  1363. package/dist/mcp/__tests__/trace-server.test.js +119 -0
  1364. package/dist/mcp/__tests__/trace-server.test.js.map +1 -0
  1365. package/dist/mcp/__tests__/wiki-server.test.d.ts +2 -0
  1366. package/dist/mcp/__tests__/wiki-server.test.d.ts.map +1 -0
  1367. package/dist/mcp/__tests__/wiki-server.test.js +126 -0
  1368. package/dist/mcp/__tests__/wiki-server.test.js.map +1 -0
  1369. package/dist/mcp/bootstrap.d.ts +44 -0
  1370. package/dist/mcp/bootstrap.d.ts.map +1 -0
  1371. package/dist/mcp/bootstrap.js +520 -0
  1372. package/dist/mcp/bootstrap.js.map +1 -0
  1373. package/dist/mcp/code-intel-server.d.ts +333 -0
  1374. package/dist/mcp/code-intel-server.d.ts.map +1 -0
  1375. package/dist/mcp/code-intel-server.js +605 -0
  1376. package/dist/mcp/code-intel-server.js.map +1 -0
  1377. package/dist/mcp/hermes-bridge.d.ts +124 -0
  1378. package/dist/mcp/hermes-bridge.d.ts.map +1 -0
  1379. package/dist/mcp/hermes-bridge.js +549 -0
  1380. package/dist/mcp/hermes-bridge.js.map +1 -0
  1381. package/dist/mcp/hermes-server.d.ts +374 -0
  1382. package/dist/mcp/hermes-server.d.ts.map +1 -0
  1383. package/dist/mcp/hermes-server.js +158 -0
  1384. package/dist/mcp/hermes-server.js.map +1 -0
  1385. package/dist/mcp/lifecycle-telemetry.d.ts +16 -0
  1386. package/dist/mcp/lifecycle-telemetry.d.ts.map +1 -0
  1387. package/dist/mcp/lifecycle-telemetry.js +95 -0
  1388. package/dist/mcp/lifecycle-telemetry.js.map +1 -0
  1389. package/dist/mcp/memory-server.d.ts +201 -0
  1390. package/dist/mcp/memory-server.d.ts.map +1 -0
  1391. package/dist/mcp/memory-server.js +441 -0
  1392. package/dist/mcp/memory-server.js.map +1 -0
  1393. package/dist/mcp/memory-validation.d.ts +9 -0
  1394. package/dist/mcp/memory-validation.d.ts.map +1 -0
  1395. package/dist/mcp/memory-validation.js +11 -0
  1396. package/dist/mcp/memory-validation.js.map +1 -0
  1397. package/dist/mcp/state-paths.d.ts +91 -0
  1398. package/dist/mcp/state-paths.d.ts.map +1 -0
  1399. package/dist/mcp/state-paths.js +473 -0
  1400. package/dist/mcp/state-paths.js.map +1 -0
  1401. package/dist/mcp/state-server.d.ts +222 -0
  1402. package/dist/mcp/state-server.d.ts.map +1 -0
  1403. package/dist/mcp/state-server.js +181 -0
  1404. package/dist/mcp/state-server.js.map +1 -0
  1405. package/dist/mcp/trace-server.d.ts +81 -0
  1406. package/dist/mcp/trace-server.d.ts.map +1 -0
  1407. package/dist/mcp/trace-server.js +271 -0
  1408. package/dist/mcp/trace-server.js.map +1 -0
  1409. package/dist/mcp/wiki-server.d.ts +181 -0
  1410. package/dist/mcp/wiki-server.d.ts.map +1 -0
  1411. package/dist/mcp/wiki-server.js +244 -0
  1412. package/dist/mcp/wiki-server.js.map +1 -0
  1413. package/dist/modes/__tests__/base-autopilot-gates.test.d.ts +2 -0
  1414. package/dist/modes/__tests__/base-autopilot-gates.test.d.ts.map +1 -0
  1415. package/dist/modes/__tests__/base-autopilot-gates.test.js +154 -0
  1416. package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -0
  1417. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts +2 -0
  1418. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts.map +1 -0
  1419. package/dist/modes/__tests__/base-autoresearch-contract.test.js +129 -0
  1420. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -0
  1421. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts +2 -0
  1422. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts.map +1 -0
  1423. package/dist/modes/__tests__/base-multi-state-compat.test.js +38 -0
  1424. package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -0
  1425. package/dist/modes/__tests__/base-ralph-contract.test.d.ts +2 -0
  1426. package/dist/modes/__tests__/base-ralph-contract.test.d.ts.map +1 -0
  1427. package/dist/modes/__tests__/base-ralph-contract.test.js +64 -0
  1428. package/dist/modes/__tests__/base-ralph-contract.test.js.map +1 -0
  1429. package/dist/modes/__tests__/base-session-scope.test.d.ts +2 -0
  1430. package/dist/modes/__tests__/base-session-scope.test.d.ts.map +1 -0
  1431. package/dist/modes/__tests__/base-session-scope.test.js +146 -0
  1432. package/dist/modes/__tests__/base-session-scope.test.js.map +1 -0
  1433. package/dist/modes/__tests__/base-tmux-pane.test.d.ts +2 -0
  1434. package/dist/modes/__tests__/base-tmux-pane.test.d.ts.map +1 -0
  1435. package/dist/modes/__tests__/base-tmux-pane.test.js +100 -0
  1436. package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -0
  1437. package/dist/modes/base.d.ts +60 -0
  1438. package/dist/modes/base.d.ts.map +1 -0
  1439. package/dist/modes/base.js +346 -0
  1440. package/dist/modes/base.js.map +1 -0
  1441. package/dist/notifications/__tests__/config.test.d.ts +2 -0
  1442. package/dist/notifications/__tests__/config.test.d.ts.map +1 -0
  1443. package/dist/notifications/__tests__/config.test.js +269 -0
  1444. package/dist/notifications/__tests__/config.test.js.map +1 -0
  1445. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts +2 -0
  1446. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts.map +1 -0
  1447. package/dist/notifications/__tests__/custom-alias-enablement.test.js +84 -0
  1448. package/dist/notifications/__tests__/custom-alias-enablement.test.js.map +1 -0
  1449. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +5 -0
  1450. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +1 -0
  1451. package/dist/notifications/__tests__/dispatch-cooldown.test.js +100 -0
  1452. package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +1 -0
  1453. package/dist/notifications/__tests__/dispatcher.test.d.ts +2 -0
  1454. package/dist/notifications/__tests__/dispatcher.test.d.ts.map +1 -0
  1455. package/dist/notifications/__tests__/dispatcher.test.js +202 -0
  1456. package/dist/notifications/__tests__/dispatcher.test.js.map +1 -0
  1457. package/dist/notifications/__tests__/formatter.test.d.ts +2 -0
  1458. package/dist/notifications/__tests__/formatter.test.d.ts.map +1 -0
  1459. package/dist/notifications/__tests__/formatter.test.js +270 -0
  1460. package/dist/notifications/__tests__/formatter.test.js.map +1 -0
  1461. package/dist/notifications/__tests__/hook-config.test.d.ts +5 -0
  1462. package/dist/notifications/__tests__/hook-config.test.d.ts.map +1 -0
  1463. package/dist/notifications/__tests__/hook-config.test.js +139 -0
  1464. package/dist/notifications/__tests__/hook-config.test.js.map +1 -0
  1465. package/dist/notifications/__tests__/http-client-resource.test.d.ts +2 -0
  1466. package/dist/notifications/__tests__/http-client-resource.test.d.ts.map +1 -0
  1467. package/dist/notifications/__tests__/http-client-resource.test.js +41 -0
  1468. package/dist/notifications/__tests__/http-client-resource.test.js.map +1 -0
  1469. package/dist/notifications/__tests__/http-client.test.d.ts +2 -0
  1470. package/dist/notifications/__tests__/http-client.test.d.ts.map +1 -0
  1471. package/dist/notifications/__tests__/http-client.test.js +90 -0
  1472. package/dist/notifications/__tests__/http-client.test.js.map +1 -0
  1473. package/dist/notifications/__tests__/idle-cooldown.test.d.ts +5 -0
  1474. package/dist/notifications/__tests__/idle-cooldown.test.d.ts.map +1 -0
  1475. package/dist/notifications/__tests__/idle-cooldown.test.js +209 -0
  1476. package/dist/notifications/__tests__/idle-cooldown.test.js.map +1 -0
  1477. package/dist/notifications/__tests__/index.test.d.ts +2 -0
  1478. package/dist/notifications/__tests__/index.test.d.ts.map +1 -0
  1479. package/dist/notifications/__tests__/index.test.js +188 -0
  1480. package/dist/notifications/__tests__/index.test.js.map +1 -0
  1481. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts +2 -0
  1482. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts.map +1 -0
  1483. package/dist/notifications/__tests__/lifecycle-dedupe.test.js +86 -0
  1484. package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +1 -0
  1485. package/dist/notifications/__tests__/notifier.test.d.ts +2 -0
  1486. package/dist/notifications/__tests__/notifier.test.d.ts.map +1 -0
  1487. package/dist/notifications/__tests__/notifier.test.js +201 -0
  1488. package/dist/notifications/__tests__/notifier.test.js.map +1 -0
  1489. package/dist/notifications/__tests__/profiles.test.d.ts +2 -0
  1490. package/dist/notifications/__tests__/profiles.test.d.ts.map +1 -0
  1491. package/dist/notifications/__tests__/profiles.test.js +404 -0
  1492. package/dist/notifications/__tests__/profiles.test.js.map +1 -0
  1493. package/dist/notifications/__tests__/reply-config.test.d.ts +2 -0
  1494. package/dist/notifications/__tests__/reply-config.test.d.ts.map +1 -0
  1495. package/dist/notifications/__tests__/reply-config.test.js +79 -0
  1496. package/dist/notifications/__tests__/reply-config.test.js.map +1 -0
  1497. package/dist/notifications/__tests__/reply-listener.test.d.ts +2 -0
  1498. package/dist/notifications/__tests__/reply-listener.test.d.ts.map +1 -0
  1499. package/dist/notifications/__tests__/reply-listener.test.js +723 -0
  1500. package/dist/notifications/__tests__/reply-listener.test.js.map +1 -0
  1501. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts +2 -0
  1502. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts.map +1 -0
  1503. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +93 -0
  1504. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +1 -0
  1505. package/dist/notifications/__tests__/session-registry.test.d.ts +2 -0
  1506. package/dist/notifications/__tests__/session-registry.test.d.ts.map +1 -0
  1507. package/dist/notifications/__tests__/session-registry.test.js +234 -0
  1508. package/dist/notifications/__tests__/session-registry.test.js.map +1 -0
  1509. package/dist/notifications/__tests__/session-status.test.d.ts +2 -0
  1510. package/dist/notifications/__tests__/session-status.test.d.ts.map +1 -0
  1511. package/dist/notifications/__tests__/session-status.test.js +249 -0
  1512. package/dist/notifications/__tests__/session-status.test.js.map +1 -0
  1513. package/dist/notifications/__tests__/temp-mode.test.d.ts +2 -0
  1514. package/dist/notifications/__tests__/temp-mode.test.d.ts.map +1 -0
  1515. package/dist/notifications/__tests__/temp-mode.test.js +172 -0
  1516. package/dist/notifications/__tests__/temp-mode.test.js.map +1 -0
  1517. package/dist/notifications/__tests__/template-engine.test.d.ts +5 -0
  1518. package/dist/notifications/__tests__/template-engine.test.d.ts.map +1 -0
  1519. package/dist/notifications/__tests__/template-engine.test.js +158 -0
  1520. package/dist/notifications/__tests__/template-engine.test.js.map +1 -0
  1521. package/dist/notifications/__tests__/tmux-detector.test.d.ts +2 -0
  1522. package/dist/notifications/__tests__/tmux-detector.test.d.ts.map +1 -0
  1523. package/dist/notifications/__tests__/tmux-detector.test.js +204 -0
  1524. package/dist/notifications/__tests__/tmux-detector.test.js.map +1 -0
  1525. package/dist/notifications/__tests__/tmux.test.d.ts +2 -0
  1526. package/dist/notifications/__tests__/tmux.test.d.ts.map +1 -0
  1527. package/dist/notifications/__tests__/tmux.test.js +285 -0
  1528. package/dist/notifications/__tests__/tmux.test.js.map +1 -0
  1529. package/dist/notifications/__tests__/verbosity.test.d.ts +2 -0
  1530. package/dist/notifications/__tests__/verbosity.test.d.ts.map +1 -0
  1531. package/dist/notifications/__tests__/verbosity.test.js +257 -0
  1532. package/dist/notifications/__tests__/verbosity.test.js.map +1 -0
  1533. package/dist/notifications/config.d.ts +65 -0
  1534. package/dist/notifications/config.d.ts.map +1 -0
  1535. package/dist/notifications/config.js +615 -0
  1536. package/dist/notifications/config.js.map +1 -0
  1537. package/dist/notifications/dispatch-cooldown.d.ts +36 -0
  1538. package/dist/notifications/dispatch-cooldown.d.ts.map +1 -0
  1539. package/dist/notifications/dispatch-cooldown.js +109 -0
  1540. package/dist/notifications/dispatch-cooldown.js.map +1 -0
  1541. package/dist/notifications/dispatcher.d.ts +15 -0
  1542. package/dist/notifications/dispatcher.d.ts.map +1 -0
  1543. package/dist/notifications/dispatcher.js +385 -0
  1544. package/dist/notifications/dispatcher.js.map +1 -0
  1545. package/dist/notifications/formatter.d.ts +30 -0
  1546. package/dist/notifications/formatter.d.ts.map +1 -0
  1547. package/dist/notifications/formatter.js +234 -0
  1548. package/dist/notifications/formatter.js.map +1 -0
  1549. package/dist/notifications/hook-config-types.d.ts +43 -0
  1550. package/dist/notifications/hook-config-types.d.ts.map +1 -0
  1551. package/dist/notifications/hook-config-types.js +8 -0
  1552. package/dist/notifications/hook-config-types.js.map +1 -0
  1553. package/dist/notifications/hook-config.d.ts +40 -0
  1554. package/dist/notifications/hook-config.d.ts.map +1 -0
  1555. package/dist/notifications/hook-config.js +127 -0
  1556. package/dist/notifications/hook-config.js.map +1 -0
  1557. package/dist/notifications/http-client.d.ts +22 -0
  1558. package/dist/notifications/http-client.d.ts.map +1 -0
  1559. package/dist/notifications/http-client.js +349 -0
  1560. package/dist/notifications/http-client.js.map +1 -0
  1561. package/dist/notifications/idle-cooldown.d.ts +61 -0
  1562. package/dist/notifications/idle-cooldown.d.ts.map +1 -0
  1563. package/dist/notifications/idle-cooldown.js +207 -0
  1564. package/dist/notifications/idle-cooldown.js.map +1 -0
  1565. package/dist/notifications/index.d.ts +40 -0
  1566. package/dist/notifications/index.d.ts.map +1 -0
  1567. package/dist/notifications/index.js +228 -0
  1568. package/dist/notifications/index.js.map +1 -0
  1569. package/dist/notifications/lifecycle-dedupe.d.ts +8 -0
  1570. package/dist/notifications/lifecycle-dedupe.d.ts.map +1 -0
  1571. package/dist/notifications/lifecycle-dedupe.js +112 -0
  1572. package/dist/notifications/lifecycle-dedupe.js.map +1 -0
  1573. package/dist/notifications/notifier.d.ts +45 -0
  1574. package/dist/notifications/notifier.d.ts.map +1 -0
  1575. package/dist/notifications/notifier.js +146 -0
  1576. package/dist/notifications/notifier.js.map +1 -0
  1577. package/dist/notifications/reply-listener.d.ts +123 -0
  1578. package/dist/notifications/reply-listener.d.ts.map +1 -0
  1579. package/dist/notifications/reply-listener.js +846 -0
  1580. package/dist/notifications/reply-listener.js.map +1 -0
  1581. package/dist/notifications/session-registry.d.ts +26 -0
  1582. package/dist/notifications/session-registry.d.ts.map +1 -0
  1583. package/dist/notifications/session-registry.js +293 -0
  1584. package/dist/notifications/session-registry.js.map +1 -0
  1585. package/dist/notifications/session-status.d.ts +25 -0
  1586. package/dist/notifications/session-status.d.ts.map +1 -0
  1587. package/dist/notifications/session-status.js +202 -0
  1588. package/dist/notifications/session-status.js.map +1 -0
  1589. package/dist/notifications/temp-contract.d.ts +22 -0
  1590. package/dist/notifications/temp-contract.d.ts.map +1 -0
  1591. package/dist/notifications/temp-contract.js +147 -0
  1592. package/dist/notifications/temp-contract.js.map +1 -0
  1593. package/dist/notifications/template-engine.d.ts +34 -0
  1594. package/dist/notifications/template-engine.d.ts.map +1 -0
  1595. package/dist/notifications/template-engine.js +249 -0
  1596. package/dist/notifications/template-engine.js.map +1 -0
  1597. package/dist/notifications/tmux-detector.d.ts +59 -0
  1598. package/dist/notifications/tmux-detector.d.ts.map +1 -0
  1599. package/dist/notifications/tmux-detector.js +126 -0
  1600. package/dist/notifications/tmux-detector.js.map +1 -0
  1601. package/dist/notifications/tmux.d.ts +44 -0
  1602. package/dist/notifications/tmux.d.ts.map +1 -0
  1603. package/dist/notifications/tmux.js +293 -0
  1604. package/dist/notifications/tmux.js.map +1 -0
  1605. package/dist/notifications/types.d.ts +226 -0
  1606. package/dist/notifications/types.d.ts.map +1 -0
  1607. package/dist/notifications/types.js +9 -0
  1608. package/dist/notifications/types.js.map +1 -0
  1609. package/dist/openclaw/__tests__/config.test.d.ts +6 -0
  1610. package/dist/openclaw/__tests__/config.test.d.ts.map +1 -0
  1611. package/dist/openclaw/__tests__/config.test.js +344 -0
  1612. package/dist/openclaw/__tests__/config.test.js.map +1 -0
  1613. package/dist/openclaw/__tests__/dispatcher.test.d.ts +5 -0
  1614. package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +1 -0
  1615. package/dist/openclaw/__tests__/dispatcher.test.js +278 -0
  1616. package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -0
  1617. package/dist/openclaw/__tests__/index.test.d.ts +6 -0
  1618. package/dist/openclaw/__tests__/index.test.d.ts.map +1 -0
  1619. package/dist/openclaw/__tests__/index.test.js +382 -0
  1620. package/dist/openclaw/__tests__/index.test.js.map +1 -0
  1621. package/dist/openclaw/config.d.ts +59 -0
  1622. package/dist/openclaw/config.d.ts.map +1 -0
  1623. package/dist/openclaw/config.js +400 -0
  1624. package/dist/openclaw/config.js.map +1 -0
  1625. package/dist/openclaw/dispatcher.d.ts +75 -0
  1626. package/dist/openclaw/dispatcher.d.ts.map +1 -0
  1627. package/dist/openclaw/dispatcher.js +223 -0
  1628. package/dist/openclaw/dispatcher.js.map +1 -0
  1629. package/dist/openclaw/index.d.ts +29 -0
  1630. package/dist/openclaw/index.d.ts.map +1 -0
  1631. package/dist/openclaw/index.js +149 -0
  1632. package/dist/openclaw/index.js.map +1 -0
  1633. package/dist/openclaw/types.d.ts +123 -0
  1634. package/dist/openclaw/types.d.ts.map +1 -0
  1635. package/dist/openclaw/types.js +12 -0
  1636. package/dist/openclaw/types.js.map +1 -0
  1637. package/dist/performance-goal/artifacts.d.ts +76 -0
  1638. package/dist/performance-goal/artifacts.d.ts.map +1 -0
  1639. package/dist/performance-goal/artifacts.js +221 -0
  1640. package/dist/performance-goal/artifacts.js.map +1 -0
  1641. package/dist/pipeline/__tests__/orchestrator.test.d.ts +2 -0
  1642. package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +1 -0
  1643. package/dist/pipeline/__tests__/orchestrator.test.js +645 -0
  1644. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -0
  1645. package/dist/pipeline/__tests__/stages.test.d.ts +2 -0
  1646. package/dist/pipeline/__tests__/stages.test.d.ts.map +1 -0
  1647. package/dist/pipeline/__tests__/stages.test.js +1638 -0
  1648. package/dist/pipeline/__tests__/stages.test.js.map +1 -0
  1649. package/dist/pipeline/index.d.ts +25 -0
  1650. package/dist/pipeline/index.d.ts.map +1 -0
  1651. package/dist/pipeline/index.js +17 -0
  1652. package/dist/pipeline/index.js.map +1 -0
  1653. package/dist/pipeline/orchestrator.d.ts +52 -0
  1654. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  1655. package/dist/pipeline/orchestrator.js +392 -0
  1656. package/dist/pipeline/orchestrator.js.map +1 -0
  1657. package/dist/pipeline/review-verdict.d.ts +3 -0
  1658. package/dist/pipeline/review-verdict.d.ts.map +1 -0
  1659. package/dist/pipeline/review-verdict.js +14 -0
  1660. package/dist/pipeline/review-verdict.js.map +1 -0
  1661. package/dist/pipeline/stages/code-review.d.ts +35 -0
  1662. package/dist/pipeline/stages/code-review.d.ts.map +1 -0
  1663. package/dist/pipeline/stages/code-review.js +55 -0
  1664. package/dist/pipeline/stages/code-review.js.map +1 -0
  1665. package/dist/pipeline/stages/deep-interview.d.ts +15 -0
  1666. package/dist/pipeline/stages/deep-interview.d.ts.map +1 -0
  1667. package/dist/pipeline/stages/deep-interview.js +32 -0
  1668. package/dist/pipeline/stages/deep-interview.js.map +1 -0
  1669. package/dist/pipeline/stages/ralph-verify.d.ts +53 -0
  1670. package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -0
  1671. package/dist/pipeline/stages/ralph-verify.js +89 -0
  1672. package/dist/pipeline/stages/ralph-verify.js.map +1 -0
  1673. package/dist/pipeline/stages/ralplan.d.ts +26 -0
  1674. package/dist/pipeline/stages/ralplan.d.ts.map +1 -0
  1675. package/dist/pipeline/stages/ralplan.js +151 -0
  1676. package/dist/pipeline/stages/ralplan.js.map +1 -0
  1677. package/dist/pipeline/stages/team-exec.d.ts +52 -0
  1678. package/dist/pipeline/stages/team-exec.d.ts.map +1 -0
  1679. package/dist/pipeline/stages/team-exec.js +266 -0
  1680. package/dist/pipeline/stages/team-exec.js.map +1 -0
  1681. package/dist/pipeline/stages/ultragoal.d.ts +19 -0
  1682. package/dist/pipeline/stages/ultragoal.d.ts.map +1 -0
  1683. package/dist/pipeline/stages/ultragoal.js +38 -0
  1684. package/dist/pipeline/stages/ultragoal.js.map +1 -0
  1685. package/dist/pipeline/stages/ultraqa.d.ts +33 -0
  1686. package/dist/pipeline/stages/ultraqa.d.ts.map +1 -0
  1687. package/dist/pipeline/stages/ultraqa.js +49 -0
  1688. package/dist/pipeline/stages/ultraqa.js.map +1 -0
  1689. package/dist/pipeline/types.d.ts +124 -0
  1690. package/dist/pipeline/types.d.ts.map +1 -0
  1691. package/dist/pipeline/types.js +8 -0
  1692. package/dist/pipeline/types.js.map +1 -0
  1693. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts +2 -0
  1694. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts.map +1 -0
  1695. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +158 -0
  1696. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -0
  1697. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts +2 -0
  1698. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts.map +1 -0
  1699. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js +440 -0
  1700. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js.map +1 -0
  1701. package/dist/planning/__tests__/artifacts.test.d.ts +2 -0
  1702. package/dist/planning/__tests__/artifacts.test.d.ts.map +1 -0
  1703. package/dist/planning/__tests__/artifacts.test.js +942 -0
  1704. package/dist/planning/__tests__/artifacts.test.js.map +1 -0
  1705. package/dist/planning/__tests__/markdown-structure.test.d.ts +2 -0
  1706. package/dist/planning/__tests__/markdown-structure.test.d.ts.map +1 -0
  1707. package/dist/planning/__tests__/markdown-structure.test.js +459 -0
  1708. package/dist/planning/__tests__/markdown-structure.test.js.map +1 -0
  1709. package/dist/planning/artifact-names.d.ts +13 -0
  1710. package/dist/planning/artifact-names.d.ts.map +1 -0
  1711. package/dist/planning/artifact-names.js +108 -0
  1712. package/dist/planning/artifact-names.js.map +1 -0
  1713. package/dist/planning/artifacts.d.ts +65 -0
  1714. package/dist/planning/artifacts.d.ts.map +1 -0
  1715. package/dist/planning/artifacts.js +561 -0
  1716. package/dist/planning/artifacts.js.map +1 -0
  1717. package/dist/planning/markdown-structure.d.ts +20 -0
  1718. package/dist/planning/markdown-structure.d.ts.map +1 -0
  1719. package/dist/planning/markdown-structure.js +137 -0
  1720. package/dist/planning/markdown-structure.js.map +1 -0
  1721. package/dist/question/__tests__/client.test.d.ts +2 -0
  1722. package/dist/question/__tests__/client.test.d.ts.map +1 -0
  1723. package/dist/question/__tests__/client.test.js +90 -0
  1724. package/dist/question/__tests__/client.test.js.map +1 -0
  1725. package/dist/question/__tests__/deep-interview.test.d.ts +2 -0
  1726. package/dist/question/__tests__/deep-interview.test.d.ts.map +1 -0
  1727. package/dist/question/__tests__/deep-interview.test.js +440 -0
  1728. package/dist/question/__tests__/deep-interview.test.js.map +1 -0
  1729. package/dist/question/__tests__/policy.test.d.ts +2 -0
  1730. package/dist/question/__tests__/policy.test.d.ts.map +1 -0
  1731. package/dist/question/__tests__/policy.test.js +273 -0
  1732. package/dist/question/__tests__/policy.test.js.map +1 -0
  1733. package/dist/question/__tests__/renderer.test.d.ts +2 -0
  1734. package/dist/question/__tests__/renderer.test.d.ts.map +1 -0
  1735. package/dist/question/__tests__/renderer.test.js +1461 -0
  1736. package/dist/question/__tests__/renderer.test.js.map +1 -0
  1737. package/dist/question/__tests__/state.test.d.ts +2 -0
  1738. package/dist/question/__tests__/state.test.d.ts.map +1 -0
  1739. package/dist/question/__tests__/state.test.js +541 -0
  1740. package/dist/question/__tests__/state.test.js.map +1 -0
  1741. package/dist/question/__tests__/types.test.d.ts +2 -0
  1742. package/dist/question/__tests__/types.test.d.ts.map +1 -0
  1743. package/dist/question/__tests__/types.test.js +65 -0
  1744. package/dist/question/__tests__/types.test.js.map +1 -0
  1745. package/dist/question/__tests__/ui.test.d.ts +2 -0
  1746. package/dist/question/__tests__/ui.test.d.ts.map +1 -0
  1747. package/dist/question/__tests__/ui.test.js +483 -0
  1748. package/dist/question/__tests__/ui.test.js.map +1 -0
  1749. package/dist/question/autopilot-wait.d.ts +21 -0
  1750. package/dist/question/autopilot-wait.d.ts.map +1 -0
  1751. package/dist/question/autopilot-wait.js +251 -0
  1752. package/dist/question/autopilot-wait.js.map +1 -0
  1753. package/dist/question/client.d.ts +64 -0
  1754. package/dist/question/client.d.ts.map +1 -0
  1755. package/dist/question/client.js +77 -0
  1756. package/dist/question/client.js.map +1 -0
  1757. package/dist/question/deep-interview.d.ts +33 -0
  1758. package/dist/question/deep-interview.d.ts.map +1 -0
  1759. package/dist/question/deep-interview.js +216 -0
  1760. package/dist/question/deep-interview.js.map +1 -0
  1761. package/dist/question/events.d.ts +53 -0
  1762. package/dist/question/events.d.ts.map +1 -0
  1763. package/dist/question/events.js +201 -0
  1764. package/dist/question/events.js.map +1 -0
  1765. package/dist/question/policy.d.ts +19 -0
  1766. package/dist/question/policy.d.ts.map +1 -0
  1767. package/dist/question/policy.js +95 -0
  1768. package/dist/question/policy.js.map +1 -0
  1769. package/dist/question/renderer.d.ts +66 -0
  1770. package/dist/question/renderer.d.ts.map +1 -0
  1771. package/dist/question/renderer.js +748 -0
  1772. package/dist/question/renderer.js.map +1 -0
  1773. package/dist/question/state.d.ts +56 -0
  1774. package/dist/question/state.d.ts.map +1 -0
  1775. package/dist/question/state.js +432 -0
  1776. package/dist/question/state.js.map +1 -0
  1777. package/dist/question/types.d.ts +92 -0
  1778. package/dist/question/types.d.ts.map +1 -0
  1779. package/dist/question/types.js +117 -0
  1780. package/dist/question/types.js.map +1 -0
  1781. package/dist/question/ui.d.ts +66 -0
  1782. package/dist/question/ui.d.ts.map +1 -0
  1783. package/dist/question/ui.js +458 -0
  1784. package/dist/question/ui.js.map +1 -0
  1785. package/dist/ralph/__tests__/completion-audit.test.d.ts +2 -0
  1786. package/dist/ralph/__tests__/completion-audit.test.d.ts.map +1 -0
  1787. package/dist/ralph/__tests__/completion-audit.test.js +160 -0
  1788. package/dist/ralph/__tests__/completion-audit.test.js.map +1 -0
  1789. package/dist/ralph/__tests__/persistence.test.d.ts +2 -0
  1790. package/dist/ralph/__tests__/persistence.test.d.ts.map +1 -0
  1791. package/dist/ralph/__tests__/persistence.test.js +116 -0
  1792. package/dist/ralph/__tests__/persistence.test.js.map +1 -0
  1793. package/dist/ralph/completion-audit.d.ts +8 -0
  1794. package/dist/ralph/completion-audit.d.ts.map +1 -0
  1795. package/dist/ralph/completion-audit.js +99 -0
  1796. package/dist/ralph/completion-audit.js.map +1 -0
  1797. package/dist/ralph/contract.d.ts +17 -0
  1798. package/dist/ralph/contract.d.ts.map +1 -0
  1799. package/dist/ralph/contract.js +108 -0
  1800. package/dist/ralph/contract.js.map +1 -0
  1801. package/dist/ralph/persistence.d.ts +29 -0
  1802. package/dist/ralph/persistence.d.ts.map +1 -0
  1803. package/dist/ralph/persistence.js +273 -0
  1804. package/dist/ralph/persistence.js.map +1 -0
  1805. package/dist/ralplan/__tests__/consensus-gate.test.d.ts +2 -0
  1806. package/dist/ralplan/__tests__/consensus-gate.test.d.ts.map +1 -0
  1807. package/dist/ralplan/__tests__/consensus-gate.test.js +192 -0
  1808. package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -0
  1809. package/dist/ralplan/__tests__/runtime.test.d.ts +2 -0
  1810. package/dist/ralplan/__tests__/runtime.test.d.ts.map +1 -0
  1811. package/dist/ralplan/__tests__/runtime.test.js +548 -0
  1812. package/dist/ralplan/__tests__/runtime.test.js.map +1 -0
  1813. package/dist/ralplan/consensus-gate.d.ts +37 -0
  1814. package/dist/ralplan/consensus-gate.d.ts.map +1 -0
  1815. package/dist/ralplan/consensus-gate.js +422 -0
  1816. package/dist/ralplan/consensus-gate.js.map +1 -0
  1817. package/dist/ralplan/runtime.d.ts +86 -0
  1818. package/dist/ralplan/runtime.d.ts.map +1 -0
  1819. package/dist/ralplan/runtime.js +365 -0
  1820. package/dist/ralplan/runtime.js.map +1 -0
  1821. package/dist/runtime/__tests__/bridge.test.d.ts +2 -0
  1822. package/dist/runtime/__tests__/bridge.test.d.ts.map +1 -0
  1823. package/dist/runtime/__tests__/bridge.test.js +194 -0
  1824. package/dist/runtime/__tests__/bridge.test.js.map +1 -0
  1825. package/dist/runtime/__tests__/process-tree.test.d.ts +2 -0
  1826. package/dist/runtime/__tests__/process-tree.test.d.ts.map +1 -0
  1827. package/dist/runtime/__tests__/process-tree.test.js +107 -0
  1828. package/dist/runtime/__tests__/process-tree.test.js.map +1 -0
  1829. package/dist/runtime/__tests__/run-loop.test.d.ts +2 -0
  1830. package/dist/runtime/__tests__/run-loop.test.d.ts.map +1 -0
  1831. package/dist/runtime/__tests__/run-loop.test.js +35 -0
  1832. package/dist/runtime/__tests__/run-loop.test.js.map +1 -0
  1833. package/dist/runtime/__tests__/run-outcome.test.d.ts +2 -0
  1834. package/dist/runtime/__tests__/run-outcome.test.d.ts.map +1 -0
  1835. package/dist/runtime/__tests__/run-outcome.test.js +102 -0
  1836. package/dist/runtime/__tests__/run-outcome.test.js.map +1 -0
  1837. package/dist/runtime/__tests__/run-state.test.d.ts +2 -0
  1838. package/dist/runtime/__tests__/run-state.test.d.ts.map +1 -0
  1839. package/dist/runtime/__tests__/run-state.test.js +37 -0
  1840. package/dist/runtime/__tests__/run-state.test.js.map +1 -0
  1841. package/dist/runtime/bridge.d.ts +214 -0
  1842. package/dist/runtime/bridge.d.ts.map +1 -0
  1843. package/dist/runtime/bridge.js +223 -0
  1844. package/dist/runtime/bridge.js.map +1 -0
  1845. package/dist/runtime/process-tree.d.ts +28 -0
  1846. package/dist/runtime/process-tree.d.ts.map +1 -0
  1847. package/dist/runtime/process-tree.js +230 -0
  1848. package/dist/runtime/process-tree.js.map +1 -0
  1849. package/dist/runtime/run-loop.d.ts +45 -0
  1850. package/dist/runtime/run-loop.d.ts.map +1 -0
  1851. package/dist/runtime/run-loop.js +51 -0
  1852. package/dist/runtime/run-loop.js.map +1 -0
  1853. package/dist/runtime/run-outcome.d.ts +46 -0
  1854. package/dist/runtime/run-outcome.d.ts.map +1 -0
  1855. package/dist/runtime/run-outcome.js +285 -0
  1856. package/dist/runtime/run-outcome.js.map +1 -0
  1857. package/dist/runtime/run-state.d.ts +40 -0
  1858. package/dist/runtime/run-state.d.ts.map +1 -0
  1859. package/dist/runtime/run-state.js +120 -0
  1860. package/dist/runtime/run-state.js.map +1 -0
  1861. package/dist/runtime/terminal-lifecycle.d.ts +11 -0
  1862. package/dist/runtime/terminal-lifecycle.d.ts.map +1 -0
  1863. package/dist/runtime/terminal-lifecycle.js +52 -0
  1864. package/dist/runtime/terminal-lifecycle.js.map +1 -0
  1865. package/dist/scripts/__tests__/codex-native-hook.test.d.ts +2 -0
  1866. package/dist/scripts/__tests__/codex-native-hook.test.d.ts.map +1 -0
  1867. package/dist/scripts/__tests__/codex-native-hook.test.js +14253 -0
  1868. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -0
  1869. package/dist/scripts/__tests__/docs-site-contract.test.d.ts +2 -0
  1870. package/dist/scripts/__tests__/docs-site-contract.test.d.ts.map +1 -0
  1871. package/dist/scripts/__tests__/docs-site-contract.test.js +42 -0
  1872. package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -0
  1873. package/dist/scripts/__tests__/generate-release-body.test.d.ts +2 -0
  1874. package/dist/scripts/__tests__/generate-release-body.test.d.ts.map +1 -0
  1875. package/dist/scripts/__tests__/generate-release-body.test.js +233 -0
  1876. package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -0
  1877. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts +2 -0
  1878. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts.map +1 -0
  1879. package/dist/scripts/__tests__/hook-derived-watcher.test.js +227 -0
  1880. package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -0
  1881. package/dist/scripts/__tests__/notify-dispatcher.test.d.ts +2 -0
  1882. package/dist/scripts/__tests__/notify-dispatcher.test.d.ts.map +1 -0
  1883. package/dist/scripts/__tests__/notify-dispatcher.test.js +421 -0
  1884. package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -0
  1885. package/dist/scripts/__tests__/notify-state-io.test.d.ts +2 -0
  1886. package/dist/scripts/__tests__/notify-state-io.test.d.ts.map +1 -0
  1887. package/dist/scripts/__tests__/notify-state-io.test.js +111 -0
  1888. package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -0
  1889. package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts +2 -0
  1890. package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts.map +1 -0
  1891. package/dist/scripts/__tests__/notify-tmux-injection.test.js +57 -0
  1892. package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -0
  1893. package/dist/scripts/__tests__/postinstall.test.d.ts +2 -0
  1894. package/dist/scripts/__tests__/postinstall.test.d.ts.map +1 -0
  1895. package/dist/scripts/__tests__/postinstall.test.js +92 -0
  1896. package/dist/scripts/__tests__/postinstall.test.js.map +1 -0
  1897. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
  1898. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
  1899. package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
  1900. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
  1901. package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
  1902. package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
  1903. package/dist/scripts/__tests__/run-test-files.test.js +365 -0
  1904. package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
  1905. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts +2 -0
  1906. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts.map +1 -0
  1907. package/dist/scripts/__tests__/smoke-packed-install.test.js +160 -0
  1908. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -0
  1909. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts +2 -0
  1910. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts.map +1 -0
  1911. package/dist/scripts/__tests__/test-reply-listener-live.test.js +82 -0
  1912. package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +1 -0
  1913. package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
  1914. package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
  1915. package/dist/scripts/__tests__/verify-native-agents.test.js +246 -0
  1916. package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
  1917. package/dist/scripts/build-api.d.ts +2 -0
  1918. package/dist/scripts/build-api.d.ts.map +1 -0
  1919. package/dist/scripts/build-api.js +44 -0
  1920. package/dist/scripts/build-api.js.map +1 -0
  1921. package/dist/scripts/build-explore-harness.d.ts +3 -0
  1922. package/dist/scripts/build-explore-harness.d.ts.map +1 -0
  1923. package/dist/scripts/build-explore-harness.js +50 -0
  1924. package/dist/scripts/build-explore-harness.js.map +1 -0
  1925. package/dist/scripts/build-sparkshell.d.ts +2 -0
  1926. package/dist/scripts/build-sparkshell.d.ts.map +1 -0
  1927. package/dist/scripts/build-sparkshell.js +46 -0
  1928. package/dist/scripts/build-sparkshell.js.map +1 -0
  1929. package/dist/scripts/check-runtime-syntax.d.ts +3 -0
  1930. package/dist/scripts/check-runtime-syntax.d.ts.map +1 -0
  1931. package/dist/scripts/check-runtime-syntax.js +57 -0
  1932. package/dist/scripts/check-runtime-syntax.js.map +1 -0
  1933. package/dist/scripts/check-version-sync.d.ts +3 -0
  1934. package/dist/scripts/check-version-sync.d.ts.map +1 -0
  1935. package/dist/scripts/check-version-sync.js +53 -0
  1936. package/dist/scripts/check-version-sync.js.map +1 -0
  1937. package/dist/scripts/cleanup-explore-harness.d.ts +3 -0
  1938. package/dist/scripts/cleanup-explore-harness.d.ts.map +1 -0
  1939. package/dist/scripts/cleanup-explore-harness.js +17 -0
  1940. package/dist/scripts/cleanup-explore-harness.js.map +1 -0
  1941. package/dist/scripts/codex-execution-surface.d.ts +16 -0
  1942. package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
  1943. package/dist/scripts/codex-execution-surface.js +42 -0
  1944. package/dist/scripts/codex-execution-surface.js.map +1 -0
  1945. package/dist/scripts/codex-native-hook.d.ts +26 -0
  1946. package/dist/scripts/codex-native-hook.d.ts.map +1 -0
  1947. package/dist/scripts/codex-native-hook.js +3842 -0
  1948. package/dist/scripts/codex-native-hook.js.map +1 -0
  1949. package/dist/scripts/codex-native-pre-post.d.ts +46 -0
  1950. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -0
  1951. package/dist/scripts/codex-native-pre-post.js +1186 -0
  1952. package/dist/scripts/codex-native-pre-post.js.map +1 -0
  1953. package/dist/scripts/eval/eval-candidate-handoff.d.ts +2 -0
  1954. package/dist/scripts/eval/eval-candidate-handoff.d.ts.map +1 -0
  1955. package/dist/scripts/eval/eval-candidate-handoff.js +11 -0
  1956. package/dist/scripts/eval/eval-candidate-handoff.js.map +1 -0
  1957. package/dist/scripts/eval/eval-cli-discoverability.d.ts +3 -0
  1958. package/dist/scripts/eval/eval-cli-discoverability.d.ts.map +1 -0
  1959. package/dist/scripts/eval/eval-cli-discoverability.js +37 -0
  1960. package/dist/scripts/eval/eval-cli-discoverability.js.map +1 -0
  1961. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts +2 -0
  1962. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts.map +1 -0
  1963. package/dist/scripts/eval/eval-fresh-run-tagging.js +11 -0
  1964. package/dist/scripts/eval/eval-fresh-run-tagging.js.map +1 -0
  1965. package/dist/scripts/eval/eval-help-consistency.d.ts +2 -0
  1966. package/dist/scripts/eval/eval-help-consistency.d.ts.map +1 -0
  1967. package/dist/scripts/eval/eval-help-consistency.js +12 -0
  1968. package/dist/scripts/eval/eval-help-consistency.js.map +1 -0
  1969. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts +2 -0
  1970. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts.map +1 -0
  1971. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js +31 -0
  1972. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js.map +1 -0
  1973. package/dist/scripts/eval/eval-parity-smoke.d.ts +2 -0
  1974. package/dist/scripts/eval/eval-parity-smoke.d.ts.map +1 -0
  1975. package/dist/scripts/eval/eval-parity-smoke.js +23 -0
  1976. package/dist/scripts/eval/eval-parity-smoke.js.map +1 -0
  1977. package/dist/scripts/eval/eval-parity-sweep.d.ts +2 -0
  1978. package/dist/scripts/eval/eval-parity-sweep.d.ts.map +1 -0
  1979. package/dist/scripts/eval/eval-parity-sweep.js +29 -0
  1980. package/dist/scripts/eval/eval-parity-sweep.js.map +1 -0
  1981. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts +2 -0
  1982. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts.map +1 -0
  1983. package/dist/scripts/eval/eval-resume-dirty-guard.js +11 -0
  1984. package/dist/scripts/eval/eval-resume-dirty-guard.js.map +1 -0
  1985. package/dist/scripts/eval/eval-security-path-traversal.d.ts +3 -0
  1986. package/dist/scripts/eval/eval-security-path-traversal.d.ts.map +1 -0
  1987. package/dist/scripts/eval/eval-security-path-traversal.js +35 -0
  1988. package/dist/scripts/eval/eval-security-path-traversal.js.map +1 -0
  1989. package/dist/scripts/fixtures/ask-advisor-stub.d.ts +3 -0
  1990. package/dist/scripts/fixtures/ask-advisor-stub.d.ts.map +1 -0
  1991. package/dist/scripts/fixtures/ask-advisor-stub.js +13 -0
  1992. package/dist/scripts/fixtures/ask-advisor-stub.js.map +1 -0
  1993. package/dist/scripts/generate-catalog-docs.d.ts +3 -0
  1994. package/dist/scripts/generate-catalog-docs.d.ts.map +1 -0
  1995. package/dist/scripts/generate-catalog-docs.js +99 -0
  1996. package/dist/scripts/generate-catalog-docs.js.map +1 -0
  1997. package/dist/scripts/generate-native-release-manifest.d.ts +3 -0
  1998. package/dist/scripts/generate-native-release-manifest.d.ts.map +1 -0
  1999. package/dist/scripts/generate-native-release-manifest.js +107 -0
  2000. package/dist/scripts/generate-native-release-manifest.js.map +1 -0
  2001. package/dist/scripts/generate-release-body.d.ts +35 -0
  2002. package/dist/scripts/generate-release-body.d.ts.map +1 -0
  2003. package/dist/scripts/generate-release-body.js +278 -0
  2004. package/dist/scripts/generate-release-body.js.map +1 -0
  2005. package/dist/scripts/hook-derived-watcher.d.ts +3 -0
  2006. package/dist/scripts/hook-derived-watcher.d.ts.map +1 -0
  2007. package/dist/scripts/hook-derived-watcher.js +557 -0
  2008. package/dist/scripts/hook-derived-watcher.js.map +1 -0
  2009. package/dist/scripts/hook-payload-guard.d.ts +9 -0
  2010. package/dist/scripts/hook-payload-guard.d.ts.map +1 -0
  2011. package/dist/scripts/hook-payload-guard.js +111 -0
  2012. package/dist/scripts/hook-payload-guard.js.map +1 -0
  2013. package/dist/scripts/notify-dispatcher.d.ts +7 -0
  2014. package/dist/scripts/notify-dispatcher.d.ts.map +1 -0
  2015. package/dist/scripts/notify-dispatcher.js +359 -0
  2016. package/dist/scripts/notify-dispatcher.js.map +1 -0
  2017. package/dist/scripts/notify-fallback-watcher.d.ts +3 -0
  2018. package/dist/scripts/notify-fallback-watcher.d.ts.map +1 -0
  2019. package/dist/scripts/notify-fallback-watcher.js +1771 -0
  2020. package/dist/scripts/notify-fallback-watcher.js.map +1 -0
  2021. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts +2 -0
  2022. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts.map +1 -0
  2023. package/dist/scripts/notify-hook/__tests__/operational-events.test.js +24 -0
  2024. package/dist/scripts/notify-hook/__tests__/operational-events.test.js.map +1 -0
  2025. package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts +2 -0
  2026. package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts.map +1 -0
  2027. package/dist/scripts/notify-hook/__tests__/payload-guard.test.js +39 -0
  2028. package/dist/scripts/notify-hook/__tests__/payload-guard.test.js.map +1 -0
  2029. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
  2030. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
  2031. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
  2032. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
  2033. package/dist/scripts/notify-hook/active-team.d.ts +9 -0
  2034. package/dist/scripts/notify-hook/active-team.d.ts.map +1 -0
  2035. package/dist/scripts/notify-hook/active-team.js +45 -0
  2036. package/dist/scripts/notify-hook/active-team.js.map +1 -0
  2037. package/dist/scripts/notify-hook/auto-nudge.d.ts +96 -0
  2038. package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -0
  2039. package/dist/scripts/notify-hook/auto-nudge.js +698 -0
  2040. package/dist/scripts/notify-hook/auto-nudge.js.map +1 -0
  2041. package/dist/scripts/notify-hook/log.d.ts +6 -0
  2042. package/dist/scripts/notify-hook/log.d.ts.map +1 -0
  2043. package/dist/scripts/notify-hook/log.js +22 -0
  2044. package/dist/scripts/notify-hook/log.js.map +1 -0
  2045. package/dist/scripts/notify-hook/managed-tmux.d.ts +21 -0
  2046. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -0
  2047. package/dist/scripts/notify-hook/managed-tmux.js +541 -0
  2048. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -0
  2049. package/dist/scripts/notify-hook/operational-events.d.ts +14 -0
  2050. package/dist/scripts/notify-hook/operational-events.d.ts.map +1 -0
  2051. package/dist/scripts/notify-hook/operational-events.js +255 -0
  2052. package/dist/scripts/notify-hook/operational-events.js.map +1 -0
  2053. package/dist/scripts/notify-hook/orchestration-intent.d.ts +17 -0
  2054. package/dist/scripts/notify-hook/orchestration-intent.d.ts.map +1 -0
  2055. package/dist/scripts/notify-hook/orchestration-intent.js +71 -0
  2056. package/dist/scripts/notify-hook/orchestration-intent.js.map +1 -0
  2057. package/dist/scripts/notify-hook/payload-parser.d.ts +13 -0
  2058. package/dist/scripts/notify-hook/payload-parser.d.ts.map +1 -0
  2059. package/dist/scripts/notify-hook/payload-parser.js +134 -0
  2060. package/dist/scripts/notify-hook/payload-parser.js.map +1 -0
  2061. package/dist/scripts/notify-hook/process-runner.d.ts +9 -0
  2062. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -0
  2063. package/dist/scripts/notify-hook/process-runner.js +74 -0
  2064. package/dist/scripts/notify-hook/process-runner.js.map +1 -0
  2065. package/dist/scripts/notify-hook/ralph-session-resume.d.ts +22 -0
  2066. package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -0
  2067. package/dist/scripts/notify-hook/ralph-session-resume.js +381 -0
  2068. package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -0
  2069. package/dist/scripts/notify-hook/state-io.d.ts +21 -0
  2070. package/dist/scripts/notify-hook/state-io.d.ts.map +1 -0
  2071. package/dist/scripts/notify-hook/state-io.js +169 -0
  2072. package/dist/scripts/notify-hook/state-io.js.map +1 -0
  2073. package/dist/scripts/notify-hook/team-dispatch.d.ts +36 -0
  2074. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -0
  2075. package/dist/scripts/notify-hook/team-dispatch.js +1084 -0
  2076. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -0
  2077. package/dist/scripts/notify-hook/team-leader-nudge.d.ts +21 -0
  2078. package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -0
  2079. package/dist/scripts/notify-hook/team-leader-nudge.js +1029 -0
  2080. package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -0
  2081. package/dist/scripts/notify-hook/team-tmux-guard.d.ts +15 -0
  2082. package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -0
  2083. package/dist/scripts/notify-hook/team-tmux-guard.js +205 -0
  2084. package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -0
  2085. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
  2086. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
  2087. package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
  2088. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
  2089. package/dist/scripts/notify-hook/team-worker-stop.d.ts +15 -0
  2090. package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -0
  2091. package/dist/scripts/notify-hook/team-worker-stop.js +418 -0
  2092. package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -0
  2093. package/dist/scripts/notify-hook/team-worker.d.ts +33 -0
  2094. package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -0
  2095. package/dist/scripts/notify-hook/team-worker.js +705 -0
  2096. package/dist/scripts/notify-hook/team-worker.js.map +1 -0
  2097. package/dist/scripts/notify-hook/tmux-injection.d.ts +15 -0
  2098. package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -0
  2099. package/dist/scripts/notify-hook/tmux-injection.js +673 -0
  2100. package/dist/scripts/notify-hook/tmux-injection.js.map +1 -0
  2101. package/dist/scripts/notify-hook/utils.d.ts +9 -0
  2102. package/dist/scripts/notify-hook/utils.d.ts.map +1 -0
  2103. package/dist/scripts/notify-hook/utils.js +36 -0
  2104. package/dist/scripts/notify-hook/utils.js.map +1 -0
  2105. package/dist/scripts/notify-hook/visual-verdict.d.ts +29 -0
  2106. package/dist/scripts/notify-hook/visual-verdict.d.ts.map +1 -0
  2107. package/dist/scripts/notify-hook/visual-verdict.js +145 -0
  2108. package/dist/scripts/notify-hook/visual-verdict.js.map +1 -0
  2109. package/dist/scripts/notify-hook.d.ts +20 -0
  2110. package/dist/scripts/notify-hook.d.ts.map +1 -0
  2111. package/dist/scripts/notify-hook.js +950 -0
  2112. package/dist/scripts/notify-hook.js.map +1 -0
  2113. package/dist/scripts/postinstall.d.ts +18 -0
  2114. package/dist/scripts/postinstall.d.ts.map +1 -0
  2115. package/dist/scripts/postinstall.js +66 -0
  2116. package/dist/scripts/postinstall.js.map +1 -0
  2117. package/dist/scripts/prompt-inventory.d.ts +29 -0
  2118. package/dist/scripts/prompt-inventory.d.ts.map +1 -0
  2119. package/dist/scripts/prompt-inventory.js +178 -0
  2120. package/dist/scripts/prompt-inventory.js.map +1 -0
  2121. package/dist/scripts/run-provider-advisor.d.ts +3 -0
  2122. package/dist/scripts/run-provider-advisor.d.ts.map +1 -0
  2123. package/dist/scripts/run-provider-advisor.js +177 -0
  2124. package/dist/scripts/run-provider-advisor.js.map +1 -0
  2125. package/dist/scripts/run-test-files.d.ts +2 -0
  2126. package/dist/scripts/run-test-files.d.ts.map +1 -0
  2127. package/dist/scripts/run-test-files.js +340 -0
  2128. package/dist/scripts/run-test-files.js.map +1 -0
  2129. package/dist/scripts/smoke-packed-install.d.ts +21 -0
  2130. package/dist/scripts/smoke-packed-install.d.ts.map +1 -0
  2131. package/dist/scripts/smoke-packed-install.js +221 -0
  2132. package/dist/scripts/smoke-packed-install.js.map +1 -0
  2133. package/dist/scripts/sync-plugin-mirror.d.ts +14 -0
  2134. package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
  2135. package/dist/scripts/sync-plugin-mirror.js +306 -0
  2136. package/dist/scripts/sync-plugin-mirror.js.map +1 -0
  2137. package/dist/scripts/sync-prompt-guidance-fragments.d.ts +3 -0
  2138. package/dist/scripts/sync-prompt-guidance-fragments.d.ts.map +1 -0
  2139. package/dist/scripts/sync-prompt-guidance-fragments.js +50 -0
  2140. package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -0
  2141. package/dist/scripts/team-hardening-benchmark.d.ts +3 -0
  2142. package/dist/scripts/team-hardening-benchmark.d.ts.map +1 -0
  2143. package/dist/scripts/team-hardening-benchmark.js +91 -0
  2144. package/dist/scripts/team-hardening-benchmark.js.map +1 -0
  2145. package/dist/scripts/test-reply-listener-live.d.ts +24 -0
  2146. package/dist/scripts/test-reply-listener-live.d.ts.map +1 -0
  2147. package/dist/scripts/test-reply-listener-live.js +138 -0
  2148. package/dist/scripts/test-reply-listener-live.js.map +1 -0
  2149. package/dist/scripts/test-sparkshell.d.ts +2 -0
  2150. package/dist/scripts/test-sparkshell.d.ts.map +1 -0
  2151. package/dist/scripts/test-sparkshell.js +25 -0
  2152. package/dist/scripts/test-sparkshell.js.map +1 -0
  2153. package/dist/scripts/tmux-hook-engine.d.ts +45 -0
  2154. package/dist/scripts/tmux-hook-engine.d.ts.map +1 -0
  2155. package/dist/scripts/tmux-hook-engine.js +313 -0
  2156. package/dist/scripts/tmux-hook-engine.js.map +1 -0
  2157. package/dist/scripts/verify-native-agents.d.ts +16 -0
  2158. package/dist/scripts/verify-native-agents.d.ts.map +1 -0
  2159. package/dist/scripts/verify-native-agents.js +247 -0
  2160. package/dist/scripts/verify-native-agents.js.map +1 -0
  2161. package/dist/scripts/verify-native-release-assets.d.ts +3 -0
  2162. package/dist/scripts/verify-native-release-assets.d.ts.map +1 -0
  2163. package/dist/scripts/verify-native-release-assets.js +62 -0
  2164. package/dist/scripts/verify-native-release-assets.js.map +1 -0
  2165. package/dist/session-history/__tests__/search.test.d.ts +2 -0
  2166. package/dist/session-history/__tests__/search.test.d.ts.map +1 -0
  2167. package/dist/session-history/__tests__/search.test.js +150 -0
  2168. package/dist/session-history/__tests__/search.test.js.map +1 -0
  2169. package/dist/session-history/search.d.ts +31 -0
  2170. package/dist/session-history/search.d.ts.map +1 -0
  2171. package/dist/session-history/search.js +331 -0
  2172. package/dist/session-history/search.js.map +1 -0
  2173. package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
  2174. package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
  2175. package/dist/sidecar/__tests__/boundary.test.js +48 -0
  2176. package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
  2177. package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
  2178. package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
  2179. package/dist/sidecar/__tests__/collector.test.js +162 -0
  2180. package/dist/sidecar/__tests__/collector.test.js.map +1 -0
  2181. package/dist/sidecar/__tests__/render.test.d.ts +2 -0
  2182. package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
  2183. package/dist/sidecar/__tests__/render.test.js +67 -0
  2184. package/dist/sidecar/__tests__/render.test.js.map +1 -0
  2185. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts +2 -0
  2186. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  2187. package/dist/sidecar/__tests__/resource-leak-watch.test.js +38 -0
  2188. package/dist/sidecar/__tests__/resource-leak-watch.test.js.map +1 -0
  2189. package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
  2190. package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
  2191. package/dist/sidecar/__tests__/tmux.test.js +30 -0
  2192. package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
  2193. package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
  2194. package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
  2195. package/dist/sidecar/__tests__/watch.test.js +42 -0
  2196. package/dist/sidecar/__tests__/watch.test.js.map +1 -0
  2197. package/dist/sidecar/collector.d.ts +4 -0
  2198. package/dist/sidecar/collector.d.ts.map +1 -0
  2199. package/dist/sidecar/collector.js +377 -0
  2200. package/dist/sidecar/collector.js.map +1 -0
  2201. package/dist/sidecar/index.d.ts +25 -0
  2202. package/dist/sidecar/index.d.ts.map +1 -0
  2203. package/dist/sidecar/index.js +182 -0
  2204. package/dist/sidecar/index.js.map +1 -0
  2205. package/dist/sidecar/render.d.ts +3 -0
  2206. package/dist/sidecar/render.d.ts.map +1 -0
  2207. package/dist/sidecar/render.js +72 -0
  2208. package/dist/sidecar/render.js.map +1 -0
  2209. package/dist/sidecar/tmux.d.ts +13 -0
  2210. package/dist/sidecar/tmux.d.ts.map +1 -0
  2211. package/dist/sidecar/tmux.js +44 -0
  2212. package/dist/sidecar/tmux.js.map +1 -0
  2213. package/dist/sidecar/types.d.ts +125 -0
  2214. package/dist/sidecar/types.d.ts.map +1 -0
  2215. package/dist/sidecar/types.js +2 -0
  2216. package/dist/sidecar/types.js.map +1 -0
  2217. package/dist/state/__tests__/mode-state-context.test.d.ts +2 -0
  2218. package/dist/state/__tests__/mode-state-context.test.d.ts.map +1 -0
  2219. package/dist/state/__tests__/mode-state-context.test.js +35 -0
  2220. package/dist/state/__tests__/mode-state-context.test.js.map +1 -0
  2221. package/dist/state/__tests__/operations-ralph-phase.test.d.ts +2 -0
  2222. package/dist/state/__tests__/operations-ralph-phase.test.d.ts.map +1 -0
  2223. package/dist/state/__tests__/operations-ralph-phase.test.js +190 -0
  2224. package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -0
  2225. package/dist/state/__tests__/operations.test.d.ts +2 -0
  2226. package/dist/state/__tests__/operations.test.d.ts.map +1 -0
  2227. package/dist/state/__tests__/operations.test.js +2753 -0
  2228. package/dist/state/__tests__/operations.test.js.map +1 -0
  2229. package/dist/state/__tests__/path-traversal.test.d.ts +2 -0
  2230. package/dist/state/__tests__/path-traversal.test.d.ts.map +1 -0
  2231. package/dist/state/__tests__/path-traversal.test.js +49 -0
  2232. package/dist/state/__tests__/path-traversal.test.js.map +1 -0
  2233. package/dist/state/__tests__/planning-gate.test.d.ts +2 -0
  2234. package/dist/state/__tests__/planning-gate.test.d.ts.map +1 -0
  2235. package/dist/state/__tests__/planning-gate.test.js +219 -0
  2236. package/dist/state/__tests__/planning-gate.test.js.map +1 -0
  2237. package/dist/state/__tests__/skill-active.test.d.ts +2 -0
  2238. package/dist/state/__tests__/skill-active.test.d.ts.map +1 -0
  2239. package/dist/state/__tests__/skill-active.test.js +314 -0
  2240. package/dist/state/__tests__/skill-active.test.js.map +1 -0
  2241. package/dist/state/__tests__/workflow-transition.test.d.ts +2 -0
  2242. package/dist/state/__tests__/workflow-transition.test.d.ts.map +1 -0
  2243. package/dist/state/__tests__/workflow-transition.test.js +293 -0
  2244. package/dist/state/__tests__/workflow-transition.test.js.map +1 -0
  2245. package/dist/state/mode-state-context.d.ts +14 -0
  2246. package/dist/state/mode-state-context.d.ts.map +1 -0
  2247. package/dist/state/mode-state-context.js +49 -0
  2248. package/dist/state/mode-state-context.js.map +1 -0
  2249. package/dist/state/operations.d.ts +13 -0
  2250. package/dist/state/operations.d.ts.map +1 -0
  2251. package/dist/state/operations.js +544 -0
  2252. package/dist/state/operations.js.map +1 -0
  2253. package/dist/state/paths.d.ts +3 -0
  2254. package/dist/state/paths.d.ts.map +1 -0
  2255. package/dist/state/paths.js +2 -0
  2256. package/dist/state/paths.js.map +1 -0
  2257. package/dist/state/skill-active.d.ts +64 -0
  2258. package/dist/state/skill-active.d.ts.map +1 -0
  2259. package/dist/state/skill-active.js +375 -0
  2260. package/dist/state/skill-active.js.map +1 -0
  2261. package/dist/state/workflow-transition-reconcile.d.ts +22 -0
  2262. package/dist/state/workflow-transition-reconcile.d.ts.map +1 -0
  2263. package/dist/state/workflow-transition-reconcile.js +144 -0
  2264. package/dist/state/workflow-transition-reconcile.js.map +1 -0
  2265. package/dist/state/workflow-transition.d.ts +45 -0
  2266. package/dist/state/workflow-transition.d.ts.map +1 -0
  2267. package/dist/state/workflow-transition.js +268 -0
  2268. package/dist/state/workflow-transition.js.map +1 -0
  2269. package/dist/subagents/__tests__/tracker.test.d.ts +2 -0
  2270. package/dist/subagents/__tests__/tracker.test.d.ts.map +1 -0
  2271. package/dist/subagents/__tests__/tracker.test.js +255 -0
  2272. package/dist/subagents/__tests__/tracker.test.js.map +1 -0
  2273. package/dist/subagents/tracker.d.ts +60 -0
  2274. package/dist/subagents/tracker.d.ts.map +1 -0
  2275. package/dist/subagents/tracker.js +229 -0
  2276. package/dist/subagents/tracker.js.map +1 -0
  2277. package/dist/team/__tests__/allocation-policy.test.d.ts +2 -0
  2278. package/dist/team/__tests__/allocation-policy.test.d.ts.map +1 -0
  2279. package/dist/team/__tests__/allocation-policy.test.js +111 -0
  2280. package/dist/team/__tests__/allocation-policy.test.js.map +1 -0
  2281. package/dist/team/__tests__/api-interop.test.d.ts +2 -0
  2282. package/dist/team/__tests__/api-interop.test.d.ts.map +1 -0
  2283. package/dist/team/__tests__/api-interop.test.js +2321 -0
  2284. package/dist/team/__tests__/api-interop.test.js.map +1 -0
  2285. package/dist/team/__tests__/approved-execution.test.d.ts +2 -0
  2286. package/dist/team/__tests__/approved-execution.test.d.ts.map +1 -0
  2287. package/dist/team/__tests__/approved-execution.test.js +304 -0
  2288. package/dist/team/__tests__/approved-execution.test.js.map +1 -0
  2289. package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
  2290. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
  2291. package/dist/team/__tests__/commit-hygiene.test.js +93 -0
  2292. package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
  2293. package/dist/team/__tests__/coordination-protocol.test.d.ts +2 -0
  2294. package/dist/team/__tests__/coordination-protocol.test.d.ts.map +1 -0
  2295. package/dist/team/__tests__/coordination-protocol.test.js +173 -0
  2296. package/dist/team/__tests__/coordination-protocol.test.js.map +1 -0
  2297. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts +2 -0
  2298. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts.map +1 -0
  2299. package/dist/team/__tests__/cross-rebase-smoke.test.js +161 -0
  2300. package/dist/team/__tests__/cross-rebase-smoke.test.js.map +1 -0
  2301. package/dist/team/__tests__/current-task-baseline.test.d.ts +2 -0
  2302. package/dist/team/__tests__/current-task-baseline.test.d.ts.map +1 -0
  2303. package/dist/team/__tests__/current-task-baseline.test.js +87 -0
  2304. package/dist/team/__tests__/current-task-baseline.test.js.map +1 -0
  2305. package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
  2306. package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
  2307. package/dist/team/__tests__/delegation-policy.test.js +69 -0
  2308. package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
  2309. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts +2 -0
  2310. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts.map +1 -0
  2311. package/dist/team/__tests__/delivery-e2e-smoke.test.js +677 -0
  2312. package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -0
  2313. package/dist/team/__tests__/delivery-log.test.d.ts +2 -0
  2314. package/dist/team/__tests__/delivery-log.test.d.ts.map +1 -0
  2315. package/dist/team/__tests__/delivery-log.test.js +62 -0
  2316. package/dist/team/__tests__/delivery-log.test.js.map +1 -0
  2317. package/dist/team/__tests__/events.test.d.ts +2 -0
  2318. package/dist/team/__tests__/events.test.d.ts.map +1 -0
  2319. package/dist/team/__tests__/events.test.js +313 -0
  2320. package/dist/team/__tests__/events.test.js.map +1 -0
  2321. package/dist/team/__tests__/followup-planner.test.d.ts +2 -0
  2322. package/dist/team/__tests__/followup-planner.test.d.ts.map +1 -0
  2323. package/dist/team/__tests__/followup-planner.test.js +100 -0
  2324. package/dist/team/__tests__/followup-planner.test.js.map +1 -0
  2325. package/dist/team/__tests__/hardening-e2e.test.d.ts +2 -0
  2326. package/dist/team/__tests__/hardening-e2e.test.d.ts.map +1 -0
  2327. package/dist/team/__tests__/hardening-e2e.test.js +98 -0
  2328. package/dist/team/__tests__/hardening-e2e.test.js.map +1 -0
  2329. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
  2330. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
  2331. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
  2332. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
  2333. package/dist/team/__tests__/idle-nudge.test.d.ts +2 -0
  2334. package/dist/team/__tests__/idle-nudge.test.d.ts.map +1 -0
  2335. package/dist/team/__tests__/idle-nudge.test.js +230 -0
  2336. package/dist/team/__tests__/idle-nudge.test.js.map +1 -0
  2337. package/dist/team/__tests__/leader-activity.test.d.ts +2 -0
  2338. package/dist/team/__tests__/leader-activity.test.d.ts.map +1 -0
  2339. package/dist/team/__tests__/leader-activity.test.js +261 -0
  2340. package/dist/team/__tests__/leader-activity.test.js.map +1 -0
  2341. package/dist/team/__tests__/mcp-comm.test.d.ts +2 -0
  2342. package/dist/team/__tests__/mcp-comm.test.d.ts.map +1 -0
  2343. package/dist/team/__tests__/mcp-comm.test.js +289 -0
  2344. package/dist/team/__tests__/mcp-comm.test.js.map +1 -0
  2345. package/dist/team/__tests__/model-contract.test.d.ts +2 -0
  2346. package/dist/team/__tests__/model-contract.test.d.ts.map +1 -0
  2347. package/dist/team/__tests__/model-contract.test.js +187 -0
  2348. package/dist/team/__tests__/model-contract.test.js.map +1 -0
  2349. package/dist/team/__tests__/orchestrator.test.d.ts +2 -0
  2350. package/dist/team/__tests__/orchestrator.test.d.ts.map +1 -0
  2351. package/dist/team/__tests__/orchestrator.test.js +111 -0
  2352. package/dist/team/__tests__/orchestrator.test.js.map +1 -0
  2353. package/dist/team/__tests__/phase-controller.test.d.ts +2 -0
  2354. package/dist/team/__tests__/phase-controller.test.d.ts.map +1 -0
  2355. package/dist/team/__tests__/phase-controller.test.js +50 -0
  2356. package/dist/team/__tests__/phase-controller.test.js.map +1 -0
  2357. package/dist/team/__tests__/rebalance-policy.test.d.ts +2 -0
  2358. package/dist/team/__tests__/rebalance-policy.test.d.ts.map +1 -0
  2359. package/dist/team/__tests__/rebalance-policy.test.js +168 -0
  2360. package/dist/team/__tests__/rebalance-policy.test.js.map +1 -0
  2361. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
  2362. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
  2363. package/dist/team/__tests__/repo-aware-decomposition.test.js +156 -0
  2364. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
  2365. package/dist/team/__tests__/role-router.test.d.ts +2 -0
  2366. package/dist/team/__tests__/role-router.test.d.ts.map +1 -0
  2367. package/dist/team/__tests__/role-router.test.js +263 -0
  2368. package/dist/team/__tests__/role-router.test.js.map +1 -0
  2369. package/dist/team/__tests__/runtime-boxed-state.test.d.ts +2 -0
  2370. package/dist/team/__tests__/runtime-boxed-state.test.d.ts.map +1 -0
  2371. package/dist/team/__tests__/runtime-boxed-state.test.js +39 -0
  2372. package/dist/team/__tests__/runtime-boxed-state.test.js.map +1 -0
  2373. package/dist/team/__tests__/runtime-cli.test.d.ts +2 -0
  2374. package/dist/team/__tests__/runtime-cli.test.d.ts.map +1 -0
  2375. package/dist/team/__tests__/runtime-cli.test.js +320 -0
  2376. package/dist/team/__tests__/runtime-cli.test.js.map +1 -0
  2377. package/dist/team/__tests__/runtime.test.d.ts +2 -0
  2378. package/dist/team/__tests__/runtime.test.d.ts.map +1 -0
  2379. package/dist/team/__tests__/runtime.test.js +6464 -0
  2380. package/dist/team/__tests__/runtime.test.js.map +1 -0
  2381. package/dist/team/__tests__/scaling.test.d.ts +2 -0
  2382. package/dist/team/__tests__/scaling.test.d.ts.map +1 -0
  2383. package/dist/team/__tests__/scaling.test.js +1664 -0
  2384. package/dist/team/__tests__/scaling.test.js.map +1 -0
  2385. package/dist/team/__tests__/shutdown-fallback.test.d.ts +2 -0
  2386. package/dist/team/__tests__/shutdown-fallback.test.d.ts.map +1 -0
  2387. package/dist/team/__tests__/shutdown-fallback.test.js +125 -0
  2388. package/dist/team/__tests__/shutdown-fallback.test.js.map +1 -0
  2389. package/dist/team/__tests__/state-root.test.d.ts +2 -0
  2390. package/dist/team/__tests__/state-root.test.d.ts.map +1 -0
  2391. package/dist/team/__tests__/state-root.test.js +208 -0
  2392. package/dist/team/__tests__/state-root.test.js.map +1 -0
  2393. package/dist/team/__tests__/state.test.d.ts +2 -0
  2394. package/dist/team/__tests__/state.test.d.ts.map +1 -0
  2395. package/dist/team/__tests__/state.test.js +1942 -0
  2396. package/dist/team/__tests__/state.test.js.map +1 -0
  2397. package/dist/team/__tests__/team-identity.test.d.ts +2 -0
  2398. package/dist/team/__tests__/team-identity.test.d.ts.map +1 -0
  2399. package/dist/team/__tests__/team-identity.test.js +166 -0
  2400. package/dist/team/__tests__/team-identity.test.js.map +1 -0
  2401. package/dist/team/__tests__/team-ops-contract.test.d.ts +2 -0
  2402. package/dist/team/__tests__/team-ops-contract.test.d.ts.map +1 -0
  2403. package/dist/team/__tests__/team-ops-contract.test.js +96 -0
  2404. package/dist/team/__tests__/team-ops-contract.test.js.map +1 -0
  2405. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +2 -0
  2406. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +1 -0
  2407. package/dist/team/__tests__/tmux-claude-workers-demo.test.js +191 -0
  2408. package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +1 -0
  2409. package/dist/team/__tests__/tmux-session.test.d.ts +2 -0
  2410. package/dist/team/__tests__/tmux-session.test.d.ts.map +1 -0
  2411. package/dist/team/__tests__/tmux-session.test.js +4546 -0
  2412. package/dist/team/__tests__/tmux-session.test.js.map +1 -0
  2413. package/dist/team/__tests__/tmux-test-fixture.d.ts +20 -0
  2414. package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -0
  2415. package/dist/team/__tests__/tmux-test-fixture.js +148 -0
  2416. package/dist/team/__tests__/tmux-test-fixture.js.map +1 -0
  2417. package/dist/team/__tests__/tmux-test-fixture.test.d.ts +2 -0
  2418. package/dist/team/__tests__/tmux-test-fixture.test.d.ts.map +1 -0
  2419. package/dist/team/__tests__/tmux-test-fixture.test.js +114 -0
  2420. package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -0
  2421. package/dist/team/__tests__/worker-bootstrap.test.d.ts +2 -0
  2422. package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +1 -0
  2423. package/dist/team/__tests__/worker-bootstrap.test.js +1122 -0
  2424. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -0
  2425. package/dist/team/__tests__/worker-runtime-identity.test.d.ts +2 -0
  2426. package/dist/team/__tests__/worker-runtime-identity.test.d.ts.map +1 -0
  2427. package/dist/team/__tests__/worker-runtime-identity.test.js +258 -0
  2428. package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -0
  2429. package/dist/team/__tests__/worktree.test.d.ts +2 -0
  2430. package/dist/team/__tests__/worktree.test.d.ts.map +1 -0
  2431. package/dist/team/__tests__/worktree.test.js +317 -0
  2432. package/dist/team/__tests__/worktree.test.js.map +1 -0
  2433. package/dist/team/allocation-policy.d.ts +29 -0
  2434. package/dist/team/allocation-policy.d.ts.map +1 -0
  2435. package/dist/team/allocation-policy.js +153 -0
  2436. package/dist/team/allocation-policy.js.map +1 -0
  2437. package/dist/team/api-interop.d.ts +20 -0
  2438. package/dist/team/api-interop.d.ts.map +1 -0
  2439. package/dist/team/api-interop.js +1084 -0
  2440. package/dist/team/api-interop.js.map +1 -0
  2441. package/dist/team/approved-execution.d.ts +64 -0
  2442. package/dist/team/approved-execution.d.ts.map +1 -0
  2443. package/dist/team/approved-execution.js +242 -0
  2444. package/dist/team/approved-execution.js.map +1 -0
  2445. package/dist/team/commit-hygiene.d.ts +79 -0
  2446. package/dist/team/commit-hygiene.d.ts.map +1 -0
  2447. package/dist/team/commit-hygiene.js +364 -0
  2448. package/dist/team/commit-hygiene.js.map +1 -0
  2449. package/dist/team/contracts.d.ts +26 -0
  2450. package/dist/team/contracts.d.ts.map +1 -0
  2451. package/dist/team/contracts.js +103 -0
  2452. package/dist/team/contracts.js.map +1 -0
  2453. package/dist/team/coordination-protocol.d.ts +14 -0
  2454. package/dist/team/coordination-protocol.d.ts.map +1 -0
  2455. package/dist/team/coordination-protocol.js +244 -0
  2456. package/dist/team/coordination-protocol.js.map +1 -0
  2457. package/dist/team/current-task-baseline.d.ts +32 -0
  2458. package/dist/team/current-task-baseline.d.ts.map +1 -0
  2459. package/dist/team/current-task-baseline.js +85 -0
  2460. package/dist/team/current-task-baseline.js.map +1 -0
  2461. package/dist/team/dag-schema.d.ts +38 -0
  2462. package/dist/team/dag-schema.d.ts.map +1 -0
  2463. package/dist/team/dag-schema.js +221 -0
  2464. package/dist/team/dag-schema.js.map +1 -0
  2465. package/dist/team/delegation-policy.d.ts +3 -0
  2466. package/dist/team/delegation-policy.d.ts.map +1 -0
  2467. package/dist/team/delegation-policy.js +82 -0
  2468. package/dist/team/delegation-policy.js.map +1 -0
  2469. package/dist/team/delivery-log.d.ts +14 -0
  2470. package/dist/team/delivery-log.d.ts.map +1 -0
  2471. package/dist/team/delivery-log.js +43 -0
  2472. package/dist/team/delivery-log.js.map +1 -0
  2473. package/dist/team/followup-planner.d.ts +45 -0
  2474. package/dist/team/followup-planner.d.ts.map +1 -0
  2475. package/dist/team/followup-planner.js +200 -0
  2476. package/dist/team/followup-planner.js.map +1 -0
  2477. package/dist/team/goal-workflow.d.ts +20 -0
  2478. package/dist/team/goal-workflow.d.ts.map +1 -0
  2479. package/dist/team/goal-workflow.js +57 -0
  2480. package/dist/team/goal-workflow.js.map +1 -0
  2481. package/dist/team/idle-nudge.d.ts +53 -0
  2482. package/dist/team/idle-nudge.d.ts.map +1 -0
  2483. package/dist/team/idle-nudge.js +141 -0
  2484. package/dist/team/idle-nudge.js.map +1 -0
  2485. package/dist/team/leader-activity.d.ts +15 -0
  2486. package/dist/team/leader-activity.d.ts.map +1 -0
  2487. package/dist/team/leader-activity.js +224 -0
  2488. package/dist/team/leader-activity.js.map +1 -0
  2489. package/dist/team/mcp-comm.d.ts +73 -0
  2490. package/dist/team/mcp-comm.d.ts.map +1 -0
  2491. package/dist/team/mcp-comm.js +314 -0
  2492. package/dist/team/mcp-comm.js.map +1 -0
  2493. package/dist/team/model-contract.d.ts +26 -0
  2494. package/dist/team/model-contract.d.ts.map +1 -0
  2495. package/dist/team/model-contract.js +205 -0
  2496. package/dist/team/model-contract.js.map +1 -0
  2497. package/dist/team/orchestrator.d.ts +47 -0
  2498. package/dist/team/orchestrator.d.ts.map +1 -0
  2499. package/dist/team/orchestrator.js +131 -0
  2500. package/dist/team/orchestrator.js.map +1 -0
  2501. package/dist/team/pane-status.d.ts +149 -0
  2502. package/dist/team/pane-status.d.ts.map +1 -0
  2503. package/dist/team/pane-status.js +558 -0
  2504. package/dist/team/pane-status.js.map +1 -0
  2505. package/dist/team/phase-controller.d.ts +12 -0
  2506. package/dist/team/phase-controller.d.ts.map +1 -0
  2507. package/dist/team/phase-controller.js +142 -0
  2508. package/dist/team/phase-controller.js.map +1 -0
  2509. package/dist/team/progress-evidence.d.ts +2 -0
  2510. package/dist/team/progress-evidence.d.ts.map +1 -0
  2511. package/dist/team/progress-evidence.js +77 -0
  2512. package/dist/team/progress-evidence.js.map +1 -0
  2513. package/dist/team/rebalance-policy.d.ts +19 -0
  2514. package/dist/team/rebalance-policy.d.ts.map +1 -0
  2515. package/dist/team/rebalance-policy.js +48 -0
  2516. package/dist/team/rebalance-policy.js.map +1 -0
  2517. package/dist/team/reminder-intents.d.ts +11 -0
  2518. package/dist/team/reminder-intents.d.ts.map +1 -0
  2519. package/dist/team/reminder-intents.js +40 -0
  2520. package/dist/team/reminder-intents.js.map +1 -0
  2521. package/dist/team/repo-aware-decomposition.d.ts +68 -0
  2522. package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
  2523. package/dist/team/repo-aware-decomposition.js +235 -0
  2524. package/dist/team/repo-aware-decomposition.js.map +1 -0
  2525. package/dist/team/role-router.d.ts +32 -0
  2526. package/dist/team/role-router.d.ts.map +1 -0
  2527. package/dist/team/role-router.js +298 -0
  2528. package/dist/team/role-router.js.map +1 -0
  2529. package/dist/team/runtime-cli.d.ts +78 -0
  2530. package/dist/team/runtime-cli.d.ts.map +1 -0
  2531. package/dist/team/runtime-cli.js +376 -0
  2532. package/dist/team/runtime-cli.js.map +1 -0
  2533. package/dist/team/runtime.d.ts +162 -0
  2534. package/dist/team/runtime.d.ts.map +1 -0
  2535. package/dist/team/runtime.js +4160 -0
  2536. package/dist/team/runtime.js.map +1 -0
  2537. package/dist/team/scaling.d.ts +59 -0
  2538. package/dist/team/scaling.d.ts.map +1 -0
  2539. package/dist/team/scaling.js +650 -0
  2540. package/dist/team/scaling.js.map +1 -0
  2541. package/dist/team/state/approvals.d.ts +25 -0
  2542. package/dist/team/state/approvals.d.ts.map +1 -0
  2543. package/dist/team/state/approvals.js +31 -0
  2544. package/dist/team/state/approvals.js.map +1 -0
  2545. package/dist/team/state/config.d.ts +2 -0
  2546. package/dist/team/state/config.d.ts.map +1 -0
  2547. package/dist/team/state/config.js +2 -0
  2548. package/dist/team/state/config.js.map +1 -0
  2549. package/dist/team/state/dispatch-lock.d.ts +3 -0
  2550. package/dist/team/state/dispatch-lock.d.ts.map +1 -0
  2551. package/dist/team/state/dispatch-lock.js +81 -0
  2552. package/dist/team/state/dispatch-lock.js.map +1 -0
  2553. package/dist/team/state/dispatch.d.ts +67 -0
  2554. package/dist/team/state/dispatch.d.ts.map +1 -0
  2555. package/dist/team/state/dispatch.js +302 -0
  2556. package/dist/team/state/dispatch.js.map +1 -0
  2557. package/dist/team/state/events.d.ts +26 -0
  2558. package/dist/team/state/events.d.ts.map +1 -0
  2559. package/dist/team/state/events.js +145 -0
  2560. package/dist/team/state/events.js.map +1 -0
  2561. package/dist/team/state/index.d.ts +11 -0
  2562. package/dist/team/state/index.d.ts.map +1 -0
  2563. package/dist/team/state/index.js +11 -0
  2564. package/dist/team/state/index.js.map +1 -0
  2565. package/dist/team/state/io.d.ts +2 -0
  2566. package/dist/team/state/io.d.ts.map +1 -0
  2567. package/dist/team/state/io.js +2 -0
  2568. package/dist/team/state/io.js.map +1 -0
  2569. package/dist/team/state/locks.d.ts +16 -0
  2570. package/dist/team/state/locks.d.ts.map +1 -0
  2571. package/dist/team/state/locks.js +201 -0
  2572. package/dist/team/state/locks.js.map +1 -0
  2573. package/dist/team/state/mailbox.d.ts +43 -0
  2574. package/dist/team/state/mailbox.d.ts.map +1 -0
  2575. package/dist/team/state/mailbox.js +222 -0
  2576. package/dist/team/state/mailbox.js.map +1 -0
  2577. package/dist/team/state/monitor.d.ts +108 -0
  2578. package/dist/team/state/monitor.d.ts.map +1 -0
  2579. package/dist/team/state/monitor.js +193 -0
  2580. package/dist/team/state/monitor.js.map +1 -0
  2581. package/dist/team/state/shutdown.d.ts +2 -0
  2582. package/dist/team/state/shutdown.d.ts.map +1 -0
  2583. package/dist/team/state/shutdown.js +2 -0
  2584. package/dist/team/state/shutdown.js.map +1 -0
  2585. package/dist/team/state/summary.d.ts +2 -0
  2586. package/dist/team/state/summary.d.ts.map +1 -0
  2587. package/dist/team/state/summary.js +2 -0
  2588. package/dist/team/state/summary.js.map +1 -0
  2589. package/dist/team/state/tasks.d.ts +53 -0
  2590. package/dist/team/state/tasks.d.ts.map +1 -0
  2591. package/dist/team/state/tasks.js +284 -0
  2592. package/dist/team/state/tasks.js.map +1 -0
  2593. package/dist/team/state/types.d.ts +356 -0
  2594. package/dist/team/state/types.d.ts.map +1 -0
  2595. package/dist/team/state/types.js +3 -0
  2596. package/dist/team/state/types.js.map +1 -0
  2597. package/dist/team/state/workers.d.ts +2 -0
  2598. package/dist/team/state/workers.d.ts.map +1 -0
  2599. package/dist/team/state/workers.js +2 -0
  2600. package/dist/team/state/workers.js.map +1 -0
  2601. package/dist/team/state-root.d.ts +40 -0
  2602. package/dist/team/state-root.d.ts.map +1 -0
  2603. package/dist/team/state-root.js +297 -0
  2604. package/dist/team/state-root.js.map +1 -0
  2605. package/dist/team/state.d.ts +471 -0
  2606. package/dist/team/state.d.ts.map +1 -0
  2607. package/dist/team/state.js +1418 -0
  2608. package/dist/team/state.js.map +1 -0
  2609. package/dist/team/team-identity.d.ts +26 -0
  2610. package/dist/team/team-identity.d.ts.map +1 -0
  2611. package/dist/team/team-identity.js +169 -0
  2612. package/dist/team/team-identity.js.map +1 -0
  2613. package/dist/team/team-ops.d.ts +66 -0
  2614. package/dist/team/team-ops.d.ts.map +1 -0
  2615. package/dist/team/team-ops.js +79 -0
  2616. package/dist/team/team-ops.js.map +1 -0
  2617. package/dist/team/tmux-session.d.ts +190 -0
  2618. package/dist/team/tmux-session.d.ts.map +1 -0
  2619. package/dist/team/tmux-session.js +2071 -0
  2620. package/dist/team/tmux-session.js.map +1 -0
  2621. package/dist/team/ultragoal-context.d.ts +47 -0
  2622. package/dist/team/ultragoal-context.d.ts.map +1 -0
  2623. package/dist/team/ultragoal-context.js +215 -0
  2624. package/dist/team/ultragoal-context.js.map +1 -0
  2625. package/dist/team/worker-bootstrap.d.ts +92 -0
  2626. package/dist/team/worker-bootstrap.d.ts.map +1 -0
  2627. package/dist/team/worker-bootstrap.js +860 -0
  2628. package/dist/team/worker-bootstrap.js.map +1 -0
  2629. package/dist/team/worktree.d.ts +69 -0
  2630. package/dist/team/worktree.d.ts.map +1 -0
  2631. package/dist/team/worktree.js +437 -0
  2632. package/dist/team/worktree.js.map +1 -0
  2633. package/dist/ultragoal/__tests__/artifacts.test.d.ts +2 -0
  2634. package/dist/ultragoal/__tests__/artifacts.test.d.ts.map +1 -0
  2635. package/dist/ultragoal/__tests__/artifacts.test.js +1423 -0
  2636. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -0
  2637. package/dist/ultragoal/__tests__/docs-contract.test.d.ts +2 -0
  2638. package/dist/ultragoal/__tests__/docs-contract.test.d.ts.map +1 -0
  2639. package/dist/ultragoal/__tests__/docs-contract.test.js +132 -0
  2640. package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -0
  2641. package/dist/ultragoal/__tests__/steering-fixtures.d.ts +68 -0
  2642. package/dist/ultragoal/__tests__/steering-fixtures.d.ts.map +1 -0
  2643. package/dist/ultragoal/__tests__/steering-fixtures.js +259 -0
  2644. package/dist/ultragoal/__tests__/steering-fixtures.js.map +1 -0
  2645. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts +2 -0
  2646. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts.map +1 -0
  2647. package/dist/ultragoal/__tests__/steering-fixtures.test.js +65 -0
  2648. package/dist/ultragoal/__tests__/steering-fixtures.test.js.map +1 -0
  2649. package/dist/ultragoal/artifacts.d.ts +249 -0
  2650. package/dist/ultragoal/artifacts.d.ts.map +1 -0
  2651. package/dist/ultragoal/artifacts.js +1349 -0
  2652. package/dist/ultragoal/artifacts.js.map +1 -0
  2653. package/dist/utils/__tests__/agents-md.test.d.ts +2 -0
  2654. package/dist/utils/__tests__/agents-md.test.d.ts.map +1 -0
  2655. package/dist/utils/__tests__/agents-md.test.js +96 -0
  2656. package/dist/utils/__tests__/agents-md.test.js.map +1 -0
  2657. package/dist/utils/__tests__/agents-model-table.test.d.ts +2 -0
  2658. package/dist/utils/__tests__/agents-model-table.test.d.ts.map +1 -0
  2659. package/dist/utils/__tests__/agents-model-table.test.js +108 -0
  2660. package/dist/utils/__tests__/agents-model-table.test.js.map +1 -0
  2661. package/dist/utils/__tests__/dep-versions.test.d.ts +2 -0
  2662. package/dist/utils/__tests__/dep-versions.test.d.ts.map +1 -0
  2663. package/dist/utils/__tests__/dep-versions.test.js +46 -0
  2664. package/dist/utils/__tests__/dep-versions.test.js.map +1 -0
  2665. package/dist/utils/__tests__/package.test.d.ts +2 -0
  2666. package/dist/utils/__tests__/package.test.d.ts.map +1 -0
  2667. package/dist/utils/__tests__/package.test.js +21 -0
  2668. package/dist/utils/__tests__/package.test.js.map +1 -0
  2669. package/dist/utils/__tests__/paths.test.d.ts +2 -0
  2670. package/dist/utils/__tests__/paths.test.d.ts.map +1 -0
  2671. package/dist/utils/__tests__/paths.test.js +647 -0
  2672. package/dist/utils/__tests__/paths.test.js.map +1 -0
  2673. package/dist/utils/__tests__/platform-command.test.d.ts +2 -0
  2674. package/dist/utils/__tests__/platform-command.test.d.ts.map +1 -0
  2675. package/dist/utils/__tests__/platform-command.test.js +399 -0
  2676. package/dist/utils/__tests__/platform-command.test.js.map +1 -0
  2677. package/dist/utils/__tests__/repo-deps.test.d.ts +2 -0
  2678. package/dist/utils/__tests__/repo-deps.test.d.ts.map +1 -0
  2679. package/dist/utils/__tests__/repo-deps.test.js +71 -0
  2680. package/dist/utils/__tests__/repo-deps.test.js.map +1 -0
  2681. package/dist/utils/__tests__/sleep-resource.test.d.ts +2 -0
  2682. package/dist/utils/__tests__/sleep-resource.test.d.ts.map +1 -0
  2683. package/dist/utils/__tests__/sleep-resource.test.js +39 -0
  2684. package/dist/utils/__tests__/sleep-resource.test.js.map +1 -0
  2685. package/dist/utils/__tests__/version.test.d.ts +2 -0
  2686. package/dist/utils/__tests__/version.test.d.ts.map +1 -0
  2687. package/dist/utils/__tests__/version.test.js +78 -0
  2688. package/dist/utils/__tests__/version.test.js.map +1 -0
  2689. package/dist/utils/agents-md.d.ts +10 -0
  2690. package/dist/utils/agents-md.d.ts.map +1 -0
  2691. package/dist/utils/agents-md.js +76 -0
  2692. package/dist/utils/agents-md.js.map +1 -0
  2693. package/dist/utils/agents-model-table.d.ts +16 -0
  2694. package/dist/utils/agents-model-table.d.ts.map +1 -0
  2695. package/dist/utils/agents-model-table.js +102 -0
  2696. package/dist/utils/agents-model-table.js.map +1 -0
  2697. package/dist/utils/git-layout.d.ts +8 -0
  2698. package/dist/utils/git-layout.d.ts.map +1 -0
  2699. package/dist/utils/git-layout.js +58 -0
  2700. package/dist/utils/git-layout.js.map +1 -0
  2701. package/dist/utils/package.d.ts +9 -0
  2702. package/dist/utils/package.d.ts.map +1 -0
  2703. package/dist/utils/package.js +31 -0
  2704. package/dist/utils/package.js.map +1 -0
  2705. package/dist/utils/paths.d.ts +101 -0
  2706. package/dist/utils/paths.d.ts.map +1 -0
  2707. package/dist/utils/paths.js +314 -0
  2708. package/dist/utils/paths.js.map +1 -0
  2709. package/dist/utils/platform-command.d.ts +29 -0
  2710. package/dist/utils/platform-command.d.ts.map +1 -0
  2711. package/dist/utils/platform-command.js +239 -0
  2712. package/dist/utils/platform-command.js.map +1 -0
  2713. package/dist/utils/repo-deps.d.ts +20 -0
  2714. package/dist/utils/repo-deps.d.ts.map +1 -0
  2715. package/dist/utils/repo-deps.js +78 -0
  2716. package/dist/utils/repo-deps.js.map +1 -0
  2717. package/dist/utils/safe-json.d.ts +3 -0
  2718. package/dist/utils/safe-json.d.ts.map +1 -0
  2719. package/dist/utils/safe-json.js +19 -0
  2720. package/dist/utils/safe-json.js.map +1 -0
  2721. package/dist/utils/sleep.d.ts +3 -0
  2722. package/dist/utils/sleep.d.ts.map +1 -0
  2723. package/dist/utils/sleep.js +35 -0
  2724. package/dist/utils/sleep.js.map +1 -0
  2725. package/dist/utils/toml.d.ts +4 -0
  2726. package/dist/utils/toml.d.ts.map +1 -0
  2727. package/dist/utils/toml.js +75 -0
  2728. package/dist/utils/toml.js.map +1 -0
  2729. package/dist/utils/version.d.ts +7 -0
  2730. package/dist/utils/version.d.ts.map +1 -0
  2731. package/dist/utils/version.js +72 -0
  2732. package/dist/utils/version.js.map +1 -0
  2733. package/dist/verification/__tests__/ci-rust-gates.test.d.ts +2 -0
  2734. package/dist/verification/__tests__/ci-rust-gates.test.d.ts.map +1 -0
  2735. package/dist/verification/__tests__/ci-rust-gates.test.js +293 -0
  2736. package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -0
  2737. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts +2 -0
  2738. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts.map +1 -0
  2739. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +68 -0
  2740. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -0
  2741. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts +2 -0
  2742. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts.map +1 -0
  2743. package/dist/verification/__tests__/explore-harness-release-workflow.test.js +74 -0
  2744. package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -0
  2745. package/dist/verification/__tests__/native-release-manifest.test.d.ts +2 -0
  2746. package/dist/verification/__tests__/native-release-manifest.test.d.ts.map +1 -0
  2747. package/dist/verification/__tests__/native-release-manifest.test.js +80 -0
  2748. package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -0
  2749. package/dist/verification/__tests__/pr-check-workflow.test.d.ts +2 -0
  2750. package/dist/verification/__tests__/pr-check-workflow.test.d.ts.map +1 -0
  2751. package/dist/verification/__tests__/pr-check-workflow.test.js +27 -0
  2752. package/dist/verification/__tests__/pr-check-workflow.test.js.map +1 -0
  2753. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts +2 -0
  2754. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts.map +1 -0
  2755. package/dist/verification/__tests__/ralph-persistence-gate.test.js +55 -0
  2756. package/dist/verification/__tests__/ralph-persistence-gate.test.js.map +1 -0
  2757. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts +2 -0
  2758. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts.map +1 -0
  2759. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js +32 -0
  2760. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js.map +1 -0
  2761. package/dist/verification/__tests__/verifier.test.d.ts +2 -0
  2762. package/dist/verification/__tests__/verifier.test.d.ts.map +1 -0
  2763. package/dist/verification/__tests__/verifier.test.js +113 -0
  2764. package/dist/verification/__tests__/verifier.test.js.map +1 -0
  2765. package/dist/verification/verifier.d.ts +37 -0
  2766. package/dist/verification/verifier.d.ts.map +1 -0
  2767. package/dist/verification/verifier.js +100 -0
  2768. package/dist/verification/verifier.js.map +1 -0
  2769. package/dist/visual/__tests__/verdict.test.d.ts +2 -0
  2770. package/dist/visual/__tests__/verdict.test.d.ts.map +1 -0
  2771. package/dist/visual/__tests__/verdict.test.js +81 -0
  2772. package/dist/visual/__tests__/verdict.test.js.map +1 -0
  2773. package/dist/visual/constants.d.ts +4 -0
  2774. package/dist/visual/constants.d.ts.map +1 -0
  2775. package/dist/visual/constants.js +3 -0
  2776. package/dist/visual/constants.js.map +1 -0
  2777. package/dist/visual/verdict.d.ts +17 -0
  2778. package/dist/visual/verdict.d.ts.map +1 -0
  2779. package/dist/visual/verdict.js +61 -0
  2780. package/dist/visual/verdict.js.map +1 -0
  2781. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts +12 -0
  2782. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts.map +1 -0
  2783. package/dist/wiki/__tests__/cjk-tokenize.test.js +139 -0
  2784. package/dist/wiki/__tests__/cjk-tokenize.test.js.map +1 -0
  2785. package/dist/wiki/__tests__/crlf-parse.test.d.ts +2 -0
  2786. package/dist/wiki/__tests__/crlf-parse.test.d.ts.map +1 -0
  2787. package/dist/wiki/__tests__/crlf-parse.test.js +24 -0
  2788. package/dist/wiki/__tests__/crlf-parse.test.js.map +1 -0
  2789. package/dist/wiki/__tests__/escape-newline.test.d.ts +2 -0
  2790. package/dist/wiki/__tests__/escape-newline.test.d.ts.map +1 -0
  2791. package/dist/wiki/__tests__/escape-newline.test.js +45 -0
  2792. package/dist/wiki/__tests__/escape-newline.test.js.map +1 -0
  2793. package/dist/wiki/__tests__/ingest.test.d.ts +5 -0
  2794. package/dist/wiki/__tests__/ingest.test.d.ts.map +1 -0
  2795. package/dist/wiki/__tests__/ingest.test.js +215 -0
  2796. package/dist/wiki/__tests__/ingest.test.js.map +1 -0
  2797. package/dist/wiki/__tests__/lint.test.d.ts +5 -0
  2798. package/dist/wiki/__tests__/lint.test.d.ts.map +1 -0
  2799. package/dist/wiki/__tests__/lint.test.js +176 -0
  2800. package/dist/wiki/__tests__/lint.test.js.map +1 -0
  2801. package/dist/wiki/__tests__/query.test.d.ts +5 -0
  2802. package/dist/wiki/__tests__/query.test.d.ts.map +1 -0
  2803. package/dist/wiki/__tests__/query.test.js +166 -0
  2804. package/dist/wiki/__tests__/query.test.js.map +1 -0
  2805. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts +2 -0
  2806. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts.map +1 -0
  2807. package/dist/wiki/__tests__/reserved-file-guard.test.js +44 -0
  2808. package/dist/wiki/__tests__/reserved-file-guard.test.js.map +1 -0
  2809. package/dist/wiki/__tests__/session-hooks.test.d.ts +5 -0
  2810. package/dist/wiki/__tests__/session-hooks.test.d.ts.map +1 -0
  2811. package/dist/wiki/__tests__/session-hooks.test.js +64 -0
  2812. package/dist/wiki/__tests__/session-hooks.test.js.map +1 -0
  2813. package/dist/wiki/__tests__/slug-nonascii.test.d.ts +2 -0
  2814. package/dist/wiki/__tests__/slug-nonascii.test.d.ts.map +1 -0
  2815. package/dist/wiki/__tests__/slug-nonascii.test.js +30 -0
  2816. package/dist/wiki/__tests__/slug-nonascii.test.js.map +1 -0
  2817. package/dist/wiki/__tests__/storage.test.d.ts +5 -0
  2818. package/dist/wiki/__tests__/storage.test.d.ts.map +1 -0
  2819. package/dist/wiki/__tests__/storage.test.js +318 -0
  2820. package/dist/wiki/__tests__/storage.test.js.map +1 -0
  2821. package/dist/wiki/__tests__/test-helpers.d.ts +31 -0
  2822. package/dist/wiki/__tests__/test-helpers.d.ts.map +1 -0
  2823. package/dist/wiki/__tests__/test-helpers.js +108 -0
  2824. package/dist/wiki/__tests__/test-helpers.js.map +1 -0
  2825. package/dist/wiki/index.d.ts +14 -0
  2826. package/dist/wiki/index.d.ts.map +1 -0
  2827. package/dist/wiki/index.js +17 -0
  2828. package/dist/wiki/index.js.map +1 -0
  2829. package/dist/wiki/ingest.d.ts +20 -0
  2830. package/dist/wiki/ingest.d.ts.map +1 -0
  2831. package/dist/wiki/ingest.js +115 -0
  2832. package/dist/wiki/ingest.js.map +1 -0
  2833. package/dist/wiki/lifecycle.d.ts +25 -0
  2834. package/dist/wiki/lifecycle.d.ts.map +1 -0
  2835. package/dist/wiki/lifecycle.js +239 -0
  2836. package/dist/wiki/lifecycle.js.map +1 -0
  2837. package/dist/wiki/lint.d.ts +25 -0
  2838. package/dist/wiki/lint.d.ts.map +1 -0
  2839. package/dist/wiki/lint.js +170 -0
  2840. package/dist/wiki/lint.js.map +1 -0
  2841. package/dist/wiki/query.d.ts +36 -0
  2842. package/dist/wiki/query.d.ts.map +1 -0
  2843. package/dist/wiki/query.js +139 -0
  2844. package/dist/wiki/query.js.map +1 -0
  2845. package/dist/wiki/storage.d.ts +37 -0
  2846. package/dist/wiki/storage.d.ts.map +1 -0
  2847. package/dist/wiki/storage.js +358 -0
  2848. package/dist/wiki/storage.js.map +1 -0
  2849. package/dist/wiki/types.d.ts +83 -0
  2850. package/dist/wiki/types.d.ts.map +1 -0
  2851. package/dist/wiki/types.js +15 -0
  2852. package/dist/wiki/types.js.map +1 -0
  2853. package/package.json +110 -0
  2854. package/plugins/oh-my-codex/.app.json +3 -0
  2855. package/plugins/oh-my-codex/.codex-plugin/plugin.json +31 -0
  2856. package/plugins/oh-my-codex/.mcp.json +52 -0
  2857. package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +420 -0
  2858. package/plugins/oh-my-codex/hooks/hooks.json +76 -0
  2859. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +148 -0
  2860. package/plugins/oh-my-codex/skills/analyze/SKILL.md +146 -0
  2861. package/plugins/oh-my-codex/skills/ask/SKILL.md +58 -0
  2862. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +215 -0
  2863. package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +72 -0
  2864. package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +36 -0
  2865. package/plugins/oh-my-codex/skills/best-practice-research/SKILL.md +88 -0
  2866. package/plugins/oh-my-codex/skills/cancel/SKILL.md +399 -0
  2867. package/plugins/oh-my-codex/skills/code-review/SKILL.md +292 -0
  2868. package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +287 -0
  2869. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +579 -0
  2870. package/plugins/oh-my-codex/skills/design/SKILL.md +180 -0
  2871. package/plugins/oh-my-codex/skills/doctor/SKILL.md +239 -0
  2872. package/plugins/oh-my-codex/skills/hud/SKILL.md +98 -0
  2873. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +135 -0
  2874. package/plugins/oh-my-codex/skills/performance-goal/SKILL.md +65 -0
  2875. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +97 -0
  2876. package/plugins/oh-my-codex/skills/plan/SKILL.md +277 -0
  2877. package/plugins/oh-my-codex/skills/prometheus-strict/README.md +35 -0
  2878. package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +219 -0
  2879. package/plugins/oh-my-codex/skills/ralph/SKILL.md +294 -0
  2880. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +203 -0
  2881. package/plugins/oh-my-codex/skills/skill/SKILL.md +836 -0
  2882. package/plugins/oh-my-codex/skills/team/SKILL.md +536 -0
  2883. package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +139 -0
  2884. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +263 -0
  2885. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +190 -0
  2886. package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +161 -0
  2887. package/plugins/oh-my-codex/skills/wiki/SKILL.md +57 -0
  2888. package/plugins/oh-my-codex/skills/worker/SKILL.md +120 -0
  2889. package/prompts/analyst.md +135 -0
  2890. package/prompts/api-reviewer.md +113 -0
  2891. package/prompts/architect.md +111 -0
  2892. package/prompts/build-fixer.md +115 -0
  2893. package/prompts/code-reviewer.md +139 -0
  2894. package/prompts/code-simplifier.md +134 -0
  2895. package/prompts/critic.md +80 -0
  2896. package/prompts/debugger.md +117 -0
  2897. package/prompts/dependency-expert.md +129 -0
  2898. package/prompts/designer.md +126 -0
  2899. package/prompts/executor.md +108 -0
  2900. package/prompts/explore-harness.md +64 -0
  2901. package/prompts/explore.md +85 -0
  2902. package/prompts/git-master.md +114 -0
  2903. package/prompts/information-architect.md +226 -0
  2904. package/prompts/performance-reviewer.md +109 -0
  2905. package/prompts/planner.md +110 -0
  2906. package/prompts/product-analyst.md +304 -0
  2907. package/prompts/product-manager.md +245 -0
  2908. package/prompts/prometheus-strict-metis.md +274 -0
  2909. package/prompts/prometheus-strict-momus.md +82 -0
  2910. package/prompts/prometheus-strict-oracle.md +107 -0
  2911. package/prompts/qa-tester.md +124 -0
  2912. package/prompts/quality-reviewer.md +123 -0
  2913. package/prompts/quality-strategist.md +274 -0
  2914. package/prompts/researcher.md +122 -0
  2915. package/prompts/scholastic.md +11 -0
  2916. package/prompts/security-reviewer.md +143 -0
  2917. package/prompts/sisyphus-lite.md +111 -0
  2918. package/prompts/style-reviewer.md +102 -0
  2919. package/prompts/team-executor.md +57 -0
  2920. package/prompts/team-orchestrator.md +8 -0
  2921. package/prompts/test-engineer.md +130 -0
  2922. package/prompts/ux-researcher.md +327 -0
  2923. package/prompts/verifier.md +85 -0
  2924. package/prompts/vision.md +98 -0
  2925. package/prompts/writer.md +109 -0
  2926. package/skills/ai-slop-cleaner/SKILL.md +148 -0
  2927. package/skills/analyze/SKILL.md +146 -0
  2928. package/skills/ask/SKILL.md +58 -0
  2929. package/skills/ask-claude/SKILL.md +12 -0
  2930. package/skills/ask-gemini/SKILL.md +12 -0
  2931. package/skills/autopilot/SKILL.md +215 -0
  2932. package/skills/autoresearch/SKILL.md +72 -0
  2933. package/skills/autoresearch-goal/SKILL.md +36 -0
  2934. package/skills/best-practice-research/SKILL.md +88 -0
  2935. package/skills/build-fix/SKILL.md +10 -0
  2936. package/skills/cancel/SKILL.md +399 -0
  2937. package/skills/code-review/SKILL.md +292 -0
  2938. package/skills/configure-notifications/SKILL.md +287 -0
  2939. package/skills/deep-interview/SKILL.md +579 -0
  2940. package/skills/deepsearch/SKILL.md +10 -0
  2941. package/skills/design/SKILL.md +180 -0
  2942. package/skills/doctor/SKILL.md +239 -0
  2943. package/skills/ecomode/SKILL.md +114 -0
  2944. package/skills/frontend-ui-ux/SKILL.md +16 -0
  2945. package/skills/git-master/SKILL.md +27 -0
  2946. package/skills/help/SKILL.md +10 -0
  2947. package/skills/hud/SKILL.md +98 -0
  2948. package/skills/note/SKILL.md +10 -0
  2949. package/skills/omx-setup/SKILL.md +135 -0
  2950. package/skills/performance-goal/SKILL.md +65 -0
  2951. package/skills/pipeline/SKILL.md +97 -0
  2952. package/skills/plan/SKILL.md +277 -0
  2953. package/skills/prometheus-strict/README.md +35 -0
  2954. package/skills/prometheus-strict/SKILL.md +219 -0
  2955. package/skills/ralph/SKILL.md +294 -0
  2956. package/skills/ralph-init/SKILL.md +10 -0
  2957. package/skills/ralplan/SKILL.md +203 -0
  2958. package/skills/review/SKILL.md +10 -0
  2959. package/skills/security-review/SKILL.md +10 -0
  2960. package/skills/skill/SKILL.md +836 -0
  2961. package/skills/swarm/SKILL.md +12 -0
  2962. package/skills/tdd/SKILL.md +104 -0
  2963. package/skills/team/SKILL.md +536 -0
  2964. package/skills/trace/SKILL.md +10 -0
  2965. package/skills/ultragoal/SKILL.md +139 -0
  2966. package/skills/ultraqa/SKILL.md +263 -0
  2967. package/skills/ultrawork/SKILL.md +190 -0
  2968. package/skills/visual-ralph/SKILL.md +161 -0
  2969. package/skills/visual-verdict/SKILL.md +10 -0
  2970. package/skills/web-clone/SKILL.md +357 -0
  2971. package/skills/wiki/SKILL.md +57 -0
  2972. package/skills/worker/SKILL.md +120 -0
  2973. package/src/scripts/__tests__/codex-native-hook.test.ts +17173 -0
  2974. package/src/scripts/__tests__/docs-site-contract.test.ts +47 -0
  2975. package/src/scripts/__tests__/generate-release-body.test.ts +275 -0
  2976. package/src/scripts/__tests__/hook-derived-watcher.test.ts +285 -0
  2977. package/src/scripts/__tests__/notify-dispatcher.test.ts +504 -0
  2978. package/src/scripts/__tests__/notify-state-io.test.ts +168 -0
  2979. package/src/scripts/__tests__/notify-tmux-injection.test.ts +82 -0
  2980. package/src/scripts/__tests__/postinstall.test.ts +113 -0
  2981. package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
  2982. package/src/scripts/__tests__/run-test-files.test.ts +455 -0
  2983. package/src/scripts/__tests__/smoke-packed-install.test.ts +192 -0
  2984. package/src/scripts/__tests__/test-reply-listener-live.test.ts +101 -0
  2985. package/src/scripts/__tests__/verify-native-agents.test.ts +299 -0
  2986. package/src/scripts/ask-claude.sh +17 -0
  2987. package/src/scripts/ask-gemini.sh +14 -0
  2988. package/src/scripts/build-api.ts +48 -0
  2989. package/src/scripts/build-explore-harness.ts +54 -0
  2990. package/src/scripts/build-sparkshell.ts +52 -0
  2991. package/src/scripts/check-runtime-syntax.ts +63 -0
  2992. package/src/scripts/check-version-sync.ts +54 -0
  2993. package/src/scripts/cleanup-explore-harness.ts +18 -0
  2994. package/src/scripts/codex-execution-surface.ts +75 -0
  2995. package/src/scripts/codex-native-hook.ts +4877 -0
  2996. package/src/scripts/codex-native-pre-post.ts +1360 -0
  2997. package/src/scripts/demo-claude-workers.sh +241 -0
  2998. package/src/scripts/demo-team-e2e.sh +184 -0
  2999. package/src/scripts/eval/eval-adaptive-sort-optimization.py +24 -0
  3000. package/src/scripts/eval/eval-candidate-handoff.ts +8 -0
  3001. package/src/scripts/eval/eval-cli-discoverability.ts +40 -0
  3002. package/src/scripts/eval/eval-fresh-run-tagging.ts +8 -0
  3003. package/src/scripts/eval/eval-help-consistency.ts +11 -0
  3004. package/src/scripts/eval/eval-in-action-cat-shellout-demo.ts +31 -0
  3005. package/src/scripts/eval/eval-ml-kaggle-model-optimization.py +29 -0
  3006. package/src/scripts/eval/eval-noisy-bayesopt-highdim.py +44 -0
  3007. package/src/scripts/eval/eval-noisy-latent-subspace-discovery.py +44 -0
  3008. package/src/scripts/eval/eval-parity-smoke.ts +20 -0
  3009. package/src/scripts/eval/eval-parity-sweep.ts +26 -0
  3010. package/src/scripts/eval/eval-resume-dirty-guard.ts +8 -0
  3011. package/src/scripts/eval/eval-security-path-traversal.ts +38 -0
  3012. package/src/scripts/fixtures/ask-advisor-stub.ts +12 -0
  3013. package/src/scripts/generate-catalog-docs.ts +112 -0
  3014. package/src/scripts/generate-native-release-manifest.ts +147 -0
  3015. package/src/scripts/generate-release-body.ts +327 -0
  3016. package/src/scripts/hook-derived-watcher.ts +649 -0
  3017. package/src/scripts/hook-payload-guard.ts +113 -0
  3018. package/src/scripts/notify-dispatcher.ts +408 -0
  3019. package/src/scripts/notify-fallback-watcher.ts +2022 -0
  3020. package/src/scripts/notify-hook/__tests__/operational-events.test.ts +24 -0
  3021. package/src/scripts/notify-hook/__tests__/payload-guard.test.ts +41 -0
  3022. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
  3023. package/src/scripts/notify-hook/active-team.ts +55 -0
  3024. package/src/scripts/notify-hook/auto-nudge.ts +758 -0
  3025. package/src/scripts/notify-hook/log.ts +30 -0
  3026. package/src/scripts/notify-hook/managed-tmux.ts +568 -0
  3027. package/src/scripts/notify-hook/operational-events.ts +282 -0
  3028. package/src/scripts/notify-hook/orchestration-intent.ts +80 -0
  3029. package/src/scripts/notify-hook/payload-parser.ts +143 -0
  3030. package/src/scripts/notify-hook/process-runner.ts +75 -0
  3031. package/src/scripts/notify-hook/ralph-session-resume.ts +465 -0
  3032. package/src/scripts/notify-hook/state-io.ts +220 -0
  3033. package/src/scripts/notify-hook/team-dispatch.ts +1162 -0
  3034. package/src/scripts/notify-hook/team-leader-nudge.ts +1068 -0
  3035. package/src/scripts/notify-hook/team-tmux-guard.ts +236 -0
  3036. package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
  3037. package/src/scripts/notify-hook/team-worker-stop.ts +438 -0
  3038. package/src/scripts/notify-hook/team-worker.ts +709 -0
  3039. package/src/scripts/notify-hook/tmux-injection.ts +740 -0
  3040. package/src/scripts/notify-hook/utils.ts +31 -0
  3041. package/src/scripts/notify-hook/visual-verdict.ts +158 -0
  3042. package/src/scripts/notify-hook.ts +1033 -0
  3043. package/src/scripts/postinstall.ts +107 -0
  3044. package/src/scripts/prepare-build.js +83 -0
  3045. package/src/scripts/prompt-inventory.ts +218 -0
  3046. package/src/scripts/run-autoresearch-showcase.sh +75 -0
  3047. package/src/scripts/run-provider-advisor.ts +213 -0
  3048. package/src/scripts/run-test-files.ts +379 -0
  3049. package/src/scripts/smoke-packed-install.ts +268 -0
  3050. package/src/scripts/sync-plugin-mirror.ts +458 -0
  3051. package/src/scripts/sync-prompt-guidance-fragments.ts +55 -0
  3052. package/src/scripts/team-hardening-benchmark.ts +90 -0
  3053. package/src/scripts/test-reply-listener-live.ts +188 -0
  3054. package/src/scripts/test-sparkshell.ts +29 -0
  3055. package/src/scripts/tmux-hook-engine.ts +349 -0
  3056. package/src/scripts/verify-native-agents.ts +311 -0
  3057. package/src/scripts/verify-native-release-assets.ts +68 -0
  3058. package/templates/AGENTS.md +187 -0
  3059. package/templates/catalog-manifest.json +547 -0
  3060. package/templates/model-instructions/explore-lightweight-AGENTS.md +11 -0
  3061. package/templates/model-instructions/sparkshell-lightweight-AGENTS.md +10 -0
@@ -0,0 +1,3323 @@
1
+ import { describe, it, mock } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { existsSync } from 'node:fs';
4
+ import { mkdtemp, mkdir, readFile, rm, symlink, writeFile } from 'node:fs/promises';
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { detectKeywords, detectPrimaryKeyword, recordSkillActivation, DEEP_INTERVIEW_STATE_FILE, DEEP_INTERVIEW_BLOCKED_APPROVAL_INPUTS, DEEP_INTERVIEW_INPUT_LOCK_MESSAGE, persistDeepInterviewModeState, } from '../keyword-detector.js';
8
+ import { SKILL_ACTIVE_STATE_FILE } from '../../state/skill-active.js';
9
+ import { isUnderspecifiedForExecution, applyRalplanGate } from '../keyword-detector.js';
10
+ import { KEYWORD_TRIGGER_DEFINITIONS } from '../keyword-registry.js';
11
+ async function withIsolatedHome(prefix, run) {
12
+ const homeDir = await mkdtemp(join(tmpdir(), `omx-keyword-home-${prefix}-`));
13
+ const previousHome = process.env.HOME;
14
+ try {
15
+ process.env.HOME = homeDir;
16
+ return await run(homeDir);
17
+ }
18
+ finally {
19
+ if (typeof previousHome === 'string')
20
+ process.env.HOME = previousHome;
21
+ else
22
+ delete process.env.HOME;
23
+ await rm(homeDir, { recursive: true, force: true });
24
+ }
25
+ }
26
+ const AUTOPILOT_TEST_NOW = '2026-05-30T00:00:00.000Z';
27
+ const AUTOPILOT_TEST_STARTED_AT = '2026-05-29T00:00:00.000Z';
28
+ const AUTOPILOT_TEST_UPDATED_AT = '2026-05-29T00:10:00.000Z';
29
+ async function writeActiveAutopilotSkillState(stateDir, sessionId, phase = 'ralplan') {
30
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
31
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
32
+ version: 1,
33
+ active: true,
34
+ skill: 'autopilot',
35
+ keyword: '$autopilot',
36
+ phase,
37
+ activated_at: AUTOPILOT_TEST_STARTED_AT,
38
+ updated_at: AUTOPILOT_TEST_UPDATED_AT,
39
+ session_id: sessionId,
40
+ active_skills: [{ skill: 'autopilot', active: true, phase, session_id: sessionId }],
41
+ }, null, 2));
42
+ }
43
+ async function readAutopilotModeState(stateDir, sessionId) {
44
+ return JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), 'utf-8'));
45
+ }
46
+ async function continueAutopilotTestState(stateDir, cwd, sessionId, suffix, text = 'continue') {
47
+ await recordSkillActivation({
48
+ stateDir,
49
+ sourceCwd: cwd,
50
+ text,
51
+ sessionId,
52
+ threadId: `thread-${suffix}`,
53
+ turnId: `turn-${suffix}`,
54
+ nowIso: AUTOPILOT_TEST_NOW,
55
+ });
56
+ }
57
+ async function assertAutopilotRecoverySnapshot(cwd, modeState, expectedPath, expectedReason) {
58
+ const snapshotPath = modeState.state?.handoff_artifacts?.context_snapshot_path ?? '';
59
+ if (typeof expectedPath === 'string')
60
+ assert.equal(snapshotPath, expectedPath);
61
+ else
62
+ assert.match(snapshotPath, expectedPath);
63
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot?.kind, 'recovery');
64
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot?.recovery?.reason, expectedReason);
65
+ assert.equal(modeState.state?.context_snapshot_recovery?.status, 'degraded');
66
+ assert.equal(modeState.state?.context_snapshot_recovery?.reason, expectedReason);
67
+ const recoverySnapshot = await readFile(join(cwd, snapshotPath), 'utf-8');
68
+ assert.match(recoverySnapshot, /recovery status: degraded/);
69
+ assert.match(recoverySnapshot, new RegExp(`recovery reason: ${expectedReason}`));
70
+ assert.match(recoverySnapshot, /do not treat the continuation input as the task seed/);
71
+ assert.doesNotMatch(recoverySnapshot, /task seed: continue/);
72
+ return snapshotPath;
73
+ }
74
+ describe('keyword detector team compatibility', () => {
75
+ it('keeps explicit $skill order in detectKeywords results (left-to-right)', () => {
76
+ const matches = detectKeywords('$analyze $ultraqa $code-review now');
77
+ assert.deepEqual(matches.map((m) => m.skill).slice(0, 3), ['analyze', 'ultraqa', 'code-review']);
78
+ });
79
+ it('de-duplicates repeated explicit skill tokens', () => {
80
+ const matches = detectKeywords('$analyze $analyze root cause');
81
+ assert.deepEqual(matches.map((m) => m.skill), ['analyze']);
82
+ });
83
+ it('limits explicit multi-skill invocation to the first contiguous $skill block', () => {
84
+ const matches = detectKeywords('$ralplan Fix issue #1030 and ensure other directives ($ralph, $team, $deep-interview) are not affected');
85
+ assert.deepEqual(matches.map((m) => m.skill), ['ralplan']);
86
+ });
87
+ it('does not merge implicit keyword matches when an explicit $skill is present', () => {
88
+ const matches = detectKeywords('please run $team and then analyze the result');
89
+ assert.deepEqual(matches.map((m) => m.skill), ['team']);
90
+ });
91
+ it('does not fall back to implicit keyword detection when an unknown $token is present', () => {
92
+ const matches = detectKeywords('$maer-thinking 다시 설명해봐 keep going');
93
+ assert.deepEqual(matches, []);
94
+ const primary = detectPrimaryKeyword('$maer-thinking 다시 설명해봐 keep going');
95
+ assert.equal(primary, null);
96
+ });
97
+ it('recognizes plugin-prefixed explicit skill tokens', () => {
98
+ const matches = detectKeywords('$oh-my-codex:ralplan implement issue #1307');
99
+ assert.deepEqual(matches.map((m) => m.skill), ['ralplan']);
100
+ assert.equal(matches[0]?.keyword, '$oh-my-codex:ralplan');
101
+ });
102
+ it('supports mixed-form explicit multi-skill invocation ordering and dedupe', () => {
103
+ const matches = detectKeywords('$oh-my-codex:ralplan $ralph $oh-my-codex:ralplan ship this');
104
+ assert.deepEqual(matches.map((m) => m.skill), ['ralplan', 'ralph']);
105
+ assert.deepEqual(matches.map((m) => m.keyword), ['$oh-my-codex:ralplan', '$ralph']);
106
+ });
107
+ it('keeps recognized tokens on both sides of an unknown plugin-prefixed token in the same contiguous block', () => {
108
+ const matches = detectKeywords('$oh-my-codex:ralplan $oh-my-codex:unknown $ralph');
109
+ assert.deepEqual(matches.map((m) => m.skill), ['ralplan', 'ralph']);
110
+ assert.deepEqual(matches.map((m) => m.keyword), ['$oh-my-codex:ralplan', '$ralph']);
111
+ });
112
+ it('limits mixed-form explicit invocation to the first contiguous block', () => {
113
+ const matches = detectKeywords('$oh-my-codex:ralplan text $ralph');
114
+ assert.deepEqual(matches.map((m) => m.skill), ['ralplan']);
115
+ });
116
+ it('normalizes plugin-prefixed ulw shorthand token', () => {
117
+ const ulw = detectPrimaryKeyword('$oh-my-codex:ulw continue');
118
+ assert.ok(ulw);
119
+ assert.equal(ulw.skill, 'ultrawork');
120
+ assert.equal(ulw.keyword, '$oh-my-codex:ulw');
121
+ });
122
+ it('supports plugin-prefixed hyphenated workflow tokens', () => {
123
+ const deepInterview = detectPrimaryKeyword('$oh-my-codex:deep-interview gather requirements');
124
+ assert.ok(deepInterview);
125
+ assert.equal(deepInterview.skill, 'deep-interview');
126
+ assert.equal(deepInterview.keyword, '$oh-my-codex:deep-interview');
127
+ const codeReview = detectPrimaryKeyword('$oh-my-codex:code-review before merge');
128
+ assert.ok(codeReview);
129
+ assert.equal(codeReview.skill, 'code-review');
130
+ assert.equal(codeReview.keyword, '$oh-my-codex:code-review');
131
+ const bestPracticeResearch = detectPrimaryKeyword('$oh-my-codex:best-practice-research find official best practices');
132
+ assert.ok(bestPracticeResearch);
133
+ assert.equal(bestPracticeResearch.skill, 'best-practice-research');
134
+ assert.equal(bestPracticeResearch.keyword, '$oh-my-codex:best-practice-research');
135
+ });
136
+ it('does not fall back to implicit keyword detection when an unknown plugin-prefixed $token is present', () => {
137
+ const matches = detectKeywords('$oh-my-codex:maer-thinking 다시 설명해봐 keep going');
138
+ assert.deepEqual(matches, []);
139
+ const primary = detectPrimaryKeyword('$oh-my-codex:maer-thinking 다시 설명해봐 keep going');
140
+ assert.equal(primary, null);
141
+ });
142
+ it('suppresses implicit detection when an unknown plugin-prefixed token is present with other keyword text', () => {
143
+ const matches = detectKeywords('$oh-my-codex:unknown analyze this issue');
144
+ assert.deepEqual(matches, []);
145
+ assert.equal(detectPrimaryKeyword('$oh-my-codex:unknown analyze this issue'), null);
146
+ });
147
+ it('does not auto-detect keywords for explicit /prompts invocation without $skills', () => {
148
+ const matches = detectKeywords('/prompts:architect analyze this issue');
149
+ assert.deepEqual(matches, []);
150
+ const primary = detectPrimaryKeyword('/prompts:architect analyze this issue');
151
+ assert.equal(primary, null);
152
+ });
153
+ it('treats /prompts invocation with trailing punctuation as explicit command', () => {
154
+ const matches = detectKeywords('/prompts:architect, analyze this issue');
155
+ assert.deepEqual(matches, []);
156
+ const primary = detectPrimaryKeyword('/prompts:architect, analyze this issue');
157
+ assert.equal(primary, null);
158
+ });
159
+ it('maps explicit $analyze invocation to analyze skill', () => {
160
+ const match = detectPrimaryKeyword('please run $analyze on this workflow');
161
+ assert.ok(match);
162
+ assert.equal(match.skill, 'analyze');
163
+ assert.equal(match.keyword.toLowerCase(), '$analyze');
164
+ });
165
+ it('maps explicit $ultragoal invocation to ultragoal workflow skill', () => {
166
+ const match = detectPrimaryKeyword('$ultragoal split this release into durable goals');
167
+ assert.ok(match);
168
+ assert.equal(match.skill, 'ultragoal');
169
+ assert.equal(match.keyword.toLowerCase(), '$ultragoal');
170
+ });
171
+ it('maps explicit $best-practice-research invocation to the best-practice research wrapper', () => {
172
+ const match = detectPrimaryKeyword('$best-practice-research find current official guidance for this API');
173
+ assert.ok(match);
174
+ assert.equal(match.skill, 'best-practice-research');
175
+ assert.equal(match.keyword.toLowerCase(), '$best-practice-research');
176
+ });
177
+ it('maps intentful ultragoal prose without triggering artifact path mentions', () => {
178
+ const intentful = detectPrimaryKeyword('please run ultragoal workflow for this launch');
179
+ assert.ok(intentful);
180
+ assert.equal(intentful.skill, 'ultragoal');
181
+ const pathOnly = detectPrimaryKeyword('inspect .omx/ultragoal/goals.json');
182
+ assert.notEqual(pathOnly?.skill, 'ultragoal');
183
+ });
184
+ it('maps bare and command-style autopilot invocations to autopilot', () => {
185
+ for (const prompt of ['autopilot', 'run autopilot', 'autopilot this', 'autopilot mode']) {
186
+ const match = detectPrimaryKeyword(prompt);
187
+ assert.ok(match, `expected autopilot match for ${prompt}`);
188
+ assert.equal(match.skill, 'autopilot');
189
+ assert.equal(match.keyword.toLowerCase(), 'autopilot');
190
+ }
191
+ });
192
+ it('does not trigger autopilot from management/debug prose mentions', () => {
193
+ assert.equal(detectPrimaryKeyword('inspect autopilot state before continuing'), null);
194
+ assert.equal(detectPrimaryKeyword('fix the autopilot bug in the detector'), null);
195
+ assert.equal(detectPrimaryKeyword('why did autopilot fail?'), null);
196
+ assert.equal(detectPrimaryKeyword('run autopilot tests'), null);
197
+ assert.equal(detectPrimaryKeyword('run autopilot regression tests'), null);
198
+ assert.equal(detectPrimaryKeyword('continue autopilot debugging'), null);
199
+ assert.equal(detectPrimaryKeyword('start autopilot bug investigation'), null);
200
+ });
201
+ it('keeps higher-priority workflow keywords ahead of autopilot mentions', () => {
202
+ const match = detectPrimaryKeyword('autopilot this after consensus plan');
203
+ assert.ok(match);
204
+ assert.equal(match.skill, 'ralplan');
205
+ });
206
+ it('maps code-review keyword variants to code-review skill', () => {
207
+ const hyphen = detectPrimaryKeyword('run $code-review before merge');
208
+ assert.ok(hyphen);
209
+ assert.equal(hyphen.skill, 'code-review');
210
+ assert.equal(hyphen.keyword.toLowerCase(), '$code-review');
211
+ const spaced = detectPrimaryKeyword('please do a code review');
212
+ assert.ok(spaced);
213
+ assert.equal(spaced.skill, 'code-review');
214
+ assert.equal(detectPrimaryKeyword('run $security-review before merge')?.skill, undefined);
215
+ assert.equal(detectPrimaryKeyword('please do a security review')?.skill, undefined);
216
+ });
217
+ it('supports explicit multi-skill invocation by prioritizing left-most $skill', () => {
218
+ const match = detectPrimaryKeyword('$ultraqa $analyze $code-review run now');
219
+ assert.ok(match);
220
+ assert.equal(match.skill, 'ultraqa');
221
+ assert.equal(match.keyword.toLowerCase(), '$ultraqa');
222
+ });
223
+ it('maps "coordinated team" phrase to team orchestration skill', () => {
224
+ const match = detectPrimaryKeyword('run a coordinated team for implementation');
225
+ assert.ok(match);
226
+ assert.equal(match.skill, 'team');
227
+ assert.match(match.keyword.toLowerCase(), /team/);
228
+ });
229
+ it('does not trigger team keyword from filesystem/team-state path text', () => {
230
+ const match = detectPrimaryKeyword('You have 1 new message(s). Read .omx/state/team/execute-plan/mailbox/worker-3.json, act now, reply with concrete progress, then continue assigned work or next feasible task.');
231
+ assert.equal(match, null);
232
+ });
233
+ it('does not trigger team skill from incidental prose usage', () => {
234
+ const match = detectPrimaryKeyword('the team reviewed the document and shared feedback');
235
+ assert.equal(match, null);
236
+ });
237
+ it('does not trigger team from bare skill-name phrasing without $ invocation', () => {
238
+ const match = detectPrimaryKeyword('please use team agents for this');
239
+ assert.equal(match, null);
240
+ });
241
+ it('still triggers team for explicit $team invocation', () => {
242
+ const match = detectPrimaryKeyword('please run $team now');
243
+ assert.ok(match);
244
+ assert.equal(match.skill, 'team');
245
+ });
246
+ it('does not trigger keyword detector for explicit /prompts:swarm invocation', () => {
247
+ const match = detectPrimaryKeyword('use /prompts:swarm for this');
248
+ assert.equal(match, null);
249
+ });
250
+ it('does not trigger ralph from plain conversational mention', () => {
251
+ const match = detectPrimaryKeyword('why does ralph keep blocking stop?');
252
+ assert.equal(match, null);
253
+ });
254
+ it('still triggers ralph for explicit $ralph invocation', () => {
255
+ const match = detectPrimaryKeyword('$ralph continue verification');
256
+ assert.ok(match);
257
+ assert.equal(match.skill, 'ralph');
258
+ assert.equal(match.keyword.toLowerCase(), '$ralph');
259
+ });
260
+ it('prefers ralplan over ralph follow-up language when both implicit routes are present', () => {
261
+ const match = detectPrimaryKeyword('keep going but do consensus plan first');
262
+ assert.ok(match);
263
+ assert.equal(match.skill, 'ralplan');
264
+ });
265
+ it('applies longest-match tie-breaker when priorities are equal', () => {
266
+ const match = detectPrimaryKeyword('please run a deep interview for this');
267
+ assert.ok(match);
268
+ assert.equal(match.skill, 'deep-interview');
269
+ assert.equal(match.keyword.toLowerCase(), 'deep interview');
270
+ });
271
+ it('maps "deep interview" phrase to deep-interview skill', () => {
272
+ const match = detectPrimaryKeyword('please run a deep interview before planning');
273
+ assert.ok(match);
274
+ assert.equal(match.skill, 'deep-interview');
275
+ assert.equal(match.keyword.toLowerCase(), 'deep interview');
276
+ });
277
+ it('does not trigger deep-interview from cleanup or state-management mentions', () => {
278
+ assert.equal(detectPrimaryKeyword('clear deep interview state before continuing'), null);
279
+ assert.equal(detectPrimaryKeyword('cleanup stale deep-interview state after session clear'), null);
280
+ assert.equal(detectPrimaryKeyword('remove the stale deep interview lock from .omx/state'), null);
281
+ });
282
+ it('does not trigger deep-interview from casual discussion mentions', () => {
283
+ assert.equal(detectPrimaryKeyword('the deep interview report is useful context for the next plan'), null);
284
+ assert.equal(detectPrimaryKeyword('we already did a deep interview and should not reactivate it'), null);
285
+ assert.equal(detectPrimaryKeyword('this interview transcript says implementation is ready'), null);
286
+ });
287
+ it('maps "gather requirements" to deep-interview skill', () => {
288
+ const match = detectPrimaryKeyword('let us gather requirements first');
289
+ assert.ok(match);
290
+ assert.equal(match.skill, 'deep-interview');
291
+ assert.equal(match.keyword.toLowerCase(), 'gather requirements');
292
+ });
293
+ it('maps "ouroboros" to deep-interview skill', () => {
294
+ const match = detectPrimaryKeyword('please run ouroboros before planning');
295
+ assert.ok(match);
296
+ assert.equal(match.skill, 'deep-interview');
297
+ assert.equal(match.keyword.toLowerCase(), 'ouroboros');
298
+ });
299
+ it('maps "interview me" to deep-interview skill', () => {
300
+ const match = detectPrimaryKeyword('interview me before we start implementation');
301
+ assert.ok(match);
302
+ assert.equal(match.skill, 'deep-interview');
303
+ assert.equal(match.keyword.toLowerCase(), 'interview me');
304
+ });
305
+ it('maps "don\'t assume" to deep-interview skill', () => {
306
+ const match = detectPrimaryKeyword("don't assume anything yet");
307
+ assert.ok(match);
308
+ assert.equal(match.skill, 'deep-interview');
309
+ assert.equal(match.keyword.toLowerCase(), "don't assume");
310
+ });
311
+ it('prefers "deep interview" over "interview" for deterministic longest-match behavior', () => {
312
+ const match = detectPrimaryKeyword('deep interview this request first');
313
+ assert.ok(match);
314
+ assert.equal(match.skill, 'deep-interview');
315
+ assert.equal(match.keyword.toLowerCase(), 'deep interview');
316
+ });
317
+ it('treats direct abort commands as cancel intent', () => {
318
+ const match = detectPrimaryKeyword('abort now');
319
+ assert.ok(match);
320
+ assert.equal(match.skill, 'cancel');
321
+ assert.equal(match.keyword.toLowerCase(), 'abort');
322
+ });
323
+ it('treats direct stop commands as cancel intent', () => {
324
+ const match = detectPrimaryKeyword('stop now');
325
+ assert.ok(match);
326
+ assert.equal(match.skill, 'cancel');
327
+ assert.equal(match.keyword.toLowerCase(), 'stop');
328
+ });
329
+ it('does not trigger cancel from incidental stop/abort test-log prose', () => {
330
+ assert.equal(detectPrimaryKeyword('FAIL should stop retrying after max attempts'), null);
331
+ assert.equal(detectPrimaryKeyword('PASS request aborted when upstream returns 499'), null);
332
+ });
333
+ it('does not trigger ultrawork from incidental parallel test-log prose', () => {
334
+ assert.equal(detectPrimaryKeyword('PASS runs assertions in parallel when sharding is enabled'), null);
335
+ assert.equal(detectPrimaryKeyword('running 8 tests in parallel across 4 workers'), null);
336
+ });
337
+ it('normalizes the Korean keyboard typo for ulw to ultrawork only', () => {
338
+ const match = detectPrimaryKeyword('ㅕㅣㅈ로 이 작업 처리해줘');
339
+ assert.ok(match);
340
+ assert.equal(match.skill, 'ultrawork');
341
+ assert.equal(match.keyword, 'ulw');
342
+ const explicitMatch = detectPrimaryKeyword('$ㅕㅣㅈ로 이 작업 처리해줘');
343
+ assert.ok(explicitMatch);
344
+ assert.equal(explicitMatch.skill, 'ultrawork');
345
+ assert.equal(explicitMatch.keyword, '$ulw');
346
+ assert.equal(detectPrimaryKeyword('ㅁㅔㅔ로 처리해줘'), null);
347
+ });
348
+ });
349
+ describe('autoresearch keyword detection', () => {
350
+ it('detects explicit $autoresearch invocation', () => {
351
+ const match = detectPrimaryKeyword('please run $autoresearch now');
352
+ assert.ok(match);
353
+ assert.equal(match.skill, 'autoresearch');
354
+ assert.equal(match.keyword.toLowerCase(), '$autoresearch');
355
+ });
356
+ it('does not detect bare autoresearch phrasing without explicit $ invocation', () => {
357
+ const match = detectPrimaryKeyword('please use autoresearch workflow for this mission');
358
+ assert.equal(match, null);
359
+ });
360
+ it('does not trigger autoresearch from incidental prose', () => {
361
+ const match = detectPrimaryKeyword('Karpathy did autoresearch before native hooks existed');
362
+ assert.equal(match, null);
363
+ });
364
+ });
365
+ describe('explicit skill-name invocation requirement', () => {
366
+ it('does not trigger analyze from bare skill-name usage', () => {
367
+ assert.equal(detectPrimaryKeyword('please analyze this workflow'), null);
368
+ });
369
+ it('does not trigger autoresearch from bare skill-name usage', () => {
370
+ assert.equal(detectPrimaryKeyword('please run autoresearch now'), null);
371
+ });
372
+ it('does not trigger ralph from bare skill-name usage', () => {
373
+ assert.equal(detectPrimaryKeyword('please use ralph for this task'), null);
374
+ });
375
+ it('does not trigger ralplan from bare skill-name usage', () => {
376
+ assert.equal(detectPrimaryKeyword('please do ralplan first'), null);
377
+ });
378
+ it('detects explicit prometheus-strict invocation only', () => {
379
+ const match = detectPrimaryKeyword('please run $prometheus-strict before implementation');
380
+ assert.ok(match);
381
+ assert.equal(match.skill, 'prometheus-strict');
382
+ assert.equal(match.keyword.toLowerCase(), '$prometheus-strict');
383
+ assert.equal(detectPrimaryKeyword('please use prometheus-strict planning here'), null);
384
+ });
385
+ });
386
+ describe('keyword registry coverage', () => {
387
+ it('includes key team aliases in runtime keyword registry', () => {
388
+ const registryKeywords = new Set(KEYWORD_TRIGGER_DEFINITIONS.map((v) => v.keyword.toLowerCase()));
389
+ assert.ok(registryKeywords.has('$ultraqa'));
390
+ assert.ok(registryKeywords.has('$analyze'));
391
+ assert.ok(registryKeywords.has('investigate'));
392
+ assert.ok(registryKeywords.has('code review'));
393
+ assert.ok(registryKeywords.has('$code-review'));
394
+ assert.ok(registryKeywords.has('$best-practice-research'));
395
+ assert.ok(registryKeywords.has('coordinated team'));
396
+ assert.ok(registryKeywords.has('ouroboros'));
397
+ assert.ok(registryKeywords.has("don't assume"));
398
+ assert.ok(registryKeywords.has('interview me'));
399
+ assert.ok(registryKeywords.has('wiki query'));
400
+ assert.ok(registryKeywords.has('wiki add'));
401
+ assert.ok(registryKeywords.has('wiki lint'));
402
+ assert.ok(registryKeywords.has('$autoresearch'));
403
+ assert.ok(registryKeywords.has('$ultragoal'));
404
+ assert.ok(registryKeywords.has('$prometheus-strict'));
405
+ assert.ok(registryKeywords.has('ultragoal'));
406
+ assert.ok(registryKeywords.has('autopilot'));
407
+ });
408
+ });
409
+ describe('keyword detector skill-active-state lifecycle', () => {
410
+ it('co-locates direct boxed activation mode detail and canonical skill state for OMX_ROOT', async () => {
411
+ const root = await mkdtemp(join(tmpdir(), 'omx-keyword-boxed-root-'));
412
+ const sourceCwd = join(root, 'source');
413
+ const omxRoot = join(root, 'box');
414
+ const stateDir = join(omxRoot, '.omx', 'state');
415
+ const previousOmxRoot = process.env.OMX_ROOT;
416
+ const previousOmxStateRoot = process.env.OMX_STATE_ROOT;
417
+ const previousTeamStateRoot = process.env.OMX_TEAM_STATE_ROOT;
418
+ try {
419
+ await mkdir(sourceCwd, { recursive: true });
420
+ process.env.OMX_ROOT = omxRoot;
421
+ delete process.env.OMX_STATE_ROOT;
422
+ delete process.env.OMX_TEAM_STATE_ROOT;
423
+ const result = await recordSkillActivation({
424
+ stateDir,
425
+ sourceCwd,
426
+ text: '$ralplan implement issue #1307',
427
+ sessionId: 'sess-boxed-ralplan',
428
+ threadId: 'thread-boxed',
429
+ turnId: 'turn-boxed',
430
+ nowIso: '2026-05-10T00:00:00.000Z',
431
+ });
432
+ assert.ok(result);
433
+ assert.equal(result.skill, 'ralplan');
434
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-boxed-ralplan', SKILL_ACTIVE_STATE_FILE)), true);
435
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-boxed-ralplan', 'ralplan-state.json')), true);
436
+ assert.equal(existsSync(join(sourceCwd, '.omx', 'state', 'sessions', 'sess-boxed-ralplan', SKILL_ACTIVE_STATE_FILE)), false);
437
+ assert.equal(existsSync(join(sourceCwd, '.omx', 'state', 'sessions', 'sess-boxed-ralplan', 'ralplan-state.json')), false);
438
+ }
439
+ finally {
440
+ if (typeof previousOmxRoot === 'string')
441
+ process.env.OMX_ROOT = previousOmxRoot;
442
+ else
443
+ delete process.env.OMX_ROOT;
444
+ if (typeof previousOmxStateRoot === 'string')
445
+ process.env.OMX_STATE_ROOT = previousOmxStateRoot;
446
+ else
447
+ delete process.env.OMX_STATE_ROOT;
448
+ if (typeof previousTeamStateRoot === 'string')
449
+ process.env.OMX_TEAM_STATE_ROOT = previousTeamStateRoot;
450
+ else
451
+ delete process.env.OMX_TEAM_STATE_ROOT;
452
+ await rm(root, { recursive: true, force: true });
453
+ }
454
+ });
455
+ it('co-locates direct boxed activation mode detail and canonical skill state for OMX_STATE_ROOT', async () => {
456
+ const root = await mkdtemp(join(tmpdir(), 'omx-keyword-boxed-state-root-'));
457
+ const sourceCwd = join(root, 'source');
458
+ const stateRoot = join(root, 'state-root');
459
+ const stateDir = join(stateRoot, '.omx', 'state');
460
+ const previousOmxRoot = process.env.OMX_ROOT;
461
+ const previousOmxStateRoot = process.env.OMX_STATE_ROOT;
462
+ const previousTeamStateRoot = process.env.OMX_TEAM_STATE_ROOT;
463
+ try {
464
+ await mkdir(sourceCwd, { recursive: true });
465
+ delete process.env.OMX_ROOT;
466
+ process.env.OMX_STATE_ROOT = stateRoot;
467
+ delete process.env.OMX_TEAM_STATE_ROOT;
468
+ const result = await recordSkillActivation({
469
+ stateDir,
470
+ sourceCwd,
471
+ text: '$ralplan implement issue #1307',
472
+ sessionId: 'sess-state-root-ralplan',
473
+ threadId: 'thread-state-root',
474
+ turnId: 'turn-state-root',
475
+ nowIso: '2026-05-10T00:00:00.000Z',
476
+ });
477
+ assert.ok(result);
478
+ assert.equal(result.skill, 'ralplan');
479
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-state-root-ralplan', SKILL_ACTIVE_STATE_FILE)), true);
480
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-state-root-ralplan', 'ralplan-state.json')), true);
481
+ assert.equal(existsSync(join(sourceCwd, '.omx', 'state', 'sessions', 'sess-state-root-ralplan', SKILL_ACTIVE_STATE_FILE)), false);
482
+ assert.equal(existsSync(join(sourceCwd, '.omx', 'state', 'sessions', 'sess-state-root-ralplan', 'ralplan-state.json')), false);
483
+ }
484
+ finally {
485
+ if (typeof previousOmxRoot === 'string')
486
+ process.env.OMX_ROOT = previousOmxRoot;
487
+ else
488
+ delete process.env.OMX_ROOT;
489
+ if (typeof previousOmxStateRoot === 'string')
490
+ process.env.OMX_STATE_ROOT = previousOmxStateRoot;
491
+ else
492
+ delete process.env.OMX_STATE_ROOT;
493
+ if (typeof previousTeamStateRoot === 'string')
494
+ process.env.OMX_TEAM_STATE_ROOT = previousTeamStateRoot;
495
+ else
496
+ delete process.env.OMX_TEAM_STATE_ROOT;
497
+ await rm(root, { recursive: true, force: true });
498
+ }
499
+ });
500
+ it('writes skill-active-state.json with deep-interview phase when autopilot keyword activates', async () => {
501
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-'));
502
+ const stateDir = join(cwd, '.omx', 'state');
503
+ try {
504
+ await mkdir(stateDir, { recursive: true });
505
+ const result = await recordSkillActivation({
506
+ stateDir,
507
+ text: 'please run $autopilot and keep going',
508
+ sessionId: 'sess-1',
509
+ threadId: 'thread-1',
510
+ turnId: 'turn-1',
511
+ nowIso: '2026-02-25T00:00:00.000Z',
512
+ });
513
+ assert.ok(result);
514
+ assert.equal(result.skill, 'autopilot');
515
+ assert.equal(result.phase, 'deep-interview');
516
+ assert.equal(result.active, true);
517
+ assert.deepEqual(result.active_skills, [{
518
+ skill: 'autopilot',
519
+ phase: 'deep-interview',
520
+ active: true,
521
+ activated_at: '2026-02-25T00:00:00.000Z',
522
+ updated_at: '2026-02-25T00:00:00.000Z',
523
+ session_id: 'sess-1',
524
+ thread_id: 'thread-1',
525
+ turn_id: 'turn-1',
526
+ }]);
527
+ assert.equal(result.initialized_mode, 'autopilot');
528
+ assert.equal(result.initialized_state_path, '.omx/state/sessions/sess-1/autopilot-state.json');
529
+ assert.equal(existsSync(join(stateDir, SKILL_ACTIVE_STATE_FILE)), false, 'session-scoped non-Ralph activation should not create root canonical state when no root state exists');
530
+ const sessionScopedSkillState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-1', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
531
+ assert.deepEqual(sessionScopedSkillState.active_skills, result.active_skills);
532
+ assert.equal(sessionScopedSkillState.initialized_mode, 'autopilot');
533
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-1', 'autopilot-state.json'), 'utf-8'));
534
+ assert.equal(modeState.mode, 'autopilot');
535
+ assert.equal(modeState.active, true);
536
+ assert.equal(modeState.current_phase, 'deep-interview');
537
+ assert.equal(modeState.iteration, 1);
538
+ assert.equal(modeState.review_cycle, 0);
539
+ assert.equal(modeState.max_iterations, 10);
540
+ assert.deepEqual(modeState.state.phase_cycle, ['deep-interview', 'ralplan', 'ultragoal', 'code-review', 'ultraqa']);
541
+ assert.deepEqual(modeState.state.deep_interview_gate, {
542
+ status: 'required',
543
+ skip_reason: null,
544
+ rationale: 'Autopilot starts at the deep-interview gate by default; clear bounded tasks may skip only with an explicit persisted skip reason.',
545
+ });
546
+ assert.deepEqual(modeState.state.handoff_artifacts, {
547
+ context_snapshot_path: '.omx/context/please-run-and-keep-going-20260225T000000Z.md',
548
+ context_snapshot: {
549
+ path: '.omx/context/please-run-and-keep-going-20260225T000000Z.md',
550
+ kind: 'canonical',
551
+ original_task_status: 'activation-prompt',
552
+ },
553
+ deep_interview: null,
554
+ ralplan: null,
555
+ ralplan_consensus_gate: {
556
+ required: true,
557
+ sequence: ['architect-review', 'critic-review'],
558
+ planning_artifacts_are_not_consensus: true,
559
+ required_review_roles: ['architect', 'critic'],
560
+ ralplan_architect_review: null,
561
+ ralplan_critic_review: null,
562
+ complete: false,
563
+ },
564
+ ultragoal: null,
565
+ code_review: null,
566
+ ultraqa: null,
567
+ });
568
+ assert.equal(modeState.state.review_verdict, null);
569
+ assert.equal(modeState.state.qa_verdict, null);
570
+ assert.equal(modeState.state.return_to_ralplan_reason, null);
571
+ const snapshot = await readFile(join(cwd, '.omx', 'context', 'please-run-and-keep-going-20260225T000000Z.md'), 'utf-8');
572
+ assert.match(snapshot, /activation prompt \/ task seed: please run \$autopilot and keep going/);
573
+ assert.match(snapshot, /scope note: this seed captures the Autopilot activation prompt/);
574
+ }
575
+ finally {
576
+ await rm(cwd, { recursive: true, force: true });
577
+ }
578
+ });
579
+ it('migrates legacy Autopilot context snapshot paths into handoff artifacts', async () => {
580
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-legacy-context-'));
581
+ const stateDir = join(cwd, '.omx', 'state');
582
+ const sessionId = 'sess-autopilot-legacy-context';
583
+ try {
584
+ await writeActiveAutopilotSkillState(stateDir, sessionId, 'deep-interview');
585
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
586
+ active: true,
587
+ mode: 'autopilot',
588
+ current_phase: 'deep-interview',
589
+ started_at: AUTOPILOT_TEST_STARTED_AT,
590
+ context_snapshot_path: '.omx/context/legacy-task-20260529T000000Z.md',
591
+ state: { handoff_artifacts: { deep_interview: null } },
592
+ }, null, 2));
593
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
594
+ await writeFile(join(cwd, '.omx', 'context', 'legacy-task-20260529T000000Z.md'), '# legacy task');
595
+ await continueAutopilotTestState(stateDir, cwd, sessionId, 'legacy');
596
+ const modeState = await readAutopilotModeState(stateDir, sessionId);
597
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/legacy-task-20260529T000000Z.md');
598
+ assert.deepEqual(modeState.state?.handoff_artifacts?.context_snapshot, {
599
+ path: '.omx/context/legacy-task-20260529T000000Z.md',
600
+ kind: 'legacy',
601
+ original_task_status: 'legacy-unverified',
602
+ });
603
+ assert.equal(existsSync(join(cwd, '.omx', 'context', 'continue-20260530T000000Z.md')), false);
604
+ }
605
+ finally {
606
+ await rm(cwd, { recursive: true, force: true });
607
+ }
608
+ });
609
+ it('rejects unsafe legacy Autopilot context snapshot paths without writing outside .omx/context', async () => {
610
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-unsafe-context-'));
611
+ const stateDir = join(cwd, '.omx', 'state');
612
+ const sessionId = 'sess-autopilot-unsafe-context';
613
+ try {
614
+ await writeActiveAutopilotSkillState(stateDir, sessionId, 'deep-interview');
615
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
616
+ active: true,
617
+ mode: 'autopilot',
618
+ current_phase: 'deep-interview',
619
+ started_at: AUTOPILOT_TEST_STARTED_AT,
620
+ context_snapshot_path: '.omx/context/../../escape.md',
621
+ state: { handoff_artifacts: { deep_interview: null } },
622
+ }, null, 2));
623
+ const result = await recordSkillActivation({
624
+ stateDir,
625
+ text: 'continue',
626
+ sessionId,
627
+ threadId: 'thread-unsafe',
628
+ turnId: 'turn-unsafe',
629
+ nowIso: '2026-05-30T00:00:00.000Z',
630
+ });
631
+ assert.ok(result);
632
+ assert.equal(existsSync(join(cwd, '.omx', 'escape.md')), false);
633
+ const modeState = await readAutopilotModeState(stateDir, sessionId);
634
+ assert.equal(modeState.context_snapshot_path, undefined);
635
+ await assertAutopilotRecoverySnapshot(cwd, modeState, '.omx/context/autopilot-recovery-20260530T000000Z.md', 'missing-or-unsafe-legacy-context-snapshot');
636
+ }
637
+ finally {
638
+ await rm(cwd, { recursive: true, force: true });
639
+ }
640
+ });
641
+ it('does not snapshot bare continuation text when active Autopilot mode state is corrupt', async () => {
642
+ const expectedReasons = {
643
+ 'missing-current-phase': 'nonpreservable-autopilot-mode-state-missing-current-phase',
644
+ 'malformed-json': 'malformed-autopilot-mode-state',
645
+ 'array-json': 'malformed-autopilot-mode-state',
646
+ };
647
+ for (const fixture of ['missing-current-phase', 'malformed-json', 'array-json']) {
648
+ const cwd = await mkdtemp(join(tmpdir(), `omx-keyword-autopilot-corrupt-continuation-${fixture}-`));
649
+ const stateDir = join(cwd, '.omx', 'state');
650
+ const sessionId = `sess-autopilot-corrupt-continuation-${fixture}`;
651
+ try {
652
+ await writeActiveAutopilotSkillState(stateDir, sessionId);
653
+ const modeStatePath = join(stateDir, 'sessions', sessionId, 'autopilot-state.json');
654
+ if (fixture === 'missing-current-phase') {
655
+ await writeFile(modeStatePath, JSON.stringify({
656
+ active: true,
657
+ mode: 'autopilot',
658
+ started_at: AUTOPILOT_TEST_STARTED_AT,
659
+ state: { handoff_artifacts: {} },
660
+ }, null, 2));
661
+ }
662
+ else if (fixture === 'malformed-json') {
663
+ await writeFile(modeStatePath, '{ "active": true, "mode": "autopilot",');
664
+ }
665
+ else {
666
+ await writeFile(modeStatePath, '[]');
667
+ }
668
+ await continueAutopilotTestState(stateDir, cwd, sessionId, fixture);
669
+ assert.equal(existsSync(join(cwd, '.omx', 'context', 'continue-20260530T000000Z.md')), false);
670
+ await assertAutopilotRecoverySnapshot(cwd, JSON.parse(await readFile(modeStatePath, 'utf-8')), /^\.omx\/context\/autopilot-recovery-20260530T000000Z(?:-\d+)?\.md$/, expectedReasons[fixture]);
671
+ }
672
+ finally {
673
+ await rm(cwd, { recursive: true, force: true });
674
+ }
675
+ }
676
+ });
677
+ it('rejects nested symlink Autopilot context snapshot candidates during reuse', async () => {
678
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-nested-symlink-context-'));
679
+ const outside = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-nested-symlink-outside-'));
680
+ const stateDir = join(cwd, '.omx', 'state');
681
+ const sessionId = 'sess-autopilot-nested-symlink-context';
682
+ try {
683
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
684
+ await symlink(outside, join(cwd, '.omx', 'context', 'link'));
685
+ await writeFile(join(outside, 'exfil.md'), '# outside context');
686
+ await writeActiveAutopilotSkillState(stateDir, sessionId);
687
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
688
+ active: true,
689
+ mode: 'autopilot',
690
+ current_phase: 'ralplan',
691
+ started_at: AUTOPILOT_TEST_STARTED_AT,
692
+ state: { handoff_artifacts: { context_snapshot_path: '.omx/context/link/exfil.md' } },
693
+ }, null, 2));
694
+ await continueAutopilotTestState(stateDir, cwd, sessionId, 'nested-symlink');
695
+ await assertAutopilotRecoverySnapshot(cwd, await readAutopilotModeState(stateDir, sessionId), '.omx/context/autopilot-recovery-20260530T000000Z.md', 'missing-or-unsafe-legacy-context-snapshot');
696
+ assert.equal(existsSync(join(outside, 'exfil.md')), true);
697
+ }
698
+ finally {
699
+ await rm(cwd, { recursive: true, force: true });
700
+ await rm(outside, { recursive: true, force: true });
701
+ }
702
+ });
703
+ it('rejects typed canonical Autopilot recovery snapshot candidates during reuse', async () => {
704
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-typed-recovery-context-'));
705
+ const stateDir = join(cwd, '.omx', 'state');
706
+ const sessionId = 'sess-autopilot-typed-recovery-context';
707
+ try {
708
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
709
+ await writeFile(join(cwd, '.omx', 'context', 'autopilot-recovery-20260529T000000Z.md'), '# stale degraded recovery');
710
+ await writeActiveAutopilotSkillState(stateDir, sessionId);
711
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
712
+ active: true,
713
+ mode: 'autopilot',
714
+ current_phase: 'ralplan',
715
+ started_at: AUTOPILOT_TEST_STARTED_AT,
716
+ state: {
717
+ handoff_artifacts: {
718
+ context_snapshot: {
719
+ path: '.omx/context/autopilot-recovery-20260529T000000Z.md',
720
+ kind: 'canonical',
721
+ },
722
+ },
723
+ },
724
+ }, null, 2));
725
+ await continueAutopilotTestState(stateDir, cwd, sessionId, 'typed-recovery');
726
+ await assertAutopilotRecoverySnapshot(cwd, await readAutopilotModeState(stateDir, sessionId), '.omx/context/autopilot-recovery-20260530T000000Z.md', 'missing-or-unsafe-legacy-context-snapshot');
727
+ assert.equal(existsSync(join(cwd, '.omx', 'context', 'autopilot-recovery-20260529T000000Z.md')), true);
728
+ }
729
+ finally {
730
+ await rm(cwd, { recursive: true, force: true });
731
+ }
732
+ });
733
+ it('rejects oversized Autopilot context snapshot candidates during reuse', async () => {
734
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-oversized-context-'));
735
+ const stateDir = join(cwd, '.omx', 'state');
736
+ const sessionId = 'sess-autopilot-oversized-context';
737
+ try {
738
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
739
+ await writeFile(join(cwd, '.omx', 'context', 'oversized-legacy-20260529T000000Z.md'), 'x'.repeat((1024 * 1024) + 1));
740
+ await writeActiveAutopilotSkillState(stateDir, sessionId);
741
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
742
+ active: true,
743
+ mode: 'autopilot',
744
+ current_phase: 'ralplan',
745
+ started_at: AUTOPILOT_TEST_STARTED_AT,
746
+ state: {
747
+ handoff_artifacts: {
748
+ context_snapshot_path: '.omx/context/oversized-legacy-20260529T000000Z.md',
749
+ },
750
+ },
751
+ }, null, 2));
752
+ await continueAutopilotTestState(stateDir, cwd, sessionId, 'oversized-context');
753
+ await assertAutopilotRecoverySnapshot(cwd, await readAutopilotModeState(stateDir, sessionId), '.omx/context/autopilot-recovery-20260530T000000Z.md', 'missing-or-unsafe-legacy-context-snapshot');
754
+ assert.equal(existsSync(join(cwd, '.omx', 'context', 'oversized-legacy-20260529T000000Z.md')), true);
755
+ }
756
+ finally {
757
+ await rm(cwd, { recursive: true, force: true });
758
+ }
759
+ });
760
+ it('does not promote degraded recovery snapshots to canonical context on reactivation', async () => {
761
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-recovery-reactivation-'));
762
+ const stateDir = join(cwd, '.omx', 'state');
763
+ const sessionId = 'sess-autopilot-recovery-reactivation';
764
+ try {
765
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
766
+ await writeFile(join(cwd, '.omx', 'context', 'autopilot-recovery-20260529T000000Z.md'), '# degraded recovery');
767
+ await writeActiveAutopilotSkillState(stateDir, sessionId, 'complete');
768
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
769
+ active: true,
770
+ mode: 'autopilot',
771
+ current_phase: 'complete',
772
+ completed_at: AUTOPILOT_TEST_UPDATED_AT,
773
+ state: {
774
+ handoff_artifacts: {
775
+ context_snapshot_path: '.omx/context/autopilot-recovery-20260529T000000Z.md',
776
+ context_snapshot: {
777
+ path: '.omx/context/autopilot-recovery-20260529T000000Z.md',
778
+ kind: 'recovery',
779
+ recovery: { status: 'degraded', reason: 'missing-or-unsafe-legacy-context-snapshot' },
780
+ },
781
+ },
782
+ context_snapshot_recovery: { status: 'degraded', reason: 'missing-or-unsafe-legacy-context-snapshot' },
783
+ },
784
+ }, null, 2));
785
+ await continueAutopilotTestState(stateDir, cwd, sessionId, 'recovery-reactivation', '$autopilot implement the real task');
786
+ const modeState = await readAutopilotModeState(stateDir, sessionId);
787
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/implement-the-real-task-20260530T000000Z.md');
788
+ assert.deepEqual(modeState.state?.handoff_artifacts?.context_snapshot, {
789
+ path: '.omx/context/implement-the-real-task-20260530T000000Z.md',
790
+ kind: 'canonical',
791
+ original_task_status: 'activation-prompt',
792
+ });
793
+ assert.equal(modeState.state?.context_snapshot_recovery, undefined);
794
+ const snapshot = await readFile(join(cwd, '.omx', 'context', 'implement-the-real-task-20260530T000000Z.md'), 'utf-8');
795
+ assert.match(snapshot, /activation prompt \/ task seed: \$autopilot implement the real task/);
796
+ }
797
+ finally {
798
+ await rm(cwd, { recursive: true, force: true });
799
+ }
800
+ });
801
+ it('does not follow symlinked Autopilot context directories when writing snapshots', async () => {
802
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-symlink-context-'));
803
+ const outside = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-symlink-outside-'));
804
+ const stateDir = join(cwd, '.omx', 'state');
805
+ try {
806
+ await mkdir(join(cwd, '.omx'), { recursive: true });
807
+ await symlink(outside, join(cwd, '.omx', 'context'));
808
+ await mkdir(stateDir, { recursive: true });
809
+ const warnings = [];
810
+ mock.method(console, 'warn', (...args) => {
811
+ warnings.push(args);
812
+ });
813
+ await recordSkillActivation({
814
+ stateDir,
815
+ sourceCwd: cwd,
816
+ text: '$autopilot symlink escape',
817
+ sessionId: 'sess-autopilot-symlink-context',
818
+ threadId: 'thread-symlink-context',
819
+ turnId: 'turn-symlink-context',
820
+ nowIso: '2026-05-30T00:00:00.000Z',
821
+ });
822
+ assert.equal(warnings.length, 1);
823
+ assert.match(String(warnings[0][1]), /symbolic link/);
824
+ assert.equal(existsSync(join(outside, 'symlink-escape-20260530T000000Z.md')), false);
825
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-autopilot-symlink-context', 'autopilot-state.json')), false);
826
+ }
827
+ finally {
828
+ await rm(cwd, { recursive: true, force: true });
829
+ await rm(outside, { recursive: true, force: true });
830
+ }
831
+ });
832
+ it('allocates unique Autopilot context snapshot paths for same-second matching slugs', async () => {
833
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-context-collision-'));
834
+ const stateDir = join(cwd, '.omx', 'state');
835
+ try {
836
+ await mkdir(stateDir, { recursive: true });
837
+ await recordSkillActivation({
838
+ stateDir,
839
+ sourceCwd: cwd,
840
+ text: '$autopilot same task',
841
+ sessionId: 'sess-autopilot-collision-a',
842
+ threadId: 'thread-collision',
843
+ turnId: 'turn-collision-a',
844
+ nowIso: '2026-05-30T00:00:00.000Z',
845
+ });
846
+ await recordSkillActivation({
847
+ stateDir,
848
+ sourceCwd: cwd,
849
+ text: '$autopilot same task',
850
+ sessionId: 'sess-autopilot-collision-b',
851
+ threadId: 'thread-collision',
852
+ turnId: 'turn-collision-b',
853
+ nowIso: '2026-05-30T00:00:00.000Z',
854
+ });
855
+ const first = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-autopilot-collision-a', 'autopilot-state.json'), 'utf-8'));
856
+ const second = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-autopilot-collision-b', 'autopilot-state.json'), 'utf-8'));
857
+ assert.equal(first.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/same-task-20260530T000000Z.md');
858
+ assert.equal(second.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/same-task-20260530T000000Z-2.md');
859
+ }
860
+ finally {
861
+ await rm(cwd, { recursive: true, force: true });
862
+ }
863
+ });
864
+ it('fully resets terminal Autopilot mode state when reactivated', async () => {
865
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autopilot-terminal-reset-'));
866
+ const stateDir = join(cwd, '.omx', 'state');
867
+ const sessionId = 'sess-autopilot-terminal-reset';
868
+ try {
869
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
870
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
871
+ version: 1,
872
+ active: true,
873
+ skill: 'autopilot',
874
+ keyword: '$autopilot',
875
+ phase: 'complete',
876
+ activated_at: '2026-05-29T00:00:00.000Z',
877
+ updated_at: '2026-05-29T00:00:00.000Z',
878
+ session_id: sessionId,
879
+ active_skills: [{ skill: 'autopilot', active: true, phase: 'complete', session_id: sessionId }],
880
+ }, null, 2));
881
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
882
+ active: true,
883
+ mode: 'autopilot',
884
+ current_phase: 'complete',
885
+ started_at: '2026-05-29T00:00:00.000Z',
886
+ completed_at: '2026-05-29T00:10:00.000Z',
887
+ iteration: 10,
888
+ max_iterations: 10,
889
+ review_cycle: 3,
890
+ lifecycle_outcome: 'finished',
891
+ run_outcome: 'finish',
892
+ handoff_artifacts: {
893
+ code_review: { verdict: 'APPROVE / CLEAR' },
894
+ ultraqa: { verdict: 'pass' },
895
+ },
896
+ state: {
897
+ handoff_artifacts: {
898
+ ralplan_consensus_gate: { complete: false },
899
+ code_review: { verdict: 'stale' },
900
+ },
901
+ },
902
+ }, null, 2));
903
+ const result = await recordSkillActivation({
904
+ stateDir,
905
+ text: '$autopilot investigate the next issue',
906
+ sessionId,
907
+ threadId: 'thread-reactivated',
908
+ turnId: 'turn-reactivated',
909
+ nowIso: '2026-05-30T00:00:00.000Z',
910
+ });
911
+ assert.ok(result);
912
+ assert.equal(result.skill, 'autopilot');
913
+ assert.equal(result.phase, 'deep-interview');
914
+ assert.equal(result.activated_at, '2026-05-30T00:00:00.000Z');
915
+ assert.equal(result.active_skills?.[0]?.phase, 'deep-interview');
916
+ assert.equal(result.active_skills?.[0]?.activated_at, '2026-05-30T00:00:00.000Z');
917
+ const skillState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), 'utf-8'));
918
+ assert.equal(skillState.phase, 'deep-interview');
919
+ assert.equal(skillState.activated_at, '2026-05-30T00:00:00.000Z');
920
+ assert.equal(skillState.active_skills?.[0]?.phase, 'deep-interview');
921
+ assert.equal(skillState.active_skills?.[0]?.activated_at, '2026-05-30T00:00:00.000Z');
922
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), 'utf-8'));
923
+ assert.equal(modeState.active, true);
924
+ assert.equal(modeState.current_phase, 'deep-interview');
925
+ assert.equal(modeState.started_at, '2026-05-30T00:00:00.000Z');
926
+ assert.equal(modeState.completed_at, undefined);
927
+ assert.equal(modeState.iteration, 1);
928
+ assert.equal(modeState.max_iterations, 10);
929
+ assert.equal(modeState.review_cycle, 0);
930
+ assert.equal(modeState.lifecycle_outcome, undefined);
931
+ assert.equal(modeState.run_outcome, undefined);
932
+ assert.equal(modeState.handoff_artifacts, undefined);
933
+ assert.deepEqual(modeState.state?.handoff_artifacts, {
934
+ context_snapshot_path: '.omx/context/investigate-the-next-issue-20260530T000000Z.md',
935
+ context_snapshot: {
936
+ path: '.omx/context/investigate-the-next-issue-20260530T000000Z.md',
937
+ kind: 'canonical',
938
+ original_task_status: 'activation-prompt',
939
+ },
940
+ deep_interview: null,
941
+ ralplan: null,
942
+ ralplan_consensus_gate: {
943
+ required: true,
944
+ sequence: ['architect-review', 'critic-review'],
945
+ planning_artifacts_are_not_consensus: true,
946
+ required_review_roles: ['architect', 'critic'],
947
+ ralplan_architect_review: null,
948
+ ralplan_critic_review: null,
949
+ complete: false,
950
+ },
951
+ ultragoal: null,
952
+ code_review: null,
953
+ ultraqa: null,
954
+ });
955
+ }
956
+ finally {
957
+ await rm(cwd, { recursive: true, force: true });
958
+ }
959
+ });
960
+ it('resets stopped Autopilot mode state when reactivated', async () => {
961
+ for (const phase of ['stopped', 'user-stopped']) {
962
+ const cwd = await mkdtemp(join(tmpdir(), `omx-keyword-autopilot-${phase}-reset-`));
963
+ const stateDir = join(cwd, '.omx', 'state');
964
+ const sessionId = `sess-autopilot-${phase}-reset`;
965
+ try {
966
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
967
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
968
+ version: 1,
969
+ active: true,
970
+ skill: 'autopilot',
971
+ keyword: '$autopilot',
972
+ phase,
973
+ activated_at: '2026-05-29T00:00:00.000Z',
974
+ updated_at: '2026-05-29T00:00:00.000Z',
975
+ source: 'keyword-detector',
976
+ session_id: sessionId,
977
+ active_skills: [{ skill: 'autopilot', active: true, phase, session_id: sessionId }],
978
+ }, null, 2));
979
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
980
+ active: true,
981
+ mode: 'autopilot',
982
+ current_phase: phase,
983
+ started_at: '2026-05-29T00:00:00.000Z',
984
+ completed_at: '2026-05-29T00:10:00.000Z',
985
+ iteration: 10,
986
+ max_iterations: 10,
987
+ review_cycle: 3,
988
+ state: { handoff_artifacts: { code_review: { verdict: 'stale' } } },
989
+ }, null, 2));
990
+ const result = await recordSkillActivation({
991
+ stateDir,
992
+ text: '$autopilot new task after stop',
993
+ sessionId,
994
+ nowIso: '2026-05-30T00:00:00.000Z',
995
+ });
996
+ assert.ok(result);
997
+ assert.equal(result.phase, 'deep-interview');
998
+ assert.equal(result.activated_at, '2026-05-30T00:00:00.000Z');
999
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), 'utf-8'));
1000
+ assert.equal(modeState.current_phase, 'deep-interview');
1001
+ assert.equal(modeState.iteration, 1);
1002
+ assert.equal(modeState.review_cycle, 0);
1003
+ assert.equal(modeState.state?.handoff_artifacts?.code_review, null);
1004
+ }
1005
+ finally {
1006
+ await rm(cwd, { recursive: true, force: true });
1007
+ }
1008
+ }
1009
+ });
1010
+ it('adds approved workflow overlaps without deleting the existing canonical state', async () => {
1011
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-overlap-'));
1012
+ const stateDir = join(cwd, '.omx', 'state');
1013
+ try {
1014
+ await mkdir(stateDir, { recursive: true });
1015
+ await recordSkillActivation({
1016
+ stateDir,
1017
+ text: '$team ship this',
1018
+ sessionId: 'sess-overlap',
1019
+ threadId: 'thread-overlap',
1020
+ turnId: 'turn-1',
1021
+ nowIso: '2026-02-26T00:00:00.000Z',
1022
+ });
1023
+ const result = await recordSkillActivation({
1024
+ stateDir,
1025
+ text: '$ralph continue verification',
1026
+ sessionId: 'sess-overlap',
1027
+ threadId: 'thread-overlap',
1028
+ turnId: 'turn-2',
1029
+ nowIso: '2026-02-26T00:05:00.000Z',
1030
+ });
1031
+ assert.ok(result);
1032
+ assert.deepEqual(result.active_skills?.map((entry) => entry.skill), ['team', 'ralph']);
1033
+ const persisted = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-overlap', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
1034
+ assert.deepEqual(persisted.active_skills?.map((entry) => entry.skill), ['team', 'ralph']);
1035
+ }
1036
+ finally {
1037
+ await rm(cwd, { recursive: true, force: true });
1038
+ }
1039
+ });
1040
+ it('keeps a session-scoped Ralph activation out of the root canonical state for other sessions', async () => {
1041
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralph-isolation-'));
1042
+ const stateDir = join(cwd, '.omx', 'state');
1043
+ try {
1044
+ await mkdir(stateDir, { recursive: true });
1045
+ const result = await recordSkillActivation({
1046
+ stateDir,
1047
+ text: '$ralph continue verification',
1048
+ sessionId: 'sess-ralph-a',
1049
+ threadId: 'thread-ralph-a',
1050
+ turnId: 'turn-ralph-a',
1051
+ nowIso: '2026-04-14T00:00:00.000Z',
1052
+ });
1053
+ assert.ok(result);
1054
+ const rootSkillStatePath = join(stateDir, SKILL_ACTIVE_STATE_FILE);
1055
+ assert.equal(existsSync(rootSkillStatePath), false, 'session-scoped prompt activation should not create a root canonical skill state');
1056
+ const sessionScopedSkillState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralph-a', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
1057
+ assert.deepEqual(sessionScopedSkillState.active_skills, [{
1058
+ skill: 'ralph',
1059
+ phase: 'planning',
1060
+ active: true,
1061
+ activated_at: '2026-04-14T00:00:00.000Z',
1062
+ updated_at: '2026-04-14T00:00:00.000Z',
1063
+ session_id: 'sess-ralph-a',
1064
+ thread_id: 'thread-ralph-a',
1065
+ turn_id: 'turn-ralph-a',
1066
+ }]);
1067
+ }
1068
+ finally {
1069
+ await rm(cwd, { recursive: true, force: true });
1070
+ }
1071
+ });
1072
+ it('hard-fails denied workflow overlaps without mutating current state', async () => {
1073
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deny-'));
1074
+ const stateDir = join(cwd, '.omx', 'state');
1075
+ try {
1076
+ await mkdir(stateDir, { recursive: true });
1077
+ await recordSkillActivation({
1078
+ stateDir,
1079
+ text: '$team ship this',
1080
+ sessionId: 'sess-deny',
1081
+ threadId: 'thread-deny',
1082
+ turnId: 'turn-1',
1083
+ nowIso: '2026-02-26T00:00:00.000Z',
1084
+ });
1085
+ const denied = await recordSkillActivation({
1086
+ stateDir,
1087
+ text: '$autopilot do it too',
1088
+ sessionId: 'sess-deny',
1089
+ threadId: 'thread-deny',
1090
+ turnId: 'turn-2',
1091
+ nowIso: '2026-02-26T00:05:00.000Z',
1092
+ });
1093
+ assert.ok(denied?.transition_error);
1094
+ assert.match(String(denied?.transition_error), /Unsupported workflow overlap: team \+ autopilot\./);
1095
+ assert.match(String(denied?.transition_error), /`omx state clear --input '{"mode":"<mode>"}' --json`/);
1096
+ assert.match(String(denied?.transition_error), /explicit MCP compatibility is enabled/);
1097
+ const persisted = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-deny', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
1098
+ assert.deepEqual(persisted.active_skills?.map((entry) => entry.skill), ['team']);
1099
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-deny', 'autopilot-state.json')), false);
1100
+ }
1101
+ finally {
1102
+ await rm(cwd, { recursive: true, force: true });
1103
+ }
1104
+ });
1105
+ it('denies prompt-submit overlaps against the current session-visible canonical state', async () => {
1106
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-session-visible-'));
1107
+ const stateDir = join(cwd, '.omx', 'state');
1108
+ try {
1109
+ await mkdir(join(stateDir, 'sessions', 'sess-visible'), { recursive: true });
1110
+ await writeFile(join(stateDir, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1111
+ version: 1,
1112
+ active: true,
1113
+ skill: 'team',
1114
+ active_skills: [
1115
+ { skill: 'team', phase: 'running', active: true },
1116
+ ],
1117
+ }, null, 2));
1118
+ await writeFile(join(stateDir, 'sessions', 'sess-visible', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1119
+ version: 1,
1120
+ active: true,
1121
+ skill: 'team',
1122
+ session_id: 'sess-visible',
1123
+ active_skills: [
1124
+ { skill: 'team', phase: 'running', active: true },
1125
+ { skill: 'ralph', phase: 'executing', active: true, session_id: 'sess-visible' },
1126
+ ],
1127
+ }, null, 2));
1128
+ const allowed = await recordSkillActivation({
1129
+ stateDir,
1130
+ text: '$ultrawork continue',
1131
+ sessionId: 'sess-visible',
1132
+ nowIso: '2026-04-10T00:00:00.000Z',
1133
+ });
1134
+ assert.equal(allowed?.transition_error, undefined);
1135
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-visible', 'ultrawork-state.json')), true);
1136
+ const persisted = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-visible', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
1137
+ assert.deepEqual(persisted.active_skills?.map((entry) => entry.skill), ['team', 'ralph', 'ultrawork']);
1138
+ }
1139
+ finally {
1140
+ await rm(cwd, { recursive: true, force: true });
1141
+ }
1142
+ });
1143
+ it('activates ultrawork mode from the Korean keyboard typo for ulw', async () => {
1144
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ulw-ko-'));
1145
+ const stateDir = join(cwd, '.omx', 'state');
1146
+ try {
1147
+ await mkdir(stateDir, { recursive: true });
1148
+ const result = await recordSkillActivation({
1149
+ stateDir,
1150
+ text: 'ㅕㅣㅈ로 병렬 처리해줘',
1151
+ sessionId: 'sess-ulw-ko',
1152
+ threadId: 'thread-ulw-ko',
1153
+ turnId: 'turn-ulw-ko',
1154
+ nowIso: '2026-04-21T00:00:00.000Z',
1155
+ });
1156
+ assert.ok(result);
1157
+ assert.equal(result.skill, 'ultrawork');
1158
+ assert.equal(result.keyword, 'ulw');
1159
+ assert.equal(result.initialized_mode, 'ultrawork');
1160
+ assert.equal(result.initialized_state_path, '.omx/state/sessions/sess-ulw-ko/ultrawork-state.json');
1161
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ulw-ko', 'ultrawork-state.json'), 'utf-8'));
1162
+ assert.equal(modeState.mode, 'ultrawork');
1163
+ assert.equal(modeState.active, true);
1164
+ assert.equal(modeState.current_phase, 'planning');
1165
+ }
1166
+ finally {
1167
+ await rm(cwd, { recursive: true, force: true });
1168
+ }
1169
+ });
1170
+ it('seeds executing state for autoresearch prompt-submit activation', async () => {
1171
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autoresearch-'));
1172
+ const stateDir = join(cwd, '.omx', 'state');
1173
+ try {
1174
+ await mkdir(stateDir, { recursive: true });
1175
+ const result = await recordSkillActivation({
1176
+ stateDir,
1177
+ text: '$autoresearch continue the mission',
1178
+ sessionId: 'sess-autoresearch',
1179
+ nowIso: '2026-04-17T00:00:00.000Z',
1180
+ });
1181
+ assert.ok(result);
1182
+ assert.equal(result.skill, 'autoresearch');
1183
+ assert.equal(result.phase, 'executing');
1184
+ assert.equal(result.initialized_mode, 'autoresearch');
1185
+ assert.equal(result.initialized_state_path, '.omx/state/sessions/sess-autoresearch/autoresearch-state.json');
1186
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-autoresearch', 'autoresearch-state.json'), 'utf-8'));
1187
+ assert.equal(modeState.mode, 'autoresearch');
1188
+ assert.equal(modeState.active, true);
1189
+ assert.equal(modeState.current_phase, 'executing');
1190
+ }
1191
+ finally {
1192
+ await rm(cwd, { recursive: true, force: true });
1193
+ }
1194
+ });
1195
+ it('preserves the planning skill when ralplan and autoresearch are invoked together', async () => {
1196
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-autoresearch-planning-precedence-'));
1197
+ const stateDir = join(cwd, '.omx', 'state');
1198
+ try {
1199
+ await mkdir(stateDir, { recursive: true });
1200
+ const result = await recordSkillActivation({
1201
+ stateDir,
1202
+ text: '$ralplan $autoresearch wire the mission loop',
1203
+ sessionId: 'sess-autoresearch-precedence',
1204
+ nowIso: '2026-04-17T00:05:00.000Z',
1205
+ });
1206
+ assert.equal(result?.transition_error, undefined);
1207
+ assert.equal(result?.skill, 'ralplan');
1208
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralplan']);
1209
+ assert.deepEqual(result?.deferred_skills, ['autoresearch']);
1210
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-autoresearch-precedence', 'ralplan-state.json')), true);
1211
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-autoresearch-precedence', 'autoresearch-state.json')), false);
1212
+ }
1213
+ finally {
1214
+ await rm(cwd, { recursive: true, force: true });
1215
+ }
1216
+ });
1217
+ it('captures tmux_pane_id in seeded ralplan prompt-submit state when TMUX_PANE is present', async () => {
1218
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralplan-pane-'));
1219
+ const stateDir = join(cwd, '.omx', 'state');
1220
+ const previousPane = process.env.TMUX_PANE;
1221
+ try {
1222
+ await mkdir(stateDir, { recursive: true });
1223
+ process.env.TMUX_PANE = '%88';
1224
+ const result = await recordSkillActivation({
1225
+ stateDir,
1226
+ text: '$ralplan tighten the plan',
1227
+ sessionId: 'sess-ralplan-pane',
1228
+ nowIso: '2026-02-25T00:00:00.000Z',
1229
+ });
1230
+ assert.ok(result);
1231
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan-pane', 'ralplan-state.json'), 'utf-8'));
1232
+ assert.equal(modeState.tmux_pane_id, '%88');
1233
+ }
1234
+ finally {
1235
+ if (typeof previousPane === 'string')
1236
+ process.env.TMUX_PANE = previousPane;
1237
+ else
1238
+ delete process.env.TMUX_PANE;
1239
+ await rm(cwd, { recursive: true, force: true });
1240
+ }
1241
+ });
1242
+ it('captures tmux_pane_id in deep-interview prompt-submit state when TMUX_PANE is present', async () => {
1243
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-pane-'));
1244
+ const stateDir = join(cwd, '.omx', 'state');
1245
+ const previousPane = process.env.TMUX_PANE;
1246
+ try {
1247
+ await mkdir(stateDir, { recursive: true });
1248
+ process.env.TMUX_PANE = '%89';
1249
+ const result = await recordSkillActivation({
1250
+ stateDir,
1251
+ text: '$deep-interview tighten the requirements',
1252
+ sessionId: 'sess-deep-interview-pane',
1253
+ nowIso: '2026-02-25T00:00:00.000Z',
1254
+ });
1255
+ assert.ok(result);
1256
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-deep-interview-pane', 'deep-interview-state.json'), 'utf-8'));
1257
+ assert.equal(modeState.tmux_pane_id, '%89');
1258
+ }
1259
+ finally {
1260
+ if (typeof previousPane === 'string')
1261
+ process.env.TMUX_PANE = previousPane;
1262
+ else
1263
+ delete process.env.TMUX_PANE;
1264
+ await rm(cwd, { recursive: true, force: true });
1265
+ }
1266
+ });
1267
+ it('preserves an existing deep-interview tmux_pane_id when prompt-submit re-seeds state without TMUX_PANE', async () => {
1268
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-preserve-pane-'));
1269
+ const stateDir = join(cwd, '.omx', 'state');
1270
+ const sessionId = 'sess-deep-interview-preserve-pane';
1271
+ const previousPane = process.env.TMUX_PANE;
1272
+ try {
1273
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
1274
+ delete process.env.TMUX_PANE;
1275
+ await writeFile(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json'), JSON.stringify({
1276
+ active: true,
1277
+ mode: 'deep-interview',
1278
+ current_phase: 'intent-first',
1279
+ started_at: '2026-02-25T00:00:00.000Z',
1280
+ updated_at: '2026-02-25T00:00:00.000Z',
1281
+ session_id: sessionId,
1282
+ tmux_pane_id: '%89',
1283
+ tmux_pane_set_at: '2026-02-25T00:00:00.000Z',
1284
+ }, null, 2));
1285
+ const result = await recordSkillActivation({
1286
+ stateDir,
1287
+ text: '$deep-interview tighten the requirements',
1288
+ sessionId,
1289
+ nowIso: '2026-02-25T00:05:00.000Z',
1290
+ });
1291
+ assert.ok(result);
1292
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json'), 'utf-8'));
1293
+ assert.equal(modeState.tmux_pane_id, '%89');
1294
+ assert.equal(modeState.tmux_pane_set_at, '2026-02-25T00:00:00.000Z');
1295
+ }
1296
+ finally {
1297
+ if (typeof previousPane === 'string')
1298
+ process.env.TMUX_PANE = previousPane;
1299
+ else
1300
+ delete process.env.TMUX_PANE;
1301
+ await rm(cwd, { recursive: true, force: true });
1302
+ }
1303
+ });
1304
+ it('seeds first-class state for ralplan prompt-submit activation', async () => {
1305
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralplan-'));
1306
+ const stateDir = join(cwd, '.omx', 'state');
1307
+ try {
1308
+ await mkdir(stateDir, { recursive: true });
1309
+ const result = await recordSkillActivation({
1310
+ stateDir,
1311
+ text: '$ralplan tighten the plan',
1312
+ sessionId: 'sess-ralplan',
1313
+ nowIso: '2026-02-25T00:00:00.000Z',
1314
+ });
1315
+ assert.ok(result);
1316
+ assert.equal(result.skill, 'ralplan');
1317
+ assert.equal(result.initialized_mode, 'ralplan');
1318
+ assert.equal(result.initialized_state_path, '.omx/state/sessions/sess-ralplan/ralplan-state.json');
1319
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan', 'ralplan-state.json'), 'utf-8'));
1320
+ assert.equal(modeState.mode, 'ralplan');
1321
+ assert.equal(modeState.active, true);
1322
+ assert.equal(modeState.current_phase, 'planning');
1323
+ }
1324
+ finally {
1325
+ await rm(cwd, { recursive: true, force: true });
1326
+ }
1327
+ });
1328
+ it('auto-completes deep-interview during allowlisted forward handoff', async () => {
1329
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-handoff-'));
1330
+ const stateDir = join(cwd, '.omx', 'state');
1331
+ try {
1332
+ await mkdir(join(stateDir, 'sessions', 'sess-handoff'), { recursive: true });
1333
+ await writeFile(join(stateDir, 'sessions', 'sess-handoff', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1334
+ version: 1,
1335
+ active: true,
1336
+ skill: 'deep-interview',
1337
+ phase: 'planning',
1338
+ session_id: 'sess-handoff',
1339
+ active_skills: [{ skill: 'deep-interview', phase: 'planning', active: true, session_id: 'sess-handoff' }],
1340
+ }, null, 2));
1341
+ await writeFile(join(stateDir, 'sessions', 'sess-handoff', 'deep-interview-state.json'), JSON.stringify({
1342
+ active: true,
1343
+ mode: 'deep-interview',
1344
+ current_phase: 'intent-first',
1345
+ question_enforcement: {
1346
+ obligation_id: 'obligation-handoff',
1347
+ source: 'omx-question',
1348
+ status: 'pending',
1349
+ requested_at: '2026-04-09T23:59:00.000Z',
1350
+ },
1351
+ }, null, 2));
1352
+ const result = await recordSkillActivation({
1353
+ stateDir,
1354
+ text: '$ultragoal turn the clarified spec into goals',
1355
+ sessionId: 'sess-handoff',
1356
+ nowIso: '2026-04-10T00:00:00.000Z',
1357
+ });
1358
+ assert.equal(result?.transition_error, undefined);
1359
+ assert.equal(result?.skill, 'ultragoal');
1360
+ assert.equal(result?.initialized_mode, 'ultragoal');
1361
+ assert.equal(result?.initialized_state_path, '.omx/state/sessions/sess-handoff/ultragoal-state.json');
1362
+ assert.equal(result?.transition_message, 'mode transiting: deep-interview -> ultragoal');
1363
+ const completed = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-handoff', 'deep-interview-state.json'), 'utf-8'));
1364
+ assert.equal(completed.active, false);
1365
+ assert.equal(completed.current_phase, 'completed');
1366
+ assert.equal(completed.question_enforcement?.status, 'cleared');
1367
+ assert.equal(completed.question_enforcement?.clear_reason, 'handoff');
1368
+ assert.ok(completed.question_enforcement?.cleared_at);
1369
+ const ultragoal = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-handoff', 'ultragoal-state.json'), 'utf-8'));
1370
+ assert.equal(ultragoal.active, true);
1371
+ assert.equal(ultragoal.mode, 'ultragoal');
1372
+ assert.equal(ultragoal.current_phase, 'planning');
1373
+ }
1374
+ finally {
1375
+ await rm(cwd, { recursive: true, force: true });
1376
+ }
1377
+ });
1378
+ it('denies ralplan handoff from deep-interview without completion or explicit skip evidence', async () => {
1379
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-ralplan-handoff-'));
1380
+ const stateDir = join(cwd, '.omx', 'state');
1381
+ try {
1382
+ await mkdir(join(stateDir, 'sessions', 'sess-ralplan-handoff'), { recursive: true });
1383
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-handoff', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1384
+ version: 1,
1385
+ active: true,
1386
+ skill: 'deep-interview',
1387
+ phase: 'planning',
1388
+ session_id: 'sess-ralplan-handoff',
1389
+ active_skills: [{ skill: 'deep-interview', phase: 'planning', active: true, session_id: 'sess-ralplan-handoff' }],
1390
+ }, null, 2));
1391
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-handoff', 'deep-interview-state.json'), JSON.stringify({ active: true, mode: 'deep-interview', current_phase: 'intent-first' }, null, 2));
1392
+ const result = await recordSkillActivation({
1393
+ stateDir,
1394
+ text: '$ralplan implement the approved contract',
1395
+ sessionId: 'sess-ralplan-handoff',
1396
+ nowIso: '2026-04-10T00:00:00.000Z',
1397
+ });
1398
+ assert.equal(result?.skill, 'deep-interview');
1399
+ assert.match(String(result?.transition_error), /missing deep-interview completion\/skip gate/i);
1400
+ const preserved = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan-handoff', 'deep-interview-state.json'), 'utf-8'));
1401
+ assert.equal(preserved.active, true);
1402
+ assert.equal(preserved.current_phase, 'intent-first');
1403
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-ralplan-handoff', 'ralplan-state.json')), false);
1404
+ }
1405
+ finally {
1406
+ await rm(cwd, { recursive: true, force: true });
1407
+ }
1408
+ });
1409
+ it('allows ralplan handoff from deep-interview with a durable completion gate', async () => {
1410
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-ralplan-handoff-complete-'));
1411
+ const stateDir = join(cwd, '.omx', 'state');
1412
+ try {
1413
+ await mkdir(join(stateDir, 'sessions', 'sess-ralplan-handoff-complete'), { recursive: true });
1414
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-handoff-complete', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1415
+ version: 1,
1416
+ active: true,
1417
+ skill: 'deep-interview',
1418
+ phase: 'planning',
1419
+ session_id: 'sess-ralplan-handoff-complete',
1420
+ active_skills: [{ skill: 'deep-interview', phase: 'planning', active: true, session_id: 'sess-ralplan-handoff-complete' }],
1421
+ }, null, 2));
1422
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-handoff-complete', 'deep-interview-state.json'), JSON.stringify({
1423
+ active: true,
1424
+ mode: 'deep-interview',
1425
+ current_phase: 'intent-first',
1426
+ deep_interview_gate: {
1427
+ status: 'complete',
1428
+ rationale: 'Requirements are clarified and ready for ralplan consensus.',
1429
+ },
1430
+ }, null, 2));
1431
+ const result = await recordSkillActivation({
1432
+ stateDir,
1433
+ text: '$ralplan implement the approved contract',
1434
+ sessionId: 'sess-ralplan-handoff-complete',
1435
+ nowIso: '2026-04-10T00:00:00.000Z',
1436
+ });
1437
+ assert.equal(result?.transition_error, undefined);
1438
+ assert.equal(result?.skill, 'ralplan');
1439
+ assert.equal(result?.transition_message, 'mode transiting: deep-interview -> ralplan');
1440
+ const completed = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan-handoff-complete', 'deep-interview-state.json'), 'utf-8'));
1441
+ assert.equal(completed.active, false);
1442
+ assert.equal(completed.current_phase, 'completed');
1443
+ }
1444
+ finally {
1445
+ await rm(cwd, { recursive: true, force: true });
1446
+ }
1447
+ });
1448
+ it('preserves the planning skill when planning and execution workflows are invoked together', async () => {
1449
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-planning-precedence-'));
1450
+ const stateDir = join(cwd, '.omx', 'state');
1451
+ try {
1452
+ await mkdir(stateDir, { recursive: true });
1453
+ const result = await recordSkillActivation({
1454
+ stateDir,
1455
+ text: '$ralplan $team $ralph ship this fix',
1456
+ sessionId: 'sess-multi',
1457
+ nowIso: '2026-04-10T00:00:00.000Z',
1458
+ });
1459
+ assert.equal(result?.transition_error, undefined);
1460
+ assert.equal(result?.transition_message, undefined);
1461
+ assert.equal(result?.skill, 'ralplan');
1462
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralplan']);
1463
+ assert.deepEqual(result?.deferred_skills, ['team', 'ralph']);
1464
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-multi', 'ralplan-state.json')), true);
1465
+ assert.equal(existsSync(join(stateDir, 'team-state.json')), false);
1466
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-multi', 'ralph-state.json')), false);
1467
+ }
1468
+ finally {
1469
+ await rm(cwd, { recursive: true, force: true });
1470
+ }
1471
+ });
1472
+ it('lets planning win even when execution appears first in the contiguous skill block', async () => {
1473
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-planning-beats-execution-'));
1474
+ const stateDir = join(cwd, '.omx', 'state');
1475
+ try {
1476
+ await mkdir(stateDir, { recursive: true });
1477
+ const result = await recordSkillActivation({
1478
+ stateDir,
1479
+ text: '$ralph $ralplan continue',
1480
+ sessionId: 'sess-priority',
1481
+ nowIso: '2026-04-10T00:00:00.000Z',
1482
+ });
1483
+ assert.equal(result?.transition_error, undefined);
1484
+ assert.equal(result?.skill, 'ralplan');
1485
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralplan']);
1486
+ assert.deepEqual(result?.deferred_skills, ['ralph']);
1487
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-priority', 'ralplan-state.json')), true);
1488
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-priority', 'ralph-state.json')), false);
1489
+ }
1490
+ finally {
1491
+ await rm(cwd, { recursive: true, force: true });
1492
+ }
1493
+ });
1494
+ it('seeds first-class root team state for team prompt-submit activation', async () => {
1495
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-'));
1496
+ const stateDir = join(cwd, '.omx', 'state');
1497
+ try {
1498
+ await mkdir(stateDir, { recursive: true });
1499
+ const result = await recordSkillActivation({
1500
+ stateDir,
1501
+ text: '$team coordinate the hotfix',
1502
+ sessionId: 'sess-team',
1503
+ nowIso: '2026-04-08T00:00:00.000Z',
1504
+ });
1505
+ assert.ok(result);
1506
+ assert.equal(result.skill, 'team');
1507
+ assert.equal(result.initialized_mode, 'team');
1508
+ assert.equal(result.initialized_state_path, '.omx/state/team-state.json');
1509
+ const modeState = JSON.parse(await readFile(join(stateDir, 'team-state.json'), 'utf-8'));
1510
+ assert.equal(modeState.mode, 'team');
1511
+ assert.equal(modeState.active, true);
1512
+ assert.equal(modeState.current_phase, 'starting');
1513
+ }
1514
+ finally {
1515
+ await rm(cwd, { recursive: true, force: true });
1516
+ }
1517
+ });
1518
+ it('does not activate team state when persisted Team mode is disabled', async () => {
1519
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-disabled-'));
1520
+ const stateDir = join(cwd, '.omx', 'state');
1521
+ try {
1522
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1523
+ await mkdir(stateDir, { recursive: true });
1524
+ await writeFile(join(cwd, '.omx', 'setup-scope.json'), JSON.stringify({ scope: 'project', teamMode: 'disabled' }, null, 2));
1525
+ const result = await recordSkillActivation({
1526
+ stateDir,
1527
+ text: '$team coordinate the hotfix',
1528
+ sessionId: 'sess-team-disabled',
1529
+ nowIso: '2026-04-08T00:00:00.000Z',
1530
+ });
1531
+ assert.equal(result, null);
1532
+ assert.equal(existsSync(join(stateDir, 'team-state.json')), false);
1533
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-team-disabled', SKILL_ACTIVE_STATE_FILE)), false);
1534
+ }
1535
+ finally {
1536
+ await rm(cwd, { recursive: true, force: true });
1537
+ }
1538
+ });
1539
+ it('ignores disabled Team when selecting the primary workflow', async () => {
1540
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-disabled-primary-'));
1541
+ const stateDir = join(cwd, '.omx', 'state');
1542
+ try {
1543
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1544
+ await mkdir(stateDir, { recursive: true });
1545
+ await writeFile(join(cwd, '.omx', 'setup-scope.json'), JSON.stringify({ scope: 'project', teamMode: 'disabled' }, null, 2));
1546
+ const result = await recordSkillActivation({
1547
+ stateDir,
1548
+ text: '$team $ralph ship this fix',
1549
+ sessionId: 'sess-team-disabled-primary',
1550
+ nowIso: '2026-04-10T01:00:00.000Z',
1551
+ });
1552
+ assert.equal(result?.skill, 'ralph');
1553
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralph']);
1554
+ assert.equal(existsSync(join(stateDir, 'team-state.json')), false);
1555
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-team-disabled-primary', 'ralph-state.json')), true);
1556
+ }
1557
+ finally {
1558
+ await rm(cwd, { recursive: true, force: true });
1559
+ }
1560
+ });
1561
+ it('filters deferred team handoffs when persisted Team mode is disabled', async () => {
1562
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-disabled-deferred-'));
1563
+ const stateDir = join(cwd, '.omx', 'state');
1564
+ try {
1565
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1566
+ await mkdir(stateDir, { recursive: true });
1567
+ await writeFile(join(cwd, '.omx', 'setup-scope.json'), JSON.stringify({ scope: 'project', teamMode: 'disabled' }, null, 2));
1568
+ const result = await recordSkillActivation({
1569
+ stateDir,
1570
+ text: '$ralplan $team $ralph ship this fix',
1571
+ sessionId: 'sess-team-disabled-deferred',
1572
+ nowIso: '2026-04-10T00:00:00.000Z',
1573
+ });
1574
+ assert.equal(result?.skill, 'ralplan');
1575
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralplan']);
1576
+ assert.deepEqual(result?.deferred_skills, ['ralph']);
1577
+ assert.equal(existsSync(join(stateDir, 'team-state.json')), false);
1578
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-team-disabled-deferred', 'team-state.json')), false);
1579
+ }
1580
+ finally {
1581
+ await rm(cwd, { recursive: true, force: true });
1582
+ }
1583
+ });
1584
+ it('preserves active team root state when $team is re-entered from prompt routing', async () => {
1585
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-preserve-'));
1586
+ const stateDir = join(cwd, '.omx', 'state');
1587
+ try {
1588
+ await mkdir(stateDir, { recursive: true });
1589
+ await writeFile(join(stateDir, 'team-state.json'), JSON.stringify({
1590
+ active: true,
1591
+ mode: 'team',
1592
+ current_phase: 'team-verify',
1593
+ started_at: '2026-04-08T00:00:00.000Z',
1594
+ updated_at: '2026-04-08T00:05:00.000Z',
1595
+ team_name: 'review-team',
1596
+ }, null, 2));
1597
+ const result = await recordSkillActivation({
1598
+ stateDir,
1599
+ text: '$team continue the review lane',
1600
+ sessionId: 'sess-team-preserve',
1601
+ nowIso: '2026-04-08T00:10:00.000Z',
1602
+ });
1603
+ assert.ok(result);
1604
+ assert.equal(result.initialized_mode, 'team');
1605
+ assert.equal(result.initialized_state_path, '.omx/state/team-state.json');
1606
+ const modeState = JSON.parse(await readFile(join(stateDir, 'team-state.json'), 'utf-8'));
1607
+ assert.equal(modeState.mode, 'team');
1608
+ assert.equal(modeState.active, true);
1609
+ assert.equal(modeState.current_phase, 'team-verify');
1610
+ assert.equal(modeState.team_name, 'review-team');
1611
+ }
1612
+ finally {
1613
+ await rm(cwd, { recursive: true, force: true });
1614
+ }
1615
+ });
1616
+ it('preserves active team root state when planning follow-up defers a simultaneous $team re-entry', async () => {
1617
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-planning-followup-'));
1618
+ const stateDir = join(cwd, '.omx', 'state');
1619
+ try {
1620
+ await mkdir(stateDir, { recursive: true });
1621
+ await writeFile(join(stateDir, 'team-state.json'), JSON.stringify({
1622
+ active: true,
1623
+ mode: 'team',
1624
+ current_phase: 'team-verify',
1625
+ started_at: '2026-04-08T00:00:00.000Z',
1626
+ updated_at: '2026-04-08T00:05:00.000Z',
1627
+ team_name: 'review-team',
1628
+ session_id: 'sess-team-root',
1629
+ }, null, 2));
1630
+ const result = await recordSkillActivation({
1631
+ stateDir,
1632
+ text: '$ralplan $team tighten the approved execution handoff',
1633
+ sessionId: 'sess-team-followup',
1634
+ nowIso: '2026-04-10T00:15:00.000Z',
1635
+ });
1636
+ assert.ok(result);
1637
+ assert.equal(result?.skill, 'ralplan');
1638
+ assert.equal(result?.initialized_mode, 'ralplan');
1639
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ralplan']);
1640
+ assert.deepEqual(result?.deferred_skills, ['team']);
1641
+ const modeState = JSON.parse(await readFile(join(stateDir, 'team-state.json'), 'utf-8'));
1642
+ assert.equal(modeState.mode, 'team');
1643
+ assert.equal(modeState.active, true);
1644
+ assert.equal(modeState.current_phase, 'team-verify');
1645
+ assert.equal(modeState.team_name, 'review-team');
1646
+ assert.equal(modeState.session_id, 'sess-team-root');
1647
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-team-followup', 'team-state.json')), false);
1648
+ }
1649
+ finally {
1650
+ await rm(cwd, { recursive: true, force: true });
1651
+ }
1652
+ });
1653
+ it('emits terminal ralplan state before explicit ultragoal execution handoff', async () => {
1654
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-ralplan-ultragoal-handoff-'));
1655
+ const stateDir = join(cwd, '.omx', 'state');
1656
+ try {
1657
+ await mkdir(join(stateDir, 'sessions', 'sess-ralplan-ultragoal'), { recursive: true });
1658
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-ultragoal', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
1659
+ version: 1,
1660
+ active: true,
1661
+ skill: 'ralplan',
1662
+ keyword: '$ralplan',
1663
+ phase: 'planning',
1664
+ session_id: 'sess-ralplan-ultragoal',
1665
+ active_skills: [{ skill: 'ralplan', phase: 'planning', active: true, session_id: 'sess-ralplan-ultragoal' }],
1666
+ }, null, 2));
1667
+ await writeFile(join(stateDir, 'sessions', 'sess-ralplan-ultragoal', 'ralplan-state.json'), JSON.stringify({
1668
+ active: true,
1669
+ mode: 'ralplan',
1670
+ current_phase: 'complete',
1671
+ planning_complete: true,
1672
+ ralplan_consensus_gate: {
1673
+ complete: true,
1674
+ sequence: ['architect-review', 'critic-review'],
1675
+ ralplan_architect_review: { agent_role: 'architect', verdict: 'approve', approved: true },
1676
+ ralplan_critic_review: { agent_role: 'critic', verdict: 'approve', approved: true },
1677
+ },
1678
+ }, null, 2));
1679
+ const result = await recordSkillActivation({
1680
+ stateDir,
1681
+ sourceCwd: cwd,
1682
+ text: '$ultragoal execute the approved ralplan',
1683
+ sessionId: 'sess-ralplan-ultragoal',
1684
+ nowIso: '2026-04-10T00:20:00.000Z',
1685
+ });
1686
+ assert.equal(result?.transition_error, undefined);
1687
+ assert.equal(result?.skill, 'ultragoal');
1688
+ assert.equal(result?.transition_message, 'mode transiting: ralplan -> ultragoal');
1689
+ assert.deepEqual(result?.active_skills?.map((entry) => entry.skill), ['ultragoal']);
1690
+ const ralplan = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan-ultragoal', 'ralplan-state.json'), 'utf-8'));
1691
+ assert.equal(ralplan.active, false);
1692
+ assert.equal(ralplan.current_phase, 'completed');
1693
+ assert.equal(ralplan.auto_completed_reason, 'mode transiting: ralplan -> ultragoal');
1694
+ assert.ok(ralplan.completed_at);
1695
+ const ultragoal = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralplan-ultragoal', 'ultragoal-state.json'), 'utf-8'));
1696
+ assert.equal(ultragoal.active, true);
1697
+ assert.equal(ultragoal.mode, 'ultragoal');
1698
+ assert.equal(ultragoal.current_phase, 'planning');
1699
+ }
1700
+ finally {
1701
+ await rm(cwd, { recursive: true, force: true });
1702
+ }
1703
+ });
1704
+ it('keeps root team state out of the session-scoped Ralph canonical state', async () => {
1705
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-team-ralph-'));
1706
+ const stateDir = join(cwd, '.omx', 'state');
1707
+ try {
1708
+ await mkdir(stateDir, { recursive: true });
1709
+ await recordSkillActivation({
1710
+ stateDir,
1711
+ text: '$team coordinate the rollout',
1712
+ sessionId: 'sess-team-ralph',
1713
+ nowIso: '2026-04-09T00:00:00.000Z',
1714
+ });
1715
+ const result = await recordSkillActivation({
1716
+ stateDir,
1717
+ text: '$ralph complete the approved plan',
1718
+ sessionId: 'sess-team-ralph',
1719
+ nowIso: '2026-04-09T00:05:00.000Z',
1720
+ });
1721
+ assert.ok(result);
1722
+ assert.equal(result.skill, 'ralph');
1723
+ assert.equal(existsSync(join(stateDir, SKILL_ACTIVE_STATE_FILE)), false, 'session-scoped team and Ralph activations should stay out of root canonical state when no root state exists');
1724
+ const sessionCanonical = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-team-ralph', SKILL_ACTIVE_STATE_FILE), 'utf-8'));
1725
+ assert.deepEqual(sessionCanonical.active_skills?.map(({ skill, phase, session_id }) => ({
1726
+ skill,
1727
+ phase,
1728
+ session_id,
1729
+ })), [
1730
+ { skill: 'team', phase: 'planning', session_id: 'sess-team-ralph' },
1731
+ { skill: 'ralph', phase: 'planning', session_id: 'sess-team-ralph' },
1732
+ ]);
1733
+ }
1734
+ finally {
1735
+ await rm(cwd, { recursive: true, force: true });
1736
+ }
1737
+ });
1738
+ it('acquires a deep-interview input lock immediately on activation', async () => {
1739
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-'));
1740
+ const stateDir = join(cwd, '.omx', 'state');
1741
+ try {
1742
+ await mkdir(stateDir, { recursive: true });
1743
+ const result = await recordSkillActivation({
1744
+ stateDir,
1745
+ text: 'please run a deep interview before planning',
1746
+ nowIso: '2026-02-25T00:00:00.000Z',
1747
+ });
1748
+ assert.ok(result);
1749
+ assert.equal(result.skill, 'deep-interview');
1750
+ assert.equal(result.input_lock?.active, true);
1751
+ assert.deepEqual(result.input_lock?.blocked_inputs, [...DEEP_INTERVIEW_BLOCKED_APPROVAL_INPUTS]);
1752
+ assert.equal(result.input_lock?.blocked_inputs.includes('next i should'), true);
1753
+ assert.equal(result.input_lock?.message, DEEP_INTERVIEW_INPUT_LOCK_MESSAGE);
1754
+ const modeState = JSON.parse(await readFile(join(stateDir, DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
1755
+ assert.equal(modeState.mode, 'deep-interview');
1756
+ assert.equal(modeState.active, true);
1757
+ assert.equal(modeState.current_phase, 'intent-first');
1758
+ assert.equal(modeState.input_lock?.active, true);
1759
+ }
1760
+ finally {
1761
+ await rm(cwd, { recursive: true, force: true });
1762
+ }
1763
+ });
1764
+ it('persists repo-local deep-interview config values into activation and mode state', async () => {
1765
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-config-'));
1766
+ const stateDir = join(cwd, '.omx', 'state');
1767
+ try {
1768
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1769
+ await mkdir(stateDir, { recursive: true });
1770
+ await writeFile(join(cwd, '.omx', 'config.toml'), `[omx.deepInterview]
1771
+ defaultProfile = "standard"
1772
+ standardThreshold = 0.05
1773
+ standardMaxRounds = 15
1774
+ enableChallengeModes = false
1775
+ `);
1776
+ const result = await recordSkillActivation({
1777
+ stateDir,
1778
+ sourceCwd: cwd,
1779
+ text: '$deep-interview clarify runtime config',
1780
+ sessionId: 'sess-deep-interview-config',
1781
+ nowIso: '2026-02-25T00:00:00.000Z',
1782
+ });
1783
+ assert.ok(result);
1784
+ assert.equal(result.skill, 'deep-interview');
1785
+ assert.equal(result.deep_interview_config?.profile, 'standard');
1786
+ assert.equal(result.deep_interview_config?.threshold, 0.05);
1787
+ assert.equal(result.deep_interview_config?.maxRounds, 15);
1788
+ assert.equal(result.initialized_state_path, '.omx/state/sessions/sess-deep-interview-config/deep-interview-state.json');
1789
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-deep-interview-config', DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
1790
+ assert.equal(modeState.profile, 'standard');
1791
+ assert.equal(modeState.threshold, 0.05);
1792
+ assert.equal(modeState.max_rounds, 15);
1793
+ assert.equal(modeState.enable_challenge_modes, false);
1794
+ assert.equal(modeState.config_source, join(cwd, '.omx', 'config.toml'));
1795
+ assert.equal(modeState.deep_interview_config?.sourcePath, join(cwd, '.omx', 'config.toml'));
1796
+ }
1797
+ finally {
1798
+ await rm(cwd, { recursive: true, force: true });
1799
+ }
1800
+ });
1801
+ it('persists deep-interview config when mixed workflow prompts defer execution modes', async () => {
1802
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-config-mixed-'));
1803
+ const stateDir = join(cwd, '.omx', 'state');
1804
+ const sessionId = 'sess-deep-interview-config-mixed';
1805
+ try {
1806
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1807
+ await mkdir(stateDir, { recursive: true });
1808
+ await writeFile(join(cwd, '.omx', 'config.toml'), `[omx.deepInterview]
1809
+ defaultProfile = "deep"
1810
+ deepThreshold = 0.13
1811
+ deepMaxRounds = 21
1812
+ enableChallengeModes = false
1813
+ `);
1814
+ const result = await recordSkillActivation({
1815
+ stateDir,
1816
+ sourceCwd: cwd,
1817
+ text: '$autopilot $deep-interview prove mixed workflow config',
1818
+ sessionId,
1819
+ nowIso: '2026-02-25T00:00:00.000Z',
1820
+ });
1821
+ assert.ok(result);
1822
+ assert.equal(result.skill, 'deep-interview');
1823
+ assert.deepEqual(result.deferred_skills, ['autopilot']);
1824
+ assert.equal(result.input_lock?.active, true);
1825
+ assert.equal(result.deep_interview_config?.profile, 'deep');
1826
+ assert.equal(result.deep_interview_config?.threshold, 0.13);
1827
+ assert.equal(result.deep_interview_config?.maxRounds, 21);
1828
+ assert.equal(result.deep_interview_config?.enableChallengeModes, false);
1829
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
1830
+ assert.equal(modeState.profile, 'deep');
1831
+ assert.equal(modeState.threshold, 0.13);
1832
+ assert.equal(modeState.max_rounds, 21);
1833
+ assert.equal(modeState.enable_challenge_modes, false);
1834
+ assert.equal(modeState.config_source, join(cwd, '.omx', 'config.toml'));
1835
+ assert.equal(modeState.deep_interview_config?.profile, 'deep');
1836
+ assert.equal(modeState.input_lock?.active, true);
1837
+ }
1838
+ finally {
1839
+ await rm(cwd, { recursive: true, force: true });
1840
+ }
1841
+ });
1842
+ it('shows before-after state change when deep-interview config is added at runtime', async () => {
1843
+ await withIsolatedHome('deep-interview-config-before-after', async () => {
1844
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-config-before-after-'));
1845
+ const stateDir = join(cwd, '.omx', 'state');
1846
+ const sessionId = 'sess-deep-interview-config-before-after';
1847
+ const statePath = join(stateDir, 'sessions', sessionId, DEEP_INTERVIEW_STATE_FILE);
1848
+ try {
1849
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1850
+ await mkdir(stateDir, { recursive: true });
1851
+ const before = await recordSkillActivation({
1852
+ stateDir,
1853
+ sourceCwd: cwd,
1854
+ text: '$deep-interview prove config before state',
1855
+ sessionId,
1856
+ nowIso: '2026-02-25T00:00:00.000Z',
1857
+ });
1858
+ const beforeModeState = JSON.parse(await readFile(statePath, 'utf-8'));
1859
+ assert.ok(before);
1860
+ assert.equal(before.deep_interview_config, undefined);
1861
+ assert.equal(beforeModeState.deep_interview_config, undefined);
1862
+ assert.equal(beforeModeState.profile, undefined);
1863
+ assert.equal(beforeModeState.threshold, undefined);
1864
+ assert.equal(beforeModeState.max_rounds, undefined);
1865
+ assert.equal(beforeModeState.config_source, undefined);
1866
+ await writeFile(join(cwd, '.omx', 'config.toml'), `[omx.deepInterview]
1867
+ defaultProfile = "standard"
1868
+ standardThreshold = 0.05
1869
+ standardMaxRounds = 15
1870
+ `);
1871
+ const after = await recordSkillActivation({
1872
+ stateDir,
1873
+ sourceCwd: cwd,
1874
+ text: '$deep-interview prove config after state',
1875
+ sessionId,
1876
+ nowIso: '2026-02-25T00:00:01.000Z',
1877
+ });
1878
+ const afterModeState = JSON.parse(await readFile(statePath, 'utf-8'));
1879
+ assert.ok(after);
1880
+ assert.equal(after.deep_interview_config?.profile, 'standard');
1881
+ assert.equal(after.deep_interview_config?.threshold, 0.05);
1882
+ assert.equal(after.deep_interview_config?.maxRounds, 15);
1883
+ assert.equal(afterModeState.deep_interview_config?.profile, 'standard');
1884
+ assert.equal(afterModeState.profile, 'standard');
1885
+ assert.equal(afterModeState.threshold, 0.05);
1886
+ assert.equal(afterModeState.max_rounds, 15);
1887
+ assert.equal(afterModeState.config_source, join(cwd, '.omx', 'config.toml'));
1888
+ }
1889
+ finally {
1890
+ await rm(cwd, { recursive: true, force: true });
1891
+ }
1892
+ });
1893
+ });
1894
+ it('preserves deep-interview config values during continuation prompts', async () => {
1895
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-config-continuation-'));
1896
+ const stateDir = join(cwd, '.omx', 'state');
1897
+ const sessionId = 'sess-deep-interview-config-continuation';
1898
+ const statePath = join(stateDir, 'sessions', sessionId, DEEP_INTERVIEW_STATE_FILE);
1899
+ try {
1900
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1901
+ await mkdir(stateDir, { recursive: true });
1902
+ await writeFile(join(cwd, '.omx', 'config.toml'), `[omx.deepInterview]
1903
+ defaultProfile = "standard"
1904
+ standardThreshold = 0.05
1905
+ standardMaxRounds = 15
1906
+ `);
1907
+ await recordSkillActivation({
1908
+ stateDir,
1909
+ sourceCwd: cwd,
1910
+ text: '$deep-interview prove config continuation',
1911
+ sessionId,
1912
+ nowIso: '2026-02-25T00:00:00.000Z',
1913
+ });
1914
+ const continued = await recordSkillActivation({
1915
+ stateDir,
1916
+ sourceCwd: cwd,
1917
+ text: 'continue',
1918
+ sessionId,
1919
+ nowIso: '2026-02-25T00:00:01.000Z',
1920
+ });
1921
+ const modeState = JSON.parse(await readFile(statePath, 'utf-8'));
1922
+ assert.equal(continued?.skill, 'deep-interview');
1923
+ assert.equal(continued?.deep_interview_config?.profile, 'standard');
1924
+ assert.equal(continued?.deep_interview_config?.threshold, 0.05);
1925
+ assert.equal(continued?.deep_interview_config?.maxRounds, 15);
1926
+ assert.equal(modeState.deep_interview_config?.profile, 'standard');
1927
+ assert.equal(modeState.profile, 'standard');
1928
+ assert.equal(modeState.threshold, 0.05);
1929
+ assert.equal(modeState.max_rounds, 15);
1930
+ }
1931
+ finally {
1932
+ await rm(cwd, { recursive: true, force: true });
1933
+ }
1934
+ });
1935
+ it('preserves explicit deep-interview profile flags during continuation prompts', async () => {
1936
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-config-profile-continuation-'));
1937
+ const stateDir = join(cwd, '.omx', 'state');
1938
+ const sessionId = 'sess-deep-interview-config-profile-continuation';
1939
+ const statePath = join(stateDir, 'sessions', sessionId, DEEP_INTERVIEW_STATE_FILE);
1940
+ try {
1941
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1942
+ await mkdir(stateDir, { recursive: true });
1943
+ await writeFile(join(cwd, '.omx', 'config.toml'), `[omx.deepInterview]
1944
+ defaultProfile = "standard"
1945
+ standardThreshold = 0.22
1946
+ standardMaxRounds = 13
1947
+ deepThreshold = 0.13
1948
+ deepMaxRounds = 21
1949
+ `);
1950
+ const started = await recordSkillActivation({
1951
+ stateDir,
1952
+ sourceCwd: cwd,
1953
+ text: '$deep-interview --deep prove explicit profile continuation',
1954
+ sessionId,
1955
+ nowIso: '2026-02-25T00:00:00.000Z',
1956
+ });
1957
+ const continued = await recordSkillActivation({
1958
+ stateDir,
1959
+ sourceCwd: cwd,
1960
+ text: 'continue',
1961
+ sessionId,
1962
+ nowIso: '2026-02-25T00:00:01.000Z',
1963
+ });
1964
+ const modeState = JSON.parse(await readFile(statePath, 'utf-8'));
1965
+ assert.equal(started?.deep_interview_config?.profile, 'deep');
1966
+ assert.equal(continued?.deep_interview_config?.profile, 'deep');
1967
+ assert.equal(continued?.deep_interview_config?.threshold, 0.13);
1968
+ assert.equal(continued?.deep_interview_config?.maxRounds, 21);
1969
+ assert.equal(modeState.deep_interview_config?.profile, 'deep');
1970
+ assert.equal(modeState.profile, 'deep');
1971
+ assert.equal(modeState.threshold, 0.13);
1972
+ assert.equal(modeState.max_rounds, 21);
1973
+ }
1974
+ finally {
1975
+ await rm(cwd, { recursive: true, force: true });
1976
+ }
1977
+ });
1978
+ it('keeps the documented deep-interview Suggested Config executable through activation state', async () => {
1979
+ const skillDoc = await readFile(join(process.cwd(), 'skills', 'deep-interview', 'SKILL.md'), 'utf-8');
1980
+ const markerIndex = skillDoc.indexOf('## Suggested Config (optional)');
1981
+ assert.notEqual(markerIndex, -1);
1982
+ const configMatch = skillDoc.slice(markerIndex).match(/```toml\n([\s\S]*?)\n```/);
1983
+ assert.ok(configMatch);
1984
+ const documentedConfig = configMatch[1]?.trimEnd();
1985
+ assert.ok(documentedConfig);
1986
+ assert.match(documentedConfig, /standardThreshold = 0\.20/);
1987
+ assert.match(documentedConfig, /standardMaxRounds = 12/);
1988
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-doc-config-'));
1989
+ const stateDir = join(cwd, '.omx', 'state');
1990
+ const sessionId = 'sess-deep-interview-doc-config';
1991
+ const statePath = join(stateDir, 'sessions', sessionId, DEEP_INTERVIEW_STATE_FILE);
1992
+ try {
1993
+ await mkdir(join(cwd, '.omx'), { recursive: true });
1994
+ await mkdir(stateDir, { recursive: true });
1995
+ await writeFile(join(cwd, '.omx', 'config.toml'), `${documentedConfig}\n`);
1996
+ const result = await recordSkillActivation({
1997
+ stateDir,
1998
+ sourceCwd: cwd,
1999
+ text: '$deep-interview prove documented config runtime contract',
2000
+ sessionId,
2001
+ nowIso: '2026-02-25T00:00:00.000Z',
2002
+ });
2003
+ const modeState = JSON.parse(await readFile(statePath, 'utf-8'));
2004
+ assert.ok(result);
2005
+ assert.equal(result.deep_interview_config?.profile, 'standard');
2006
+ assert.equal(result.deep_interview_config?.threshold, 0.2);
2007
+ assert.equal(result.deep_interview_config?.maxRounds, 12);
2008
+ assert.equal(modeState.deep_interview_config?.profile, 'standard');
2009
+ assert.equal(modeState.profile, 'standard');
2010
+ assert.equal(modeState.threshold, 0.2);
2011
+ assert.equal(modeState.max_rounds, 12);
2012
+ assert.equal(modeState.config_source, join(cwd, '.omx', 'config.toml'));
2013
+ }
2014
+ finally {
2015
+ await rm(cwd, { recursive: true, force: true });
2016
+ }
2017
+ });
2018
+ it('keeps deep-interview activation alive when repo config TOML is malformed', async () => {
2019
+ await withIsolatedHome('deep-interview-malformed-config', async () => {
2020
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-malformed-config-'));
2021
+ const stateDir = join(cwd, '.omx', 'state');
2022
+ const originalWarn = console.warn;
2023
+ try {
2024
+ console.warn = () => { };
2025
+ await mkdir(join(cwd, '.omx'), { recursive: true });
2026
+ await mkdir(stateDir, { recursive: true });
2027
+ await writeFile(join(cwd, '.omx', 'config.toml'), '[omx.deepInterview\nstandardThreshold = 0.05\n');
2028
+ const result = await recordSkillActivation({
2029
+ stateDir,
2030
+ sourceCwd: cwd,
2031
+ text: '$deep-interview clarify despite malformed config',
2032
+ sessionId: 'sess-deep-interview-malformed-config',
2033
+ nowIso: '2026-02-25T00:00:00.000Z',
2034
+ });
2035
+ assert.ok(result);
2036
+ assert.equal(result.skill, 'deep-interview');
2037
+ assert.equal(result.active, true);
2038
+ assert.equal(result.deep_interview_config, undefined);
2039
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-deep-interview-malformed-config', DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
2040
+ assert.equal(modeState.mode, 'deep-interview');
2041
+ assert.equal(modeState.active, true);
2042
+ assert.equal(modeState.deep_interview_config, undefined);
2043
+ }
2044
+ finally {
2045
+ console.warn = originalWarn;
2046
+ await rm(cwd, { recursive: true, force: true });
2047
+ }
2048
+ });
2049
+ });
2050
+ it('creates the session-scoped deep-interview state directory before persisting mode state', async () => {
2051
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-session-dir-'));
2052
+ const stateDir = join(cwd, '.omx', 'state');
2053
+ try {
2054
+ await mkdir(stateDir, { recursive: true });
2055
+ await persistDeepInterviewModeState(stateDir, {
2056
+ version: 1,
2057
+ active: true,
2058
+ skill: 'deep-interview',
2059
+ keyword: 'deep interview',
2060
+ phase: 'ralplan',
2061
+ activated_at: '2026-02-25T00:00:00.000Z',
2062
+ updated_at: '2026-02-25T00:00:00.000Z',
2063
+ source: 'keyword-detector',
2064
+ session_id: 'sess-sync',
2065
+ input_lock: {
2066
+ active: true,
2067
+ scope: 'deep-interview-auto-approval',
2068
+ acquired_at: '2026-02-25T00:00:00.000Z',
2069
+ blocked_inputs: [...DEEP_INTERVIEW_BLOCKED_APPROVAL_INPUTS],
2070
+ message: DEEP_INTERVIEW_INPUT_LOCK_MESSAGE,
2071
+ },
2072
+ }, '2026-02-25T00:00:00.000Z', null, { sessionId: 'sess-sync' });
2073
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-sync', DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
2074
+ assert.equal(modeState.active, true);
2075
+ assert.equal(modeState.mode, 'deep-interview');
2076
+ }
2077
+ finally {
2078
+ await rm(cwd, { recursive: true, force: true });
2079
+ }
2080
+ });
2081
+ it('clears stale pending deep-interview question enforcement when deep-interview is reactivated', async () => {
2082
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-reactivation-'));
2083
+ const stateDir = join(cwd, '.omx', 'state');
2084
+ try {
2085
+ await mkdir(join(stateDir, 'sessions', 'sess-reactivate'), { recursive: true });
2086
+ await writeFile(join(stateDir, 'sessions', 'sess-reactivate', DEEP_INTERVIEW_STATE_FILE), JSON.stringify({
2087
+ active: false,
2088
+ mode: 'deep-interview',
2089
+ current_phase: 'completed',
2090
+ started_at: '2026-04-10T00:00:00.000Z',
2091
+ updated_at: '2026-04-10T00:10:00.000Z',
2092
+ completed_at: '2026-04-10T00:10:00.000Z',
2093
+ question_enforcement: {
2094
+ obligation_id: 'obligation-reactivate',
2095
+ source: 'omx-question',
2096
+ status: 'pending',
2097
+ requested_at: '2026-04-10T00:05:00.000Z',
2098
+ },
2099
+ }, null, 2));
2100
+ await persistDeepInterviewModeState(stateDir, {
2101
+ version: 1,
2102
+ active: true,
2103
+ skill: 'deep-interview',
2104
+ keyword: 'deep interview',
2105
+ phase: 'planning',
2106
+ activated_at: '2026-04-10T00:11:00.000Z',
2107
+ updated_at: '2026-04-10T00:11:00.000Z',
2108
+ source: 'keyword-detector',
2109
+ session_id: 'sess-reactivate',
2110
+ input_lock: {
2111
+ active: true,
2112
+ scope: 'deep-interview-auto-approval',
2113
+ acquired_at: '2026-04-10T00:11:00.000Z',
2114
+ blocked_inputs: [...DEEP_INTERVIEW_BLOCKED_APPROVAL_INPUTS],
2115
+ message: DEEP_INTERVIEW_INPUT_LOCK_MESSAGE,
2116
+ },
2117
+ }, '2026-04-10T00:11:00.000Z', null, { sessionId: 'sess-reactivate' });
2118
+ const reactivated = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-reactivate', DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
2119
+ assert.equal(reactivated.active, true);
2120
+ assert.equal(reactivated.question_enforcement?.status, 'cleared');
2121
+ assert.equal(reactivated.question_enforcement?.clear_reason, 'handoff');
2122
+ assert.ok(reactivated.question_enforcement?.cleared_at);
2123
+ }
2124
+ finally {
2125
+ await rm(cwd, { recursive: true, force: true });
2126
+ }
2127
+ });
2128
+ it('releases the deep-interview input lock on abort via cancel keyword', async () => {
2129
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-deep-interview-abort-'));
2130
+ const stateDir = join(cwd, '.omx', 'state');
2131
+ try {
2132
+ await mkdir(stateDir, { recursive: true });
2133
+ await recordSkillActivation({
2134
+ stateDir,
2135
+ text: 'please run $deep-interview',
2136
+ nowIso: '2026-02-25T00:00:00.000Z',
2137
+ });
2138
+ const result = await recordSkillActivation({
2139
+ stateDir,
2140
+ text: 'abort now',
2141
+ nowIso: '2026-02-25T00:05:00.000Z',
2142
+ });
2143
+ assert.ok(result);
2144
+ assert.equal(result.skill, 'deep-interview');
2145
+ assert.equal(result.active, false);
2146
+ assert.equal(result.phase, 'completing');
2147
+ assert.equal(result.input_lock?.active, false);
2148
+ assert.equal(result.input_lock?.released_at, '2026-02-25T00:05:00.000Z');
2149
+ const modeState = JSON.parse(await readFile(join(stateDir, DEEP_INTERVIEW_STATE_FILE), 'utf-8'));
2150
+ assert.equal(modeState.active, false);
2151
+ assert.equal(modeState.current_phase, 'completing');
2152
+ assert.equal(modeState.completed_at, '2026-02-25T00:05:00.000Z');
2153
+ assert.equal(modeState.input_lock?.active, false);
2154
+ assert.equal(modeState.input_lock?.released_at, '2026-02-25T00:05:00.000Z');
2155
+ }
2156
+ finally {
2157
+ await rm(cwd, { recursive: true, force: true });
2158
+ }
2159
+ });
2160
+ it('does not write state when no keyword is present', async () => {
2161
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-none-'));
2162
+ const stateDir = join(cwd, '.omx', 'state');
2163
+ try {
2164
+ await mkdir(stateDir, { recursive: true });
2165
+ const result = await recordSkillActivation({
2166
+ stateDir,
2167
+ text: 'hello there, how are you',
2168
+ });
2169
+ assert.equal(result, null);
2170
+ }
2171
+ finally {
2172
+ await rm(cwd, { recursive: true, force: true });
2173
+ }
2174
+ });
2175
+ it('does not seed non-stateful skill mode state on keyword activation', async () => {
2176
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-non-stateful-'));
2177
+ const stateDir = join(cwd, '.omx', 'state');
2178
+ try {
2179
+ await mkdir(stateDir, { recursive: true });
2180
+ const result = await recordSkillActivation({
2181
+ stateDir,
2182
+ text: 'please do a code review before merge',
2183
+ });
2184
+ assert.ok(result);
2185
+ assert.equal(result.skill, 'code-review');
2186
+ assert.equal(result.initialized_mode, undefined);
2187
+ assert.equal(result.initialized_state_path, undefined);
2188
+ }
2189
+ finally {
2190
+ await rm(cwd, { recursive: true, force: true });
2191
+ }
2192
+ });
2193
+ it('keeps Autopilot visible when a supervised code-review child keyword appears', async () => {
2194
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-child-code-review-'));
2195
+ const stateDir = join(cwd, '.omx', 'state');
2196
+ const sessionId = 'sess-autopilot-child-code-review';
2197
+ try {
2198
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2199
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2200
+ version: 1,
2201
+ active: true,
2202
+ skill: 'autopilot',
2203
+ keyword: '$autopilot',
2204
+ phase: 'ralplan',
2205
+ activated_at: '2026-05-30T00:00:00.000Z',
2206
+ updated_at: '2026-05-30T00:01:00.000Z',
2207
+ source: 'keyword-detector',
2208
+ session_id: sessionId,
2209
+ active_skills: [{ skill: 'autopilot', phase: 'ralplan', active: true, session_id: sessionId }],
2210
+ }, null, 2));
2211
+ const result = await recordSkillActivation({
2212
+ stateDir,
2213
+ text: 'CODE REVIEW the current diff before continuing',
2214
+ sessionId,
2215
+ threadId: 'thread-autopilot-child-code-review',
2216
+ turnId: 'turn-autopilot-child-code-review',
2217
+ nowIso: '2026-05-30T00:02:00.000Z',
2218
+ });
2219
+ assert.ok(result);
2220
+ assert.equal(result.skill, 'autopilot');
2221
+ assert.equal(result.phase, 'ralplan');
2222
+ assert.equal(result.supervised_child_skill, 'code-review');
2223
+ const persisted = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), 'utf-8'));
2224
+ assert.equal(persisted.skill, 'autopilot');
2225
+ assert.equal(persisted.phase, 'ralplan');
2226
+ assert.deepEqual(persisted.active_skills?.map((entry) => entry.skill), ['autopilot']);
2227
+ assert.equal(existsSync(join(stateDir, 'sessions', sessionId, 'code-review-state.json')), false);
2228
+ }
2229
+ finally {
2230
+ await rm(cwd, { recursive: true, force: true });
2231
+ }
2232
+ });
2233
+ it('keeps tracked Autopilot child keywords supervised and completes stale child mode state', async () => {
2234
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-child-ultraqa-'));
2235
+ const stateDir = join(cwd, '.omx', 'state');
2236
+ const sessionId = 'sess-autopilot-child-ultraqa';
2237
+ try {
2238
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2239
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2240
+ version: 1,
2241
+ active: true,
2242
+ skill: 'autopilot',
2243
+ keyword: '$autopilot',
2244
+ phase: 'ultraqa',
2245
+ activated_at: '2026-05-30T00:00:00.000Z',
2246
+ updated_at: '2026-05-30T00:01:00.000Z',
2247
+ source: 'keyword-detector',
2248
+ session_id: sessionId,
2249
+ active_skills: [{ skill: 'autopilot', phase: 'ultraqa', active: true, session_id: sessionId }],
2250
+ }, null, 2));
2251
+ await writeFile(join(stateDir, 'sessions', sessionId, 'ultragoal-state.json'), JSON.stringify({
2252
+ active: true,
2253
+ mode: 'ultragoal',
2254
+ current_phase: 'planning',
2255
+ session_id: sessionId,
2256
+ started_at: '2026-05-29T23:00:00.000Z',
2257
+ updated_at: '2026-05-29T23:05:00.000Z',
2258
+ }, null, 2));
2259
+ const result = await recordSkillActivation({
2260
+ stateDir,
2261
+ text: '$ultraqa run adversarial checks',
2262
+ sessionId,
2263
+ threadId: 'thread-autopilot-child-ultraqa',
2264
+ turnId: 'turn-autopilot-child-ultraqa',
2265
+ nowIso: '2026-05-30T00:02:00.000Z',
2266
+ });
2267
+ assert.ok(result);
2268
+ assert.equal(result.skill, 'autopilot');
2269
+ assert.equal(result.phase, 'ultraqa');
2270
+ assert.equal(result.supervised_child_skill, 'ultraqa');
2271
+ assert.equal(result.transition_error, undefined);
2272
+ assert.equal(existsSync(join(stateDir, 'sessions', sessionId, 'ultraqa-state.json')), false);
2273
+ const ultragoal = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'ultragoal-state.json'), 'utf-8'));
2274
+ assert.equal(ultragoal.active, false);
2275
+ assert.equal(ultragoal.current_phase, 'completed');
2276
+ assert.match(ultragoal.auto_completed_reason || '', /mode transiting: ultragoal -> ultraqa/);
2277
+ }
2278
+ finally {
2279
+ await rm(cwd, { recursive: true, force: true });
2280
+ }
2281
+ });
2282
+ it('denies supervised Autopilot child rollback without clearing stale execution state', async () => {
2283
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-child-rollback-'));
2284
+ const stateDir = join(cwd, '.omx', 'state');
2285
+ const sessionId = 'sess-autopilot-child-rollback';
2286
+ try {
2287
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2288
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2289
+ version: 1,
2290
+ active: true,
2291
+ skill: 'autopilot',
2292
+ keyword: '$autopilot',
2293
+ phase: 'ultragoal',
2294
+ session_id: sessionId,
2295
+ active_skills: [{ skill: 'autopilot', phase: 'ultragoal', active: true, session_id: sessionId }],
2296
+ }, null, 2));
2297
+ await writeFile(join(stateDir, 'sessions', sessionId, 'ultragoal-state.json'), JSON.stringify({
2298
+ active: true,
2299
+ mode: 'ultragoal',
2300
+ current_phase: 'executing',
2301
+ session_id: sessionId,
2302
+ }, null, 2));
2303
+ const result = await recordSkillActivation({
2304
+ stateDir,
2305
+ text: '$deep-interview go back and re-plan',
2306
+ sessionId,
2307
+ nowIso: '2026-05-30T00:03:00.000Z',
2308
+ });
2309
+ assert.equal(result?.skill, 'autopilot');
2310
+ assert.match(String(result?.transition_error), /Execution-to-planning rollback auto-complete is not allowed/i);
2311
+ assert.equal(result?.supervised_child_skill, undefined);
2312
+ assert.equal(existsSync(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json')), false);
2313
+ const ultragoal = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'ultragoal-state.json'), 'utf-8'));
2314
+ assert.equal(ultragoal.active, true);
2315
+ assert.equal(ultragoal.current_phase, 'executing');
2316
+ }
2317
+ finally {
2318
+ await rm(cwd, { recursive: true, force: true });
2319
+ }
2320
+ });
2321
+ it('surfaces supervised Autopilot deep-interview to ralplan gate failures', async () => {
2322
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-child-gate-'));
2323
+ const stateDir = join(cwd, '.omx', 'state');
2324
+ const sessionId = 'sess-autopilot-child-gate';
2325
+ try {
2326
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2327
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2328
+ version: 1,
2329
+ active: true,
2330
+ skill: 'autopilot',
2331
+ keyword: '$autopilot',
2332
+ phase: 'deep-interview',
2333
+ session_id: sessionId,
2334
+ active_skills: [{ skill: 'autopilot', phase: 'deep-interview', active: true, session_id: sessionId }],
2335
+ }, null, 2));
2336
+ await writeFile(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json'), JSON.stringify({
2337
+ active: true,
2338
+ mode: 'deep-interview',
2339
+ current_phase: 'intent-first',
2340
+ session_id: sessionId,
2341
+ }, null, 2));
2342
+ const result = await recordSkillActivation({
2343
+ stateDir,
2344
+ text: '$ralplan continue without interview completion evidence',
2345
+ sessionId,
2346
+ nowIso: '2026-05-30T00:04:00.000Z',
2347
+ });
2348
+ assert.equal(result?.skill, 'autopilot');
2349
+ assert.match(String(result?.transition_error), /missing deep-interview completion\/skip gate/i);
2350
+ assert.equal(result?.supervised_child_skill, undefined);
2351
+ assert.equal(existsSync(join(stateDir, 'sessions', sessionId, 'ralplan-state.json')), false);
2352
+ const deepInterview = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json'), 'utf-8'));
2353
+ assert.equal(deepInterview.active, true);
2354
+ assert.equal(deepInterview.current_phase, 'intent-first');
2355
+ }
2356
+ finally {
2357
+ await rm(cwd, { recursive: true, force: true });
2358
+ }
2359
+ });
2360
+ it('ignores stale root child mode state during session-scoped Autopilot child reconciliation', async () => {
2361
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-child-session-root-'));
2362
+ const stateDir = join(cwd, '.omx', 'state');
2363
+ const sessionId = 'sess-autopilot-child-session-root';
2364
+ try {
2365
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2366
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2367
+ version: 1,
2368
+ active: true,
2369
+ skill: 'autopilot',
2370
+ keyword: '$autopilot',
2371
+ phase: 'deep-interview',
2372
+ session_id: sessionId,
2373
+ active_skills: [{ skill: 'autopilot', phase: 'deep-interview', active: true, session_id: sessionId }],
2374
+ }, null, 2));
2375
+ await writeFile(join(stateDir, 'ultragoal-state.json'), JSON.stringify({
2376
+ active: true,
2377
+ mode: 'ultragoal',
2378
+ current_phase: 'executing',
2379
+ }, null, 2));
2380
+ const result = await recordSkillActivation({
2381
+ stateDir,
2382
+ text: '$deep-interview continue scoped interview',
2383
+ sessionId,
2384
+ nowIso: '2026-05-30T00:05:00.000Z',
2385
+ });
2386
+ assert.equal(result?.skill, 'autopilot');
2387
+ assert.equal(result?.supervised_child_skill, 'deep-interview');
2388
+ assert.equal(result?.transition_error, undefined);
2389
+ const rootUltragoal = JSON.parse(await readFile(join(stateDir, 'ultragoal-state.json'), 'utf-8'));
2390
+ assert.equal(rootUltragoal.active, true);
2391
+ assert.equal(rootUltragoal.current_phase, 'executing');
2392
+ assert.equal(existsSync(join(stateDir, 'sessions', sessionId, 'deep-interview-state.json')), false);
2393
+ }
2394
+ finally {
2395
+ await rm(cwd, { recursive: true, force: true });
2396
+ }
2397
+ });
2398
+ it('records ultragoal as a prompt skill with first-class mode state', async () => {
2399
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ultragoal-'));
2400
+ const stateDir = join(cwd, '.omx', 'state');
2401
+ try {
2402
+ await mkdir(stateDir, { recursive: true });
2403
+ const result = await recordSkillActivation({
2404
+ stateDir,
2405
+ text: '$ultragoal split this launch into durable goals',
2406
+ });
2407
+ assert.ok(result);
2408
+ assert.equal(result.skill, 'ultragoal');
2409
+ assert.equal(result.keyword, '$ultragoal');
2410
+ assert.equal(result.initialized_mode, 'ultragoal');
2411
+ assert.equal(result.initialized_state_path, '.omx/state/ultragoal-state.json');
2412
+ const modeState = JSON.parse(await readFile(join(stateDir, 'ultragoal-state.json'), 'utf-8'));
2413
+ assert.equal(modeState.active, true);
2414
+ assert.equal(modeState.mode, 'ultragoal');
2415
+ assert.equal(modeState.current_phase, 'planning');
2416
+ }
2417
+ finally {
2418
+ await rm(cwd, { recursive: true, force: true });
2419
+ }
2420
+ });
2421
+ it('emits a warning when skill-active-state persistence fails', async () => {
2422
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-persist-fail-'));
2423
+ const warnings = [];
2424
+ mock.method(console, 'warn', (...args) => {
2425
+ warnings.push(args);
2426
+ });
2427
+ try {
2428
+ const blockingFile = join(cwd, 'state-root-file');
2429
+ await writeFile(blockingFile, 'not a directory');
2430
+ const result = await recordSkillActivation({
2431
+ stateDir: join(blockingFile, 'nested', 'state-dir'),
2432
+ text: 'please run $autopilot',
2433
+ nowIso: '2026-02-25T00:00:00.000Z',
2434
+ });
2435
+ assert.ok(result);
2436
+ assert.equal(result.skill, 'autopilot');
2437
+ assert.equal(warnings.length, 1);
2438
+ assert.match(String(warnings[0][0]), /failed to persist keyword activation state/);
2439
+ }
2440
+ finally {
2441
+ await rm(cwd, { recursive: true, force: true });
2442
+ }
2443
+ });
2444
+ it('preserves activated_at for same-skill continuation', async () => {
2445
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-continuation-'));
2446
+ const stateDir = join(cwd, '.omx', 'state');
2447
+ const statePath = join(stateDir, SKILL_ACTIVE_STATE_FILE);
2448
+ try {
2449
+ await mkdir(stateDir, { recursive: true });
2450
+ await writeFile(statePath, JSON.stringify({
2451
+ version: 1,
2452
+ active: true,
2453
+ skill: 'autopilot',
2454
+ keyword: '$autopilot',
2455
+ phase: 'ralplan',
2456
+ activated_at: '2026-02-25T00:00:00.000Z',
2457
+ updated_at: '2026-02-25T00:10:00.000Z',
2458
+ source: 'keyword-detector',
2459
+ }));
2460
+ const result = await recordSkillActivation({
2461
+ stateDir,
2462
+ text: 'autopilot keep going',
2463
+ nowIso: '2026-02-26T00:00:00.000Z',
2464
+ });
2465
+ assert.ok(result);
2466
+ assert.equal(result.skill, 'autopilot');
2467
+ assert.equal(result.transition_error, undefined);
2468
+ assert.equal(result.activated_at, '2026-02-25T00:00:00.000Z');
2469
+ assert.equal(result.updated_at, '2026-02-26T00:00:00.000Z');
2470
+ }
2471
+ finally {
2472
+ await rm(cwd, { recursive: true, force: true });
2473
+ }
2474
+ });
2475
+ it('preserves seeded mode progress for same-skill continuation', async () => {
2476
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-seed-continuation-'));
2477
+ const stateDir = join(cwd, '.omx', 'state');
2478
+ try {
2479
+ await mkdir(stateDir, { recursive: true });
2480
+ await mkdir(join(stateDir, 'sessions', 'sess-autopilot'), { recursive: true });
2481
+ await writeFile(join(stateDir, 'sessions', 'sess-autopilot', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2482
+ version: 1,
2483
+ active: true,
2484
+ skill: 'autopilot',
2485
+ keyword: 'autopilot',
2486
+ phase: 'ralplan',
2487
+ activated_at: '2026-02-25T00:00:00.000Z',
2488
+ updated_at: '2026-02-25T00:10:00.000Z',
2489
+ source: 'keyword-detector',
2490
+ session_id: 'sess-autopilot',
2491
+ }));
2492
+ await writeFile(join(stateDir, 'sessions', 'sess-autopilot', 'autopilot-state.json'), JSON.stringify({
2493
+ active: true,
2494
+ mode: 'autopilot',
2495
+ current_phase: 'code-review',
2496
+ started_at: '2026-02-25T00:00:00.000Z',
2497
+ updated_at: '2026-02-25T00:10:00.000Z',
2498
+ session_id: 'sess-autopilot',
2499
+ state: { context_snapshot_path: '.omx/context/existing.md' },
2500
+ }));
2501
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
2502
+ await writeFile(join(cwd, '.omx', 'context', 'existing.md'), '# existing context');
2503
+ const result = await recordSkillActivation({
2504
+ stateDir,
2505
+ text: 'autopilot keep going',
2506
+ sessionId: 'sess-autopilot',
2507
+ nowIso: '2026-02-26T00:00:00.000Z',
2508
+ });
2509
+ assert.ok(result);
2510
+ assert.equal(result.skill, 'autopilot');
2511
+ assert.equal(result.phase, 'ralplan');
2512
+ assert.equal(result.transition_error, undefined);
2513
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-autopilot', 'autopilot-state.json'), 'utf-8'));
2514
+ assert.equal(modeState.current_phase, 'code-review');
2515
+ assert.equal(modeState.started_at, '2026-02-25T00:00:00.000Z');
2516
+ assert.equal(modeState.state?.context_snapshot_path, undefined);
2517
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/existing.md');
2518
+ }
2519
+ finally {
2520
+ await rm(cwd, { recursive: true, force: true });
2521
+ }
2522
+ });
2523
+ it('does not persist Ralph workflow state for a plain conversational mention', async () => {
2524
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralph-plain-text-'));
2525
+ const stateDir = join(cwd, '.omx', 'state');
2526
+ try {
2527
+ await mkdir(stateDir, { recursive: true });
2528
+ const result = await recordSkillActivation({
2529
+ stateDir,
2530
+ text: 'why does ralph keep blocking stop?',
2531
+ sessionId: 'sess-plain-ralph',
2532
+ threadId: 'thread-plain-ralph',
2533
+ turnId: 'turn-plain-ralph',
2534
+ nowIso: '2026-04-17T00:00:00.000Z',
2535
+ });
2536
+ assert.equal(result, null);
2537
+ assert.equal(existsSync(join(stateDir, SKILL_ACTIVE_STATE_FILE)), false);
2538
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-plain-ralph', SKILL_ACTIVE_STATE_FILE)), false);
2539
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-plain-ralph', 'ralph-state.json')), false);
2540
+ }
2541
+ finally {
2542
+ await rm(cwd, { recursive: true, force: true });
2543
+ }
2544
+ });
2545
+ it('preserves Ralph iteration counters for same-skill continuation', async () => {
2546
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralph-continuation-'));
2547
+ const stateDir = join(cwd, '.omx', 'state');
2548
+ const statePath = join(stateDir, SKILL_ACTIVE_STATE_FILE);
2549
+ try {
2550
+ await mkdir(stateDir, { recursive: true });
2551
+ await writeFile(statePath, JSON.stringify({
2552
+ version: 1,
2553
+ active: true,
2554
+ skill: 'ralph',
2555
+ keyword: 'ralph',
2556
+ phase: 'executing',
2557
+ activated_at: '2026-02-25T00:00:00.000Z',
2558
+ updated_at: '2026-02-25T00:10:00.000Z',
2559
+ source: 'keyword-detector',
2560
+ }));
2561
+ await writeFile(join(stateDir, 'ralph-state.json'), JSON.stringify({
2562
+ active: true,
2563
+ mode: 'ralph',
2564
+ current_phase: 'verifying',
2565
+ started_at: '2026-02-25T00:00:00.000Z',
2566
+ updated_at: '2026-02-25T00:10:00.000Z',
2567
+ iteration: 3,
2568
+ max_iterations: 10,
2569
+ }));
2570
+ const result = await recordSkillActivation({
2571
+ stateDir,
2572
+ text: 'ralph keep going',
2573
+ nowIso: '2026-02-26T00:00:00.000Z',
2574
+ });
2575
+ assert.ok(result);
2576
+ assert.equal(result.skill, 'ralph');
2577
+ assert.equal(result.transition_error, undefined);
2578
+ const modeState = JSON.parse(await readFile(join(stateDir, 'ralph-state.json'), 'utf-8'));
2579
+ assert.equal(modeState.current_phase, 'verifying');
2580
+ assert.equal(modeState.iteration, 3);
2581
+ assert.equal(modeState.max_iterations, 10);
2582
+ }
2583
+ finally {
2584
+ await rm(cwd, { recursive: true, force: true });
2585
+ }
2586
+ });
2587
+ it('keeps Korean ulw typo first in mixed explicit workflow persistence', async () => {
2588
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ulw-ko-mixed-'));
2589
+ const stateDir = join(cwd, '.omx', 'state');
2590
+ try {
2591
+ await mkdir(stateDir, { recursive: true });
2592
+ const result = await recordSkillActivation({
2593
+ stateDir,
2594
+ text: '$ㅕㅣㅈ $autopilot 병렬 작업으로 처리해줘',
2595
+ sessionId: 'sess-ulw-ko-mixed',
2596
+ nowIso: '2026-04-21T00:20:00.000Z',
2597
+ });
2598
+ assert.ok(result);
2599
+ assert.equal(result.skill, 'ultrawork');
2600
+ assert.equal(result.keyword, '$ulw');
2601
+ assert.deepEqual(result.requested_skills, ['ultrawork', 'autopilot']);
2602
+ assert.deepEqual(result.active_skills?.map((entry) => entry.skill), ['ultrawork', 'autopilot']);
2603
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-ulw-ko-mixed', 'ultrawork-state.json')), true);
2604
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-ulw-ko-mixed', 'autopilot-state.json')), true);
2605
+ }
2606
+ finally {
2607
+ await rm(cwd, { recursive: true, force: true });
2608
+ }
2609
+ });
2610
+ it('lets an explicit Korean ulw typo override an active workflow continuation', async () => {
2611
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ulw-ko-explicit-'));
2612
+ const stateDir = join(cwd, '.omx', 'state');
2613
+ try {
2614
+ await mkdir(join(stateDir, 'sessions', 'sess-ulw-ko-explicit'), { recursive: true });
2615
+ await writeFile(join(stateDir, 'sessions', 'sess-ulw-ko-explicit', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2616
+ version: 1,
2617
+ active: true,
2618
+ skill: 'autopilot',
2619
+ keyword: '$autopilot',
2620
+ phase: 'executing',
2621
+ activated_at: '2026-04-21T00:00:00.000Z',
2622
+ updated_at: '2026-04-21T00:05:00.000Z',
2623
+ source: 'keyword-detector',
2624
+ session_id: 'sess-ulw-ko-explicit',
2625
+ active_skills: [
2626
+ {
2627
+ skill: 'autopilot',
2628
+ phase: 'executing',
2629
+ active: true,
2630
+ activated_at: '2026-04-21T00:00:00.000Z',
2631
+ updated_at: '2026-04-21T00:05:00.000Z',
2632
+ session_id: 'sess-ulw-ko-explicit',
2633
+ },
2634
+ ],
2635
+ }, null, 2));
2636
+ const result = await recordSkillActivation({
2637
+ stateDir,
2638
+ text: '$ㅕㅣㅈ continue',
2639
+ sessionId: 'sess-ulw-ko-explicit',
2640
+ nowIso: '2026-04-21T00:10:00.000Z',
2641
+ });
2642
+ assert.ok(result);
2643
+ assert.equal(result.skill, 'ultrawork');
2644
+ assert.equal(result.keyword, '$ulw');
2645
+ assert.deepEqual(result.active_skills?.map((entry) => entry.skill), ['autopilot', 'ultrawork']);
2646
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-ulw-ko-explicit', 'ultrawork-state.json')), true);
2647
+ }
2648
+ finally {
2649
+ await rm(cwd, { recursive: true, force: true });
2650
+ }
2651
+ });
2652
+ it('routes bare keep-going continuation to the active autopilot skill instead of generic ralph continuation', async () => {
2653
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-bare-continuation-'));
2654
+ const stateDir = join(cwd, '.omx', 'state');
2655
+ try {
2656
+ await mkdir(join(stateDir, 'sessions', 'sess-autopilot-bare'), { recursive: true });
2657
+ await writeFile(join(stateDir, 'sessions', 'sess-autopilot-bare', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2658
+ version: 1,
2659
+ active: true,
2660
+ skill: 'autopilot',
2661
+ keyword: '$autopilot',
2662
+ phase: 'ralplan',
2663
+ activated_at: '2026-04-19T00:00:00.000Z',
2664
+ updated_at: '2026-04-19T00:10:00.000Z',
2665
+ source: 'keyword-detector',
2666
+ session_id: 'sess-autopilot-bare',
2667
+ active_skills: [
2668
+ {
2669
+ skill: 'autopilot',
2670
+ phase: 'ralplan',
2671
+ active: true,
2672
+ activated_at: '2026-04-19T00:00:00.000Z',
2673
+ updated_at: '2026-04-19T00:10:00.000Z',
2674
+ session_id: 'sess-autopilot-bare',
2675
+ },
2676
+ ],
2677
+ }, null, 2));
2678
+ await writeFile(join(stateDir, 'sessions', 'sess-autopilot-bare', 'autopilot-state.json'), JSON.stringify({
2679
+ active: true,
2680
+ mode: 'autopilot',
2681
+ current_phase: 'code-review',
2682
+ started_at: '2026-04-19T00:00:00.000Z',
2683
+ updated_at: '2026-04-19T00:10:00.000Z',
2684
+ session_id: 'sess-autopilot-bare',
2685
+ state: { context_snapshot_path: '.omx/context/autopilot.md' },
2686
+ }, null, 2));
2687
+ await mkdir(join(cwd, '.omx', 'context'), { recursive: true });
2688
+ await writeFile(join(cwd, '.omx', 'context', 'autopilot.md'), '# autopilot context');
2689
+ const result = await recordSkillActivation({
2690
+ stateDir,
2691
+ text: '\\ keep going now',
2692
+ sessionId: 'sess-autopilot-bare',
2693
+ nowIso: '2026-04-19T00:15:00.000Z',
2694
+ });
2695
+ assert.ok(result);
2696
+ assert.equal(result.skill, 'autopilot');
2697
+ assert.equal(result.keyword, '$autopilot');
2698
+ assert.equal(result.transition_error, undefined);
2699
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-autopilot-bare', 'autopilot-state.json'), 'utf-8'));
2700
+ assert.equal(modeState.current_phase, 'code-review');
2701
+ assert.equal(modeState.state?.context_snapshot_path, undefined);
2702
+ assert.equal(modeState.state?.handoff_artifacts?.context_snapshot_path, '.omx/context/autopilot.md');
2703
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-autopilot-bare', 'ralph-state.json')), false);
2704
+ }
2705
+ finally {
2706
+ await rm(cwd, { recursive: true, force: true });
2707
+ }
2708
+ });
2709
+ it('preserves active Autopilot question-wait state on bare continuation', async () => {
2710
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-autopilot-question-wait-'));
2711
+ const stateDir = join(cwd, '.omx', 'state');
2712
+ const sessionId = 'sess-autopilot-question-wait';
2713
+ try {
2714
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2715
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2716
+ version: 1,
2717
+ active: true,
2718
+ skill: 'autopilot',
2719
+ keyword: '$autopilot',
2720
+ phase: 'waiting-for-user',
2721
+ activated_at: '2026-04-19T00:00:00.000Z',
2722
+ updated_at: '2026-04-19T00:10:00.000Z',
2723
+ source: 'keyword-detector',
2724
+ session_id: sessionId,
2725
+ active_skills: [
2726
+ {
2727
+ skill: 'autopilot',
2728
+ phase: 'waiting-for-user',
2729
+ active: true,
2730
+ activated_at: '2026-04-19T00:00:00.000Z',
2731
+ updated_at: '2026-04-19T00:10:00.000Z',
2732
+ session_id: sessionId,
2733
+ },
2734
+ ],
2735
+ }, null, 2));
2736
+ await writeFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), JSON.stringify({
2737
+ active: true,
2738
+ mode: 'autopilot',
2739
+ current_phase: 'waiting-for-user',
2740
+ started_at: '2026-04-19T00:00:00.000Z',
2741
+ updated_at: '2026-04-19T00:10:00.000Z',
2742
+ session_id: sessionId,
2743
+ iteration: 4,
2744
+ max_iterations: 10,
2745
+ review_cycle: 2,
2746
+ run_outcome: 'blocked_on_user',
2747
+ lifecycle_outcome: 'askuserQuestion',
2748
+ state: {
2749
+ deep_interview_question: {
2750
+ status: 'waiting_for_user',
2751
+ obligation_id: 'obligation-question-wait',
2752
+ previous_phase: 'deep-interview',
2753
+ },
2754
+ },
2755
+ }, null, 2));
2756
+ const result = await recordSkillActivation({
2757
+ stateDir,
2758
+ text: '\\ keep going now',
2759
+ sessionId,
2760
+ nowIso: '2026-04-19T00:15:00.000Z',
2761
+ });
2762
+ assert.ok(result);
2763
+ assert.equal(result.skill, 'autopilot');
2764
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'autopilot-state.json'), 'utf-8'));
2765
+ assert.equal(modeState.current_phase, 'waiting-for-user');
2766
+ assert.equal(modeState.iteration, 4);
2767
+ assert.equal(modeState.max_iterations, 10);
2768
+ assert.equal(modeState.review_cycle, 2);
2769
+ assert.equal(modeState.lifecycle_outcome, 'askuserQuestion');
2770
+ assert.equal(modeState.state?.deep_interview_question?.status, 'waiting_for_user');
2771
+ assert.equal(modeState.state?.deep_interview_question?.obligation_id, 'obligation-question-wait');
2772
+ }
2773
+ finally {
2774
+ await rm(cwd, { recursive: true, force: true });
2775
+ }
2776
+ });
2777
+ it('resets terminal Ralph blocked_on_user state when reactivated', async () => {
2778
+ const cases = [
2779
+ { name: 'phase', phase: 'blocked_on_user', run_outcome: undefined },
2780
+ { name: 'outcome', phase: 'executing', run_outcome: 'blocked_on_user' },
2781
+ ];
2782
+ for (const testCase of cases) {
2783
+ const cwd = await mkdtemp(join(tmpdir(), `omx-keyword-state-ralph-terminal-${testCase.name}-reactivation-`));
2784
+ const stateDir = join(cwd, '.omx', 'state');
2785
+ const sessionId = `sess-ralph-terminal-${testCase.name}`;
2786
+ try {
2787
+ await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
2788
+ await writeFile(join(stateDir, 'sessions', sessionId, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2789
+ version: 1,
2790
+ active: true,
2791
+ skill: 'ralph',
2792
+ keyword: '$ralph',
2793
+ phase: testCase.phase,
2794
+ activated_at: '2026-04-19T00:00:00.000Z',
2795
+ updated_at: '2026-04-19T00:10:00.000Z',
2796
+ source: 'keyword-detector',
2797
+ session_id: sessionId,
2798
+ active_skills: [
2799
+ {
2800
+ skill: 'ralph',
2801
+ phase: testCase.phase,
2802
+ active: true,
2803
+ activated_at: '2026-04-19T00:00:00.000Z',
2804
+ updated_at: '2026-04-19T00:10:00.000Z',
2805
+ session_id: sessionId,
2806
+ },
2807
+ ],
2808
+ }, null, 2));
2809
+ await writeFile(join(stateDir, 'sessions', sessionId, 'ralph-state.json'), JSON.stringify({
2810
+ active: false,
2811
+ mode: 'ralph',
2812
+ current_phase: testCase.phase,
2813
+ started_at: '2026-04-19T00:00:00.000Z',
2814
+ completed_at: '2026-04-19T00:10:00.000Z',
2815
+ iteration: 50,
2816
+ max_iterations: 50,
2817
+ ...(testCase.run_outcome ? { run_outcome: testCase.run_outcome } : {}),
2818
+ }, null, 2));
2819
+ const result = await recordSkillActivation({
2820
+ stateDir,
2821
+ text: '\\ keep going now',
2822
+ sessionId,
2823
+ nowIso: '2026-04-19T00:15:00.000Z',
2824
+ });
2825
+ assert.ok(result);
2826
+ assert.equal(result.skill, 'ralph');
2827
+ assert.equal(result.phase, 'planning');
2828
+ assert.equal(result.activated_at, '2026-04-19T00:15:00.000Z');
2829
+ assert.equal(result.active_skills?.[0]?.phase, 'planning');
2830
+ assert.equal(result.active_skills?.[0]?.activated_at, '2026-04-19T00:15:00.000Z');
2831
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'ralph-state.json'), 'utf-8'));
2832
+ assert.equal(modeState.active, true);
2833
+ assert.equal(modeState.current_phase, 'starting');
2834
+ assert.equal(modeState.started_at, '2026-04-19T00:15:00.000Z');
2835
+ assert.equal(modeState.completed_at, undefined);
2836
+ assert.equal(modeState.iteration, 0);
2837
+ assert.equal(modeState.max_iterations, 50);
2838
+ }
2839
+ finally {
2840
+ await rm(cwd, { recursive: true, force: true });
2841
+ }
2842
+ }
2843
+ });
2844
+ it('routes bare keep-going continuation to the active ralph skill instead of resetting through generic keep-going detection', async () => {
2845
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-ralph-bare-continuation-'));
2846
+ const stateDir = join(cwd, '.omx', 'state');
2847
+ try {
2848
+ await mkdir(join(stateDir, 'sessions', 'sess-ralph-bare'), { recursive: true });
2849
+ await writeFile(join(stateDir, 'sessions', 'sess-ralph-bare', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2850
+ version: 1,
2851
+ active: true,
2852
+ skill: 'ralph',
2853
+ keyword: '$ralph',
2854
+ phase: 'executing',
2855
+ activated_at: '2026-04-19T00:00:00.000Z',
2856
+ updated_at: '2026-04-19T00:10:00.000Z',
2857
+ source: 'keyword-detector',
2858
+ session_id: 'sess-ralph-bare',
2859
+ active_skills: [
2860
+ {
2861
+ skill: 'ralph',
2862
+ phase: 'executing',
2863
+ active: true,
2864
+ activated_at: '2026-04-19T00:00:00.000Z',
2865
+ updated_at: '2026-04-19T00:10:00.000Z',
2866
+ session_id: 'sess-ralph-bare',
2867
+ },
2868
+ ],
2869
+ }, null, 2));
2870
+ await writeFile(join(stateDir, 'sessions', 'sess-ralph-bare', 'ralph-state.json'), JSON.stringify({
2871
+ active: true,
2872
+ mode: 'ralph',
2873
+ current_phase: 'verifying',
2874
+ started_at: '2026-04-19T00:00:00.000Z',
2875
+ updated_at: '2026-04-19T00:10:00.000Z',
2876
+ iteration: 7,
2877
+ max_iterations: 50,
2878
+ session_id: 'sess-ralph-bare',
2879
+ }, null, 2));
2880
+ const result = await recordSkillActivation({
2881
+ stateDir,
2882
+ text: 'keep going now',
2883
+ sessionId: 'sess-ralph-bare',
2884
+ nowIso: '2026-04-19T00:15:00.000Z',
2885
+ });
2886
+ assert.ok(result);
2887
+ assert.equal(result.skill, 'ralph');
2888
+ assert.equal(result.keyword, '$ralph');
2889
+ assert.equal(result.transition_error, undefined);
2890
+ const modeState = JSON.parse(await readFile(join(stateDir, 'sessions', 'sess-ralph-bare', 'ralph-state.json'), 'utf-8'));
2891
+ assert.equal(modeState.current_phase, 'verifying');
2892
+ assert.equal(modeState.iteration, 7);
2893
+ assert.equal(modeState.max_iterations, 50);
2894
+ }
2895
+ finally {
2896
+ await rm(cwd, { recursive: true, force: true });
2897
+ }
2898
+ });
2899
+ it('does not reuse active workflow continuation when prompt contains an unknown plugin-prefixed explicit token', async () => {
2900
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-unknown-prefixed-explicit-'));
2901
+ const stateDir = join(cwd, '.omx', 'state');
2902
+ try {
2903
+ await mkdir(join(stateDir, 'sessions', 'sess-unknown-prefixed'), { recursive: true });
2904
+ await writeFile(join(stateDir, 'sessions', 'sess-unknown-prefixed', SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2905
+ version: 1,
2906
+ active: true,
2907
+ skill: 'ralph',
2908
+ keyword: '$ralph',
2909
+ phase: 'executing',
2910
+ activated_at: '2026-04-19T00:00:00.000Z',
2911
+ updated_at: '2026-04-19T00:10:00.000Z',
2912
+ source: 'keyword-detector',
2913
+ session_id: 'sess-unknown-prefixed',
2914
+ active_skills: [
2915
+ {
2916
+ skill: 'ralph',
2917
+ phase: 'executing',
2918
+ active: true,
2919
+ activated_at: '2026-04-19T00:00:00.000Z',
2920
+ updated_at: '2026-04-19T00:10:00.000Z',
2921
+ session_id: 'sess-unknown-prefixed',
2922
+ },
2923
+ ],
2924
+ }, null, 2));
2925
+ const result = await recordSkillActivation({
2926
+ stateDir,
2927
+ text: '$oh-my-codex:unknown continue',
2928
+ sessionId: 'sess-unknown-prefixed',
2929
+ nowIso: '2026-04-19T00:15:00.000Z',
2930
+ });
2931
+ assert.equal(result, null);
2932
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-unknown-prefixed', 'ralph-state.json')), false);
2933
+ }
2934
+ finally {
2935
+ await rm(cwd, { recursive: true, force: true });
2936
+ }
2937
+ });
2938
+ it('does not continue a workflow from another session root canonical entry', async () => {
2939
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-cross-session-continue-'));
2940
+ const stateDir = join(cwd, '.omx', 'state');
2941
+ try {
2942
+ await mkdir(stateDir, { recursive: true });
2943
+ await writeFile(join(stateDir, SKILL_ACTIVE_STATE_FILE), JSON.stringify({
2944
+ version: 1,
2945
+ active: true,
2946
+ skill: 'autopilot',
2947
+ keyword: 'autopilot',
2948
+ phase: 'ralplan',
2949
+ session_id: 'sess-a',
2950
+ active_skills: [{ skill: 'autopilot', phase: 'ralplan', active: true, session_id: 'sess-a' }],
2951
+ }, null, 2));
2952
+ const result = await recordSkillActivation({
2953
+ stateDir,
2954
+ text: 'continue',
2955
+ sessionId: 'sess-b',
2956
+ nowIso: '2026-05-08T00:00:00.000Z',
2957
+ });
2958
+ assert.equal(result, null);
2959
+ assert.equal(existsSync(join(stateDir, 'sessions', 'sess-b', SKILL_ACTIVE_STATE_FILE)), false);
2960
+ const rootCanonical = JSON.parse(await readFile(join(stateDir, SKILL_ACTIVE_STATE_FILE), 'utf-8'));
2961
+ assert.deepEqual(rootCanonical.active_skills, [
2962
+ { skill: 'autopilot', phase: 'ralplan', active: true, session_id: 'sess-a' },
2963
+ ]);
2964
+ }
2965
+ finally {
2966
+ await rm(cwd, { recursive: true, force: true });
2967
+ }
2968
+ });
2969
+ it('denies switching away from a standalone workflow without explicit clear', async () => {
2970
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-skill-switch-deny-'));
2971
+ const stateDir = join(cwd, '.omx', 'state');
2972
+ const statePath = join(stateDir, SKILL_ACTIVE_STATE_FILE);
2973
+ try {
2974
+ await mkdir(stateDir, { recursive: true });
2975
+ await writeFile(statePath, JSON.stringify({
2976
+ version: 1,
2977
+ active: true,
2978
+ skill: 'autopilot',
2979
+ keyword: 'autopilot',
2980
+ phase: 'ralplan',
2981
+ activated_at: '2026-02-25T00:00:00.000Z',
2982
+ updated_at: '2026-02-25T00:10:00.000Z',
2983
+ source: 'keyword-detector',
2984
+ }));
2985
+ const result = await recordSkillActivation({
2986
+ stateDir,
2987
+ text: 'please run $ralph now',
2988
+ nowIso: '2026-02-26T00:00:00.000Z',
2989
+ });
2990
+ assert.ok(result);
2991
+ assert.equal(result.skill, 'autopilot');
2992
+ assert.match(String(result.transition_error), /Unsupported workflow overlap: autopilot \+ ralph\./);
2993
+ assert.equal(result.activated_at, '2026-02-25T00:00:00.000Z');
2994
+ }
2995
+ finally {
2996
+ await rm(cwd, { recursive: true, force: true });
2997
+ }
2998
+ });
2999
+ it('resets activated_at when keyword changes within the same skill', async () => {
3000
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-state-keyword-switch-'));
3001
+ const stateDir = join(cwd, '.omx', 'state');
3002
+ const statePath = join(stateDir, SKILL_ACTIVE_STATE_FILE);
3003
+ try {
3004
+ await mkdir(stateDir, { recursive: true });
3005
+ await writeFile(statePath, JSON.stringify({
3006
+ version: 1,
3007
+ active: true,
3008
+ skill: 'autopilot',
3009
+ keyword: 'autopilot',
3010
+ phase: 'ralplan',
3011
+ activated_at: '2026-02-25T00:00:00.000Z',
3012
+ updated_at: '2026-02-25T00:10:00.000Z',
3013
+ source: 'keyword-detector',
3014
+ }));
3015
+ const result = await recordSkillActivation({
3016
+ stateDir,
3017
+ text: 'I want a starter API',
3018
+ nowIso: '2026-02-26T00:00:00.000Z',
3019
+ });
3020
+ assert.ok(result);
3021
+ assert.equal(result.skill, 'autopilot');
3022
+ assert.notEqual(result.keyword.toLowerCase(), 'autopilot');
3023
+ assert.equal(result.activated_at, '2026-02-26T00:00:00.000Z');
3024
+ }
3025
+ finally {
3026
+ await rm(cwd, { recursive: true, force: true });
3027
+ }
3028
+ });
3029
+ });
3030
+ describe('isUnderspecifiedForExecution', () => {
3031
+ it('flags vague prompt with no files or functions', () => {
3032
+ assert.equal(isUnderspecifiedForExecution('ralph fix this'), true);
3033
+ });
3034
+ it('flags short vague prompt', () => {
3035
+ assert.equal(isUnderspecifiedForExecution('autopilot build the app'), true);
3036
+ });
3037
+ it('flags prompt with only keyword and generic words', () => {
3038
+ assert.equal(isUnderspecifiedForExecution('team improve performance'), true);
3039
+ });
3040
+ it('passes prompt with a file path reference', () => {
3041
+ assert.equal(isUnderspecifiedForExecution('ralph fix src/hooks/bridge.ts'), false);
3042
+ });
3043
+ it('passes prompt with a file extension reference', () => {
3044
+ assert.equal(isUnderspecifiedForExecution('fix the bug in auth.ts'), false);
3045
+ });
3046
+ it('passes prompt with a directory/file path', () => {
3047
+ assert.equal(isUnderspecifiedForExecution('update src/hooks/emulator.ts'), false);
3048
+ });
3049
+ it('passes prompt with a camelCase symbol', () => {
3050
+ assert.equal(isUnderspecifiedForExecution('team fix processKeywordDetector'), false);
3051
+ });
3052
+ it('passes prompt with a PascalCase symbol', () => {
3053
+ assert.equal(isUnderspecifiedForExecution('ralph update UserModel'), false);
3054
+ });
3055
+ it('passes prompt with snake_case symbol', () => {
3056
+ assert.equal(isUnderspecifiedForExecution('fix user_model validation'), false);
3057
+ });
3058
+ it('passes prompt with an issue number', () => {
3059
+ assert.equal(isUnderspecifiedForExecution('autopilot implement #42'), false);
3060
+ });
3061
+ it('passes prompt with numbered steps', () => {
3062
+ assert.equal(isUnderspecifiedForExecution('ralph do:\n1. Add input validation\n2. Write tests\n3. Update README'), false);
3063
+ });
3064
+ it('passes prompt with acceptance criteria keyword', () => {
3065
+ assert.equal(isUnderspecifiedForExecution('add login - acceptance criteria: user sees error on bad password'), false);
3066
+ });
3067
+ it('passes prompt with a specific error reference', () => {
3068
+ assert.equal(isUnderspecifiedForExecution('ralph fix TypeError in auth handler'), false);
3069
+ });
3070
+ it('passes with force: escape hatch prefix', () => {
3071
+ assert.equal(isUnderspecifiedForExecution('force: ralph refactor the auth module'), false);
3072
+ });
3073
+ it('passes with ! escape hatch prefix', () => {
3074
+ assert.equal(isUnderspecifiedForExecution('! autopilot optimize everything'), false);
3075
+ });
3076
+ it('returns true for empty string', () => {
3077
+ assert.equal(isUnderspecifiedForExecution(''), true);
3078
+ });
3079
+ it('returns true for whitespace only', () => {
3080
+ assert.equal(isUnderspecifiedForExecution(' '), true);
3081
+ });
3082
+ it('passes prompt with test runner command', () => {
3083
+ assert.equal(isUnderspecifiedForExecution('ralph npm test && fix failures'), false);
3084
+ });
3085
+ it('passes longer prompt that exceeds word threshold', () => {
3086
+ // 16+ effective words without specific signals → passes (not underspecified by word count)
3087
+ const longVague = 'please help me improve the overall quality and performance and reliability of this system going forward';
3088
+ assert.equal(isUnderspecifiedForExecution(longVague), false);
3089
+ });
3090
+ it('false positive prevention: camelCase identifiers pass', () => {
3091
+ assert.equal(isUnderspecifiedForExecution('fix getUserById to handle null'), false);
3092
+ });
3093
+ });
3094
+ describe('applyRalplanGate', () => {
3095
+ it('gates short team follow-up when only PRD/test-spec artifacts exist', async () => {
3096
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-followup-'));
3097
+ try {
3098
+ const plansDir = join(cwd, '.omx', 'plans');
3099
+ await mkdir(plansDir, { recursive: true });
3100
+ await writeFile(join(plansDir, 'prd-issue-831.md'), '# Approved plan\n\nLaunch hint: omx team 3:executor "Execute approved issue 831 plan"\n');
3101
+ await writeFile(join(plansDir, 'test-spec-issue-831.md'), '# Test spec\n');
3102
+ const result = applyRalplanGate(['team'], 'team', { cwd });
3103
+ assert.equal(result.gateApplied, true);
3104
+ assert.deepEqual(result.keywords, ['ralplan']);
3105
+ }
3106
+ finally {
3107
+ await rm(cwd, { recursive: true, force: true });
3108
+ }
3109
+ });
3110
+ it('does not re-enter ralplan for a short approved team follow-up with durable consensus', async () => {
3111
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-followup-ko-'));
3112
+ try {
3113
+ const plansDir = join(cwd, '.omx', 'plans');
3114
+ const stateDir = join(cwd, '.omx', 'state');
3115
+ await mkdir(plansDir, { recursive: true });
3116
+ await mkdir(stateDir, { recursive: true });
3117
+ await writeFile(join(plansDir, 'prd-issue-831.md'), '# Approved plan\n\nLaunch hint: omx team 3:executor "Execute approved issue 831 plan"\n');
3118
+ await writeFile(join(plansDir, 'test-spec-issue-831.md'), '# Test spec\n');
3119
+ await writeFile(join(stateDir, 'ralplan-state.json'), JSON.stringify({
3120
+ current_phase: 'complete',
3121
+ planning_complete: true,
3122
+ ralplan_consensus_gate: {
3123
+ complete: true,
3124
+ sequence: ['architect-review', 'critic-review'],
3125
+ ralplan_architect_review: { agent_role: 'architect', verdict: 'approve', iteration: 1 },
3126
+ ralplan_critic_review: { agent_role: 'critic', verdict: 'approve', iteration: 1 },
3127
+ },
3128
+ }));
3129
+ const result = applyRalplanGate(['team'], 'team으로 해줘', { cwd });
3130
+ assert.equal(result.gateApplied, false);
3131
+ assert.deepEqual(result.keywords, ['team']);
3132
+ }
3133
+ finally {
3134
+ await rm(cwd, { recursive: true, force: true });
3135
+ }
3136
+ });
3137
+ it('keeps native-proof execution follow-ups gated when consensus is artifact-only', async () => {
3138
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-native-required-'));
3139
+ try {
3140
+ const plansDir = join(cwd, '.omx', 'plans');
3141
+ const stateDir = join(cwd, '.omx', 'state');
3142
+ await mkdir(plansDir, { recursive: true });
3143
+ await mkdir(stateDir, { recursive: true });
3144
+ await writeFile(join(plansDir, 'prd-issue-833.md'), '# Approved plan\n\nLaunch hint: omx team 3:executor "Execute approved issue 833 plan"\n');
3145
+ await writeFile(join(plansDir, 'test-spec-issue-833.md'), '# Test spec\n');
3146
+ await writeFile(join(stateDir, 'ralplan-state.json'), JSON.stringify({
3147
+ current_phase: 'complete',
3148
+ planning_complete: true,
3149
+ ralplan_consensus_gate: {
3150
+ complete: true,
3151
+ sequence: ['architect-review', 'critic-review'],
3152
+ ralplan_architect_review: {
3153
+ agent_role: 'architect',
3154
+ verdict: 'approve',
3155
+ iteration: 1,
3156
+ provenance_kind: 'codex_exec',
3157
+ },
3158
+ ralplan_critic_review: {
3159
+ agent_role: 'critic',
3160
+ verdict: 'approve',
3161
+ iteration: 1,
3162
+ provenance_kind: 'codex_exec',
3163
+ },
3164
+ },
3165
+ }));
3166
+ const result = applyRalplanGate(['team'], 'team', { cwd, requireNativeSubagents: true });
3167
+ assert.equal(result.gateApplied, true);
3168
+ assert.deepEqual(result.keywords, ['ralplan']);
3169
+ }
3170
+ finally {
3171
+ await rm(cwd, { recursive: true, force: true });
3172
+ }
3173
+ });
3174
+ it('does not re-enter ralplan for a short approved ralph follow-up with durable consensus', async () => {
3175
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-followup-ralph-'));
3176
+ try {
3177
+ const plansDir = join(cwd, '.omx', 'plans');
3178
+ const stateDir = join(cwd, '.omx', 'state');
3179
+ await mkdir(plansDir, { recursive: true });
3180
+ await mkdir(stateDir, { recursive: true });
3181
+ await writeFile(join(plansDir, 'prd-issue-832.md'), '# Approved plan\n\nLaunch hint: omx ralph "Execute approved issue 832 plan"\n');
3182
+ await writeFile(join(plansDir, 'test-spec-issue-832.md'), '# Test spec\n');
3183
+ await writeFile(join(stateDir, 'ralplan-state.json'), JSON.stringify({
3184
+ current_phase: 'complete',
3185
+ planning_complete: true,
3186
+ ralplan_consensus_gate: {
3187
+ complete: true,
3188
+ sequence: ['architect-review', 'critic-review'],
3189
+ ralplan_architect_review: { agent_role: 'architect', verdict: 'approve', iteration: 1 },
3190
+ ralplan_critic_review: { agent_role: 'critic', verdict: 'approve', iteration: 1 },
3191
+ },
3192
+ }));
3193
+ const result = applyRalplanGate(['ralph'], 'ralph please', { cwd, priorSkill: 'ralplan' });
3194
+ assert.equal(result.gateApplied, false);
3195
+ assert.deepEqual(result.keywords, ['ralph']);
3196
+ }
3197
+ finally {
3198
+ await rm(cwd, { recursive: true, force: true });
3199
+ }
3200
+ });
3201
+ it('ignores ambient OMX_ROOT consensus state for local PRD/test-spec-only follow-up gating', async () => {
3202
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-local-'));
3203
+ const ambientRoot = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-ambient-'));
3204
+ const previousOmxRoot = process.env.OMX_ROOT;
3205
+ try {
3206
+ const plansDir = join(cwd, '.omx', 'plans');
3207
+ await mkdir(plansDir, { recursive: true });
3208
+ await writeFile(join(plansDir, 'prd-local.md'), '# Plan\n');
3209
+ await writeFile(join(plansDir, 'test-spec-local.md'), '# Test spec\n');
3210
+ const ambientStateDir = join(ambientRoot, '.omx', 'state');
3211
+ await mkdir(ambientStateDir, { recursive: true });
3212
+ await writeFile(join(ambientStateDir, 'ralplan-state.json'), JSON.stringify({
3213
+ current_phase: 'complete',
3214
+ planning_complete: true,
3215
+ ralplan_consensus_gate: {
3216
+ complete: true,
3217
+ ralplan_architect_review: { agent_role: 'architect', verdict: 'approve', iteration: 1 },
3218
+ ralplan_critic_review: { agent_role: 'critic', verdict: 'approve', iteration: 1 },
3219
+ },
3220
+ }));
3221
+ process.env.OMX_ROOT = ambientRoot;
3222
+ const result = applyRalplanGate(['team'], 'team', { cwd });
3223
+ assert.equal(result.gateApplied, true);
3224
+ assert.deepEqual(result.keywords, ['ralplan']);
3225
+ }
3226
+ finally {
3227
+ if (previousOmxRoot === undefined)
3228
+ delete process.env.OMX_ROOT;
3229
+ else
3230
+ process.env.OMX_ROOT = previousOmxRoot;
3231
+ await rm(cwd, { recursive: true, force: true });
3232
+ await rm(ambientRoot, { recursive: true, force: true });
3233
+ }
3234
+ });
3235
+ it('gates short follow-up when local state only has latest verdict fields', async () => {
3236
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-keyword-gate-latest-only-'));
3237
+ try {
3238
+ const plansDir = join(cwd, '.omx', 'plans');
3239
+ const stateDir = join(cwd, '.omx', 'state');
3240
+ await mkdir(plansDir, { recursive: true });
3241
+ await mkdir(stateDir, { recursive: true });
3242
+ await writeFile(join(plansDir, 'prd-local.md'), '# Plan\n\nLaunch hint: omx team 3:executor "Execute approved local plan"\n');
3243
+ await writeFile(join(plansDir, 'test-spec-local.md'), '# Test spec\n');
3244
+ await writeFile(join(stateDir, 'ralplan-state.json'), JSON.stringify({
3245
+ current_phase: 'complete',
3246
+ planning_complete: true,
3247
+ latest_architect_verdict: 'approve',
3248
+ latest_critic_verdict: 'approve',
3249
+ }));
3250
+ const result = applyRalplanGate(['team'], 'team', { cwd });
3251
+ assert.equal(result.gateApplied, true);
3252
+ assert.deepEqual(result.keywords, ['ralplan']);
3253
+ }
3254
+ finally {
3255
+ await rm(cwd, { recursive: true, force: true });
3256
+ }
3257
+ });
3258
+ it('redirects underspecified execution keywords to ralplan', () => {
3259
+ const result = applyRalplanGate(['ralph'], 'ralph fix this');
3260
+ assert.equal(result.gateApplied, true);
3261
+ assert.ok(result.keywords.includes('ralplan'));
3262
+ assert.ok(!result.keywords.includes('ralph'));
3263
+ });
3264
+ it('redirects autopilot to ralplan when underspecified', () => {
3265
+ const result = applyRalplanGate(['autopilot'], 'autopilot build the app');
3266
+ assert.equal(result.gateApplied, true);
3267
+ assert.ok(result.keywords.includes('ralplan'));
3268
+ });
3269
+ it('does not gate well-specified prompts', () => {
3270
+ const result = applyRalplanGate(['ralph'], 'ralph fix src/hooks/bridge.ts null check');
3271
+ assert.equal(result.gateApplied, false);
3272
+ assert.ok(result.keywords.includes('ralph'));
3273
+ });
3274
+ it('does not gate when cancel is present', () => {
3275
+ const result = applyRalplanGate(['cancel', 'ralph'], 'cancel ralph');
3276
+ assert.equal(result.gateApplied, false);
3277
+ });
3278
+ it('does not gate when ralplan is already present', () => {
3279
+ const result = applyRalplanGate(['ralplan'], 'ralplan add auth');
3280
+ assert.equal(result.gateApplied, false);
3281
+ assert.ok(result.keywords.includes('ralplan'));
3282
+ });
3283
+ it('does not gate non-execution keywords', () => {
3284
+ const result = applyRalplanGate(['analyze'], 'analyze this');
3285
+ assert.equal(result.gateApplied, false);
3286
+ });
3287
+ it('preserves non-execution keywords when gating', () => {
3288
+ const result = applyRalplanGate(['ralph', 'analyze'], 'ralph analyze this');
3289
+ assert.equal(result.gateApplied, true);
3290
+ assert.ok(result.keywords.includes('analyze'));
3291
+ assert.ok(result.keywords.includes('ralplan'));
3292
+ assert.ok(!result.keywords.includes('ralph'));
3293
+ });
3294
+ it('handles force: escape hatch — does not gate', () => {
3295
+ const result = applyRalplanGate(['ralph'], 'force: ralph refactor the auth module');
3296
+ assert.equal(result.gateApplied, false);
3297
+ });
3298
+ it('gates multiple execution keywords at once', () => {
3299
+ const result = applyRalplanGate(['ralph', 'team'], 'ralph team fix this');
3300
+ assert.equal(result.gateApplied, true);
3301
+ assert.ok(result.keywords.includes('ralplan'));
3302
+ assert.ok(!result.keywords.includes('ralph'));
3303
+ assert.ok(!result.keywords.includes('team'));
3304
+ assert.ok(result.gatedKeywords.includes('ralph'));
3305
+ assert.ok(result.gatedKeywords.includes('team'));
3306
+ });
3307
+ it('returns empty keywords unchanged when no keywords', () => {
3308
+ const result = applyRalplanGate([], 'fix this');
3309
+ assert.equal(result.gateApplied, false);
3310
+ assert.deepEqual(result.keywords, []);
3311
+ });
3312
+ it('does not duplicate ralplan if already in filtered list', () => {
3313
+ // ultrawork is an execution keyword; after filtering, ralplan added once
3314
+ const result = applyRalplanGate(['ultrawork'], 'ultrawork do stuff');
3315
+ assert.equal(result.keywords.filter(k => k === 'ralplan').length, 1);
3316
+ });
3317
+ it('reports gatedKeywords correctly', () => {
3318
+ const result = applyRalplanGate(['ralph', 'ultrawork'], 'ralph ultrawork build');
3319
+ assert.ok(result.gatedKeywords.includes('ralph'));
3320
+ assert.ok(result.gatedKeywords.includes('ultrawork'));
3321
+ });
3322
+ });
3323
+ //# sourceMappingURL=keyword-detector.test.js.map