@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
@@ -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-HWIQ2S7K.js";
7
+ import "./chunk-EEENLQHE.js";
8
+ import "./chunk-72ZFEMAW.js";
9
+ import "./chunk-D27KILIA.js";
10
+ import "./chunk-2RNDPDTJ.js";
11
11
  import {
12
12
  RUNS_SUBPATH,
13
13
  liveRunDirectoryGateway,
14
14
  unavailableRunDirectoryGateway
15
- } from "./chunk-P357TZAY.js";
15
+ } from "./chunk-4O5C2XGJ.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-YEPFSLQR.js";
24
24
  import {
25
25
  RUNNER_SNAPSHOTS_SUBPATH,
26
26
  configResolver,
@@ -31,17 +31,18 @@ import {
31
31
  liveFileListsFileGateway,
32
32
  liveGitHubActionsTokenGateway,
33
33
  liveRunnerSandboxGateway,
34
- liveRunnerSnapshotCacheGateway,
34
+ liveRunnerSnapshotIndexGateway,
35
35
  liveRunnerTerminal,
36
+ liveVercelOidcTokenGateway,
36
37
  localUserName,
37
38
  systemClock,
38
39
  systemTimer,
39
- unavailableRunnerSnapshotCacheGateway
40
- } from "./chunk-DC2CDHNK.js";
41
- import "./chunk-AWBSONHB.js";
40
+ unavailableRunnerSnapshotIndexGateway
41
+ } from "./chunk-RNAS7JHE.js";
42
+ import "./chunk-XBDRVFEV.js";
42
43
  import {
43
44
  resolveColorDepth
44
- } from "./chunk-VL7WFTVQ.js";
45
+ } from "./chunk-4WAMTUWZ.js";
45
46
 
46
47
  // src/local-services.ts
47
48
  import { parse } from "node:path";
@@ -75,11 +76,12 @@ function liveContext(options) {
75
76
  return {
76
77
  credentials: liveCredentialGateway(),
77
78
  githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 1e4 }),
79
+ vercelOidcTokens: liveVercelOidcTokenGateway({ env: options.env }),
78
80
  commands: liveCommandGateway(),
79
81
  config: liveConfigGateway(),
80
82
  fileListsFiles: liveFileListsFileGateway(),
81
83
  checkout: liveCheckoutGateway(),
82
- runnerSnapshots: snapshots.ok ? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
84
+ runnerSnapshots: snapshots.ok ? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
83
85
  runnerSandboxes: liveRunnerSandboxGateway(),
