oh-my-codex 0.18.1 → 0.18.3

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 (310) hide show
  1. package/Cargo.lock +6 -6
  2. package/Cargo.toml +1 -1
  3. package/README.md +4 -2
  4. package/dist/agents/__tests__/definitions.test.js +23 -0
  5. package/dist/agents/__tests__/definitions.test.js.map +1 -1
  6. package/dist/agents/__tests__/native-config.test.js +20 -0
  7. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  8. package/dist/agents/definitions.d.ts.map +1 -1
  9. package/dist/agents/definitions.js +40 -0
  10. package/dist/agents/definitions.js.map +1 -1
  11. package/dist/agents/native-config.d.ts +1 -0
  12. package/dist/agents/native-config.d.ts.map +1 -1
  13. package/dist/agents/native-config.js +4 -0
  14. package/dist/agents/native-config.js.map +1 -1
  15. package/dist/auth/__tests__/config-sessions.test.d.ts +2 -0
  16. package/dist/auth/__tests__/config-sessions.test.d.ts.map +1 -0
  17. package/dist/auth/__tests__/config-sessions.test.js +48 -0
  18. package/dist/auth/__tests__/config-sessions.test.js.map +1 -0
  19. package/dist/auth/__tests__/quota-rotation.test.d.ts +2 -0
  20. package/dist/auth/__tests__/quota-rotation.test.d.ts.map +1 -0
  21. package/dist/auth/__tests__/quota-rotation.test.js +33 -0
  22. package/dist/auth/__tests__/quota-rotation.test.js.map +1 -0
  23. package/dist/auth/__tests__/redact.test.d.ts +2 -0
  24. package/dist/auth/__tests__/redact.test.d.ts.map +1 -0
  25. package/dist/auth/__tests__/redact.test.js +20 -0
  26. package/dist/auth/__tests__/redact.test.js.map +1 -0
  27. package/dist/auth/__tests__/storage.test.d.ts +2 -0
  28. package/dist/auth/__tests__/storage.test.d.ts.map +1 -0
  29. package/dist/auth/__tests__/storage.test.js +108 -0
  30. package/dist/auth/__tests__/storage.test.js.map +1 -0
  31. package/dist/auth/config.d.ts +9 -0
  32. package/dist/auth/config.d.ts.map +1 -0
  33. package/dist/auth/config.js +77 -0
  34. package/dist/auth/config.js.map +1 -0
  35. package/dist/auth/hotswap.d.ts +36 -0
  36. package/dist/auth/hotswap.d.ts.map +1 -0
  37. package/dist/auth/hotswap.js +159 -0
  38. package/dist/auth/hotswap.js.map +1 -0
  39. package/dist/auth/index.d.ts +8 -0
  40. package/dist/auth/index.d.ts.map +1 -0
  41. package/dist/auth/index.js +8 -0
  42. package/dist/auth/index.js.map +1 -0
  43. package/dist/auth/paths.d.ts +12 -0
  44. package/dist/auth/paths.d.ts.map +1 -0
  45. package/dist/auth/paths.js +78 -0
  46. package/dist/auth/paths.js.map +1 -0
  47. package/dist/auth/quota-detector.d.ts +10 -0
  48. package/dist/auth/quota-detector.d.ts.map +1 -0
  49. package/dist/auth/quota-detector.js +40 -0
  50. package/dist/auth/quota-detector.js.map +1 -0
  51. package/dist/auth/redact.d.ts +2 -0
  52. package/dist/auth/redact.d.ts.map +1 -0
  53. package/dist/auth/redact.js +26 -0
  54. package/dist/auth/redact.js.map +1 -0
  55. package/dist/auth/rotation.d.ts +9 -0
  56. package/dist/auth/rotation.d.ts.map +1 -0
  57. package/dist/auth/rotation.js +26 -0
  58. package/dist/auth/rotation.js.map +1 -0
  59. package/dist/auth/sessions.d.ts +15 -0
  60. package/dist/auth/sessions.d.ts.map +1 -0
  61. package/dist/auth/sessions.js +62 -0
  62. package/dist/auth/sessions.js.map +1 -0
  63. package/dist/auth/storage.d.ts +27 -0
  64. package/dist/auth/storage.d.ts.map +1 -0
  65. package/dist/auth/storage.js +111 -0
  66. package/dist/auth/storage.js.map +1 -0
  67. package/dist/catalog/__tests__/generator.test.js +4 -0
  68. package/dist/catalog/__tests__/generator.test.js.map +1 -1
  69. package/dist/cli/__tests__/auth.test.d.ts +2 -0
  70. package/dist/cli/__tests__/auth.test.d.ts.map +1 -0
  71. package/dist/cli/__tests__/auth.test.js +168 -0
  72. package/dist/cli/__tests__/auth.test.js.map +1 -0
  73. package/dist/cli/__tests__/doctor-warning-copy.test.js +112 -5
  74. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  75. package/dist/cli/__tests__/explore.test.js +20 -0
  76. package/dist/cli/__tests__/explore.test.js.map +1 -1
  77. package/dist/cli/__tests__/index.test.js +171 -21
  78. package/dist/cli/__tests__/index.test.js.map +1 -1
  79. package/dist/cli/__tests__/launch-fallback.test.js +51 -3
  80. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  81. package/dist/cli/__tests__/nested-help-routing.test.js +1 -0
  82. package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
  83. package/dist/cli/__tests__/question.test.js +2 -2
  84. package/dist/cli/__tests__/question.test.js.map +1 -1
  85. package/dist/cli/__tests__/setup-agents-overwrite.test.js +30 -1
  86. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  87. package/dist/cli/__tests__/setup-install-mode.test.js +47 -0
  88. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  89. package/dist/cli/auth.d.ts +4 -0
  90. package/dist/cli/auth.d.ts.map +1 -0
  91. package/dist/cli/auth.js +89 -0
  92. package/dist/cli/auth.js.map +1 -0
  93. package/dist/cli/doctor.d.ts.map +1 -1
  94. package/dist/cli/doctor.js +190 -7
  95. package/dist/cli/doctor.js.map +1 -1
  96. package/dist/cli/explore.d.ts.map +1 -1
  97. package/dist/cli/explore.js +12 -0
  98. package/dist/cli/explore.js.map +1 -1
  99. package/dist/cli/index.d.ts +27 -3
  100. package/dist/cli/index.d.ts.map +1 -1
  101. package/dist/cli/index.js +245 -47
  102. package/dist/cli/index.js.map +1 -1
  103. package/dist/cli/setup.d.ts.map +1 -1
  104. package/dist/cli/setup.js +11 -3
  105. package/dist/cli/setup.js.map +1 -1
  106. package/dist/config/__tests__/codex-hooks.test.js +3 -3
  107. package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
  108. package/dist/config/__tests__/deep-interview.test.d.ts +2 -0
  109. package/dist/config/__tests__/deep-interview.test.d.ts.map +1 -0
  110. package/dist/config/__tests__/deep-interview.test.js +239 -0
  111. package/dist/config/__tests__/deep-interview.test.js.map +1 -0
  112. package/dist/config/__tests__/generator-idempotent.test.js +123 -0
  113. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  114. package/dist/config/codex-hooks.d.ts +1 -0
  115. package/dist/config/codex-hooks.d.ts.map +1 -1
  116. package/dist/config/codex-hooks.js +2 -4
  117. package/dist/config/codex-hooks.js.map +1 -1
  118. package/dist/config/deep-interview.d.ts +22 -0
  119. package/dist/config/deep-interview.d.ts.map +1 -0
  120. package/dist/config/deep-interview.js +151 -0
  121. package/dist/config/deep-interview.js.map +1 -0
  122. package/dist/config/generator.d.ts +19 -2
  123. package/dist/config/generator.d.ts.map +1 -1
  124. package/dist/config/generator.js +198 -29
  125. package/dist/config/generator.js.map +1 -1
  126. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +21 -0
  127. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
  128. package/dist/goal-workflows/codex-goal-snapshot.d.ts +3 -0
  129. package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
  130. package/dist/goal-workflows/codex-goal-snapshot.js +45 -2
  131. package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
  132. package/dist/hooks/__tests__/agents-overlay.test.js +2 -0
  133. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
  134. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +17 -0
  135. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
  136. package/dist/hooks/__tests__/explore-routing.test.js +1 -0
  137. package/dist/hooks/__tests__/explore-routing.test.js.map +1 -1
  138. package/dist/hooks/__tests__/keyword-detector.test.js +471 -15
  139. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  140. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +2 -0
  141. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +1 -0
  142. package/dist/hooks/__tests__/prometheus-strict-contract.test.js +320 -0
  143. package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +1 -0
  144. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +12 -0
  145. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  146. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts +2 -0
  147. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts.map +1 -0
  148. package/dist/hooks/__tests__/research-workflow-boundaries.test.js +35 -0
  149. package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -0
  150. package/dist/hooks/deep-interview-config-instruction.d.ts +3 -0
  151. package/dist/hooks/deep-interview-config-instruction.d.ts.map +1 -0
  152. package/dist/hooks/deep-interview-config-instruction.js +47 -0
  153. package/dist/hooks/deep-interview-config-instruction.js.map +1 -0
  154. package/dist/hooks/explore-routing.d.ts.map +1 -1
  155. package/dist/hooks/explore-routing.js +1 -0
  156. package/dist/hooks/explore-routing.js.map +1 -1
  157. package/dist/hooks/keyword-detector.d.ts +6 -1
  158. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  159. package/dist/hooks/keyword-detector.js +80 -14
  160. package/dist/hooks/keyword-detector.js.map +1 -1
  161. package/dist/hooks/keyword-registry.d.ts.map +1 -1
  162. package/dist/hooks/keyword-registry.js +1 -0
  163. package/dist/hooks/keyword-registry.js.map +1 -1
  164. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  165. package/dist/hooks/prompt-guidance-contract.js +11 -0
  166. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  167. package/dist/hud/__tests__/hud-tmux-injection.test.js +22 -0
  168. package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
  169. package/dist/hud/__tests__/reconcile.test.js +213 -17
  170. package/dist/hud/__tests__/reconcile.test.js.map +1 -1
  171. package/dist/hud/__tests__/render.test.js +84 -0
  172. package/dist/hud/__tests__/render.test.js.map +1 -1
  173. package/dist/hud/__tests__/state.test.js +51 -1
  174. package/dist/hud/__tests__/state.test.js.map +1 -1
  175. package/dist/hud/__tests__/tmux.test.js +171 -23
  176. package/dist/hud/__tests__/tmux.test.js.map +1 -1
  177. package/dist/hud/index.d.ts +1 -1
  178. package/dist/hud/index.d.ts.map +1 -1
  179. package/dist/hud/index.js +8 -3
  180. package/dist/hud/index.js.map +1 -1
  181. package/dist/hud/reconcile.d.ts +1 -1
  182. package/dist/hud/reconcile.d.ts.map +1 -1
  183. package/dist/hud/reconcile.js +14 -3
  184. package/dist/hud/reconcile.js.map +1 -1
  185. package/dist/hud/render.d.ts.map +1 -1
  186. package/dist/hud/render.js +26 -0
  187. package/dist/hud/render.js.map +1 -1
  188. package/dist/hud/state.d.ts +2 -1
  189. package/dist/hud/state.d.ts.map +1 -1
  190. package/dist/hud/state.js +62 -1
  191. package/dist/hud/state.js.map +1 -1
  192. package/dist/hud/tmux.d.ts +17 -3
  193. package/dist/hud/tmux.d.ts.map +1 -1
  194. package/dist/hud/tmux.js +96 -10
  195. package/dist/hud/tmux.js.map +1 -1
  196. package/dist/hud/types.d.ts +22 -0
  197. package/dist/hud/types.d.ts.map +1 -1
  198. package/dist/hud/types.js.map +1 -1
  199. package/dist/pipeline/__tests__/orchestrator.test.js +63 -1
  200. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
  201. package/dist/pipeline/__tests__/stages.test.js +410 -4
  202. package/dist/pipeline/__tests__/stages.test.js.map +1 -1
  203. package/dist/pipeline/orchestrator.d.ts.map +1 -1
  204. package/dist/pipeline/orchestrator.js +29 -2
  205. package/dist/pipeline/orchestrator.js.map +1 -1
  206. package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
  207. package/dist/pipeline/stages/ralplan.js +41 -6
  208. package/dist/pipeline/stages/ralplan.js.map +1 -1
  209. package/dist/question/__tests__/ui.test.js +43 -10
  210. package/dist/question/__tests__/ui.test.js.map +1 -1
  211. package/dist/question/deep-interview.d.ts +2 -0
  212. package/dist/question/deep-interview.d.ts.map +1 -1
  213. package/dist/question/deep-interview.js.map +1 -1
  214. package/dist/question/ui.d.ts +12 -0
  215. package/dist/question/ui.d.ts.map +1 -1
  216. package/dist/question/ui.js +83 -46
  217. package/dist/question/ui.js.map +1 -1
  218. package/dist/ralplan/__tests__/runtime.test.js +200 -10
  219. package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
  220. package/dist/ralplan/consensus-gate.d.ts +23 -0
  221. package/dist/ralplan/consensus-gate.d.ts.map +1 -0
  222. package/dist/ralplan/consensus-gate.js +212 -0
  223. package/dist/ralplan/consensus-gate.js.map +1 -0
  224. package/dist/ralplan/runtime.d.ts +25 -0
  225. package/dist/ralplan/runtime.d.ts.map +1 -1
  226. package/dist/ralplan/runtime.js +144 -8
  227. package/dist/ralplan/runtime.js.map +1 -1
  228. package/dist/scripts/__tests__/codex-native-hook.test.js +1034 -28
  229. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  230. package/dist/scripts/__tests__/docs-site-contract.test.d.ts +2 -0
  231. package/dist/scripts/__tests__/docs-site-contract.test.d.ts.map +1 -0
  232. package/dist/scripts/__tests__/docs-site-contract.test.js +42 -0
  233. package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -0
  234. package/dist/scripts/__tests__/notify-dispatcher.test.js +115 -2
  235. package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -1
  236. package/dist/scripts/__tests__/run-test-files.test.js +57 -0
  237. package/dist/scripts/__tests__/run-test-files.test.js.map +1 -1
  238. package/dist/scripts/__tests__/verify-native-agents.test.js +2 -2
  239. package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -1
  240. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  241. package/dist/scripts/codex-native-hook.js +238 -36
  242. package/dist/scripts/codex-native-hook.js.map +1 -1
  243. package/dist/scripts/notify-dispatcher.js +188 -4
  244. package/dist/scripts/notify-dispatcher.js.map +1 -1
  245. package/dist/scripts/run-test-files.js +13 -0
  246. package/dist/scripts/run-test-files.js.map +1 -1
  247. package/dist/state/__tests__/planning-gate.test.d.ts +2 -0
  248. package/dist/state/__tests__/planning-gate.test.d.ts.map +1 -0
  249. package/dist/state/__tests__/planning-gate.test.js +219 -0
  250. package/dist/state/__tests__/planning-gate.test.js.map +1 -0
  251. package/dist/state/__tests__/workflow-transition.test.js +6 -0
  252. package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
  253. package/dist/state/workflow-transition.d.ts +24 -1
  254. package/dist/state/workflow-transition.d.ts.map +1 -1
  255. package/dist/state/workflow-transition.js +70 -0
  256. package/dist/state/workflow-transition.js.map +1 -1
  257. package/dist/subagents/tracker.d.ts.map +1 -1
  258. package/dist/subagents/tracker.js +4 -3
  259. package/dist/subagents/tracker.js.map +1 -1
  260. package/dist/team/__tests__/runtime.test.js +36 -44
  261. package/dist/team/__tests__/runtime.test.js.map +1 -1
  262. package/dist/team/__tests__/tmux-session.test.js +144 -18
  263. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  264. package/dist/team/runtime.d.ts.map +1 -1
  265. package/dist/team/runtime.js +10 -20
  266. package/dist/team/runtime.js.map +1 -1
  267. package/dist/team/tmux-session.d.ts.map +1 -1
  268. package/dist/team/tmux-session.js +22 -6
  269. package/dist/team/tmux-session.js.map +1 -1
  270. package/dist/ultragoal/__tests__/artifacts.test.js +50 -0
  271. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
  272. package/dist/ultragoal/artifacts.d.ts.map +1 -1
  273. package/dist/ultragoal/artifacts.js +28 -2
  274. package/dist/ultragoal/artifacts.js.map +1 -1
  275. package/package.json +1 -1
  276. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  277. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +16 -4
  278. package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +4 -0
  279. package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +1 -1
  280. package/plugins/oh-my-codex/skills/best-practice-research/SKILL.md +1 -1
  281. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +10 -0
  282. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +1 -1
  283. package/plugins/oh-my-codex/skills/plan/SKILL.md +1 -1
  284. package/plugins/oh-my-codex/skills/prometheus-strict/README.md +35 -0
  285. package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +219 -0
  286. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +24 -5
  287. package/prompts/prometheus-strict-metis.md +274 -0
  288. package/prompts/prometheus-strict-momus.md +82 -0
  289. package/prompts/prometheus-strict-oracle.md +107 -0
  290. package/prompts/researcher.md +22 -3
  291. package/prompts/scholastic.md +11 -0
  292. package/skills/autopilot/SKILL.md +16 -4
  293. package/skills/autoresearch/SKILL.md +4 -0
  294. package/skills/autoresearch-goal/SKILL.md +1 -1
  295. package/skills/best-practice-research/SKILL.md +1 -1
  296. package/skills/deep-interview/SKILL.md +10 -0
  297. package/skills/pipeline/SKILL.md +1 -1
  298. package/skills/plan/SKILL.md +1 -1
  299. package/skills/prometheus-strict/README.md +35 -0
  300. package/skills/prometheus-strict/SKILL.md +219 -0
  301. package/skills/ralplan/SKILL.md +24 -5
  302. package/src/scripts/__tests__/codex-native-hook.test.ts +1307 -61
  303. package/src/scripts/__tests__/docs-site-contract.test.ts +47 -0
  304. package/src/scripts/__tests__/notify-dispatcher.test.ts +132 -3
  305. package/src/scripts/__tests__/run-test-files.test.ts +67 -0
  306. package/src/scripts/__tests__/verify-native-agents.test.ts +2 -2
  307. package/src/scripts/codex-native-hook.ts +260 -31
  308. package/src/scripts/notify-dispatcher.ts +202 -4
  309. package/src/scripts/run-test-files.ts +13 -0
  310. package/templates/catalog-manifest.json +27 -0
