@cnc-tools/storm 0.6.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 (174) 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 +797 -1
  5. package/dist/commands/exec/command.js +1 -1
  6. package/dist/commands/exec/live-view.js +32 -15
  7. package/dist/commands/exec/metadata.d.ts +5 -2
  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 +526 -0
  11. package/dist/commands/exec/outcomes.js +9 -0
  12. package/dist/commands/exec/progress.d.ts +14 -2
  13. package/dist/commands/exec/progress.js +57 -14
  14. package/dist/commands/exec/run-command.d.ts +10 -4
  15. package/dist/commands/exec/run-command.js +41 -8
  16. package/dist/commands/exec/run-metadata.d.ts +6 -3
  17. package/dist/commands/exec/run-metadata.js +6 -3
  18. package/dist/commands/exec/run-record.d.ts +83 -4
  19. package/dist/commands/exec/run-record.js +49 -1
  20. package/dist/commands/exec/tests-summary.d.ts +1 -1
  21. package/dist/commands/exec/tests-summary.js +1 -1
  22. package/dist/commands/exec/view.js +36 -4
  23. package/dist/commands/runs/facts.d.ts +25 -0
  24. package/dist/commands/runs/facts.js +36 -3
  25. package/dist/commands/runs/list/command.d.ts +154 -1
  26. package/dist/commands/runs/list/command.js +1 -1
  27. package/dist/commands/runs/list/outcomes.d.ts +41 -0
  28. package/dist/commands/runs/logs/command.d.ts +263 -1
  29. package/dist/commands/runs/logs/command.js +1 -1
  30. package/dist/commands/runs/logs/outcomes.d.ts +105 -0
  31. package/dist/commands/runs/show/command.d.ts +354 -1
  32. package/dist/commands/runs/show/command.js +1 -1
  33. package/dist/commands/runs/show/metadata.js +1 -1
  34. package/dist/commands/runs/show/outcomes.d.ts +96 -0
  35. package/dist/commands/runs/show/outcomes.js +30 -1
  36. package/dist/commands/vitest/command.d.ts +912 -1
  37. package/dist/commands/vitest/command.js +1 -1
  38. package/dist/commands/vitest/metadata.d.ts +5 -2
  39. package/dist/commands/vitest/metadata.js +4 -0
  40. package/dist/commands/vitest/outcomes.d.ts +320 -0
  41. package/dist/config/errors.d.ts +73 -0
  42. package/dist/config/schema.d.ts +1 -1
  43. package/dist/config-file/define.d.ts +4 -3
  44. package/dist/config-file/define.js +1 -1
  45. package/dist/config-file/toolchain.js +1 -1
  46. package/dist/core/command-slots.d.ts +8 -2
  47. package/dist/core/command-slots.js +6 -2
  48. package/dist/core/events.d.ts +9 -7
  49. package/dist/core/index.d.ts +1 -1
  50. package/dist/core/run-state.d.ts +30 -6
  51. package/dist/core/run-state.js +19 -4
  52. package/dist/core/run.d.ts +17 -4
  53. package/dist/core/run.js +61 -25
  54. package/dist/credential/index.d.ts +1 -0
  55. package/dist/credential/index.js +1 -0
  56. package/dist/credential/settle.d.ts +20 -0
  57. package/dist/credential/target.d.ts +6 -0
  58. package/dist/credential/target.js +7 -0
  59. package/dist/resources/github/command.d.ts +54 -2
  60. package/dist/resources/github/config.js +1 -1
  61. package/dist/resources/github/index.js +1 -1
  62. package/dist/resources/github/resource.js +2 -2
  63. package/dist/resources/testserver/command.d.ts +208 -10
  64. package/dist/resources/testserver/command.js +7 -0
  65. package/dist/resources/testserver/commands/create/command.d.ts +808 -1
  66. package/dist/resources/testserver/commands/create/command.js +64 -23
  67. package/dist/resources/testserver/commands/create/metadata.js +6 -2
  68. package/dist/resources/testserver/commands/create/outcomes.d.ts +347 -0
  69. package/dist/resources/testserver/commands/create/outcomes.js +14 -1
  70. package/dist/resources/testserver/commands/list/command.d.ts +84 -1
  71. package/dist/resources/testserver/commands/list/command.js +1 -1
  72. package/dist/resources/testserver/commands/list/outcomes.d.ts +16 -0
  73. package/dist/resources/testserver/config.js +14 -4
  74. package/dist/resources/testserver/events.d.ts +9 -0
  75. package/dist/resources/testserver/index.js +8 -7
  76. package/dist/resources/testserver/lane.js +1 -0
  77. package/dist/resources/testserver/live/gateways.d.ts +2 -0
  78. package/dist/resources/testserver/live/gateways.js +16 -3
  79. package/dist/resources/testserver/pool/channels.d.ts +5 -2
  80. package/dist/resources/testserver/pool/channels.js +1 -1
  81. package/dist/resources/testserver/pool/create.d.ts +6 -2
  82. package/dist/resources/testserver/pool/create.js +6 -5
  83. package/dist/resources/testserver/pool/index.d.ts +1 -0
  84. package/dist/resources/testserver/pool/index.js +1 -0
  85. package/dist/resources/testserver/pool/pull-request.d.ts +89 -0
  86. package/dist/resources/testserver/pool/pull-request.js +85 -0
  87. package/dist/resources/testserver/pr-build-facts.d.ts +130 -0
  88. package/dist/resources/testserver/pr-build-facts.js +261 -0
  89. package/dist/resources/testserver/presentation.d.ts +2 -2
  90. package/dist/resources/testserver/presentation.js +12 -3
  91. package/dist/resources/testserver/provider.d.ts +16 -6
  92. package/dist/resources/testserver/provider.js +46 -15
  93. package/dist/resources/testserver/pull-request/gateways.d.ts +117 -0
  94. package/dist/resources/testserver/pull-request/gateways.js +5 -0
  95. package/dist/resources/testserver/pull-request/index.d.ts +5 -0
  96. package/dist/resources/testserver/pull-request/index.js +6 -0
  97. package/dist/resources/testserver/pull-request/live/github-rest.d.ts +28 -0
  98. package/dist/resources/testserver/pull-request/live/github-rest.js +114 -0
  99. package/dist/resources/testserver/pull-request/live/github-token-gateway.d.ts +12 -0
  100. package/dist/resources/testserver/pull-request/live/github-token-gateway.js +39 -0
  101. package/dist/resources/testserver/pull-request/live/pull-request-gateway.d.ts +10 -0
  102. package/dist/resources/testserver/pull-request/live/pull-request-gateway.js +27 -0
  103. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.d.ts +21 -0
  104. package/dist/resources/testserver/pull-request/live/testserver-workflow-gateway.js +64 -0
  105. package/dist/resources/testserver/ran.d.ts +5 -0
  106. package/dist/resources/testserver/ran.js +19 -3
  107. package/dist/resources/testserver/resource.d.ts +5 -1
  108. package/dist/resources/testserver/resource.js +2 -2
  109. package/dist/resources/testserver/sandbox/build-reference.d.ts +38 -0
  110. package/dist/resources/testserver/sandbox/build-reference.js +79 -0
  111. package/dist/resources/testserver/sandbox/index.d.ts +1 -0
  112. package/dist/resources/testserver/sandbox/index.js +1 -0
  113. package/dist/resources.d.ts +265 -15
  114. package/dist/runner/events.d.ts +64 -1
  115. package/dist/runner/gateways.d.ts +17 -6
  116. package/dist/runner/index.d.ts +5 -4
  117. package/dist/runner/index.js +4 -3
  118. package/dist/runner/live/snapshot-records.js +18 -4
  119. package/dist/runner/prepare.d.ts +23 -4
  120. package/dist/runner/prepare.js +13 -3
  121. package/dist/runner/ready.d.ts +7 -3
  122. package/dist/runner/ready.js +11 -5
  123. package/dist/runner/scope.d.ts +17 -1
  124. package/dist/runner/scope.js +4 -0
  125. package/dist/runner/snapshot-build.d.ts +3 -1
  126. package/dist/runner/snapshot-build.js +12 -2
  127. package/dist/runner/snapshot-cache.d.ts +46 -8
  128. package/dist/runner/snapshot-cache.js +60 -11
  129. package/dist/runner/snapshot-key.d.ts +12 -1
  130. package/dist/runner/snapshot-key.js +17 -1
  131. package/dist/runner/snapshot-save.d.ts +53 -0
  132. package/dist/runner/snapshot-save.js +148 -0
  133. package/dist/sdk/index.js +2 -2
  134. package/dist/story/align.d.ts +1 -1
  135. package/dist/story/align.js +1 -1
  136. package/dist/story/command-line.d.ts +34 -0
  137. package/dist/story/command-line.js +100 -0
  138. package/dist/story/definition.d.ts +22 -15
  139. package/dist/story/definition.js +2 -2
  140. package/dist/story/errors.js +1 -1
  141. package/dist/story/gateways.d.ts +45 -25
  142. package/dist/story/gateways.js +2 -2
  143. package/dist/story/host.d.ts +11 -8
  144. package/dist/story/host.js +37 -37
  145. package/dist/story/index.d.ts +2 -1
  146. package/dist/story/index.js +6 -5
  147. package/dist/story/json.d.ts +1 -1
  148. package/dist/story/json.js +2 -2
  149. package/dist/story/live/recording-gateway.d.ts +2 -0
  150. package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
  151. package/dist/story/mode.d.ts +2 -2
  152. package/dist/story/mode.js +1 -1
  153. package/dist/story/orphans.d.ts +23 -5
  154. package/dist/story/orphans.js +44 -8
  155. package/dist/story/recording.d.ts +62 -0
  156. package/dist/story/{artifact.js → recording.js} +31 -27
  157. package/dist/story/report.d.ts +21 -9
  158. package/dist/story/report.js +37 -25
  159. package/dist/story/settle.d.ts +23 -21
  160. package/dist/story/settle.js +17 -16
  161. package/dist/story/{run.d.ts → start.d.ts} +18 -17
  162. package/dist/story/{run.js → start.js} +66 -43
  163. package/dist/vercel-cli/context.js +1 -1
  164. package/dist/vercel-cli/index.js +1 -1
  165. package/dist/vitest/config.js +2 -2
  166. package/dist/vitest/fixtures.d.ts +1 -1
  167. package/dist/vitest/fixtures.js +1 -1
  168. package/dist/vitest/index.js +3 -3
  169. package/dist/vitest/plan.js +1 -1
  170. package/package.json +3 -3
  171. package/skills/overview.md +2 -0
  172. package/skills/testserver-builds.md +80 -0
  173. package/dist/story/artifact.d.ts +0 -60
  174. package/dist/story/live/artifact-gateway.d.ts +0 -2
