@cnc-tools/storm 0.17.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 (129) hide show
  1. package/dist/bin/storm.js +37 -39
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-4WAMTUWZ.js → chunk-24UYAK4R.js} +88 -67
  4. package/dist/chunks/{chunk-RNAS7JHE.js → chunk-2JMWUKH3.js} +710 -102
  5. package/dist/chunks/{chunk-YEPFSLQR.js → chunk-3VXZONGE.js} +2 -2
  6. package/dist/chunks/{chunk-D27KILIA.js → chunk-55O4FCN4.js} +1 -1
  7. package/dist/chunks/{chunk-JN3YY6ZH.js → chunk-AS37D43E.js} +27 -20
  8. package/dist/chunks/{chunk-2VP4GRJM.js → chunk-CQAY6GLP.js} +54 -13
  9. package/dist/chunks/{chunk-MR77L2GK.js → chunk-DZLU7BYK.js} +5 -5
  10. package/dist/chunks/{chunk-LKTZ5OXS.js → chunk-EI3XDCEI.js} +1 -1
  11. package/dist/chunks/{chunk-FNBB6V4R.js → chunk-FDUY3BNF.js} +1 -1
  12. package/dist/chunks/{chunk-RWIXDDCK.js → chunk-GUCCYCIO.js} +3 -3
  13. package/dist/chunks/{chunk-6UHIJXZG.js → chunk-HBI4LEMH.js} +2 -2
  14. package/dist/chunks/{chunk-CKGZA25H.js → chunk-K4MDQPLW.js} +1 -1
  15. package/dist/chunks/{chunk-F4MOYHRY.js → chunk-KK7PAWIZ.js} +1 -1
  16. package/dist/chunks/{chunk-GRT3UIBV.js → chunk-KQ5FXRUD.js} +1 -1
  17. package/dist/chunks/{chunk-WV3DP6NR.js → chunk-LKXHGGGX.js} +1 -1
  18. package/dist/chunks/{chunk-4O5C2XGJ.js → chunk-LOGHIUUB.js} +6 -6
  19. package/dist/chunks/{chunk-7DZE67QM.js → chunk-OEPFINFT.js} +2 -2
  20. package/dist/chunks/{chunk-HWIQ2S7K.js → chunk-OI4AP6Z7.js} +3 -3
  21. package/dist/chunks/{chunk-DADEYJDW.js → chunk-PMBQWVTW.js} +6 -6
  22. package/dist/chunks/{chunk-HP3CURSZ.js → chunk-SZMYIIG2.js} +2 -2
  23. package/dist/chunks/{chunk-2RNDPDTJ.js → chunk-TXCOFC7N.js} +2 -2
  24. package/dist/chunks/{chunk-BCBKYOHW.js → chunk-UXD3TVWM.js} +1 -1
  25. package/dist/chunks/{chunk-M7EKRGVD.js → chunk-WNW2QXQK.js} +1 -1
  26. package/dist/chunks/{live-app-R76JQXZL.js → live-app-UY7BEDUN.js} +9 -7
  27. package/dist/cli.d.ts +28 -0
  28. package/dist/cli.js +64 -0
  29. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
  30. package/dist/commands/exec/across-sandboxes-outcomes.js +1 -1
  31. package/dist/commands/exec/before-run.d.ts +1 -1
  32. package/dist/commands/exec/command.d.ts +36 -12
  33. package/dist/commands/exec/command.js +18 -18
  34. package/dist/commands/exec/execute-run.js +1 -1
  35. package/dist/commands/exec/outcomes.d.ts +71 -15
  36. package/dist/commands/exec/outcomes.js +46 -6
  37. package/dist/commands/exec/plan-run.d.ts +1 -1
  38. package/dist/commands/exec/plan-run.js +8 -3
  39. package/dist/commands/exec/run-metadata.js +1 -1
  40. package/dist/commands/exec/run-summary.js +1 -1
  41. package/dist/commands/runs/facts.d.ts +1 -1
  42. package/dist/commands/runs/facts.js +2 -2
  43. package/dist/commands/runs/list/command.d.ts +2 -2
  44. package/dist/commands/runs/list/command.js +9 -9
  45. package/dist/commands/runs/list/outcomes.d.ts +1 -1
  46. package/dist/commands/runs/logs/command.js +9 -9
  47. package/dist/commands/runs/show/command.d.ts +2 -2
  48. package/dist/commands/runs/show/command.js +16 -16
  49. package/dist/commands/runs/show/metadata.js +1 -1
  50. package/dist/commands/runs/show/outcomes.d.ts +1 -1
  51. package/dist/commands/runs/show/outcomes.js +1 -1
  52. package/dist/commands/snapshots/build/command.d.ts +22 -14
  53. package/dist/commands/snapshots/build/command.js +32 -30
  54. package/dist/commands/snapshots/build/metadata.js +1 -1
  55. package/dist/commands/snapshots/build/outcomes.d.ts +14 -10
  56. package/dist/commands/snapshots/build/outcomes.js +1 -1
  57. package/dist/commands/snapshots/list/command.d.ts +2 -2
  58. package/dist/commands/snapshots/list/command.js +19 -19
  59. package/dist/commands/snapshots/list/outcomes.d.ts +2 -2
  60. package/dist/commands/snapshots/list/outcomes.js +3 -3
  61. package/dist/commands/snapshots/prune/command.js +14 -14
  62. package/dist/commands/suites/list/command.js +10 -10
  63. package/dist/commands/test/command.d.ts +36 -12
  64. package/dist/commands/test/command.js +20 -20
  65. package/dist/commands/test/outcomes.d.ts +18 -6
  66. package/dist/config-file/define.d.ts +1 -1
  67. package/dist/config-file/toolchain.d.ts +13 -3
  68. package/dist/config-file/toolchain.js +41 -5
  69. package/dist/context.d.ts +3 -1
  70. package/dist/context.js +2 -1
  71. package/dist/core/outcomes.d.ts +1 -1
  72. package/dist/core/run.js +1 -1
  73. package/dist/extension-commands.d.ts +2 -7
  74. package/dist/extension-commands.js +3 -17
  75. package/dist/extensions/testserver/commands/pool/create/command.js +3 -3
  76. package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
  77. package/dist/run-directory/recording.js +1 -1
  78. package/dist/run-directory/run-record.d.ts +5 -5
  79. package/dist/run-directory/run-record.js +5 -5
  80. package/dist/runner/build-snapshots.d.ts +5 -0
  81. package/dist/runner/build-snapshots.js +11 -5
  82. package/dist/runner/gateways.d.ts +37 -4
  83. package/dist/runner/gh.d.ts +42 -0
  84. package/dist/runner/gh.js +58 -0
  85. package/dist/runner/index.d.ts +5 -4
  86. package/dist/runner/index.js +3 -2
  87. package/dist/runner/live/checkout-gateway.js +7 -0
  88. package/dist/runner/live/gh-output.d.ts +17 -0
  89. package/dist/runner/live/gh-output.js +37 -0
  90. package/dist/runner/live/gh-token-gateway.d.ts +13 -0
  91. package/dist/runner/live/gh-token-gateway.js +51 -0
  92. package/dist/runner/live/sandbox-gateway.js +12 -2
  93. package/dist/runner/live/snapshot-records.js +10 -9
  94. package/dist/runner/local-snapshot-index.d.ts +11 -5
  95. package/dist/runner/local-snapshot-index.js +13 -14
  96. package/dist/runner/ready.d.ts +1 -1
  97. package/dist/runner/ready.js +1 -1
  98. package/dist/runner/scope.d.ts +5 -2
  99. package/dist/runner/scope.js +6 -2
  100. package/dist/runner/secrets.d.ts +37 -14
  101. package/dist/runner/secrets.js +218 -25
  102. package/dist/runner/session.js +3 -0
  103. package/dist/runner/shared-snapshot-entry.d.ts +3 -3
  104. package/dist/runner/shared-snapshot-entry.js +4 -4
  105. package/dist/runner/shared-snapshot-list.d.ts +1 -1
  106. package/dist/runner/shared-snapshot-list.js +1 -1
  107. package/dist/runner/shared-snapshot-lookup.d.ts +1 -1
  108. package/dist/runner/shared-snapshot-lookup.js +1 -1
  109. package/dist/runner/snapshot-build.js +54 -25
  110. package/dist/runner/snapshot-choice.js +1 -0
  111. package/dist/runner/snapshot-inspect.js +2 -5
  112. package/dist/runner/snapshot-key.d.ts +21 -7
  113. package/dist/runner/snapshot-key.js +31 -7
  114. package/dist/runner/snapshot-source.d.ts +31 -0
  115. package/dist/runner/snapshot-source.js +122 -0
  116. package/dist/runner/vercel-sandbox-check.d.ts +2 -0
  117. package/dist/runner/vercel-sandbox-check.js +6 -2
  118. package/dist/runner/vercel-sandbox-options.d.ts +36 -6
  119. package/dist/runner/vercel-sandbox-options.js +62 -19
  120. package/dist/runner/vercel-sandbox-secrets.d.ts +55 -6
  121. package/dist/runner/vercel-sandbox-secrets.js +142 -9
  122. package/dist/sdk/extension/commands.d.ts +3 -8
  123. package/dist/sdk/extension/commands.js +1 -3
  124. package/package.json +4 -3
  125. package/skills/overview.md +1 -1
  126. package/dist/application.d.ts +0 -30
  127. package/dist/application.js +0 -41
  128. package/dist/bin/run.d.ts +0 -18
  129. package/dist/bin/run.js +0 -31
