@cnc-tools/storm 0.14.1 → 0.15.0

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 (404) hide show
  1. package/dist/application.js +3 -1
  2. package/dist/bin/storm.js +18 -8
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
  5. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  6. package/dist/chunks/chunk-5GBMR4HM.js +966 -0
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  9. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  10. package/dist/chunks/{chunk-27P2QSIM.js → chunk-CXAT7ZKP.js} +2 -2
  11. package/dist/chunks/chunk-E4PJNZVG.js +783 -0
  12. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  13. package/dist/chunks/{chunk-ZH5R7W4A.js → chunk-KC4KDJ5K.js} +147 -26
  14. package/dist/chunks/{chunk-5ED3IDUJ.js → chunk-L36GBUBB.js} +1652 -681
  15. package/dist/chunks/{chunk-QBR5VHJ7.js → chunk-OX7X4B2L.js} +7 -2
  16. package/dist/chunks/{chunk-Z5OXOZD3.js → chunk-PN5ULTTH.js} +140 -130
  17. package/dist/chunks/chunk-QUHY6FGN.js +108 -0
  18. package/dist/chunks/chunk-QVS7HRU7.js +74 -0
  19. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  20. package/dist/chunks/{chunk-YBPTMJUM.js → chunk-RAQEXKL6.js} +1120 -465
  21. package/dist/chunks/{chunk-RKONDLPS.js → chunk-SZEURWRS.js} +446 -52
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  24. package/dist/chunks/{chunk-XPCUINWS.js → chunk-XEVHP5ZW.js} +2 -2
  25. package/dist/chunks/{chunk-5TMHYH7G.js → chunk-YV7GE6EV.js} +638 -80
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-FBVWUUMT.js → live-app-PI3BAN6Y.js} +37 -26
  28. package/dist/command-tree.d.ts +2 -2
  29. package/dist/command-tree.js +2 -2
  30. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
  31. package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
  32. package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
  33. package/dist/commands/exec/across-sandboxes-run.js +339 -0
  34. package/dist/commands/exec/command.d.ts +577 -75
  35. package/dist/commands/exec/command.js +165 -32
  36. package/dist/commands/exec/driver-plan.d.ts +8 -2
  37. package/dist/commands/exec/driver-plan.js +13 -3
  38. package/dist/commands/exec/exec-words.d.ts +17 -3
  39. package/dist/commands/exec/exec-words.js +27 -16
  40. package/dist/commands/exec/live-view.d.ts +3 -4
  41. package/dist/commands/exec/live-view.js +37 -28
  42. package/dist/commands/exec/metadata.js +2 -2
  43. package/dist/commands/exec/mint-failed.d.ts +4 -4
  44. package/dist/commands/exec/mint-failed.js +6 -6
  45. package/dist/commands/exec/outcomes.d.ts +530 -73
  46. package/dist/commands/exec/outcomes.js +202 -66
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +46 -0
  49. package/dist/commands/exec/plan-run.d.ts +54 -35
  50. package/dist/commands/exec/plan-run.js +81 -38
  51. package/dist/commands/exec/planned-outcome.d.ts +15 -0
  52. package/dist/commands/exec/planned-outcome.js +35 -0
  53. package/dist/commands/exec/progress.d.ts +2 -2
  54. package/dist/commands/exec/progress.js +35 -18
  55. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  56. package/dist/commands/exec/resource-refusals.js +3 -3
  57. package/dist/commands/exec/run-bin.d.ts +1 -1
  58. package/dist/commands/exec/run-bin.js +2 -2
  59. package/dist/commands/exec/run-command.d.ts +345 -63
  60. package/dist/commands/exec/run-command.js +308 -258
  61. package/dist/commands/exec/run-metadata.d.ts +42 -8
  62. package/dist/commands/exec/run-metadata.js +40 -21
  63. package/dist/commands/exec/run-planned.d.ts +20 -0
  64. package/dist/commands/exec/run-planned.js +22 -0
  65. package/dist/commands/exec/sandbox-lines.d.ts +42 -0
  66. package/dist/commands/exec/sandbox-lines.js +59 -0
  67. package/dist/commands/exec/sandbox-progress.d.ts +30 -0
  68. package/dist/commands/exec/sandbox-progress.js +232 -0
  69. package/dist/commands/exec/sandbox-view.d.ts +19 -0
  70. package/dist/commands/exec/sandbox-view.js +72 -0
  71. package/dist/commands/exec/view.d.ts +3 -2
  72. package/dist/commands/exec/view.js +10 -6
  73. package/dist/commands/runs/facts.d.ts +51 -9
  74. package/dist/commands/runs/facts.js +49 -29
  75. package/dist/commands/runs/list/command.d.ts +80 -4
  76. package/dist/commands/runs/list/command.js +11 -10
  77. package/dist/commands/runs/list/metadata.js +1 -1
  78. package/dist/commands/runs/list/outcomes.d.ts +40 -2
  79. package/dist/commands/runs/logs/command.d.ts +103 -8
  80. package/dist/commands/runs/logs/command.js +139 -24
  81. package/dist/commands/runs/logs/metadata.d.ts +4 -0
  82. package/dist/commands/runs/logs/metadata.js +14 -7
  83. package/dist/commands/runs/logs/outcomes.d.ts +49 -2
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +77 -6
  86. package/dist/commands/runs/past-run.js +133 -4
  87. package/dist/commands/runs/show/command.d.ts +568 -10
  88. package/dist/commands/runs/show/command.js +634 -119
  89. package/dist/commands/runs/show/metadata.d.ts +17 -0
  90. package/dist/commands/runs/show/metadata.js +48 -7
  91. package/dist/commands/runs/show/outcomes.d.ts +276 -5
  92. package/dist/commands/runs/show/outcomes.js +484 -96
  93. package/dist/commands/snapshots/build/command.d.ts +109 -18
  94. package/dist/commands/snapshots/build/command.js +72 -36
  95. package/dist/commands/snapshots/build/metadata.d.ts +4 -0
  96. package/dist/commands/snapshots/build/metadata.js +5 -1
  97. package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
  98. package/dist/commands/snapshots/build/outcomes.js +26 -3
  99. package/dist/commands/snapshots/list/command.d.ts +72 -7
  100. package/dist/commands/snapshots/list/command.js +57 -24
  101. package/dist/commands/snapshots/list/metadata.d.ts +4 -0
  102. package/dist/commands/snapshots/list/metadata.js +4 -0
  103. package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
  104. package/dist/commands/snapshots/list/outcomes.js +25 -2
  105. package/dist/commands/suites/list/command.d.ts +129 -0
  106. package/dist/commands/suites/list/command.js +162 -0
  107. package/dist/commands/suites/list/metadata.d.ts +11 -0
  108. package/dist/commands/suites/list/metadata.js +15 -0
  109. package/dist/commands/suites/list/outcomes.d.ts +91 -0
  110. package/dist/commands/suites/list/outcomes.js +122 -0
  111. package/dist/commands/suites/metadata.js +8 -0
  112. package/dist/commands/test/command.d.ts +1389 -0
  113. package/dist/commands/test/command.js +583 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +765 -0
  116. package/dist/commands/test/outcomes.js +140 -0
  117. package/dist/commands/test/plan.d.ts +92 -0
  118. package/dist/commands/test/plan.js +128 -0
  119. package/dist/commands/test/test-words.d.ts +12 -0
  120. package/dist/commands/test/test-words.js +42 -0
  121. package/dist/config/check-resources.d.ts +14 -0
  122. package/dist/config/check-resources.js +98 -0
  123. package/dist/config/check-runner.d.ts +13 -0
  124. package/dist/config/check-runner.js +54 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +99 -0
  127. package/dist/config/gateways.d.ts +24 -0
  128. package/dist/config/index.d.ts +6 -3
  129. package/dist/config/index.js +3 -1
  130. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  131. package/dist/config/live/file-lists-file-gateway.js +27 -0
  132. package/dist/config/load.d.ts +11 -10
  133. package/dist/config/load.js +35 -103
  134. package/dist/config/recipe-run.d.ts +8 -1
  135. package/dist/config/recipe-run.js +2 -1
  136. package/dist/config/resolve.d.ts +3 -2
  137. package/dist/config/resolve.js +6 -3
  138. package/dist/config/resolver.d.ts +20 -6
  139. package/dist/config/resolver.js +11 -8
  140. package/dist/config/runner.d.ts +24 -0
  141. package/dist/config/runner.js +4 -0
  142. package/dist/config/schema.d.ts +26 -18
  143. package/dist/config/schema.js +41 -9
  144. package/dist/config/settings-file.d.ts +9 -3
  145. package/dist/config/settings-file.js +41 -4
  146. package/dist/config/suite.d.ts +39 -0
  147. package/dist/config/suite.js +5 -0
  148. package/dist/config-file/define.d.ts +49 -18
  149. package/dist/config-file/define.js +9 -8
  150. package/dist/config-file/runner.d.ts +12 -0
  151. package/dist/config-file/runner.js +9 -0
  152. package/dist/context.d.ts +13 -8
  153. package/dist/context.js +13 -4
  154. package/dist/core/across-sandboxes.d.ts +43 -0
  155. package/dist/core/across-sandboxes.js +319 -0
  156. package/dist/core/before-run.d.ts +5 -3
  157. package/dist/core/before-run.js +12 -1
  158. package/dist/core/events.d.ts +62 -6
  159. package/dist/core/events.js +14 -0
  160. package/dist/core/index.d.ts +4 -2
  161. package/dist/core/index.js +3 -1
  162. package/dist/core/payload.d.ts +7 -4
  163. package/dist/core/payload.js +10 -4
  164. package/dist/core/presentations.js +1 -1
  165. package/dist/core/resource.d.ts +1 -1
  166. package/dist/core/resources.d.ts +56 -6
  167. package/dist/core/resources.js +81 -5
  168. package/dist/core/run-state.js +9 -0
  169. package/dist/core/run.d.ts +77 -15
  170. package/dist/core/run.js +150 -86
  171. package/dist/core/sandbox-end.d.ts +64 -0
  172. package/dist/core/sandbox-end.js +128 -0
  173. package/dist/core/timeline.d.ts +4 -4
  174. package/dist/core/timeline.js +3 -3
  175. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  176. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  177. package/dist/extensions/github/context.d.ts +1 -1
  178. package/dist/extensions/github/definition.d.ts +11 -9
  179. package/dist/extensions/github/definition.js +8 -6
  180. package/dist/extensions/github/extension.d.ts +3 -3
  181. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  182. package/dist/extensions/github/fixture-repo.js +31 -2
  183. package/dist/extensions/github/index.d.ts +2 -2
  184. package/dist/extensions/github/index.js +2 -2
  185. package/dist/extensions/github/lifecycle.d.ts +16 -6
  186. package/dist/extensions/github/lifecycle.js +42 -25
  187. package/dist/extensions/github/options.d.ts +17 -11
  188. package/dist/extensions/github/options.js +14 -13
  189. package/dist/extensions/github/refusals.d.ts +23 -6
  190. package/dist/extensions/github/refusals.js +34 -12
  191. package/dist/extensions/github/resource.d.ts +21 -12
  192. package/dist/extensions/github/resource.js +16 -8
  193. package/dist/extensions/github/run/payload.d.ts +6 -6
  194. package/dist/extensions/github/run/payload.js +3 -5
  195. package/dist/extensions/github/split.d.ts +10 -0
  196. package/dist/extensions/github/split.js +12 -0
  197. package/dist/extensions/playwright/driver.js +6 -26
  198. package/dist/extensions/playwright/extension.js +1 -1
  199. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  200. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  201. package/dist/extensions/testserver/definition.d.ts +4 -4
  202. package/dist/extensions/testserver/definition.js +41 -31
  203. package/dist/extensions/testserver/extension.d.ts +4 -5
  204. package/dist/extensions/testserver/extension.js +14 -41
  205. package/dist/extensions/testserver/index.d.ts +1 -1
  206. package/dist/extensions/testserver/index.js +1 -1
  207. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  208. package/dist/extensions/testserver/lifecycle.js +29 -6
  209. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  210. package/dist/extensions/testserver/options/rules.js +10 -8
  211. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  212. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  213. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  214. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  215. package/dist/extensions/testserver/pool/index.js +1 -1
  216. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  217. package/dist/extensions/testserver/pool/lease.js +21 -0
  218. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  219. package/dist/extensions/testserver/refusals.d.ts +12 -0
  220. package/dist/extensions/testserver/refusals.js +18 -0
  221. package/dist/extensions/testserver/release.d.ts +16 -0
  222. package/dist/extensions/testserver/release.js +56 -4
  223. package/dist/extensions/testserver/resource.d.ts +4 -4
  224. package/dist/extensions/testserver/resource.js +1 -1
  225. package/dist/extensions/testserver/split.d.ts +9 -0
  226. package/dist/extensions/testserver/split.js +22 -0
  227. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  228. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  229. package/dist/extensions/vitest/driver.d.ts +7 -0
  230. package/dist/extensions/vitest/driver.js +33 -37
  231. package/dist/extensions/vitest/extension.js +1 -1
  232. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  233. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  234. package/dist/extensions.d.ts +17 -16
  235. package/dist/extensions.js +5 -4
  236. package/dist/forward-sigterm.js +1 -1
  237. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  238. package/dist/live-app.d.ts +3 -1
  239. package/dist/live-app.js +9 -5
  240. package/dist/local-services.js +1 -1
  241. package/dist/planning/driver-file-lists.d.ts +61 -0
  242. package/dist/planning/driver-file-lists.js +66 -0
  243. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  244. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  245. package/dist/planning/file-lists-file.d.ts +58 -0
  246. package/dist/planning/file-lists-file.js +105 -0
  247. package/dist/planning/file-lists.d.ts +28 -0
  248. package/dist/planning/file-lists.js +52 -0
  249. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  250. package/dist/{commands/exec → planning}/final-results.js +6 -6
  251. package/dist/planning/plan-only.d.ts +81 -0
  252. package/dist/planning/plan-only.js +83 -0
  253. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  254. package/dist/{commands/exec → planning}/redaction.js +5 -4
  255. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  256. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  257. package/dist/planning/run-kind-flags.d.ts +20 -0
  258. package/dist/planning/run-kind-flags.js +48 -0
  259. package/dist/planning/run-plan.d.ts +30 -0
  260. package/dist/planning/run-plan.js +4 -0
  261. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  262. package/dist/planning/sandbox-placeholders.js +60 -0
  263. package/dist/planning/suite-not-found.d.ts +37 -0
  264. package/dist/planning/suite-not-found.js +36 -0
  265. package/dist/planning/suites.d.ts +43 -0
  266. package/dist/planning/suites.js +89 -0
  267. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  268. package/dist/{commands/exec → planning}/test-plan.js +32 -4
  269. package/dist/playwright/reporter.d.ts +20 -8
  270. package/dist/playwright/reporter.js +195 -15
  271. package/dist/presentation.d.ts +10 -6
  272. package/dist/presentation.js +13 -15
  273. package/dist/run-directory/gateways.d.ts +60 -4
  274. package/dist/run-directory/index.d.ts +4 -4
  275. package/dist/run-directory/index.js +2 -1
  276. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  277. package/dist/run-directory/plan.d.ts +35 -2
  278. package/dist/run-directory/plan.js +44 -7
  279. package/dist/run-directory/reader.d.ts +26 -5
  280. package/dist/run-directory/reader.js +24 -1
  281. package/dist/run-directory/recording.d.ts +75 -49
  282. package/dist/run-directory/recording.js +214 -28
  283. package/dist/run-directory/run-directory.d.ts +22 -1
  284. package/dist/run-directory/run-directory.js +24 -0
  285. package/dist/run-directory/run-record.d.ts +144 -21
  286. package/dist/run-directory/run-record.js +118 -19
  287. package/dist/run-directory/timeline-facts.js +4 -4
  288. package/dist/runner/build-snapshots.d.ts +7 -7
  289. package/dist/runner/build-snapshots.js +12 -16
  290. package/dist/runner/events.d.ts +29 -8
  291. package/dist/runner/gateways.d.ts +59 -8
  292. package/dist/runner/index.d.ts +6 -4
  293. package/dist/runner/index.js +3 -2
  294. package/dist/runner/live/sandbox-gateway.js +177 -33
  295. package/dist/runner/live/terminal.d.ts +15 -3
  296. package/dist/runner/live/terminal.js +25 -3
  297. package/dist/runner/network-policy.d.ts +55 -0
  298. package/dist/runner/network-policy.js +46 -0
  299. package/dist/runner/policy-writes.d.ts +40 -0
  300. package/dist/runner/policy-writes.js +124 -0
  301. package/dist/runner/prepare.d.ts +6 -7
  302. package/dist/runner/ready.d.ts +39 -10
  303. package/dist/runner/ready.js +59 -47
  304. package/dist/runner/recipe-check.d.ts +6 -0
  305. package/dist/runner/recipe-check.js +29 -0
  306. package/dist/runner/recipe-secrets.d.ts +67 -0
  307. package/dist/runner/recipe-secrets.js +230 -0
  308. package/dist/runner/recipe.d.ts +118 -28
  309. package/dist/runner/recipe.js +147 -154
  310. package/dist/runner/sandboxed-command.d.ts +24 -10
  311. package/dist/runner/sandboxed-command.js +37 -12
  312. package/dist/runner/scope.d.ts +107 -21
  313. package/dist/runner/scope.js +274 -54
  314. package/dist/runner/secrets.d.ts +42 -31
  315. package/dist/runner/secrets.js +62 -40
  316. package/dist/runner/session.d.ts +59 -26
  317. package/dist/runner/session.js +82 -41
  318. package/dist/runner/snapshot-build.d.ts +7 -4
  319. package/dist/runner/snapshot-build.js +48 -28
  320. package/dist/runner/snapshot-choice.d.ts +37 -0
  321. package/dist/runner/snapshot-choice.js +38 -0
  322. package/dist/runner/snapshot-key.d.ts +16 -14
  323. package/dist/runner/snapshot-key.js +24 -18
  324. package/dist/runner/steps.d.ts +13 -5
  325. package/dist/runner/steps.js +34 -4
  326. package/dist/runner/time-limit.d.ts +10 -0
  327. package/dist/runner/time-limit.js +43 -0
  328. package/dist/sdk/extension/commands.d.ts +1 -7
  329. package/dist/sdk/extension/driver.d.ts +39 -46
  330. package/dist/sdk/extension/driver.js +6 -6
  331. package/dist/sdk/extension/index.d.ts +3 -3
  332. package/dist/sdk/extension/index.js +3 -4
  333. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  334. package/dist/sdk/extension/lifecycle.js +1 -1
  335. package/dist/sdk/extension/resource-definition.d.ts +13 -10
  336. package/dist/sdk/extension/resource-definition.js +7 -2
  337. package/dist/sdk/extension/resource.d.ts +2 -2
  338. package/dist/sdk/extension/secret-source.d.ts +58 -0
  339. package/dist/sdk/extension/secret-source.js +78 -0
  340. package/dist/sdk/index.d.ts +2 -2
  341. package/dist/sdk/index.js +1 -1
  342. package/dist/sdk/run/launcher.d.ts +1 -1
  343. package/dist/sdk/run/launcher.js +1 -1
  344. package/dist/sdk/run/payload.d.ts +16 -1
  345. package/dist/sdk/run/payload.js +17 -2
  346. package/dist/sdk/run/redact.js +2 -2
  347. package/dist/sdk/run/test-events.d.ts +23 -6
  348. package/dist/sdk/run/test-events.js +6 -4
  349. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  350. package/dist/sdk/run/test-result-writer.js +22 -2
  351. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  352. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  353. package/dist/shared/job-summary.d.ts +19 -0
  354. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  355. package/dist/shared/sandbox-table.d.ts +48 -0
  356. package/dist/shared/sandbox-table.js +109 -0
  357. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  358. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  359. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  360. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  361. package/dist/{commands/exec → shared}/text.js +9 -1
  362. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  363. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  364. package/dist/shared/worker-chart.d.ts +172 -0
  365. package/dist/shared/worker-chart.js +623 -0
  366. package/dist/vitest/config.d.ts +35 -11
  367. package/dist/vitest/config.js +47 -14
  368. package/dist/vitest/index.d.ts +1 -1
  369. package/dist/vitest/index.js +3 -3
  370. package/dist/vitest/sequencer.d.ts +23 -0
  371. package/dist/vitest/sequencer.js +73 -0
  372. package/dist/vitest/setup.d.ts +1 -0
  373. package/dist/vitest/setup.js +34 -0
  374. package/dist/vitest/test-events.d.ts +32 -6
  375. package/dist/vitest/test-events.js +25 -5
  376. package/dist/vitest/test-results.d.ts +8 -3
  377. package/dist/vitest/test-results.js +6 -0
  378. package/package.json +7 -2
  379. package/skills/overview.md +21 -17
  380. package/skills/plan-runs.md +67 -0
  381. package/skills/read-run-output.md +51 -19
  382. package/dist/chunks/chunk-BFLYGMG3.js +0 -607
  383. package/dist/chunks/chunk-HOKDKP5A.js +0 -49
  384. package/dist/chunks/chunk-IVRRGGCD.js +0 -201
  385. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  386. package/dist/commands/exec/define-run-command.d.ts +0 -671
  387. package/dist/commands/exec/define-run-command.js +0 -91
  388. package/dist/commands/exec/job-summary.d.ts +0 -10
  389. package/dist/commands/exec/worker-chart.d.ts +0 -87
  390. package/dist/commands/exec/worker-chart.js +0 -343
  391. package/dist/commands/playwright/command.d.ts +0 -661
  392. package/dist/commands/playwright/command.js +0 -31
  393. package/dist/commands/playwright/metadata.js +0 -8
  394. package/dist/commands/vitest/command.d.ts +0 -662
  395. package/dist/commands/vitest/command.js +0 -31
  396. package/dist/commands/vitest/metadata.js +0 -8
  397. package/dist/sdk/extension/ci.d.ts +0 -2
  398. package/dist/sdk/extension/ci.js +0 -6
  399. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  400. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  401. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  402. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  403. /package/dist/{commands → shared}/dashboard.js +0 -0
  404. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -6,7 +6,7 @@
