@cnc-tools/storm 0.7.0 → 0.8.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 (113) 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/list/command.d.ts +129 -1
  18. package/dist/commands/runs/list/command.js +1 -1
  19. package/dist/commands/runs/list/outcomes.d.ts +16 -0
  20. package/dist/commands/runs/logs/command.d.ts +263 -1
  21. package/dist/commands/runs/logs/command.js +1 -1
  22. package/dist/commands/runs/logs/outcomes.d.ts +105 -0
  23. package/dist/commands/runs/show/command.d.ts +329 -1
  24. package/dist/commands/runs/show/command.js +1 -1
  25. package/dist/commands/runs/show/outcomes.d.ts +71 -0
  26. package/dist/commands/vitest/command.d.ts +886 -1
  27. package/dist/commands/vitest/command.js +1 -1
  28. package/dist/commands/vitest/metadata.d.ts +1 -1
  29. package/dist/commands/vitest/metadata.js +4 -0
  30. package/dist/commands/vitest/outcomes.d.ts +295 -0
  31. package/dist/config/errors.d.ts +73 -0
  32. package/dist/config/schema.d.ts +1 -1
  33. package/dist/config-file/define.d.ts +4 -3
  34. package/dist/config-file/define.js +1 -1
  35. package/dist/config-file/toolchain.js +1 -1
  36. package/dist/core/command-slots.d.ts +8 -2
  37. package/dist/core/command-slots.js +6 -2
  38. package/dist/core/index.d.ts +1 -1
  39. package/dist/credential/index.d.ts +1 -0
  40. package/dist/credential/index.js +1 -0
  41. package/dist/credential/settle.d.ts +20 -0
  42. package/dist/credential/target.d.ts +6 -0
  43. package/dist/credential/target.js +7 -0
  44. package/dist/resources/github/command.d.ts +54 -2
  45. package/dist/resources/github/config.js +1 -1
  46. package/dist/resources/github/index.js +1 -1
  47. package/dist/resources/github/resource.js +2 -2
  48. package/dist/resources/testserver/command.d.ts +208 -10
  49. package/dist/resources/testserver/command.js +7 -0
  50. package/dist/resources/testserver/commands/create/command.d.ts +808 -1
  51. package/dist/resources/testserver/commands/create/command.js +64 -23
  52. package/dist/resources/testserver/commands/create/metadata.js +6 -2
  53. package/dist/resources/testserver/commands/create/outcomes.d.ts +347 -0
  54. package/dist/resources/testserver/commands/create/outcomes.js +14 -1
  55. package/dist/resources/testserver/commands/list/command.d.ts +84 -1
  56. package/dist/resources/testserver/commands/list/command.js +1 -1
  57. package/dist/resources/testserver/commands/list/outcomes.d.ts +16 -0
  58. package/dist/resources/testserver/config.js +14 -4
  59. package/dist/resources/testserver/events.d.ts +9 -0
  60. package/dist/resources/testserver/index.js +8 -7
  61. package/dist/resources/testserver/lane.js +1 -0
  62. package/dist/resources/testserver/live/gateways.d.ts +2 -0
  63. package/dist/resources/testserver/live/gateways.js +16 -3
  64. package/dist/resources/testserver/pool/channels.d.ts +5 -2
  65. package/dist/resources/testserver/pool/channels.js +1 -1
  66. package/dist/resources/testserver/pool/create.d.ts +6 -2
  67. package/dist/resources/testserver/pool/create.js +6 -5
  68. package/dist/resources/testserver/pool/index.d.ts +1 -0
  69. package/dist/resources/testserver/pool/index.js +1 -0
  70. package/dist/resources/testserver/pool/pull-request.d.ts +89 -0
  71. package/dist/resources/testserver/pool/pull-request.js +85 -0
  72. package/dist/resources/testserver/pr-build-facts.d.ts +130 -0
  73. package/dist/resources/testserver/pr-build-facts.js +261 -0
  74. package/dist/resources/testserver/presentation.d.ts +2 -2
  75. package/dist/resources/testserver/presentation.js +12 -3
  76. package/dist/resources/testserver/provider.d.ts +16 -6
  77. package/dist/resources/testserver/provider.js +46 -15
  78. package/dist/resources/testserver/pull-request/gateways.d.ts +117 -0
  79. package/dist/resources/testserver/pull-request/gateways.js +5 -0
  80. package/dist/resources/testserver/pull-request/index.d.ts +5 -0
  81. package/dist/resources/testserver/pull-request/index.js +6 -0
  82. package/dist/resources/testserver/pull-request/live/github-rest.d.ts +28 -0
  83. package/dist/resources/testserver/pull-request/live/github-rest.js +114 -0
  84. package/dist/resources/testserver/pull-request/live/github-token-gateway.d.ts +12 -0
  85. package/dist/resources/testserver/pull-request/live/github-token-gateway.js +39 -0
  86. package/dist/resources/testserver/pull-request/live/pull-request-gateway.d.ts +10 -0
  87. package/dist/resources/testserver/pull-request/live/pull-request-gateway.js +27 -0
  88. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.d.ts +21 -0
  89. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.js +64 -0
  90. package/dist/resources/testserver/ran.d.ts +5 -0
  91. package/dist/resources/testserver/ran.js +19 -3
  92. package/dist/resources/testserver/resource.d.ts +5 -1
  93. package/dist/resources/testserver/resource.js +2 -2
  94. package/dist/resources/testserver/sandbox/build-reference.d.ts +38 -0
  95. package/dist/resources/testserver/sandbox/build-reference.js +79 -0
  96. package/dist/resources/testserver/sandbox/index.d.ts +1 -0
  97. package/dist/resources/testserver/sandbox/index.js +1 -0
  98. package/dist/resources.d.ts +265 -15
  99. package/dist/sdk/index.js +2 -2
  100. package/dist/story/command-line.d.ts +34 -0
  101. package/dist/story/command-line.js +100 -0
  102. package/dist/story/index.d.ts +1 -0
  103. package/dist/story/index.js +3 -2
  104. package/dist/vercel-cli/context.js +1 -1
  105. package/dist/vercel-cli/index.js +1 -1
  106. package/dist/vitest/config.js +2 -2
  107. package/dist/vitest/fixtures.d.ts +1 -1
  108. package/dist/vitest/fixtures.js +1 -1
  109. package/dist/vitest/index.js +3 -3
  110. package/dist/vitest/plan.js +1 -1
  111. package/package.json +3 -3
  112. package/skills/overview.md +2 -0
  113. package/skills/testserver-builds.md +80 -0
