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,311 @@
1
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
3
+ import { tmpdir } from 'os';
4
+ import { join } from 'path';
5
+ import { CASSETTE_ENV } from '../../copilot-session-env.js';
6
+ import { GLOBAL_STREAM, readCassette, REDACTION_FAILED_MARKER } from '../cassette.js';
7
+ import { addRecordingDenyLiterals, RECORD_FAILED_SUFFIX, RECORD_PARTS_DIR, RECORD_STARTED_SUFFIX, withCassette, } from '../handler.js';
8
+ import { cassetteEnv, finalizeRecording, gateCassettes, keepFailedParts, importCassettes, mergeRecordedParts, platformTag, recordTargetRefusal, replayModel, replayOutcome, scenarioCassetteDir, scenarioStateDir, } from '../run.js';
9
+ const dirs = [];
10
+ const tempDir = (prefix) => {
11
+ const dir = mkdtempSync(join(tmpdir(), prefix));
12
+ dirs.push(dir);
13
+ return dir;
14
+ };
15
+ const fetchSpy = vi.fn(async () => { throw new Error('fetch called'); });
16
+ beforeEach(() => { vi.stubGlobal('fetch', fetchSpy); });
17
+ afterEach(() => {
18
+ vi.unstubAllGlobals();
19
+ vi.restoreAllMocks();
20
+ expect(fetchSpy).not.toHaveBeenCalled();
21
+ for (const dir of dirs)
22
+ rmSync(dir, { recursive: true, force: true });
23
+ dirs.length = 0;
24
+ });
25
+ const API = 'https://api.githubcopilot.com';
26
+ function fakeSdkBase(answer = () => ({ id: 'c', choices: [{ index: 0, message: { role: 'assistant', content: 'ok' } }] })) {
27
+ const upstream = vi.fn(async (request) => {
28
+ const text = request.method === 'GET' ? '' : await request.text();
29
+ return new Response(JSON.stringify(answer(text ? JSON.parse(text) : null)), { status: 200, headers: { 'content-type': 'application/json' } });
30
+ });
31
+ class Base {
32
+ async sendRequest(request, _ctx) { return upstream(request); }
33
+ async openWebSocket() { throw new Error('no ws'); }
34
+ }
35
+ return { Base: Base, upstream };
36
+ }
37
+ class FakeClient {
38
+ opts;
39
+ constructor(opts) {
40
+ this.opts = opts;
41
+ }
42
+ get handler() { return this.opts.requestHandler; }
43
+ async start() { }
44
+ async stop() { return []; }
45
+ async getStatus() { return {}; }
46
+ async listModels() { return []; }
47
+ async createSession(config) { return { sessionId: 'x', config }; }
48
+ async deleteSession() { }
49
+ }
50
+ function fakeSdk(Base) {
51
+ return { module: { CopilotClient: FakeClient, RuntimeConnection: { forStdio: (o) => o }, CopilotRequestHandler: Base }, version: '1.0.16', from: 'test' };
52
+ }
53
+ const newClient = (sdk) => new sdk.module.CopilotClient({ connection: {}, baseDirectory: 'b', workingDirectory: 'w' });
54
+ async function drive(client, session, prompt, method = 'POST') {
55
+ const url = `${API}${method === 'GET' ? '/models' : '/chat/completions'}`;
56
+ const body = { model: 'gpt-5-mini', messages: [{ role: 'user', content: prompt }] };
57
+ const request = new Request(url, { method, headers: { 'content-type': 'application/json' }, ...(method === 'GET' ? {} : { body: JSON.stringify(body) }) });
58
+ return client.handler.sendRequest(request, { sessionId: session, transport: 'http', url, headers: { 'content-type': ['application/json'] } });
59
+ }
60
+ function newRun(mode, root = tempDir('omg-cassettes-'), over = {}) {
61
+ return { mode, root, stateRoot: tempDir('omg-cassette-state-'), strict: false, overwrite: false, ...over };
62
+ }
63
+ /** Record `prompts` for `scenario`, one client (one "process") per prompt group; returns the run. */
64
+ async function recordScenario(run, scenario, groups) {
65
+ for (const prompts of groups) {
66
+ const { Base } = fakeSdkBase();
67
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, scenario)));
68
+ for (const [i, prompt] of prompts.entries()) {
69
+ await drive(client, `${prompt}-session`, prompt);
70
+ if (i === 0)
71
+ await drive(client, `${prompt}-session`, '', 'GET');
72
+ }
73
+ expect(await client.stop()).toEqual([]);
74
+ }
75
+ }
76
+ describe('cassette run: record parts, merge, finalize', () => {
77
+ it('merges the parts of several clients into one cassette with distinct streams and renumbered global interactions', async () => {
78
+ const run = newRun('record');
79
+ await recordScenario(run, 'team', [['task alpha'], ['task beta']]);
80
+ const parts = readdirSync(join(scenarioStateDir(run, 'team'), RECORD_PARTS_DIR));
81
+ expect(parts).toHaveLength(2);
82
+ const merged = mergeRecordedParts(scenarioStateDir(run, 'team'), 'team');
83
+ expect(merged.manifest.scenario).toBe('team');
84
+ expect(merged.manifest.streams.map((s) => s.id).sort()).toEqual(['s1-root', 's2-root']);
85
+ expect(merged.interactions.filter((it) => it.stream === GLOBAL_STREAM).map((it) => it.seq)).toEqual([1, 2]);
86
+ const written = finalizeRecording(run, 'team', { model: 'gpt-5-mini', maxCredits: 30, cost: { credits: 1.2, premiumRequests: 2 } });
87
+ expect(written).toMatchObject({ dir: scenarioCassetteDir(run, 'team'), streams: 2, interactions: 4 });
88
+ expect(written.dir).toBe(join(run.root, platformTag(), 'team'));
89
+ const cassette = readCassette(written.dir);
90
+ expect(cassette.manifest).toMatchObject({ scenario: 'team', model: 'gpt-5-mini', maxCredits: 30, cost: { credits: 1.2, premiumRequests: 2 } });
91
+ expect(replayModel({ ...run, mode: 'replay' }, ['team'])).toBe('gpt-5-mini');
92
+ });
93
+ it('refuses to merge when any part failed, and a gate refusal at stop() leaves that marker', async () => {
94
+ const run = newRun('record');
95
+ const secret = `late-literal-${Date.now()}-9931`;
96
+ const { Base } = fakeSdkBase(() => ({ id: 'c', choices: [{ index: 0, message: { role: 'assistant', content: `x ${secret}` } }] }));
97
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke')));
98
+ await (await drive(client, 's', 'hello')).text();
99
+ await new Promise((r) => { setTimeout(r, 50); }); // the tapped response is redacted in the background
100
+ addRecordingDenyLiterals([secret]); // learned after redaction: only the gate at stop() sees it
101
+ const errors = await client.stop();
102
+ expect(errors).toHaveLength(1);
103
+ const partsDir = join(scenarioStateDir(run, 'smoke'), RECORD_PARTS_DIR);
104
+ const markers = readdirSync(partsDir).filter((n) => n.endsWith(RECORD_FAILED_SUFFIX));
105
+ expect(markers).toHaveLength(1);
106
+ expect(readFileSync(join(partsDir, markers[0]), 'utf-8')).not.toContain(secret);
107
+ expect(() => mergeRecordedParts(scenarioStateDir(run, 'smoke'), 'smoke')).toThrow(/part\(s\) failed, refusing to merge/);
108
+ expect(() => finalizeRecording(run, 'smoke', {})).toThrow(/refusing to merge/);
109
+ expect(existsSync(scenarioCassetteDir(run, 'smoke'))).toBe(false);
110
+ });
111
+ it('a scenario with no request finalizes to nothing; an existing cassette is refused before recording unless overwritten', async () => {
112
+ const run = newRun('record');
113
+ expect(() => finalizeRecording(run, 'smoke', {})).toThrow(/no model request was recorded/);
114
+ await recordScenario(run, 'smoke', [['hi']]);
115
+ finalizeRecording(run, 'smoke', { model: 'm' });
116
+ expect(recordTargetRefusal(run, 'smoke')).toMatch(/already holds a recording; pass --record-overwrite/);
117
+ expect(recordTargetRefusal({ ...run, overwrite: true }, 'smoke')).toBeNull();
118
+ expect(recordTargetRefusal(run, 'guardrail')).toBeNull();
119
+ });
120
+ it('one client switched between scenarios records each into its own state dir', async () => {
121
+ const run = newRun('record');
122
+ const { Base } = fakeSdkBase();
123
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {})));
124
+ expect(client.cassette).toBe('record');
125
+ client.setCassetteScenario('smoke', scenarioStateDir(run, 'smoke'));
126
+ await drive(client, 'a', 'smoke prompt');
127
+ client.setCassetteScenario('guardrail', scenarioStateDir(run, 'guardrail'));
128
+ await drive(client, 'b', 'guardrail prompt');
129
+ expect(await client.stop()).toEqual([]);
130
+ for (const name of ['smoke', 'guardrail']) {
131
+ const merged = mergeRecordedParts(scenarioStateDir(run, name), name);
132
+ expect(merged.manifest.streams.map((s) => [s.id, s.session])).toEqual([['s1-root', 1]]);
133
+ }
134
+ });
135
+ it('before its first scenario a switched client answers 418 without forwarding; a late request of scenario A after the switch stays in A', async () => {
136
+ const run = newRun('record');
137
+ const { Base, upstream } = fakeSdkBase();
138
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {})));
139
+ expect((await drive(client, 'static', 'static prompt')).status).toBe(418);
140
+ expect((await drive(client, 'static', '', 'GET')).status).toBe(418);
141
+ expect(upstream).not.toHaveBeenCalled();
142
+ client.setCassetteScenario('smoke', scenarioStateDir(run, 'smoke'));
143
+ await drive(client, 'a', 'smoke prompt');
144
+ client.setCassetteScenario('guardrail', scenarioStateDir(run, 'guardrail'));
145
+ await drive(client, 'a', 'smoke follow-up'); // session a spoke in smoke first
146
+ await drive(client, 'b', 'guardrail prompt');
147
+ expect(await client.stop()).toEqual([]);
148
+ expect(mergeRecordedParts(scenarioStateDir(run, 'smoke'), 'smoke').interactions).toHaveLength(2);
149
+ expect(mergeRecordedParts(scenarioStateDir(run, 'guardrail'), 'guardrail').interactions).toHaveLength(1);
150
+ expect(existsSync(join(run.stateRoot, '_client', RECORD_PARTS_DIR))).toBe(false);
151
+ });
152
+ it('a client that recorded and was never stopped (a killed process) leaves a marker the merge refuses', async () => {
153
+ const run = newRun('record');
154
+ const { Base } = fakeSdkBase();
155
+ const killed = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'team')));
156
+ await drive(killed, 'k', 'task alpha');
157
+ await recordScenario(run, 'team', [['task beta']]);
158
+ const partsDir = join(scenarioStateDir(run, 'team'), RECORD_PARTS_DIR);
159
+ expect(readdirSync(partsDir).filter((n) => n.endsWith(RECORD_STARTED_SUFFIX))).toHaveLength(1);
160
+ expect(() => mergeRecordedParts(scenarioStateDir(run, 'team'), 'team')).toThrow(/never finished .*refusing to merge/);
161
+ expect(await killed.stop()).toEqual([]);
162
+ expect(readdirSync(partsDir).filter((n) => n.endsWith(RECORD_STARTED_SUFFIX))).toEqual([]);
163
+ expect(mergeRecordedParts(scenarioStateDir(run, 'team'), 'team').manifest.streams).toHaveLength(2);
164
+ });
165
+ it('borrows a global GET from another scenario but not a global POST', async () => {
166
+ const run = newRun('record');
167
+ await recordScenario(run, 'smoke', [['task alpha']]);
168
+ const { Base } = fakeSdkBase();
169
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke')));
170
+ const url = `${API}/chat/completions`;
171
+ await client.handler.sendRequest(new Request(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' }), { sessionId: 'g', transport: 'http', url, headers: { 'content-type': ['application/json'] } });
172
+ expect(await client.stop()).toEqual([]);
173
+ const own = mergeRecordedParts(scenarioStateDir(run, 'smoke'), 'smoke');
174
+ expect(own.interactions.filter((it) => it.stream === GLOBAL_STREAM).map((it) => it.req.method).sort()).toEqual(['GET', 'POST']);
175
+ await recordScenario(run, 'guardrail', [['task beta']]);
176
+ finalizeRecording(run, 'guardrail', {}, { globalsFrom: ['smoke', 'guardrail'] });
177
+ const globals = readCassette(scenarioCassetteDir(run, 'guardrail')).interactions.filter((it) => it.stream === GLOBAL_STREAM);
178
+ expect(globals.map((it) => it.req.method)).toEqual(['GET']);
179
+ });
180
+ it('keepFailedParts copies parts and .failed markers but not .started markers', async () => {
181
+ const run = newRun('record');
182
+ await recordScenario(run, 'team', [['task alpha']]);
183
+ const partsDir = join(scenarioStateDir(run, 'team'), RECORD_PARTS_DIR);
184
+ writeFileSync(join(partsDir, `9-1${RECORD_STARTED_SUFFIX}`), '9');
185
+ writeFileSync(join(partsDir, `9-2${RECORD_FAILED_SUFFIX}`), 'boom');
186
+ const kept = join(keepFailedParts(run, 'team'), RECORD_PARTS_DIR);
187
+ const names = readdirSync(kept);
188
+ expect(names).toContain(`9-2${RECORD_FAILED_SUFFIX}`);
189
+ expect(names.some((n) => n.endsWith(RECORD_STARTED_SUFFIX))).toBe(false);
190
+ expect(names.length).toBeGreaterThan(1);
191
+ });
192
+ });
193
+ describe('cassette run: replay outcome', () => {
194
+ async function recorded() {
195
+ const run = newRun('record');
196
+ await recordScenario(run, 'smoke', [['hi']]);
197
+ finalizeRecording(run, 'smoke', { model: 'gpt-5-mini' });
198
+ return newRun('replay', run.root);
199
+ }
200
+ it('a full replay serves every stream; the SDK and its clients carry the replay marker', async () => {
201
+ const run = await recorded();
202
+ const { Base, upstream } = fakeSdkBase();
203
+ const sdk = withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke'));
204
+ expect(sdk.cassette).toBe('replay');
205
+ const client = newClient(sdk);
206
+ expect(client.cassette).toBe('replay');
207
+ expect((await drive(client, 'live', 'hi')).status).toBe(200);
208
+ expect((await drive(client, 'live', '', 'GET')).status).toBe(200);
209
+ expect(upstream).not.toHaveBeenCalled();
210
+ const outcome = replayOutcome(run, 'smoke');
211
+ expect(outcome).toMatchObject({ streams: 1, misses: [], unclaimed: [], unconsumed: [] });
212
+ });
213
+ it('a miss and an unclaimed stream are reported', async () => {
214
+ const run = await recorded();
215
+ const { Base } = fakeSdkBase();
216
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke')));
217
+ expect((await drive(client, 'live', 'hi')).status).toBe(200);
218
+ expect((await drive(client, 'live', 'hi again')).status).toBe(418); // the stream is exhausted
219
+ expect(replayOutcome(run, 'smoke')).toMatchObject({ misses: [expect.objectContaining({ reason: 'stream exhausted' })] });
220
+ const idle = await recorded();
221
+ expect(replayOutcome(idle, 'smoke')).toMatchObject({ unclaimed: ['s1-root'] });
222
+ expect(replayOutcome(idle, 'team')).toMatch(/no manifest\.json/);
223
+ });
224
+ it('a client with no scenario selected answers 418 and logs nothing', async () => {
225
+ const run = await recorded();
226
+ const { Base } = fakeSdkBase();
227
+ const client = newClient(withCassette(fakeSdk(Base), cassetteEnv({}, run, {})));
228
+ expect((await drive(client, 'live', 'hi')).status).toBe(418);
229
+ client.setCassetteScenario('smoke', scenarioStateDir(run, 'smoke'));
230
+ expect((await drive(client, 'live2', 'hi')).status).toBe(200);
231
+ expect(replayOutcome(run, 'smoke')).toMatchObject({ misses: [] });
232
+ });
233
+ });
234
+ describe('cassette env', () => {
235
+ it('carries the mode, the platform dir for replay, a per-scenario state, the match mode and the placeholder dirs', () => {
236
+ const run = newRun('replay', tempDir('root-'), { strict: true });
237
+ const env = cassetteEnv({ PATH: '/bin', [CASSETTE_ENV.scenario]: 'stale' }, run, { PROJECT: '/p' }, 'team');
238
+ expect(env).toMatchObject({
239
+ PATH: '/bin',
240
+ [CASSETTE_ENV.mode]: 'replay',
241
+ [CASSETTE_ENV.dir]: join(run.root, platformTag()),
242
+ [CASSETTE_ENV.state]: join(run.stateRoot, 'team'),
243
+ [CASSETTE_ENV.scenario]: 'team',
244
+ [CASSETTE_ENV.match]: 'strict',
245
+ [CASSETTE_ENV.dirs]: '{"PROJECT":"/p"}',
246
+ });
247
+ expect(cassetteEnv({ [CASSETTE_ENV.scenario]: 'stale' }, run, {})[CASSETTE_ENV.scenario]).toBeUndefined();
248
+ });
249
+ it('a bad match mode or placeholder map fails the SDK load', () => {
250
+ const { Base } = fakeSdkBase();
251
+ const run = newRun('record');
252
+ expect(() => withCassette(fakeSdk(Base), { ...cassetteEnv({}, run, {}), [CASSETTE_ENV.match]: 'loose' })).toThrow(/"strict" or "tolerant"/);
253
+ expect(() => withCassette(fakeSdk(Base), { ...cassetteEnv({}, run, {}), [CASSETTE_ENV.dirs]: '{"NOPE":"/x"}' })).toThrow(/not a path placeholder/);
254
+ });
255
+ it('record mode says so on stderr, once per state dir', () => {
256
+ const write = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
257
+ const { Base } = fakeSdkBase();
258
+ const run = newRun('record');
259
+ withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke'));
260
+ withCassette(fakeSdk(Base), cassetteEnv({}, run, {}, 'smoke'));
261
+ const notices = write.mock.calls.map((c) => String(c[0])).filter((t) => t.includes('omg cassette: RECORD mode'));
262
+ expect(notices).toHaveLength(1);
263
+ expect(notices[0]).toContain(scenarioStateDir(run, 'smoke'));
264
+ write.mockClear();
265
+ withCassette(fakeSdk(Base), cassetteEnv({}, newRun('replay', run.root), {}));
266
+ expect(write.mock.calls.map((c) => String(c[0])).filter((t) => t.includes('RECORD mode'))).toEqual([]);
267
+ });
268
+ });
269
+ describe('cassette verify and import', () => {
270
+ async function capture() {
271
+ const run = newRun('record');
272
+ await recordScenario(run, 'smoke', [['hi']]);
273
+ finalizeRecording(run, 'smoke', { model: 'gpt-5-mini' });
274
+ return run.root;
275
+ }
276
+ it('the gate passes a clean capture and marks one with a planted token', async () => {
277
+ const root = await capture();
278
+ expect(gateCassettes(root)).toEqual([expect.objectContaining({ ok: true })]);
279
+ const dir = join(root, platformTag(), 'smoke');
280
+ const interactions = join(dir, 'interactions.jsonl');
281
+ writeFileSync(interactions, readFileSync(interactions, 'utf-8').replace('"ok"', `"ghp_${'a'.repeat(36)}"`));
282
+ const [result] = gateCassettes(root);
283
+ expect(result.ok).toBe(false);
284
+ expect(existsSync(join(dir, REDACTION_FAILED_MARKER))).toBe(true);
285
+ });
286
+ it('imports into <dest>/<platform>-<arch>/<scenario>, all or nothing, refusing an existing target without overwrite', async () => {
287
+ const root = await capture();
288
+ const dest = tempDir('fixtures-');
289
+ expect(importCassettes(root, dest).imported).toEqual([`${platformTag()}/smoke`]);
290
+ expect(readCassette(join(dest, platformTag(), 'smoke')).manifest.model).toBe('gpt-5-mini');
291
+ expect(() => importCassettes(root, dest)).toThrow(/exists; pass --overwrite/);
292
+ expect(importCassettes(root, dest, true).imported).toHaveLength(1);
293
+ // A stray file in the target would be mixed into the cassette.
294
+ writeFileSync(join(dest, platformTag(), 'smoke', 'report.json'), '{}');
295
+ expect(() => importCassettes(root, dest, true)).toThrow(/does not replace \(report\.json\)/);
296
+ });
297
+ it('refuses a cassette with a gate failure or outside its platform dir, copying nothing', async () => {
298
+ const root = await capture();
299
+ const dest = tempDir('fixtures-');
300
+ const misplaced = join(root, 'elsewhere', 'smoke');
301
+ mkdirSync(join(misplaced, '..'), { recursive: true });
302
+ cpSync(join(root, platformTag(), 'smoke'), misplaced, { recursive: true });
303
+ expect(() => importCassettes(root, dest)).toThrow(/keep each cassette at <platform>-<arch>\/<scenario>/);
304
+ expect(readdirSync(dest)).toEqual([]);
305
+ rmSync(join(root, 'elsewhere'), { recursive: true });
306
+ writeFileSync(join(root, platformTag(), 'smoke', REDACTION_FAILED_MARKER), 'x\n');
307
+ expect(() => importCassettes(root, dest)).toThrow(/redaction gate failed/);
308
+ expect(readdirSync(dest)).toEqual([]);
309
+ });
310
+ });
311
+ //# sourceMappingURL=run.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.test.js","sourceRoot":"","sources":["../../../../src/smoke/replay/__tests__/run.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAClH,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,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AAO,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Copilot replay cassettes, format version 1 (design:
3
+ * .omc/plans/2026-10-29-copilot-replay-design.md, sections 3 and 5).
4
+ *
5
+ * One cassette is one directory:
6
+ *
7
+ * manifest.json {@link CassetteManifest}
8
+ * interactions.jsonl one {@link CassetteInteraction} per model request
9
+ * events/<stream>.jsonl the scenario's SDK events, redacted (optional)
10
+ * report.json the record run's smoke report, redacted (optional)
11
+ *
12
+ * Shared types for the matcher (matcher.ts) and the handlers live here.
13
+ *
14
+ * Writing is fail closed: {@link writeCassette} runs the redaction gate over
15
+ * every serialized file first and writes nothing if anything secret-looking
16
+ * survived. {@link verifyCassetteDir} is the same gate over a directory on
17
+ * disk; a failing verify leaves a {@link REDACTION_FAILED_MARKER} that
18
+ * {@link readCassette} (and so the importer) refuses.
19
+ */
20
+ import { type RedactionIdentity, type SecretHit } from './redact.js';
21
+ export declare const CASSETTE_FORMAT = "omg-copilot-cassette";
22
+ export declare const CASSETTE_VERSION = 1;
23
+ export declare const MANIFEST_FILE = "manifest.json";
24
+ export declare const INTERACTIONS_FILE = "interactions.jsonl";
25
+ export declare const EVENTS_DIR = "events";
26
+ export declare const REPORT_FILE = "report.json";
27
+ /** Written by a failing gate; a cassette dir that holds it is never read or imported. */
28
+ export declare const REDACTION_FAILED_MARKER = "REDACTION-FAILED";
29
+ /** The `--record-full` sidecar (local debugging only); the gate rejects a cassette that contains it. */
30
+ export declare const RECORD_FULL_SIDECAR = "full-requests";
31
+ /** Stream id of requests outside any agent thread (e.g. `GET /models`), keyed by method + path only. */
32
+ export declare const GLOBAL_STREAM = "global";
33
+ export type CassetteTransport = 'http' | 'ws';
34
+ export interface CassetteStream {
35
+ id: string;
36
+ /** Digest of the normalized first user message of the stream's first request. */
37
+ promptDigest: string;
38
+ /** Order in which the stream's session first issued a request in the scenario (1-based). */
39
+ session: number;
40
+ /** `root`, or `root/2` for the second subagent spawned under root. */
41
+ agent: string;
42
+ /** Number of interactions recorded for this stream. */
43
+ interactions: number;
44
+ label?: string;
45
+ }
46
+ export interface CassetteManifest {
47
+ format: typeof CASSETTE_FORMAT;
48
+ version: typeof CASSETTE_VERSION;
49
+ scenario: string;
50
+ recordedAt: string;
51
+ omg: {
52
+ version: string;
53
+ gitSha?: string;
54
+ dirty?: boolean;
55
+ };
56
+ sdk: {
57
+ version: string;
58
+ };
59
+ runtime?: {
60
+ version?: string;
61
+ protocolVersion?: number;
62
+ };
63
+ platform: string;
64
+ arch: string;
65
+ node?: string;
66
+ model?: string;
67
+ maxCredits?: number;
68
+ cost?: {
69
+ credits?: number;
70
+ premiumRequests?: number;
71
+ };
72
+ redaction: {
73
+ rules: number;
74
+ hits: Record<string, number>;
75
+ };
76
+ streams: CassetteStream[];
77
+ selfVerify?: {
78
+ ok: boolean;
79
+ misses: number;
80
+ drift: number;
81
+ };
82
+ /** The scenarios of the recording run, in the order they ran (replay keeps it: one runtime caches global GETs across them). */
83
+ runOrder?: string[];
84
+ }
85
+ export interface CassetteRequest {
86
+ method: string;
87
+ path: string;
88
+ transport: CassetteTransport;
89
+ interactionType?: string;
90
+ model?: string;
91
+ /** Allowlisted headers only (redact.ts rule 1). */
92
+ headers: Record<string, string>;
93
+ /** Digest of the normalized new messages since the stream's previous request. */
94
+ deltaDigest: string;
95
+ toolNamesDigest?: string;
96
+ /** Tool-call ids of the previous recorded response that this request must answer. */
97
+ expectsToolResults?: string[];
98
+ /** `diskDelta()` of the new messages: redacted, normalized, cut at DELTA_MAX_BYTES (drift reports only). */
99
+ delta?: string;
100
+ }
101
+ export interface CassetteWsMessage {
102
+ dir: 'in' | 'out';
103
+ data: string;
104
+ }
105
+ interface CassetteResponseBase {
106
+ status: number;
107
+ /** Allowlisted headers only (redact.ts rule 2). */
108
+ headers: Record<string, string>;
109
+ }
110
+ export type CassetteResponse = CassetteResponseBase & {
111
+ kind: 'sse';
112
+ chunks: string[];
113
+ } | CassetteResponseBase & {
114
+ kind: 'json';
115
+ body: unknown;
116
+ } | CassetteResponseBase & {
117
+ kind: 'text';
118
+ body: string;
119
+ } | CassetteResponseBase & {
120
+ kind: 'ws';
121
+ messages: CassetteWsMessage[];
122
+ };
123
+ export type CassetteResponseKind = CassetteResponse['kind'];
124
+ export interface CassetteInteraction {
125
+ /** A {@link CassetteStream.id}, or {@link GLOBAL_STREAM}. */
126
+ stream: string;
127
+ /** Position in the stream; strictly increasing within a stream. */
128
+ seq: number;
129
+ req: CassetteRequest;
130
+ res: CassetteResponse;
131
+ /** Informational; replay does not sleep. */
132
+ ms?: number;
133
+ }
134
+ export interface Cassette {
135
+ manifest: CassetteManifest;
136
+ interactions: CassetteInteraction[];
137
+ /** SDK events per stream id. */
138
+ events?: Record<string, unknown[]>;
139
+ report?: unknown;
140
+ }
141
+ export declare class CassetteFormatError extends Error {
142
+ name: string;
143
+ }
144
+ export interface GateHit extends SecretHit {
145
+ /** Path relative to the cassette dir, `/`-separated. */
146
+ file: string;
147
+ /** 1-based line of the hit (0 for a file-level problem, or a hit only a decoded level of a .json file shows). */
148
+ line: number;
149
+ }
150
+ export declare class CassetteGateError extends Error {
151
+ readonly hits: GateHit[];
152
+ name: string;
153
+ constructor(hits: GateHit[]);
154
+ }
155
+ export declare function formatGateHits(hits: readonly GateHit[]): string;
156
+ /**
157
+ * Validate a parsed manifest. Refuses any other `format` and any `version`
158
+ * this build does not know (a newer one first, with the hint to upgrade).
159
+ */
160
+ export declare function parseManifest(value: unknown, where?: string): CassetteManifest;
161
+ /** Validate one parsed interaction. */
162
+ export declare function parseInteraction(value: unknown, where: string): CassetteInteraction;
163
+ /** Read and validate a cassette directory. Refuses a gate-failed cassette and unknown formats or versions. */
164
+ export declare function readCassette(dir: string): Cassette;
165
+ /** The files of a cassette as `relative path -> content`, in write order (manifest last). */
166
+ export declare function serializeCassette(cassette: Cassette): Map<string, string>;
167
+ export interface GateOptions {
168
+ /** Deny-set literals (record time only; never written anywhere). */
169
+ denyLiterals?: Iterable<string>;
170
+ /** Identity strings to look for (record time only). */
171
+ identity?: RedactionIdentity;
172
+ }
173
+ /**
174
+ * The gate over in-memory file contents (relative path -> text). Scans the
175
+ * serialized text, then every decoded string level of each JSON document
176
+ * (a .json file, or a .jsonl line) and of each reassembled stream, so a
177
+ * secret is found however deeply escaped it sits or however it was split.
178
+ * A decoded hit repeating a text hit is reported once.
179
+ */
180
+ export declare function gateFiles(files: ReadonlyMap<string, string>, options?: GateOptions): GateHit[];
181
+ export interface WriteCassetteOptions extends GateOptions {
182
+ /** Allow writing into a non-empty directory whose files this write all replaces (any other file is refused). */
183
+ overwrite?: boolean;
184
+ }
185
+ /**
186
+ * Validate, gate, then write a cassette. Fail closed: if the gate finds
187
+ * anything, a {@link CassetteGateError} is thrown and no file is written.
188
+ */
189
+ export declare function writeCassette(dir: string, cassette: Cassette, options?: WriteCassetteOptions): string[];
190
+ export interface VerifyResult {
191
+ ok: boolean;
192
+ hits: GateHit[];
193
+ /** Set when the gate wrote the marker. */
194
+ marker?: string;
195
+ }
196
+ /**
197
+ * The gate over a cassette directory on disk (`omg smoke cassette verify`):
198
+ * only the cassette's own files, each BOM-less UTF-8 that parses, the
199
+ * cassette must validate, no symlink, no `--record-full` sidecar, no header outside the allowlists, and no secret
200
+ * pattern (plus the deny set when given). On failure it deletes nothing and
201
+ * writes {@link REDACTION_FAILED_MARKER} listing the masked hits, unless
202
+ * `writeMarker` is false.
203
+ */
204
+ export declare function verifyCassetteDir(dir: string, options?: GateOptions & {
205
+ writeMarker?: boolean;
206
+ }): VerifyResult;
207
+ /** Every cassette dir (a dir holding manifest.json) under `root`, the root itself included. Does not follow symlinks. */
208
+ export declare function findCassetteDirs(root: string): string[];
209
+ export {};
210
+ //# sourceMappingURL=cassette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cassette.d.ts","sourceRoot":"","sources":["../../../src/smoke/replay/cassette.ts"],"names":[],"mappings":"AA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