@cnc-tools/storm 0.16.0 → 0.17.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 (281) hide show
  1. package/dist/application.d.ts +22 -13
  2. package/dist/application.js +21 -10
  3. package/dist/bin/run.d.ts +18 -0
  4. package/dist/bin/run.js +31 -0
  5. package/dist/bin/storm.js +42 -26
  6. package/dist/build-info.js +1 -1
  7. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
  8. package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
  9. package/dist/chunks/{chunk-P357TZAY.js → chunk-4O5C2XGJ.js} +18 -15
  10. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
  11. package/dist/chunks/{chunk-OIY3DMF2.js → chunk-6UHIJXZG.js} +3 -3
  12. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  13. package/dist/chunks/{chunk-CK2GZEPK.js → chunk-7DZE67QM.js} +2 -2
  14. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
  15. package/dist/chunks/{chunk-2MAD5NKK.js → chunk-CKGZA25H.js} +1 -18
  16. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
  17. package/dist/chunks/{chunk-V4IKA3WI.js → chunk-DADEYJDW.js} +24 -17
  18. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  19. package/dist/chunks/chunk-F4MOYHRY.js +198 -0
  20. package/dist/chunks/{chunk-HVNK3I45.js → chunk-FNBB6V4R.js} +1 -1
  21. package/dist/chunks/{chunk-G3PHMXH5.js → chunk-GRT3UIBV.js} +18 -1
  22. package/dist/chunks/chunk-HP3CURSZ.js +88 -0
  23. package/dist/chunks/{chunk-DWEAHX4T.js → chunk-HWIQ2S7K.js} +5 -5
  24. package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
  25. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
  26. package/dist/chunks/{chunk-3L52KNQA.js → chunk-M7EKRGVD.js} +8 -8
  27. package/dist/chunks/chunk-MR77L2GK.js +340 -0
  28. package/dist/chunks/{chunk-DC2CDHNK.js → chunk-RNAS7JHE.js} +1438 -445
  29. package/dist/chunks/{chunk-FCQUJDA4.js → chunk-RWIXDDCK.js} +4 -189
  30. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
  31. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  32. package/dist/chunks/{chunk-FOZWA52V.js → chunk-YEPFSLQR.js} +480 -375
  33. package/dist/chunks/{live-app-WECQOQ4C.js → live-app-R76JQXZL.js} +15 -13
  34. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
  35. package/dist/commands/exec/across-sandboxes-outcomes.js +2 -2
  36. package/dist/commands/exec/before-run.d.ts +123 -0
  37. package/dist/commands/exec/before-run.js +105 -0
  38. package/dist/commands/exec/command.d.ts +31 -2
  39. package/dist/commands/exec/command.js +31 -95
  40. package/dist/commands/exec/driver-plan.d.ts +9 -4
  41. package/dist/commands/exec/driver-plan.js +8 -8
  42. package/dist/commands/exec/exec-words.js +1 -1
  43. package/dist/commands/exec/execute-run.d.ts +39 -0
  44. package/dist/commands/exec/execute-run.js +325 -0
  45. package/dist/commands/exec/live-view.d.ts +3 -3
  46. package/dist/commands/exec/live-view.js +16 -15
  47. package/dist/commands/exec/metadata.js +1 -1
  48. package/dist/commands/exec/mint-failed.d.ts +38 -0
  49. package/dist/commands/exec/mint-failed.js +27 -4
  50. package/dist/commands/exec/outcomes.d.ts +34 -8
  51. package/dist/commands/exec/outcomes.js +30 -23
  52. package/dist/commands/exec/plan-run.d.ts +58 -150
  53. package/dist/commands/exec/plan-run.js +232 -88
  54. package/dist/commands/exec/progress.d.ts +10 -6
  55. package/dist/commands/exec/progress.js +38 -25
  56. package/dist/commands/exec/run-bin.d.ts +11 -11
  57. package/dist/commands/exec/run-bin.js +9 -9
  58. package/dist/commands/exec/run-flags.d.ts +69 -0
  59. package/dist/commands/exec/run-flags.js +58 -0
  60. package/dist/commands/exec/run-metadata.js +4 -4
  61. package/dist/commands/exec/run-summary.d.ts +58 -0
  62. package/dist/commands/exec/run-summary.js +205 -0
  63. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  64. package/dist/commands/exec/runner-refusals.js +71 -0
  65. package/dist/commands/exec/sandbox-progress.js +3 -0
  66. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  67. package/dist/commands/exec/stopped-outcome.js +77 -0
  68. package/dist/commands/exec/view.d.ts +20 -11
  69. package/dist/commands/exec/view.js +103 -47
  70. package/dist/commands/runs/facts.d.ts +7 -3
  71. package/dist/commands/runs/facts.js +17 -8
  72. package/dist/commands/runs/list/command.d.ts +14 -6
  73. package/dist/commands/runs/list/command.js +10 -10
  74. package/dist/commands/runs/list/outcomes.d.ts +7 -3
  75. package/dist/commands/runs/logs/command.js +10 -10
  76. package/dist/commands/runs/show/command.d.ts +14 -6
  77. package/dist/commands/runs/show/command.js +30 -28
  78. package/dist/commands/runs/show/outcomes.d.ts +7 -3
  79. package/dist/commands/runs/show/outcomes.js +7 -5
  80. package/dist/commands/snapshots/access.d.ts +111 -0
  81. package/dist/commands/snapshots/access.js +96 -0
  82. package/dist/commands/snapshots/build/command.d.ts +360 -93
  83. package/dist/commands/snapshots/build/command.js +446 -150
  84. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  85. package/dist/commands/snapshots/build/metadata.js +31 -11
  86. package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
  87. package/dist/commands/snapshots/build/outcomes.js +200 -36
  88. package/dist/commands/snapshots/list/command.d.ts +366 -25
  89. package/dist/commands/snapshots/list/command.js +296 -66
  90. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  91. package/dist/commands/snapshots/list/metadata.js +29 -6
  92. package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
  93. package/dist/commands/snapshots/list/outcomes.js +221 -50
  94. package/dist/commands/snapshots/metadata.js +1 -1
  95. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  96. package/dist/commands/snapshots/prune/command.js +161 -0
  97. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  98. package/dist/commands/snapshots/prune/metadata.js +39 -0
  99. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  100. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  101. package/dist/commands/suites/list/command.js +17 -17
  102. package/dist/commands/suites/list/outcomes.js +2 -2
  103. package/dist/commands/test/command.d.ts +31 -2
  104. package/dist/commands/test/command.js +49 -252
  105. package/dist/commands/test/outcomes.d.ts +15 -1
  106. package/dist/config/check-runner.d.ts +3 -3
  107. package/dist/config/check-runner.js +8 -7
  108. package/dist/config/credential-resolver.d.ts +50 -5
  109. package/dist/config/credential-resolver.js +51 -19
  110. package/dist/config/credential-settle.d.ts +6 -2
  111. package/dist/config/credential-settle.js +11 -5
  112. package/dist/config/index.d.ts +2 -2
  113. package/dist/config/index.js +1 -1
  114. package/dist/config/runner.d.ts +5 -5
  115. package/dist/config/runner.js +1 -1
  116. package/dist/config/schema.d.ts +2 -2
  117. package/dist/config/schema.js +1 -1
  118. package/dist/config-file/define.d.ts +1 -1
  119. package/dist/config-file/define.js +1 -1
  120. package/dist/config-file/runner.d.ts +5 -5
  121. package/dist/config-file/toolchain.d.ts +1 -1
  122. package/dist/config-file/toolchain.js +2 -2
  123. package/dist/context.d.ts +8 -6
  124. package/dist/context.js +7 -6
  125. package/dist/core/across-sandboxes.d.ts +7 -6
  126. package/dist/core/across-sandboxes.js +123 -152
  127. package/dist/core/coordinator.d.ts +166 -0
  128. package/dist/core/coordinator.js +233 -0
  129. package/dist/core/events.d.ts +2 -2
  130. package/dist/core/index.d.ts +4 -2
  131. package/dist/core/index.js +1 -1
  132. package/dist/core/outcomes.d.ts +148 -0
  133. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  134. package/dist/core/resources.d.ts +31 -53
  135. package/dist/core/resources.js +32 -70
  136. package/dist/core/run-state.d.ts +7 -1
  137. package/dist/core/run-state.js +2 -0
  138. package/dist/core/run.d.ts +32 -236
  139. package/dist/core/run.js +106 -266
  140. package/dist/core/state-directory.d.ts +1 -1
  141. package/dist/core/state-directory.js +2 -2
  142. package/dist/credential/gateways.d.ts +15 -1
  143. package/dist/credential/index.d.ts +4 -3
  144. package/dist/credential/index.js +3 -2
  145. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  146. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  147. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  148. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  149. package/dist/credential/source.d.ts +73 -6
  150. package/dist/credential/source.js +55 -2
  151. package/dist/extension-commands.d.ts +6 -1
  152. package/dist/extension-commands.js +15 -1
  153. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  154. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  155. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  156. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  157. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  158. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  159. package/dist/extensions/testserver/credential-facts.js +29 -11
  160. package/dist/extensions/testserver/lifecycle.js +7 -1
  161. package/dist/extensions/testserver/limit.d.ts +3 -0
  162. package/dist/extensions/testserver/limit.js +3 -0
  163. package/dist/extensions/testserver/provision.d.ts +8 -1
  164. package/dist/extensions/testserver/provision.js +8 -3
  165. package/dist/extensions/testserver/refusals.d.ts +6 -1
  166. package/dist/extensions/testserver/refusals.js +16 -1
  167. package/dist/extensions/testserver/resource.d.ts +1 -1
  168. package/dist/extensions/testserver/resource.js +1 -1
  169. package/dist/extensions/testserver/result.d.ts +1 -1
  170. package/dist/extensions/testserver/result.js +9 -4
  171. package/dist/planning/driver-file-lists.d.ts +0 -15
  172. package/dist/planning/driver-file-lists.js +2 -21
  173. package/dist/planning/plan-only.d.ts +3 -14
  174. package/dist/planning/plan-only.js +11 -20
  175. package/dist/planning/run-kind-flags.js +2 -2
  176. package/dist/planning/run-plan.d.ts +45 -12
  177. package/dist/planning/run-plan.js +4 -3
  178. package/dist/planning/suites.d.ts +1 -1
  179. package/dist/planning/suites.js +2 -2
  180. package/dist/planning/test-plan.d.ts +9 -0
  181. package/dist/planning/test-plan.js +9 -0
  182. package/dist/run-directory/recording.js +2 -2
  183. package/dist/run-directory/run-record.d.ts +21 -6
  184. package/dist/run-directory/run-record.js +12 -9
  185. package/dist/runner/base.js +1 -1
  186. package/dist/runner/build-snapshots.d.ts +55 -29
  187. package/dist/runner/build-snapshots.js +130 -29
  188. package/dist/runner/context.d.ts +15 -7
  189. package/dist/runner/context.js +19 -6
  190. package/dist/runner/events.d.ts +16 -10
  191. package/dist/runner/gateways.d.ts +87 -21
  192. package/dist/runner/gateways.js +1 -1
  193. package/dist/runner/index.d.ts +11 -7
  194. package/dist/runner/index.js +9 -4
  195. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  196. package/dist/runner/live/sandbox-errors.js +4 -0
  197. package/dist/runner/live/sandbox-gateway.js +129 -3
  198. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  199. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  200. package/dist/runner/live/snapshot-records.js +6 -7
  201. package/dist/runner/local-snapshot-index.d.ts +199 -0
  202. package/dist/runner/local-snapshot-index.js +211 -0
  203. package/dist/runner/network-policy.d.ts +6 -6
  204. package/dist/runner/network-policy.js +7 -7
  205. package/dist/runner/policy-writes.d.ts +1 -1
  206. package/dist/runner/policy-writes.js +1 -1
  207. package/dist/runner/prepare.d.ts +14 -14
  208. package/dist/runner/prepare.js +20 -11
  209. package/dist/runner/ready.d.ts +18 -10
  210. package/dist/runner/ready.js +104 -33
  211. package/dist/runner/sandboxed-command.d.ts +3 -3
  212. package/dist/runner/sandboxed-command.js +3 -3
  213. package/dist/runner/scope.d.ts +10 -6
  214. package/dist/runner/scope.js +10 -3
  215. package/dist/runner/secrets.d.ts +13 -13
  216. package/dist/runner/secrets.js +18 -15
  217. package/dist/runner/session.d.ts +8 -8
  218. package/dist/runner/session.js +3 -3
  219. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  220. package/dist/runner/shared-snapshot-entry.js +168 -0
  221. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  222. package/dist/runner/shared-snapshot-list.js +155 -0
  223. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  224. package/dist/runner/shared-snapshot-lookup.js +118 -0
  225. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  226. package/dist/runner/shared-snapshot-prune.js +133 -0
  227. package/dist/runner/snapshot-build.d.ts +42 -14
  228. package/dist/runner/snapshot-build.js +32 -29
  229. package/dist/runner/snapshot-choice.js +1 -1
  230. package/dist/runner/snapshot-inspect.d.ts +39 -40
  231. package/dist/runner/snapshot-inspect.js +55 -35
  232. package/dist/runner/snapshot-key.d.ts +13 -12
  233. package/dist/runner/snapshot-key.js +13 -12
  234. package/dist/runner/steps.d.ts +1 -1
  235. package/dist/runner/steps.js +1 -1
  236. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
  237. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
  238. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +24 -23
  239. package/dist/runner/{recipe.js → vercel-sandbox-options.js} +70 -69
  240. package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
  241. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
  242. package/dist/sdk/extension/commands.d.ts +8 -3
  243. package/dist/sdk/extension/commands.js +3 -1
  244. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  245. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  246. package/dist/sdk/extension/credential-source.d.ts +20 -3
  247. package/dist/sdk/extension/credential-source.js +4 -4
  248. package/dist/sdk/extension/index.d.ts +3 -2
  249. package/dist/sdk/extension/index.js +2 -1
  250. package/dist/sdk/extension/resource-definition.d.ts +1 -1
  251. package/dist/sdk/extension/secret-source.d.ts +1 -1
  252. package/dist/sdk/extension/secret-source.js +1 -1
  253. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  254. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  255. package/dist/shared/cleanup.d.ts +3 -3
  256. package/dist/shared/cleanup.js +15 -5
  257. package/dist/shared/snapshot-text.d.ts +4 -4
  258. package/dist/shared/snapshot-text.js +11 -11
  259. package/dist/time/duration.js +1 -1
  260. package/package.json +3 -2
  261. package/skills/overview.md +4 -4
  262. package/skills/plan-runs.md +1 -1
  263. package/skills/read-run-output.md +6 -6
  264. package/dist/chunks/chunk-7EENF73W.js +0 -782
  265. package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
  266. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  267. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  268. package/dist/commands/exec/plan-only.d.ts +0 -10
  269. package/dist/commands/exec/plan-only.js +0 -45
  270. package/dist/commands/exec/run-command.d.ts +0 -475
  271. package/dist/commands/exec/run-command.js +0 -603
  272. package/dist/commands/exec/run-planned.d.ts +0 -20
  273. package/dist/commands/exec/run-planned.js +0 -22
  274. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  275. package/dist/commands/exec/sandbox-view.js +0 -72
  276. package/dist/commands/test/plan.d.ts +0 -92
  277. package/dist/commands/test/plan.js +0 -125
  278. package/dist/core/sandbox-end.d.ts +0 -64
  279. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  280. package/dist/runner/snapshot-cache.d.ts +0 -148
  281. package/dist/runner/snapshot-cache.js +0 -126
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  redactor
3
- } from "./chunk-HVNK3I45.js";
3
+ } from "./chunk-FNBB6V4R.js";
4
4
  import {
5
5
  declaredSecretValues,
6
6
  effectiveConfig
7
- } from "./chunk-DC2CDHNK.js";
7
+ } from "./chunk-RNAS7JHE.js";
8
8
 
