@cnc-tools/storm 0.10.0 → 0.11.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 (198) hide show
  1. package/dist/bin/storm.js +17 -9
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-YF3ICDBY.js → chunk-3ZZVZPMG.js} +1 -1
  4. package/dist/chunks/{chunk-JQ2HK4RN.js → chunk-4EU4AH7E.js} +141 -6
  5. package/dist/chunks/{chunk-ZJ2USLAT.js → chunk-4PRAB24Y.js} +2 -22
  6. package/dist/chunks/chunk-AMTYHUYB.js +257 -0
  7. package/dist/chunks/{chunk-WF4KJ7YG.js → chunk-ETCZ6WP7.js} +1 -1
  8. package/dist/chunks/chunk-FVMQKYTT.js +10 -0
  9. package/dist/chunks/{chunk-XHJGHJBW.js → chunk-GRMD7G4J.js} +33 -275
  10. package/dist/chunks/chunk-ICB4BZJX.js +22 -0
  11. package/dist/chunks/{chunk-AGWW3HDT.js → chunk-KR7WIYLG.js} +1826 -2201
  12. package/dist/chunks/{chunk-OVXD7GES.js → chunk-L4ZPMSKQ.js} +4 -37
  13. package/dist/chunks/chunk-NPPJ57W7.js +569 -0
  14. package/dist/chunks/{chunk-VJQLMGOH.js → chunk-O4BUT7BE.js} +361 -1716
  15. package/dist/chunks/chunk-OJOKQRM6.js +1457 -0
  16. package/dist/chunks/chunk-SLNKW4ZM.js +40 -0
  17. package/dist/chunks/{chunk-AKKNF3WZ.js → chunk-TRFEAYNC.js} +277 -348
  18. package/dist/chunks/chunk-VZZTHCBW.js +93 -0
  19. package/dist/chunks/chunk-WNIQA5J6.js +19 -0
  20. package/dist/chunks/chunk-WSIF7SR6.js +10 -0
  21. package/dist/chunks/{live-app-RIJM3QFD.js → live-app-LOGYUBKB.js} +52 -7
  22. package/dist/commands/exec/cleanup.d.ts +3 -3
  23. package/dist/commands/exec/cleanup.js +6 -2
  24. package/dist/commands/exec/command.d.ts +3 -3
  25. package/dist/commands/exec/command.js +17 -10
  26. package/dist/commands/exec/job-summary.d.ts +1 -1
  27. package/dist/commands/exec/job-summary.js +1 -1
  28. package/dist/commands/exec/live-view.js +5 -5
  29. package/dist/commands/exec/mint-failed.js +1 -1
  30. package/dist/commands/exec/outcomes.d.ts +2 -2
  31. package/dist/commands/exec/outcomes.js +7 -8
  32. package/dist/commands/exec/plan-run.d.ts +3 -5
  33. package/dist/commands/exec/progress.d.ts +3 -3
  34. package/dist/commands/exec/progress.js +6 -6
  35. package/dist/commands/exec/resource-refusals.d.ts +1 -1
  36. package/dist/commands/exec/resource-refusals.js +1 -1
  37. package/dist/commands/exec/run-command.d.ts +14 -9
  38. package/dist/commands/exec/run-command.js +91 -202
  39. package/dist/commands/exec/run-metadata.d.ts +2 -2
  40. package/dist/commands/exec/run-metadata.js +3 -3
  41. package/dist/commands/exec/test-plan.d.ts +1 -35
  42. package/dist/commands/exec/test-plan.js +4 -24
  43. package/dist/commands/exec/view.js +3 -3
  44. package/dist/commands/exec/waterfall.d.ts +3 -1
  45. package/dist/commands/exec/waterfall.js +18 -1
  46. package/dist/commands/runs/facts.d.ts +2 -1
  47. package/dist/commands/runs/facts.js +1 -1
  48. package/dist/commands/runs/list/command.js +10 -9
  49. package/dist/commands/runs/logs/command.js +14 -12
  50. package/dist/commands/runs/past-run.d.ts +3 -27
  51. package/dist/commands/runs/past-run.js +3 -37
  52. package/dist/commands/runs/show/command.js +24 -21
  53. package/dist/commands/runs/show/outcomes.js +2 -2
  54. package/dist/commands/vitest/command.d.ts +3 -3
  55. package/dist/commands/vitest/command.js +24 -17
  56. package/dist/commands/vitest/outcomes.d.ts +1 -1
  57. package/dist/commands/vitest/outcomes.js +1 -1
  58. package/dist/config/credential-resolver.d.ts +6 -3
  59. package/dist/config/credential-resolver.js +6 -5
  60. package/dist/context.d.ts +27 -9
  61. package/dist/context.js +19 -8
  62. package/dist/core/before-run.d.ts +5 -4
  63. package/dist/core/before-run.js +6 -6
  64. package/dist/core/definition-lookup.d.ts +22 -0
  65. package/dist/core/definition-lookup.js +34 -0
  66. package/dist/core/events.d.ts +5 -19
  67. package/dist/core/gateways.d.ts +22 -162
  68. package/dist/core/index.d.ts +10 -11
  69. package/dist/core/index.js +9 -11
  70. package/dist/core/launcher-supplies.js +2 -2
  71. package/dist/core/live/terminal-command-gateway.d.ts +8 -0
  72. package/dist/core/live/terminal-command-gateway.js +49 -0
  73. package/dist/core/presentations.d.ts +4 -3
  74. package/dist/core/presentations.js +4 -5
  75. package/dist/core/resource-registry.d.ts +35 -51
  76. package/dist/core/resource-registry.js +27 -54
  77. package/dist/core/resource-reports.d.ts +37 -4
  78. package/dist/core/resource-reports.js +34 -5
  79. package/dist/core/resources.d.ts +4 -3
  80. package/dist/core/resources.js +2 -4
  81. package/dist/core/run-state.d.ts +1 -1
  82. package/dist/core/run-state.js +1 -1
  83. package/dist/core/run.d.ts +19 -37
  84. package/dist/core/run.js +59 -114
  85. package/dist/core/timeline.js +2 -1
  86. package/dist/credential/events.d.ts +20 -0
  87. package/dist/credential/events.js +4 -0
  88. package/dist/credential/index.d.ts +2 -1
  89. package/dist/credential/index.js +6 -5
  90. package/dist/credential/source.d.ts +38 -26
  91. package/dist/credential/source.js +25 -34
  92. package/dist/extension-commands.d.ts +12 -6
  93. package/dist/extension-commands.js +18 -11
  94. package/dist/extensions/story/command-tree.d.ts +6 -0
  95. package/dist/extensions/story/command-tree.js +21 -0
  96. package/dist/extensions/story/commands/app.d.ts +23 -0
  97. package/dist/extensions/story/commands/app.js +5 -0
  98. package/dist/extensions/story/commands/run/command.d.ts +211 -0
  99. package/dist/extensions/story/commands/run/command.js +259 -0
  100. package/dist/extensions/story/commands/run/metadata.d.ts +4 -0
  101. package/dist/extensions/story/commands/run/metadata.js +8 -0
  102. package/dist/extensions/story/commands/run/outcomes.d.ts +101 -0
  103. package/dist/extensions/story/commands/run/outcomes.js +73 -0
  104. package/dist/extensions/story/commands/tree.d.ts +2 -0
  105. package/dist/extensions/story/commands/tree.js +6 -0
  106. package/dist/extensions/story/extension.d.ts +2 -0
  107. package/dist/extensions/story/extension.js +8 -0
  108. package/dist/extensions/testserver/command-tree.d.ts +1 -1
  109. package/dist/extensions/testserver/command-tree.js +0 -1
  110. package/dist/extensions/testserver/commands/pool/create/command.js +14 -8
  111. package/dist/extensions/testserver/commands/pool/list/command.js +8 -4
  112. package/dist/extensions/testserver/vitest/config.d.ts +7 -5
  113. package/dist/extensions/testserver/vitest/config.js +7 -5
  114. package/dist/extensions/testserver/vitest/fixtures.d.ts +2 -0
  115. package/dist/extensions/testserver/vitest/fixtures.js +36 -5
  116. package/dist/extensions.d.ts +12 -21
  117. package/dist/extensions.js +22 -34
  118. package/dist/forward-sigterm.d.ts +8 -0
  119. package/dist/forward-sigterm.js +18 -0
  120. package/dist/launcher-resolvers/index.d.ts +1 -0
  121. package/dist/launcher-resolvers/index.js +2 -1
  122. package/dist/launcher-resolvers/local-services.d.ts +57 -0
  123. package/dist/launcher-resolvers/local-services.js +7 -0
  124. package/dist/live-app.js +2 -1
  125. package/dist/local-services.d.ts +19 -0
  126. package/dist/local-services.js +37 -0
  127. package/dist/run-directory/gateways.d.ts +167 -0
  128. package/dist/run-directory/gateways.js +2 -0
  129. package/dist/run-directory/index.d.ts +8 -0
  130. package/dist/run-directory/index.js +13 -0
  131. package/dist/run-directory/plan.d.ts +35 -0
  132. package/dist/run-directory/plan.js +24 -0
  133. package/dist/run-directory/reader.d.ts +70 -0
  134. package/dist/run-directory/reader.js +51 -0
  135. package/dist/run-directory/recording.d.ts +92 -0
  136. package/dist/run-directory/recording.js +85 -0
  137. package/dist/{commands/exec → run-directory}/run-collector.d.ts +9 -8
  138. package/dist/{commands/exec → run-directory}/run-collector.js +8 -10
  139. package/dist/{core → run-directory}/run-directory.d.ts +3 -3
  140. package/dist/{core → run-directory}/run-directory.js +2 -2
  141. package/dist/{commands/exec → run-directory}/run-record.d.ts +29 -7
  142. package/dist/{commands/exec → run-directory}/run-record.js +79 -5
  143. package/dist/{commands/exec → run-directory}/timeline-facts.d.ts +4 -8
  144. package/dist/{commands/exec → run-directory}/timeline-facts.js +8 -24
  145. package/dist/runner/events.d.ts +6 -5
  146. package/dist/runner/index.d.ts +13 -17
  147. package/dist/runner/index.js +10 -14
  148. package/dist/runner/prepare.d.ts +28 -6
  149. package/dist/runner/prepare.js +15 -9
  150. package/dist/runner/recipe.d.ts +14 -0
  151. package/dist/runner/recipe.js +12 -0
  152. package/dist/runner/scope.d.ts +18 -11
  153. package/dist/runner/scope.js +12 -10
  154. package/dist/runner/session.d.ts +100 -0
  155. package/dist/runner/session.js +109 -0
  156. package/dist/runner/snapshot-save.d.ts +3 -2
  157. package/dist/runner/snapshot-save.js +6 -5
  158. package/dist/sdk/extension/ci.d.ts +2 -0
  159. package/dist/sdk/extension/ci.js +6 -0
  160. package/dist/sdk/extension/commands.d.ts +11 -13
  161. package/dist/sdk/extension/commands.js +5 -5
  162. package/dist/sdk/extension/index.d.ts +1 -0
  163. package/dist/sdk/extension/index.js +1 -0
  164. package/dist/sdk/extension/lifecycle.d.ts +4 -3
  165. package/dist/sdk/extension/progress.js +2 -2
  166. package/dist/sdk/extension/resource.js +1 -1
  167. package/dist/story/align.d.ts +1 -1
  168. package/dist/story/align.js +1 -1
  169. package/dist/story/command-line.d.ts +6 -16
  170. package/dist/story/command-line.js +11 -23
  171. package/dist/story/errors.d.ts +1 -1
  172. package/dist/story/errors.js +1 -1
  173. package/dist/story/host.d.ts +1 -1
  174. package/dist/story/host.js +2 -2
  175. package/dist/story/index.d.ts +2 -2
  176. package/dist/story/index.js +4 -3
  177. package/dist/story/launch.d.ts +70 -0
  178. package/dist/story/launch.js +77 -0
  179. package/dist/story/report.d.ts +2 -2
  180. package/dist/story/report.js +3 -4
  181. package/dist/story/settle.d.ts +7 -7
  182. package/dist/story/settle.js +5 -5
  183. package/dist/story/start.d.ts +2 -2
  184. package/dist/vendor/testserver-sdk/container/container.d.ts +11 -6
  185. package/dist/vendor/testserver-sdk/container/container.js +38 -16
  186. package/dist/vendor/testserver-sdk/testserver/failure.d.ts +4 -3
  187. package/dist/vendor/testserver-sdk/testserver/failure.js +4 -3
  188. package/package.json +1 -1
  189. package/skills/overview.md +3 -0
  190. package/skills/read-run-output.md +2 -2
  191. package/dist/chunks/chunk-H2VCSNVU.js +0 -351
  192. package/dist/chunks/chunk-J6ZNYUDV.js +0 -21
  193. package/dist/core/mint.d.ts +0 -10
  194. package/dist/core/mint.js +0 -14
  195. package/dist/story/mode.d.ts +0 -17
  196. package/dist/story/mode.js +0 -21
  197. /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
  198. /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { type Refusable } from "@vercel/clinkr";
