@cnc-tools/storm 0.12.0 → 0.14.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 (188) hide show
  1. package/dist/application.js +5 -1
  2. package/dist/bin/storm.js +6 -2
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/{chunk-FK4RLDEK.js → chunk-27P2QSIM.js} +1 -1
  5. package/dist/chunks/{chunk-ODQHQJLE.js → chunk-5ED3IDUJ.js} +749 -1121
  6. package/dist/chunks/{chunk-FSP3SJ35.js → chunk-5TMHYH7G.js} +16 -46
  7. package/dist/chunks/{chunk-Y3BUNNRG.js → chunk-BFLYGMG3.js} +12 -7
  8. package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
  9. package/dist/chunks/{chunk-RYRJNHL7.js → chunk-HOKDKP5A.js} +3 -9
  10. package/dist/chunks/{chunk-SXW6XN4R.js → chunk-IVRRGGCD.js} +60 -20
  11. package/dist/chunks/{chunk-TMQQYHUX.js → chunk-QBR5VHJ7.js} +1 -1
  12. package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
  13. package/dist/chunks/{chunk-TEEZL3GA.js → chunk-RKONDLPS.js} +17 -71
  14. package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
  15. package/dist/chunks/{chunk-4XT5RC5T.js → chunk-XPCUINWS.js} +6 -42
  16. package/dist/chunks/{chunk-U7M3ZB3Z.js → chunk-YBPTMJUM.js} +123 -180
  17. package/dist/chunks/{chunk-ISGQJIQM.js → chunk-Z5OXOZD3.js} +125 -83
  18. package/dist/chunks/{chunk-7D6LC5JY.js → chunk-ZH5R7W4A.js} +7 -39
  19. package/dist/chunks/{live-app-AZ5N5HBD.js → live-app-FBVWUUMT.js} +7 -7
  20. package/dist/commands/exec/command.d.ts +4 -90
  21. package/dist/commands/exec/command.js +15 -41
  22. package/dist/commands/exec/define-run-command.d.ts +19 -100
  23. package/dist/commands/exec/define-run-command.js +48 -15
  24. package/dist/commands/exec/driver-plan.d.ts +24 -16
  25. package/dist/commands/exec/driver-plan.js +34 -15
  26. package/dist/commands/exec/driver-refusals.js +7 -6
  27. package/dist/commands/exec/exec-words.d.ts +1 -1
  28. package/dist/commands/exec/exec-words.js +8 -2
  29. package/dist/commands/exec/final-results.d.ts +39 -0
  30. package/dist/commands/exec/final-results.js +29 -0
  31. package/dist/commands/exec/live-view.js +18 -22
  32. package/dist/commands/exec/metadata.js +1 -1
  33. package/dist/commands/exec/outcomes.d.ts +15 -109
  34. package/dist/commands/exec/outcomes.js +25 -39
  35. package/dist/commands/exec/plan-run.d.ts +11 -3
  36. package/dist/commands/exec/plan-run.js +3 -2
  37. package/dist/commands/exec/progress.d.ts +3 -19
  38. package/dist/commands/exec/progress.js +16 -60
  39. package/dist/commands/exec/run-command.d.ts +5 -24
  40. package/dist/commands/exec/run-command.js +32 -84
  41. package/dist/commands/exec/run-metadata.d.ts +0 -6
  42. package/dist/commands/exec/run-metadata.js +2 -8
  43. package/dist/commands/exec/snapshot-text.d.ts +7 -16
  44. package/dist/commands/exec/snapshot-text.js +9 -49
  45. package/dist/commands/exec/test-plan.d.ts +2 -1
  46. package/dist/commands/exec/test-plan.js +13 -4
  47. package/dist/commands/exec/tests-summary.d.ts +2 -2
  48. package/dist/commands/exec/view.js +2 -12
  49. package/dist/commands/exec/worker-chart.d.ts +1 -1
  50. package/dist/commands/playwright/command.d.ts +12 -97
  51. package/dist/commands/playwright/command.js +14 -14
  52. package/dist/commands/playwright/metadata.js +2 -2
  53. package/dist/commands/runs/facts.d.ts +1 -37
  54. package/dist/commands/runs/facts.js +4 -36
  55. package/dist/commands/runs/list/command.d.ts +0 -72
  56. package/dist/commands/runs/list/command.js +6 -6
  57. package/dist/commands/runs/list/outcomes.d.ts +0 -36
  58. package/dist/commands/runs/logs/command.js +6 -6
  59. package/dist/commands/runs/show/command.d.ts +2 -74
  60. package/dist/commands/runs/show/command.js +16 -43
  61. package/dist/commands/runs/show/metadata.js +1 -1
  62. package/dist/commands/runs/show/outcomes.d.ts +1 -37
  63. package/dist/commands/runs/show/outcomes.js +8 -42
  64. package/dist/commands/snapshots/build/command.d.ts +14 -411
  65. package/dist/commands/snapshots/build/command.js +59 -234
  66. package/dist/commands/snapshots/build/metadata.js +10 -7
  67. package/dist/commands/snapshots/build/outcomes.d.ts +11 -241
  68. package/dist/commands/snapshots/build/outcomes.js +29 -196
  69. package/dist/commands/snapshots/list/command.d.ts +2 -36
  70. package/dist/commands/snapshots/list/command.js +20 -56
  71. package/dist/commands/snapshots/list/metadata.js +1 -1
  72. package/dist/commands/snapshots/list/outcomes.d.ts +2 -37
  73. package/dist/commands/snapshots/list/outcomes.js +13 -53
  74. package/dist/commands/vitest/command.d.ts +14 -98
  75. package/dist/commands/vitest/command.js +14 -14
  76. package/dist/commands/vitest/metadata.js +2 -2
  77. package/dist/config/resolve.d.ts +1 -1
  78. package/dist/config/resolve.js +2 -1
  79. package/dist/config/schema.d.ts +8 -0
  80. package/dist/config/schema.js +5 -4
  81. package/dist/core/events.d.ts +5 -6
  82. package/dist/core/run-state.d.ts +7 -29
  83. package/dist/core/run-state.js +3 -26
  84. package/dist/core/run.d.ts +6 -14
  85. package/dist/core/run.js +17 -28
  86. package/dist/extensions/playwright/driver.js +17 -10
  87. package/dist/extensions/testserver/commands/pool/create/command.js +4 -4
  88. package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
  89. package/dist/extensions/testserver/definition.d.ts +1 -1
  90. package/dist/extensions/testserver/extension.d.ts +1 -1
  91. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  92. package/dist/extensions/testserver/options/rules.js +5 -5
  93. package/dist/extensions/testserver/resource.d.ts +1 -1
  94. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -0
  95. package/dist/extensions/testserver/vercel-cli/index.js +1 -0
  96. package/dist/extensions/testserver/vercel-cli/report.js +5 -2
  97. package/dist/extensions/testserver/vercel-cli/session-id.d.ts +8 -0
  98. package/dist/extensions/testserver/vercel-cli/session-id.js +16 -0
  99. package/dist/extensions/testserver/vitest/config.d.ts +2 -2
  100. package/dist/extensions/testserver/vitest/config.js +2 -2
  101. package/dist/extensions/testserver/vitest/container-scope.d.ts +25 -16
  102. package/dist/extensions/testserver/vitest/container-scope.js +32 -13
  103. package/dist/extensions/testserver/vitest/diagnostics.d.ts +5 -4
  104. package/dist/extensions/testserver/vitest/diagnostics.js +15 -8
  105. package/dist/extensions/testserver/vitest/fixtures.d.ts +10 -1
  106. package/dist/extensions/testserver/vitest/fixtures.js +36 -10
  107. package/dist/extensions/testserver/vitest/types.d.ts +9 -0
  108. package/dist/extensions/vitest/driver.js +28 -14
  109. package/dist/extensions/vitest/plan/gateways.d.ts +28 -5
  110. package/dist/extensions/vitest/plan/gateways.js +2 -2
  111. package/dist/extensions/vitest/plan/list-output.d.ts +5 -0
  112. package/dist/extensions/vitest/plan/list-output.js +23 -9
  113. package/dist/extensions/vitest/plan/live/list-gateway.d.ts +3 -2
  114. package/dist/extensions/vitest/plan/live/list-gateway.js +77 -64
  115. package/dist/extensions/vitest/plan/plan-over.d.ts +19 -7
  116. package/dist/extensions/vitest/plan/plan-over.js +18 -7
  117. package/dist/extensions/vitest/plan/plan.d.ts +14 -5
  118. package/dist/extensions/vitest/plan/plan.js +23 -9
  119. package/dist/extensions.d.ts +2 -2
  120. package/dist/run-directory/index.d.ts +1 -1
  121. package/dist/run-directory/index.js +0 -1
  122. package/dist/run-directory/plan.d.ts +3 -2
  123. package/dist/run-directory/plan.js +6 -3
  124. package/dist/run-directory/recording.js +2 -2
  125. package/dist/run-directory/run-record.d.ts +18 -135
  126. package/dist/run-directory/run-record.js +8 -68
  127. package/dist/runner/build-snapshots.d.ts +50 -114
  128. package/dist/runner/build-snapshots.js +70 -159
  129. package/dist/runner/events.d.ts +4 -88
  130. package/dist/runner/gateways.d.ts +5 -23
  131. package/dist/runner/index.d.ts +5 -6
  132. package/dist/runner/index.js +1 -1
  133. package/dist/runner/live/snapshot-records.js +7 -18
  134. package/dist/runner/prepare.d.ts +11 -22
  135. package/dist/runner/prepare.js +6 -17
  136. package/dist/runner/ready.d.ts +16 -45
  137. package/dist/runner/ready.js +34 -59
  138. package/dist/runner/recipe.d.ts +5 -45
  139. package/dist/runner/recipe.js +0 -41
  140. package/dist/runner/sandboxed-command.d.ts +5 -3
  141. package/dist/runner/sandboxed-command.js +10 -4
  142. package/dist/runner/scope.d.ts +8 -25
  143. package/dist/runner/scope.js +4 -8
  144. package/dist/runner/session.d.ts +18 -65
  145. package/dist/runner/session.js +15 -83
  146. package/dist/runner/snapshot-build.d.ts +2 -2
  147. package/dist/runner/snapshot-cache.d.ts +22 -74
  148. package/dist/runner/snapshot-cache.js +15 -107
  149. package/dist/runner/snapshot-inspect.d.ts +9 -13
  150. package/dist/runner/snapshot-inspect.js +48 -57
  151. package/dist/runner/snapshot-key.d.ts +9 -14
  152. package/dist/runner/snapshot-key.js +15 -22
  153. package/dist/sdk/extension/driver.d.ts +32 -6
  154. package/dist/sdk/extension/driver.js +12 -2
  155. package/dist/sdk/extension/index.d.ts +1 -1
  156. package/dist/sdk/extension/index.js +2 -1
  157. package/dist/sdk/extension/resource-definition.d.ts +6 -5
  158. package/dist/vendor/testserver-sdk/container/api-request.d.ts +2 -3
  159. package/dist/vendor/testserver-sdk/container/api-request.js +2 -3
  160. package/dist/vendor/testserver-sdk/container/container.d.ts +12 -2
  161. package/dist/vendor/testserver-sdk/container/container.js +10 -7
  162. package/dist/vendor/testserver-sdk/container/recorder.d.ts +29 -7
  163. package/dist/vendor/testserver-sdk/container/recorder.js +26 -14
  164. package/dist/vendor/testserver-sdk/index.d.ts +1 -1
  165. package/dist/vendor/testserver-sdk/index.js +1 -1
  166. package/dist/vendor/testserver-sdk/proxy/exchange.d.ts +24 -5
  167. package/dist/vendor/testserver-sdk/proxy/exchange.js +43 -25
  168. package/dist/vendor/testserver-sdk/proxy/faulted-exchange.js +15 -10
  169. package/dist/vendor/testserver-sdk/proxy/faults.d.ts +6 -5
  170. package/dist/vendor/testserver-sdk/proxy/proxy.d.ts +10 -1
  171. package/dist/vendor/testserver-sdk/proxy/proxy.js +5 -3
  172. package/dist/vendor/testserver-sdk/proxy/records.d.ts +17 -17
  173. package/dist/vendor/testserver-sdk/proxy/records.js +18 -17
  174. package/dist/vendor/testserver-sdk/records/body.d.ts +7 -9
  175. package/dist/vendor/testserver-sdk/records/body.js +10 -15
  176. package/dist/vendor/testserver-sdk/records/headers.d.ts +79 -0
  177. package/dist/vendor/testserver-sdk/records/headers.js +162 -0
  178. package/dist/vendor/testserver-sdk/records/index.d.ts +2 -1
  179. package/dist/vendor/testserver-sdk/records/index.js +4 -2
  180. package/dist/vendor/testserver-sdk/records/records.d.ts +19 -10
  181. package/package.json +5 -4
  182. package/skills/overview.md +5 -5
  183. package/skills/read-run-output.md +8 -9
  184. package/dist/runner/snapshot-save.d.ts +0 -70
  185. package/dist/runner/snapshot-save.js +0 -160
  186. package/dist/runner/snapshot-start.d.ts +0 -25
  187. package/dist/runner/snapshot-start.js +0 -16
  188. package/skills/testserver-builds.md +0 -82
