oh-my-codex 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (533) hide show
  1. package/Cargo.lock +5 -5
  2. package/Cargo.toml +1 -1
  3. package/README.md +36 -5
  4. package/crates/omx-explore/src/main.rs +222 -12
  5. package/dist/agents/__tests__/native-config.test.js +40 -0
  6. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  7. package/dist/agents/native-config.d.ts +1 -0
  8. package/dist/agents/native-config.d.ts.map +1 -1
  9. package/dist/agents/native-config.js +6 -1
  10. package/dist/agents/native-config.js.map +1 -1
  11. package/dist/agents/policy.d.ts +1 -0
  12. package/dist/agents/policy.d.ts.map +1 -1
  13. package/dist/agents/policy.js +4 -0
  14. package/dist/agents/policy.js.map +1 -1
  15. package/dist/cli/__tests__/autoresearch-guided.test.js +37 -13
  16. package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -1
  17. package/dist/cli/__tests__/codex-plugin-layout.test.js +1 -1
  18. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
  19. package/dist/cli/__tests__/doctor-team.test.js +46 -1
  20. package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
  21. package/dist/cli/__tests__/doctor-warning-copy.test.js +225 -111
  22. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  23. package/dist/cli/__tests__/exec.test.js +96 -1
  24. package/dist/cli/__tests__/exec.test.js.map +1 -1
  25. package/dist/cli/__tests__/explore.test.js +15 -2
  26. package/dist/cli/__tests__/explore.test.js.map +1 -1
  27. package/dist/cli/__tests__/index.test.js +292 -3
  28. package/dist/cli/__tests__/index.test.js.map +1 -1
  29. package/dist/cli/__tests__/launch-fallback.test.js +223 -0
  30. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  31. package/dist/cli/__tests__/mcp-parity.test.js +86 -0
  32. package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
  33. package/dist/cli/__tests__/package-bin-contract.test.js +23 -0
  34. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  35. package/dist/cli/__tests__/question.test.js +76 -11
  36. package/dist/cli/__tests__/question.test.js.map +1 -1
  37. package/dist/cli/__tests__/setup-agents-overwrite.test.js +140 -1
  38. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  39. package/dist/cli/__tests__/setup-install-mode.test.js +310 -4
  40. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  41. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +78 -19
  42. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
  43. package/dist/cli/__tests__/setup-refresh.test.js +79 -2
  44. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  45. package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
  46. package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
  47. package/dist/cli/__tests__/sidecar.test.js +24 -0
  48. package/dist/cli/__tests__/sidecar.test.js.map +1 -0
  49. package/dist/cli/__tests__/team.test.js +54 -7
  50. package/dist/cli/__tests__/team.test.js.map +1 -1
  51. package/dist/cli/autoresearch-guided.d.ts.map +1 -1
  52. package/dist/cli/autoresearch-guided.js +12 -4
  53. package/dist/cli/autoresearch-guided.js.map +1 -1
  54. package/dist/cli/codex-home.d.ts +4 -6
  55. package/dist/cli/codex-home.d.ts.map +1 -1
  56. package/dist/cli/codex-home.js +9 -41
  57. package/dist/cli/codex-home.js.map +1 -1
  58. package/dist/cli/doctor.d.ts +1 -1
  59. package/dist/cli/doctor.d.ts.map +1 -1
  60. package/dist/cli/doctor.js +509 -279
  61. package/dist/cli/doctor.js.map +1 -1
  62. package/dist/cli/index.d.ts +6 -4
  63. package/dist/cli/index.d.ts.map +1 -1
  64. package/dist/cli/index.js +284 -25
  65. package/dist/cli/index.js.map +1 -1
  66. package/dist/cli/omx.js +3 -1
  67. package/dist/cli/omx.js.map +1 -1
  68. package/dist/cli/plugin-marketplace.d.ts +13 -0
  69. package/dist/cli/plugin-marketplace.d.ts.map +1 -0
  70. package/dist/cli/plugin-marketplace.js +77 -0
  71. package/dist/cli/plugin-marketplace.js.map +1 -0
  72. package/dist/cli/question.d.ts +1 -1
  73. package/dist/cli/question.d.ts.map +1 -1
  74. package/dist/cli/question.js +26 -12
  75. package/dist/cli/question.js.map +1 -1
  76. package/dist/cli/setup-preferences.d.ts +20 -0
  77. package/dist/cli/setup-preferences.d.ts.map +1 -0
  78. package/dist/cli/setup-preferences.js +71 -0
  79. package/dist/cli/setup-preferences.js.map +1 -0
  80. package/dist/cli/setup.d.ts +7 -5
  81. package/dist/cli/setup.d.ts.map +1 -1
  82. package/dist/cli/setup.js +271 -152
  83. package/dist/cli/setup.js.map +1 -1
  84. package/dist/cli/team.d.ts +1 -0
  85. package/dist/cli/team.d.ts.map +1 -1
  86. package/dist/cli/team.js +70 -15
  87. package/dist/cli/team.js.map +1 -1
  88. package/dist/config/__tests__/generator-idempotent.test.js +100 -3
  89. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  90. package/dist/config/__tests__/generator-notify.test.js +6 -5
  91. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  92. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
  93. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
  94. package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
  95. package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
  96. package/dist/config/__tests__/models.test.js +23 -1
  97. package/dist/config/__tests__/models.test.js.map +1 -1
  98. package/dist/config/generator.d.ts +9 -1
  99. package/dist/config/generator.d.ts.map +1 -1
  100. package/dist/config/generator.js +184 -16
  101. package/dist/config/generator.js.map +1 -1
  102. package/dist/config/models.d.ts +5 -1
  103. package/dist/config/models.d.ts.map +1 -1
  104. package/dist/config/models.js +12 -2
  105. package/dist/config/models.js.map +1 -1
  106. package/dist/exec/followup.d.ts +44 -0
  107. package/dist/exec/followup.d.ts.map +1 -0
  108. package/dist/exec/followup.js +349 -0
  109. package/dist/exec/followup.js.map +1 -0
  110. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +2 -0
  111. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +1 -0
  112. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +37 -0
  113. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -0
  114. package/dist/hooks/__tests__/codebase-map.test.js +63 -1
  115. package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
  116. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +1 -1
  117. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +5 -5
  118. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
  119. package/dist/hooks/__tests__/deep-interview-contract.test.js +12 -9
  120. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  121. package/dist/hooks/__tests__/keyword-detector.test.js +25 -18
  122. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  123. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -2
  124. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
  125. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +45 -2
  126. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  127. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +17 -0
  128. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
  129. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +121 -0
  130. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
  131. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +4 -4
  132. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
  133. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +103 -0
  134. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
  135. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +2 -2
  136. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
  137. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +27 -13
  138. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
  139. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
  140. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
  141. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
  142. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
  143. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +215 -0
  144. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
  145. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +70 -3
  146. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
  147. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +5 -0
  148. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
  149. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +3 -2
  150. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
  151. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +9 -0
  152. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  153. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
  154. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
  155. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
  156. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
  157. package/dist/hooks/codebase-map.d.ts.map +1 -1
  158. package/dist/hooks/codebase-map.js +83 -6
  159. package/dist/hooks/codebase-map.js.map +1 -1
  160. package/dist/hooks/keyword-detector.d.ts +1 -1
  161. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  162. package/dist/hooks/keyword-detector.js +35 -4
  163. package/dist/hooks/keyword-detector.js.map +1 -1
  164. package/dist/hooks/prompt-guidance-contract.d.ts +6 -0
  165. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  166. package/dist/hooks/prompt-guidance-contract.js +117 -13
  167. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  168. package/dist/hooks/session.d.ts +2 -0
  169. package/dist/hooks/session.d.ts.map +1 -1
  170. package/dist/hooks/session.js +6 -0
  171. package/dist/hooks/session.js.map +1 -1
  172. package/dist/hud/__tests__/index.test.js +4 -4
  173. package/dist/hud/__tests__/index.test.js.map +1 -1
  174. package/dist/hud/__tests__/state.test.js +4 -0
  175. package/dist/hud/__tests__/state.test.js.map +1 -1
  176. package/dist/hud/__tests__/types.test.js +27 -0
  177. package/dist/hud/__tests__/types.test.js.map +1 -1
  178. package/dist/hud/state.d.ts.map +1 -1
  179. package/dist/hud/state.js +8 -0
  180. package/dist/hud/state.js.map +1 -1
  181. package/dist/hud/types.d.ts +9 -0
  182. package/dist/hud/types.d.ts.map +1 -1
  183. package/dist/hud/types.js +3 -0
  184. package/dist/hud/types.js.map +1 -1
  185. package/dist/mcp/__tests__/bootstrap.test.js +23 -5
  186. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  187. package/dist/mcp/__tests__/server-lifecycle.test.js +50 -7
  188. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
  189. package/dist/mcp/__tests__/state-server.test.js +70 -12
  190. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  191. package/dist/mcp/bootstrap.d.ts +10 -1
  192. package/dist/mcp/bootstrap.d.ts.map +1 -1
  193. package/dist/mcp/bootstrap.js +71 -26
  194. package/dist/mcp/bootstrap.js.map +1 -1
  195. package/dist/mcp/state-server.d.ts +5 -11
  196. package/dist/mcp/state-server.d.ts.map +1 -1
  197. package/dist/mcp/state-server.js +16 -432
  198. package/dist/mcp/state-server.js.map +1 -1
  199. package/dist/modes/__tests__/base-autoresearch-contract.test.js +1 -1
  200. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
  201. package/dist/pipeline/__tests__/orchestrator.test.js +89 -5
  202. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
  203. package/dist/pipeline/__tests__/stages.test.js +98 -1
  204. package/dist/pipeline/__tests__/stages.test.js.map +1 -1
  205. package/dist/pipeline/index.d.ts +5 -3
  206. package/dist/pipeline/index.d.ts.map +1 -1
  207. package/dist/pipeline/index.js +4 -3
  208. package/dist/pipeline/index.js.map +1 -1
  209. package/dist/pipeline/orchestrator.d.ts +7 -6
  210. package/dist/pipeline/orchestrator.d.ts.map +1 -1
  211. package/dist/pipeline/orchestrator.js +90 -11
  212. package/dist/pipeline/orchestrator.js.map +1 -1
  213. package/dist/pipeline/review-verdict.d.ts +3 -0
  214. package/dist/pipeline/review-verdict.d.ts.map +1 -0
  215. package/dist/pipeline/review-verdict.js +14 -0
  216. package/dist/pipeline/review-verdict.js.map +1 -0
  217. package/dist/pipeline/stages/code-review.d.ts +33 -0
  218. package/dist/pipeline/stages/code-review.d.ts.map +1 -0
  219. package/dist/pipeline/stages/code-review.js +51 -0
  220. package/dist/pipeline/stages/code-review.js.map +1 -0
  221. package/dist/pipeline/stages/ralph-verify.d.ts +12 -2
  222. package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -1
  223. package/dist/pipeline/stages/ralph-verify.js +24 -6
  224. package/dist/pipeline/stages/ralph-verify.js.map +1 -1
  225. package/dist/pipeline/stages/ralplan.d.ts +1 -1
  226. package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
  227. package/dist/pipeline/stages/ralplan.js +21 -1
  228. package/dist/pipeline/stages/ralplan.js.map +1 -1
  229. package/dist/pipeline/types.d.ts +14 -7
  230. package/dist/pipeline/types.d.ts.map +1 -1
  231. package/dist/pipeline/types.js +2 -2
  232. package/dist/planning/__tests__/artifacts.test.js +152 -1
  233. package/dist/planning/__tests__/artifacts.test.js.map +1 -1
  234. package/dist/planning/artifacts.d.ts +9 -0
  235. package/dist/planning/artifacts.d.ts.map +1 -1
  236. package/dist/planning/artifacts.js +60 -1
  237. package/dist/planning/artifacts.js.map +1 -1
  238. package/dist/question/__tests__/client.test.js +23 -3
  239. package/dist/question/__tests__/client.test.js.map +1 -1
  240. package/dist/question/__tests__/renderer.test.js +148 -37
  241. package/dist/question/__tests__/renderer.test.js.map +1 -1
  242. package/dist/question/__tests__/types.test.js +21 -0
  243. package/dist/question/__tests__/types.test.js.map +1 -1
  244. package/dist/question/__tests__/ui.test.js +155 -7
  245. package/dist/question/__tests__/ui.test.js.map +1 -1
  246. package/dist/question/client.d.ts +14 -4
  247. package/dist/question/client.d.ts.map +1 -1
  248. package/dist/question/client.js.map +1 -1
  249. package/dist/question/renderer.d.ts +11 -1
  250. package/dist/question/renderer.d.ts.map +1 -1
  251. package/dist/question/renderer.js +102 -7
  252. package/dist/question/renderer.js.map +1 -1
  253. package/dist/question/state.d.ts +2 -2
  254. package/dist/question/state.d.ts.map +1 -1
  255. package/dist/question/state.js +26 -17
  256. package/dist/question/state.js.map +1 -1
  257. package/dist/question/types.d.ts +25 -1
  258. package/dist/question/types.d.ts.map +1 -1
  259. package/dist/question/types.js +48 -13
  260. package/dist/question/types.js.map +1 -1
  261. package/dist/question/ui.d.ts +15 -2
  262. package/dist/question/ui.d.ts.map +1 -1
  263. package/dist/question/ui.js +268 -162
  264. package/dist/question/ui.js.map +1 -1
  265. package/dist/scripts/__tests__/codex-native-hook.test.js +415 -94
  266. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  267. package/dist/scripts/__tests__/generate-release-body.test.js +36 -0
  268. package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
  269. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
  270. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
  271. package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
  272. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
  273. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  274. package/dist/scripts/codex-native-hook.js +232 -54
  275. package/dist/scripts/codex-native-hook.js.map +1 -1
  276. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  277. package/dist/scripts/codex-native-pre-post.js +12 -9
  278. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  279. package/dist/scripts/generate-release-body.d.ts.map +1 -1
  280. package/dist/scripts/generate-release-body.js +12 -3
  281. package/dist/scripts/generate-release-body.js.map +1 -1
  282. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
  283. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
  284. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
  285. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
  286. package/dist/scripts/notify-hook/managed-tmux.d.ts +4 -2
  287. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
  288. package/dist/scripts/notify-hook/managed-tmux.js +188 -6
  289. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
  290. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
  291. package/dist/scripts/notify-hook/process-runner.js +7 -3
  292. package/dist/scripts/notify-hook/process-runner.js.map +1 -1
  293. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  294. package/dist/scripts/notify-hook/team-dispatch.js +96 -11
  295. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  296. package/dist/scripts/notify-hook/team-tmux-guard.js +3 -3
  297. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
  298. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
  299. package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
  300. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
  301. package/dist/scripts/notify-hook/team-worker.d.ts +1 -1
  302. package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
  303. package/dist/scripts/notify-hook/team-worker.js +3 -43
  304. package/dist/scripts/notify-hook/team-worker.js.map +1 -1
  305. package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
  306. package/dist/scripts/notify-hook/tmux-injection.js +25 -4
  307. package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
  308. package/dist/scripts/notify-hook.js +36 -5
  309. package/dist/scripts/notify-hook.js.map +1 -1
  310. package/dist/scripts/prompt-inventory.d.ts +29 -0
  311. package/dist/scripts/prompt-inventory.d.ts.map +1 -0
  312. package/dist/scripts/prompt-inventory.js +178 -0
  313. package/dist/scripts/prompt-inventory.js.map +1 -0
  314. package/dist/scripts/run-test-files.js +1 -0
  315. package/dist/scripts/run-test-files.js.map +1 -1
  316. package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
  317. package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
  318. package/dist/sidecar/__tests__/boundary.test.js +48 -0
  319. package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
  320. package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
  321. package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
  322. package/dist/sidecar/__tests__/collector.test.js +162 -0
  323. package/dist/sidecar/__tests__/collector.test.js.map +1 -0
  324. package/dist/sidecar/__tests__/render.test.d.ts +2 -0
  325. package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
  326. package/dist/sidecar/__tests__/render.test.js +67 -0
  327. package/dist/sidecar/__tests__/render.test.js.map +1 -0
  328. package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
  329. package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
  330. package/dist/sidecar/__tests__/tmux.test.js +30 -0
  331. package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
  332. package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
  333. package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
  334. package/dist/sidecar/__tests__/watch.test.js +42 -0
  335. package/dist/sidecar/__tests__/watch.test.js.map +1 -0
  336. package/dist/sidecar/collector.d.ts +4 -0
  337. package/dist/sidecar/collector.d.ts.map +1 -0
  338. package/dist/sidecar/collector.js +377 -0
  339. package/dist/sidecar/collector.js.map +1 -0
  340. package/dist/sidecar/index.d.ts +25 -0
  341. package/dist/sidecar/index.d.ts.map +1 -0
  342. package/dist/sidecar/index.js +165 -0
  343. package/dist/sidecar/index.js.map +1 -0
  344. package/dist/sidecar/render.d.ts +3 -0
  345. package/dist/sidecar/render.d.ts.map +1 -0
  346. package/dist/sidecar/render.js +72 -0
  347. package/dist/sidecar/render.js.map +1 -0
  348. package/dist/sidecar/tmux.d.ts +13 -0
  349. package/dist/sidecar/tmux.d.ts.map +1 -0
  350. package/dist/sidecar/tmux.js +44 -0
  351. package/dist/sidecar/tmux.js.map +1 -0
  352. package/dist/sidecar/types.d.ts +125 -0
  353. package/dist/sidecar/types.d.ts.map +1 -0
  354. package/dist/sidecar/types.js +2 -0
  355. package/dist/sidecar/types.js.map +1 -0
  356. package/dist/state/__tests__/operations.test.js +50 -22
  357. package/dist/state/__tests__/operations.test.js.map +1 -1
  358. package/dist/state/__tests__/workflow-transition.test.js +9 -1
  359. package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
  360. package/dist/state/operations.d.ts +1 -1
  361. package/dist/state/operations.d.ts.map +1 -1
  362. package/dist/state/operations.js +19 -7
  363. package/dist/state/operations.js.map +1 -1
  364. package/dist/state/workflow-transition.d.ts.map +1 -1
  365. package/dist/state/workflow-transition.js +1 -0
  366. package/dist/state/workflow-transition.js.map +1 -1
  367. package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
  368. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
  369. package/dist/team/__tests__/commit-hygiene.test.js +93 -0
  370. package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
  371. package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
  372. package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
  373. package/dist/team/__tests__/delegation-policy.test.js +69 -0
  374. package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
  375. package/dist/team/__tests__/events.test.js +54 -4
  376. package/dist/team/__tests__/events.test.js.map +1 -1
  377. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
  378. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
  379. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
  380. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
  381. package/dist/team/__tests__/model-contract.test.js +16 -0
  382. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  383. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
  384. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
  385. package/dist/team/__tests__/repo-aware-decomposition.test.js +95 -0
  386. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
  387. package/dist/team/__tests__/runtime.test.js +623 -14
  388. package/dist/team/__tests__/runtime.test.js.map +1 -1
  389. package/dist/team/__tests__/state-root.test.js +177 -1
  390. package/dist/team/__tests__/state-root.test.js.map +1 -1
  391. package/dist/team/__tests__/state.test.js +110 -0
  392. package/dist/team/__tests__/state.test.js.map +1 -1
  393. package/dist/team/__tests__/tmux-session.test.js +399 -2
  394. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  395. package/dist/team/__tests__/worker-bootstrap.test.js +94 -0
  396. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  397. package/dist/team/commit-hygiene.d.ts +22 -3
  398. package/dist/team/commit-hygiene.d.ts.map +1 -1
  399. package/dist/team/commit-hygiene.js +134 -2
  400. package/dist/team/commit-hygiene.js.map +1 -1
  401. package/dist/team/contracts.d.ts +1 -1
  402. package/dist/team/contracts.d.ts.map +1 -1
  403. package/dist/team/contracts.js +2 -0
  404. package/dist/team/contracts.js.map +1 -1
  405. package/dist/team/dag-schema.d.ts +38 -0
  406. package/dist/team/dag-schema.d.ts.map +1 -0
  407. package/dist/team/dag-schema.js +221 -0
  408. package/dist/team/dag-schema.js.map +1 -0
  409. package/dist/team/delegation-policy.d.ts +3 -0
  410. package/dist/team/delegation-policy.d.ts.map +1 -0
  411. package/dist/team/delegation-policy.js +82 -0
  412. package/dist/team/delegation-policy.js.map +1 -0
  413. package/dist/team/model-contract.d.ts +3 -1
  414. package/dist/team/model-contract.d.ts.map +1 -1
  415. package/dist/team/model-contract.js +44 -5
  416. package/dist/team/model-contract.js.map +1 -1
  417. package/dist/team/repo-aware-decomposition.d.ts +60 -0
  418. package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
  419. package/dist/team/repo-aware-decomposition.js +229 -0
  420. package/dist/team/repo-aware-decomposition.js.map +1 -0
  421. package/dist/team/runtime.d.ts +27 -0
  422. package/dist/team/runtime.d.ts.map +1 -1
  423. package/dist/team/runtime.js +172 -52
  424. package/dist/team/runtime.js.map +1 -1
  425. package/dist/team/state/tasks.d.ts.map +1 -1
  426. package/dist/team/state/tasks.js +33 -0
  427. package/dist/team/state/tasks.js.map +1 -1
  428. package/dist/team/state/types.d.ts +23 -1
  429. package/dist/team/state/types.d.ts.map +1 -1
  430. package/dist/team/state/types.js.map +1 -1
  431. package/dist/team/state-root.d.ts +35 -0
  432. package/dist/team/state-root.d.ts.map +1 -1
  433. package/dist/team/state-root.js +281 -1
  434. package/dist/team/state-root.js.map +1 -1
  435. package/dist/team/state.d.ts +27 -1
  436. package/dist/team/state.d.ts.map +1 -1
  437. package/dist/team/state.js +6 -0
  438. package/dist/team/state.js.map +1 -1
  439. package/dist/team/tmux-session.d.ts +1 -0
  440. package/dist/team/tmux-session.d.ts.map +1 -1
  441. package/dist/team/tmux-session.js +105 -6
  442. package/dist/team/tmux-session.js.map +1 -1
  443. package/dist/team/worker-bootstrap.d.ts +3 -0
  444. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  445. package/dist/team/worker-bootstrap.js +77 -4
  446. package/dist/team/worker-bootstrap.js.map +1 -1
  447. package/dist/utils/agents-md.d.ts +3 -0
  448. package/dist/utils/agents-md.d.ts.map +1 -1
  449. package/dist/utils/agents-md.js +25 -0
  450. package/dist/utils/agents-md.js.map +1 -1
  451. package/package.json +3 -2
  452. package/plugins/oh-my-codex/.codex-plugin/plugin.json +2 -2
  453. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +1 -1
  454. package/plugins/oh-my-codex/skills/analyze/SKILL.md +1 -1
  455. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +134 -205
  456. package/plugins/oh-my-codex/skills/code-review/SKILL.md +4 -4
  457. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +14 -7
  458. package/plugins/oh-my-codex/skills/doctor/SKILL.md +1 -1
  459. package/plugins/oh-my-codex/skills/help/SKILL.md +1 -1
  460. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +41 -10
  461. package/plugins/oh-my-codex/skills/plan/SKILL.md +12 -14
  462. package/plugins/oh-my-codex/skills/ralph/SKILL.md +2 -4
  463. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +5 -9
  464. package/plugins/oh-my-codex/skills/security-review/SKILL.md +4 -4
  465. package/plugins/oh-my-codex/skills/team/SKILL.md +2 -5
  466. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +2 -5
  467. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +2 -3
  468. package/prompts/analyst.md +2 -2
  469. package/prompts/api-reviewer.md +2 -2
  470. package/prompts/architect.md +2 -2
  471. package/prompts/build-fixer.md +2 -2
  472. package/prompts/code-reviewer.md +15 -5
  473. package/prompts/code-simplifier.md +1 -1
  474. package/prompts/critic.md +35 -83
  475. package/prompts/debugger.md +2 -2
  476. package/prompts/dependency-expert.md +2 -2
  477. package/prompts/designer.md +2 -2
  478. package/prompts/executor.md +40 -114
  479. package/prompts/explore-harness.md +1 -1
  480. package/prompts/explore.md +37 -90
  481. package/prompts/git-master.md +2 -2
  482. package/prompts/information-architect.md +1 -1
  483. package/prompts/performance-reviewer.md +2 -2
  484. package/prompts/planner.md +35 -62
  485. package/prompts/product-analyst.md +2 -2
  486. package/prompts/product-manager.md +2 -2
  487. package/prompts/qa-tester.md +2 -2
  488. package/prompts/quality-reviewer.md +2 -2
  489. package/prompts/quality-strategist.md +2 -2
  490. package/prompts/researcher.md +46 -78
  491. package/prompts/security-reviewer.md +2 -2
  492. package/prompts/sisyphus-lite.md +2 -2
  493. package/prompts/style-reviewer.md +2 -2
  494. package/prompts/team-executor.md +1 -1
  495. package/prompts/test-engineer.md +2 -2
  496. package/prompts/ux-researcher.md +2 -2
  497. package/prompts/verifier.md +29 -34
  498. package/prompts/vision.md +2 -2
  499. package/prompts/writer.md +2 -2
  500. package/skills/ai-slop-cleaner/SKILL.md +1 -1
  501. package/skills/analyze/SKILL.md +1 -1
  502. package/skills/autopilot/SKILL.md +134 -205
  503. package/skills/build-fix/SKILL.md +4 -4
  504. package/skills/code-review/SKILL.md +4 -4
  505. package/skills/deep-interview/SKILL.md +14 -7
  506. package/skills/doctor/SKILL.md +1 -1
  507. package/skills/help/SKILL.md +1 -1
  508. package/skills/omx-setup/SKILL.md +41 -10
  509. package/skills/plan/SKILL.md +12 -14
  510. package/skills/ralph/SKILL.md +2 -4
  511. package/skills/ralplan/SKILL.md +5 -9
  512. package/skills/security-review/SKILL.md +4 -4
  513. package/skills/team/SKILL.md +2 -5
  514. package/skills/ultraqa/SKILL.md +2 -5
  515. package/skills/ultrawork/SKILL.md +2 -3
  516. package/src/scripts/__tests__/codex-native-hook.test.ts +502 -94
  517. package/src/scripts/__tests__/generate-release-body.test.ts +41 -0
  518. package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
  519. package/src/scripts/codex-native-hook.ts +293 -61
  520. package/src/scripts/codex-native-pre-post.ts +10 -8
  521. package/src/scripts/generate-release-body.ts +13 -2
  522. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
  523. package/src/scripts/notify-hook/managed-tmux.ts +196 -9
  524. package/src/scripts/notify-hook/process-runner.ts +7 -3
  525. package/src/scripts/notify-hook/team-dispatch.ts +103 -11
  526. package/src/scripts/notify-hook/team-tmux-guard.ts +3 -3
  527. package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
  528. package/src/scripts/notify-hook/team-worker.ts +4 -48
  529. package/src/scripts/notify-hook/tmux-injection.ts +24 -6
  530. package/src/scripts/notify-hook.ts +36 -5
  531. package/src/scripts/prompt-inventory.ts +218 -0
  532. package/src/scripts/run-test-files.ts +1 -0
  533. package/templates/AGENTS.md +34 -95