9
9
  // src/planning/suites.ts
10
10
  function resolveProjectTests(file, driverByName) {
@@ -51,7 +51,7 @@ function formatCommandLine(command) {
51
51
  }
52
52
  function targetRedactor(target, env) {
53
53
  const runner = target.settingsFile.values?.settings.runner;
54
- return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.recipe : void 0, env));
54
+ return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.options : void 0, env));
55
55
  }
56
56
  function preRunLine(target, extraCliArgs, redact) {
57
57
  const label = target.name === null ? "tests" : `suite ${target.name}`;
@@ -2,7 +2,7 @@ import {
2
2
  booleanOption,
3
3
  mustBe,
4
4
  nonEmptyString
5
- } from "./chunk-AWBSONHB.js";
5
+ } from "./chunk-XBDRVFEV.js";
6
6
 
7
7
  // src/extensions/testserver/options/channels.ts
8
8
  var BUILD_CHANNELS = ["stable", "latest_main"];
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CONFIG_FILE_NAME
3
- } from "./chunk-DC2CDHNK.js";
3
+ } from "./chunk-RNAS7JHE.js";
4
4
  import {
5
5
  defineErrors
6
- } from "./chunk-VL7WFTVQ.js";
6
+ } from "./chunk-4WAMTUWZ.js";
7
7
 
