@cnc-tools/storm 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/storm.js +10 -2
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-27P2QSIM.js → chunk-3HBPNQ4Y.js} +1 -1
- package/dist/chunks/{chunk-HOKDKP5A.js → chunk-E3QU74NX.js} +1 -1
- package/dist/chunks/{chunk-RKONDLPS.js → chunk-GJOEPJJL.js} +2 -2
- package/dist/chunks/{chunk-XPCUINWS.js → chunk-HDL4WKIB.js} +1 -1
- package/dist/chunks/{chunk-IVRRGGCD.js → chunk-HP54VHGY.js} +4 -4
- package/dist/chunks/{chunk-5ED3IDUJ.js → chunk-I7AN3DIJ.js} +25 -4
- package/dist/chunks/{chunk-YBPTMJUM.js → chunk-LUOHJ3LB.js} +9 -9
- package/dist/chunks/{chunk-ZH5R7W4A.js → chunk-RUPD4TLT.js} +1 -1
- package/dist/chunks/{chunk-BFLYGMG3.js → chunk-TVMEKVOW.js} +4 -4
- package/dist/chunks/{chunk-Z5OXOZD3.js → chunk-UUBZTGLV.js} +1 -1
- package/dist/chunks/{chunk-5TMHYH7G.js → chunk-VH2POPW5.js} +4 -2
- package/dist/chunks/{chunk-QBR5VHJ7.js → chunk-XZCDA5PE.js} +1 -1
- package/dist/chunks/{live-app-FBVWUUMT.js → live-app-SZGEILCQ.js} +13 -7
- package/dist/commands/exec/command.js +10 -10
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/playwright/command.js +11 -11
- package/dist/commands/runs/list/command.js +5 -5
- package/dist/commands/runs/logs/command.js +5 -5
- package/dist/commands/runs/show/command.js +8 -8
- package/dist/commands/snapshots/build/command.js +9 -9
- package/dist/commands/snapshots/list/command.js +6 -6
- package/dist/commands/vitest/command.js +11 -11
- package/dist/context.d.ts +1 -0
- package/dist/context.js +4 -1
- package/dist/core/payload.d.ts +5 -3
- package/dist/core/payload.js +8 -3
- package/dist/extensions/testserver/commands/pool/create/command.js +1 -1
- package/dist/live-app.d.ts +3 -1
- package/dist/live-app.js +5 -2
- package/dist/runner/gateways.d.ts +10 -2
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/live/sandbox-gateway.js +16 -2
- package/dist/runner/live/terminal.d.ts +15 -3
- package/dist/runner/live/terminal.js +25 -3
- package/dist/runner/recipe.d.ts +3 -2
- package/dist/runner/sandboxed-command.d.ts +5 -5
- package/dist/runner/sandboxed-command.js +7 -5
- package/package.json +1 -1
package/dist/bin/storm.js
CHANGED
|
@@ -102,11 +102,19 @@ async function version() {
|
|
|
102
102
|
return versionText(manifest.version, built);
|
|
103
103
|
}
|
|
104
104
|
var exit = { status: void 0 };
|
|
105
|
+
function hasNoColorFlag(argv) {
|
|
106
|
+
for (const token of argv) {
|
|
107
|
+
if (token === "--") return false;
|
|
108
|
+
if (token === "--no-color") return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
105
112
|
var accessible = process.env["VERCEL_ACCESSIBLE"] === "1";
|
|
113
|
+
var noColor = hasNoColorFlag(process.argv.slice(2));
|
|
106
114
|
var status = await runNodeCli(await loadStormApplication(version, { accessible, root }), {
|
|
107
115
|
app: async (host) => {
|
|
108
|
-
const [{ liveStormApp }, built] = await Promise.all([import("../chunks/live-app-
|
|
109
|
-
return liveStormApp(host, { version: manifest.version, commit: built }, exit);
|
|
116
|
+
const [{ liveStormApp }, built] = await Promise.all([import("../chunks/live-app-SZGEILCQ.js"), commit()]);
|
|
117
|
+
return liveStormApp(host, { version: manifest.version, commit: built }, exit, { noColor });
|
|
110
118
|
}
|
|
111
119
|
});
|
|
112
120
|
process.exitCode = exit.status ?? status;
|
package/dist/build-info.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
RESOURCE_FLAG_HELP,
|
|
3
3
|
RESOURCE_USAGE_FLAGS,
|
|
4
4
|
resourceRunExamples
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TVMEKVOW.js";
|
|
6
6
|
|
|
7
7
|
// src/commands/exec/run-metadata.ts
|
|
8
8
|
var RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
EMPTY_RUN_STATE,
|
|
3
3
|
commandExitStatus,
|
|
4
4
|
observeAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VH2POPW5.js";
|
|
6
6
|
import {
|
|
7
7
|
parseTestEvent,
|
|
8
8
|
testEventLine
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I7AN3DIJ.js";
|
|
10
10
|
|
|
11
11
|
// src/run-directory/run-directory.ts
|
|
12
12
|
import { join } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runHelp
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E3QU74NX.js";
|
|
4
4
|
import {
|
|
5
5
|
RAN_DESCRIPTION,
|
|
6
6
|
RUN_CLI_OPTIONS,
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
ranSchema,
|
|
13
13
|
runCommand,
|
|
14
14
|
runProblems
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LUOHJ3LB.js";
|
|
16
16
|
import {
|
|
17
17
|
recordedPlan
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TVMEKVOW.js";
|
|
19
19
|
import {
|
|
20
20
|
planSchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GJOEPJJL.js";
|
|
22
22
|
import {
|
|
23
23
|
DRIVER_PLAN_FAILURE_KINDS,
|
|
24
24
|
NOT_COUNTED
|
|
@@ -1552,6 +1552,13 @@ var TERMINATE_GRACE_MS = 1e4;
|
|
|
1552
1552
|
var KILL_GRACE_MS = 5e3;
|
|
1553
1553
|
var STDERR_MESSAGE_CHARS = 1e3;
|
|
1554
1554
|
var SNAPSHOT_GONE_STATUS = 410;
|
|
1555
|
+
var DROP_CAPABILITIES_ARGS = [
|
|
1556
|
+
"--inh-caps=-all",
|
|
1557
|
+
"--ambient-caps=-all",
|
|
1558
|
+
"--bounding-set=-all",
|
|
1559
|
+
"--no-new-privs",
|
|
1560
|
+
"--"
|
|
1561
|
+
];
|
|
1555
1562
|
function liveRunnerSandboxGateway() {
|
|
1556
1563
|
let loading;
|
|
1557
1564
|
const sdk = () => loading ??= import("@vercel/sandbox");
|
|
@@ -1651,8 +1658,8 @@ function liveRunnerSandboxGateway() {
|
|
|
1651
1658
|
const cmd = await resolveExecutable(holder, request2);
|
|
1652
1659
|
if (kill.aborted) return { ok: false, failure: { kind: "aborted" } };
|
|
1653
1660
|
const command = await startDetached(holder, {
|
|
1654
|
-
cmd,
|
|
1655
|
-
args: [...request2.args],
|
|
1661
|
+
cmd: "setpriv",
|
|
1662
|
+
args: [...DROP_CAPABILITIES_ARGS, cmd, ...request2.args],
|
|
1656
1663
|
cwd: request2.cwd,
|
|
1657
1664
|
env: { ...request2.env }
|
|
1658
1665
|
});
|
|
@@ -1909,6 +1916,16 @@ function isAborted(signal) {
|
|
|
1909
1916
|
}
|
|
1910
1917
|
|
|
1911
1918
|
// src/runner/live/terminal.ts
|
|
1919
|
+
function resolveRunnerTerminalColor(options) {
|
|
1920
|
+
if (options.noColor === true) return "off";
|
|
1921
|
+
const noColor = options.env["NO_COLOR"];
|
|
1922
|
+
if (noColor !== void 0 && noColor !== "") return "off";
|
|
1923
|
+
const forced = options.env["FORCE_COLOR"];
|
|
1924
|
+
if (forced !== void 0 && forced !== "") {
|
|
1925
|
+
return forced === "0" || forced === "false" ? "auto" : "on";
|
|
1926
|
+
}
|
|
1927
|
+
return options.isTTY && options.env["TERM"] !== "dumb" ? "on" : "auto";
|
|
1928
|
+
}
|
|
1912
1929
|
function liveRunnerTerminal(options) {
|
|
1913
1930
|
const stdout = options.stdout ?? process.stdout;
|
|
1914
1931
|
const stderr = options.stderr ?? process.stderr;
|
|
@@ -1931,7 +1948,11 @@ function liveRunnerTerminal(options) {
|
|
|
1931
1948
|
}
|
|
1932
1949
|
};
|
|
1933
1950
|
return {
|
|
1934
|
-
color:
|
|
1951
|
+
color: resolveRunnerTerminalColor({
|
|
1952
|
+
isTTY: stdout.isTTY === true,
|
|
1953
|
+
env: options.env,
|
|
1954
|
+
...options.noColor === void 0 ? {} : { noColor: options.noColor }
|
|
1955
|
+
}),
|
|
1935
1956
|
writeStdout: (text) => write(stdout, text),
|
|
1936
1957
|
writeStderr: (text) => write(stderr, text)
|
|
1937
1958
|
};
|
|
@@ -2143,7 +2164,7 @@ function sandboxEnvironment(request2) {
|
|
|
2143
2164
|
return {
|
|
2144
2165
|
PATH: [...bins, request2.loginPath].filter((part) => part !== "").join(":"),
|
|
2145
2166
|
NO_UPDATE_NOTIFIER: "1",
|
|
2146
|
-
...request2.env["FORCE_COLOR"] !== void 0 || request2.env["NO_COLOR"] !== void 0 ? {} : request2.color ? { FORCE_COLOR: "1" } : { NO_COLOR: "1" },
|
|
2167
|
+
...request2.env["FORCE_COLOR"] !== void 0 || request2.env["NO_COLOR"] !== void 0 ? {} : request2.color === "on" ? { FORCE_COLOR: "1" } : request2.color === "off" ? { NO_COLOR: "1" } : {},
|
|
2147
2168
|
...request2.env,
|
|
2148
2169
|
[RUN_PAYLOAD_VARIABLE]: request2.runPayload
|
|
2149
2170
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
redactingObserver,
|
|
7
7
|
redactingTerminal,
|
|
8
8
|
redactor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3HBPNQ4Y.js";
|
|
10
10
|
import {
|
|
11
11
|
criticalPathStep,
|
|
12
12
|
recordedPlan,
|
|
@@ -17,23 +17,23 @@ import {
|
|
|
17
17
|
testsChart,
|
|
18
18
|
testsSummaryLines,
|
|
19
19
|
waterfallLines
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TVMEKVOW.js";
|
|
21
21
|
import {
|
|
22
22
|
builtAtText,
|
|
23
23
|
rejectionLines,
|
|
24
24
|
snapshotCacheNoteText
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HDL4WKIB.js";
|
|
26
26
|
import {
|
|
27
27
|
DEFINITION_SET,
|
|
28
28
|
RESOURCES
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UUBZTGLV.js";
|
|
30
30
|
import {
|
|
31
31
|
sandboxConnectPage
|
|
32
32
|
} from "./chunk-NMVODY3P.js";
|
|
33
33
|
import {
|
|
34
34
|
recordRun,
|
|
35
35
|
timelineSchema
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-GJOEPJJL.js";
|
|
37
37
|
import {
|
|
38
38
|
isoSecondsText,
|
|
39
39
|
keepTimeText,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
truncate,
|
|
47
47
|
visibleLength,
|
|
48
48
|
withArticle
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-XZCDA5PE.js";
|
|
50
50
|
import {
|
|
51
51
|
EMPTY_RUN_STATE,
|
|
52
52
|
cleanupProblems,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
setupPhaseWords,
|
|
60
60
|
timedProgress,
|
|
61
61
|
warningTally
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-VH2POPW5.js";
|
|
63
63
|
import {
|
|
64
64
|
RUNNER_SECRET_MIN_LENGTH,
|
|
65
65
|
configErrors,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
requireTarget,
|
|
76
76
|
settleCredential,
|
|
77
77
|
settleRunResources
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-I7AN3DIJ.js";
|
|
79
79
|
import {
|
|
80
80
|
describeMintFailure,
|
|
81
81
|
isCi
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
// src/commands/exec/exec-words.ts
|
|
94
94
|
var EXEC_HELP = {
|
|
95
95
|
usage: "-- <command...>",
|
|
96
|
-
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR when that env sets neither, with paths under the repository's root rewritten.",
|
|
96
|
+
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
|
|
97
97
|
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
98
98
|
examples: [
|
|
99
99
|
{
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEFINITION_SET,
|
|
3
3
|
EXTENSIONS,
|
|
4
4
|
RESOURCES
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UUBZTGLV.js";
|
|
6
6
|
import {
|
|
7
7
|
median,
|
|
8
8
|
paint,
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
shortFile,
|
|
11
11
|
truncate,
|
|
12
12
|
visibleLength
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XZCDA5PE.js";
|
|
14
14
|
import {
|
|
15
15
|
megabytesText,
|
|
16
16
|
sameRow,
|
|
17
17
|
setupPhaseKey,
|
|
18
18
|
setupPhaseWords
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VH2POPW5.js";
|
|
20
20
|
import {
|
|
21
21
|
CONFIG_FILE_NAME
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-I7AN3DIJ.js";
|
|
23
23
|
import {
|
|
24
24
|
defaultResourceKey,
|
|
25
25
|
optionKeyPath
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
parseTestEvent,
|
|
8
8
|
systemClock,
|
|
9
9
|
systemTimer
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-I7AN3DIJ.js";
|
|
11
11
|
|
|
12
12
|
// src/core/reports.ts
|
|
13
13
|
var WARNINGS_HEADING = "Warnings";
|
|
@@ -976,7 +976,9 @@ function commandEnvironment(env, payload) {
|
|
|
976
976
|
}
|
|
977
977
|
function colorEnvironment(env, color) {
|
|
978
978
|
if (env["FORCE_COLOR"] !== void 0 || env["NO_COLOR"] !== void 0) return env;
|
|
979
|
-
|
|
979
|
+
if (color === "on") return { ...env, FORCE_COLOR: "1" };
|
|
980
|
+
if (color === "off") return { ...env, NO_COLOR: "1" };
|
|
981
|
+
return env;
|
|
980
982
|
}
|
|
981
983
|
|
|
982
984
|
// src/core/resources.ts
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
RESOURCES,
|
|
3
3
|
liveDriverContexts,
|
|
4
4
|
liveResourceContexts
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UUBZTGLV.js";
|
|
6
6
|
import "./chunk-UC6DULWY.js";
|
|
7
7
|
import "./chunk-BRUIATTR.js";
|
|
8
8
|
import {
|
|
9
9
|
RUNS_SUBPATH,
|
|
10
10
|
liveRunDirectoryGateway,
|
|
11
11
|
unavailableRunDirectoryGateway
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GJOEPJJL.js";
|
|
13
13
|
import {
|
|
14
14
|
liveCommandGateway,
|
|
15
15
|
liveJobSummaryGateway,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
liveProgressTerminal,
|
|
18
18
|
resolveStateDirectory,
|
|
19
19
|
stateDirectoryPattern
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VH2POPW5.js";
|
|
21
21
|
import {
|
|
22
22
|
RUNNER_SNAPSHOTS_SUBPATH,
|
|
23
23
|
configResolver,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
systemClock,
|
|
34
34
|
systemTimer,
|
|
35
35
|
unavailableRunnerSnapshotCacheGateway
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-I7AN3DIJ.js";
|
|
37
37
|
import "./chunk-RA4L2ACU.js";
|
|
38
38
|
import "./chunk-GQIL3AHY.js";
|
|
39
39
|
import "./chunk-GSC6SRTW.js";
|
|
@@ -71,7 +71,10 @@ function liveContext(options) {
|
|
|
71
71
|
checkout: liveCheckoutGateway(),
|
|
72
72
|
runnerSnapshots: snapshots.ok ? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
|
|
73
73
|
runnerSandboxes: liveRunnerSandboxGateway(),
|
|
74
|
-
runnerTerminal: liveRunnerTerminal({
|
|
74
|
+
runnerTerminal: liveRunnerTerminal({
|
|
75
|
+
env: options.env,
|
|
76
|
+
...options.noColor === void 0 ? {} : { noColor: options.noColor }
|
|
77
|
+
}),
|
|
75
78
|
runDirectories: runs.ok ? liveRunDirectoryGateway({ directory: runs.directory }) : unavailableRunDirectoryGateway(stateDirectoryPattern(RUNS_SUBPATH), runs.reason),
|
|
76
79
|
progressTerminal: liveProgressTerminal(),
|
|
77
80
|
jobSummary: liveJobSummaryGateway({ path: options.env["GITHUB_STEP_SUMMARY"] }),
|
|
@@ -98,8 +101,11 @@ function resolveColor(env, rich) {
|
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
// src/live-app.ts
|
|
101
|
-
function liveStormApp(host, build, exit) {
|
|
102
|
-
const context = liveContext({
|
|
104
|
+
function liveStormApp(host, build, exit, options = {}) {
|
|
105
|
+
const context = liveContext({
|
|
106
|
+
env: host.env,
|
|
107
|
+
...options.noColor === void 0 ? {} : { noColor: options.noColor }
|
|
108
|
+
});
|
|
103
109
|
return {
|
|
104
110
|
context,
|
|
105
111
|
resourceContexts: liveResourceContexts(host.env),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runHelp
|
|
3
|
-
} from "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-E3QU74NX.js";
|
|
4
4
|
import {
|
|
5
5
|
EXEC_HELP,
|
|
6
6
|
EXEC_HINTS,
|
|
@@ -9,19 +9,19 @@ import {
|
|
|
9
9
|
outcomes,
|
|
10
10
|
runCommand,
|
|
11
11
|
runProblems
|
|
12
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-LUOHJ3LB.js";
|
|
13
13
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
14
|
-
import "../../chunks/chunk-
|
|
15
|
-
import "../../chunks/chunk-
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
14
|
+
import "../../chunks/chunk-3HBPNQ4Y.js";
|
|
15
|
+
import "../../chunks/chunk-TVMEKVOW.js";
|
|
16
|
+
import "../../chunks/chunk-HDL4WKIB.js";
|
|
17
|
+
import "../../chunks/chunk-UUBZTGLV.js";
|
|
18
18
|
import "../../chunks/chunk-UC6DULWY.js";
|
|
19
19
|
import "../../chunks/chunk-BRUIATTR.js";
|
|
20
20
|
import "../../chunks/chunk-NMVODY3P.js";
|
|
21
|
-
import "../../chunks/chunk-
|
|
22
|
-
import "../../chunks/chunk-
|
|
23
|
-
import "../../chunks/chunk-
|
|
24
|
-
import "../../chunks/chunk-
|
|
21
|
+
import "../../chunks/chunk-GJOEPJJL.js";
|
|
22
|
+
import "../../chunks/chunk-XZCDA5PE.js";
|
|
23
|
+
import "../../chunks/chunk-VH2POPW5.js";
|
|
24
|
+
import "../../chunks/chunk-I7AN3DIJ.js";
|
|
25
25
|
import {
|
|
26
26
|
NOT_COUNTED
|
|
27
27
|
} from "../../chunks/chunk-RA4L2ACU.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/** `exec`'s part of its leaf help: its usage after the run flags, its arguments, `--verbose`'s ending and its examples. */
|
|
7
7
|
export const EXEC_HELP = {
|
|
8
8
|
usage: "-- <command...>",
|
|
9
|
-
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR when that env sets neither, with paths under the repository's root rewritten.",
|
|
9
|
+
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
|
|
10
10
|
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/commands/exec/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
|
-
description: "Run any command, the argument list after --, as it is, with the run payload in STORM_RUN. For vitest, use storm vitest, which finds vitest and can count the tests and size the run first (testPlan in storm.config.ts); exec counts nothing and sizes nothing. In an unsandboxed run (--unsandboxed), the command runs on this machine in the working directory, with this machine's environment less the launcher environment variables the run's resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set. In a sandboxed run, the default, it runs in a runner sandbox, a Vercel Sandbox readied from the runner recipe in storm.config.ts, in the recipe's cwd, with the runner sandbox's own environment, a PATH that starts with node_modules/.bin of that cwd and of the repository's root, the recipe's env, FORCE_COLOR or NO_COLOR only when that env sets neither (
|
|
3
|
+
description: "Run any command, the argument list after --, as it is, with the run payload in STORM_RUN. For vitest, use storm vitest, which finds vitest and can count the tests and size the run first (testPlan in storm.config.ts); exec counts nothing and sizes nothing. In an unsandboxed run (--unsandboxed), the command runs on this machine in the working directory, with this machine's environment less the launcher environment variables the run's resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color. In a sandboxed run, the default, it runs in a runner sandbox, a Vercel Sandbox readied from the runner recipe in storm.config.ts, in the recipe's cwd, with the runner sandbox's own environment, a PATH that starts with node_modules/.bin of that cwd and of the repository's root, the recipe's env, FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color (a plain non-TTY launcher gets neither), and STORM_RUN, and nothing else from this machine's environment; each recipe step that names a runner secret, never the command, also gets that launcher environment variable, one its secrets key declares, shown as <token> in what storm prints and writes, and a sandboxed run refuses before it starts when one of them is unset, holds a line break or is shorter than 8 characters; each path under the repository's root in its arguments points at the runner sandbox's copy, and each in its output back at this checkout. The run has each resource that storm.config.ts declares under resources or that one of the resource's own flags names, unless the resource skips itself: it first acquires each one, while a sandboxed run readies its runner sandbox, hands it to the command under the run payload's resources, and releases it once the command has stopped; without one, the run payload names no resource. Each resource's flags and examples are below, and its own commands are under storm ext. Shows on stderr what runs when and what runs at once, live on a terminal and one line at a time elsewhere, then a waterfall of the run's lanes naming its critical path, and exits with the command's code. A run whose command exits 0 but saves no final test result warns no_final_test_results, whose next steps say how to add storm's reporter if the command runs tests. Each run writes what it was and how it ended, its events, its steps' output, its command's output, its test events and its timeline to a run directory under ${XDG_STATE_HOME:-~/.local/state}/storm/runs/, named for its run id, keeping the newest 1000 completed ones and every one whose run is still going; the summary names the run id, storm runs show reads the run back, and storm runs logs prints its command's output and its steps' logs. A flag overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default. A secret a resource hands its command, such as a test-data token, shows as <token> in what the run prints and writes.",
|
|
4
4
|
summary: "Run any command, in a runner sandbox or unsandboxed."
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineRunCommand
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-HP54VHGY.js";
|
|
4
|
+
import "../../chunks/chunk-E3QU74NX.js";
|
|
5
|
+
import "../../chunks/chunk-LUOHJ3LB.js";
|
|
6
6
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
7
|
-
import "../../chunks/chunk-
|
|
8
|
-
import "../../chunks/chunk-
|
|
9
|
-
import "../../chunks/chunk-
|
|
7
|
+
import "../../chunks/chunk-3HBPNQ4Y.js";
|
|
8
|
+
import "../../chunks/chunk-TVMEKVOW.js";
|
|
9
|
+
import "../../chunks/chunk-HDL4WKIB.js";
|
|
10
10
|
import {
|
|
11
11
|
driverNamed
|
|
12
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-UUBZTGLV.js";
|
|
13
13
|
import "../../chunks/chunk-UC6DULWY.js";
|
|
14
14
|
import "../../chunks/chunk-BRUIATTR.js";
|
|
15
15
|
import "../../chunks/chunk-NMVODY3P.js";
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
18
|
-
import "../../chunks/chunk-
|
|
19
|
-
import "../../chunks/chunk-
|
|
16
|
+
import "../../chunks/chunk-GJOEPJJL.js";
|
|
17
|
+
import "../../chunks/chunk-XZCDA5PE.js";
|
|
18
|
+
import "../../chunks/chunk-VH2POPW5.js";
|
|
19
|
+
import "../../chunks/chunk-I7AN3DIJ.js";
|
|
20
20
|
import "../../chunks/chunk-RA4L2ACU.js";
|
|
21
21
|
import "../../chunks/chunk-BW2ADH7U.js";
|
|
22
22
|
import "../../chunks/chunk-GQIL3AHY.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
tookText,
|
|
18
18
|
totalsText,
|
|
19
19
|
totalsTone
|
|
20
|
-
} from "../../../chunks/chunk-
|
|
20
|
+
} from "../../../chunks/chunk-RUPD4TLT.js";
|
|
21
21
|
import {
|
|
22
22
|
muted,
|
|
23
23
|
path,
|
|
@@ -27,12 +27,12 @@ import {
|
|
|
27
27
|
import "../../../chunks/chunk-NMVODY3P.js";
|
|
28
28
|
import {
|
|
29
29
|
pastRuns
|
|
30
|
-
} from "../../../chunks/chunk-
|
|
31
|
-
import "../../../chunks/chunk-
|
|
32
|
-
import "../../../chunks/chunk-
|
|
30
|
+
} from "../../../chunks/chunk-GJOEPJJL.js";
|
|
31
|
+
import "../../../chunks/chunk-XZCDA5PE.js";
|
|
32
|
+
import "../../../chunks/chunk-VH2POPW5.js";
|
|
33
33
|
import {
|
|
34
34
|
findConfigFile
|
|
35
|
-
} from "../../../chunks/chunk-
|
|
35
|
+
} from "../../../chunks/chunk-I7AN3DIJ.js";
|
|
36
36
|
import "../../../chunks/chunk-RA4L2ACU.js";
|
|
37
37
|
import {
|
|
38
38
|
stormCommands
|
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
runsUnreadable,
|
|
8
8
|
scopeFacts,
|
|
9
9
|
scopeSchema
|
|
10
|
-
} from "../../../chunks/chunk-
|
|
10
|
+
} from "../../../chunks/chunk-RUPD4TLT.js";
|
|
11
11
|
import {
|
|
12
12
|
renderOutcome
|
|
13
13
|
} from "../../../chunks/chunk-T6AZIDZD.js";
|
|
14
14
|
import "../../../chunks/chunk-NMVODY3P.js";
|
|
15
15
|
import {
|
|
16
16
|
pastRuns
|
|
17
|
-
} from "../../../chunks/chunk-
|
|
18
|
-
import "../../../chunks/chunk-
|
|
19
|
-
import "../../../chunks/chunk-
|
|
17
|
+
} from "../../../chunks/chunk-GJOEPJJL.js";
|
|
18
|
+
import "../../../chunks/chunk-XZCDA5PE.js";
|
|
19
|
+
import "../../../chunks/chunk-VH2POPW5.js";
|
|
20
20
|
import {
|
|
21
21
|
findConfigFile
|
|
22
|
-
} from "../../../chunks/chunk-
|
|
22
|
+
} from "../../../chunks/chunk-I7AN3DIJ.js";
|
|
23
23
|
import "../../../chunks/chunk-RA4L2ACU.js";
|
|
24
24
|
import {
|
|
25
25
|
stormCommands
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
tookText,
|
|
21
21
|
totalsText,
|
|
22
22
|
totalsTone
|
|
23
|
-
} from "../../../chunks/chunk-
|
|
23
|
+
} from "../../../chunks/chunk-RUPD4TLT.js";
|
|
24
24
|
import {
|
|
25
25
|
bold,
|
|
26
26
|
capsFor,
|
|
@@ -29,11 +29,11 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
testPlanText,
|
|
31
31
|
waterfallLines
|
|
32
|
-
} from "../../../chunks/chunk-
|
|
32
|
+
} from "../../../chunks/chunk-TVMEKVOW.js";
|
|
33
33
|
import {
|
|
34
34
|
builtAtText
|
|
35
|
-
} from "../../../chunks/chunk-
|
|
36
|
-
import "../../../chunks/chunk-
|
|
35
|
+
} from "../../../chunks/chunk-HDL4WKIB.js";
|
|
36
|
+
import "../../../chunks/chunk-UUBZTGLV.js";
|
|
37
37
|
import "../../../chunks/chunk-UC6DULWY.js";
|
|
38
38
|
import "../../../chunks/chunk-BRUIATTR.js";
|
|
39
39
|
import "../../../chunks/chunk-NMVODY3P.js";
|
|
@@ -41,16 +41,16 @@ import {
|
|
|
41
41
|
pastRuns,
|
|
42
42
|
planSchema,
|
|
43
43
|
timelineSchema
|
|
44
|
-
} from "../../../chunks/chunk-
|
|
44
|
+
} from "../../../chunks/chunk-GJOEPJJL.js";
|
|
45
45
|
import {
|
|
46
46
|
short
|
|
47
|
-
} from "../../../chunks/chunk-
|
|
47
|
+
} from "../../../chunks/chunk-XZCDA5PE.js";
|
|
48
48
|
import {
|
|
49
49
|
megabytesText
|
|
50
|
-
} from "../../../chunks/chunk-
|
|
50
|
+
} from "../../../chunks/chunk-VH2POPW5.js";
|
|
51
51
|
import {
|
|
52
52
|
findConfigFile
|
|
53
|
-
} from "../../../chunks/chunk-
|
|
53
|
+
} from "../../../chunks/chunk-I7AN3DIJ.js";
|
|
54
54
|
import "../../../chunks/chunk-RA4L2ACU.js";
|
|
55
55
|
import "../../../chunks/chunk-GQIL3AHY.js";
|
|
56
56
|
import "../../../chunks/chunk-GSC6SRTW.js";
|
|
@@ -9,28 +9,28 @@ import {
|
|
|
9
9
|
prepareRefusal,
|
|
10
10
|
runErrors,
|
|
11
11
|
runnerFailureFacts
|
|
12
|
-
} from "../../../chunks/chunk-
|
|
12
|
+
} from "../../../chunks/chunk-LUOHJ3LB.js";
|
|
13
13
|
import "../../../chunks/chunk-I5GZLOLQ.js";
|
|
14
14
|
import {
|
|
15
15
|
redactStrings,
|
|
16
16
|
redactor
|
|
17
|
-
} from "../../../chunks/chunk-
|
|
18
|
-
import "../../../chunks/chunk-
|
|
19
|
-
import "../../../chunks/chunk-
|
|
17
|
+
} from "../../../chunks/chunk-3HBPNQ4Y.js";
|
|
18
|
+
import "../../../chunks/chunk-TVMEKVOW.js";
|
|
19
|
+
import "../../../chunks/chunk-HDL4WKIB.js";
|
|
20
20
|
import {
|
|
21
21
|
RESOURCES
|
|
22
|
-
} from "../../../chunks/chunk-
|
|
22
|
+
} from "../../../chunks/chunk-UUBZTGLV.js";
|
|
23
23
|
import "../../../chunks/chunk-UC6DULWY.js";
|
|
24
24
|
import "../../../chunks/chunk-BRUIATTR.js";
|
|
25
25
|
import "../../../chunks/chunk-NMVODY3P.js";
|
|
26
|
-
import "../../../chunks/chunk-
|
|
26
|
+
import "../../../chunks/chunk-GJOEPJJL.js";
|
|
27
27
|
import {
|
|
28
28
|
seconds,
|
|
29
29
|
short
|
|
30
|
-
} from "../../../chunks/chunk-
|
|
30
|
+
} from "../../../chunks/chunk-XZCDA5PE.js";
|
|
31
31
|
import {
|
|
32
32
|
megabytesText
|
|
33
|
-
} from "../../../chunks/chunk-
|
|
33
|
+
} from "../../../chunks/chunk-VH2POPW5.js";
|
|
34
34
|
import {
|
|
35
35
|
RUNNER_SECRET_MIN_LENGTH,
|
|
36
36
|
buildSnapshots,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
prepareSnapshotBuild,
|
|
43
43
|
readRunnerSecrets,
|
|
44
44
|
requireTarget
|
|
45
|
-
} from "../../../chunks/chunk-
|
|
45
|
+
} from "../../../chunks/chunk-I7AN3DIJ.js";
|
|
46
46
|
import "../../../chunks/chunk-RA4L2ACU.js";
|
|
47
47
|
import "../../../chunks/chunk-BW2ADH7U.js";
|
|
48
48
|
import "../../../chunks/chunk-GQIL3AHY.js";
|
|
@@ -4,29 +4,29 @@ import {
|
|
|
4
4
|
} from "../../../chunks/chunk-T6AZIDZD.js";
|
|
5
5
|
import {
|
|
6
6
|
redactor
|
|
7
|
-
} from "../../../chunks/chunk-
|
|
7
|
+
} from "../../../chunks/chunk-3HBPNQ4Y.js";
|
|
8
8
|
import {
|
|
9
9
|
REJECTIONS_SHOWN,
|
|
10
10
|
REJECTION_REASONS,
|
|
11
11
|
builtAtText,
|
|
12
12
|
rejectionText
|
|
13
|
-
} from "../../../chunks/chunk-
|
|
13
|
+
} from "../../../chunks/chunk-HDL4WKIB.js";
|
|
14
14
|
import {
|
|
15
15
|
RESOURCES
|
|
16
|
-
} from "../../../chunks/chunk-
|
|
16
|
+
} from "../../../chunks/chunk-UUBZTGLV.js";
|
|
17
17
|
import "../../../chunks/chunk-UC6DULWY.js";
|
|
18
18
|
import "../../../chunks/chunk-BRUIATTR.js";
|
|
19
19
|
import {
|
|
20
20
|
short
|
|
21
|
-
} from "../../../chunks/chunk-
|
|
22
|
-
import "../../../chunks/chunk-
|
|
21
|
+
} from "../../../chunks/chunk-XZCDA5PE.js";
|
|
22
|
+
import "../../../chunks/chunk-VH2POPW5.js";
|
|
23
23
|
import {
|
|
24
24
|
configErrors,
|
|
25
25
|
declaredSecretValues,
|
|
26
26
|
inspectSnapshotCache,
|
|
27
27
|
invalidConfig,
|
|
28
28
|
loadSettingsFile
|
|
29
|
-
} from "../../../chunks/chunk-
|
|
29
|
+
} from "../../../chunks/chunk-I7AN3DIJ.js";
|
|
30
30
|
import "../../../chunks/chunk-RA4L2ACU.js";
|
|
31
31
|
import "../../../chunks/chunk-GQIL3AHY.js";
|
|
32
32
|
import "../../../chunks/chunk-GSC6SRTW.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineRunCommand
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-HP54VHGY.js";
|
|
4
|
+
import "../../chunks/chunk-E3QU74NX.js";
|
|
5
|
+
import "../../chunks/chunk-LUOHJ3LB.js";
|
|
6
6
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
7
|
-
import "../../chunks/chunk-
|
|
8
|
-
import "../../chunks/chunk-
|
|
9
|
-
import "../../chunks/chunk-
|
|
7
|
+
import "../../chunks/chunk-3HBPNQ4Y.js";
|
|
8
|
+
import "../../chunks/chunk-TVMEKVOW.js";
|
|
9
|
+
import "../../chunks/chunk-HDL4WKIB.js";
|
|
10
10
|
import {
|
|
11
11
|
driverNamed
|
|
12
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-UUBZTGLV.js";
|
|
13
13
|
import "../../chunks/chunk-UC6DULWY.js";
|
|
14
14
|
import "../../chunks/chunk-BRUIATTR.js";
|
|
15
15
|
import "../../chunks/chunk-NMVODY3P.js";
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
18
|
-
import "../../chunks/chunk-
|
|
19
|
-
import "../../chunks/chunk-
|
|
16
|
+
import "../../chunks/chunk-GJOEPJJL.js";
|
|
17
|
+
import "../../chunks/chunk-XZCDA5PE.js";
|
|
18
|
+
import "../../chunks/chunk-VH2POPW5.js";
|
|
19
|
+
import "../../chunks/chunk-I7AN3DIJ.js";
|
|
20
20
|
import "../../chunks/chunk-RA4L2ACU.js";
|
|
21
21
|
import "../../chunks/chunk-BW2ADH7U.js";
|
|
22
22
|
import "../../chunks/chunk-GQIL3AHY.js";
|
package/dist/context.d.ts
CHANGED
package/dist/context.js
CHANGED
|
@@ -47,7 +47,10 @@ export function liveContext(options) {
|
|
|
47
47
|
? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory })
|
|
48
48
|
: unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
|
|
49
49
|
runnerSandboxes: liveRunnerSandboxGateway(),
|
|
50
|
-
runnerTerminal: liveRunnerTerminal({
|
|
50
|
+
runnerTerminal: liveRunnerTerminal({
|
|
51
|
+
env: options.env,
|
|
52
|
+
...(options.noColor === undefined ? {} : { noColor: options.noColor }),
|
|
53
|
+
}),
|
|
51
54
|
runDirectories: runs.ok
|
|
52
55
|
? liveRunDirectoryGateway({ directory: runs.directory })
|
|
53
56
|
: unavailableRunDirectoryGateway(stateDirectoryPattern(RUNS_SUBPATH), runs.reason),
|
package/dist/core/payload.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RunnerTerminalColor } from "../runner/index.ts";
|
|
1
2
|
import { type RunPayloadInstance, type RunPayloadJson } from "../sdk/run/launcher.ts";
|
|
2
3
|
/**
|
|
3
4
|
* The run payload for a run with `resources`, what each acquired resource instance hands the command, under its
|
|
@@ -19,7 +20,8 @@ export declare function runPayload<R extends {
|
|
|
19
20
|
export declare function commandEnvironment(env: Readonly<Record<string, string | undefined>>, payload: RunPayloadJson): Readonly<Record<string, string>>;
|
|
20
21
|
/**
|
|
21
22
|
* `env` with color set for a spawned command whose stdout and stderr are pipes, so it can't tell whether a
|
|
22
|
-
* terminal shows color: `FORCE_COLOR=1` when the terminal
|
|
23
|
-
* `
|
|
23
|
+
* terminal shows color: `FORCE_COLOR=1` when the launcher terminal asks for color (`"on"`), `NO_COLOR=1` when the
|
|
24
|
+
* launcher explicitly opted out (`"off"`), and neither on a plain non-TTY launcher (`"auto"`). An `env` that sets
|
|
25
|
+
* either already is left as it is.
|
|
24
26
|
*/
|
|
25
|
-
export declare function colorEnvironment(env: Readonly<Record<string, string | undefined>>, color:
|
|
27
|
+
export declare function colorEnvironment(env: Readonly<Record<string, string | undefined>>, color: RunnerTerminalColor): Readonly<Record<string, string | undefined>>;
|
package/dist/core/payload.js
CHANGED
|
@@ -24,11 +24,16 @@ export function commandEnvironment(env, payload) {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* `env` with color set for a spawned command whose stdout and stderr are pipes, so it can't tell whether a
|
|
27
|
-
* terminal shows color: `FORCE_COLOR=1` when the terminal
|
|
28
|
-
* `
|
|
27
|
+
* terminal shows color: `FORCE_COLOR=1` when the launcher terminal asks for color (`"on"`), `NO_COLOR=1` when the
|
|
28
|
+
* launcher explicitly opted out (`"off"`), and neither on a plain non-TTY launcher (`"auto"`). An `env` that sets
|
|
29
|
+
* either already is left as it is.
|
|
29
30
|
*/
|
|
30
31
|
export function colorEnvironment(env, color) {
|
|
31
32
|
if (env["FORCE_COLOR"] !== undefined || env["NO_COLOR"] !== undefined)
|
|
32
33
|
return env;
|
|
33
|
-
|
|
34
|
+
if (color === "on")
|
|
35
|
+
return { ...env, FORCE_COLOR: "1" };
|
|
36
|
+
if (color === "off")
|
|
37
|
+
return { ...env, NO_COLOR: "1" };
|
|
38
|
+
return env;
|
|
34
39
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
configErrors,
|
|
25
25
|
credentialErrors,
|
|
26
26
|
credentialSourceErrors
|
|
27
|
-
} from "../../../../../chunks/chunk-
|
|
27
|
+
} from "../../../../../chunks/chunk-I7AN3DIJ.js";
|
|
28
28
|
import "../../../../../chunks/chunk-RA4L2ACU.js";
|
|
29
29
|
import {
|
|
30
30
|
testserverCommands
|
package/dist/live-app.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export interface StormBuild {
|
|
|
6
6
|
readonly commit: string | null;
|
|
7
7
|
}
|
|
8
8
|
/** The live app over the resolved host, whose commands record their status in `exit`, which the executable reads. */
|
|
9
|
-
export declare function liveStormApp(host: NodeHost, build: StormBuild, exit: StormExit
|
|
9
|
+
export declare function liveStormApp(host: NodeHost, build: StormBuild, exit: StormExit, options?: {
|
|
10
|
+
readonly noColor?: boolean;
|
|
11
|
+
}): StormApp;
|
package/dist/live-app.js
CHANGED
|
@@ -7,8 +7,11 @@ import { resolvePresentation } from "./presentation.js";
|
|
|
7
7
|
import { liveDriverContexts, liveResourceContexts, RESOURCES } from "./extensions.js";
|
|
8
8
|
import { localUserName } from "./runner/index.js";
|
|
9
9
|
/** The live app over the resolved host, whose commands record their status in `exit`, which the executable reads. */
|
|
10
|
-
export function liveStormApp(host, build, exit) {
|
|
11
|
-
const context = liveContext({
|
|
10
|
+
export function liveStormApp(host, build, exit, options = {}) {
|
|
11
|
+
const context = liveContext({
|
|
12
|
+
env: host.env,
|
|
13
|
+
...(options.noColor === undefined ? {} : { noColor: options.noColor }),
|
|
14
|
+
});
|
|
12
15
|
return {
|
|
13
16
|
context,
|
|
14
17
|
resourceContexts: liveResourceContexts(host.env),
|
|
@@ -353,12 +353,20 @@ export interface RunnerSandboxGateway {
|
|
|
353
353
|
/** Deletes a sandbox, keeping every snapshot it was started from or saved as. */
|
|
354
354
|
delete(sandbox: RunnerSandbox): Promise<RunnerSandboxOperation>;
|
|
355
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* What color environment variable the launcher terminal asks the command to receive when the command's own
|
|
358
|
+
* environment sets neither `FORCE_COLOR` nor `NO_COLOR`:
|
|
359
|
+
* - `"on"`: set `FORCE_COLOR=1` (stdout is a TTY, or launcher `FORCE_COLOR` turns color on).
|
|
360
|
+
* - `"off"`: set `NO_COLOR=1` (`--no-color` was passed, or launcher `NO_COLOR` is set and non-empty).
|
|
361
|
+
* - `"auto"`: set neither (non-TTY launcher with no explicit color setting, or `FORCE_COLOR` set to `0` or `false`).
|
|
362
|
+
*/
|
|
363
|
+
export type RunnerTerminalColor = "on" | "off" | "auto";
|
|
356
364
|
/**
|
|
357
365
|
* The terminal the command's output reaches, wherever the command runs, a DI seam: stdout and stderr, and whether the
|
|
358
|
-
* terminal
|
|
366
|
+
* launcher terminal asks the command for color. Writes never throw.
|
|
359
367
|
*/
|
|
360
368
|
export interface RunnerTerminal {
|
|
361
|
-
readonly color:
|
|
369
|
+
readonly color: RunnerTerminalColor;
|
|
362
370
|
writeStdout(text: string): void;
|
|
363
371
|
writeStderr(text: string): void;
|
|
364
372
|
}
|
package/dist/runner/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { RunnerContext } from "./context.ts";
|
|
2
2
|
export { buildSnapshots, prepareSnapshotBuild, type PrepareSnapshotBuildOutcome, type SnapshotBuildOutcome, } from "./build-snapshots.ts";
|
|
3
3
|
export { type KeptSandbox, type RunnerEvent, type RunnerFailure, type RunnerProgress, type RunnerStepPhase, type SnapshotBuildReason, } from "./events.ts";
|
|
4
|
-
export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, } from "./gateways.ts";
|
|
4
|
+
export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, RunnerTerminalColor, } from "./gateways.ts";
|
|
5
5
|
export { liveCheckoutGateway } from "./live/checkout-gateway.ts";
|
|
6
6
|
export { liveRunnerSandboxGateway } from "./live/sandbox-gateway.ts";
|
|
7
7
|
export { liveRunnerTerminal } from "./live/terminal.ts";
|
|
@@ -15,6 +15,20 @@ export const KILL_GRACE_MS = 5_000;
|
|
|
15
15
|
const STDERR_MESSAGE_CHARS = 1000;
|
|
16
16
|
/** The Sandbox API's answer when a snapshot to start from has expired or been deleted. */
|
|
17
17
|
const SNAPSHOT_GONE_STATUS = 410;
|
|
18
|
+
/**
|
|
19
|
+
* `setpriv` flags used to drop every Linux capability and block privilege escalation before `execve` of the user
|
|
20
|
+
* command. Vercel Sandbox's default `vercel-sandbox` user (uid 1000) holds full capabilities (`CAP_DAC_OVERRIDE`,
|
|
21
|
+
* `CAP_DAC_READ_SEARCH`, etc.), which causes filesystem permission tests (`chmod 0500` / `0444`) to pass writes
|
|
22
|
+
* instead of failing with `EACCES`. Only `runCommand` uses this; `runScript` keeps capabilities so toolchain steps
|
|
23
|
+
* can run `sudo dnf install`.
|
|
24
|
+
*/
|
|
25
|
+
const DROP_CAPABILITIES_ARGS = [
|
|
26
|
+
"--inh-caps=-all",
|
|
27
|
+
"--ambient-caps=-all",
|
|
28
|
+
"--bounding-set=-all",
|
|
29
|
+
"--no-new-privs",
|
|
30
|
+
"--",
|
|
31
|
+
];
|
|
18
32
|
/** Vercel Sandbox through `@vercel/sandbox`. */
|
|
19
33
|
export function liveRunnerSandboxGateway() {
|
|
20
34
|
let loading;
|
|
@@ -125,8 +139,8 @@ export function liveRunnerSandboxGateway() {
|
|
|
125
139
|
if (kill.aborted)
|
|
126
140
|
return { ok: false, failure: { kind: "aborted" } };
|
|
127
141
|
const command = await startDetached(holder, {
|
|
128
|
-
cmd,
|
|
129
|
-
args: [...request.args],
|
|
142
|
+
cmd: "setpriv",
|
|
143
|
+
args: [...DROP_CAPABILITIES_ARGS, cmd, ...request.args],
|
|
130
144
|
cwd: request.cwd,
|
|
131
145
|
env: { ...request.env },
|
|
132
146
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RunnerTerminal } from "../gateways.ts";
|
|
1
|
+
import type { RunnerTerminal, RunnerTerminalColor } from "../gateways.ts";
|
|
2
2
|
/** The part of a writable stream the terminal uses: `process.stdout` and `process.stderr` have it. */
|
|
3
3
|
export interface TerminalStream {
|
|
4
4
|
readonly isTTY?: boolean;
|
|
@@ -6,11 +6,23 @@ export interface TerminalStream {
|
|
|
6
6
|
on(event: "error", listener: (error: Error) => void): unknown;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* launcher
|
|
9
|
+
* Resolves the color policy for a command launched from this terminal:
|
|
10
|
+
* - `"off"` when `--no-color` was passed or launcher `NO_COLOR` is set and non-empty.
|
|
11
|
+
* - `"on"` when launcher `FORCE_COLOR` is set to a non-empty value other than `"0"` or `"false"`, or `stdout` is a TTY and `TERM` isn't `"dumb"`.
|
|
12
|
+
* - `"auto"` otherwise, so a non-TTY or `TERM=dumb` launcher with no explicit color opt-out sets neither `FORCE_COLOR` nor `NO_COLOR`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveRunnerTerminalColor(options: {
|
|
15
|
+
readonly isTTY: boolean;
|
|
16
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
17
|
+
readonly noColor?: boolean;
|
|
18
|
+
}): RunnerTerminalColor;
|
|
19
|
+
/**
|
|
20
|
+
* A terminal over `stdout` and `stderr`, by default this process's. Its `color` reflects explicit `--no-color` /
|
|
21
|
+
* `NO_COLOR`, explicit `FORCE_COLOR`, or an interactive TTY stdout, and stays `"auto"` on a plain non-TTY launcher.
|
|
11
22
|
*/
|
|
12
23
|
export declare function liveRunnerTerminal(options: {
|
|
13
24
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
25
|
+
readonly noColor?: boolean;
|
|
14
26
|
readonly stdout?: TerminalStream;
|
|
15
27
|
readonly stderr?: TerminalStream;
|
|
16
28
|
}): RunnerTerminal;
|
|
@@ -2,8 +2,26 @@
|
|
|
2
2
|
// EPIPE after SIGHUP closes the terminal, it stops writing, so a closed terminal can't crash storm before it
|
|
3
3
|
// cleans up its sandboxes.
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* launcher
|
|
5
|
+
* Resolves the color policy for a command launched from this terminal:
|
|
6
|
+
* - `"off"` when `--no-color` was passed or launcher `NO_COLOR` is set and non-empty.
|
|
7
|
+
* - `"on"` when launcher `FORCE_COLOR` is set to a non-empty value other than `"0"` or `"false"`, or `stdout` is a TTY and `TERM` isn't `"dumb"`.
|
|
8
|
+
* - `"auto"` otherwise, so a non-TTY or `TERM=dumb` launcher with no explicit color opt-out sets neither `FORCE_COLOR` nor `NO_COLOR`.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveRunnerTerminalColor(options) {
|
|
11
|
+
if (options.noColor === true)
|
|
12
|
+
return "off";
|
|
13
|
+
const noColor = options.env["NO_COLOR"];
|
|
14
|
+
if (noColor !== undefined && noColor !== "")
|
|
15
|
+
return "off";
|
|
16
|
+
const forced = options.env["FORCE_COLOR"];
|
|
17
|
+
if (forced !== undefined && forced !== "") {
|
|
18
|
+
return forced === "0" || forced === "false" ? "auto" : "on";
|
|
19
|
+
}
|
|
20
|
+
return options.isTTY && options.env["TERM"] !== "dumb" ? "on" : "auto";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A terminal over `stdout` and `stderr`, by default this process's. Its `color` reflects explicit `--no-color` /
|
|
24
|
+
* `NO_COLOR`, explicit `FORCE_COLOR`, or an interactive TTY stdout, and stays `"auto"` on a plain non-TTY launcher.
|
|
7
25
|
*/
|
|
8
26
|
export function liveRunnerTerminal(options) {
|
|
9
27
|
const stdout = options.stdout ?? process.stdout;
|
|
@@ -30,7 +48,11 @@ export function liveRunnerTerminal(options) {
|
|
|
30
48
|
}
|
|
31
49
|
};
|
|
32
50
|
return {
|
|
33
|
-
color:
|
|
51
|
+
color: resolveRunnerTerminalColor({
|
|
52
|
+
isTTY: stdout.isTTY === true,
|
|
53
|
+
env: options.env,
|
|
54
|
+
...(options.noColor === undefined ? {} : { noColor: options.noColor }),
|
|
55
|
+
}),
|
|
34
56
|
writeStdout: (text) => write(stdout, text),
|
|
35
57
|
writeStderr: (text) => write(stderr, text),
|
|
36
58
|
};
|
package/dist/runner/recipe.d.ts
CHANGED
|
@@ -54,8 +54,9 @@ export interface RunnerRecipe<Run = never> {
|
|
|
54
54
|
readonly vcpus: number | ((run: Run) => number);
|
|
55
55
|
/**
|
|
56
56
|
* Extra environment variables for the command. It can't set `STORM_RUN`. When it sets neither `FORCE_COLOR` nor
|
|
57
|
-
* `NO_COLOR`, storm sets `FORCE_COLOR=1` when the local terminal
|
|
58
|
-
*
|
|
57
|
+
* `NO_COLOR`, storm sets `FORCE_COLOR=1` when the local terminal asks for color (a TTY or `FORCE_COLOR`),
|
|
58
|
+
* `NO_COLOR=1` when the launcher explicitly opted out (`--no-color` or a non-empty `NO_COLOR`), and neither on a
|
|
59
|
+
* plain non-TTY launcher; when the recipe sets either, storm sets neither.
|
|
59
60
|
*/
|
|
60
61
|
readonly env?: Readonly<Record<string, string>>;
|
|
61
62
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Clock } from "../time/index.ts";
|
|
2
2
|
import type { RunnerFailure, RunnerProgress } from "./events.ts";
|
|
3
|
-
import type { RunnerSandboxGateway, RunnerTerminal } from "./gateways.ts";
|
|
3
|
+
import type { RunnerSandboxGateway, RunnerTerminal, RunnerTerminalColor } from "./gateways.ts";
|
|
4
4
|
import type { ReadyRunner } from "./ready.ts";
|
|
5
5
|
/**
|
|
6
6
|
* The command as the runner sandbox runs it: each `<repoRoot>/` in its arguments, the executable's included, points
|
|
@@ -18,14 +18,14 @@ export declare function sandboxedCommand(request: {
|
|
|
18
18
|
* What the command's environment adds to the runner sandbox's own: `PATH` with the sandbox `cwd`'s and the
|
|
19
19
|
* repository's `node_modules/.bin` before the login shell's, no update checks, the recipe's `env`, and `STORM_RUN`
|
|
20
20
|
* last, so nothing overrides it. When the recipe's `env` sets neither `FORCE_COLOR` nor `NO_COLOR`, it also gets
|
|
21
|
-
* `FORCE_COLOR=1` when the local terminal
|
|
22
|
-
* (`
|
|
23
|
-
* the local environment.
|
|
21
|
+
* `FORCE_COLOR=1` when the local terminal asks for color (`"on"`), `NO_COLOR=1` when the launcher explicitly opted out
|
|
22
|
+
* (`"off"`), and neither on a plain non-TTY launcher (`"auto"`), as a run with no runner does (`colorEnvironment` in
|
|
23
|
+
* `core/payload.ts`); a recipe that sets either gets neither from storm. Nothing else comes from the local environment.
|
|
24
24
|
*/
|
|
25
25
|
export declare function sandboxEnvironment(request: {
|
|
26
26
|
readonly cwd: string;
|
|
27
27
|
readonly loginPath: string;
|
|
28
|
-
readonly color:
|
|
28
|
+
readonly color: RunnerTerminalColor;
|
|
29
29
|
readonly env: Readonly<Record<string, string>>;
|
|
30
30
|
readonly runPayload: string;
|
|
31
31
|
}): Record<string, string>;
|
|
@@ -18,9 +18,9 @@ export function sandboxedCommand(request) {
|
|
|
18
18
|
* What the command's environment adds to the runner sandbox's own: `PATH` with the sandbox `cwd`'s and the
|
|
19
19
|
* repository's `node_modules/.bin` before the login shell's, no update checks, the recipe's `env`, and `STORM_RUN`
|
|
20
20
|
* last, so nothing overrides it. When the recipe's `env` sets neither `FORCE_COLOR` nor `NO_COLOR`, it also gets
|
|
21
|
-
* `FORCE_COLOR=1` when the local terminal
|
|
22
|
-
* (`
|
|
23
|
-
* the local environment.
|
|
21
|
+
* `FORCE_COLOR=1` when the local terminal asks for color (`"on"`), `NO_COLOR=1` when the launcher explicitly opted out
|
|
22
|
+
* (`"off"`), and neither on a plain non-TTY launcher (`"auto"`), as a run with no runner does (`colorEnvironment` in
|
|
23
|
+
* `core/payload.ts`); a recipe that sets either gets neither from storm. Nothing else comes from the local environment.
|
|
24
24
|
*/
|
|
25
25
|
export function sandboxEnvironment(request) {
|
|
26
26
|
const bins = [
|
|
@@ -31,9 +31,11 @@ export function sandboxEnvironment(request) {
|
|
|
31
31
|
NO_UPDATE_NOTIFIER: "1",
|
|
32
32
|
...(request.env["FORCE_COLOR"] !== undefined || request.env["NO_COLOR"] !== undefined
|
|
33
33
|
? {}
|
|
34
|
-
: request.color
|
|
34
|
+
: request.color === "on"
|
|
35
35
|
? { FORCE_COLOR: "1" }
|
|
36
|
-
:
|
|
36
|
+
: request.color === "off"
|
|
37
|
+
? { NO_COLOR: "1" }
|
|
38
|
+
: {}),
|
|
37
39
|
...request.env,
|
|
38
40
|
[RUN_PAYLOAD_VARIABLE]: request.runPayload,
|
|
39
41
|
};
|
package/package.json
CHANGED