oh-my-codex 0.20.5 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (890) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +22 -19
  3. package/dist/agents/__tests__/definitions.test.js +0 -27
  4. package/dist/agents/__tests__/definitions.test.js.map +1 -1
  5. package/dist/agents/__tests__/native-config.test.js +3 -8
  6. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  7. package/dist/agents/definitions.d.ts.map +1 -1
  8. package/dist/agents/definitions.js +0 -41
  9. package/dist/agents/definitions.js.map +1 -1
  10. package/dist/agents/policy.d.ts.map +1 -1
  11. package/dist/agents/policy.js +0 -1
  12. package/dist/agents/policy.js.map +1 -1
  13. package/dist/autopilot/__tests__/completion-gate-advisory.test.d.ts +2 -0
  14. package/dist/autopilot/__tests__/completion-gate-advisory.test.d.ts.map +1 -0
  15. package/dist/autopilot/__tests__/completion-gate-advisory.test.js +383 -0
  16. package/dist/autopilot/__tests__/completion-gate-advisory.test.js.map +1 -0
  17. package/dist/autopilot/completion-gate.d.ts +6 -1
  18. package/dist/autopilot/completion-gate.d.ts.map +1 -1
  19. package/dist/autopilot/completion-gate.js +247 -7
  20. package/dist/autopilot/completion-gate.js.map +1 -1
  21. package/dist/catalog/__tests__/generator.test.js +15 -10
  22. package/dist/catalog/__tests__/generator.test.js.map +1 -1
  23. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +13 -7
  24. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
  25. package/dist/catalog/__tests__/schema.test.js +3 -5
  26. package/dist/catalog/__tests__/schema.test.js.map +1 -1
  27. package/dist/catalog/schema.js +1 -1
  28. package/dist/catalog/schema.js.map +1 -1
  29. package/dist/cli/__tests__/autopilot.test.d.ts +2 -0
  30. package/dist/cli/__tests__/autopilot.test.d.ts.map +1 -0
  31. package/dist/cli/__tests__/autopilot.test.js +143 -0
  32. package/dist/cli/__tests__/autopilot.test.js.map +1 -0
  33. package/dist/cli/__tests__/codex-plugin-layout.test.js +6 -2
  34. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
  35. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts +2 -0
  36. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.d.ts.map +1 -0
  37. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js +592 -0
  38. package/dist/cli/__tests__/detached-launch-diagnostics-3578.test.js.map +1 -0
  39. package/dist/cli/__tests__/detached-leader-teardown.test.js +270 -33
  40. package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -1
  41. package/dist/cli/__tests__/doctor-state-root-binding.test.js +69 -2
  42. package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -1
  43. package/dist/cli/__tests__/doctor-team.test.js +85 -0
  44. package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
  45. package/dist/cli/__tests__/doctor-warning-copy.test.js +136 -8
  46. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  47. package/dist/cli/__tests__/index.test.js +543 -2
  48. package/dist/cli/__tests__/index.test.js.map +1 -1
  49. package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts +2 -0
  50. package/dist/cli/__tests__/issue-windows-cancel-identity.test.d.ts.map +1 -0
  51. package/dist/cli/__tests__/issue-windows-cancel-identity.test.js +17 -0
  52. package/dist/cli/__tests__/issue-windows-cancel-identity.test.js.map +1 -0
  53. package/dist/cli/__tests__/launch-fallback.test.js +120 -3
  54. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  55. package/dist/cli/__tests__/package-bin-contract.test.js +25 -8
  56. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  57. package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts +2 -0
  58. package/dist/cli/__tests__/plugin-cache-stale-lock.test.d.ts.map +1 -0
  59. package/dist/cli/__tests__/plugin-cache-stale-lock.test.js +76 -0
  60. package/dist/cli/__tests__/plugin-cache-stale-lock.test.js.map +1 -0
  61. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts +2 -0
  62. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.d.ts.map +1 -0
  63. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js +1662 -0
  64. package/dist/cli/__tests__/plugin-cache-symlink-provenance-3552.test.js.map +1 -0
  65. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts +2 -0
  66. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.d.ts.map +1 -0
  67. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js +522 -0
  68. package/dist/cli/__tests__/plugin-launcher-provenance-3558.test.js.map +1 -0
  69. package/dist/cli/__tests__/ralph-deslop-contract.test.js +4 -18
  70. package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -1
  71. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +4 -30
  72. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
  73. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +4 -15
  74. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -1
  75. package/dist/cli/__tests__/ralplan-advisory.test.d.ts +2 -0
  76. package/dist/cli/__tests__/ralplan-advisory.test.d.ts.map +1 -0
  77. package/dist/cli/__tests__/ralplan-advisory.test.js +301 -0
  78. package/dist/cli/__tests__/ralplan-advisory.test.js.map +1 -0
  79. package/dist/cli/__tests__/ralplan.test.js +88 -4
  80. package/dist/cli/__tests__/ralplan.test.js.map +1 -1
  81. package/dist/cli/__tests__/resume.test.js +81 -6
  82. package/dist/cli/__tests__/resume.test.js.map +1 -1
  83. package/dist/cli/__tests__/session-scoped-runtime.test.js +458 -4
  84. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
  85. package/dist/cli/__tests__/session-search-help.test.js +65 -3
  86. package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
  87. package/dist/cli/__tests__/setup-agents-overwrite.test.js +49 -0
  88. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  89. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +34 -0
  90. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
  91. package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js +1 -1
  92. package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js.map +1 -1
  93. package/dist/cli/__tests__/setup-install-mode.test.js +133 -23
  94. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  95. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +1 -1
  96. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
  97. package/dist/cli/__tests__/setup-refresh.test.js +12 -6
  98. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  99. package/dist/cli/__tests__/setup-skills-overwrite.test.js +180 -21
  100. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
  101. package/dist/cli/__tests__/sparkshell-cli.test.js +4 -0
  102. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
  103. package/dist/cli/__tests__/ultragoal.test.js +115 -0
  104. package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
  105. package/dist/cli/__tests__/uninstall.test.js +23 -23
  106. package/dist/cli/__tests__/uninstall.test.js.map +1 -1
  107. package/dist/cli/__tests__/update.test.js +81 -1
  108. package/dist/cli/__tests__/update.test.js.map +1 -1
  109. package/dist/cli/__tests__/windows-popup-loop-contract.test.js +30 -4
  110. package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
  111. package/dist/cli/autopilot.d.ts +8 -0
  112. package/dist/cli/autopilot.d.ts.map +1 -0
  113. package/dist/cli/autopilot.js +160 -0
  114. package/dist/cli/autopilot.js.map +1 -0
  115. package/dist/cli/doctor.d.ts +12 -0
  116. package/dist/cli/doctor.d.ts.map +1 -1
  117. package/dist/cli/doctor.js +216 -27
  118. package/dist/cli/doctor.js.map +1 -1
  119. package/dist/cli/index.d.ts +114 -8
  120. package/dist/cli/index.d.ts.map +1 -1
  121. package/dist/cli/index.js +1932 -200
  122. package/dist/cli/index.js.map +1 -1
  123. package/dist/cli/mcp-parity.d.ts.map +1 -1
  124. package/dist/cli/mcp-parity.js +7 -3
  125. package/dist/cli/mcp-parity.js.map +1 -1
  126. package/dist/cli/native-assets.d.ts +1 -1
  127. package/dist/cli/native-assets.d.ts.map +1 -1
  128. package/dist/cli/package-manager-ownership.d.ts +6 -0
  129. package/dist/cli/package-manager-ownership.d.ts.map +1 -1
  130. package/dist/cli/package-manager-ownership.js +15 -0
  131. package/dist/cli/package-manager-ownership.js.map +1 -1
  132. package/dist/cli/plugin-marketplace.d.ts +90 -4
  133. package/dist/cli/plugin-marketplace.d.ts.map +1 -1
  134. package/dist/cli/plugin-marketplace.js +2190 -105
  135. package/dist/cli/plugin-marketplace.js.map +1 -1
  136. package/dist/cli/ralplan.d.ts +4 -1
  137. package/dist/cli/ralplan.d.ts.map +1 -1
  138. package/dist/cli/ralplan.js +199 -1
  139. package/dist/cli/ralplan.js.map +1 -1
  140. package/dist/cli/session-search.d.ts.map +1 -1
  141. package/dist/cli/session-search.js +38 -1
  142. package/dist/cli/session-search.js.map +1 -1
  143. package/dist/cli/setup.d.ts +3 -0
  144. package/dist/cli/setup.d.ts.map +1 -1
  145. package/dist/cli/setup.js +376 -183
  146. package/dist/cli/setup.js.map +1 -1
  147. package/dist/cli/sparkshell.d.ts.map +1 -1
  148. package/dist/cli/sparkshell.js +9 -10
  149. package/dist/cli/sparkshell.js.map +1 -1
  150. package/dist/cli/ultragoal.d.ts +1 -1
  151. package/dist/cli/ultragoal.d.ts.map +1 -1
  152. package/dist/cli/ultragoal.js +8 -5
  153. package/dist/cli/ultragoal.js.map +1 -1
  154. package/dist/cli/update.d.ts +2 -1
  155. package/dist/cli/update.d.ts.map +1 -1
  156. package/dist/cli/update.js +21 -1
  157. package/dist/cli/update.js.map +1 -1
  158. package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts +2 -0
  159. package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts.map +1 -0
  160. package/dist/compat/__tests__/upgrade-from-0-20.test.js +109 -0
  161. package/dist/compat/__tests__/upgrade-from-0-20.test.js.map +1 -0
  162. package/dist/compat/upgrade-from-0-20.d.ts +64 -0
  163. package/dist/compat/upgrade-from-0-20.d.ts.map +1 -0
  164. package/dist/compat/upgrade-from-0-20.js +276 -0
  165. package/dist/compat/upgrade-from-0-20.js.map +1 -0
  166. package/dist/config/__tests__/generator-idempotent.test.js +118 -0
  167. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  168. package/dist/config/generator.d.ts.map +1 -1
  169. package/dist/config/generator.js +74 -4
  170. package/dist/config/generator.js.map +1 -1
  171. package/dist/hooks/__tests__/analyze-skill-contract.test.js +24 -31
  172. package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -1
  173. package/dist/hooks/__tests__/anti-slop-workflow.test.js +66 -135
  174. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
  175. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +47 -129
  176. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
  177. package/dist/hooks/__tests__/code-review-skill-contract.test.js +16 -18
  178. package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
  179. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +2 -14
  180. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -1
  181. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +56 -234
  182. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
  183. package/dist/hooks/__tests__/deep-interview-contract.test.js +1 -3
  184. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  185. package/dist/hooks/__tests__/design-skill.test.js +18 -16
  186. package/dist/hooks/__tests__/design-skill.test.js.map +1 -1
  187. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +24 -20
  188. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -1
  189. package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js +8 -16
  190. package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -1
  191. package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts +2 -0
  192. package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts.map +1 -0
  193. package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js +169 -0
  194. package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js.map +1 -0
  195. package/dist/hooks/__tests__/keyword-detector.test.js +200 -897
  196. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  197. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +4 -4
  198. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
  199. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +18 -54
  200. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  201. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +14 -904
  202. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
  203. package/dist/hooks/__tests__/notify-hook-session-scope.test.js +5 -5
  204. package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
  205. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +5 -5
  206. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
  207. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +7 -7
  208. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
  209. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +7 -6
  210. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
  211. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +19 -21
  212. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
  213. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +15 -4
  214. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
  215. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +23 -28
  216. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  217. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts +2 -0
  218. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.d.ts.map +1 -0
  219. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js +250 -0
  220. package/dist/hooks/__tests__/ralplan-advisory-keyword.test.js.map +1 -0
  221. package/dist/hooks/__tests__/research-workflow-boundaries.test.js +9 -8
  222. package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -1
  223. package/dist/hooks/__tests__/session.test.js +608 -18
  224. package/dist/hooks/__tests__/session.test.js.map +1 -1
  225. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +13 -22
  226. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -1
  227. package/dist/hooks/__tests__/skill-guidance-contract.test.js +3 -13
  228. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
  229. package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts +2 -0
  230. package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts.map +1 -0
  231. package/dist/hooks/__tests__/sunset-routing-contract.test.js +172 -0
  232. package/dist/hooks/__tests__/sunset-routing-contract.test.js.map +1 -0
  233. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +2 -2
  234. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -1
  235. package/dist/hooks/__tests__/tmux-hook-engine.test.js +18 -3
  236. package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -1
  237. package/dist/hooks/__tests__/visual-ralph-skill.test.js +20 -17
  238. package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -1
  239. package/dist/hooks/__tests__/visual-verdict-loop.test.js +17 -18
  240. package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -1
  241. package/dist/hooks/keyword-detector.d.ts +10 -51
  242. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  243. package/dist/hooks/keyword-detector.js +279 -366
  244. package/dist/hooks/keyword-detector.js.map +1 -1
  245. package/dist/hooks/keyword-registry.d.ts.map +1 -1
  246. package/dist/hooks/keyword-registry.js +14 -26
  247. package/dist/hooks/keyword-registry.js.map +1 -1
  248. package/dist/hooks/native/capability-warnings.d.ts +16 -0
  249. package/dist/hooks/native/capability-warnings.d.ts.map +1 -0
  250. package/dist/hooks/native/capability-warnings.js +40 -0
  251. package/dist/hooks/native/capability-warnings.js.map +1 -0
  252. package/dist/hooks/native/index.d.ts +17 -0
  253. package/dist/hooks/native/index.d.ts.map +1 -0
  254. package/dist/hooks/native/index.js +17 -0
  255. package/dist/hooks/native/index.js.map +1 -0
  256. package/dist/hooks/native/pre-tool-use-advisory.d.ts +17 -0
  257. package/dist/hooks/native/pre-tool-use-advisory.d.ts.map +1 -0
  258. package/dist/hooks/native/pre-tool-use-advisory.js +112 -0
  259. package/dist/hooks/native/pre-tool-use-advisory.js.map +1 -0
  260. package/dist/hooks/native/types.d.ts +30 -0
  261. package/dist/hooks/native/types.d.ts.map +1 -0
  262. package/dist/hooks/native/types.js +22 -0
  263. package/dist/hooks/native/types.js.map +1 -0
  264. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  265. package/dist/hooks/prompt-guidance-contract.js +46 -93
  266. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  267. package/dist/hooks/session.d.ts +22 -4
  268. package/dist/hooks/session.d.ts.map +1 -1
  269. package/dist/hooks/session.js +589 -28
  270. package/dist/hooks/session.js.map +1 -1
  271. package/dist/hooks/sunset-stub.d.ts +17 -0
  272. package/dist/hooks/sunset-stub.d.ts.map +1 -0
  273. package/dist/hooks/sunset-stub.js +125 -0
  274. package/dist/hooks/sunset-stub.js.map +1 -0
  275. package/dist/hud/__tests__/index.test.js +16 -1
  276. package/dist/hud/__tests__/index.test.js.map +1 -1
  277. package/dist/hud/__tests__/reconcile.test.js +134 -7
  278. package/dist/hud/__tests__/reconcile.test.js.map +1 -1
  279. package/dist/hud/__tests__/session-attached.test.d.ts +2 -0
  280. package/dist/hud/__tests__/session-attached.test.d.ts.map +1 -0
  281. package/dist/hud/__tests__/session-attached.test.js +82 -0
  282. package/dist/hud/__tests__/session-attached.test.js.map +1 -0
  283. package/dist/hud/__tests__/tmux-split-realtmux.test.d.ts +2 -0
  284. package/dist/hud/__tests__/tmux-split-realtmux.test.d.ts.map +1 -0
  285. package/dist/hud/__tests__/tmux-split-realtmux.test.js +279 -0
  286. package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -0
  287. package/dist/hud/__tests__/tmux.test.js +166 -22
  288. package/dist/hud/__tests__/tmux.test.js.map +1 -1
  289. package/dist/hud/__tests__/watch-detached.test.d.ts +2 -0
  290. package/dist/hud/__tests__/watch-detached.test.d.ts.map +1 -0
  291. package/dist/hud/__tests__/watch-detached.test.js +383 -0
  292. package/dist/hud/__tests__/watch-detached.test.js.map +1 -0
  293. package/dist/hud/__tests__/watch-realtmux.test.d.ts +2 -0
  294. package/dist/hud/__tests__/watch-realtmux.test.d.ts.map +1 -0
  295. package/dist/hud/__tests__/watch-realtmux.test.js +322 -0
  296. package/dist/hud/__tests__/watch-realtmux.test.js.map +1 -0
  297. package/dist/hud/index.d.ts +3 -0
  298. package/dist/hud/index.d.ts.map +1 -1
  299. package/dist/hud/index.js +98 -20
  300. package/dist/hud/index.js.map +1 -1
  301. package/dist/hud/reconcile.d.ts.map +1 -1
  302. package/dist/hud/reconcile.js +68 -24
  303. package/dist/hud/reconcile.js.map +1 -1
  304. package/dist/hud/session-attached.d.ts +15 -0
  305. package/dist/hud/session-attached.d.ts.map +1 -0
  306. package/dist/hud/session-attached.js +47 -0
  307. package/dist/hud/session-attached.js.map +1 -0
  308. package/dist/hud/tmux.d.ts +5 -0
  309. package/dist/hud/tmux.d.ts.map +1 -1
  310. package/dist/hud/tmux.js +103 -32
  311. package/dist/hud/tmux.js.map +1 -1
  312. package/dist/mcp/__tests__/state-server-ralph-phase.test.js +29 -4
  313. package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -1
  314. package/dist/mcp/__tests__/state-server-schema.test.js +13 -3
  315. package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -1
  316. package/dist/mcp/__tests__/state-server.test.js +11 -1033
  317. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  318. package/dist/mcp/state-server.d.ts +67 -96
  319. package/dist/mcp/state-server.d.ts.map +1 -1
  320. package/dist/mcp/state-server.js +116 -67
  321. package/dist/mcp/state-server.js.map +1 -1
  322. package/dist/modes/__tests__/base-autopilot-gates.test.js +1 -197
  323. package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
  324. package/dist/modes/__tests__/base-autoresearch-contract.test.js +1 -85
  325. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
  326. package/dist/modes/__tests__/base-multi-state-compat.test.js +1 -35
  327. package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -1
  328. package/dist/modes/__tests__/base-session-scope.test.js +1 -158
  329. package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
  330. package/dist/modes/base.d.ts +16 -3
  331. package/dist/modes/base.d.ts.map +1 -1
  332. package/dist/modes/base.js +157 -97
  333. package/dist/modes/base.js.map +1 -1
  334. package/dist/native-assets/policy.d.ts +1 -1
  335. package/dist/native-assets/policy.d.ts.map +1 -1
  336. package/dist/native-assets/policy.js +1 -1
  337. package/dist/native-assets/policy.js.map +1 -1
  338. package/dist/notifications/__tests__/formatter.test.js +8 -0
  339. package/dist/notifications/__tests__/formatter.test.js.map +1 -1
  340. package/dist/notifications/__tests__/template-engine.test.js +8 -0
  341. package/dist/notifications/__tests__/template-engine.test.js.map +1 -1
  342. package/dist/notifications/formatter.js +1 -1
  343. package/dist/notifications/formatter.js.map +1 -1
  344. package/dist/notifications/template-engine.js +1 -1
  345. package/dist/notifications/template-engine.js.map +1 -1
  346. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +0 -21
  347. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -1
  348. package/dist/question/autopilot-wait.d.ts.map +1 -1
  349. package/dist/question/autopilot-wait.js +3 -3
  350. package/dist/question/autopilot-wait.js.map +1 -1
  351. package/dist/question/deep-interview.d.ts +1 -2
  352. package/dist/question/deep-interview.d.ts.map +1 -1
  353. package/dist/question/deep-interview.js +5 -5
  354. package/dist/question/deep-interview.js.map +1 -1
  355. package/dist/ralplan/__tests__/advisory-activation.test.d.ts +2 -0
  356. package/dist/ralplan/__tests__/advisory-activation.test.d.ts.map +1 -0
  357. package/dist/ralplan/__tests__/advisory-activation.test.js +700 -0
  358. package/dist/ralplan/__tests__/advisory-activation.test.js.map +1 -0
  359. package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts +2 -0
  360. package/dist/ralplan/__tests__/advisory-detached-transition.test.d.ts.map +1 -0
  361. package/dist/ralplan/__tests__/advisory-detached-transition.test.js +88 -0
  362. package/dist/ralplan/__tests__/advisory-detached-transition.test.js.map +1 -0
  363. package/dist/ralplan/__tests__/advisory.test.d.ts +2 -0
  364. package/dist/ralplan/__tests__/advisory.test.d.ts.map +1 -0
  365. package/dist/ralplan/__tests__/advisory.test.js +1087 -0
  366. package/dist/ralplan/__tests__/advisory.test.js.map +1 -0
  367. package/dist/ralplan/__tests__/runtime.test.js +380 -716
  368. package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
  369. package/dist/ralplan/advisory-activation-verifier.d.ts +19 -0
  370. package/dist/ralplan/advisory-activation-verifier.d.ts.map +1 -0
  371. package/dist/ralplan/advisory-activation-verifier.js +77 -0
  372. package/dist/ralplan/advisory-activation-verifier.js.map +1 -0
  373. package/dist/ralplan/advisory-activation.d.ts +34 -0
  374. package/dist/ralplan/advisory-activation.d.ts.map +1 -0
  375. package/dist/ralplan/advisory-activation.js +205 -0
  376. package/dist/ralplan/advisory-activation.js.map +1 -0
  377. package/dist/ralplan/advisory-contract.d.ts +103 -0
  378. package/dist/ralplan/advisory-contract.d.ts.map +1 -0
  379. package/dist/ralplan/advisory-contract.js +83 -0
  380. package/dist/ralplan/advisory-contract.js.map +1 -0
  381. package/dist/ralplan/advisory-detached-transition.d.ts +11 -0
  382. package/dist/ralplan/advisory-detached-transition.d.ts.map +1 -0
  383. package/dist/ralplan/advisory-detached-transition.js +21 -0
  384. package/dist/ralplan/advisory-detached-transition.js.map +1 -0
  385. package/dist/ralplan/advisory-evidence.d.ts +91 -0
  386. package/dist/ralplan/advisory-evidence.d.ts.map +1 -0
  387. package/dist/ralplan/advisory-evidence.js +393 -0
  388. package/dist/ralplan/advisory-evidence.js.map +1 -0
  389. package/dist/ralplan/advisory-lifecycle-validation.d.ts +11 -0
  390. package/dist/ralplan/advisory-lifecycle-validation.d.ts.map +1 -0
  391. package/dist/ralplan/advisory-lifecycle-validation.js +72 -0
  392. package/dist/ralplan/advisory-lifecycle-validation.js.map +1 -0
  393. package/dist/ralplan/advisory-postconditions.d.ts +3 -0
  394. package/dist/ralplan/advisory-postconditions.d.ts.map +1 -0
  395. package/dist/ralplan/advisory-postconditions.js +33 -0
  396. package/dist/ralplan/advisory-postconditions.js.map +1 -0
  397. package/dist/ralplan/advisory-recovery-journal.d.ts +56 -0
  398. package/dist/ralplan/advisory-recovery-journal.d.ts.map +1 -0
  399. package/dist/ralplan/advisory-recovery-journal.js +136 -0
  400. package/dist/ralplan/advisory-recovery-journal.js.map +1 -0
  401. package/dist/ralplan/advisory-storage.d.ts +24 -0
  402. package/dist/ralplan/advisory-storage.d.ts.map +1 -0
  403. package/dist/ralplan/advisory-storage.js +106 -0
  404. package/dist/ralplan/advisory-storage.js.map +1 -0
  405. package/dist/ralplan/advisory.d.ts +99 -0
  406. package/dist/ralplan/advisory.d.ts.map +1 -0
  407. package/dist/ralplan/advisory.js +914 -0
  408. package/dist/ralplan/advisory.js.map +1 -0
  409. package/dist/ralplan/documented-leader-preflight.d.ts +8 -0
  410. package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
  411. package/dist/ralplan/documented-leader-preflight.js +60 -2
  412. package/dist/ralplan/documented-leader-preflight.js.map +1 -1
  413. package/dist/ralplan/runtime-advisory-lifecycle.d.ts +74 -0
  414. package/dist/ralplan/runtime-advisory-lifecycle.d.ts.map +1 -0
  415. package/dist/ralplan/runtime-advisory-lifecycle.js +352 -0
  416. package/dist/ralplan/runtime-advisory-lifecycle.js.map +1 -0
  417. package/dist/ralplan/runtime-contract.d.ts +126 -0
  418. package/dist/ralplan/runtime-contract.d.ts.map +1 -0
  419. package/dist/ralplan/runtime-contract.js +2 -0
  420. package/dist/ralplan/runtime-contract.js.map +1 -0
  421. package/dist/ralplan/runtime.d.ts +6 -109
  422. package/dist/ralplan/runtime.d.ts.map +1 -1
  423. package/dist/ralplan/runtime.js +256 -51
  424. package/dist/ralplan/runtime.js.map +1 -1
  425. package/dist/runtime/bridge.d.ts.map +1 -1
  426. package/dist/runtime/bridge.js +45 -0
  427. package/dist/runtime/bridge.js.map +1 -1
  428. package/dist/scripts/__tests__/codex-native-hook.test.js +7361 -19497
  429. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  430. package/dist/scripts/__tests__/docs-site-contract.test.js +2 -2
  431. package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -1
  432. package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts +2 -0
  433. package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts.map +1 -0
  434. package/dist/scripts/__tests__/generated-artifact-drift.test.js +84 -0
  435. package/dist/scripts/__tests__/generated-artifact-drift.test.js.map +1 -0
  436. package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js +13 -3
  437. package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js.map +1 -1
  438. package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js +32 -84
  439. package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js.map +1 -1
  440. package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js +69 -404
  441. package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js.map +1 -1
  442. package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js +107 -624
  443. package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js.map +1 -1
  444. package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js +3 -171
  445. package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -1
  446. package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts +2 -0
  447. package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts.map +1 -0
  448. package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js +63 -0
  449. package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js.map +1 -0
  450. package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts +2 -0
  451. package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts.map +1 -0
  452. package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js +65 -0
  453. package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js.map +1 -0
  454. package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts +2 -0
  455. package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts.map +1 -0
  456. package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.js +189 -0
  457. package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.js.map +1 -0
  458. package/dist/scripts/__tests__/prompt-inventory.test.js +54 -1
  459. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -1
  460. package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts +2 -0
  461. package/dist/scripts/__tests__/ralplan-advisory-hook.test.d.ts.map +1 -0
  462. package/dist/scripts/__tests__/ralplan-advisory-hook.test.js +299 -0
  463. package/dist/scripts/__tests__/ralplan-advisory-hook.test.js.map +1 -0
  464. package/dist/scripts/__tests__/reasoning-artifact-contract.test.js +2 -2
  465. package/dist/scripts/__tests__/reasoning-artifact-contract.test.js.map +1 -1
  466. package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +46 -77
  467. package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -1
  468. package/dist/scripts/__tests__/smoke-packed-install.test.js +121 -18
  469. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
  470. package/dist/scripts/codex-native-hook.d.ts +21 -1
  471. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  472. package/dist/scripts/codex-native-hook.js +412 -993
  473. package/dist/scripts/codex-native-hook.js.map +1 -1
  474. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  475. package/dist/scripts/codex-native-pre-post.js +8 -20
  476. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  477. package/dist/scripts/notify-hook/auto-nudge.d.ts +2 -48
  478. package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
  479. package/dist/scripts/notify-hook/auto-nudge.js +1 -0
  480. package/dist/scripts/notify-hook/auto-nudge.js.map +1 -1
  481. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  482. package/dist/scripts/notify-hook/team-dispatch.js +8 -5
  483. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  484. package/dist/scripts/notify-hook/team-tmux-guard.d.ts +1 -1
  485. package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
  486. package/dist/scripts/notify-hook/team-tmux-guard.js +3 -2
  487. package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
  488. package/dist/scripts/notify-hook.d.ts.map +1 -1
  489. package/dist/scripts/notify-hook.js +2 -51
  490. package/dist/scripts/notify-hook.js.map +1 -1
  491. package/dist/scripts/prompt-inventory.d.ts +39 -0
  492. package/dist/scripts/prompt-inventory.d.ts.map +1 -1
  493. package/dist/scripts/prompt-inventory.js +108 -3
  494. package/dist/scripts/prompt-inventory.js.map +1 -1
  495. package/dist/scripts/run-compiled-ci.js +2 -0
  496. package/dist/scripts/run-compiled-ci.js.map +1 -1
  497. package/dist/scripts/run-test-files.js +1 -0
  498. package/dist/scripts/run-test-files.js.map +1 -1
  499. package/dist/scripts/smoke-packed-install.d.ts +21 -5
  500. package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
  501. package/dist/scripts/smoke-packed-install.js +158 -64
  502. package/dist/scripts/smoke-packed-install.js.map +1 -1
  503. package/dist/scripts/sync-prompt-guidance-fragments.js +62 -20
  504. package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -1
  505. package/dist/scripts/tmux-hook-engine.d.ts +1 -1
  506. package/dist/scripts/tmux-hook-engine.d.ts.map +1 -1
  507. package/dist/scripts/tmux-hook-engine.js +3 -3
  508. package/dist/scripts/tmux-hook-engine.js.map +1 -1
  509. package/dist/scripts/verify-capabilities-lock.d.ts +3 -0
  510. package/dist/scripts/verify-capabilities-lock.d.ts.map +1 -0
  511. package/dist/scripts/verify-capabilities-lock.js +22 -0
  512. package/dist/scripts/verify-capabilities-lock.js.map +1 -0
  513. package/dist/state/__tests__/authority-decreasing.test.d.ts +2 -0
  514. package/dist/state/__tests__/authority-decreasing.test.d.ts.map +1 -0
  515. package/dist/state/__tests__/authority-decreasing.test.js +78 -0
  516. package/dist/state/__tests__/authority-decreasing.test.js.map +1 -0
  517. package/dist/state/__tests__/handoff-carrier.test.d.ts +2 -0
  518. package/dist/state/__tests__/handoff-carrier.test.d.ts.map +1 -0
  519. package/dist/state/__tests__/handoff-carrier.test.js +96 -0
  520. package/dist/state/__tests__/handoff-carrier.test.js.map +1 -0
  521. package/dist/state/__tests__/mode-binding-lease.test.d.ts +2 -0
  522. package/dist/state/__tests__/mode-binding-lease.test.d.ts.map +1 -0
  523. package/dist/state/__tests__/mode-binding-lease.test.js +498 -0
  524. package/dist/state/__tests__/mode-binding-lease.test.js.map +1 -0
  525. package/dist/state/__tests__/operations.test.js +340 -1596
  526. package/dist/state/__tests__/operations.test.js.map +1 -1
  527. package/dist/state/__tests__/pinned-atomic-file.test.d.ts +2 -0
  528. package/dist/state/__tests__/pinned-atomic-file.test.d.ts.map +1 -0
  529. package/dist/state/__tests__/pinned-atomic-file.test.js +438 -0
  530. package/dist/state/__tests__/pinned-atomic-file.test.js.map +1 -0
  531. package/dist/state/__tests__/single-writer-invariant.test.d.ts +2 -0
  532. package/dist/state/__tests__/single-writer-invariant.test.d.ts.map +1 -0
  533. package/dist/state/__tests__/single-writer-invariant.test.js +342 -0
  534. package/dist/state/__tests__/single-writer-invariant.test.js.map +1 -0
  535. package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts +2 -0
  536. package/dist/state/__tests__/skill-active-exact-session-transaction.test.d.ts.map +1 -0
  537. package/dist/state/__tests__/skill-active-exact-session-transaction.test.js +179 -0
  538. package/dist/state/__tests__/skill-active-exact-session-transaction.test.js.map +1 -0
  539. package/dist/state/__tests__/skill-active.test.js +29 -1
  540. package/dist/state/__tests__/skill-active.test.js.map +1 -1
  541. package/dist/state/__tests__/stale-state-neutralization.test.d.ts +2 -0
  542. package/dist/state/__tests__/stale-state-neutralization.test.d.ts.map +1 -0
  543. package/dist/state/__tests__/stale-state-neutralization.test.js +84 -0
  544. package/dist/state/__tests__/stale-state-neutralization.test.js.map +1 -0
  545. package/dist/state/__tests__/workflow-transition.test.js +20 -33
  546. package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
  547. package/dist/state/handoff-carrier.d.ts +46 -0
  548. package/dist/state/handoff-carrier.d.ts.map +1 -0
  549. package/dist/state/handoff-carrier.js +85 -0
  550. package/dist/state/handoff-carrier.js.map +1 -0
  551. package/dist/state/mode-binding-lease-helper.d.ts +2 -0
  552. package/dist/state/mode-binding-lease-helper.d.ts.map +1 -0
  553. package/dist/state/mode-binding-lease-helper.js +623 -0
  554. package/dist/state/mode-binding-lease-helper.js.map +1 -0
  555. package/dist/state/mode-binding-lease.d.ts +25 -0
  556. package/dist/state/mode-binding-lease.d.ts.map +1 -0
  557. package/dist/state/mode-binding-lease.js +380 -0
  558. package/dist/state/mode-binding-lease.js.map +1 -0
  559. package/dist/state/namespace-owners.d.ts +34 -0
  560. package/dist/state/namespace-owners.d.ts.map +1 -0
  561. package/dist/state/namespace-owners.js +127 -0
  562. package/dist/state/namespace-owners.js.map +1 -0
  563. package/dist/state/operations.d.ts +34 -4
  564. package/dist/state/operations.d.ts.map +1 -1
  565. package/dist/state/operations.js +274 -338
  566. package/dist/state/operations.js.map +1 -1
  567. package/dist/state/pinned-atomic-file-darwin-client.d.ts +34 -0
  568. package/dist/state/pinned-atomic-file-darwin-client.d.ts.map +1 -0
  569. package/dist/state/pinned-atomic-file-darwin-client.js +174 -0
  570. package/dist/state/pinned-atomic-file-darwin-client.js.map +1 -0
  571. package/dist/state/pinned-atomic-file-darwin-helper.d.ts +2 -0
  572. package/dist/state/pinned-atomic-file-darwin-helper.d.ts.map +1 -0
  573. package/dist/state/pinned-atomic-file-darwin-helper.js +275 -0
  574. package/dist/state/pinned-atomic-file-darwin-helper.js.map +1 -0
  575. package/dist/state/pinned-atomic-file-darwin-janitor.d.ts +2 -0
  576. package/dist/state/pinned-atomic-file-darwin-janitor.d.ts.map +1 -0
  577. package/dist/state/pinned-atomic-file-darwin-janitor.js +272 -0
  578. package/dist/state/pinned-atomic-file-darwin-janitor.js.map +1 -0
  579. package/dist/state/pinned-atomic-file.d.ts +29 -0
  580. package/dist/state/pinned-atomic-file.d.ts.map +1 -0
  581. package/dist/state/pinned-atomic-file.js +536 -0
  582. package/dist/state/pinned-atomic-file.js.map +1 -0
  583. package/dist/state/process-identity.d.ts +30 -0
  584. package/dist/state/process-identity.d.ts.map +1 -0
  585. package/dist/state/process-identity.js +99 -0
  586. package/dist/state/process-identity.js.map +1 -0
  587. package/dist/state/skill-active.d.ts +18 -1
  588. package/dist/state/skill-active.d.ts.map +1 -1
  589. package/dist/state/skill-active.js +83 -13
  590. package/dist/state/skill-active.js.map +1 -1
  591. package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
  592. package/dist/state/workflow-transition-reconcile.js +5 -31
  593. package/dist/state/workflow-transition-reconcile.js.map +1 -1
  594. package/dist/state/workflow-transition.d.ts +1 -27
  595. package/dist/state/workflow-transition.d.ts.map +1 -1
  596. package/dist/state/workflow-transition.js +6 -789
  597. package/dist/state/workflow-transition.js.map +1 -1
  598. package/dist/team/__tests__/api-interop.test.js +1 -0
  599. package/dist/team/__tests__/api-interop.test.js.map +1 -1
  600. package/dist/team/__tests__/scaling.test.js +47 -8
  601. package/dist/team/__tests__/scaling.test.js.map +1 -1
  602. package/dist/team/__tests__/team-ops-contract.test.js +1 -0
  603. package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
  604. package/dist/team/__tests__/tmux-session.test.js +321 -15
  605. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  606. package/dist/team/__tests__/tmux-source-authority-realtmux.test.js +11 -1
  607. package/dist/team/__tests__/tmux-source-authority-realtmux.test.js.map +1 -1
  608. package/dist/team/__tests__/worker-bootstrap.test.js +11 -13
  609. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  610. package/dist/team/__tests__/worker-provenance.test.d.ts +2 -0
  611. package/dist/team/__tests__/worker-provenance.test.d.ts.map +1 -0
  612. package/dist/team/__tests__/worker-provenance.test.js +251 -0
  613. package/dist/team/__tests__/worker-provenance.test.js.map +1 -0
  614. package/dist/team/api-interop.d.ts.map +1 -1
  615. package/dist/team/api-interop.js +14 -8
  616. package/dist/team/api-interop.js.map +1 -1
  617. package/dist/team/mcp-comm.d.ts.map +1 -1
  618. package/dist/team/mcp-comm.js +3 -8
  619. package/dist/team/mcp-comm.js.map +1 -1
  620. package/dist/team/scaling.js +1 -1
  621. package/dist/team/scaling.js.map +1 -1
  622. package/dist/team/state.d.ts +1 -0
  623. package/dist/team/state.d.ts.map +1 -1
  624. package/dist/team/state.js +11 -1
  625. package/dist/team/state.js.map +1 -1
  626. package/dist/team/team-ops.d.ts +1 -0
  627. package/dist/team/team-ops.d.ts.map +1 -1
  628. package/dist/team/team-ops.js +1 -0
  629. package/dist/team/team-ops.js.map +1 -1
  630. package/dist/team/tmux-session.d.ts +2 -0
  631. package/dist/team/tmux-session.d.ts.map +1 -1
  632. package/dist/team/tmux-session.js +73 -35
  633. package/dist/team/tmux-session.js.map +1 -1
  634. package/dist/team/ultragoal-context.d.ts +1 -0
  635. package/dist/team/ultragoal-context.d.ts.map +1 -1
  636. package/dist/team/ultragoal-context.js +2 -0
  637. package/dist/team/ultragoal-context.js.map +1 -1
  638. package/dist/team/worker-provenance.d.ts +35 -0
  639. package/dist/team/worker-provenance.d.ts.map +1 -0
  640. package/dist/team/worker-provenance.js +213 -0
  641. package/dist/team/worker-provenance.js.map +1 -0
  642. package/dist/ultragoal/__tests__/artifacts.test.js +103 -0
  643. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
  644. package/dist/ultragoal/__tests__/docs-contract.test.js +88 -59
  645. package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
  646. package/dist/ultragoal/artifacts.d.ts +1 -0
  647. package/dist/ultragoal/artifacts.d.ts.map +1 -1
  648. package/dist/ultragoal/artifacts.js +35 -5
  649. package/dist/ultragoal/artifacts.js.map +1 -1
  650. package/dist/url-reader/__tests__/url-reader.test.js +14 -0
  651. package/dist/url-reader/__tests__/url-reader.test.js.map +1 -1
  652. package/dist/url-reader/index.js +5 -3
  653. package/dist/url-reader/index.js.map +1 -1
  654. package/dist/utils/__tests__/file-durability.test.js +20 -0
  655. package/dist/utils/__tests__/file-durability.test.js.map +1 -1
  656. package/dist/utils/__tests__/version.test.js +17 -0
  657. package/dist/utils/__tests__/version.test.js.map +1 -1
  658. package/dist/utils/file-durability.d.ts +1 -1
  659. package/dist/utils/file-durability.d.ts.map +1 -1
  660. package/dist/utils/file-durability.js.map +1 -1
  661. package/dist/utils/version.d.ts.map +1 -1
  662. package/dist/utils/version.js +2 -1
  663. package/dist/utils/version.js.map +1 -1
  664. package/dist/verification/__tests__/ci-rust-gates.test.js +12 -4
  665. package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
  666. package/dist/verification/__tests__/ci-trusted-publish.test.d.ts +2 -0
  667. package/dist/verification/__tests__/ci-trusted-publish.test.d.ts.map +1 -0
  668. package/dist/verification/__tests__/ci-trusted-publish.test.js +205 -0
  669. package/dist/verification/__tests__/ci-trusted-publish.test.js.map +1 -0
  670. package/dist/verification/__tests__/explore-harness-release-workflow.test.js +10 -5
  671. package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
  672. package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts +2 -0
  673. package/dist/verification/__tests__/publish-npm-manual-retired.test.d.ts.map +1 -0
  674. package/dist/verification/__tests__/publish-npm-manual-retired.test.js +22 -0
  675. package/dist/verification/__tests__/publish-npm-manual-retired.test.js.map +1 -0
  676. package/package.json +6 -3
  677. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  678. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +60 -135
  679. package/plugins/oh-my-codex/skills/analyze/SKILL.md +35 -111
  680. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +69 -168
  681. package/plugins/oh-my-codex/skills/cancel/SKILL.md +33 -337
  682. package/plugins/oh-my-codex/skills/code-review/SKILL.md +66 -256
  683. package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +30 -216
  684. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +11 -10
  685. package/plugins/oh-my-codex/skills/design/SKILL.md +32 -132
  686. package/plugins/oh-my-codex/skills/doctor/SKILL.md +56 -177
  687. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +35 -116
  688. package/plugins/oh-my-codex/skills/plan/SKILL.md +45 -228
  689. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +26 -17
  690. package/plugins/oh-my-codex/skills/skill/SKILL.md +82 -807
  691. package/plugins/oh-my-codex/skills/team/SKILL.md +34 -520
  692. package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +47 -151
  693. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +75 -252
  694. package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +33 -111
  695. package/plugins/oh-my-codex/skills/worker/SKILL.md +40 -113
  696. package/prompts/analyst.md +27 -107
  697. package/prompts/api-reviewer.md +17 -84
  698. package/prompts/architect.md +31 -70
  699. package/prompts/code-reviewer.md +18 -107
  700. package/prompts/code-simplifier.md +32 -110
  701. package/prompts/critic.md +32 -54
  702. package/prompts/dependency-expert.md +37 -107
  703. package/prompts/designer.md +40 -107
  704. package/prompts/executor.md +26 -75
  705. package/prompts/information-architect.md +51 -200
  706. package/prompts/performance-reviewer.md +17 -81
  707. package/prompts/planner.md +33 -76
  708. package/prompts/product-analyst.md +65 -280
  709. package/prompts/product-manager.md +48 -216
  710. package/prompts/qa-tester.md +33 -104
  711. package/prompts/quality-reviewer.md +17 -93
  712. package/prompts/quality-strategist.md +31 -255
  713. package/prompts/researcher.md +32 -89
  714. package/prompts/security-reviewer.md +12 -98
  715. package/prompts/test-engineer.md +29 -110
  716. package/prompts/ux-researcher.md +46 -300
  717. package/prompts/verifier.md +23 -51
  718. package/skills/ai-slop-cleaner/SKILL.md +60 -135
  719. package/skills/analyze/SKILL.md +35 -111
  720. package/skills/autopilot/SKILL.md +69 -168
  721. package/skills/autoresearch-goal/SKILL.md +6 -31
  722. package/skills/cancel/SKILL.md +33 -337
  723. package/skills/code-review/SKILL.md +66 -256
  724. package/skills/configure-notifications/SKILL.md +30 -216
  725. package/skills/deep-interview/SKILL.md +11 -10
  726. package/skills/design/SKILL.md +32 -132
  727. package/skills/doctor/SKILL.md +56 -177
  728. package/skills/omx-setup/SKILL.md +35 -116
  729. package/skills/pipeline/SKILL.md +6 -89
  730. package/skills/plan/SKILL.md +45 -228
  731. package/skills/ralph/SKILL.md +6 -290
  732. package/skills/ralplan/SKILL.md +26 -17
  733. package/skills/skill/SKILL.md +82 -807
  734. package/skills/team/SKILL.md +34 -520
  735. package/skills/ultragoal/SKILL.md +47 -151
  736. package/skills/ultraqa/SKILL.md +75 -252
  737. package/skills/ultrawork/SKILL.md +6 -182
  738. package/skills/visual-ralph/SKILL.md +33 -111
  739. package/skills/worker/SKILL.md +40 -113
  740. package/src/scripts/__tests__/codex-native-hook.test.ts +17518 -32980
  741. package/src/scripts/__tests__/docs-site-contract.test.ts +2 -2
  742. package/src/scripts/__tests__/generated-artifact-drift.test.ts +97 -0
  743. package/src/scripts/__tests__/issue-3293-callsite-parity.test.ts +12 -2
  744. package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +32 -33
  745. package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +67 -481
  746. package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +115 -615
  747. package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +0 -168
  748. package/src/scripts/__tests__/issue-3481-conductor-deadlock.test.ts +77 -0
  749. package/src/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.ts +95 -0
  750. package/src/scripts/__tests__/issue-3536-external-team-state-root.test.ts +216 -0
  751. package/src/scripts/__tests__/prompt-inventory.test.ts +62 -1
  752. package/src/scripts/__tests__/ralplan-advisory-hook.test.ts +320 -0
  753. package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +1 -2
  754. package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +49 -78
  755. package/src/scripts/__tests__/smoke-packed-install.test.ts +141 -19
  756. package/src/scripts/codex-native-hook.ts +436 -1154
  757. package/src/scripts/codex-native-pre-post.ts +17 -22
  758. package/src/scripts/notify-hook/auto-nudge.ts +1 -0
  759. package/src/scripts/notify-hook/team-dispatch.ts +8 -5
  760. package/src/scripts/notify-hook/team-tmux-guard.ts +3 -1
  761. package/src/scripts/notify-hook.ts +2 -51
  762. package/src/scripts/prompt-inventory.ts +142 -3
  763. package/src/scripts/run-compiled-ci.ts +2 -0
  764. package/src/scripts/run-test-files.ts +1 -0
  765. package/src/scripts/smoke-packed-install.ts +176 -77
  766. package/src/scripts/sync-prompt-guidance-fragments.ts +59 -22
  767. package/src/scripts/tmux-hook-engine.ts +3 -3
  768. package/src/scripts/verify-capabilities-lock.ts +23 -0
  769. package/templates/AGENTS.md +45 -10
  770. package/templates/catalog-manifest.json +6 -146
  771. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +0 -2
  772. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +0 -1
  773. package/dist/autopilot/__tests__/deep-interview-gate.test.js +0 -215
  774. package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +0 -1
  775. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +0 -2
  776. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +0 -1
  777. package/dist/autopilot/__tests__/ralplan-gate.test.js +0 -114
  778. package/dist/autopilot/__tests__/ralplan-gate.test.js.map +0 -1
  779. package/dist/autopilot/deep-interview-gate.d.ts +0 -18
  780. package/dist/autopilot/deep-interview-gate.d.ts.map +0 -1
  781. package/dist/autopilot/deep-interview-gate.js +0 -396
  782. package/dist/autopilot/deep-interview-gate.js.map +0 -1
  783. package/dist/autopilot/ralplan-gate.d.ts +0 -18
  784. package/dist/autopilot/ralplan-gate.d.ts.map +0 -1
  785. package/dist/autopilot/ralplan-gate.js +0 -149
  786. package/dist/autopilot/ralplan-gate.js.map +0 -1
  787. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +0 -2
  788. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +0 -1
  789. package/dist/hooks/__tests__/prometheus-strict-contract.test.js +0 -320
  790. package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +0 -1
  791. package/dist/pipeline/__tests__/orchestrator.test.d.ts +0 -2
  792. package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +0 -1
  793. package/dist/pipeline/__tests__/orchestrator.test.js +0 -892
  794. package/dist/pipeline/__tests__/orchestrator.test.js.map +0 -1
  795. package/dist/pipeline/__tests__/stages.test.d.ts +0 -2
  796. package/dist/pipeline/__tests__/stages.test.d.ts.map +0 -1
  797. package/dist/pipeline/__tests__/stages.test.js +0 -1695
  798. package/dist/pipeline/__tests__/stages.test.js.map +0 -1
  799. package/dist/pipeline/index.d.ts +0 -25
  800. package/dist/pipeline/index.d.ts.map +0 -1
  801. package/dist/pipeline/index.js +0 -17
  802. package/dist/pipeline/index.js.map +0 -1
  803. package/dist/pipeline/orchestrator.d.ts +0 -52
  804. package/dist/pipeline/orchestrator.d.ts.map +0 -1
  805. package/dist/pipeline/orchestrator.js +0 -505
  806. package/dist/pipeline/orchestrator.js.map +0 -1
  807. package/dist/pipeline/review-verdict.d.ts +0 -3
  808. package/dist/pipeline/review-verdict.d.ts.map +0 -1
  809. package/dist/pipeline/review-verdict.js +0 -14
  810. package/dist/pipeline/review-verdict.js.map +0 -1
  811. package/dist/pipeline/stages/code-review.d.ts +0 -35
  812. package/dist/pipeline/stages/code-review.d.ts.map +0 -1
  813. package/dist/pipeline/stages/code-review.js +0 -55
  814. package/dist/pipeline/stages/code-review.js.map +0 -1
  815. package/dist/pipeline/stages/deep-interview.d.ts +0 -15
  816. package/dist/pipeline/stages/deep-interview.d.ts.map +0 -1
  817. package/dist/pipeline/stages/deep-interview.js +0 -32
  818. package/dist/pipeline/stages/deep-interview.js.map +0 -1
  819. package/dist/pipeline/stages/ralph-verify.d.ts +0 -53
  820. package/dist/pipeline/stages/ralph-verify.d.ts.map +0 -1
  821. package/dist/pipeline/stages/ralph-verify.js +0 -89
  822. package/dist/pipeline/stages/ralph-verify.js.map +0 -1
  823. package/dist/pipeline/stages/ralplan.d.ts +0 -27
  824. package/dist/pipeline/stages/ralplan.d.ts.map +0 -1
  825. package/dist/pipeline/stages/ralplan.js +0 -180
  826. package/dist/pipeline/stages/ralplan.js.map +0 -1
  827. package/dist/pipeline/stages/team-exec.d.ts +0 -52
  828. package/dist/pipeline/stages/team-exec.d.ts.map +0 -1
  829. package/dist/pipeline/stages/team-exec.js +0 -266
  830. package/dist/pipeline/stages/team-exec.js.map +0 -1
  831. package/dist/pipeline/stages/ultragoal.d.ts +0 -23
  832. package/dist/pipeline/stages/ultragoal.d.ts.map +0 -1
  833. package/dist/pipeline/stages/ultragoal.js +0 -53
  834. package/dist/pipeline/stages/ultragoal.js.map +0 -1
  835. package/dist/pipeline/stages/ultraqa.d.ts +0 -33
  836. package/dist/pipeline/stages/ultraqa.d.ts.map +0 -1
  837. package/dist/pipeline/stages/ultraqa.js +0 -49
  838. package/dist/pipeline/stages/ultraqa.js.map +0 -1
  839. package/dist/pipeline/types.d.ts +0 -124
  840. package/dist/pipeline/types.d.ts.map +0 -1
  841. package/dist/pipeline/types.js +0 -8
  842. package/dist/pipeline/types.js.map +0 -1
  843. package/dist/ralplan/__tests__/consensus-gate.test.d.ts +0 -2
  844. package/dist/ralplan/__tests__/consensus-gate.test.d.ts.map +0 -1
  845. package/dist/ralplan/__tests__/consensus-gate.test.js +0 -88
  846. package/dist/ralplan/__tests__/consensus-gate.test.js.map +0 -1
  847. package/dist/ralplan/consensus-gate.d.ts +0 -70
  848. package/dist/ralplan/consensus-gate.d.ts.map +0 -1
  849. package/dist/ralplan/consensus-gate.js +0 -496
  850. package/dist/ralplan/consensus-gate.js.map +0 -1
  851. package/dist/scripts/notify-hook/ralph-session-resume.d.ts +0 -25
  852. package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +0 -1
  853. package/dist/scripts/notify-hook/ralph-session-resume.js +0 -377
  854. package/dist/scripts/notify-hook/ralph-session-resume.js.map +0 -1
  855. package/dist/state/__tests__/planning-gate.test.d.ts +0 -2
  856. package/dist/state/__tests__/planning-gate.test.d.ts.map +0 -1
  857. package/dist/state/__tests__/planning-gate.test.js +0 -629
  858. package/dist/state/__tests__/planning-gate.test.js.map +0 -1
  859. package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +0 -39
  860. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +0 -97
  861. package/plugins/oh-my-codex/skills/prometheus-strict/README.md +0 -35
  862. package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +0 -219
  863. package/plugins/oh-my-codex/skills/ralph/SKILL.md +0 -298
  864. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +0 -190
  865. package/plugins/oh-my-codex/skills/ultrawork/references/agent-tiers.md +0 -62
  866. package/prompts/prometheus-strict-metis.md +0 -274
  867. package/prompts/prometheus-strict-momus.md +0 -82
  868. package/prompts/prometheus-strict-oracle.md +0 -107
  869. package/prompts/scholastic.md +0 -11
  870. package/prompts/sisyphus-lite.md +0 -111
  871. package/skills/ask-claude/SKILL.md +0 -12
  872. package/skills/ask-gemini/SKILL.md +0 -12
  873. package/skills/build-fix/SKILL.md +0 -10
  874. package/skills/deepsearch/SKILL.md +0 -10
  875. package/skills/ecomode/SKILL.md +0 -114
  876. package/skills/ecomode/references/agent-tiers.md +0 -61
  877. package/skills/frontend-ui-ux/SKILL.md +0 -16
  878. package/skills/help/SKILL.md +0 -10
  879. package/skills/note/SKILL.md +0 -10
  880. package/skills/prometheus-strict/README.md +0 -35
  881. package/skills/prometheus-strict/SKILL.md +0 -219
  882. package/skills/ralph-init/SKILL.md +0 -10
  883. package/skills/review/SKILL.md +0 -10
  884. package/skills/security-review/SKILL.md +0 -10
  885. package/skills/swarm/SKILL.md +0 -12
  886. package/skills/tdd/SKILL.md +0 -104
  887. package/skills/trace/SKILL.md +0 -10
  888. package/skills/visual-verdict/SKILL.md +0 -10
  889. package/skills/web-clone/SKILL.md +0 -357
  890. package/src/scripts/notify-hook/ralph-session-resume.ts +0 -466
