@cnc-tools/storm 0.15.0 → 0.16.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 (109) hide show
  1. package/dist/bin/storm.js +1 -1
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-QUHY6FGN.js → chunk-2MAD5NKK.js} +1 -1
  4. package/dist/chunks/{chunk-XEVHP5ZW.js → chunk-3L52KNQA.js} +1 -1
  5. package/dist/chunks/{chunk-E4PJNZVG.js → chunk-7EENF73W.js} +12 -13
  6. package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-CK2GZEPK.js} +1 -1
  7. package/dist/chunks/{chunk-L36GBUBB.js → chunk-DC2CDHNK.js} +398 -158
  8. package/dist/chunks/{chunk-PN5ULTTH.js → chunk-DWEAHX4T.js} +1 -1
  9. package/dist/chunks/{chunk-5GBMR4HM.js → chunk-FCQUJDA4.js} +4 -7
  10. package/dist/chunks/{chunk-YV7GE6EV.js → chunk-FOZWA52V.js} +1 -1
  11. package/dist/chunks/{chunk-OX7X4B2L.js → chunk-G3PHMXH5.js} +1 -1
  12. package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-HVNK3I45.js} +1 -1
  13. package/dist/chunks/{chunk-QVS7HRU7.js → chunk-OIY3DMF2.js} +2 -2
  14. package/dist/chunks/{chunk-SZEURWRS.js → chunk-P357TZAY.js} +2 -2
  15. package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-V4IKA3WI.js} +153 -139
  16. package/dist/chunks/{chunk-RAQEXKL6.js → chunk-Z5PBVG3Y.js} +26 -18
  17. package/dist/chunks/{live-app-PI3BAN6Y.js → live-app-WECQOQ4C.js} +4 -4
  18. package/dist/commands/exec/across-sandboxes-outcomes.js +2 -1
  19. package/dist/commands/exec/command.d.ts +8 -2
  20. package/dist/commands/exec/command.js +11 -11
  21. package/dist/commands/exec/metadata.js +1 -1
  22. package/dist/commands/exec/outcomes.d.ts +4 -1
  23. package/dist/commands/exec/outcomes.js +2 -2
  24. package/dist/commands/exec/plan-only.js +1 -2
  25. package/dist/commands/exec/planned-outcome.js +8 -1
  26. package/dist/commands/exec/run-command.d.ts +6 -7
  27. package/dist/commands/exec/run-command.js +8 -9
  28. package/dist/commands/exec/run-metadata.js +1 -1
  29. package/dist/commands/runs/facts.d.ts +2 -1
  30. package/dist/commands/runs/facts.js +11 -3
  31. package/dist/commands/runs/list/command.d.ts +2 -0
  32. package/dist/commands/runs/list/command.js +6 -6
  33. package/dist/commands/runs/list/outcomes.d.ts +1 -0
  34. package/dist/commands/runs/logs/command.d.ts +6 -2
  35. package/dist/commands/runs/logs/command.js +6 -6
  36. package/dist/commands/runs/logs/outcomes.d.ts +3 -1
  37. package/dist/commands/runs/past-run.d.ts +14 -5
  38. package/dist/commands/runs/past-run.js +16 -5
  39. package/dist/commands/runs/show/command.d.ts +6 -2
  40. package/dist/commands/runs/show/command.js +9 -9
  41. package/dist/commands/runs/show/outcomes.d.ts +3 -1
  42. package/dist/commands/snapshots/build/command.js +11 -11
  43. package/dist/commands/snapshots/list/command.d.ts +3 -3
  44. package/dist/commands/snapshots/list/command.js +6 -6
  45. package/dist/commands/snapshots/list/metadata.js +1 -1
  46. package/dist/commands/suites/list/command.js +7 -6
  47. package/dist/commands/suites/list/outcomes.js +2 -2
  48. package/dist/commands/test/command.d.ts +8 -2
  49. package/dist/commands/test/command.js +38 -40
  50. package/dist/commands/test/metadata.js +1 -1
  51. package/dist/commands/test/outcomes.d.ts +4 -1
  52. package/dist/commands/test/outcomes.js +2 -2
  53. package/dist/commands/test/plan.d.ts +2 -2
  54. package/dist/commands/test/plan.js +2 -5
  55. package/dist/config/check-runner.d.ts +4 -2
  56. package/dist/config/check-runner.js +27 -2
  57. package/dist/config/check-suites.js +1 -0
  58. package/dist/config/gateways.d.ts +7 -3
  59. package/dist/config/index.d.ts +2 -3
  60. package/dist/config/index.js +2 -3
  61. package/dist/config/live/config-gateway.js +5 -2
  62. package/dist/config/load.d.ts +21 -4
  63. package/dist/config/load.js +129 -15
  64. package/dist/config/runner.d.ts +5 -6
  65. package/dist/config/runner.js +1 -1
  66. package/dist/config/schema.d.ts +15 -3
  67. package/dist/config/schema.js +10 -2
  68. package/dist/config/typed-options.d.ts +1 -6
  69. package/dist/config/typed-options.js +2 -10
  70. package/dist/config-file/define.d.ts +1 -11
  71. package/dist/config-file/define.js +3 -3
  72. package/dist/config-file/runner.d.ts +2 -3
  73. package/dist/config-file/toolchain.d.ts +13 -7
  74. package/dist/config-file/toolchain.js +51 -35
  75. package/dist/extensions/github/resource.d.ts +1 -1
  76. package/dist/extensions/github/resource.js +1 -1
  77. package/dist/extensions/testserver/commands/pool/create/command.js +1 -1
  78. package/dist/extensions/testserver/resource.d.ts +2 -2
  79. package/dist/extensions/testserver/resource.js +2 -2
  80. package/dist/planning/plan-only.d.ts +4 -1
  81. package/dist/planning/plan-only.js +5 -2
  82. package/dist/planning/run-plan.d.ts +1 -2
  83. package/dist/planning/test-plan.js +1 -2
  84. package/dist/runner/base.d.ts +0 -6
  85. package/dist/runner/base.js +0 -15
  86. package/dist/runner/build-snapshots.js +7 -8
  87. package/dist/runner/gateways.d.ts +5 -0
  88. package/dist/runner/index.d.ts +1 -1
  89. package/dist/runner/live/sandbox-gateway.js +12 -0
  90. package/dist/runner/prepare.d.ts +16 -15
  91. package/dist/runner/prepare.js +11 -12
  92. package/dist/runner/recipe.d.ts +66 -67
  93. package/dist/runner/recipe.js +204 -120
  94. package/dist/runner/snapshot-build.d.ts +1 -1
  95. package/dist/runner/snapshot-build.js +10 -3
  96. package/dist/runner/snapshot-inspect.d.ts +4 -4
  97. package/dist/runner/snapshot-inspect.js +7 -7
  98. package/dist/runner/snapshot-key.d.ts +23 -15
  99. package/dist/runner/snapshot-key.js +46 -27
  100. package/dist/sdk/extension/resource-definition.d.ts +3 -2
  101. package/dist/sdk/extension/resource-definition.js +3 -2
  102. package/dist/sdk/extension/resource-factory.js +3 -4
  103. package/dist/sdk/run/present.d.ts +3 -3
  104. package/dist/sdk/run/present.js +1 -3
  105. package/package.json +1 -1
  106. package/skills/overview.md +2 -0
  107. package/skills/plan-runs.md +1 -1
  108. package/dist/config/recipe-run.d.ts +0 -33
  109. package/dist/config/recipe-run.js +0 -28
