@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,19 +1,19 @@
1
1
  import {
2
2
  muted
3
- } from "./chunk-TJNFVNKR.js";
3
+ } from "./chunk-EI3XDCEI.js";
4
4
  import {
5
- sandboxPage,
6
- snapshotPage,
7
5
  testTotalsText
8
- } from "./chunk-2MAD5NKK.js";
9
- import {
10
- sandboxRecordSchema
11
- } from "./chunk-P357TZAY.js";
6
+ } from "./chunk-K4MDQPLW.js";
12
7
  import {
13
8
  isoSecondsText,
9
+ sandboxPage,
14
10
  seconds,
15
- short
16
- } from "./chunk-G3PHMXH5.js";
11
+ short,
12
+ snapshotPage
13
+ } from "./chunk-KQ5FXRUD.js";
14
+ import {
15
+ sandboxRecordSchema
16
+ } from "./chunk-LOGHIUUB.js";
17
17
  import {
18
18
  stripAnsi
19
19
  } from "./chunk-F6N34UWB.js";
@@ -179,14 +179,14 @@ var runFactsSchema = z.object({
179
179
  z.object({ kind: z.literal("launch-machine") }),
180
180
  z.object({
181
181
  kind: z.literal("vercel-sandbox"),
182
- /** The control plane team the runner sandbox ran in. */
183
- team: z.string(),
184
- /** The control plane project the runner sandbox ran in. */
185
- project: z.string(),
182
+ /** The control plane team the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --scope). */
183
+ team: z.string().nullable(),
184
+ /** The control plane project the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --project). */
185
+ project: z.string().nullable(),
186
186
  /** The runner sandbox's region, such as iad1. */
187
187
  region: z.string(),
188
- /** The runner sandbox's runtime, such as node24. */
189
- runtime: z.string(),
188
+ /** The runner sandbox's image, such as vercel/sandbox/node:al-24. */
189
+ image: z.string(),
190
190
  /** The runner sandbox's vCPUs. */
191
191
  vcpus: z.number(),
192
192
  /** The run's base: HEAD's merge-base with baseRef, a full SHA. */
@@ -201,14 +201,16 @@ var runFactsSchema = z.object({
201
201
  keptUntil: z.string().nullable(),
202
202
  /** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
203
203
  keptMinutesLeft: z.number().nullable(),
204
- /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
204
+ /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, where a reused snapshot came from (`local` or `shared`), and its page in the Vercel dashboard. Null until known. */
205
205
  snapshot: z.object({
206
206
  id: z.string(),
207
207
  base: z.string(),
208
208
  built: z.boolean(),
209
209
  /** How many commits the run's HEAD had that its base, the commit it was built at, lacks; null when the run state had no count. */
210
210
  builtBehind: z.number().nullable(),
211
- url: z.string()
211
+ /** Where a reused snapshot came from (`local` or `shared`); null when this run built it or when unknown. */
212
+ source: z.enum(["local", "shared"]).nullable(),
213
+ url: z.string().nullable()
212
214
  }).nullable(),
213
215
  /** How many bytes of changes the run uploaded to the runner sandbox; null when the run stopped before the upload. */
214
216
  uploadBytes: z.number().nullable()
@@ -281,11 +283,16 @@ function runFacts(run, now) {
281
283
  function whereFacts(where, now) {
282
284
  if (where.kind === "launch-machine") return { kind: "launch-machine" };
283
285
  const { sandbox, snapshot, keptUntil } = where;
286
+ const project = where.team !== null && where.project !== null ? { team: where.team, project: where.project } : null;
284
287
  return {
285
288
  ...where,
286
289
  keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 6e4)),
287
- sandboxUrl: sandbox === null ? null : sandboxPage(where, sandbox),
288
- snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) }
290
+ sandboxUrl: sandbox === null || project === null ? null : sandboxPage(project, sandbox),
291
+ snapshot: snapshot === null ? null : {
292
+ ...snapshot,
293
+ source: snapshot.source ?? null,
294
+ url: project === null ? null : snapshotPage(project, snapshot.id)
295
+ }
289
296
  };
290
297
  }
291
298
  function scopeFacts(scope) {
@@ -0,0 +1,88 @@
1
+ import {
2
+ RUN_CLEANUP,
3
+ runErrors,
4
+ runnerFailureFacts
5
+ } from "./chunk-CQAY6GLP.js";
6
+ import {
7
+ credentialSourceError,
8
+ givenTarget
9
+ } from "./chunk-2JMWUKH3.js";
10
+
11
+ // src/commands/snapshots/access.ts
12
+ import { z } from "zod";
13
+ var SNAPSHOT_ACCESS_FIELDS = {
14
+ credential: z.enum(["mint", "vercel-oidc"]).default("mint"),
15
+ scope: z.string().min(1).optional(),
16
+ project: z.string().min(1).optional()
17
+ };
18
+ var SNAPSHOT_ACCESS_CLI = { options: { project: { short: "p" } } };
19
+ var PROJECT_FIELDS = {
20
+ /** The canonical team and project IDs from the credential. */
21
+ teamId: z.string(),
22
+ projectId: z.string(),
23
+ /** The display team and project slugs from flags or `storm.config.ts`, or null when unset. */
24
+ team: z.string().nullable(),
25
+ project: z.string().nullable()
26
+ };
27
+ function projectDisplayText(owner) {
28
+ return owner.team !== null && owner.project !== null ? `${owner.team}/${owner.project}` : `${owner.teamId}/${owner.projectId}`;
29
+ }
30
+ function sharedListFailedError(words) {
31
+ return {
32
+ exitCode: 1,
33
+ description: words.description,
34
+ schema: z.object({
35
+ ...PROJECT_FIELDS,
36
+ /** What the Sandbox API said. */
37
+ message: z.string()
38
+ }),
39
+ render: (facts) => ({
40
+ message: `Couldn't list the shared snapshot index of ${projectDisplayText(facts)}${words.consequence}: ${facts.message}`,
41
+ next: [{ type: "text", text: words.next }]
42
+ })
43
+ };
44
+ }
45
+ function settleSnapshotAccess(app, credential, settings, progress) {
46
+ const chosen = app.credentials.vercelProjectSource(credential, settings, { progress });
47
+ if (!chosen.ok) return chosen;
48
+ const target = givenTarget(settings.scope, settings.project);
49
+ return {
50
+ ok: true,
51
+ settled: {
52
+ target,
53
+ obtain: () => obtainSnapshotAccess(chosen.source, target)
54
+ }
55
+ };
56
+ }
57
+ async function obtainSnapshotAccess(source, target) {
58
+ const got = await source.obtain();
59
+ if (!got.ok) {
60
+ const { failure } = got;
61
+ return {
62
+ ok: false,
63
+ refusal: failure.source === "claims-missing" ? runErrors.runnerFailed({
64
+ failure: runnerFailureFacts({ kind: "credential-claims-missing", target: failure.target }),
65
+ cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: {} })
66
+ }) : credentialSourceError(failure)
67
+ };
68
+ }
69
+ const { project } = got;
70
+ return {
71
+ ok: true,
72
+ access: { credential: got.credential, ...project },
73
+ target,
74
+ teamId: project.teamId,
75
+ projectId: project.projectId,
76
+ team: target?.team ?? null,
77
+ project: target?.project ?? null
78
+ };
79
+ }
80
+
81
+ export {
82
+ SNAPSHOT_ACCESS_FIELDS,
83
+ SNAPSHOT_ACCESS_CLI,
84
+ PROJECT_FIELDS,
85
+ projectDisplayText,
86
+ sharedListFailedError,
87
+ settleSnapshotAccess
88
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  commandTree,
3
3
  mount
4
- } from "./chunk-VL7WFTVQ.js";
4
+ } from "./chunk-24UYAK4R.js";
5
5
 
6
6
  // src/sdk/extension/commands.ts
7
7
  import { join } from "node:path";
@@ -7,7 +7,7 @@ import {
7
7
  resolveColorDepth,
8
8
  resolveUnicode,
9
9
  runCliWith
10
- } from "./chunk-VL7WFTVQ.js";
10
+ } from "./chunk-24UYAK4R.js";
11
11
 
