@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
@@ -9,6 +9,11 @@ import type { TestserverCommandApp } from "../app.ts";
9
9
  * the pool, unleased. In text output it reports each step, and each progress message the control plane sends, indented,
10
10
  * as it arrives.
11
11
  *
12
+ * A PR build reference (`pr:<N>`, or the vercel/api pull request's URL) is resolved first, as a run resolves it, from
13
+ * GitHub with the host's GitHub token: the pull request's head commit, then the newest PR build vercel/api's
14
+ * `Testserver` workflow published from it. The Testserver sandbox is created on that PR build, and its pool entry records `pr:<N>` as
15
+ * its requested build. A PR build reference that can't be resolved refuses, and nothing is created.
16
+ *
12
17
  * Each setting comes from its flag, else `storm.config.ts` (found from the working directory), else its built-in
13
18
  * default; `--scope` and `--project` have none, so one of the two must give them. `pool create` only ever makes
14
19
  * Testserver sandboxes, so it reads `build` and `ttl` through the Testserver pool resource's config, from the file's
@@ -31,12 +36,522 @@ export declare function command(cmd: CommandBuilder<TestserverCommandApp>): impo
31
36
  logViewerUrl: z.ZodString;
32
37
  requestedBuild: z.ZodString;
33
38
  resolvedBuild: z.ZodString;
39
+ pullRequest: z.ZodNullable<z.ZodObject<{
40
+ repo: z.ZodString;
41
+ number: z.ZodNumber;
42
+ headSha: z.ZodString;
43
+ }, z.core.$strip>>;
44
+ ttlMinutes: z.ZodNumber;
45
+ configFile: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ }, {
48
+ created: unknown;
49
+ }, {
50
+ pullRequestUnreadable: z.ZodObject<{
51
+ pr: z.ZodNumber;
52
+ repo: z.ZodString;
53
+ kind: z.ZodEnum<{
54
+ "connect-failed": "connect-failed";
55
+ "http-error": "http-error";
56
+ malformed: "malformed";
57
+ "no-token": "no-token";
58
+ "not-found": "not-found";
59
+ rejected: "rejected";
60
+ timeout: "timeout";
61
+ }>;
62
+ status: z.ZodNullable<z.ZodNumber>;
63
+ message: z.ZodNullable<z.ZodString>;
64
+ tokenOrigin: z.ZodNullable<z.ZodEnum<{
65
+ GH_TOKEN: "GH_TOKEN";
66
+ GITHUB_TOKEN: "GITHUB_TOKEN";
67
+ "gh auth token": "gh auth token";
68
+ }>>;
69
+ }, z.core.$strip>;
70
+ prBuildsUnlisted: z.ZodObject<{
71
+ pr: z.ZodNumber;
72
+ failure: z.ZodObject<{
73
+ kind: z.ZodEnum<{
74
+ "connect-failed": "connect-failed";
75
+ "http-error": "http-error";
76
+ malformed: "malformed";
77
+ "not-found": "not-found";
78
+ rejected: "rejected";
79
+ timeout: "timeout";
80
+ }>;
81
+ status: z.ZodNullable<z.ZodNumber>;
82
+ detail: z.ZodString;
83
+ }, z.core.$strip>;
84
+ }, z.core.$strip>;
85
+ prBuildNotReady: z.ZodObject<{
86
+ pr: z.ZodNumber;
87
+ headSha: z.ZodString;
88
+ newest: z.ZodNullable<z.ZodObject<{
89
+ build: z.ZodString;
90
+ headSha: z.ZodString;
91
+ createdAt: z.ZodString;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ prBuildExpired: z.ZodObject<{
95
+ pr: z.ZodNumber;
96
+ headSha: z.ZodString;
97
+ build: z.ZodString;
98
+ expiresAt: z.ZodString;
99
+ }, z.core.$strip>;
100
+ poolUnavailable: z.ZodObject<{
101
+ path: z.ZodString;
102
+ message: z.ZodString;
103
+ }, z.core.$strip>;
104
+ mintFailed: z.ZodObject<{
105
+ team: z.ZodString;
106
+ project: z.ZodString;
107
+ cause: z.ZodString;
108
+ fix: z.ZodString;
109
+ }, z.core.$strip>;
110
+ tokenRequestFailed: z.ZodObject<{
111
+ cause: z.ZodEnum<{
112
+ "request-failed": "request-failed";
113
+ "variables-missing": "variables-missing";
114
+ }>;
115
+ missing: z.ZodNullable<z.ZodArray<z.ZodEnum<{
116
+ ACTIONS_ID_TOKEN_REQUEST_TOKEN: "ACTIONS_ID_TOKEN_REQUEST_TOKEN";
117
+ ACTIONS_ID_TOKEN_REQUEST_URL: "ACTIONS_ID_TOKEN_REQUEST_URL";
118
+ }>>>;
119
+ status: z.ZodNullable<z.ZodNumber>;
120
+ said: z.ZodNullable<z.ZodString>;
121
+ detail: z.ZodString;
122
+ fix: z.ZodString;
123
+ }, z.core.$strip>;
124
+ credentialRejected: z.ZodObject<{
125
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
+ source: z.ZodLiteral<"mint">;
127
+ team: z.ZodString;
128
+ project: z.ZodString;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ source: z.ZodLiteral<"github-actions">;
131
+ claims: z.ZodNullable<z.ZodObject<{
132
+ aud: z.ZodString;
133
+ repository: z.ZodString;
134
+ }, z.core.$strip>>;
135
+ }, z.core.$strip>], "source">;
136
+ fix: z.ZodString;
137
+ status: z.ZodNumber;
138
+ vercelId: z.ZodNullable<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ testserverUnreachable: z.ZodObject<{
141
+ attempts: z.ZodNumber;
142
+ code: z.ZodString;
143
+ }, z.core.$strip>;
144
+ poolWriteFailed: z.ZodObject<{
145
+ testserverUrl: z.ZodString;
146
+ logViewerUrl: z.ZodString;
147
+ requestedBuild: z.ZodString;
148
+ resolvedBuild: z.ZodString;
149
+ pullRequest: z.ZodNullable<z.ZodObject<{
150
+ repo: z.ZodString;
151
+ number: z.ZodNumber;
152
+ headSha: z.ZodString;
153
+ }, z.core.$strip>>;
154
+ ttlMinutes: z.ZodNumber;
155
+ configFile: z.ZodNullable<z.ZodString>;
156
+ path: z.ZodString;
157
+ message: z.ZodString;
158
+ }, z.core.$strip>;
159
+ createFailed: z.ZodObject<{
160
+ kind: z.ZodEnum<{
161
+ dropped: "dropped";
162
+ "http-error": "http-error";
163
+ malformed: "malformed";
164
+ "stream-ended": "stream-ended";
165
+ "stream-error": "stream-error";
166
+ timeout: "timeout";
167
+ }>;
168
+ build: z.ZodString;
169
+ ttlMinutes: z.ZodNumber;
170
+ detail: z.ZodNullable<z.ZodString>;
171
+ status: z.ZodNullable<z.ZodNumber>;
172
+ seconds: z.ZodNullable<z.ZodNumber>;
173
+ sandboxMayExist: z.ZodBoolean;
174
+ }, z.core.$strip>;
175
+ invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
176
+ file: string;
177
+ problems: {
178
+ key: string | null;
179
+ location: {
180
+ line: number;
181
+ column: number | null;
182
+ } | null;
183
+ problem: string;
184
+ }[];
185
+ }]>;
186
+ invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
187
+ configFile: string | null;
188
+ problems: {
189
+ key: string;
190
+ problem: string;
191
+ values: {
192
+ key: string;
193
+ value: string;
194
+ source: "default" | "file" | "flag";
195
+ }[];
196
+ }[];
197
+ }]>;
198
+ missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
199
+ missing: ("project" | "scope")[];
200
+ }]>;
201
+ }, {
202
+ readonly pullRequestUnreadable: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
203
+ pr: z.ZodNumber;
204
+ repo: z.ZodString;
205
+ kind: z.ZodEnum<{
206
+ "connect-failed": "connect-failed";
207
+ "http-error": "http-error";
208
+ malformed: "malformed";
209
+ "no-token": "no-token";
210
+ "not-found": "not-found";
211
+ rejected: "rejected";
212
+ timeout: "timeout";
213
+ }>;
214
+ status: z.ZodNullable<z.ZodNumber>;
215
+ message: z.ZodNullable<z.ZodString>;
216
+ tokenOrigin: z.ZodNullable<z.ZodEnum<{
217
+ GH_TOKEN: "GH_TOKEN";
218
+ GITHUB_TOKEN: "GITHUB_TOKEN";
219
+ "gh auth token": "gh auth token";
220
+ }>>;
221
+ }, z.core.$strip>, readonly []>;
222
+ readonly prBuildsUnlisted: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
223
+ pr: z.ZodNumber;
224
+ failure: z.ZodObject<{
225
+ kind: z.ZodEnum<{
226
+ "connect-failed": "connect-failed";
227
+ "http-error": "http-error";
228
+ malformed: "malformed";
229
+ "not-found": "not-found";
230
+ rejected: "rejected";
231
+ timeout: "timeout";
232
+ }>;
233
+ status: z.ZodNullable<z.ZodNumber>;
234
+ detail: z.ZodString;
235
+ }, z.core.$strip>;
236
+ }, z.core.$strip>, readonly []>;
237
+ readonly prBuildNotReady: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
238
+ pr: z.ZodNumber;
239
+ headSha: z.ZodString;
240
+ newest: z.ZodNullable<z.ZodObject<{
241
+ build: z.ZodString;
242
+ headSha: z.ZodString;
243
+ createdAt: z.ZodString;
244
+ }, z.core.$strip>>;
245
+ }, z.core.$strip>, readonly []>;
246
+ readonly prBuildExpired: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
247
+ pr: z.ZodNumber;
248
+ headSha: z.ZodString;
249
+ build: z.ZodString;
250
+ expiresAt: z.ZodString;
251
+ }, z.core.$strip>, readonly []>;
252
+ readonly poolUnavailable: {
253
+ readonly exitCode: 1;
254
+ readonly description: "storm couldn't use the pool, so it minted no credential and created no Testserver sandbox.";
255
+ readonly schema: z.ZodObject<{
256
+ path: z.ZodString;
257
+ message: z.ZodString;
258
+ }, z.core.$strip>;
259
+ readonly render: ({ path, message }: {
260
+ path: string;
261
+ message: string;
262
+ }) => {
263
+ message: string;
264
+ rows: [string, string][];
265
+ next: {
266
+ type: "text";
267
+ text: string;
268
+ }[];
269
+ };
270
+ };
271
+ readonly mintFailed: {
272
+ readonly exitCode: 1;
273
+ readonly description: "The vercel CLI couldn't mint a credential for the team and project.";
274
+ readonly schema: z.ZodObject<{
275
+ team: z.ZodString;
276
+ project: z.ZodString;
277
+ cause: z.ZodString;
278
+ fix: z.ZodString;
279
+ }, z.core.$strip>;
280
+ readonly render: ({ cause, fix }: {
281
+ team: string;
282
+ project: string;
283
+ cause: string;
284
+ fix: string;
285
+ }) => {
286
+ message: string;
287
+ next: {
288
+ type: "text";
289
+ text: string;
290
+ }[];
291
+ };
292
+ };
293
+ readonly tokenRequestFailed: {
294
+ readonly exitCode: 1;
295
+ readonly description: "With --credential github-actions, the GitHub Actions OIDC token request failed.";
296
+ readonly schema: z.ZodObject<{
297
+ cause: z.ZodEnum<{
298
+ "request-failed": "request-failed";
299
+ "variables-missing": "variables-missing";
300
+ }>;
301
+ missing: z.ZodNullable<z.ZodArray<z.ZodEnum<{
302
+ ACTIONS_ID_TOKEN_REQUEST_TOKEN: "ACTIONS_ID_TOKEN_REQUEST_TOKEN";
303
+ ACTIONS_ID_TOKEN_REQUEST_URL: "ACTIONS_ID_TOKEN_REQUEST_URL";
304
+ }>>>;
305
+ status: z.ZodNullable<z.ZodNumber>;
306
+ said: z.ZodNullable<z.ZodString>;
307
+ detail: z.ZodString;
308
+ fix: z.ZodString;
309
+ }, z.core.$strip>;
310
+ readonly render: ({ detail, fix }: {
311
+ cause: "request-failed" | "variables-missing";
312
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
313
+ status: number | null;
314
+ said: string | null;
315
+ detail: string;
316
+ fix: string;
317
+ }) => {
318
+ message: string;
319
+ next: {
320
+ type: "text";
321
+ text: string;
322
+ }[];
323
+ };
324
+ };
325
+ readonly credentialRejected: {
326
+ readonly exitCode: 1;
327
+ readonly description: "The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401 or a 403).";
328
+ readonly schema: z.ZodObject<{
329
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
330
+ source: z.ZodLiteral<"mint">;
331
+ team: z.ZodString;
332
+ project: z.ZodString;
333
+ }, z.core.$strip>, z.ZodObject<{
334
+ source: z.ZodLiteral<"github-actions">;
335
+ claims: z.ZodNullable<z.ZodObject<{
336
+ aud: z.ZodString;
337
+ repository: z.ZodString;
338
+ }, z.core.$strip>>;
339
+ }, z.core.$strip>], "source">;
340
+ fix: z.ZodString;
341
+ status: z.ZodNumber;
342
+ vercelId: z.ZodNullable<z.ZodString>;
343
+ }, z.core.$strip>;
344
+ readonly render: ({ origin, fix, status, vercelId }: {
345
+ origin: {
346
+ source: "mint";
347
+ team: string;
348
+ project: string;
349
+ } | {
350
+ source: "github-actions";
351
+ claims: {
352
+ aud: string;
353
+ repository: string;
354
+ } | null;
355
+ };
356
+ fix: string;
357
+ status: number;
358
+ vercelId: string | null;
359
+ }) => {
360
+ message: string;
361
+ rows: (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
362
+ next: {
363
+ type: "text";
364
+ text: string;
365
+ }[];
366
+ };
367
+ };
368
+ readonly testserverUnreachable: {
369
+ readonly exitCode: 1;
370
+ readonly description: "No create reached the Testserver control plane, after every attempt.";
371
+ readonly schema: z.ZodObject<{
372
+ attempts: z.ZodNumber;
373
+ code: z.ZodString;
374
+ }, z.core.$strip>;
375
+ readonly render: ({ attempts, code }: {
376
+ attempts: number;
377
+ code: string;
378
+ }) => {
379
+ message: string;
380
+ next: {
381
+ type: "text";
382
+ text: string;
383
+ }[];
384
+ };
385
+ };
386
+ readonly poolWriteFailed: {
387
+ readonly exitCode: 1;
388
+ readonly description: "Created the Testserver sandbox, but couldn't add it to the pool.";
389
+ readonly schema: z.ZodObject<{
390
+ testserverUrl: z.ZodString;
391
+ logViewerUrl: z.ZodString;
392
+ requestedBuild: z.ZodString;
393
+ resolvedBuild: z.ZodString;
394
+ pullRequest: z.ZodNullable<z.ZodObject<{
395
+ repo: z.ZodString;
396
+ number: z.ZodNumber;
397
+ headSha: z.ZodString;
398
+ }, z.core.$strip>>;
399
+ ttlMinutes: z.ZodNumber;
400
+ configFile: z.ZodNullable<z.ZodString>;
401
+ path: z.ZodString;
402
+ message: z.ZodString;
403
+ }, z.core.$strip>;
404
+ readonly render: (failure: {
405
+ testserverUrl: string;
406
+ logViewerUrl: string;
407
+ requestedBuild: string;
408
+ resolvedBuild: string;
409
+ pullRequest: {
410
+ repo: string;
411
+ number: number;
412
+ headSha: string;
413
+ } | null;
414
+ ttlMinutes: number;
415
+ configFile: string | null;
416
+ path: string;
417
+ message: string;
418
+ }) => {
419
+ message: string;
420
+ rows: [string, string][];
421
+ next: {
422
+ type: "text";
423
+ text: string;
424
+ }[];
425
+ };
426
+ };
427
+ readonly createFailed: {
428
+ readonly exitCode: 1;
429
+ readonly description: "The create reached the Testserver control plane and failed.";
430
+ readonly schema: z.ZodObject<{
431
+ kind: z.ZodEnum<{
432
+ dropped: "dropped";
433
+ "http-error": "http-error";
434
+ malformed: "malformed";
435
+ "stream-ended": "stream-ended";
436
+ "stream-error": "stream-error";
437
+ timeout: "timeout";
438
+ }>;
439
+ build: z.ZodString;
440
+ ttlMinutes: z.ZodNumber;
441
+ detail: z.ZodNullable<z.ZodString>;
442
+ status: z.ZodNullable<z.ZodNumber>;
443
+ seconds: z.ZodNullable<z.ZodNumber>;
444
+ sandboxMayExist: z.ZodBoolean;
445
+ }, z.core.$strip>;
446
+ readonly render: (failure: {
447
+ kind: "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
448
+ build: string;
449
+ ttlMinutes: number;
450
+ detail: string | null;
451
+ status: number | null;
452
+ seconds: number | null;
453
+ sandboxMayExist: boolean;
454
+ }) => {
455
+ message: string;
456
+ next?: {
457
+ type: "text";
458
+ text: string;
459
+ }[];
460
+ };
461
+ };
462
+ readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
463
+ file: string;
464
+ problems: {
465
+ key: string | null;
466
+ location: {
467
+ line: number;
468
+ column: number | null;
469
+ } | null;
470
+ problem: string;
471
+ }[];
472
+ }]>;
473
+ readonly invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
474
+ configFile: string | null;
475
+ problems: {
476
+ key: string;
477
+ problem: string;
478
+ values: {
479
+ key: string;
480
+ value: string;
481
+ source: "default" | "file" | "flag";
482
+ }[];
483
+ }[];
484
+ }]>;
485
+ readonly missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
486
+ missing: ("project" | "scope")[];
487
+ }]>;
488
+ }>, import("@vercel/clinkr").OutcomeOf<import("@vercel/clinkr").Outcomes<{
489
+ created: z.ZodObject<{
490
+ testserverUrl: z.ZodString;
491
+ logViewerUrl: z.ZodString;
492
+ requestedBuild: z.ZodString;
493
+ resolvedBuild: z.ZodString;
494
+ pullRequest: z.ZodNullable<z.ZodObject<{
495
+ repo: z.ZodString;
496
+ number: z.ZodNumber;
497
+ headSha: z.ZodString;
498
+ }, z.core.$strip>>;
34
499
  ttlMinutes: z.ZodNumber;
35
500
  configFile: z.ZodNullable<z.ZodString>;
36
501
  }, z.core.$strip>;
37
502
  }, {
38
503
  created: unknown;
39
504
  }, {
505
+ pullRequestUnreadable: z.ZodObject<{
506
+ pr: z.ZodNumber;
507
+ repo: z.ZodString;
508
+ kind: z.ZodEnum<{
509
+ "connect-failed": "connect-failed";
510
+ "http-error": "http-error";
511
+ malformed: "malformed";
512
+ "no-token": "no-token";
513
+ "not-found": "not-found";
514
+ rejected: "rejected";
515
+ timeout: "timeout";
516
+ }>;
517
+ status: z.ZodNullable<z.ZodNumber>;
518
+ message: z.ZodNullable<z.ZodString>;
519
+ tokenOrigin: z.ZodNullable<z.ZodEnum<{
520
+ GH_TOKEN: "GH_TOKEN";
521
+ GITHUB_TOKEN: "GITHUB_TOKEN";
522
+ "gh auth token": "gh auth token";
523
+ }>>;
524
+ }, z.core.$strip>;
525
+ prBuildsUnlisted: z.ZodObject<{
526
+ pr: z.ZodNumber;
527
+ failure: z.ZodObject<{
528
+ kind: z.ZodEnum<{
529
+ "connect-failed": "connect-failed";
530
+ "http-error": "http-error";
531
+ malformed: "malformed";
532
+ "not-found": "not-found";
533
+ rejected: "rejected";
534
+ timeout: "timeout";
535
+ }>;
536
+ status: z.ZodNullable<z.ZodNumber>;
537
+ detail: z.ZodString;
538
+ }, z.core.$strip>;
539
+ }, z.core.$strip>;
540
+ prBuildNotReady: z.ZodObject<{
541
+ pr: z.ZodNumber;
542
+ headSha: z.ZodString;
543
+ newest: z.ZodNullable<z.ZodObject<{
544
+ build: z.ZodString;
545
+ headSha: z.ZodString;
546
+ createdAt: z.ZodString;
547
+ }, z.core.$strip>>;
548
+ }, z.core.$strip>;
549
+ prBuildExpired: z.ZodObject<{
550
+ pr: z.ZodNumber;
551
+ headSha: z.ZodString;
552
+ build: z.ZodString;
553
+ expiresAt: z.ZodString;
554
+ }, z.core.$strip>;
40
555
  poolUnavailable: z.ZodObject<{
41
556
  path: z.ZodString;
42
557
  message: z.ZodString;
@@ -86,6 +601,11 @@ export declare function command(cmd: CommandBuilder<TestserverCommandApp>): impo
86
601
  logViewerUrl: z.ZodString;
87
602
  requestedBuild: z.ZodString;
88
603
  resolvedBuild: z.ZodString;
604
+ pullRequest: z.ZodNullable<z.ZodObject<{
605
+ repo: z.ZodString;
606
+ number: z.ZodNumber;
607
+ headSha: z.ZodString;
608
+ }, z.core.$strip>>;
89
609
  ttlMinutes: z.ZodNumber;
90
610
  configFile: z.ZodNullable<z.ZodString>;
91
611
  path: z.ZodString;
@@ -133,4 +653,291 @@ export declare function command(cmd: CommandBuilder<TestserverCommandApp>): impo
133
653
  missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
134
654
  missing: ("project" | "scope")[];
135
655
  }]>;