@@ -12,7 +12,7 @@ import {
12
12
  driversOf,
13
13
  resourceDefinitionSet,
14
14
  resourcesOf
15
- } from "./chunk-YV7GE6EV.js";
15
+ } from "./chunk-FOZWA52V.js";
16
16
  import {
17
17
  SECRET_MIN_LENGTH,
18
18
  argsText,
@@ -2,14 +2,14 @@ import {
2
2
  DEFINITION_SET,
3
3
  EXTENSIONS,
4
4
  RESOURCES
5
- } from "./chunk-PN5ULTTH.js";
5
+ } from "./chunk-DWEAHX4T.js";
6
6
  import {
7
7
  median,
8
8
  seconds,
9
9
  shortFile,
10
10
  truncate,
11
11
  visibleLength
12
- } from "./chunk-OX7X4B2L.js";
12
+ } from "./chunk-G3PHMXH5.js";
13
13
  import {
14
14
  PALETTE,
15
15
  paintSwatch
@@ -19,10 +19,7 @@ import {
19
19
  sameRow,
20
20
  setupPhaseKey,
21
21
  setupPhaseWords
22
- } from "./chunk-YV7GE6EV.js";
23
- import {
24
- CONFIG_FILE_NAME
25
- } from "./chunk-L36GBUBB.js";
22
+ } from "./chunk-FOZWA52V.js";
26
23
  import {
27
24
  defaultResourceKey,
28
25
  optionKeyPath
@@ -188,7 +185,7 @@ function fromText(path, from) {
188
185
  case "flag":
189
186
  return RESOURCE_FLAGS.find(({ resource, option }) => optionKeyPath(resource, option) === path)?.flag ?? "a flag";
190
187
  case "file":
191
- return CONFIG_FILE_NAME;
188
+ return "config file";
192
189
  case "default":
193
190
  return "default";
194
191
  }
@@ -8,7 +8,7 @@ import {
8
8
  parseTestEvent,
9
9
  systemClock,
10
10
  systemTimer
11
- } from "./chunk-L36GBUBB.js";
11
+ } from "./chunk-DC2CDHNK.js";
12
12
  import {
13
13
  describeMintFailure
14
14
  } from "./chunk-AWBSONHB.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  secondsOf,