2
2
  import { z } from "zod";
3
- import { type Credential, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice, credentialSourceFor } from "../credential/index.ts";
3
+ import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice } from "../credential/index.ts";
4
4
  import { type credentialErrors } from "./credential-settle.ts";
5
5
  /**
6
6
  * The errors a credential source's `obtain()` refuses with. A command that obtains a credential spreads them into its
@@ -108,7 +108,10 @@ export interface CredentialTarget {
108
108
  readonly scope: GivenSetting | undefined;
109
109
  readonly project: GivenSetting | undefined;
110
110
  }
111
- /** How a command shows a credential source's steps: one line before each mint or token request. */
111
+ /**
112
+ * How a command shows a credential source's steps: one line before each mint or token request, from the source's
113
+ * `minting` and `requesting-token` events; its `minted` event shows nothing.
114
+ */
112
115
  export interface CredentialReport {
113
116
  readonly progress?: ((line: string) => Promise<void>) | undefined;
114
117
  }
@@ -127,5 +130,5 @@ export interface CredentialResolver {
127
130
  }, ReturnType<typeof credentialErrors.missingTarget>>;
128
131
  }
129
132
  /** The credential launcher resolver over `gateways`. */
130
- export declare function credentialResolver(gateways: Parameters<typeof credentialSourceFor>[1]): CredentialResolver;
133
+ export declare function credentialResolver(gateways: CredentialContext): CredentialResolver;
131
134
  export {};
