oh-my-copilot 5.18.0 → 5.18.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 (320) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +3 -3
  4. package/bridge/__pycache__/gyoshu_bridge.cpython-314.pyc +0 -0
  5. package/bridge/claude-md-coordinator.cjs +2 -2
  6. package/bridge/cli.cjs +17691 -14571
  7. package/bridge/mcp-server.cjs +4624 -1922
  8. package/bridge/runtime-cli.cjs +2735 -757
  9. package/bridge/team-bridge.cjs +357 -139
  10. package/bridge/team-mcp.cjs +922 -645
  11. package/bridge/team.js +2851 -874
  12. package/dist/__tests__/delegation-enforcer.test.js +1 -1
  13. package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
  14. package/dist/__tests__/hud/cli-diagnostic.test.js +1 -1
  15. package/dist/__tests__/hud/cli-diagnostic.test.js.map +1 -1
  16. package/dist/__tests__/pre-tool-enforcer.test.js +3 -0
  17. package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
  18. package/dist/__tests__/session-start-script-context.test.js +1 -1
  19. package/dist/__tests__/session-start-script-context.test.js.map +1 -1
  20. package/dist/__tests__/skills.test.js +9 -0
  21. package/dist/__tests__/skills.test.js.map +1 -1
  22. package/dist/cli/commands/__tests__/smoke-cassette.test.d.ts +2 -0
  23. package/dist/cli/commands/__tests__/smoke-cassette.test.d.ts.map +1 -0
  24. package/dist/cli/commands/__tests__/smoke-cassette.test.js +135 -0
  25. package/dist/cli/commands/__tests__/smoke-cassette.test.js.map +1 -0
  26. package/dist/cli/commands/smoke.d.ts +41 -2
  27. package/dist/cli/commands/smoke.d.ts.map +1 -1
  28. package/dist/cli/commands/smoke.js +103 -6
  29. package/dist/cli/commands/smoke.js.map +1 -1
  30. package/dist/cli/index.d.ts.map +1 -1
  31. package/dist/cli/index.js +30 -2
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/copilot-run/__tests__/job.test.js +347 -2
  34. package/dist/copilot-run/__tests__/job.test.js.map +1 -1
  35. package/dist/copilot-run/__tests__/sandbox-session.test.d.ts +2 -0
  36. package/dist/copilot-run/__tests__/sandbox-session.test.d.ts.map +1 -0
  37. package/dist/copilot-run/__tests__/sandbox-session.test.js +181 -0
  38. package/dist/copilot-run/__tests__/sandbox-session.test.js.map +1 -0
  39. package/dist/copilot-run/__tests__/sandbox.test.js +128 -4
  40. package/dist/copilot-run/__tests__/sandbox.test.js.map +1 -1
  41. package/dist/copilot-run/job.d.ts +87 -13
  42. package/dist/copilot-run/job.d.ts.map +1 -1
  43. package/dist/copilot-run/job.js +517 -177
  44. package/dist/copilot-run/job.js.map +1 -1
  45. package/dist/copilot-run/sandbox-session.d.ts +71 -0
  46. package/dist/copilot-run/sandbox-session.d.ts.map +1 -0
  47. package/dist/copilot-run/sandbox-session.js +156 -0
  48. package/dist/copilot-run/sandbox-session.js.map +1 -0
  49. package/dist/copilot-run/sandbox.d.ts +17 -0
  50. package/dist/copilot-run/sandbox.d.ts.map +1 -1
  51. package/dist/copilot-run/sandbox.js +108 -4
  52. package/dist/copilot-run/sandbox.js.map +1 -1
  53. package/dist/copilot-run/timeout.d.ts +4 -0
  54. package/dist/copilot-run/timeout.d.ts.map +1 -0
  55. package/dist/copilot-run/timeout.js +10 -0
  56. package/dist/copilot-run/timeout.js.map +1 -0
  57. package/dist/factory/check/__tests__/cli-ado.test.d.ts +2 -0
  58. package/dist/factory/check/__tests__/cli-ado.test.d.ts.map +1 -0
  59. package/dist/factory/check/__tests__/cli-ado.test.js +95 -0
  60. package/dist/factory/check/__tests__/cli-ado.test.js.map +1 -0
  61. package/dist/factory/check/__tests__/cli.test.js +2 -1
  62. package/dist/factory/check/__tests__/cli.test.js.map +1 -1
  63. package/dist/factory/check/cli.d.ts +17 -1
  64. package/dist/factory/check/cli.d.ts.map +1 -1
  65. package/dist/factory/check/cli.js +20 -2
  66. package/dist/factory/check/cli.js.map +1 -1
  67. package/dist/factory/heal/__tests__/logs-ado.test.d.ts +2 -0
  68. package/dist/factory/heal/__tests__/logs-ado.test.d.ts.map +1 -0
  69. package/dist/factory/heal/__tests__/logs-ado.test.js +39 -0
  70. package/dist/factory/heal/__tests__/logs-ado.test.js.map +1 -0
  71. package/dist/factory/heal/classify.d.ts +3 -1
  72. package/dist/factory/heal/classify.d.ts.map +1 -1
  73. package/dist/factory/heal/classify.js +4 -2
  74. package/dist/factory/heal/classify.js.map +1 -1
  75. package/dist/factory/heal/cli.d.ts +8 -2
  76. package/dist/factory/heal/cli.d.ts.map +1 -1
  77. package/dist/factory/heal/cli.js +11 -9
  78. package/dist/factory/heal/cli.js.map +1 -1
  79. package/dist/factory/heal/debug-lane.js +1 -1
  80. package/dist/factory/heal/debug-lane.js.map +1 -1
  81. package/dist/factory/heal/heal-evidence.d.ts +4 -2
  82. package/dist/factory/heal/heal-evidence.d.ts.map +1 -1
  83. package/dist/factory/heal/heal-evidence.js +8 -6
  84. package/dist/factory/heal/heal-evidence.js.map +1 -1
  85. package/dist/factory/heal/logs.d.ts +1 -1
  86. package/dist/factory/heal/logs.d.ts.map +1 -1
  87. package/dist/factory/heal/logs.js +4 -3
  88. package/dist/factory/heal/logs.js.map +1 -1
  89. package/dist/factory/heal/run.d.ts +3 -0
  90. package/dist/factory/heal/run.d.ts.map +1 -1
  91. package/dist/factory/heal/run.js +1 -1
  92. package/dist/factory/heal/run.js.map +1 -1
  93. package/dist/factory/run/__tests__/engine.sandbox.test.js +30 -2
  94. package/dist/factory/run/__tests__/engine.sandbox.test.js.map +1 -1
  95. package/dist/factory/run/__tests__/engine.test.js +31 -1
  96. package/dist/factory/run/__tests__/engine.test.js.map +1 -1
  97. package/dist/factory/run/__tests__/fake-lanes.d.ts +2 -0
  98. package/dist/factory/run/__tests__/fake-lanes.d.ts.map +1 -1
  99. package/dist/factory/run/__tests__/fake-lanes.js +1 -1
  100. package/dist/factory/run/__tests__/fake-lanes.js.map +1 -1
  101. package/dist/factory/run/__tests__/merge-policy.test.d.ts +2 -0
  102. package/dist/factory/run/__tests__/merge-policy.test.d.ts.map +1 -0
  103. package/dist/factory/run/__tests__/merge-policy.test.js +40 -0
  104. package/dist/factory/run/__tests__/merge-policy.test.js.map +1 -0
  105. package/dist/factory/run/__tests__/prepare-gates.test.js +22 -0
  106. package/dist/factory/run/__tests__/prepare-gates.test.js.map +1 -1
  107. package/dist/factory/run/__tests__/units.test.js +12 -1
  108. package/dist/factory/run/__tests__/units.test.js.map +1 -1
  109. package/dist/factory/run/engine.d.ts.map +1 -1
  110. package/dist/factory/run/engine.js +32 -6
  111. package/dist/factory/run/engine.js.map +1 -1
  112. package/dist/factory/run/lane-commit.d.ts +10 -1
  113. package/dist/factory/run/lane-commit.d.ts.map +1 -1
  114. package/dist/factory/run/lane-commit.js +21 -4
  115. package/dist/factory/run/lane-commit.js.map +1 -1
  116. package/dist/factory/run/merge-policy.d.ts +3 -1
  117. package/dist/factory/run/merge-policy.d.ts.map +1 -1
  118. package/dist/factory/run/merge-policy.js +8 -2
  119. package/dist/factory/run/merge-policy.js.map +1 -1
  120. package/dist/factory/run/review-guard.d.ts +2 -0
  121. package/dist/factory/run/review-guard.d.ts.map +1 -1
  122. package/dist/factory/run/review-guard.js +1 -1
  123. package/dist/factory/run/review-guard.js.map +1 -1
  124. package/dist/factory/run/state.d.ts +13 -0
  125. package/dist/factory/run/state.d.ts.map +1 -1
  126. package/dist/factory/run/state.js +20 -5
  127. package/dist/factory/run/state.js.map +1 -1
  128. package/dist/features/builtin-skills/skills.js +1 -1
  129. package/dist/features/builtin-skills/skills.js.map +1 -1
  130. package/dist/features/delegation-enforcer.d.ts.map +1 -1
  131. package/dist/features/delegation-enforcer.js +2 -6
  132. package/dist/features/delegation-enforcer.js.map +1 -1
  133. package/dist/forge/__tests__/gh-argv-baseline.heal.test.js +52 -2
  134. package/dist/forge/__tests__/gh-argv-baseline.heal.test.js.map +1 -1
  135. package/dist/forge/ado/__tests__/acceptance-scripts.test.d.ts +8 -0
  136. package/dist/forge/ado/__tests__/acceptance-scripts.test.d.ts.map +1 -0
  137. package/dist/forge/ado/__tests__/acceptance-scripts.test.js +567 -0
  138. package/dist/forge/ado/__tests__/acceptance-scripts.test.js.map +1 -0
  139. package/dist/forge/ado/__tests__/az-binary.test.js +4 -0
  140. package/dist/forge/ado/__tests__/az-binary.test.js.map +1 -1
  141. package/dist/forge/ado/__tests__/failed-jobs.test.d.ts +2 -0
  142. package/dist/forge/ado/__tests__/failed-jobs.test.d.ts.map +1 -0
  143. package/dist/forge/ado/__tests__/failed-jobs.test.js +96 -0
  144. package/dist/forge/ado/__tests__/failed-jobs.test.js.map +1 -0
  145. package/dist/forge/ado/az-binary.d.ts +2 -1
  146. package/dist/forge/ado/az-binary.d.ts.map +1 -1
  147. package/dist/forge/ado/az-binary.js +3 -2
  148. package/dist/forge/ado/az-binary.js.map +1 -1
  149. package/dist/forge/ado/checks.d.ts.map +1 -1
  150. package/dist/forge/ado/checks.js +30 -0
  151. package/dist/forge/ado/checks.js.map +1 -1
  152. package/dist/forge/github/ci.d.ts +2 -0
  153. package/dist/forge/github/ci.d.ts.map +1 -1
  154. package/dist/forge/github/ci.js +3 -0
  155. package/dist/forge/github/ci.js.map +1 -1
  156. package/dist/forge/types.d.ts +2 -0
  157. package/dist/forge/types.d.ts.map +1 -1
  158. package/dist/hooks/autopilot/__tests__/pipeline.test.js +1 -1
  159. package/dist/hooks/autopilot/__tests__/pipeline.test.js.map +1 -1
  160. package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -3
  161. package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -1
  162. package/dist/hooks/keyword-detector/__tests__/index.test.js +4 -0
  163. package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -1
  164. package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js +7 -0
  165. package/dist/hooks/keyword-detector/__tests__/jev-shadow.test.js.map +1 -1
  166. package/dist/hooks/keyword-detector/index.d.ts +1 -1
  167. package/dist/hooks/keyword-detector/index.js +4 -4
  168. package/dist/hooks/keyword-detector/index.js.map +1 -1
  169. package/dist/hooks/keyword-detector/jev-shadow.js +1 -1
  170. package/dist/hooks/keyword-detector/jev-shadow.js.map +1 -1
  171. package/dist/hud/index.js +1 -1
  172. package/dist/hud/index.js.map +1 -1
  173. package/dist/mcp/__tests__/host-smoke-tool.test.js +14 -0
  174. package/dist/mcp/__tests__/host-smoke-tool.test.js.map +1 -1
  175. package/dist/ship/gates.d.ts +9 -3
  176. package/dist/ship/gates.d.ts.map +1 -1
  177. package/dist/ship/gates.js +24 -7
  178. package/dist/ship/gates.js.map +1 -1
  179. package/dist/smoke/__tests__/copilot-sdk-driver.test.js +129 -4
  180. package/dist/smoke/__tests__/copilot-sdk-driver.test.js.map +1 -1
  181. package/dist/smoke/__tests__/copilot-session-env.test.d.ts +2 -0
  182. package/dist/smoke/__tests__/copilot-session-env.test.d.ts.map +1 -0
  183. package/dist/smoke/__tests__/copilot-session-env.test.js +29 -0
  184. package/dist/smoke/__tests__/copilot-session-env.test.js.map +1 -0
  185. package/dist/smoke/__tests__/copilot-team-scenario.test.js +3 -0
  186. package/dist/smoke/__tests__/copilot-team-scenario.test.js.map +1 -1
  187. package/dist/smoke/copilot-sdk-driver.d.ts +37 -1
  188. package/dist/smoke/copilot-sdk-driver.d.ts.map +1 -1
  189. package/dist/smoke/copilot-sdk-driver.js +114 -10
  190. package/dist/smoke/copilot-sdk-driver.js.map +1 -1
  191. package/dist/smoke/copilot-sdk-scenarios.d.ts +27 -0
  192. package/dist/smoke/copilot-sdk-scenarios.d.ts.map +1 -1
  193. package/dist/smoke/copilot-sdk-scenarios.js +31 -0
  194. package/dist/smoke/copilot-sdk-scenarios.js.map +1 -1
  195. package/dist/smoke/copilot-session-env.d.ts +38 -1
  196. package/dist/smoke/copilot-session-env.d.ts.map +1 -1
  197. package/dist/smoke/copilot-session-env.js +82 -1
  198. package/dist/smoke/copilot-session-env.js.map +1 -1
  199. package/dist/smoke/copilot-smoke.d.ts +21 -1
  200. package/dist/smoke/copilot-smoke.d.ts.map +1 -1
  201. package/dist/smoke/copilot-smoke.js +86 -6
  202. package/dist/smoke/copilot-smoke.js.map +1 -1
  203. package/dist/smoke/copilot-team-scenario.d.ts +4 -2
  204. package/dist/smoke/copilot-team-scenario.d.ts.map +1 -1
  205. package/dist/smoke/copilot-team-scenario.js +5 -4
  206. package/dist/smoke/copilot-team-scenario.js.map +1 -1
  207. package/dist/smoke/replay/__tests__/cassette.test.d.ts +2 -0
  208. package/dist/smoke/replay/__tests__/cassette.test.d.ts.map +1 -0
  209. package/dist/smoke/replay/__tests__/cassette.test.js +387 -0
  210. package/dist/smoke/replay/__tests__/cassette.test.js.map +1 -0
  211. package/dist/smoke/replay/__tests__/handler.test.d.ts +2 -0
  212. package/dist/smoke/replay/__tests__/handler.test.d.ts.map +1 -0
  213. package/dist/smoke/replay/__tests__/handler.test.js +367 -0
  214. package/dist/smoke/replay/__tests__/handler.test.js.map +1 -0
  215. package/dist/smoke/replay/__tests__/matcher.test.d.ts +2 -0
  216. package/dist/smoke/replay/__tests__/matcher.test.d.ts.map +1 -0
  217. package/dist/smoke/replay/__tests__/matcher.test.js +318 -0
  218. package/dist/smoke/replay/__tests__/matcher.test.js.map +1 -0
  219. package/dist/smoke/replay/__tests__/normalize.test.d.ts +2 -0
  220. package/dist/smoke/replay/__tests__/normalize.test.d.ts.map +1 -0
  221. package/dist/smoke/replay/__tests__/normalize.test.js +53 -0
  222. package/dist/smoke/replay/__tests__/normalize.test.js.map +1 -0
  223. package/dist/smoke/replay/__tests__/redact.test.d.ts +2 -0
  224. package/dist/smoke/replay/__tests__/redact.test.d.ts.map +1 -0
  225. package/dist/smoke/replay/__tests__/redact.test.js +453 -0
  226. package/dist/smoke/replay/__tests__/redact.test.js.map +1 -0
  227. package/dist/smoke/replay/__tests__/run.test.d.ts +2 -0
  228. package/dist/smoke/replay/__tests__/run.test.d.ts.map +1 -0
  229. package/dist/smoke/replay/__tests__/run.test.js +311 -0
  230. package/dist/smoke/replay/__tests__/run.test.js.map +1 -0
  231. package/dist/smoke/replay/cassette.d.ts +210 -0
  232. package/dist/smoke/replay/cassette.d.ts.map +1 -0
  233. package/dist/smoke/replay/cassette.js +580 -0
  234. package/dist/smoke/replay/cassette.js.map +1 -0
  235. package/dist/smoke/replay/handler.d.ts +221 -0
  236. package/dist/smoke/replay/handler.d.ts.map +1 -0
  237. package/dist/smoke/replay/handler.js +702 -0
  238. package/dist/smoke/replay/handler.js.map +1 -0
  239. package/dist/smoke/replay/matcher.d.ts +194 -0
  240. package/dist/smoke/replay/matcher.d.ts.map +1 -0
  241. package/dist/smoke/replay/matcher.js +344 -0
  242. package/dist/smoke/replay/matcher.js.map +1 -0
  243. package/dist/smoke/replay/normalize.d.ts +35 -0
  244. package/dist/smoke/replay/normalize.d.ts.map +1 -0
  245. package/dist/smoke/replay/normalize.js +64 -0
  246. package/dist/smoke/replay/normalize.js.map +1 -0
  247. package/dist/smoke/replay/redact.d.ts +151 -0
  248. package/dist/smoke/replay/redact.d.ts.map +1 -0
  249. package/dist/smoke/replay/redact.js +577 -0
  250. package/dist/smoke/replay/redact.js.map +1 -0
  251. package/dist/smoke/replay/run.d.ts +119 -0
  252. package/dist/smoke/replay/run.d.ts.map +1 -0
  253. package/dist/smoke/replay/run.js +302 -0
  254. package/dist/smoke/replay/run.js.map +1 -0
  255. package/dist/team/__tests__/sdk-transport.test.js +334 -6
  256. package/dist/team/__tests__/sdk-transport.test.js.map +1 -1
  257. package/dist/team/__tests__/tmux-session.pane-env.test.js +13 -13
  258. package/dist/team/__tests__/tmux-session.pane-env.test.js.map +1 -1
  259. package/dist/team/__tests__/tmux-session.spawn.test.js +12 -0
  260. package/dist/team/__tests__/tmux-session.spawn.test.js.map +1 -1
  261. package/dist/team/__tests__/tmux-session.split-pane-env.test.js +2 -2
  262. package/dist/team/__tests__/tmux-session.split-pane-env.test.js.map +1 -1
  263. package/dist/team/__tests__/worker-launch-ack.test.js +173 -9
  264. package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
  265. package/dist/team/git-worktree.d.ts.map +1 -1
  266. package/dist/team/git-worktree.js +2 -1
  267. package/dist/team/git-worktree.js.map +1 -1
  268. package/dist/team/model-contract.d.ts.map +1 -1
  269. package/dist/team/model-contract.js +3 -2
  270. package/dist/team/model-contract.js.map +1 -1
  271. package/dist/team/sdk-host.d.ts +44 -0
  272. package/dist/team/sdk-host.d.ts.map +1 -1
  273. package/dist/team/sdk-host.js +147 -5
  274. package/dist/team/sdk-host.js.map +1 -1
  275. package/dist/team/sdk-policy.d.ts +17 -0
  276. package/dist/team/sdk-policy.d.ts.map +1 -1
  277. package/dist/team/sdk-policy.js +79 -1
  278. package/dist/team/sdk-policy.js.map +1 -1
  279. package/dist/team/sdk-transport.d.ts +15 -0
  280. package/dist/team/sdk-transport.d.ts.map +1 -1
  281. package/dist/team/sdk-transport.js +54 -9
  282. package/dist/team/sdk-transport.js.map +1 -1
  283. package/dist/team/tmux-session.d.ts.map +1 -1
  284. package/dist/team/tmux-session.js +5 -0
  285. package/dist/team/tmux-session.js.map +1 -1
  286. package/dist/team/worker-launch-ack.d.ts +3 -1
  287. package/dist/team/worker-launch-ack.d.ts.map +1 -1
  288. package/dist/team/worker-launch-ack.js +73 -8
  289. package/dist/team/worker-launch-ack.js.map +1 -1
  290. package/dist/tools/host-smoke-tool.d.ts +5 -1
  291. package/dist/tools/host-smoke-tool.d.ts.map +1 -1
  292. package/dist/tools/host-smoke-tool.js +26 -3
  293. package/dist/tools/host-smoke-tool.js.map +1 -1
  294. package/dist/workflow/__tests__/alias-resolver.test.js +2 -0
  295. package/dist/workflow/__tests__/alias-resolver.test.js.map +1 -1
  296. package/dist/workflow/alias-resolver.js +2 -2
  297. package/dist/workflow/alias-resolver.js.map +1 -1
  298. package/docs/CLAUDE.md +3 -2
  299. package/docs/REFERENCE.md +69 -4
  300. package/docs/copilot-instructions.md +6 -5
  301. package/package.json +2 -2
  302. package/plugin.json +1 -1
  303. package/scripts/ado-acceptance.mjs +611 -0
  304. package/scripts/ado-capture.mjs +320 -0
  305. package/scripts/ado-fixture-import.mjs +293 -0
  306. package/scripts/keyword-detector.mjs +2 -2
  307. package/scripts/lib/backlog-to-workitems.mjs +115 -0
  308. package/scripts/persistent-mode.cjs +1 -1
  309. package/scripts/persistent-mode.mjs +1 -1
  310. package/scripts/pre-tool-enforcer.mjs +1 -1
  311. package/scripts/session-start.mjs +3 -3
  312. package/scripts/setup-copilot-instructions.sh +1 -1
  313. package/scripts/spikes/request-handler-probe.mjs +186 -0
  314. package/skills/autopilot/SKILL.md +3 -3
  315. package/skills/cancel/SKILL.md +1 -1
  316. package/skills/ship/SKILL.md +2 -2
  317. package/skills/team/SKILL.md +3 -3
  318. package/templates/hooks/keyword-detector.mjs +1 -1
  319. package/templates/hooks/pre-tool-use.mjs +1 -1
  320. package/bridge/__pycache__/gyoshu_bridge.cpython-312.pyc +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"tmux-session.split-pane-env.test.js","sourceRoot":"","sources":["../../../src/team/__tests__/tmux-session.split-pane-env.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,kFAAkF;AAClF,4EAA4E;AAC5E,yEAAyE;AAEzE,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9B,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,KAAK;IACpB,iBAAiB,EAAE,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AAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,4CAA4C,CAAC,CAAC;QAChF,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -6,7 +6,7 @@ import { mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promis
6
6
  import { tmpdir } from 'node:os';
7
7
  import { join, relative } from 'node:path';
8
8
  import * as processUtils from '../../platform/process-utils.js';
9
- import { awaitWorkerLaunchAcknowledgement, awaitWorkerLaunchProviderStarted, buildWorkerLaunchBootstrapSpec, buildWindowsSupervisorInvocation, buildWindowsSupervisorSource, cleanupWorkerLaunchTransport, observeWorkerLaunchProvider, isWorkerLaunchAttemptAccepted, isWorkerLaunchProviderStarted, loadWorkerLaunchAttempt, loadCurrentWorkerLaunchAttempt, prepareWorkerLaunchAttempt, materializeWorkerLaunchTransport, runWorkerLaunchBootstrap, readAndConsumeWorkerLaunchDescriptor, retireWorkerLaunchAttempt, retireAndCleanupCurrentWorkerLaunchAttempt, terminateWorkerLaunchProvider, revokeWorkerLaunchAttempt, withWorkerLaunchAttemptFence, buildProviderEnvironment, buildProviderSpawnInvocation, materializeProviderSpawnInvocation, quoteWindowsCreateProcessArgument, } from '../worker-launch-ack.js';
9
+ import { awaitWorkerLaunchAcknowledgement, awaitWorkerLaunchProviderStarted, buildWorkerLaunchBootstrapSpec, buildWindowsSupervisorInvocation, buildWindowsSupervisorSource, cleanupWorkerLaunchTransport, observeWorkerLaunchProvider, isWorkerLaunchAttemptAccepted, isWorkerLaunchProviderStarted, loadWorkerLaunchAttempt, loadCurrentWorkerLaunchAttempt, prepareWorkerLaunchAttempt, materializeWorkerLaunchTransport, runWorkerLaunchBootstrap, readAndConsumeWorkerLaunchDescriptor, retireWorkerLaunchAttempt, retireAndCleanupCurrentWorkerLaunchAttempt, terminateWorkerLaunchProvider, revokeWorkerLaunchAttempt, withWorkerLaunchAttemptFence, assertEnvPassthroughAllowed, buildProviderEnvironment, buildProviderSpawnInvocation, materializeProviderSpawnInvocation, quoteWindowsCreateProcessArgument, } from '../worker-launch-ack.js';
10
10
  import { captureOwnedProcessGroup, getProcessStartIdentity, isProcessAlive, terminateOwnedProcessGroup, terminateOwnedProcessTree, } from '../../platform/process-utils.js';
11
11
  import { getOmcRoot } from '../../lib/worktree-paths.js';
12
12
  import { getWorkerEnv } from '../model-contract.js';
@@ -82,7 +82,7 @@ afterEach(async () => {
82
82
  await removeFixtureDir(cwd);
83
83
  cwd = '';
84
84
  });
85
- async function attempt() {
85
+ async function attempt(provider = 'codex') {
86
86
  cwd = await createFixture('worker-launch-ack-');
87
87
  return prepareWorkerLaunchAttempt({
88
88
  cwd,
@@ -90,7 +90,7 @@ async function attempt() {
90
90
  workerName: 'worker-1',
91
91
  instanceId: randomUUID(),
92
92
  paneId: '%2',
93
- provider: 'codex',
93
+ provider,
94
94
  runtimeCliPath: '/runtime-cli.cjs',
95
95
  });
96
96
  }
@@ -515,6 +515,65 @@ describe('worker launch acknowledgement', () => {
515
515
  await writeFile(completionPath, 'not-an-exit-code\n', 'utf8');
516
516
  await expect(observeWorkerLaunchProvider(launchAttempt)).resolves.toBe('unknown');
517
517
  });
518
+ describe('stops waiting for provider start once the provider has exited', () => {
519
+ const START_WAIT_MS = 10_000;
520
+ async function writeStarted(launchAttempt, pid, processStartIdentity) {
521
+ const expected = await acceptFixtureAttempt(launchAttempt);
522
+ await writeFile(launchAttempt.startedPath, JSON.stringify({
523
+ ...expected,
524
+ kind: 'worker_launch_provider_started',
525
+ pid,
526
+ process_start_identity: processStartIdentity,
527
+ written_at: new Date().toISOString(),
528
+ }), 'utf8');
529
+ }
530
+ async function timedStartWait(launchAttempt) {
531
+ const t0 = Date.now();
532
+ const started = await awaitWorkerLaunchProviderStarted(launchAttempt, { timeoutMs: START_WAIT_MS, pollIntervalMs: 5 });
533
+ return { started, elapsedMs: Date.now() - t0 };
534
+ }
535
+ it('returns false at once when a terminal record follows valid start evidence', async () => {
536
+ const launchAttempt = await attempt();
537
+ const identity = await getProcessStartIdentity(process.pid);
538
+ await writeStarted(launchAttempt, process.pid, identity);
539
+ await writeFile(`${launchAttempt.startedPath}.terminal`, '{}', 'utf8');
540
+ const { started, elapsedMs } = await timedStartWait(launchAttempt);
541
+ expect(started).toBe(false);
542
+ expect(elapsedMs).toBeLessThan(2_000);
543
+ });
544
+ it('returns false at once when the supervisor completion marker exists', async () => {
545
+ const launchAttempt = await attempt();
546
+ await acceptFixtureAttempt(launchAttempt);
547
+ await writeBoundCompletionEvidence(launchAttempt, join(cwd, 'provider-exit.json'));
548
+ const { started, elapsedMs } = await timedStartWait(launchAttempt);
549
+ expect(started).toBe(false);
550
+ expect(elapsedMs).toBeLessThan(2_000);
551
+ });
552
+ it('returns false at once when the started pid is dead', async () => {
553
+ const launchAttempt = await attempt();
554
+ const provider = await spawnDisposableProvider();
555
+ await writeStarted(launchAttempt, provider.pid, provider.processStartIdentity);
556
+ await stopDisposableProvider(provider.child);
557
+ await vi.waitFor(() => expect(isProcessAlive(provider.pid)).toBe(false), { timeout: 5_000, interval: 10 });
558
+ const { started, elapsedMs } = await timedStartWait(launchAttempt);
559
+ expect(started).toBe(false);
560
+ expect(elapsedMs).toBeLessThan(2_000);
561
+ });
562
+ it.each(['mismatch', 'unknown'])('keeps waiting through a transient %s liveness read', async (transient) => {
563
+ const launchAttempt = await attempt();
564
+ const identity = await getProcessStartIdentity(process.pid);
565
+ await writeStarted(launchAttempt, process.pid, identity);
566
+ const liveness = vi.spyOn(processUtils, 'isProcessIdentityLive').mockResolvedValueOnce(transient);
567
+ try {
568
+ const { started } = await timedStartWait(launchAttempt);
569
+ expect(started).toBe(true);
570
+ expect(liveness.mock.calls.length).toBeGreaterThanOrEqual(2);
571
+ }
572
+ finally {
573
+ liveness.mockRestore();
574
+ }
575
+ });
576
+ });
518
577
  it('rejects a completion marker from another launch even when the path is substituted', async () => {
519
578
  const launchAttempt = await attempt();
520
579
  await acceptFixtureAttempt(launchAttempt);
@@ -3095,22 +3154,22 @@ describe('worker launch acknowledgement', () => {
3095
3154
  const sourceEnv = {
3096
3155
  PATH: '/usr/bin:/bin',
3097
3156
  HOME: '/home/provider',
3098
- CUSTOM_PROVIDER_TOKEN: 'secret-token-123',
3157
+ CUSTOM_PROVIDER_SETTING: 'secret-token-123',
3099
3158
  ANOTHER_CUSTOM_VAR: 'another-value',
3100
3159
  };
3101
3160
  // Verify that without passthrough, custom vars are NOT in the environment
3102
3161
  const runtimeEnv = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux');
3103
3162
  expect(runtimeEnv).toHaveProperty('EXPLICIT', 'yes');
3104
- expect(runtimeEnv).not.toHaveProperty('CUSTOM_PROVIDER_TOKEN');
3163
+ expect(runtimeEnv).not.toHaveProperty('CUSTOM_PROVIDER_SETTING');
3105
3164
  expect(runtimeEnv).not.toHaveProperty('ANOTHER_CUSTOM_VAR');
3106
3165
  // Verify that custom vars ARE included when passthrough is specified
3107
- const runtimeEnvWithPassthrough = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['CUSTOM_PROVIDER_TOKEN', 'ANOTHER_CUSTOM_VAR']);
3166
+ const runtimeEnvWithPassthrough = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['CUSTOM_PROVIDER_SETTING', 'ANOTHER_CUSTOM_VAR']);
3108
3167
  expect(runtimeEnvWithPassthrough).toHaveProperty('EXPLICIT', 'yes');
3109
- expect(runtimeEnvWithPassthrough).toHaveProperty('CUSTOM_PROVIDER_TOKEN', 'secret-token-123');
3168
+ expect(runtimeEnvWithPassthrough).toHaveProperty('CUSTOM_PROVIDER_SETTING', 'secret-token-123');
3110
3169
  expect(runtimeEnvWithPassthrough).toHaveProperty('ANOTHER_CUSTOM_VAR', 'another-value');
3111
3170
  // Passthrough vars that don't exist in sourceEnv should be silently skipped
3112
- const runtimeEnvMissingVar = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['NONEXISTENT_VAR', 'CUSTOM_PROVIDER_TOKEN']);
3113
- expect(runtimeEnvMissingVar).toHaveProperty('CUSTOM_PROVIDER_TOKEN', 'secret-token-123');
3171
+ const runtimeEnvMissingVar = buildProviderEnvironment({ EXPLICIT: 'yes' }, sourceEnv, 'linux', ['NONEXISTENT_VAR', 'CUSTOM_PROVIDER_SETTING']);
3172
+ expect(runtimeEnvMissingVar).toHaveProperty('CUSTOM_PROVIDER_SETTING', 'secret-token-123');
3114
3173
  expect(runtimeEnvMissingVar).not.toHaveProperty('NONEXISTENT_VAR');
3115
3174
  });
3116
3175
  it('parses OMC_TEAM_WORKER_ENV_PASSTHROUGH from source environment', () => {
@@ -3154,4 +3213,109 @@ describe('worker launch acknowledgement', () => {
3154
3213
  expect(() => buildProviderEnvironment({}, sourceEnv, 'win32', ['SYSTEMROOT'])).toThrow('worker_launch_env_passthrough_key_reserved');
3155
3214
  });
3156
3215
  });
3216
+ describe('worker env passthrough refuses credentials except the provider login', () => {
3217
+ const sourceEnv = {
3218
+ PATH: '/usr/bin',
3219
+ HOME: '/home/user',
3220
+ AWS_SECRET_ACCESS_KEY: 'aws-secret',
3221
+ AWS_REGION: 'eu-north-1',
3222
+ NPM_TOKEN: 'npm-secret',
3223
+ SSH_AUTH_SOCK: '/tmp/agent.sock',
3224
+ GH_TOKEN: 'gh-secret',
3225
+ ANTHROPIC_API_KEY: 'anthropic-secret',
3226
+ GOOGLE_APPLICATION_CREDENTIALS: '/keys/sa.json',
3227
+ };
3228
+ afterEach(() => { vi.unstubAllEnvs(); });
3229
+ it('builds the provider env without the source env credentials', () => {
3230
+ for (const provider of ['copilot', 'claude', undefined]) {
3231
+ const env = buildProviderEnvironment({}, sourceEnv, 'linux', undefined, provider);
3232
+ expect(Object.keys(env).sort()).toEqual(['HOME', 'PATH']);
3233
+ }
3234
+ });
3235
+ it.each(['AWS_SECRET_ACCESS_KEY', 'NPM_TOKEN', 'SSH_AUTH_SOCK'])('refuses passthrough of %s for every provider', key => {
3236
+ for (const provider of ['copilot', 'claude', 'codex', undefined]) {
3237
+ expect(() => buildProviderEnvironment({}, sourceEnv, 'linux', [key], provider))
3238
+ .toThrow('worker_launch_env_passthrough_credential');
3239
+ }
3240
+ });
3241
+ it('passes ANTHROPIC_API_KEY to claude only and GH_TOKEN to copilot only, skipping the other', () => {
3242
+ const notice = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
3243
+ expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['ANTHROPIC_API_KEY'], 'claude'))
3244
+ .toHaveProperty('ANTHROPIC_API_KEY', 'anthropic-secret');
3245
+ expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['GH_TOKEN'], 'copilot'))
3246
+ .toHaveProperty('GH_TOKEN', 'gh-secret');
3247
+ expect(notice).not.toHaveBeenCalled();
3248
+ // A mixed team shares one list: another provider's login is skipped, not refused.
3249
+ const mixed = ['ANTHROPIC_API_KEY', 'GH_TOKEN', 'CUSTOM_SETTING'];
3250
+ const env = { ...sourceEnv, CUSTOM_SETTING: 'custom' };
3251
+ const copilot = buildProviderEnvironment({}, env, 'linux', mixed, 'copilot');
3252
+ expect(copilot).toMatchObject({ GH_TOKEN: 'gh-secret', CUSTOM_SETTING: 'custom' });
3253
+ expect(copilot).not.toHaveProperty('ANTHROPIC_API_KEY');
3254
+ const claude = buildProviderEnvironment({}, env, 'linux', mixed, 'claude');
3255
+ expect(claude).toMatchObject({ ANTHROPIC_API_KEY: 'anthropic-secret', CUSTOM_SETTING: 'custom' });
3256
+ expect(claude).not.toHaveProperty('GH_TOKEN');
3257
+ const codex = buildProviderEnvironment({}, env, 'linux', mixed, 'codex');
3258
+ expect(codex).not.toHaveProperty('ANTHROPIC_API_KEY');
3259
+ expect(codex).not.toHaveProperty('GH_TOKEN');
3260
+ expect(notice).toHaveBeenCalledWith(expect.stringMatching(/ANTHROPIC_API_KEY is another provider's login; not forwarded to this copilot worker/));
3261
+ notice.mockRestore();
3262
+ // The pane shell hosts any provider: any provider's login passes there.
3263
+ expect(buildProviderEnvironment({}, sourceEnv, 'linux', ['ANTHROPIC_API_KEY', 'GH_TOKEN']))
3264
+ .toMatchObject({ ANTHROPIC_API_KEY: 'anthropic-secret', GH_TOKEN: 'gh-secret' });
3265
+ });
3266
+ it('passes AWS_* and GOOGLE_* to claude only when Bedrock or Vertex is enabled', () => {
3267
+ const bedrock = { ...sourceEnv, CLAUDE_CODE_USE_BEDROCK: '1' };
3268
+ expect(buildProviderEnvironment({}, bedrock, 'linux', ['AWS_SECRET_ACCESS_KEY', 'AWS_REGION'], 'claude'))
3269
+ .toMatchObject({ AWS_SECRET_ACCESS_KEY: 'aws-secret', AWS_REGION: 'eu-north-1' });
3270
+ const notice = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
3271
+ expect(buildProviderEnvironment({}, bedrock, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'copilot'))
3272
+ .not.toHaveProperty('AWS_SECRET_ACCESS_KEY');
3273
+ notice.mockRestore();
3274
+ expect(() => buildProviderEnvironment({}, sourceEnv, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'copilot'))
3275
+ .toThrow('worker_launch_env_passthrough_credential');
3276
+ expect(() => buildProviderEnvironment({}, { ...sourceEnv, CLAUDE_CODE_USE_BEDROCK: '0' }, 'linux', ['AWS_SECRET_ACCESS_KEY'], 'claude'))
3277
+ .toThrow('worker_launch_env_passthrough_credential');
3278
+ expect(() => buildProviderEnvironment({}, bedrock, 'linux', ['GOOGLE_APPLICATION_CREDENTIALS'], 'claude'))
3279
+ .toThrow('worker_launch_env_passthrough_credential');
3280
+ expect(buildProviderEnvironment({}, { ...sourceEnv, CLAUDE_CODE_USE_VERTEX: 'true' }, 'linux', ['GOOGLE_APPLICATION_CREDENTIALS'], 'claude'))
3281
+ .toHaveProperty('GOOGLE_APPLICATION_CREDENTIALS', '/keys/sa.json');
3282
+ });
3283
+ it('matches the provider login by case on POSIX and case-insensitively on Windows', () => {
3284
+ const env = { ...sourceEnv, gh_token: 'lower' };
3285
+ expect(() => buildProviderEnvironment({}, env, 'linux', ['gh_token'], 'copilot'))
3286
+ .toThrow('worker_launch_env_passthrough_credential');
3287
+ expect(buildProviderEnvironment({}, env, 'win32', ['gh_token'], 'copilot')).toHaveProperty('gh_token', 'lower');
3288
+ });
3289
+ it('names the key, the provider and the allowed logins in the error', () => {
3290
+ expect(() => assertEnvPassthroughAllowed('copilot', { OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'PATH, NPM_TOKEN' }, 'linux'))
3291
+ .toThrow(/^worker_launch_env_passthrough_credential: .*NPM_TOKEN for a copilot worker; remove it\..*COPILOT_GITHUB_TOKEN/);
3292
+ expect(() => assertEnvPassthroughAllowed('copilot', { OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'COPILOT_GITHUB_TOKEN,CUSTOM_SETTING' }, 'linux'))
3293
+ .not.toThrow();
3294
+ });
3295
+ it('the supervisor refuses a passthrough credential no provider owns', async () => {
3296
+ const launchAttempt = await attempt();
3297
+ const spec = buildWorkerLaunchBootstrapSpec(launchAttempt, ['codex'], cwd, { platform: 'win32' });
3298
+ expect(() => buildWindowsSupervisorInvocation(spec, { ...sourceEnv, OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'NPM_TOKEN' }))
3299
+ .toThrow('worker_launch_env_passthrough_credential');
3300
+ });
3301
+ it('the supervisor takes the Bedrock switch from the worker env, not only the pane shell env', async () => {
3302
+ const launchAttempt = await attempt('claude');
3303
+ const providerEnv = { CLAUDE_CODE_USE_BEDROCK: '1' };
3304
+ const spec = buildWorkerLaunchBootstrapSpec(launchAttempt, ['claude'], cwd, { platform: 'win32', providerEnv });
3305
+ // The pane shell env (env -i + baseline + passthrough) carries no switch.
3306
+ const paneEnv = { ...sourceEnv, OMC_TEAM_WORKER_ENV_PASSTHROUGH: 'AWS_SECRET_ACCESS_KEY,AWS_REGION' };
3307
+ expect(() => buildWindowsSupervisorInvocation(spec, paneEnv)).not.toThrow('worker_launch_env_passthrough_credential');
3308
+ expect(buildProviderEnvironment(spec.provider_env, paneEnv, 'linux', undefined, 'claude'))
3309
+ .toMatchObject({ CLAUDE_CODE_USE_BEDROCK: '1', AWS_SECRET_ACCESS_KEY: 'aws-secret', AWS_REGION: 'eu-north-1' });
3310
+ expect(() => assertEnvPassthroughAllowed('claude', paneEnv, 'linux', providerEnv)).not.toThrow();
3311
+ });
3312
+ it('the leader refuses before materializing the launch transport', async () => {
3313
+ const launchAttempt = await attempt();
3314
+ vi.stubEnv('OMC_TEAM_WORKER_ENV_PASSTHROUGH', 'NPM_TOKEN');
3315
+ vi.stubEnv('NPM_TOKEN', 'npm-secret');
3316
+ await expect(materializeWorkerLaunchTransport({ attempt: launchAttempt, providerArgv: ['codex'], cwd }))
3317
+ .rejects.toThrow('worker_launch_env_passthrough_credential');
3318
+ expect(existsSync(launchAttempt.bootstrapDescriptorPath)).toBe(false);
3319
+ });
3320
+ });
3157
3321
  //# sourceMappingURL=worker-launch-ack.test.js.map