@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,22 +1,21 @@
1
- // How a run shows as it goes and once it is done, by presentation: nothing under `--json`, plain lines, or a live view
2
- // on a terminal. Each view also says where the command's output goes, wherever the command runs, so the live region is
3
- // the one writer on the terminal.
1
+ // Unified run view for single runs and runs across runner sandboxes, by presentation: nothing under `--json`, plain
2
+ // lines (with optional 1-second tick loop for multi-sandbox progress), or a live view on a terminal. All write loops
3
+ // share `droppingWriter` so EIO errors drop subsequent lines without aborting cleanup.
4
4
  import { EMPTY_RUN_STATE, } from "../../core/index.js";
5
5
  import { DEFINITION_SET } from "../../extensions.js";
6
- import { activePhase, headerLine, phaseFrame, phaseRecord } from "./live-view.js";
7
- import { snapshotBuildTexts, cacheWriteFailureText, lineProgress, preparedNoteTexts, progressLine, resourceWarningText, skippedText, } from "./progress.js";
8
6
  import { paint } from "../../shared/text.js";
7
+ import { activePhase, headerLine, phaseFrame, phaseRecord } from "./live-view.js";
8
+ import { droppingWriter, lineProgress, localIndexWriteFailureText, preparedNoteTexts, progressLine, resourceWarningText, sharedSnapshotLookupFailedText, skippedText, snapshotBuildTexts, } from "./progress.js";
9
+ /** How long the plain multi-sandbox view waits before asking again for progress lines that came due. */
10
+ export const PROGRESS_TICK_MS = 1_000;
9
11
  /** The plain summary's width when stderr reports none: 80 columns. */
10
12
  const PLAIN_WIDTH = 80;
11
13
  /**
12
- * The view for `presentation`. Without `progress`, as under `--json`, it shows nothing. A plain view writes its
13
- * lines through `progress`; a live view draws on `context.progressTerminal`, where the command's output also goes,
14
- * above the live region, and with `showOutput` each step's output too. `verbose` tells each resource's presentation,
15
- * which may then add lines of its own, and adds each step's output to a live view.
14
+ * The view for `presentation` and `mode`. Without `progress`, as under `--json`, it shows nothing.
16
15
  */
