@cnc-tools/storm 0.16.0 → 0.18.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 (290) hide show
  1. package/dist/bin/storm.js +54 -40
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
  4. package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
  5. package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
  6. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
  7. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  8. package/dist/chunks/chunk-AS37D43E.js +2173 -0
  9. package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
  10. package/dist/chunks/chunk-DZLU7BYK.js +340 -0
  11. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  12. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
  13. package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
  14. package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
  15. package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
  16. package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
  17. package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
  18. package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
  19. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
  20. package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
  21. package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
  22. package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
  23. package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
  24. package/dist/chunks/chunk-SZMYIIG2.js +88 -0
  25. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
  26. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
  27. package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
  28. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  29. package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
  30. package/dist/cli.d.ts +28 -0
  31. package/dist/cli.js +64 -0
  32. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
  33. package/dist/commands/exec/across-sandboxes-outcomes.js +3 -3
  34. package/dist/commands/exec/before-run.d.ts +123 -0
  35. package/dist/commands/exec/before-run.js +105 -0
  36. package/dist/commands/exec/command.d.ts +67 -14
  37. package/dist/commands/exec/command.js +31 -95
  38. package/dist/commands/exec/driver-plan.d.ts +9 -4
  39. package/dist/commands/exec/driver-plan.js +8 -8
  40. package/dist/commands/exec/exec-words.js +1 -1
  41. package/dist/commands/exec/execute-run.d.ts +39 -0
  42. package/dist/commands/exec/execute-run.js +325 -0
  43. package/dist/commands/exec/live-view.d.ts +3 -3
  44. package/dist/commands/exec/live-view.js +16 -15
  45. package/dist/commands/exec/metadata.js +1 -1
  46. package/dist/commands/exec/mint-failed.d.ts +38 -0
  47. package/dist/commands/exec/mint-failed.js +27 -4
  48. package/dist/commands/exec/outcomes.d.ts +104 -22
  49. package/dist/commands/exec/outcomes.js +73 -26
  50. package/dist/commands/exec/plan-run.d.ts +58 -150
  51. package/dist/commands/exec/plan-run.js +239 -90
  52. package/dist/commands/exec/progress.d.ts +10 -6
  53. package/dist/commands/exec/progress.js +38 -25
  54. package/dist/commands/exec/run-bin.d.ts +11 -11
  55. package/dist/commands/exec/run-bin.js +9 -9
  56. package/dist/commands/exec/run-flags.d.ts +69 -0
  57. package/dist/commands/exec/run-flags.js +58 -0
  58. package/dist/commands/exec/run-metadata.js +4 -4
  59. package/dist/commands/exec/run-summary.d.ts +58 -0
  60. package/dist/commands/exec/run-summary.js +205 -0
  61. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  62. package/dist/commands/exec/runner-refusals.js +71 -0
  63. package/dist/commands/exec/sandbox-progress.js +3 -0
  64. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  65. package/dist/commands/exec/stopped-outcome.js +77 -0
  66. package/dist/commands/exec/view.d.ts +20 -11
  67. package/dist/commands/exec/view.js +103 -47
  68. package/dist/commands/runs/facts.d.ts +8 -4
  69. package/dist/commands/runs/facts.js +19 -10
  70. package/dist/commands/runs/list/command.d.ts +16 -8
  71. package/dist/commands/runs/list/command.js +10 -10
  72. package/dist/commands/runs/list/outcomes.d.ts +8 -4
  73. package/dist/commands/runs/logs/command.js +10 -10
  74. package/dist/commands/runs/show/command.d.ts +16 -8
  75. package/dist/commands/runs/show/command.js +31 -29
  76. package/dist/commands/runs/show/metadata.js +1 -1
  77. package/dist/commands/runs/show/outcomes.d.ts +8 -4
  78. package/dist/commands/runs/show/outcomes.js +8 -6
  79. package/dist/commands/snapshots/access.d.ts +111 -0
  80. package/dist/commands/snapshots/access.js +96 -0
  81. package/dist/commands/snapshots/build/command.d.ts +376 -101
  82. package/dist/commands/snapshots/build/command.js +447 -149
  83. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  84. package/dist/commands/snapshots/build/metadata.js +31 -11
  85. package/dist/commands/snapshots/build/outcomes.d.ts +242 -47
  86. package/dist/commands/snapshots/build/outcomes.js +200 -36
  87. package/dist/commands/snapshots/list/command.d.ts +368 -27
  88. package/dist/commands/snapshots/list/command.js +298 -68
  89. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  90. package/dist/commands/snapshots/list/metadata.js +29 -6
  91. package/dist/commands/snapshots/list/outcomes.d.ts +247 -15
  92. package/dist/commands/snapshots/list/outcomes.js +223 -52
  93. package/dist/commands/snapshots/metadata.js +1 -1
  94. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  95. package/dist/commands/snapshots/prune/command.js +161 -0
  96. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  97. package/dist/commands/snapshots/prune/metadata.js +39 -0
  98. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  99. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  100. package/dist/commands/suites/list/command.js +17 -17
  101. package/dist/commands/suites/list/outcomes.js +2 -2
  102. package/dist/commands/test/command.d.ts +67 -14
  103. package/dist/commands/test/command.js +49 -252
  104. package/dist/commands/test/outcomes.d.ts +33 -7
  105. package/dist/config/check-runner.d.ts +3 -3
  106. package/dist/config/check-runner.js +8 -7
  107. package/dist/config/credential-resolver.d.ts +50 -5
  108. package/dist/config/credential-resolver.js +51 -19
  109. package/dist/config/credential-settle.d.ts +6 -2
  110. package/dist/config/credential-settle.js +11 -5
  111. package/dist/config/index.d.ts +2 -2
  112. package/dist/config/index.js +1 -1
  113. package/dist/config/runner.d.ts +5 -5
  114. package/dist/config/runner.js +1 -1
  115. package/dist/config/schema.d.ts +2 -2
  116. package/dist/config/schema.js +1 -1
  117. package/dist/config-file/define.d.ts +1 -1
  118. package/dist/config-file/define.js +1 -1
  119. package/dist/config-file/runner.d.ts +5 -5
  120. package/dist/config-file/toolchain.d.ts +14 -4
  121. package/dist/config-file/toolchain.js +43 -7
  122. package/dist/context.d.ts +10 -6
  123. package/dist/context.js +8 -6
  124. package/dist/core/across-sandboxes.d.ts +7 -6
  125. package/dist/core/across-sandboxes.js +123 -152
  126. package/dist/core/coordinator.d.ts +166 -0
  127. package/dist/core/coordinator.js +233 -0
  128. package/dist/core/events.d.ts +2 -2
  129. package/dist/core/index.d.ts +4 -2
  130. package/dist/core/index.js +1 -1
  131. package/dist/core/outcomes.d.ts +148 -0
  132. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  133. package/dist/core/resources.d.ts +31 -53
  134. package/dist/core/resources.js +32 -70
  135. package/dist/core/run-state.d.ts +7 -1
  136. package/dist/core/run-state.js +2 -0
  137. package/dist/core/run.d.ts +32 -236
  138. package/dist/core/run.js +107 -267
  139. package/dist/core/state-directory.d.ts +1 -1
  140. package/dist/core/state-directory.js +2 -2
  141. package/dist/credential/gateways.d.ts +15 -1
  142. package/dist/credential/index.d.ts +4 -3
  143. package/dist/credential/index.js +3 -2
  144. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  145. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  146. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  147. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  148. package/dist/credential/source.d.ts +73 -6
  149. package/dist/credential/source.js +55 -2
  150. package/dist/extension-commands.d.ts +1 -1
  151. package/dist/extension-commands.js +2 -2
  152. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  153. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  154. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  155. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  156. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  157. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  158. package/dist/extensions/testserver/credential-facts.js +29 -11
  159. package/dist/extensions/testserver/lifecycle.js +7 -1
  160. package/dist/extensions/testserver/limit.d.ts +3 -0
  161. package/dist/extensions/testserver/limit.js +3 -0
  162. package/dist/extensions/testserver/provision.d.ts +8 -1
  163. package/dist/extensions/testserver/provision.js +8 -3
  164. package/dist/extensions/testserver/refusals.d.ts +6 -1
  165. package/dist/extensions/testserver/refusals.js +16 -1
  166. package/dist/extensions/testserver/resource.d.ts +1 -1
  167. package/dist/extensions/testserver/resource.js +1 -1
  168. package/dist/extensions/testserver/result.d.ts +1 -1
  169. package/dist/extensions/testserver/result.js +9 -4
  170. package/dist/planning/driver-file-lists.d.ts +0 -15
  171. package/dist/planning/driver-file-lists.js +2 -21
  172. package/dist/planning/plan-only.d.ts +3 -14
  173. package/dist/planning/plan-only.js +11 -20
  174. package/dist/planning/run-kind-flags.js +2 -2
  175. package/dist/planning/run-plan.d.ts +45 -12
  176. package/dist/planning/run-plan.js +4 -3
  177. package/dist/planning/suites.d.ts +1 -1
  178. package/dist/planning/suites.js +2 -2
  179. package/dist/planning/test-plan.d.ts +9 -0
  180. package/dist/planning/test-plan.js +9 -0
  181. package/dist/run-directory/recording.js +3 -3
  182. package/dist/run-directory/run-record.d.ts +26 -11
  183. package/dist/run-directory/run-record.js +16 -13
  184. package/dist/runner/base.js +1 -1
  185. package/dist/runner/build-snapshots.d.ts +60 -29
  186. package/dist/runner/build-snapshots.js +136 -29
  187. package/dist/runner/context.d.ts +15 -7
  188. package/dist/runner/context.js +19 -6
  189. package/dist/runner/events.d.ts +16 -10
  190. package/dist/runner/gateways.d.ts +122 -23
  191. package/dist/runner/gateways.js +1 -1
  192. package/dist/runner/gh.d.ts +42 -0
  193. package/dist/runner/gh.js +58 -0
  194. package/dist/runner/index.d.ts +13 -8
  195. package/dist/runner/index.js +12 -6
  196. package/dist/runner/live/checkout-gateway.js +7 -0
  197. package/dist/runner/live/gh-output.d.ts +17 -0
  198. package/dist/runner/live/gh-output.js +37 -0
  199. package/dist/runner/live/gh-token-gateway.d.ts +13 -0
  200. package/dist/runner/live/gh-token-gateway.js +51 -0
  201. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  202. package/dist/runner/live/sandbox-errors.js +4 -0
  203. package/dist/runner/live/sandbox-gateway.js +140 -4
  204. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  205. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  206. package/dist/runner/live/snapshot-records.js +12 -12
  207. package/dist/runner/local-snapshot-index.d.ts +205 -0
  208. package/dist/runner/local-snapshot-index.js +210 -0
  209. package/dist/runner/network-policy.d.ts +6 -6
  210. package/dist/runner/network-policy.js +7 -7
  211. package/dist/runner/policy-writes.d.ts +1 -1
  212. package/dist/runner/policy-writes.js +1 -1
  213. package/dist/runner/prepare.d.ts +14 -14
  214. package/dist/runner/prepare.js +20 -11
  215. package/dist/runner/ready.d.ts +19 -11
  216. package/dist/runner/ready.js +104 -33
  217. package/dist/runner/sandboxed-command.d.ts +3 -3
  218. package/dist/runner/sandboxed-command.js +3 -3
  219. package/dist/runner/scope.d.ts +15 -8
  220. package/dist/runner/scope.js +16 -5
  221. package/dist/runner/secrets.d.ts +41 -18
  222. package/dist/runner/secrets.js +226 -30
  223. package/dist/runner/session.d.ts +8 -8
  224. package/dist/runner/session.js +6 -3
  225. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  226. package/dist/runner/shared-snapshot-entry.js +168 -0
  227. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  228. package/dist/runner/shared-snapshot-list.js +155 -0
  229. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  230. package/dist/runner/shared-snapshot-lookup.js +118 -0
  231. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  232. package/dist/runner/shared-snapshot-prune.js +133 -0
  233. package/dist/runner/snapshot-build.d.ts +42 -14
  234. package/dist/runner/snapshot-build.js +79 -47
  235. package/dist/runner/snapshot-choice.js +2 -1
  236. package/dist/runner/snapshot-inspect.d.ts +39 -40
  237. package/dist/runner/snapshot-inspect.js +52 -35
  238. package/dist/runner/snapshot-key.d.ts +32 -17
  239. package/dist/runner/snapshot-key.js +43 -18
  240. package/dist/runner/snapshot-source.d.ts +31 -0
  241. package/dist/runner/snapshot-source.js +122 -0
  242. package/dist/runner/steps.d.ts +1 -1
  243. package/dist/runner/steps.js +1 -1
  244. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +4 -2
  245. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
  246. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
  247. package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
  248. package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
  249. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
  250. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  251. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  252. package/dist/sdk/extension/credential-source.d.ts +20 -3
  253. package/dist/sdk/extension/credential-source.js +4 -4
  254. package/dist/sdk/extension/index.d.ts +3 -2
  255. package/dist/sdk/extension/index.js +2 -1
  256. package/dist/sdk/extension/resource-definition.d.ts +1 -1
  257. package/dist/sdk/extension/secret-source.d.ts +1 -1
  258. package/dist/sdk/extension/secret-source.js +1 -1
  259. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  260. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  261. package/dist/shared/cleanup.d.ts +3 -3
  262. package/dist/shared/cleanup.js +15 -5
  263. package/dist/shared/snapshot-text.d.ts +4 -4
  264. package/dist/shared/snapshot-text.js +11 -11
  265. package/dist/time/duration.js +1 -1
  266. package/package.json +5 -3
  267. package/skills/overview.md +4 -4
  268. package/skills/plan-runs.md +1 -1
  269. package/skills/read-run-output.md +6 -6
  270. package/dist/application.d.ts +0 -21
  271. package/dist/application.js +0 -30
  272. package/dist/chunks/chunk-7EENF73W.js +0 -782
  273. package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
  274. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  275. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  276. package/dist/commands/exec/plan-only.d.ts +0 -10
  277. package/dist/commands/exec/plan-only.js +0 -45
  278. package/dist/commands/exec/run-command.d.ts +0 -475
  279. package/dist/commands/exec/run-command.js +0 -603
  280. package/dist/commands/exec/run-planned.d.ts +0 -20
  281. package/dist/commands/exec/run-planned.js +0 -22
  282. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  283. package/dist/commands/exec/sandbox-view.js +0 -72
  284. package/dist/commands/test/plan.d.ts +0 -92
  285. package/dist/commands/test/plan.js +0 -125
  286. package/dist/core/sandbox-end.d.ts +0 -64
  287. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  288. package/dist/runner/recipe-secrets.d.ts +0 -67
  289. package/dist/runner/snapshot-cache.d.ts +0 -148
  290. package/dist/runner/snapshot-cache.js +0 -126