3
3
  secondsText
4
- } from "./chunk-YV7GE6EV.js";
4
+ } from "./chunk-FOZWA52V.js";
5
5
 
6
6
  // src/shared/text.ts
7
7
  function seconds(ms) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecrets
3
- } from "./chunk-L36GBUBB.js";
3
+ } from "./chunk-DC2CDHNK.js";
4
4
 
5
5
  // src/planning/redaction.ts
6
6
  function redactor(secrets) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  redactor
3
- } from "./chunk-CXAT7ZKP.js";
3
+ } from "./chunk-HVNK3I45.js";
4
4
  import {
5
5
  declaredSecretValues,
6
6
  effectiveConfig
7
- } from "./chunk-L36GBUBB.js";
7
+ } from "./chunk-DC2CDHNK.js";
8
8
 
9
9
  // src/planning/suites.ts
10
10
  function resolveProjectTests(file, driverByName) {
@@ -5,11 +5,11 @@ import {
5
5
  commandExitStatus,
6
6
  observeAll,
7
7
  sandboxEndFacts
8
- } from "./chunk-YV7GE6EV.js";
8
+ } from "./chunk-FOZWA52V.js";
9
9
  import {
10
10
  parseTestEvent,
11
11
  testEventLine
12
- } from "./chunk-L36GBUBB.js";
12
+ } from "./chunk-DC2CDHNK.js";
13
13
 
14
14
  // src/run-directory/reader.ts
15
15
  import { z as z4 } from "zod";
@@ -5,19 +5,143 @@ import {
5
5
  sandboxPage,
6
6
  snapshotPage,
7
7
  testTotalsText
8
- } from "./chunk-QUHY6FGN.js";
8
+ } from "./chunk-2MAD5NKK.js";
9
9
  import {
10
10
  sandboxRecordSchema
11
- } from "./chunk-SZEURWRS.js";
11
+ } from "./chunk-P357TZAY.js";
12
12
  import {
13
13
  isoSecondsText,
14
14
  seconds,
15
15
  short
16
- } from "./chunk-OX7X4B2L.js";
16
+ } from "./chunk-G3PHMXH5.js";
17
17
  import {
18
18
  stripAnsi
19
19
  } from "./chunk-F6N34UWB.js";
20
20
 