8
8
  // src/planning/suite-not-found.ts
9
9
  import { z } from "zod";
@@ -7,7 +7,7 @@ import {
7
7
  resolveColorDepth,
8
8
  resolveUnicode,
9
9
  runCliWith
10
- } from "./chunk-VL7WFTVQ.js";
10
+ } from "./chunk-4WAMTUWZ.js";
11
11
 
12
12
  // ../../../libs/clinkr/ts/dist/node/environment.js
13
13
  var AGENT_VARIABLES = [
@@ -2,21 +2,7 @@ import {
2
2
  isoSecondsText,
3
3
  paint,
4
4
  seconds
5
- } from "./chunk-G3PHMXH5.js";
6
-
7
- // src/shared/dashboard.ts
8
- function projectPage({ team, project }) {
9
- return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
10
- }
11
- function sandboxPage(where, name) {
12
- return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
13
- }
14
- function sandboxConnectPage(where, name) {
15
- return `${sandboxPage(where, name)}/connect`;
16
- }
17
- function snapshotPage(where, id) {
18
- return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
19
- }
5
+ } from "./chunk-GRT3UIBV.js";
20
6
 
21
7
  // src/shared/sandbox-table.ts
22
8
  var SANDBOX_TABLE_HEADER = [
@@ -92,9 +78,6 @@ function sandboxTableLines(records, style = paint(false)) {
92
78
  }
93
79
 
94
80
  export {
95
- sandboxPage,
96
- sandboxConnectPage,
97
- snapshotPage,
98
81
  SANDBOX_TABLE_HEADER,
99
82
  testTotalsText,
100
83
  sandboxStateText,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  defineExtensionCommands,
3
3
  testserverCommands
4
- } from "./chunk-5CCP36QQ.js";
4
+ } from "./chunk-2RNDPDTJ.js";
5
5
 