@@ -64,10 +64,35 @@ export declare const ranSchema: z.ZodObject<{
64
64
  runner: z.ZodNullable<z.ZodObject<{
65
65
  snapshotId: z.ZodString;
66
66
  base: z.ZodString;
67
+ snapshotBranch: z.ZodNullable<z.ZodString>;
68
+ snapshotHead: z.ZodNullable<z.ZodString>;
67
69
  built: z.ZodBoolean;
68
70
  vcpus: z.ZodNumber;
69
71
  region: z.ZodString;
70
72
  runtime: z.ZodString;
73
+ buildMs: z.ZodNumber;
74
+ save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
75
+ kind: z.ZodLiteral<"saved">;
76
+ snapshotId: z.ZodString;
77
+ base: z.ZodString;
78
+ branch: z.ZodString;
79
+ head: z.ZodString;
80
+ ms: z.ZodNumber;
81
+ sizeBytes: z.ZodNumber;
82
+ entryWritten: z.ZodBoolean;
83
+ }, z.core.$strip>, z.ZodObject<{
84
+ kind: z.ZodLiteral<"skipped">;
85
+ reason: z.ZodLiteral<"detached-head">;
86
+ }, z.core.$strip>, z.ZodObject<{
87
+ kind: z.ZodLiteral<"failed">;
88
+ step: z.ZodEnum<{
89
+ "save-snapshot": "save-snapshot";
90
+ scrub: "scrub";
91
+ }>;
92
+ message: z.ZodString;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"stopped">;
95
+ }, z.core.$strip>], "kind">>;
71
96
  }, z.core.$strip>>;
