oh-my-copilot 5.5.0 → 5.6.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 (444) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -0
  4. package/bridge/__pycache__/gyoshu_bridge.cpython-312.pyc +0 -0
  5. package/bridge/claude-md-coordinator.cjs +2 -2
  6. package/bridge/cli.cjs +6290 -3436
  7. package/bridge/mcp-server.cjs +637 -503
  8. package/bridge/runtime-cli.cjs +516 -213
  9. package/bridge/team-bridge.cjs +141 -135
  10. package/bridge/team-mcp.cjs +201 -129
  11. package/bridge/team.js +473 -237
  12. package/copilot/hooks.json +43 -0
  13. package/dist/__tests__/chain-enqueuer-registration.test.d.ts +11 -0
  14. package/dist/__tests__/chain-enqueuer-registration.test.d.ts.map +1 -0
  15. package/dist/__tests__/chain-enqueuer-registration.test.js +122 -0
  16. package/dist/__tests__/chain-enqueuer-registration.test.js.map +1 -0
  17. package/dist/__tests__/copilot-hooks-manifest.test.js +3 -1
  18. package/dist/__tests__/copilot-hooks-manifest.test.js.map +1 -1
  19. package/dist/__tests__/directory-context-injector.test.js +41 -1
  20. package/dist/__tests__/directory-context-injector.test.js.map +1 -1
  21. package/dist/__tests__/hook-bridge-main-module.test.d.ts +2 -0
  22. package/dist/__tests__/hook-bridge-main-module.test.d.ts.map +1 -0
  23. package/dist/__tests__/hook-bridge-main-module.test.js +48 -0
  24. package/dist/__tests__/hook-bridge-main-module.test.js.map +1 -0
  25. package/dist/__tests__/ralph-prd-stale.test.js +12 -1
  26. package/dist/__tests__/ralph-prd-stale.test.js.map +1 -1
  27. package/dist/__tests__/ralph-prd.test.js +56 -0
  28. package/dist/__tests__/ralph-prd.test.js.map +1 -1
  29. package/dist/__tests__/run-cjs-graceful-fallback.test.js +2 -0
  30. package/dist/__tests__/run-cjs-graceful-fallback.test.js.map +1 -1
  31. package/dist/__tests__/session-end-forwarder-fallback.test.d.ts +2 -0
  32. package/dist/__tests__/session-end-forwarder-fallback.test.d.ts.map +1 -0
  33. package/dist/__tests__/session-end-forwarder-fallback.test.js +138 -0
  34. package/dist/__tests__/session-end-forwarder-fallback.test.js.map +1 -0
  35. package/dist/cli/__tests__/autoresearch-setup-session.test.js +67 -3
  36. package/dist/cli/__tests__/autoresearch-setup-session.test.js.map +1 -1
  37. package/dist/cli/__tests__/launch.test.js +73 -11
  38. package/dist/cli/__tests__/launch.test.js.map +1 -1
  39. package/dist/cli/__tests__/plugin-dir-capture.test.js +45 -0
  40. package/dist/cli/__tests__/plugin-dir-capture.test.js.map +1 -1
  41. package/dist/cli/__tests__/ralph-afk.test.d.ts +2 -0
  42. package/dist/cli/__tests__/ralph-afk.test.d.ts.map +1 -0
  43. package/dist/cli/__tests__/ralph-afk.test.js +312 -0
  44. package/dist/cli/__tests__/ralph-afk.test.js.map +1 -0
  45. package/dist/cli/__tests__/team.test.js +170 -0
  46. package/dist/cli/__tests__/team.test.js.map +1 -1
  47. package/dist/cli/__tests__/tmux-utils.test.js +132 -16
  48. package/dist/cli/__tests__/tmux-utils.test.js.map +1 -1
  49. package/dist/cli/autoresearch-setup-session.d.ts.map +1 -1
  50. package/dist/cli/autoresearch-setup-session.js +29 -9
  51. package/dist/cli/autoresearch-setup-session.js.map +1 -1
  52. package/dist/cli/commands/__tests__/factory-init.test.d.ts +2 -0
  53. package/dist/cli/commands/__tests__/factory-init.test.d.ts.map +1 -0
  54. package/dist/cli/commands/__tests__/factory-init.test.js +90 -0
  55. package/dist/cli/commands/__tests__/factory-init.test.js.map +1 -0
  56. package/dist/cli/commands/__tests__/intake-headless-flag.test.d.ts +2 -0
  57. package/dist/cli/commands/__tests__/intake-headless-flag.test.d.ts.map +1 -0
  58. package/dist/cli/commands/__tests__/intake-headless-flag.test.js +30 -0
  59. package/dist/cli/commands/__tests__/intake-headless-flag.test.js.map +1 -0
  60. package/dist/cli/commands/__tests__/intake.test.d.ts +2 -0
  61. package/dist/cli/commands/__tests__/intake.test.d.ts.map +1 -0
  62. package/dist/cli/commands/__tests__/intake.test.js +257 -0
  63. package/dist/cli/commands/__tests__/intake.test.js.map +1 -0
  64. package/dist/cli/commands/factory.d.ts +61 -0
  65. package/dist/cli/commands/factory.d.ts.map +1 -0
  66. package/dist/cli/commands/factory.js +190 -0
  67. package/dist/cli/commands/factory.js.map +1 -0
  68. package/dist/cli/commands/intake.d.ts +94 -0
  69. package/dist/cli/commands/intake.d.ts.map +1 -0
  70. package/dist/cli/commands/intake.js +311 -0
  71. package/dist/cli/commands/intake.js.map +1 -0
  72. package/dist/cli/commands/ralph.d.ts +88 -0
  73. package/dist/cli/commands/ralph.d.ts.map +1 -0
  74. package/dist/cli/commands/ralph.js +456 -0
  75. package/dist/cli/commands/ralph.js.map +1 -0
  76. package/dist/cli/commands/team.d.ts.map +1 -1
  77. package/dist/cli/commands/team.js +25 -5
  78. package/dist/cli/commands/team.js.map +1 -1
  79. package/dist/cli/index.d.ts.map +1 -1
  80. package/dist/cli/index.js +7 -0
  81. package/dist/cli/index.js.map +1 -1
  82. package/dist/cli/launch.d.ts.map +1 -1
  83. package/dist/cli/launch.js +32 -7
  84. package/dist/cli/launch.js.map +1 -1
  85. package/dist/cli/team.d.ts.map +1 -1
  86. package/dist/cli/team.js +61 -7
  87. package/dist/cli/team.js.map +1 -1
  88. package/dist/cli/tmux-utils.d.ts +26 -0
  89. package/dist/cli/tmux-utils.d.ts.map +1 -1
  90. package/dist/cli/tmux-utils.js +61 -9
  91. package/dist/cli/tmux-utils.js.map +1 -1
  92. package/dist/config/__tests__/loader.test.js +138 -0
  93. package/dist/config/__tests__/loader.test.js.map +1 -1
  94. package/dist/config/loader.d.ts.map +1 -1
  95. package/dist/config/loader.js +17 -0
  96. package/dist/config/loader.js.map +1 -1
  97. package/dist/factory/__tests__/check-run.test.d.ts +2 -0
  98. package/dist/factory/__tests__/check-run.test.d.ts.map +1 -0
  99. package/dist/factory/__tests__/check-run.test.js +213 -0
  100. package/dist/factory/__tests__/check-run.test.js.map +1 -0
  101. package/dist/factory/__tests__/listener.test.d.ts +2 -0
  102. package/dist/factory/__tests__/listener.test.d.ts.map +1 -0
  103. package/dist/factory/__tests__/listener.test.js +312 -0
  104. package/dist/factory/__tests__/listener.test.js.map +1 -0
  105. package/dist/factory/__tests__/map-frontier.test.d.ts +2 -0
  106. package/dist/factory/__tests__/map-frontier.test.d.ts.map +1 -0
  107. package/dist/factory/__tests__/map-frontier.test.js +128 -0
  108. package/dist/factory/__tests__/map-frontier.test.js.map +1 -0
  109. package/dist/factory/__tests__/map-ingest.test.d.ts +2 -0
  110. package/dist/factory/__tests__/map-ingest.test.d.ts.map +1 -0
  111. package/dist/factory/__tests__/map-ingest.test.js +166 -0
  112. package/dist/factory/__tests__/map-ingest.test.js.map +1 -0
  113. package/dist/factory/__tests__/map-run.test.d.ts +2 -0
  114. package/dist/factory/__tests__/map-run.test.d.ts.map +1 -0
  115. package/dist/factory/__tests__/map-run.test.js +148 -0
  116. package/dist/factory/__tests__/map-run.test.js.map +1 -0
  117. package/dist/factory/__tests__/status.test.d.ts +2 -0
  118. package/dist/factory/__tests__/status.test.d.ts.map +1 -0
  119. package/dist/factory/__tests__/status.test.js +77 -0
  120. package/dist/factory/__tests__/status.test.js.map +1 -0
  121. package/dist/factory/listener.d.ts +98 -0
  122. package/dist/factory/listener.d.ts.map +1 -0
  123. package/dist/factory/listener.js +315 -0
  124. package/dist/factory/listener.js.map +1 -0
  125. package/dist/factory/map-frontier.d.ts +73 -0
  126. package/dist/factory/map-frontier.d.ts.map +1 -0
  127. package/dist/factory/map-frontier.js +147 -0
  128. package/dist/factory/map-frontier.js.map +1 -0
  129. package/dist/factory/map-ingest.d.ts +79 -0
  130. package/dist/factory/map-ingest.d.ts.map +1 -0
  131. package/dist/factory/map-ingest.js +232 -0
  132. package/dist/factory/map-ingest.js.map +1 -0
  133. package/dist/factory/map-run.d.ts +74 -0
  134. package/dist/factory/map-run.d.ts.map +1 -0
  135. package/dist/factory/map-run.js +229 -0
  136. package/dist/factory/map-run.js.map +1 -0
  137. package/dist/factory/status.d.ts +33 -0
  138. package/dist/factory/status.d.ts.map +1 -0
  139. package/dist/factory/status.js +93 -0
  140. package/dist/factory/status.js.map +1 -0
  141. package/dist/factory/watchdog.d.ts +46 -0
  142. package/dist/factory/watchdog.d.ts.map +1 -0
  143. package/dist/factory/watchdog.js +130 -0
  144. package/dist/factory/watchdog.js.map +1 -0
  145. package/dist/factory/watchdog.test.d.ts +2 -0
  146. package/dist/factory/watchdog.test.d.ts.map +1 -0
  147. package/dist/factory/watchdog.test.js +111 -0
  148. package/dist/factory/watchdog.test.js.map +1 -0
  149. package/dist/graph/runtime/native-contained-fs.js +1 -1
  150. package/dist/graph/runtime/native-contained-fs.js.map +1 -1
  151. package/dist/hooks/__tests__/compaction-concurrency.test.js +20 -20
  152. package/dist/hooks/__tests__/compaction-concurrency.test.js.map +1 -1
  153. package/dist/hooks/__tests__/workflow-drift-guard-script.test.js +27 -0
  154. package/dist/hooks/__tests__/workflow-drift-guard-script.test.js.map +1 -1
  155. package/dist/hooks/bridge.d.ts +8 -0
  156. package/dist/hooks/bridge.d.ts.map +1 -1
  157. package/dist/hooks/bridge.js +38 -9
  158. package/dist/hooks/bridge.js.map +1 -1
  159. package/dist/hooks/code-simplifier/__tests__/global-config-path.test.d.ts +2 -0
  160. package/dist/hooks/code-simplifier/__tests__/global-config-path.test.d.ts.map +1 -0
  161. package/dist/hooks/code-simplifier/__tests__/global-config-path.test.js +89 -0
  162. package/dist/hooks/code-simplifier/__tests__/global-config-path.test.js.map +1 -0
  163. package/dist/hooks/code-simplifier/index.d.ts +1 -1
  164. package/dist/hooks/code-simplifier/index.js +1 -1
  165. package/dist/hooks/code-simplifier/jev-shadow.d.ts +5 -4
  166. package/dist/hooks/code-simplifier/jev-shadow.d.ts.map +1 -1
  167. package/dist/hooks/code-simplifier/jev-shadow.js +9 -4
  168. package/dist/hooks/code-simplifier/jev-shadow.js.map +1 -1
  169. package/dist/hooks/directory-readme-injector/index.d.ts.map +1 -1
  170. package/dist/hooks/directory-readme-injector/index.js +11 -2
  171. package/dist/hooks/directory-readme-injector/index.js.map +1 -1
  172. package/dist/hooks/jev/__tests__/active-mode.test.d.ts +9 -0
  173. package/dist/hooks/jev/__tests__/active-mode.test.d.ts.map +1 -0
  174. package/dist/hooks/jev/__tests__/active-mode.test.js +252 -0
  175. package/dist/hooks/jev/__tests__/active-mode.test.js.map +1 -0
  176. package/dist/hooks/jev/points.d.ts +3 -1
  177. package/dist/hooks/jev/points.d.ts.map +1 -1
  178. package/dist/hooks/jev/points.js +1 -0
  179. package/dist/hooks/jev/points.js.map +1 -1
  180. package/dist/hooks/jev/resolver.d.ts.map +1 -1
  181. package/dist/hooks/jev/resolver.js +17 -1
  182. package/dist/hooks/jev/resolver.js.map +1 -1
  183. package/dist/hooks/keyword-detector/index.d.ts +2 -0
  184. package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
  185. package/dist/hooks/keyword-detector/index.js +3 -3
  186. package/dist/hooks/keyword-detector/index.js.map +1 -1
  187. package/dist/hooks/keyword-detector/jev-shadow.d.ts +6 -4
  188. package/dist/hooks/keyword-detector/jev-shadow.d.ts.map +1 -1
  189. package/dist/hooks/keyword-detector/jev-shadow.js +18 -4
  190. package/dist/hooks/keyword-detector/jev-shadow.js.map +1 -1
  191. package/dist/hooks/learner/jev-shadow.d.ts +4 -3
  192. package/dist/hooks/learner/jev-shadow.d.ts.map +1 -1
  193. package/dist/hooks/learner/jev-shadow.js +14 -3
  194. package/dist/hooks/learner/jev-shadow.js.map +1 -1
  195. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  196. package/dist/hooks/persistent-mode/index.js +22 -6
  197. package/dist/hooks/persistent-mode/index.js.map +1 -1
  198. package/dist/hooks/persistent-mode/jev-shadow.d.ts +7 -5
  199. package/dist/hooks/persistent-mode/jev-shadow.d.ts.map +1 -1
  200. package/dist/hooks/persistent-mode/jev-shadow.js +28 -6
  201. package/dist/hooks/persistent-mode/jev-shadow.js.map +1 -1
  202. package/dist/hooks/preemptive-compaction/__tests__/jev-shadow.test.js +3 -3
  203. package/dist/hooks/preemptive-compaction/__tests__/jev-shadow.test.js.map +1 -1
  204. package/dist/hooks/preemptive-compaction/index.d.ts +5 -1
  205. package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -1
  206. package/dist/hooks/preemptive-compaction/index.js +13 -8
  207. package/dist/hooks/preemptive-compaction/index.js.map +1 -1
  208. package/dist/hooks/preemptive-compaction/jev-shadow.d.ts +6 -5
  209. package/dist/hooks/preemptive-compaction/jev-shadow.d.ts.map +1 -1
  210. package/dist/hooks/preemptive-compaction/jev-shadow.js +18 -5
  211. package/dist/hooks/preemptive-compaction/jev-shadow.js.map +1 -1
  212. package/dist/hooks/ralph/__tests__/feedback-baseline.test.d.ts +2 -0
  213. package/dist/hooks/ralph/__tests__/feedback-baseline.test.d.ts.map +1 -0
  214. package/dist/hooks/ralph/__tests__/feedback-baseline.test.js +250 -0
  215. package/dist/hooks/ralph/__tests__/feedback-baseline.test.js.map +1 -0
  216. package/dist/hooks/ralph/feedback-baseline.d.ts +58 -0
  217. package/dist/hooks/ralph/feedback-baseline.d.ts.map +1 -0
  218. package/dist/hooks/ralph/feedback-baseline.js +141 -0
  219. package/dist/hooks/ralph/feedback-baseline.js.map +1 -0
  220. package/dist/hooks/ralph/index.d.ts +1 -1
  221. package/dist/hooks/ralph/index.d.ts.map +1 -1
  222. package/dist/hooks/ralph/index.js +1 -1
  223. package/dist/hooks/ralph/index.js.map +1 -1
  224. package/dist/hooks/ralph/jev-shadow.d.ts +4 -3
  225. package/dist/hooks/ralph/jev-shadow.d.ts.map +1 -1
  226. package/dist/hooks/ralph/jev-shadow.js +14 -4
  227. package/dist/hooks/ralph/jev-shadow.js.map +1 -1
  228. package/dist/hooks/ralph/loop.d.ts +7 -0
  229. package/dist/hooks/ralph/loop.d.ts.map +1 -1
  230. package/dist/hooks/ralph/loop.js +21 -0
  231. package/dist/hooks/ralph/loop.js.map +1 -1
  232. package/dist/hooks/ralph/prd.d.ts +17 -0
  233. package/dist/hooks/ralph/prd.d.ts.map +1 -1
  234. package/dist/hooks/ralph/prd.js +26 -1
  235. package/dist/hooks/ralph/prd.js.map +1 -1
  236. package/dist/hooks/registry/__tests__/registry.test.js +12 -4
  237. package/dist/hooks/registry/__tests__/registry.test.js.map +1 -1
  238. package/dist/hooks/rules-injector/matcher.d.ts.map +1 -1
  239. package/dist/hooks/rules-injector/matcher.js +35 -7
  240. package/dist/hooks/rules-injector/matcher.js.map +1 -1
  241. package/dist/hooks/rules-injector/matcher.test.d.ts +2 -0
  242. package/dist/hooks/rules-injector/matcher.test.d.ts.map +1 -0
  243. package/dist/hooks/rules-injector/matcher.test.js +58 -0
  244. package/dist/hooks/rules-injector/matcher.test.js.map +1 -0
  245. package/dist/hooks/session-end/__tests__/action-runner.test.js +51 -0
  246. package/dist/hooks/session-end/__tests__/action-runner.test.js.map +1 -1
  247. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.d.ts +2 -0
  248. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.d.ts.map +1 -0
  249. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js +274 -0
  250. package/dist/hooks/session-end/__tests__/chain-enqueuer.test.js.map +1 -0
  251. package/dist/hooks/session-end/__tests__/check-evidence.test.d.ts +2 -0
  252. package/dist/hooks/session-end/__tests__/check-evidence.test.d.ts.map +1 -0
  253. package/dist/hooks/session-end/__tests__/check-evidence.test.js +171 -0
  254. package/dist/hooks/session-end/__tests__/check-evidence.test.js.map +1 -0
  255. package/dist/hooks/session-end/__tests__/cleanup-manifest.test.js +21 -0
  256. package/dist/hooks/session-end/__tests__/cleanup-manifest.test.js.map +1 -1
  257. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.d.ts +10 -0
  258. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.d.ts.map +1 -0
  259. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js +123 -0
  260. package/dist/hooks/session-end/__tests__/foreground-bootstrap.test.js.map +1 -0
  261. package/dist/hooks/session-end/__tests__/guardrails.test.d.ts +2 -0
  262. package/dist/hooks/session-end/__tests__/guardrails.test.d.ts.map +1 -0
  263. package/dist/hooks/session-end/__tests__/guardrails.test.js +184 -0
  264. package/dist/hooks/session-end/__tests__/guardrails.test.js.map +1 -0
  265. package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.d.ts +9 -0
  266. package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.d.ts.map +1 -0
  267. package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.js +96 -0
  268. package/dist/hooks/session-end/__tests__/process-session-end-worker-spawn.test.js.map +1 -0
  269. package/dist/hooks/session-end/__tests__/routing.test.d.ts +2 -0
  270. package/dist/hooks/session-end/__tests__/routing.test.d.ts.map +1 -0
  271. package/dist/hooks/session-end/__tests__/routing.test.js +135 -0
  272. package/dist/hooks/session-end/__tests__/routing.test.js.map +1 -0
  273. package/dist/hooks/session-end/__tests__/spawn-next.test.d.ts +2 -0
  274. package/dist/hooks/session-end/__tests__/spawn-next.test.d.ts.map +1 -0
  275. package/dist/hooks/session-end/__tests__/spawn-next.test.js +501 -0
  276. package/dist/hooks/session-end/__tests__/spawn-next.test.js.map +1 -0
  277. package/dist/hooks/session-end/__tests__/worker.test.js +102 -0
  278. package/dist/hooks/session-end/__tests__/worker.test.js.map +1 -1
  279. package/dist/hooks/session-end/action-runner.d.ts.map +1 -1
  280. package/dist/hooks/session-end/action-runner.js +24 -2
  281. package/dist/hooks/session-end/action-runner.js.map +1 -1
  282. package/dist/hooks/session-end/chain-enqueuer.d.ts +45 -0
  283. package/dist/hooks/session-end/chain-enqueuer.d.ts.map +1 -0
  284. package/dist/hooks/session-end/chain-enqueuer.js +191 -0
  285. package/dist/hooks/session-end/chain-enqueuer.js.map +1 -0
  286. package/dist/hooks/session-end/check-evidence.d.ts +29 -0
  287. package/dist/hooks/session-end/check-evidence.d.ts.map +1 -0
  288. package/dist/hooks/session-end/check-evidence.js +52 -0
  289. package/dist/hooks/session-end/check-evidence.js.map +1 -0
  290. package/dist/hooks/session-end/cleanup-manifest.d.ts +1 -1
  291. package/dist/hooks/session-end/cleanup-manifest.d.ts.map +1 -1
  292. package/dist/hooks/session-end/cleanup-manifest.js +22 -2
  293. package/dist/hooks/session-end/cleanup-manifest.js.map +1 -1
  294. package/dist/hooks/session-end/foreground-bootstrap.d.ts.map +1 -1
  295. package/dist/hooks/session-end/foreground-bootstrap.js +30 -4
  296. package/dist/hooks/session-end/foreground-bootstrap.js.map +1 -1
  297. package/dist/hooks/session-end/guardrails.d.ts +67 -0
  298. package/dist/hooks/session-end/guardrails.d.ts.map +1 -0
  299. package/dist/hooks/session-end/guardrails.js +149 -0
  300. package/dist/hooks/session-end/guardrails.js.map +1 -0
  301. package/dist/hooks/session-end/index.d.ts.map +1 -1
  302. package/dist/hooks/session-end/index.js +14 -6
  303. package/dist/hooks/session-end/index.js.map +1 -1
  304. package/dist/hooks/session-end/routing.d.ts +53 -0
  305. package/dist/hooks/session-end/routing.d.ts.map +1 -0
  306. package/dist/hooks/session-end/routing.js +75 -0
  307. package/dist/hooks/session-end/routing.js.map +1 -0
  308. package/dist/hooks/session-end/spawn-next.d.ts +117 -0
  309. package/dist/hooks/session-end/spawn-next.d.ts.map +1 -0
  310. package/dist/hooks/session-end/spawn-next.js +292 -0
  311. package/dist/hooks/session-end/spawn-next.js.map +1 -0
  312. package/dist/hooks/session-end/worker.d.ts.map +1 -1
  313. package/dist/hooks/session-end/worker.js +45 -5
  314. package/dist/hooks/session-end/worker.js.map +1 -1
  315. package/dist/hooks/task-size-detector/jev-shadow.d.ts +2 -1
  316. package/dist/hooks/task-size-detector/jev-shadow.d.ts.map +1 -1
  317. package/dist/hooks/task-size-detector/jev-shadow.js +19 -1
  318. package/dist/hooks/task-size-detector/jev-shadow.js.map +1 -1
  319. package/dist/installer/__tests__/hook-command-portability.test.js +57 -1
  320. package/dist/installer/__tests__/hook-command-portability.test.js.map +1 -1
  321. package/dist/installer/__tests__/mcp-registry.test.js +98 -0
  322. package/dist/installer/__tests__/mcp-registry.test.js.map +1 -1
  323. package/dist/installer/hooks.d.ts +7 -0
  324. package/dist/installer/hooks.d.ts.map +1 -1
  325. package/dist/installer/hooks.js +15 -0
  326. package/dist/installer/hooks.js.map +1 -1
  327. package/dist/installer/index.d.ts +12 -0
  328. package/dist/installer/index.d.ts.map +1 -1
  329. package/dist/installer/index.js +3 -1
  330. package/dist/installer/index.js.map +1 -1
  331. package/dist/installer/mcp-registry.d.ts.map +1 -1
  332. package/dist/installer/mcp-registry.js +56 -6
  333. package/dist/installer/mcp-registry.js.map +1 -1
  334. package/dist/lib/__tests__/host-load-gate.test.d.ts +2 -0
  335. package/dist/lib/__tests__/host-load-gate.test.d.ts.map +1 -0
  336. package/dist/lib/__tests__/host-load-gate.test.js +377 -0
  337. package/dist/lib/__tests__/host-load-gate.test.js.map +1 -0
  338. package/dist/lib/__tests__/runs-ledger.test.d.ts +2 -0
  339. package/dist/lib/__tests__/runs-ledger.test.d.ts.map +1 -0
  340. package/dist/lib/__tests__/runs-ledger.test.js +99 -0
  341. package/dist/lib/__tests__/runs-ledger.test.js.map +1 -0
  342. package/dist/lib/atomic-write.d.ts +16 -0
  343. package/dist/lib/atomic-write.d.ts.map +1 -1
  344. package/dist/lib/atomic-write.js +27 -4
  345. package/dist/lib/atomic-write.js.map +1 -1
  346. package/dist/lib/host-load-gate.d.ts +110 -0
  347. package/dist/lib/host-load-gate.d.ts.map +1 -0
  348. package/dist/lib/host-load-gate.js +228 -0
  349. package/dist/lib/host-load-gate.js.map +1 -0
  350. package/dist/lib/mode-state-io.d.ts.map +1 -1
  351. package/dist/lib/mode-state-io.js +55 -18
  352. package/dist/lib/mode-state-io.js.map +1 -1
  353. package/dist/lib/runs-ledger.d.ts +45 -0
  354. package/dist/lib/runs-ledger.d.ts.map +1 -0
  355. package/dist/lib/runs-ledger.js +141 -0
  356. package/dist/lib/runs-ledger.js.map +1 -0
  357. package/dist/platform/executable-resolution.d.ts +13 -0
  358. package/dist/platform/executable-resolution.d.ts.map +1 -1
  359. package/dist/platform/executable-resolution.js +16 -0
  360. package/dist/platform/executable-resolution.js.map +1 -1
  361. package/dist/shared/types.d.ts +3 -0
  362. package/dist/shared/types.d.ts.map +1 -1
  363. package/dist/team/__tests__/model-contract.test.js +63 -1
  364. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  365. package/dist/team/__tests__/stage-router.test.js +22 -0
  366. package/dist/team/__tests__/stage-router.test.js.map +1 -1
  367. package/dist/team/__tests__/team-owner-epoch.test.js +33 -0
  368. package/dist/team/__tests__/team-owner-epoch.test.js.map +1 -1
  369. package/dist/team/__tests__/tmux-session.create-team.test.js +60 -2
  370. package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
  371. package/dist/team/__tests__/tmux-session.psmux.test.js +12 -0
  372. package/dist/team/__tests__/tmux-session.psmux.test.js.map +1 -1
  373. package/dist/team/__tests__/tmux-session.test.js +230 -7
  374. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  375. package/dist/team/__tests__/worker-launch-ack.test.js +62 -0
  376. package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
  377. package/dist/team/model-contract.d.ts +3 -2
  378. package/dist/team/model-contract.d.ts.map +1 -1
  379. package/dist/team/model-contract.js +35 -10
  380. package/dist/team/model-contract.js.map +1 -1
  381. package/dist/team/runtime-v2.d.ts +13 -0
  382. package/dist/team/runtime-v2.d.ts.map +1 -1
  383. package/dist/team/runtime-v2.js +112 -7
  384. package/dist/team/runtime-v2.js.map +1 -1
  385. package/dist/team/scaling.d.ts.map +1 -1
  386. package/dist/team/scaling.js +4 -1
  387. package/dist/team/scaling.js.map +1 -1
  388. package/dist/team/stage-router.d.ts.map +1 -1
  389. package/dist/team/stage-router.js +3 -1
  390. package/dist/team/stage-router.js.map +1 -1
  391. package/dist/team/team-owner-epoch.d.ts.map +1 -1
  392. package/dist/team/team-owner-epoch.js +4 -7
  393. package/dist/team/team-owner-epoch.js.map +1 -1
  394. package/dist/team/tmux-session.d.ts +8 -1
  395. package/dist/team/tmux-session.d.ts.map +1 -1
  396. package/dist/team/tmux-session.js +71 -19
  397. package/dist/team/tmux-session.js.map +1 -1
  398. package/dist/team/worker-launch-ack.d.ts +1 -1
  399. package/dist/team/worker-launch-ack.d.ts.map +1 -1
  400. package/dist/team/worker-launch-ack.js +28 -1
  401. package/dist/team/worker-launch-ack.js.map +1 -1
  402. package/dist/tools/lsp/__tests__/client-handle-data.test.js +83 -0
  403. package/dist/tools/lsp/__tests__/client-handle-data.test.js.map +1 -1
  404. package/dist/tools/lsp/client.d.ts.map +1 -1
  405. package/dist/tools/lsp/client.js +41 -11
  406. package/dist/tools/lsp/client.js.map +1 -1
  407. package/docs/CLAUDE.md +1 -1
  408. package/docs/HOOKS.md +235 -0
  409. package/docs/MIGRATION.md +132 -0
  410. package/docs/REFERENCE.md +26 -1
  411. package/docs/adr/03672-env-activated-active-mode.md +18 -1
  412. package/docs/design/FACTORY-FINAL-DESIGN.md +114 -0
  413. package/docs/design/P2-RUN-LEDGER-AND-INTAKE-PLAN.md +83 -0
  414. package/docs/factory/t6-acceptance/acceptance-comment.md +36 -0
  415. package/hooks/hooks.json +22 -1
  416. package/package.json +6 -2
  417. package/plugin.json +1 -1
  418. package/scripts/build-contained-fs.mjs +24 -2
  419. package/scripts/ci/check-multirepo-paths.mjs +3 -0
  420. package/scripts/code-simplifier.mjs +24 -2
  421. package/scripts/dev/repro-state-lock.mjs +67 -0
  422. package/scripts/git-guardrails.mjs +581 -0
  423. package/scripts/keyword-detector.mjs +21 -4
  424. package/scripts/lib/atomic-write.mjs +31 -8
  425. package/scripts/lib/jev-shadow.mjs +68 -29
  426. package/scripts/lib/run-reaper.mjs +114 -0
  427. package/scripts/lib/state-lock.mjs +22 -13
  428. package/scripts/post-tool-verifier.mjs +8 -2
  429. package/scripts/postinstall-contained-fs.mjs +56 -0
  430. package/scripts/pre-tool-enforcer.mjs +25 -8
  431. package/scripts/run.cjs +18 -0
  432. package/scripts/runs-reconciler.mjs +103 -0
  433. package/scripts/stale-run-reporter.mjs +73 -0
  434. package/scripts/workflow-drift-guard.mjs +6 -1
  435. package/skills/autopilot/SKILL.md +10 -2
  436. package/skills/harbor/SKILL.md +8 -0
  437. package/skills/omc-setup/phases/04-welcome.md +1 -1
  438. package/skills/ralph/SKILL.md +32 -15
  439. package/skills/refit/SKILL.md +8 -0
  440. package/skills/team/SKILL.md +2 -0
  441. package/templates/hooks/code-simplifier.mjs +24 -2
  442. package/templates/hooks/lib/atomic-write.mjs +31 -8
  443. package/templates/hooks/session-end.mjs +99 -0
  444. package/templates/hooks/workflow-drift-guard.mjs +6 -1
