@cnc-tools/storm 0.7.0 → 0.8.1

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 (120) hide show
  1. package/dist/build-info.js +1 -1
  2. package/dist/commands/exec/cleanup.d.ts +3 -3
  3. package/dist/commands/exec/cleanup.js +1 -1
  4. package/dist/commands/exec/command.d.ts +771 -1
  5. package/dist/commands/exec/command.js +1 -1
  6. package/dist/commands/exec/live-view.js +3 -2
  7. package/dist/commands/exec/metadata.d.ts +1 -1
  8. package/dist/commands/exec/metadata.js +4 -0
  9. package/dist/commands/exec/mint-failed.d.ts +28 -0
  10. package/dist/commands/exec/outcomes.d.ts +476 -0
  11. package/dist/commands/exec/progress.js +3 -5
  12. package/dist/commands/exec/run-command.d.ts +2 -2
  13. package/dist/commands/exec/run-metadata.d.ts +1 -1
  14. package/dist/commands/exec/run-metadata.js +1 -1
  15. package/dist/commands/exec/tests-summary.d.ts +1 -1
  16. package/dist/commands/exec/tests-summary.js +1 -1
  17. package/dist/commands/runs/facts.d.ts +2 -2
  18. package/dist/commands/runs/facts.js +1 -1
  19. package/dist/commands/runs/list/command.d.ts +129 -1
  20. package/dist/commands/runs/list/command.js +1 -1
  21. package/dist/commands/runs/list/outcomes.d.ts +16 -0
  22. package/dist/commands/runs/list/outcomes.js +1 -1
  23. package/dist/commands/runs/logs/command.d.ts +263 -1
  24. package/dist/commands/runs/logs/command.js +1 -1
  25. package/dist/commands/runs/logs/outcomes.d.ts +105 -0
  26. package/dist/commands/runs/logs/outcomes.js +1 -1
  27. package/dist/commands/runs/show/command.d.ts +329 -1
  28. package/dist/commands/runs/show/command.js +1 -1
  29. package/dist/commands/runs/show/outcomes.d.ts +71 -0
  30. package/dist/commands/runs/show/outcomes.js +3 -3
  31. package/dist/commands/vitest/command.d.ts +886 -1
  32. package/dist/commands/vitest/command.js +1 -1
  33. package/dist/commands/vitest/metadata.d.ts +1 -1
  34. package/dist/commands/vitest/metadata.js +4 -0
  35. package/dist/commands/vitest/outcomes.d.ts +295 -0
  36. package/dist/config/errors.d.ts +73 -0
  37. package/dist/config/schema.d.ts +1 -1
  38. package/dist/config-file/define.d.ts +4 -3
  39. package/dist/config-file/define.js +1 -1
  40. package/dist/config-file/toolchain.js +1 -1
  41. package/dist/core/command-slots.d.ts +8 -2
  42. package/dist/core/command-slots.js +6 -2
  43. package/dist/core/index.d.ts +1 -1
  44. package/dist/credential/index.d.ts +1 -0
  45. package/dist/credential/index.js +1 -0
  46. package/dist/credential/settle.d.ts +20 -0
  47. package/dist/credential/target.d.ts +6 -0
  48. package/dist/credential/target.js +7 -0
  49. package/dist/resources/github/command.d.ts +54 -2
  50. package/dist/resources/github/config.js +1 -1
  51. package/dist/resources/github/index.js +1 -1
  52. package/dist/resources/github/resource.js +2 -2
  53. package/dist/resources/testserver/command.d.ts +208 -10
  54. package/dist/resources/testserver/command.js +7 -0
  55. package/dist/resources/testserver/commands/create/command.d.ts +810 -1
  56. package/dist/resources/testserver/commands/create/command.js +73 -23
  57. package/dist/resources/testserver/commands/create/metadata.js +6 -2
  58. package/dist/resources/testserver/commands/create/outcomes.d.ts +347 -0
  59. package/dist/resources/testserver/commands/create/outcomes.js +14 -1
  60. package/dist/resources/testserver/commands/list/command.d.ts +84 -1
  61. package/dist/resources/testserver/commands/list/command.js +1 -1
  62. package/dist/resources/testserver/commands/list/outcomes.d.ts +16 -0
  63. package/dist/resources/testserver/config.js +14 -4
  64. package/dist/resources/testserver/events.d.ts +11 -0
  65. package/dist/resources/testserver/index.js +8 -7
  66. package/dist/resources/testserver/lane.js +1 -0
  67. package/dist/resources/testserver/live/gateways.d.ts +2 -0
  68. package/dist/resources/testserver/live/gateways.js +16 -3
  69. package/dist/resources/testserver/pool/channels.d.ts +5 -2
  70. package/dist/resources/testserver/pool/channels.js +1 -1
  71. package/dist/resources/testserver/pool/create.d.ts +9 -2
  72. package/dist/resources/testserver/pool/create.js +8 -5
  73. package/dist/resources/testserver/pool/gateways.d.ts +6 -0
  74. package/dist/resources/testserver/pool/index.d.ts +1 -0
  75. package/dist/resources/testserver/pool/index.js +1 -0
  76. package/dist/resources/testserver/pool/live/pool-records.js +6 -2
  77. package/dist/resources/testserver/pool/pull-request.d.ts +96 -0
  78. package/dist/resources/testserver/pool/pull-request.js +118 -0
  79. package/dist/resources/testserver/pr-build-facts.d.ts +130 -0
  80. package/dist/resources/testserver/pr-build-facts.js +261 -0
  81. package/dist/resources/testserver/presentation.d.ts +2 -2
  82. package/dist/resources/testserver/presentation.js +13 -3
  83. package/dist/resources/testserver/provider.d.ts +16 -6
  84. package/dist/resources/testserver/provider.js +55 -16
  85. package/dist/resources/testserver/pull-request/gateways.d.ts +117 -0
  86. package/dist/resources/testserver/pull-request/gateways.js +5 -0
  87. package/dist/resources/testserver/pull-request/index.d.ts +5 -0
  88. package/dist/resources/testserver/pull-request/index.js +6 -0
  89. package/dist/resources/testserver/pull-request/live/github-rest.d.ts +28 -0
  90. package/dist/resources/testserver/pull-request/live/github-rest.js +114 -0
  91. package/dist/resources/testserver/pull-request/live/github-token-gateway.d.ts +12 -0
  92. package/dist/resources/testserver/pull-request/live/github-token-gateway.js +39 -0
  93. package/dist/resources/testserver/pull-request/live/pull-request-gateway.d.ts +10 -0
  94. package/dist/resources/testserver/pull-request/live/pull-request-gateway.js +27 -0
  95. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.d.ts +21 -0
  96. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.js +64 -0
  97. package/dist/resources/testserver/ran.d.ts +5 -0
  98. package/dist/resources/testserver/ran.js +19 -3
  99. package/dist/resources/testserver/resource.d.ts +5 -1
  100. package/dist/resources/testserver/resource.js +2 -2
  101. package/dist/resources/testserver/sandbox/build-reference.d.ts +38 -0
  102. package/dist/resources/testserver/sandbox/build-reference.js +79 -0
  103. package/dist/resources/testserver/sandbox/index.d.ts +1 -0
  104. package/dist/resources/testserver/sandbox/index.js +1 -0
  105. package/dist/resources.d.ts +265 -15
  106. package/dist/sdk/index.js +2 -2
  107. package/dist/story/command-line.d.ts +34 -0
  108. package/dist/story/command-line.js +100 -0
  109. package/dist/story/index.d.ts +1 -0
  110. package/dist/story/index.js +3 -2
  111. package/dist/vercel-cli/context.js +1 -1
  112. package/dist/vercel-cli/index.js +1 -1
  113. package/dist/vitest/config.js +2 -2
  114. package/dist/vitest/fixtures.d.ts +1 -1
  115. package/dist/vitest/fixtures.js +1 -1
  116. package/dist/vitest/index.js +3 -3
  117. package/dist/vitest/plan.js +1 -1
  118. package/package.json +2 -3
  119. package/skills/overview.md +2 -0
  120. package/skills/testserver-builds.md +82 -0