@@ -3,11 +3,11 @@ import {
3
3
  resolveProjectTests,
4
4
  resolveSuite,
5
5
  targetRedactor
6
- } from "../../chunks/chunk-6UHIJXZG.js";
6
+ } from "../../chunks/chunk-HBI4LEMH.js";
7
7
  import {
8
8
  suiteNamesText,
9
9
  suiteNotFoundErrors
10
- } from "../../chunks/chunk-7DZE67QM.js";
10
+ } from "../../chunks/chunk-OEPFINFT.js";
11
11
  import {
12
12
  DRIVER_FILE_LISTS_HELP,
13
13
  DRIVER_SANDBOXES_HELP,
@@ -19,9 +19,9 @@ import {
19
19
  runFlagProblems,
20
20
  runHelp,
21
21
  sandboxesFlagProblems
22
- } from "../../chunks/chunk-JN3YY6ZH.js";
23
- import "../../chunks/chunk-RWIXDDCK.js";
24
- import "../../chunks/chunk-MR77L2GK.js";
22
+ } from "../../chunks/chunk-AS37D43E.js";
23
+ import "../../chunks/chunk-GUCCYCIO.js";
24
+ import "../../chunks/chunk-DZLU7BYK.js";
25
25
  import "../../chunks/chunk-I5GZLOLQ.js";