17
16
  export function runView(options) {
18
- const { presentation, progress, context } = options;
19
- if (progress === undefined)
17
+ const { presentation, progress, context, mode } = options;
18
+ if (progress === undefined) {
20
19
  return {
21
20
  observer: { observe: async () => { } },
22
21
  runnerTerminal: context.runnerTerminal,
@@ -24,52 +23,115 @@ export function runView(options) {
24
23
  colorDepth: "none",
25
24
  finish: async () => { },
26
25
  };
26
+ }
27
+ const plainWidth = Math.min(Math.max(presentation.columns ?? PLAIN_WIDTH, 60), 120);
28
+ if (mode.kind === "sandboxes") {
29
+ const writer = droppingWriter(progress);
30
+ const writeLines = async (lines) => {
31
+ for (const line of lines)
32
+ await writer(line);
33
+ };
34
+ if (presentation.kind === "live") {
35
+ return sandboxesLiveView(context, presentation.colorDepth, plainWidth, mode.progress, writeLines);
36
+ }
37
+ return sandboxesPlainView(context, presentation.colorDepth, plainWidth, mode.progress, writeLines);
38
+ }
27
39
  if (presentation.kind === "plain") {
28
40
  const writer = droppingWriter(progress);
29
41
  return {
30
- observer: lineProgress(writer, { github: presentation.github, verbose: options.verbose }),
42
+ observer: lineProgress(writer, { github: presentation.github, verbose: mode.verbose }),
31
43
  runnerTerminal: context.runnerTerminal,
32
- width: Math.min(Math.max(presentation.columns ?? PLAIN_WIDTH, 60), 120),
44
+ width: plainWidth,
33
45
  colorDepth: presentation.colorDepth,
34
- finish: async (summary) => {
46
+ finish: async (summary = []) => {
35
47
  for (const line of summary)
36
48
  await writer(line);
37
49
  },
38
50
  };
39
51
  }
40
- return liveView(context, presentation.colorDepth, {
41
- showOutput: options.showOutput || options.verbose,
42
- verbose: options.verbose,
52
+ return singleLiveView(context, presentation.colorDepth, {
53
+ showOutput: mode.showOutput || mode.verbose,
54
+ verbose: mode.verbose,
43
55
  });
44
56
  }
45
- /** `write`, until a write fails: then it drops every later line and still resolves. */
46
- function droppingWriter(write) {
47
- let failed = false;
48
- return async (line) => {
49
- if (failed)
50
- return;
51
- try {
52
- await write(line);
53
- }
54
- catch {
55
- failed = true;
56
- }
57
+ function sandboxesLiveView(context, colorDepth, width, status, writeSummary) {
58
+ const terminal = context.progressTerminal;
59
+ const style = paint(colorDepth !== "none");
60
+ let shown = false;
61
+ let finished = false;
62
+ return {
63
+ observer: {
64
+ observe: async (timed) => {
65
+ if (finished)
66
+ return;
67
+ const lines = status.lines(timed);
68
+ if (lines.length > 0)
69
+ terminal.print("stderr", lines.map((line) => `${line}\n`).join(""));
70
+ if (!shown && timed.event.kind === "sandboxes-started") {
71
+ shown = true;
72
+ terminal.show(() => (finished ? [] : status.rows(context.clock.now().getTime(), style)));
73
+ }
74
+ },
75
+ },
76
+ runnerTerminal: context.runnerTerminal,
77
+ width,
78
+ colorDepth,
79
+ finish: async (summary = []) => {
80
+ if (finished)
81
+ return;
82
+ finished = true;
83
+ if (shown)
84
+ terminal.settle();
85
+ await writeSummary(summary);
86
+ },
87
+ };
88
+ }
89
+ function sandboxesPlainView(context, colorDepth, width, status, writeLines) {
90
+ const abort = new AbortController();
91
+ if (context.timer !== undefined) {
92
+ const { timer, clock } = context;
93
+ const tick = async () => {
94
+ for (;;) {
95
+ await timer.sleep(PROGRESS_TICK_MS, abort.signal);
96
+ if (abort.signal.aborted)
97
+ return;
98
+ await writeLines(status.tick(clock.now().getTime()));
99
+ }
100
+ };
101
+ void tick();
102
+ }
103
+ let finished = false;
104
+ return {
105
+ observer: {
106
+ observe: async (timed) => {
107
+ if (finished)
108
+ return;
109
+ await writeLines(status.lines(timed));
110
+ },
111
+ },
112
+ runnerTerminal: context.runnerTerminal,
113
+ width,
114
+ colorDepth,
115
+ finish: async (summary = []) => {
116
+ if (finished)
117
+ return;
118
+ finished = true;
119
+ abort.abort();
120
+ await writeLines(summary);
121
+ },
57
122
  };
58
123
  }
59
124
  /**
60
- * The live view: the run's phases in order. The phase that runs shows in the live region, drawn from the state the
61
- * run's events build; once the next starts, it is printed above in its final form, so the terminal reads in time order.
62
- * The command's output, wherever the command runs, prints above the region as it arrives. What a phase can't hold, such
63
- * as a cache note or a resource's notice, is printed above as it happens, as a plain line.
125
+ * The live view for a single run: its phases in order. The active phase shows in the live region, drawn from `RunState`;
126
+ * once the next starts, it is printed above in its final form so the terminal reads in time order.
64
127
  */
65
- function liveView(context, colorDepth, options) {
128
+ function singleLiveView(context, colorDepth, options) {
66
129
  const { showOutput } = options;
67
130
  const colors = paint(colorDepth !== "none");
68
131
  const terminal = context.progressTerminal;
69
132
  let state = EMPTY_RUN_STATE;
70
133
  let phase;
71
134
  let headerPrinted = false;
72
- /** Whether the region shows. */
73
135
  let live = false;
74
136
  let finished = false;
75
137
  // One column short of the width: the live region keeps the last column free, so no row touches the edge.
@@ -114,12 +176,11 @@ function liveView(context, colorDepth, options) {
114
176
  writeStdout: (text) => terminal.print("stdout", text),
115
177
  writeStderr: (text) => terminal.print("stderr", text),
116
178
  },
117
- // The terminal may have been resized by the time the summary prints.
118
179
  get width() {
119
180
  return terminal.columns();
120
181
  },
121
182
  colorDepth,
122
- finish: async (summary) => {
183
+ finish: async (summary = []) => {
123
184
  if (finished)
124
185
  return;
125
186
  finished = true;
@@ -129,8 +190,8 @@ function liveView(context, colorDepth, options) {
129
190
  };
130
191
  }
131
192
  /**
132
- * The notices for `timed`: what the live view's phases can't hold, such as a cache note or a resource's notice, as
133
- * plain lines with their time since `origin` and their lane. `verbose` tells the resources' presentations.
193
+ * The notices for `timed`: what the live view's phases can't hold, such as a local snapshot index note or a resource's
194
+ * notice, as plain lines with their time since `origin` and their lane.
134
195
  */
135
196
  function noticeLines(timed, origin, verbose) {
136
197
  const line = (lane, text) => progressLine(timed.at.getTime() - origin, lane, text);
@@ -142,14 +203,12 @@ function noticeLines(timed, origin, verbose) {
142
203
  return runnerNoticeLines(event.event, line);
143
204
  case "resource":
144
205
  return DEFINITION_SET.presentations.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
145
- // A line a resource instance reported prints as it is, in its lane, and a warning marked as one.
146
206
  case "resource-notice":
147
207
  return [line(event.lane, event.text)];
148
208
  case "resource-warning":
149
209
  return [line(event.lane, resourceWarningText(event))];
150
210
  case "resource-skipped":
151
211
  return [line("run", skippedText(event))];
152
- // The live view draws what an acquired resource holds from its lane's state.
153
212
  case "resource-acquired":
154
213
  case "started":
155
214
  case "requesting-token":
@@ -171,19 +230,16 @@ function noticeLines(timed, origin, verbose) {
171
230
  return [];
172
231
  }
173
232
  }
174
- /**
175
- * The runner's notices: why the cached snapshots didn't fit a run that builds one, and a cache entry not written.
176
- */
177
233
  function runnerNoticeLines(event, line) {
178
234
  switch (event.kind) {
179
235
  case "snapshot-entry-not-written":
180
- return [line("runner", cacheWriteFailureText(event.failure))];
181
- // The runner row shows the build; its reasons, when a cached snapshot didn't fit, are lines of their own.
236
+ return [line("runner", localIndexWriteFailureText(event.failure))];
237
+ case "shared-snapshot-lookup-failed":
238
+ return [line("runner", sharedSnapshotLookupFailedText(event.message))];
182
239
  case "snapshot-build-started":
183
240
  return event.why.kind === "no-snapshot" && event.why.rejected.length > 0
184
241
  ? snapshotBuildTexts(event).map((text) => line("runner", text))
185
242
  : [];
186
- // The live view's phases show the rest.
187
243
  case "snapshot-reused":
188
244
  case "runner-sandbox-starting":
189
245
  case "sandbox-started":
@@ -33,10 +33,10 @@ export declare const runFactsSchema: z.ZodObject<{
33
33
  kind: z.ZodLiteral<"launch-machine">;
34
34
  }, z.core.$strip>, z.ZodObject<{
35
35
  kind: z.ZodLiteral<"vercel-sandbox">;
36
- team: z.ZodString;
37
- project: z.ZodString;
36
+ team: z.ZodNullable<z.ZodString>;
37
+ project: z.ZodNullable<z.ZodString>;
38
38
  region: z.ZodString;
39
- runtime: z.ZodString;
39
+ image: z.ZodString;
40
40
  vcpus: z.ZodNumber;
41
41
  base: z.ZodString;
42
42
  baseRef: z.ZodString;
@@ -49,7 +49,11 @@ export declare const runFactsSchema: z.ZodObject<{
49
49
  base: z.ZodString;
50
50
  built: z.ZodBoolean;
51
51
  builtBehind: z.ZodNullable<z.ZodNumber>;
52
- url: z.ZodString;
52
+ source: z.ZodNullable<z.ZodEnum<{
53
+ local: "local";
54
+ shared: "shared";
55
+ }>>;
56
+ url: z.ZodNullable<z.ZodString>;
53
57
  }, z.core.$strip>>;
54
58
  uploadBytes: z.ZodNullable<z.ZodNumber>;
55
59
  }, z.core.$strip>], "kind">>;
@@ -49,14 +49,14 @@ export const runFactsSchema = z.object({
49
49
  z.object({ kind: z.literal("launch-machine") }),
50
50
  z.object({
51
51
  kind: z.literal("vercel-sandbox"),
52
- /** The control plane team the runner sandbox ran in. */
53
- team: z.string(),
54
- /** The control plane project the runner sandbox ran in. */
55
- project: z.string(),
52
+ /** The control plane team the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --scope). */
53
+ team: z.string().nullable(),
54
+ /** The control plane project the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --project). */
55
+ project: z.string().nullable(),
56
56
  /** The runner sandbox's region, such as iad1. */
57
57
  region: z.string(),
58
- /** The runner sandbox's runtime, such as node24. */
59
- runtime: z.string(),
58
+ /** The runner sandbox's image, such as vercel/sandbox/node:al-24. */
59
+ image: z.string(),
60
60
  /** The runner sandbox's vCPUs. */
61
61
  vcpus: z.number(),
62
62
  /** The run's base: HEAD's merge-base with baseRef, a full SHA. */
@@ -71,7 +71,7 @@ export const runFactsSchema = z.object({
71
71
  keptUntil: z.string().nullable(),
72
72
  /** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
73
73
  keptMinutesLeft: z.number().nullable(),
74
- /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
74
+ /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, where a reused snapshot came from (`local` or `shared`), and its page in the Vercel dashboard. Null until known. */
75
75
  snapshot: z
76
76
  .object({
77
77
  id: z.string(),
@@ -79,7 +79,9 @@ export const runFactsSchema = z.object({
79
79
  built: z.boolean(),
80
80
  /** How many commits the run's HEAD had that its base, the commit it was built at, lacks; null when the run state had no count. */
81
81
  builtBehind: z.number().nullable(),
82
- url: z.string(),
82
+ /** Where a reused snapshot came from (`local` or `shared`); null when this run built it or when unknown. */
83
+ source: z.enum(["local", "shared"]).nullable(),
84
+ url: z.string().nullable(),
83
85
  })
84
86
  .nullable(),
85
87
  /** How many bytes of changes the run uploaded to the runner sandbox; null when the run stopped before the upload. */
@@ -164,11 +166,18 @@ function whereFacts(where, now) {
164
166
  if (where.kind === "launch-machine")
165
167
  return { kind: "launch-machine" };
166
168
  const { sandbox, snapshot, keptUntil } = where;
169
+ const project = where.team !== null && where.project !== null ? { team: where.team, project: where.project } : null;
167
170
  return {
168
171
  ...where,
169
172
  keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 60_000)),
170
- sandboxUrl: sandbox === null ? null : sandboxPage(where, sandbox),
171
- snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) },
173
+ sandboxUrl: sandbox === null || project === null ? null : sandboxPage(project, sandbox),
174
+ snapshot: snapshot === null
175
+ ? null
176
+ : {
177
+ ...snapshot,
178
+ source: snapshot.source ?? null,
179
+ url: project === null ? null : snapshotPage(project, snapshot.id),
180
+ },
172
181
  };
173
182
  }
174
183
  /** `scope` as the result reports it. */
@@ -37,10 +37,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
37
37
  kind: z.ZodLiteral<"launch-machine">;
38
38
  }, z.core.$strip>, z.ZodObject<{
39
39
  kind: z.ZodLiteral<"vercel-sandbox">;
40
- team: z.ZodString;
41
- project: z.ZodString;
40
+ team: z.ZodNullable<z.ZodString>;
41
+ project: z.ZodNullable<z.ZodString>;
42
42
  region: z.ZodString;
43
- runtime: z.ZodString;
43
+ image: z.ZodString;
44
44
  vcpus: z.ZodNumber;
45
45
  base: z.ZodString;
46
46
  baseRef: z.ZodString;
@@ -53,7 +53,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
53
53
  base: z.ZodString;
54
54
  built: z.ZodBoolean;
55
55
  builtBehind: z.ZodNullable<z.ZodNumber>;
56
- url: z.ZodString;
56
+ source: z.ZodNullable<z.ZodEnum<{
57
+ local: "local";
58
+ shared: "shared";
59
+ }>>;
60
+ url: z.ZodNullable<z.ZodString>;
57
61
  }, z.core.$strip>>;
58
62
  uploadBytes: z.ZodNullable<z.ZodNumber>;
59
63
  }, z.core.$strip>], "kind">>;
@@ -169,10 +173,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
169
173
  kind: z.ZodLiteral<"launch-machine">;
170
174
  }, z.core.$strip>, z.ZodObject<{
171
175
  kind: z.ZodLiteral<"vercel-sandbox">;
172
- team: z.ZodString;
173
- project: z.ZodString;
176
+ team: z.ZodNullable<z.ZodString>;
177
+ project: z.ZodNullable<z.ZodString>;
174
178
  region: z.ZodString;
175
- runtime: z.ZodString;
179
+ image: z.ZodString;
176
180
  vcpus: z.ZodNumber;
177
181
  base: z.ZodString;
178
182
  baseRef: z.ZodString;
@@ -185,7 +189,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
185
189
  base: z.ZodString;
186
190
  built: z.ZodBoolean;
187
191
  builtBehind: z.ZodNullable<z.ZodNumber>;
188
- url: z.ZodString;
192
+ source: z.ZodNullable<z.ZodEnum<{
193
+ local: "local";
194
+ shared: "shared";
195
+ }>>;
196
+ url: z.ZodNullable<z.ZodString>;
189
197
  }, z.core.$strip>>;
190
198
  uploadBytes: z.ZodNullable<z.ZodNumber>;
191
199
  }, z.core.$strip>], "kind">>;
@@ -17,30 +17,30 @@ import {
17
17
  tookText,
18
18
  totalsText,
19
19
  totalsTone
20
- } from "../../../chunks/chunk-V4IKA3WI.js";
20
+ } from "../../../chunks/chunk-PMBQWVTW.js";
21
21
  import {
22
22
  muted,
23
23
  path,
24
24
  renderOutcome,
25
25
  status
26
- } from "../../../chunks/chunk-TJNFVNKR.js";
27
- import "../../../chunks/chunk-2MAD5NKK.js";
26
+ } from "../../../chunks/chunk-EI3XDCEI.js";
27
+ import "../../../chunks/chunk-K4MDQPLW.js";
28
+ import "../../../chunks/chunk-KQ5FXRUD.js";
28
29
  import {
29
30
  pastRuns
30
- } from "../../../chunks/chunk-P357TZAY.js";
31
- import "../../../chunks/chunk-G3PHMXH5.js";
31
+ } from "../../../chunks/chunk-LOGHIUUB.js";
32
32
  import "../../../chunks/chunk-F6N34UWB.js";
33
- import "../../../chunks/chunk-FOZWA52V.js";
33
+ import "../../../chunks/chunk-3VXZONGE.js";
34
34
  import {
35
35
  findConfigFile
36
- } from "../../../chunks/chunk-DC2CDHNK.js";
37
- import "../../../chunks/chunk-AWBSONHB.js";
36
+ } from "../../../chunks/chunk-2JMWUKH3.js";
37
+ import "../../../chunks/chunk-XBDRVFEV.js";
38
38
  import {
39
39
  stormCommands
40
- } from "../../../chunks/chunk-5VXBKPW6.js";
40
+ } from "../../../chunks/chunk-LKXHGGGX.js";
41
41
  import {
42
42
  defineOutcomes
43
- } from "../../../chunks/chunk-VL7WFTVQ.js";
43
+ } from "../../../chunks/chunk-24UYAK4R.js";
44
44
 
45
45
  // src/commands/runs/list/command.ts
46
46
  import { z as z2 } from "zod";
@@ -27,10 +27,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
27
27
  kind: z.ZodLiteral<"launch-machine">;
28
28
  }, z.core.$strip>, z.ZodObject<{
29
29
  kind: z.ZodLiteral<"vercel-sandbox">;
30
- team: z.ZodString;
31
- project: z.ZodString;
30
+ team: z.ZodNullable<z.ZodString>;
31
+ project: z.ZodNullable<z.ZodString>;
32
32
  region: z.ZodString;
33
- runtime: z.ZodString;
33
+ image: z.ZodString;
34
34
  vcpus: z.ZodNumber;
35
35
  base: z.ZodString;
36
36
  baseRef: z.ZodString;
@@ -43,7 +43,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
43
43
  base: z.ZodString;
44
44
  built: z.ZodBoolean;
45
45
  builtBehind: z.ZodNullable<z.ZodNumber>;
46
- url: z.ZodString;
46
+ source: z.ZodNullable<z.ZodEnum<{
47
+ local: "local";
48
+ shared: "shared";
49
+ }>>;
50
+ url: z.ZodNullable<z.ZodString>;
47
51
  }, z.core.$strip>>;
48
52
  uploadBytes: z.ZodNullable<z.ZodNumber>;
49
53
  }, z.core.$strip>], "kind">>;