package/dist/cli/setup.js CHANGED
@@ -13,14 +13,14 @@ import { createHash } from "crypto";
13
13
  import { clearNativeHookClaimJournal as clearNativeHookClaimJournalWithDurability, createNativeHookClaimJournalDurability, persistNativeHookClaimJournal as persistNativeHookClaimJournalWithDurability, recoverNativeHookClaimJournal, syncNativeHookClaimParent as syncNativeHookClaimParentWithDurability, restoreNativeHookClaimNoClobber as restoreNativeHookClaimNoClobberWithDurability, wrapNativeHookClaimJournalDurability, } from "./native-hook-claim-journal.js";
14
14
  import { codexHome, codexConfigPath, codexPromptsDir, codexAgentsDir, userSkillsDir, omxStateDir, detectLegacySkillRootOverlap, omxPlansDir, omxLogsDir, } from "../utils/paths.js";
15
15
  import { emitDegradedDurabilityWarning, recordRegularFileSyncOutcome, syncRegularFile, } from "../utils/file-durability.js";
16
- import { buildMergedConfig, getRootModelName, getRootTomlArray, hasLegacyOmxTeamRunTable, isOmxManagedNotifyCommand, sanitizePreviousNotifyCommand, stripExistingOmxBlocks, stripExistingSharedMcpRegistryBlock, mergeSharedMcpRegistryBlock, stripOmxEnvSettings, stripOmxFeatureFlags, stripOmxSeededBehavioralDefaults, upsertPluginModeRuntimeFeatureFlags, upsertManagedCodexHookTrustState, stripManagedCodexHookTrustState, OMX_DEVELOPER_INSTRUCTIONS, OMX_PLUGIN_DEVELOPER_INSTRUCTIONS, hasFirstPartyOmxMcpRegistrations, extractFirstPartyOmxMcpSections, stripFirstPartyOmxMcpSections, } from "../config/generator.js";
16
+ import { buildMergedConfig, formatTomlStringArray, getRootModelName, getRootTomlArray, hasLegacyOmxTeamRunTable, isOmxManagedNotifyCommand, sanitizePreviousNotifyCommand, stripExistingOmxBlocks, stripExistingSharedMcpRegistryBlock, mergeSharedMcpRegistryBlock, stripOmxEnvSettings, stripOmxFeatureFlags, stripOmxSeededBehavioralDefaults, upsertPluginModeRuntimeFeatureFlags, upsertManagedCodexHookTrustState, stripManagedCodexHookTrustState, OMX_DEVELOPER_INSTRUCTIONS, OMX_PLUGIN_DEVELOPER_INSTRUCTIONS, hasFirstPartyOmxMcpRegistrations, extractFirstPartyOmxMcpSections, stripFirstPartyOmxMcpSections, } from "../config/generator.js";
17
17
  import { buildManagedCodexNativeHookWindowsShimContent, buildManagedCodexNativeHookWindowsShimPath, planManagedCodexHooksMerge, planManagedCodexHooksRemoval, classifyManagedCodexNativeHookWindowsShimOwnership, ManagedCodexHooksPlanError, validateCodexHooksConfigStrict, } from "../config/codex-hooks.js";