84
86
  runnerTerminal: liveRunnerTerminal({
85
87
  env: options.env,
@@ -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
  /**
@@ -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 }),
@@ -0,0 +1,123 @@
1
+ import { type ExecutionContext } from "@vercel/clinkr";
2
+ import type { StormApp } from "../../context.ts";
3
+ import type { CredentialSourceChoice } from "../../credential/index.ts";
4
+ import type { ResourceLifecycles } from "../../core/index.ts";
5
+ import type { RunPlan, VercelSandboxPlannedRunner } from "../../planning/run-plan.ts";
6
+ import type { TestPlanFacts } from "../../run-directory/index.ts";
7
+ import { type CheckedVercelSandboxOptions } from "../../runner/index.ts";
8
+ import type { RunCommandRequest } from "./run-flags.ts";
9
+ /**
10
+ * Resolved runner once the run's resources' `beforeRun` let it go on: on the launch machine, with the credential source
11
+ * it chose when a resource needs the Vercel credential; or in a Vercel Sandbox, whose one mint the resources share.
12
+ */
13
+ export type ResolvedRunRunner = {
14
+ readonly kind: "launch-machine";
15
+ readonly credential: CredentialSourceChoice | undefined;
16
+ } | VercelSandboxPlannedRunner;
17
+ /**
18
+ * Calls each resource's `beforeRun` in registry order, with its options and their sources, then chooses the credential
19
+ * source, refusing in order: a resource's `beforeRun` refusal (`resource_refused_before_run`), with the config file
20
+ * beside it, which stops the resources after it from being asked; a `--credential` no used resource needs
21
+ * (`credential_unused`); on the launch machine, a used resource that needs a runner sandbox
22
+ * (`resource_needs_runner_sandbox`, naming every such resource by its key; a skipped resource never refuses); and on
23
+ * the launch machine where a used resource needs the Vercel credential, the credential source (`missing_target` for
24
+ * the mint). Each refusal ends the command before the run starts, so it leaves no run directory.
25
+ */
26
+ export declare function resourcesBeforeRun(lifecycles: ResourceLifecycles, plan: RunPlan, request: Pick<RunCommandRequest, "credential">): Promise<{
27
+ readonly ok: false;
28
+ readonly refusal: import("@vercel/clinkr").CommandError<"missing_target">;
29
+ } | {
30
+ readonly ok: false;
31
+ readonly refusal: import("@vercel/clinkr").CommandError<"credential_unused">;
32
+ } | {
33
+ readonly ok: false;
34
+ readonly refusal: import("@vercel/clinkr").CommandError<"resource_needs_runner_sandbox">;
35
+ } | {
36
+ readonly ok: false;
37
+ readonly refusal: import("@vercel/clinkr").CommandError<"resource_refused_before_run">;
38
+ } | {
39
+ readonly ok: true;
40
+ readonly runner: ResolvedRunRunner;
41
+ readonly used: {
42
+ readonly ok: true;
43
+ readonly requests: import("../../core/resource.ts").ResourceRequests;
44
+ readonly skipped: readonly import("../../core/resource.ts").ResourceSkip[];
45
+ readonly secrets: readonly string[];
46
+ readonly needsVercelCredential: boolean;
47
+ readonly needRunnerSandbox: readonly string[];
48
+ readonly hiddenVariables: readonly string[];
49
+ };
50
+ }>;
51
+ /** What the resources' `beforeRun` answered, once they let the run go on. */
52
+ export type BeforeRun = Extract<Awaited<ReturnType<typeof resourcesBeforeRun>>, {
53
+ readonly ok: true;
54
+ }>;
55
+ /**
56
+ * Keep time of each runner sandbox, in milliseconds:
57
+ * - `"single"`: `--keep-sandbox`, else `runner.keepSandbox`, else 0.
58
+ * - `"sandboxes"`: `--keep-sandbox`, else 0 (multi-sandbox runs intentionally ignore `runner.keepSandbox`).
59
+ */
60
+ export declare function resolveKeepMs(flag: string | undefined, options: CheckedVercelSandboxOptions, mode: "single" | "sandboxes"): number;
61
+ /**
62
+ * Runs `prepareRunner` for a Vercel Sandbox runner and redacts any preparation refusal with `secrets`. Shared by
63
+ * `--plan-only`, single-run execution, and multi-sandbox execution.
64
+ */
65
+ export declare function prepareRunnerForRun(app: StormApp, runner: VercelSandboxPlannedRunner, input: {
66
+ readonly configFile: string | null;
67
+ readonly resources: Readonly<Record<string, {
68
+ readonly definition: string;
69
+ readonly options: unknown;
70
+ }>>;
71
+ readonly sandboxes: number;
72
+ readonly secrets: readonly string[];
73
+ }): Promise<{
74
+ readonly ok: true;
75
+ readonly prepared: import("../../runner/prepare.ts").PreparedRunner;
76
+ readonly refusal?: never;
77
+ } | {
78
+ readonly prepared?: never;
79
+ readonly ok: false;
80
+ readonly refusal: import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">;
81
+ }>;
82
+ /** Shared pre-start sequence: `resourcesBeforeRun`, signal cancel check, and test-plan progress line. */
83
+ export declare function beforeRunStarts({ ui, signal }: ExecutionContext<StormApp>, lifecycles: ResourceLifecycles, planned: RunPlan, request: Pick<RunCommandRequest, "credential">, plan: TestPlanFacts | undefined): Promise<{
84
+ readonly ok: false;
85
+ readonly refusal: import("@vercel/clinkr").CommandError<"missing_target">;
86
+ } | {
87
+ readonly ok: false;
88
+ readonly refusal: import("@vercel/clinkr").CommandError<"credential_unused">;
89
+ } | {
90
+ readonly ok: false;
91
+ readonly refusal: import("@vercel/clinkr").CommandError<"resource_needs_runner_sandbox">;
92
+ } | {
93
+ readonly ok: false;
94
+ readonly refusal: import("@vercel/clinkr").CommandError<"resource_refused_before_run">;
95
+ } | {
96
+ readonly ok: true;
97
+ readonly runner: ResolvedRunRunner;
98
+ readonly used: {
99
+ readonly ok: true;
100
+ readonly requests: import("../../core/resource.ts").ResourceRequests;
101
+ readonly skipped: readonly import("../../core/resource.ts").ResourceSkip[];
102
+ readonly secrets: readonly string[];
103
+ readonly needsVercelCredential: boolean;
104
+ readonly needRunnerSandbox: readonly string[];
105
+ readonly hiddenVariables: readonly string[];
106
+ };
107
+ } | {
108
+ readonly ok: false;
109
+ readonly refusal: import("@vercel/clinkr").ClinkrError<"canceled">;
110
+ }>;
111
+ /** Builds a `RunRunnerRequest` from a prepared Vercel Sandbox runner. */
112
+ export declare function runnerRequestFor(app: StormApp, runner: VercelSandboxPlannedRunner, used: BeforeRun["used"], options: {
113
+ readonly configFile: string | null;
114
+ readonly sandboxes: number;
115
+ readonly keepMs: number;
116
+ }): Promise<{
117
+ readonly prepared?: never;
118
+ readonly ok: false;
119
+ readonly refusal: import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">;
120
+ } | {
121
+ readonly ok: true;
122
+ readonly runner: import("../../runner/session.ts").RunnerSessionRequest;
123
+ }>;
@@ -0,0 +1,105 @@
1
+ // Pre-start resource checks and Vercel Sandbox runner preparation shared by `--plan-only`, single runs, and runs
2
+ // across runner sandboxes: calling each resource's `beforeRun`, settling the launch-machine credential source,
3
+ // resolving runner keep time, and running redacted `prepareRunner`.
4
+ import { refused } from "@vercel/clinkr";
5
+ import { settleCredential } from "../../config/index.js";
6
+ import { redactor, redactStrings } from "../../planning/redaction.js";
7
+ import { testPlanLine } from "../../planning/test-plan.js";
8
+ import { prepareRunner } from "../../runner/index.js";
9
+ import { parseKeepTime } from "../../time/index.js";
10
+ import { canceledBeforeStart, runErrors } from "./outcomes.js";
11
+ import { resourceRefusedBeforeRun } from "./resource-refusals.js";
12
+ import { prepareRefusal, vcpuResources } from "./runner-refusals.js";
13
+ /**
14
+ * Calls each resource's `beforeRun` in registry order, with its options and their sources, then chooses the credential
15
+ * source, refusing in order: a resource's `beforeRun` refusal (`resource_refused_before_run`), with the config file
16
+ * beside it, which stops the resources after it from being asked; a `--credential` no used resource needs
17
+ * (`credential_unused`); on the launch machine, a used resource that needs a runner sandbox
18
+ * (`resource_needs_runner_sandbox`, naming every such resource by its key; a skipped resource never refuses); and on
19
+ * the launch machine where a used resource needs the Vercel credential, the credential source (`missing_target` for
20
+ * the mint). Each refusal ends the command before the run starts, so it leaves no run directory.
21
+ */
22
+ export async function resourcesBeforeRun(lifecycles, plan, request) {
23
+ const { configFile, resources, settings } = plan;
24
+ const used = await lifecycles.beforeRun(resources);
25
+ if (!used.ok)
26
+ return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
27
+ if (plan.runner.kind === "launch-machine" && request.credential !== undefined && !used.needsVercelCredential)
28
+ return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
29
+ if (plan.runner.kind === "launch-machine" && used.needRunnerSandbox.length > 0)
30
+ return refused(runErrors.resourceNeedsRunnerSandbox({ resources: [...used.needRunnerSandbox], configFile }));
31
+ let runner;
32
+ if (plan.runner.kind === "vercel-sandbox")
33
+ runner = plan.runner;
34
+ else if (used.needsVercelCredential) {
35
+ const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
36
+ if (!chosen.ok)
37
+ return chosen;
38
+ runner = { kind: "launch-machine", credential: chosen.credential };
39
+ }
40
+ else
41
+ runner = { kind: "launch-machine", credential: undefined };
42
+ return { ok: true, runner, used };
43
+ }
44
+ /**
45
+ * Keep time of each runner sandbox, in milliseconds:
46
+ * - `"single"`: `--keep-sandbox`, else `runner.keepSandbox`, else 0.
47
+ * - `"sandboxes"`: `--keep-sandbox`, else 0 (multi-sandbox runs intentionally ignore `runner.keepSandbox`).
48
+ */
49
+ export function resolveKeepMs(flag, options, mode) {
50
+ const fromFlag = flag === undefined ? undefined : parseKeepTime(flag);
51
+ const minutes = mode === "single" ? (fromFlag ?? options.keepSandboxMinutes ?? 0) : (fromFlag ?? 0);
52
+ return minutes * 60_000;
53
+ }
54
+ /**
55
+ * Runs `prepareRunner` for a Vercel Sandbox runner and redacts any preparation refusal with `secrets`. Shared by
56
+ * `--plan-only`, single-run execution, and multi-sandbox execution.
57
+ */
58
+ export async function prepareRunnerForRun(app, runner, input) {
59
+ const prepared = await prepareRunner(app.context, {
60
+ cwd: app.cwd,
61
+ options: runner.options,
62
+ vcpuRun: { resources: vcpuResources(input.resources), sandboxes: input.sandboxes },
63
+ });
64
+ if (prepared.kind === "ok")
65
+ return { ok: true, prepared: prepared.prepared };
66
+ const refusal = prepareRefusal(prepared, input.configFile);
67
+ return {
68
+ ok: false,
69
+ refusal: input.secrets.length === 0 ? refusal : redactStrings(refusal, redactor(input.secrets)),
70
+ };
71
+ }
72
+ /** Shared pre-start sequence: `resourcesBeforeRun`, signal cancel check, and test-plan progress line. */
73
+ export async function beforeRunStarts({ ui, signal }, lifecycles, planned, request, plan) {
74
+ const before = await resourcesBeforeRun(lifecycles, planned, request);
75
+ if (!before.ok)
76
+ return before;
77
+ if (signal.aborted)
78
+ return { ok: false, refusal: canceledBeforeStart() };
79
+ if (plan !== undefined)
80
+ await ui.progress?.(testPlanLine(plan));
81
+ return before;
82
+ }
83
+ /** Builds a `RunRunnerRequest` from a prepared Vercel Sandbox runner. */
84
+ export async function runnerRequestFor(app, runner, used, options) {
85
+ const secrets = [...used.secrets, ...runner.secrets];
86
+ const prepared = await prepareRunnerForRun(app, runner, {
87
+ configFile: options.configFile,
88
+ resources: used.requests,
89
+ sandboxes: options.sandboxes,
90
+ secrets,
91
+ });
92
+ if (!prepared.ok)
93
+ return prepared;
94
+ const session = {
95
+ prepared: prepared.prepared,
96
+ target: runner.target,
97
+ user: app.user,
98
+ credentials: runner.credentials,
99
+ ...(Object.keys(runner.unsafeSecretEnvVars).length === 0
100
+ ? {}
101
+ : { unsafeSecretEnvVars: runner.unsafeSecretEnvVars }),
102
+ keepMs: options.keepMs,
103
+ };
104
+ return { ok: true, runner: session };
105
+ }
@@ -5,6 +5,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
5
5
  credential: z.ZodOptional<z.ZodEnum<{
6
6
  "github-actions": "github-actions";
7
7
  mint: "mint";
8
+ "vercel-oidc": "vercel-oidc";
8
9
  }>>;
9
10
  showOutput: z.ZodDefault<z.ZodBoolean>;
10
11
  keepSandbox: z.ZodOptional<z.ZodString>;
@@ -177,7 +178,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
177
178
  sandbox: z.ZodNumber;
178
179
  name: z.ZodString;
179
180
  stopsAt: z.ZodString;
180
- url: z.ZodString;
181
+ url: z.ZodNullable<z.ZodString>;
181
182
  }, z.core.$strip>>;
182
183
  notKept: z.ZodArray<z.ZodObject<{
183
184
  sandbox: z.ZodNumber;
@@ -399,6 +400,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
399
400
  minLength: number;
400
401
  configFile: string | null;
401
402
  }]>;