@@ -12,7 +12,7 @@ export function command(cmd) {
12
12
  command: z.array(z.string()).min(1, { message: "Give the command to run after --" }),
13
13
  }),
14
14
  cli: { options: RUN_CLI_OPTIONS, positionals: ["command"] },
15
- outcomes,
15
+ response: outcomes,
16
16
  validate: runProblems,
17
17
  handler: async (context, request) => await runCommand(context, request, {
18
18
  name: "exec",
@@ -5,6 +5,7 @@
5
5
  // starts, it is printed above for good in its final form. Each resource lane's rows are its presentation's text
6
6
  // (`RESOURCE_PRESENTATIONS`), laid out here.
7
7
  import { cleanupProblems, megabytesText, } from "../../core/index.js";
8
+ import { mintTargetText } from "../../credential/index.js";
8
9
  import { RESOURCE_PRESENTATIONS } from "../../resources.js";
9
10
  import { versionText } from "../../version.js";
10
11
  import { commandEnd, LANE_WIDTH } from "./progress.js";
@@ -121,7 +122,7 @@ function elapsed(view, from, to) {
121
122
  return from === undefined || end === undefined ? "" : seconds(end - from);
122
123
  }
123
124
  function credentialLine(mint, view) {
124
- return view.row(` ${view.glyph(mint.status)} credential ${mint.target.team}/${mint.target.project}`, elapsed(view, mint.startedAt, mint.endedAt));
125
+ return view.row(` ${view.glyph(mint.status)} credential ${mintTargetText(mint.target)}`, elapsed(view, mint.startedAt, mint.endedAt));
125
126
  }
126
127
  /**
127
128
  * The lanes block: a row for each resource lane the run holds, a runner row with its current step and the steps it
@@ -272,7 +273,7 @@ function localResourcesFrame(state, view) {
272
273
  const { mint } = state;
273
274
  const draw = laneDraw(view);
274
275
  const mintRow = mint !== undefined && mint.status === "running"
275
- ? view.row(` ${view.glyph("running")} minting a credential for ${mint.target.team}/${mint.target.project}`, elapsed(view, mint.startedAt, mint.endedAt))
276
+ ? view.row(` ${view.glyph("running")} minting a credential for ${mintTargetText(mint.target)}`, elapsed(view, mint.startedAt, mint.endedAt))
276
277
  : undefined;
277
278
  const rows = RESOURCE_PRESENTATIONS.lanes.flatMap((lane) => {
278
279
  const row = lane.localRow(state.resources, draw);
@@ -9,7 +9,7 @@ export declare const metadata: {
9
9
  };
10
10
  testserverBuild: {
11
11
  readonly valueLabel: "BUILD";
12
- readonly description: "The build the Testserver sandboxes run: a build name or the build channel stable or latest_main, overriding resources.testserverPool.build in storm.config.ts; default stable. Gives the run a Testserver side.";
12
+ readonly description: "The build the Testserver sandboxes run: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL, overriding resources.testserverPool.build in storm.config.ts; default stable. A pull request runs on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN or gh auth token, or refuses. Gives the run a Testserver side.";
13
13
  };
14
14
  testserverMinTimeLeft: {
15
15
  readonly valueLabel: "DURATION";
@@ -35,6 +35,10 @@ export const metadata = {
35
35
  argv: "--local --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
36
36
  description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts.",
37
37
  },
38
+ {
39
+ argv: "--local --testserver-build pr:104196 -- pnpm test",
40
+ description: "Run the tests on this machine against the Testserver build of vercel/api pull request 104196's head commit.",
41
+ },
38
42
  {
39
43
  argv: "--local --testserver-no-create --testserver-sandboxes 4 -- pnpm test",
40
44
  description: "Run only on Testserver sandboxes already in the pool, never minting.",
@@ -8,4 +8,32 @@ export declare const mintFailedErrors: import("@vercel/clinkr").SharedErrors<{
8
8
  runner: z.ZodBoolean;
9
9
  cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
10
10
  }, z.core.$strip>;
11
+ }, {
12
+ readonly mintFailed: {
13
+ readonly exitCode: 1;
14
+ readonly description: "The vercel CLI couldn't mint a credential, so the command didn't run. In a runner run, the credential was for the runner sandbox, which always needs one; in a local run, for a resource that couldn't go on without it.";
15
+ readonly schema: z.ZodObject<{
16
+ team: z.ZodString;
17
+ project: z.ZodString;
18
+ cause: z.ZodString;
19
+ fix: z.ZodString;
20
+ runner: z.ZodBoolean;
21
+ cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
22
+ }, z.core.$strip>;
23
+ readonly render: ({ cause, fix, runner, cleanup }: {
24
+ team: string;
25
+ project: string;
26
+ cause: string;
27
+ fix: string;
28
+ runner: boolean;
29
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
30
+ }) => {
31
+ message: string;
32
+ rows?: readonly import("@vercel/clinkr").Row[];
33
+ next: {
34
+ type: "text";
35
+ text: string;
36
+ }[];
37
+ };
38
+ };
11
39
  }>;
@@ -215,6 +215,193 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
215
215
  message: z.ZodString;
216
216
  cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
217
217
  }, z.core.$strip>;
218
+ }, {
219
+ readonly credentialUnused: {
220
+ readonly exitCode: 2;
221
+ readonly description: "--credential was given to a run that holds no resource that takes a credential.";
222
+ readonly schema: z.ZodObject<{
223
+ flags: z.ZodArray<z.ZodString>;
224
+ configFile: z.ZodNullable<z.ZodString>;
225
+ }, z.core.$strip>;
226
+ readonly render: ({ flags }: {
227
+ flags: string[];
228
+ configFile: string | null;
229
+ }) => {
230
+ message: string;
231
+ next: {
232
+ type: "text";
233
+ text: string;
234
+ }[];
235
+ };
236
+ };
237
+ readonly missingRunner: {
238
+ readonly exitCode: 2;
239
+ readonly description: "A runner run (no --local) needs a runner recipe, and no storm.config.ts gives a runner key.";
240
+ readonly schema: z.ZodObject<{
241
+ configFile: z.ZodNullable<z.ZodString>;
242
+ }, z.core.$strip>;
243
+ readonly render: ({ configFile }: {
244
+ configFile: string | null;
245
+ }) => {
246
+ message: string;
247
+ next: {
248
+ type: "text";
249
+ text: string;
250
+ }[];
251
+ };
252
+ };
253
+ readonly noBaseRef: {
254
+ readonly exitCode: 1;
255
+ readonly description: "In a runner run, none of the runner recipe's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.";
256
+ readonly schema: z.ZodObject<{
257
+ refs: z.ZodArray<z.ZodObject<{
258
+ ref: z.ZodString;
259
+ reason: z.ZodEnum<{
260
+ missing: "missing";
261
+ unrelated: "unrelated";
262
+ }>;
263
+ }, z.core.$strip>>;
264
+ }, z.core.$strip>;
265
+ readonly render: ({ refs }: {
266
+ refs: {
267
+ ref: string;
268
+ reason: "missing" | "unrelated";
269
+ }[];
270
+ }) => {
271
+ message: string;
272
+ rows: [string, string[]][];
273
+ next: {
274
+ type: "text";
275
+ text: string;
276
+ }[];
277
+ };
278
+ };
279
+ readonly submodulesRefused: {
280
+ readonly exitCode: 1;
281
+ readonly description: "In a runner run, the checkout has Git submodules, which neither the upload nor the base's files carry.";
282
+ readonly schema: z.ZodObject<{
283
+ paths: z.ZodArray<z.ZodString>;
284
+ }, z.core.$strip>;
285
+ readonly render: ({ paths }: {
286
+ paths: string[];
287
+ }) => {
288
+ message: string;
289
+ next: {
290
+ type: "text";
291
+ text: string;
292
+ }[];
293
+ };
294
+ };
295
+ readonly snapshotGone: {
296
+ readonly exitCode: 1;
297
+ readonly description: "In a runner run, the cached runner snapshot the run picked was gone (the Sandbox API answered 410), so its cache entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.";
298
+ readonly schema: z.ZodObject<{
299
+ snapshotId: z.ZodString;
300
+ base: z.ZodString;
301
+ removal: z.ZodNullable<z.ZodObject<{
302
+ path: z.ZodString;
303
+ message: z.ZodString;
304
+ }, z.core.$strip>>;
305
+ cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
306
+ }, z.core.$strip>;
307
+ readonly render: ({ snapshotId, removal, cleanup }: {
308
+ snapshotId: string;
309
+ base: string;
310
+ removal: {
311
+ path: string;
312
+ message: string;
313
+ } | null;
314
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
315
+ }) => {
316
+ message: string;
317
+ rows?: readonly import("@vercel/clinkr").Row[];
318
+ next: {
319
+ type: "text";
320
+ text: string;
321
+ }[];
322
+ };
323
+ };
324
+ readonly runnerFailed: {
325
+ readonly exitCode: 1;
326
+ readonly description: "In a runner run, the runner couldn't run the command: a snapshot build step, applying the changes, the install or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, git or tar failed on this machine, or the credential names no team and project ids.";
327
+ readonly schema: z.ZodObject<{
328
+ failure: z.ZodUnion<readonly [z.ZodObject<{
329
+ kind: z.ZodEnum<{
330
+ "apply-failed": "apply-failed";
331
+ "build-failed": "build-failed";
332
+ "install-failed": "install-failed";
333
+ "snapshot-build-step-failed": "snapshot-build-step-failed";
334
+ }>;
335
+ label: z.ZodString;
336
+ exitCode: z.ZodNullable<z.ZodNumber>;
337
+ tail: z.ZodArray<z.ZodString>;
338
+ }, z.core.$strip>, z.ZodObject<{
339
+ kind: z.ZodLiteral<"sandbox-api-failed">;
340
+ operation: z.ZodString;
341
+ status: z.ZodNullable<z.ZodNumber>;
342
+ message: z.ZodString;
343
+ }, z.core.$strip>, z.ZodObject<{
344
+ kind: z.ZodLiteral<"checkout-failed">;
345
+ message: z.ZodString;
346
+ command: z.ZodNullable<z.ZodString>;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"credential-claims-missing">;
349
+ team: z.ZodString;
350
+ project: z.ZodString;
351
+ }, z.core.$strip>]>;
352
+ cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
353
+ }, z.core.$strip>;
354
+ readonly render: ({ failure, cleanup }: {
355
+ failure: {
356
+ kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
357
+ label: string;
358
+ exitCode: number | null;
359
+ tail: string[];
360
+ } | {
361
+ kind: "sandbox-api-failed";
362
+ operation: string;
363
+ status: number | null;
364
+ message: string;
365
+ } | {
366
+ kind: "checkout-failed";
367
+ message: string;
368
+ command: string | null;
369
+ } | {
370
+ kind: "credential-claims-missing";
371
+ team: string;
372
+ project: string;
373
+ };
374
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
375
+ }) => {
376
+ message: string;
377
+ rows?: import("@vercel/clinkr").Row[];
378
+ next: {
379
+ type: "text";
380
+ text: string;
381
+ }[];
382
+ };
383
+ };
384
+ readonly spawnFailed: {
385
+ readonly exitCode: 1;
386
+ readonly description: "The command couldn't start.";
387
+ readonly schema: z.ZodObject<{
388
+ executable: z.ZodString;
389
+ message: z.ZodString;
390
+ cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
391
+ }, z.core.$strip>;
392
+ readonly render: ({ executable, message, cleanup }: {
393
+ executable: string;
394
+ message: string;
395
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
396
+ }) => {
397
+ message: string;
398
+ rows?: readonly import("@vercel/clinkr").Row[];
399
+ next: {
400
+ type: "text";
401
+ text: string;
402
+ }[];
403
+ };
404
+ };
218
405
  }>;
219
406
  /** Every error a run ends with, in order: the config's, the credential's, each resource's, the mint's, the run's. */
220
407
  export declare const RUN_ERRORS: {
@@ -334,6 +521,45 @@ export declare const RUN_ERRORS: {
334
521
  } & {
335
522
  readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
336
523
  }]>;
524
+ prBuildExpired: import("@vercel/clinkr").SharedError<"pr_build_expired", [{
525
+ pr: number;
526
+ headSha: string;
527
+ build: string;
528
+ expiresAt: string;
529
+ } & {
530
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
531
+ }]>;
532
+ prBuildNotReady: import("@vercel/clinkr").SharedError<"pr_build_not_ready", [{
533
+ pr: number;
534
+ headSha: string;
535
+ newest: {
536
+ build: string;
537
+ headSha: string;
538
+ createdAt: string;
539
+ } | null;
540
+ } & {
541
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
542
+ }]>;
543
+ prBuildsUnlisted: import("@vercel/clinkr").SharedError<"pr_builds_unlisted", [{
544
+ pr: number;
545
+ failure: {
546
+ kind: "connect-failed" | "http-error" | "malformed" | "not-found" | "rejected" | "timeout";
547
+ status: number | null;
548
+ detail: string;
549
+ };
550
+ } & {
551
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
552
+ }]>;
553
+ pullRequestUnreadable: import("@vercel/clinkr").SharedError<"pull_request_unreadable", [{
554
+ pr: number;
555
+ repo: string;
556
+ kind: "connect-failed" | "http-error" | "malformed" | "no-token" | "not-found" | "rejected" | "timeout";
557
+ status: number | null;
558
+ message: string | null;
559
+ tokenOrigin: "GH_TOKEN" | "GITHUB_TOKEN" | "gh auth token" | null;
560
+ } & {
561
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
562
+ }]>;
337
563
  runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
338
564
  failure: {
339
565
  kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
@@ -606,6 +832,256 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
606
832
  } & {
607
833
  readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
608
834
  }]>;
835
+ prBuildExpired: import("@vercel/clinkr").SharedError<"pr_build_expired", [{
836
+ pr: number;
837
+ headSha: string;
838
+ build: string;
839
+ expiresAt: string;
840
+ } & {
841
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
842
+ }]>;
843
+ prBuildNotReady: import("@vercel/clinkr").SharedError<"pr_build_not_ready", [{
844
+ pr: number;
845
+ headSha: string;
846
+ newest: {
847
+ build: string;
848
+ headSha: string;
849
+ createdAt: string;
850
+ } | null;
851
+ } & {
852
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
853
+ }]>;
854
+ prBuildsUnlisted: import("@vercel/clinkr").SharedError<"pr_builds_unlisted", [{
855
+ pr: number;
856
+ failure: {
857
+ kind: "connect-failed" | "http-error" | "malformed" | "not-found" | "rejected" | "timeout";
858
+ status: number | null;
859
+ detail: string;
860
+ };
861
+ } & {
862
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
863
+ }]>;
864
+ pullRequestUnreadable: import("@vercel/clinkr").SharedError<"pull_request_unreadable", [{
865
+ pr: number;
866
+ repo: string;
867
+ kind: "connect-failed" | "http-error" | "malformed" | "no-token" | "not-found" | "rejected" | "timeout";
868
+ status: number | null;
869
+ message: string | null;
870
+ tokenOrigin: "GH_TOKEN" | "GITHUB_TOKEN" | "gh auth token" | null;
871
+ } & {
872
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
873
+ }]>;
874
+ runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
875
+ failure: {
876
+ kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
877
+ label: string;
878
+ exitCode: number | null;
879
+ tail: string[];
880
+ } | {
881
+ kind: "sandbox-api-failed";
882
+ operation: string;
883
+ status: number | null;
884
+ message: string;
885
+ } | {
886
+ kind: "checkout-failed";
887
+ message: string;
888
+ command: string | null;
889
+ } | {
890
+ kind: "credential-claims-missing";
891
+ team: string;
892
+ project: string;
893
+ };
894
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
895
+ }]>;
896
+ snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
897
+ snapshotId: string;
898
+ base: string;
899
+ removal: {
900
+ path: string;
901
+ message: string;
902
+ } | null;
903
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
904
+ }]>;
905
+ spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
906
+ executable: string;
907
+ message: string;
908
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
909
+ }]>;
910
+ submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
911
+ paths: string[];
912
+ }]>;
913
+ tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
914
+ cause: "request-failed" | "variables-missing";
915
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
916
+ status: number | null;
917
+ said: string | null;
918
+ detail: string;
919
+ fix: string;
920
+ ttlMinutes: number;
921
+ failedCreates: {
922
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
923
+ detail: string | null;
924
+ }[];
925
+ sandboxMayExist: boolean;
926
+ } & {
927
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
928
+ }]>;
929
+ }, {
930
+ credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
931
+ origin: {
932
+ source: "mint";
933
+ team: string;
934
+ project: string;
935
+ } | {
936
+ source: "github-actions";
937
+ claims: {
938
+ aud: string;
939
+ repository: string;
940
+ } | null;
941
+ };
942
+ fix: string;
943
+ status: number;
944
+ vercelId: string | null;
945
+ ttlMinutes: number;
946
+ failedCreates: {
947
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
948
+ detail: string | null;
949
+ }[];
950
+ unpooled: {
951
+ testserverUrl: string;
952
+ path: string;
953
+ message: string;
954
+ }[];
955
+ sandboxMayExist: boolean;
956
+ } & {
957
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
958
+ }]>;
959
+ credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
960
+ flags: string[];
961
+ configFile: string | null;
962
+ }]>;
963
+ githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
964
+ repo: string;
965
+ status: number | null;
966
+ message: string;
967
+ } & {
968
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
969
+ }]>;
970
+ githubTokenMissing: import("@vercel/clinkr").SharedError<"github_token_missing", [data: {
971
+ tokenEnv: string;
972
+ repo: string;
973
+ configFile: string | null;
974
+ requiredBy: "config" | "set";
975
+ }]>;
976
+ invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
977
+ file: string;
978
+ problems: {
979
+ key: string | null;
980
+ location: {
981
+ line: number;
982
+ column: number | null;
983
+ } | null;
984
+ problem: string;
985
+ }[];
986
+ }]>;
987
+ invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
988
+ configFile: string | null;
989
+ problems: {
990
+ key: string;
991
+ problem: string;
992
+ values: {
993
+ key: string;
994
+ value: string;
995
+ source: "default" | "file" | "flag";
996
+ }[];
997
+ }[];
998
+ }]>;
999
+ mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
1000
+ team: string;
1001
+ project: string;
1002
+ cause: string;
1003
+ fix: string;
1004
+ runner: boolean;
1005
+ cleanup: import("./cleanup.ts").StormCleanupFacts;
1006
+ }]>;
1007
+ missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
1008
+ configFile: string | null;
1009
+ }]>;
1010
+ missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
1011
+ missing: ("project" | "scope")[];
1012
+ }]>;
1013
+ noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
1014
+ refs: {
1015
+ ref: string;
1016
+ reason: "missing" | "unrelated";
1017
+ }[];
1018
+ }]>;
1019
+ noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
1020
+ requested: number;
1021
+ ttlMinutes: number;
1022
+ failedCreates: {
1023
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
1024
+ detail: string | null;
1025
+ }[];
1026
+ sandboxMayExist: boolean;
1027
+ } & {
1028
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1029
+ }]>;
1030
+ noUsableSandboxes: import("@vercel/clinkr").SharedError<"no_usable_sandboxes", [{
1031
+ requested: number;
1032
+ build: string;
1033
+ } & {
1034
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1035
+ }]>;
1036
+ poolUnavailable: import("@vercel/clinkr").SharedError<"pool_unavailable", [data: {
1037
+ path: string;
1038
+ message: string;
1039
+ }]>;
1040
+ poolUnreadable: import("@vercel/clinkr").SharedError<"pool_unreadable", [{
1041
+ path: string;
1042
+ message: string;
1043
+ } & {
1044
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1045
+ }]>;
1046
+ prBuildExpired: import("@vercel/clinkr").SharedError<"pr_build_expired", [{
1047
+ pr: number;
1048
+ headSha: string;
1049
+ build: string;
1050
+ expiresAt: string;
1051
+ } & {
1052
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1053
+ }]>;
1054
+ prBuildNotReady: import("@vercel/clinkr").SharedError<"pr_build_not_ready", [{
1055
+ pr: number;
1056
+ headSha: string;
1057
+ newest: {
1058
+ build: string;
1059
+ headSha: string;
1060
+ createdAt: string;
1061
+ } | null;
1062
+ } & {
1063
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1064
+ }]>;
1065
+ prBuildsUnlisted: import("@vercel/clinkr").SharedError<"pr_builds_unlisted", [{
1066
+ pr: number;
1067
+ failure: {
1068
+ kind: "connect-failed" | "http-error" | "malformed" | "not-found" | "rejected" | "timeout";
1069
+ status: number | null;
1070
+ detail: string;
1071
+ };
1072
+ } & {
1073
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1074
+ }]>;
1075
+ pullRequestUnreadable: import("@vercel/clinkr").SharedError<"pull_request_unreadable", [{
1076
+ pr: number;
1077
+ repo: string;
1078
+ kind: "connect-failed" | "http-error" | "malformed" | "no-token" | "not-found" | "rejected" | "timeout";
1079
+ status: number | null;
1080
+ message: string | null;
1081
+ tokenOrigin: "GH_TOKEN" | "GITHUB_TOKEN" | "gh auth token" | null;
1082
+ } & {
1083
+ readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
1084
+ }]>;
609
1085
  runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