@@ -3,11 +3,13 @@ import { existsSync, appendFileSync, mkdirSync } from 'fs';
3
3
  import { mkdir, readdir, readFile, writeFile } from 'fs/promises';
4
4
  import { performance } from 'perf_hooks';
5
5
  import { spawn, spawnSync } from 'child_process';
6
- import { sanitizeTeamName, isTmuxAvailable, hasCurrentTmuxClientContext, createTeamSession, buildWorkerProcessLaunchSpec, resolveTeamWorkerCli, resolveTeamWorkerCliPlan, resolveTeamWorkerLaunchMode, waitForWorkerReady, dismissTrustPromptIfPresent, sleepFractionalSeconds, sendToWorker, sendToWorkerStdin, isWorkerAlive, isWorkerPaneOpen, getWorkerPanePid, killWorkerByPaneIdAsync, restoreStandaloneHudPane, teardownWorkerPanes, unregisterResizeHook, destroyTeamSession, listPaneIds, listTeamSessions, resolveSharedSessionShutdownTopology, } from './tmux-session.js';
7
- import { teamInit as initTeamState, DEFAULT_MAX_WORKERS, teamReadConfig as readTeamConfig, teamWriteWorkerIdentity as writeWorkerIdentity, teamReadWorkerHeartbeat as readWorkerHeartbeat, teamReadWorkerStatus as readWorkerStatus, teamWriteWorkerInbox as writeWorkerInbox, teamCreateTask as createStateTask, teamReadTask as readTask, teamListTasks as listTasks, teamReadManifest as readTeamManifestV2, teamNormalizeGovernance as normalizeTeamGovernance, teamNormalizePolicy as normalizeTeamPolicy, teamClaimTask as claimTask, teamReleaseTaskClaim as releaseTaskClaim, teamReclaimExpiredTaskClaim as reclaimExpiredTaskClaim, teamAppendEvent as appendTeamEvent, teamReadTaskApproval as readTaskApproval, teamListMailbox as listMailboxMessages, teamMarkMessageDelivered as markMessageDelivered, teamMarkMessageNotified as markMessageNotified, teamEnqueueDispatchRequest as enqueueDispatchRequest, teamMarkDispatchRequestNotified as markDispatchRequestNotified, teamTransitionDispatchRequest as transitionDispatchRequest, teamReadDispatchRequest as readDispatchRequest, teamCleanup as cleanupTeamState, teamSaveConfig as saveTeamConfig, teamWriteShutdownRequest as writeShutdownRequest, teamReadShutdownAck as readShutdownAck, teamReadMonitorSnapshot as readMonitorSnapshot, teamWriteMonitorSnapshot as writeMonitorSnapshot, teamReadPhase as readTeamPhaseState, teamWritePhase as writeTeamPhaseState, teamWriteWorkerStatus as writeWorkerStatus, } from './team-ops.js';
6
+ import { sanitizeTeamName, isTmuxAvailable, hasCurrentTmuxClientContext, createTeamSession, buildWorkerProcessLaunchSpec, resolveTeamWorkerCli, resolveTeamWorkerCliPlan, resolveTeamWorkerLaunchMode, waitForWorkerReady, waitForWorkerReadyAsync, dismissTrustPromptIfPresent, sendToWorker, sendToWorkerStdin, isWorkerAlive, isWorkerPaneOpen, getWorkerPanePid, killWorkerByPaneIdAsync, restoreStandaloneHudPane, teardownWorkerPanes, unregisterResizeHook, destroyTeamSession, listPaneIds, listTeamSessions, resolveSharedSessionShutdownTopology, } from './tmux-session.js';
7
+ import { teamInit as initTeamState, DEFAULT_MAX_WORKERS, teamReadConfig as readTeamConfig, teamWriteWorkerIdentity as writeWorkerIdentity, teamReadWorkerHeartbeat as readWorkerHeartbeat, teamReadWorkerStatus as readWorkerStatus, teamWriteWorkerInbox as writeWorkerInbox, teamCreateTask as createStateTask, teamReadTask as readTask, teamListTasks as listTasks, teamUpdateTask as updateTask, teamReadManifest as readTeamManifestV2, teamNormalizeGovernance as normalizeTeamGovernance, teamNormalizePolicy as normalizeTeamPolicy, teamClaimTask as claimTask, teamReleaseTaskClaim as releaseTaskClaim, teamReclaimExpiredTaskClaim as reclaimExpiredTaskClaim, teamAppendEvent as appendTeamEvent, teamReadTaskApproval as readTaskApproval, teamListMailbox as listMailboxMessages, teamMarkMessageDelivered as markMessageDelivered, teamMarkMessageNotified as markMessageNotified, teamEnqueueDispatchRequest as enqueueDispatchRequest, teamMarkDispatchRequestNotified as markDispatchRequestNotified, teamTransitionDispatchRequest as transitionDispatchRequest, teamReadDispatchRequest as readDispatchRequest, teamCleanup as cleanupTeamState, teamSaveConfig as saveTeamConfig, teamWriteShutdownRequest as writeShutdownRequest, teamReadShutdownAck as readShutdownAck, teamReadMonitorSnapshot as readMonitorSnapshot, teamWriteMonitorSnapshot as writeMonitorSnapshot, teamReadPhase as readTeamPhaseState, teamWritePhase as writeTeamPhaseState, teamWriteWorkerStatus as writeWorkerStatus, } from './team-ops.js';
8
8
  import { queueInboxInstruction, queueDirectMailboxMessage, queueBroadcastMailboxMessage, waitForDispatchReceipt, } from './mcp-comm.js';