@@ -8252,7 +8252,7 @@ function getNativeContainedFs() {
8252
8252
  loaded = (0, import_node_module.createRequire)(importMetaUrl)(binary);
8253
8253
  return loaded;
8254
8254
  } catch (cause) {
8255
- throw new Error(`The contained filesystem backend is unavailable at ${binary}. Build it with node scripts/build-contained-fs.mjs before running graph commands.`, { cause });
8255
+ throw new Error(`The contained filesystem backend is unavailable at ${binary}. Build it with node scripts/build-contained-fs.mjs (from the installed package directory) before running graph or team commands.`, { cause });
8256
8256
  }
8257
8257
  }
8258
8258
  }
@@ -8318,7 +8318,7 @@ function probeProcessStartIdentityForPlatform(pid, platform, exec2, read, strict
8318
8318
  ["-NoProfile", "-NonInteractive", "-Command", command],
8319
8319
  { encoding: "utf8", windowsHide: true }
8320
8320
  ).trim();
8321
- return /^\d+$/.test(ticks) ? { identity: `win32:${ticks}`, precise: true } : { identity: null, precise: false };
8321
+ return /^[1-9]\d*$/.test(ticks) ? { identity: `win32:${ticks}`, precise: true } : { identity: null, precise: false };
8322
8322
  }