6
6
  // src/extensions/testserver/command-tree.ts
7
7
  var testserverExtensionCommands = defineExtensionCommands({
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  muted
3
- } from "./chunk-TJNFVNKR.js";
3
+ } from "./chunk-LKTZ5OXS.js";
4
4
  import {
5
- sandboxPage,
6
- snapshotPage,
7
5
  testTotalsText
8
- } from "./chunk-2MAD5NKK.js";
9
- import {
10
- sandboxRecordSchema
11
- } from "./chunk-P357TZAY.js";
6
+ } from "./chunk-CKGZA25H.js";
12
7
  import {
13
8
  isoSecondsText,
9
+ sandboxPage,
14
10
  seconds,
15
- short
16
- } from "./chunk-G3PHMXH5.js";
11
+ short,
12
+ snapshotPage
13
+ } from "./chunk-GRT3UIBV.js";
14
+ import {
15
+ sandboxRecordSchema
16
+ } from "./chunk-4O5C2XGJ.js";
17
17
  import {
18
18
  stripAnsi
19
19
  } from "./chunk-F6N34UWB.js";
@@ -179,10 +179,10 @@ var runFactsSchema = z.object({
179
179
  z.object({ kind: z.literal("launch-machine") }),
180
180
  z.object({
181
181
  kind: z.literal("vercel-sandbox"),
182
- /** The control plane team the runner sandbox ran in. */
183
- team: z.string(),
184
- /** The control plane project the runner sandbox ran in. */
185
- project: z.string(),
182
+ /** The control plane team the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --scope). */
183
+ team: z.string().nullable(),
184
+ /** The control plane project the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --project). */
185
+ project: z.string().nullable(),
186
186
  /** The runner sandbox's region, such as iad1. */
187
187
  region: z.string(),
188
188
  /** The runner sandbox's runtime, such as node24. */
@@ -201,14 +201,16 @@ var runFactsSchema = z.object({
201
201
  keptUntil: z.string().nullable(),
202
202
  /** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
203
203
  keptMinutesLeft: z.number().nullable(),
204
- /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
204
+ /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, where a reused snapshot came from (`local` or `shared`), and its page in the Vercel dashboard. Null until known. */
205
205
  snapshot: z.object({
206
206
  id: z.string(),
207
207
  base: z.string(),
208
208
  built: z.boolean(),
209
209
  /** How many commits the run's HEAD had that its base, the commit it was built at, lacks; null when the run state had no count. */
210
210
  builtBehind: z.number().nullable(),
211
- url: z.string()
211
+ /** Where a reused snapshot came from (`local` or `shared`); null when this run built it or when unknown. */
212
+ source: z.enum(["local", "shared"]).nullable(),
213
+ url: z.string().nullable()
212
214
  }).nullable(),
213
215
  /** How many bytes of changes the run uploaded to the runner sandbox; null when the run stopped before the upload. */
214
216
  uploadBytes: z.number().nullable()
@@ -281,11 +283,16 @@ function runFacts(run, now) {
281
283
  function whereFacts(where, now) {
282
284
  if (where.kind === "launch-machine") return { kind: "launch-machine" };
283
285
  const { sandbox, snapshot, keptUntil } = where;
286
+ const project = where.team !== null && where.project !== null ? { team: where.team, project: where.project } : null;
284
287
  return {
285
288
  ...where,
286
289
  keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 6e4)),
287
- sandboxUrl: sandbox === null ? null : sandboxPage(where, sandbox),
288
- snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) }
290
+ sandboxUrl: sandbox === null || project === null ? null : sandboxPage(project, sandbox),
291
+ snapshot: snapshot === null ? null : {
292
+ ...snapshot,
293
+ source: snapshot.source ?? null,
294
+ url: project === null ? null : snapshotPage(project, snapshot.id)
295
+ }
289
296
  };
290
297
  }
291
298
  function scopeFacts(scope) {
@@ -22,13 +22,14 @@ import {
22
22
  testserverPoolRules,
23
23
  ttlMinutes,
24
24
  unavailablePoolStoreGateway
25
- } from "./chunk-CN4EFA5J.js";
25
+ } from "./chunk-72ZFEMAW.js";
26
26
  import {
27
27
  defineResource,
28
28
  describeCredentialFailure,
29
29
  optionKeyPath,
30
- tokenRequestFailureFacts
31
- } from "./chunk-AWBSONHB.js";
30
+ tokenRequestFailureFacts,
31
+ vercelOidcTokenFailureFacts
32
+ } from "./chunk-XBDRVFEV.js";
32
33
 
33
34
  // src/extensions/testserver/credential-facts.ts
34
35
  import { z } from "zod";
@@ -46,34 +47,54 @@ var credentialOriginSchema = z.discriminatedUnion("source", [
46
47
  source: z.literal("github-actions"),
47
48
  /** The token's aud and repository claims; null when they can't be read. */
48
49
  claims: z.object({ aud: z.string(), repository: z.string() }).nullable()
50
+ }),
51
+ z.object({
52
+ /** A pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN. */
53
+ source: z.literal("vercel-oidc")
49
54
  })
50
55
  ]);
