@cnc-tools/storm 0.16.0 → 0.17.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 (281) hide show
  1. package/dist/application.d.ts +22 -13
  2. package/dist/application.js +21 -10
  3. package/dist/bin/run.d.ts +18 -0
  4. package/dist/bin/run.js +31 -0
  5. package/dist/bin/storm.js +42 -26
  6. package/dist/build-info.js +1 -1
  7. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
  8. package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
  9. package/dist/chunks/{chunk-P357TZAY.js → chunk-4O5C2XGJ.js} +18 -15
  10. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
  11. package/dist/chunks/{chunk-OIY3DMF2.js → chunk-6UHIJXZG.js} +3 -3
  12. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  13. package/dist/chunks/{chunk-CK2GZEPK.js → chunk-7DZE67QM.js} +2 -2
  14. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
  15. package/dist/chunks/{chunk-2MAD5NKK.js → chunk-CKGZA25H.js} +1 -18
  16. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
  17. package/dist/chunks/{chunk-V4IKA3WI.js → chunk-DADEYJDW.js} +24 -17
  18. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  19. package/dist/chunks/chunk-F4MOYHRY.js +198 -0
  20. package/dist/chunks/{chunk-HVNK3I45.js → chunk-FNBB6V4R.js} +1 -1
  21. package/dist/chunks/{chunk-G3PHMXH5.js → chunk-GRT3UIBV.js} +18 -1
  22. package/dist/chunks/chunk-HP3CURSZ.js +88 -0
  23. package/dist/chunks/{chunk-DWEAHX4T.js → chunk-HWIQ2S7K.js} +5 -5
  24. package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
  25. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
  26. package/dist/chunks/{chunk-3L52KNQA.js → chunk-M7EKRGVD.js} +8 -8
  27. package/dist/chunks/chunk-MR77L2GK.js +340 -0
  28. package/dist/chunks/{chunk-DC2CDHNK.js → chunk-RNAS7JHE.js} +1438 -445
  29. package/dist/chunks/{chunk-FCQUJDA4.js → chunk-RWIXDDCK.js} +4 -189
  30. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
  31. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  32. package/dist/chunks/{chunk-FOZWA52V.js → chunk-YEPFSLQR.js} +480 -375
  33. package/dist/chunks/{live-app-WECQOQ4C.js → live-app-R76JQXZL.js} +15 -13
  34. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
  35. package/dist/commands/exec/across-sandboxes-outcomes.js +2 -2
  36. package/dist/commands/exec/before-run.d.ts +123 -0
  37. package/dist/commands/exec/before-run.js +105 -0
  38. package/dist/commands/exec/command.d.ts +31 -2
  39. package/dist/commands/exec/command.js +31 -95
  40. package/dist/commands/exec/driver-plan.d.ts +9 -4
  41. package/dist/commands/exec/driver-plan.js +8 -8
  42. package/dist/commands/exec/exec-words.js +1 -1
  43. package/dist/commands/exec/execute-run.d.ts +39 -0
  44. package/dist/commands/exec/execute-run.js +325 -0
  45. package/dist/commands/exec/live-view.d.ts +3 -3
  46. package/dist/commands/exec/live-view.js +16 -15
  47. package/dist/commands/exec/metadata.js +1 -1
  48. package/dist/commands/exec/mint-failed.d.ts +38 -0
  49. package/dist/commands/exec/mint-failed.js +27 -4
  50. package/dist/commands/exec/outcomes.d.ts +34 -8
  51. package/dist/commands/exec/outcomes.js +30 -23
  52. package/dist/commands/exec/plan-run.d.ts +58 -150
  53. package/dist/commands/exec/plan-run.js +232 -88
  54. package/dist/commands/exec/progress.d.ts +10 -6
  55. package/dist/commands/exec/progress.js +38 -25
  56. package/dist/commands/exec/run-bin.d.ts +11 -11
  57. package/dist/commands/exec/run-bin.js +9 -9
  58. package/dist/commands/exec/run-flags.d.ts +69 -0
  59. package/dist/commands/exec/run-flags.js +58 -0
  60. package/dist/commands/exec/run-metadata.js +4 -4
  61. package/dist/commands/exec/run-summary.d.ts +58 -0
  62. package/dist/commands/exec/run-summary.js +205 -0
  63. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  64. package/dist/commands/exec/runner-refusals.js +71 -0
  65. package/dist/commands/exec/sandbox-progress.js +3 -0
  66. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  67. package/dist/commands/exec/stopped-outcome.js +77 -0
  68. package/dist/commands/exec/view.d.ts +20 -11
  69. package/dist/commands/exec/view.js +103 -47
  70. package/dist/commands/runs/facts.d.ts +7 -3
  71. package/dist/commands/runs/facts.js +17 -8
  72. package/dist/commands/runs/list/command.d.ts +14 -6
  73. package/dist/commands/runs/list/command.js +10 -10
  74. package/dist/commands/runs/list/outcomes.d.ts +7 -3
  75. package/dist/commands/runs/logs/command.js +10 -10
  76. package/dist/commands/runs/show/command.d.ts +14 -6
  77. package/dist/commands/runs/show/command.js +30 -28
  78. package/dist/commands/runs/show/outcomes.d.ts +7 -3
  79. package/dist/commands/runs/show/outcomes.js +7 -5
  80. package/dist/commands/snapshots/access.d.ts +111 -0
  81. package/dist/commands/snapshots/access.js +96 -0
  82. package/dist/commands/snapshots/build/command.d.ts +360 -93
  83. package/dist/commands/snapshots/build/command.js +446 -150
  84. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  85. package/dist/commands/snapshots/build/metadata.js +31 -11
  86. package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
  87. package/dist/commands/snapshots/build/outcomes.js +200 -36
  88. package/dist/commands/snapshots/list/command.d.ts +366 -25
  89. package/dist/commands/snapshots/list/command.js +296 -66
  90. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  91. package/dist/commands/snapshots/list/metadata.js +29 -6
  92. package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
  93. package/dist/commands/snapshots/list/outcomes.js +221 -50
  94. package/dist/commands/snapshots/metadata.js +1 -1
  95. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  96. package/dist/commands/snapshots/prune/command.js +161 -0
  97. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  98. package/dist/commands/snapshots/prune/metadata.js +39 -0
  99. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  100. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  101. package/dist/commands/suites/list/command.js +17 -17
  102. package/dist/commands/suites/list/outcomes.js +2 -2
  103. package/dist/commands/test/command.d.ts +31 -2
  104. package/dist/commands/test/command.js +49 -252
  105. package/dist/commands/test/outcomes.d.ts +15 -1
  106. package/dist/config/check-runner.d.ts +3 -3
  107. package/dist/config/check-runner.js +8 -7
  108. package/dist/config/credential-resolver.d.ts +50 -5
  109. package/dist/config/credential-resolver.js +51 -19
  110. package/dist/config/credential-settle.d.ts +6 -2
  111. package/dist/config/credential-settle.js +11 -5
  112. package/dist/config/index.d.ts +2 -2
  113. package/dist/config/index.js +1 -1
  114. package/dist/config/runner.d.ts +5 -5
  115. package/dist/config/runner.js +1 -1
  116. package/dist/config/schema.d.ts +2 -2
  117. package/dist/config/schema.js +1 -1
  118. package/dist/config-file/define.d.ts +1 -1
  119. package/dist/config-file/define.js +1 -1
  120. package/dist/config-file/runner.d.ts +5 -5
  121. package/dist/config-file/toolchain.d.ts +1 -1
  122. package/dist/config-file/toolchain.js +2 -2
  123. package/dist/context.d.ts +8 -6
  124. package/dist/context.js +7 -6
  125. package/dist/core/across-sandboxes.d.ts +7 -6
  126. package/dist/core/across-sandboxes.js +123 -152
  127. package/dist/core/coordinator.d.ts +166 -0
  128. package/dist/core/coordinator.js +233 -0
  129. package/dist/core/events.d.ts +2 -2
  130. package/dist/core/index.d.ts +4 -2
  131. package/dist/core/index.js +1 -1
  132. package/dist/core/outcomes.d.ts +148 -0
  133. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  134. package/dist/core/resources.d.ts +31 -53
  135. package/dist/core/resources.js +32 -70
  136. package/dist/core/run-state.d.ts +7 -1
  137. package/dist/core/run-state.js +2 -0
  138. package/dist/core/run.d.ts +32 -236
  139. package/dist/core/run.js +106 -266
  140. package/dist/core/state-directory.d.ts +1 -1
  141. package/dist/core/state-directory.js +2 -2
  142. package/dist/credential/gateways.d.ts +15 -1
  143. package/dist/credential/index.d.ts +4 -3
  144. package/dist/credential/index.js +3 -2
  145. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  146. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  147. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  148. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  149. package/dist/credential/source.d.ts +73 -6
  150. package/dist/credential/source.js +55 -2
  151. package/dist/extension-commands.d.ts +6 -1
  152. package/dist/extension-commands.js +15 -1
  153. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  154. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  155. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  156. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  157. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  158. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  159. package/dist/extensions/testserver/credential-facts.js +29 -11
  160. package/dist/extensions/testserver/lifecycle.js +7 -1
  161. package/dist/extensions/testserver/limit.d.ts +3 -0
  162. package/dist/extensions/testserver/limit.js +3 -0
  163. package/dist/extensions/testserver/provision.d.ts +8 -1
  164. package/dist/extensions/testserver/provision.js +8 -3
  165. package/dist/extensions/testserver/refusals.d.ts +6 -1
  166. package/dist/extensions/testserver/refusals.js +16 -1
  167. package/dist/extensions/testserver/resource.d.ts +1 -1
  168. package/dist/extensions/testserver/resource.js +1 -1
  169. package/dist/extensions/testserver/result.d.ts +1 -1
  170. package/dist/extensions/testserver/result.js +9 -4
  171. package/dist/planning/driver-file-lists.d.ts +0 -15
  172. package/dist/planning/driver-file-lists.js +2 -21
  173. package/dist/planning/plan-only.d.ts +3 -14
  174. package/dist/planning/plan-only.js +11 -20
  175. package/dist/planning/run-kind-flags.js +2 -2
  176. package/dist/planning/run-plan.d.ts +45 -12
  177. package/dist/planning/run-plan.js +4 -3
  178. package/dist/planning/suites.d.ts +1 -1
  179. package/dist/planning/suites.js +2 -2
  180. package/dist/planning/test-plan.d.ts +9 -0
  181. package/dist/planning/test-plan.js +9 -0
  182. package/dist/run-directory/recording.js +2 -2
  183. package/dist/run-directory/run-record.d.ts +21 -6
  184. package/dist/run-directory/run-record.js +12 -9
  185. package/dist/runner/base.js +1 -1
  186. package/dist/runner/build-snapshots.d.ts +55 -29
  187. package/dist/runner/build-snapshots.js +130 -29
  188. package/dist/runner/context.d.ts +15 -7
  189. package/dist/runner/context.js +19 -6
  190. package/dist/runner/events.d.ts +16 -10
  191. package/dist/runner/gateways.d.ts +87 -21
  192. package/dist/runner/gateways.js +1 -1
  193. package/dist/runner/index.d.ts +11 -7
  194. package/dist/runner/index.js +9 -4
  195. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  196. package/dist/runner/live/sandbox-errors.js +4 -0
  197. package/dist/runner/live/sandbox-gateway.js +129 -3
  198. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  199. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  200. package/dist/runner/live/snapshot-records.js +6 -7
  201. package/dist/runner/local-snapshot-index.d.ts +199 -0
  202. package/dist/runner/local-snapshot-index.js +211 -0
  203. package/dist/runner/network-policy.d.ts +6 -6
  204. package/dist/runner/network-policy.js +7 -7
  205. package/dist/runner/policy-writes.d.ts +1 -1
  206. package/dist/runner/policy-writes.js +1 -1
  207. package/dist/runner/prepare.d.ts +14 -14
  208. package/dist/runner/prepare.js +20 -11
  209. package/dist/runner/ready.d.ts +18 -10
  210. package/dist/runner/ready.js +104 -33
  211. package/dist/runner/sandboxed-command.d.ts +3 -3
  212. package/dist/runner/sandboxed-command.js +3 -3
  213. package/dist/runner/scope.d.ts +10 -6
  214. package/dist/runner/scope.js +10 -3
  215. package/dist/runner/secrets.d.ts +13 -13
  216. package/dist/runner/secrets.js +18 -15
  217. package/dist/runner/session.d.ts +8 -8
  218. package/dist/runner/session.js +3 -3
  219. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  220. package/dist/runner/shared-snapshot-entry.js +168 -0
  221. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  222. package/dist/runner/shared-snapshot-list.js +155 -0
  223. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  224. package/dist/runner/shared-snapshot-lookup.js +118 -0
  225. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  226. package/dist/runner/shared-snapshot-prune.js +133 -0
  227. package/dist/runner/snapshot-build.d.ts +42 -14
  228. package/dist/runner/snapshot-build.js +32 -29
  229. package/dist/runner/snapshot-choice.js +1 -1
  230. package/dist/runner/snapshot-inspect.d.ts +39 -40
  231. package/dist/runner/snapshot-inspect.js +55 -35
  232. package/dist/runner/snapshot-key.d.ts +13 -12
  233. package/dist/runner/snapshot-key.js +13 -12
  234. package/dist/runner/steps.d.ts +1 -1
  235. package/dist/runner/steps.js +1 -1
  236. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
  237. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
  238. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +24 -23
  239. package/dist/runner/{recipe.js → vercel-sandbox-options.js} +70 -69
  240. package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
  241. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
  242. package/dist/sdk/extension/commands.d.ts +8 -3
  243. package/dist/sdk/extension/commands.js +3 -1
  244. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  245. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  246. package/dist/sdk/extension/credential-source.d.ts +20 -3
  247. package/dist/sdk/extension/credential-source.js +4 -4
  248. package/dist/sdk/extension/index.d.ts +3 -2
  249. package/dist/sdk/extension/index.js +2 -1
  250. package/dist/sdk/extension/resource-definition.d.ts +1 -1
  251. package/dist/sdk/extension/secret-source.d.ts +1 -1
  252. package/dist/sdk/extension/secret-source.js +1 -1
  253. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  254. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  255. package/dist/shared/cleanup.d.ts +3 -3
  256. package/dist/shared/cleanup.js +15 -5
  257. package/dist/shared/snapshot-text.d.ts +4 -4
  258. package/dist/shared/snapshot-text.js +11 -11
  259. package/dist/time/duration.js +1 -1
  260. package/package.json +3 -2
  261. package/skills/overview.md +4 -4
  262. package/skills/plan-runs.md +1 -1
  263. package/skills/read-run-output.md +6 -6
  264. package/dist/chunks/chunk-7EENF73W.js +0 -782
  265. package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
  266. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  267. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  268. package/dist/commands/exec/plan-only.d.ts +0 -10
  269. package/dist/commands/exec/plan-only.js +0 -45
  270. package/dist/commands/exec/run-command.d.ts +0 -475
  271. package/dist/commands/exec/run-command.js +0 -603
  272. package/dist/commands/exec/run-planned.d.ts +0 -20
  273. package/dist/commands/exec/run-planned.js +0 -22
  274. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  275. package/dist/commands/exec/sandbox-view.js +0 -72
  276. package/dist/commands/test/plan.d.ts +0 -92
  277. package/dist/commands/test/plan.js +0 -125
  278. package/dist/core/sandbox-end.d.ts +0 -64
  279. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  280. package/dist/runner/snapshot-cache.d.ts +0 -148
  281. package/dist/runner/snapshot-cache.js +0 -126