9
9
  import { appendTeamDeliveryLogForCwd } from './delivery-log.js';
10
+ import { remapRepoAwareDecompositionMetadataToCreatedTasks, } from './repo-aware-decomposition.js';
10
11
  import { generateWorkerOverlay, writeTeamWorkerInstructionsFile, removeTeamWorkerInstructionsFile, writeWorkerWorktreeRootAgentsFile, removeWorkerWorktreeRootAgentsFile, generateInitialInbox, generateTaskAssignmentInbox, generateShutdownInbox, buildTriggerDirective, buildMailboxTriggerDirective, buildLeaderMailboxTriggerDirective, writeWorkerRoleInstructionsFile, } from './worker-bootstrap.js';
12
+ import { synthesizeDelegationPlan } from './delegation-policy.js';
11
13
  import { loadRolePrompt } from './role-router.js';
12
14
  import { composeRoleInstructionsForRole } from '../agents/native-config.js';
13
15
  import { codexPromptsDir } from '../utils/paths.js';
@@ -20,7 +22,7 @@ import { hasStructuredVerificationEvidence } from '../verification/verifier.js';
20
22
  import { buildRebalanceDecisions } from './rebalance-policy.js';
21
23
  import { getStatePath } from '../mcp/state-paths.js';
22
24
  import { readModeState, updateModeState } from '../modes/base.js';