12
12
  // ../../../libs/clinkr/ts/dist/node/environment.js
13
13
  var AGENT_VARIABLES = [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  short
3
- } from "./chunk-G3PHMXH5.js";
3
+ } from "./chunk-KQ5FXRUD.js";
4
4
 
5
5
  // src/shared/snapshot-text.ts
6
6
  var REJECTIONS_SHOWN = 5;
@@ -21,9 +21,9 @@ function rejectionText(reason, snapshot) {
21
21
  case "expires-soon":
22
22
  return "expires within the hour";
23
23
  case "other-base":
24
- return `its base ${short(snapshot.base)} is not the merge-base`;
24
+ return `its base ${short(snapshot.base)} is neither the merge-base nor an ancestor of it`;
25
25
  case "steps-changed":
26
- return "the recipe's snapshot steps changed since it was built";
26
+ return "the runner's snapshot steps changed since it was built";
27
27
  case "other-owner":
28
28
  return "built for another team or project";
29
29
  }
@@ -43,12 +43,12 @@ var REJECTION_REASONS = [
43
43
  "steps-changed",
44
44
  "other-owner"
45
45
  ];
46
- function snapshotCacheNoteText(note) {
46
+ function snapshotIndexNoteText(note) {
47
47
  switch (note.kind) {
48
- case "cache-unreadable":
49
- return `couldn't read the runner snapshot cache at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
48
+ case "local-index-unreadable":
49
+ return `couldn't read the local snapshot index at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
50
50
  case "expired-entry-not-removed":
51
- return `couldn't remove the expired cache entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
51
+ return `couldn't remove the expired local snapshot index entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
52
52
  }
53
53
  }
54
54
 
@@ -58,5 +58,5 @@ export {
58
58
  rejectionText,
59
59
  rejectionLines,
60
60
  REJECTION_REASONS,
61
- snapshotCacheNoteText
61
+ snapshotIndexNoteText
62
62
  };
@@ -1,18 +1,3 @@
1
- // src/sdk/extension/resource-definition.ts
2
- var NOT_COUNTED = Object.freeze({
3
- testPlan: Object.freeze({ kind: "not-counted" }),
4
- sandboxes: 1
5
- });
6
- function defaultResourceKey(definition) {
7
- return definition.name;
8
- }
9
- function optionKeyPath(key, option) {
10
- return ["resources", key, option].join(".");
11
- }
12
- function resourceCall(name) {
13
- return `${name}({ \u2026 })`;
14
- }
15
-
16
1
  // src/sdk/extension/secret-source.ts
17
2
  import { z as z2 } from "zod";
18
3
 
@@ -220,8 +205,29 @@ function describeTokenRequestFailure(failure) {
220
205
  return { cause: `GitHub's answer to the token request held no token: ${last.said}`, fix };
221
206
  }
222
207
  }