26
26
  import {
27
27
  PLANNED_DESCRIPTION,
@@ -37,40 +37,40 @@ import {
37
37
  sandboxesDefaultErrors,
38
38
  sandboxesErrors,
39
39
  sandboxesRanSchema
40
- } from "../../chunks/chunk-2VP4GRJM.js";
41
- import "../../chunks/chunk-FNBB6V4R.js";
42
- import "../../chunks/chunk-M7EKRGVD.js";
43
- import "../../chunks/chunk-F4MOYHRY.js";
40
+ } from "../../chunks/chunk-CQAY6GLP.js";
41
+ import "../../chunks/chunk-FDUY3BNF.js";
42
+ import "../../chunks/chunk-WNW2QXQK.js";
43
+ import "../../chunks/chunk-KK7PAWIZ.js";
44
44
  import {
45
45
  DRIVER_NAMES,
46
46
  driverNamed
47
- } from "../../chunks/chunk-HWIQ2S7K.js";
47
+ } from "../../chunks/chunk-OI4AP6Z7.js";
48
48
  import "../../chunks/chunk-EEENLQHE.js";
49
49
  import "../../chunks/chunk-72ZFEMAW.js";
50
- import "../../chunks/chunk-BCBKYOHW.js";
51
- import "../../chunks/chunk-D27KILIA.js";
52
- import "../../chunks/chunk-2RNDPDTJ.js";
53
- import "../../chunks/chunk-CKGZA25H.js";
54
- import "../../chunks/chunk-GRT3UIBV.js";
50
+ import "../../chunks/chunk-UXD3TVWM.js";
51
+ import "../../chunks/chunk-55O4FCN4.js";
52
+ import "../../chunks/chunk-TXCOFC7N.js";
53
+ import "../../chunks/chunk-K4MDQPLW.js";
54
+ import "../../chunks/chunk-KQ5FXRUD.js";
55
55
  import {
56
56
  planSchema
57
- } from "../../chunks/chunk-4O5C2XGJ.js";
57
+ } from "../../chunks/chunk-LOGHIUUB.js";
58
58
  import "../../chunks/chunk-F6N34UWB.js";
59
- import "../../chunks/chunk-YEPFSLQR.js";
59
+ import "../../chunks/chunk-3VXZONGE.js";
60
60
  import {
61
61
  CONFIG_FILE_NAME,
62
62
  CONFIG_FILE_NAMES_TEXT
63
- } from "../../chunks/chunk-RNAS7JHE.js";
63
+ } from "../../chunks/chunk-2JMWUKH3.js";
64
64
  import {
65
65
  DRIVER_PLAN_FAILURE_KINDS
66
66
  } from "../../chunks/chunk-XBDRVFEV.js";
67
67
  import {
68
68
  stormCommands
69
- } from "../../chunks/chunk-WV3DP6NR.js";
69
+ } from "../../chunks/chunk-LKXHGGGX.js";
70
70
  import {
71
71
  defineErrors,
72
72
  defineOutcomes
73
- } from "../../chunks/chunk-4WAMTUWZ.js";
73
+ } from "../../chunks/chunk-24UYAK4R.js";
74
74
 
75
75
  // src/commands/test/command.ts
76
76
  import { z as z3 } from "zod";
@@ -96,7 +96,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
96
96
  built: z.ZodBoolean;
97
97
  vcpus: z.ZodNumber;
98
98
  region: z.ZodString;
99
- runtime: z.ZodString;
99
+ image: z.ZodString;
100
100
  buildMs: z.ZodNumber;
101
101
  }, z.core.$strip>>;
102
102
  timeline: z.ZodObject<{
@@ -259,7 +259,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
259
259
  built: z.ZodBoolean;
260
260
  vcpus: z.ZodNumber;
261
261
  region: z.ZodString;
262
- runtime: z.ZodString;
262
+ image: z.ZodString;
263
263
  uploadBytes: z.ZodNullable<z.ZodNumber>;
264
264
  }, z.core.$strip>;
265
265
  cleanup: z.ZodType<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts>>;
@@ -356,9 +356,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
356
356
  configFile: string | null;
357
357
  }]>;
358
358
  credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
359
- variables: {
359
+ problems: {
360
360
  name: string;
361
- problem: "missing" | "multiline" | "short";
361
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
362
+ detail: string;
363
+ hint: string;
362
364
  }[];
363
365
  minLength: number;
364
366
  configFile: string | null;
@@ -426,6 +428,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
426
428
  }[];
427
429
  }[];
428
430
  }]>;
