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
@@ -0,0 +1,119 @@
1
+ /**
2
+ * The smoke side of record/replay (design: .omc/plans/2026-10-29-copilot-replay-design.md,
3
+ * sections 6 and 7): where a run's cassettes and state live, the cassette env
4
+ * each scenario runs with, the merge of a recording's per-process parts into
5
+ * one cassette, the replay summary behind `scn.<name>.replay`, and the
6
+ * `omg smoke cassette verify|import` file work.
7
+ */
8
+ import { type Cassette, type CassetteManifest } from './cassette.js';
9
+ import { type CassetteMode } from './handler.js';
10
+ import { type ReplayStateSummary } from './matcher.js';
11
+ import type { PlaceholderDirs } from './redact.js';
12
+ export interface CassetteRun {
13
+ mode: CassetteMode;
14
+ /** The `--record` or `--replay` root; a scenario's cassette is `<root>/<platform>-<arch>/<scenario>/`. */
15
+ root: string;
16
+ /** This run's temp state; each scenario gets `<stateRoot>/<scenario>` (claims, ordinals, logs, record parts). */
17
+ stateRoot: string;
18
+ /** `--replay-strict`. */
19
+ strict: boolean;
20
+ /** `--record-overwrite`. */
21
+ overwrite: boolean;
22
+ }
23
+ /** `<platform>-<arch>` of this machine: the cassette subdir it records into and replays from. */
24
+ export declare function platformTag(): string;
25
+ export declare function scenarioCassetteDir(run: Pick<CassetteRun, 'root'>, scenario: string): string;
26
+ export declare function scenarioStateDir(run: Pick<CassetteRun, 'stateRoot'>, scenario: string): string;
27
+ /**
28
+ * The cassette env on top of `base`. With a scenario, the scenario's state
29
+ * dir; without one (the smoke driver's shared client, switched per scenario
30
+ * by `setCassetteScenario`), the unscoped state dir, whose requests both
31
+ * modes answer with a 418 miss.
32
+ */
33
+ export declare function cassetteEnv(base: NodeJS.ProcessEnv, run: CassetteRun, dirs: PlaceholderDirs, scenario?: string): NodeJS.ProcessEnv;
34
+ /**
35
+ * One cassette from every part the scenario's clients wrote (one per client,
36
+ * several processes for a team). Refuses when any part failed
37
+ * (`<pid>-<n>.failed`), a stream id repeats, or the parts disagree on the
38
+ * platform. Null when nothing was recorded. Global interactions are
39
+ * renumbered in part order.
40
+ */
41
+ export declare function mergeRecordedParts(stateDir: string, scenario: string): Cassette | null;
42
+ export interface RecordMeta {
43
+ model?: string;
44
+ maxCredits?: number;
45
+ cost?: {
46
+ credits?: number;
47
+ premiumRequests?: number;
48
+ };
49
+ /** The scenarios of the recording run, in the order they ran; a replay runs them in this order. */
50
+ runOrder?: string[];
51
+ }
52
+ /**
53
+ * Merge the scenario's parts and write the cassette to
54
+ * `<root>/<platform>-<arch>/<scenario>/` through the gate. Returns the
55
+ * cassette dir and the stream count; throws when nothing was recorded or the
56
+ * merge or write refuses.
57
+ *
58
+ * `globalsFrom`: the run's other scenarios. A runtime caches global GETs
59
+ * across the scenarios of one client, so only the first scenario to need one
60
+ * records it; each global key this scenario lacks is copied from them, and a
61
+ * replay of any subset, in any order, finds it (an unserved global is not a
62
+ * replay failure).
63
+ */
64
+ export declare function finalizeRecording(run: CassetteRun, scenario: string, meta: RecordMeta, opts?: {
65
+ globalsFrom?: string[];
66
+ }): {
67
+ dir: string;
68
+ streams: number;
69
+ interactions: number;
70
+ };
71
+ /**
72
+ * The selected scenarios in the order their recording ran (the manifests'
73
+ * `runOrder`), or null when no selected cassette stores one. Scenarios the
74
+ * stored order does not name keep their relative order, after the others.
75
+ */
76
+ export declare function storedRunOrder<T extends string>(run: Pick<CassetteRun, 'root'>, scenarios: readonly T[]): T[] | null;
77
+ /** Where a scenario's parts go when its recording is not written: `<root>/_failed/<scenario>/` (never read as a cassette). */
78
+ export declare const FAILED_RECORDINGS_DIR = "_failed";
79
+ /**
80
+ * Keep a scenario's recorded parts (each already through the gate) under
81
+ * `<root>/_failed/<scenario>/` for diagnosis, replacing an earlier copy.
82
+ * Returns that dir, or null when the scenario recorded nothing.
83
+ */
84
+ export declare function keepFailedParts(run: CassetteRun, scenario: string): string | null;
85
+ /** Why recording `scenario` would be refused before any credit is spent (an existing cassette), or null. */
86
+ export declare function recordTargetRefusal(run: CassetteRun, scenario: string): string | null;
87
+ export type ReplayOutcome = ReplayStateSummary & {
88
+ streams: number;
89
+ };
90
+ /** What the scenario's replay served, from its state dir; a string when the cassette cannot be read. */
91
+ export declare function replayOutcome(run: CassetteRun, scenario: string): ReplayOutcome | string;
92
+ /** The model a replay pins: the one every selected cassette was recorded with. */
93
+ export declare function replayModel(run: CassetteRun, scenarios: readonly string[]): string | undefined;
94
+ /** Whether `scenario` has a cassette for this machine under the run root. */
95
+ export declare function hasCassette(run: Pick<CassetteRun, 'root'>, scenario: string): boolean;
96
+ export interface GateResult {
97
+ dir: string;
98
+ ok: boolean;
99
+ /** The masked hits (file:line, rule), one per line. */
100
+ detail: string;
101
+ }
102
+ /** The redaction gate over every cassette under `root` (writes a REDACTION-FAILED marker into each that fails). */
103
+ export declare function gateCassettes(root: string): GateResult[];
104
+ /** Record the self-verify replay's result in the cassette's manifest. */
105
+ export declare function writeSelfVerify(dir: string, selfVerify: NonNullable<CassetteManifest['selfVerify']>): void;
106
+ export interface ImportResult {
107
+ /** `<platform>-<arch>/<scenario>` per imported cassette. */
108
+ imported: string[];
109
+ dest: string;
110
+ }
111
+ /**
112
+ * Copy every cassette under `source` into `<dest>/<platform>-<arch>/<scenario>/`
113
+ * after the gate (no marker written into the source) and a format check.
114
+ * All or nothing: any refusal (a gate hit, an unknown version, a cassette
115
+ * outside its `<platform>-<arch>` dir, an existing target without
116
+ * `overwrite`) copies nothing.
117
+ */
118
+ export declare function importCassettes(source: string, dest: string, overwrite?: boolean): ImportResult;
119
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/smoke/replay/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAQL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqF,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACpI,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,0GAA0G;IAC1G,IAAI,EAAE,MAAM,CAAC;IACb,iHAAiH;IACjH,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,4BAA4B;IAC5B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,iGAAiG;AACjG,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5F;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,EAA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M,GAAG,IAAI,CAIrF;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,MAAM,CAQxF;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAW9F;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErF;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mHAAmH;AACnH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAMxD;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI,CAG1G;AAUD,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,YAAY,CAgC7F"}
@@ -0,0 +1,302 @@
1
+ /**
2
+ * The smoke side of record/replay (design: .omc/plans/2026-10-29-copilot-replay-design.md,
3
+ * sections 6 and 7): where a run's cassettes and state live, the cassette env
4
+ * each scenario runs with, the merge of a recording's per-process parts into
5
+ * one cassette, the replay summary behind `scn.<name>.replay`, and the
6
+ * `omg smoke cassette verify|import` file work.
7
+ */
8
+ import { cpSync, existsSync, readdirSync, readFileSync, rmSync, statSync } from 'fs';
9
+ import { join, relative, resolve } from 'path';
10
+ import { CASSETTE_ENV } from '../copilot-session-env.js';
11
+ import { GLOBAL_STREAM, MANIFEST_FILE, findCassetteDirs, readCassette, verifyCassetteDir, writeCassette, formatGateHits, } from './cassette.js';
12
+ import { RECORD_FAILED_SUFFIX, RECORD_PARTS_DIR, RECORD_STARTED_SUFFIX, UNSCOPED_STATE_DIR } from './handler.js';
13
+ import { summarizeReplayState } from './matcher.js';
14
+ /** `<platform>-<arch>` of this machine: the cassette subdir it records into and replays from. */
15
+ export function platformTag() {
16
+ return `${process.platform}-${process.arch}`;
17
+ }
18
+ export function scenarioCassetteDir(run, scenario) {
19
+ return join(resolve(run.root), platformTag(), scenario);
20
+ }
21
+ export function scenarioStateDir(run, scenario) {
22
+ return join(run.stateRoot, scenario);
23
+ }
24
+ /**
25
+ * The cassette env on top of `base`. With a scenario, the scenario's state
26
+ * dir; without one (the smoke driver's shared client, switched per scenario
27
+ * by `setCassetteScenario`), the unscoped state dir, whose requests both
28
+ * modes answer with a 418 miss.
29
+ */
30
+ export function cassetteEnv(base, run, dirs, scenario) {
31
+ const env = {
32
+ ...base,
33
+ [CASSETTE_ENV.mode]: run.mode,
34
+ [CASSETTE_ENV.dir]: run.mode === 'replay' ? join(resolve(run.root), platformTag()) : resolve(run.root),
35
+ [CASSETTE_ENV.state]: scenario ? scenarioStateDir(run, scenario) : join(run.stateRoot, UNSCOPED_STATE_DIR),
36
+ [CASSETTE_ENV.match]: run.strict ? 'strict' : 'tolerant',
37
+ [CASSETTE_ENV.dirs]: JSON.stringify(dirs),
38
+ };
39
+ if (scenario)
40
+ env[CASSETTE_ENV.scenario] = scenario;
41
+ else
42
+ delete env[CASSETTE_ENV.scenario];
43
+ return env;
44
+ }
45
+ /**
46
+ * One cassette from every part the scenario's clients wrote (one per client,
47
+ * several processes for a team). Refuses when any part failed
48
+ * (`<pid>-<n>.failed`), a stream id repeats, or the parts disagree on the
49
+ * platform. Null when nothing was recorded. Global interactions are
50
+ * renumbered in part order.
51
+ */
52
+ export function mergeRecordedParts(stateDir, scenario) {
53
+ const partsDir = join(stateDir, RECORD_PARTS_DIR);
54
+ if (!existsSync(partsDir))
55
+ return null;
56
+ const names = readdirSync(partsDir).sort();
57
+ const unfinished = names.filter((n) => n.endsWith(RECORD_STARTED_SUFFIX)).map((n) => n.slice(0, -RECORD_STARTED_SUFFIX.length));
58
+ if (unfinished.length > 0) {
59
+ throw new Error(`recording part(s) ${unfinished.join(', ')} never finished (the client was not stopped, or its process was killed), refusing to merge`);
60
+ }
61
+ const failed = names.filter((n) => n.endsWith(RECORD_FAILED_SUFFIX));
62
+ if (failed.length > 0) {
63
+ const why = failed.map((n) => `${n}: ${readFileSync(join(partsDir, n), 'utf-8').trim().slice(0, 300)}`);
64
+ throw new Error(`${failed.length} recording part(s) failed, refusing to merge: ${why.join('; ')}`);
65
+ }
66
+ const parts = names.filter((n) => statSync(join(partsDir, n)).isDirectory()).map((n) => readCassette(join(partsDir, n)));
67
+ if (parts.length === 0)
68
+ return null;
69
+ const first = parts[0].manifest;
70
+ const streams = [];
71
+ const hits = {};
72
+ const interactions = [];
73
+ let globalSeq = 0;
74
+ for (const part of parts) {
75
+ const m = part.manifest;
76
+ if (m.platform !== first.platform || m.arch !== first.arch)
77
+ throw new Error(`recording parts disagree on the platform (${first.platform}-${first.arch} vs ${m.platform}-${m.arch})`);
78
+ for (const s of m.streams) {
79
+ if (streams.some((t) => t.id === s.id))
80
+ throw new Error(`stream ${s.id} was recorded by two clients`);
81
+ streams.push(s);
82
+ }
83
+ for (const [rule, n] of Object.entries(m.redaction.hits))
84
+ hits[rule] = (hits[rule] ?? 0) + n;
85
+ // A part lists its interactions in recording order, so its global seqs are already ascending.
86
+ for (const it of part.interactions)
87
+ interactions.push(it.stream === GLOBAL_STREAM ? { ...it, seq: ++globalSeq } : it);
88
+ }
89
+ return {
90
+ manifest: { ...first, scenario, recordedAt: new Date().toISOString(), redaction: { rules: first.redaction.rules, hits }, streams },
91
+ interactions,
92
+ };
93
+ }
94
+ /** The global GET and HEAD interactions of a scenario's finished parts, in recording order (a global POST is never borrowed). */
95
+ function recordedGlobals(stateDir) {
96
+ const partsDir = join(stateDir, RECORD_PARTS_DIR);
97
+ if (!existsSync(partsDir))
98
+ return [];
99
+ return readdirSync(partsDir).sort()
100
+ .filter((n) => statSync(join(partsDir, n)).isDirectory())
101
+ .flatMap((n) => readCassette(join(partsDir, n)).interactions.filter((it) => it.stream === GLOBAL_STREAM && (it.req.method === 'GET' || it.req.method === 'HEAD')));
102
+ }
103
+ /**
104
+ * Merge the scenario's parts and write the cassette to
105
+ * `<root>/<platform>-<arch>/<scenario>/` through the gate. Returns the
106
+ * cassette dir and the stream count; throws when nothing was recorded or the
107
+ * merge or write refuses.
108
+ *
109
+ * `globalsFrom`: the run's other scenarios. A runtime caches global GETs
110
+ * across the scenarios of one client, so only the first scenario to need one
111
+ * records it; each global key this scenario lacks is copied from them, and a
112
+ * replay of any subset, in any order, finds it (an unserved global is not a
113
+ * replay failure).
114
+ */
115
+ export function finalizeRecording(run, scenario, meta, opts = {}) {
116
+ const merged = mergeRecordedParts(scenarioStateDir(run, scenario), scenario);
117
+ if (!merged || merged.interactions.length === 0)
118
+ throw new Error('no model request was recorded');
119
+ const key = (it) => `${it.req.method} ${it.req.path}`;
120
+ const own = new Set(merged.interactions.filter((it) => it.stream === GLOBAL_STREAM).map(key));
121
+ let globalSeq = own.size === 0 ? 0 : Math.max(...merged.interactions.filter((it) => it.stream === GLOBAL_STREAM).map((it) => it.seq));
122
+ const borrowed = [];
123
+ for (const other of opts.globalsFrom ?? []) {
124
+ if (other === scenario)
125
+ continue;
126
+ for (const it of recordedGlobals(scenarioStateDir(run, other))) {
127
+ if (own.has(key(it)) || borrowed.some((b) => key(b) === key(it)))
128
+ continue;
129
+ borrowed.push({ ...it, seq: ++globalSeq });
130
+ }
131
+ }
132
+ const interactions = [...merged.interactions, ...borrowed];
133
+ const manifest = {
134
+ ...merged.manifest,
135
+ ...(meta.model ? { model: meta.model } : {}),
136
+ ...(meta.maxCredits !== undefined ? { maxCredits: meta.maxCredits } : {}),
137
+ ...(meta.cost ? { cost: meta.cost } : {}),
138
+ ...(meta.runOrder ? { runOrder: meta.runOrder } : {}),
139
+ };
140
+ const dir = scenarioCassetteDir(run, scenario);
141
+ writeCassette(dir, { ...merged, interactions, manifest }, { overwrite: run.overwrite });
142
+ return { dir, streams: manifest.streams.length, interactions: interactions.length };
143
+ }
144
+ /**
145
+ * The selected scenarios in the order their recording ran (the manifests'
146
+ * `runOrder`), or null when no selected cassette stores one. Scenarios the
147
+ * stored order does not name keep their relative order, after the others.
148
+ */
149
+ export function storedRunOrder(run, scenarios) {
150
+ for (const scenario of scenarios) {
151
+ if (!hasCassette(run, scenario))
152
+ continue;
153
+ const order = readCassette(scenarioCassetteDir(run, scenario)).manifest.runOrder;
154
+ if (!order)
155
+ continue;
156
+ const rank = (s) => (order.includes(s) ? order.indexOf(s) : order.length);
157
+ return [...scenarios].sort((a, b) => rank(a) - rank(b));
158
+ }
159
+ return null;
160
+ }
161
+ /** Where a scenario's parts go when its recording is not written: `<root>/_failed/<scenario>/` (never read as a cassette). */
162
+ export const FAILED_RECORDINGS_DIR = '_failed';
163
+ /**
164
+ * Keep a scenario's recorded parts (each already through the gate) under
165
+ * `<root>/_failed/<scenario>/` for diagnosis, replacing an earlier copy.
166
+ * Returns that dir, or null when the scenario recorded nothing.
167
+ */
168
+ export function keepFailedParts(run, scenario) {
169
+ const parts = join(scenarioStateDir(run, scenario), RECORD_PARTS_DIR);
170
+ if (!existsSync(parts) || readdirSync(parts).length === 0)
171
+ return null;
172
+ const dest = join(resolve(run.root), FAILED_RECORDINGS_DIR, scenario);
173
+ rmSync(dest, { recursive: true, force: true });
174
+ cpSync(parts, join(dest, RECORD_PARTS_DIR), { recursive: true, filter: (src) => !src.endsWith(RECORD_STARTED_SUFFIX) });
175
+ return dest;
176
+ }
177
+ /** The cassettes under `root`, leaving out the kept parts of failed recordings. */
178
+ function cassetteDirsUnder(root) {
179
+ return findCassetteDirs(root).filter((dir) => relative(root, dir).split(/[\\/]/)[0] !== FAILED_RECORDINGS_DIR);
180
+ }
181
+ /** Why recording `scenario` would be refused before any credit is spent (an existing cassette), or null. */
182
+ export function recordTargetRefusal(run, scenario) {
183
+ const dir = scenarioCassetteDir(run, scenario);
184
+ if (run.overwrite || !existsSync(dir) || readdirSync(dir).length === 0)
185
+ return null;
186
+ return `${dir} already holds a recording; pass --record-overwrite to replace it`;
187
+ }
188
+ /** What the scenario's replay served, from its state dir; a string when the cassette cannot be read. */
189
+ export function replayOutcome(run, scenario) {
190
+ let cassette;
191
+ try {
192
+ cassette = readCassette(scenarioCassetteDir(run, scenario));
193
+ }
194
+ catch (err) {
195
+ return err.message;
196
+ }
197
+ return { ...summarizeReplayState(scenarioStateDir(run, scenario), cassette), streams: cassette.manifest.streams.length };
198
+ }
199
+ /** The model a replay pins: the one every selected cassette was recorded with. */
200
+ export function replayModel(run, scenarios) {
201
+ const models = new Set();
202
+ for (const scenario of scenarios) {
203
+ const manifest = join(scenarioCassetteDir(run, scenario), MANIFEST_FILE);
204
+ if (!existsSync(manifest))
205
+ continue;
206
+ const model = readCassette(scenarioCassetteDir(run, scenario)).manifest.model;
207
+ if (!model)
208
+ throw new Error(`${scenario}: the cassette names no model, so replay cannot pin one; re-record it with --model`);
209
+ models.add(model);
210
+ }
211
+ if (models.size > 1)
212
+ throw new Error(`the selected cassettes were recorded on different models (${[...models].join(', ')}); replay them in separate runs`);
213
+ return [...models][0];
214
+ }
215
+ /** Whether `scenario` has a cassette for this machine under the run root. */
216
+ export function hasCassette(run, scenario) {
217
+ return existsSync(join(scenarioCassetteDir(run, scenario), MANIFEST_FILE));
218
+ }
219
+ /** The redaction gate over every cassette under `root` (writes a REDACTION-FAILED marker into each that fails). */
220
+ export function gateCassettes(root) {
221
+ if (!existsSync(root))
222
+ throw new Error(`${root} does not exist`);
223
+ return cassetteDirsUnder(resolve(root)).map((dir) => {
224
+ const result = verifyCassetteDir(dir);
225
+ return { dir, ok: result.ok, detail: result.ok ? 'clean' : formatGateHits(result.hits) };
226
+ });
227
+ }
228
+ /** Record the self-verify replay's result in the cassette's manifest. */
229
+ export function writeSelfVerify(dir, selfVerify) {
230
+ const cassette = readCassette(dir);
231
+ writeCassette(dir, { ...cassette, manifest: { ...cassette.manifest, selfVerify } }, { overwrite: true });
232
+ }
233
+ /** Files under `dir`, relative and `/`-separated. */
234
+ function filesUnder(dir, current = dir) {
235
+ return readdirSync(current, { withFileTypes: true }).flatMap((entry) => {
236
+ const path = join(current, entry.name);
237
+ return entry.isDirectory() ? filesUnder(dir, path) : [relative(dir, path).split('\\').join('/')];
238
+ });
239
+ }
240
+ /**
241
+ * Copy every cassette under `source` into `<dest>/<platform>-<arch>/<scenario>/`
242
+ * after the gate (no marker written into the source) and a format check.
243
+ * All or nothing: any refusal (a gate hit, an unknown version, a cassette
244
+ * outside its `<platform>-<arch>` dir, an existing target without
245
+ * `overwrite`) copies nothing.
246
+ */
247
+ export function importCassettes(source, dest, overwrite = false) {
248
+ const root = resolve(source);
249
+ if (!existsSync(root))
250
+ throw new Error(`${source} does not exist`);
251
+ const dirs = cassetteDirsUnder(root);
252
+ if (dirs.length === 0)
253
+ throw new Error(`no cassette (a dir with ${MANIFEST_FILE}) under ${source}`);
254
+ const plan = [];
255
+ const problems = [];
256
+ for (const dir of dirs) {
257
+ const rel = relative(root, dir).split('\\').join('/') || '.';
258
+ const gate = verifyCassetteDir(dir, { writeMarker: false });
259
+ if (!gate.ok) {
260
+ problems.push(`${rel}: redaction gate failed\n${formatGateHits(gate.hits)}`);
261
+ continue;
262
+ }
263
+ let manifest;
264
+ try {
265
+ manifest = readCassette(dir).manifest;
266
+ }
267
+ catch (err) {
268
+ problems.push(`${rel}: ${err.message}`);
269
+ continue;
270
+ }
271
+ const label = `${manifest.platform}-${manifest.arch}/${manifest.scenario}`;
272
+ if (!rel.endsWith(label) && rel !== manifest.scenario) {
273
+ problems.push(`${rel}: the manifest says ${label}; keep each cassette at <platform>-<arch>/<scenario>`);
274
+ continue;
275
+ }
276
+ const to = join(resolve(dest), manifest.platform + '-' + manifest.arch, manifest.scenario);
277
+ if (plan.some((p) => p.to === to)) {
278
+ problems.push(`${rel}: a second cassette for ${label}`);
279
+ continue;
280
+ }
281
+ if (existsSync(to) && readdirSync(to).length > 0) {
282
+ if (!overwrite) {
283
+ problems.push(`${label}: ${to} exists; pass --overwrite to replace it`);
284
+ continue;
285
+ }
286
+ // A file the new cassette does not replace would be mixed into it (an old stream's events).
287
+ const incoming = new Set(filesUnder(dir));
288
+ const stale = filesUnder(to).filter((f) => !incoming.has(f));
289
+ if (stale.length > 0) {
290
+ problems.push(`${label}: ${to} holds file(s) the import does not replace (${stale.join(', ')}); remove them first`);
291
+ continue;
292
+ }
293
+ }
294
+ plan.push({ from: dir, to, label });
295
+ }
296
+ if (problems.length > 0)
297
+ throw new Error(`nothing imported:\n${problems.join('\n')}`);
298
+ for (const { from, to } of plan)
299
+ cpSync(from, to, { recursive: true, force: true });
300
+ return { imported: plan.map((p) => p.label), dest: resolve(dest) };
301
+ }
302
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/smoke/replay/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,E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