@@ -15,7 +15,7 @@ export function command(cmd) {
15
15
  return cmd.define({
16
16
  requestSchema: z.object({ ...RUN_REQUEST_FIELDS, args: z.array(z.string()).default([]) }),
17
17
  cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
18
- outcomes,
18
+ response: outcomes,
19
19
  validate: runProblems,
20
20
  handler: async (context, request) => await runCommand(context, request, {
21
21
  name: "vitest",
@@ -5,7 +5,7 @@ export declare const metadata: {
5
5
  fields: {
6
6
  testserverBuild: {
7
7
  readonly valueLabel: "BUILD";
8
- 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.";
8
+ 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.";
9
9
  };
10
10
  testserverMinTimeLeft: {
11
11
  readonly valueLabel: "DURATION";
@@ -23,6 +23,10 @@ export const metadata = {
23
23
  argv: "test/api -- -t creates",
24
24
  description: "Run the tests named creates in the files under test/api.",
25
25
  },
26
+ {
27
+ argv: "--testserver-build pr:104196",
28
+ description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit.",
29
+ },
26
30
  {
27
31
  argv: "--local --testserver-no-create",
28
32
  description: "Run on this machine, on Testserver sandboxes already in the pool, never minting.",
@@ -240,6 +240,45 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
240
240
  } & {
241
241
  readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
242
242
  }]>;
243
+ prBuildExpired: import("@vercel/clinkr").SharedError<"pr_build_expired", [{
244
+ pr: number;
245
+ headSha: string;
246
+ build: string;
247
+ expiresAt: string;
248
+ } & {
249
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
250
+ }]>;
251
+ prBuildNotReady: import("@vercel/clinkr").SharedError<"pr_build_not_ready", [{
252
+ pr: number;
253
+ headSha: string;
254
+ newest: {
255
+ build: string;
256
+ headSha: string;
257
+ createdAt: string;
258
+ } | null;
259
+ } & {
260
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
261
+ }]>;
262
+ prBuildsUnlisted: import("@vercel/clinkr").SharedError<"pr_builds_unlisted", [{
263
+ pr: number;
264
+ failure: {
265
+ kind: "connect-failed" | "http-error" | "malformed" | "not-found" | "rejected" | "timeout";
266
+ status: number | null;
267
+ detail: string;
268
+ };
269
+ } & {
270
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
271
+ }]>;
272
+ pullRequestUnreadable: import("@vercel/clinkr").SharedError<"pull_request_unreadable", [{
273
+ pr: number;
274
+ repo: string;
275
+ kind: "connect-failed" | "http-error" | "malformed" | "no-token" | "not-found" | "rejected" | "timeout";
276
+ status: number | null;
277
+ message: string | null;
278
+ tokenOrigin: "GH_TOKEN" | "GITHUB_TOKEN" | "gh auth token" | null;
279
+ } & {
280
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
281
+ }]>;
243
282
  runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
244
283
  failure: {
245
284
  kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
@@ -295,4 +334,260 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
295
334
  } & {
296
335
  readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
297
336
  }]>;
337
+ }, {
338
+ readonly noMatchingTests: {
339
+ readonly exitCode: 1;
340
+ readonly description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, leased or started.";
341
+ readonly schema: z.ZodObject<{
342
+ args: z.ZodArray<z.ZodString>;
343
+ cwd: z.ZodString;
344
+ }, z.core.$strip>;
345
+ readonly render: ({ args, cwd }: {
346
+ args: string[];
347
+ cwd: string;
348
+ }) => {
349
+ message: string;
350
+ next: {
351
+ type: "text";
352
+ text: string;
353
+ }[];
354
+ };
355
+ };
356
+ readonly vitestListFailed: {
357
+ readonly exitCode: 1;
358
+ readonly description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, leased or started.";
359
+ readonly schema: z.ZodObject<{
360
+ args: z.ZodArray<z.ZodString>;
361
+ cwd: z.ZodString;
362
+ kind: z.ZodEnum<{
363
+ exited: "exited";
364
+ "start-failed": "start-failed";
365
+ "timed-out": "timed-out";
366
+ "unreadable-output": "unreadable-output";
367
+ }>;
368
+ message: z.ZodString;
369
+ }, z.core.$strip>;
370
+ readonly render: ({ kind, message, cwd }: {
371
+ args: string[];
372
+ cwd: string;
373
+ kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
374
+ message: string;
375
+ }) => {
376
+ message: string;
377
+ next: {
378
+ type: "text";
379
+ text: "Check that the package's vitest prints its list with --json, then retry." | "Check why vitest list doesn't finish, such as a global setup that waits, then retry." | "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options." | "Install vitest in the package, or run the command with storm exec, which counts nothing.";
380
+ }[];
381
+ };
382
+ };
383
+ readonly credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
384
+ origin: {
385
+ source: "mint";
386
+ team: string;
387
+ project: string;
388
+ } | {
389
+ source: "github-actions";
390
+ claims: {
391
+ aud: string;
392
+ repository: string;
393
+ } | null;
394
+ };
395
+ fix: string;
396
+ status: number;
397
+ vercelId: string | null;
398
+ ttlMinutes: number;
399
+ failedCreates: {
400
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
401
+ detail: string | null;
402
+ }[];
403
+ unpooled: {
404
+ testserverUrl: string;
405
+ path: string;
406
+ message: string;
407
+ }[];
408
+ sandboxMayExist: boolean;
409
+ } & {
410
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
411
+ }]>;
412
+ readonly credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
413
+ flags: string[];
414
+ configFile: string | null;
415
+ }]>;
416
+ readonly githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
417
+ repo: string;
418
+ status: number | null;
419
+ message: string;
420
+ } & {
421
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
422
+ }]>;
423
+ readonly githubTokenMissing: import("@vercel/clinkr").SharedError<"github_token_missing", [data: {
424
+ tokenEnv: string;
425
+ repo: string;
426
+ configFile: string | null;
427
+ requiredBy: "config" | "set";
428
+ }]>;
429
+ readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
430
+ file: string;
431
+ problems: {
432
+ key: string | null;
433
+ location: {
434
+ line: number;
435
+ column: number | null;
436
+ } | null;
437
+ problem: string;
438
+ }[];
439
+ }]>;
440
+ readonly invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
441
+ configFile: string | null;
442
+ problems: {
443
+ key: string;
444
+ problem: string;
445
+ values: {
446
+ key: string;
447
+ value: string;
448
+ source: "default" | "file" | "flag";
449
+ }[];
450
+ }[];
451
+ }]>;
452
+ readonly mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
453
+ team: string;
454
+ project: string;
455
+ cause: string;
456
+ fix: string;
457
+ runner: boolean;
458
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
459
+ }]>;
460
+ readonly missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
461
+ configFile: string | null;
462
+ }]>;
463
+ readonly missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
464
+ missing: ("project" | "scope")[];
465
+ }]>;
466
+ readonly noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
467
+ refs: {
468
+ ref: string;
469
+ reason: "missing" | "unrelated";
470
+ }[];
471
+ }]>;
472
+ readonly noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
473
+ requested: number;
474
+ ttlMinutes: number;
475
+ failedCreates: {
476
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
477
+ detail: string | null;
478
+ }[];
479
+ sandboxMayExist: boolean;
480
+ } & {
481
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
482
+ }]>;
483
+ readonly noUsableSandboxes: import("@vercel/clinkr").SharedError<"no_usable_sandboxes", [{
484
+ requested: number;
485
+ build: string;
486
+ } & {
487
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
488
+ }]>;
489
+ readonly poolUnavailable: import("@vercel/clinkr").SharedError<"pool_unavailable", [data: {
490
+ path: string;
491
+ message: string;
492
+ }]>;
493
+ readonly poolUnreadable: import("@vercel/clinkr").SharedError<"pool_unreadable", [{
494
+ path: string;
495
+ message: string;
496
+ } & {
497
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
498
+ }]>;
499
+ readonly prBuildExpired: import("@vercel/clinkr").SharedError<"pr_build_expired", [{
500
+ pr: number;
501
+ headSha: string;
502
+ build: string;
503
+ expiresAt: string;
504
+ } & {
505
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
506
+ }]>;
507
+ readonly prBuildNotReady: import("@vercel/clinkr").SharedError<"pr_build_not_ready", [{
508
+ pr: number;
509
+ headSha: string;
510
+ newest: {
511
+ build: string;
512
+ headSha: string;
513
+ createdAt: string;
514
+ } | null;
515
+ } & {
516
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
517
+ }]>;
518
+ readonly prBuildsUnlisted: import("@vercel/clinkr").SharedError<"pr_builds_unlisted", [{
519
+ pr: number;
520
+ failure: {
521
+ kind: "connect-failed" | "http-error" | "malformed" | "not-found" | "rejected" | "timeout";
522
+ status: number | null;
523
+ detail: string;
524
+ };
525
+ } & {
526
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
527
+ }]>;
528
+ readonly pullRequestUnreadable: import("@vercel/clinkr").SharedError<"pull_request_unreadable", [{
529
+ pr: number;
530
+ repo: string;
531
+ kind: "connect-failed" | "http-error" | "malformed" | "no-token" | "not-found" | "rejected" | "timeout";
532
+ status: number | null;
533
+ message: string | null;
534
+ tokenOrigin: "GH_TOKEN" | "GITHUB_TOKEN" | "gh auth token" | null;
535
+ } & {
536
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
537
+ }]>;
538
+ readonly runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
539
+ failure: {
540
+ kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
541
+ label: string;
542
+ exitCode: number | null;
543
+ tail: string[];
544
+ } | {
545
+ kind: "sandbox-api-failed";
546
+ operation: string;
547
+ status: number | null;
548
+ message: string;
549
+ } | {
550
+ kind: "checkout-failed";
551
+ message: string;
552
+ command: string | null;
553
+ } | {
554
+ kind: "credential-claims-missing";
555
+ team: string;
556
+ project: string;
557
+ };
558
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
559
+ }]>;
560
+ readonly snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
561
+ snapshotId: string;
562
+ base: string;
563
+ removal: {
564
+ path: string;
565
+ message: string;
566
+ } | null;
567
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
568
+ }]>;
569
+ readonly spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
570
+ executable: string;
571
+ message: string;
572
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
573
+ }]>;
574
+ readonly submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
575
+ paths: string[];
576
+ }]>;
577
+ readonly tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
578
+ cause: "request-failed" | "variables-missing";
579
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
580
+ status: number | null;
581
+ said: string | null;
582
+ detail: string;
583
+ fix: string;
584
+ ttlMinutes: number;
585
+ failedCreates: {
586
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
587
+ detail: string | null;
588
+ }[];
589
+ sandboxMayExist: boolean;
590
+ } & {
591
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
592
+ }]>;
298
593
  }>;
