@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,4 +1,4 @@
1
- import type { CredentialFailure, CredentialOrigin, CredentialSource, MintFailed, TokenRequestFailure } from "../../sdk/extension/index.ts";
1
+ import type { CredentialFailure, CredentialOrigin, CredentialSource, MintFailed, TokenRequestFailure, VercelOidcTokenFailure } from "../../sdk/extension/index.ts";
2
2
  import type { TestserverPoolEvent } from "./events.ts";
3
3
  import { type BuildMatch, type BuildResolution, type PoolStoreFailure, type PrBuildRefusal } from "./pool/index.ts";
4
4
  import { type TestserverPoolOptions } from "./options/index.ts";
@@ -84,6 +84,13 @@ export type TestserverRefusal = {
84
84
  readonly ttlMinutes: number;
85
85
  /** The creates that failed before the token request failed. */
86
86
  readonly failedCreates: readonly FailedCreate[];
87
+ } | {
88
+ readonly kind: "vercel-oidc-token-failed";
89
+ readonly failure: VercelOidcTokenFailure;
90
+ /** The TTL each create asked for, which any Testserver sandbox a failed create left lives. */
91
+ readonly ttlMinutes: number;
92
+ /** The creates that failed before reading `VERCEL_OIDC_TOKEN` failed. */
93
+ readonly failedCreates: readonly FailedCreate[];
87
94
  } | {
88
95
  readonly kind: "credential-rejected";
89
96
  readonly failure: RejectedCreate;
@@ -41,9 +41,14 @@ export function createWith(options, credential) {
41
41
  * failed: the run's own `mint_failed`, or `token-request-failed`, which reports the creates that failed before it.
42
42
  */
43
43
  function credentialFailed(failure, ttlMinutes, failedCreates) {
44
- return failure.source === "mint"
45
- ? { kind: "mint-failed", failed: failure }
46
- : { kind: "token-request-failed", failure: failure.failure, ttlMinutes, failedCreates };
44
+ switch (failure.source) {
45
+ case "mint":
46
+ return { kind: "mint-failed", failed: failure };
47
+ case "github-actions":
48
+ return { kind: "token-request-failed", failure: failure.failure, ttlMinutes, failedCreates };
49
+ case "vercel-oidc":
50
+ return { kind: "vercel-oidc-token-failed", failure: failure.failure, ttlMinutes, failedCreates };
51
+ }
47
52
  }
48
53
  /**
49
54
  * What a canceled run says of the Testserver pool once it provisioned `facts`: what it created, pooled or not, with the
@@ -1,4 +1,4 @@
1
- import { type CredentialOrigin, type Refusal, type TokenRequestFailure } from "../../sdk/extension/index.ts";
1
+ import { type CredentialOrigin, type Refusal, type TokenRequestFailure, type VercelOidcTokenFailure } from "../../sdk/extension/index.ts";
2
2
  import type { CreateFailureFacts, UnpooledFacts } from "./provision.ts";
3
3
  /** Where the pool lives, or would, and what the OS said, or why there is no place for it. */
4
4
  export interface PoolPathFailure {
@@ -26,6 +26,11 @@ export interface TokenRequestFailedData {
26
26
  * before the request did, and says when one may have left a Testserver sandbox.
27
27
  */
28
28
  export declare function tokenRequestFailed(failure: TokenRequestFailure, data: TokenRequestFailedData): Refusal;
29
+ /**
30
+ * With --credential vercel-oidc, reading `VERCEL_OIDC_TOKEN` failed (`failure`), and the run had no usable Testserver
31
+ * sandbox, from the pool or created, so the command didn't run.
32
+ */
33
+ export declare function vercelOidcTokenFailed(failure: VercelOidcTokenFailure, data: TokenRequestFailedData): Refusal;
29
34
  /** `credential_rejected`'s data beside where the credential came from. */
30
35
  export interface CredentialRejectedData {
31
36
  readonly status: number;
@@ -5,7 +5,7 @@
5
5
  // resolved (`prBuildRefusal`, `pr-build-facts.ts`), which storm ends the run with as `resource_refused`, with the
6
6
  // run's cleanup. A failed mint with no Testserver sandbox in hand isn't one of them: it ends the run as the run's own
7
7
  // `mint_failed`.
8
- import { optionKeyPath, tokenRequestFailureFacts, } from "../../sdk/extension/index.js";
8
+ import { optionKeyPath, tokenRequestFailureFacts, vercelOidcTokenFailureFacts, } from "../../sdk/extension/index.js";
9
9
  import { credentialOriginRows, rejectedCredentialFacts, rejectedCredentialText } from "./credential-facts.js";
10
10
  import { describeTtl } from "./options/index.js";
11
11
  import { createFailureText } from "./sandbox/index.js";
@@ -67,6 +67,21 @@ export function tokenRequestFailed(failure, data) {
67
67
  next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes)],
68
68
  };
69
69
  }
70
+ /**
71
+ * With --credential vercel-oidc, reading `VERCEL_OIDC_TOKEN` failed (`failure`), and the run had no usable Testserver
72
+ * sandbox, from the pool or created, so the command didn't run.
73
+ */
74
+ export function vercelOidcTokenFailed(failure, data) {
75
+ const facts = vercelOidcTokenFailureFacts(failure);
76
+ const { ttlMinutes, failedCreates, sandboxMayExist: mayExist } = data;
77
+ return {
78
+ refused: "vercel_oidc_token_failed",
79
+ data: { ...facts, ...data },
80
+ message: `Couldn't use VERCEL_OIDC_TOKEN: ${facts.detail}. The pool had no usable Testserver sandbox, so the command didn't run.`,
81
+ rows: failedCreateRows(failedCreates),
82
+ next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes)],
83
+ };
84
+ }
70
85
  /**
71
86
  * The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401
72
87
  * or a 403), so the command didn't run. It lists the other creates that failed and the created Testserver sandboxes
@@ -9,7 +9,7 @@ export type { TestserverPoolOptions } from "./options/index.ts";
9
9
  *
10
10
  * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
11
11
  * `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
12
- * reads `build` and `ttl`. A runner recipe's declared `vcpus` rule can scale from its options by resource key
12
+ * reads `build` and `ttl`. A Vercel Sandbox runner's declared `vcpus` rule can scale from its options by resource key
13
13
  * `"testserverPool"`, such as `option: "sandboxes"`.
14
14
  */