@@ -11,8 +11,8 @@ import { type NotifyTempContract, type ParseNotifyTempContractResult } from "../
11
11
  export declare function resolveNotifyFallbackWatcherScript(pkgRoot?: string): string;
12
12
  export declare function resolveHookDerivedWatcherScript(pkgRoot?: string): string;
13
13
  export declare function resolveNotifyHookScript(pkgRoot?: string): string;
14
- export declare const HELP = "\noh-my-codex (omx) - Multi-agent orchestration for Codex CLI\n\nUsage:\n omx Launch Codex CLI (detached tmux by default on supported interactive terminals)\n omx exec Run codex exec non-interactively with OMX AGENTS/overlay injection\n omx exec inject <session-id> --prompt <text>\n Queue audited follow-up instructions for a running non-interactive exec job\n omx imagegen continuation <session-id> --artifact <name>\n Queue a Stop-hook continuation for built-in image generation turns\n omx setup Install skills, prompts, CLI-first config, and scope-specific AGENTS.md\n (user scope prompts for legacy vs plugin skill delivery when needed)\n omx update Check npm now, update the global install immediately, then refresh setup\n omx uninstall Remove OMX configuration and clean up installed artifacts\n omx doctor Check installation health\n omx list List packaged OMX skills and native agent prompts (--json)\n omx cleanup Kill orphaned OMX MCP server processes and remove stale OMX /tmp directories\n omx doctor --team Check team/swarm runtime health diagnostics\n omx ask Ask local provider CLI (claude|gemini) and write artifact output\n omx question OMX-owned blocking question UI entrypoint for agent-invoked user questions\n omx adapt Scaffold OMX-owned adapter foundations for persistent external targets\n omx resume Resume a previous interactive Codex session\n omx explore Default read-only exploration entrypoint (may adaptively use sparkshell backend)\n omx api Run native omx-api localhost gateway commands (serve|status|stop|generate)\n omx session Search prior local session transcripts and history artifacts\n omx agents-init [path]\n Bootstrap lightweight AGENTS.md files for a repo/subtree\n omx agents Manage Codex native agent TOML files\n omx deepinit [path]\n Alias for agents-init (lightweight AGENTS bootstrap only)\n omx team Spawn parallel worker panes in tmux and bootstrap inbox/task state\n omx ralph Launch Codex with ralph persistence mode active\n omx ultragoal Create, resume, and checkpoint durable multi-goal plans over Codex goal mode\n omx performance-goal\n Create, hand off, and gate evaluator-backed performance goals\n omx autoresearch-goal\n Create, hand off, and gate professor-critic research goals\n omx autoresearch [DEPRECATED] Use $autoresearch; direct CLI launch removed\n omx version Show version information\n omx tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)\n omx hooks Manage hook plugins (init|status|validate|test)\n omx hud Show HUD statusline (--watch, --json, --preset=NAME)\n omx sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)\n omx state Read/write/list OMX mode state via CLI parity surface\n omx notepad JSON CLI surface for OMX notepad operations\n omx project-memory\n JSON CLI surface for OMX project-memory operations\n omx trace JSON CLI surface for OMX trace operations\n omx code-intel\n JSON CLI surface for OMX code-intel operations\n omx wiki JSON CLI surface for OMX wiki operations\n omx mcp-serve Launch an OMX stdio MCP server target (plugin/runtime use)\n omx sparkshell <command> [args...]\n omx sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]\n Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization\n (also used as an adaptive backend for qualifying read-only explore tasks)\n omx help Show this help message\n omx status Show active modes and state\n omx cancel Cancel active execution modes\n omx reasoning Show or set model reasoning effort (low|medium|high|xhigh)\n\nOptions:\n --yolo Launch Codex in yolo mode (shorthand for: omx launch --yolo)\n --high Launch Codex with high reasoning effort\n (shorthand for: -c model_reasoning_effort=\"high\")\n --xhigh Launch Codex with xhigh reasoning effort\n (shorthand for: -c model_reasoning_effort=\"xhigh\")\n --madmax DANGEROUS: bypass Codex approvals and sandbox\n (alias for --dangerously-bypass-approvals-and-sandbox)\n --spark Use the Codex spark model (~1.3x faster) for team workers only\n Workers get the configured low-complexity team model; leader model unchanged\n --madmax-spark spark model for workers + bypass approvals for leader and workers\n (shorthand for: --spark --madmax)\n --notify-temp Enable temporary notification routing for this run/session only\n --direct Launch the interactive leader directly without OMX tmux/HUD management\n --tmux Launch the interactive leader session in detached tmux\n --discord Select Discord provider for temporary notification mode\n --slack Select Slack provider for temporary notification mode\n --telegram Select Telegram provider for temporary notification mode\n --custom <name>\n Select custom/OpenClaw gateway name for temporary notification mode\n -w, --worktree[=<name>]\n Launch Codex in a git worktree (detached when no name is given)\n --force Force reinstall (overwrite existing files)\n --merge-agents\n Merge OMX-managed AGENTS.md sections into an existing AGENTS.md\n instead of overwriting user-authored content\n --dry-run Show what would be done without doing it\n --plugin Use Codex plugin delivery for omx setup and remove legacy OMX-managed user/project components\n --legacy Use legacy setup delivery for omx setup, overriding persisted plugin mode\n --install-mode <legacy|plugin>\n Explicit setup install mode (canonical form; --legacy/--plugin are aliases)\n --mcp <none|compat>\n Explicit setup MCP mode (default: none; compat enables first-party MCP compatibility and shared registry sync)\n --no-mcp Alias for --mcp=none\n --with-mcp Alias for --mcp=compat\n --keep-config Skip config.toml cleanup during uninstall\n --purge Remove .omx/ cache directory during uninstall\n --verbose Show detailed output\n --scope Setup scope for \"omx setup\" only:\n user | project\n\nLaunch policy:\n OMX_LAUNCH_POLICY=auto\n Use the default policy: detached tmux when supported, direct otherwise\n OMX_LAUNCH_POLICY=direct\n Run without OMX tmux/HUD management\n OMX_LAUNCH_POLICY=tmux\n Force OMX-managed detached tmux launch\n OMX_LAUNCH_POLICY=detached-tmux\n Force OMX-managed detached tmux launch\n CLI policy flags (--direct/--tmux) override OMX_LAUNCH_POLICY; the last flag before -- wins.\n Unset or empty OMX_LAUNCH_POLICY returns to auto/default behavior.\n Config files are intentionally not used for launch policy in this release.\n";
15
- type CliCommand = "launch" | "exec" | "imagegen" | "setup" | "update" | "list" | "agents" | "agents-init" | "deepinit" | "uninstall" | "doctor" | "cleanup" | "ask" | "question" | "adapt" | "explore" | "api" | "sparkshell" | "team" | "session" | "resume" | "version" | "tmux-hook" | "hooks" | "hud" | "sidecar" | "state" | "wiki" | "mcp-serve" | "status" | "cancel" | "help" | "reasoning" | "codex-native-hook" | string;
14
+ export declare const HELP = "\noh-my-codex (omx) - Multi-agent orchestration for Codex CLI\n\nUsage:\n omx Launch Codex CLI (detached tmux by default on supported interactive terminals)\n omx exec Run codex exec non-interactively with OMX AGENTS/overlay injection\n omx exec inject <session-id> --prompt <text>\n Queue audited follow-up instructions for a running non-interactive exec job\n omx imagegen continuation <session-id> --artifact <name>\n Queue a Stop-hook continuation for built-in image generation turns\n omx setup Install skills, prompts, CLI-first config, and scope-specific AGENTS.md\n (user scope prompts for legacy vs plugin skill delivery when needed)\n omx update Check npm now, update the global install immediately, then refresh setup\n omx uninstall Remove OMX configuration and clean up installed artifacts\n omx doctor Check installation health\n omx list List packaged OMX skills and native agent prompts (--json)\n omx cleanup Kill orphaned OMX MCP server processes and remove stale OMX /tmp directories\n omx doctor --team Check team/swarm runtime health diagnostics\n omx ask Ask local provider CLI (claude|gemini) and write artifact output\n omx auth Manage Codex OAuth auth slots (add|list|use)\n omx question OMX-owned blocking question UI entrypoint for agent-invoked user questions\n omx adapt Scaffold OMX-owned adapter foundations for persistent external targets\n omx resume Resume a previous interactive Codex session\n omx explore Default read-only exploration entrypoint (may adaptively use sparkshell backend)\n omx api Run native omx-api localhost gateway commands (serve|status|stop|generate)\n omx session Search prior local session transcripts and history artifacts\n omx agents-init [path]\n Bootstrap lightweight AGENTS.md files for a repo/subtree\n omx agents Manage Codex native agent TOML files\n omx deepinit [path]\n Alias for agents-init (lightweight AGENTS bootstrap only)\n omx team Spawn parallel worker panes in tmux and bootstrap inbox/task state\n omx ralph Launch Codex with ralph persistence mode active\n omx ultragoal Create, resume, and checkpoint durable multi-goal plans over Codex goal mode\n omx performance-goal\n Create, hand off, and gate evaluator-backed performance goals\n omx autoresearch-goal\n Create, hand off, and gate professor-critic research goals\n omx autoresearch [DEPRECATED] Use $autoresearch; direct CLI launch removed\n omx version Show version information\n omx tmux-hook Manage tmux prompt injection workaround (init|status|validate|test)\n omx hooks Manage hook plugins (init|status|validate|test)\n omx hud Show HUD statusline (--watch, --json, --preset=NAME)\n omx sidecar Show read-only team/multi-agent visualization (--watch, --json, --tmux)\n omx state Read/write/list OMX mode state via CLI parity surface\n omx notepad JSON CLI surface for OMX notepad operations\n omx project-memory\n JSON CLI surface for OMX project-memory operations\n omx trace JSON CLI surface for OMX trace operations\n omx code-intel\n JSON CLI surface for OMX code-intel operations\n omx wiki JSON CLI surface for OMX wiki operations\n omx mcp-serve Launch an OMX stdio MCP server target (plugin/runtime use)\n omx sparkshell <command> [args...]\n omx sparkshell --tmux-pane <pane-id> [--tail-lines <100-1000>]\n Run native sparkshell sidecar for direct command execution or explicit tmux-pane summarization\n (also used as an adaptive backend for qualifying read-only explore tasks)\n omx help Show this help message\n omx status Show active modes and state\n omx cancel Cancel active execution modes\n omx reasoning Show or set model reasoning effort (low|medium|high|xhigh)\n\nOptions:\n --yolo Launch Codex in yolo mode (shorthand for: omx launch --yolo)\n --high Launch Codex with high reasoning effort\n (shorthand for: -c model_reasoning_effort=\"high\")\n --xhigh Launch Codex with xhigh reasoning effort\n (shorthand for: -c model_reasoning_effort=\"xhigh\")\n --madmax DANGEROUS: bypass Codex approvals and sandbox\n (alias for --dangerously-bypass-approvals-and-sandbox)\n --spark Use the Codex spark model (~1.3x faster) for team workers only\n Workers get the configured low-complexity team model; leader model unchanged\n --madmax-spark spark model for workers + bypass approvals for leader and workers\n (shorthand for: --spark --madmax)\n --notify-temp Enable temporary notification routing for this run/session only\n --hotswap Run a direct Codex session that rotates auth slots on 429/quota and resumes\n --direct Launch the interactive leader directly without OMX tmux/HUD management\n --tmux Launch the interactive leader session in detached tmux\n --discord Select Discord provider for temporary notification mode\n --slack Select Slack provider for temporary notification mode\n --telegram Select Telegram provider for temporary notification mode\n --custom <name>\n Select custom/OpenClaw gateway name for temporary notification mode\n -w, --worktree[=<name>]\n Launch Codex in a git worktree (detached when no name is given)\n --force Force reinstall (overwrite existing files)\n --merge-agents\n Merge OMX-managed AGENTS.md sections into an existing AGENTS.md\n instead of overwriting user-authored content\n --dry-run Show what would be done without doing it\n --plugin Use Codex plugin delivery for omx setup and remove legacy OMX-managed user/project components\n --legacy Use legacy setup delivery for omx setup, overriding persisted plugin mode\n --install-mode <legacy|plugin>\n Explicit setup install mode (canonical form; --legacy/--plugin are aliases)\n --mcp <none|compat>\n Explicit setup MCP mode (default: none; compat enables first-party MCP compatibility and shared registry sync)\n --no-mcp Alias for --mcp=none\n --with-mcp Alias for --mcp=compat\n --keep-config Skip config.toml cleanup during uninstall\n --purge Remove .omx/ cache directory during uninstall\n --verbose Show detailed output\n --scope Setup scope for \"omx setup\" only:\n user | project\n\nLaunch policy:\n OMX_LAUNCH_POLICY=auto\n Use the default policy: detached tmux when supported, direct otherwise\n OMX_LAUNCH_POLICY=direct\n Run without OMX tmux/HUD management\n OMX_LAUNCH_POLICY=tmux\n Force OMX-managed detached tmux launch\n OMX_LAUNCH_POLICY=detached-tmux\n Force OMX-managed detached tmux launch\n CLI policy flags (--direct/--tmux) override OMX_LAUNCH_POLICY; the last flag before -- wins.\n Unset or empty OMX_LAUNCH_POLICY returns to auto/default behavior.\n Config files are intentionally not used for launch policy in this release.\n";
15
+ type CliCommand = "launch" | "exec" | "imagegen" | "setup" | "update" | "list" | "agents" | "agents-init" | "deepinit" | "uninstall" | "doctor" | "cleanup" | "auth" | "ask" | "question" | "adapt" | "explore" | "api" | "sparkshell" | "team" | "session" | "resume" | "version" | "tmux-hook" | "hooks" | "hud" | "sidecar" | "state" | "wiki" | "mcp-serve" | "status" | "cancel" | "help" | "reasoning" | "codex-native-hook" | string;
16
16
  export interface ResolvedCliInvocation {
17
17
  command: CliCommand;
18
18
  launchArgs: string[];
@@ -45,6 +45,8 @@ export declare function persistProjectLaunchRuntimeAuthState(runtimeCodexHome: s
45
45
  */
46
46
  export declare function prepareRuntimeCodexHomeForProjectLaunch(cwd: string, sessionId: string, projectCodexHome: string): Promise<string>;
47
47
  export declare function prepareCodexHomeForLaunch(cwd: string, sessionId: string, env?: NodeJS.ProcessEnv): Promise<PreparedCodexHomeForLaunch>;
48
+ export declare function persistProjectLaunchRuntimeProjectTrustState(runtimeCodexHome: string | undefined, projectCodexHome: string | undefined): Promise<void>;
49
+ export declare function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup?: string, projectCodexHomeForPersistence?: string): Promise<void>;
48
50
  export interface TmuxLaunchHealth {
49
51
  usable: boolean;
50
52
  reason?: string;
@@ -77,9 +79,15 @@ export declare function resolveDisposableWorktreeOmxRootForLaunch(ensuredWorktre
77
79
  enabled: false;
78
80
  } | undefined, env?: NodeJS.ProcessEnv): string | undefined;
79
81
  export declare function shouldAutoIsolateMadmaxLaunch(command: string, launchArgs: string[], env?: NodeJS.ProcessEnv): boolean;
80
- export declare function buildMadmaxDetachedLaunchContextKey(sourceCwd: string, argv: readonly string[]): string;
82
+ interface MadmaxDetachedLockRetryOptions {
83
+ maxAttempts?: number;
84
+ retryMs?: number;
85
+ }
86
+ export declare function buildMadmaxDetachedLaunchContextKey(sourceCwd: string, argv: readonly string[], runIdentity?: string): string;
87
+ export declare function withMadmaxDetachedContextLock<T>(runsRoot: string, contextKey: string, run: () => T, options?: MadmaxDetachedLockRetryOptions): T;
81
88
  export declare function createMadmaxIsolatedRoot(sourceCwd: string, argv: string[], env?: NodeJS.ProcessEnv): string;
82
89
  export declare function main(args: string[]): Promise<void>;
90
+ export declare function launchWithAuthHotswap(args: string[]): Promise<void>;
83
91
  export declare function launchWithHud(args: string[]): Promise<void>;
84
92
  export declare function execWithOverlay(args: string[]): Promise<void>;
85
93
  export declare function normalizeCodexLaunchArgs(args: string[]): string[];
@@ -136,6 +144,17 @@ interface PostLaunchModeCleanupDependencies {
136
144
  }
137
145
  export declare function cleanupPostLaunchModeStateFiles(cwd: string, sessionId: string, dependencies?: PostLaunchModeCleanupDependencies): Promise<void>;
138
146
  export declare function reapPostLaunchOrphanedMcpProcesses(dependencies?: PostLaunchCleanupDependencies): Promise<void>;
147
+ /**
148
+ * preLaunch: Prepare environment before Codex starts.
149
+ * 1. Best-effort launch-safe orphan cleanup for detached OMX MCP processes
150
+ * 2. Generate runtime overlay + write session-scoped model instructions file
151
+ * 3. Write session.json
152
+ *
153
+ * Automatic broad stale-session cleanup remains disabled here. Only detached
154
+ * OMX MCP processes without a live Codex ancestor are reaped so new launches
155
+ * do not accumulate stale processes from prior crashed/closed sessions.
156
+ */
157
+ export declare function preLaunch(cwd: string, sessionId: string, notifyTempContract?: NotifyTempContract, codexHomeOverride?: string, enableNotifyFallbackAuthority?: boolean, worktreeDirty?: boolean): Promise<void>;
139
158
  export declare function buildTmuxShellCommand(command: string, args: string[]): string;
140
159
  export declare function buildWindowsPromptCommand(command: string, args: string[]): string;
141
160
  /**
@@ -152,6 +171,11 @@ export declare function buildWindowsPromptCommand(command: string, args: string[
152
171
  export declare function shouldSourceTmuxPaneShellRc(env?: NodeJS.ProcessEnv): boolean;
153
172
  export declare function buildTmuxPaneCommand(command: string, args: string[], shellPath?: string | undefined, env?: NodeJS.ProcessEnv): string;
154
173
  export declare function buildDetachedWindowsBootstrapScript(sessionName: string, commandText: string, delayMs?: number, tmuxCommand?: string): string;
174
+ /**
175
+ * postLaunch: Clean up after Codex exits.
176
+ * Each step is independently fault-tolerant (try/catch per step).
177
+ */
178
+ export declare function postLaunch(cwd: string, sessionId: string, codexHomeOverride?: string, enableNotifyFallbackAuthority?: boolean, projectLocalCodexHomeForCleanup?: string): Promise<void>;
155
179
  export declare function runDetachedSessionPostLaunch(cwd: string, sessionId: string, codexHomeOverride?: string, projectLocalCodexHomeForCleanup?: string, runtimeCodexHomeForCleanup?: string): Promise<void>;
156
180
  export declare function shouldDetachBackgroundHelper(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
157
181
  export type BackgroundHelperLaunchMode = "direct-detached" | "windows-msys-bootstrap";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAcpB,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAoCtB,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,iBAAiB,CAAC;AA6CzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAY1E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAqB5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C,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC;IAC/D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACjE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,wBAAwB,CAAC,CAoCnC"}
package/dist/cli/index.js CHANGED
@@ -35,6 +35,8 @@ import { mcpParityCommand } from "./mcp-parity.js";
35
35
  import { mcpServeCommand } from "./mcp-serve.js";
36
36
  import { adaptCommand } from "./adapt.js";
37
37
  import { listCommand } from "./list.js";
38
+ import { authCommand } from "./auth.js";
39
+ import { runAuthHotswap } from "../auth/hotswap.js";
38
40
  import { MADMAX_FLAG, CODEX_BYPASS_FLAG, HIGH_REASONING_FLAG, XHIGH_REASONING_FLAG, SPARK_FLAG, MADMAX_SPARK_FLAG, CONFIG_FLAG, LONG_CONFIG_FLAG, } from "./constants.js";
39
41
  import { getBaseStateDir, getStateDir, listModeStateFilesWithScopePreference, } from "../mcp/state-paths.js";
40
42
  import { evaluateRalphCompletionAuditEvidence, isRalphCompletePhase } from "../ralph/completion-audit.js";
@@ -49,11 +51,11 @@ import { readSessionState, writeSessionStart, writeSessionEnd, resetSessionMetri
49
51
  import { buildClientAttachedReconcileHookName, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, mitigateCopyModeUnderlineArtifacts, } from "../team/tmux-session.js";
50
52
  import { getPackageRoot } from "../utils/package.js";
51
53
  import { codexConfigPath, omxRoot, rememberOmxLaunchContext, resolveOmxEntryPath } from "../utils/paths.js";
52
- import { cleanCodexModelAvailabilityNuxIfNeeded, extractSharedMcpRegistryServersFromConfig, repairConfigIfNeeded, upsertManagedCodexHookTrustState } from "../config/generator.js";
54
+ import { cleanCodexModelAvailabilityNuxIfNeeded, extractSharedMcpRegistryServersFromConfig, repairConfigIfNeeded, syncProjectScopeTrustStateFromRuntime } from "../config/generator.js";
53
55
  import { OMX_FIRST_PARTY_MCP_SERVER_NAMES } from "../config/omx-first-party-mcp.js";
54
56
  import { HUD_TMUX_HEIGHT_LINES } from "../hud/constants.js";
55
57
  import { OMX_TMUX_HUD_OWNER_ENV } from "../hud/reconcile.js";
56
- import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, parsePaneIdFromTmuxOutput, registerHudResizeHook, } from "../hud/tmux.js";
58
+ import { createHudWatchPane as createSharedHudWatchPane, killTmuxPane as killSharedTmuxPane, listCurrentWindowHudPaneIds, listCurrentWindowPanes, OMX_TMUX_HUD_LEADER_PANE_ENV, parsePaneIdFromTmuxOutput, reapDeadHudPanes, registerHudResizeHook, } from "../hud/tmux.js";
57
59
  export { parseTmuxPaneSnapshot, isHudWatchPane, findHudWatchPaneIds } from "../hud/tmux.js";
58
60
  rememberOmxLaunchContext();
59
61
  import { classifySpawnError, resolveTmuxBinaryForPlatform, spawnPlatformCommandSync, } from "../utils/platform-command.js";
@@ -96,6 +98,7 @@ Usage:
96
98
  omx cleanup Kill orphaned OMX MCP server processes and remove stale OMX /tmp directories
97
99
  omx doctor --team Check team/swarm runtime health diagnostics
98
100
  omx ask Ask local provider CLI (claude|gemini) and write artifact output
101
+ omx auth Manage Codex OAuth auth slots (add|list|use)
99
102
  omx question OMX-owned blocking question UI entrypoint for agent-invoked user questions
100
103
  omx adapt Scaffold OMX-owned adapter foundations for persistent external targets
101
104
  omx resume Resume a previous interactive Codex session
@@ -151,6 +154,7 @@ Options:
151
154
  --madmax-spark spark model for workers + bypass approvals for leader and workers
152
155
  (shorthand for: --spark --madmax)
153
156
  --notify-temp Enable temporary notification routing for this run/session only
157
+ --hotswap Run a direct Codex session that rotates auth slots on 429/quota and resumes
154
158
  --direct Launch the interactive leader directly without OMX tmux/HUD management
155
159
  --tmux Launch the interactive leader session in detached tmux
156
160
  --discord Select Discord provider for temporary notification mode
@@ -233,7 +237,9 @@ const NESTED_HELP_COMMANDS = new Set([
233
237
  "ask",
234
238
  "question",
235
239
  "cleanup",
240
+ "auth",
236
241
  "adapt",
242
+ "explore",
237
243
  "autoresearch",
238
244
  "autoresearch-goal",
239
245
  "agents",
@@ -485,6 +491,11 @@ const PROJECT_LAUNCH_PERSISTED_RUNTIME_ENTRY_NAMES = new Set([
485
491
  // log the contents.
486
492
  "auth.json",
487
493
  ]);
494
+ // Mirroring these files into the runtime CODEX_HOME would cause Codex to load
495
+ // them as user-scope config alongside the canonical project-scope copies under
496
+ // <cwd>/.codex, duplicating every native hook and asking the user to re-trust
497
+ // hooks on every launch. See GH issue #2470.
498
+ const PROJECT_LAUNCH_RUNTIME_SKIPPED_ENTRY_NAMES = new Set(["hooks.json"]);
488
499
  function shouldPersistProjectLaunchRuntimeEntry(entryName) {
489
500
  return PROJECT_LAUNCH_PERSISTED_RUNTIME_ENTRY_NAMES.has(entryName);
490
501
  }
@@ -515,22 +526,16 @@ export async function prepareRuntimeCodexHomeForProjectLaunch(cwd, sessionId, pr
515
526
  for (const entry of await readdir(projectCodexHome, { withFileTypes: true })) {
516
527
  if (isCodexSqliteArtifact(entry.name))
517
528
  continue;
529
+ if (PROJECT_LAUNCH_RUNTIME_SKIPPED_ENTRY_NAMES.has(entry.name))
530
+ continue;
518
531
  const source = join(projectCodexHome, entry.name);
519
532
  const destination = join(runtimeCodexHome, entry.name);
520
- if (entry.name === "config.toml" || entry.name === "hooks.json") {
533
+ if (entry.name === "config.toml") {
521
534
  await copyFile(source, destination);
522
535
  continue;
523
536
  }
524
537
  await linkOrCopyCodexHomeEntry(source, destination);
525
538
  }
526
- const runtimeConfigPath = join(runtimeCodexHome, "config.toml");
527
- const runtimeHooksPath = join(runtimeCodexHome, "hooks.json");
528
- if (existsSync(runtimeConfigPath) && existsSync(runtimeHooksPath)) {
529
- const runtimeConfig = await readFile(runtimeConfigPath, "utf-8");
530
- if (runtimeConfig.includes("# OMX-owned Codex hook trust state")) {
531
- await writeFile(runtimeConfigPath, upsertManagedCodexHookTrustState(runtimeConfig, getPackageRoot(), runtimeHooksPath), "utf-8");
532
- }
533
- }
534
539
  return runtimeCodexHome;
535
540
  }
536
541
  function resolveProjectSqliteHomeForLaunch(projectCodexHome, env) {
@@ -555,10 +560,29 @@ export async function prepareCodexHomeForLaunch(cwd, sessionId, env = process.en
555
560
  projectLocalCodexHomeForCleanup,
556
561
  };
557
562
  }
558
- async function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence) {
563
+ export async function persistProjectLaunchRuntimeProjectTrustState(runtimeCodexHome, projectCodexHome) {
564
+ if (!runtimeCodexHome || !projectCodexHome)
565
+ return;
566
+ const runtimeConfigPath = join(runtimeCodexHome, "config.toml");
567
+ if (!existsSync(runtimeConfigPath))
568
+ return;
569
+ const projectConfigPath = join(projectCodexHome, "config.toml");
570
+ const runtimeConfig = await readFile(runtimeConfigPath, "utf-8");
571
+ const projectConfig = existsSync(projectConfigPath)
572
+ ? await readFile(projectConfigPath, "utf-8")
573
+ : "";
574
+ const projectHooksPath = join(projectCodexHome, "hooks.json");
575
+ const nextProjectConfig = syncProjectScopeTrustStateFromRuntime(projectConfig, runtimeConfig, projectHooksPath);
576
+ if (nextProjectConfig !== projectConfig) {
577
+ await mkdir(projectCodexHome, { recursive: true });
578
+ await writeFile(projectConfigPath, nextProjectConfig, "utf-8");
579
+ }
580
+ }
581
+ export async function cleanupRuntimeCodexHome(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence) {
559
582
  if (!runtimeCodexHomeForCleanup)
560
583
  return;
561
584
  await persistProjectLaunchRuntimeAuthState(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence);
585
+ await persistProjectLaunchRuntimeProjectTrustState(runtimeCodexHomeForCleanup, projectCodexHomeForPersistence);
562
586
  await rm(runtimeCodexHomeForCleanup, { recursive: true, force: true });
563
587
  }
564
588
  function execTmuxFileSync(args, options) {
@@ -878,10 +902,15 @@ function normalizeMadmaxDetachedLaunchArgv(argv) {
878
902
  ...passthrough,
879
903
  ];
880
904
  }
881
- export function buildMadmaxDetachedLaunchContextKey(sourceCwd, argv) {
905
+ export function buildMadmaxDetachedLaunchContextKey(sourceCwd, argv, runIdentity = "") {
906
+ // The boxed run root is part of the lock identity for auto-isolated madmax
907
+ // launches. That lets independent `omx --madmax --high` sessions share the
908
+ // same source cwd/argv without contending on one active-detached lock, while
909
+ // callers that intentionally reuse the same boxed context keep one key.
882
910
  const payload = JSON.stringify({
883
911
  source_cwd: canonicalizeLaunchCwd(sourceCwd),
884
912
  argv: normalizeMadmaxDetachedLaunchArgv(argv),
913
+ run_identity: runIdentity,
885
914
  });
886
915
  return createHash("sha256").update(payload).digest("hex").slice(0, 32);
887
916
  }
@@ -925,13 +954,90 @@ function detachedTmuxSessionExists(sessionName) {
925
954
  return false;
926
955
  }
927
956
  }
928
- function withMadmaxDetachedContextLock(runsRoot, contextKey, run) {
957
+ function readMadmaxDetachedLockOwner(lockPath) {
958
+ try {
959
+ const parsed = JSON.parse(readFileSync(join(lockPath, "owner.json"), "utf-8"));
960
+ if (parsed.version !== 1 ||
961
+ typeof parsed.pid !== "number" ||
962
+ !Number.isSafeInteger(parsed.pid) ||
963
+ parsed.pid <= 0 ||
964
+ typeof parsed.context_key !== "string" ||
965
+ typeof parsed.acquired_at !== "string") {
966
+ return null;
967
+ }
968
+ return {
969
+ version: 1,
970
+ pid: parsed.pid,
971
+ context_key: parsed.context_key,
972
+ acquired_at: parsed.acquired_at,
973
+ };
974
+ }
975
+ catch {
976
+ return null;
977
+ }
978
+ }
979
+ function readMadmaxDetachedLockPid(lockPath) {
980
+ const owner = readMadmaxDetachedLockOwner(lockPath);
981
+ if (owner)
982
+ return owner.pid;
983
+ try {
984
+ const holderPid = Number.parseInt(readFileSync(join(lockPath, "pid"), "utf-8").trim(), 10);
985
+ return Number.isSafeInteger(holderPid) && holderPid > 0 ? holderPid : null;
986
+ }
987
+ catch {
988
+ return null;
989
+ }
990
+ }
991
+ function inspectMadmaxDetachedContextLock(lockPath) {
992
+ const lockStat = statSync(lockPath, { throwIfNoEntry: false });
993
+ if (!lockStat) {
994
+ return { stale: false, diagnostic: "lock disappeared while waiting" };
995
+ }
996
+ const ageMs = Math.max(0, Date.now() - lockStat.mtimeMs);
997
+ const owner = readMadmaxDetachedLockOwner(lockPath);
998
+ const holderPid = owner?.pid ?? readMadmaxDetachedLockPid(lockPath);
999
+ if (holderPid) {
1000
+ if (!isProcessAlive(holderPid)) {
1001
+ return {
1002
+ stale: true,
1003
+ diagnostic: `stale holder pid ${holderPid} is not running; lock age ${Math.round(ageMs)}ms`,
1004
+ };
1005
+ }
1006
+ const ownerContext = owner ? `, owner context ${owner.context_key}` : ", legacy pid-only lock";
1007
+ const sameDirectoryGuidance = "Another madmax detached launch is active for this directory; close the existing madmax session or use --worktree for concurrent work. Multiple madmax sessions in one directory are unsafe";
1008
+ return {
1009
+ stale: false,
1010
+ diagnostic: `holder pid ${holderPid} is still running${ownerContext}; lock age ${Math.round(ageMs)}ms. ${sameDirectoryGuidance}`,
1011
+ };
1012
+ }
1013
+ if (ageMs > MADMAX_DETACHED_LOCK_STALE_MS) {
1014
+ return {
1015
+ stale: true,
1016
+ diagnostic: `legacy lock has no readable owner pid and is older than ${MADMAX_DETACHED_LOCK_STALE_MS}ms; lock age ${Math.round(ageMs)}ms`,
1017
+ };
1018
+ }
1019
+ return {
1020
+ stale: false,
1021
+ diagnostic: `lock has no readable owner pid yet; lock age ${Math.round(ageMs)}ms`,
1022
+ };
1023
+ }
1024
+ export function withMadmaxDetachedContextLock(runsRoot, contextKey, run, options = {}) {
929
1025
  const lockPath = join(runsRoot, MADMAX_DETACHED_ACTIVE_DIR, `${contextKey}.lock`);
1026
+ const maxAttempts = options.maxAttempts ?? MADMAX_DETACHED_LOCK_MAX_ATTEMPTS;
1027
+ const retryMs = options.retryMs ?? MADMAX_DETACHED_LOCK_RETRY_MS;
1028
+ let lastDiagnostic = "lock was busy";
930
1029
  mkdirSync(dirname(lockPath), { recursive: true });
931
- for (let attempt = 0; attempt < MADMAX_DETACHED_LOCK_MAX_ATTEMPTS; attempt++) {
1030
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
932
1031
  try {
933
1032
  mkdirSync(lockPath);
934
1033
  try {
1034
+ const owner = {
1035
+ version: 1,
1036
+ pid: process.pid,
1037
+ context_key: contextKey,
1038
+ acquired_at: new Date().toISOString(),
1039
+ };
1040
+ writeFileSync(join(lockPath, "owner.json"), `${JSON.stringify(owner, null, 2)}\n`, { mode: 0o600 });
935
1041
  writeFileSync(join(lockPath, "pid"), String(process.pid));
936
1042
  return run();
937
1043
  }
@@ -945,28 +1051,16 @@ function withMadmaxDetachedContextLock(runsRoot, contextKey, run) {
945
1051
  : "";
946
1052
  if (code !== "EEXIST")
947
1053
  throw err;
948
- const lockStat = statSync(lockPath, { throwIfNoEntry: false });
949
- if (lockStat && Date.now() - lockStat.mtimeMs > MADMAX_DETACHED_LOCK_STALE_MS) {
950
- let holderAlive = false;
951
- try {
952
- const holderPid = Number.parseInt(readFileSync(join(lockPath, "pid"), "utf-8").trim(), 10);
953
- if (Number.isSafeInteger(holderPid) && holderPid > 0) {
954
- process.kill(holderPid, 0);
955
- holderAlive = true;
956
- }
957
- }
958
- catch {
959
- holderAlive = false;
960
- }
961
- if (!holderAlive) {
962
- rmSync(lockPath, { recursive: true, force: true });
963
- continue;
964
- }
1054
+ const inspection = inspectMadmaxDetachedContextLock(lockPath);
1055
+ lastDiagnostic = inspection.diagnostic;
1056
+ if (inspection.stale) {
1057
+ rmSync(lockPath, { recursive: true, force: true });
1058
+ continue;
965
1059
  }
966
- blockMs(MADMAX_DETACHED_LOCK_RETRY_MS);
1060
+ blockMs(retryMs);
967
1061
  }
968
1062
  }
969
- throw new MadmaxDetachedGuardError(`timed out waiting for madmax detached launch context lock: ${lockPath}`);
1063
+ throw new MadmaxDetachedGuardError(`timed out waiting for madmax detached launch context lock: ${lockPath} (${lastDiagnostic})`);
970
1064
  }
971
1065
  function isMadmaxDetachedGuardEnabled(env) {
972
1066
  return env.OMXBOX_ACTIVE === "1" && typeof env[OMX_MADMAX_DETACHED_CONTEXT_ENV] === "string";
@@ -997,7 +1091,7 @@ export function createMadmaxIsolatedRoot(sourceCwd, argv, env = process.env) {
997
1091
  const suffix = Math.random().toString(16).slice(2, 6);
998
1092
  const runDir = join(runsRoot, sanitizeRunIdSegment(`run-${stamp}-${suffix}`));
999
1093
  mkdirSync(runDir, { recursive: false });
1000
- const detachedLaunchContext = buildMadmaxDetachedLaunchContextKey(sourceCwd, argv);
1094
+ const detachedLaunchContext = buildMadmaxDetachedLaunchContextKey(sourceCwd, argv, runDir);
1001
1095
  const metadata = {
1002
1096
  launcher: "omx --madmax",
1003
1097
  created_at: new Date().toISOString(),
@@ -1034,6 +1128,7 @@ export async function main(args) {
1034
1128
  "uninstall",
1035
1129
  "doctor",
1036
1130
  "cleanup",
1131
+ "auth",
1037
1132
  "ask",
1038
1133
  "question",
1039
1134
  "autoresearch",
@@ -1078,7 +1173,12 @@ export async function main(args) {
1078
1173
  try {
1079
1174
  switch (command) {
1080
1175
  case "launch":
1081
- await launchWithHud(launchArgs);
1176
+ if (launchArgs.includes("--hotswap")) {
1177
+ await launchWithAuthHotswap(launchArgs);
1178
+ }
1179
+ else {
1180
+ await launchWithHud(launchArgs);
1181
+ }
1082
1182
  break;
1083
1183
  case "resume":
1084
1184
  await launchWithHud(["resume", ...launchArgs]);
@@ -1135,6 +1235,9 @@ export async function main(args) {
1135
1235
  case "cleanup":
1136
1236
  await cleanupCommand(args.slice(1));
1137
1237
  break;
1238
+ case "auth":
1239
+ await authCommand(args.slice(1));
1240
+ break;
1138
1241
  case "autoresearch":
1139
1242
  await autoresearchCommand(args.slice(1));
1140
1243
  break;
@@ -1310,6 +1413,75 @@ async function reasoningCommand(args) {
1310
1413
  await writeFile(configPath, updated);
1311
1414
  console.log(`Set ${REASONING_KEY}="${mode}" in ${configPath}`);
1312
1415
  }
1416
+ export async function launchWithAuthHotswap(args) {
1417
+ const launchCwd = process.cwd();
1418
+ const parsedWorktree = parseWorktreeMode(args);
1419
+ let cwd = launchCwd;
1420
+ let worktreeDirty = false;
1421
+ let ensuredLaunchWorktree;
1422
+ if (parsedWorktree.mode.enabled) {
1423
+ const planned = planWorktreeTarget({
1424
+ cwd: launchCwd,
1425
+ scope: "launch",
1426
+ mode: parsedWorktree.mode,
1427
+ });
1428
+ const ensured = ensureWorktree(planned, { allowDirtyReuse: true });
1429
+ ensuredLaunchWorktree = ensured;
1430
+ if (ensured.enabled) {
1431
+ cwd = ensured.worktreePath;
1432
+ worktreeDirty = Boolean(ensured.dirty);
1433
+ if (ensured.dirty) {
1434
+ process.stderr.write(`[omx] Caution: worktree at ${cwd} has uncommitted changes.\n` +
1435
+ ` The hotswap session will launch as-is.\n`);
1436
+ }
1437
+ const depBootstrap = ensureReusableNodeModules(cwd);
1438
+ if (depBootstrap.strategy === "symlink") {
1439
+ console.log(`[omx] Reusing node_modules from ${depBootstrap.sourceNodeModulesPath}`);
1440
+ }
1441
+ else if (depBootstrap.strategy === "missing" && depBootstrap.warning) {
1442
+ console.warn(`[omx] ${depBootstrap.warning}`);
1443
+ }
1444
+ }
1445
+ }
1446
+ applyDisposableWorktreeOmxRootForLaunch(ensuredLaunchWorktree);
1447
+ try {
1448
+ await maybeCheckAndPromptUpdate(cwd);
1449
+ }
1450
+ catch (err) {
1451
+ logCliOperationFailure(err);
1452
+ }
1453
+ try {
1454
+ await maybePromptGithubStar();
1455
+ }
1456
+ catch (err) {
1457
+ logCliOperationFailure(err);
1458
+ }
1459
+ try {
1460
+ const configPath = resolveCodexConfigPathForLaunch(launchCwd, process.env);
1461
+ const repaired = await repairConfigIfNeeded(configPath, getPackageRoot(), await resolveLaunchConfigRepairOptions(launchCwd, configPath));
1462
+ if (repaired)
1463
+ console.log("[omx] Repaired managed config.toml compatibility issue.");
1464
+ }
1465
+ catch {
1466
+ // Non-fatal: repair failure must not block launch
1467
+ }
1468
+ const status = await runAuthHotswap({
1469
+ cwd,
1470
+ argv: parsedWorktree.remainingArgs,
1471
+ lifecycle: {
1472
+ prepareCodexHomeForLaunch,
1473
+ preLaunch: (launchPath, sessionId, notifyTempContract, codexHomeOverride, enableAuthority) => preLaunch(launchPath, sessionId, notifyTempContract, codexHomeOverride, enableAuthority, worktreeDirty),
1474
+ postLaunch,
1475
+ cleanupRuntimeCodexHome,
1476
+ normalizeCodexLaunchArgs,
1477
+ injectModelInstructionsBypassArgs,
1478
+ sessionModelInstructionsPath,
1479
+ resolveOmxRootForLaunch,
1480
+ resolveNotifyTempContract,
1481
+ },
1482
+ });
1483
+ process.exitCode = status;
1484
+ }
1313
1485
  export async function launchWithHud(args) {
1314
1486
  if (isNativeWindows()) {
1315
1487
  const { result } = spawnPlatformCommandSync("tmux", ["-V"], {
@@ -2743,7 +2915,7 @@ export async function reapPostLaunchOrphanedMcpProcesses(dependencies = {}) {
2743
2915
  * OMX MCP processes without a live Codex ancestor are reaped so new launches
2744
2916
  * do not accumulate stale processes from prior crashed/closed sessions.
2745
2917
  */
2746
- async function preLaunch(cwd, sessionId, notifyTempContract, codexHomeOverride, enableNotifyFallbackAuthority = false, worktreeDirty = false) {
2918
+ export async function preLaunch(cwd, sessionId, notifyTempContract, codexHomeOverride, enableNotifyFallbackAuthority = false, worktreeDirty = false) {
2747
2919
  // 1. Best-effort launch-safe orphan cleanup
2748
2920
  try {
2749
2921
  const cleanup = await cleanupLaunchOrphanedMcpProcesses();
@@ -2847,12 +3019,19 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
2847
3019
  if (!omxBin) {
2848
3020
  throw new Error("Unable to resolve OMX launcher path for tmux HUD bootstrap");
2849
3021
  }
3022
+ const omxRootOverride = resolveOmxRootForLaunch(cwd, process.env);
3023
+ const currentPaneId = process.env.TMUX_PANE;
3024
+ const hudEnvArgs = [
3025
+ `OMX_SESSION_ID=${sessionId}`,
3026
+ `${OMX_TMUX_HUD_OWNER_ENV}=1`,
3027
+ ...(currentPaneId ? [`${OMX_TMUX_HUD_LEADER_PANE_ENV}=${currentPaneId}`] : []),
3028
+ ...(omxRootOverride ? [`OMX_ROOT=${omxRootOverride}`] : []),
3029
+ ];
2850
3030
  const hudCmd = nativeWindows
2851
3031
  ? buildWindowsPromptCommand("node", [omxBin, "hud", "--watch"])
2852
- : buildTmuxPaneCommand("env", [`OMX_SESSION_ID=${sessionId}`, `${OMX_TMUX_HUD_OWNER_ENV}=1`, "node", omxBin, "hud", "--watch"]);
3032
+ : buildTmuxPaneCommand("env", [...hudEnvArgs, "node", omxBin, "hud", "--watch"]);
2853
3033
  const inheritLeaderFlags = process.env[TEAM_INHERIT_LEADER_FLAGS_ENV] !== "0";
2854
3034
  const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV], launchArgs, inheritLeaderFlags, workerDefaultModel);
2855
- const omxRootOverride = resolveOmxRootForLaunch(cwd, process.env);
2856
3035
  const codexBaseEnv = {
2857
3036
  ...process.env,
2858
3037
  ...(codexHomeOverride ? { CODEX_HOME: codexHomeOverride } : {}),
@@ -2877,14 +3056,30 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
2877
3056
  }
2878
3057
  if (launchPolicy === "inside-tmux") {
2879
3058
  // Already in tmux: launch codex in current pane, HUD in bottom split
2880
- const currentPaneId = process.env.TMUX_PANE;
2881
- const staleHudPaneIds = listHudWatchPaneIdsInCurrentWindow(currentPaneId);
3059
+ const currentWindowPanes = currentPaneId ? listCurrentWindowPanes(undefined, currentPaneId) : [];
3060
+ reapDeadHudPanes(currentWindowPanes, {
3061
+ killPane: (paneId) => {
3062
+ try {
3063
+ return killSharedTmuxPane(paneId);
3064
+ }
3065
+ catch (err) {
3066
+ logCliOperationFailure(err);
3067
+ return false;
3068
+ }
3069
+ },
3070
+ });
3071
+ const staleHudPaneIds = currentPaneId
3072
+ ? listHudWatchPaneIdsInCurrentWindow(currentPaneId, { leaderPaneId: currentPaneId })
3073
+ : [];
2882
3074
  for (const paneId of staleHudPaneIds) {
2883
3075
  killTmuxPane(paneId);
2884
3076
  }
2885
3077
  let hudPaneId = null;
2886
3078
  try {
2887
- hudPaneId = createHudWatchPane(cwd, hudCmd);
3079
+ hudPaneId = createHudWatchPane(cwd, hudCmd, {
3080
+ heightLines: HUD_TMUX_HEIGHT_LINES,
3081
+ targetPaneId: currentPaneId,
3082
+ });
2888
3083
  if (hudPaneId && currentPaneId) {
2889
3084
  registerHudResizeHook(hudPaneId, currentPaneId, HUD_TMUX_HEIGHT_LINES);
2890
3085
  }
@@ -3114,17 +3309,20 @@ function runCodex(cwd, args, sessionId, workerDefaultModel, codexHomeOverride, s
3114
3309
  }
3115
3310
  }
3116
3311
  }
3117
- function listHudWatchPaneIdsInCurrentWindow(currentPaneId) {
3312
+ function listHudWatchPaneIdsInCurrentWindow(currentPaneId, owner = {}) {
3118
3313
  try {
3119
- return listCurrentWindowHudPaneIds(currentPaneId);
3314
+ return listCurrentWindowHudPaneIds(currentPaneId, undefined, owner);
3120
3315
  }
3121
3316
  catch (err) {
3122
3317
  logCliOperationFailure(err);
3123
3318
  return [];
3124
3319
  }
3125
3320
  }
3126
- function createHudWatchPane(cwd, hudCmd) {
3127
- return createSharedHudWatchPane(cwd, hudCmd, { heightLines: HUD_TMUX_HEIGHT_LINES });
3321
+ function createHudWatchPane(cwd, hudCmd, options = {}) {
3322
+ return createSharedHudWatchPane(cwd, hudCmd, {
3323
+ heightLines: options.heightLines ?? HUD_TMUX_HEIGHT_LINES,
3324
+ targetPaneId: options.targetPaneId,
3325
+ });
3128
3326
  }
3129
3327
  function killTmuxPane(paneId) {
3130
3328
  if (!paneId.startsWith("%"))
@@ -3222,7 +3420,7 @@ function scheduleDetachedWindowsCodexLaunch(sessionName, commandText) {
3222
3420
  * postLaunch: Clean up after Codex exits.
3223
3421
  * Each step is independently fault-tolerant (try/catch per step).
3224
3422
  */
3225
- async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority = false, projectLocalCodexHomeForCleanup) {
3423
+ export async function postLaunch(cwd, sessionId, codexHomeOverride, enableNotifyFallbackAuthority = false, projectLocalCodexHomeForCleanup) {
3226
3424
  // Capture session start time before cleanup (writeSessionEnd deletes session.json)
3227
3425
  let sessionStartedAt;
3228
3426
  try {