@@ -1,15 +1,13 @@
1
1
  import {
2
- DEFINITION_SET,
3
- EXTENSIONS,
4
- RESOURCES
5
- } from "./chunk-DWEAHX4T.js";
2
+ DEFINITION_SET
3
+ } from "./chunk-HWIQ2S7K.js";
6
4
  import {
7
5
  median,
8
6
  seconds,
9
7
  shortFile,
10
8
  truncate,
11
9
  visibleLength
12
- } from "./chunk-G3PHMXH5.js";
10
+ } from "./chunk-GRT3UIBV.js";
13
11
  import {
14
12
  PALETTE,
15
13
  paintSwatch
@@ -19,177 +17,7 @@ import {
19
17
  sameRow,
20
18
  setupPhaseKey,
21
19
  setupPhaseWords
22
- } from "./chunk-FOZWA52V.js";
23
- import {
24
- defaultResourceKey,
25
- optionKeyPath
26
- } from "./chunk-AWBSONHB.js";
27
-
28
- // src/planning/file-lists.ts
29
- function byCodeUnits(a, b) {
30
- return a < b ? -1 : a > b ? 1 : 0;
31
- }
32
- function dealFileLists(files, count) {
33
- const sorted = [...new Set(files)].toSorted(byCodeUnits);
34
- const lists = Array.from({ length: Math.min(count, sorted.length) }, () => []);
35
- sorted.forEach((file, index) => lists[index % lists.length]?.push(file));
36
- return lists;
37
- }
38
- function comparedPath(path) {
39
- let normal = path.replaceAll("\\", "/").replace(/\/{2,}/g, "/");
40
- while (normal.startsWith("./")) normal = normal.slice(2);
41
- return normal;
42
- }
43
- function fileListMismatches(sandboxes) {
44
- return sandboxes.flatMap(({ sandbox, files, exitCode, reported, whole }) => {
45
- if (files === null || exitCode === null || !whole) return [];
46
- const listed = new Set(files.map(comparedPath));
47
- const seen = new Set(reported.map(comparedPath));
48
- const missing = [...listed].filter((file) => !seen.has(file)).toSorted(byCodeUnits);
49
- const extra = [...seen].filter((file) => !listed.has(file)).toSorted(byCodeUnits);
50
- return missing.length === 0 && extra.length === 0 ? [] : [{ sandbox, missing, extra }];
51
- });
52
- }
53
- var NAMED_PATHS = 3;
54
- function pathsText(paths) {
55
- const named = paths.slice(0, NAMED_PATHS).join(", ");
56
- return paths.length > NAMED_PATHS ? `${named}, and ${paths.length - NAMED_PATHS} more` : named;
57
- }
58
- function fileListMismatchText({ sandbox, missing, extra }, options = {}) {
59
- const files = (n) => `${n} test ${n === 1 ? "file" : "files"}`;
60
- const parts = [
61
- ...missing.length === 0 ? [] : [`reported nothing for ${files(missing.length)} of its file list: ${pathsText(missing)}`],
62
- ...extra.length === 0 ? [] : [`reported ${files(extra.length)} not in its file list: ${pathsText(extra)}`]
63
- ];
64
- const hint = extra.length > 0 && options.extraHint !== void 0 ? ` ${options.extraHint}` : "";
65
- return `Runner sandbox ${sandbox} ${parts.join("; it ")}.${hint}`;
66
- }
67
-
68
- // src/planning/resource-flags.ts
69
- import { z } from "zod";
70
- function flagField(prefix, option) {
71
- return `${prefix}${option.charAt(0).toUpperCase()}${option.slice(1)}`;
72
- }
73
- function flagSpelling(field) {
74
- return `--${field.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
75
- }
76
- var RESOURCE_FLAGS = RESOURCES.flatMap((definition) => {
77
- const options = definition.options;
78
- return Object.entries(options).flatMap(([option, rule]) => {
79
- const help = rule.flag;
80
- if (help === void 0) return [];
81
- const field = flagField(definition.flagPrefix, option);
82
- return [
83
- {
84
- definition: definition.name,
85
- resource: defaultResourceKey(definition),
86
- option,
87
- field,
88
- flag: flagSpelling(field),
89
- rule,
90
- help
91
- }
92
- ];
93
- });
94
- });
95
- var RESOURCE_FLAG_HELP = Object.fromEntries(
96
- RESOURCE_FLAGS.map(({ field, help }) => [field, help])
97
- );
98
- var RESOURCE_USAGE_FLAGS = RESOURCE_FLAGS.map(({ flag, help, rule }) => {
99
- if (help.valueLabel !== void 0) return `[${flag} <${help.valueLabel}>]`;
100
- return rule.default === true ? `[${flag}=false]` : `[${flag}]`;
101
- }).join(" ");
102
- function resourceRunExamples() {
103
- return EXTENSIONS.flatMap(({ examples }) => examples?.exec ?? []);
104
- }
105
- function baseType(schema, field) {
106
- let input = schema;
107
- while (input instanceof z.ZodPipe) input = input.in;
108
- if (input instanceof z.ZodNumber) return z.number();
109
- if (input instanceof z.ZodString) return z.string();
110
- if (input instanceof z.ZodBoolean) return z.boolean();
111
- if (input instanceof z.ZodEnum) return input;
112
- throw new Error(`The run flag ${field}'s option schema has no number, string, boolean or enum base`);
113
- }
114
- function resourceFlagFields(taken) {
115
- const fields = {};
116
- for (const { field, rule } of RESOURCE_FLAGS) {
117
- if (Object.hasOwn(fields, field) || taken.includes(field))
118
- throw new Error(`Two run flags share the request field ${field}`);
119
- fields[field] = baseType(rule.schema, field).optional();
120
- }
121
- return fields;
122
- }
123
- function readResourceFlags(request) {
124
- const values = {};
125
- const problems = [];
126
- for (const { definition, option, field, flag, rule } of RESOURCE_FLAGS) {
127
- const value = request[field];
128
- if (value === void 0) continue;
129
- const checked = rule.schema.safeParse(value);
130
- if (checked.success) values[definition] = { ...values[definition], [option]: checked.data };
131
- else problems.push(...checked.error.issues.map(({ message }) => ({ field, message: `${flag} ${message}.` })));
132
- }
133
- if (problems.length > 0) return { ok: false, problems };
134
- return { ok: true, values };
135
- }
136
- function resourceFlagProblems(request) {
137
- const read = readResourceFlags(request);
138
- return read.ok ? [] : read.problems;
139
- }
140
- function resourceFlagValues(request) {
141
- const read = readResourceFlags(request);
142
- if (!read.ok) throw new Error(`The flags should have been refused: ${read.problems.map((p) => p.message).join(" ")}`);
143
- return read.values;
144
- }
145
-
146
- // src/planning/test-plan.ts
147
- function recordedPlan(testPlan, options) {
148
- return testPlan.kind === "counted" ? {
149
- ...testPlan.tests === void 0 ? {} : { tests: testPlan.tests },
150
- files: testPlan.files,
151
- options: options.map((option) => ({ ...option }))
152
- } : void 0;
153
- }
154
- function testPlanLine(plan) {
155
- return `Running ${testPlanText(plan)}`;
156
- }
157
- function testPlanText(plan) {
158
- const sandboxes = plan.sandboxes === void 0 ? void 0 : sandboxCountText(plan.sandboxes);
159
- const leftOut = plan.sandboxes?.leftOut ?? 0;
160
- const count = plan.files === void 0 ? void 0 : leftOut > 0 ? `${plan.files - leftOut} of ${plan.files} test files` : plan.sandboxes !== void 0 && plan.tests === void 0 ? `${plan.files} test ${plan.files === 1 ? "file" : "files"}` : countText({ tests: plan.tests, files: plan.files });
161
- const head = count === void 0 ? sandboxes : sandboxes === void 0 ? count : `${count} in ${sandboxes}`;
162
- return [...head === void 0 ? [] : [head], ...plan.options.map(planOptionText)].join("; ");
163
- }
164
- function sandboxCountText({ count, from, max, requested, default: given }) {
165
- const sandboxes = `${count} ${count === 1 ? "runner sandbox" : "runner sandboxes"}`;
166
- if (from === "default" && given !== void 0 && given > max)
167
- return `${sandboxes} (${SANDBOX_COUNT_FROM.default} ${given}, lowered to the max ${max}${requested === void 0 ? "" : ", then to the number of test files"})`;
168
- const source = requested === void 0 ? SANDBOX_COUNT_FROM[from] : `${SANDBOX_COUNT_FROM[from]} ${requested}, lowered to the number of test files`;
169
- return `${sandboxes} (${source}, max ${max})`;
170
- }
171
- var SANDBOX_COUNT_FROM = {
172
- flag: "--sandboxes",
173
- "file-lists": "--file-lists",
174
- default: "runner.sandboxes.default"
175
- };
176
- function countText({ tests, files }) {
177
- const inFiles = `in ${files} ${files === 1 ? "file" : "files"}`;
178
- return tests === void 0 ? `tests ${inFiles}` : `${tests} ${tests === 1 ? "test" : "tests"} ${inFiles}`;
179
- }
180
- function planOptionText({ path, value, from }) {
181
- return `${path} ${String(value)} (${fromText(path, from)})`;
182
- }
183
- function fromText(path, from) {
184
- switch (from) {
185
- case "flag":
186
- return RESOURCE_FLAGS.find(({ resource, option }) => optionKeyPath(resource, option) === path)?.flag ?? "a flag";
187
- case "file":
188
- return "config file";
189
- case "default":
190
- return "default";
191
- }
192
- }
20
+ } from "./chunk-YEPFSLQR.js";
193
21
 
194
22
  // src/shared/tests-summary.ts
195
23
  var SLOWEST_FILES = 3;
@@ -937,19 +765,6 @@ function breakdownText(row) {
937
765
  }
938
766
 
939
767
  export {
940
- dealFileLists,
941
- comparedPath,
942
- fileListMismatches,
943
- fileListMismatchText,
944
- RESOURCE_FLAG_HELP,
945
- RESOURCE_USAGE_FLAGS,
946
- resourceRunExamples,
947
- resourceFlagFields,
948
- resourceFlagProblems,
949
- resourceFlagValues,
950
- recordedPlan,
951
- testPlanLine,
952
- testPlanText,
953
768
  testsSummaryLines,
954
769
  testsChart,
955
770
  workerLaneNotes,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  commandTree
3
- } from "./chunk-VL7WFTVQ.js";
3
+ } from "./chunk-4WAMTUWZ.js";
4
4
 
5
5
  // src/command-tree.ts
6
6
  var stormCommands = commandTree({ id: "storm" });
@@ -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,