403
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
404
+ cause: "invalid-token" | "missing-token";
405
+ detail: string;
406
+ fix: string;
407
+ runner: boolean;
408
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
409
+ }]>;
402
410
  }, {
403
411
  readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
404
412
  conflicts: {
@@ -550,6 +558,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
550
558
  minLength: number;
551
559
  configFile: string | null;
552
560
  }]>;
561
+ readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
562
+ cause: "invalid-token" | "missing-token";
563
+ detail: string;
564
+ fix: string;
565
+ runner: boolean;
566
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
567
+ }]>;
553
568
  }>, import("@vercel/clinkr").OutcomeOf<import("@vercel/clinkr").Outcomes<{
554
569
  ran: z.ZodObject<{
555
570
  version: z.ZodString;
@@ -712,7 +727,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
712
727
  sandbox: z.ZodNumber;
713
728
  name: z.ZodString;
714
729
  stopsAt: z.ZodString;
715
- url: z.ZodString;
730
+ url: z.ZodNullable<z.ZodString>;
716
731
  }, z.core.$strip>>;
717
732
  notKept: z.ZodArray<z.ZodObject<{
718
733
  sandbox: z.ZodNumber;
@@ -934,6 +949,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
934
949
  minLength: number;
935
950
  configFile: string | null;
936
951
  }]>;