6
6
  // them when the run ended, so a past run reads the same after a resource definition is renamed or its extension
7
7
  // removed.
8
8
  import { z } from "zod";
9
- import { commandExitStatus, } from "../core/index.js";
9
+ import { commandExitStatus, SANDBOX_FAILED_STAGES, acrossSandboxesExitStatus, } from "../core/index.js";
10
10
  import { planSchema } from "./plan.js";
11
11
  const testTotalsSchema = z.object({
12
12
  passed: z.number().int().nonnegative(),
@@ -18,6 +18,8 @@ const endedSchema = z.object({
18
18
  exitCode: z.number().int().nullable(),
19
19
  signal: z.string().nullable(),
20
20
  ms: z.number().nonnegative().nullable(),
21
+ // Absent in a record that storm 0.13.0 wrote.
22
+ wallMs: z.number().nonnegative().exactOptional(),
21
23
  tests: testTotalsSchema.nullable(),
22
24
  testsIncomplete: z.string().nullable(),
23
25
  resources: z.record(z.string(), z.object({ definition: z.string(), facts: z.unknown() })).nullable(),
@@ -30,9 +32,9 @@ const snapshotSchema = z.object({
30
32
  builtBehind: z.number().nullable(),
31
33
  });
32
34
  const whereSchema = z.discriminatedUnion("kind", [
33
- z.object({ kind: z.literal("unsandboxed") }),
35
+ z.object({ kind: z.literal("launch-machine") }),
34
36
  z.object({
35
- kind: z.literal("runner"),
37
+ kind: z.literal("vercel-sandbox"),
36
38
  team: z.string(),
37
39
  project: z.string(),
38
40
  region: z.string(),
@@ -47,16 +49,60 @@ const whereSchema = z.discriminatedUnion("kind", [
47
49
  }),
48
50
  ]);
49
51
  const gitSchema = z.object({ branch: z.string().nullable(), commit: z.string(), dirty: z.boolean() });
52
+ /** One runner sandbox of a run across runner sandboxes, as `run.json`, `storm runs`, and `sandboxes_ran` report it. */
53
+ export const sandboxRecordSchema = z.object({
54
+ /** The runner sandbox index, from 0. */
55
+ sandbox: z.number().int().nonnegative(),
56
+ /** The runner sandbox's command. */
57
+ argv: z.array(z.string()).readonly(),
58
+ /**
59
+ * The file list: the test files the runner sandbox runs, as paths relative to the project; null for a storm exec run.
60
+ */
61
+ files: z.array(z.string()).readonly().nullable(),
62
+ /** The runner sandbox state: passed, failed, not-started, canceled, or pending while the run goes on. */
63
+ state: z.enum(["pending", "passed", "failed", "not-started", "canceled"]),
64
+ /** The factual stage that failed; null when passed, canceled, pending, or recorded by an older storm. */
65
+ failedStage: z.enum(SANDBOX_FAILED_STAGES).nullable(),
66
+ /** The command's exit code; null when no command ended with one. */
67
+ exitCode: z.number().int().nullable(),
68
+ /**
69
+ * One line that says why the runner sandbox is failed without an exit code, not-started, or canceled; null otherwise.
70
+ */
71
+ cause: z.string().nullable(),
72
+ /** The runner sandbox's name; null when none started. */
73
+ name: z.string().nullable(),
74
+ /** When the runner sandbox the run kept stops, as an ISO time; null when it was not kept. */
75
+ keptUntil: z.string().nullable(),
76
+ /**
77
+ * From the run's start to the start of the runner sandbox's command, in milliseconds; null when the command never
78
+ * started.
79
+ */
80
+ preparedMs: z.number().nonnegative().nullable(),
81
+ /** How long the command took, in milliseconds; null when it did not end on its own. */
82
+ commandMs: z.number().nonnegative().nullable(),
83
+ /** The runner sandbox's tests' totals, by their final results; null without one. */
84
+ tests: testTotalsSchema.nullable(),
85
+ /** The last lines of the runner sandbox's command log, for a runner sandbox that is not passed; empty otherwise. */
86
+ tail: z.array(z.string()).readonly(),
87
+ });
88
+ /** How many of its command log's last lines a runner sandbox record keeps. */
89
+ export const SANDBOX_TAIL_LINES = 20;
50
90
  const runRecordSchema = z.object({
51
91
  version: z.literal(5),
52
92
  startedAt: z.string(),
53
93
  cwd: z.string(),
54
94
  configFile: z.string().nullable(),
55
95
  argv: z.array(z.string()).readonly(),
56
- // Only a `storm vitest` run has one.
96
+ /** The driver name for a driver run (`vitest`, `playwright`); absent for a run with no driver (`storm exec`). */
97
+ driver: z.string().exactOptional(),
98
+ /** The suite name for a `storm test` run (`null` for the project's tests); absent for other run commands. */
99
+ suite: z.string().nullable().exactOptional(),
100
+ // Only a run that counted tests has one.
57
101
  plan: planSchema.exactOptional(),
58
102
  where: whereSchema,
59
103
  git: gitSchema.nullable(),
104
+ // Only a run across runner sandboxes has it.
105
+ sandboxes: z.array(sandboxRecordSchema).readonly().exactOptional(),
60
106
  ended: endedSchema.exactOptional(),
61
107
  });
62
108
  /** `run.json`'s text for `record`. */
@@ -103,33 +149,41 @@ export function testTotals(events) {
103
149
  * ran outcome's acquired resources' result facts, with the rows `storm runs show` lists for them, each rendered when
104
150
  * the resource's acquire answered, so a past run shows them without the definitions that made them.
105
151
  */
106
- export function runEnd(outcome, ran, tests, reports) {
152
+ export function runEnd(outcome, ran, tests, reports, wallMs) {
107
153
  const command = outcome.kind === "ran" ? outcome.command : undefined;
108
- const ranRecords = outcome.kind === "ran" ? outcome.resources : undefined;
109
- const ms = ran?.outcome === undefined || ran.outcome === "stopped" || ran.endedAt === undefined
110
- ? null
111
- : ran.endedAt - ran.startedAt;
154
+ const ranRecords = outcome.kind === "ran" || outcome.kind === "sandboxes_ran" ? outcome.resources : undefined;
112
155
  return {
113
156
  outcome: outcome.kind,
114
- exitCode: command === undefined ? null : commandExitStatus(command),
157
+ exitCode: outcome.kind === "sandboxes_ran"
158
+ ? acrossSandboxesExitStatus(outcome.sandboxes)
159
+ : command === undefined
160
+ ? null
161
+ : commandExitStatus(command),
115
162
  signal: command?.kind === "signaled" ? command.signal : null,
116
- ms,
163
+ ms: commandMs(ran),
164
+ wallMs,
117
165
  tests: testTotals(tests.events),
118
166
  testsIncomplete: tests.incomplete ?? null,
119
167
  resources: ranRecords === undefined ? null : reports.ranFacts(ranRecords),
120
168
  resourceRows: ranRecords === undefined ? [] : reports.ranRows(ranRecords),
121
169
  };
122
170
  }
171
+ /** How long a command took, from its state once it ended on its own; null when it never did, or the run stopped it. */
172
+ function commandMs(ran) {
173
+ return ran?.outcome === undefined || ran.outcome === "stopped" || ran.endedAt === undefined
174
+ ? null
175
+ : ran.endedAt - ran.startedAt;
176
+ }
123
177
  /**
124
- * Where the command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
125
- * no sandbox or snapshot yet.
178
+ * Where the command runs, as `run.json` records it as the run starts: on the launch machine (`launch-machine`), or in
179
+ * a Vercel Sandbox (`vercel-sandbox`), with no sandbox or snapshot yet.
126
180
  */
127
181
  export function startedWhere(run) {
128
182
  if (run.runner === undefined)
129
- return { kind: "unsandboxed" };
183
+ return { kind: "launch-machine" };
130
184
  const { prepared, target } = run.runner;
131
185
  return {
132
- kind: "runner",
186
+ kind: "vercel-sandbox",
133
187
  team: target.team,
134
188
  project: target.project,
135
189
  region: prepared.recipe.region,
@@ -144,12 +198,12 @@ export function startedWhere(run) {
144
198
  };
145
199
  }
146
200
  /**
147
- * `where` once the run is over, from the runner's final state: for a sandboxed run, the runner sandbox the run started,
148
- * the runner snapshot it started from, which the run reused or built, when its timeout stops the runner sandbox it
149
- * kept running. Each is null when the run stopped before it, or kept no runner sandbox.
201
+ * `where` once the run is over, from the runner's final state: for a run in a runner sandbox, the runner sandbox the
202
+ * run started, the runner snapshot it started from, which the run reused or built, and when its timeout stops the
203
+ * runner sandbox it kept running. Each is null when the run stopped before it, or kept no runner sandbox.
150
204
  */
151
205
  export function endedWhere(where, runner) {
152
- if (where.kind === "unsandboxed")
206
+ if (where.kind === "launch-machine")
153
207
  return where;
154
208
  const snapshot = runner?.snapshot;
155
209
  return {
@@ -167,3 +221,48 @@ export function endedWhere(where, runner) {
167
221
  uploadBytes: runner?.uploadBytes ?? null,
168
222
  };
169
223
  }
224
+ /**
225
+ * The record of runner sandbox `sandbox` as the run directory opens: `pending`, with its command and its file list
226
+ * (null for a `storm exec` run), and nothing else known yet.
227
+ */
228
+ export function pendingSandboxRecord(request) {
229
+ return {
230
+ sandbox: request.sandbox,
231
+ argv: [...request.argv],
232
+ files: request.files === null ? null : [...request.files],
233
+ state: "pending",
234
+ failedStage: null,
235
+ exitCode: null,
236
+ cause: null,
237
+ name: null,
238
+ keptUntil: null,
239
+ preparedMs: null,
240
+ commandMs: null,
241
+ tests: null,
242
+ tail: [],
243
+ };
244
+ }
245
+ /**
246
+ * The record of runner sandbox `sandbox` once it ended (`ended`: its runner sandbox state, exit code, and cause), with
247
+ * `state` folded from its events: its command (`argv`), its file list (`files`, null for a `storm exec` run), its test
248
+ * totals, and the last `SANDBOX_TAIL_LINES` lines of `tail`, its command log's last lines, unless it passed.
249
+ */
250
+ export function sandboxRecord(request) {
251
+ const { command, runner } = request.state;
252
+ const { state, failedStage, exitCode, cause } = request.ended;
253
+ return {
254
+ sandbox: request.sandbox,
255
+ argv: [...request.argv],
256
+ files: request.files === null ? null : [...request.files],
257
+ state,
258
+ failedStage,
259
+ exitCode,
260
+ cause,
261
+ name: runner?.sandbox?.name ?? null,
262
+ keptUntil: runner?.kept?.stopsAt ?? null,
263
+ preparedMs: command === undefined ? null : Math.max(0, command.startedAt - request.startedAt.getTime()),
264
+ commandMs: commandMs(command),
265
+ tests: request.tests === null ? null : { ...request.tests },
266
+ tail: state === "passed" ? [] : request.tail.slice(-SANDBOX_TAIL_LINES),
267
+ };
268
+ }
@@ -6,7 +6,7 @@
6
6
  import { z } from "zod";
7
7
  /** Which row of the timeline: its name, and for a resource instance's lane the resource key, null for any other. */
8
8
  const rowRefShape = {
9
- /** The row's name: `mint`, a resource lane's name, `runner`, `tests` or `cleanup`. */
9
+ /** The row's name: `mint`, a resource lane's name, `runner`, `command`, or `cleanup`. */
10
10
  name: z.string(),
11
11
  /** For a resource instance's lane, the resource key; null for every other row. */
12
12
  resource: z.string().nullable(),
@@ -20,7 +20,7 @@ export const timelineSchema = z.object({
20
20
  /** From the run's start to its last event. */
21
21
  totalMs: z.number(),
22
22
  /**
23
- * The lanes in order: mint, each resource instance's lane, runner, tests, cleanup; each only when the run got that
23
+ * The rows in order: mint, each resource instance's lane, runner, command, cleanup; each only when the run got that
24
24
  * far.
25
25
  */
26
26
  rows: z.array(z.object({
@@ -66,8 +66,8 @@ export function timelineFacts(timeline, laneKinds) {
66
66
  };
67
67
  }
68
68
  /**
69
- * A lane as the waterfall and the job summary name it: the credential, each resource lane by its presentation's label,
70
- * such as `<lane>-setup`, the runner's setup, the tests and the cleanup.
69
+ * A row as the waterfall and the job summary name it: the credential, each resource lane by its presentation's label,
70
+ * such as `<lane>-setup`, the runner's setup, the command, and the cleanup.
71
71
  */
72
72
  function laneLabel(name, laneKinds) {
73
73
  if (name === "mint")
@@ -1,10 +1,10 @@
1
+ import type { SandboxCredential } from "../sdk/extension/index.ts";
1
2
  import type { RunnerContext } from "./context.ts";
2
3
  import type { RunnerFailure, RunnerProgress } from "./events.ts";
3
4
  import type { CheckoutHead, RunnerSnapshotCacheFailure, RunnerSnapshotEntry, SandboxAccess } from "./gateways.ts";
4
5
  import type { PrepareRunnerOutcome, RunnerPrepareContext } from "./prepare.ts";
5
6
  import type { CheckedRecipe } from "./recipe.ts";
6
7
  import { type RunnerScopeFacts } from "./scope.ts";
7
- import type { RunnerSecrets } from "./secrets.ts";
8
8
  import { type BaseSnapshotPlan } from "./snapshot-build.ts";
9
9
  /** What `prepareSnapshotBuild` checks: where, which recipe, and what to build. */
10
10
  export interface SnapshotBuildRequest {
@@ -56,15 +56,15 @@ export type PrepareSnapshotBuildOutcome = {
56
56
  * and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
57
57
  */
58
58
  export declare function prepareSnapshotBuild(context: RunnerPrepareContext, request: SnapshotBuildRequest): Promise<PrepareSnapshotBuildOutcome>;
59
- /** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the secrets. */
59
+ /** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the credentials. */
60
60
  export interface BuildSnapshotsRequest {
61
61
  readonly build: PreparedSnapshotBuild;
62
62
  /** The minted credential, and the team and project it names: the sandboxes run there. */
63
63
  readonly access: SandboxAccess;
64
64
  /** The local user, for each sandbox's `user` tag. */
65
65
  readonly user: string;
66
- /** The runner secrets' values: each recipe step gets the ones it names. */
67
- readonly secrets: RunnerSecrets;
66
+ /** The recipe's credentials, with their values: the firewall adds every one while the recipe's snapshot steps run. */
67
+ readonly credentials: readonly Required<SandboxCredential>[];
68
68
  }
69
69
  /**
70
70
  * How a build ended, before its sandbox scope closed.
@@ -106,9 +106,9 @@ export type SnapshotBuildOutcome = SnapshotBuildEnd & {
106
106
  /**
107
107
  * Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
108
108
  * ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
109
- * `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
110
- * closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
111
- * once and ends `aborted` with what it saved.
109
+ * `full`, which builds a new one that replaces its cache entry. `signal` cancels it in any stage: the scope says so,
110
+ * revokes every credential at once, and stops its sandboxes. A base snapshot's save isn't stopped by the signal, so
111
+ * after it the build checks the signal once and ends `aborted` with what it saved.
112
112
  */
113
113
  export declare function buildSnapshots(context: RunnerContext, request: BuildSnapshotsRequest, control: {
114
114
  readonly signal: AbortSignal;
@@ -3,6 +3,7 @@
3
3
  // merge-base. It owns its sandbox scope from its first stage to its end, as a run's runner session does. It
4
4
  // acquires no resource, runs no command, and keeps no sandbox.
5
5
  import { resolveBase } from "./base.js";
6
+ import { runnerNetworkPolicy } from "./network-policy.js";
6
7
  import { runnerSandboxScope } from "./scope.js";
7
8
  import { buildSnapshot } from "./snapshot-build.js";
8
9
  import { hasTimeLeft } from "./snapshot-cache.js";
@@ -91,34 +92,29 @@ export async function prepareSnapshotBuild(context, request) {
91
92
  /**
92
93
  * Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
93
94
  * ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
94
- * `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
95
- * closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
96
- * once and ends `aborted` with what it saved.
95
+ * `full`, which builds a new one that replaces its cache entry. `signal` cancels it in any stage: the scope says so,
96
+ * revokes every credential at once, and stops its sandboxes. A base snapshot's save isn't stopped by the signal, so
97
+ * after it the build checks the signal once and ends `aborted` with what it saved.
97
98
  */
98
99
  export async function buildSnapshots(context, request, control, progress) {
99
100
  const { signal } = control;
100
- const scope = runnerSandboxScope(context, progress, { keepMs: 0 });
101
- const stop = () => {
102
- void progress.emit({ kind: "stopping", commandRunning: false, keepMs: 0 }).catch(() => undefined);
103
- void scope.close().catch(() => undefined);
104
- };
105
- if (signal.aborted)
106
- stop();
107
- else
108
- signal.addEventListener("abort", stop, { once: true });
101
+ // When the build is canceled, the scope stops its sandboxes and revokes every credential at once.
102
+ const scope = runnerSandboxScope(context, progress, {
103
+ keepMs: 0,
104
+ basePolicy: runnerNetworkPolicy(request.build.plan.recipe),
105
+ signal,
106
+ });
109
107
  try {
110
108
  const ended = await buildIn(context, request, { scope, signal }, progress);
111
- signal.removeEventListener("abort", stop);
112
109
  return { ...ended, cleanup: await scope.close() };
113
110
  }
114
111
  catch (error) {
115
- signal.removeEventListener("abort", stop);
116
112
  await scope.close();
117
113
  throw error;
118
114
  }
119
115
  }
120
116
  async function buildIn(context, request, control, progress) {
121
- const { build, access, user, secrets } = request;
117
+ const { build, access, user, credentials } = request;
122
118
  const { signal } = control;
123
119
  if (signal.aborted)
124
120
  return { kind: "aborted", snapshot: null };
@@ -130,7 +126,7 @@ async function buildIn(context, request, control, progress) {
130
126
  prepared: build.plan,
131
127
  access,
132
128
  user,
133
- secrets,
129
+ credentials,
134
130
  why: why === "no-snapshot" ? { kind: why, rejected: [] } : { kind: why },
135
131
  }, control, progress);
136
132
  if (built.kind === "aborted")
@@ -20,7 +20,10 @@ export interface NotDeletedSandbox {
20
20
  readonly role: RunnerSandboxRole;
21
21
  readonly message: string;
22
22
  }
23
- /** The runner sandbox a run kept running once it ended, and when its timeout stops it, as an ISO time. */
23
+ /**
24
+ * The runner sandbox a run kept running once it ended, with no network access, and when its timeout stops it, as an
25
+ * ISO time.
26
+ */
24
27
  export interface KeptSandbox {
25
28
  readonly name: string;
26
29
  readonly stopsAt: string;
@@ -65,10 +68,10 @@ export type SnapshotBuildReason = {
65
68
  * terminal.
66
69
  * - `command-stopped`: the run killed the command, on a signal, and stopped following its output.
67
70
  * - `stopping`: a signal arrived and the run is stopping: killing the command when `commandRunning`, then stopping
68
- * and deleting the runner's sandboxes, but for the runner sandbox it keeps running `keepMs` when that is above 0,
69
- * and releasing the run's resources.
71
+ * the runner's sandboxes, but for the runner sandbox it keeps running `keepMs` when that is above 0, releasing the
72
+ * run's resources, and then deleting the stopped sandboxes and keeping the kept one running.
70
73
  * - `waiting-for-snapshot`: closing waits up to `settleMs` for a runner snapshot still saving.
71
- * - `sandbox-kept`: closing kept runner sandbox `name` running until `stopsAt`, an ISO time.
74
+ * - `sandbox-kept`: closing kept runner sandbox `name` running until `stopsAt`, an ISO time, with no network access.
72
75
  */
73
76
  export type RunnerEvent = {
74
77
  readonly kind: "snapshot-reused";
@@ -145,17 +148,21 @@ export type RunnerEvent = {
145
148
  } | {
146
149
  readonly kind: "waiting-for-snapshot";
147
150
  readonly settleMs: number;
148
- } | {
151
+ } | ({
149
152
  readonly kind: "sandbox-kept";
150
- readonly name: string;
151
- readonly stopsAt: string;
152
- };
153
+ } & KeptSandbox);
153
154
  /** Hears the runner's events as they happen. */
154
155
  export interface RunnerProgress {
155
156
  emit(event: RunnerEvent): Promise<void>;
156
157
  }
157
158
  /** What a Sandbox call was doing when it failed, as `sandbox-api-failed` names it. */
158
159
  export type RunnerSandboxCall = "start-build-sandbox" | "start-runner-sandbox" | "upload" | "run-script" | "login-path" | "run-command" | "save-snapshot";
160
+ /**
161
+ * Where a network policy write that puts credentials in place or removes them was: around the recipe's snapshot steps
162
+ * (its toolchain and prebuild steps, in the build sandbox), around its run steps (its install and build steps, in the
163
+ * runner sandbox), before a snapshot save, or around the command.
164
+ */
165
+ export type NetworkPolicyPlace = "snapshot-steps" | "run-steps" | "snapshot-save" | "command";
159
166
  /**
160
167
  * Why the runner couldn't run the command.
161
168
  *
@@ -163,6 +170,13 @@ export type RunnerSandboxCall = "start-build-sandbox" | "start-runner-sandbox" |
163
170
  * without an exit code (`exitCode` null); `tail` is its last 40 output lines.
164
171
  * - `sandbox-api-failed`: a Sandbox call failed; `status` is the HTTP status when the API answered one.
165
172
  * - `checkout-failed`: git or tar failed on this machine, packing the base's files or the run's changes.
173
+ * - `network-policy-failed`: a network policy write that puts credentials in place or removes them failed, `around`
174
+ * one of four places: the recipe's snapshot steps (`snapshot-steps`) or its run steps (`run-steps`), whose
175
+ * credentials it puts in place before the first of them (`inject`; none of them ran); a snapshot save
176
+ * (`snapshot-save`), before which the scope removes them (`remove`); or the command (`command`), whose resources'
177
+ * credentials it puts in place before the command starts (`inject`; the command didn't run). `reason` is `api`, with
178
+ * the HTTP status when the API answered one, or `timed-out`. It holds no credential's value. After a failed removal
179
+ * the scope keeps no snapshot or runner sandbox of that sandbox.
166
180
  */
167
181
  export type RunnerFailure = {
168
182
  readonly kind: "snapshot-build-step-failed" | "apply-failed" | "install-failed" | "build-failed";
@@ -177,6 +191,13 @@ export type RunnerFailure = {
177
191
  } | {
178
192
  readonly kind: "checkout-failed";
179
193
  readonly failure: CheckoutFailure;
194
+ } | {
195
+ readonly kind: "network-policy-failed";
196
+ readonly operation: "inject" | "remove";
197
+ readonly around: NetworkPolicyPlace;
198
+ readonly reason: "api" | "timed-out";
199
+ readonly status: number | null;
200
+ readonly message: string;
180
201
  };
181
202
  /** How one stage of readying the runner ended: its value, a failure, or a stop because the run was aborted. */
182
203
  export type RunnerStage<T> = {
@@ -1,4 +1,5 @@
1
1
  import type { Credential } from "../credential/index.ts";
2
+ import type { SandboxCredential } from "../sdk/extension/index.ts";
2
3
  /** Why a checkout operation failed: what git or tar said, and the command that failed when there was one. */
3
4
  export interface CheckoutFailure {
4
5
  readonly message: string;
@@ -212,13 +213,44 @@ export interface RunnerSandbox {
212
213
  /** How long it may live, in milliseconds, after which the Sandbox API stops it. */
213
214
  readonly timeoutMs: number;
214
215
  }
216
+ /**
217
+ * The network policy of a sandbox: what it may reach. A runner snapshot carries no policy, so every create passes one,
218
+ * and a write to a running sandbox replaces its whole policy. storm always builds the whole policy from what the run
219
+ * knows and never reads one back.
220
+ *
221
+ * It is a union by `kind`:
222
+ *
223
+ * - `allow-all`: every domain is reachable. With `credentials` (normalized `SandboxCredential`s, each with lowercased
224
+ * domain and header and `requests` given), the firewall adds each credential's header to the requests to its domain
225
+ * that its `requests` names: for `read`, `GET` and `HEAD` requests, and it answers every other request to that domain
226
+ * with 403; for `all`, every request. Every other domain stays fully reachable.
227
+ * - `custom`: only the allowed domains and the domain of each credential in place are reachable, and every other
228
+ * domain doesn't resolve. An allowed domain is a hostname or a wildcard with one leading `*.`. Each credential's
229
+ * domain gets the same rules as under `allow-all`. A recipe's `allowedDomains` gives the list.
230
+ * - `deny-all`: no domain is reachable, and no credential is in place. A run writes it to the runner sandbox it keeps
231
+ * before it releases its resources.
232
+ *
233
+ * Two credentials in one policy for one domain have the same `requests`, since the firewall has one rule set per
234
+ * domain.
235
+ */
236
+ export type RunnerNetworkPolicy = {
237
+ readonly kind: "allow-all";
238
+ readonly credentials: readonly Required<SandboxCredential>[];
239
+ } | {
240
+ readonly kind: "custom";
241
+ readonly allowedDomains: readonly string[];
242
+ readonly credentials: readonly Required<SandboxCredential>[];
243
+ } | {
244
+ readonly kind: "deny-all";
245
+ };
215
246
  /** What every sandbox is created with, whatever it starts from. */
216
247
  export interface RunnerSandboxPlacement {
217
248
  readonly region: string;
218
249
  readonly vcpus: number;
219
250
  readonly timeoutMs: number;
220
- /** At most 5: `purpose`, `user` and `role`. */
251
+ /** At most 5: `purpose`, `user`, and `role`. */
221
252
  readonly tags: Readonly<Record<string, string>>;
253
+ readonly networkPolicy: RunnerNetworkPolicy;
222
254
  }
223
255
  /**
224
256
  * Why a Sandbox call failed.
@@ -332,6 +364,12 @@ export interface RunnerSandboxGateway {
332
364
  readonly path: string;
333
365
  readonly fromLine: number;
334
366
  }, onOutput: (chunk: SandboxOutputChunk) => void, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
367
+ /**
368
+ * Replaces a running sandbox's whole network policy with `policy`, which takes effect on its next requests. It never
369
+ * reads the policy back. A failed write may have changed the policy or not: the Sandbox API's update isn't atomic.
370
+ * Aborting `signal` stops the write and answers `aborted`. A failure's message holds no credential's value.
371
+ */
372
+ writeNetworkPolicy(sandbox: RunnerSandbox, policy: RunnerNetworkPolicy, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
335
373
  /** Saves a build sandbox as a runner snapshot that expires after `expirationMs`; that stops the sandbox. */
336
374
  saveSnapshot(sandbox: RunnerSandbox, request: {
337
375
  readonly expirationMs: number;
@@ -342,23 +380,36 @@ export interface RunnerSandboxGateway {
342
380
  * fails with `processes-running` when it can't confirm one ended. A script or command asked to start once it began
343
381
  * answers `aborted` and starts nothing. Then it keeps the sandbox running at least `until`, extending its timeout
344
382
  * when it would stop sooner, and answers when it stops: `until`, or later when its timeout already reached past it.
345
- * The Sandbox API can extend a running sandbox's timeout but never shorten it.
383
+ * The Sandbox API can extend a running sandbox's timeout but never shorten it. Each kill has a time limit of its
384
+ * own. Aborting `signal` stops the call and answers `aborted`; the sandbox may then be extended or not.
346
385
  */
347
386
  keepRunning(sandbox: RunnerSandbox, request: {
348
387
  readonly until: Date;
349
- }): Promise<RunnerSandboxResult<{
388
+ }, signal?: AbortSignal): Promise<RunnerSandboxResult<{
350
389
  readonly stopsAt: Date;
351
390
  }, RunnerKeepFailure>>;
352
- stop(sandbox: RunnerSandbox): Promise<RunnerSandboxOperation>;
353
- /** Deletes a sandbox, keeping every snapshot it was started from or saved as. */
354
- delete(sandbox: RunnerSandbox): Promise<RunnerSandboxOperation>;
391
+ /** Stops a sandbox, which ends every process in it. Aborting `signal` stops the call and answers `aborted`. */
392
+ stop(sandbox: RunnerSandbox, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
393
+ /**
394
+ * Deletes a sandbox, keeping every snapshot it was started from or saved as. Aborting `signal` stops the call and
395
+ * answers `aborted`.
396
+ */
397
+ delete(sandbox: RunnerSandbox, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
355
398
  }
399
+ /**
400
+ * What color environment variable the launcher terminal asks the command to receive when the command's own
401
+ * environment sets neither `FORCE_COLOR` nor `NO_COLOR`:
402
+ * - `"on"`: set `FORCE_COLOR=1` (stdout is a TTY, or launcher `FORCE_COLOR` turns color on).
403
+ * - `"off"`: set `NO_COLOR=1` (`--no-color` was passed, or launcher `NO_COLOR` is set and non-empty).
404
+ * - `"auto"`: set neither (non-TTY launcher with no explicit color setting, or `FORCE_COLOR` set to `0` or `false`).
405
+ */
406
+ export type RunnerTerminalColor = "on" | "off" | "auto";
356
407
  /**
357
408
  * The terminal the command's output reaches, wherever the command runs, a DI seam: stdout and stderr, and whether the
358
- * terminal shows color. Writes never throw.
409
+ * launcher terminal asks the command for color. Writes never throw.
359
410
  */
360
411
  export interface RunnerTerminal {
361
- readonly color: boolean;
412
+ readonly color: RunnerTerminalColor;
362
413
  writeStdout(text: string): void;
363
414
  writeStderr(text: string): void;
364
415
  }
@@ -1,7 +1,7 @@
1
1
  export type { RunnerContext } from "./context.ts";
2
2
  export { buildSnapshots, prepareSnapshotBuild, type PrepareSnapshotBuildOutcome, type SnapshotBuildOutcome, } from "./build-snapshots.ts";
3
3
  export { type KeptSandbox, type RunnerEvent, type RunnerFailure, type RunnerProgress, type RunnerStepPhase, type SnapshotBuildReason, } from "./events.ts";
4
- export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, } from "./gateways.ts";
4
+ export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, SandboxAccess, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, RunnerTerminalColor, } from "./gateways.ts";
5
5
  export { liveCheckoutGateway } from "./live/checkout-gateway.ts";
6
6
  export { liveRunnerSandboxGateway } from "./live/sandbox-gateway.ts";
7
7
  export { liveRunnerTerminal } from "./live/terminal.ts";
@@ -9,10 +9,12 @@ export { localUserName } from "./live/user.ts";
9
9
  export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.ts";
10
10
  export { lineSplitter } from "./output.ts";
11
11
  export { prepareRunner, type PrepareRunnerOutcome } from "./prepare.ts";
12
- export type { ReadyRunnerOutcome } from "./ready.ts";
13
- export { type CheckedRecipe, checkRecipe } from "./recipe.ts";
12
+ export type { ChosenSnapshot, ReadyRunnerOutcome } from "./ready.ts";
13
+ export { type CheckedRecipe, checkRecipe, MAX_RUNNER_SANDBOXES, resolveSandboxCountDefault, type SandboxCountDefault, type SandboxCountDefaultRun, type RunnerSandboxCount, } from "./recipe.ts";
14
+ export { chooseSnapshotForRun, type SnapshotChoice, type SnapshotChoiceEnd } from "./snapshot-choice.ts";
14
15
  export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.ts";
15
- export { declaredSecretValues, readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH, type RunnerSecrets } from "./secrets.ts";
16
+ export type { RunnerFenceOutcome } from "./scope.ts";
17
+ export { declaredSecretValues, readCredentials, readUnsafeSecretEnvVars, SECRET_MIN_LENGTH, type UnsafeSecretEnvVarMap, } from "./secrets.ts";
16
18
  export { type RunnerCleanupFacts, openRunnerSession, type RunnerSession, type RunnerSessionCleanup, type RunnerSessionRequest, } from "./session.ts";
17
19
  export { type InspectedSnapshot, inspectSnapshotCache, type SnapshotCacheInspection, type UnpickedReason, } from "./snapshot-inspect.ts";
18
20
  export { type RejectedSnapshot, RUNNER_SNAPSHOTS_SUBPATH, type SnapshotCacheNote, type SnapshotRejectionReason, } from "./snapshot-cache.ts";
@@ -10,9 +10,10 @@ export { localUserName } from "./live/user.js";
10
10
  export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.js";
11
11
  export { lineSplitter } from "./output.js";
12
12
  export { prepareRunner } from "./prepare.js";
13
- export { checkRecipe } from "./recipe.js";
13
+ export { checkRecipe, MAX_RUNNER_SANDBOXES, resolveSandboxCountDefault, } from "./recipe.js";
14
+ export { chooseSnapshotForRun } from "./snapshot-choice.js";
14
15
  export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.js";
15
- export { declaredSecretValues, readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH } from "./secrets.js";
16
+ export { declaredSecretValues, readCredentials, readUnsafeSecretEnvVars, SECRET_MIN_LENGTH, } from "./secrets.js";
16
17
  export { openRunnerSession, } from "./session.js";
17
18
  export { inspectSnapshotCache, } from "./snapshot-inspect.js";
18
19
  export { RUNNER_SNAPSHOTS_SUBPATH, } from "./snapshot-cache.js";