610
1086
  failure: {
611
1087
  kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
@@ -1,3 +1,4 @@
1
+ import { mintTargetText } from "../../credential/index.js";
1
2
  import { megabytesText, secondsOf, secondsText } from "../../core/index.js";
2
3
  import { RESOURCE_PRESENTATIONS, RESOURCE_REPORTS, } from "../../resources.js";
3
4
  import { versionText } from "../../version.js";
@@ -76,10 +77,10 @@ function eventLines(event, now, state, line, options) {
76
77
  ];
77
78
  case "minting":
78
79
  state.mintStartedAt = now;
79
- return [line("mint", `credential for ${targetText(event.target)}…`)];
80
+ return [line("mint", `credential for ${mintTargetText(event.target)}…`)];
80
81
  case "minted":
81
82
  return [
82
- line("mint", `${event.ok ? "credential" : "no credential"} for ${targetText(event.target)} (${since(state.mintStartedAt)})`),
83
+ line("mint", `${event.ok ? "credential" : "no credential"} for ${mintTargetText(event.target)} (${since(state.mintStartedAt)})`),
83
84
  ];
84
85
  case "requesting-token":
85
86
  return [line("mint", "requesting a GitHub Actions OIDC token…")];
@@ -297,9 +298,6 @@ function noteText(note) {
297
298
  return `not reusing cached runner snapshots of base ${short(note.base)}: ${note.failure.message.replace(/\.$/, "")}`;
298
299
  }
299
300
  }