@@ -8,29 +8,29 @@ import {
8
8
  sandboxIndexesText,
9
9
  scopeFacts,
10
10
  scopeSchema
11
- } from "../../../chunks/chunk-V4IKA3WI.js";
11
+ } from "../../../chunks/chunk-PMBQWVTW.js";
12
12
  import {
13
13
  renderOutcome
14
- } from "../../../chunks/chunk-TJNFVNKR.js";
15
- import "../../../chunks/chunk-2MAD5NKK.js";
14
+ } from "../../../chunks/chunk-EI3XDCEI.js";
15
+ import "../../../chunks/chunk-K4MDQPLW.js";
16
+ import "../../../chunks/chunk-KQ5FXRUD.js";
16
17
  import {
17
18
  pastRuns
18
- } from "../../../chunks/chunk-P357TZAY.js";
19
- import "../../../chunks/chunk-G3PHMXH5.js";
19
+ } from "../../../chunks/chunk-LOGHIUUB.js";
20
20
  import {
21
21
  stripAnsi
22
22
  } from "../../../chunks/chunk-F6N34UWB.js";
23
- import "../../../chunks/chunk-FOZWA52V.js";
23
+ import "../../../chunks/chunk-3VXZONGE.js";
24
24
  import {
25
25
  findConfigFile
26
- } from "../../../chunks/chunk-DC2CDHNK.js";
27
- import "../../../chunks/chunk-AWBSONHB.js";
26
+ } from "../../../chunks/chunk-2JMWUKH3.js";
27
+ import "../../../chunks/chunk-XBDRVFEV.js";
28
28
  import {
29
29
  stormCommands
30
- } from "../../../chunks/chunk-5VXBKPW6.js";
30
+ } from "../../../chunks/chunk-LKXHGGGX.js";
31
31
  import {
32
32
  defineOutcomes
33
- } from "../../../chunks/chunk-VL7WFTVQ.js";
33
+ } from "../../../chunks/chunk-24UYAK4R.js";
34
34
 