51
56
  var rejectedCredentialShape = {
52
57
  origin: credentialOriginSchema,
53
- /** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
58
+ /** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token, or a trusted project's token for VERCEL_OIDC_TOKEN. */
54
59
  fix: z.string()
55
60
  };
56
61
  function rejectedCredentialFacts(origin) {
57
62
  return {
58
- origin: origin.source === "mint" ? { source: "mint", ...origin.target } : { source: "github-actions", claims: origin.claims === void 0 ? null : { ...origin.claims } },
63
+ origin: origin.source === "mint" ? { source: "mint", ...origin.target } : origin.source === "vercel-oidc" ? { source: "vercel-oidc" } : { source: "github-actions", claims: origin.claims === void 0 ? null : { ...origin.claims } },
59
64
  fix: rejectedCredentialFix(origin)
60
65
  };
61
66
  }
62
67
  function rejectedCredentialFix(origin) {
63
68
  if (origin.source === "mint")
64
69
  return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources; vercel-internal mints for project vercel on team vercel. Use a trusted team and project, then retry.";
70
+ if (origin.source === "vercel-oidc")
71
+ return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources. Set VERCEL_OIDC_TOKEN to a token from a trusted project, then retry.";
65
72
  const aud = origin.claims?.aud ?? "https://github.com/<owner>";
66
73
  const repository = origin.claims?.repository ?? "<owner>/<repo>";
67
74
  return `The Testserver control plane trusts GitHub Actions OIDC tokens only from repositories in its Trusted Sources. Ask the \`vercel/testserver\` owners for a Trusted Source rule matching \`aud: ${aud}\` and \`repository: ${repository}\`, then rerun the job.`;
68
75
  }
69
76
  function rejectedCredentialText(origin) {
70
- return origin.source === "mint" ? `the credential minted for project ${origin.project} on team ${origin.team}` : "the GitHub Actions OIDC token";
77
+ switch (origin.source) {
78
+ case "mint":
79
+ return `the credential minted for project ${origin.project} on team ${origin.team}`;
80
+ case "github-actions":
81
+ return "the GitHub Actions OIDC token";
82
+ case "vercel-oidc":
83
+ return "the Vercel OIDC token from VERCEL_OIDC_TOKEN";
84
+ }
71
85
  }
72
86
  function credentialOriginRows(origin) {
73
- return origin.source === "mint" ? [["Team", origin.team], ["Project", origin.project]] : [
74
- ["aud", origin.claims?.aud ?? "unreadable"],
75
- ["repository", origin.claims?.repository ?? "unreadable"]
76
- ];
87
+ switch (origin.source) {
88
+ case "mint":
89
+ return [["Team", origin.team], ["Project", origin.project]];
90
+ case "github-actions":
91
+ return [
92
+ ["aud", origin.claims?.aud ?? "unreadable"],
93
+ ["repository", origin.claims?.repository ?? "unreadable"]
94
+ ];
95
+ case "vercel-oidc":
96
+ return [["Credential", "VERCEL_OIDC_TOKEN"]];
97
+ }
77
98
  }
78
99
 
79
100
  // src/extensions/testserver/pr-build-facts.ts
@@ -443,7 +464,14 @@ function createWith(options, credential) {
443
464
  return { source: credential, ttlMinutes: ttlMinutes(options) };
444
465
  }
445
466
  function credentialFailed(failure, ttlMinutes2, failedCreates) {
446
- return failure.source === "mint" ? { kind: "mint-failed", failed: failure } : { kind: "token-request-failed", failure: failure.failure, ttlMinutes: ttlMinutes2, failedCreates };
467
+ switch (failure.source) {
468
+ case "mint":
469
+ return { kind: "mint-failed", failed: failure };
470
+ case "github-actions":
471
+ return { kind: "token-request-failed", failure: failure.failure, ttlMinutes: ttlMinutes2, failedCreates };
472
+ case "vercel-oidc":
473
+ return { kind: "vercel-oidc-token-failed", failure: failure.failure, ttlMinutes: ttlMinutes2, failedCreates };
474
+ }
447
475
  }
448
476
  function testserverCanceledFacts(options, facts) {
449
477
  return canceledAfter(facts, options.create ? ttlMinutes(options) : void 0);
@@ -675,6 +703,17 @@ function tokenRequestFailed(failure, data) {
675
703
  next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes2)]
676
704
  };
677
705
  }