@@ -1,6 +1,6 @@
1
- // What a run, `storm runs show` and `storm snapshots list` say about a runner snapshot: where it was built, in
2
- // commits a person knows, why a run doesn't start from one, and what the cache read noticed. Each text says only what
3
- // storm checked.
1
+ // What a run, `storm runs show`, and `storm snapshots list` say about a runner snapshot: where it was built, in
2
+ // commits a person knows, why a run doesn't start from one, and what reading the local snapshot index noticed. Each
3
+ // text says only what storm checked.
4
4
  import { short } from "./text.js";
5
5
  /** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
6
6
  export const REJECTIONS_SHOWN = 5;
@@ -31,15 +31,15 @@ export function rejectionText(reason, snapshot) {
31
31
  case "expires-soon":
32
32
  return "expires within the hour";
33
33
  case "other-base":
34
- return `its base ${short(snapshot.base)} is not the merge-base`;
34
+ return `its base ${short(snapshot.base)} is neither the merge-base nor an ancestor of it`;
35
35
  case "steps-changed":
36
- return "the recipe's snapshot steps changed since it was built";
36
+ return "the runner's snapshot steps changed since it was built";
37
37
  case "other-owner":
38
38
  return "built for another team or project";
39
39
  }
40
40
  }
41
41
  /**
42
- * The lines under a run's build line: why each cached snapshot of the recipe doesn't fit, `REJECTIONS_SHOWN` of them
42
+ * The lines under a run's build line: why each cached snapshot of the runner doesn't fit, `REJECTIONS_SHOWN` of them
43
43
  * at most, then how many more `storm snapshots list` shows.
44
44
  */