@@ -1,70 +1,17 @@
1
- import { type Row } from "@vercel/clinkr";
2
1
  import { z } from "zod";
3
- import type { DevSnapshotDrop, DevSnapshotReuse, RunnerSnapshotEntry, SnapshotBuildWarning } from "../../../runner/index.ts";
2
+ import type { RunnerSnapshotEntry } from "../../../runner/index.ts";
4
3
  import { RUN_CLEANUP } from "../../exec/cleanup.ts";
5
- /** A cached runner snapshot, as the result names it. */
4
+ /** A cached base snapshot, as the result names it. */
6
5
  declare const snapshotSchema: z.ZodObject<{
7
6
  snapshotId: z.ZodString;
8
- kind: z.ZodEnum<{
9
- base: "base";
10
- dev: "dev";
11
- }>;
12
7
  base: z.ZodString;
13
- builtAt: z.ZodString;
14
- branch: z.ZodNullable<z.ZodString>;
15
8
  expiresAt: z.ZodString;
16
9
  }, z.core.$strip>;
17
10
  type SnapshotFacts = z.output<typeof snapshotSchema>;
18
- /** The base snapshot this build built, and whether the cache wrote its entry; null when it built none. */
19
- declare const baseSnapshotSchema: z.ZodNullable<z.ZodObject<{
20
- snapshotId: z.ZodString;
21
- kind: z.ZodEnum<{
22
- base: "base";
23
- dev: "dev";
24
- }>;
25
- base: z.ZodString;
26
- builtAt: z.ZodString;
27
- branch: z.ZodNullable<z.ZodString>;
28
- expiresAt: z.ZodString;
29
- cached: z.ZodBoolean;
30
- }, z.core.$strip>>;
31
- type BaseSnapshotFacts = z.output<typeof baseSnapshotSchema>;
32
- /** A base snapshot this build built as the result names it, from the runner's; null when it built none. */
33
- export declare function baseSnapshotOf(baseSnapshot: {
34
- readonly entry: RunnerSnapshotEntry;
35
- readonly cached: boolean;
36
- } | null): BaseSnapshotFacts;
37
11
  /** A cache entry as the result names it. */
