@cnc-tools/storm 0.7.0 → 0.8.1

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