952
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
953
+ cause: "invalid-token" | "missing-token";
954
+ detail: string;
955
+ fix: string;
956
+ runner: boolean;
957
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
958
+ }]>;
937
959
  }, {
938
960
  readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
939
961
  conflicts: {
@@ -1085,5 +1107,12 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
1085
1107
  minLength: number;
1086
1108
  configFile: string | null;
1087
1109
  }]>;
1110
+ readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
1111
+ cause: "invalid-token" | "missing-token";
1112
+ detail: string;
1113
+ fix: string;
1114
+ runner: boolean;
1115
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
1116
+ }]>;
1088
1117
  }>>, import("../../context.ts").StormApp, false>;
1089
1118
  export default _default;
@@ -1,93 +1,49 @@
1
- import {
2
- planAskedSandboxesRun,
3
- runHelp,
4
- runPlanned
5
- } from "../../chunks/chunk-7EENF73W.js";
6
1
  import {
7
2
  RUN_CLI_OPTIONS,
8
3
  RUN_REQUEST_FIELDS,
9
- outcomes,
10
- planCommandRun,
4
+ executePlannedRun,
5
+ placeholderProblems,
6
+ planRun,
11
7
  runFlagProblems,
8
+ runHelp,
12
9
  sandboxesFlagProblems
13
- } from "../../chunks/chunk-Z5PBVG3Y.js";
10
+ } from "../../chunks/chunk-JN3YY6ZH.js";
11
+ import "../../chunks/chunk-RWIXDDCK.js";
12
+ import "../../chunks/chunk-MR77L2GK.js";
14
13
  import "../../chunks/chunk-I5GZLOLQ.js";
