@cnc-tools/storm 0.5.0 → 0.7.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 (171) hide show
  1. package/dist/build-info.js +1 -1
  2. package/dist/combine-errors.js +2 -2
  3. package/dist/commands/dashboard.js +1 -1
  4. package/dist/commands/{run → exec}/cleanup.d.ts +1 -1
  5. package/dist/commands/{run → exec}/cleanup.js +1 -1
  6. package/dist/commands/{run/outcomes.d.ts → exec/command.d.ts} +103 -112
  7. package/dist/commands/exec/command.js +23 -0
  8. package/dist/commands/{run → exec}/job-summary.d.ts +5 -1
  9. package/dist/commands/{run → exec}/job-summary.js +5 -2
  10. package/dist/commands/{run → exec}/live-view.js +29 -13
  11. package/dist/commands/exec/metadata.d.ts +69 -0
  12. package/dist/commands/exec/metadata.js +55 -0
  13. package/dist/commands/{run → exec}/mint-failed.js +4 -4
  14. package/dist/commands/exec/outcomes.d.ts +664 -0
  15. package/dist/commands/exec/outcomes.js +347 -0
  16. package/dist/commands/{run → exec}/progress.d.ts +14 -2
  17. package/dist/commands/{run → exec}/progress.js +54 -9
  18. package/dist/commands/exec/run-command.d.ts +227 -0
  19. package/dist/commands/exec/run-command.js +696 -0
  20. package/dist/commands/exec/run-metadata.d.ts +59 -0
  21. package/dist/commands/exec/run-metadata.js +61 -0
  22. package/dist/commands/{run → exec}/run-record.d.ts +110 -5
  23. package/dist/commands/{run → exec}/run-record.js +57 -1
  24. package/dist/commands/exec/testserver-flags.d.ts +48 -0
  25. package/dist/commands/exec/testserver-flags.js +80 -0
  26. package/dist/commands/{run → exec}/view.js +36 -4
  27. package/dist/commands/runs/facts.d.ts +25 -0
  28. package/dist/commands/runs/facts.js +38 -5
  29. package/dist/commands/runs/list/command.d.ts +25 -0
  30. package/dist/commands/runs/list/outcomes.d.ts +25 -0
  31. package/dist/commands/runs/logs/metadata.js +1 -1
  32. package/dist/commands/runs/logs/outcomes.js +4 -1
  33. package/dist/commands/runs/past-run.d.ts +2 -2
  34. package/dist/commands/runs/past-run.js +2 -2
  35. package/dist/commands/runs/show/command.d.ts +25 -0
  36. package/dist/commands/runs/show/metadata.js +2 -2
  37. package/dist/commands/runs/show/outcomes.d.ts +25 -0
  38. package/dist/commands/runs/show/outcomes.js +37 -5
  39. package/dist/commands/vitest/command.d.ts +325 -0
  40. package/dist/commands/vitest/command.js +138 -0
  41. package/dist/commands/vitest/metadata.d.ts +69 -0
  42. package/dist/commands/vitest/metadata.js +35 -0
  43. package/dist/commands/vitest/outcomes.d.ts +298 -0
  44. package/dist/commands/vitest/outcomes.js +77 -0
  45. package/dist/config/index.d.ts +2 -1
  46. package/dist/config/index.js +1 -0
  47. package/dist/config/resolve.d.ts +3 -3
  48. package/dist/config/resolve.js +3 -3
  49. package/dist/config/resource-config.d.ts +2 -2
  50. package/dist/config/schema.d.ts +1 -1
  51. package/dist/config/set.d.ts +15 -4
  52. package/dist/config/set.js +28 -12
  53. package/dist/config-file/define.d.ts +8 -6
  54. package/dist/context.d.ts +6 -3
  55. package/dist/context.js +4 -2
  56. package/dist/core/command-provider.d.ts +1 -1
  57. package/dist/core/events.d.ts +9 -7
  58. package/dist/core/presentation.js +1 -1
  59. package/dist/core/presentations.js +1 -1
  60. package/dist/core/run-state.d.ts +30 -6
  61. package/dist/core/run-state.js +19 -4
  62. package/dist/core/run.d.ts +17 -4
  63. package/dist/core/run.js +61 -25
  64. package/dist/resources/testserver/command.d.ts +1 -1
  65. package/dist/resources/testserver/command.js +1 -1
  66. package/dist/resources/testserver/config.d.ts +1 -1
  67. package/dist/resources/testserver/config.js +3 -2
  68. package/dist/resources/testserver/credential-facts.js +1 -1
  69. package/dist/resources/testserver/resource.d.ts +2 -2
  70. package/dist/resources/testserver/sandbox/create.d.ts +2 -2
  71. package/dist/resources/testserver/sandbox/create.js +2 -2
  72. package/dist/resources.d.ts +9 -6
  73. package/dist/resources.js +3 -3
  74. package/dist/runner/events.d.ts +64 -1
  75. package/dist/runner/gateways.d.ts +17 -6
  76. package/dist/runner/index.d.ts +5 -4
  77. package/dist/runner/index.js +4 -3
  78. package/dist/runner/live/snapshot-records.js +18 -4
  79. package/dist/runner/prepare.d.ts +23 -4
  80. package/dist/runner/prepare.js +13 -3
  81. package/dist/runner/ready.d.ts +7 -3
  82. package/dist/runner/ready.js +11 -5
  83. package/dist/runner/scope.d.ts +17 -1
  84. package/dist/runner/scope.js +4 -0
  85. package/dist/runner/snapshot-build.d.ts +3 -1
  86. package/dist/runner/snapshot-build.js +12 -2
  87. package/dist/runner/snapshot-cache.d.ts +46 -8
  88. package/dist/runner/snapshot-cache.js +60 -11
  89. package/dist/runner/snapshot-key.d.ts +12 -1
  90. package/dist/runner/snapshot-key.js +17 -1
  91. package/dist/runner/snapshot-save.d.ts +53 -0
  92. package/dist/runner/snapshot-save.js +148 -0
  93. package/dist/sdk/index.js +1 -1
  94. package/dist/sdk/payload/payload.d.ts +2 -2
  95. package/dist/sdk/payload/payload.js +2 -2
  96. package/dist/story/align.d.ts +1 -1
  97. package/dist/story/align.js +1 -1
  98. package/dist/story/definition.d.ts +22 -15
  99. package/dist/story/definition.js +2 -2
  100. package/dist/story/errors.js +1 -1
  101. package/dist/story/gateways.d.ts +45 -25
  102. package/dist/story/gateways.js +2 -2
  103. package/dist/story/host.d.ts +11 -8
  104. package/dist/story/host.js +37 -37
  105. package/dist/story/index.d.ts +1 -1
  106. package/dist/story/index.js +4 -4
  107. package/dist/story/json.d.ts +1 -1
  108. package/dist/story/json.js +2 -2
  109. package/dist/story/live/recording-gateway.d.ts +2 -0
  110. package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
  111. package/dist/story/mode.d.ts +2 -2
  112. package/dist/story/mode.js +1 -1
  113. package/dist/story/orphans.d.ts +23 -5
  114. package/dist/story/orphans.js +44 -8
  115. package/dist/story/recording.d.ts +62 -0
  116. package/dist/story/{artifact.js → recording.js} +31 -27
  117. package/dist/story/report.d.ts +21 -9
  118. package/dist/story/report.js +37 -25
  119. package/dist/story/settle.d.ts +23 -21
  120. package/dist/story/settle.js +17 -16
  121. package/dist/story/{run.d.ts → start.d.ts} +18 -17
  122. package/dist/story/{run.js → start.js} +66 -43
  123. package/dist/vercel-cli/driver.d.ts +1 -1
  124. package/dist/vercel-cli/entry.d.ts +1 -1
  125. package/dist/vercel-cli/entry.js +1 -1
  126. package/dist/vercel-cli/verbose.d.ts +2 -2
  127. package/dist/vercel-cli/verbose.js +2 -2
  128. package/dist/vitest/config.d.ts +5 -5
  129. package/dist/vitest/config.js +5 -5
  130. package/dist/vitest/find-vitest.d.ts +7 -0
  131. package/dist/vitest/find-vitest.js +28 -0
  132. package/dist/vitest/fixtures.d.ts +2 -2
  133. package/dist/vitest/fixtures.js +3 -3
  134. package/dist/vitest/gateways.d.ts +37 -6
  135. package/dist/vitest/gateways.js +3 -2
  136. package/dist/vitest/live/list-gateway.d.ts +7 -3
  137. package/dist/vitest/live/list-gateway.js +55 -8
  138. package/dist/vitest/plan.d.ts +41 -8
  139. package/dist/vitest/plan.js +47 -16
  140. package/dist/vitest/sandbox.d.ts +1 -1
  141. package/dist/vitest/sandbox.js +1 -1
  142. package/dist/vitest/test-events.d.ts +2 -2
  143. package/dist/vitest/test-events.js +3 -3
  144. package/dist/vitest/test-results.d.ts +1 -1
  145. package/dist/vitest/test-results.js +1 -1
  146. package/dist/vitest/types.d.ts +1 -1
  147. package/package.json +2 -2
  148. package/skills/overview.md +5 -4
  149. package/skills/read-run-output.md +1 -1
  150. package/dist/commands/run/command.d.ts +0 -327
  151. package/dist/commands/run/command.js +0 -620
  152. package/dist/commands/run/metadata.d.ts +0 -47
  153. package/dist/commands/run/metadata.js +0 -83
  154. package/dist/commands/run/outcomes.js +0 -332
  155. package/dist/story/artifact.d.ts +0 -60
  156. package/dist/story/live/artifact-gateway.d.ts +0 -2
  157. /package/dist/commands/{run → exec}/live-view.d.ts +0 -0
  158. /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
  159. /package/dist/commands/{run → exec}/redaction.d.ts +0 -0
  160. /package/dist/commands/{run → exec}/redaction.js +0 -0
  161. /package/dist/commands/{run → exec}/run-collector.d.ts +0 -0
  162. /package/dist/commands/{run → exec}/run-collector.js +0 -0
  163. /package/dist/commands/{run → exec}/tests-summary.d.ts +0 -0
  164. /package/dist/commands/{run → exec}/tests-summary.js +0 -0
  165. /package/dist/commands/{run → exec}/text.d.ts +0 -0
  166. /package/dist/commands/{run → exec}/text.js +0 -0
  167. /package/dist/commands/{run → exec}/view.d.ts +0 -0
  168. /package/dist/commands/{run → exec}/waterfall.d.ts +0 -0
  169. /package/dist/commands/{run → exec}/waterfall.js +0 -0
  170. /package/dist/commands/{run → exec}/worker-chart.d.ts +0 -0
  171. /package/dist/commands/{run → exec}/worker-chart.js +0 -0