15
15
  export declare const testserverPool: import("../../sdk/extension/resource-factory.ts").ResourceFactory<import("../../sdk/extension/resource-definition.ts").ResourceDefinition<"testserverPool", {
@@ -13,7 +13,7 @@ import { testserverPoolDefinition } from "./definition.js";
13
13
  *
14
14
  * Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
15
15
  * `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
16
- * reads `build` and `ttl`. A runner recipe's declared `vcpus` rule can scale from its options by resource key
16
+ * reads `build` and `ttl`. A Vercel Sandbox runner's declared `vcpus` rule can scale from its options by resource key
17
17
  * `"testserverPool"`, such as `option: "sandboxes"`.
18
18
  */
19
19
  export const testserverPool = resourceFactory(testserverPoolDefinition);
@@ -33,7 +33,7 @@ export interface TestserverPoolResultFacts {
33
33
  /** When the credential source failed with some Testserver sandboxes in hand: how many more weren't created, which source failed, and why. */
34
34
  readonly uncreated: {
35
35
  readonly count: number;
36
- readonly source: "mint" | "github-actions";
36
+ readonly source: "mint" | "github-actions" | "vercel-oidc";
37
37
  readonly cause: string;
38
38
  readonly fix: string;
39
39
  } | null;
@@ -67,10 +67,15 @@ export function testserverPoolResultWarnings(facts) {
67
67
  reason: "mint_failed",
68
68
  message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't mint a credential: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
69
69
  }
70
- : {
71
- reason: "token_request_failed",
72
- message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't request a GitHub Actions OIDC token: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
73
- },
70
+ : facts.uncreated.source === "vercel-oidc"
71
+ ? {
72
+ reason: "vercel_oidc_token_failed",
73
+ message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't use VERCEL_OIDC_TOKEN: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
74
+ }
75
+ : {
76
+ reason: "token_request_failed",
77
+ message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't request a GitHub Actions OIDC token: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
78
+ },
74
79
  ]),
75
80
  ...(facts.notCreated === 0
76
81
  ? []
@@ -1,20 +1,5 @@
1
- import type { ArgumentIssue } from "@vercel/clinkr";
2
- import type { Driver } from "../sdk/extension/index.ts";
3
1
  import type { PlannedSandboxesRun } from "./run-plan.ts";
4
2
  import { type CallerFileList } from "./file-lists-file.ts";
5
- /** What `driverSandboxesProblems` reads of a driver command's request. */
6
- export interface DriverSandboxesRequest {
7
- readonly sandboxes?: number | undefined;
8
- readonly fileLists?: string | undefined;
9
- readonly args: readonly string[];
10
- }
11
- /**
12
- * What is wrong with a driver command's request for a run across runner sandboxes, as `validate` reports it: a number
13
- * of runner sandboxes that is not a whole number from 1, and any argument problem reported by
14
- * `driver.fileLists.validate`. Returns nothing without `--sandboxes` or `--file-lists`, or for a driver without
15
- * `fileLists`.
16
- */
17
- export declare function driverSandboxesProblems(driver: Driver, request: DriverSandboxesRequest): readonly ArgumentIssue[];
18
3
  /**
19
4
  * The number of runner sandboxes a driver run with storm's file lists asks for, and where it came from: `--sandboxes`
20
5
  * (`flag`), or `runner.sandboxes.default` (`default`), with the number the default gave for the run, which may exceed
@@ -1,27 +1,8 @@
1
1
  // Pure helpers that plan a driver command's run across runner sandboxes (`--sandboxes`, `--file-lists`, and
2
- // `runner.sandboxes.default`). Validates driver arguments through `driver.fileLists.validate`, deals listed test files
3
- // into file lists, and builds `PlannedSandboxesRun` values whose runner sandboxes each run the run's argv unchanged,
4
- // with their file list for `STORM_RUN`. Names no test runner.
2
+ // `runner.sandboxes.default`). Deals listed test files into file lists and builds `PlannedSandboxesRun` values whose
3
+ // runner sandboxes each run the run's argv unchanged, with their file list for `STORM_RUN`. Names no test runner.
5
4
  import { resolveCallerFileLists } from "./file-lists-file.js";
6
5
  import { dealFileLists } from "./file-lists.js";
7
- /**
8
- * What is wrong with a driver command's request for a run across runner sandboxes, as `validate` reports it: a number
9
- * of runner sandboxes that is not a whole number from 1, and any argument problem reported by
10
- * `driver.fileLists.validate`. Returns nothing without `--sandboxes` or `--file-lists`, or for a driver without
11
- * `fileLists`.
12
- */
13
- export function driverSandboxesProblems(driver, request) {
14
- const { sandboxes, fileLists: listsPath, args } = request;
15
- if ((sandboxes === undefined && listsPath === undefined) || driver.fileLists === undefined)
16
- return [];
17
- const checked = driver.fileLists.validate(args);
18
- return [
19
- ...(sandboxes === undefined || (Number.isInteger(sandboxes) && sandboxes >= 1)
20
- ? []
21
- : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }]),
22
- ...(checked.ok ? [] : [{ field: "args", message: checked.problem }]),
23
- ];
24
- }
25
6
  /**
26
7
  * Builds the planned runner sandboxes for a driver run that asks for `asked` runner sandboxes within `max`: deals
27
8
  * `testFiles` into round-robin file lists and assigns each list to a runner sandbox running `argv` unchanged. A default
@@ -1,9 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import type { ResolvedResourceRecord } from "../config/index.ts";
3
3
  import type { ResourceLifecycles } from "../core/index.ts";
4
- import { type PlanOption } from "../run-directory/index.ts";
5
- import { type RunTestPlan } from "../sdk/extension/index.ts";
6
- import type { PlannedSandboxesRun, PlannedWhere } from "./run-plan.ts";
4
+ import type { PlannedRunner, RunPlan } from "./run-plan.ts";
7
5
  /** What a `planned` outcome says of the planned run. No field carries the credential. */
8
6
  export declare const plannedSchema: z.ZodObject<{
9
7
  version: z.ZodString;
@@ -62,23 +60,14 @@ export declare const plannedSchema: z.ZodObject<{
62
60
  /** What a `planned` outcome holds. */
63
61
  export type PlannedFacts = z.input<typeof plannedSchema>;
64
62
  /** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
65
- export declare function plannedSecrets(lifecycles: ResourceLifecycles, where: PlannedWhere, resources: {
63
+ export declare function plannedSecrets(lifecycles: ResourceLifecycles, runner: PlannedRunner, resources: {
66
64
  readonly [key: string]: ResolvedResourceRecord;
67
65
  }): readonly string[];
68
66
  /** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
69
67
  export declare function buildPlannedFacts(input: {
70
68
  readonly version: string;
71
69
  readonly commit: string | null;
72
- readonly configFile: string | null;
73
- readonly argv: readonly string[];
74
- readonly where: PlannedWhere;
75
- readonly testPlan: RunTestPlan;
76
- readonly planOptions: readonly PlanOption[];
77
- readonly testFiles: readonly string[] | undefined;
78
- readonly sandboxes: PlannedSandboxesRun | undefined;
79
- readonly resources: {
80
- readonly [key: string]: ResolvedResourceRecord;
81
- };
70
+ readonly plan: RunPlan;
82
71
  readonly lifecycles: ResourceLifecycles;
83
72
  readonly vcpus: number | null;
84
73
  }): PlannedFacts;
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { planSchema } from "../run-directory/index.js";
6
6
  import { optionKeyPath } from "../sdk/extension/index.js";
7
7
  import { redactor, redactStrings } from "./redaction.js";
8
- import { recordedPlan } from "./test-plan.js";
8
+ import { plannedTestPlan } from "./test-plan.js";
9
9
  const plannedOptionSchema = z.object({
10
10
  /** The option's key path, `resources.<key>.<option>`. */
11
11
  path: z.string(),
@@ -35,30 +35,21 @@ export const plannedSchema = z.object({
35
35
  vcpus: z.number().nullable(),
36
36
  });
37
37
  /** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
38
- export function plannedSecrets(lifecycles, where, resources) {
39
- return [...lifecycles.secrets(resources), ...(where.kind === "runner" ? where.secrets : [])];
38
+ export function plannedSecrets(lifecycles, runner, resources) {
39
+ return [...lifecycles.secrets(resources), ...(runner.kind === "vercel-sandbox" ? runner.secrets : [])];
40
40
  }
41
41
  /** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
42
42
  export function buildPlannedFacts(input) {
43
- const { where, sandboxes, resources, lifecycles } = input;
44
- const policy = where.kind === "runner" ? where.recipe.sandboxes : undefined;
45
- const basePlan = recordedPlan(input.testPlan, input.planOptions);
46
- const plan = sandboxes !== undefined
47
- ? {
48
- ...(basePlan ?? { options: [] }),
49
- options: (basePlan?.options ?? []).map((option) => ({ ...option })),
50
- sandboxes: { ...sandboxes.count },
51
- }
52
- : basePlan === undefined
53
- ? null
54
- : { ...basePlan, options: basePlan.options.map((option) => ({ ...option })) };
43
+ const { plan: runPlan, lifecycles } = input;
44
+ const { runner, sandboxes, resources } = runPlan;
45
+ const policy = runner.kind === "vercel-sandbox" ? runner.options.sandboxes : undefined;
55
46
  const facts = {
56
47
  version: input.version,
57
48
  commit: input.commit,
58
- configFile: input.configFile,
59
- argv: [...input.argv],
60
- plan,
61
- testFiles: input.testFiles === undefined ? null : [...input.testFiles],
49
+ configFile: runPlan.configFile,
50
+ argv: [...runPlan.argv],
51
+ plan: plannedTestPlan(runPlan) ?? null,
52
+ testFiles: runPlan.testFiles === undefined ? null : [...runPlan.testFiles],
62
53
  runnerSandboxes: policy === undefined
63
54
  ? null
64
55
  : {
@@ -81,6 +72,6 @@ export function buildPlannedFacts(input) {
81
72
  }))),
82
73
  vcpus: input.vcpus,
83
74
  };
84
- const redact = redactor(plannedSecrets(lifecycles, where, resources));
75
+ const redact = redactor(plannedSecrets(lifecycles, runner, resources));
85
76
  return redactStrings(facts, redact);
86
77
  }
@@ -1,6 +1,6 @@
1
1
  // The run flags that fit only one runner kind: `--show-output`, `--keep-sandbox`, `--sandboxes`, and `--file-lists`
2
2
  // fit the Vercel Sandbox runner, and `--credential github-actions` fits the launch machine runner, since the Vercel
3
- // Sandbox runner needs the mint.
3
+ // Sandbox runner needs a Vercel credential (`mint` or `vercel-oidc`).
4
4
  // `planRun` runs this rule once after the effective runner is settled (`conflicting_options`).
5
5
  /**
6
6
  * Each flag in `flags` that doesn't fit `runner`: `--credential github-actions` for `vercel-sandbox`, and
@@ -35,7 +35,7 @@ export function runKindFlagName(flag) {
35
35
  export function runKindFlagMessage(flag) {
36
36
  switch (flag) {
37
37
  case "credential":
38
- return "The Vercel Sandbox runner needs a minted Vercel credential, so it can't use --credential github-actions.";
38
+ return "The Vercel Sandbox runner needs a Vercel credential (mint or vercel-oidc), so it can't use --credential github-actions.";
39
39
  case "showOutput":
40
40
  return "--show-output prints the Vercel Sandbox runner's step output, and this run uses the launch machine runner.";
41
41
  case "keepSandbox":
@@ -1,24 +1,33 @@
1
- import type { MintTarget } from "../credential/index.ts";
2
- import type { PlannedSandboxCount, RecordedSandboxStart } from "../run-directory/index.ts";
3
- import type { CheckedRecipe, UnsafeSecretEnvVarMap } from "../runner/index.ts";
4
- import type { SandboxCredential } from "../sdk/extension/index.ts";
1
+ import type { ResolvedResourceRecord, ResolvedSettings } from "../config/index.ts";
2
+ import type { CredentialSourceChoice, MintTarget } from "../credential/index.ts";
3
+ import type { PlanOption, PlannedSandboxCount, RecordedSandboxStart } from "../run-directory/index.ts";
4
+ import type { CheckedVercelSandboxOptions, UnsafeSecretEnvVarMap } from "../runner/index.ts";
5
+ import type { RunTestPlan, SandboxCredential } from "../sdk/extension/index.ts";
5
6
  /**
6
- * Where a planned run runs: with `--unsandboxed` on this machine; or by default in a runner sandbox, with the runner
7
- * recipe and the config file it comes from, the team and project the runner sandbox's credential is minted for, whose
8
- * one mint the resources share, the recipe's credentials with their values, and its unsafe secret environment variables.
7
+ * The settled runner of a planned run: on the launch machine (`launch-machine`), or in a Vercel Sandbox
8
+ * (`vercel-sandbox`), with the checked runner options, the config file it comes from, the credential source (`mint` or
9
+ * `vercel-oidc`), the control plane team and project when given, the runner's credentials with their values, and its
10
+ * unsafe secret environment variables.
9
11
  */
10
- export type PlannedWhere = {
11
- readonly kind: "unsandboxed";
12
+ export type PlannedRunner = {
13
+ readonly kind: "launch-machine";
12
14
  } | {
13
- readonly kind: "runner";
15
+ readonly kind: "vercel-sandbox";
14
16
  readonly configFile: string;
15
- readonly recipe: CheckedRecipe;
16
- readonly target: MintTarget;
17
+ readonly options: CheckedVercelSandboxOptions;
18
+ readonly credential: Extract<CredentialSourceChoice, {
19
+ readonly source: "mint" | "vercel-oidc";
20
+ }>;
21
+ readonly target: MintTarget | null;
17
22
  readonly credentials: readonly Required<SandboxCredential>[];
18
23
  readonly unsafeSecretEnvVars: UnsafeSecretEnvVarMap;
19
24
  /** Every secret value the runner declared (credentials and unsafe secret environment variables), for redaction. */
20
25
  readonly secrets: readonly string[];
21
26
  };
27
+ /** A Vercel Sandbox planned runner (`PlannedRunner` narrowed to `"vercel-sandbox"`). */
28
+ export type VercelSandboxPlannedRunner = Extract<PlannedRunner, {
29
+ readonly kind: "vercel-sandbox";
30
+ }>;
22
31
  /**
23
32
  * The planned runner sandboxes of a run across runner sandboxes: their number, with where it came from, and each runner
24
33
  * sandbox's argv and file list.
@@ -27,3 +36,27 @@ export interface PlannedSandboxesRun {
27
36
  readonly count: PlannedSandboxCount;
28
37
  readonly sandboxes: readonly RecordedSandboxStart[];
29
38
  }
39
+ interface RunPlanBase {
40
+ readonly configFile: string | null;
41
+ readonly settings: ResolvedSettings;
42
+ readonly argv: readonly string[];
43
+ readonly testPlan: RunTestPlan;
44
+ readonly testFiles: readonly string[] | undefined;
45
+ readonly resources: {
46
+ readonly [key: string]: ResolvedResourceRecord;
47
+ };
48
+ readonly planOptions: readonly PlanOption[];
49
+ }
50
+ /** A planned single run: on the launch machine or in one Vercel Sandbox. */
51
+ export interface SingleRunPlan extends RunPlanBase {
52
+ readonly runner: PlannedRunner;
53
+ readonly sandboxes: undefined;
54
+ }
55
+ /** A planned run across runner sandboxes: always uses the Vercel Sandbox runner. */
56
+ export interface SandboxesRunPlan extends RunPlanBase {
57
+ readonly runner: VercelSandboxPlannedRunner;
58
+ readonly sandboxes: PlannedSandboxesRun;
59
+ }
60
+ /** A planned run, as `planRun` settles it before any resource `beforeRun` or execution starts. */
61
+ export type RunPlan = SingleRunPlan | SandboxesRunPlan;
62
+ export {};
@@ -1,4 +1,5 @@
1
- // What a run's plan says before anything is minted, acquired or started: where the run runs, and its runner sandboxes
2
- // when it has them. `planRun` (`commands/exec/plan-run.ts`) plans a run over the gateways and answers these; the pure
3
- // planning modules here read them.
1
+ // What a run's plan says before anything is minted, acquired, or started: its peer runner (`PlannedRunner`), its
2
+ // runner sandboxes when it has them (`PlannedSandboxesRun`), and the settled run plan (`RunPlan`, discriminated so a
3
+ // run across runner sandboxes always carries a Vercel Sandbox runner). `planRun` (`commands/exec/plan-run.ts`) plans a
4
+ // run over the gateways and answers these; the pure planning modules here read them.
4
5
  export {};
@@ -27,7 +27,7 @@ export declare function listResolvedSuites(file: SettingsFile, driverByName: (na
27
27
  /** Formats a command argument list as a readable shell-like string for display. */
28
28
  export declare function formatCommandLine(command: readonly string[]): string;
29
29
  /**
30
- * A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner recipe
30
+ * A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
31
31
  * declares and `env` (the launcher environment) sets, since the config file's `args` can hold one. A launch machine
32
32
  * runner, or none, declares no secret.
33
33
  */
@@ -60,13 +60,13 @@ export function formatCommandLine(command) {
60
60
  return command.map(quoteArg).join(" ");
61
61
  }
62
62
  /**
63
- * A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner recipe
63
+ * A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
64
64
  * declares and `env` (the launcher environment) sets, since the config file's `args` can hold one. A launch machine
65
65
  * runner, or none, declares no secret.
66
66
  */
67
67
  export function targetRedactor(target, env) {
68
68
  const runner = target.settingsFile.values?.settings.runner;
69
- return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.recipe : undefined, env));
69
+ return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.options : undefined, env));
70
70
  }
71
71
  /**
72
72
  * The pre-run stderr line for `storm test`: `tests: <command>` or `suite <name>: <command>`, plus a count of
@@ -1,7 +1,16 @@
1
1
  import type { PlannedSandboxCount, PlanOption, TestPlanFacts } from "../run-directory/index.ts";
2
2
  import { type RunTestPlan } from "../sdk/extension/index.ts";
3
+ import type { RunPlan, SandboxesRunPlan, SingleRunPlan } from "./run-plan.ts";
3
4
  /** The plan a run records: with a counted test plan, its counts and `options`; none for a run that counted nothing. */
4
5
  export declare function recordedPlan(testPlan: RunTestPlan, options: readonly PlanOption[]): TestPlanFacts | undefined;
6
+ /**
7
+ * The plan facts a planned run records, prints before starting, and reports in `--plan-only`, `ran`, and
8
+ * `sandboxes_ran`: for a run across runner sandboxes, always present with `sandboxes`; for a single run, present only
9
+ * when counted.
10
+ */
11
+ export declare function plannedTestPlan(plan: SandboxesRunPlan): TestPlanFacts;
12
+ export declare function plannedTestPlan(plan: SingleRunPlan): TestPlanFacts | undefined;
13
+ export declare function plannedTestPlan(plan: RunPlan): TestPlanFacts | undefined;
5
14
  /**
6
15
  * The plan as `vitest` and `playwright` say it before the run: `Running 65 tests in 19 files; resources.<key>.<option>
7
16
  * 5 (default)`, each option with where its value came from, or `Running 65 tests in 19 files` without one, and
@@ -14,6 +14,15 @@ export function recordedPlan(testPlan, options) {
14
14
  }
15
15
  : undefined;
16
16
  }
17
+ export function plannedTestPlan(plan) {
18
+ const base = recordedPlan(plan.testPlan, plan.planOptions);
19
+ if (plan.sandboxes === undefined)
20
+ return base;
21
+ return {
22
+ ...(base ?? { options: [] }),
23
+ sandboxes: { ...plan.sandboxes.count },
24
+ };
25
+ }
17
26
  /**
18
27
  * The plan as `vitest` and `playwright` say it before the run: `Running 65 tests in 19 files; resources.<key>.<option>
19
28
  * 5 (default)`, each option with where its value came from, or `Running 65 tests in 19 files` without one, and
@@ -27,7 +27,7 @@ import { timelineFacts } from "./timeline-facts.js";
27
27
  async function openRecording(gateway, start, extra) {
28
28
  const startedAt = start.clock.now();
29
29
  const record = start.redact({
30
- version: 5,
30
+ version: 6,
31
31
  startedAt: startedAt.toISOString(),
32
32
  cwd: start.cwd,
33
33
  configFile: start.configFile,
@@ -57,7 +57,7 @@ async function openRecording(gateway, start, extra) {
57
57
  export async function recordRun(gateway, start) {
58
58
  const { definitionSet } = start;
59
59
  const { record, directory, opened, wallMs, abandon } = await openRecording(gateway, start, {
60
- where: startedWhere(start.run),
60
+ where: startedWhere(start.run.runner),
61
61
  });
62
62
  const collector = runCollector(definitionSet, directory);
63
63
  return {
@@ -103,7 +103,7 @@ export async function recordRun(gateway, start) {
103
103
  export async function recordAcrossSandboxes(gateway, start) {
104
104
  const { definitionSet, redact } = start;
105
105
  const { startedAt, record, directory, opened, wallMs, abandon } = await openRecording(gateway, start, {
106
- where: startedWhere({ runner: start.runner }),
106
+ where: startedWhere({ kind: "vercel-sandbox", session: start.runner }),
107
107
  sandboxes: start.sandboxes.map((sandbox, index) => pendingSandboxRecord({ sandbox: index, argv: sandbox.argv, files: sandbox.files })),
108
108
  });
109
109
  const run = runCollector(definitionSet, undefined);
@@ -56,6 +56,10 @@ declare const snapshotSchema: z.ZodObject<{
56
56
  base: z.ZodString;
57
57
  built: z.ZodBoolean;
58
58
  builtBehind: z.ZodNullable<z.ZodNumber>;
59
+ source: z.ZodExactOptional<z.ZodNullable<z.ZodEnum<{
60
+ local: "local";
61
+ shared: "shared";
62
+ }>>>;
59
63
  }, z.core.$strip>;
60
64
  /**
61
65
  * The runner snapshot a runner sandbox started from: its id, the base it is of, which the run's changes were uploaded
@@ -68,10 +72,10 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
72
  kind: z.ZodLiteral<"launch-machine">;
69
73
  }, z.core.$strip>, z.ZodObject<{
70
74
  kind: z.ZodLiteral<"vercel-sandbox">;
71
- team: z.ZodString;
72
- project: z.ZodString;
75
+ team: z.ZodNullable<z.ZodString>;
76
+ project: z.ZodNullable<z.ZodString>;
73
77
  region: z.ZodString;
74
- runtime: z.ZodString;
78
+ image: z.ZodString;
75
79
  vcpus: z.ZodNumber;
76
80
  base: z.ZodString;
77
81
  baseRef: z.ZodString;
@@ -81,13 +85,17 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
85
  base: z.ZodString;
82
86
  built: z.ZodBoolean;
83
87
  builtBehind: z.ZodNullable<z.ZodNumber>;
88
+ source: z.ZodExactOptional<z.ZodNullable<z.ZodEnum<{
89
+ local: "local";
90
+ shared: "shared";
91
+ }>>>;
84
92
  }, z.core.$strip>>;
85
93
  keptUntil: z.ZodNullable<z.ZodString>;
86
94
  uploadBytes: z.ZodNullable<z.ZodNumber>;
87
95
  }, z.core.$strip>], "kind">;
88
96
  /**
89
97
  * Where the command ran: on the launch machine (`launch-machine`), or in a Vercel Sandbox (`vercel-sandbox`):
90
- * the control plane team and project it runs in, its region, runtime, and vCPUs, and the run's base, HEAD's merge-base
98
+ * the control plane team and project it runs in, its region, image, and vCPUs, and the run's base, HEAD's merge-base
91
99
  * with `baseRef`, all known as the run starts; then, once the run is over, the runner sandbox's name and the runner
92
100
  * snapshot it started from, each null when the run stopped before it, when the runner sandbox's timeout stops it, as an
93
101
  * ISO time, when the run kept it running (null when it stopped and deleted it), and how many bytes of changes the run
@@ -155,7 +163,7 @@ export type SandboxState = SandboxRecord["state"];
155
163
  /** How many of its command log's last lines a runner sandbox record keeps. */
156
164
  export declare const SANDBOX_TAIL_LINES = 20;
157
165
  declare const runRecordSchema: z.ZodObject<{
158
- version: z.ZodLiteral<5>;
166
+ version: z.ZodLiteral<6>;
159
167
  startedAt: z.ZodString;
160
168
  cwd: z.ZodString;
161
169
  configFile: z.ZodNullable<z.ZodString>;
@@ -191,10 +199,10 @@ declare const runRecordSchema: z.ZodObject<{
191
199
  kind: z.ZodLiteral<"launch-machine">;
192
200
  }, z.core.$strip>, z.ZodObject<{
193
201
  kind: z.ZodLiteral<"vercel-sandbox">;
194
- team: z.ZodString;
195
- project: z.ZodString;
202
+ team: z.ZodNullable<z.ZodString>;
203
+ project: z.ZodNullable<z.ZodString>;
196
204
  region: z.ZodString;
197
- runtime: z.ZodString;
205
+ image: z.ZodString;
198
206
  vcpus: z.ZodNumber;
199
207
  base: z.ZodString;
200
208
  baseRef: z.ZodString;
@@ -204,6 +212,10 @@ declare const runRecordSchema: z.ZodObject<{
204
212
  base: z.ZodString;
205
213
  built: z.ZodBoolean;
206
214
  builtBehind: z.ZodNullable<z.ZodNumber>;
215
+ source: z.ZodExactOptional<z.ZodNullable<z.ZodEnum<{
216
+ local: "local";
217
+ shared: "shared";
218
+ }>>>;
207
219
  }, z.core.$strip>>;
208
220
  keptUntil: z.ZodNullable<z.ZodString>;
209
221
  uploadBytes: z.ZodNullable<z.ZodNumber>;
@@ -279,7 +291,7 @@ export type RunRecord = Readonly<Omit<z.output<typeof runRecordSchema>, "ended">
279
291
  }>;
280
292
  /** `run.json`'s text for `record`. */
281
293
  export declare function runRecordText(record: RunRecord): string;
282
- /** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
294
+ /** The run `text` records; undefined when there is no text, or it isn't a version 6 `run.json`. */
283
295
  export declare function parseRunRecord(text: string | undefined): RunRecord | undefined;
284
296
  /** The totals of `events`' final results; null without one. */
285
297
  export declare function testTotals(events: readonly TestEvent[]): RunTestTotals | null;
@@ -295,8 +307,11 @@ export declare function runEnd(outcome: RunOutcome, ran: RunState["command"], te
295
307
  * Where the command runs, as `run.json` records it as the run starts: on the launch machine (`launch-machine`), or in
296
308
  * a Vercel Sandbox (`vercel-sandbox`), with no sandbox or snapshot yet.
297
309
  */
298
- export declare function startedWhere(run: {
299
- readonly runner?: RunRunnerRequest | undefined;
310
+ export declare function startedWhere(runner: {
311
+ readonly kind: "launch-machine";
312
+ } | {
313
+ readonly kind: "vercel-sandbox";
314
+ readonly session: RunRunnerRequest;
300
315
  }): RunRecordWhere;
301
316
  /**
302
317
  * `where` once the run is over, from the runner's final state: for a run in a runner sandbox, the runner sandbox the