38
12
  export declare function snapshotOf(entry: RunnerSnapshotEntry): SnapshotFacts;
39
- /**
40
- * Why the build saved no dev snapshot: the recipe doesn't trust them (`not-trusted`) or reuses none (`reuse-off`), or
41
- * `--base` builds only a base snapshot (`base-only`).
42
- */
43
- declare const noDevSnapshotReasonSchema: z.ZodEnum<{
44
- "base-only": "base-only";
45
- "not-trusted": "not-trusted";
46
- "reuse-off": "reuse-off";
47
- }>;
48
- type NoDevSnapshotFact = z.output<typeof noDevSnapshotReasonSchema>;
49
- /** What a `--base` build checked of its commit, for its warnings: null for a checkout build. */
50
- export declare function baseChecksOf(warnings: readonly SnapshotBuildWarning[] | null): {
51
- uncommitted: boolean | null;
52
- onBaseRef: boolean | null;
53
- };
54
- /** What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed. */
55
- declare const droppedSchema: z.ZodObject<{
56
- snapshotIds: z.ZodArray<z.ZodString>;
57
- failures: z.ZodArray<z.ZodString>;
58
- }, z.core.$strip>;
59
- /**
60
- * A build's reason for saving no dev snapshot: from whether a checkout build uses dev snapshots, none when it does, or
61
- * `base-only` for --base, which gives null.
62
- */
63
- export declare function noDevSnapshotFact(devSnapshots: DevSnapshotReuse | null): NoDevSnapshotFact | null;
64
- /** A snapshot in words: its kind, its id and its built-at commit. */
65
- export declare function snapshotText({ kind, snapshotId, builtAt }: SnapshotFacts): string;
66
- /** A drop as the result names it; null when the build dropped nothing. */
67
- export declare function droppedOf(dropped: DevSnapshotDrop | null): z.output<typeof droppedSchema> | null;
13
+ /** A snapshot in words: its id and its base. */
14
+ export declare function snapshotText({ snapshotId, base }: SnapshotFacts): string;
68
15
  /** How `snapshots build` ends. No outcome carries the credential. */