431
+ keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
432
+ providers: string[];
433
+ configFile: string | null;
434
+ }]>;
429
435
  keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
430
436
  variables: string[];
431
437
  configFile: string | null;
@@ -575,9 +581,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
575
581
  configFile: string | null;
576
582
  }]>;
577
583
  readonly credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
578
- variables: {
584
+ problems: {
579
585
  name: string;
580
- problem: "missing" | "multiline" | "short";
586
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
587
+ detail: string;
588
+ hint: string;
581
589
  }[];
582
590
  minLength: number;
583
591
  configFile: string | null;
@@ -645,6 +653,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
645
653
  }[];
646
654
  }[];
647
655
  }]>;
656
+ readonly keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
657
+ providers: string[];
658
+ configFile: string | null;
659
+ }]>;
648
660
  readonly keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
649
661
  variables: string[];
650
662
  configFile: string | null;
@@ -6,7 +6,7 @@ export { launchMachine, vercelSandbox } from "./runner.ts";
6
6
  export { pnpmToolchains } from "./toolchain.ts";
7
7
  export type { LaunchMachineRunner, RunnerConfig, RunnerKind, SuiteRunnerConfig, VercelSandboxRunner, } from "../config/runner.ts";
8
8
  export type { SuiteConfig, SuiteConfigMap } from "../config/suite.ts";
9
- export type { CredentialDeclaration, RunnerSandboxCount, RunnerStep, RunnerVcpuCount, RunnerVcpuRule, SandboxCountDefault, SandboxCountDefaultRule, ToolchainStep, UnsafeSecretEnvVar, VercelSandboxOptions, } from "../runner/vercel-sandbox-options.ts";
9
+ export type { CredentialDeclaration, GhCredentialSource, GhTokenFormat, ManagedCredential, RunnerSandboxCount, RunnerStep, RunnerVcpuCount, RunnerVcpuRule, SandboxCountDefault, SandboxCountDefaultRule, SandboxCredentialSource, SnapshotSource, ToolchainStep, UnsafeSecretEnvVar, VercelSandboxOptions, } from "../runner/vercel-sandbox-options.ts";
10
10
  export type { Resource } from "../sdk/extension/resource-definition.ts";
11
11
  export type { SecretSource } from "../sdk/extension/secret-source.ts";
12
12
  /**
@@ -5,11 +5,21 @@ import type { ToolchainStep } from "../runner/vercel-sandbox-options.ts";
5
5
  * directly without slicing the shell script.
6
6
  */
7
7
  export declare const PNPM_TOOLCHAINS_MANIFEST_SCRIPT: string;
8
+ /**
9
+ * Bash snippet run at the start of `pnpmToolchains` to put `$HOME/.local/bin` first on `PATH` and persist it
10
+ * idempotently in `$HOME/.bash_profile` and `$HOME/.bashrc`, preserving any pre-existing `$HOME/.bash_login` or
11
+ * `$HOME/.profile`. Uses a storm-owned marker comment so an image's earlier `PATH` export never stops storm from
12
+ * appending at the end of the file. Exported from this file (not `@vercel/storm/config`) so tests can run it
13
+ * directly under `bash -lc` against synthetic `$HOME` fixtures.
14
+ */
15
+ export declare const PNPM_TOOLCHAINS_PROFILE_SCRIPT: string;
8
16
  /**
9
17
  * Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
10
18
  * and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
11
- * steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
12
- * than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
13
- * spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
19
+ * steps run, and the script puts `$HOME/.local/bin` first on `PATH` (persisting it idempotently to `$HOME/.bash_profile`
20
+ * and `$HOME/.bashrc` so pre-installed shims such as `~/.global/pnpm/bin` never shadow installed tools), installs `git`
21
+ * when absent via `dnf` or `apt-get`, downloads Node into `$HOME/.local/bin` when the image's Node is older than
22
+ * `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or spread
23
+ * it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
14
24
  */
15
25
  export declare const pnpmToolchains: readonly ToolchainStep[];
@@ -23,12 +23,39 @@ if (node === undefined) {
23
23
  }
24
24
  process.stdout.write(node + " " + pnpm + "\n");