18
18
  import { getLegacyUnifiedMcpRegistryCandidate, getUnifiedMcpRegistryCandidates, loadUnifiedMcpRegistry, planClaudeCodeMcpSettingsSync, } from "../config/mcp-registry.js";
19
19
  import { generateAgentToml } from "../agents/native-config.js";
20
20
  import { AGENT_DEFINITIONS } from "../agents/definitions.js";
21
21
  import { getCatalogAgentStatusByName, getInstallableNativeAgentNames, isNativeAgentInstallableStatus, isSetupPromptAssetName, } from "../agents/policy.js";
22
22
  import { getPackageRoot } from "../utils/package.js";
23
- import { readSessionState, isSessionStale } from "../hooks/session.js";
23
+ import { readSessionState, classifySessionStateLiveness } from "../hooks/session.js";
24
24
  import { getCatalogHeadlineCounts } from "./catalog-contract.js";
25
25
  import { tryReadCatalogManifest } from "../catalog/reader.js";
26
26
  import { DEFAULT_FRONTIER_MODEL } from "../config/models.js";
@@ -28,7 +28,7 @@ import { teamModeEnabled, } from "../config/team-mode.js";
28
28
  import { addGeneratedAgentsMarker, hasOmxAgentsContract, hasOmxManagedAgentsSections, isOmxGeneratedAgentsMd, preserveUserOmxPolicyBlocks, upsertManagedAgentsBlock, } from "../utils/agents-md.js";