35
35
  // src/commands/runs/logs/command.ts
36
36
  import { z as z2 } from "zod";
@@ -37,10 +37,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
37
37
  kind: z.ZodLiteral<"launch-machine">;
38
38
  }, z.core.$strip>, z.ZodObject<{
39
39
  kind: z.ZodLiteral<"vercel-sandbox">;
40
- team: z.ZodString;
41
- project: z.ZodString;
40
+ team: z.ZodNullable<z.ZodString>;
41
+ project: z.ZodNullable<z.ZodString>;
42
42
  region: z.ZodString;
43
- runtime: z.ZodString;
43
+ image: z.ZodString;
44
44
  vcpus: z.ZodNumber;
45
45
  base: z.ZodString;
46
46
  baseRef: z.ZodString;
@@ -53,7 +53,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
53
53
  base: z.ZodString;
54
54
  built: z.ZodBoolean;
55
55
  builtBehind: z.ZodNullable<z.ZodNumber>;
56
- url: z.ZodString;
56
+ source: z.ZodNullable<z.ZodEnum<{
57
+ local: "local";
58
+ shared: "shared";
59
+ }>>;
60
+ url: z.ZodNullable<z.ZodString>;
57
61
  }, z.core.$strip>>;
58
62
  uploadBytes: z.ZodNullable<z.ZodNumber>;