25
25
  `.trim();
26
+ /**
27
+ * Bash snippet run at the start of `pnpmToolchains` to put `$HOME/.local/bin` first on `PATH` and persist it
28
+ * idempotently in `$HOME/.bash_profile` and `$HOME/.bashrc`, preserving any pre-existing `$HOME/.bash_login` or
29
+ * `$HOME/.profile`. Uses a storm-owned marker comment so an image's earlier `PATH` export never stops storm from
30
+ * appending at the end of the file. Exported from this file (not `@vercel/storm/config`) so tests can run it
31
+ * directly under `bash -lc` against synthetic `$HOME` fixtures.
32
+ */
33
+ export const PNPM_TOOLCHAINS_PROFILE_SCRIPT = [
34
+ 'mkdir -p "$HOME/.local/bin"',
35
+ 'export PATH="$HOME/.local/bin:$PATH"',
36
+ // A login shell reads only the first of these files it finds, so a new `.bash_profile` sources the one it hides.
37
+ 'if [ ! -f "$HOME/.bash_profile" ]; then',
38
+ " for STORM_LOGIN in .bash_login .profile; do",
39
+ ' if [ -f "$HOME/$STORM_LOGIN" ]; then',
40
+ ' printf \'[ -f "$HOME/%s" ] && . "$HOME/%s"\\n\' "$STORM_LOGIN" "$STORM_LOGIN" > "$HOME/.bash_profile"',
41
+ " break",
42
+ " fi",
43
+ " done",
44
+ "fi",
45
+ "STORM_LOCAL_BIN_EXPORT='export PATH=\"$HOME/.local/bin:$PATH\" # storm:local-bin'",
46
+ 'for STORM_PROFILE in "$HOME/.bash_profile" "$HOME/.bashrc"; do',
47
+ ' touch "$STORM_PROFILE"',
48
+ ' grep -Fqx "$STORM_LOCAL_BIN_EXPORT" "$STORM_PROFILE" || printf \'\\n%s\\n\' "$STORM_LOCAL_BIN_EXPORT" >> "$STORM_PROFILE"',
49
+ "done",
50
+ ].join("\n");
26
51
  /**
27
52
  * Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
28
53
  * and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
29
- * steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
30
- * than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
31
- * spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
54
+ * steps run, and the script puts `$HOME/.local/bin` first on `PATH` (persisting it idempotently to `$HOME/.bash_profile`
55
+ * and `$HOME/.bashrc` so pre-installed shims such as `~/.global/pnpm/bin` never shadow installed tools), installs `git`
56
+ * when absent via `dnf` or `apt-get`, downloads Node into `$HOME/.local/bin` when the image's Node is older than
57
+ * `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or spread
58
+ * it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
32
59
  */