300
- function targetText(target) {
301
- return `${target.team}/${target.project}`;
302
- }
303
301
  // The notices: what a run reports that the live view's phases can't hold, so it prints them above the live region
304
302
  // as plain lines, and plain progress prints among its other lines. Each builder answers the lines' text, which the
305
303
  // caller prefixes with the time and the lane (`progressLine`). A resource's own notices are its presentation's.
@@ -153,7 +153,7 @@ export interface RunCommandSpec<TPlan, TRan, TRefusal> {
153
153
  * are hidden as `<token>` in the run's progress, its run directory, its job summary, its outcome, `spec.prepare`'s
154
154
  * refusal, and its command's output, in either kind of run.
155
155
  */
156
- export declare function runCommand<TPlan extends RunRecordPlan | undefined, TRan extends CommandResult, TRefusal extends CommandError = never>({ app, ui, signal }: ExecutionContext<StormApp>, request: RunCommandRequest, spec: RunCommandSpec<TPlan, TRan, TRefusal>): Promise<TRan | TRefusal | import("@vercel/clinkr").ClinkrError<"canceled"> | CommandError<"credential_unused"> | CommandError<"invalid_config"> | CommandError<"invalid_resource_options"> | CommandError<"mint_failed"> | CommandError<"missing_runner"> | CommandError<"missing_target"> | CommandError<"no_base_ref"> | CommandError<"runner_failed"> | CommandError<"snapshot_gone"> | CommandError<"spawn_failed"> | CommandError<"submodules_refused"> | CommandError<"credential_rejected" | "github_fixture_repo_unavailable" | "github_token_missing" | "no_sandboxes" | "no_usable_sandboxes" | "pool_unavailable" | "pool_unreadable" | "token_request_failed">>;
156
+ export declare function runCommand<TPlan extends RunRecordPlan | undefined, TRan extends CommandResult, TRefusal extends CommandError = never>({ app, ui, signal }: ExecutionContext<StormApp>, request: RunCommandRequest, spec: RunCommandSpec<TPlan, TRan, TRefusal>): Promise<TRan | TRefusal | import("@vercel/clinkr").ClinkrError<"canceled"> | CommandError<"credential_rejected"> | CommandError<"credential_unused"> | CommandError<"github_fixture_repo_unavailable"> | CommandError<"github_token_missing"> | CommandError<"invalid_config"> | CommandError<"invalid_resource_options"> | CommandError<"mint_failed"> | CommandError<"missing_runner"> | CommandError<"missing_target"> | CommandError<"no_base_ref"> | CommandError<"no_sandboxes"> | CommandError<"no_usable_sandboxes"> | CommandError<"pool_unavailable"> | CommandError<"pool_unreadable"> | CommandError<"pr_build_expired"> | CommandError<"pr_build_not_ready"> | CommandError<"pr_builds_unlisted"> | CommandError<"pull_request_unreadable"> | CommandError<"runner_failed"> | CommandError<"snapshot_gone"> | CommandError<"spawn_failed"> | CommandError<"submodules_refused"> | CommandError<"token_request_failed">>;
157
157
  /** What is wrong with a run's request that its schema can't say, as `validate` reports it. */
158
158
  export declare function runProblems({ set, credential, local, rebuildSnapshot, saveSnapshot, showOutput, keepSandbox, ...rest }: RunCommandRequest): readonly ArgumentIssue[];
159
159
  /**
@@ -205,7 +205,7 @@ declare function settleRun(app: StormApp, request: {
205
205
  readonly refusal: CommandError<"missing_target">;
206
206
  } | {
207
207
  readonly ok: false;
208
- readonly refusal: CommandError<"credential_rejected" | "github_fixture_repo_unavailable" | "github_token_missing" | "no_sandboxes" | "no_usable_sandboxes" | "pool_unavailable" | "pool_unreadable" | "token_request_failed">;
208
+ readonly refusal: CommandError<"credential_rejected"> | CommandError<"github_fixture_repo_unavailable"> | CommandError<"github_token_missing"> | CommandError<"no_sandboxes"> | CommandError<"no_usable_sandboxes"> | CommandError<"pool_unavailable"> | CommandError<"pool_unreadable"> | CommandError<"pr_build_expired"> | CommandError<"pr_build_not_ready"> | CommandError<"pr_builds_unlisted"> | CommandError<"pull_request_unreadable"> | CommandError<"token_request_failed">;
209
209
  } | {
210
210
  readonly ok: false;
211
211
  readonly refusal: CommandError<"credential_unused">;
@@ -8,7 +8,7 @@ export declare const RUN_FIELDS: {
8
8
  };
9
9
  readonly testserverBuild: {
10
10
  readonly valueLabel: "BUILD";
11
- readonly description: "The build the Testserver sandboxes run: a build name or the build channel stable or latest_main, overriding resources.testserverPool.build in storm.config.ts; default stable. Gives the run a Testserver side.";
11
+ readonly description: "The build the Testserver sandboxes run: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL, overriding resources.testserverPool.build in storm.config.ts; default stable. A pull request runs on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN or gh auth token, or refuses. Gives the run a Testserver side.";
12
12
  };
13
13
  readonly testserverMinTimeLeft: {
14
14
  readonly valueLabel: "DURATION";
@@ -10,7 +10,7 @@ export const RUN_FIELDS = {
10
10
  },
11
11
  testserverBuild: {
12
12
  valueLabel: "BUILD",
13
- description: "The build the Testserver sandboxes run: a build name or the build channel stable or latest_main, overriding resources.testserverPool.build in storm.config.ts; default stable. Gives the run a Testserver side.",
13
+ description: "The build the Testserver sandboxes run: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL, overriding resources.testserverPool.build in storm.config.ts; default stable. A pull request runs on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN or gh auth token, or refuses. Gives the run a Testserver side.",
14
14
  },
15
15
  testserverMinTimeLeft: {
16
16
  valueLabel: "DURATION",