23
- import { appendTeamCommitHygieneEntries, buildTeamCommitHygieneContext, writeTeamCommitHygieneContext, } from './commit-hygiene.js';
25
+ import { appendTeamCommitHygieneEntries, buildTeamCommitHygieneContext, resolveTeamCommitHygieneArtifactCwd, writeTeamCommitHygieneContext, } from './commit-hygiene.js';
24
26
  import { assertCleanLeaderWorkspaceForWorkerWorktrees, ensureWorktree, isGitRepository, isWorktreeDirty, planWorktreeTarget, removeWorktreeForce, rollbackProvisionedWorktrees, } from './worktree.js';
25
27
  import { cleanupOmxMcpProcesses, findLaunchSafeCleanupCandidates, } from '../cli/cleanup.js';
26
28
  async function syncRootTeamModeStateOnTerminalPhase(teamName, phase, cwd) {
@@ -371,7 +373,7 @@ async function integrateWorkerCommitsIntoLeader(params) {
371
373
  const leaderHeadAtCycleStart = resolveLeaderHead(resolve(config.workers[0]?.worktree_repo_root ?? cwd), cwd);
372
374
  const integratedWorkerNames = new Set();
373
375
  const commitHygieneEntries = [];
374
- const artifactCwd = config.leader_cwd ?? cwd;
376
+ const artifactCwd = resolveTeamCommitHygieneArtifactCwd(config, cwd);
375
377
  // ── Phase A: Auto-commit dirty worktrees ──
376
378
  for (const worker of config.workers) {
377
379
  if (!worker.worktree_repo_root || !worker.worktree_path || !existsSync(worker.worktree_path))
@@ -927,9 +929,9 @@ const MODEL_INSTRUCTIONS_FILE_ENV = 'OMX_MODEL_INSTRUCTIONS_FILE';
927
929
  const TEAM_STATE_ROOT_ENV = 'OMX_TEAM_STATE_ROOT';
928
930
  const TEAM_LEADER_CWD_ENV = 'OMX_TEAM_LEADER_CWD';
929
931
  const WORKTREE_TRIGGER_STATE_ROOT = '$OMX_TEAM_STATE_ROOT';
930
- const STARTUP_EVIDENCE_TIMEOUT_MS = 2_000;
932
+ const STARTUP_EVIDENCE_TIMEOUT_MS = 15_000;
931
933
  const STARTUP_EVIDENCE_POLL_MS = 100;
932
- const STARTUP_EVIDENCE_LAUNCH_TIMEOUT_MS = 5_000;
934
+ const STARTUP_EVIDENCE_LAUNCH_TIMEOUT_MS = 45_000;
933
935
  const promptWorkerRegistry = new Map();
934
936
  const previousModelInstructionsFileByTeam = new Map();
935
937
  const PROMPT_WORKER_SIGTERM_WAIT_MS = 3_000;
@@ -1454,9 +1456,27 @@ function resolveEffectiveWorkerCliForStartupLog(resolvedLaunchArgs, env) {
1454
1456
  }
1455
1457
  return resolveTeamWorkerCli(resolvedLaunchArgs, env);
1456
1458
  }
1457
- /**
1458
- * Start a new team: init state, create tmux session, bootstrap workers.
1459
- */
1459
+ async function writeDecompositionArtifacts(teamName, cwd, metadata) {
1460
+ const root = join(resolveCanonicalTeamStateRoot(cwd), 'team', teamName);
1461
+ await mkdir(root, { recursive: true });
1462
+ await writeFile(join(root, 'decomposition-report.json'), JSON.stringify(metadata, null, 2), 'utf8');
1463
+ const manifest = await readTeamManifestV2(teamName, cwd);
1464
+ if (manifest) {
1465
+ await writeFile(join(root, 'manifest.v2.json'), JSON.stringify({ ...manifest, team_decomposition: metadata }, null, 2), 'utf8');
1466
+ }
1467
+ }
1468
+ export async function settleStartupAttemptResults(attempts) {
1469
+ const settled = await Promise.allSettled(attempts.map((attempt) => attempt.attempt));
1470
+ return settled.map((result, index) => {
1471
+ if (result.status === 'fulfilled')
1472
+ return result.value;
1473
+ const descriptor = attempts[index];
1474
+ const workerIndex = descriptor?.workerIndex ?? index + 1;
1475
+ const workerName = descriptor?.workerName ?? `worker-${workerIndex}`;
1476
+ const error = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
1477
+ return { ok: false, workerIndex, workerName, error };
1478
+ });
1479
+ }
1460
1480
  export async function startTeam(teamName, task, agentType, workerCount, tasks, cwd, options = {}) {
1461
1481
  const leaderCwd = resolve(cwd);
1462
1482
  await assertNestedTeamAllowed(leaderCwd);
@@ -1546,15 +1566,49 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1546
1566
  config.team_state_root = teamStateRoot;
1547
1567
  config.workspace_mode = workspaceMode;
1548
1568
  config.worktree_mode = effectiveWorktreeMode;
1549
- // 4. Create tasks
1569
+ // 4. Create tasks. Repo-aware DAG dependencies are symbolic until the
1570
+ // state layer returns concrete task IDs, so create those tasks dependency
1571
+ // free and patch runtime dependency fields after ID assignment.
1572
+ const createdTasks = [];
1550
1573
  for (const t of tasks) {
1551
- await createStateTask(sanitized, {
1574
+ const hasSymbolicDagIdentity = Boolean(t.symbolic_id);
1575
+ const created = await createStateTask(sanitized, {
1552
1576
  subject: t.subject,
1553
1577
  description: t.description,
1554
1578
  status: 'pending',
1555
1579
  owner: t.owner,
1556
- blocked_by: t.blocked_by,
1580
+ blocked_by: hasSymbolicDagIdentity ? undefined : t.blocked_by ?? t.depends_on,
1581
+ depends_on: hasSymbolicDagIdentity ? undefined : t.depends_on ?? t.blocked_by,
1557
1582
  role: t.role,
1583
+ delegation: t.delegation ?? synthesizeDelegationPlan(t),
1584
+ requires_code_change: t.requires_code_change,
1585
+ filePaths: t.filePaths,
1586
+ domains: t.domains,
1587
+ lane: t.lane,
1588
+ allocation_reason: t.allocation_reason,
1589
+ }, leaderCwd);
1590
+ createdTasks.push(created);
1591
+ }
1592
+ const effectiveDecompositionMetadata = options.decompositionMetadata
1593
+ ? remapRepoAwareDecompositionMetadataToCreatedTasks(options.decompositionMetadata, tasks, createdTasks)
1594
+ : undefined;
1595
+ const nodeIdToTaskId = effectiveDecompositionMetadata?.node_id_to_task_id ?? {};
1596
+ for (let index = 0; index < tasks.length; index += 1) {
1597
+ const planned = tasks[index];
1598
+ if (!planned?.symbolic_id)
1599
+ continue;
1600
+ const created = createdTasks[index];
1601
+ if (!created)
1602
+ continue;
1603
+ const symbolicDeps = planned.symbolic_depends_on
1604
+ ?? effectiveDecompositionMetadata?.node_dependencies?.[planned.symbolic_id]
1605
+ ?? [];
1606
+ const concreteDeps = symbolicDeps.map((dep) => nodeIdToTaskId[dep]).filter(Boolean);
1607
+ if (concreteDeps.length === 0)
1608
+ continue;
1609
+ await updateTask(sanitized, created.id, {
1610
+ blocked_by: concreteDeps,
1611
+ depends_on: concreteDeps,
1558
1612
  }, leaderCwd);
1559
1613
  }
1560
1614
  // 5. Write team-scoped worker instructions file only for single-workspace mode.
@@ -1563,6 +1617,9 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1563
1617
  setTeamModelInstructionsFile(sanitized, workerInstructionsPath);
1564
1618
  }
1565
1619
  const allTasks = await listTasks(sanitized, leaderCwd);
1620
+ if (effectiveDecompositionMetadata) {
1621
+ await writeDecompositionArtifacts(sanitized, leaderCwd, effectiveDecompositionMetadata);
1622
+ }
1566
1623
  const workerBootstrapPlans = [];
1567
1624
  for (let i = 1; i <= workerCount; i++) {
1568
1625
  const workerName = `worker-${i}`;
@@ -1603,6 +1660,7 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1603
1660
  workerRole: runtimeRole,
1604
1661
  rolePromptContent: rawRolePromptContent ?? undefined,
1605
1662
  worktreeRootAgentsCanonical: Boolean(workerWorkspace.worktreePath),
1663
+ taskHints: effectiveDecompositionMetadata?.task_hints,
1606
1664
  });
1607
1665
  const triggerDirective = buildTriggerDirective(workerName, sanitized, resolveInstructionStateRoot(workerWorkspace.worktreePath));
1608
1666
  const trigger = triggerDirective.text;
@@ -1731,31 +1789,40 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1731
1789
  await materializeWorkerStartupState(bootstrapPlan, i, workerPaneIds[i - 1]);
1732
1790
  }
1733
1791
  await saveTeamConfig(config, leaderCwd);
1734
- // 7. Wait for all workers to be ready (interactive mode), then bootstrap them
1792
+ // 7. Start all safe per-worker readiness/dispatch attempts concurrently.
1793
+ // Pane creation and worktree provisioning above remain dependency-bound and
1794
+ // ordered; readiness polling and startup dispatch must not let worker-1
1795
+ // block later workers from receiving their own startup attempts.
1735
1796
  const manifest = await readTeamManifestV2(sanitized, leaderCwd);
1736
1797
  const dispatchPolicy = resolveDispatchPolicy(manifest?.policy, workerLaunchMode);
1737
- for (let i = 1; i <= workerCount; i++) {
1738
- const bootstrapPlan = workerBootstrapPlans[i - 1];
1798
+ const runWorkerStartupAttempt = async (workerIndex) => {
1799
+ const bootstrapPlan = workerBootstrapPlans[workerIndex - 1];
1739
1800
  if (!bootstrapPlan) {
1740
- throw new Error(`missing bootstrap plan for worker-${i}`);
1801
+ return {
1802
+ ok: false,
1803
+ workerIndex,
1804
+ workerName: `worker-${workerIndex}`,
1805
+ error: new Error(`missing bootstrap plan for worker-${workerIndex}`),
1806
+ };
1741
1807
  }
1742
- const { workerName, paneId, workerTasks, inbox, trigger, triggerIntent, initialPrompt } = {
1743
- workerName: bootstrapPlan.workerName,
1744
- paneId: workerPaneIds[i - 1],
1745
- workerTasks: bootstrapPlan.workerTasks,
1746
- inbox: bootstrapPlan.inbox,
1747
- trigger: bootstrapPlan.trigger,
1748
- triggerIntent: bootstrapPlan.triggerIntent,
1749
- initialPrompt: bootstrapPlan.initialPrompt,
1750
- };
1751
- if (workerTasks.map(t => t.role).filter(Boolean).length > 0 && new Set(workerTasks.map(t => t.role).filter(Boolean)).size > 1) {
1752
- console.log(`[omx:team] ${workerName}: mixed task roles [${[...new Set(workerTasks.map(t => t.role).filter(Boolean))].join(', ')}], falling back to ${agentType}`);
1808
+ const workerName = bootstrapPlan.workerName;
1809
+ const paneId = workerPaneIds[workerIndex - 1];
1810
+ const workerTasks = bootstrapPlan.workerTasks;
1811
+ const inbox = bootstrapPlan.inbox;
1812
+ const trigger = bootstrapPlan.trigger;
1813
+ const triggerIntent = bootstrapPlan.triggerIntent;
1814
+ const initialPrompt = bootstrapPlan.initialPrompt;
1815
+ const taskRoles = workerTasks
1816
+ .map((task) => task.role)
1817
+ .filter((role) => Boolean(role));
1818
+ const uniqueTaskRoles = [...new Set(taskRoles)];
1819
+ if (uniqueTaskRoles.length > 1) {
1820
+ console.log(`[omx:team] ${workerName}: mixed task roles [${uniqueTaskRoles.join(', ')}], falling back to ${agentType}`);
1753
1821
  }
1754
- // Wait for worker readiness
1755
1822
  if (workerLaunchMode === 'interactive' && !skipWorkerReadyWait && !initialPrompt) {
1756
- const ready = waitForWorkerReady(sessionName, i, workerReadyTimeoutMs, paneId);
1823
+ const ready = await waitForWorkerReadyAsync(sessionName, workerIndex, workerReadyTimeoutMs, paneId);
1757
1824
  if (!ready) {
1758
- const workerAlive = isWorkerPaneOpen(sessionName, i, paneId);
1825
+ const workerAlive = isWorkerPaneOpen(sessionName, workerIndex, paneId);
1759
1826
  if (workerAlive) {
1760
1827
  await recordRecoverableStartupIssue({
1761
1828
  teamName: sanitized,
@@ -1764,14 +1831,16 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1764
1831
  reason: 'ready_prompt_timeout',
1765
1832
  cwd: leaderCwd,
1766
1833
  });
1767
- continue;
1834
+ return { ok: true, workerIndex, workerName };
1768
1835
  }
1769
- throw new Error(`Worker ${workerName} did not become ready in tmux session ${sessionName}`);
1836
+ return {
1837
+ ok: false,
1838
+ workerIndex,
1839
+ workerName,
1840
+ error: new Error(`Worker ${workerName} did not become ready in tmux session ${sessionName}`),
1841
+ };
1770
1842
  }
1771
1843
  }
1772
- // Queue inbox via MCP/state then notify worker via tmux transport.
1773
- // Retry dispatch up to 3 times to handle Codex trust prompts that may
1774
- // block the worker pane during startup (fixes #393).
1775
1844
  let dispatchOutcome = initialPrompt
1776
1845
  ? { ok: true, transport: 'none', reason: 'startup_prompt_delivered_at_launch' }
1777
1846
  : { ok: false, transport: 'none', reason: 'not_attempted' };
@@ -1781,9 +1850,9 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1781
1850
  teamName: sanitized,
1782
1851
  config: config,
1783
1852
  workerName,
1784
- workerIndex: i,
1853
+ workerIndex,
1785
1854
  paneId,
1786
- workerCli: workerCliPlan[i - 1],
1855
+ workerCli: workerCliPlan[workerIndex - 1],
1787
1856
  inbox,
1788
1857
  triggerMessage: trigger,
1789
1858
  intent: triggerIntent,
@@ -1796,25 +1865,24 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1796
1865
  if (dispatchOutcome.ok)
1797
1866
  break;
1798
1867
  if (attempt < startupDispatchRetries) {
1799
- // Check for trust prompt blocking the worker and dismiss it before retry
1800
1868
  if (workerLaunchMode === 'interactive') {
1801
- if (dismissTrustPromptIfPresent(sessionName, i, paneId)) {
1802
- waitForWorkerReady(sessionName, i, workerReadyTimeoutMs, paneId);
1869
+ if (dismissTrustPromptIfPresent(sessionName, workerIndex, paneId)) {
1870
+ await waitForWorkerReadyAsync(sessionName, workerIndex, workerReadyTimeoutMs, paneId);
1803
1871
  }
1804
1872
  else {
1805
- sleepFractionalSeconds(startupRetryDelayS);
1873
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, startupRetryDelayS * 1000)));
1806
1874
  }
1807
1875
  }
1808
1876
  else {
1809
- sleepFractionalSeconds(startupRetryDelayS);
1877
+ await new Promise((resolve) => setTimeout(resolve, Math.max(0, startupRetryDelayS * 1000)));
1810
1878
  }
1811
1879
  }
1812
1880
  }
1813
1881
  }
1814
1882
  if (!dispatchOutcome.ok) {
1815
1883
  const workerAlive = workerLaunchMode === 'prompt'
1816
- ? isPromptWorkerAlive(config, config.workers[i - 1])
1817
- : isWorkerPaneOpen(sessionName, i, paneId);
1884
+ ? isPromptWorkerAlive(config, config.workers[workerIndex - 1])
1885
+ : isWorkerPaneOpen(sessionName, workerIndex, paneId);
1818
1886
  if (workerLaunchMode === 'interactive'
1819
1887
  && workerAlive
1820
1888
  && isRecoverableInteractiveStartupReason(dispatchOutcome.reason)) {
@@ -1825,10 +1893,32 @@ export async function startTeam(teamName, task, agentType, workerCount, tasks, c
1825
1893
  reason: dispatchOutcome.reason,
1826
1894
  cwd: leaderCwd,
1827
1895
  });
1828
- continue;
1896
+ return { ok: true, workerIndex, workerName };
1829
1897
  }
1830
- throw new Error(`worker_notify_failed:${workerName}:${dispatchOutcome.reason}`);
1898
+ return {
1899
+ ok: false,
1900
+ workerIndex,
1901
+ workerName,
1902
+ error: new Error(`worker_notify_failed:${workerName}:${dispatchOutcome.reason}`),
1903
+ };
1831
1904
  }