8323
8323
  if (platform === "darwin") {
8324
8324
  if (strict) {
@@ -11625,11 +11625,11 @@ function tmuxEnv() {
11625
11625
  function resolveEnv(opts) {
11626
11626
  return opts?.stripTmux ? tmuxEnv() : process.env;
11627
11627
  }
11628
- function quoteForCmd(arg) {
11629
- assertSafeCmdValue(arg);
11630
- if (arg.length === 0) return '""';
11631
- if (!/[\s"%^&|<>()]/.test(arg)) return arg;
11632
- return `"${arg.replace(/(["%])/g, "$1$1")}"`;
11628
+ function quoteForTmuxCmdLayer(command) {
11629
+ assertSafeCmdValue(command);
11630
+ if (command.length === 0) return '""';
11631
+ if (!/[\s"%^&|<>()]/.test(command)) return command;
11632
+ return `"${command.replace(/(["%])/g, "$1$1")}"`;
11633
11633
  }
11634
11634
  function assertSafeCmdValue(value) {
11635
11635
  if (/[\0\r\n]/.test(value)) {
@@ -11640,7 +11640,7 @@ function resolveTmuxInvocation(args) {
11640
11640
  const resolvedBinary = resolveTmuxBinaryPath();
11641
11641
  if (process.platform === "win32" && /\.(cmd|bat)$/i.test(resolvedBinary)) {
11642
11642
  const comspec = process.env.COMSPEC || "cmd.exe";
11643
- const commandLine = [quoteForCmd(resolvedBinary), ...args.map(quoteForCmd)].join(" ");
11643
+ const commandLine = [quoteForTmuxCmdLayer(resolvedBinary), ...args.map(quoteForTmuxCmdLayer)].join(" ");
11644
11644
  return {
11645
11645
  command: comspec,
11646
11646
  args: ["/d", "/s", "/c", commandLine]
@@ -12080,7 +12080,7 @@ function verifyPrivateTempFile(fd, tempPath, label, operations) {
12080
12080
  `${label} temporary file must be a private regular single-link file`
12081
12081
  );
12082
12082
  }
12083
- if (fdStats.dev !== pathStats.dev || fdStats.ino !== pathStats.ino) {
12083
+ if (!sameFileIdentity(fdStats, pathStats)) {
12084
12084
  throw new Error(`${label} temporary file was replaced before rename`);
12085
12085
  }
12086
12086
  }
@@ -12092,7 +12092,7 @@ function verifyPublishedFile(fd, filePath, label, operations) {
12092
12092
  } catch {
12093
12093
  throw new Error(`${label} target was replaced at publication`);
12094
12094
  }
12095
- if (!pathStats.isFile() || fdStats.dev !== pathStats.dev || fdStats.ino !== pathStats.ino) {
12095
+ if (!pathStats.isFile() || !sameFileIdentity(fdStats, pathStats)) {
12096
12096
  throw new Error(`${label} target was replaced at publication`);
12097
12097
  }
12098
12098
  }
@@ -12116,6 +12116,14 @@ function preservePriorTarget(filePath, operations) {
12116
12116
  return null;
12117
12117
  }
12118
12118
  }
12119
+ function sameFileIdentity(a, b) {
12120
+ if (a.ino !== b.ino) return false;
12121
+ const isWindows = process.platform === "win32";
12122
+ if (isWindows && (a.dev === 0 || b.dev === 0)) {
12123
+ return true;
12124
+ }
12125
+ return a.dev === b.dev;
12126
+ }
12119
12127
  function currentFileIdentity(filePath, operations) {
12120
12128
  try {
12121
12129
  const stats = (operations?.lstat ?? fsSync.lstatSync)(filePath);
@@ -12136,7 +12144,7 @@ function rollbackPriorTarget(filePath, backupPath, expectedIdentity, operations)
12136
12144
  if (expectedIdentity === null) return;
12137
12145
  const current = currentFileIdentity(filePath, operations);
12138
12146
  if (current === null) return;
12139
- if (expectedIdentity !== null && (current.dev !== expectedIdentity.dev || current.ino !== expectedIdentity.ino)) {
12147
+ if (expectedIdentity !== null && !sameFileIdentity(current, expectedIdentity)) {
12140
12148
  return;
12141
12149
  }
12142
12150
  try {
@@ -12433,6 +12441,18 @@ var init_file_lock = __esm({
12433
12441
  }
12434
12442
  });
12435
12443
 
12444
+ // src/lib/host-load-gate.ts
12445
+ var import_os6, import_fs20, import_path22;
12446
+ var init_host_load_gate = __esm({
12447
+ "src/lib/host-load-gate.ts"() {
12448
+ "use strict";
12449
+ import_os6 = require("os");
12450
+ import_fs20 = require("fs");
12451
+ import_path22 = require("path");
12452
+ init_paths();
12453
+ }
12454
+ });
12455
+
12436
12456
  // src/team/worker-launch-ack.ts
12437
12457
  function buildWindowsSupervisorSource() {
12438
12458
  return [
@@ -12498,7 +12518,11 @@ function normalizeProviderEnvironment(value, platform = process.platform) {
12498
12518
  }
12499
12519
  return normalized;
12500
12520
  }
12501
- function buildProviderEnvironment(providerEnv, sourceEnv = process.env, platform = process.platform) {
12521
+ function parseEnvPassthrough(value) {
12522
+ if (!value || value.trim().length === 0) return [];
12523
+ return value.split(",").map((k) => k.trim()).filter((k) => k.length > 0);
12524
+ }
12525
+ function buildProviderEnvironment(providerEnv, sourceEnv = process.env, platform = process.platform, envPassthrough) {
12502
12526
  const normalized = normalizeProviderEnvironment(providerEnv, platform);
12503
12527
  const baseline = {};
12504
12528
  for (const key of SAFE_BASELINE_ENV_KEYS) {
@@ -12519,6 +12543,14 @@ function buildProviderEnvironment(providerEnv, sourceEnv = process.env, platform
12519
12543
  const homeKey = platform === "win32" ? "USERPROFILE" : "HOME";
12520
12544
  const home = platform === "win32" ? Object.entries(sourceEnv).find(([key]) => key.toUpperCase() === homeKey)?.[1] : sourceEnv[homeKey];
12521
12545
  if (typeof home === "string" && home.length > 0) baseline[homeKey] = home;
12546
+ const passthroughList = envPassthrough ?? parseEnvPassthrough(sourceEnv.OMC_TEAM_WORKER_ENV_PASSTHROUGH);
12547
+ for (const key of passthroughList) {
12548
+ if (!isValidEnvironmentKey(key)) throw new Error("worker_launch_env_passthrough_key_invalid");
12549
+ if (WORKER_LAUNCH_INTERNAL_ENV_KEYS.has(key)) throw new Error("worker_launch_env_passthrough_key_reserved");
12550
+ if (platform === "win32" && WINDOWS_RESERVED_ENV_KEYS.has(key.toUpperCase())) throw new Error("worker_launch_env_passthrough_key_reserved");
12551
+ const value = sourceEnv[key];
12552
+ if (typeof value === "string") baseline[key] = value;
12553
+ }
12522
12554
  if (platform === "win32") {
12523
12555
  for (const key of Object.keys(normalized)) {
12524
12556
  const baselineKey = Object.keys(baseline).find((candidate) => candidate.toUpperCase() === key.toUpperCase());
@@ -13256,6 +13288,7 @@ var init_worker_launch_ack = __esm({
13256
13288
  init_state_paths();
13257
13289
  init_atomic_write();
13258
13290
  init_file_lock();
13291
+ init_host_load_gate();
13259
13292
  WORKER_LAUNCH_SCHEMA_VERSION = 1;
13260
13293
  DEFAULT_ACK_TIMEOUT_MS = 8e3;
13261
13294
  DEFAULT_POLL_INTERVAL_MS = 25;
@@ -13303,13 +13336,13 @@ var init_worker_launch_ack = __esm({
13303
13336
  });
13304
13337
 
13305
13338
  // src/team/recovery-request-store.ts
13306
- var import_crypto6, import_fs20, import_path22, RETENTION_MS;
13339
+ var import_crypto6, import_fs21, import_path23, RETENTION_MS;
13307
13340
  var init_recovery_request_store = __esm({
13308
13341
  "src/team/recovery-request-store.ts"() {
13309
13342
  "use strict";
13310
13343
  import_crypto6 = require("crypto");
13311
- import_fs20 = require("fs");
13312
- import_path22 = require("path");
13344
+ import_fs21 = require("fs");
13345
+ import_path23 = require("path");
13313
13346
  init_types2();
13314
13347
  init_state_paths();
13315
13348
  init_process_identity_lock();
@@ -13394,6 +13427,7 @@ __export(tmux_session_exports, {
13394
13427
  spawnWorkerInPane: () => spawnWorkerInPane,
13395
13428
  splitTeamWorkerPane: () => splitTeamWorkerPane,
13396
13429
  splitTeamWorkerPaneWithEvidence: () => splitTeamWorkerPaneWithEvidence,
13430
+ strictIdentityUnavailableError: () => strictIdentityUnavailableError,
13397
13431
  validateTmux: () => validateTmux,
13398
13432
  verifyTeamTargetOwnership: () => verifyTeamTargetOwnership,
13399
13433
  waitForPaneReady: () => waitForPaneReady,
@@ -13405,7 +13439,7 @@ function tmuxArgsForIdentity(identity, args) {
13405
13439
  return ["-S", identity.socket_path, ...args];
13406
13440
  }
13407
13441
  function buildDetachedTmuxServerKeepaliveArgs(socketPath) {
13408
- if (!(0, import_path23.isAbsolute)(socketPath) && !import_path23.win32.isAbsolute(socketPath)) {
13442
+ if (!(0, import_path24.isAbsolute)(socketPath) && !import_path24.win32.isAbsolute(socketPath)) {
13409
13443
  throw new Error("tmux_private_socket_path_not_absolute");
13410
13444
  }
13411
13445
  return [
@@ -13421,8 +13455,8 @@ function buildDetachedTmuxServerKeepaliveArgs(socketPath) {
13421
13455
  }
13422
13456
  function buildPrivateTmuxSocketPath() {
13423
13457
  if (isPsmux()) return buildPsmuxNamespacePath();
13424
- const socketDirectory = process.platform === "darwin" || process.platform === "linux" ? "/tmp" : (0, import_os6.tmpdir)();
13425
- const socketPath = (0, import_path23.join)(
13458
+ const socketDirectory = process.platform === "darwin" || process.platform === "linux" ? "/tmp" : (0, import_os7.tmpdir)();
13459
+ const socketPath = (0, import_path24.join)(
13426
13460
  socketDirectory,
13427
13461
  `o-${process.pid.toString(36)}-${Date.now().toString(36)}-${(0, import_crypto7.randomUUID)().slice(0, 8)}.sock`
13428
13462
  );
@@ -13444,19 +13478,19 @@ function resolveTmuxServerGuardRuntime() {
13444
13478
  } catch {
13445
13479
  throw new Error("tmux_server_guard_runtime_path_unavailable");
13446
13480
  }
13447
- if (!(0, import_path23.isAbsolute)(runtimePath) && !import_path23.win32.isAbsolute(runtimePath) || !isRegularFile(runtimePath)) {
13481
+ if (!(0, import_path24.isAbsolute)(runtimePath) && !import_path24.win32.isAbsolute(runtimePath) || !isRegularFile(runtimePath)) {
13448
13482
  throw new Error("tmux_server_guard_runtime_path_unavailable");
13449
13483
  }
13450
13484
  const nodePath = process.execPath;
13451
- if (!(0, import_path23.isAbsolute)(nodePath) && !import_path23.win32.isAbsolute(nodePath) || !isRegularFile(nodePath)) {
13485
+ if (!(0, import_path24.isAbsolute)(nodePath) && !import_path24.win32.isAbsolute(nodePath) || !isRegularFile(nodePath)) {
13452
13486
  throw new Error("tmux_server_guard_node_path_unavailable");
13453
13487
  }
13454
13488
  return { nodePath, runtimePath };
13455
13489
  }
13456
13490
  function isRegularFile(path5) {
13457
- if (!(0, import_fs21.existsSync)(path5)) return false;
13491
+ if (!(0, import_fs22.existsSync)(path5)) return false;
13458
13492
  try {
13459
- return (0, import_fs21.statSync)(path5).isFile();
13493
+ return (0, import_fs22.statSync)(path5).isFile();
13460
13494
  } catch {
13461
13495
  return false;
13462
13496
  }
@@ -13488,6 +13522,13 @@ function parseTmuxServerFields(output) {
13488
13522
  function buildTmuxServerIdentity(socketPath, pid, processIdentity) {
13489
13523
  const processStartedAt = processIdentity(pid);
13490
13524
  if (!processStartedAt || !isValidStrictProcessStartIdentity(processStartedAt)) return null;
13525
+ if (process.platform === "win32") {
13526
+ try {
13527
+ process.kill(pid, 0);
13528
+ } catch {
13529
+ return null;
13530
+ }
13531
+ }
13491
13532
  const identity = {
13492
13533
  socket_path: socketPath,
13493
13534
  server_pid: pid,
@@ -13540,17 +13581,26 @@ async function captureTmuxServerIdentity(selectedEndpoint, dependencies = {}) {
13540
13581
  async function observeTmuxServerIdentity(expected, dependencies = {}) {
13541
13582
  const deps = { ...defaultTmuxServerIdentityDependencies, ...dependencies };
13542
13583
  if (!isValidTmuxServerIdentity(expected) || !isValidStrictProcessStartIdentity(expected.process_started_at)) return "unknown";
13543
- let processState;
13544
- try {
13545
- processState = deps.processObservation({
13546
- server_pid: expected.server_pid,
13547
- process_started_at: expected.process_started_at
13548
- });
13549
- } catch {
13550
- return "unknown";
13584
+ const singleWindowsProbe = process.platform === "win32" && dependencies.processObservation === void 0;
13585
+ if (singleWindowsProbe) {
13586
+ try {
13587
+ process.kill(expected.server_pid, 0);
13588
+ } catch (error2) {
13589
+ return error2.code === "ESRCH" ? "dead" : "unknown";
13590
+ }
13591
+ } else {
13592
+ let processState;
13593
+ try {
13594
+ processState = deps.processObservation({
13595
+ server_pid: expected.server_pid,
13596
+ process_started_at: expected.process_started_at
13597
+ });
13598
+ } catch {
13599
+ return "unknown";
13600
+ }
13601
+ if (processState === "dead") return "dead";
13602
+ if (processState !== "matching") return "unknown";
13551
13603
  }
13552
- if (processState === "dead") return "dead";
13553
- if (processState !== "matching") return "unknown";
13554
13604
  try {
13555
13605
  const result = await deps.tmuxQuery(
13556
13606
  tmuxArgsForIdentity(expected, ["display-message", "-p", "#{pid}"]),
@@ -13562,7 +13612,15 @@ async function observeTmuxServerIdentity(expected, dependencies = {}) {
13562
13612
  const actualPid = parseExactPositivePid(lines[0]);
13563
13613
  if (actualPid !== expected.server_pid) return "unknown";
13564
13614
  const actualStart = deps.processIdentity(actualPid);
13615
+ if (singleWindowsProbe && actualStart && isValidStrictProcessStartIdentity(actualStart) && actualStart !== expected.process_started_at) return "dead";
13565
13616
  if (!actualStart || actualStart !== expected.process_started_at) return "unknown";
13617
+ if (singleWindowsProbe) {
13618
+ try {
13619
+ process.kill(actualPid, 0);
13620
+ } catch (error2) {
13621
+ return error2.code === "ESRCH" ? "dead" : "unknown";
13622
+ }
13623
+ }
13566
13624
  return "matching";
13567
13625
  } catch {
13568
13626
  return "unknown";
@@ -14070,7 +14128,7 @@ function getDefaultShell() {
14070
14128
  return process.env.COMSPEC || "cmd.exe";
14071
14129
  }
14072
14130
  const shell = process.env.SHELL || "/bin/bash";
14073
- const name = (0, import_path23.basename)(shell.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
14131
+ const name = (0, import_path24.basename)(shell.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
14074
14132
  if (!SUPPORTED_POSIX_SHELLS.has(name)) {
14075
14133
  return "/bin/sh";
14076
14134
  }
@@ -14080,7 +14138,7 @@ function pathEntries(envPath) {
14080
14138
  return (envPath ?? "").split(process.platform === "win32" ? ";" : ":").map((entry) => entry.trim()).filter(Boolean);
14081
14139
  }
14082
14140
  function pathCandidateNames(candidatePath) {
14083
- const base = (0, import_path23.basename)(candidatePath.replace(/\\/g, "/"));
14141
+ const base = (0, import_path24.basename)(candidatePath.replace(/\\/g, "/"));
14084
14142
  const bare = base.replace(/\.(exe|cmd|bat)$/i, "");
14085
14143
  if (process.platform === "win32") {
14086
14144
  return Array.from(/* @__PURE__ */ new Set([`${bare}.exe`, `${bare}.cmd`, `${bare}.bat`, bare]));
@@ -14090,15 +14148,15 @@ function pathCandidateNames(candidatePath) {
14090
14148
  function resolveShellFromPath(candidatePath) {
14091
14149
  for (const dir of pathEntries(process.env.PATH)) {
14092
14150
  for (const name of pathCandidateNames(candidatePath)) {
14093
- const full = (0, import_path23.join)(dir, name);
14094
- if ((0, import_fs21.existsSync)(full)) return full;
14151
+ const full = (0, import_path24.join)(dir, name);
14152
+ if ((0, import_fs22.existsSync)(full)) return full;
14095
14153
  }
14096
14154
  }
14097
14155
  return null;
14098
14156
  }
14099
14157
  function resolveShellFromCandidates(paths, rcFile) {
14100
14158
  for (const p of paths) {
14101
- if ((0, import_fs21.existsSync)(p)) return { shell: p, rcFile };
14159
+ if ((0, import_fs22.existsSync)(p)) return { shell: p, rcFile };
14102
14160
  const resolvedFromPath = resolveShellFromPath(p);
14103
14161
  if (resolvedFromPath) return { shell: resolvedFromPath, rcFile };
14104
14162
  }
@@ -14106,9 +14164,9 @@ function resolveShellFromCandidates(paths, rcFile) {
14106
14164
  }
14107
14165
  function resolveSupportedShellAffinity(shellPath) {
14108
14166
  if (!shellPath) return null;
14109
- const name = (0, import_path23.basename)(shellPath.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
14167
+ const name = (0, import_path24.basename)(shellPath.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "");
14110
14168
  if (name !== "zsh" && name !== "bash") return null;
14111
- if (!(0, import_fs21.existsSync)(shellPath)) return null;
14169
+ if (!(0, import_fs22.existsSync)(shellPath)) return null;
14112
14170
  const home = process.env.HOME ?? "";
14113
14171
  const rcFile = home ? `${home}/.${name}rc` : null;
14114
14172
  return { shell: shellPath, rcFile };
@@ -14141,7 +14199,7 @@ function logWorkerSpawnDiagnostic(message) {
14141
14199
  `);
14142
14200
  }
14143
14201
  function paneCurrentCommandLooksReady(command) {
14144
- const normalized = (0, import_path23.basename)(command.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "").toLowerCase();
14202
+ const normalized = (0, import_path24.basename)(command.replace(/\\/g, "/")).replace(/\.(exe|cmd|bat)$/i, "").toLowerCase();
14145
14203
  return SUPPORTED_POSIX_SHELLS.has(normalized) || ["cmd", "powershell", "pwsh", "nu", "elvish"].includes(normalized);
14146
14204
  }
14147
14205
  async function getPaneCurrentCommandStatus(paneId, tmuxServerIdentity) {
@@ -14275,7 +14333,7 @@ function assertSafeCmdValue2(value) {
14275
14333
  if (/[\r\n\0]/.test(value)) throw new Error("Invalid Windows command value: contains CR, LF, or NUL");
14276
14334
  }
14277
14335
  function shellNameFromPath(shellPath) {
14278
- const shellName = (0, import_path23.basename)(shellPath.replace(/\\/g, "/"));
14336
+ const shellName = (0, import_path24.basename)(shellPath.replace(/\\/g, "/"));
14279
14337
  return shellName.replace(/\.(exe|cmd|bat)$/i, "");
14280
14338
  }
14281
14339
  function shellEscape(value) {
@@ -14287,7 +14345,7 @@ function assertSafeEnvKey(key) {
14287
14345
  }
14288
14346
  }
14289
14347
  function isAbsoluteLaunchBinaryPath(value) {
14290
- return (0, import_path23.isAbsolute)(value) || import_path23.win32.isAbsolute(value);
14348
+ return (0, import_path24.isAbsolute)(value) || import_path24.win32.isAbsolute(value);
14291
14349
  }
14292
14350
  function assertSafeLaunchBinary(launchBinary) {
14293
14351
  if (launchBinary.trim().length === 0) {
@@ -14321,11 +14379,13 @@ function buildWorkerStartCommand(config2) {
14321
14379
  const providerLaunchWords = getLaunchWords(config2);
14322
14380
  const launchWords = config2.launchAttempt ? [process.execPath, config2.launchAttempt.runtimeCliPath, "--worker-launch"] : providerLaunchWords;
14323
14381
  const envVars = config2.launchAttempt ? {
14324
- ...config2.envVars,
14325
14382
  // Supervised launches carry the attempt-owned bootstrap descriptor by
14326
14383
  // path (never inline): secrets stay out of the process list and tmux
14327
14384
  // scrollback, and the delivered command stays small. The runtime CLI
14328
14385
  // validates and consumes the descriptor before running the provider.
14386
+ // Team identity (team_name, worker_name, provider, instance_id) is read
14387
+ // from the descriptor, not from environment vars, keeping the typed
14388
+ // command under 1024 bytes even with long cwd paths.
14329
14389
  OMC_WORKER_LAUNCH_SPEC_FILE: config2.launchAttempt.bootstrapDescriptorPath
14330
14390
  } : config2.envVars;
14331
14391
  const shouldSourceRc = process.env.OMC_TEAM_NO_RC !== "1";
@@ -14615,6 +14675,17 @@ async function splitTeamWorkerPaneWithEvidence(splitTarget, direction, cwd, prov
14615
14675
  async function splitTeamWorkerPane(splitTarget, direction, cwd) {
14616
14676
  return (await splitTeamWorkerPaneWithEvidence(splitTarget, direction, cwd)).paneId;
14617
14677
  }
14678
+ function strictIdentityUnavailableError(platform, loadNative = getNativeContainedFs) {
14679
+ if (platform === "darwin") {
14680
+ try {
14681
+ loadNative();
14682
+ } catch (cause) {
14683
+ const detail = cause instanceof Error ? cause.message : String(cause);
14684
+ return new Error(`tmux_server_identity_probe_unavailable: ${detail}`, { cause });
14685
+ }
14686
+ }
14687
+ return new Error("tmux_server_identity_probe_unavailable");
14688
+ }
14618
14689
  async function createTeamSession(teamName, workerCount, cwd, options = {}) {
14619
14690
  const multiplexerContext = isPsmux() ? "none" : detectTeamMultiplexerContext();
14620
14691
  const inTmux = multiplexerContext === "tmux";
@@ -14624,7 +14695,7 @@ async function createTeamSession(teamName, workerCount, cwd, options = {}) {
14624
14695
  validateTmux();
14625
14696
  }
14626
14697
  if (!inCmux && !currentStrictProcessStartIdentity()) {
14627
- throw new Error("tmux_server_identity_probe_unavailable");
14698
+ throw strictIdentityUnavailableError(process.platform);
14628
14699
  }
14629
14700
  let tmuxServerIdentity;
14630
14701
  let freshDetachedServerIdentity;
@@ -14674,7 +14745,7 @@ async function createTeamSession(teamName, workerCount, cwd, options = {}) {
14674
14745
  "-d",
14675
14746
  "-P",
14676
14747
  "-F",
14677
- "#S:0 #{pane_id} #{socket_path} #{pid}",
14748
+ "#S:#{window_index} #{pane_id} #{socket_path} #{pid}",
14678
14749
  "-s",
14679
14750
  detachedSessionName,
14680
14751
  "-c",
@@ -15368,7 +15439,7 @@ async function spawnWorkerInPane(sessionName2, paneId, config2) {
15368
15439
  if (config2.launchAttempt) {
15369
15440
  await revokeWorkerLaunchAttempt(config2.launchAttempt, "launch_failed").catch(() => void 0);
15370
15441
  }
15371
- if (config2.launchAttempt && (!materializedTransport || (0, import_fs21.existsSync)(materializedTransport.bootstrapDescriptorPath))) {
15442
+ if (config2.launchAttempt && (!materializedTransport || (0, import_fs22.existsSync)(materializedTransport.bootstrapDescriptorPath))) {
15372
15443
  const cleaned = await cleanupWorkerLaunchTransport(config2.launchAttempt, "launch_failed").catch(() => false);
15373
15444
  if (!cleaned) {
15374
15445
  logWorkerSpawnDiagnostic(
@@ -16189,7 +16260,7 @@ function parseDedicatedWindowTarget(sessionName2) {
16189
16260
  }
16190
16261
  function normalizeDetachedSessionTarget(sessionName2) {
16191
16262
  const detachedTarget = sessionName2.includes(":") ? parseDedicatedWindowTarget(sessionName2) : null;
16192
- const sessionTarget = detachedTarget ? detachedTarget.windowIndex === "0" ? detachedTarget.sessionName : "" : sessionName2;
16263
+ const sessionTarget = detachedTarget ? detachedTarget.sessionName : sessionName2;
16193
16264
  return sessionTarget && /^[^\s:]+$/.test(sessionTarget) ? sessionTarget : null;
16194
16265
  }
16195
16266
  async function resolveSplitPaneWorkerPaneIds(_sessionName, recordedPaneIds, leaderPaneId) {
@@ -16347,20 +16418,21 @@ async function killTeamSession(sessionName2, workerPaneIds, leaderPaneId, option
16347
16418
  if (result.outcome === "executed") return true;
16348
16419
  return await observeTmuxServerIdentity(identity) === "dead";
16349
16420
  }
16350
- var import_fs21, import_crypto7, import_child_process7, import_util7, import_path23, import_os6, sleep3, execFileAsync2, TMUX_SESSION_PREFIX, defaultTmuxServerIdentityDependencies, guardMarkerCounter, TMUX_MAILBOX_PANE_ID, TMUX_MAILBOX_TARGET, defaultMailboxTargetOwnershipDependencies, defaultDirectMailboxEffectDependencies, TeamSessionCreationError, SUPPORTED_POSIX_SHELLS, ZSH_CANDIDATES, BASH_CANDIDATES, DANGEROUS_LAUNCH_BINARY_CHARS;
16421
+ var import_fs22, import_crypto7, import_child_process7, import_util7, import_path24, import_os7, sleep3, execFileAsync2, TMUX_SESSION_PREFIX, defaultTmuxServerIdentityDependencies, guardMarkerCounter, TMUX_MAILBOX_PANE_ID, TMUX_MAILBOX_TARGET, defaultMailboxTargetOwnershipDependencies, defaultDirectMailboxEffectDependencies, TeamSessionCreationError, SUPPORTED_POSIX_SHELLS, ZSH_CANDIDATES, BASH_CANDIDATES, DANGEROUS_LAUNCH_BINARY_CHARS;
16351
16422
  var init_tmux_session = __esm({
16352
16423
  "src/team/tmux-session.ts"() {
16353
16424
  "use strict";
16354
- import_fs21 = require("fs");
16425
+ import_fs22 = require("fs");
16355
16426
  import_crypto7 = require("crypto");
16356
16427
  import_child_process7 = require("child_process");
16357
16428
  import_util7 = require("util");
16358
- import_path23 = require("path");
16359
- import_os6 = require("os");
16429
+ import_path24 = require("path");
16430
+ import_os7 = require("os");
16360
16431
  init_team_name();
16361
16432
  init_tmux_utils();
16362
16433
  init_types2();
16363
16434
  init_team_owner_epoch();
16435
+ init_native_contained_fs();
16364
16436
  init_pane_readiness();
16365
16437
  init_worker_launch_ack();
16366
16438
  init_runtime_owner_client();
@@ -16418,23 +16490,23 @@ var init_tmux_session = __esm({
16418
16490
  // src/agents/prompt-helpers.ts
16419
16491
  function getPackageDir3() {
16420
16492
  if (typeof __dirname !== "undefined" && __dirname) {
16421
- const currentDirName = (0, import_path24.basename)(__dirname);
16422
- const parentDirName = (0, import_path24.basename)((0, import_path24.dirname)(__dirname));
16493
+ const currentDirName = (0, import_path25.basename)(__dirname);
16494
+ const parentDirName = (0, import_path25.basename)((0, import_path25.dirname)(__dirname));
16423
16495
  if (currentDirName === "bridge") {
16424
- return (0, import_path24.join)(__dirname, "..");
16496
+ return (0, import_path25.join)(__dirname, "..");
16425
16497
  }
16426
16498
  if (currentDirName === "agents" && (parentDirName === "src" || parentDirName === "dist")) {
16427
- return (0, import_path24.join)(__dirname, "..", "..");
16499
+ return (0, import_path25.join)(__dirname, "..", "..");
16428
16500
  }
16429
16501
  }
16430
16502
  try {
16431
16503
  const __filename = (0, import_url4.fileURLToPath)(importMetaUrl);
16432
- const __dirname2 = (0, import_path24.dirname)(__filename);
16433
- const currentDirName = (0, import_path24.basename)(__dirname2);
16504
+ const __dirname2 = (0, import_path25.dirname)(__filename);
16505
+ const currentDirName = (0, import_path25.basename)(__dirname2);
16434
16506
  if (currentDirName === "bridge") {
16435
- return (0, import_path24.join)(__dirname2, "..");
16507
+ return (0, import_path25.join)(__dirname2, "..");
16436
16508
  }
16437
- return (0, import_path24.join)(__dirname2, "..", "..");
16509
+ return (0, import_path25.join)(__dirname2, "..", "..");
16438
16510
  } catch {
16439
16511
  }
16440
16512
  return process.cwd();
@@ -16449,21 +16521,21 @@ function getValidAgentRoles() {
16449
16521
  } catch {
16450
16522
  }
16451
16523
  try {
16452
- const agentsDir = (0, import_path24.join)(getPackageDir3(), "agents");
16453
- const files = (0, import_fs22.readdirSync)(agentsDir);
16454
- _cachedRoles = files.filter((f) => f.endsWith(".md")).map((f) => (0, import_path24.basename)(f, ".md")).sort();
16524
+ const agentsDir = (0, import_path25.join)(getPackageDir3(), "agents");
16525
+ const files = (0, import_fs23.readdirSync)(agentsDir);
16526
+ _cachedRoles = files.filter((f) => f.endsWith(".md")).map((f) => (0, import_path25.basename)(f, ".md")).sort();
16455
16527
  } catch (err) {
16456
16528
  console.error("[prompt-injection] CRITICAL: Could not scan agents/ directory for role discovery:", err);
16457
16529
  _cachedRoles = [];
16458
16530
  }
16459
16531
  return _cachedRoles;
16460
16532
  }
16461
- var import_fs22, import_path24, import_url4, _cachedRoles, VALID_AGENT_ROLES;
16533
+ var import_fs23, import_path25, import_url4, _cachedRoles, VALID_AGENT_ROLES;
16462
16534
  var init_prompt_helpers = __esm({
16463
16535
  "src/agents/prompt-helpers.ts"() {
16464
16536
  "use strict";
16465
- import_fs22 = require("fs");
16466
- import_path24 = require("path");
16537
+ import_fs23 = require("fs");
16538
+ import_path25 = require("path");
16467
16539
  import_url4 = require("url");
16468
16540
  init_utils();
16469
16541
  init_strict_mode_guidance();
@@ -16474,58 +16546,58 @@ var init_prompt_helpers = __esm({
16474
16546
 
16475
16547
  // src/team/fs-utils.ts
16476
16548
  function atomicWriteJson2(filePath, data, mode = 384) {
16477
- const dir = (0, import_path25.dirname)(filePath);
16478
- if (!(0, import_fs23.existsSync)(dir)) (0, import_fs23.mkdirSync)(dir, { recursive: true, mode: 448 });
16549
+ const dir = (0, import_path26.dirname)(filePath);
16550
+ if (!(0, import_fs24.existsSync)(dir)) (0, import_fs24.mkdirSync)(dir, { recursive: true, mode: 448 });
16479
16551
  const tmpPath = `${filePath}.tmp.${process.pid}.${Date.now()}`;
16480
- (0, import_fs23.writeFileSync)(tmpPath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode });
16481
- (0, import_fs23.renameSync)(tmpPath, filePath);
16552
+ (0, import_fs24.writeFileSync)(tmpPath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode });
16553
+ (0, import_fs24.renameSync)(tmpPath, filePath);
16482
16554
  }
16483
16555
  function ensureDirWithMode(dirPath, mode = 448) {
16484
- if (!(0, import_fs23.existsSync)(dirPath)) (0, import_fs23.mkdirSync)(dirPath, { recursive: true, mode });
16556
+ if (!(0, import_fs24.existsSync)(dirPath)) (0, import_fs24.mkdirSync)(dirPath, { recursive: true, mode });
16485
16557
  }
16486
16558
  function safeRealpath(p) {
16487
16559
  try {
16488
- return (0, import_fs23.realpathSync)(p);
16560
+ return (0, import_fs24.realpathSync)(p);
16489
16561
  } catch {
16490
16562
  const segments = [];
16491
- let current = (0, import_path25.resolve)(p);
16492
- while (!(0, import_fs23.existsSync)(current)) {
16493
- segments.unshift((0, import_path25.basename)(current));
16494
- const parent = (0, import_path25.dirname)(current);
16563
+ let current = (0, import_path26.resolve)(p);
16564
+ while (!(0, import_fs24.existsSync)(current)) {
16565
+ segments.unshift((0, import_path26.basename)(current));
16566
+ const parent = (0, import_path26.dirname)(current);
16495
16567
  if (parent === current) break;
16496
16568
  current = parent;
16497
16569
  }
16498
16570
  try {
16499
- return (0, import_path25.join)((0, import_fs23.realpathSync)(current), ...segments);
16571
+ return (0, import_path26.join)((0, import_fs24.realpathSync)(current), ...segments);
16500
16572
  } catch {
16501
- return (0, import_path25.resolve)(p);
16573
+ return (0, import_path26.resolve)(p);
16502
16574
  }
16503
16575
  }
16504
16576
  }
16505
16577
  function validateResolvedPath(resolvedPath, expectedBase) {
16506
16578
  const absResolved = safeRealpath(resolvedPath);
16507
16579
  const absBase = safeRealpath(expectedBase);
16508
- const rel = (0, import_path25.relative)(absBase, absResolved);
16509
- if (rel.startsWith("..") || (0, import_path25.resolve)(absBase, rel) !== absResolved) {
16580
+ const rel = (0, import_path26.relative)(absBase, absResolved);
16581
+ if (rel.startsWith("..") || (0, import_path26.resolve)(absBase, rel) !== absResolved) {
16510
16582
  throw new Error(`Path traversal detected: "${resolvedPath}" escapes base "${expectedBase}"`);
16511
16583
  }
16512
16584
  }
16513
- var import_fs23, import_path25;
16585
+ var import_fs24, import_path26;
16514
16586
  var init_fs_utils = __esm({
16515
16587
  "src/team/fs-utils.ts"() {
16516
16588
  "use strict";
16517
- import_fs23 = require("fs");
16518
- import_path25 = require("path");
16589
+ import_fs24 = require("fs");
16590
+ import_path26 = require("path");
16519
16591
  }
16520
16592
  });
16521
16593
 
16522
16594
  // src/team/worker-bootstrap.ts
16523
- var import_promises9, import_path26;
16595
+ var import_promises9, import_path27;
16524
16596
  var init_worker_bootstrap = __esm({
16525
16597
  "src/team/worker-bootstrap.ts"() {
16526
16598
  "use strict";
16527
16599
  import_promises9 = require("fs/promises");
16528
- import_path26 = require("path");
16600
+ import_path27 = require("path");
16529
16601
  init_prompt_helpers();
16530
16602
  init_omc_cli_rendering();
16531
16603
  init_tmux_session();
@@ -16536,14 +16608,14 @@ var init_worker_bootstrap = __esm({
16536
16608
  });
16537
16609
 
16538
16610
  // src/team/dispatch-queue.ts
16539
- var import_crypto8, import_fs24, import_promises10, import_path27, LOCK_STALE_MS;
16611
+ var import_crypto8, import_fs25, import_promises10, import_path28, LOCK_STALE_MS;
16540
16612
  var init_dispatch_queue = __esm({
16541
16613
  "src/team/dispatch-queue.ts"() {
16542
16614
  "use strict";
16543
16615
  import_crypto8 = require("crypto");
16544
- import_fs24 = require("fs");
16616
+ import_fs25 = require("fs");
16545
16617
  import_promises10 = require("fs/promises");
16546
- import_path27 = require("path");
16618
+ import_path28 = require("path");
16547
16619
  init_state_paths();
16548
16620
  init_fs_utils();
16549
16621
  init_contracts();
@@ -16583,7 +16655,7 @@ function taskDependencyIds(task) {
16583
16655
  return validateTaskDependencies(task, "invalid_persisted_state");
16584
16656
  }
16585
16657
  async function listTasks(teamName, cwd, deps) {
16586
- const tasksRoot = (0, import_path28.join)(deps.teamDir(teamName, cwd), "tasks");
16658
+ const tasksRoot = (0, import_path29.join)(deps.teamDir(teamName, cwd), "tasks");
16587
16659
  const invalidState = (path5, cause) => deps.stateError?.(path5, cause) ?? new Error("invalid_persisted_state");
16588
16660
  let entries;
16589
16661
  try {
@@ -16608,7 +16680,7 @@ async function listTasks(teamName, cwd, deps) {
16608
16680
  for (const [id, paths] of candidates) {
16609
16681
  let fileName = paths.canonical ?? paths.legacy;
16610
16682
  if (!fileName) continue;
16611
- let path5 = (0, import_path28.join)(tasksRoot, fileName);
16683
+ let path5 = (0, import_path29.join)(tasksRoot, fileName);
16612
16684
  let fileStat;
16613
16685
  try {
16614
16686
  fileStat = await (0, import_promises11.lstat)(path5);
@@ -16616,7 +16688,7 @@ async function listTasks(teamName, cwd, deps) {
16616
16688
  if (error2.code === "ENOENT") {
16617
16689
  if (fileName === paths.canonical && paths.legacy) {
16618
16690
  fileName = paths.legacy;
16619
- path5 = (0, import_path28.join)(tasksRoot, fileName);
16691
+ path5 = (0, import_path29.join)(tasksRoot, fileName);
16620
16692
  try {
16621
16693
  fileStat = await (0, import_promises11.lstat)(path5);
16622
16694
  } catch (legacyError) {
@@ -16640,7 +16712,7 @@ async function listTasks(teamName, cwd, deps) {
16640
16712
  if (error2.code === "ENOENT") {
16641
16713
  if (fileName === paths.canonical && paths.legacy) {
16642
16714
  fileName = paths.legacy;
16643
- path5 = (0, import_path28.join)(tasksRoot, fileName);
16715
+ path5 = (0, import_path29.join)(tasksRoot, fileName);
16644
16716
  try {
16645
16717
  const legacyStat = await (0, import_promises11.lstat)(path5);
16646
16718
  if (legacyStat.isSymbolicLink() || !legacyStat.isFile()) {
@@ -16665,7 +16737,7 @@ async function listTasks(teamName, cwd, deps) {
16665
16737
  try {
16666
16738
  parsed = JSON.parse(raw);
16667
16739
  } catch {
16668
- throw invalidState((0, import_path28.join)(tasksRoot, fileName), "json");
16740
+ throw invalidState((0, import_path29.join)(tasksRoot, fileName), "json");
16669
16741
  }
16670
16742
  if (!deps.isTeamTask(parsed)) throw invalidState(path5, "schema");
16671
16743
  const task = deps.normalizeTask(parsed);
@@ -16680,12 +16752,12 @@ async function listTasks(teamName, cwd, deps) {
16680
16752
  tasks.sort((a, b) => Number(a.id) - Number(b.id));
16681
16753
  return tasks;
16682
16754
  }
16683
- var import_crypto9, import_path28, import_promises11, logEventAppendFailure, logCompletionMarkerFailure;
16755
+ var import_crypto9, import_path29, import_promises11, logEventAppendFailure, logCompletionMarkerFailure;
16684
16756
  var init_tasks = __esm({
16685
16757
  "src/team/state/tasks.ts"() {
16686
16758
  "use strict";
16687
16759
  import_crypto9 = require("crypto");
16688
- import_path28 = require("path");
16760
+ import_path29 = require("path");
16689
16761
  import_promises11 = require("fs/promises");
16690
16762
  init_contracts();
16691
16763
  init_swallowed_error();
@@ -17255,13 +17327,13 @@ var init_merge_coordinator = __esm({
17255
17327
  });
17256
17328
 
17257
17329
  // src/team/leader-inbox.ts
17258
- var import_promises12, import_fs25, import_path29;
17330
+ var import_promises12, import_fs26, import_path30;
17259
17331
  var init_leader_inbox = __esm({
17260
17332
  "src/team/leader-inbox.ts"() {
17261
17333
  "use strict";
17262
17334
  import_promises12 = require("fs/promises");
17263
- import_fs25 = require("fs");
17264
- import_path29 = require("path");
17335
+ import_fs26 = require("fs");
17336
+ import_path30 = require("path");
17265
17337
  init_tmux_session();
17266
17338
  init_fs_utils();
17267
17339
  init_state_paths();
@@ -17290,7 +17362,7 @@ async function uninstallCommitCadence(ctx, io = { readFile: import_promises13.re
17290
17362
  if (ownsRegisteredGeneration) cadenceOwners.delete(ctx.worktreePath);
17291
17363
  return;
17292
17364
  }
17293
- const settingsPath = (0, import_path30.join)(ctx.worktreePath, ".copilot", "settings.json");
17365
+ const settingsPath = (0, import_path31.join)(ctx.worktreePath, ".copilot", "settings.json");
17294
17366
  let raw;
17295
17367
  try {
17296
17368
  raw = await io.readFile(settingsPath, "utf-8");
@@ -17315,13 +17387,13 @@ async function uninstallCommitCadence(ctx, io = { readFile: import_promises13.re
17315
17387
  await io.writeFile(settingsPath, JSON.stringify(updated, null, 2) + "\n", "utf-8");
17316
17388
  if (ownsRegisteredGeneration) cadenceOwners.delete(ctx.worktreePath);
17317
17389
  }
17318
- var import_fs26, import_promises13, import_path30, import_child_process8, cadenceOwners, HOOK_MATCHER;
17390
+ var import_fs27, import_promises13, import_path31, import_child_process8, cadenceOwners, HOOK_MATCHER;
17319
17391
  var init_worker_commit_cadence = __esm({
17320
17392
  "src/team/worker-commit-cadence.ts"() {
17321
17393
  "use strict";
17322
- import_fs26 = require("fs");
17394
+ import_fs27 = require("fs");
17323
17395
  import_promises13 = require("fs/promises");
17324
- import_path30 = require("path");
17396
+ import_path31 = require("path");
17325
17397
  import_child_process8 = require("child_process");
17326
17398
  cadenceOwners = /* @__PURE__ */ new Map();
17327
17399
  HOOK_MATCHER = "Write|Edit|MultiEdit";
@@ -17346,11 +17418,11 @@ var init_merge_orchestrator = __esm({
17346
17418
  });
17347
17419
 
17348
17420
  // src/team/scaling.ts
17349
- var import_path31, import_promises14;
17421
+ var import_path32, import_promises14;
17350
17422
  var init_scaling = __esm({
17351
17423
  "src/team/scaling.ts"() {
17352
17424
  "use strict";
17353
- import_path31 = require("path");
17425
+ import_path32 = require("path");
17354
17426
  import_promises14 = require("fs/promises");
17355
17427
  init_model_contract();
17356
17428
  init_loader();
@@ -17680,7 +17752,7 @@ async function shutdownTeamV2(teamName, cwd, options = {}) {
17680
17752
  };
17681
17753
  if (!config2) {
17682
17754
  const cleanupSafety = inspectTeamWorktreeCleanupSafety(sanitized, cwd);
17683
- if (cleanupSafety.hasEvidence || (0, import_fs27.existsSync)(absPath(cwd, TeamPaths.root(sanitized)))) {
17755
+ if (cleanupSafety.hasEvidence || (0, import_fs28.existsSync)(absPath(cwd, TeamPaths.root(sanitized)))) {
17684
17756
  process.stderr.write("[team/runtime-v2] preserving team state because config is missing and worktree cleanup evidence remains\n");
17685
17757
  return { outcome: "preserved", reason: "config_missing_cleanup_evidence", workers: [] };
17686
17758
  }
@@ -17957,12 +18029,12 @@ Then exit your session.
17957
18029
  return { outcome: "cleaned" };
17958
18030
  });
17959
18031
  }
17960
- var import_path32, import_fs27, import_promises15, import_node_crypto6, orchestratorByTeam, cadenceByTeam, TEAM_INSTANCE_FINAL_DISPOSAL_AUTHORIZATION;
18032
+ var import_path33, import_fs28, import_promises15, import_node_crypto6, orchestratorByTeam, cadenceByTeam, TEAM_INSTANCE_FINAL_DISPOSAL_AUTHORIZATION;
17961
18033
  var init_runtime_v2 = __esm({
17962
18034
  "src/team/runtime-v2.ts"() {
17963
18035
  "use strict";
17964
- import_path32 = require("path");
17965
- import_fs27 = require("fs");
18036
+ import_path33 = require("path");
18037
+ import_fs28 = require("fs");
17966
18038
  import_promises15 = require("fs/promises");
17967
18039
  init_state_paths();
17968
18040
  init_worktree_paths();
@@ -28995,10 +29067,10 @@ var StdioServerTransport = class {
28995
29067
  // src/mcp/team-server.ts
28996
29068
  var import_node_crypto7 = require("node:crypto");
28997
29069
  var import_child_process9 = require("child_process");
28998
- var import_path34 = require("path");
29070
+ var import_path35 = require("path");
28999
29071
  var import_url5 = require("url");
29000
29072
  init_omc_cli_rendering();
29001
- var import_fs29 = require("fs");
29073
+ var import_fs30 = require("fs");
29002
29074
  var import_promises16 = require("fs/promises");
29003
29075
  init_team_name();
29004
29076
  init_runtime_v2();
@@ -29114,16 +29186,16 @@ var NudgeTracker = class {
29114
29186
  };
29115
29187
 
29116
29188
  // src/mcp/team-job-convergence.ts
29117
- var import_fs28 = require("fs");
29118
- var import_path33 = require("path");
29189
+ var import_fs29 = require("fs");
29190
+ var import_path34 = require("path");
29119
29191
  init_types2();
29120
29192
  init_team_name();
29121
29193
  function readResultArtifact(omcJobsDir, jobId) {
29122
- const artifactPath = (0, import_path33.join)(omcJobsDir, `${jobId}-result.json`);
29123
- if (!(0, import_fs28.existsSync)(artifactPath)) return { kind: "none" };
29194
+ const artifactPath = (0, import_path34.join)(omcJobsDir, `${jobId}-result.json`);
29195
+ if (!(0, import_fs29.existsSync)(artifactPath)) return { kind: "none" };
29124
29196
  let raw;
29125
29197
  try {
29126
- raw = (0, import_fs28.readFileSync)(artifactPath, "utf-8");
29198
+ raw = (0, import_fs29.readFileSync)(artifactPath, "utf-8");
29127
29199
  } catch (error2) {
29128
29200
  if (error2.code === "ENOENT") return { kind: "none" };
29129
29201
  const message = `Failed to read result artifact at ${artifactPath}: ${error2 instanceof Error ? error2.message : String(error2)}`;
@@ -29225,10 +29297,10 @@ function convergeJobWithResultArtifact(job, jobId, omcJobsDir) {
29225
29297
  };
29226
29298
  }
29227
29299
  function resultArtifactIdentityError(job, jobId, omcJobsDir) {
29228
- const artifactPath = (0, import_path33.join)(omcJobsDir, `${jobId}-result.json`);
29300
+ const artifactPath = (0, import_path34.join)(omcJobsDir, `${jobId}-result.json`);
29229
29301
  let raw;
29230
29302
  try {
29231
- raw = (0, import_fs28.readFileSync)(artifactPath, "utf-8");
29303
+ raw = (0, import_fs29.readFileSync)(artifactPath, "utf-8");
29232
29304
  } catch (error2) {
29233
29305
  if (error2.code === "ENOENT") return null;
29234
29306
  return `cleanup_result_evidence_unreadable:${error2 instanceof Error ? error2.message : String(error2)}`;
@@ -29243,7 +29315,7 @@ function resultArtifactIdentityError(job, jobId, omcJobsDir) {
29243
29315
  }
29244
29316
  function readMatchingTerminalArtifact(job, jobId, omcJobsDir) {
29245
29317
  try {
29246
- const raw = (0, import_fs28.readFileSync)((0, import_path33.join)(omcJobsDir, `${jobId}-result.json`), "utf-8");
29318
+ const raw = (0, import_fs29.readFileSync)((0, import_path34.join)(omcJobsDir, `${jobId}-result.json`), "utf-8");
29247
29319
  const parsed = JSON.parse(raw);
29248
29320
  if (parsed.status !== "completed" && parsed.status !== "failed" || parsed.instanceId !== job.instanceId || !isValidTeamInstanceId(parsed.instanceId)) return null;
29249
29321
  return { status: parsed.status, raw };
@@ -29389,10 +29461,10 @@ function persistJob(jobId, job) {
29389
29461
  }
29390
29462
  }
29391
29463
  function loadJobFromDisk(jobId) {
29392
- const path5 = (0, import_path34.join)(OMC_JOBS_DIR, `${jobId}.json`);
29464
+ const path5 = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}.json`);
29393
29465
  let content;
29394
29466
  try {
29395
- content = (0, import_fs29.readFileSync)(path5, "utf-8");
29467
+ content = (0, import_fs30.readFileSync)(path5, "utf-8");
29396
29468
  } catch (error2) {
29397
29469
  if (error2.code === "ENOENT") return void 0;
29398
29470
  throw new Error(`Unreadable job file: ${jobId} (${error2 instanceof Error ? error2.message : String(error2)})`);
@@ -29412,7 +29484,7 @@ function getJob(jobId) {
29412
29484
  return loadJobFromDisk(jobId);
29413
29485
  }
29414
29486
  async function loadPaneIds(jobId, instanceId) {
29415
- const p = (0, import_path34.join)(OMC_JOBS_DIR, `${jobId}-panes.json`);
29487
+ const p = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}-panes.json`);
29416
29488
  try {
29417
29489
  const parsed = JSON.parse(await (0, import_promises16.readFile)(p, "utf-8"));
29418
29490
  if (!isValidTeamPaneArtifact(parsed, instanceId)) return null;
@@ -29576,18 +29648,18 @@ function validateJobId(job_id) {
29576
29648
  }
29577
29649
  }
29578
29650
  function jobLockPath(jobId) {
29579
- return (0, import_path34.join)(OMC_JOBS_DIR, `.${jobId}.lock`);
29651
+ return (0, import_path35.join)(OMC_JOBS_DIR, `.${jobId}.lock`);
29580
29652
  }
29581
29653
  function persistJobUnlocked(jobId, job) {
29582
- if (!(0, import_fs29.existsSync)(OMC_JOBS_DIR)) (0, import_fs29.mkdirSync)(OMC_JOBS_DIR, { recursive: true });
29583
- const targetPath = (0, import_path34.join)(OMC_JOBS_DIR, `${jobId}.json`);
29654
+ if (!(0, import_fs30.existsSync)(OMC_JOBS_DIR)) (0, import_fs30.mkdirSync)(OMC_JOBS_DIR, { recursive: true });
29655
+ const targetPath = (0, import_path35.join)(OMC_JOBS_DIR, `${jobId}.json`);
29584
29656
  const tempPath = `${targetPath}.tmp.${process.pid}.${(0, import_node_crypto7.randomUUID)()}`;
29585
29657
  try {
29586
- (0, import_fs29.writeFileSync)(tempPath, JSON.stringify(job), { encoding: "utf-8", mode: 384 });
29587
- (0, import_fs29.renameSync)(tempPath, targetPath);
29658
+ (0, import_fs30.writeFileSync)(tempPath, JSON.stringify(job), { encoding: "utf-8", mode: 384 });
29659
+ (0, import_fs30.renameSync)(tempPath, targetPath);
29588
29660
  } finally {
29589
29661
  try {
29590
- (0, import_fs29.unlinkSync)(tempPath);
29662
+ (0, import_fs30.unlinkSync)(tempPath);
29591
29663
  } catch {
29592
29664
  }
29593
29665
  }
@@ -29717,10 +29789,10 @@ async function handleStart(args) {
29717
29789
  "team_start_unsafe_runtime_v1: instance-bound provider cleanup requires runtime v2; set OMC_RUNTIME_V2=1"
29718
29790
  );
29719
29791
  }
29720
- const cwd = (0, import_path34.resolve)(input.cwd);
29792
+ const cwd = (0, import_path35.resolve)(input.cwd);
29721
29793
  const jobId = `omc-${Date.now().toString(36)}${(0, import_node_crypto7.randomUUID)().slice(0, 8)}`;
29722
29794
  const instanceId = (0, import_node_crypto7.randomUUID)();
29723
- const runtimeCliPath = (0, import_path34.join)(__ownDir, "runtime-cli.cjs");
29795
+ const runtimeCliPath = (0, import_path35.join)(__ownDir, "runtime-cli.cjs");
29724
29796
  const job = {
29725
29797
  status: "running",
29726
29798
  startedAt: Date.now(),
@@ -29997,7 +30069,7 @@ async function handleCleanup(args) {
29997
30069
  if (resultEvidenceError) return blockCleanup(resultEvidenceError);
29998
30070
  const panes = await loadPaneIds(job_id, job.instanceId);
29999
30071
  if (!panes) {
30000
- const reason = (0, import_fs29.existsSync)((0, import_path34.join)(OMC_JOBS_DIR, `${job_id}-panes.json`)) ? "cleanup_panes_evidence_corrupt" : "cleanup_panes_evidence_missing";
30072
+ const reason = (0, import_fs30.existsSync)((0, import_path35.join)(OMC_JOBS_DIR, `${job_id}-panes.json`)) ? "cleanup_panes_evidence_corrupt" : "cleanup_panes_evidence_missing";
30001
30073
  return blockCleanup(reason);
30002
30074
  }
30003
30075
  try {