59
63
  }, z.core.$strip>], "kind">>;
@@ -554,10 +558,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
554
558
  kind: z.ZodLiteral<"launch-machine">;
555
559
  }, z.core.$strip>, z.ZodObject<{
556
560
  kind: z.ZodLiteral<"vercel-sandbox">;
557
- team: z.ZodString;
558
- project: z.ZodString;
561
+ team: z.ZodNullable<z.ZodString>;
562
+ project: z.ZodNullable<z.ZodString>;
559
563
  region: z.ZodString;
560
- runtime: z.ZodString;
564
+ image: z.ZodString;
561
565
  vcpus: z.ZodNumber;
562
566
  base: z.ZodString;
563
567
  baseRef: z.ZodString;
@@ -570,7 +574,11 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
570
574
  base: z.ZodString;
571
575
  built: z.ZodBoolean;
572
576
  builtBehind: z.ZodNullable<z.ZodNumber>;
573
- url: z.ZodString;
577
+ source: z.ZodNullable<z.ZodEnum<{
578
+ local: "local";
579
+ shared: "shared";
580
+ }>>;
581
+ url: z.ZodNullable<z.ZodString>;
574
582
  }, z.core.$strip>>;
575
583
  uploadBytes: z.ZodNullable<z.ZodNumber>;
576
584
  }, z.core.$strip>], "kind">>;