706
+ function vercelOidcTokenFailed(failure, data) {
707
+ const facts = vercelOidcTokenFailureFacts(failure);
708
+ const { ttlMinutes: ttlMinutes2, failedCreates, sandboxMayExist: mayExist } = data;
709
+ return {
710
+ refused: "vercel_oidc_token_failed",
711
+ data: { ...facts, ...data },
712
+ message: `Couldn't use VERCEL_OIDC_TOKEN: ${facts.detail}. The pool had no usable Testserver sandbox, so the command didn't run.`,
713
+ rows: failedCreateRows(failedCreates),
714
+ next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes2)]
715
+ };
716
+ }
678
717
  function credentialRejected(credential, data) {
679
718
  const { origin, fix } = rejectedCredentialFacts(credential);
680
719
  const { status, vercelId, ttlMinutes: ttlMinutes2, failedCreates, unpooled, sandboxMayExist: mayExist } = data;
@@ -811,6 +850,9 @@ function testserverPoolResultWarnings(facts) {
811
850
  facts.uncreated.source === "mint" ? {
812
851
  reason: "mint_failed",
813
852
  message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't mint a credential: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
853
+ } : facts.uncreated.source === "vercel-oidc" ? {
854
+ reason: "vercel_oidc_token_failed",
855
+ message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't use VERCEL_OIDC_TOKEN: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
814
856
  } : {
815
857
  reason: "token_request_failed",
816
858
  message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't request a GitHub Actions OIDC token: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
@@ -941,6 +983,12 @@ function acquireRefusal(refusal) {
941
983
  failedCreates: failedCreateFacts(refusal.failedCreates),
942
984
  sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox)
943
985
  });
986
+ case "vercel-oidc-token-failed":
987
+ return vercelOidcTokenFailed(refusal.failure, {
988
+ ttlMinutes: refusal.ttlMinutes,
989
+ failedCreates: failedCreateFacts(refusal.failedCreates),
990
+ sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox)
991
+ });
944
992
  case "credential-rejected":
