@cnc-tools/storm 0.15.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.
- package/dist/application.d.ts +22 -13
- package/dist/application.js +21 -10
- package/dist/bin/run.d.ts +18 -0
- package/dist/bin/run.js +31 -0
- package/dist/bin/storm.js +42 -26
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
- package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
- package/dist/chunks/{chunk-SZEURWRS.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-QVS7HRU7.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-QUHY6FGN.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-DADEYJDW.js} +174 -153
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-OX7X4B2L.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-PN5ULTTH.js → chunk-HWIQ2S7K.js} +5 -5
- package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
- package/dist/chunks/{chunk-XEVHP5ZW.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-L36GBUBB.js → chunk-RNAS7JHE.js} +1755 -522
- package/dist/chunks/{chunk-5GBMR4HM.js → chunk-RWIXDDCK.js} +4 -192
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{chunk-YV7GE6EV.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-PI3BAN6Y.js → live-app-R76JQXZL.js} +15 -13
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
- package/dist/commands/exec/across-sandboxes-outcomes.js +4 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +39 -4
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +38 -9
- package/dist/commands/exec/outcomes.js +32 -25
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- package/dist/commands/exec/planned-outcome.js +8 -1
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +5 -5
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +9 -4
- package/dist/commands/runs/facts.js +28 -11
- package/dist/commands/runs/list/command.d.ts +16 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -3
- package/dist/commands/runs/logs/command.d.ts +6 -2
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/logs/outcomes.d.ts +3 -1
- package/dist/commands/runs/past-run.d.ts +14 -5
- package/dist/commands/runs/past-run.js +16 -5
- package/dist/commands/runs/show/command.d.ts +20 -8
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +10 -4
- package/dist/commands/runs/show/outcomes.js +7 -5
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +360 -93
- package/dist/commands/snapshots/build/command.js +446 -150
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +296 -66
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
- package/dist/commands/snapshots/list/outcomes.js +221 -50
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +19 -18
- package/dist/commands/suites/list/outcomes.js +4 -4
- package/dist/commands/test/command.d.ts +39 -4
- package/dist/commands/test/command.js +50 -255
- package/dist/commands/test/metadata.js +1 -1
- package/dist/commands/test/outcomes.d.ts +19 -2
- package/dist/commands/test/outcomes.js +2 -2
- package/dist/config/check-runner.d.ts +5 -3
- package/dist/config/check-runner.js +33 -7
- package/dist/config/check-suites.js +1 -0
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/gateways.d.ts +7 -3
- package/dist/config/index.d.ts +4 -5
- package/dist/config/index.js +3 -4
- package/dist/config/live/config-gateway.js +5 -2
- package/dist/config/load.d.ts +21 -4
- package/dist/config/load.js +129 -15
- package/dist/config/runner.d.ts +7 -8
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +17 -5
- package/dist/config/schema.js +11 -3
- package/dist/config/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +1 -11
- package/dist/config-file/define.js +3 -3
- package/dist/config-file/runner.d.ts +5 -6
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +53 -37
- package/dist/context.d.ts +8 -6
- package/dist/context.js +7 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +106 -266
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +6 -1
- package/dist/extension-commands.js +15 -1
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/github/resource.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/resource.js +2 -2
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +7 -15
- package/dist/planning/plan-only.js +16 -22
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -13
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +10 -2
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +21 -6
- package/dist/run-directory/run-record.js +12 -9
- package/dist/runner/base.d.ts +0 -6
- package/dist/runner/base.js +1 -16
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +135 -35
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +92 -21
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +11 -7
- package/dist/runner/index.js +9 -4
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +141 -3
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +6 -7
- package/dist/runner/local-snapshot-index.d.ts +199 -0
- package/dist/runner/local-snapshot-index.js +211 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +25 -24
- package/dist/runner/prepare.js +28 -20
- package/dist/runner/ready.d.ts +18 -10
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +10 -6
- package/dist/runner/scope.js +10 -3
- package/dist/runner/secrets.d.ts +13 -13
- package/dist/runner/secrets.js +18 -15
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +3 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +38 -28
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +58 -38
- package/dist/runner/snapshot-key.d.ts +30 -21
- package/dist/runner/snapshot-key.js +49 -29
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +82 -82
- package/dist/runner/vercel-sandbox-options.js +510 -0
- package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
- package/dist/sdk/extension/commands.d.ts +8 -3
- package/dist/sdk/extension/commands.js +3 -1
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +4 -3
- package/dist/sdk/extension/resource-definition.js +3 -2
- package/dist/sdk/extension/resource-factory.js +3 -4
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/sdk/run/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +3 -2
- package/skills/overview.md +6 -4
- package/skills/plan-runs.md +2 -2
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-E4PJNZVG.js +0 -783
- package/dist/chunks/chunk-RAQEXKL6.js +0 -2591
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -46
- package/dist/commands/exec/run-command.d.ts +0 -476
- package/dist/commands/exec/run-command.js +0 -604
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -128
- package/dist/config/recipe-run.d.ts +0 -33
- package/dist/config/recipe-run.js +0 -28
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe.js +0 -425
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Deletes the dead entries (expired, missing, failed, or snapshot-less) of the shared snapshot index of the Vercel
|
|
4
|
+
* project: each `storm-snap-<bucket>-<base>` named sandbox that ended failed or aborted, stopped without a snapshot, or
|
|
5
|
+
* stopped with a snapshot that is missing, not created, or expired (`pruneSharedSnapshots`). It loads
|
|
6
|
+
* `storm.config.ts`, when there is one, only for its team and project, obtains a credential through the credential
|
|
7
|
+
* launcher resolver, as `snapshots build` does, and words the summary. With `--dry-run` it deletes nothing. It ends
|
|
8
|
+
* with `deletes_failed` (exit 1) when it couldn't check or delete an entry, unless `--dry-run`, and with
|
|
9
|
+
* `shared_list_failed` when the listing failed.
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
12
|
+
credential: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
mint: "mint";
|
|
14
|
+
"vercel-oidc": "vercel-oidc";
|
|
15
|
+
}>>;
|
|
16
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
17
|
+
project: z.ZodOptional<z.ZodString>;
|
|
18
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>, import("@vercel/clinkr").Outcomes<{
|
|
20
|
+
pruned: z.ZodObject<{
|
|
21
|
+
teamId: z.ZodString;
|
|
22
|
+
projectId: z.ZodString;
|
|
23
|
+
team: z.ZodNullable<z.ZodString>;
|
|
24
|
+
project: z.ZodNullable<z.ZodString>;
|
|
25
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
26
|
+
dryRun: z.ZodBoolean;
|
|
27
|
+
scanned: z.ZodNumber;
|
|
28
|
+
deleted: z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
reason: z.ZodEnum<{
|
|
31
|
+
expired: "expired";
|
|
32
|
+
failed: "failed";
|
|
33
|
+
missing: "missing";
|
|
34
|
+
"no-snapshot": "no-snapshot";
|
|
35
|
+
}>;
|
|
36
|
+
snapshotId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
skipped: z.ZodNumber;
|
|
39
|
+
failed: z.ZodArray<z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
deletesFailed: z.ZodObject<{
|
|
45
|
+
teamId: z.ZodString;
|
|
46
|
+
projectId: z.ZodString;
|
|
47
|
+
team: z.ZodNullable<z.ZodString>;
|
|
48
|
+
project: z.ZodNullable<z.ZodString>;
|
|
49
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
50
|
+
dryRun: z.ZodBoolean;
|
|
51
|
+
scanned: z.ZodNumber;
|
|
52
|
+
deleted: z.ZodArray<z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
reason: z.ZodEnum<{
|
|
55
|
+
expired: "expired";
|
|
56
|
+
failed: "failed";
|
|
57
|
+
missing: "missing";
|
|
58
|
+
"no-snapshot": "no-snapshot";
|
|
59
|
+
}>;
|
|
60
|
+
snapshotId: z.ZodNullable<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
skipped: z.ZodNumber;
|
|
63
|
+
failed: z.ZodArray<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
message: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
}, {
|
|
69
|
+
pruned: unknown;
|
|
70
|
+
deletesFailed: 1;
|
|
71
|
+
}, {
|
|
72
|
+
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
73
|
+
file: string;
|
|
74
|
+
problems: {
|
|
75
|
+
key: string | null;
|
|
76
|
+
location: {
|
|
77
|
+
line: number;
|
|
78
|
+
column: number | null;
|
|
79
|
+
} | null;
|
|
80
|
+
problem: string;
|
|
81
|
+
}[];
|
|
82
|
+
}]>;
|
|
83
|
+
missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
84
|
+
missing: ("project" | "scope")[];
|
|
85
|
+
}]>;
|
|
86
|
+
runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
87
|
+
failure: {
|
|
88
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
89
|
+
label: string;
|
|
90
|
+
exitCode: number | null;
|
|
91
|
+
tail: string[];
|
|
92
|
+
} | {
|
|
93
|
+
kind: "sandbox-api-failed";
|
|
94
|
+
operation: string;
|
|
95
|
+
status: number | null;
|
|
96
|
+
message: string;
|
|
97
|
+
} | {
|
|
98
|
+
kind: "checkout-failed";
|
|
99
|
+
message: string;
|
|
100
|
+
command: string | null;
|
|
101
|
+
} | {
|
|
102
|
+
kind: "credential-claims-missing";
|
|
103
|
+
team: string;
|
|
104
|
+
project: string;
|
|
105
|
+
} | {
|
|
106
|
+
kind: "network-policy-failed";
|
|
107
|
+
operation: "inject" | "remove";
|
|
108
|
+
around: "command" | "run-steps" | "snapshot-save" | "snapshot-steps";
|
|
109
|
+
reason: "api" | "timed-out";
|
|
110
|
+
status: number | null;
|
|
111
|
+
message: string;
|
|
112
|
+
};
|
|
113
|
+
cleanup: import("../../../shared/cleanup.ts").StormCleanupFacts;
|
|
114
|
+
}]>;
|
|
115
|
+
sharedListFailed: z.ZodObject<{
|
|
116
|
+
teamId: z.ZodString;
|
|
117
|
+
projectId: z.ZodString;
|
|
118
|
+
team: z.ZodNullable<z.ZodString>;
|
|
119
|
+
project: z.ZodNullable<z.ZodString>;
|
|
120
|
+
message: z.ZodString;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
|
|
123
|
+
team: string;
|
|
124
|
+
project: string;
|
|
125
|
+
cause: string;
|
|
126
|
+
fix: string;
|
|
127
|
+
}]>;
|
|
128
|
+
tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [data: {
|
|
129
|
+
cause: "request-failed" | "variables-missing";
|
|
130
|
+
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
131
|
+
status: number | null;
|
|
132
|
+
said: string | null;
|
|
133
|
+
detail: string;
|
|
134
|
+
fix: string;
|
|
135
|
+
}]>;
|
|
136
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
137
|
+
cause: "invalid-token" | "missing-token";
|
|
138
|
+
detail: string;
|
|
139
|
+
fix: string;
|
|
140
|
+
}]>;
|
|
141
|
+
}, {
|
|
142
|
+
readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
143
|
+
file: string;
|
|
144
|
+
problems: {
|
|
145
|
+
key: string | null;
|
|
146
|
+
location: {
|
|
147
|
+
line: number;
|
|
148
|
+
column: number | null;
|
|
149
|
+
} | null;
|
|
150
|
+
problem: string;
|
|
151
|
+
}[];
|
|
152
|
+
}]>;
|
|
153
|
+
readonly missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
154
|
+
missing: ("project" | "scope")[];
|
|
155
|
+
}]>;
|
|
156
|
+
readonly runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
157
|
+
failure: {
|
|
158
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
159
|
+
label: string;
|
|
160
|
+
exitCode: number | null;
|
|
161
|
+
tail: string[];
|
|
162
|
+
} | {
|
|
163
|
+
kind: "sandbox-api-failed";
|
|
164
|
+
operation: string;
|
|
165
|
+
status: number | null;
|
|
166
|
+
message: string;
|
|
167
|
+
} | {
|
|
168
|
+
kind: "checkout-failed";
|
|
169
|
+
message: string;
|
|
170
|
+
command: string | null;
|
|
171
|
+
} | {
|
|
172
|
+
kind: "credential-claims-missing";
|
|
173
|
+
team: string;
|
|
174
|
+
project: string;
|
|
175
|
+
} | {
|
|
176
|
+
kind: "network-policy-failed";
|
|
177
|
+
operation: "inject" | "remove";
|
|
178
|
+
around: "command" | "run-steps" | "snapshot-save" | "snapshot-steps";
|
|
179
|
+
reason: "api" | "timed-out";
|
|
180
|
+
status: number | null;
|
|
181
|
+
message: string;
|
|
182
|
+
};
|
|
183
|
+
cleanup: import("../../../shared/cleanup.ts").StormCleanupFacts;
|
|
184
|
+
}]>;
|
|
185
|
+
readonly sharedListFailed: {
|
|
186
|
+
exitCode: 1;
|
|
187
|
+
description: string;
|
|
188
|
+
schema: z.ZodObject<{
|
|
189
|
+
teamId: z.ZodString;
|
|
190
|
+
projectId: z.ZodString;
|
|
191
|
+
team: z.ZodNullable<z.ZodString>;
|
|
192
|
+
project: z.ZodNullable<z.ZodString>;
|
|
193
|
+
message: z.ZodString;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
render: (facts: import("../access.ts").ProjectFacts & {
|
|
196
|
+
readonly message: string;
|
|
197
|
+
}) => {
|
|
198
|
+
message: string;
|
|
199
|
+
next: {
|
|
200
|
+
type: "text";
|
|
201
|
+
text: string;
|
|
202
|
+
}[];
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
|
|
206
|
+
team: string;
|
|
207
|
+
project: string;
|
|
208
|
+
cause: string;
|
|
209
|
+
fix: string;
|
|
210
|
+
}]>;
|
|
211
|
+
readonly tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [data: {
|
|
212
|
+
cause: "request-failed" | "variables-missing";
|
|
213
|
+
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
214
|
+
status: number | null;
|
|
215
|
+
said: string | null;
|
|
216
|
+
detail: string;
|
|
217
|
+
fix: string;
|
|
218
|
+
}]>;
|
|
219
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
220
|
+
cause: "invalid-token" | "missing-token";
|
|
221
|
+
detail: string;
|
|
222
|
+
fix: string;
|
|
223
|
+
}]>;
|
|
224
|
+
}>, import("@vercel/clinkr").OutcomeOf<import("@vercel/clinkr").Outcomes<{
|
|
225
|
+
pruned: z.ZodObject<{
|
|
226
|
+
teamId: z.ZodString;
|
|
227
|
+
projectId: z.ZodString;
|
|
228
|
+
team: z.ZodNullable<z.ZodString>;
|
|
229
|
+
project: z.ZodNullable<z.ZodString>;
|
|
230
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
231
|
+
dryRun: z.ZodBoolean;
|
|
232
|
+
scanned: z.ZodNumber;
|
|
233
|
+
deleted: z.ZodArray<z.ZodObject<{
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
reason: z.ZodEnum<{
|
|
236
|
+
expired: "expired";
|
|
237
|
+
failed: "failed";
|
|
238
|
+
missing: "missing";
|
|
239
|
+
"no-snapshot": "no-snapshot";
|
|
240
|
+
}>;
|
|
241
|
+
snapshotId: z.ZodNullable<z.ZodString>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
skipped: z.ZodNumber;
|
|
244
|
+
failed: z.ZodArray<z.ZodObject<{
|
|
245
|
+
name: z.ZodString;
|
|
246
|
+
message: z.ZodString;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
deletesFailed: z.ZodObject<{
|
|
250
|
+
teamId: z.ZodString;
|
|
251
|
+
projectId: z.ZodString;
|
|
252
|
+
team: z.ZodNullable<z.ZodString>;
|
|
253
|
+
project: z.ZodNullable<z.ZodString>;
|
|
254
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
255
|
+
dryRun: z.ZodBoolean;
|
|
256
|
+
scanned: z.ZodNumber;
|
|
257
|
+
deleted: z.ZodArray<z.ZodObject<{
|
|
258
|
+
name: z.ZodString;
|
|
259
|
+
reason: z.ZodEnum<{
|
|
260
|
+
expired: "expired";
|
|
261
|
+
failed: "failed";
|
|
262
|
+
missing: "missing";
|
|
263
|
+
"no-snapshot": "no-snapshot";
|
|
264
|
+
}>;
|
|
265
|
+
snapshotId: z.ZodNullable<z.ZodString>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
skipped: z.ZodNumber;
|
|
268
|
+
failed: z.ZodArray<z.ZodObject<{
|
|
269
|
+
name: z.ZodString;
|
|
270
|
+
message: z.ZodString;
|
|
271
|
+
}, z.core.$strip>>;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
}, {
|
|
274
|
+
pruned: unknown;
|
|
275
|
+
deletesFailed: 1;
|
|
276
|
+
}, {
|
|
277
|
+
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
278
|
+
file: string;
|
|
279
|
+
problems: {
|
|
280
|
+
key: string | null;
|
|
281
|
+
location: {
|
|
282
|
+
line: number;
|
|
283
|
+
column: number | null;
|
|
284
|
+
} | null;
|
|
285
|
+
problem: string;
|
|
286
|
+
}[];
|
|
287
|
+
}]>;
|
|
288
|
+
missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
289
|
+
missing: ("project" | "scope")[];
|
|
290
|
+
}]>;
|
|
291
|
+
runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
292
|
+
failure: {
|
|
293
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
294
|
+
label: string;
|
|
295
|
+
exitCode: number | null;
|
|
296
|
+
tail: string[];
|
|
297
|
+
} | {
|
|
298
|
+
kind: "sandbox-api-failed";
|
|
299
|
+
operation: string;
|
|
300
|
+
status: number | null;
|
|
301
|
+
message: string;
|
|
302
|
+
} | {
|
|
303
|
+
kind: "checkout-failed";
|
|
304
|
+
message: string;
|
|
305
|
+
command: string | null;
|
|
306
|
+
} | {
|
|
307
|
+
kind: "credential-claims-missing";
|
|
308
|
+
team: string;
|
|
309
|
+
project: string;
|
|
310
|
+
} | {
|
|
311
|
+
kind: "network-policy-failed";
|
|
312
|
+
operation: "inject" | "remove";
|
|
313
|
+
around: "command" | "run-steps" | "snapshot-save" | "snapshot-steps";
|
|
314
|
+
reason: "api" | "timed-out";
|
|
315
|
+
status: number | null;
|
|
316
|
+
message: string;
|
|
317
|
+
};
|
|
318
|
+
cleanup: import("../../../shared/cleanup.ts").StormCleanupFacts;
|
|
319
|
+
}]>;
|
|
320
|
+
sharedListFailed: z.ZodObject<{
|
|
321
|
+
teamId: z.ZodString;
|
|
322
|
+
projectId: z.ZodString;
|
|
323
|
+
team: z.ZodNullable<z.ZodString>;
|
|
324
|
+
project: z.ZodNullable<z.ZodString>;
|
|
325
|
+
message: z.ZodString;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
|
|
328
|
+
team: string;
|
|
329
|
+
project: string;
|
|
330
|
+
cause: string;
|
|
331
|
+
fix: string;
|
|
332
|
+
}]>;
|
|
333
|
+
tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [data: {
|
|
334
|
+
cause: "request-failed" | "variables-missing";
|
|
335
|
+
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
336
|
+
status: number | null;
|
|
337
|
+
said: string | null;
|
|
338
|
+
detail: string;
|
|
339
|
+
fix: string;
|
|
340
|
+
}]>;
|
|
341
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
342
|
+
cause: "invalid-token" | "missing-token";
|
|
343
|
+
detail: string;
|
|
344
|
+
fix: string;
|
|
345
|
+
}]>;
|
|
346
|
+
}, {
|
|
347
|
+
readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
348
|
+
file: string;
|
|
349
|
+
problems: {
|
|
350
|
+
key: string | null;
|
|
351
|
+
location: {
|
|
352
|
+
line: number;
|
|
353
|
+
column: number | null;
|
|
354
|
+
} | null;
|
|
355
|
+
problem: string;
|
|
356
|
+
}[];
|
|
357
|
+
}]>;
|
|
358
|
+
readonly missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
359
|
+
missing: ("project" | "scope")[];
|
|
360
|
+
}]>;
|
|
361
|
+
readonly runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
362
|
+
failure: {
|
|
363
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
364
|
+
label: string;
|
|
365
|
+
exitCode: number | null;
|
|
366
|
+
tail: string[];
|
|
367
|
+
} | {
|
|
368
|
+
kind: "sandbox-api-failed";
|
|
369
|
+
operation: string;
|
|
370
|
+
status: number | null;
|
|
371
|
+
message: string;
|
|
372
|
+
} | {
|
|
373
|
+
kind: "checkout-failed";
|
|
374
|
+
message: string;
|
|
375
|
+
command: string | null;
|
|
376
|
+
} | {
|
|
377
|
+
kind: "credential-claims-missing";
|
|
378
|
+
team: string;
|
|
379
|
+
project: string;
|
|
380
|
+
} | {
|
|
381
|
+
kind: "network-policy-failed";
|
|
382
|
+
operation: "inject" | "remove";
|
|
383
|
+
around: "command" | "run-steps" | "snapshot-save" | "snapshot-steps";
|
|
384
|
+
reason: "api" | "timed-out";
|
|
385
|
+
status: number | null;
|
|
386
|
+
message: string;
|
|
387
|
+
};
|
|
388
|
+
cleanup: import("../../../shared/cleanup.ts").StormCleanupFacts;
|
|
389
|
+
}]>;
|
|
390
|
+
readonly sharedListFailed: {
|
|
391
|
+
exitCode: 1;
|
|
392
|
+
description: string;
|
|
393
|
+
schema: z.ZodObject<{
|
|
394
|
+
teamId: z.ZodString;
|
|
395
|
+
projectId: z.ZodString;
|
|
396
|
+
team: z.ZodNullable<z.ZodString>;
|
|
397
|
+
project: z.ZodNullable<z.ZodString>;
|
|
398
|
+
message: z.ZodString;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
render: (facts: import("../access.ts").ProjectFacts & {
|
|
401
|
+
readonly message: string;
|
|
402
|
+
}) => {
|
|
403
|
+
message: string;
|
|
404
|
+
next: {
|
|
405
|
+
type: "text";
|
|
406
|
+
text: string;
|
|
407
|
+
}[];
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
readonly mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
|
|
411
|
+
team: string;
|
|
412
|
+
project: string;
|
|
413
|
+
cause: string;
|
|
414
|
+
fix: string;
|
|
415
|
+
}]>;
|
|
416
|
+
readonly tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [data: {
|
|
417
|
+
cause: "request-failed" | "variables-missing";
|
|
418
|
+
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
419
|
+
status: number | null;
|
|
420
|
+
said: string | null;
|
|
421
|
+
detail: string;
|
|
422
|
+
fix: string;
|
|
423
|
+
}]>;
|
|
424
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
425
|
+
cause: "invalid-token" | "missing-token";
|
|
426
|
+
detail: string;
|
|
427
|
+
fix: string;
|
|
428
|
+
}]>;
|
|
429
|
+
}>>, import("../../../context.ts").StormApp, false>;
|
|
430
|
+
export default _default;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PROJECT_FIELDS,
|
|
3
|
+
SNAPSHOT_ACCESS_CLI,
|
|
4
|
+
SNAPSHOT_ACCESS_FIELDS,
|
|
5
|
+
projectDisplayText,
|
|
6
|
+
settleSnapshotAccess,
|
|
7
|
+
sharedListFailedError
|
|
8
|
+
} from "../../../chunks/chunk-HP3CURSZ.js";
|
|
9
|
+
import {
|
|
10
|
+
runErrors
|
|
11
|
+
} from "../../../chunks/chunk-2VP4GRJM.js";
|
|
12
|
+
import "../../../chunks/chunk-FNBB6V4R.js";
|
|
13
|
+
import "../../../chunks/chunk-F4MOYHRY.js";
|
|
14
|
+
import "../../../chunks/chunk-HWIQ2S7K.js";
|
|
15
|
+
import "../../../chunks/chunk-EEENLQHE.js";
|
|
16
|
+
import "../../../chunks/chunk-72ZFEMAW.js";
|
|
17
|
+
import "../../../chunks/chunk-D27KILIA.js";
|
|
18
|
+
import "../../../chunks/chunk-2RNDPDTJ.js";
|
|
19
|
+
import {
|
|
20
|
+
renderOutcome
|
|
21
|
+
} from "../../../chunks/chunk-LKTZ5OXS.js";
|
|
22
|
+
import "../../../chunks/chunk-GRT3UIBV.js";
|
|
23
|
+
import "../../../chunks/chunk-4O5C2XGJ.js";
|
|
24
|
+
import "../../../chunks/chunk-F6N34UWB.js";
|
|
25
|
+
import "../../../chunks/chunk-YEPFSLQR.js";
|
|
26
|
+
import {
|
|
27
|
+
configErrors,
|
|
28
|
+
credentialErrors,
|
|
29
|
+
credentialSourceErrors,
|
|
30
|
+
fileSettings,
|
|
31
|
+
pruneSharedSnapshots
|
|
32
|
+
} from "../../../chunks/chunk-RNAS7JHE.js";
|
|
33
|
+
import "../../../chunks/chunk-XBDRVFEV.js";
|
|
34
|
+
import {
|
|
35
|
+
stormCommands
|
|
36
|
+
} from "../../../chunks/chunk-WV3DP6NR.js";
|
|
37
|
+
import {
|
|
38
|
+
defineOutcomes
|
|
39
|
+
} from "../../../chunks/chunk-4WAMTUWZ.js";
|
|
40
|
+
|
|
41
|
+
// src/commands/snapshots/prune/command.ts
|
|
42
|
+
import { z as z2 } from "zod";
|
|
43
|
+
|
|
44
|
+
// src/commands/snapshots/prune/outcomes.ts
|
|
45
|
+
import { z } from "zod";
|
|
46
|
+
var deletedSchema = z.object({
|
|
47
|
+
/** The named sandbox that held the entry. */
|
|
48
|
+
name: z.string(),
|
|
49
|
+
/** Why: `no-snapshot`, the sandbox holds no snapshot; `failed`, the build sandbox ended failed or aborted; `missing`, its snapshot is not found or not created; `expired`, its snapshot has expired. */
|
|
50
|
+
reason: z.enum(["no-snapshot", "expired", "missing", "failed"]),
|
|
51
|
+
/** For `expired` and `missing`, the snapshot id the sandbox held; null for `no-snapshot` and `failed`. */
|
|
52
|
+
snapshotId: z.string().nullable()
|
|
53
|
+
});
|
|
54
|
+
var prunedSchema = z.object({
|
|
55
|
+
/** The config file that gave the team and project; null when none did. */
|
|
56
|
+
configFile: z.string().nullable(),
|
|
57
|
+
/** The Vercel project whose shared snapshot index it pruned. */
|
|
58
|
+
...PROJECT_FIELDS,
|
|
59
|
+
/** Whether --dry-run asked it to delete nothing. */
|
|
60
|
+
dryRun: z.boolean(),
|
|
61
|
+
/** How many storm-snap- sandboxes the project holds. */
|
|
62
|
+
scanned: z.number(),
|
|
63
|
+
/** Each entry it deleted, or with --dry-run would delete, in the order it listed them. */
|
|
64
|
+
deleted: z.array(deletedSchema),
|
|
65
|
+
/** How many it kept: a build still owns it, or it is unexpired. */
|
|
66
|
+
skipped: z.number(),
|
|
67
|
+
/** Each sandbox it couldn't check or delete, with what the Sandbox API said. */
|
|
68
|
+
failed: z.array(z.object({ name: z.string(), message: z.string() }))
|
|
69
|
+
});
|
|
70
|
+
function deletedText({ name, reason, snapshotId }) {
|
|
71
|
+
return snapshotId === null ? `${name} (${reason})` : `${name} (${reason}, snapshot ${snapshotId})`;
|
|
72
|
+
}
|
|
73
|
+
function countsText(pruned) {
|
|
74
|
+
const deleted = pruned.dryRun ? `${pruned.deleted.length} to delete` : `${pruned.deleted.length} deleted`;
|
|
75
|
+
return `Scanned ${pruned.scanned}: ${deleted}, ${pruned.skipped} skipped, ${pruned.failed.length} failed.`;
|
|
76
|
+
}
|
|
77
|
+
function prunedContent(pruned) {
|
|
78
|
+
return renderOutcome({
|
|
79
|
+
rows: [
|
|
80
|
+
["Project", projectDisplayText(pruned)],
|
|
81
|
+
[pruned.dryRun ? "Would delete" : "Deleted", pruned.deleted.map(deletedText)],
|
|
82
|
+
["Failed", pruned.failed.map(({ name, message }) => `${name}: ${message}`)]
|
|
83
|
+
],
|
|
84
|
+
message: [countsText(pruned), ...pruned.dryRun ? ["--dry-run deleted nothing."] : []].join("\n")
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
var outcomes = defineOutcomes({
|
|
88
|
+
results: {
|
|
89
|
+
pruned: {
|
|
90
|
+
schema: prunedSchema,
|
|
91
|
+
description: "It scanned the shared snapshot index and deleted each dead entry (expired, missing, failed, or snapshot-less), or with --dry-run listed them and deleted nothing.",
|
|
92
|
+
render: prunedContent
|
|
93
|
+
},
|
|
94
|
+
deletesFailed: {
|
|
95
|
+
exitCode: 1,
|
|
96
|
+
schema: prunedSchema,
|
|
97
|
+
description: "It scanned the shared snapshot index, but couldn't check or delete at least one entry; `failed` names each one.",
|
|
98
|
+
render: prunedContent
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
errors: {
|
|
102
|
+
invalidConfig: configErrors.invalidConfig,
|
|
103
|
+
missingTarget: credentialErrors.missingTarget,
|
|
104
|
+
...credentialSourceErrors,
|
|
105
|
+
runnerFailed: runErrors.runnerFailed,
|
|
106
|
+
sharedListFailed: sharedListFailedError({
|
|
107
|
+
description: "The Vercel Sandbox API failed while storm listed the shared snapshot index, so nothing was deleted.",
|
|
108
|
+
consequence: ", so nothing was deleted",
|
|
109
|
+
next: "Run storm snapshots prune again."
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// src/commands/snapshots/prune/command.ts
|
|
115
|
+
var command_default = stormCommands.define({
|
|
116
|
+
requestSchema: z2.object({
|
|
117
|
+
dryRun: z2.boolean().default(false),
|
|
118
|
+
...SNAPSHOT_ACCESS_FIELDS
|
|
119
|
+
}),
|
|
120
|
+
cli: SNAPSHOT_ACCESS_CLI,
|
|
121
|
+
response: outcomes,
|
|
122
|
+
handler: async ({ app, ui, signal }, request) => {
|
|
123
|
+
const file = await app.config.loadFile();
|
|
124
|
+
if (!file.ok) return file.refusal;
|
|
125
|
+
const settings = fileSettings(file, request);
|
|
126
|
+
const chosen = settleSnapshotAccess(app, request.credential, settings, ui.progress);
|
|
127
|
+
if (!chosen.ok) return chosen.refusal;
|
|
128
|
+
if (signal.aborted) return outcomes.canceled({ changed: "Nothing was deleted." });
|
|
129
|
+
const obtained = await chosen.settled.obtain();
|
|
130
|
+
if (!obtained.ok) return obtained.refusal;
|
|
131
|
+
const { access, teamId, projectId, team, project } = obtained;
|
|
132
|
+
const ended = await pruneSharedSnapshots(app.context, { access, dryRun: request.dryRun }, signal);
|
|
133
|
+
if (ended.kind === "aborted")
|
|
134
|
+
return outcomes.canceled({
|
|
135
|
+
changed: request.dryRun ? "Nothing was deleted." : "The prune stopped: it may have deleted some entries. storm snapshots prune --dry-run lists what is left."
|
|
136
|
+
});
|
|
137
|
+
if (ended.kind === "failed")
|
|
138
|
+
return outcomes.sharedListFailed({ teamId, projectId, team, project, message: ended.message });
|
|
139
|
+
const { summary } = ended;
|
|
140
|
+
const facts = {
|
|
141
|
+
configFile: file.path,
|
|
142
|
+
teamId,
|
|
143
|
+
projectId,
|
|
144
|
+
team,
|
|
145
|
+
project,
|
|
146
|
+
dryRun: summary.dryRun,
|
|
147
|
+
scanned: summary.scanned,
|
|
148
|
+
deleted: summary.deleted.map((entry) => ({
|
|
149
|
+
name: entry.name,
|
|
150
|
+
reason: entry.reason,
|
|
151
|
+
snapshotId: entry.reason === "expired" || entry.reason === "missing" ? entry.snapshotId : null
|
|
152
|
+
})),
|
|
153
|
+
skipped: summary.skipped,
|
|
154
|
+
failed: summary.failed.map(({ name, message }) => ({ name, message }))
|
|
155
|
+
};
|
|
156
|
+
return facts.failed.length > 0 && !facts.dryRun ? outcomes.deletesFailed(facts) : outcomes.pruned(facts);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
export {
|
|
160
|
+
command_default as default
|
|
161
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const metadata: {
|
|
2
|
+
description: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
help: {
|
|
5
|
+
usages: string[];
|
|
6
|
+
fields: {
|
|
7
|
+
dryRun: {
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
credential: {
|
|
11
|
+
valueLabel: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
scope: {
|
|
15
|
+
valueLabel: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
project: {
|
|
19
|
+
valueLabel: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
examples: {
|
|
24
|
+
argv: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/commands/snapshots/prune/metadata.ts
|
|
2
|
+
var metadata = {
|
|
3
|
+
description: "Delete dead entries (expired, missing, failed, or snapshot-less) from the shared snapshot index of the Vercel project. Each entry is a named sandbox, storm-snap-<bucket>-<base>, that storm snapshots build --publish kept, and it stays in the project until something deletes it. It scans every storm-snap-<bucket>-<base> sandbox in the project and deletes each failed or aborted one (failed), each stopped one that holds no snapshot (no-snapshot), each stopped one whose snapshot is not found or not created (missing), and each stopped one whose snapshot has expired (expired). It skips a sandbox that a build still owns, such as one that is running or snapshotting, and a stopped one whose expires-at tag is still in the future. It obtains a credential as storm snapshots build does (minting one by default, or reading VERCEL_OIDC_TOKEN with --credential vercel-oidc), and needs no storm.config.ts when the flags give what it needs. With --dry-run it lists what it would delete and deletes nothing. It exits 1 when the listing or any delete fails.",
|
|
4
|
+
summary: "Delete dead entries (expired, missing, failed, or snapshot-less) from the shared snapshot index.",
|
|
5
|
+
help: {
|
|
6
|
+
usages: ["[--dry-run] [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>]"],
|
|
7
|
+
fields: {
|
|
8
|
+
dryRun: {
|
|
9
|
+
description: "List the entries it would delete, each with its reason, and delete nothing."
|
|
10
|
+
},
|
|
11
|
+
credential: {
|
|
12
|
+
valueLabel: "SOURCE",
|
|
13
|
+
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; vercel-oidc reads a pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN and needs no --scope or --project. No config key."
|
|
14
|
+
},
|
|
15
|
+
scope: {
|
|
16
|
+
valueLabel: "TEAM",
|
|
17
|
+
description: "The Vercel team whose project holds the shared snapshot index. Required with --credential mint, from this flag or scope in storm.config.ts; optional with --credential vercel-oidc."
|
|
18
|
+
},
|
|
19
|
+
project: {
|
|
20
|
+
valueLabel: "PROJECT",
|
|
21
|
+
description: "The Vercel project, within the team, that holds the shared snapshot index. Required with --credential mint, from this flag or project in storm.config.ts; optional with --credential vercel-oidc."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
examples: [
|
|
25
|
+
{
|
|
26
|
+
argv: "--dry-run",
|
|
27
|
+
description: "List the dead entries of the shared snapshot index, and delete nothing."
|
|
28
|
+
},
|
|
29
|
+
{ argv: "", description: "Delete the dead entries of the shared snapshot index." },
|
|
30
|
+
{
|
|
31
|
+
argv: "--credential vercel-oidc --json",
|
|
32
|
+
description: "Delete the dead entries with the token in VERCEL_OIDC_TOKEN, and print what it did as JSON."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
metadata
|
|
39
|
+
};
|