69
16
  export declare const outcomes: import("@vercel/clinkr").Outcomes<{
70
17
  built: z.ZodObject<{
@@ -75,57 +22,15 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
75
22
  head: z.ZodString;
76
23
  base: z.ZodString;
77
24
  baseRef: z.ZodString;
78
- noDevSnapshotReason: z.ZodNullable<z.ZodEnum<{
79
- "base-only": "base-only";
80
- "not-trusted": "not-trusted";
81
- "reuse-off": "reuse-off";
82
- }>>;
83
25
  uncommitted: z.ZodNullable<z.ZodBoolean>;
84
- onBaseRef: z.ZodNullable<z.ZodBoolean>;
85
- baseSnapshot: z.ZodNullable<z.ZodObject<{
86
- snapshotId: z.ZodString;
87
- kind: z.ZodEnum<{
88
- base: "base";
89
- dev: "dev";
90
- }>;
91
- base: z.ZodString;
92
- builtAt: z.ZodString;
93
- branch: z.ZodNullable<z.ZodString>;
94
- expiresAt: z.ZodString;
95
- cached: z.ZodBoolean;
96
- }, z.core.$strip>>;
97
- startedFrom: z.ZodNullable<z.ZodObject<{
98
- snapshotId: z.ZodString;
99
- kind: z.ZodEnum<{
100
- base: "base";
101
- dev: "dev";
102
- }>;
103
- base: z.ZodString;
104
- builtAt: z.ZodString;
105
- branch: z.ZodNullable<z.ZodString>;
106
- expiresAt: z.ZodString;
107
- }, z.core.$strip>>;
108
- devSnapshot: z.ZodNullable<z.ZodObject<{
26
+ atMergeBase: z.ZodNullable<z.ZodBoolean>;
27
+ snapshot: z.ZodObject<{
109
28
  snapshotId: z.ZodString;
110
- kind: z.ZodEnum<{
111
- base: "base";
112
- dev: "dev";
113
- }>;
114
29
  base: z.ZodString;
115
- builtAt: z.ZodString;
116
- branch: z.ZodNullable<z.ZodString>;
117
30
  expiresAt: z.ZodString;
118
- ms: z.ZodNumber;
119
- sizeBytes: z.ZodNumber;
120
- }, z.core.$strip>>;
121
- dropped: z.ZodObject<{
122
- snapshotIds: z.ZodArray<z.ZodString>;
123
- failures: z.ZodArray<z.ZodString>;
124
31
  }, z.core.$strip>;
125
- savedAgainstRunDefault: z.ZodNullable<z.ZodEnum<{
126
- ci: "ci";
127
- recipe: "recipe";
128
- }>>;
32
+ ms: z.ZodNumber;
33
+ sizeBytes: z.ZodNumber;
129
34
  cleanup: z.ZodType<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts>>;
130
35
  }, z.core.$strip>;
131
36
  upToDate: z.ZodObject<{
@@ -136,22 +41,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
136
41
  head: z.ZodString;
137
42
  base: z.ZodString;
138
43
  baseRef: z.ZodString;
139
- noDevSnapshotReason: z.ZodNullable<z.ZodEnum<{
140
- "base-only": "base-only";
141
- "not-trusted": "not-trusted";
142
- "reuse-off": "reuse-off";
143
- }>>;
144
44
  uncommitted: z.ZodNullable<z.ZodBoolean>;
145
- onBaseRef: z.ZodNullable<z.ZodBoolean>;
45
+ atMergeBase: z.ZodNullable<z.ZodBoolean>;
146
46
  snapshot: z.ZodObject<{
147
47
  snapshotId: z.ZodString;
148
- kind: z.ZodEnum<{
149
- base: "base";
150
- dev: "dev";
151
- }>;
152
48
  base: z.ZodString;
153
- builtAt: z.ZodString;
154
- branch: z.ZodNullable<z.ZodString>;
155
49
  expiresAt: z.ZodString;
156
50
  }, z.core.$strip>;
157
51
  }, z.core.$strip>;
@@ -229,69 +123,17 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
229
123
  };
230
124
  cleanup: import("../../exec/cleanup.ts").StormCleanupFacts;
231
125
  }]>;
232
- snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
233
- snapshotId: string;
234
- base: string;
235
- removal: {
236
- path: string;
237
- message: string;
238
- } | null;
239
- cleanup: import("../../exec/cleanup.ts").StormCleanupFacts;
240
- }]>;
241
126
  refNotFound: z.ZodObject<{
242
127
  ref: z.ZodString;
243
128
  }, z.core.$strip>;
244
- devSnapshotNotSaved: z.ZodObject<{
245
- step: z.ZodEnum<{
246
- "save-snapshot": "save-snapshot";
247
- scrub: "scrub";
248
- }>;
249
- message: z.ZodString;
250
- baseSnapshot: z.ZodNullable<z.ZodObject<{
251
- snapshotId: z.ZodString;
252
- kind: z.ZodEnum<{
253
- base: "base";
254
- dev: "dev";
255
- }>;
256
- base: z.ZodString;
257
- builtAt: z.ZodString;
258
- branch: z.ZodNullable<z.ZodString>;
259
- expiresAt: z.ZodString;
260
- cached: z.ZodBoolean;
261
- }, z.core.$strip>>;
262
- cleanup: z.ZodType<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts>>;
263
- }, z.core.$strip>;
264
129
  snapshotNotCached: z.ZodObject<{
265
130
  snapshot: z.ZodObject<{
266
131
  snapshotId: z.ZodString;
267
- kind: z.ZodEnum<{
268
- base: "base";
269
- dev: "dev";
270
- }>;
271
132
  base: z.ZodString;
272
- builtAt: z.ZodString;
273
- branch: z.ZodNullable<z.ZodString>;
274
133
  expiresAt: z.ZodString;
275
134
  }, z.core.$strip>;
276
135
  path: z.ZodString;
277
136
  message: z.ZodString;
278
- baseSnapshot: z.ZodNullable<z.ZodObject<{
279
- snapshotId: z.ZodString;
280
- kind: z.ZodEnum<{
281
- base: "base";
282
- dev: "dev";
283
- }>;
284
- base: z.ZodString;
285
- builtAt: z.ZodString;
286
- branch: z.ZodNullable<z.ZodString>;
287
- expiresAt: z.ZodString;
288
- cached: z.ZodBoolean;
289
- }, z.core.$strip>>;
290
- full: z.ZodBoolean;
291
- dropped: z.ZodNullable<z.ZodObject<{
292
- snapshotIds: z.ZodArray<z.ZodString>;
293
- failures: z.ZodArray<z.ZodString>;
294
- }, z.core.$strip>>;
295
137
  cleanup: z.ZodType<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts>>;
296
138
  }, z.core.$strip>;