29
29
  import { DEFAULT_HUD_CONFIG } from "../hud/types.js";
30
30
  import { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES, getSetupScopeFilePath, readPersistedSetupPreferences, resolvePersistedSetupMergeAgents, writePersistedSetupPreferences, } from "./setup-preferences.js";
31
- import { OMX_LOCAL_MARKETPLACE_NAME, OMX_PLUGIN_NAME, materializePackagedOmxPluginCache, resolvePackagedOmxMarketplace, upsertLocalOmxMarketplaceRegistration, upsertLocalOmxPluginEnablement, upsertLocalOmxPluginMcpServerEnablement, hasLocalOmxPluginMcpServerRegistrations, pluginHookCacheMatchesPackaged, } from "./plugin-marketplace.js";
31
+ import { OMX_LOCAL_MARKETPLACE_NAME, OMX_LOCAL_PLUGIN_CONFIG_KEY, OMX_PLUGIN_NAME, discoverOmxPluginCacheDirs, materializePackagedOmxPluginCache, resolvePackagedOmxMarketplace, upsertLocalOmxMarketplaceRegistration, upsertLocalOmxPluginEnablement, upsertLocalOmxPluginMcpServerEnablement, hasLocalOmxPluginMcpServerRegistrations, } from "./plugin-marketplace.js";
32
32
  import { resolveCodexHookFeatureSupportForCli } from "./codex-feature-probe.js";