33
60
  export const pnpmToolchains = [
34
61
  {
@@ -36,8 +63,17 @@ export const pnpmToolchains = [
36
63
  baseFiles: ["package.json"],
37
64
  script: [
38
65
  "set -euo pipefail",
39
- 'mkdir -p "$HOME/.local/bin"',
40
- "command -v git >/dev/null || sudo dnf install -y -q git",
66
+ PNPM_TOOLCHAINS_PROFILE_SCRIPT,
67
+ "if ! command -v git >/dev/null; then",
68
+ " if command -v dnf >/dev/null; then",
69
+ " sudo dnf install -y -q git",
70
+ " elif command -v apt-get >/dev/null; then",
71
+ " sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq git",
72
+ " else",
73
+ ' echo "git is not installed and neither dnf nor apt-get is available" >&2',
74
+ " exit 1",
75
+ " fi",
76
+ "fi",
41
77
  "git --version",
42
78
  `STORM_TOOLCHAINS="$(node - <<'STORM_MANIFEST_EOF'\n${PNPM_TOOLCHAINS_MANIFEST_SCRIPT}\nSTORM_MANIFEST_EOF\n)"`,
43
79
  'read -r STORM_NODE_MIN STORM_PNPM_VERSION <<< "$STORM_TOOLCHAINS"',
package/dist/context.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { Presentation } from "./presentation.ts";
5
5
  import type { RESOURCES, StormDriverContextMap, StormResourceContextMap } from "./extensions.ts";
6
6
  import { type CommandGateway, type JobSummaryGateway, type PackageBinGateway, type ProgressTerminal } from "./core/index.ts";
7
7
  import { type RunDirectoryGateway } from "./run-directory/index.ts";
8
- import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotIndexGateway, type RunnerTerminal } from "./runner/index.ts";
8
+ import { type CheckoutGateway, type GhTokenGateway, type RunnerSandboxGateway, type RunnerSnapshotIndexGateway, type RunnerTerminal } from "./runner/index.ts";
9
9
  import { type Clock, type Timer } from "./time/index.ts";
10
10
  /**
11
11
  * The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
@@ -24,6 +24,8 @@ export interface StormContext {
24
24
  readonly fileListsFiles: FileListsFileGateway;
25
25
  /** The local Git checkout the runner uploads from. */
26
26
  readonly checkout: CheckoutGateway;
27
+ /** Reads a GitHub token via `gh auth token` for `{ kind: "gh" }` sandbox credentials. */
28
+ readonly ghTokens: GhTokenGateway;
27
29
  /** The per-machine local snapshot index. */
28
30
  readonly runnerSnapshots: RunnerSnapshotIndexGateway;
29
31
  /** Vercel Sandbox, where runner and build sandboxes run. */
package/dist/context.js CHANGED
@@ -6,7 +6,7 @@ import { liveCredentialGateway, liveGitHubActionsTokenGateway, liveVercelOidcTok
6
6
  import { packageBinService } from "./local-services.js";
7
7
  import { liveCommandGateway, liveJobSummaryGateway, livePackageBinGateway, liveProgressTerminal, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
8
8
  import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
9
- import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotIndexGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotIndexGateway, } from "./runner/index.js";
9
+ import { liveCheckoutGateway, liveGhTokenGateway, liveRunnerSandboxGateway, liveRunnerSnapshotIndexGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotIndexGateway, } from "./runner/index.js";
10
10
  import { systemClock, systemTimer } from "./time/index.js";
11
11
  /**
12
12
  * The launcher resolvers over an app's context, from its working directory, checking the file against every resource
@@ -50,6 +50,7 @@ export function liveContext(options) {
50
50
  config: liveConfigGateway(),
51
51
  fileListsFiles: liveFileListsFileGateway(),
52
52
  checkout: liveCheckoutGateway(),
53
+ ghTokens: liveGhTokenGateway({ env: options.env }),
53
54
  runnerSnapshots: snapshots.ok
54
55
  ? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory })
55
56
  : unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
@@ -25,7 +25,7 @@ export interface RanRunner {
25
25
  readonly uploadBytes: number;
26
26
  readonly vcpus: number;
27
27
  readonly region: string;
28
- readonly runtime: string;
28
+ readonly image: string;
29
29
  /** How long the build step took, in milliseconds. */
30
30
  readonly buildMs: number;
31
31
  }
package/dist/core/run.js CHANGED
@@ -202,7 +202,7 @@ async function runInVercelSandbox(context, runner, input) {
202
202
  uploadBytes: ready.uploadBytes,
203
203
  vcpus: ready.vcpus,
204
204
  region: ready.region,
205
- runtime: ready.runtime,
205
+ image: ready.image,
206
206
  buildMs: ready.buildMs,
207
207
  },
208
208
  };
@@ -1,4 +1,4 @@
1
- import type { ManifestEntry, Mount } from "@vercel/clinkr";
1
+ import type { Mount } from "@vercel/clinkr";
2
2
  import type { StormApp } from "./context.ts";
3
3
  import type { ExtensionCommands } from "./sdk/extension/commands.ts";
4
4
  /** One extension's command tree, and the command path storm mounts it at. */
@@ -14,12 +14,7 @@ export interface ExtensionCommandsEntry {
14
14
  export declare const EXTENSION_COMMANDS: readonly ExtensionCommandsEntry[];
15
15
  /**
16
16
  * Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
17
- * `dist/`), which `application.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
17
+ * `dist/`), which `cli.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
18
18
  * Clinkr refuses a path that collides with a command of storm's own or another mount.
19
19
  */
20
20
  export declare function extensionMounts(root: string): readonly Mount<StormApp>[];
21
- /**
22
- * Every extension's command tree, mounted from pre-built static manifests (keyed by each extension's `directory`), for
23
- * single-file compiled builds that do not scan directories at runtime.
24
- */
25
- export declare function extensionManifestMounts(manifests: Readonly<Record<string, Readonly<Record<string, ManifestEntry>>>>): readonly Mount<StormApp>[];
@@ -1,11 +1,10 @@
1
- // The extensions' own command trees, each with the path `application.ts` mounts it at. It is the one file besides the
1
+ // The extensions' own command trees, each with the path `cli.ts` mounts it at. It is the one file besides the
2
2
  // extension registry (`src/extensions.ts`) that names an extension, and it imports only each extension's
3
3
  // `command-tree.ts`, which loads no resource: help lists `ext testserver` without loading the extension registry, the
4
4
  // resources, the runner, or the SDK. This file places each tree, not its extension: the tree of an extension that
5
5
  // brings a resource goes under `ext <name>`, so its storm commands can't collide with storm's own. `.oxlintrc.json`
6
6
  // holds this file to `command-tree.ts`; `test/unit/extension-commands.test.ts` holds its list to the extensions'
7
- // `commands`. `scripts/bundle.js` reads the list from tsc's build to bundle each tree's commands, and
8
- // `scripts/build-bun-entry.js` reads it to emit static manifests mounted via `extensionManifestMounts`.
7
+ // `commands`. `scripts/bundle.js` reads the list from tsc's build to bundle each tree's commands.
9
8
  import { testserverExtensionCommands } from "./extensions/testserver/command-tree.js";
10
9
  /**
11
10
  * Every extension's command tree, in extension order, with its path, checked against the app Clinkr hands their
@@ -16,22 +15,9 @@ export const EXTENSION_COMMANDS = [
16
15
  ];
17
16
  /**
18
17
  * Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
19
- * `dist/`), which `application.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
18
+ * `dist/`), which `cli.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
20
19
  * Clinkr refuses a path that collides with a command of storm's own or another mount.
21
20
  */
22
21
  export function extensionMounts(root) {
23
22
  return EXTENSION_COMMANDS.map(({ commands, path }) => commands.mount({ path, root }));
24
23
  }
25
- /**
26
- * Every extension's command tree, mounted from pre-built static manifests (keyed by each extension's `directory`), for
27
- * single-file compiled builds that do not scan directories at runtime.
28
- */
29
- export function extensionManifestMounts(manifests) {
30
- return EXTENSION_COMMANDS.map(({ commands, path }) => {
31
- const manifest = manifests[commands.directory];
32
- if (manifest === undefined) {
33
- throw new Error(`Missing bundled command manifest for extension directory "${commands.directory}".`);
34
- }
35
- return commands.mount({ path, manifest });
36
- });
37
- }
@@ -22,17 +22,17 @@ import {
22
22
  } from "../../../../../chunks/chunk-72ZFEMAW.js";
23
23
  import {
24
24
  testserverCommands
25
- } from "../../../../../chunks/chunk-2RNDPDTJ.js";
25
+ } from "../../../../../chunks/chunk-TXCOFC7N.js";
26
26
  import {
27
27
  configErrors,
28
28
  credentialErrors,
29
29
  credentialSourceErrors
30
- } from "../../../../../chunks/chunk-RNAS7JHE.js";
30
+ } from "../../../../../chunks/chunk-2JMWUKH3.js";
31
31
  import "../../../../../chunks/chunk-XBDRVFEV.js";
32
32
  import {
33
33
  defineOutcomes,
34
34
  renderOutcome
35
- } from "../../../../../chunks/chunk-4WAMTUWZ.js";
35
+ } from "../../../../../chunks/chunk-24UYAK4R.js";
36
36
 