208
+ function describeVercelOidcTokenFailure(failure) {
209
+ switch (failure.kind) {
210
+ case "missing-token":
211
+ return {
212
+ cause: "`VERCEL_OIDC_TOKEN` is not set or is empty",
213
+ fix: "Set `VERCEL_OIDC_TOKEN` to a Vercel project OIDC token (for example, from `vercel project token` or Vercel OIDC in CI), or use `--credential mint`, then retry."
214
+ };
215
+ case "invalid-token":
216
+ return {
217
+ cause: "`VERCEL_OIDC_TOKEN` is not a valid Vercel project OIDC token (expected a JWT with `owner_id` and `project_id` claims)",
218
+ fix: "Set `VERCEL_OIDC_TOKEN` to a Vercel project OIDC token from `vercel project token` or Vercel OIDC, then retry."
219
+ };
220
+ }
221
+ }
223
222
  function describeCredentialFailure(failure) {
224
- return failure.source === "mint" ? describeMintFailure(failure.failure, failure.target) : describeTokenRequestFailure(failure.failure);
223
+ switch (failure.source) {
224
+ case "mint":
225
+ return describeMintFailure(failure.failure, failure.target);
226
+ case "github-actions":
227
+ return describeTokenRequestFailure(failure.failure);
228
+ case "vercel-oidc":
229
+ return describeVercelOidcTokenFailure(failure.failure);
230
+ }
225
231
  }
226
232
  function variablesText(missing) {
227
233
  return missing.map((name) => `\`${name}\``).join(" and ");
@@ -258,6 +264,21 @@ function tokenRequestFailureFacts(failure) {
258
264
  };
259
265
  }
260
266
 
267
+ // src/sdk/extension/vercel-oidc-facts.ts
268
+ import { z as z4 } from "zod";
269
+ var vercelOidcTokenFailureShape = {
270
+ /** Why reading `VERCEL_OIDC_TOKEN` failed: unset/empty, or not a valid Vercel project OIDC token. */
271
+ cause: z4.enum(["missing-token", "invalid-token"]),
272
+ /** The cause, for a person. */
273
+ detail: z4.string(),
274
+ /** The one fix. */
275
+ fix: z4.string()
276
+ };
277
+ function vercelOidcTokenFailureFacts(failure) {
278
+ const { cause: detail, fix } = describeVercelOidcTokenFailure(failure);
279
+ return { cause: failure.kind, detail, fix };
280
+ }
281
+
261
282
  // src/sdk/extension/resource.ts