15
- import "../../chunks/chunk-FCQUJDA4.js";
16
- import "../../chunks/chunk-DWEAHX4T.js";
17
- import "../../chunks/chunk-R7XVBZOY.js";
18
- import "../../chunks/chunk-CN4EFA5J.js";
19
- import "../../chunks/chunk-HVNK3I45.js";
20
- import "../../chunks/chunk-3L52KNQA.js";
21
- import "../../chunks/chunk-VUPZH7J2.js";
22
- import "../../chunks/chunk-ZG3WQ4UF.js";
23
- import "../../chunks/chunk-5CCP36QQ.js";
24
- import "../../chunks/chunk-2MAD5NKK.js";
25
- import "../../chunks/chunk-P357TZAY.js";
26
- import "../../chunks/chunk-G3PHMXH5.js";
14
+ import {
15
+ outcomes
16
+ } from "../../chunks/chunk-2VP4GRJM.js";
17
+ import "../../chunks/chunk-FNBB6V4R.js";
18
+ import "../../chunks/chunk-M7EKRGVD.js";
19
+ import "../../chunks/chunk-F4MOYHRY.js";
20
+ import "../../chunks/chunk-HWIQ2S7K.js";
21
+ import "../../chunks/chunk-EEENLQHE.js";
22
+ import "../../chunks/chunk-72ZFEMAW.js";
23
+ import "../../chunks/chunk-BCBKYOHW.js";
24
+ import "../../chunks/chunk-D27KILIA.js";
25
+ import "../../chunks/chunk-2RNDPDTJ.js";
26
+ import "../../chunks/chunk-CKGZA25H.js";
27
+ import "../../chunks/chunk-GRT3UIBV.js";
28
+ import "../../chunks/chunk-4O5C2XGJ.js";
27
29
  import "../../chunks/chunk-F6N34UWB.js";