37
37
  // src/extensions/testserver/commands/pool/create/command.ts
38
38
  import { z as z2 } from "zod";
@@ -3,12 +3,12 @@ import {
3
3
  } from "../../../../../chunks/chunk-72ZFEMAW.js";
4
4
  import {
5
5
  testserverCommands
6
- } from "../../../../../chunks/chunk-2RNDPDTJ.js";
6
+ } from "../../../../../chunks/chunk-TXCOFC7N.js";
7
7
  import "../../../../../chunks/chunk-XBDRVFEV.js";
8
8
  import {
9
9
  defineOutcomes,
10
10
  renderOutcome
11
- } from "../../../../../chunks/chunk-4WAMTUWZ.js";
11
+ } from "../../../../../chunks/chunk-24UYAK4R.js";
12
12
 
13
13
  // src/extensions/testserver/commands/pool/list/command.ts
14
14
  import { z as z2 } from "zod";
@@ -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,
@@ -75,7 +75,7 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
75
  team: z.ZodNullable<z.ZodString>;
76
76
  project: z.ZodNullable<z.ZodString>;
77
77
  region: z.ZodString;
78
- runtime: z.ZodString;
78
+ image: z.ZodString;
79
79
  vcpus: z.ZodNumber;
80
80
  base: z.ZodString;
81
81
  baseRef: z.ZodString;
@@ -95,7 +95,7 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
95
  }, z.core.$strip>], "kind">;
96
96
  /**
97
97
  * Where the command ran: on the launch machine (`launch-machine`), or in a Vercel Sandbox (`vercel-sandbox`):
98
- * 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
99
99
  * with `baseRef`, all known as the run starts; then, once the run is over, the runner sandbox's name and the runner
100
100
  * snapshot it started from, each null when the run stopped before it, when the runner sandbox's timeout stops it, as an
101
101
  * ISO time, when the run kept it running (null when it stopped and deleted it), and how many bytes of changes the run
@@ -163,7 +163,7 @@ export type SandboxState = SandboxRecord["state"];
163
163
  /** How many of its command log's last lines a runner sandbox record keeps. */
164
164
  export declare const SANDBOX_TAIL_LINES = 20;