72
97
  timeline: z.ZodObject<{
73
98
  startedAt: z.ZodString;
@@ -190,6 +215,193 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
190
215
  message: z.ZodString;
191
216
  cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
192
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
+ };
193
405
  }>;
194
406
  /** Every error a run ends with, in order: the config's, the credential's, each resource's, the mint's, the run's. */
195
407
  export declare const RUN_ERRORS: {
@@ -309,6 +521,45 @@ export declare const RUN_ERRORS: {
309
521
  } & {
310
522
  readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
311
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
+ }]>;
312
563
  runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
313
564
  failure: {
314
565
  kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
@@ -380,10 +631,35 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
380
631
  runner: z.ZodNullable<z.ZodObject<{
381
632
  snapshotId: z.ZodString;
382
633
  base: z.ZodString;
634
+ snapshotBranch: z.ZodNullable<z.ZodString>;
635
+ snapshotHead: z.ZodNullable<z.ZodString>;
383
636
  built: z.ZodBoolean;
384
637
  vcpus: z.ZodNumber;
385
638
  region: z.ZodString;
386
639
  runtime: z.ZodString;
640
+ buildMs: z.ZodNumber;
641
+ save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
642
+ kind: z.ZodLiteral<"saved">;
643
+ snapshotId: z.ZodString;
644
+ base: z.ZodString;
645
+ branch: z.ZodString;
646
+ head: z.ZodString;
647
+ ms: z.ZodNumber;
648
+ sizeBytes: z.ZodNumber;
649
+ entryWritten: z.ZodBoolean;
650
+ }, z.core.$strip>, z.ZodObject<{
651
+ kind: z.ZodLiteral<"skipped">;
652
+ reason: z.ZodLiteral<"detached-head">;
653
+ }, z.core.$strip>, z.ZodObject<{
654
+ kind: z.ZodLiteral<"failed">;
655
+ step: z.ZodEnum<{
656
+ "save-snapshot": "save-snapshot";
657
+ scrub: "scrub";
658
+ }>;
659
+ message: z.ZodString;
660
+ }, z.core.$strip>, z.ZodObject<{
661
+ kind: z.ZodLiteral<"stopped">;
662
+ }, z.core.$strip>], "kind">>;
387
663
  }, z.core.$strip>>;