262
283
  function defineResource(spec) {
263
284
  const { name, flagPrefix, options, check, payload, context, lifecycle, progress } = spec;
@@ -296,6 +317,21 @@ function argsText(args) {
296
317
  return args.length === 0 ? "(none)" : args.join(" ");
297
318
  }
298
319
 
320
+ // src/sdk/extension/resource-definition.ts
321
+ var NOT_COUNTED = Object.freeze({
322
+ testPlan: Object.freeze({ kind: "not-counted" }),
323
+ sandboxes: 1
324
+ });
325
+ function defaultResourceKey(definition) {
326
+ return definition.name;
327
+ }
328
+ function optionKeyPath(key, option) {
329
+ return ["resources", key, option].join(".");
330
+ }
331
+ function resourceCall(name) {
332
+ return `${name}({ \u2026 })`;
333
+ }
334
+
299
335
  // src/sdk/extension/resource-factory.ts
300
336
  function resourceFactory(definition) {
301
337
  const make = (given = {}) => ({
@@ -308,9 +344,12 @@ function resourceFactory(definition) {
308
344
  export {
309
345
  Credential,
310
346
  describeMintFailure,
347
+ describeVercelOidcTokenFailure,
311
348
  describeCredentialFailure,
312
349
  tokenRequestFailureShape,
313
350
  tokenRequestFailureFacts,
351
+ vercelOidcTokenFailureShape,
352
+ vercelOidcTokenFailureFacts,
314
353
  defineResource,
315
354
  DRIVER_PLAN_FAILURE_KINDS,
316
355
  defineDriver,
@@ -3,16 +3,16 @@ import {
3
3
  RESOURCES,
4
4
  liveDriverContexts,
5
5
  liveResourceContexts
6
- } from "./chunk-DWEAHX4T.js";
7
- import "./chunk-R7XVBZOY.js";
8
- import "./chunk-CN4EFA5J.js";
9
- import "./chunk-ZG3WQ4UF.js";
10
- import "./chunk-5CCP36QQ.js";
6
+ } from "./chunk-OI4AP6Z7.js";
7
+ import "./chunk-EEENLQHE.js";
8
+ import "./chunk-72ZFEMAW.js";
9
+ import "./chunk-55O4FCN4.js";
10
+ import "./chunk-TXCOFC7N.js";
11
11
  import {
12
12
  RUNS_SUBPATH,
13
13
  liveRunDirectoryGateway,
14
14
  unavailableRunDirectoryGateway
15
- } from "./chunk-P357TZAY.js";
15
+ } from "./chunk-LOGHIUUB.js";
16
16
  import {
17
17
  liveCommandGateway,
18
18
  liveJobSummaryGateway,
@@ -20,7 +20,7 @@ import {
20
20
  liveProgressTerminal,
21
21
  resolveStateDirectory,
22
22
  stateDirectoryPattern
23
- } from "./chunk-FOZWA52V.js";
23
+ } from "./chunk-3VXZONGE.js";
24
24
  import {
25
25
  RUNNER_SNAPSHOTS_SUBPATH,
26
26
  configResolver,
@@ -29,19 +29,21 @@ import {
29
29
  liveConfigGateway,
30
30
  liveCredentialGateway,
31
31
  liveFileListsFileGateway,
32
+ liveGhTokenGateway,
32
33
  liveGitHubActionsTokenGateway,
33
34
  liveRunnerSandboxGateway,
34
- liveRunnerSnapshotCacheGateway,
35
+ liveRunnerSnapshotIndexGateway,
35
36
  liveRunnerTerminal,
37
+ liveVercelOidcTokenGateway,
36
38
  localUserName,
37
39
  systemClock,
38
40
  systemTimer,
39
- unavailableRunnerSnapshotCacheGateway
40
- } from "./chunk-DC2CDHNK.js";
41
- import "./chunk-AWBSONHB.js";
41
+ unavailableRunnerSnapshotIndexGateway
42
+ } from "./chunk-2JMWUKH3.js";
43
+ import "./chunk-XBDRVFEV.js";
42
44
  import {
43
45
  resolveColorDepth
44
- } from "./chunk-VL7WFTVQ.js";
46
+ } from "./chunk-24UYAK4R.js";
45
47
 
46
48
  // src/local-services.ts
47
49
  import { parse } from "node:path";
@@ -75,11 +77,13 @@ function liveContext(options) {
75
77
  return {
76
78
  credentials: liveCredentialGateway(),
77
79
  githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 1e4 }),
80
+ vercelOidcTokens: liveVercelOidcTokenGateway({ env: options.env }),
78
81
  commands: liveCommandGateway(),
79
82
  config: liveConfigGateway(),
80
83
  fileListsFiles: liveFileListsFileGateway(),
81
84
  checkout: liveCheckoutGateway(),
82
- runnerSnapshots: snapshots.ok ? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
85
+ ghTokens: liveGhTokenGateway({ env: options.env }),
86
+ runnerSnapshots: snapshots.ok ? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
83
87
  runnerSandboxes: liveRunnerSandboxGateway(),
84
88
  runnerTerminal: liveRunnerTerminal({
85
89
  env: options.env,
package/dist/cli.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { type ApplicationSources, type ClinkrApplication } from "@vercel/clinkr";
2
+ import type { StormApp } from "./context.ts";
3
+ /** Inputs for running the `storm` CLI from either `src/bin/storm.ts` or a compiled binary. */
4
+ export interface StormRunOptions {
5
+ readonly argv: readonly string[];
6
+ readonly sources: ApplicationSources<StormApp>;
7
+ readonly version: string;
8
+ readonly commit: string | null | (() => Promise<string | null>);
9
+ }
10
+ /**
11
+ * Resolves storm's command tree, extension mounts, and skills directory from `root`, storm's code root (`src/` from
12
+ * source, `dist/` built). The caller passes `root`, since a bundled build moves this module's code to another file,
13
+ * where `import.meta.dirname` names another directory.
14
+ */
15
+ export declare function sources(root: string): ApplicationSources<StormApp>;
16
+ /**
17
+ * Builds the `storm` Clinkr application from directory- or manifest-backed `ApplicationSources`.
18
+ */
19
+ export declare function application(cliSources: ApplicationSources<StormApp>, options?: {
20
+ readonly accessible?: boolean;
21
+ }): Promise<ClinkrApplication<StormApp>>;
22
+ /** Whether the global `--no-color` flag appears before a bare `--` in `argv`, matching Clinkr's global flag parse. */
23
+ export declare function hasNoColorFlag(argv: readonly string[]): boolean;
24
+ /**
25
+ * Runs the `storm` CLI under Clinkr's `runNodeCli`, lazily loading `live-app.ts` only when a command runs, then
26
+ * returns the status a command recorded past Clinkr's (the command's exit code), or else Clinkr's.
27
+ */
28
+ export declare function run(options: StormRunOptions): Promise<number>;
package/dist/cli.js ADDED
@@ -0,0 +1,64 @@
1
+ import { join } from "node:path";
2
+ import { createApplication } from "@vercel/clinkr";
3
+ import { runNodeCli } from "@vercel/clinkr/node";
4
+ import { stormCommands } from "./command-tree.js";
5
+ import { extensionMounts } from "./extension-commands.js";
6
+ import { stormHelpLogo } from "./help-logo.js";
7
+ const DESCRIPTION = [
8
+ "Run a project's tests in a test environment that storm sets up.",
9
+ "",
10
+ "Start with storm test, using the driver and suites declared in storm.config.ts, or storm exec to run any command.",
11
+ "",
12
+ "Docs: https://storm.playground-vercel.tools/",
13
+ ].join("\n");
14
+ /**
15
+ * Resolves storm's command tree, extension mounts, and skills directory from `root`, storm's code root (`src/` from
16
+ * source, `dist/` built). The caller passes `root`, since a bundled build moves this module's code to another file,
17
+ * where `import.meta.dirname` names another directory.
18
+ */
19
+ export function sources(root) {
20
+ return {
21
+ commands: stormCommands.directory(join(root, "commands")),
22
+ mounts: extensionMounts(root),
23
+ skills: join(root, "../skills"),
24
+ };
25
+ }
26
+ /**
27
+ * Builds the `storm` Clinkr application from directory- or manifest-backed `ApplicationSources`.
28
+ */
29
+ export function application(cliSources, options) {
30
+ const accessible = options?.accessible ?? false;
31
+ return createApplication("storm", {
32
+ ...cliSources,
33
+ description: DESCRIPTION,
34
+ helpLogo: (terminal) => stormHelpLogo(terminal, { accessible }),
35
+ });
36
+ }
37
+ /** Whether the global `--no-color` flag appears before a bare `--` in `argv`, matching Clinkr's global flag parse. */
38
+ export function hasNoColorFlag(argv) {
39
+ for (const token of argv) {
40
+ if (token === "--")
41
+ return false;
42
+ if (token === "--no-color")
43
+ return true;
44
+ }
45
+ return false;
46
+ }
47
+ /**
48
+ * Runs the `storm` CLI under Clinkr's `runNodeCli`, lazily loading `live-app.ts` only when a command runs, then
49
+ * returns the status a command recorded past Clinkr's (the command's exit code), or else Clinkr's.
50
+ */
51
+ export async function run(options) {
52
+ const exit = { status: undefined };
53
+ const accessible = process.env["VERCEL_ACCESSIBLE"] === "1";
54
+ const noColor = hasNoColorFlag(options.argv);
55
+ const status = await runNodeCli(await application(options.sources, { accessible }), {
56
+ argv: options.argv,
57
+ app: async (host) => {
58
+ const commitPromise = typeof options.commit === "function" ? options.commit() : Promise.resolve(options.commit);
59
+ const [{ liveStormApp }, resolvedCommit] = await Promise.all([import("./live-app.js"), commitPromise]);
60
+ return liveStormApp(host, { version: options.version, commit: resolvedCommit }, exit, { noColor });
61
+ },
62
+ });
63
+ return exit.status ?? status;
64
+ }
@@ -91,7 +91,7 @@ export declare const sandboxesRanSchema: z.ZodObject<{
91
91
  built: z.ZodBoolean;
92
92
  vcpus: z.ZodNumber;
93
93
  region: z.ZodString;
94
- runtime: z.ZodString;
94
+ image: z.ZodString;
95
95
  uploadBytes: z.ZodNullable<z.ZodNumber>;
96
96
  }, z.core.$strip>;
97
97
  cleanup: z.ZodType<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts>>;
@@ -99,7 +99,7 @@ export declare const sandboxesRanSchema: z.ZodObject<{
99
99
  sandbox: z.ZodNumber;
100
100
  name: z.ZodString;
101
101
  stopsAt: z.ZodString;
102
- url: z.ZodString;
102
+ url: z.ZodNullable<z.ZodString>;
103
103
  }, z.core.$strip>>;
104
104
  notKept: z.ZodArray<z.ZodObject<{
105
105
  sandbox: z.ZodNumber;
@@ -16,7 +16,7 @@ const keptSandboxSchema = z.object({
16
16
  sandbox: z.number(),
17
17
  name: z.string(),
18
18
  stopsAt: z.string(),
19
- url: z.string(),
19
+ url: z.string().nullable(),
20
20
  });
21
21
  const notKeptSandboxSchema = z.object({ sandbox: z.number(), name: z.string(), message: z.string() });
22
22
  /**
@@ -47,7 +47,7 @@ export const sandboxesRanSchema = z.object({
47
47
  built: z.boolean(),
48
48
  vcpus: z.number(),
49
49
  region: z.string(),
50
- runtime: z.string(),
50
+ image: z.string(),
51
51
  uploadBytes: z.number().nullable(),
52
52
  }),
53
53
  cleanup: RUN_CLEANUP.schema,
@@ -78,7 +78,7 @@ export function renderSandboxesRan(ran, options = {}) {
78
78
  })),
79
79
  ...noFinal.warnings,
80
80
  ];
81
- const kept = ran.kept.map(({ sandbox, name, stopsAt, url }) => `Kept runner sandbox ${sandbox}, ${name}, running until ${isoSecondsText(stopsAt)}, so you can connect to it: ${url}`);
81
+ const kept = ran.kept.map(({ sandbox, name, stopsAt, url }) => `Kept runner sandbox ${sandbox}, ${name}, running until ${isoSecondsText(stopsAt)}, so you can connect to it${url === null ? "" : `: ${url}`}`);
82
82
  return renderOutcome({
83
83
  ...(kept.length === 0 ? {} : { message: kept.join("\n") }),
84
84
  ...(warnings.length === 0 ? {} : { warnings }),