28
- import "../../chunks/chunk-FOZWA52V.js";
30
+ import "../../chunks/chunk-YEPFSLQR.js";
29
31
  import {
30
32
  effectiveConfig
31
- } from "../../chunks/chunk-DC2CDHNK.js";
32
- import {
33
- NOT_COUNTED
34
- } from "../../chunks/chunk-AWBSONHB.js";
33
+ } from "../../chunks/chunk-RNAS7JHE.js";
34
+ import "../../chunks/chunk-XBDRVFEV.js";
35
35
  import {
36
36
  stormCommands
37
- } from "../../chunks/chunk-5VXBKPW6.js";
38
- import "../../chunks/chunk-VL7WFTVQ.js";
37
+ } from "../../chunks/chunk-WV3DP6NR.js";
38
+ import "../../chunks/chunk-4WAMTUWZ.js";
39
39
 
40
40
  // src/commands/exec/command.ts
41
41
  import { z } from "zod";
42
42
 
43
- // src/planning/sandbox-placeholders.ts
44
- var PLACEHOLDER = /(?<!\$)\{(sandbox\+1|sandbox(?:es)?)\}/g;
45
- function placeholdersOf(argv) {
46
- return new Set(
47
- argv.flatMap((argument) => [...argument.matchAll(PLACEHOLDER)].map(([, name]) => name))
48
- );
49
- }
50
- function commandForSandbox(argv, sandbox, count) {
51
- return argv.map(
52
- (argument) => argument.replace(
53
- PLACEHOLDER,
54
- (_match, name) => String(name === "sandbox" ? sandbox : name === "sandbox+1" ? sandbox + 1 : count)
55
- )
56
- );
57
- }
58
- function commandsForSandboxes(argv, count) {
59
- return Array.from({ length: count }, (_, index) => commandForSandbox(argv, index, count));
60
- }
61
- function placeholderListText(names) {
62
- const words = names.map((name) => `{${name}}`);
63
- if (words.length <= 2) return words.join(" and ");
64
- return `${words.slice(0, -1).join(", ")}, and ${words.at(-1) ?? ""}`;
65
- }
66
- function placeholderProblems(request) {
67
- const { sandboxes, command } = request;
68
- const held = placeholdersOf(command);
69
- if (sandboxes === void 0)
70
- return held.size === 0 ? [] : [
71
- {
72
- field: "command",
73
- message: `The command holds ${placeholderListText([...held])}, which only --sandboxes replaces. Add --sandboxes <n>, or write $ before the brace to keep it as it is.`
74
- }
75
- ];
76
- return [
77
- ...Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }],
78
- ...held.has("sandbox") || held.has("sandbox+1") ? [] : [
79
- {
80
- field: "command",
81
- message: "--sandboxes needs {sandbox} or {sandbox+1} in an argument of the command, such as -g {sandbox+1}/{sandboxes}: without it, every runner sandbox runs the same command."
82
- }
83
- ]
84
- ];
85
- }
86
-
87
43
  // src/commands/exec/exec-words.ts