297
139
  }, {
@@ -365,15 +207,6 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
365
207
  };
366
208
  cleanup: import("../../exec/cleanup.ts").StormCleanupFacts;
367
209
  }]>;
368
- readonly snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
369
- snapshotId: string;
370
- base: string;
371
- removal: {
372
- path: string;
373
- message: string;
374
- } | null;
375
- cleanup: import("../../exec/cleanup.ts").StormCleanupFacts;
376
- }]>;
377
210
  readonly refNotFound: {
378
211
  readonly exitCode: 1;
379
212
  readonly description: "--base names no commit in this clone: storm resolves it from local refs only, and never fetches.";
@@ -390,90 +223,27 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
390
223
  }[];
391
224
  };
392
225
  };
393
- readonly devSnapshotNotSaved: {
394
- readonly exitCode: 1;
395
- readonly description: "It readied a runner sandbox for this checkout but couldn't save it as a dev snapshot: the scrub or the save failed. baseSnapshot names the base snapshot it built first, if any, and whether the cache holds it.";
396
- readonly schema: z.ZodObject<{
397
- step: z.ZodEnum<{
398
- "save-snapshot": "save-snapshot";
399
- scrub: "scrub";
400
- }>;
401
- message: z.ZodString;
402
- baseSnapshot: z.ZodNullable<z.ZodObject<{
403
- snapshotId: z.ZodString;
404
- kind: z.ZodEnum<{
405
- base: "base";
406
- dev: "dev";
407
- }>;
408
- base: z.ZodString;
409
- builtAt: z.ZodString;
410
- branch: z.ZodNullable<z.ZodString>;
411
- expiresAt: z.ZodString;
412
- cached: z.ZodBoolean;
413
- }, z.core.$strip>>;
414
- cleanup: z.ZodType<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts>>;
415
- }, z.core.$strip>;
416
- readonly render: ({ step, message, baseSnapshot, cleanup, }: {
417
- readonly step: string;
418
- readonly message: string;
419
- readonly baseSnapshot: BaseSnapshotFacts;
420
- readonly cleanup: z.output<typeof RUN_CLEANUP.schema>;
421
- }) => {
422
- message: string;
423
- rows?: Row[];
424
- next: {
425
- type: "text";
426
- text: string;
427
- }[];
428
- };
429
- };
430
226
  readonly snapshotNotCached: {
431
227
  readonly exitCode: 1;
432
- readonly description: "It saved the snapshot the build ends with, the dev snapshot or, with --base or a recipe that saves no dev snapshot, the base snapshot, but couldn't write its cache entry, so no run finds it.";
228
+ readonly description: "It built and saved the base snapshot, but couldn't write its cache entry, so no run finds it.";
433
229
  readonly schema: z.ZodObject<{
434
230
  snapshot: z.ZodObject<{
435
231
  snapshotId: z.ZodString;
436
- kind: z.ZodEnum<{
437
- base: "base";
438
- dev: "dev";
439
- }>;
440
232
  base: z.ZodString;
441
- builtAt: z.ZodString;
442
- branch: z.ZodNullable<z.ZodString>;
443
233
  expiresAt: z.ZodString;
444
234
  }, z.core.$strip>;
445
235
  path: z.ZodString;
446
236
  message: z.ZodString;
447
- baseSnapshot: z.ZodNullable<z.ZodObject<{
448
- snapshotId: z.ZodString;
449
- kind: z.ZodEnum<{
450
- base: "base";
451
- dev: "dev";
452
- }>;
453
- base: z.ZodString;
454
- builtAt: z.ZodString;
455
- branch: z.ZodNullable<z.ZodString>;
456
- expiresAt: z.ZodString;
457
- cached: z.ZodBoolean;
458
- }, z.core.$strip>>;
459
- full: z.ZodBoolean;
460
- dropped: z.ZodNullable<z.ZodObject<{
461
- snapshotIds: z.ZodArray<z.ZodString>;
462
- failures: z.ZodArray<z.ZodString>;
463
- }, z.core.$strip>>;
464
237
  cleanup: z.ZodType<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../exec/cleanup.ts").StormCleanupFacts, import("../../exec/cleanup.ts").StormCleanupFacts>>;
465
238
  }, z.core.$strip>;
466
239
  readonly render: (facts: {
467
240
  readonly snapshot: SnapshotFacts;
468
241
  readonly path: string;
469
242
  readonly message: string;
470
- readonly baseSnapshot: BaseSnapshotFacts;
471
- readonly full: boolean;
472
- readonly dropped: z.output<typeof droppedSchema> | null;
473
243
  readonly cleanup: z.output<typeof RUN_CLEANUP.schema>;
474
244
  }) => {
475
245
  message: string;
476
- rows: Row[];
246
+ rows: import("@vercel/clinkr").Row[];
477
247
  next: {
478
248
  type: "text";
479
249
  text: string;
@@ -5,59 +5,22 @@ import { configErrors, credentialErrors, credentialSourceErrors } from "../../..
5
5
  import { megabytesText } from "../../../core/index.js";
6
6
  import { RUN_CLEANUP } from "../../exec/cleanup.js";
7
7
  import { runErrors } from "../../exec/outcomes.js";
8
- import { noSaveText } from "../../exec/snapshot-text.js";
9
8
  import { seconds, short } from "../../exec/text.js";
10
- /** A cached runner snapshot, as the result names it. */
9
+ /** A cached base snapshot, as the result names it. */
11
10
  const snapshotSchema = z.object({
12
11
  snapshotId: z.string(),
13
- /** A base snapshot, built from a base, or a dev snapshot, saved from a runner sandbox. */
14
- kind: z.enum(["base", "dev"]),
15
- /** Its base, a full SHA. */
12
+ /** Its base, the commit it was built at, a full SHA. */
16
13
  base: z.string(),
17
- /** The commit it was built at: a base snapshot's base, or the commit that saved a dev snapshot. */
18
- builtAt: z.string(),
19
- /** For a dev snapshot, the branch of the run that saved it; null for a base snapshot and a detached HEAD. */
20
- branch: z.string().nullable(),
21
14
  /** When it expires, as an ISO time. */
22
15
  expiresAt: z.string(),
23
16
  });
24
- /** The base snapshot this build built, and whether the cache wrote its entry; null when it built none. */
25
- const baseSnapshotSchema = snapshotSchema.extend({ cached: z.boolean() }).nullable();
26
- /** A base snapshot this build built as the result names it, from the runner's; null when it built none. */
27
- export function baseSnapshotOf(baseSnapshot) {
28
- return baseSnapshot === null ? null : { ...snapshotOf(baseSnapshot.entry), cached: baseSnapshot.cached };
29
- }
30
- /**
31
- * The "Built" row for the base snapshot this build built, saying when the cache doesn't hold it; none when it built
32
- * none, or when it is the snapshot the result's message names (`named`).
33
- */
34
- function builtRows(baseSnapshot, named) {
35
- if (baseSnapshot === null || baseSnapshot.snapshotId === named?.snapshotId)
36
- return [];
37
- return [["Built", `${snapshotText(baseSnapshot)}${baseSnapshot.cached ? "" : ", not in the cache"}`]];
38
- }
39
17
  /** A cache entry as the result names it. */
40
18
  export function snapshotOf(entry) {
41
- return {
42
- snapshotId: entry.snapshotId,
43
- kind: entry.head === undefined ? "base" : "dev",
44
- base: entry.base,
45
- builtAt: entry.head ?? entry.base,
46
- branch: entry.branch ?? null,
47
- expiresAt: entry.expiresAt,
48
- };
19
+ return { snapshotId: entry.snapshotId, base: entry.base, expiresAt: entry.expiresAt };
49
20
  }
50
- /**
51
- * Why the build saved no dev snapshot: the recipe doesn't trust them (`not-trusted`) or reuses none (`reuse-off`), or
52
- * `--base` builds only a base snapshot (`base-only`).
53
- */
54
- const noDevSnapshotReasonSchema = z.enum(["not-trusted", "reuse-off", "base-only"]);
55
- /** What a `--base` build checked of its commit, for its warnings: null for a checkout build. */
56
- export function baseChecksOf(warnings) {
57
- return {
58
- uncommitted: warnings === null ? null : warnings.some(({ kind }) => kind === "uncommitted"),
59
- onBaseRef: warnings === null ? null : !warnings.some(({ kind }) => kind === "not-on-base-ref"),
60
- };
21
+ /** A snapshot in words: its id and its base. */
22
+ export function snapshotText({ snapshotId, base }) {
23
+ return `base snapshot ${snapshotId} at ${short(base)}`;
61
24
  }
62
25
  /** What every result says of where the build ran, and of what it built at. */
63
26
  const whereFields = {
@@ -72,85 +35,29 @@ const whereFields = {
72
35
  /** What it built at: HEAD's merge-base with `baseRef`, or with --base the commit the ref names, a full SHA. */
73
36
  base: z.string(),
74
37
  baseRef: z.string(),
75
- /** Why it saved no dev snapshot; null when it saved one, or the checkout's dev snapshot is up to date. */
76
- noDevSnapshotReason: noDevSnapshotReasonSchema.nullable(),
77
38
  /** With --base, whether the working tree had uncommitted changes, which a base snapshot doesn't hold; else null. */
78
39
  uncommitted: z.boolean().nullable(),
79
40
  /**
80
- * With --base, whether one of the recipe's baseRefs holds the commit in its history; else null. When none does, a
81
- * rewrite of the commit makes the snapshot unusable.
41
+ * With --base, whether the commit is HEAD's merge-base with a base ref; else null. A run here starts only from a
42
+ * snapshot at its merge-base.
82
43
  */
83
- onBaseRef: z.boolean().nullable(),
44
+ atMergeBase: z.boolean().nullable(),
84
45
  };
85
- /** The run defaults a build can save a dev snapshot against: the recipe's `saveDevSnapshot: false`, and `CI`. */
86
- const savedAgainstRunDefaultSchema = z.enum(["recipe", "ci"]);
87
- /** What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed. */
88
- const droppedSchema = z.object({ snapshotIds: z.array(z.string()), failures: z.array(z.string()) });
89
46
  const builtSchema = z.object({
90
47
  ...whereFields,
91
- /** The base snapshot it built, and whether the cache holds it; null when it built none. */
92
- baseSnapshot: baseSnapshotSchema,
93
- /** The snapshot the runner sandbox started from; null when it started none. */
94
- startedFrom: snapshotSchema.nullable(),
95
- /** The dev snapshot it saved at HEAD's commit, how long the save took and its size; null when it saved none. */
96
- devSnapshot: snapshotSchema.extend({ ms: z.number(), sizeBytes: z.number() }).nullable(),
97
- /** What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed. */
98
- dropped: droppedSchema,
99
- /**
100
- * Why a run here that gives no flag would save no dev snapshot, when this build saved one: the recipe sets
101
- * `saveDevSnapshot: false` (`recipe`), or `CI` is set (`ci`), each a run's `noSaveReason`. Both are defaults for
102
- * runs, and this command is not a run. Null when it saved none, or when such a run would save one too.
103
- */
104
- savedAgainstRunDefault: savedAgainstRunDefaultSchema.nullable(),
48
+ /** The base snapshot it built and cached. */
49
+ snapshot: snapshotSchema,
50
+ /** How long the build took, and the snapshot's size. */
51
+ ms: z.number(),
52
+ sizeBytes: z.number(),
105
53
  /** What the build couldn't clean up. */
106
54
  cleanup: RUN_CLEANUP.schema,
107
55
  });
108
56
  const upToDateSchema = z.object({
109
57
  ...whereFields,
110
- /** The snapshot the next run here starts from, or with --base the base snapshot the cache holds at that commit. */
58
+ /** The base snapshot the cache holds at that commit for the team and project. */
111
59
  snapshot: snapshotSchema,
112
60
  });
113
- /** Why the build saved no dev snapshot, as its line says after the colon. */
114
- const NO_DEV_SNAPSHOT_TEXT = {
115
- "not-trusted": "the runner recipe doesn't trust dev snapshots (trustDevSnapshots)",
116
- "reuse-off": "the runner recipe reuses no dev snapshot (reuseDevSnapshot: false)",
117
- "base-only": "--base builds only a base snapshot",
118
- };
119
- /**
120
- * A build's reason for saving no dev snapshot: from whether a checkout build uses dev snapshots, none when it does, or
121
- * `base-only` for --base, which gives null.
122
- */
123
- export function noDevSnapshotFact(devSnapshots) {
124
- if (devSnapshots === null)
125
- return "base-only";
126
- return devSnapshots === "reuse" ? null : devSnapshots;
127
- }
128
- /** A snapshot in words: its kind, its id and its built-at commit. */
129
- export function snapshotText({ kind, snapshotId, builtAt }) {
130
- return `${kind} snapshot ${snapshotId} at ${short(builtAt)}`;
131
- }
132
- /** A drop as the result names it; null when the build dropped nothing. */
133
- export function droppedOf(dropped) {
134
- return dropped === null
135
- ? null
136
- : { snapshotIds: [...dropped.snapshotIds], failures: dropped.failures.map(({ message }) => message) };
137
- }
138
- /** The rows a result shows for what --full dropped, or why it dropped nothing. */
139
- function droppedRows(full, dropped) {
140
- if (dropped === null)
141
- return full
142
- ? [
143
- [
144
- "Dropped",
145
- "nothing: the new base snapshot isn't cached, so the one it replaces and its dev snapshots stay usable",
146
- ],
147
- ]
148
- : [];
149
- return [
150
- ...(dropped.snapshotIds.length === 0 ? [] : [["Dropped", dropped.snapshotIds.join(", ")]]),
151
- ...(dropped.failures.length === 0 ? [] : [["Not dropped", dropped.failures]]),
152
- ];
153
- }
154
61
  function warningsOf(facts) {
155
62
  return [
156
63
  ...(facts.uncommitted === true
@@ -161,11 +68,11 @@ function warningsOf(facts) {
161
68
  },
162
69
  ]
163
70
  : []),
164
- ...(facts.onBaseRef === false
71
+ ...(facts.atMergeBase === false
165
72
  ? [
166
73
  {
167
- reason: "commit_not_on_base_ref",
168
- message: `${facts.baseRef}'s commit is in the history of none of the runner recipe's baseRefs: a rewrite of it makes the snapshot unusable.`,
74
+ reason: "commit_not_merge_base",
75
+ message: `${facts.baseRef}'s commit is not HEAD's merge-base, so a run here doesn't start from the snapshot: a run starts only from a snapshot at its merge-base.`,
169
76
  },
170
77
  ]
171
78
  : []),
@@ -176,59 +83,24 @@ export const outcomes = defineOutcomes({
176
83
  results: {
177
84
  built: {
178
85
  schema: builtSchema,
179
- description: "It built what the cache lacked: a base snapshot, a dev snapshot at HEAD's commit, or both; with --base, a base snapshot at that commit. savedAgainstRunDefault says when it saved a dev snapshot that a run here with no flag would not save, because the recipe sets saveDevSnapshot: false or CI is set.",
86
+ description: "It built a base snapshot that the cache lacked, at the merge-base or, with --base, at the commit the ref names, and cached it.",
180
87
  render: (built) => {
181
- const next = built.devSnapshot ?? built.baseSnapshot;
182
- const rows = [
183
- ["Recipe", built.recipe],
184
- ...builtRows(built.baseSnapshot, next),
185
- ...(built.startedFrom === null || built.startedFrom.snapshotId === built.baseSnapshot?.snapshotId
186
- ? []
187
- : [["Started from", snapshotText(built.startedFrom)]]),
188
- ...(built.devSnapshot === null
189
- ? []
190
- : [
191
- [
192
- "Saved",
193
- `${snapshotText(built.devSnapshot)} in ${seconds(built.devSnapshot.ms)} (${megabytesText(built.devSnapshot.sizeBytes)})`,
194
- ],
195
- ]),
196
- ...(built.dropped.snapshotIds.length === 0
197
- ? []
198
- : [["Dropped", built.dropped.snapshotIds.join(", ")]]),
199
- ...RUN_CLEANUP.rows(built.cleanup),
200
- ];
201
- const message = built.noDevSnapshotReason === "base-only" || next === null
202
- ? `Built ${next === null ? "nothing" : snapshotText(next)}.`
203
- : `The next run here starts from ${snapshotText(next)}.${built.noDevSnapshotReason === null
204
- ? ""
205
- : ` It saved no dev snapshot: ${NO_DEV_SNAPSHOT_TEXT[built.noDevSnapshotReason]}.`}${built.savedAgainstRunDefault === null
206
- ? ""
207
- : ` It saved a dev snapshot although ${noSaveText(built.savedAgainstRunDefault)}: that is a default for runs, and this command is not a run.`}`;
208
- const warnings = [
209
- ...warningsOf(built),
210
- ...built.dropped.failures.map((failure) => ({
211
- reason: "dev_snapshot_not_dropped",
212
- message: `Couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${failure}. A later run may start from it.`,
213
- })),
214
- ];
215
- return renderOutcome({ rows, message, ...(warnings.length === 0 ? {} : { warnings }) });
88
+ const warnings = warningsOf(built);
89
+ return renderOutcome({
90
+ rows: [["Recipe", built.recipe], ...RUN_CLEANUP.rows(built.cleanup)],
91
+ message: `Built ${snapshotText(built.snapshot)} in ${seconds(built.ms)} (${megabytesText(built.sizeBytes)}).`,
92
+ ...(warnings.length === 0 ? {} : { warnings }),
93
+ });
216
94
  },
217
95
  },
218
96
  upToDate: {
219
97
  schema: upToDateSchema,
220
- description: "Nothing to build, so nothing started: the next run here starts from a dev snapshot built at HEAD's commit with a clean working tree, or, for a recipe that saves no dev snapshot, from a base snapshot that fits; with --base, the cache holds a base snapshot at that commit.",
98
+ description: "Nothing to build, so nothing started: the cache holds a base snapshot at the commit, the merge-base or the one --base names, for the team and project.",
221
99
  render: (facts) => {
222
- const { snapshot } = facts;
223
- const message = facts.noDevSnapshotReason === "base-only"
224
- ? `The cache holds ${snapshotText(snapshot)} for this team and project. --full builds a new one.`
225
- : `Up to date: the next run here starts from ${snapshotText(snapshot)}.${facts.noDevSnapshotReason === null
226
- ? ""
227
- : ` It saves no dev snapshot: ${NO_DEV_SNAPSHOT_TEXT[facts.noDevSnapshotReason]}.`}`;
228
100
  const warnings = warningsOf(facts);
229
101
  return renderOutcome({
230
102
  rows: [["Recipe", facts.recipe]],
231
- message,
103
+ message: `The cache holds ${snapshotText(facts.snapshot)} for this team and project. --full builds a new one.`,
232
104
  ...(warnings.length === 0 ? {} : { warnings }),
233
105
  });
234
106
  },
@@ -244,7 +116,6 @@ export const outcomes = defineOutcomes({
244
116
  mintFailed: credentialSourceErrors.mintFailed,
245
117
  tokenRequestFailed: credentialSourceErrors.tokenRequestFailed,
246
118
  runnerFailed: runErrors.runnerFailed,
247
- snapshotGone: runErrors.snapshotGone,
248
119
  refNotFound: {
249
120
  exitCode: 1,
250
121
  description: "--base names no commit in this clone: storm resolves it from local refs only, and never fetches.",
@@ -257,29 +128,9 @@ export const outcomes = defineOutcomes({
257
128
  next: [{ type: "text", text: `Fetch the ref, such as git fetch origin, then run again.` }],
258
129
  }),
259
130
  },
260
- devSnapshotNotSaved: {
261
- exitCode: 1,
262
- description: "It readied a runner sandbox for this checkout but couldn't save it as a dev snapshot: the scrub or the save failed. baseSnapshot names the base snapshot it built first, if any, and whether the cache holds it.",
263
- schema: z.object({
264
- /** What failed, the scrub or the save, with what it said. */
265
- step: z.enum(["scrub", "save-snapshot"]),
266
- message: z.string(),
267
- /** The base snapshot it built first, and whether the cache holds it; null when it built none. */
268
- baseSnapshot: baseSnapshotSchema,
269
- cleanup: RUN_CLEANUP.schema,
270
- }),
271
- render: ({ step, message, baseSnapshot, cleanup, }) => {
272
- const rows = [...builtRows(baseSnapshot, null), ...RUN_CLEANUP.rows(cleanup)];
273
- return {
274
- message: `Couldn't save the dev snapshot: the ${step === "scrub" ? "scrub" : "save"} failed: ${message}`,
275
- ...(rows.length === 0 ? {} : { rows }),
276
- next: [{ type: "text", text: "Run storm snapshots build again." }],
277
- };
278
- },
279
- },
280
131
  snapshotNotCached: {
281
132
  exitCode: 1,
282
- description: "It saved the snapshot the build ends with, the dev snapshot or, with --base or a recipe that saves no dev snapshot, the base snapshot, but couldn't write its cache entry, so no run finds it.",
133
+ description: "It built and saved the base snapshot, but couldn't write its cache entry, so no run finds it.",
283
134
  schema: z.object({
284
135
  /** The snapshot it saved, whose cache entry it couldn't write. */
285
136
  snapshot: snapshotSchema,
@@ -287,29 +138,11 @@ export const outcomes = defineOutcomes({
287
138
  path: z.string(),
288
139
  /** What the operating system said. */
289
140
  message: z.string(),
290
- /**
291
- * The base snapshot it built, and whether the cache holds it; null when it built none. With --base or a recipe
292
- * that saves no dev snapshot, it is `snapshot`, not cached.
293
- */
294
- baseSnapshot: baseSnapshotSchema,
295
- /** Whether --full was given: build without the cache, and drop the dev snapshots on the base snapshot it replaces. */
296
- full: z.boolean(),
297
- /**
298
- * What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed;
299
- * null when it dropped nothing: without --full, or when the new base snapshot isn't cached, so the one it
300
- * replaces and its dev snapshots stay usable.
301
- */
302
- dropped: droppedSchema.nullable(),
303
141
  cleanup: RUN_CLEANUP.schema,
304
142
  }),
305
143
  render: (facts) => ({
306
144
  message: `Saved ${snapshotText(facts.snapshot)}, but couldn't write its cache entry: ${facts.message}`,
307
- rows: [
308
- ["Path", facts.path],
309
- ...builtRows(facts.baseSnapshot, facts.snapshot),
310
- ...droppedRows(facts.full, facts.dropped),
311
- ...RUN_CLEANUP.rows(facts.cleanup),
312
- ],
145
+ rows: [["Path", facts.path], ...RUN_CLEANUP.rows(facts.cleanup)],
313
146
  next: [
314
147
  {
315
148
  type: "text",