@@ -46,12 +46,13 @@ export function credentialResolver(gateways) {
46
46
  if (!chosen.ok)
47
47
  return chosen;
48
48
  const { progress } = report;
49
+ // The source's events as the command's lines: one before the mint and one before each token request.
49
50
  const source = credentialSourceFor(chosen.credential, gateways, {
50
- onMint: async (mintTarget) => {
51
- await progress?.(`Minting a credential for ${mintTargetText(mintTarget)}…`);
52
- },
53
- onRequest: async () => {
54
- await progress?.(REQUESTING_TOKEN_LINE);
51
+ emit: async (event) => {
52
+ if (event.kind === "minting")
53
+ await progress?.(`Minting a credential for ${mintTargetText(event.target)}…`);
54
+ else if (event.kind === "requesting-token")
55
+ await progress?.(REQUESTING_TOKEN_LINE);
55
56
  },
56
57
  });
57
58
  return {
package/dist/context.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { type ConfigGateway, type ConfigResolver, type CredentialResolver } from "./config/index.ts";
2
2
  import { type CredentialGateway, type GitHubActionsTokenGateway } from "./credential/index.ts";
3
+ import type { TerminalService, VitestService } from "./launcher-resolvers/index.ts";
3
4
  import type { Presentation } from "./presentation.ts";
4
5
  import type { RESOURCES, StormWorlds } from "./extensions.ts";
5
- import { type CommandGateway, type JobSummaryGateway, type ProgressTerminal, type RunDirectoryGateway } from "./core/index.ts";
6
+ import { type CommandGateway, type JobSummaryGateway, type ProgressTerminal, type TerminalCommandGateway } from "./core/index.ts";
7
+ import { type RunDirectoryGateway } from "./run-directory/index.ts";
6
8
  import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotCacheGateway, type RunnerTerminal } from "./runner/index.ts";
7
9
  import { type Clock, type Timer } from "./time/index.ts";
8
10
  import { type VitestListGateway } from "./vitest/plan.ts";
@@ -15,6 +17,8 @@ export interface StormContext {
15
17
  /** GitHub Actions' OIDC token issuer, for `--credential github-actions`. */
16
18
  readonly githubActionsTokens: GitHubActionsTokenGateway;
17
19
  readonly commands: CommandGateway;
20
+ /** Commands run on this machine in the launcher's terminal, for the terminal local service. */
21
+ readonly terminalCommands: TerminalCommandGateway;
18
22
  readonly config: ConfigGateway;
19
23
  /** The local Git checkout the runner uploads from. */
20
24
  readonly checkout: CheckoutGateway;
@@ -48,7 +52,7 @@ export interface StormExit {
48
52
  * which their mount projects from this one, and the mounts are checked against it (`EXTENSION_COMMANDS`,
49
53
  * `src/extension-commands.ts`).
50
54
  */
51
- export interface StormApp extends LauncherResolvers {
55
+ export interface StormApp extends LauncherResolvers, LocalServices {
52
56
  readonly context: StormContext;
53
57
  /** Each definition's world, by its name, built once for the command: what a run hands each resource instance. */
54
58
  readonly worlds: StormWorlds;
@@ -86,16 +90,30 @@ export interface LauncherResolvers {
86
90
  * definition.
87
91
  */
88
92
  export declare function launcherResolvers(app: Pick<StormApp, "context" | "cwd" | "resourceDefinitions">): LauncherResolvers;
93
+ /**
94
+ * The local services, which every command gets in its app. An extension's own commands reach this machine only through
95
+ * them, since they never see the Context; `storm vitest` finds `vitest` for a run on this machine through the vitest
96
+ * service too, and `exec`'s and `vitest`'s runs reach the Context's gateways directly.
97
+ */
98
+ export interface LocalServices {
99
+ /** Finds `vitest` on this machine, as `storm vitest` does there. */
100
+ readonly vitest: VitestService;
101
+ /** Runs a command on this machine in the launcher's terminal. */
102
+ readonly terminal: TerminalService;
103
+ }
104
+ /** The local services over an app's context. */
105
+ export declare function localServices(app: Pick<StormApp, "context">): LocalServices;
89
106
  /**
90
107
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
91
108
  * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; a run's command spawned as a
92
- * real process; `storm.config.ts` imported by Node; for the runner, git and tar on the local checkout, the
93
- * runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
94
- * only when the runner first calls it) and this process's stdout and stderr; the run directories beside the runner
95
- * snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
96
- * `vitest` found in `node_modules/.bin` and spawned as a real process; and the system timer and clock. When `env` names
97
- * no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
98
- * empty cache, and so does opening a run directory, which a run goes on without.
109
+ * real process, and a command in the launcher's terminal as another, sharing this process's stdio; `storm.config.ts`
110
+ * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
111
+ * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
112
+ * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
113
+ * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; `vitest` found in `node_modules/.bin` and
114
+ * spawned as a real process; and the system timer and clock. When `env` names no place for the state directory, every
115
+ * runner snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
116
+ * directory, which a run goes on without.
99
117
  */
100
118
  export declare function liveContext(options: {
101
119
  readonly env: Readonly<Record<string, string | undefined>>;
package/dist/context.js CHANGED
@@ -2,7 +2,9 @@
2
2
  // (`liveWorlds`, through the registry), which the app holds beside the context, so this file names no resource.
3
3
  import { configResolver, credentialResolver, liveConfigGateway, } from "./config/index.js";
4
4
  import { liveCredentialGateway, liveGitHubActionsTokenGateway, } from "./credential/index.js";
5
- import { liveCommandGateway, liveJobSummaryGateway, liveProgressTerminal, liveRunDirectoryGateway, resolveStateDirectory, RUNS_SUBPATH, stateDirectoryPattern, unavailableRunDirectoryGateway, } from "./core/index.js";
5
+ import { terminalService, vitestService } from "./local-services.js";
6
+ import { liveCommandGateway, liveJobSummaryGateway, liveProgressTerminal, liveTerminalCommandGateway, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
7
+ import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
6
8
  import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotCacheGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotCacheGateway, } from "./runner/index.js";
7
9
  import { systemClock, systemTimer } from "./time/index.js";
8
10
  import { liveVitestListGateway } from "./vitest/plan.js";
@@ -16,16 +18,24 @@ export function launcherResolvers(app) {
16
18
  credentials: credentialResolver(app.context),
17
19
  };
18
20
  }
21
+ /** The local services over an app's context. */
22
+ export function localServices(app) {
23
+ return {
24
+ vitest: vitestService(app.context),
25
+ terminal: terminalService(app.context),
26
+ };
27
+ }
19
28
  /**
20
29
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
21
30
  * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; a run's command spawned as a
22
- * real process; `storm.config.ts` imported by Node; for the runner, git and tar on the local checkout, the
23
- * runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
24
- * only when the runner first calls it) and this process's stdout and stderr; the run directories beside the runner
25
- * snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
26
- * `vitest` found in `node_modules/.bin` and spawned as a real process; and the system timer and clock. When `env` names
27
- * no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
28
- * empty cache, and so does opening a run directory, which a run goes on without.
31
+ * real process, and a command in the launcher's terminal as another, sharing this process's stdio; `storm.config.ts`
32
+ * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
33
+ * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
34
+ * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
35
+ * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; `vitest` found in `node_modules/.bin` and
36
+ * spawned as a real process; and the system timer and clock. When `env` names no place for the state directory, every
37
+ * runner snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
38
+ * directory, which a run goes on without.
29
39
  */
30
40
  export function liveContext(options) {
31
41
  const snapshots = resolveStateDirectory(options.env, RUNNER_SNAPSHOTS_SUBPATH);
@@ -34,6 +44,7 @@ export function liveContext(options) {
34
44
  credentials: liveCredentialGateway(),
35
45
  githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 10_000 }),
36
46
  commands: liveCommandGateway(),
47
+ terminalCommands: liveTerminalCommandGateway(),
37
48
  config: liveConfigGateway(),
38
49
  checkout: liveCheckoutGateway(),
39
50
  runnerSnapshots: snapshots.ok
@@ -1,4 +1,5 @@
1
- import type { Refusal, ResourceDefinition } from "../sdk/extension/index.ts";
1
+ import type { Refusal } from "../sdk/extension/index.ts";
2
+ import type { DefinitionLookup } from "./definition-lookup.ts";
2
3
  import type { ResourceInputs, ResourceOptions, ResourceRequests, ResourceSkip, ResourceWorlds } from "./resource.ts";
3
4
  /**
4
5
  * How every resource's `beforeRun` answered, in order: `ok`, with each used instance's part of the run request, each
@@ -31,7 +32,7 @@ export interface ResourceLifecycles {
31
32
  beforeRun(inputs: ResourceInputs): Promise<ResourcesBeforeRun>;
32
33
  }
33
34
  /**
34
- * Every one of `resources`' lifecycles, each over its own world from `worlds`, by its definition's name, for the run's
35
- * resources in their order.
35
+ * Every one of `lookup`'s definitions' lifecycles, each over its own world from `worlds`, by its definition's name, for
36
+ * the run's resources in their order.
36
37
  */
37
- export declare function bindLifecycles(resources: readonly ResourceDefinition[], worlds: ResourceWorlds): ResourceLifecycles;
38
+ export declare function bindLifecycles(lookup: DefinitionLookup, worlds: ResourceWorlds): ResourceLifecycles;
@@ -1,13 +1,13 @@
1
1
  // How the launcher calls the lifecycle of each of the run's resources before the run starts: each definition's
2
2
  // lifecycle, over its own world. `bindLifecycles` builds each definition's lifecycle once, then hands each resource of
3
- // the run to its definition's, with only that resource's options and sources.
4
- import { resourceRegistry } from "./resource-registry.js";
3
+ // the run to its definition's, with only that resource's options and sources. The registry's `lifecycles(worlds)` calls
4
+ // it (`resourceRegistry`, `resource-registry.ts`).
5
5
  /**
6
- * Every one of `resources`' lifecycles, each over its own world from `worlds`, by its definition's name, for the run's
7
- * resources in their order.
6
+ * Every one of `lookup`'s definitions' lifecycles, each over its own world from `worlds`, by its definition's name, for
7
+ * the run's resources in their order.
8
8
  */
9
- export function bindLifecycles(resources, worlds) {
10
- const { named } = resourceRegistry(resources);
9
+ export function bindLifecycles(lookup, worlds) {
10
+ const { definitions: resources, named } = lookup;
11
11
  // Each definition's lifecycle, over its own world, built once.
12
12
  const lifecycles = new Map(resources.map((resource) => [resource, resource.lifecycle(worlds[resource.name])]));
13
13
  const lifecycleOf = (definition, key) => {
@@ -0,0 +1,22 @@
1
+ import type { ResourceDefinition } from "../sdk/extension/index.ts";
2
+ /** One map's resource instance with its definition. */
3
+ export interface InstanceOf<R> {
4
+ readonly key: string;
5
+ readonly record: R;
6
+ readonly resource: ResourceDefinition;
7
+ }
8
+ /** Resource definitions, in registry order, looked up by name. */
9
+ export interface DefinitionLookup {
10
+ /** The definitions, in registry order. */
11
+ readonly definitions: readonly ResourceDefinition[];
12
+ /** The resource definition named `definition`, the definition of resource instance `key`; throws when none is. */
13
+ readonly named: (definition: string, key: string) => ResourceDefinition;
14
+ /** Each of `map`'s resource instances with its definition, in registry order, then the map's order. */
15
+ readonly inRegistryOrder: <R extends {
16
+ readonly definition: string;
17
+ }>(map: {
18
+ readonly [key: string]: R;
19
+ }) => readonly InstanceOf<R>[];
20
+ }
21
+ /** `definitions`, in registry order, looked up by each one's name. */
22
+ export declare function definitionLookup(definitions: readonly ResourceDefinition[]): DefinitionLookup;
@@ -0,0 +1,34 @@
1
+ // The registry's lookup of a resource instance's definition by its name, with the one registry order, which every loop
2
+ // over the instances shares: registry order, then the map's order. The registry (`resourceRegistry`,
3
+ // `resource-registry.ts`) builds it once and hands it to what it builds; it stays the core's, since `index.ts` exports
4
+ // none of this file. The core holds each definition as `defineResource` returned it, seen through the bare
5
+ // `ResourceDefinition`, whose types are `unknown` wherever the resource has types of its own. `defineResource` turns
6
+ // the typed object into that view with one cast, which rests on the core's routing: the core hands each world, thing
7
+ // taken, event, lane state and record back only to the definition or resource instance that produced it, by its
8
+ // definition's name or its resource key, which `test/unit/core/resource-events.test.ts` holds. It names no resource.
9
+ /** `definitions`, in registry order, looked up by each one's name. */
10
+ export function definitionLookup(definitions) {
11
+ // Built once; the first definition of a name wins, as in registry order.
12
+ const byName = new Map();
13
+ for (const definition of definitions)
14
+ if (!byName.has(definition.name))
15
+ byName.set(definition.name, definition);
16
+ const named = (definition, key) => {
17
+ const resource = byName.get(definition);
18
+ if (resource === undefined)
19
+ throw new Error(`${key}'s definition, ${definition}, isn't in the registry`);
20
+ return resource;
21
+ };
22
+ return {
23
+ definitions,
24
+ named,
25
+ inRegistryOrder: (map) => {
26
+ const entries = Object.entries(map).map(([key, record]) => ({
27
+ key,
28
+ record,
29
+ resource: named(record.definition, key),
30
+ }));
31
+ return definitions.flatMap((resource) => entries.filter((entry) => entry.resource === resource));
32
+ },
33
+ };
34
+ }
@@ -1,4 +1,4 @@
1
- import type { MintTarget } from "../credential/index.ts";
1
+ import type { CredentialEvent } from "../credential/index.ts";
2
2
  import type { LaneOutcome } from "../sdk/extension/index.ts";
3
3
  import type { RunnerEvent, RunnerSandboxPlan, SnapshotCacheNote } from "../runner/index.ts";
4
4
  import type { Clock } from "../time/index.ts";
@@ -16,9 +16,10 @@ import type { RanCommand } from "./timing.ts";
16
16
  * the run goes on without instance `resource`, of `definition`, and `notice` says why.
17
17
  * - `runner-prepared`: what the runner's local checks found: the base, a full SHA, and the ref it is HEAD's
18
18
  * merge-base with; the untracked nested Git repositories the upload leaves out; what the cache read noticed; and
19
- * whether `--save-snapshot` saves nothing because HEAD is detached (`saveSkipped`).
20
- * - `minting`, `minted` and `requesting-token`: a credential's events (`CredentialEvent`): the run's one mint, which a
21
- * run makes for its runner sandbox, or for a resource when it has none, and a GitHub Actions OIDC token request.
19
+ * whether a run that saves always saves nothing because HEAD is detached (`saveSkipped`).
20
+ * - `minting`, `minted` and `requesting-token`: the events of the run's credential source (`CredentialEvent`, the
21
+ * `credential` module's): the run's one mint, which a run makes for its runner sandbox, or for a resource when it has
22
+ * none, and a GitHub Actions OIDC token request.
22
23
  * - `lanes-started`: acquiring the resources and readying the runner sandbox started together, after the mint;
23
24
  * without a resource, readying the runner sandbox started alone. A run without a runner lane reports none.
24
25
  * - `lane-started`: acquiring a resource instance with a lane started: its lane's name
@@ -103,21 +104,6 @@ export type RunEvent = {
103
104
  readonly kind: "runner";
104
105
  readonly event: RunnerEvent;
105
106
  } | ResourceEvent | ResourceNoticeEvent | ResourceWarningEvent;
106
- /** A credential's events: the run's one mint, and a GitHub Actions OIDC token request. */
107
- export type CredentialEvent = {
108
- readonly kind: "minting";
109
- readonly target: MintTarget;
110
- } | {
111
- readonly kind: "minted";
112
- readonly target: MintTarget;
113
- readonly ok: boolean;
114
- } | {
115
- readonly kind: "requesting-token";
116
- };
117
- /** Hears a credential's events. */
118
- export interface CredentialProgress {
119
- emit(event: CredentialEvent): Promise<void>;
120
- }
121
107
  /** Hears a run's events as they happen. */
122
108
  export interface RunProgress {
123
109
  emit(event: RunEvent): Promise<void>;
@@ -1,4 +1,3 @@
1
- import type { RunnerStepPhase } from "../runner/index.ts";
2
1
  /** One chunk of a spawned command's output, as it arrives; a chunk may hold part of a line, or several. */
3
2
  export interface CommandOutputChunk {
4
3
  readonly stream: "stdout" | "stderr";
@@ -42,171 +41,27 @@ export type CommandOutcome = {
42
41
  export interface CommandGateway {
43
42
  run(request: CommandRequest): Promise<CommandOutcome>;
44
43
  }
45
- /** What a run directory operation couldn't do: the path and what the OS said, or why there is no place for it. */
46
- export interface RunDirectoryFailure {
47
- readonly path: string;
48
- readonly message: string;
49
- }
50
- /** The output of a step in a run directory: a snapshot build's steps, applying the changes, the install, the build. */
51
- export type RunDirectoryStep = RunnerStepPhase;
52
- /** A run log: a step's log, or the command log (`command`), the command's output, in a run directory. */
53
- export type RunLog = RunDirectoryStep | "command";
54
44
  /**
55
- * One run's run directory, open for writing: `run.json` (what the run was, and once it ended how), `events.jsonl` (the
56
- * run's events, one JSON object a line), a log of each step's output (`snapshot.log`, `apply.log`, `install.log`,
57
- * `build.log`), `command.log` (the command's stdout and stderr in arrival order, wherever it runs),
58
- * `.test-events.jsonl` (the test events the command stages here, unredacted, while it runs, which `close` removes),
59
- * `.tests.jsonl.partial` (the run's redacted test events as storm gets them), `tests.jsonl` (that file, published once
60
- * the run is over) and `timeline.json`. While it is open, `active.json` marks it active, so no run prunes it. Writes
61
- * never throw; `run.json`, `tests.jsonl` and `timeline.json` each appear whole, one after another in the order asked,
62
- * so a reader sees a file whole or not at all; the first write that fails stops the rest, and `close` answers it.
45
+ * One command run in the launcher's terminal: its argument list, its whole environment, its working directory, and
46
+ * when to stop it.
63
47
  */
64
- export interface RunDirectory {
65
- readonly path: string;
66
- /** Its run id, the directory's name. */
67
- readonly id: string;
68
- /** Replaces `run.json` whole. */
69
- writeRun(text: string): void;
70
- /** Appends one line to `events.jsonl`. */
71
- appendEvent(line: string): void;
72
- /** Appends one line of a step's output to its log. */
73
- appendStepOutput(step: RunDirectoryStep, line: string): void;
74
- /** Appends the command's output, as it came. */
75
- appendCommandOutput(text: string): void;
76
- /** Appends one redacted test event line to the private file that becomes `tests.jsonl`. */
77
- appendTestEvent(line: string): void;
78
- /**
79
- * Publishes the redacted test events appended so far as `tests.jsonl`, after any earlier replacement. A run that
80
- * appended none publishes an empty file. Appends after this are dropped.
81
- */
82
- publishTestEvents(): void;
83
- /** Writes `timeline.json` whole, after any earlier replacement. */
84
- writeTimeline(text: string): void;
85
- /**
86
- * Streams the non-empty lines the command staged in `.test-events.jsonl`, the test events file its run payload names,
87
- * to `onLine`, in order. A file that doesn't exist reads as empty; any other read failure is returned after the lines
88
- * read before it.
89
- */
90
- readTestEvents(onLine: (line: string) => void): Promise<StagedTestEventsRead>;
91
- /**
92
- * Waits for every write so far, ends writing, removes the test events the command staged whatever failed before, and
93
- * removes the active marker, so the run directory is completed; answers the first write that failed, or else a staged
94
- * test events file or a marker it couldn't remove, if any.
95
- */
96
- close(): Promise<RunDirectoryFailure | undefined>;
97
- }
98
- /** How reading the command's staged test events went: read whole, or stopped by a failure. */
99
- export type StagedTestEventsRead = {
100
- readonly ok: true;
101
- } | {
102
- readonly ok: false;
103
- readonly failure: RunDirectoryFailure;
104
- };
105
- /** How opening a run directory went: the directory, and what pruning older ones couldn't remove; or a failure. */
106
- export type OpenRunDirectoryResult = {
107
- readonly ok: true;
108
- readonly directory: RunDirectory;
109
- readonly pruneFailures: readonly RunDirectoryFailure[];
110
- } | {
111
- readonly ok: false;
112
- readonly failure: RunDirectoryFailure;
113
- };
114
- /** A run directory as a listing finds it: its run id, path, whether it is active, and its `run.json`, if readable. */
115
- export interface ListedRunDirectory {
116
- readonly id: string;
117
- readonly path: string;
118
- readonly active: boolean;
119
- /** `run.json` as it reads; undefined when the run directory has none or it can't be read. */
120
- readonly run: string | undefined;
121
- }
122
- /** How listing the run directories went: each one, newest first; or a failure. */
123
- export type ListRunDirectoriesResult = {
124
- readonly ok: true;
125
- readonly runs: readonly ListedRunDirectory[];
126
- } | {
127
- readonly ok: false;
128
- readonly failure: RunDirectoryFailure;
129
- };
130
- /**
131
- * A run directory as reading it finds it: its listing, its test events and timeline as they read, and the run logs it
132
- * holds.
133
- */
134
- export interface PastRunDirectory extends ListedRunDirectory {
135
- /**
136
- * The lines of `tests.jsonl`, the run's redacted test events; undefined until the run has written it, once it was
137
- * over. The test events the command stages while it runs are never read back.
138
- */
139
- readonly tests: readonly string[] | undefined;
140
- /** `timeline.json` as it reads; undefined when there is none. */
141
- readonly timeline: string | undefined;
142
- /** The run logs it holds, in `RUN_LOGS`' order. */
143
- readonly logs: readonly RunLog[];
48
+ export interface TerminalCommandRequest {
49
+ /** The command, run as given, with no shell. `argv[0]` is the executable. */
50
+ readonly argv: readonly string[];
51
+ /** The command's whole environment; nothing else is inherited. */
52
+ readonly env: Readonly<Record<string, string>>;
53
+ /** The directory it runs in, an absolute path. */
54
+ readonly cwd: string;
55
+ /** Aborting it sends the command SIGTERM. The command may still take its time to exit. */
56
+ readonly terminate: AbortSignal;
144
57
  }
145
58
  /**
146
- * How reading a run log went: `found`, its `text` as it is now, less a UTF-8 character still being written at its end;
147
- * `not-found` when the run directory or the log doesn't exist; or a failure.
148
- */
149
- export type ReadRunLogResult = {
150
- readonly kind: "found";
151
- readonly path: string;
152
- readonly text: string;
153
- } | {
154
- readonly kind: "not-found";
155
- } | {
156
- readonly kind: "failed";
157
- readonly failure: RunDirectoryFailure;
158
- };
159
- /** How reading one run directory went: found, not found, or a failure. */
160
- export type ReadRunDirectoryResult = {
161
- readonly kind: "found";
162
- readonly directory: PastRunDirectory;
163
- } | {
164
- readonly kind: "not-found";
165
- } | {
166
- readonly kind: "failed";
167
- readonly failure: RunDirectoryFailure;
168
- };
169
- /**
170
- * The run directories: `${XDG_STATE_HOME:-~/.local/state}/storm/runs/<run id>/`, one for each recent run. A
171
- * run id is the run's start in UTC, `YYYYMMDDTHHMMSS`, a dash and a short random suffix, so runs started in the
172
- * same second from different worktrees don't collide.
173
- *
174
- * A run directory is active from when it is opened until it is closed, and completed after. One whose run ended
175
- * without closing it, its holder gone, is completed too: on the same host, once its process no longer runs; held on
176
- * another host, or with a marker that can't be read, 24 hours after.
59
+ * Runs a command in the launcher's terminal: it shares storm's stdin, stdout and stderr, so its output reaches the
60
+ * terminal as it prints it, with its colors and its live updates, and storm sees none of it. It waits for the command.
61
+ * It never rejects: a command that can't start is `spawn-failed`.
177
62
  */
178
- export interface RunDirectoryGateway {
179
- /**
180
- * Makes a run directory for a run started at `startedAt`, active, holding `run` as its `run.json`, then removes
181
- * every completed run directory but the newest `keep`, and removes the private test event files a run that ended without
182
- * closing its run directory left in each completed one it keeps. Active run directories, this one among them, all
183
- * stay as they are.
184
- */
185
- open(request: {
186
- readonly startedAt: Date;
187
- readonly keep: number;
188
- readonly run: string;
189
- }): Promise<OpenRunDirectoryResult>;
190
- /**
191
- * Every run directory, newest first, with whether it is active at `now` and its `run.json`. A run directory whose
192
- * `run.json` can't be read is listed without it. No run directories yet is an empty list.
193
- */
194
- list(request: {
195
- readonly now: Date;
196
- }): Promise<ListRunDirectoriesResult>;
197
- /**
198
- * Run directory `id`, with whether it is active at `now`, its `run.json`, test events and timeline, and the run logs
199
- * it holds.
200
- */
201
- read(request: {
202
- readonly id: string;
203
- readonly now: Date;
204
- }): Promise<ReadRunDirectoryResult>;
205
- /** Run log `log` of run directory `id`, as it is now. */
206
- readLog(request: {
207
- readonly id: string;
208
- readonly log: RunLog;
209
- }): Promise<ReadRunLogResult>;
63
+ export interface TerminalCommandGateway {
64
+ run(request: TerminalCommandRequest): Promise<CommandOutcome>;
210
65
  }
211
66
  /**
212
67
  * The terminal a run's live view shows on, a DI seam: a live region pinned at the bottom of stderr, redrawn in
@@ -240,8 +95,13 @@ export type JobSummaryResult = {
240
95
  readonly kind: "none";
241
96
  } | {
242
97
  readonly kind: "failed";
243
- readonly failure: RunDirectoryFailure;
98
+ readonly failure: JobSummaryFailure;
244
99
  };
100
+ /** What appending to the job summary couldn't do: the path and what the OS said. */
101
+ export interface JobSummaryFailure {
102
+ readonly path: string;
103
+ readonly message: string;
104
+ }
245
105
  /** The GitHub Actions job summary a run appends its Markdown summary to. */
246
106
  export interface JobSummaryGateway {
247
107
  appendJobSummary(markdown: string): Promise<JobSummaryResult>;
@@ -1,20 +1,19 @@
1
1
  export { warningRows, warningTally } from "./reports.ts";
2
- export { bindLifecycles, type ResourceLifecycles, type ResourcesBeforeRun } from "./before-run.ts";
3
- export { cleanupInstanceSchema, type InstanceFacts, instanceSchema, type InstanceWarnings, resourceRegistry, } from "./resource-registry.ts";
4
- export { type ResourceReports, resourceReports } from "./resource-reports.ts";
2
+ export type { ResourceLifecycles, ResourcesBeforeRun } from "./before-run.ts";
3
+ export { type ResourceRegistry, resourceRegistry } from "./resource-registry.ts";
4
+ export { cleanupInstanceSchema, type InstanceFacts, instanceSchema, type InstanceWarnings, type ResourceReports, } from "./resource-reports.ts";
5
5
  export { resourcesOf } from "./resources-of.ts";
6
- export { launcherSupplies, worldsOf } from "./launcher-supplies.ts";
7
- export { type LaneKind, type PresentedInstance, type PresentedLane, type ResourcePresentations, resourcePresentations, } from "./presentations.ts";
8
- export { type CredentialEvent, type CredentialProgress, observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
9
- export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, JobSummaryGateway, JobSummaryResult, ListedRunDirectory, ListRunDirectoriesResult, OpenRunDirectoryResult, PastRunDirectory, ProgressTerminal, ReadRunDirectoryResult, ReadRunLogResult, RunDirectory, RunDirectoryFailure, RunDirectoryGateway, RunDirectoryStep, RunLog, StagedTestEventsRead, } from "./gateways.ts";
6
+ export { launcherSupplies } from "./launcher-supplies.ts";
7
+ export type { LaneKind, PresentedInstance, PresentedLane, ResourcePresentations } from "./presentations.ts";
8
+ export { observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
9
+ export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, JobSummaryFailure, JobSummaryGateway, JobSummaryResult, ProgressTerminal, TerminalCommandGateway, TerminalCommandRequest, } from "./gateways.ts";
10
10
  export { liveCommandGateway } from "./live/command-gateway.ts";
11
+ export { liveTerminalCommandGateway } from "./live/terminal-command-gateway.ts";
11
12
  export { liveJobSummaryGateway } from "./live/job-summary-gateway.ts";
12
13
  export { liveProgressTerminal } from "./live/progress-terminal.ts";
13
- export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.ts";
14
14
  export type { CoreLane, RunInstance, ResourceAcquired, ResourceCleanupRecords, ResourceEvent, ResourceNoticeEvent, ResourceWarningEvent, ResourceOptions, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceInputs, ResourceRequest, ResourceRequests, ResourceSkip, ResourceWorlds, RunLane, } from "./resource.ts";
15
- export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.ts";
16
15
  export { executeRun, type UnsandboxedRunRequest, type RanRun, type RanRunner, type SandboxedRunRequest, type RunCleanup, type RunContext, type RunnerCleanupFacts, type RunControl, type RunOutcome, type RunRequest, type RunRunnerFailure, type RunRunnerRequest, type RunStopped, } from "./run.ts";
17
16
  export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.ts";
18
17
  export { commandExitStatus, megabytesText, type RanCommand, secondsOf, secondsText } from "./timing.ts";
19
- export { cleanupProblems, commandPassed, type CleanupState, type CommandState, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, type RunnerSnapshotState, type RunnerState, type RunnerStepName, type RunnerStepState, type RunState, type TestsState, type TestWorkerState, } from "./run-state.ts";
20
- export { sameRow, timeline, type Timeline, type TimelineOutcome, type TimelineRow, type TimelineRowName, type TimelineRowRef, type TimelineSpan, type TimelineStep, type TimelineStepName, } from "./timeline.ts";
18
+ export { cleanupProblems, commandPassed, type CleanupState, type CommandState, EMPTY_RUN_STATE, RUNNER_STEPS, type RunnerSnapshotState, type RunnerState, type RunnerStepName, type RunnerStepState, type RunState, type TestsState, type TestWorkerState, } from "./run-state.ts";
19
+ export { sameRow, type Timeline, type TimelineOutcome, type TimelineRow, type TimelineRowName, type TimelineRowRef, type TimelineSpan, type TimelineStep, type TimelineStepName, } from "./timeline.ts";
@@ -1,22 +1,20 @@
1
- // The `core` module's caller-facing interface: what the composition layer runs a command with, over the registry's
2
- // resource definitions, with the types of its outcome and progress, and the words every resource's warnings show in.
1
+ // The `core` module's caller-facing interface: the registry the composition layer builds from its resource definitions
2
+ // (`resourceRegistry`), what it runs a command with over that registry, with the types of its outcome and progress,
3
+ // and the words every resource's warnings show in.
3
4
  // The resource contract each extension folder implements, its definition, lifecycle and progress, is the extension
4
5
  // API's, which a caller imports from `sdk/extension/index.ts`. It names no resource.
5
6
  export { warningRows, warningTally } from "./reports.js";
6
- export { bindLifecycles } from "./before-run.js";
7
- export { cleanupInstanceSchema, instanceSchema, resourceRegistry, } from "./resource-registry.js";
8
- export { resourceReports } from "./resource-reports.js";
7
+ export { resourceRegistry } from "./resource-registry.js";
8
+ export { cleanupInstanceSchema, instanceSchema, } from "./resource-reports.js";
9
9
  export { resourcesOf } from "./resources-of.js";
10
- export { launcherSupplies, worldsOf } from "./launcher-supplies.js";
11
- export { resourcePresentations, } from "./presentations.js";
10
+ export { launcherSupplies } from "./launcher-supplies.js";
12
11
  export { observeAll, silentProgress, timedProgress, } from "./events.js";
13
12
  export { liveCommandGateway } from "./live/command-gateway.js";
13
+ export { liveTerminalCommandGateway } from "./live/terminal-command-gateway.js";
14
14
  export { liveJobSummaryGateway } from "./live/job-summary-gateway.js";
15
15
  export { liveProgressTerminal } from "./live/progress-terminal.js";
16
- export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.js";
17
- export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.js";
18
16
  export { executeRun, } from "./run.js";
19
17
  export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
20
18
  export { commandExitStatus, megabytesText, secondsOf, secondsText } from "./timing.js";
21
- export { cleanupProblems, commandPassed, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, } from "./run-state.js";
22
- export { sameRow, timeline, } from "./timeline.js";
19
+ export { cleanupProblems, commandPassed, EMPTY_RUN_STATE, RUNNER_STEPS, } from "./run-state.js";
20
+ export { sameRow, } from "./timeline.js";
@@ -1,6 +1,6 @@
1
1
  // What the launcher hands a resource definition to build its world from (`launcherSupplies`, of the extension
2
- // API's `LauncherSupplies`), and every definition's world, built from that (`worldsOf`). A resource's
3
- // `defineResource` names how it builds its world (`world`). It names no resource.
2
+ // API's `LauncherSupplies`), and every definition's world, built from that (`worldsOf`, which the registry's `worlds`
3
+ // calls). A resource's `defineResource` names how it builds its world (`world`). It names no resource.
4
4
  import { systemClock, systemTimer } from "../time/index.js";
5
5
  import { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
6
6
  /**
@@ -0,0 +1,8 @@
1
+ import type { TerminalCommandGateway } from "../gateways.ts";
2
+ /**
3
+ * The live terminal command gateway: spawns `argv[0]` with the rest of `argv` in `cwd`, no shell, the given
4
+ * environment only, and storm's own stdin, stdout and stderr. The command runs in storm's process group, so Ctrl+C and
5
+ * a closed terminal reach it directly. Aborting `terminate` sends SIGTERM. It settles once the process has exited. An
6
+ * `error` before the process spawns (ENOENT, EACCES, a missing `cwd`) is `spawn-failed`.
7
+ */
8
+ export declare function liveTerminalCommandGateway(): TerminalCommandGateway;