388
664
  timeline: z.ZodObject<{
389
665
  startedAt: z.ZodString;
@@ -556,6 +832,256 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
556
832
  } & {
557
833
  readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
558
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
+ }]>;
559
1085
  runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
560
1086
  failure: {
561
1087
  kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
@@ -6,6 +6,7 @@ import { configErrors } from "../../config/index.js";
6
6
  import { credentialErrors } from "../../credential/index.js";
7
7
  import { keptText, runnerCleanupWarnings } from "./cleanup.js";
8
8
  import { mintFailedErrors } from "./mint-failed.js";
9
+ import { saveSchema } from "./run-record.js";
9
10
  /** Why the runner couldn't run the command. */
10
11
  const runnerFailureSchema = z.union([
11
12
  z.object({
@@ -140,11 +141,19 @@ export const ranSchema = z.object({
140
141
  snapshotId: z.string(),
141
142
  /** The runner snapshot's base, a full SHA. */
142
143
  base: z.string(),
144
+ /** For a branch snapshot, the local branch of the run that saved it; null for a base snapshot. */
145
+ snapshotBranch: z.string().nullable(),
146
+ /** For a branch snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
147
+ snapshotHead: z.string().nullable(),
143
148
  /** Whether this run built the runner snapshot. */
144
149
  built: z.boolean(),
145
150
  vcpus: z.number(),
146
151
  region: z.string(),
147
152
  runtime: z.string(),
153
+ /** How long the build step took, in milliseconds. */
154
+ buildMs: z.number(),
155
+ /** How saving the runner sandbox as a branch snapshot ended (--save-snapshot); null without the flag. */
156
+ save: saveSchema.nullable(),
148
157
  })
149
158
  .nullable(),
150
159
  /** The run's waterfall, as the run directory's timeline.json holds it: each lane's span and steps in milliseconds since the run started, how they ended, idle time, and the critical path. */
@@ -1,6 +1,6 @@
1
1
  import { type RanCommand } from "../../core/index.ts";
2
2
  import { type StormRunLane, type StormRunObserver, type StormTimedRunEvent } from "../../resources.ts";
3
- import type { RunnerSnapshotCacheFailure, SnapshotCacheNote } from "../../runner/index.ts";
3
+ import type { RunnerEvent, RunnerSnapshotCacheFailure, SnapshotCacheNote } from "../../runner/index.ts";
4
4
  /** The lane a plain progress line names after its elapsed time: what part of the run it is about. */
5
5
  export type ProgressLane = "run" | "mint" | StormRunLane | "command" | "cleanup";
6
6
  /**
@@ -33,12 +33,24 @@ export declare function plainRenderer(options: LineProgressOptions): (timed: Sto
33
33
  export declare function progressLine(elapsedMs: number, lane: ProgressLane, text: string): string;
34
34
  /** The widest lane a plain line names: `command`, `cleanup`, or a resource's lane, such as `testserver`. */
35
35
  export declare const LANE_WIDTH: number;
36
+ /** How saving a branch snapshot ended, as its line says. */
37
+ export declare function branchSnapshotSaveText(event: Extract<RunnerEvent, {
38
+ readonly kind: "branch-snapshot-saved" | "branch-snapshot-not-saved";
39
+ }>): string;
40
+ /** What `--rebuild-snapshot` did to the branch's branch snapshot entries, as its line says. */
41
+ export declare function branchSnapshotsDropText(event: Extract<RunnerEvent, {
42
+ readonly kind: "branch-snapshots-dropped" | "branch-snapshots-not-dropped";
43
+ }>): string;
36
44
  /** How a command ended, as its end line and the live view say. */
37
45
  export declare function commandEnd(outcome: RanCommand): string;
38
- /** In a runner run, what the local checks noticed: nested Git repositories left out, and the cache read's notes. */
46
+ /**
47
+ * In a runner run, what the local checks noticed: nested Git repositories left out, the cache read's notes, and that
48
+ * `--save-snapshot` saves nothing on a detached HEAD.
49
+ */
39
50
  export declare function preparedNoteTexts(prepared: {
40
51
  readonly nestedRepositories: readonly string[];
41
52
  readonly notes: readonly SnapshotCacheNote[];
53
+ readonly saveSkipped: boolean;
42
54
  }): string[];
43
55
  /** The runner snapshot cache couldn't record a runner snapshot the run built. */
44
56
  export declare function cacheWriteFailureText(failure: RunnerSnapshotCacheFailure): string;