21
+ // src/commands/runs/past-run.ts
22
+ var ALL_RUNS_WHY = ["flag", "no-config-file", "config-file-conflict"];
23
+ function runScope(all, found) {
24
+ if (all) return { kind: "all", why: "flag" };
25
+ switch (found.kind) {
26
+ case "none":
27
+ return { kind: "all", why: "no-config-file" };
28
+ case "conflict":
29
+ return { kind: "all", why: "config-file-conflict" };
30
+ case "found":
31
+ return { kind: "config", configFile: found.path };
32
+ }
33
+ }
34
+ function runsInScope(listed, scope) {
35
+ return scope.kind === "all" ? listed : listed.filter(({ record }) => record?.configFile === scope.configFile);
36
+ }
37
+ function onBranch(runs, branch) {
38
+ return branch === void 0 ? runs : runs.filter(({ record }) => record?.git?.branch === branch);
39
+ }
40
+ function newestFinished(runs) {
41
+ return runs.find((run) => !run.active && run.record?.ended !== void 0);
42
+ }
43
+ function newest(runs) {
44
+ return runs[0];
45
+ }
46
+ function finalResults(events) {
47
+ return events.flatMap((event) => event.kind === "test-result" ? [event] : []);
48
+ }
49
+ function sandboxDidNotPass(state, active) {
50
+ return state !== "passed" && !(active && state === "pending");
51
+ }
52
+ function ofSandbox(events, sandbox) {
53
+ return sandbox === void 0 ? events : events.filter((event) => event.sandbox === sandbox);
54
+ }
55
+ function testFiles(events) {
56
+ const files = /* @__PURE__ */ new Map();
57
+ for (const event of events) {
58
+ const sandbox = event.sandbox ?? null;
59
+ const key = `${sandbox ?? ""}\0${event.file}`;
60
+ let held = files.get(key);
61
+ if (held === void 0) {
62
+ held = { file: event.file, sandbox, tests: { passed: 0, failed: 0, skipped: 0 } };
63
+ files.set(key, held);
64
+ }
65
+ if (event.kind === "file-started") held.started = Math.min(held.started ?? event.at, event.at);
66
+ else if (event.kind === "file-finished") held.finished = Math.max(held.finished ?? event.at, event.at);
67
+ else if (event.kind === "test-result")
68
+ held.tests[event.state === "pass" ? "passed" : event.state === "fail" ? "failed" : "skipped"] += 1;
69
+ }
70
+ return [...files.values()].toSorted((a, b) => (a.sandbox ?? -1) - (b.sandbox ?? -1) || (a.file < b.file ? -1 : a.file > b.file ? 1 : 0)).map(({ file, sandbox, started, finished, tests }) => ({
71
+ file,
72
+ sandbox,
73
+ startedAt: started === void 0 ? null : new Date(started).toISOString(),
74
+ finishedAt: finished === void 0 ? null : new Date(finished).toISOString(),
75
+ ms: started === void 0 || finished === void 0 ? null : Math.max(0, finished - started),
76
+ tests: { ...tests }
77
+ }));
78
+ }
79
+ function testTimings(events) {
80
+ const bySandbox = /* @__PURE__ */ new Map();
81
+ for (const event of events) {
82
+ if (event.kind !== "test-started" && event.kind !== "test-attempt-finished") continue;
83
+ let timings = bySandbox.get(event.sandbox);
84
+ if (timings === void 0) {
85
+ timings = /* @__PURE__ */ new Map();
86
+ bySandbox.set(event.sandbox, timings);
87
+ }
88
+ const durationMs = timings.get(event.id)?.durationMs ?? null;
89
+ timings.set(event.id, {
90
+ durationMs: event.kind === "test-attempt-finished" ? (durationMs ?? 0) + event.ms : durationMs,
91
+ worker: event.worker
92
+ });
93
+ }
94
+ return bySandbox;
95
+ }
96
+ function totalAttemptMs(events) {
97
+ let sum = 0;
98
+ for (const event of events) {
99
+ if (event.kind === "test-attempt-finished") sum += event.ms;
100
+ }
101
+ return sum;
102
+ }
103
+ function parseWorkerFlag(raw) {
104
+ const match = /^w?(0|[1-9]\d*)$/i.exec(raw);
105
+ if (match === null) return void 0;
106
+ const parsed = Number(match[1]);
107
+ return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : void 0;
108
+ }
109
+ function sortBySlowest(tests) {
110
+ return [...tests].toSorted((a, b) => {
111
+ if (a.durationMs === null && b.durationMs === null) return 0;
112
+ if (a.durationMs === null) return 1;
113
+ if (b.durationMs === null) return -1;
114
+ return b.durationMs - a.durationMs;
115
+ });
116
+ }
117
+ function selected(result, filters, testWorker = null) {
118
+ if (filters.failed && result.state !== "fail") return false;
119
+ if (filters.test !== void 0 && !result.test.includes(filters.test) && !result.file.includes(filters.test))
120
+ return false;
121
+ if (filters.worker !== void 0 && testWorker !== filters.worker) return false;
122
+ return true;
123
+ }
124
+ function deduplicateTestErrors(errors) {
125
+ if (errors === void 0 || errors.length === 0) return [];
126
+ const collapsed = [];
127
+ const byKey = /* @__PURE__ */ new Map();
128
+ for (const error of errors) {
129
+ const name = stripAnsi(error.name);
130
+ const message = stripAnsi(error.message);
131
+ const stack = error.stack === void 0 ? null : stripAnsi(error.stack);
132
+ const diff = error.diff === void 0 ? null : stripAnsi(error.diff);
133
+ const key = `${name}\0${message}\0${stack ?? ""}\0${diff ?? ""}`;
134
+ const existing = byKey.get(key);
135
+ if (existing !== void 0) {
136
+ collapsed[existing].occurrences += 1;
137
+ continue;
138
+ }
139
+ byKey.set(key, collapsed.length);
140
+ collapsed.push({ name, message, stack, diff, occurrences: 1 });
141
+ }
142
+ return collapsed;
143
+ }
144
+
21
145
  // src/commands/runs/facts.ts
22
146
  import { z } from "zod";
23
147
  var LOG_STEPS = ["command", "install", "build", "apply", "snapshot"];
@@ -31,8 +155,8 @@ var scopeSchema = z.discriminatedUnion("kind", [
31
155
  z.object({
32
156
  /** Every run. */
33
157
  kind: z.literal("all"),
34
- /** `flag` for `--all`; `no-config-file` when no storm.config.ts was found from the working directory. */
35
- why: z.enum(["flag", "no-config-file"])
158
+ /** Why every run: one of `ALL_RUNS_WHY`. */
159
+ why: z.enum(ALL_RUNS_WHY)
36
160
  })
37
161
  ]);