33
33
  async function resolveStatusLinePresetForSetup(projectRoot, options) {
34
34
  if (options.force) {
@@ -54,6 +54,8 @@ export { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES };
54
54
  export { SETUP_TEAM_MODES } from "../config/team-mode.js";
55
55
  const PROJECT_GITIGNORE_ENTRIES = [
56
56
  ".omx/",
57
+ ".omx-state-locks/",
58
+ ".omx-state-locks.identity.json",
57
59
  ".codex/*",
58
60
  "!.codex/agents/",
59
61
  "!.codex/agents/**",
@@ -67,7 +69,6 @@ const LEGACY_PROJECT_GITIGNORE_ENTRIES = [".codex/"];
67
69
  const SETUP_ONLY_INSTALLABLE_SKILLS = new Set(["wiki"]);
68
70
  const DEFAULT_SETUP_MCP_MODE = "none";
69
71
  const SKIP_NATIVE_AGENT_REFRESH_ENV = "OMX_SKIP_NATIVE_AGENT_REFRESH";
70
- const HARD_DEPRECATED_SKILL_NAMES = new Set(["web-clone"]);
71
72
  const TEAM_MODE_SKILL_NAMES = new Set(["team", "worker"]);
72
73
  const TEAM_MODE_PROMPT_NAMES = new Set(["team-executor"]);
73
74
  const TEAM_MODE_NATIVE_AGENT_NAMES = new Set(["team-executor"]);
@@ -1337,9 +1338,134 @@ export async function validateSkillFile(skillMdPath) {
1337
1338
  const content = await readFile(skillMdPath, "utf-8");
1338
1339
  parseSkillFrontmatter(content, skillMdPath);
1339
1340
  }
1341
+ const INSTALLED_SKILL_BADGE_PREFIX = "[OMX] ";
1342
+ function installedSkillReceiptPath(scope, projectRoot) {
1343
+ const authorityRoot = scope === "project" ? projectRoot : homedir();
1344
+ return join(authorityRoot, ".omx", "state", "setup", "installed-skills.json");
1345
+ }
1346
+ async function readInstalledSkillReceipt(receiptPath) {
1347
+ try {
1348
+ const parsed = JSON.parse(await readFile(receiptPath, "utf-8"));
1349
+ if (parsed?.version === 1 && parsed.skills && typeof parsed.skills === "object") {
1350
+ // Re-key through a prototype-less record so a `__proto__` entry in a persisted receipt is a
1351
+ // real own property on both sides of the comparison.
1352
+ const skills = Object.create(null);
1353
+ for (const [name, entry] of Object.entries(parsed.skills)) {
1354
+ const files = Object.create(null);
1355
+ for (const [file, digest] of Object.entries(entry?.files ?? {}))
1356
+ files[file] = String(digest);
1357
+ skills[name] = { files };
1358
+ }
1359
+ return { version: 1, skills };
1360
+ }
1361
+ }
1362
+ catch {
1363
+ // A missing or unreadable receipt means "no proof of ownership", which retains conservatively.
1364
+ }
1365
+ return { version: 1, skills: Object.create(null) };
1366
+ }
1367
+ /**
1368
+ * Digest the CURRENT contents of a skill directory, used to compare against a receipt.
1369
+ *
1370
+ * Non-regular entries (symlinks, sockets) are recorded as a sentinel rather than skipped, so a
1371
+ * directory containing one can never compare equal to a receipt of regular files and is therefore
1372
+ * retained instead of deleted.
1373
+ */
1374
+ async function digestSkillDirectory(skillDir) {
1375
+ // Prototype-less: a file literally named `__proto__` assigned into a normal object literal is not an
1376
+ // own enumerable property, so it would vanish from Object.keys() and let a user entry be deleted
1377
+ // while the comparison still reported equality.
1378
+ const files = Object.create(null);
1379
+ const walk = async (dir, prefix) => {
1380
+ for (const entry of await readdir(dir, { withFileTypes: true })) {
1381
+ const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
1382
+ const full = join(dir, entry.name);
1383
+ if (entry.isDirectory()) {
1384
+ await walk(full, relPath);
1385
+ continue;
1386
+ }
1387
+ if (!entry.isFile()) {
1388
+ files[relPath] = "non-regular-entry";
1389
+ continue;
1390
+ }
1391
+ files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
1392
+ }
1393
+ };
1394
+ await walk(skillDir, "");
1395
+ return files;
1396
+ }
1397
+ /** True only when every current file matches the digest OMX recorded at install time. */
1398
+ async function isUnmodifiedRecordedInstall(receiptPath, skillName, skillDir) {
1399
+ const receipt = await readInstalledSkillReceipt(receiptPath);
1400
+ const recorded = receipt.skills[skillName]?.files;
1401
+ if (!recorded || Object.keys(recorded).length === 0)
1402
+ return false;
1403
+ let current;
1404
+ try {
1405
+ current = await digestSkillDirectory(skillDir);
1406
+ }
1407
+ catch {
1408
+ return false;
1409
+ }
1410
+ const recordedNames = Object.keys(recorded).sort();
1411
+ const currentNames = Object.keys(current).sort();
1412
+ if (recordedNames.length !== currentNames.length)
1413
+ return false;
1414
+ return recordedNames.every((name, index) => currentNames[index] === name && current[name] === recorded[name]);
1415
+ }
1416
+ /**
1417
+ * Record digests for EXACTLY the files OMX wrote, keyed by skill.
1418
+ *
1419
+ * Digesting the destination tree instead would poison the receipt: a note a user drops into an active
1420
+ * skill directory would be recorded as OMX-owned and then deleted when that skill is later retired.
1421
+ * The receipt therefore describes the installer's own output, and any extra entry present at
1422
+ * retirement time makes the comparison fail, which retains the directory.
1423
+ */
1424
+ async function writeInstalledSkillReceipt(receiptPath, skillsDir, writtenFilesBySkill, options) {
1425
+ if (options.dryRun)
1426
+ return;
1427
+ const receipt = await readInstalledSkillReceipt(receiptPath);
1428
+ for (const [name, relativePaths] of writtenFilesBySkill) {
1429
+ const files = Object.create(null);
1430
+ let complete = true;
1431
+ for (const relPath of relativePaths) {
1432
+ const full = join(skillsDir, name, relPath);
1433
+ try {
1434
+ files[relPath] = createHash("sha256").update(await readFile(full)).digest("hex");
1435
+ }
1436
+ catch {
1437
+ complete = false;
1438
+ break;
1439
+ }
1440
+ }
1441
+ if (complete && Object.keys(files).length > 0)
1442
+ receipt.skills[name] = { files };
1443
+ else
1444
+ delete receipt.skills[name];
1445
+ }
1446
+ try {
1447
+ await mkdir(dirname(receiptPath), { recursive: true });
1448
+ await writeFile(receiptPath, `${JSON.stringify(receipt, null, 2)}\n`);
1449
+ }
1450
+ catch {
1451
+ // A receipt we cannot persist simply means the next refresh retains conservatively.
1452
+ }
1453
+ }
1454
+ async function isOmxManagedInstalledSkillDir(skillDir) {
1455
+ const skillMdPath = join(skillDir, "SKILL.md");
1456
+ if (!existsSync(skillMdPath))
1457
+ return false;
1458
+ try {
1459
+ const metadata = parseSkillFrontmatter(await readFile(skillMdPath, "utf-8"), skillMdPath);
1460
+ return metadata.description.startsWith(INSTALLED_SKILL_BADGE_PREFIX);
1461
+ }
1462
+ catch {
1463
+ return false;
1464
+ }
1465
+ }
1340
1466
  function rewriteInstalledSkillDescriptionBadge(content, filePath = "SKILL.md") {
1341
1467
  const metadata = parseSkillFrontmatter(content, filePath);
1342
- const badgePrefix = "[OMX] ";
1468
+ const badgePrefix = INSTALLED_SKILL_BADGE_PREFIX;
1343
1469
  const displayDescription = metadata.description.startsWith(badgePrefix)
1344
1470
  ? metadata.description
1345
1471
  : `${badgePrefix}${metadata.description}`;
@@ -1724,155 +1850,8 @@ async function resolveSetupScope(projectRoot, requestedScope, persistedReviewDec
1724
1850
  }
1725
1851
  return { scope: DEFAULT_SETUP_SCOPE, source: "default" };
1726
1852
  }
1727
- async function readPluginManifestName(manifestPath) {
1728
- try {
1729
- const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
1730
- return typeof parsed === "object" &&
1731
- parsed !== null &&
1732
- "name" in parsed &&
1733
- typeof parsed.name === "string"
1734
- ? parsed.name
1735
- : null;
1736
- }
1737
- catch {
1738
- return null;
1739
- }
1740
- }
1741
- async function readPluginManifestSummary(manifestPath) {
1742
- try {
1743
- const parsed = JSON.parse(await readFile(manifestPath, "utf-8"));
1744
- if (typeof parsed !== "object" || parsed === null)
1745
- return null;
1746
- const manifest = parsed;
1747
- return {
1748
- name: typeof manifest.name === "string" ? manifest.name : null,
1749
- version: typeof manifest.version === "string" ? manifest.version : null,
1750
- skills: typeof manifest.skills === "string" ? manifest.skills : null,
1751
- hooks: typeof manifest.hooks === "string" ? manifest.hooks : null,
1752
- };
1753
- }
1754
- catch {
1755
- return null;
1756
- }
1757
- }
1758
- async function listChildDirectoryNames(dir) {
1759
- try {
1760
- const entries = await readdir(dir, { withFileTypes: true });
1761
- return entries
1762
- .filter((entry) => entry.isDirectory())
1763
- .map((entry) => entry.name)
1764
- .sort();
1765
- }
1766
- catch {
1767
- return null;
1768
- }
1769
- }
1770
- async function discoverOmxPluginCacheDirs(cacheRoot = join(codexHome(), "plugins", "cache")) {
1771
- if (!existsSync(cacheRoot))
1772
- return [];
1773
- const queue = [
1774
- { path: cacheRoot, depth: 0 },
1775
- ];
1776
- const maxDepth = 5;
1777
- const matches = [];
1778
- while (queue.length > 0) {
1779
- const current = queue.shift();
1780
- if (!current)
1781
- break;
1782
- const manifestPath = join(current.path, ".codex-plugin", "plugin.json");
1783
- if (existsSync(manifestPath)) {
1784
- const name = await readPluginManifestName(manifestPath);
1785
- if (name === "oh-my-codex") {
1786
- matches.push(current.path);
1787
- continue;
1788
- }
1789
- }
1790
- if (current.depth >= maxDepth)
1791
- continue;
1792
- let entries;
1793
- try {
1794
- entries = await readdir(current.path, { withFileTypes: true });
1795
- }
1796
- catch {
1797
- continue;
1798
- }
1799
- for (const entry of entries) {
1800
- if (!entry.isDirectory())
1801
- continue;
1802
- if (entry.name === ".git" || entry.name === "node_modules")
1803
- continue;
1804
- queue.push({
1805
- path: join(current.path, entry.name),
1806
- depth: current.depth + 1,
1807
- });
1808
- }
1809
- }
1810
- return matches.sort();
1811
- }
1812
- async function discoverOmxPluginCacheDir(cacheRoot = join(codexHome(), "plugins", "cache")) {
1813
- return (await discoverOmxPluginCacheDirs(cacheRoot))[0] ?? null;
1814
- }
1815
- async function refreshOmxPluginDiscoveryCache(pkgRoot, options, codexHomeDir = codexHome()) {
1816
- const packagedMarketplace = await resolvePackagedOmxMarketplace(pkgRoot);
1817
- if (!packagedMarketplace) {
1818
- return { status: "unavailable", staleDirs: [] };
1819
- }
1820
- const [pkg, expectedSkillNames, cachedDirs] = await Promise.all([
1821
- readFile(join(pkgRoot, "package.json"), "utf-8").then((raw) => JSON.parse(raw)),
1822
- listChildDirectoryNames(join(packagedMarketplace.pluginRoot, "skills")),
1823
- discoverOmxPluginCacheDirs(join(codexHomeDir, "plugins", "cache")),
1824
- ]);
1825
- const expectedVersion = typeof pkg.version === "string" ? pkg.version : null;
1826
- const staleDirs = [];
1827
- for (const cacheDir of cachedDirs) {
1828
- const manifest = await readPluginManifestSummary(join(cacheDir, ".codex-plugin", "plugin.json"));
1829
- if (manifest?.name !== "oh-my-codex")
1830
- continue;
1831
- const cachedSkillNames = await listChildDirectoryNames(join(cacheDir, "skills"));
1832
- const versionChanged = expectedVersion !== null && manifest.version !== expectedVersion;
1833
- const skillsPointerChanged = manifest.skills !== "./skills/";
1834
- const hooksPointerChanged = manifest.hooks !== "./hooks/hooks.json";
1835
- const hookFilesMissing = !existsSync(join(cacheDir, "hooks", "hooks.json"))
1836
- || !existsSync(join(cacheDir, "hooks", "codex-native-hook.mjs"))
1837
- || !existsSync(join(cacheDir, "hooks", "omx-command.json"));
1838
- const hookFilesChanged = !hookFilesMissing
1839
- && !(await pluginHookCacheMatchesPackaged(cacheDir, packagedMarketplace));
1840
- const skillListChanged = expectedSkillNames !== null &&
1841
- cachedSkillNames !== null &&
1842
- JSON.stringify(cachedSkillNames) !== JSON.stringify(expectedSkillNames);
1843
- if (!versionChanged &&
1844
- !skillsPointerChanged &&
1845
- !hooksPointerChanged &&
1846
- !hookFilesMissing &&
1847
- !hookFilesChanged &&
1848
- !skillListChanged)
1849
- continue;
1850
- staleDirs.push(cacheDir);
1851
- if (!options.dryRun) {
1852
- await rm(cacheDir, { recursive: true, force: true });
1853
- }
1854
- if (options.verbose) {
1855
- const reasons = [
1856
- versionChanged
1857
- ? `version ${manifest.version ?? "unknown"} -> ${expectedVersion}`
1858
- : null,
1859
- skillsPointerChanged
1860
- ? `skills pointer ${manifest.skills ?? "missing"} -> ./skills/`
1861
- : null,
1862
- hooksPointerChanged
1863
- ? `hooks pointer ${manifest.hooks ?? "missing"} -> ./hooks/hooks.json`
1864
- : null,
1865
- hookFilesMissing ? "plugin hook files missing" : null,
1866
- hookFilesChanged ? "plugin hook files changed" : null,
1867
- skillListChanged ? "skill directory list changed" : null,
1868
- ].filter(Boolean);
1869
- console.log(` ${options.dryRun ? "would invalidate" : "invalidated"} Codex plugin discovery cache ${cacheDir} (${reasons.join(", ")})`);
1870
- }
1871
- }
1872
- return {
1873
- status: staleDirs.length > 0 ? "refreshed" : "unchanged",
1874
- staleDirs,
1875
- };
1853
+ async function discoverOmxPluginCacheDir(codexHomeDir = codexHome()) {
1854
+ return (await discoverOmxPluginCacheDirs(codexHomeDir))[0] ?? null;
1876
1855
  }
1877
1856
  function resolveSetupMcpMode(scope, requestedMcpMode, persistedReviewDecision, persistedPreferences) {
1878
1857
  if (requestedMcpMode) {
@@ -2234,6 +2213,122 @@ function buildPluginModeLegacyConfig(original, options) {
2234
2213
  config = config.trim();
2235
2214
  return config.length > 0 ? `${config}\n` : "";
2236
2215
  }
2216
+ function stripLocalOmxPluginEnablementForDisable(config) {
2217
+ const lines = config.split(/\r?\n/);
2218
+ const header = '[plugins."oh-my-codex@oh-my-codex-local"]';
2219
+ const start = lines.findIndex((line) => line.trim() === header);
2220
+ if (start >= 0) {
2221
+ let end = lines.length;
2222
+ for (let index = start + 1; index < lines.length; index += 1) {
2223
+ if (/^\s*\[/.test(lines[index])) {
2224
+ end = index;
2225
+ break;
2226
+ }
2227
+ }
2228
+ for (let index = end - 1; index > start; index -= 1) {
2229
+ if (/^\s*enabled\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
2230
+ lines[index] = lines[index].replace("true", "false");
2231
+ break;
2232
+ }
2233
+ }
2234
+ }
2235
+ const pluginsStart = lines.findIndex((line) => /^\s*\[plugins\]\s*$/.test(line));
2236
+ if (pluginsStart >= 0) {
2237
+ for (let index = pluginsStart + 1; index < lines.length && !/^\s*\[/.test(lines[index]); index += 1) {
2238
+ if (/^\s*"oh-my-codex@oh-my-codex-local"\s*=\s*true\s*(?:#.*)?$/.test(lines[index])) {
2239
+ lines[index] = lines[index].replace("true", "false");
2240
+ break;
2241
+ }
2242
+ }
2243
+ }
2244
+ return lines.join("\n").replace(/\n{3,}/g, "\n\n");
2245
+ }
2246
+ function stripHookFeatureFlagsForDisable(config, preserveNativeHooks) {
2247
+ const lines = config.split(/\r?\n/);
2248
+ const featuresStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
2249
+ if (featuresStart < 0)
2250
+ return config;
2251
+ let sectionEnd = lines.length;
2252
+ for (let index = featuresStart + 1; index < lines.length; index += 1) {
2253
+ if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
2254
+ sectionEnd = index;
2255
+ break;
2256
+ }
2257
+ }
2258
+ const removable = new Set(preserveNativeHooks
2259
+ ? ["plugin_hooks"]
2260
+ : ["hooks", "codex_hooks", "plugin_hooks"]);
2261
+ for (let index = sectionEnd - 1; index > featuresStart; index -= 1) {
2262
+ const match = /^\s*([A-Za-z0-9_-]+)\s*=\s*true\s*(?:#.*)?$/.exec(lines[index]);
2263
+ if (match && removable.has(match[1]))
2264
+ lines[index] = lines[index].replace("true", "false");
2265
+ }
2266
+ const nextFeaturesStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
2267
+ if (nextFeaturesStart >= 0) {
2268
+ let nextSectionEnd = lines.length;
2269
+ for (let index = nextFeaturesStart + 1; index < lines.length; index += 1) {
2270
+ if (/^\s*\[\[?[^\]]+\]?\]\s*$/.test(lines[index])) {
2271
+ nextSectionEnd = index;
2272
+ break;
2273
+ }
2274
+ }
2275
+ if (lines.slice(nextFeaturesStart + 1, nextSectionEnd).every((line) => line.trim() === "")) {
2276
+ lines.splice(nextFeaturesStart, nextSectionEnd - nextFeaturesStart);
2277
+ }
2278
+ }
2279
+ return lines.join("\n");
2280
+ }
2281
+ function parseDisableHooksNotifyMetadata(snapshot, metadataPath, currentNotify) {
2282
+ if (!snapshot.bytes) {
2283
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is missing.`);
2284
+ }
2285
+ let parsed;
2286
+ try {
2287
+ parsed = JSON.parse(decodeNativeHookTransactionUtf8(snapshot.bytes, `notification metadata ${metadataPath}`));
2288
+ }
2289
+ catch (error) {
2290
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} is invalid JSON (${error instanceof Error ? error.message : String(error)}).`);
2291
+ }
2292
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
2293
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} must be an object.`);
2294
+ }
2295
+ const metadata = parsed;
2296
+ const dispatcherNotify = metadata.dispatcherNotify;
2297
+ if (metadata.managedBy !== "oh-my-codex" || metadata.version !== 1 ||
2298
+ !Array.isArray(dispatcherNotify) ||
2299
+ dispatcherNotify.length !== currentNotify.length ||
2300
+ dispatcherNotify.some((part, index) => part !== currentNotify[index])) {
2301
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} does not prove OMX ownership.`);
2302
+ }
2303
+ const previousNotify = metadata.previousNotify;
2304
+ if (previousNotify !== null && (!Array.isArray(previousNotify) || !previousNotify.every((part) => typeof part === "string"))) {
2305
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to remove managed notification dispatcher: metadata ${metadataPath} has invalid previousNotify.`);
2306
+ }
2307
+ return sanitizePreviousNotifyCommand(previousNotify, getPackageRoot());
2308
+ }
2309
+ async function planDisableHooksConfig(existingConfig, pkgRoot, managedHooksPlan, codexHomeDir, notifyMetadataSnapshot) {
2310
+ const priorManagedHookTrustState = managedHooksPlan?.priorTrustState ?? {};
2311
+ let finalConfig = stripManagedCodexHookTrustState(existingConfig, {
2312
+ priorManagedHookTrustState,
2313
+ managedTrustState: {},
2314
+ });
2315
+ finalConfig = stripHookFeatureFlagsForDisable(finalConfig, managedHooksPlan?.hasForeignHooks === true);
2316
+ finalConfig = stripLocalOmxPluginEnablementForDisable(finalConfig);
2317
+ const notify = getRootTomlArray(finalConfig, "notify");
2318
+ if (!notify || !isOmxManagedNotifyCommand(notify, pkgRoot)) {
2319
+ return { finalConfig, metadataAfter: null };
2320
+ }
2321
+ const metadataPath = getNotifyMetadataPath(codexHomeDir);
2322
+ if (isOmxDispatcherNotifyCommand(notify, pkgRoot)) {
2323
+ const previousNotify = parseDisableHooksNotifyMetadata(notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } }, metadataPath, notify);
2324
+ finalConfig = removeRootTomlKey(finalConfig, "notify");
2325
+ if (previousNotify) {
2326
+ finalConfig = insertRootTomlKey(finalConfig, `notify = ${formatTomlStringArray(previousNotify)}`);
2327
+ }
2328
+ return { finalConfig, metadataPath, metadataAfter: null };
2329
+ }
2330
+ return { finalConfig: removeRootTomlKey(finalConfig, "notify"), metadataAfter: null };
2331
+ }
2237
2332
  async function planNativeHookSetupTransaction(options) {
2238
2333
  const existingConfigSnapshot = options.configSnapshot;
2239
2334
  const existingHooksSnapshot = await captureNativeHookTransactionArtifact(options.hooksPath, `native hooks ${options.hooksPath}`);
@@ -2254,7 +2349,29 @@ async function planNativeHookSetupTransaction(options) {
2254
2349
  let notifyMetadataPrecondition = null;
2255
2350
  let modelUpgrade;
2256
2351
  let repairedLegacyTeamRunTable = false;
2257
- if (options.isPluginInstallMode) {
2352
+ if (options.disableHooks) {
2353
+ let managedHooksPlan = null;
2354
+ if (existingHooksContent !== null) {
2355
+ const removal = planManagedCodexHooksRemoval(existingHooksContent, options.hooksPath, {
2356
+ platform: options.platform,
2357
+ codexHomeDir: options.codexHomeDir,
2358
+ });
2359
+ if (!removal.ok)
2360
+ throw removal.error;
2361
+ managedHooksPlan = removal;
2362
+ finalHooksContent = removal.finalContent;
2363
+ hooksRemovedCount = removal.removedCount;
2364
+ diagnostics = removal.diagnostics;
2365
+ }
2366
+ const notifyPlan = await planDisableHooksConfig(existingConfig, options.pkgRoot, managedHooksPlan, options.codexHomeDir, options.notifyMetadataSnapshot);
2367
+ finalConfig = notifyPlan.finalConfig;
2368
+ if (notifyPlan.metadataPath) {
2369
+ const metadataBefore = options.notifyMetadataSnapshot ?? { bytes: null, topology: { kind: "absent" } };
2370
+ notifyMetadataPrecondition = nativeHookTransactionPrecondition("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore);
2371
+ notifyMetadataArtifact = nativeHookTransactionArtifact("metadata", notifyPlan.metadataPath, `notification metadata ${notifyPlan.metadataPath}`, metadataBefore, notifyPlan.metadataAfter);
2372
+ }
2373
+ }
2374
+ if (!options.disableHooks && options.isPluginInstallMode) {
2258
2375
  const pluginPlan = buildPluginModeHooksConfigPlan(existingConfig, existingHooksContent, options.pkgRoot, options.hooksPath, options.codexHomeDir, {
2259
2376
  codexHookFeatureFlag: options.codexHookFeatureFlag,
2260
2377
  pluginScopedHooks: options.pluginScopedHooks,
@@ -2280,7 +2397,7 @@ async function planNativeHookSetupTransaction(options) {
2280
2397
  finalConfig = developerInstructionsPlan.finalConfig;
2281
2398
  pluginDeveloperInstructionsResult = developerInstructionsPlan.result;
2282
2399
  }
2283
- else {
2400
+ else if (!options.disableHooks) {
2284
2401
  const managedHooksPlan = planManagedCodexHooksMerge(existingHooksContent, options.pkgRoot, options.hooksPath, {
2285
2402
  platform: options.platform,
2286
2403
  codexHomeDir: options.codexHomeDir,
@@ -2331,7 +2448,7 @@ async function planNativeHookSetupTransaction(options) {
2331
2448
  }
2332
2449
  }
2333
2450
  }
2334
- if (options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
2451
+ if (!options.disableHooks && options.isPluginInstallMode && options.sharedMcpRegistry.servers.length > 0) {
2335
2452
  finalConfig = mergeSharedMcpRegistryBlock(finalConfig, options.sharedMcpRegistry.servers, options.sharedMcpRegistry.sourcePath);
2336
2453
  }
2337
2454
  try {
@@ -2350,8 +2467,9 @@ async function planNativeHookSetupTransaction(options) {
2350
2467
  const shimAfter = Buffer.from(buildManagedCodexNativeHookWindowsShimContent(options.pkgRoot), "utf-8");
2351
2468
  assertWindowsNativeHookShimOwnership(shimPath, shimSnapshot.bytes, shimAfter);
2352
2469
  const shimReference = decideWindowsNativeHookShimReference(finalHooksContent, shimPath);
2353
- shimArtifact = nativeHookTransactionArtifact("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot, options.isPluginInstallMode && options.pluginScopedHooks &&
2354
- shimReference === "not_referenced"
2470
+ const shouldDeleteShim = shimReference === "not_referenced" &&
2471
+ (options.disableHooks || (options.isPluginInstallMode && options.pluginScopedHooks));
2472
+ shimArtifact = nativeHookTransactionArtifact("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot, shouldDeleteShim
2355
2473
  ? null
2356
2474
  : shimAfter);
2357
2475
  shimPrecondition = nativeHookTransactionPrecondition("shim", shimPath, `native hook Windows shim ${shimPath}`, shimSnapshot);
@@ -2394,7 +2512,7 @@ async function planNativeHookSetupTransaction(options) {
2394
2512
  };
2395
2513
  }
2396
2514
  export async function setup(options = {}) {
2397
- const { force = false, dryRun = false, installMode: requestedInstallMode, mcpMode: requestedMcpMode, teamMode: requestedTeamMode, scope: requestedScope, verbose = false, skipNativeAgentRefresh: requestedSkipNativeAgentRefresh = false, setupScopePrompt, persistedSetupReviewPrompt, installModePrompt, modelUpgradePrompt, pluginAgentsMdPrompt, pluginDeveloperInstructionsPrompt, firstPartyMcpRemovalPrompt, } = options;
2515
+ const { disableHooks = false, force = false, dryRun = false, installMode: requestedInstallMode, mcpMode: requestedMcpMode, teamMode: requestedTeamMode, scope: requestedScope, verbose = false, skipNativeAgentRefresh: requestedSkipNativeAgentRefresh = false, setupScopePrompt, persistedSetupReviewPrompt, installModePrompt, modelUpgradePrompt, pluginAgentsMdPrompt, pluginDeveloperInstructionsPrompt, firstPartyMcpRemovalPrompt, } = options;
2398
2516
  const pkgRoot = getPackageRoot();
2399
2517
  const projectRoot = process.cwd();
2400
2518
  const persistedPreferences = await readPersistedSetupPreferences(projectRoot, { warnOnLegacyScope: true });
@@ -2481,6 +2599,9 @@ export async function setup(options = {}) {
2481
2599
  const notifyMetadataSnapshot = configRequiresNotificationMetadataSnapshot(existingConfigForMcpMigration, pkgRoot, resolvedScope.scope)
2482
2600
  ? await captureNativeHookTransactionArtifact(getNotifyMetadataPath(scopeDirs.codexHomeDir), `notification metadata ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}`)
2483
2601
  : undefined;
2602
+ if (disableHooks && !notifyMetadataSnapshot && isOmxDispatcherNotifyCommand(getRootTomlArray(existingConfigForMcpMigration, "notify"), pkgRoot)) {
2603
+ throw new ManagedCodexHooksPlanError("invalid_document", `Refusing to disable OMX hooks: managed notification metadata is unavailable for ${getNotifyMetadataPath(scopeDirs.codexHomeDir)}.`);
2604
+ }
2484
2605
  const firstPartyMcpRegistrationKinds = [
2485
2606
  hasFirstPartyOmxMcpRegistrations(existingConfigForMcpMigration)
2486
2607
  ? "config.toml [mcp_servers.omx_*]"
@@ -2503,6 +2624,7 @@ export async function setup(options = {}) {
2503
2624
  }
2504
2625
  const scopeSourceMessage = resolvedScope.source === "persisted" ? " (from .omx/setup-scope.json)" : "";
2505
2626
  const backupContext = getBackupContext(resolvedScope.scope, projectRoot);
2627
+ const skillReceiptPath = installedSkillReceiptPath(resolvedScope.scope, projectRoot);
2506
2628
  const isPluginInstallMode = resolvedInstallMode?.installMode === "plugin";
2507
2629
  const pluginAgentsMdDst = resolvedScope.scope === "project"
2508
2630
  ? join(projectRoot, "AGENTS.md")
@@ -2576,6 +2698,7 @@ export async function setup(options = {}) {
2576
2698
  forceStatusLinePreset: force,
2577
2699
  configSnapshot: existingConfigForMcpMigrationSnapshot,
2578
2700
  notifyMetadataSnapshot,
2701
+ disableHooks,
2579
2702
  });
2580
2703
  const summary = createEmptyRunSummary();
2581
2704
  for (const precondition of nativeHookSetupTransaction.preconditions) {
@@ -2583,6 +2706,14 @@ export async function setup(options = {}) {
2583
2706
  await assertNativeHookTransactionPrecondition(precondition);
2584
2707
  }
2585
2708
  await assertNativeHookTransactionAncestorPrecondition(nativeHookTransactionAncestorPrecondition);
2709
+ if (disableHooks) {
2710
+ const disableSummary = createEmptyRunSummary();
2711
+ const durabilityTracker = { degraded: false };
2712
+ await commitNativeHookTransaction(nativeHookSetupTransaction.artifacts, nativeHookSetupTransaction.preconditions, nativeHookTransactionAncestorPrecondition, backupContext, durabilityTracker, disableSummary.config, { dryRun, verbose });
2713
+ emitDegradedDurabilityWarning("native-hook setup", durabilityTracker);
2714
+ console.log(`${dryRun ? "Would disable" : "Disabled"} OMX hook registrations; non-OMX hooks and .omx artifacts were preserved.`);
2715
+ return;
2716
+ }
2586
2717
  console.log("oh-my-codex setup");
2587
2718
  console.log("=================\n");
2588
2719
  console.log(`Using setup scope: ${resolvedScope.scope}${scopeSourceMessage}\n`);
@@ -2696,7 +2827,7 @@ export async function setup(options = {}) {
2696
2827
  const skillsDst = scopeDirs.skillsDir;
2697
2828
  if (isPluginInstallMode) {
2698
2829
  summary.skills = createEmptyCategorySummary();
2699
- const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose });
2830
+ const cleanup = await cleanupLegacyManagedSkills(skillsSrc, skillsDst, backupContext, { dryRun, verbose, skillReceiptPath });
2700
2831
  summary.skills.backedUp += cleanup.backedUp;
2701
2832
  summary.skills.removed += cleanup.removedSkillNames.length;
2702
2833
  summary.skills.skipped += cleanup.skippedSkillNames.length;
@@ -2715,6 +2846,7 @@ export async function setup(options = {}) {
2715
2846
  force,
2716
2847
  dryRun,
2717
2848
  verbose,
2849
+ skillReceiptPath,
2718
2850
  teamMode: resolvedTeamMode,
2719
2851
  });
2720
2852
  }
@@ -2741,7 +2873,7 @@ export async function setup(options = {}) {
2741
2873
  });
2742
2874
  console.log(` Native agent role refresh complete (${scopeDirs.nativeAgentsDir}); plugin mode still installs role TOML so agent_type routing works.\n`);
2743
2875
  }
2744
- else {
2876
+ else if (!options.disableHooks) {
2745
2877
  summary.nativeAgents = await refreshNativeAgentConfigs(pkgRoot, scopeDirs.nativeAgentsDir, backupContext, {
2746
2878
  force,
2747
2879
  dryRun,
@@ -2816,18 +2948,6 @@ export async function setup(options = {}) {
2816
2948
  else {
2817
2949
  console.log(` Local Codex plugin marketplace ${OMX_LOCAL_MARKETPLACE_NAME} already registered (${pkgRoot}).`);
2818
2950
  }
2819
- const pluginCacheRefresh = await refreshOmxPluginDiscoveryCache(pkgRoot, {
2820
- dryRun,
2821
- verbose,
2822
- }, scopeDirs.codexHomeDir);
2823
- if (pluginCacheRefresh.status === "refreshed") {
2824
- if (pluginCacheRefresh.staleDirs.length > 0) {
2825
- console.log(` ${dryRun ? "Would invalidate" : "Invalidated"} ${pluginCacheRefresh.staleDirs.length} stale Codex plugin discovery cache entr${pluginCacheRefresh.staleDirs.length === 1 ? "y" : "ies"} so plugin skills refresh from the packaged manifest.`);
2826
- }
2827
- }
2828
- else if (pluginCacheRefresh.status === "unchanged") {
2829
- console.log(" Codex plugin discovery cache already matches packaged plugin metadata.");
2830
- }
2831
2951
  const pluginCacheMaterialize = await materializePackagedOmxPluginCache(scopeDirs.codexHomeDir, preflightMarketplace, { dryRun, teamMode: resolvedTeamMode });
2832
2952
  if (pluginCacheMaterialize.status === "materialized") {
2833
2953
  console.log(` ${dryRun ? "Would install" : "Installed"} local Codex plugin cache for ${OMX_LOCAL_MARKETPLACE_NAME}/${OMX_PLUGIN_NAME} at ${pluginCacheMaterialize.cacheDir}.`);
@@ -2835,6 +2955,10 @@ export async function setup(options = {}) {
2835
2955
  else if (pluginCacheMaterialize.status === "unchanged") {
2836
2956
  console.log(" Local Codex plugin cache already exposes packaged OMX skills.");
2837
2957
  }
2958
+ else if (pluginCacheMaterialize.status === "stale-launcher") {
2959
+ console.log(` warning: local Codex plugin cache at ${pluginCacheMaterialize.cacheDir} has incompatible launcher provenance (${pluginCacheMaterialize.reason}); not reporting as current.`);
2960
+ console.log(` Run \`codex plugin remove ${OMX_LOCAL_PLUGIN_CONFIG_KEY} --json\` then rerun \`omx setup --plugin\` to rebuild the snapshot for ${preflightMarketplace?.packageRoot ?? pkgRoot}.`);
2961
+ }
2838
2962
  if (pluginCacheMaterialize.status === "materialized" ||
2839
2963
  pluginCacheMaterialize.status === "unchanged") {
2840
2964
  console.log(" Start a new Codex session if /skills still shows stale OMX plugin skill metadata; the current session may keep its in-memory plugin registry until restart.");
@@ -2888,7 +3012,11 @@ export async function setup(options = {}) {
2888
3012
  const activeSession = resolvedScope.scope === "project"
2889
3013
  ? await readSessionState(projectRoot)
2890
3014
  : null;
2891
- const sessionIsActive = activeSession && !isSessionStale(activeSession);
3015
+ // Only a definitely dead session releases the overlay. macOS records no process-birth evidence, so
3016
+ // a live session classifies as identity-indeterminate; treating that as stale would let setup
3017
+ // overwrite the AGENTS.md overlay of a running session.
3018
+ const sessionIsActive = activeSession !== null &&
3019
+ classifySessionStateLiveness(activeSession) !== "stale-dead";
2892
3020
  if (isPluginInstallMode) {
2893
3021
  const agentsMdSrc = join(pkgRoot, "templates", "AGENTS.md");
2894
3022
  const pluginAgentsMdExists = pluginAgentsMdPathExists;
@@ -3662,7 +3790,14 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
3662
3790
  : null;
3663
3791
  const isSetupInstallableSkill = (skillName, status) => isCatalogInstallableStatus(status) || installableSkillNames.has(skillName);
3664
3792
  const entries = await readdir(srcDir, { withFileTypes: true });
3665
- const staleCandidateSkillNames = new Set(manifest?.skills.map((skill) => skill.name) ?? []);
3793
+ const catalogKnownSkillNames = new Set(manifest?.skills.map((skill) => skill.name) ?? []);
3794
+ const staleCandidateSkillNames = new Set(catalogKnownSkillNames);
3795
+ if (existsSync(dstDir)) {
3796
+ for (const installed of await readdir(dstDir, { withFileTypes: true })) {
3797
+ if (installed.isDirectory())
3798
+ staleCandidateSkillNames.add(installed.name);
3799
+ }
3800
+ }
3666
3801
  for (const entry of entries) {
3667
3802
  if (!entry.isDirectory())
3668
3803
  continue;
@@ -3697,6 +3832,7 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
3697
3832
  for (const skill of installableSkills) {
3698
3833
  await validateSkillFile(join(skill.sourceDir, "SKILL.md"));
3699
3834
  }
3835
+ const writtenFilesBySkill = new Map();
3700
3836
  for (const skill of installableSkills) {
3701
3837
  const skillName = skill.name;
3702
3838
  const skillSrc = skill.sourceDir;
@@ -3705,18 +3841,27 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
3705
3841
  await mkdir(skillDst, { recursive: true });
3706
3842
  }
3707
3843
  const skillFiles = await readdir(skillSrc);
3844
+ const writtenForSkill = [];
3708
3845
  for (const sf of skillFiles) {
3709
3846
  const sfPath = join(skillSrc, sf);
3710
3847
  const sfStat = await stat(sfPath);
3711
3848
  if (!sfStat.isFile())
3712
3849
  continue;
3713
3850
  const dstPath = join(skillDst, sf);
3851
+ writtenForSkill.push(sf);
3714
3852
  if (sf === "SKILL.md") {
3715
3853
  await syncManagedContent(rewriteInstalledSkillDescriptionBadge(await readFile(sfPath, "utf-8"), sfPath), dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
3716
3854
  continue;
3717
3855
  }
3718
3856
  await syncManagedFileFromDisk(sfPath, dstPath, summary, backupContext, options, `skill ${skillName}/${sf}`);
3719
3857
  }
3858
+ writtenFilesBySkill.set(skillName, writtenForSkill);
3859
+ }
3860
+ // Record what we just wrote so a later refresh can prove an unmodified install before retiring it.
3861
+ // Without an authority path, refuse to create a receipt rather than placing deletion authority
3862
+ // in the user-writable skills directory.
3863
+ if (options.skillReceiptPath) {
3864
+ await writeInstalledSkillReceipt(options.skillReceiptPath, dstDir, writtenFilesBySkill, options);
3720
3865
  }
3721
3866
  if (manifest && existsSync(dstDir)) {
3722
3867
  for (const staleSkill of staleCandidateSkillNames) {
@@ -3724,14 +3869,32 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
3724
3869
  const disabledTeamSkill = !teamModeEnabled(options.teamMode) && TEAM_MODE_SKILL_NAMES.has(staleSkill);
3725
3870
  if (isSetupInstallableSkill(staleSkill, status) && !disabledTeamSkill)
3726
3871
  continue;
3727
- const hardDeprecated = HARD_DEPRECATED_SKILL_NAMES.has(staleSkill);
3728
- if (!options.force && !hardDeprecated && !disabledTeamSkill)
3729
- continue;
3730
3872
  const staleSkillDir = join(dstDir, staleSkill);
3731
3873
  if (!existsSync(staleSkillDir))
3732
3874
  continue;
3733
- if (!options.dryRun) {
3734
- await rm(staleSkillDir, { recursive: true, force: true });
3875
+ // A directory the catalog no longer ships is ours to retire on any refresh - which is what
3876
+ // makes `omx update` drop deprecated skills without an extra flag - but only when we can
3877
+ // prove it is an UNMODIFIED install we wrote. The badge alone is not proof: a user who
3878
+ // edits the body keeps it, and archiving their edit is not preserving it.
3879
+ const unmodifiedInstall = Boolean(options.skillReceiptPath)
3880
+ && await isUnmodifiedRecordedInstall(options.skillReceiptPath, staleSkill, staleSkillDir);
3881
+ const omxManaged = await isOmxManagedInstalledSkillDir(staleSkillDir) && unmodifiedInstall;
3882
+ const forcedCatalogSkill = options.force && catalogKnownSkillNames.has(staleSkill);
3883
+ // Disabling Team mode is a configuration change, not a destructive opt-in, so it must not
3884
+ // delete a directory we cannot prove we wrote. --force remains the explicit destructive path.
3885
+ const removableDisabledTeamSkill = disabledTeamSkill && unmodifiedInstall;
3886
+ if (!omxManaged && !forcedCatalogSkill && !removableDisabledTeamSkill) {
3887
+ summary.skipped += 1;
3888
+ if (options.verbose) {
3889
+ const why = await isOmxManagedInstalledSkillDir(staleSkillDir)
3890
+ ? "modified since install, or installed before receipts existed"
3891
+ : "not an OMX-managed skill install";
3892
+ console.log(` kept ${staleSkill}/ (${why})`);
3893
+ }
3894
+ continue;
3895
+ }
3896
+ if (await removeDirectoryCopyAware(staleSkillDir, backupContext, options)) {
3897
+ summary.backedUp += 1;
3735
3898
  }
3736
3899
  summary.removed += 1;
3737
3900
  if (options.verbose) {
@@ -3739,9 +3902,9 @@ export async function installSkills(srcDir, dstDir, backupContext, options) {
3739
3902
  ? "would remove stale skill"
3740
3903
  : "removed stale skill";
3741
3904
  const label = status ?? "unlisted";
3742
- const reason = disabledTeamSkill
3905
+ const reason = removableDisabledTeamSkill
3743
3906
  ? ", Team mode disabled"
3744
- : hardDeprecated ? ", hard-deprecated" : "";
3907
+ : omxManaged ? ", retired from the catalog" : "";
3745
3908
  console.log(` ${prefix} ${staleSkill}/ (status: ${label}${reason})`);
3746
3909
  }
3747
3910
  }
@@ -3799,12 +3962,42 @@ async function cleanupLegacyManagedSkills(srcDir, dstDir, backupContext, options
3799
3962
  result.warnings.push(warning);
3800
3963
  continue;
3801
3964
  }
3965
+ // A matching SKILL.md does not prove the whole directory is ours: a user file sitting beside it
3966
+ // would be deleted with the directory. Require the same unmodified-install proof the ordinary
3967
+ // retirement sweep uses.
3968
+ if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, skillName, installedSkillDir))) {
3969
+ const warning = `Skipping legacy skill cleanup for ${skillName}: directory contents are not a receipted unmodified OMX install.`;
3970
+ result.skippedSkillNames.push(skillName);
3971
+ result.warnings.push(warning);
3972
+ continue;
3973
+ }
3802
3974
  const removed = await removeDirectoryCopyAware(installedSkillDir, backupContext, options);
3803
3975
  if (removed) {
3804
3976
  result.backedUp += 1;
3805
3977
  result.removedSkillNames.push(skillName);
3806
3978
  }
3807
3979
  }
3980
+ // Plugin mode never reinstalls into the legacy directory, so a skill the catalog has retired
3981
+ // would otherwise survive there forever. Retire OMX-badged orphans on every refresh.
3982
+ for (const entry of await readdir(dstDir, { withFileTypes: true })) {
3983
+ if (!entry.isDirectory())
3984
+ continue;
3985
+ if (installableSkillNames.has(entry.name))
3986
+ continue;
3987
+ const installedSkillDir = join(dstDir, entry.name);
3988
+ if (!(await isOmxManagedInstalledSkillDir(installedSkillDir)))
3989
+ continue;
3990
+ // The badge alone is not proof of ownership for deletion; a user-edited body keeps it.
3991
+ if (!options.skillReceiptPath || !(await isUnmodifiedRecordedInstall(options.skillReceiptPath, entry.name, installedSkillDir))) {
3992
+ result.skippedSkillNames.push(entry.name);
3993
+ result.warnings.push(`Skipping retired skill ${entry.name}: modified since install, or installed before receipts existed.`);
3994
+ continue;
3995
+ }
3996
+ if (await removeDirectoryCopyAware(installedSkillDir, backupContext, options)) {
3997
+ result.backedUp += 1;
3998
+ result.removedSkillNames.push(entry.name);
3999
+ }
4000
+ }
3808
4001
  return result;
3809
4002
  }
3810
4003
  function getNotifyMetadataPath(codexHomeDir) {