136
- }>, TestserverCommandApp, false>;
656
+ }, {
657
+ readonly pullRequestUnreadable: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
658
+ pr: z.ZodNumber;
659
+ repo: z.ZodString;
660
+ kind: z.ZodEnum<{
661
+ "connect-failed": "connect-failed";
662
+ "http-error": "http-error";
663
+ malformed: "malformed";
664
+ "no-token": "no-token";
665
+ "not-found": "not-found";
666
+ rejected: "rejected";
667
+ timeout: "timeout";
668
+ }>;
669
+ status: z.ZodNullable<z.ZodNumber>;
670
+ message: z.ZodNullable<z.ZodString>;
671
+ tokenOrigin: z.ZodNullable<z.ZodEnum<{
672
+ GH_TOKEN: "GH_TOKEN";
673
+ GITHUB_TOKEN: "GITHUB_TOKEN";
674
+ "gh auth token": "gh auth token";
675
+ }>>;
676
+ }, z.core.$strip>, readonly []>;
677
+ readonly prBuildsUnlisted: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
678
+ pr: z.ZodNumber;
679
+ failure: z.ZodObject<{
680
+ kind: z.ZodEnum<{
681
+ "connect-failed": "connect-failed";
682
+ "http-error": "http-error";
683
+ malformed: "malformed";
684
+ "not-found": "not-found";
685
+ rejected: "rejected";
686
+ timeout: "timeout";
687
+ }>;
688
+ status: z.ZodNullable<z.ZodNumber>;
689
+ detail: z.ZodString;
690
+ }, z.core.$strip>;
691
+ }, z.core.$strip>, readonly []>;
692
+ readonly prBuildNotReady: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
693
+ pr: z.ZodNumber;
694
+ headSha: z.ZodString;
695
+ newest: z.ZodNullable<z.ZodObject<{
696
+ build: z.ZodString;
697
+ headSha: z.ZodString;
698
+ createdAt: z.ZodString;
699
+ }, z.core.$strip>>;
700
+ }, z.core.$strip>, readonly []>;
701
+ readonly prBuildExpired: import("@vercel/clinkr").DataErrorDefinition<z.ZodObject<{
702
+ pr: z.ZodNumber;
703
+ headSha: z.ZodString;
704
+ build: z.ZodString;
705
+ expiresAt: z.ZodString;
706
+ }, z.core.$strip>, readonly []>;
707
+ readonly poolUnavailable: {
708
+ readonly exitCode: 1;
709
+ readonly description: "storm couldn't use the pool, so it minted no credential and created no Testserver sandbox.";
710
+ readonly schema: z.ZodObject<{
711
+ path: z.ZodString;
712
+ message: z.ZodString;
713
+ }, z.core.$strip>;
714
+ readonly render: ({ path, message }: {
715
+ path: string;
716
+ message: string;
717
+ }) => {
718
+ message: string;
719
+ rows: [string, string][];
720
+ next: {
721
+ type: "text";
722
+ text: string;
723
+ }[];
724
+ };
725
+ };
726
+ readonly mintFailed: {
727
+ readonly exitCode: 1;
728
+ readonly description: "The vercel CLI couldn't mint a credential for the team and project.";
729
+ readonly schema: z.ZodObject<{
730
+ team: z.ZodString;
731
+ project: z.ZodString;
732
+ cause: z.ZodString;
733
+ fix: z.ZodString;
734
+ }, z.core.$strip>;
735
+ readonly render: ({ cause, fix }: {
736
+ team: string;
737
+ project: string;
738
+ cause: string;
739
+ fix: string;
740
+ }) => {
741
+ message: string;
742
+ next: {
743
+ type: "text";
744
+ text: string;
745
+ }[];
746
+ };
747
+ };
748
+ readonly tokenRequestFailed: {
749
+ readonly exitCode: 1;
750
+ readonly description: "With --credential github-actions, the GitHub Actions OIDC token request failed.";
751
+ readonly schema: z.ZodObject<{
752
+ cause: z.ZodEnum<{
753
+ "request-failed": "request-failed";
754
+ "variables-missing": "variables-missing";
755
+ }>;
756
+ missing: z.ZodNullable<z.ZodArray<z.ZodEnum<{
757
+ ACTIONS_ID_TOKEN_REQUEST_TOKEN: "ACTIONS_ID_TOKEN_REQUEST_TOKEN";
758
+ ACTIONS_ID_TOKEN_REQUEST_URL: "ACTIONS_ID_TOKEN_REQUEST_URL";
759
+ }>>>;
760
+ status: z.ZodNullable<z.ZodNumber>;
761
+ said: z.ZodNullable<z.ZodString>;
762
+ detail: z.ZodString;
763
+ fix: z.ZodString;
764
+ }, z.core.$strip>;
765
+ readonly render: ({ detail, fix }: {
766
+ cause: "request-failed" | "variables-missing";
767
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
768
+ status: number | null;
769
+ said: string | null;
770
+ detail: string;
771
+ fix: string;
772
+ }) => {
773
+ message: string;
774
+ next: {
775
+ type: "text";
776
+ text: string;
777
+ }[];
778
+ };
779
+ };
780
+ readonly credentialRejected: {
781
+ readonly exitCode: 1;
782
+ readonly description: "The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401 or a 403).";
783
+ readonly schema: z.ZodObject<{
784
+ origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
785
+ source: z.ZodLiteral<"mint">;
786
+ team: z.ZodString;
787
+ project: z.ZodString;
788
+ }, z.core.$strip>, z.ZodObject<{
789
+ source: z.ZodLiteral<"github-actions">;
790
+ claims: z.ZodNullable<z.ZodObject<{
791
+ aud: z.ZodString;
792
+ repository: z.ZodString;
793
+ }, z.core.$strip>>;
794
+ }, z.core.$strip>], "source">;
795
+ fix: z.ZodString;
796
+ status: z.ZodNumber;
797
+ vercelId: z.ZodNullable<z.ZodString>;
798
+ }, z.core.$strip>;
799
+ readonly render: ({ origin, fix, status, vercelId }: {
800
+ origin: {
801
+ source: "mint";
802
+ team: string;
803
+ project: string;
804
+ } | {
805
+ source: "github-actions";
806
+ claims: {
807
+ aud: string;
808
+ repository: string;
809
+ } | null;
810
+ };
811
+ fix: string;
812
+ status: number;
813
+ vercelId: string | null;
814
+ }) => {
815
+ message: string;
816
+ rows: (readonly ["Project", string] | readonly ["Team", string])[] | (readonly ["aud", string] | readonly ["repository", string])[];
817
+ next: {
818
+ type: "text";
819
+ text: string;
820
+ }[];
821
+ };
822
+ };
823
+ readonly testserverUnreachable: {
824
+ readonly exitCode: 1;
825
+ readonly description: "No create reached the Testserver control plane, after every attempt.";
826
+ readonly schema: z.ZodObject<{
827
+ attempts: z.ZodNumber;
828
+ code: z.ZodString;
829
+ }, z.core.$strip>;
830
+ readonly render: ({ attempts, code }: {
831
+ attempts: number;
832
+ code: string;
833
+ }) => {
834
+ message: string;
835
+ next: {
836
+ type: "text";
837
+ text: string;
838
+ }[];
839
+ };
840
+ };
841
+ readonly poolWriteFailed: {
842
+ readonly exitCode: 1;
843
+ readonly description: "Created the Testserver sandbox, but couldn't add it to the pool.";
844
+ readonly schema: z.ZodObject<{
845
+ testserverUrl: z.ZodString;
846
+ logViewerUrl: z.ZodString;
847
+ requestedBuild: z.ZodString;
848
+ resolvedBuild: z.ZodString;
849
+ pullRequest: z.ZodNullable<z.ZodObject<{
850
+ repo: z.ZodString;
851
+ number: z.ZodNumber;
852
+ headSha: z.ZodString;
853
+ }, z.core.$strip>>;
854
+ ttlMinutes: z.ZodNumber;
855
+ configFile: z.ZodNullable<z.ZodString>;
856
+ path: z.ZodString;
857
+ message: z.ZodString;
858
+ }, z.core.$strip>;
859
+ readonly render: (failure: {
860
+ testserverUrl: string;
861
+ logViewerUrl: string;
862
+ requestedBuild: string;
863
+ resolvedBuild: string;
864
+ pullRequest: {
865
+ repo: string;
866
+ number: number;
867
+ headSha: string;
868
+ } | null;
869
+ ttlMinutes: number;
870
+ configFile: string | null;
871
+ path: string;
872
+ message: string;
873
+ }) => {
874
+ message: string;
875
+ rows: [string, string][];
876
+ next: {
877
+ type: "text";
878
+ text: string;
879
+ }[];
880
+ };
881
+ };
882
+ readonly createFailed: {
883
+ readonly exitCode: 1;
884
+ readonly description: "The create reached the Testserver control plane and failed.";
885
+ readonly schema: z.ZodObject<{
886
+ kind: z.ZodEnum<{
887
+ dropped: "dropped";
888
+ "http-error": "http-error";
889
+ malformed: "malformed";
890
+ "stream-ended": "stream-ended";
891
+ "stream-error": "stream-error";
892
+ timeout: "timeout";
893
+ }>;
894
+ build: z.ZodString;
895
+ ttlMinutes: z.ZodNumber;
896
+ detail: z.ZodNullable<z.ZodString>;
897
+ status: z.ZodNullable<z.ZodNumber>;
898
+ seconds: z.ZodNullable<z.ZodNumber>;
899
+ sandboxMayExist: z.ZodBoolean;
900
+ }, z.core.$strip>;
901
+ readonly render: (failure: {
902
+ kind: "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
903
+ build: string;
904
+ ttlMinutes: number;
905
+ detail: string | null;
906
+ status: number | null;
907
+ seconds: number | null;
908
+ sandboxMayExist: boolean;
909
+ }) => {
910
+ message: string;
911
+ next?: {
912
+ type: "text";
913
+ text: string;
914
+ }[];
915
+ };
916
+ };
917
+ readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
918
+ file: string;
919
+ problems: {
920
+ key: string | null;
921
+ location: {
922
+ line: number;
923
+ column: number | null;
924
+ } | null;
925
+ problem: string;
926
+ }[];
927
+ }]>;
928
+ readonly invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
929
+ configFile: string | null;
930
+ problems: {
931
+ key: string;
932
+ problem: string;
933
+ values: {
934
+ key: string;
935
+ value: string;
936
+ source: "default" | "file" | "flag";
937
+ }[];
938
+ }[];
939
+ }]>;
940
+ readonly missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
941
+ missing: ("project" | "scope")[];
942
+ }]>;
943
+ }>>, TestserverCommandApp, false>;