165
165
  declare const runRecordSchema: z.ZodObject<{
166
- version: z.ZodLiteral<5>;
166
+ version: z.ZodLiteral<6>;
167
167
  startedAt: z.ZodString;
168
168
  cwd: z.ZodString;
169
169
  configFile: z.ZodNullable<z.ZodString>;
@@ -202,7 +202,7 @@ declare const runRecordSchema: z.ZodObject<{
202
202
  team: z.ZodNullable<z.ZodString>;
203
203
  project: z.ZodNullable<z.ZodString>;
204
204
  region: z.ZodString;
205
- runtime: z.ZodString;
205
+ image: z.ZodString;
206
206
  vcpus: z.ZodNumber;
207
207
  base: z.ZodString;
208
208
  baseRef: z.ZodString;
@@ -291,7 +291,7 @@ export type RunRecord = Readonly<Omit<z.output<typeof runRecordSchema>, "ended">
291
291
  }>;
292
292
  /** `run.json`'s text for `record`. */
293
293
  export declare function runRecordText(record: RunRecord): string;
294
- /** 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`. */
295
295
  export declare function parseRunRecord(text: string | undefined): RunRecord | undefined;
296
296
  /** The totals of `events`' final results; null without one. */
297
297
  export declare function testTotals(events: readonly TestEvent[]): RunTestTotals | null;
@@ -1,6 +1,6 @@
1
1
  // What a run records about itself in its run directory's `run.json`, which `storm runs` reads back: written as
2
2
  // the run directory opens, then replaced with how the run ended once it is over. The run directory gateway stores the
3
- // text; this file owns its shape, version 5, and what goes in it: where the command runs, as the run starts and
3
+ // text; this file owns its shape, version 6, and what goes in it: where the command runs, as the run starts and
4
4
  // once it is over, and how the run ended. Reading it back asks the resource definition set nothing: each resource
5
5
  // instance's facts read as recorded, beside its definition's name, and `runs show` lists the rows storm rendered for
6
6
  // them when the run ended, so a past run reads the same after a resource definition is renamed or its extension
@@ -40,7 +40,7 @@ const whereSchema = z.discriminatedUnion("kind", [
40
40
  team: z.string().nullable(),
41
41
  project: z.string().nullable(),
42
42
  region: z.string(),
43
- runtime: z.string(),
43
+ image: z.string(),
44
44
  vcpus: z.number().int().positive(),
45
45
  base: z.string(),
46
46
  baseRef: z.string(),
@@ -90,7 +90,7 @@ export const sandboxRecordSchema = z.object({
90
90
  /** How many of its command log's last lines a runner sandbox record keeps. */
91
91
  export const SANDBOX_TAIL_LINES = 20;
92
92
  const runRecordSchema = z.object({
93
- version: z.literal(5),
93
+ version: z.literal(6),
94
94
  startedAt: z.string(),
95
95
  cwd: z.string(),
96
96
  configFile: z.string().nullable(),
@@ -111,7 +111,7 @@ const runRecordSchema = z.object({
111
111
  export function runRecordText(record) {
112
112
  return JSON.stringify(record);
113
113
  }
114
- /** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
114
+ /** The run `text` records; undefined when there is no text, or it isn't a version 6 `run.json`. */
115
115
  export function parseRunRecord(text) {
116
116
  if (text === undefined)
117
117
  return undefined;
@@ -189,7 +189,7 @@ export function startedWhere(runner) {
189
189
  team: target?.team ?? null,
190
190
  project: target?.project ?? null,
191
191
  region: prepared.options.region,
192
- runtime: prepared.options.runtime,
192
+ image: prepared.options.image,
193
193
  vcpus: prepared.vcpus,
194
194
  base: prepared.base,
195
195
  baseRef: prepared.baseRef,
@@ -60,6 +60,11 @@ export type PrepareSnapshotBuildOutcome = {
60
60
  * of commits after it. It never mints, acquires or creates, and removes no cache file.
61
61
  */
62
62
  export declare function prepareSnapshotBuild(context: RunnerPrepareContext, request: SnapshotBuildRequest): Promise<PrepareSnapshotBuildOutcome>;
63
+ /**
64
+ * Whether two snapshot build plans build the same runner snapshot: same runner target (`name`, `region`, and `image`)
65
+ * and same `snapshotKey`. Used to deduplicate `--all-suites` builds.
66
+ */
67
+ export declare function sameSnapshotBuild(a: Pick<RunnerSnapshotPlan, "options" | "snapshotKey">, b: Pick<RunnerSnapshotPlan, "options" | "snapshotKey">): boolean;
63
68
  /** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the credentials. */
64
69
  export interface BuildSnapshotsRequest {
65
70
  readonly build: PreparedSnapshotBuild;
@@ -6,7 +6,7 @@
6
6
  // project, stopped.
7
7
  import { resolveBase } from "./base.js";
8
8
  import { snapshotIndexTags } from "./context.js";
9
- import { hasTimeLeft, SNAPSHOT_EXPIRATION_MS } from "./local-snapshot-index.js";
9
+ import { hasTimeLeft, matchesRunnerTarget, sameRunnerTarget, SNAPSHOT_EXPIRATION_MS } from "./local-snapshot-index.js";
10
10
  import { runnerNetworkPolicy } from "./network-policy.js";
11
11
  import { runnerSandboxScope } from "./scope.js";
12
12
  import { buildSnapshot } from "./snapshot-build.js";
@@ -60,9 +60,7 @@ export async function prepareSnapshotBuild(context, request) {
60
60
  const listed = await context.runnerSnapshots.listEntries();
61
61
  const now = context.clock.now();
62
62
  const indexed = (listed.ok ? listed.value.entries : []).filter((entry) => entry.base === base &&
63
- entry.runnerName === options.name &&
64
- entry.region === options.region &&
65
- entry.runtime === options.runtime &&
63
+ matchesRunnerTarget(entry, options) &&
66
64
  entry.snapshotKey === inputs.key &&
67
65
  hasTimeLeft(entry, now));
68
66
  const atMergeBase = base === mergeBase?.commit;
@@ -103,6 +101,13 @@ export async function prepareSnapshotBuild(context, request) {
103
101
  },
104
102
  };
105
103
  }
104
+ /**
105
+ * Whether two snapshot build plans build the same runner snapshot: same runner target (`name`, `region`, and `image`)
106
+ * and same `snapshotKey`. Used to deduplicate `--all-suites` builds.
107
+ */
108
+ export function sameSnapshotBuild(a, b) {
109
+ return sameRunnerTarget(a.options, b.options) && a.snapshotKey === b.snapshotKey;
110
+ }
106
111
  /**
107
112
  * Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
108
113
  * ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
@@ -118,6 +123,7 @@ export async function buildSnapshots(context, request, control, progress) {
118
123
  const scope = runnerSandboxScope(context, progress, {
119
124
  keepMs: 0,
120
125
  basePolicy: runnerNetworkPolicy(request.build.plan.options),
126
+ managedCredentials: request.build.plan.options.managedCredentials,
121
127
  signal,
122
128
  });
123
129
  try {
@@ -173,7 +179,7 @@ async function publishIn(context, request, control, progress) {
173
179
  teamId: access.teamId,
174
180
  projectId: access.projectId,
175
181
  region: options.region,
176
- runtime: options.runtime,
182
+ image: options.image,
177
183
  runnerName: options.name,
178
184
  snapshotKey: plan.snapshotKey,
179
185
  });