@@ -54,5 +54,78 @@ export declare const configErrors: import("@vercel/clinkr").SharedErrors<{
54
54
  }, z.core.$strip>>;
55
55
  }, z.core.$strip>>;
56
56
  }, z.core.$strip>;
57
+ }, {
58
+ readonly invalidConfig: {
59
+ readonly exitCode: 2;
60
+ readonly description: "storm.config.ts can't be used: it can't be imported, doesn't default-export an object, has an unknown key, or a value in it is invalid. storm checks the whole file whenever a command loads it.";
61
+ readonly schema: z.ZodObject<{
62
+ file: z.ZodString;
63
+ problems: z.ZodArray<z.ZodObject<{
64
+ key: z.ZodNullable<z.ZodString>;
65
+ location: z.ZodNullable<z.ZodObject<{
66
+ line: z.ZodNumber;
67
+ column: z.ZodNullable<z.ZodNumber>;
68
+ }, z.core.$strip>>;
69
+ problem: z.ZodString;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
72
+ readonly render: ({ file, problems }: {
73
+ file: string;
74
+ problems: {
75
+ key: string | null;
76
+ location: {
77
+ line: number;
78
+ column: number | null;
79
+ } | null;
80
+ problem: string;
81
+ }[];
82
+ }) => {
83
+ message: string;
84
+ rows?: [string, string[]][];
85
+ next: {
86
+ type: "text";
87
+ text: string;
88
+ }[];
89
+ };
90
+ };
91
+ readonly invalidResourceOptions: {
92
+ readonly exitCode: 2;
93
+ readonly description: "A resource's options, once its defaults, storm.config.ts and the flags are merged, don't fit together, or one it requires is missing: such as resources.testserverPool.ttl not longer than its minTimeLeft. Each problem names the values it is about and where each came from.";
94
+ readonly schema: z.ZodObject<{
95
+ configFile: z.ZodNullable<z.ZodString>;
96
+ problems: z.ZodArray<z.ZodObject<{
97
+ key: z.ZodString;
98
+ problem: z.ZodString;
99
+ values: z.ZodArray<z.ZodObject<{
100
+ key: z.ZodString;
101
+ value: z.ZodString;
102
+ source: z.ZodEnum<{
103
+ default: "default";
104
+ file: "file";
105
+ flag: "flag";
106
+ }>;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strip>>;
109
+ }, z.core.$strip>;
110
+ readonly render: ({ configFile, problems }: {
111
+ configFile: string | null;
112
+ problems: {
113
+ key: string;
114
+ problem: string;
115
+ values: {
116
+ key: string;
117
+ value: string;
118
+ source: "default" | "file" | "flag";
119
+ }[];
120
+ }[];
121
+ }) => {
122
+ message: string;
123
+ rows?: [string, string[]][];
124
+ next: {
125
+ type: "text";
126
+ text: string;
127
+ }[];
128
+ };
129
+ };
57
130
  }>;
58
131
  export {};
@@ -3,7 +3,7 @@ import { type CheckedRecipe, type RunnerRecipe } from "../runner/index.ts";
3
3
  export declare const CONFIG_FILE_NAME = "storm.config.ts";
4
4
  /**
5
5
  * The settings a `storm.config.ts` can give at its top level, as the file gives them. A flag (`--scope`,
6
- * `--project`) overrides the file; none has a built-in default. `@cnc-tools/storm/config`'s `StormConfig` adds
6
+ * `--project`) overrides the file; none has a built-in default. `@vercel/storm/config`'s `StormConfig` adds
7
7
  * `resources` to these.
8
8
  */
9
9
  export interface ConfigSettings {
@@ -12,12 +12,13 @@ export type { RunnerRecipe, RunnerResources, RunnerStep, RunnerStepContext, Runn
12
12
  */
13
13
  export interface StormResources {
14
14
  /**
15
- * The Testserver pool resource, from `testserverPool()` in `@cnc-tools/storm/testserver`. Its presence gives a run
16
- * a Testserver side. `pool create` reads its `build` and `ttl` whether or not a run would.
15
+ * The Testserver pool resource, from `testserverPool()` in `@vercel/storm/testserver`. Its presence gives a run
16
+ * a Testserver side. `pool create` reads its `build` and `ttl` whether or not a run would. Its `build` may name a
17
+ * vercel/api pull request, as `pr:<N>` or its URL.
17
18
  */
18
19
  readonly testserverPool?: TestserverPoolResource;
19
20
  /**
20
- * The GitHub fixture repository resource, from `githubFixtureRepo()` in `@cnc-tools/storm/github`: one standing
21
+ * The GitHub fixture repository resource, from `githubFixtureRepo()` in `@vercel/storm/github`: one standing
21
22
  * GitHub repository, a token for it and a run prefix, handed to the command, whose branches under the run prefix the
22
23
  * run deletes once the command has stopped. Only a run, `vitest`'s or `exec`'s, reads it.
23
24
  */
@@ -1,4 +1,4 @@
1
- // The config file's published surface, `@cnc-tools/storm/config`. A user's `storm.config.ts` imports it, so it
1
+ // The config file's published surface, `@vercel/storm/config`. A user's `storm.config.ts` imports it, so it
2
2
  // imports nothing at run time but `toolchain.ts`, which imports nothing either: loading a config file pulls in no
3
3
  // Clinkr, zod or CLI code. Everything it takes from the modules, the top-level settings, the runner recipe's types and
4
4
  // each resource's factory type, is a type-only import, erased at run time.
@@ -1,4 +1,4 @@
1
- // The toolchain steps a pnpm workspace's runner recipe can use, exported from `@cnc-tools/storm/config`. Like
1
+ // The toolchain steps a pnpm workspace's runner recipe can use, exported from `@vercel/storm/config`. Like
2
2
  // `define.ts`, it imports nothing at run time, so a config file that uses it loads no Clinkr, zod or CLI code.
3
3
  /**
4
4
  * The runner snapshot's toolchain step for the root `package.json` at the base: `git` on `PATH`, a Node that meets
@@ -44,6 +44,12 @@ export interface ResourcesSettlement<K> {
44
44
  readonly secrets: readonly string[];
45
45
  readonly requests: ResourceRequests<K>;
46
46
  }
47
+ /**
48
+ * One `CommandError` per reason in `Reason`, not one whose reason is the union. TypeScript relates an object with a
49
+ * union-valued property to a union of objects only up to 25 combinations of its discriminants, and a dozen reasons
50
+ * times an error's three exit codes pass that, so a command's declared outcomes would refuse the union-valued one.
51
+ */
52
+ export type EachCommandError<Reason extends string> = Reason extends string ? CommandError<Reason> : never;
47
53
  /**
48
54
  * Every resource's command half, bound to its name, in provider order, over kinds map `K`. Every error is one of the
49
55
  * resources' (`ResourceReason<K>`).
@@ -57,10 +63,10 @@ export interface ResourcesSettlement<K> {
57
63
  * - `canceledLines`: what a canceled run changed in its resources, for a person, resource by resource.
58
64
  */
59
65
  export interface ResourceCommands<K> {
60
- settle(options: ResourceOptions<K>, env: Readonly<Record<string, string | undefined>>, configFile: string | null): Refusable<ResourcesSettlement<K>, CommandError<ResourceReason<K>>>;
66
+ settle(options: ResourceOptions<K>, env: Readonly<Record<string, string | undefined>>, configFile: string | null): Refusable<ResourcesSettlement<K>, EachCommandError<ResourceReason<K>>>;
61
67
  takesCredential(options: ResourceOptions<K>): boolean;
62
68
  refusalFacts(outcome: ResourceRefusal<K>): RefusalFact;
63
- unpreparedError(outcome: ResourceUnprepared<K>): CommandError<ResourceReason<K>>;
69
+ unpreparedError(outcome: ResourceUnprepared<K>): EachCommandError<ResourceReason<K>>;
64
70
  canceledLines(resources: ResourceCanceledFacts<K>, cleanup: ResourceCleanup<K>): readonly string[];
65
71
  }
66
72
  /** Every one of `providers`' command halves, bound to their names, in order. */
@@ -104,6 +104,10 @@ function commandSlotOf(provider) {
104
104
  canceledLines: (resources, cleanup) => half.canceledLines(resources[name], cleanup[name]),
105
105
  };
106
106
  }
107
+ /** `error` as the member of `EachCommandError` its reason names: the same value, typed per reason. */
108
+ function each(error) {
109
+ return error;
110
+ }
107
111
  /** Every one of `providers`' command halves, bound to their names, in order. */
108
112
  export function bindCommands(providers) {
109
113
  const slots = providers.map((provider) => commandSlotOf(provider));
@@ -122,7 +126,7 @@ export function bindCommands(providers) {
122
126
  if (settled === undefined)
123
127
  continue;
124
128
  if (!settled.ok)
125
- return settled;
129
+ return { ok: false, refusal: each(settled.refusal) };
126
130
  secrets = [...secrets, ...settled.secrets];
127
131
  requests = { ...requests, ...settled.requests };
128
132
  }
@@ -130,7 +134,7 @@ export function bindCommands(providers) {
130
134
  },
131
135
  takesCredential: (options) => slots.some((slot) => slot.takesCredential(options)),
132
136
  refusalFacts: (outcome) => first(slots.map((slot) => slot.refusalFacts(outcome)), `${outcome.resource}'s refusal`),
133
- unpreparedError: (outcome) => first(slots.map((slot) => slot.unpreparedError(outcome)), `${outcome.resource}'s prepare refusal`),
137
+ unpreparedError: (outcome) => each(first(slots.map((slot) => slot.unpreparedError(outcome)), `${outcome.resource}'s prepare refusal`)),
134
138
  canceledLines: (resources, released) => slots.flatMap((slot) => slot.canceledLines(resources, released)),
135
139
  };
136
140
  }
@@ -1,5 +1,5 @@
1
1
  export { type AnyResourceError, type CommandProvider, defineRefusals, type RefusalDefinition, type RefusalDefinitions, type RefusalFact, type RefusalFactOf, type RefusalSchemaOf, type ResourceCleanupReport, type ResourceErrors, type ResourceRanReport, type ResourceSettleInput, type ResourceSettlement, type UnpreparedErrorOf, } from "./command-provider.ts";
2
- export { bindCommands, type ResourceCommands, type ResourceReports, resourceReports, type ResourcesSettlement, } from "./command-slots.ts";
2
+ export { bindCommands, type EachCommandError, type ResourceCommands, type ResourceReports, resourceReports, type ResourcesSettlement, } from "./command-slots.ts";
3
3
  export type { FittingConfig, Provider, ProviderList, ResourceCommandTree, ResourceHost } from "./provider.ts";
4
4
  export type { LaneDraw, LanePresentation, Paint, ReleaseTense, ResourceNotice, ResourcePresentation, } from "./presentation.ts";
5
5
  export { type PresentedLane, type ResourcePresentations, resourcePresentations } from "./presentations.ts";
@@ -5,3 +5,4 @@ export { liveGitHubActionsTokenGateway } from "./live/github-actions-token-gatew
5
5
  export { liveCredentialGateway } from "./live/vercel-cli-gateway.ts";
6
6
  export { credentialErrors, requireTarget, settleCredential } from "./settle.ts";
7
7
  export { type CredentialFailure, type CredentialOrigin, type CredentialOutcome, type CredentialSource, type CredentialSourceChoice, credentialSourceFor, githubActionsSource, mintSource, type TokenRequestFailure, } from "./source.ts";
8
+ export { mintTargetText } from "./target.ts";
@@ -5,3 +5,4 @@ export { liveGitHubActionsTokenGateway } from "./live/github-actions-token-gatew
5
5
  export { liveCredentialGateway } from "./live/vercel-cli-gateway.js";
6
6
  export { credentialErrors, requireTarget, settleCredential } from "./settle.js";
7
7
  export { credentialSourceFor, githubActionsSource, mintSource, } from "./source.js";
8
+ export { mintTargetText } from "./target.js";
@@ -10,6 +10,26 @@ export declare const credentialErrors: import("@vercel/clinkr").SharedErrors<{
10
10
  scope: "scope";
11
11
  }>>;
12
12
  }, z.core.$strip>;
13
+ }, {
14
+ readonly missingTarget: {
15
+ readonly exitCode: 2;
16
+ readonly description: "The command may mint a credential, and neither a flag nor storm.config.ts names the control plane team or project.";
17
+ readonly schema: z.ZodObject<{
18
+ missing: z.ZodArray<z.ZodEnum<{
19
+ project: "project";
20
+ scope: "scope";
21
+ }>>;
22
+ }, z.core.$strip>;
23
+ readonly render: ({ missing }: {
24
+ missing: ("project" | "scope")[];
25
+ }) => {
26
+ message: string;
27
+ next: {
28
+ type: "text";
29
+ text: string;
30
+ }[];
31
+ };
32
+ };
13
33
  }>;
14
34
  type MissingTarget = ReturnType<typeof credentialErrors.missingTarget>;
15
35
  /** A setting a command resolved, from a flag or the config file; only its value matters here. */
@@ -0,0 +1,6 @@
1
+ import type { MintTarget } from "./gateways.ts";
2
+ /**
3
+ * How progress names a mint target: the Vercel project and its team, each labeled, such as `Vercel project vercel on
4
+ * team vercel`, so it can't be read as a GitHub `owner/repo`.
5
+ */
6
+ export declare function mintTargetText(target: MintTarget): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * How progress names a mint target: the Vercel project and its team, each labeled, such as `Vercel project vercel on
3
+ * team vercel`, so it can't be read as a GitHub `owner/repo`.
4
+ */
5
+ export function mintTargetText(target) {
6
+ return `Vercel project ${target.project} on team ${target.team}`;
7
+ }