945
993
  return credentialRejected(refusal.origin, {
946
994
  status: refusal.failure.status,
@@ -0,0 +1,198 @@
1
+ import {
2
+ EXTENSIONS,
3
+ RESOURCES
4
+ } from "./chunk-HWIQ2S7K.js";
5
+ import {
6
+ defaultResourceKey,
7
+ optionKeyPath
8
+ } from "./chunk-XBDRVFEV.js";
9
+
10
+ // src/planning/file-lists.ts
11
+ function byCodeUnits(a, b) {
12
+ return a < b ? -1 : a > b ? 1 : 0;
13
+ }
14
+ function dealFileLists(files, count) {
15
+ const sorted = [...new Set(files)].toSorted(byCodeUnits);
16
+ const lists = Array.from({ length: Math.min(count, sorted.length) }, () => []);
17
+ sorted.forEach((file, index) => lists[index % lists.length]?.push(file));
18
+ return lists;
19
+ }
20
+ function comparedPath(path) {
21
+ let normal = path.replaceAll("\\", "/").replace(/\/{2,}/g, "/");
22
+ while (normal.startsWith("./")) normal = normal.slice(2);
23
+ return normal;
24
+ }
25
+ function fileListMismatches(sandboxes) {
26
+ return sandboxes.flatMap(({ sandbox, files, exitCode, reported, whole }) => {
27
+ if (files === null || exitCode === null || !whole) return [];
28
+ const listed = new Set(files.map(comparedPath));
29
+ const seen = new Set(reported.map(comparedPath));
30
+ const missing = [...listed].filter((file) => !seen.has(file)).toSorted(byCodeUnits);
31
+ const extra = [...seen].filter((file) => !listed.has(file)).toSorted(byCodeUnits);
32
+ return missing.length === 0 && extra.length === 0 ? [] : [{ sandbox, missing, extra }];
33
+ });
34
+ }
35
+ var NAMED_PATHS = 3;
36
+ function pathsText(paths) {
37
+ const named = paths.slice(0, NAMED_PATHS).join(", ");
38
+ return paths.length > NAMED_PATHS ? `${named}, and ${paths.length - NAMED_PATHS} more` : named;
39
+ }
40
+ function fileListMismatchText({ sandbox, missing, extra }, options = {}) {
41
+ const files = (n) => `${n} test ${n === 1 ? "file" : "files"}`;
42
+ const parts = [
43
+ ...missing.length === 0 ? [] : [`reported nothing for ${files(missing.length)} of its file list: ${pathsText(missing)}`],
44
+ ...extra.length === 0 ? [] : [`reported ${files(extra.length)} not in its file list: ${pathsText(extra)}`]
45
+ ];
46
+ const hint = extra.length > 0 && options.extraHint !== void 0 ? ` ${options.extraHint}` : "";
47
+ return `Runner sandbox ${sandbox} ${parts.join("; it ")}.${hint}`;
48
+ }
49
+
50
+ // src/planning/resource-flags.ts
51
+ import { z } from "zod";
52
+ function flagField(prefix, option) {
53
+ return `${prefix}${option.charAt(0).toUpperCase()}${option.slice(1)}`;
54
+ }
55
+ function flagSpelling(field) {
56
+ return `--${field.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
57
+ }
58
+ var RESOURCE_FLAGS = RESOURCES.flatMap((definition) => {
59
+ const options = definition.options;
60
+ return Object.entries(options).flatMap(([option, rule]) => {
61
+ const help = rule.flag;
62
+ if (help === void 0) return [];
63
+ const field = flagField(definition.flagPrefix, option);
64
+ return [
65
+ {
66
+ definition: definition.name,
67
+ resource: defaultResourceKey(definition),
68
+ option,
69
+ field,
70
+ flag: flagSpelling(field),
71
+ rule,
72
+ help
73
+ }
74
+ ];
75
+ });
76
+ });
77
+ var RESOURCE_FLAG_HELP = Object.fromEntries(
78
+ RESOURCE_FLAGS.map(({ field, help }) => [field, help])
79
+ );
80
+ var RESOURCE_USAGE_FLAGS = RESOURCE_FLAGS.map(({ flag, help, rule }) => {
81
+ if (help.valueLabel !== void 0) return `[${flag} <${help.valueLabel}>]`;
82
+ return rule.default === true ? `[${flag}=false]` : `[${flag}]`;
83
+ }).join(" ");
84
+ function resourceRunExamples() {
85
+ return EXTENSIONS.flatMap(({ examples }) => examples?.exec ?? []);
86
+ }
87
+ function baseType(schema, field) {
88
+ let input = schema;
89
+ while (input instanceof z.ZodPipe) input = input.in;
90
+ if (input instanceof z.ZodNumber) return z.number();
91
+ if (input instanceof z.ZodString) return z.string();
92
+ if (input instanceof z.ZodBoolean) return z.boolean();
93
+ if (input instanceof z.ZodEnum) return input;
94
+ throw new Error(`The run flag ${field}'s option schema has no number, string, boolean or enum base`);
95
+ }
96
+ function resourceFlagFields(taken) {
97
+ const fields = {};
98
+ for (const { field, rule } of RESOURCE_FLAGS) {
99
+ if (Object.hasOwn(fields, field) || taken.includes(field))
100
+ throw new Error(`Two run flags share the request field ${field}`);
101
+ fields[field] = baseType(rule.schema, field).optional();
102
+ }
103
+ return fields;
104
+ }
105
+ function readResourceFlags(request) {
106
+ const values = {};
107
+ const problems = [];
108
+ for (const { definition, option, field, flag, rule } of RESOURCE_FLAGS) {
109
+ const value = request[field];
110
+ if (value === void 0) continue;
111
+ const checked = rule.schema.safeParse(value);
112
+ if (checked.success) values[definition] = { ...values[definition], [option]: checked.data };
113
+ else problems.push(...checked.error.issues.map(({ message }) => ({ field, message: `${flag} ${message}.` })));
114
+ }
115
+ if (problems.length > 0) return { ok: false, problems };
116
+ return { ok: true, values };
117
+ }
118
+ function resourceFlagProblems(request) {
119
+ const read = readResourceFlags(request);
120
+ return read.ok ? [] : read.problems;
121
+ }
122
+ function resourceFlagValues(request) {
123
+ const read = readResourceFlags(request);
124
+ if (!read.ok) throw new Error(`The flags should have been refused: ${read.problems.map((p) => p.message).join(" ")}`);
125
+ return read.values;
126
+ }
127
+
128
+ // src/planning/test-plan.ts
129
+ function recordedPlan(testPlan, options) {
130
+ return testPlan.kind === "counted" ? {
131
+ ...testPlan.tests === void 0 ? {} : { tests: testPlan.tests },
132
+ files: testPlan.files,
133
+ options: options.map((option) => ({ ...option }))
134
+ } : void 0;
135
+ }
136
+ function plannedTestPlan(plan) {
137
+ const base = recordedPlan(plan.testPlan, plan.planOptions);
138
+ if (plan.sandboxes === void 0) return base;
139
+ return {
140
+ ...base ?? { options: [] },
141
+ sandboxes: { ...plan.sandboxes.count }
142
+ };
143
+ }
144
+ function testPlanLine(plan) {
145
+ return `Running ${testPlanText(plan)}`;
146
+ }
147
+ function testPlanText(plan) {
148
+ const sandboxes = plan.sandboxes === void 0 ? void 0 : sandboxCountText(plan.sandboxes);
149
+ const leftOut = plan.sandboxes?.leftOut ?? 0;
150
+ const count = plan.files === void 0 ? void 0 : leftOut > 0 ? `${plan.files - leftOut} of ${plan.files} test files` : plan.sandboxes !== void 0 && plan.tests === void 0 ? `${plan.files} test ${plan.files === 1 ? "file" : "files"}` : countText({ tests: plan.tests, files: plan.files });
151
+ const head = count === void 0 ? sandboxes : sandboxes === void 0 ? count : `${count} in ${sandboxes}`;
152
+ return [...head === void 0 ? [] : [head], ...plan.options.map(planOptionText)].join("; ");
153
+ }
154
+ function sandboxCountText({ count, from, max, requested, default: given }) {
155
+ const sandboxes = `${count} ${count === 1 ? "runner sandbox" : "runner sandboxes"}`;
156
+ if (from === "default" && given !== void 0 && given > max)
157
+ return `${sandboxes} (${SANDBOX_COUNT_FROM.default} ${given}, lowered to the max ${max}${requested === void 0 ? "" : ", then to the number of test files"})`;
158
+ const source = requested === void 0 ? SANDBOX_COUNT_FROM[from] : `${SANDBOX_COUNT_FROM[from]} ${requested}, lowered to the number of test files`;
159
+ return `${sandboxes} (${source}, max ${max})`;
160
+ }
161
+ var SANDBOX_COUNT_FROM = {
162
+ flag: "--sandboxes",
163
+ "file-lists": "--file-lists",
164
+ default: "runner.sandboxes.default"
165
+ };
166
+ function countText({ tests, files }) {
167
+ const inFiles = `in ${files} ${files === 1 ? "file" : "files"}`;
168
+ return tests === void 0 ? `tests ${inFiles}` : `${tests} ${tests === 1 ? "test" : "tests"} ${inFiles}`;
169
+ }
170
+ function planOptionText({ path, value, from }) {
171
+ return `${path} ${String(value)} (${fromText(path, from)})`;
172
+ }
173
+ function fromText(path, from) {
174
+ switch (from) {
175
+ case "flag":
176
+ return RESOURCE_FLAGS.find(({ resource, option }) => optionKeyPath(resource, option) === path)?.flag ?? "a flag";
177
+ case "file":
178
+ return "config file";
179
+ case "default":
180
+ return "default";
181
+ }
182
+ }
183
+
184
+ export {
185
+ RESOURCE_FLAG_HELP,
186
+ RESOURCE_USAGE_FLAGS,
187
+ resourceRunExamples,
188
+ resourceFlagFields,
189
+ resourceFlagProblems,
190
+ resourceFlagValues,
191
+ plannedTestPlan,
192
+ testPlanLine,
193
+ testPlanText,
194
+ dealFileLists,
195
+ comparedPath,
196
+ fileListMismatches,
197
+ fileListMismatchText
198
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecrets
3
- } from "./chunk-DC2CDHNK.js";
3
+ } from "./chunk-RNAS7JHE.js";
4
4
 
5
5
  // src/planning/redaction.ts
6
6
  function redactor(secrets) {
@@ -1,7 +1,21 @@
1
1
  import {
2
2
  secondsOf,
3
3
  secondsText
4
- } from "./chunk-FOZWA52V.js";
4
+ } from "./chunk-YEPFSLQR.js";
5
+
6
+ // src/shared/dashboard.ts
7
+ function projectPage({ team, project }) {
8
+ return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
9
+ }
10
+ function sandboxPage(where, name) {
11
+ return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
12
+ }
13
+ function sandboxConnectPage(where, name) {
14
+ return `${sandboxPage(where, name)}/connect`;
15
+ }
16
+ function snapshotPage(where, id) {
17
+ return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
18
+ }
5
19
 
6
20
  // src/shared/text.ts
7
21
  function seconds(ms) {
@@ -69,6 +83,9 @@ function spread(left, right, width) {
69
83
  }
70
84
 
71
85
  export {
86
+ sandboxPage,
87
+ sandboxConnectPage,
88
+ snapshotPage,
72
89
  seconds,
73
90
  keepTimeText,
74
91
  releaseText,
@@ -0,0 +1,88 @@
1
+ import {
2
+ RUN_CLEANUP,
3
+ runErrors,
4
+ runnerFailureFacts
5
+ } from "./chunk-2VP4GRJM.js";
6
+ import {
7
+ credentialSourceError,
8
+ givenTarget
9
+ } from "./chunk-RNAS7JHE.js";
10
+
11
+ // src/commands/snapshots/access.ts
12
+ import { z } from "zod";
13
+ var SNAPSHOT_ACCESS_FIELDS = {
14
+ credential: z.enum(["mint", "vercel-oidc"]).default("mint"),
15
+ scope: z.string().min(1).optional(),
16
+ project: z.string().min(1).optional()
17
+ };
18
+ var SNAPSHOT_ACCESS_CLI = { options: { project: { short: "p" } } };
19
+ var PROJECT_FIELDS = {
20
+ /** The canonical team and project IDs from the credential. */
21
+ teamId: z.string(),
22
+ projectId: z.string(),
23
+ /** The display team and project slugs from flags or `storm.config.ts`, or null when unset. */
24
+ team: z.string().nullable(),
25
+ project: z.string().nullable()
26
+ };
27
+ function projectDisplayText(owner) {
28
+ return owner.team !== null && owner.project !== null ? `${owner.team}/${owner.project}` : `${owner.teamId}/${owner.projectId}`;
29
+ }
30
+ function sharedListFailedError(words) {
31
+ return {
32
+ exitCode: 1,
33
+ description: words.description,
34
+ schema: z.object({
35
+ ...PROJECT_FIELDS,
36
+ /** What the Sandbox API said. */
37
+ message: z.string()
38
+ }),
39
+ render: (facts) => ({
40
+ message: `Couldn't list the shared snapshot index of ${projectDisplayText(facts)}${words.consequence}: ${facts.message}`,
41
+ next: [{ type: "text", text: words.next }]
42
+ })
43
+ };
44
+ }
45
+ function settleSnapshotAccess(app, credential, settings, progress) {
46
+ const chosen = app.credentials.vercelProjectSource(credential, settings, { progress });
47
+ if (!chosen.ok) return chosen;
48
+ const target = givenTarget(settings.scope, settings.project);
49
+ return {
50
+ ok: true,
51
+ settled: {
52
+ target,
53
+ obtain: () => obtainSnapshotAccess(chosen.source, target)
54
+ }
55
+ };
56
+ }
57
+ async function obtainSnapshotAccess(source, target) {
58
+ const got = await source.obtain();
59
+ if (!got.ok) {
60
+ const { failure } = got;
61
+ return {
62
+ ok: false,
63
+ refusal: failure.source === "claims-missing" ? runErrors.runnerFailed({
64
+ failure: runnerFailureFacts({ kind: "credential-claims-missing", target: failure.target }),
65
+ cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: {} })
66
+ }) : credentialSourceError(failure)
67
+ };
68
+ }
69
+ const { project } = got;
70
+ return {
71
+ ok: true,
72
+ access: { credential: got.credential, ...project },
73
+ target,
74
+ teamId: project.teamId,
75
+ projectId: project.projectId,
76
+ team: target?.team ?? null,
77
+ project: target?.project ?? null
78
+ };
79
+ }
80
+
81
+ export {
82
+ SNAPSHOT_ACCESS_FIELDS,
83
+ SNAPSHOT_ACCESS_CLI,
84
+ PROJECT_FIELDS,
85
+ projectDisplayText,
86
+ sharedListFailedError,
87
+ settleSnapshotAccess
88
+ };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  testserverPoolDefinition
3
- } from "./chunk-R7XVBZOY.js";
3
+ } from "./chunk-EEENLQHE.js";
4
4
  import {
5
5
  testserverExtensionCommands
6
- } from "./chunk-ZG3WQ4UF.js";
6
+ } from "./chunk-D27KILIA.js";
7
7
  import {
8
8
  defineExtension
9
- } from "./chunk-5CCP36QQ.js";
9
+ } from "./chunk-2RNDPDTJ.js";
10
10
  import {
11
11
  driverContexts,
12
12
  driversOf,
13
13
  resourceDefinitionSet,
14
14
  resourcesOf
15
- } from "./chunk-FOZWA52V.js";
15
+ } from "./chunk-YEPFSLQR.js";
16
16
  import {
17
17
  SECRET_MIN_LENGTH,
18
18
  argsText,
@@ -25,7 +25,7 @@ import {
25
25
  readSecretSourceValue,
26
26
  resourceFactory,
27
27
  secretSourceSchema
28
- } from "./chunk-AWBSONHB.js";
28
+ } from "./chunk-XBDRVFEV.js";
29
29
 
30
30
  // src/extensions/github/release.ts
31
31
  function fixtureRepoCleanupFailureText(cleanup, failure) {