38
162
  var runFactsSchema = z.object({
@@ -169,7 +293,14 @@ function scopeFacts(scope) {
169
293
  }
170
294
  function scopeText(scope) {
171
295
  if (scope.kind === "config") return scope.configFile;
172
- return scope.why === "flag" ? "every config (--all)" : "every config (no storm.config.ts found)";
296
+ switch (scope.why) {
297
+ case "flag":
298
+ return "every config (--all)";
299
+ case "no-config-file":
300
+ return "every config (no config file found)";
301
+ case "config-file-conflict":
302
+ return "every config (storm.config.ts and storm.config.mts in one directory)";
303
+ }
173
304
  }
174
305
  var runsUnreadable = {
175
306
  exitCode: 1,
@@ -273,124 +404,22 @@ function commandText(run) {
273
404
  return run.argv.map((arg) => /^[\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'\\''`)}'`).join(" ");
274
405
  }
275
406
 
276
- // src/commands/runs/past-run.ts
277
- function runScope(all, configFile) {
278
- if (all) return { kind: "all", why: "flag" };
279
- if (configFile === void 0) return { kind: "all", why: "no-config-file" };
280
- return { kind: "config", configFile };
281
- }
282
- function runsInScope(listed, scope) {
283
- return scope.kind === "all" ? listed : listed.filter(({ record }) => record?.configFile === scope.configFile);
284
- }
285
- function onBranch(runs, branch) {
286
- return branch === void 0 ? runs : runs.filter(({ record }) => record?.git?.branch === branch);
287
- }
288
- function newestFinished(runs) {
289
- return runs.find((run) => !run.active && run.record?.ended !== void 0);
290
- }
291
- function newest(runs) {
292
- return runs[0];
293
- }
294
- function finalResults(events) {
295
- return events.flatMap((event) => event.kind === "test-result" ? [event] : []);
296
- }
297
- function sandboxDidNotPass(state, active) {
298
- return state !== "passed" && !(active && state === "pending");
299
- }
300
- function ofSandbox(events, sandbox) {
301
- return sandbox === void 0 ? events : events.filter((event) => event.sandbox === sandbox);
302
- }
303
- function testFiles(events) {
304
- const files = /* @__PURE__ */ new Map();
305
- for (const event of events) {
306
- const sandbox = event.sandbox ?? null;
307
- const key = `${sandbox ?? ""}\0${event.file}`;
308
- let held = files.get(key);
309
- if (held === void 0) {
310
- held = { file: event.file, sandbox, tests: { passed: 0, failed: 0, skipped: 0 } };
311
- files.set(key, held);
312
- }
313
- if (event.kind === "file-started") held.started = Math.min(held.started ?? event.at, event.at);
314
- else if (event.kind === "file-finished") held.finished = Math.max(held.finished ?? event.at, event.at);
315
- else if (event.kind === "test-result")
316
- held.tests[event.state === "pass" ? "passed" : event.state === "fail" ? "failed" : "skipped"] += 1;
317
- }
318
- return [...files.values()].toSorted((a, b) => (a.sandbox ?? -1) - (b.sandbox ?? -1) || (a.file < b.file ? -1 : a.file > b.file ? 1 : 0)).map(({ file, sandbox, started, finished, tests }) => ({
319
- file,
320
- sandbox,
321
- startedAt: started === void 0 ? null : new Date(started).toISOString(),
322
- finishedAt: finished === void 0 ? null : new Date(finished).toISOString(),
323
- ms: started === void 0 || finished === void 0 ? null : Math.max(0, finished - started),
324
- tests: { ...tests }
325
- }));
326
- }
327
- function testTimings(events) {
328
- const bySandbox = /* @__PURE__ */ new Map();
329
- for (const event of events) {
330
- if (event.kind !== "test-started" && event.kind !== "test-attempt-finished") continue;
331
- let timings = bySandbox.get(event.sandbox);
332
- if (timings === void 0) {
333
- timings = /* @__PURE__ */ new Map();
334
- bySandbox.set(event.sandbox, timings);
335
- }
336
- const durationMs = timings.get(event.id)?.durationMs ?? null;
337
- timings.set(event.id, {
338
- durationMs: event.kind === "test-attempt-finished" ? (durationMs ?? 0) + event.ms : durationMs,
339
- worker: event.worker
340
- });
341
- }
342
- return bySandbox;
343
- }
344
- function totalAttemptMs(events) {
345
- let sum = 0;
346
- for (const event of events) {
347
- if (event.kind === "test-attempt-finished") sum += event.ms;
348
- }
349
- return sum;
350
- }
351
- function parseWorkerFlag(raw) {
352
- const match = /^w?(0|[1-9]\d*)$/i.exec(raw);
353
- if (match === null) return void 0;
354
- const parsed = Number(match[1]);
355
- return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : void 0;
356
- }
357
- function sortBySlowest(tests) {
358
- return [...tests].toSorted((a, b) => {
359
- if (a.durationMs === null && b.durationMs === null) return 0;
360
- if (a.durationMs === null) return 1;
361
- if (b.durationMs === null) return -1;
362
- return b.durationMs - a.durationMs;
363
- });
364
- }
365
- function selected(result, filters, testWorker = null) {
366
- if (filters.failed && result.state !== "fail") return false;
367
- if (filters.test !== void 0 && !result.test.includes(filters.test) && !result.file.includes(filters.test))
368
- return false;
369
- if (filters.worker !== void 0 && testWorker !== filters.worker) return false;
370
- return true;
371
- }
372
- function deduplicateTestErrors(errors) {
373
- if (errors === void 0 || errors.length === 0) return [];
374
- const collapsed = [];
375
- const byKey = /* @__PURE__ */ new Map();
376
- for (const error of errors) {
377
- const name = stripAnsi(error.name);
378
- const message = stripAnsi(error.message);
379
- const stack = error.stack === void 0 ? null : stripAnsi(error.stack);
380
- const diff = error.diff === void 0 ? null : stripAnsi(error.diff);
381
- const key = `${name}\0${message}\0${stack ?? ""}\0${diff ?? ""}`;
382
- const existing = byKey.get(key);
383
- if (existing !== void 0) {
384
- collapsed[existing].occurrences += 1;
385
- continue;
386
- }
387
- byKey.set(key, collapsed.length);
388
- collapsed.push({ name, message, stack, diff, occurrences: 1 });
389
- }
390
- return collapsed;
391
- }
392
-
393
407
  export {
408
+ runScope,
409
+ runsInScope,
410
+ onBranch,
411
+ newestFinished,
412
+ newest,
413
+ finalResults,
414
+ sandboxDidNotPass,
415
+ ofSandbox,
416
+ testFiles,
417
+ testTimings,
418
+ totalAttemptMs,
419
+ parseWorkerFlag,
420
+ sortBySlowest,
421
+ selected,
422
+ deduplicateTestErrors,
394
423
  LOG_STEPS,
395
424
  scopeSchema,
396
425
  runFactsSchema,
@@ -410,20 +439,5 @@ export {
410
439
  branchText,
411
440
  gitText,
412
441
  startedText,
413
- commandText,
414
- runScope,
415
- runsInScope,
416
- onBranch,
417
- newestFinished,
418
- newest,
419
- finalResults,
420
- sandboxDidNotPass,
421
- ofSandbox,
422
- testFiles,
423
- testTimings,
424
- totalAttemptMs,
425
- parseWorkerFlag,
426
- sortBySlowest,
427
- selected,
428
- deduplicateTestErrors
442
+ commandText
429
443
  };
@@ -14,21 +14,21 @@ import {
14
14
  testsChart,
15
15
  testsSummaryLines,
16
16
  waterfallLines
17
- } from "./chunk-5GBMR4HM.js";
17
+ } from "./chunk-FCQUJDA4.js";
18
18
  import {
19
19
  DEFINITION_SET
20
- } from "./chunk-PN5ULTTH.js";
20
+ } from "./chunk-DWEAHX4T.js";
21
21
  import {
22
22
  redactStrings,
23
23
  redactingObserver,
24
24
  redactingTerminal,
25
25
  redactor
26
- } from "./chunk-CXAT7ZKP.js";
26
+ } from "./chunk-HVNK3I45.js";
27
27
  import {
28
28
  builtAtText,
29
29
  rejectionLines,
30
30
  snapshotCacheNoteText
31
- } from "./chunk-XEVHP5ZW.js";
31
+ } from "./chunk-3L52KNQA.js";
32
32
  import {
33
33
  NodeSignalCancellation
34
34
  } from "./chunk-VUPZH7J2.js";
@@ -37,13 +37,13 @@ import {
37
37
  sandboxConnectPage,
38
38
  sandboxTableRows,
39
39
  sandboxTotalsLine
40
- } from "./chunk-QUHY6FGN.js";
40
+ } from "./chunk-2MAD5NKK.js";
41
41
  import {
42
42
  planSchema,
43
43
  recordRun,
44
44
  sandboxRecordSchema,
45
45
  timelineSchema
46
- } from "./chunk-SZEURWRS.js";
46
+ } from "./chunk-P357TZAY.js";
47
47
  import {
48
48
  isoSecondsText,
49
49
  keepTimeText,
@@ -57,7 +57,7 @@ import {
57
57
  truncate,
58
58
  visibleLength,
59
59
  withArticle
60
- } from "./chunk-OX7X4B2L.js";
60
+ } from "./chunk-G3PHMXH5.js";
61
61
  import {
62
62
  EMPTY_RUN_STATE,
63
63
  cleanupProblems,
@@ -70,8 +70,9 @@ import {
70
70
  setupPhaseWords,
71
71
  timedProgress,
72
72
  warningTally
73
- } from "./chunk-YV7GE6EV.js";
73
+ } from "./chunk-FOZWA52V.js";
74
74
  import {
75
+ CONFIG_FILE_NAMES_TEXT,
75
76
  MAX_RUNNER_SANDBOXES,
76
77
  configErrors,
77
78
  credentialErrors,
@@ -82,11 +83,10 @@ import {
82
83
  prepareRunner,
83
84
  readCredentials,
84
85
  readUnsafeSecretEnvVars,
85
- recipeRun,
86
86
  requireTarget,
87
87
  settleCredential,
88
88
  settleRunResources
89
- } from "./chunk-L36GBUBB.js";
89
+ } from "./chunk-DC2CDHNK.js";
90
90
  import {
91
91
  SECRET_MIN_LENGTH,
92
92
  describeMintFailure,
@@ -236,7 +236,10 @@ var plannedSchema = z2.object({
236
236
  argv: z2.array(z2.string()),
237
237
  plan: planSchema.nullable(),
238
238
  testFiles: z2.array(z2.string()).nullable(),
239
- runnerSandboxes: z2.object({ max: z2.number(), default: z2.union([z2.number(), z2.literal("function")]).nullable() }).nullable(),
239
+ runnerSandboxes: z2.object({
240
+ max: z2.number(),
241
+ default: z2.union([z2.number(), z2.object({ filesPerSandbox: z2.number(), max: z2.number().optional() })]).nullable()
242
+ }).nullable(),
240
243
  sandboxes: z2.array(z2.object({ sandbox: z2.number(), argv: z2.array(z2.string()), files: z2.array(z2.string()).nullable() })).nullable(),
241
244
  options: z2.array(plannedOptionSchema),
242
245
  vcpus: z2.number().nullable()
@@ -262,7 +265,7 @@ function buildPlannedFacts(input) {
262
265
  testFiles: input.testFiles === void 0 ? null : [...input.testFiles],
263
266
  runnerSandboxes: policy === void 0 ? null : {
264
267
  max: policy.max,
265
- default: policy.default === void 0 ? null : typeof policy.default === "function" ? "function" : policy.default
268
+ default: policy.default ?? null
266
269
  },
267
270
  sandboxes: sandboxes === void 0 ? null : sandboxes.sandboxes.map(({ argv, files }, index) => ({
268
271
  sandbox: index,
@@ -323,11 +326,16 @@ function plannedText(planned) {
323
326
  planned.sandboxes === null ? `runner sandbox: ${planned.vcpus} vCPUs` : `runner sandboxes: ${planned.vcpus} vCPUs each`
324
327
  ],
325
328
  ...planned.runnerSandboxes === null || planned.runnerSandboxes.default === null ? [] : [
326
- `runner.sandboxes: default ${planned.runnerSandboxes.default === "function" ? "a function of the test plan" : planned.runnerSandboxes.default}, max ${planned.runnerSandboxes.max}`
329
+ `runner.sandboxes: default ${formatSandboxesDefault(planned.runnerSandboxes.default)}, max ${planned.runnerSandboxes.max}`
327
330
  ],
328
331
  ...planned.options.map(({ path, value, from }) => `${path}: ${String(value)} (${from})`)
329
332
  ].join("\n");
330
333
  }
334
+ function formatSandboxesDefault(value) {
335
+ if (typeof value === "number") return String(value);
336
+ const per = `1 per ${value.filesPerSandbox} test ${value.filesPerSandbox === 1 ? "file" : "files"}`;
337
+ return value.max === void 0 ? per : `${per} (max ${value.max})`;
338
+ }
331
339
  function renderPlanned(planned) {
332
340
  return renderOutcome({
333
341
  text: plannedText(planned),
@@ -564,7 +572,7 @@ var sandboxesErrors = defineErrors({
564
572
  configFile: z5.string().nullable()
565
573
  }),
566
574
  render: ({ flag, configFile }) => ({
567
- message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile ?? "no storm.config.ts"} has none. The run didn't start.`,
575
+ message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile === null ? `no ${CONFIG_FILE_NAMES_TEXT} applies` : `${configFile} has none`}. The run didn't start.`,
568
576
  next: [
569
577
  {
570
578
  type: "text",
@@ -958,7 +966,7 @@ var runErrors = defineErrors({
958
966
  configFile: z6.string().nullable()
959
967
  }),
960
968
  render: ({ configFile }) => ({
961
- message: configFile === null ? "No runner is declared, and no storm.config.ts applies." : `No runner is declared in ${configFile}.`,
969
+ message: configFile === null ? `No runner is declared, and no ${CONFIG_FILE_NAMES_TEXT} applies.` : `No runner is declared in ${configFile}.`,
962
970
  next: [
963
971
  {
964
972
  type: "text",
@@ -2365,7 +2373,7 @@ async function runnerRequestFor(app, where, used, options) {
2365
2373
  const prepared = await prepareRunner(app.context, {
2366
2374
  cwd: app.cwd,
2367
2375
  recipe: where.recipe,
2368
- vcpusRun: recipeRun(recipeResources(used.requests), options.sandboxes)
2376
+ vcpuRun: { resources: recipeResources(used.requests), sandboxes: options.sandboxes }
2369
2377
  });
2370
2378
  if (prepared.kind !== "ok") {
2371
2379
  const refusal = prepareRefusal(prepared, options.configFile);
@@ -2473,9 +2481,9 @@ async function checkoutGit(checkout, cwd) {
2473
2481
  }
2474
2482
  function recipeResources(requests) {
2475
2483
  return Object.fromEntries(
2476
- Object.entries(requests).map(([key, { definition, options }]) => {
2484
+ Object.entries(requests).map(([key, { options }]) => {
2477
2485
  if (typeof options !== "object" || options === null) throw new Error(`${key}'s options are not an object`);
2478
- return [key, { definition, options }];
2486
+ return [key, options];
2479
2487
  })
2480
2488
  );
2481
2489
  }
@@ -3,7 +3,7 @@ import {
3
3
  RESOURCES,
4
4
  liveDriverContexts,
5
5
  liveResourceContexts
6
- } from "./chunk-PN5ULTTH.js";
6
+ } from "./chunk-DWEAHX4T.js";
7
7
  import "./chunk-R7XVBZOY.js";
8
8
  import "./chunk-CN4EFA5J.js";
9
9
  import "./chunk-ZG3WQ4UF.js";
@@ -12,7 +12,7 @@ import {
12
12
  RUNS_SUBPATH,
13
13
  liveRunDirectoryGateway,
14
14
  unavailableRunDirectoryGateway
15
- } from "./chunk-SZEURWRS.js";
15
+ } from "./chunk-P357TZAY.js";
16
16
  import {
17
17
  liveCommandGateway,
18
18
  liveJobSummaryGateway,
@@ -20,7 +20,7 @@ import {
20
20
  liveProgressTerminal,
21
21
  resolveStateDirectory,
22
22
  stateDirectoryPattern
23
- } from "./chunk-YV7GE6EV.js";
23
+ } from "./chunk-FOZWA52V.js";
24
24
  import {
25
25
  RUNNER_SNAPSHOTS_SUBPATH,
26
26
  configResolver,
@@ -37,7 +37,7 @@ import {
37
37
  systemClock,
38
38
  systemTimer,
39
39
  unavailableRunnerSnapshotCacheGateway
40
- } from "./chunk-L36GBUBB.js";
40
+ } from "./chunk-DC2CDHNK.js";
41
41
  import "./chunk-AWBSONHB.js";
42
42
  import {
43
43
  resolveColorDepth
@@ -3,6 +3,7 @@
3
3
  // `invalid_file_lists`, `file_lists_unlisted`).
4
4
  import { defineErrors, renderOutcome } from "@vercel/clinkr";
5
5
  import { z } from "zod";
6
+ import { CONFIG_FILE_NAMES_TEXT } from "../../config/index.js";
6
7
  import { DEFINITION_SET } from "../../extensions.js";
7
8
  import { noFinalResultsContent } from "../../planning/final-results.js";
8
9
  import { fileListsProblemText } from "../../planning/file-lists-file.js";
@@ -107,7 +108,7 @@ export const sandboxesErrors = defineErrors({
107
108
  configFile: z.string().nullable(),
108
109
  }),
109
110
  render: ({ flag, configFile }) => ({
110
- message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile ?? "no storm.config.ts"} has none. The run didn't start.`,
111
+ message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile === null ? `no ${CONFIG_FILE_NAMES_TEXT} applies` : `${configFile} has none`}. The run didn't start.`,
111
112
  next: [
112
113
  {
113
114
  type: "text",
@@ -223,7 +223,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
223
223
  testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
224
224
  runnerSandboxes: z.ZodNullable<z.ZodObject<{
225
225
  max: z.ZodNumber;
226
- default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"function">]>>;
226
+ default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
227
+ filesPerSandbox: z.ZodNumber;
228
+ max: z.ZodOptional<z.ZodNumber>;
229
+ }, z.core.$strip>]>>;
227
230
  }, z.core.$strip>>;
228
231
  sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
229
232
  sandbox: z.ZodNumber;
@@ -755,7 +758,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
755
758
  testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
756
759
  runnerSandboxes: z.ZodNullable<z.ZodObject<{
757
760
  max: z.ZodNumber;
758
- default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"function">]>>;
761
+ default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
762
+ filesPerSandbox: z.ZodNumber;
763
+ max: z.ZodOptional<z.ZodNumber>;
764
+ }, z.core.$strip>]>>;
759
765
  }, z.core.$strip>>;
760
766
  sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
761
767
  sandbox: z.ZodNumber;