1905
+ return { ok: true, workerIndex, workerName };
1906
+ };
1907
+ const startupAttemptResults = await settleStartupAttemptResults(Array.from({ length: workerCount }, (_, index) => {
1908
+ const workerIndex = index + 1;
1909
+ const bootstrapPlan = workerBootstrapPlans[index];
1910
+ const workerName = bootstrapPlan?.workerName ?? `worker-${workerIndex}`;
1911
+ return {
1912
+ workerIndex,
1913
+ workerName,
1914
+ attempt: runWorkerStartupAttempt(workerIndex),
1915
+ };
1916
+ }));
1917
+ const firstStartupError = startupAttemptResults
1918
+ .filter((result) => !result.ok)
1919
+ .sort((a, b) => a.workerIndex - b.workerIndex)[0];
1920
+ if (firstStartupError) {
1921
+ throw firstStartupError.error;
1832
1922
  }
1833
1923
  await saveTeamConfig(config, leaderCwd);
1834
1924
  return {
@@ -2207,7 +2297,10 @@ export async function assignTask(teamName, workerName, taskId, cwd) {
2207
2297
  }
2208
2298
  try {
2209
2299
  // Retry dispatch up to 2 times to handle trust prompts during assignment (fixes #393).
2210
- const inbox = generateTaskAssignmentInbox(workerName, sanitized, taskId, task.description);
2300
+ const taskForInbox = task.delegation
2301
+ ? task
2302
+ : (await updateTask(sanitized, taskId, { delegation: synthesizeDelegationPlan(task) }, cwd)) ?? task;
2303
+ const inbox = generateTaskAssignmentInbox(workerName, sanitized, taskForInbox);
2211
2304
  const maxAssignRetries = 2;
2212
2305
  const assignRetryDelayS = 2;
2213
2306
  let outcome = { ok: false, transport: 'none', reason: 'not_attempted' };
@@ -2522,7 +2615,7 @@ export async function shutdownTeam(teamName, cwd, options = {}) {
2522
2615
  });
2523
2616
  }