45
45
  export function rejectionLines(rejected) {
@@ -59,14 +59,14 @@ export const REJECTION_REASONS = [
59
59
  "other-owner",
60
60
  ];
61
61
  /**
62
- * What removing expired entries from the runner snapshot cache noticed, as a run's and `storm snapshots build`'s
62
+ * What removing expired entries from the local snapshot index noticed, as a run's and `storm snapshots build`'s
63
63
  * progress line.
64
64
  */
65
- export function snapshotCacheNoteText(note) {
65
+ export function snapshotIndexNoteText(note) {
66
66
  switch (note.kind) {
67
- case "cache-unreadable":
68
- return `couldn't read the runner snapshot cache at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
67
+ case "local-index-unreadable":
68
+ return `couldn't read the local snapshot index at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
69
69
  case "expired-entry-not-removed":
70
- return `couldn't remove the expired cache entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
70
+ return `couldn't remove the expired local snapshot index entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
71
71
  }
72
72
  }
@@ -1,4 +1,4 @@
1
- // Durations as the runner's settings write them: a runner recipe's `timeout` and `keepSandbox` (and
1
+ // Durations as the runner's settings write them: a Vercel Sandbox runner's `timeout` and `keepSandbox` (and
2
2
  // `--keep-sandbox`). A resource parses its own options' durations itself.
3
3
  /** The shortest TTL storm gives a Vercel Sandbox: 10 minutes. */
4
4
  export const MIN_TTL_MINUTES = 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnc-tools/storm",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "A test orchestrator: run your tests in the inner loop of development, in the cloud, in a test environment that you define",
5
5
  "repository": {
6
6
  "type": "git",
@@ -127,10 +127,11 @@
127
127
  "registry": "https://registry.npmjs.org/"
128
128
  },
129
129
  "dependencies": {
130
- "@vercel/sandbox": "3.9.0",
130
+ "@vercel/sandbox": "5.0.0",
131
131
  "zod": "^4.6.5"
132
132
  },
133
133
  "devDependencies": {
134
+ "@cnc/vbx-clinkr-ts": "0.0.0",
134
135
  "@playwright/test": "1.56.1",
135
136
  "@types/node": "^24.19.1",
136
137
  "@vercel/clinkr": "0.10.1",
@@ -159,11 +160,12 @@
159
160
  },
160
161
  "scripts": {
161
162
  "build": "tsc -p tsconfig.build.json && node scripts/embed-testserver-sdk.js && node scripts/bundle.js && node scripts/write-build-info.js",
163
+ "build:bun-entry": "vbx-clinkr entry --extras scripts/vbx-extras.ts",
162
164
  "typecheck": "tsc --noEmit && tsc -p tsconfig.sdk.json",
163
165
  "test": "pnpm run test:default && pnpm run test:integration",
164
166
  "test:default": "vitest run --project default --project sanity",
165
167
  "test:integration": "vitest run --project integration --passWithNoTests",
166
- "test:testserver": "node bin/storm.js test --suite testserver",
168
+ "test:testserver": "node bin/storm.js test --suite testserver --scope vercel --project vercel",
167
169
  "live:allowed-domains": "node scripts/live/allowed-domains-check.ts",
168
170
  "live:credential": "node scripts/live/credential-check.ts",
169
171
  "live:network-policy": "node scripts/live/network-policy-check.ts",
@@ -14,16 +14,16 @@ storm finds `storm.config.ts` in the working directory or the nearest parent up
14
14
  - A **run** is one `storm test` or one `storm exec`. It runs one command: the driver's program with arguments from the command line and `storm.config.ts` for `storm test`, or the command after `--` for `storm exec`.
15
15
  - The **project's tests** are the tests and test environment declared at the top level of `storm.config.ts` (`driver`, `args`, `runner`, and `resources`). `storm test` runs them when no `--suite` is given.
16
16
  - A **suite** is a named variation of the project's tests declared under `suites` in `storm.config.ts`. A suite inherits every top-level setting it does not set, the runner included. Select it with `storm test --suite <name>`, or inspect all suites with `storm suites list`.
17
- - A **runner** is where the command runs, declared under `runner` in `storm.config.ts` with one of two peer factories from `@vercel/storm/config`: `vercelSandbox({ … })` (the **Vercel Sandbox runner**, which readies a **runner sandbox** from the runner recipe and runs the command in it) or `launchMachine()` (the **launch machine runner**, which runs the command on this machine with no isolation). There is no built-in default runner: a run whose effective config declares no `runner` is refused with `missing_runner`. `storm test` has no runner flag; `storm exec` takes `--runner launch-machine` to run on the launch machine without a config file or ignoring the top-level runner.
17
+ - A **runner** is where the command runs, declared under `runner` in `storm.config.ts` with one of two peer factories from `@vercel/storm/config`: `vercelSandbox({ … })` (the **Vercel Sandbox runner**, which readies a **runner sandbox** and runs the command in it) or `launchMachine()` (the **launch machine runner**, which runs the command on this machine with no isolation). There is no built-in default runner: a run whose effective config declares no `runner` is refused with `missing_runner`. `storm test` has no runner flag; `storm exec` takes `--runner launch-machine` to run on the launch machine without a config file or ignoring the top-level runner.
18
18
  - A **resource** is a thing that a run gets for its command, such as a set of test servers. Declare it under `resources` in `storm.config.ts`, under its resource key, or give one of its flags. The run acquires the resource before the command starts, gives the command what it needs of it in the run payload, and releases it after the command stops. Each resource adds its flags to the help of `storm test` and `storm exec`. Its own commands are under `storm ext`.
19
19
  - A **run id** is the name of a run, such as `20261103T192655-8277`. It is the start time of the run in UTC and a short suffix. `storm test` and `storm exec` print it at the end, in the `logs` line. With `--json`, the result gives it as `runId`.
20
20
  - A **run directory** is the directory where a run writes what it did, on the machine that started the run. This is true for every run, whether on the launch machine or in a runner sandbox. Its name is the run id. Do not read its files directly. Use the `runs` commands.
21
21
  - A run is **active** while it goes on. A run is **finished** when it has ended and saved its test results. `runs show` shows test results only for a finished run.
22
22
  - A **test result** is the final result of one test: `pass`, `fail`, or `skip`, with its errors. The command saves test results only with a storm reporter in the config of its test runner: `stormReporter` for vitest, `@vercel/storm/playwright/reporter` for Playwright. When the command of a `storm test` run exits 0 but reports no test result, the run warns `no_final_test_results`. The exit code does not change. Do the steps in its `next`: they name the config file and the code to add. Then run the same command again.
23
23
  - **Test output** is what one test printed to the console, stdout and stderr together. storm keeps the last 8 MiB of the test output of each test. `droppedChars` counts the characters that storm did not keep.
24
- - A **sandbox credential** is a secret that the `credentials` key of the runner recipe declares, such as a token for a private npm registry: `credentials: [{ domain: "registry.npmjs.org", source: { kind: "env", name: "NPM_AUTH" } }]`. `source` is a `SecretSource` plain object (`{ kind: "env", name }`) naming a variable in your environment that holds the whole header value, such as `Bearer …`. `header` is the name of the header, `authorization` by default. `requests` is `read`, the default, for `GET` and `HEAD` only, or `all`. A run in a runner sandbox reads the variable on the machine that starts the run. The run does not start, with `credentials_invalid`, when the variable is not set, is empty, holds a line break, or has fewer than 8 characters. The value never goes into a sandbox: the firewall of the sandbox adds the header to the requests to the domain. Vercel calls this "credentials brokering". The credentials are in place for the toolchain and prebuild steps of a snapshot build, and from before the install step of a run until the command has ended. The upload and the apply step do not get them. A resource can give credentials too, for the command only. With `read`, the firewall refuses every other request to the domain. Code that runs while a credential is in place, the command included, can send requests with the header to the domain, but it cannot read the value. Each install must find the registry configuration that names the domain: `npm --prefix <dir>` reads the `.npmrc` of that directory, not the project's. storm shows the value as `<token>` in all that it prints and writes, and does not write it to a file or a snapshot. A sandbox credential is not the credential that `--credential` picks, the Vercel OIDC token that storm uses for its own calls: the word has both uses until a rename.
25
- - An **unsafe secret environment variable** is a secret declared in the `unsafeSecretEnvVars` key of the runner recipe as `{ name, source: { kind: "env", name } }`, for a secret that cannot travel as an HTTPS header. A run in a runner sandbox reads `source` on the machine that starts the run and passes `name` into the command's environment alone, never into a step or a snapshot, and forbids keeping the runner sandbox. The run does not start, with `unsafe_secret_env_vars_invalid`, when the source variable is not set, is empty, holds a line break, or has fewer than 8 characters.
26
- - An **allowed domain** is a domain that the `allowedDomains` key of the runner recipe lists, such as `example.com` or `*.example.com`. With the list, the sandboxes of a run in a runner sandbox, every step and the command, reach only the allowed domains, and the domain of each sandbox credential while it is in place. A host outside them does not resolve: `curl` exits 6. A host that a resource gives the command must be in the list too. Without the list, every host is reachable.
24
+ - A **sandbox credential** is a secret that `credentials` in `vercelSandbox({ … })` declares, such as a token for a private npm registry or GitHub: `credentials: [{ domain: "github.com", requests: "all", source: { kind: "gh", env: "GITHUB_TOKEN" } }]` or `source: { kind: "env", name: "NPM_AUTH" }`. `source` is a `SandboxCredentialSource` plain object: `{ kind: "env", name }` reads the whole header value (such as `Bearer …` or `Basic …`) from a launcher environment variable, and `{ kind: "gh", env?, host?, format? }` reads a GitHub token from `gh auth token --hostname <host>` (`host` defaults to `"github.com"`) or from the optional `env` override (such as `GITHUB_TOKEN` in CI), framing it as `Basic <base64(x-access-token:<token>)>` when `domain` matches `host` and `Bearer <token>` otherwise (overridable via `format`). `header` is the name of the header, `authorization` by default (required for `{ kind: "gh" }`). `requests` is `read`, the default, for `GET` and `HEAD` only, or `all`. A run in a runner sandbox resolves the credential on the machine that starts the run. The run does not start, with `credentials_invalid`, when the source is missing, unreadable, unauthenticated, malformed, ambiguous, holds a line break, or has fewer than 8 characters. The value never goes into a sandbox: the firewall of the sandbox adds the header to the requests to the domain. Vercel calls this "credentials brokering". The credentials are in place for the toolchain and prebuild steps of a snapshot build, and from before the install step of a run until the command has ended. The upload and the apply step do not get them. A resource can give credentials too, for the command only. With `read`, the firewall refuses every other request to the domain. Code that runs while a credential is in place, the command included, can send requests with the header to the domain, but it cannot read the value. Each install must find the registry configuration that names the domain: `npm --prefix <dir>` reads the `.npmrc` of that directory, not the project's. storm shows the value (and every derived secret form) as `<token>` in all that it prints and writes, and does not write it to a file or a snapshot. A sandbox credential is not the credential that `--credential` picks, the Vercel OIDC token that storm uses for its own calls: the word has both uses until a rename.
25
+ - An **unsafe secret environment variable** is a secret declared in `unsafeSecretEnvVars` in `vercelSandbox({ … })` as `{ name, source: { kind: "env", name } }`, for a secret that cannot travel as an HTTPS header. A run in a runner sandbox reads `source` on the machine that starts the run and passes `name` into the command's environment alone, never into a step or a snapshot, and forbids keeping the runner sandbox. The run does not start, with `unsafe_secret_env_vars_invalid`, when the source variable is not set, is empty, holds a line break, or has fewer than 8 characters.
26
+ - An **allowed domain** is a domain that `allowedDomains` in `vercelSandbox({ … })` lists, such as `example.com` or `*.example.com`. With the list, the sandboxes of a run in a runner sandbox, every step and the command, reach only the allowed domains, and the domain of each sandbox credential while it is in place. A host outside them does not resolve: `curl` exits 6. A host that a resource gives the command must be in the list too. Without the list, every host is reachable.
27
27
  - A **run log** is a log in the run directory. The **command log** (`command`) holds all the output of the command. It also holds output that no test owns: output from a `beforeAll`, a global setup, a raw `process.stdout.write`, or a child process. A **step log** (`install`, `build`, `apply`, `snapshot`) holds the output of one step of a run in a runner sandbox.
28
28
 
29
29
  ## Commands
@@ -24,7 +24,7 @@ The parts are:
24
24
  - `plan.sandboxes`: the number of runner sandboxes (`count`), where it came from (`from`: `flag` for `--sandboxes`, `file-lists` for `--file-lists`, `default` for `runner.sandboxes.default`), and its max (`max`). For `default`, `default` is the number that the default gave for this run. When that number is more than `max`, the run has `max` runner sandboxes. `requested` is the number asked for when the run has fewer test files than that. `leftOut` is the number of test files that your lists leave out.
25
25
  - `sandboxes`: one item for each runner sandbox, with `sandbox` (the runner sandbox index, from 0), `argv` (the command of the runner sandbox, unchanged across runner sandboxes for `storm test`), and `files` (its file list, delivered in `STORM_RUN.sandbox.files`, or `null` for `storm exec`).
26
26
  - `options`: each option of each resource, with its `value` and where the value came from (`from`: `flag`, `file`, or `default`). With `--sandboxes` or `--file-lists`, a default is the total for the whole run with that number of runner sandboxes, and each runner sandbox gets its own part of the resource.
27
- - `vcpus`: the vCPUs of each runner sandbox, as the recipe gives them for that number of runner sandboxes. It is `null` for a run on the launch machine runner.
27
+ - `vcpus`: the vCPUs of each runner sandbox, as the runner configures them for that number of runner sandboxes. It is `null` for a run on the launch machine runner.
28
28
  4. A refusal that a run gets before it mints, `--plan-only` gets too. Read `reason` in the error document, as for a run.
29
29
 
30
30
  ## 2. Give your own file lists
@@ -47,21 +47,21 @@ With the Vercel Sandbox runner, storm installs and builds before it runs the com
47
47
 
48
48
  ## 6. Read why the setup was fast or slow
49
49
 
50
- With the Vercel Sandbox runner, the runner sandbox starts from a runner snapshot: a base snapshot at the merge-base, or one at a commit on the branch that `storm snapshots build --base` built. The snapshot decides how much the run uploads, installs, and builds.
50
+ With the Vercel Sandbox runner, the runner sandbox starts from a runner snapshot at the run's merge-base or an ancestor of its merge-base, reused from the local snapshot index or the Vercel project's shared snapshot index, or built at the merge-base when none fits. The snapshot decides how much the run uploads, installs, and builds.
51
51
 
52
52
  1. Run `storm runs show <run-id> --json`. Read `where.snapshot`.
53
53
  2. Read `base`: the commit the snapshot was built at.
54
- 3. Read `builtBehind`: how many commits HEAD has after `base`, the run's merge-base. A large number means more work for the install and build.
54
+ 3. Read `builtBehind`: how many commits HEAD has after `base`. A large number means more work for the install and build.
55
55
  4. Read `where.uploadBytes`: how many bytes of changes the run uploaded on top of the snapshot's base. The run's merge-base is `where.base`.
56
- 5. Read `built`. If it is `true`, the run built a base snapshot first, which takes a few minutes.
57
- 6. To see which snapshot the next run here starts from, and why it does not start from each other one, run `storm snapshots list --json`. Read `snapshots`: the one with `picked` `true` is the snapshot, and `reason` says why each other one is not. When none has `picked` `true`, a run here builds a base snapshot at the merge-base. A snapshot with `reason` `other-base` has a base that is not the merge-base, so no run here starts from it: a run starts only from a snapshot at its merge-base.
58
- 7. To build a base snapshot before the next run, without a test run, run `storm snapshots build --json`. Read `outcome`: `built` or `up_to_date`.
56
+ 5. Read `built` and `source`. If `built` is `true`, the run built a runner snapshot first, which takes a few minutes. If `built` is `false`, `source` says whether the reused snapshot came from `"local"` or `"shared"` (the shared snapshot index).
57
+ 6. To see which snapshot the next run here starts from, and why it does not start from each other one, run `storm snapshots list --json` (add `--shared` to include the project's shared snapshot index). Read `local` (and `shared.entries` with `--shared`): the entry with `picked` `true` is the snapshot, and `reason` says why each other local entry is not. When none has `picked` `true`, a run here builds a runner snapshot at the merge-base. A snapshot with `reason` `other-base` has a base that is neither the merge-base nor an ancestor of it, so no run here starts from it: a run starts only from a snapshot at its merge-base or at a commit behind it on the base ref.
58
+ 7. To build a runner snapshot before the next run, without a test run, run `storm snapshots build --json`. Read `outcome`: `built` or `up_to_date`.
59
59
 
60
60
  A field is `null` when storm does not know it, such as in a run that an older storm recorded.
61
61
 
62
62
  ## 7. Run one test again in the runner sandbox
63
63
 
64
- A run in a runner sandbox keeps its runner sandbox running after it ends only when you ask, with `--keep-sandbox` or the recipe's `keepSandbox` (never when `runner.unsafeSecretEnvVars` is set). Without a request, the run stops and deletes it, also after a failure. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including test output. It holds no secret. Anyone who can update the Vercel project can connect to it. The kept runner sandbox has no network access, whether or not the run took a resource, so a test that needs the network can't run again in it.
64
+ A run in a runner sandbox keeps its runner sandbox running after it ends only when you ask, with `--keep-sandbox` or `keepSandbox` in `vercelSandbox({ … })` (never when `runner.unsafeSecretEnvVars` is set). Without a request, the run stops and deletes it, also after a failure. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including test output. It holds no secret. Anyone who can update the Vercel project can connect to it. The kept runner sandbox has no network access, whether or not the run took a resource, so a test that needs the network can't run again in it.
65
65
 
66
66
  1. Run `storm runs show <run-id> --json`.
67
67
  2. Read `where.keptMinutesLeft`. If it is `null` or 0, the runner sandbox is not running. Start a new run with `storm test` or `storm exec`, and add `--keep-sandbox 30m`. With that flag, the run keeps its runner sandbox for 30 minutes.
@@ -1,21 +0,0 @@
1
- import { type ApplicationVersion, type ClinkrApplication } from "@vercel/clinkr";
2
- import type { StormApp } from "./context.ts";
3
- /** Where storm's code is: `src/` from source, `dist/` built. Everything else resolves from it. */
4
- export interface StormApplicationOptions {
5
- /** Whether accessible mode is on (`VERCEL_ACCESSIBLE=1`), which leaves the help logo out of root help. */
6
- readonly accessible: boolean;
7
- /**
8
- * storm's code root, the directory this module's source or build sits in: `src/` or `dist/`. The bin passes it,
9
- * since a bundled build moves this module's code to another file, where `import.meta.dirname` names another
10
- * directory.
11
- */
12
- readonly root: string;
13
- }
14
- /**
15
- * Discovers the `storm` command tree under `commands/` in `root`, and mounts each extension's own command tree under
16
- * its `ext` group (`extensionMounts`, from `extension-commands.ts`, which loads no extension's resources), at
17
- * `ext <name>`; `version` is what root `--version` prints, the version and commit as a run's
18
- * version line shows them (`versionText`), or a function Clinkr calls only to print it. Its skills, which
19
- * `storm skills get` prints for agents, are the Markdown files in `skills/`, beside `src/` and `dist/`.
20
- */
21
- export declare function loadStormApplication(version: ApplicationVersion, options: StormApplicationOptions): Promise<ClinkrApplication<StormApp>>;
@@ -1,30 +0,0 @@
1
- import { join } from "node:path";
2
- import { createApplication } from "@vercel/clinkr";
3
- import { stormCommands } from "./command-tree.js";
4
- import { stormHelpLogo } from "./help-logo.js";
5
- import { extensionMounts } from "./extension-commands.js";
6
- const DESCRIPTION = [
7
- "Run a project's tests in a test environment that storm sets up.",
8
- "",
9
- "Start with storm test, using the driver and suites declared in storm.config.ts, or storm exec to run any command.",
10
- "",
11
- "Docs: https://storm.playground-vercel.tools/",
12
- ].join("\n");
13
- /**
14
- * Discovers the `storm` command tree under `commands/` in `root`, and mounts each extension's own command tree under
15
- * its `ext` group (`extensionMounts`, from `extension-commands.ts`, which loads no extension's resources), at
16
- * `ext <name>`; `version` is what root `--version` prints, the version and commit as a run's
17
- * version line shows them (`versionText`), or a function Clinkr calls only to print it. Its skills, which
18
- * `storm skills get` prints for agents, are the Markdown files in `skills/`, beside `src/` and `dist/`.
19
- */
20
- export async function loadStormApplication(version, options) {
21
- const { accessible, root } = options;
22
- return await createApplication("storm", {
23
- commands: stormCommands.directory(join(root, "commands")),
24
- description: DESCRIPTION,
25
- version,
26
- helpLogo: (terminal) => stormHelpLogo(terminal, { accessible }),
27
- mounts: extensionMounts(root),
28
- skills: join(root, "../skills"),
29
- });
30
- }