@@ -0,0 +1,227 @@
1
+ import { type ArgumentIssue, type CommandError, type CommandResult, type ExecutionContext } from "@vercel/clinkr";
2
+ import { z } from "zod";
3
+ import type { StormApp } from "../../context.ts";
4
+ import { type CredentialSourceChoice, type MintTarget } from "../../credential/index.ts";
5
+ import { type CheckedRecipe, type CheckoutFailure } from "../../runner/index.ts";
6
+ import { type StormSetValues } from "../../resources.ts";
7
+ import { type ranSchema } from "./outcomes.ts";
8
+ import { type RunRecordPlan } from "./run-record.ts";
9
+ /** The request fields every run takes, `exec`'s and `vitest`'s: each command adds the fields for its command. */
10
+ export declare const RUN_REQUEST_FIELDS: {
11
+ set: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
+ testserverSandboxes: z.ZodOptional<z.ZodNumber>;
13
+ testserverBuild: z.ZodOptional<z.ZodString>;
14
+ testserverMinTimeLeft: z.ZodOptional<z.ZodString>;
15
+ testserverTtl: z.ZodOptional<z.ZodString>;
16
+ testserverNoCreate: z.ZodOptional<z.ZodBoolean>;
17
+ scope: z.ZodOptional<z.ZodString>;
18
+ project: z.ZodOptional<z.ZodString>;
19
+ credential: z.ZodOptional<z.ZodEnum<{
20
+ "github-actions": "github-actions";
21
+ mint: "mint";
22
+ }>>;
23
+ local: z.ZodDefault<z.ZodBoolean>;
24
+ rebuildSnapshot: z.ZodDefault<z.ZodBoolean>;
25
+ saveSnapshot: z.ZodDefault<z.ZodBoolean>;
26
+ showOutput: z.ZodDefault<z.ZodBoolean>;
27
+ keepSandbox: z.ZodOptional<z.ZodString>;
28
+ verbose: z.ZodDefault<z.ZodBoolean>;
29
+ };
30
+ /** The CLI spellings of the fields every run takes. */
31
+ export declare const RUN_CLI_OPTIONS: {
32
+ readonly project: {
33
+ readonly short: "p";
34
+ };
35
+ };
36
+ declare const runRequestSchema: z.ZodObject<{
37
+ set: z.ZodDefault<z.ZodArray<z.ZodString>>;
38
+ testserverSandboxes: z.ZodOptional<z.ZodNumber>;
39
+ testserverBuild: z.ZodOptional<z.ZodString>;
40
+ testserverMinTimeLeft: z.ZodOptional<z.ZodString>;
41
+ testserverTtl: z.ZodOptional<z.ZodString>;
42
+ testserverNoCreate: z.ZodOptional<z.ZodBoolean>;
43
+ scope: z.ZodOptional<z.ZodString>;
44
+ project: z.ZodOptional<z.ZodString>;
45
+ credential: z.ZodOptional<z.ZodEnum<{
46
+ "github-actions": "github-actions";
47
+ mint: "mint";
48
+ }>>;
49
+ local: z.ZodDefault<z.ZodBoolean>;
50
+ rebuildSnapshot: z.ZodDefault<z.ZodBoolean>;
51
+ saveSnapshot: z.ZodDefault<z.ZodBoolean>;
52
+ showOutput: z.ZodDefault<z.ZodBoolean>;
53
+ keepSandbox: z.ZodOptional<z.ZodString>;
54
+ verbose: z.ZodDefault<z.ZodBoolean>;
55
+ }, z.core.$strip>;
56
+ /** What every run's request holds. */
57
+ export type RunCommandRequest = z.output<typeof runRequestSchema>;
58
+ /** A run settled before it starts: its config file, its resources' options and requests, and where it runs. */
59
+ export type SettledRun = Extract<Awaited<ReturnType<typeof settleRun>>, {
60
+ readonly ok: true;
61
+ }>;
62
+ /** What a `ran` outcome reports of every run, which a command's own `ran` may extend. */
63
+ export type RanFacts = z.input<typeof ranSchema>;
64
+ /**
65
+ * The command a settled run runs: its argv, the settled run it runs with, which `prepare` may have changed (such as
66
+ * its Testserver sandbox count) but not its secrets, which the run hides from the settled run it gave `prepare`, and
67
+ * its test plan, which `run.json` records when there is one.
68
+ */
69
+ export interface PreparedCommand<TPlan> {
70
+ readonly ok: true;
71
+ readonly argv: readonly string[];
72
+ readonly settled: SettledRun;
73
+ readonly plan: TPlan;
74
+ }
75
+ /** How one command runs: its name, the command its settled run runs, and its `ran` outcome. */
76
+ export interface RunCommandSpec<TPlan, TRan, TRefusal> {
77
+ /** The invoking command's name, `exec` or `vitest`, which the job summary's heading names. */
78
+ readonly name: string;
79
+ /**
80
+ * The command to run once the run is settled, before anything is minted, leased or started and before a runner
81
+ * run's local checks; or a refusal, which ends the run there, with the run's secrets hidden. Once `signal`, the
82
+ * invocation's, aborts, it stops what it started as soon as it can; the run then cancels, whatever it answers.
83
+ */
84
+ prepare(settled: SettledRun, signal: AbortSignal): Promise<PreparedCommand<TPlan> | {
85
+ readonly ok: false;
86
+ readonly refusal: TRefusal;
87
+ }>;
88
+ /** The `ran` outcome for a run whose command ran, from what every run reports and the command's plan. */
89
+ ran(facts: RanFacts, plan: TPlan): TRan;
90
+ }
91
+ /**
92
+ * Runs a run's command, the argv `spec.prepare` gives once the run is settled (`exec`'s command after `--`, or the
93
+ * `vitest run` argv `vitest` builds), with the run payload in `STORM_RUN` and the host variables each resource
94
+ * names removed (`TESTSERVER_BASES`/`TESTSERVER_BASE` for the Testserver pool), waits for it, and prints a waterfall.
95
+ * With a Testserver side it first leases usable Testserver sandboxes from the pool, creates the rest, and prints the
96
+ * sandbox list, and releases the leases once the command ends. The process exits with the command's code, or `128 + n`
97
+ * when signal `n` ended it: `bin/storm.ts` applies the status this records in `app.exit`, which Clinkr's 0 or 1
98
+ * can't carry.
99
+ *
100
+ * A run holds a resource when `storm.config.ts` has it under `resources` or the command line gives one of its
101
+ * options: a `--set resources.<name>.<option>=<value>`, or for the Testserver pool resource one of its own flags
102
+ * (`--testserver-sandboxes`, `--testserver-build`, `--testserver-min-time-left`, `--testserver-ttl`,
103
+ * `--testserver-no-create`; `testserver-flags.ts`). A run has a Testserver side when it holds the Testserver pool
104
+ * resource; without one, the run payload names no Testserver sandbox.
105
+ *
106
+ * Signals: before the command starts, the first signal stops the run at its next step, lets creates in flight settle,
107
+ * releases its leases, and cancels (exit `128 + n`). A signal while `spec.prepare` runs, such as while `vitest` counts
108
+ * the tests, stops it and cancels the run before anything is minted, leased or started (`canceledBeforeStart`). While
109
+ * the command runs, Ctrl+C and a closed terminal reach it directly through its process group, so only SIGTERM is
110
+ * passed on; either way the run waits for the command. A second signal makes Clinkr's host exit at once with
111
+ * `128 + n`, leaving the leases for the next run to reclaim, since their holder is gone.
112
+ *
113
+ * `scope` and `project` come from `--scope` and `--project`, else `storm.config.ts` (found from the working
114
+ * directory and checked whole); they have no default, so one of the two must give them when the run mints. Each
115
+ * resource's options come from the command line, else the file's section, else the option's default (the registry's
116
+ * resource configs, `src/resources.ts`). On the command line, each Testserver pool option has its own
117
+ * `--testserver-<option>` flag, and any other option comes from `--set resources.<name>.<option>=<value>`, which may
118
+ * repeat. An unknown key path, a key path given twice, a key path with its own flag, or a value its option's rule
119
+ * refuses is a usage error. Options that don't fit together once merged, such as a TTL not longer than `minTimeLeft`,
120
+ * or a `--testserver-ttl` with `noCreate`, are `invalid_resource_options`, which names each value's source.
121
+ *
122
+ * By default the command runs in a runner sandbox, from the `runner` recipe of `storm.config.ts`, which only a
123
+ * runner run reads: `missing_runner` without one. `--local` (no config key) runs it on this machine instead. The
124
+ * runner's local checks (`prepareRunner`) run before anything is minted, leased or created. A runner run always mints,
125
+ * for the runner sandbox, so it needs `scope` and `project` whatever resources it holds. In a runner run, the first
126
+ * SIGINT, SIGTERM or SIGHUP stops the run in any phase: the remote command is killed, every sandbox the run started is
127
+ * stopped and deleted, the leases are released, and the run cancels. `--rebuild-snapshot` (no config key, not with
128
+ * `--local`) builds a runner snapshot whatever the cache holds, and drops HEAD's branch's branch snapshots from it.
129
+ * `--save-snapshot` (no config key, not with `--local` or a `--keep-sandbox` above 0) saves the runner sandbox as a
130
+ * branch snapshot once the command ended on its own, while the leases are released, so the next run on the branch
131
+ * starts from it; a run with it on a branch keeps no runner sandbox, however it ends, and one on a detached HEAD says
132
+ * so as it starts and keeps its runner sandbox as without the flag.
133
+ *
134
+ * `--credential` (no config key) picks the credential source: `mint`, the default, or `github-actions`, which requests
135
+ * a GitHub Actions OIDC token instead and so needs no `--scope` or `--project`; any given are unused. A runner run
136
+ * needs the mint, so `--credential github-actions` without `--local` is a usage error. The registry says whether a held
137
+ * resource takes the credential (`RESOURCE_COMMANDS.takesCredential`): the Testserver pool does unless `noCreate`. A
138
+ * `--credential` given to a run where none does is `credential_unused`.
139
+ *
140
+ * Progress shows by the app's presentation (`presentation.ts`): a live view on a terminal a person watches, plain lines
141
+ * elsewhere, folded for GitHub Actions, nothing under `--json`. `--show-output` (no config key, not with `--local`)
142
+ * prints the runner's step output above the live view. `--verbose` (no config key) prints each create's progress
143
+ * messages and the runner's step output, and sets `verbose` in the run payload. Every run, `--json` included, writes a
144
+ * run directory (`core/run-directory.ts`), and a run that can't make one goes on without it; the waterfall names it and
145
+ * the `storm runs show` command that reads the run back by its run id, which a ran outcome carries as `runId`, and
146
+ * in a GitHub Actions step with a job summary the run appends a Markdown summary there.
147
+ *
148
+ * Each resource is a provider (the registry, `src/resources.ts`, lists them), whose folder under `src/resources/` says
149
+ * what the run does with it, and whose command half settles it (`RESOURCE_COMMANDS.settle`). The run refuses in this
150
+ * order: `invalid_config`, `invalid_resource_options`, `credential_unused`; in a runner run `missing_runner`, then
151
+ * `missing_target`; in a local run where a resource takes the credential, `missing_target` for the mint; then each
152
+ * resource's settle, in provider order; then `spec.prepare`'s refusal, if any. A resource's secrets, such as a token,
153
+ * are hidden as `<token>` in the run's progress, its run directory, its job summary, its outcome, `spec.prepare`'s
154
+ * refusal, and its command's output, in either kind of run.
155
+ */
156
+ export declare function runCommand<TPlan extends RunRecordPlan | undefined, TRan extends CommandResult, TRefusal extends CommandError = never>({ app, ui, signal }: ExecutionContext<StormApp>, request: RunCommandRequest, spec: RunCommandSpec<TPlan, TRan, TRefusal>): Promise<TRan | TRefusal | import("@vercel/clinkr").ClinkrError<"canceled"> | CommandError<"credential_unused"> | CommandError<"invalid_config"> | CommandError<"invalid_resource_options"> | CommandError<"mint_failed"> | CommandError<"missing_runner"> | CommandError<"missing_target"> | CommandError<"no_base_ref"> | CommandError<"runner_failed"> | CommandError<"snapshot_gone"> | CommandError<"spawn_failed"> | CommandError<"submodules_refused"> | CommandError<"credential_rejected" | "github_fixture_repo_unavailable" | "github_token_missing" | "no_sandboxes" | "no_usable_sandboxes" | "pool_unavailable" | "pool_unreadable" | "token_request_failed">>;
157
+ /** What is wrong with a run's request that its schema can't say, as `validate` reports it. */
158
+ export declare function runProblems({ set, credential, local, rebuildSnapshot, saveSnapshot, showOutput, keepSandbox, ...rest }: RunCommandRequest): readonly ArgumentIssue[];
159
+ /**
160
+ * A run canceled before it started, while it was settled or prepared: nothing was minted, leased or started, and the
161
+ * command didn't run.
162
+ */
163
+ export declare function canceledBeforeStart(): import("@vercel/clinkr").ClinkrError<"canceled">;
164
+ /**
165
+ * The refusal for a runner run whose checkout git couldn't read before anything was minted, leased or started:
166
+ * `runner_failed` with `checkout-failed`, holding nothing.
167
+ */
168
+ export declare function checkoutFailedRefusal(failure: CheckoutFailure): CommandError<"runner_failed">;
169
+ /** How long a runner sandbox keeps running once its run ends, when neither the flag nor the recipe says. */
170
+ export declare const DEFAULT_KEEP_SANDBOX_MINUTES = 30;
171
+ /**
172
+ * Where a settled run runs: with `--local` on this machine, with the credential source it settled when a held
173
+ * resource takes one; or by default in a runner sandbox, with the runner recipe and the team and project the runner
174
+ * sandbox's credential is minted for, whose one mint the resources share.
175
+ */
176
+ type RunWhere = {
177
+ readonly kind: "local";
178
+ readonly credential: CredentialSourceChoice | undefined;
179
+ } | {
180
+ readonly kind: "runner";
181
+ readonly recipe: CheckedRecipe;
182
+ readonly target: MintTarget;
183
+ };
184
+ /**
185
+ * Settles a run before it starts, refusing in this order: the config file (`invalid_config`); each held resource's
186
+ * merged options (`invalid_resource_options`); a `--credential` no held resource takes (`credential_unused`); in a
187
+ * runner run, the runner recipe (`missing_runner`) and the team and project its mint needs (`missing_target`); in a
188
+ * local run where a held resource takes the credential, the credential source (`missing_target` for the mint); then
189
+ * each held resource's own settle, in provider order.
190
+ */
191
+ declare function settleRun(app: StormApp, request: {
192
+ readonly given: StormSetValues;
193
+ readonly scope?: string | undefined;
194
+ readonly project?: string | undefined;
195
+ readonly local: boolean;
196
+ readonly credential?: CredentialSourceChoice["source"] | undefined;
197
+ }): Promise<{
198
+ readonly ok: false;
199
+ readonly refusal: CommandError<"invalid_config">;
200
+ } | {
201
+ readonly ok: false;
202
+ readonly refusal: CommandError<"invalid_resource_options">;
203
+ } | {
204
+ readonly ok: false;
205
+ readonly refusal: CommandError<"missing_target">;
206
+ } | {
207
+ readonly ok: false;
208
+ readonly refusal: CommandError<"credential_rejected" | "github_fixture_repo_unavailable" | "github_token_missing" | "no_sandboxes" | "no_usable_sandboxes" | "pool_unavailable" | "pool_unreadable" | "token_request_failed">;
209
+ } | {
210
+ readonly ok: false;
211
+ readonly refusal: CommandError<"credential_unused">;
212
+ } | {
213
+ readonly ok: false;
214
+ readonly refusal: CommandError<"missing_runner">;
215
+ } | {
216
+ readonly ok: true;
217
+ readonly configFile: string | null;
218
+ readonly file: {
219
+ readonly ok: true;
220
+ } & import("../../config/settings-file.ts").SettingsFile<(import("../../config/resource-config.ts").ResourceConfig<"githubFixtureRepo", import("../../resources/github/resource.ts").GitHubFixtureRepoOptions, import("../../resources/github/config.ts").GitHubFixtureRepoSettings, keyof import("../../resources/github/resource.ts").GitHubFixtureRepoOptions> | import("../../config/resource-config.ts").ResourceConfig<"testserverPool", import("../../resources/testserver/resource.ts").TestserverPoolOptions, import("../../resources/testserver/provider.ts").TestserverPoolRequest, keyof import("../../resources/testserver/resource.ts").TestserverPoolOptions>)[]>;
221
+ readonly options: import("../../config/resource-config.ts").ResolvedResources<(import("../../config/resource-config.ts").ResourceConfig<"githubFixtureRepo", import("../../resources/github/resource.ts").GitHubFixtureRepoOptions, import("../../resources/github/config.ts").GitHubFixtureRepoSettings, keyof import("../../resources/github/resource.ts").GitHubFixtureRepoOptions> | import("../../config/resource-config.ts").ResourceConfig<"testserverPool", import("../../resources/testserver/resource.ts").TestserverPoolOptions, import("../../resources/testserver/provider.ts").TestserverPoolRequest, keyof import("../../resources/testserver/resource.ts").TestserverPoolOptions>)[]>;
222
+ readonly where: RunWhere;
223
+ readonly settlement: {
224
+ readonly ok: true;
225
+ } & import("../../core/command-slots.ts").ResourcesSettlement<import("../../resources.ts").Resources>;
226
+ }>;
227
+ export {};