2524
2617
  }
2525
- const artifactCwd = config.leader_cwd ?? cwd;
2618
+ const artifactCwd = resolveTeamCommitHygieneArtifactCwd(config, cwd);
2526
2619
  const ledger = await appendTeamCommitHygieneEntries(sanitized, commitHygieneEntries, artifactCwd);
2527
2620
  const taskView = await listTasks(sanitized, cwd).catch(() => []);
2528
2621
  const commitHygieneContext = buildTeamCommitHygieneContext({
@@ -2588,7 +2681,8 @@ export async function resumeTeam(teamName, cwd) {
2588
2681
  return null;
2589
2682
  config.lifecycle_profile = 'default';
2590
2683
  if (config.worker_launch_mode === 'prompt') {
2591
- const hasLivePromptWorker = config.workers.some((worker) => isPromptWorkerAlive(config, worker));
2684
+ const handleTeamConfig = { ...config, name: sanitized };
2685
+ const hasLivePromptWorker = config.workers.some((worker) => isPromptWorkerAlive(handleTeamConfig, worker));
2592
2686
  if (!hasLivePromptWorker)
2593
2687
  return null;
2594
2688
  const missingHandles = config.workers
@@ -3311,9 +3405,15 @@ async function sendLeaderMailboxMessage(params) {
3311
3405
  cwd,
3312
3406
  transportPreference,
3313
3407
  fallbackAllowed: transportPreference === 'hook_preferred_with_fallback',
3314
- notify: async (_target, message) => (transportPreference === 'hook_preferred_with_fallback'
3315
- ? { ok: true, transport: 'hook', reason: 'queued_for_hook_dispatch' }
3316
- : await notifyLeaderAsync(config, message, cwd)),
3408
+ notify: async (_target, message) => {
3409
+ if (transportPreference === 'hook_preferred_with_fallback') {
3410
+ return { ok: true, transport: 'hook', reason: 'queued_for_hook_dispatch' };
3411
+ }
3412
+ if (!config.leader_pane_id) {
3413
+ return { ok: false, transport: 'mailbox', reason: 'leader_pane_missing_transport_direct_failed' };
3414
+ }
3415
+ return await notifyLeaderAsync(config, message, cwd);
3416
+ },
3317
3417
  });
3318
3418
  if (!isExistingMailboxNotificationOutcome(queuedOutcome)
3319
3419
  && transportPreference === 'hook_preferred_with_fallback'
@@ -3343,6 +3443,26 @@ async function sendLeaderMailboxMessage(params) {
3343
3443
  });
3344
3444
  return deferredOutcome;
3345
3445
  }
3446
+ if (!isExistingMailboxNotificationOutcome(queuedOutcome)
3447
+ && transportPreference === 'transport_direct'
3448
+ && !config.leader_pane_id) {
3449
+ const failedOutcome = {
3450
+ ...queuedOutcome,
3451
+ ok: false,
3452
+ transport: 'mailbox',
3453
+ reason: 'leader_pane_missing_transport_direct_failed',
3454
+ };
3455
+ await logRuntimeDispatchOutcome({
3456
+ cwd,
3457
+ teamName,
3458
+ workerName: 'leader-fixed',
3459
+ requestId: failedOutcome.request_id,
3460
+ messageId: failedOutcome.message_id,
3461
+ intent: triggerDirective.intent,
3462
+ outcome: failedOutcome,
3463
+ });
3464
+ return failedOutcome;
3465
+ }
3346
3466
  const canLeaderFallbackDirectly = Boolean(config.leader_pane_id) && isTmuxAvailable();
3347
3467
  return await finalizeQueuedMailboxDispatch({
3348
3468
  queuedOutcome,