88
44
  var EXEC_HELP = {
89
45
  usage: "[--sandboxes <N>] -- <command...>",
90
- args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
46
+ args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the Vercel Sandbox runner's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
91
47
  verbose: "which asks the command to print what each test does as it happens, for passing tests too",
92
48
  examples: [
93
49
  {
@@ -146,31 +102,11 @@ var command_default = stormCommands.define({
146
102
  const { app, signal } = context;
147
103
  const file = await app.config.loadFile();
148
104
  if (!file.ok) return file.refusal;
149
- const { sandboxes, command } = request;
105
+ const { command } = request;
150
106
  const planRequest = { ...request, settingsFile: effectiveConfig(file, null), suite: null };
151
- const planCommand = async () => ({
152
- ok: true,
153
- argv: command,
154
- testPlan: NOT_COUNTED.testPlan
155
- });
156
- const planSandboxes = (count) => async ({ max }) => ({
157
- ok: true,
158
- argv: command,
159
- testPlan: NOT_COUNTED.testPlan,
160
- sandboxes: {
161
- count: { count, from: "flag", max },
162
- sandboxes: commandsForSandboxes(command, count).map((argv) => ({ argv, files: null }))
163
- }
164
- });
165
- const plan = sandboxes === void 0 ? await planCommandRun(app, planRequest, planCommand, signal) : await planAskedSandboxesRun(
166
- app,
167
- planRequest,
168
- { count: sandboxes, flag: "--sandboxes" },
169
- planSandboxes(sandboxes),
170
- signal
171
- );
107
+ const plan = await planRun(app, planRequest, { kind: "exec", command }, signal);
172
108
  if (!plan.ok) return plan.refusal;
173
- return await runPlanned(
109
+ return await executePlannedRun(
174
110
  context,
175
111
  request,
176
112
  {
@@ -1,9 +1,9 @@
1
1
  import type { StormApp } from "../../context.ts";
2
2
  import { type Driver, type RunTestPlan } from "../../sdk/extension/index.ts";
3
3
  import type { DriverRefusals } from "../../planning/driver-refusals.ts";
4
- import type { PlannedWhere } from "../../planning/run-plan.ts";
5
- import { canceledBeforeStart, type PlannedCommand } from "./plan-run.ts";
6
- import { checkoutFailedRefusal } from "./run-command.ts";
4
+ import type { PlannedRunner } from "../../planning/run-plan.ts";
5
+ import { canceledBeforeStart } from "./outcomes.ts";
6
+ import { checkoutFailedRefusal } from "./runner-refusals.ts";
7
7
  /**
8
8
  * Whether a driver run counts before it starts: nothing when neither `testPlan` nor `--count-tests` asks; otherwise
9
9
  * each test when `--count-tests` was passed or the driver always counts each test (`driver.countsFilesOnly !== true`).
@@ -38,7 +38,12 @@ export type DriverPlanRefusal = ReturnType<typeof canceledBeforeStart> | ReturnT
38
38
  * the driver's argv (`launch`) over the binary the run starts. `errors` are the builders of the driver's two errors
39
39
  * (`driverRefusals`), the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
40
40
  */
41
- export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], count: DriverCount, where: PlannedWhere, signal: AbortSignal): Promise<PlannedCommand<RunTestPlan> | {
41
+ export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], count: DriverCount, runner: PlannedRunner, signal: AbortSignal): Promise<{
42
+ readonly ok: true;
43
+ readonly argv: readonly string[];
44
+ readonly testPlan: RunTestPlan;
45
+ readonly testFiles?: readonly string[];
46
+ } | {
42
47
  readonly ok: false;
43
48
  readonly refusal: DriverPlanRefusal;
44
49
  }>;
@@ -1,11 +1,11 @@
1
- // A program driver's part of planning a run (`PlanCommand`, `plan-run.ts`): finding the program, asking the driver's
2
- // plan step for the test plan when the run counts, and the refusals that end the run there. Every driver of a program plans through it, so
3
- // no command holds planning or refusal logic of its own.
1
+ // A program driver's part of planning a run (called from `plan-run.ts`): finding the program, asking the driver's
2
+ // plan step for the test plan when the run counts, and the refusals that end the run there. Every driver of a program
3
+ // plans through it, so no command holds planning or refusal logic of its own.
4
4
  import { refused } from "@vercel/clinkr";
5
5
  import { NOT_COUNTED } from "../../sdk/extension/index.js";
6
- import { canceledBeforeStart } from "./plan-run.js";
6
+ import { canceledBeforeStart } from "./outcomes.js";
7
7
  import { findRunBin } from "./run-bin.js";
8
- import { checkoutFailedRefusal } from "./run-command.js";
8
+ import { checkoutFailedRefusal } from "./runner-refusals.js";
9
9
  /**
10
10
  * Whether a driver run counts before it starts: nothing when neither `testPlan` nor `--count-tests` asks; otherwise
11
11
  * each test when `--count-tests` was passed or the driver always counts each test (`driver.countsFilesOnly !== true`).
@@ -35,11 +35,11 @@ export function driverCount(driver, testPlan, countTests) {
35
35
  * the driver's argv (`launch`) over the binary the run starts. `errors` are the builders of the driver's two errors
36
36
  * (`driverRefusals`), the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
37
37
  */
38
- export async function planDriverCommand(app, driver, errors, args, count, where, signal) {
38
+ export async function planDriverCommand(app, driver, errors, args, count, runner, signal) {
39
39
  const { bin: name } = driver.program;
40
- if (count === undefined && where.kind === "runner")
40
+ if (count === undefined && runner.kind === "vercel-sandbox")
41
41
  return { ok: true, argv: driver.launch(name, args), testPlan: NOT_COUNTED.testPlan };
42
- const bin = await findRunBin(app, name, where);
42
+ const bin = await findRunBin(app, name, runner);
43
43
  if (bin.kind === "checkout-failed")
44
44
  return refused(checkoutFailedRefusal(bin.failure));
45
45
  const planned = { args, cwd: bin.cwd };
@@ -6,7 +6,7 @@
6
6
  /** `exec`'s part of its leaf help: its usage after the run flags, its arguments, `--verbose`'s ending and its examples. */
7
7
  export const EXEC_HELP = {
8
8
  usage: "[--sandboxes <N>] -- <command...>",
9
- args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
9
+ args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the Vercel Sandbox runner's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
10
10
  verbose: "which asks the command to print what each test does as it happens, for passing tests too",
11
11
  examples: [
12
12
  {