@duyquangnvx/agent-cli 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/agent-cli.js +9 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/built-ins/agents-md.d.ts +3 -2
- package/dist/built-ins/agents-md.js +8 -9
- package/dist/built-ins/agents-md.js.map +1 -1
- package/dist/built-ins/commands.d.ts +2 -1
- package/dist/built-ins/commands.js.map +1 -1
- package/dist/built-ins/doctor-rows.js +1 -1
- package/dist/built-ins/doctor-rows.js.map +1 -1
- package/dist/built-ins/doctor.d.ts +0 -1
- package/dist/built-ins/doctor.js +21 -8
- package/dist/built-ins/doctor.js.map +1 -1
- package/dist/built-ins/install/dependency.js +23 -23
- package/dist/built-ins/install/dependency.js.map +1 -1
- package/dist/built-ins/install/global-npm.d.ts +6 -3
- package/dist/built-ins/install/global-npm.js +19 -14
- package/dist/built-ins/install/global-npm.js.map +1 -1
- package/dist/built-ins/install/global.js +6 -7
- package/dist/built-ins/install/global.js.map +1 -1
- package/dist/built-ins/install/install.d.ts +0 -3
- package/dist/built-ins/install/install.js +0 -1
- package/dist/built-ins/install/install.js.map +1 -1
- package/dist/built-ins/install/release-check.js +10 -17
- package/dist/built-ins/install/release-check.js.map +1 -1
- package/dist/built-ins/npm.d.ts +8 -7
- package/dist/built-ins/npm.js +20 -12
- package/dist/built-ins/npm.js.map +1 -1
- package/dist/built-ins/project-root.d.ts +4 -4
- package/dist/built-ins/project-root.js +12 -22
- package/dist/built-ins/project-root.js.map +1 -1
- package/dist/built-ins/read.d.ts +5 -0
- package/dist/built-ins/read.js +29 -0
- package/dist/built-ins/read.js.map +1 -0
- package/dist/built-ins/setup.d.ts +1 -2
- package/dist/built-ins/setup.js +32 -26
- package/dist/built-ins/setup.js.map +1 -1
- package/dist/built-ins/skill/home.d.ts +2 -1
- package/dist/built-ins/skill/home.js +19 -17
- package/dist/built-ins/skill/home.js.map +1 -1
- package/dist/built-ins/skill/install-command.d.ts +2 -1
- package/dist/built-ins/skill/install-command.js +13 -11
- package/dist/built-ins/skill/install-command.js.map +1 -1
- package/dist/built-ins/skill/project.js +6 -7
- package/dist/built-ins/skill/project.js.map +1 -1
- package/dist/built-ins/skill/sync.d.ts +4 -3
- package/dist/built-ins/skill/sync.js +24 -17
- package/dist/built-ins/skill/sync.js.map +1 -1
- package/dist/built-ins/update.d.ts +1 -1
- package/dist/built-ins/update.js +9 -7
- package/dist/built-ins/update.js.map +1 -1
- package/dist/built-ins/upgrades.d.ts +2 -1
- package/dist/built-ins/upgrades.js +5 -12
- package/dist/built-ins/upgrades.js.map +1 -1
- package/dist/check-examples.js +5 -23
- package/dist/check-examples.js.map +1 -1
- package/dist/check-next-steps.d.ts +3 -9
- package/dist/check-next-steps.js +20 -32
- package/dist/check-next-steps.js.map +1 -1
- package/dist/command-line/line-problem.d.ts +14 -0
- package/dist/command-line/line-problem.js +41 -0
- package/dist/command-line/line-problem.js.map +1 -0
- package/dist/context/files.d.ts +3 -0
- package/dist/context/files.js +17 -2
- package/dist/context/files.js.map +1 -1
- package/dist/context/outputs.d.ts +13 -24
- package/dist/context/outputs.js +37 -37
- package/dist/context/outputs.js.map +1 -1
- package/dist/context/secrets.d.ts +5 -1
- package/dist/context/secrets.js +18 -5
- package/dist/context/secrets.js.map +1 -1
- package/dist/context/spawn.js +3 -1
- package/dist/context/spawn.js.map +1 -1
- package/dist/context/tools.d.ts +9 -4
- package/dist/context/tools.js +12 -12
- package/dist/context/tools.js.map +1 -1
- package/dist/context.d.ts +12 -8
- package/dist/define-command.d.ts +29 -13
- package/dist/define-command.js +5 -3
- package/dist/define-command.js.map +1 -1
- package/dist/define.d.ts +19 -6
- package/dist/define.js.map +1 -1
- package/dist/errors.d.ts +3 -6
- package/dist/errors.js +17 -28
- package/dist/errors.js.map +1 -1
- package/dist/execute.d.ts +7 -16
- package/dist/execute.js +11 -14
- package/dist/execute.js.map +1 -1
- package/dist/exit-classes.d.ts +7 -10
- package/dist/exit-classes.js +20 -81
- package/dist/exit-classes.js.map +1 -1
- package/dist/failure.d.ts +36 -0
- package/dist/failure.js +65 -0
- package/dist/failure.js.map +1 -0
- package/dist/help-json.js +5 -3
- package/dist/help-json.js.map +1 -1
- package/dist/help.js +9 -3
- package/dist/help.js.map +1 -1
- package/dist/output.d.ts +3 -10
- package/dist/output.js +14 -24
- package/dist/output.js.map +1 -1
- package/dist/run-cli.js +7 -5
- package/dist/run-cli.js.map +1 -1
- package/dist/run-command.d.ts +6 -1
- package/dist/run-command.js +31 -155
- package/dist/run-command.js.map +1 -1
- package/dist/run-options.d.ts +5 -2
- package/dist/run-scope.d.ts +35 -0
- package/dist/run-scope.js +138 -0
- package/dist/run-scope.js.map +1 -0
- package/dist/runtime-codes.d.ts +140 -1
- package/dist/runtime-codes.js +60 -4
- package/dist/runtime-codes.js.map +1 -1
- package/docs/README.md +2 -2
- package/docs/example/cli.test.ts +9 -2
- package/docs/example/cli.ts +1 -0
- package/docs/example/folder.ts +1 -0
- package/docs/guides/commands.md +2 -2
- package/docs/guides/doctor.md +3 -2
- package/docs/guides/errors.md +1 -1
- package/docs/guides/testing.md +2 -1
- package/package.json +1 -1
- package/dist/command-errors.d.ts +0 -8
- package/dist/command-errors.js +0 -25
- package/dist/command-errors.js.map +0 -1
- package/dist/command-line/route-line.d.ts +0 -15
- package/dist/command-line/route-line.js +0 -18
- package/dist/command-line/route-line.js.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { poll, realClock } from "./clock.js";
|
|
2
|
+
import { changedArgv } from "./command-line/invocation.js";
|
|
3
|
+
import { knownFlags, stdinArgOf } from "./command-line/parse-input.js";
|
|
4
|
+
import { fileErrorOf } from "./context/errno.js";
|
|
5
|
+
import { realFiles } from "./context/files.js";
|
|
6
|
+
import { outputsOf } from "./context/outputs.js";
|
|
7
|
+
import { envFileOf, isNeeded, secretOf } from "./context/secrets.js";
|
|
8
|
+
import { contextSpawn, contextSpawnDetached, realSpawn, realSpawnDetached, } from "./context/spawn.js";
|
|
9
|
+
import { cliErrorOf } from "./error-table.js";
|
|
10
|
+
import { noticeLine, progressLine } from "./output.js";
|
|
11
|
+
import { packageRootOf } from "./package-root.js";
|
|
12
|
+
import { buildStamp } from "./version.js";
|
|
13
|
+
function selfOf(name, bin) {
|
|
14
|
+
return bin === undefined ? [name] : [process.execPath, ...process.execArgv, bin];
|
|
15
|
+
}
|
|
16
|
+
const unfakedSpawnDetached = async () => {
|
|
17
|
+
throw new Error("runCli was given a fake spawn but no spawnDetached: pass spawnDetached to runCli, so the test starts no real child");
|
|
18
|
+
};
|
|
19
|
+
// A test that fakes `spawn` expects no real child, detached ones included.
|
|
20
|
+
function spawnDetachedOf({ spawn, spawnDetached }) {
|
|
21
|
+
if (spawnDetached !== undefined)
|
|
22
|
+
return spawnDetached;
|
|
23
|
+
return spawn === undefined ? realSpawnDetached : unfakedSpawnDetached;
|
|
24
|
+
}
|
|
25
|
+
function portsOf(cli, replacement) {
|
|
26
|
+
if (replacement !== undefined)
|
|
27
|
+
return () => replacement;
|
|
28
|
+
return cli.ports ?? (() => ({}));
|
|
29
|
+
}
|
|
30
|
+
export function runScopeOf(cli, routed, settings, write, baseInvocation) {
|
|
31
|
+
const { cwd, env } = settings;
|
|
32
|
+
const clock = settings.clock ?? realClock;
|
|
33
|
+
const platform = settings.platform ?? process.platform;
|
|
34
|
+
const invocation = {
|
|
35
|
+
...baseInvocation,
|
|
36
|
+
flags: knownFlags(routed.spec),
|
|
37
|
+
stdinArg: stdinArgOf(routed),
|
|
38
|
+
};
|
|
39
|
+
const rerun = (change) => ({
|
|
40
|
+
kind: "rerun",
|
|
41
|
+
words: changedArgv(invocation, change),
|
|
42
|
+
stdinArg: invocation.stdinArg,
|
|
43
|
+
});
|
|
44
|
+
const fileError = fileErrorOf({
|
|
45
|
+
rerun: rerun(),
|
|
46
|
+
env,
|
|
47
|
+
platform,
|
|
48
|
+
});
|
|
49
|
+
const outputs = outputsOf(settings.files ?? realFiles(), { cwd, fileError });
|
|
50
|
+
const packageRoot = packageRootOf(settings.bin, cwd);
|
|
51
|
+
const progress = (message) => write.stderr(progressLine(message, routed.json));
|
|
52
|
+
const envFile = envFileOf(cli.name, env);
|
|
53
|
+
const spawning = { fileError, rerun: rerun() };
|
|
54
|
+
return {
|
|
55
|
+
invocation,
|
|
56
|
+
rerun,
|
|
57
|
+
fileError,
|
|
58
|
+
clock,
|
|
59
|
+
platform,
|
|
60
|
+
outputs,
|
|
61
|
+
progress,
|
|
62
|
+
notice: (text) => write.stderr(noticeLine(text, routed.json)),
|
|
63
|
+
packageRoot,
|
|
64
|
+
ports: portsOf(cli, settings.ports),
|
|
65
|
+
portsBase: (signal) => ({
|
|
66
|
+
cwd,
|
|
67
|
+
env,
|
|
68
|
+
platform,
|
|
69
|
+
packageRoot,
|
|
70
|
+
progress,
|
|
71
|
+
secret: (name) => secretOf({ envFile, env, fileError }, name),
|
|
72
|
+
envFile,
|
|
73
|
+
fileError,
|
|
74
|
+
version: cli.version,
|
|
75
|
+
build: buildStamp(),
|
|
76
|
+
self: selfOf(cli.name, settings.bin),
|
|
77
|
+
signal,
|
|
78
|
+
clock,
|
|
79
|
+
files: outputs.files,
|
|
80
|
+
spawn: contextSpawn(settings.spawn ?? realSpawn, { cwd, env, signal }, spawning),
|
|
81
|
+
spawnDetached: contextSpawnDetached(spawnDetachedOf(settings), { cwd, env, signal }, spawning),
|
|
82
|
+
}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function contextOf(scope, control, { command, flags, project, deliver }) {
|
|
86
|
+
const portsBase = scope.portsBase(control.signal);
|
|
87
|
+
const ports = once(() => scope.ports(portsBase));
|
|
88
|
+
// The only Secrets `ctx.secret` reads.
|
|
89
|
+
const declared = new Map((command.secrets ?? []).map((declaration) => [declaration.name, declaration]));
|
|
90
|
+
function secret(name) {
|
|
91
|
+
const declaration = declared.get(name);
|
|
92
|
+
// Only a cast reaches an undeclared name, and only a `.env` edited mid-run a missing value.
|
|
93
|
+
if (declaration === undefined) {
|
|
94
|
+
throw new Error(`ctx.secret("${name}") names a Secret the Command does not declare`);
|
|
95
|
+
}
|
|
96
|
+
const found = portsBase.secret(name);
|
|
97
|
+
if (found === undefined && isNeeded(declaration)) {
|
|
98
|
+
throw new Error(`ctx.secret("${name}") found no value`);
|
|
99
|
+
}
|
|
100
|
+
return found;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
...portsBase,
|
|
104
|
+
secret,
|
|
105
|
+
fail: cliErrorOf,
|
|
106
|
+
deadline: (ms, options) => control.deadline(ms, options),
|
|
107
|
+
runToEnd: (name, work) => control.runToEnd(name, work),
|
|
108
|
+
// Built on first read, so a factory that throws fails only what needs the ports, never `doctor`.
|
|
109
|
+
get ports() {
|
|
110
|
+
return ports();
|
|
111
|
+
},
|
|
112
|
+
project,
|
|
113
|
+
force: flags.force,
|
|
114
|
+
dryRun: flags.dryRun,
|
|
115
|
+
rerun: scope.rerun,
|
|
116
|
+
poll: (check, { intervalMs, signal: stop }) => poll(portsBase.clock, check, intervalMs, stop === undefined ? control.signal : AbortSignal.any([control.signal, stop])),
|
|
117
|
+
deliver,
|
|
118
|
+
notice: scope.notice,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** `build` runs on the first call; later calls give its value or throw its error again. */
|
|
122
|
+
export function once(build) {
|
|
123
|
+
let outcome;
|
|
124
|
+
return () => {
|
|
125
|
+
if (outcome === undefined) {
|
|
126
|
+
try {
|
|
127
|
+
outcome = { ok: true, value: build() };
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
outcome = { ok: false, error };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (outcome.ok)
|
|
134
|
+
return outcome.value;
|
|
135
|
+
throw outcome.error;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=run-scope.js.map
|
|
@@ -0,0 +1 @@
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C;IACtB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/runtime-codes.d.ts
CHANGED
|
@@ -1,3 +1,138 @@
|
|
|
1
|
+
import type { ErrorTable } from "./error-table.js";
|
|
2
|
+
import type { ExitClass } from "./exit-classes.js";
|
|
3
|
+
export declare const DOCTOR_PROBLEMS = "DOCTOR_PROBLEMS";
|
|
4
|
+
export declare const NOT_GLOBAL_INSTALL = "NOT_GLOBAL_INSTALL";
|
|
5
|
+
export declare const NOT_ON_PATH = "NOT_ON_PATH";
|
|
6
|
+
export declare const REGISTRY_UNREACHABLE = "REGISTRY_UNREACHABLE";
|
|
7
|
+
export declare const REGISTRY_AUTH = "REGISTRY_AUTH";
|
|
8
|
+
export declare const INSTALL_FAILED = "INSTALL_FAILED";
|
|
9
|
+
export declare const NPM_FAILED = "NPM_FAILED";
|
|
10
|
+
export declare const NO_LATEST = "NO_LATEST";
|
|
11
|
+
/**
|
|
12
|
+
* The Runtime codes only some Commands reach: each Command that throws one, Built-in or the CLI's
|
|
13
|
+
* own, declares it in `errors`, as it does a code of the CLI's Error table.
|
|
14
|
+
*/
|
|
15
|
+
export declare const declaredRuntimeErrors: {
|
|
16
|
+
readonly DOCTOR_PROBLEMS: {
|
|
17
|
+
readonly class: "operator";
|
|
18
|
+
};
|
|
19
|
+
readonly NOT_GLOBAL_INSTALL: {
|
|
20
|
+
readonly class: "operator";
|
|
21
|
+
};
|
|
22
|
+
readonly NOT_ON_PATH: {
|
|
23
|
+
readonly class: "operator";
|
|
24
|
+
};
|
|
25
|
+
readonly REGISTRY_UNREACHABLE: {
|
|
26
|
+
readonly class: "operator";
|
|
27
|
+
};
|
|
28
|
+
readonly REGISTRY_AUTH: {
|
|
29
|
+
readonly class: "operator";
|
|
30
|
+
};
|
|
31
|
+
readonly INSTALL_FAILED: {
|
|
32
|
+
readonly class: "operator";
|
|
33
|
+
};
|
|
34
|
+
readonly NPM_FAILED: {
|
|
35
|
+
readonly class: "operator";
|
|
36
|
+
};
|
|
37
|
+
readonly NO_LATEST: {
|
|
38
|
+
readonly class: "source";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/** The Runtime's own Error table: every code it fails a run with, and the class that must act. */
|
|
42
|
+
export declare const runtimeErrors: {
|
|
43
|
+
readonly INVALID_INPUT: {
|
|
44
|
+
readonly class: "caller";
|
|
45
|
+
};
|
|
46
|
+
readonly UNKNOWN_OPTION: {
|
|
47
|
+
readonly class: "caller";
|
|
48
|
+
};
|
|
49
|
+
readonly UNKNOWN_COMMAND: {
|
|
50
|
+
readonly class: "caller";
|
|
51
|
+
};
|
|
52
|
+
readonly UNKNOWN_FIELD: {
|
|
53
|
+
readonly class: "caller";
|
|
54
|
+
};
|
|
55
|
+
readonly CONFIRMATION_REQUIRED: {
|
|
56
|
+
readonly class: "caller";
|
|
57
|
+
};
|
|
58
|
+
readonly CONFIRMATION_MISMATCH: {
|
|
59
|
+
readonly class: "caller";
|
|
60
|
+
};
|
|
61
|
+
readonly NOT_CONFIRMED: {
|
|
62
|
+
readonly class: "operator";
|
|
63
|
+
};
|
|
64
|
+
readonly NEEDS_OPERATOR: {
|
|
65
|
+
readonly class: "operator";
|
|
66
|
+
};
|
|
67
|
+
readonly OUTPUT_EXISTS: {
|
|
68
|
+
readonly class: "caller";
|
|
69
|
+
};
|
|
70
|
+
readonly STDIN_STALLED: {
|
|
71
|
+
readonly class: "caller";
|
|
72
|
+
};
|
|
73
|
+
readonly INTERRUPTED: {
|
|
74
|
+
readonly class: "interrupted";
|
|
75
|
+
};
|
|
76
|
+
readonly DEADLINE_EXCEEDED: {
|
|
77
|
+
readonly class: "wait";
|
|
78
|
+
};
|
|
79
|
+
readonly INTERNAL: {
|
|
80
|
+
readonly class: "bug";
|
|
81
|
+
};
|
|
82
|
+
readonly PERMISSION_DENIED: {
|
|
83
|
+
readonly class: "operator";
|
|
84
|
+
};
|
|
85
|
+
readonly DISK_FULL: {
|
|
86
|
+
readonly class: "operator";
|
|
87
|
+
};
|
|
88
|
+
readonly NOT_FOUND: {
|
|
89
|
+
readonly class: "caller";
|
|
90
|
+
};
|
|
91
|
+
readonly ALREADY_EXISTS: {
|
|
92
|
+
readonly class: "caller";
|
|
93
|
+
};
|
|
94
|
+
readonly NOT_A_FILE: {
|
|
95
|
+
readonly class: "caller";
|
|
96
|
+
};
|
|
97
|
+
readonly TOOL_FAILED: {
|
|
98
|
+
readonly class: "operator";
|
|
99
|
+
};
|
|
100
|
+
readonly TOOL_MISSING: {
|
|
101
|
+
readonly class: "operator";
|
|
102
|
+
};
|
|
103
|
+
readonly SECRET_MISSING: {
|
|
104
|
+
readonly class: "operator";
|
|
105
|
+
};
|
|
106
|
+
readonly PROJECT_INVALID: {
|
|
107
|
+
readonly class: "operator";
|
|
108
|
+
};
|
|
109
|
+
readonly DOCTOR_PROBLEMS: {
|
|
110
|
+
readonly class: "operator";
|
|
111
|
+
};
|
|
112
|
+
readonly NOT_GLOBAL_INSTALL: {
|
|
113
|
+
readonly class: "operator";
|
|
114
|
+
};
|
|
115
|
+
readonly NOT_ON_PATH: {
|
|
116
|
+
readonly class: "operator";
|
|
117
|
+
};
|
|
118
|
+
readonly REGISTRY_UNREACHABLE: {
|
|
119
|
+
readonly class: "operator";
|
|
120
|
+
};
|
|
121
|
+
readonly REGISTRY_AUTH: {
|
|
122
|
+
readonly class: "operator";
|
|
123
|
+
};
|
|
124
|
+
readonly INSTALL_FAILED: {
|
|
125
|
+
readonly class: "operator";
|
|
126
|
+
};
|
|
127
|
+
readonly NPM_FAILED: {
|
|
128
|
+
readonly class: "operator";
|
|
129
|
+
};
|
|
130
|
+
readonly NO_LATEST: {
|
|
131
|
+
readonly class: "source";
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export type RuntimeCode = keyof typeof runtimeErrors;
|
|
135
|
+
export type DeclaredRuntimeErrors = typeof declaredRuntimeErrors;
|
|
1
136
|
/** Every code the Runtime fails a run with, keyed by itself, to catch or assert one. */
|
|
2
137
|
export declare const runtimeCodes: {
|
|
3
138
|
readonly INVALID_INPUT: "INVALID_INPUT";
|
|
@@ -31,4 +166,8 @@ export declare const runtimeCodes: {
|
|
|
31
166
|
readonly NPM_FAILED: "NPM_FAILED";
|
|
32
167
|
readonly NO_LATEST: "NO_LATEST";
|
|
33
168
|
};
|
|
34
|
-
export
|
|
169
|
+
export declare const anyCommandClasses: readonly ExitClass[];
|
|
170
|
+
export declare function isRuntimeCode(code: string): code is RuntimeCode;
|
|
171
|
+
export declare function isDeclaredRuntimeCode(code: string): code is keyof DeclaredRuntimeErrors;
|
|
172
|
+
/** Whether a Command or `doctor` row throwing `code` must declare it: a code of `table`, or a Runtime one only some reach. */
|
|
173
|
+
export declare function mustDeclare(code: string, table: ErrorTable): boolean;
|
package/dist/runtime-codes.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { DOCTOR_PROBLEMS } from "./built-ins/doctor.js";
|
|
2
|
-
import { NOT_GLOBAL_INSTALL } from "./built-ins/install/global-npm.js";
|
|
3
|
-
import { INSTALL_FAILED, NO_LATEST, NPM_FAILED, REGISTRY_AUTH, REGISTRY_UNREACHABLE, } from "./built-ins/npm.js";
|
|
4
|
-
import { NOT_ON_PATH } from "./built-ins/setup.js";
|
|
5
1
|
import { INVALID_INPUT, UNKNOWN_COMMAND, UNKNOWN_OPTION } from "./command-line/usage.js";
|
|
6
2
|
import { CONFIRMATION_MISMATCH, CONFIRMATION_REQUIRED } from "./context/confirm.js";
|
|
7
3
|
import { NOT_CONFIRMED } from "./context/cost.js";
|
|
@@ -16,6 +12,55 @@ import { STDIN_STALLED } from "./context/stdin.js";
|
|
|
16
12
|
import { TOOL_MISSING } from "./context/tools.js";
|
|
17
13
|
import { INTERNAL } from "./errors.js";
|
|
18
14
|
import { UNKNOWN_FIELD } from "./list.js";
|
|
15
|
+
export const DOCTOR_PROBLEMS = "DOCTOR_PROBLEMS";
|
|
16
|
+
export const NOT_GLOBAL_INSTALL = "NOT_GLOBAL_INSTALL";
|
|
17
|
+
export const NOT_ON_PATH = "NOT_ON_PATH";
|
|
18
|
+
export const REGISTRY_UNREACHABLE = "REGISTRY_UNREACHABLE";
|
|
19
|
+
export const REGISTRY_AUTH = "REGISTRY_AUTH";
|
|
20
|
+
export const INSTALL_FAILED = "INSTALL_FAILED";
|
|
21
|
+
export const NPM_FAILED = "NPM_FAILED";
|
|
22
|
+
export const NO_LATEST = "NO_LATEST";
|
|
23
|
+
/** The Runtime codes any Command can meet, which no Command declares. */
|
|
24
|
+
const anyCommandErrors = {
|
|
25
|
+
[INVALID_INPUT]: { class: "caller" },
|
|
26
|
+
[UNKNOWN_OPTION]: { class: "caller" },
|
|
27
|
+
[UNKNOWN_COMMAND]: { class: "caller" },
|
|
28
|
+
[UNKNOWN_FIELD]: { class: "caller" },
|
|
29
|
+
[CONFIRMATION_REQUIRED]: { class: "caller" },
|
|
30
|
+
[CONFIRMATION_MISMATCH]: { class: "caller" },
|
|
31
|
+
[NOT_CONFIRMED]: { class: "operator" },
|
|
32
|
+
[NEEDS_OPERATOR]: { class: "operator" },
|
|
33
|
+
[OUTPUT_EXISTS]: { class: "caller" },
|
|
34
|
+
[STDIN_STALLED]: { class: "caller" },
|
|
35
|
+
[INTERRUPTED]: { class: "interrupted" },
|
|
36
|
+
[DEADLINE_EXCEEDED]: { class: "wait" },
|
|
37
|
+
[INTERNAL]: { class: "bug" },
|
|
38
|
+
[PERMISSION_DENIED]: { class: "operator" },
|
|
39
|
+
[DISK_FULL]: { class: "operator" },
|
|
40
|
+
[NOT_FOUND]: { class: "caller" },
|
|
41
|
+
[ALREADY_EXISTS]: { class: "caller" },
|
|
42
|
+
[NOT_A_FILE]: { class: "caller" },
|
|
43
|
+
[TOOL_FAILED]: { class: "operator" },
|
|
44
|
+
[TOOL_MISSING]: { class: "operator" },
|
|
45
|
+
[SECRET_MISSING]: { class: "operator" },
|
|
46
|
+
[PROJECT_INVALID]: { class: "operator" },
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The Runtime codes only some Commands reach: each Command that throws one, Built-in or the CLI's
|
|
50
|
+
* own, declares it in `errors`, as it does a code of the CLI's Error table.
|
|
51
|
+
*/
|
|
52
|
+
export const declaredRuntimeErrors = {
|
|
53
|
+
[DOCTOR_PROBLEMS]: { class: "operator" },
|
|
54
|
+
[NOT_GLOBAL_INSTALL]: { class: "operator" },
|
|
55
|
+
[NOT_ON_PATH]: { class: "operator" },
|
|
56
|
+
[REGISTRY_UNREACHABLE]: { class: "operator" },
|
|
57
|
+
[REGISTRY_AUTH]: { class: "operator" },
|
|
58
|
+
[INSTALL_FAILED]: { class: "operator" },
|
|
59
|
+
[NPM_FAILED]: { class: "operator" },
|
|
60
|
+
[NO_LATEST]: { class: "source" },
|
|
61
|
+
};
|
|
62
|
+
/** The Runtime's own Error table: every code it fails a run with, and the class that must act. */
|
|
63
|
+
export const runtimeErrors = { ...anyCommandErrors, ...declaredRuntimeErrors };
|
|
19
64
|
/** Every code the Runtime fails a run with, keyed by itself, to catch or assert one. */
|
|
20
65
|
export const runtimeCodes = {
|
|
21
66
|
INVALID_INPUT,
|
|
@@ -49,4 +94,15 @@ export const runtimeCodes = {
|
|
|
49
94
|
NPM_FAILED,
|
|
50
95
|
NO_LATEST,
|
|
51
96
|
};
|
|
97
|
+
export const anyCommandClasses = Object.values(anyCommandErrors).map((declaration) => declaration.class);
|
|
98
|
+
export function isRuntimeCode(code) {
|
|
99
|
+
return Object.hasOwn(runtimeErrors, code);
|
|
100
|
+
}
|
|
101
|
+
export function isDeclaredRuntimeCode(code) {
|
|
102
|
+
return Object.hasOwn(declaredRuntimeErrors, code);
|
|
103
|
+
}
|
|
104
|
+
/** Whether a Command or `doctor` row throwing `code` must declare it: a code of `table`, or a Runtime one only some reach. */
|
|
105
|
+
export function mustDeclare(code, table) {
|
|
106
|
+
return Object.hasOwn(table, code) || isDeclaredRuntimeCode(code);
|
|
107
|
+
}
|
|
52
108
|
//# sourceMappingURL=runtime-codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-codes.js","sourceRoot":"","sources":["../src/runtime-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-codes.js","sourceRoot":"","sources":["../src/runtime-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AACjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,aA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S;IACT,SAAS;IACT,cAAc;IACd,UAAU;IACV,WAAW;IACX,YAAY;IACZ,cAAc;IACd,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,WAAW;IACX,oBAAoB;IACpB,aAAa;IACb,cAAc;IACd,UAAU;IACV,SAAS;CACkD,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAyB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,CACxF,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CACnC,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,8HAA8H;AAC9H,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAiB;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC"}
|
package/docs/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Read [Principles](principles.md) once, then the guide for the task at hand. Ever
|
|
|
30
30
|
## A Command is done when
|
|
31
31
|
|
|
32
32
|
- Every Error table code it throws, its helpers' and ports' included, is in its `errors`, and it throws its own through `ctx.fail`.
|
|
33
|
-
- Every key it reads is in its `secrets`, whose `get` says where to obtain it
|
|
33
|
+
- Every key it reads is in its `secrets`, whose `get` says where to obtain it; one it can run without, such as a token that overrides a saved login, is `optional: true`.
|
|
34
34
|
- Each line to run next is a Next step in `next`, never in the hint's prose; a rerun of the caller's own line comes from `ctx.rerun()`; the hint says whether running them is safe, and a step only the operator can take says so.
|
|
35
35
|
- It declares `output` or `rows`.
|
|
36
36
|
- It has `examples` with realistic full command lines starting with the CLI's name, which `checkExamples(cli)` passes.
|
|
@@ -40,7 +40,7 @@ Read [Principles](principles.md) once, then the guide for the task at hand. Ever
|
|
|
40
40
|
- Its tests, through `runCli`, cover:
|
|
41
41
|
- the success output, in text and under `--json`;
|
|
42
42
|
- each `CliError` code;
|
|
43
|
-
- for a Command with `secrets
|
|
43
|
+
- for a Command with `secrets` it needs, `SECRET_MISSING` before any work; for an optional one, a run with it unset;
|
|
44
44
|
- for a write or destructive Command, that `--dry-run` and each refused guard change nothing;
|
|
45
45
|
- for a write Command, that it is idempotent: a second run after a success changes nothing;
|
|
46
46
|
- cancellation by passing `signal` to `runCli`, aborted once with the reason `"SIGTERM"` for 143;
|
package/docs/example/cli.test.ts
CHANGED
|
@@ -241,8 +241,8 @@ describe("links check", () => {
|
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
describe("links doctor", () => {
|
|
244
|
-
async function doctor(env: Record<string, string>, config?: unknown) {
|
|
245
|
-
const cwd = await folderWith(
|
|
244
|
+
async function doctor(env: Record<string, string>, config?: unknown, links: unknown = LINKS) {
|
|
245
|
+
const cwd = await folderWith(links);
|
|
246
246
|
if (config !== undefined) {
|
|
247
247
|
await writeFile(join(cwd, "links.config.json"), JSON.stringify(config));
|
|
248
248
|
}
|
|
@@ -268,6 +268,13 @@ describe("links doctor", () => {
|
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
+
test("a corrupt links.json fails doctor in the store row as CORRUPT_DATA, exit 1", async () => {
|
|
272
|
+
const { result, row } = await doctor({ PATH: await pathWith("git") }, undefined, "not links");
|
|
273
|
+
|
|
274
|
+
expect(row("store")).toMatchObject({ state: "problem", code: "CORRUPT_DATA" });
|
|
275
|
+
expect(result.exitCode).toBe(1);
|
|
276
|
+
});
|
|
277
|
+
|
|
271
278
|
test("the tag row reads the Project file's tag", async () => {
|
|
272
279
|
const { row } = await doctor({ PATH: await pathWith("git") }, { tag: "work" });
|
|
273
280
|
|
package/docs/example/cli.ts
CHANGED
|
@@ -148,6 +148,7 @@ const check = defineCommand({
|
|
|
148
148
|
|
|
149
149
|
const store: DoctorCheck<Ports, Settings> = {
|
|
150
150
|
name: "store",
|
|
151
|
+
errors: ["CORRUPT_DATA"],
|
|
151
152
|
run: async (ctx) => {
|
|
152
153
|
const links = await readLinks(ctx);
|
|
153
154
|
return { state: "ok", message: `${linksPath(ctx.cwd)} holds ${links.length} links` };
|
package/docs/example/folder.ts
CHANGED
package/docs/guides/commands.md
CHANGED
|
@@ -26,9 +26,9 @@ Data over 30,000 characters spills to a file, so make a list that may grow a Lis
|
|
|
26
26
|
|
|
27
27
|
Reach the outside through `ctx`, so tests control it:
|
|
28
28
|
|
|
29
|
-
- the working directory and
|
|
29
|
+
- the working directory, environment and platform as `ctx.cwd`, `ctx.env` and `ctx.platform`, which `runCli`'s `platform` replaces in a test;
|
|
30
30
|
- the file system through `ctx.files`, whose failures name the path; a `node:fs` failure is a bug (exit 70). Pass `mode` to its `write` or `mkdir` for a file or folder holding tokens. Catch a file code from `runtimeCodes` to say what to do instead, as [`example/bundle.ts`](../example/bundle.ts) turns `ALREADY_EXISTS` into its own `BUNDLE_EXISTS`;
|
|
31
|
-
- a key or token through `ctx.secret(name)`, for a name in the Command's `secrets`. The Runtime reads each declared Secret from the environment, then the CLI's `.env` at `ctx.envFile` (`~/.config/<name>/.env`, or under `$XDG_CONFIG_HOME`), an empty value counting as unset, and fails the run with `SECRET_MISSING` before any work, `--dry-run` included, when one is unset; so `ctx.secret` returns a `Secret`, never `undefined`. Messages name its `origin` and keep its `value` out of the agent's context. `doctor` reports every declared Secret; a key it should check that no Command requires goes in `defineCli({ secrets })`;
|
|
31
|
+
- a key or token through `ctx.secret(name)`, for a name in the Command's `secrets`. The Runtime reads each declared Secret from the environment, then the CLI's `.env` at `ctx.envFile` (`~/.config/<name>/.env`, or under `$XDG_CONFIG_HOME`), an empty value counting as unset, and fails the run with `SECRET_MISSING` before any work, `--dry-run` included, when one is unset; so `ctx.secret` returns a `Secret`, never `undefined`. The exception is a key that only replaces something the CLI already has, such as a token that overrides a saved login: declared `optional: true`, its absence fails nothing and `ctx.secret` may give `undefined`, while help still names it, so an agent learns the key exists. Messages name its `origin` and keep its `value` out of the agent's context. `doctor` reports every declared Secret it needs, and each optional one that is set; a key it should check that no Command requires goes in `defineCli({ secrets })`;
|
|
32
32
|
- a program through `ctx.spawn`, listed in the Command's `tools`, so a missing one fails before any work and `doctor` checks it. Its `stdin` option feeds the program, from an async iterable for input too large to hold, and its `onLine` option receives each line the program writes as it comes;
|
|
33
33
|
- `ctx.progress` while a long step runs, since a Coding agent may kill a CLI that stays silent;
|
|
34
34
|
- `ctx.notice` for something the caller should know beside the data, such as that a copy it relies on is behind. A fact the next step acts on belongs in the data instead.
|
package/docs/guides/doctor.md
CHANGED
|
@@ -5,6 +5,7 @@ Every multi-Command CLI has a built-in `doctor` that reports one row per check:
|
|
|
5
5
|
```ts
|
|
6
6
|
const store: DoctorCheck<Ports, Settings> = {
|
|
7
7
|
name: "store",
|
|
8
|
+
errors: ["CORRUPT_DATA"],
|
|
8
9
|
run: async (ctx) => {
|
|
9
10
|
const links = await readLinks(ctx);
|
|
10
11
|
return { state: "ok", message: `${linksPath(ctx.cwd)} holds ${links.length} links` };
|
|
@@ -36,9 +37,9 @@ A row returns one of:
|
|
|
36
37
|
- `{ state: "problem", message, fix?, code? }`, where `fix` is the command that fixes the problem, which `doctor` gives as a Next step before its own rerun, and `code` is one of the Error table's or the Runtime's;
|
|
37
38
|
- `{ state: "skipped", message }` for a row not checked, such as "not checked: the bridge is down", so one cause shows up as one problem. It never fails `doctor`.
|
|
38
39
|
|
|
39
|
-
When any row is a problem, `doctor` fails with one error per problem row, its `code` or `DOCTOR_PROBLEMS` (exit 2) without one, so it exits by the class that must act first as any Command does: an expired session 3, a network failure 75. Give a problem the code of its real cause. A row that throws becomes its own problem, with a `CliError`'s message and hint as the message, its first Next step other than `ctx.rerun()` as `fix`, and its code as `code`; the failure ends with `doctor` as typed, which a rerun in the row's hint means. A row whose `ctx.spawn` finds no declared tool on `PATH` is `skipped`, since that tool's row reports it. Each row runs under its own deadline, 10 s unless it sets `deadlineMs`, and `ctx.signal` aborts at that deadline, so pass it on. A row with `advisory: true` shows its problem and `fix` but never fails `doctor`; when it has no `fix`, `next` ends with `doctor` as typed.
|
|
40
|
+
When any row is a problem, `doctor` fails with one error per problem row, its `code` or `DOCTOR_PROBLEMS` (exit 2) without one, so it exits by the class that must act first as any Command does: an expired session 3, a network failure 75. Give a problem the code of its real cause, and list in the row's `errors` each code of the Error table, and each Runtime code only some Commands reach, that it fails with, thrown or returned, as a Command does: the `store` row above declares `CORRUPT_DATA`, which `readLinks` throws. A row failing with a code it does not declare fails `doctor` as a bug (exit 70), even when another row declares it. `doctor`'s own `errors`, which `--help --json` lists, are `DOCTOR_PROBLEMS` and the codes of every row that is not advisory. A row that throws becomes its own problem, with a `CliError`'s message and hint as the message, its first Next step other than `ctx.rerun()` as `fix`, and its code as `code`; the failure ends with `doctor` as typed, which a rerun in the row's hint means. A row whose `ctx.spawn` finds no declared tool on `PATH` is `skipped`, since that tool's row reports it. Each row runs under its own deadline, 10 s unless it sets `deadlineMs`, and `ctx.signal` aborts at that deadline, so pass it on. A row with `advisory: true` shows its problem and `fix` but never fails `doctor`; when it has no `fix`, `next` ends with `doctor` as typed.
|
|
40
41
|
|
|
41
|
-
The Runtime's `secrets` row checks every Secret the CLI and its Commands declare, naming where each came from and never its value, so no row of yours reads a key.
|
|
42
|
+
The Runtime's `secrets` row checks every Secret the CLI and its Commands declare, naming where each came from and never its value, so no row of yours reads a key. An optional Secret appears only when set, unless some Command or the CLI needs the same name.
|
|
42
43
|
|
|
43
44
|
The `install` and `registry` rows follow `defineCli({ install })`, and are `skipped` without it. Both are advisory: a project may stay on an older release on purpose.
|
|
44
45
|
|
package/docs/guides/errors.md
CHANGED
|
@@ -21,7 +21,7 @@ export const errors = defineErrors({
|
|
|
21
21
|
|
|
22
22
|
When a `details` field is worth reading in text mode too, such as a stack, name it in the code's `print` rather than repeating it in the message, which `--json` would then carry twice.
|
|
23
23
|
|
|
24
|
-
Each Command lists in `errors` the table codes it throws, its helpers' and ports' included, so a shared store's `CORRUPT_DATA` goes on every Command that reads the store. A run ending in a table code its Command does not declare, directly or as an `AggregateError` leaf, fails as a bug (exit 70) naming the code and the Command, so the Command's tests catch a missing one; `defineCli` throws on a code the table lacks. Runtime
|
|
24
|
+
Each Command lists in `errors` the table codes it throws, its helpers' and ports' included, so a shared store's `CORRUPT_DATA` goes on every Command that reads the store. A run ending in a table code its Command does not declare, directly or as an `AggregateError` leaf, fails as a bug (exit 70) naming the code and the Command, so the Command's tests catch a missing one; `defineCli` throws on a code the table lacks. A Runtime code any Command can meet, such as `NOT_FOUND` or `TOOL_MISSING`, is never listed; one only some Commands reach (`NOT_GLOBAL_INSTALL`, `NOT_ON_PATH`, `REGISTRY_UNREACHABLE`, `REGISTRY_AUTH`, `INSTALL_FAILED`, `NPM_FAILED`, `NO_LATEST`, `DOCTOR_PROBLEMS`) is declared like a table code by each Command that throws it, the Built-in Commands included. A `doctor` row declares its codes in its own `errors` ([`doctor` rows](doctor.md)). `--help` lists only the exit codes some Command can end in, so exit 3 shows only when a code of class `source` is declared.
|
|
25
25
|
|
|
26
26
|
Inside a Command, throw `ctx.fail(code, init, options?)`, typed to the Command's `errors` and each code's `details`, so an undeclared code is a type error. A helper outside a Command, such as [`example/store.ts`](../example/store.ts), throws through the `cliError` that `agentCli` returns, typed by the whole table.
|
|
27
27
|
|
package/docs/guides/testing.md
CHANGED
|
@@ -17,7 +17,7 @@ test("--dry-run prints the Plan and saves nothing", async () => {
|
|
|
17
17
|
|
|
18
18
|
The scaffolded `test/global-setup.ts` points `TMPDIR` at one root that it removes after the run, so these folders leave nothing behind; a CLI without it should add one.
|
|
19
19
|
|
|
20
|
-
One test checks every example, the Built-in Commands' included: `checkExamples(cli)` from `@duyquangnvx/agent-cli/testing` throws one error listing each example that does not tokenize, route to a Command or pass its schemas. The scaffolded test calls it already.
|
|
20
|
+
One test checks every example, the Built-in Commands' included: `checkExamples(cli)` from `@duyquangnvx/agent-cli/testing` throws one error listing each example that does not tokenize, route to a Command or pass its schemas. The scaffolded test calls it already. Under `runCli`, a failure's Next steps face the same check: a Next step that would not run as given, such as one missing a required option or holding a placeholder like `<id>` for a number, fails the run as a bug (exit 70) naming it and why.
|
|
21
21
|
|
|
22
22
|
Under `--json`, stderr is JSON Lines: one `{"progress":"..."}` per progress line, then `{ errors: [{ code, message, hint, next?, details?, retryAt? }] }` as the last line, even for one error. Assert a failure's code through `runtimeCodes`, so a misspelt code fails type checking:
|
|
23
23
|
|
|
@@ -63,6 +63,7 @@ A Command that awaits native threads, such as sharp's, runs work the clock canno
|
|
|
63
63
|
- `spawnDetached`: replace it to answer for a detached child, such as a Daemon: return `{ pid }`. A test that fakes `spawn` but not `spawnDetached` fails as a bug when the Command starts one, rather than start a real child.
|
|
64
64
|
- `tools`: put a folder holding an empty executable of that name on the test's `PATH`.
|
|
65
65
|
- `stdin`: pass the text an `orStdin` arg reads as `runCli`'s `stdin` option.
|
|
66
|
+
- `platform`: pass `"win32"` to run the Runtime's Windows branches on any OS, where it would read `process.platform`: hint wording, a declared tool found on `PATH` by its `PATHEXT` extension, such as an executable `ffmpeg.CMD`, and the npm file (`npm.cmd`), bin folder and global `node_modules` folder the Built-in Commands use. Starting a real child and retrying a real file rename still follow the host.
|
|
66
67
|
|
|
67
68
|
## What the Runtime already tests
|
|
68
69
|
|
package/package.json
CHANGED
package/dist/command-errors.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type CommandSpec } from "./command-spec.js";
|
|
2
|
-
import type { Cli } from "./define.js";
|
|
3
|
-
/**
|
|
4
|
-
* `error`, or a bug naming each Error table code in it that the Command does not declare in its
|
|
5
|
-
* `errors`. Runtime codes are never in the table, and a built-in's failures, `doctor` rows'
|
|
6
|
-
* included, belong to no declaration, so both pass.
|
|
7
|
-
*/
|
|
8
|
-
export declare function checkedCodes(error: unknown, { command, path, builtIn }: CommandSpec, cli: Pick<Cli, "name" | "errors">): unknown;
|
package/dist/command-errors.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { commandLabel } from "./command-spec.js";
|
|
2
|
-
import { errorTableOf } from "./error-table.js";
|
|
3
|
-
import { CliError, errorsOf } from "./errors.js";
|
|
4
|
-
/**
|
|
5
|
-
* `error`, or a bug naming each Error table code in it that the Command does not declare in its
|
|
6
|
-
* `errors`. Runtime codes are never in the table, and a built-in's failures, `doctor` rows'
|
|
7
|
-
* included, belong to no declaration, so both pass.
|
|
8
|
-
*/
|
|
9
|
-
export function checkedCodes(error, { command, path, builtIn }, cli) {
|
|
10
|
-
if (builtIn)
|
|
11
|
-
return error;
|
|
12
|
-
const table = errorTableOf(cli);
|
|
13
|
-
const declared = new Set(command.errors ?? []);
|
|
14
|
-
const undeclared = errorsOf(error).flatMap((leaf) => leaf instanceof CliError && Object.hasOwn(table, leaf.code) && !declared.has(leaf.code)
|
|
15
|
-
? [leaf.code]
|
|
16
|
-
: []);
|
|
17
|
-
if (undeclared.length === 0)
|
|
18
|
-
return error;
|
|
19
|
-
const label = commandLabel(path, cli.name).join(" ");
|
|
20
|
-
const codes = [...new Set(undeclared)].join(", ");
|
|
21
|
-
return new Error(`\`${label}\` threw ${codes}, which its errors do not declare`, {
|
|
22
|
-
cause: error,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=command-errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-errors.js","sourceRoot":"","sources":["../src/command-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAc,EACd,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAe,EACvC,GAAiC;IAEjC,IAAI,OAAO;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAClD,IAAI,YAAY,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACrF,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACb,CAAC,CAAC,EAAE,CACP,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY,KAAK,mCAAmC,EAAE;QAC/E,KAAK,EAAE,KAAK;KACb,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { SpecNode } from "../command-spec.js";
|
|
2
|
-
import type { Invocation } from "./invocation.js";
|
|
3
|
-
import { type CommandRoute } from "./route.js";
|
|
4
|
-
import type { ShellWords } from "./shell-words.js";
|
|
5
|
-
/** A line a test checks: the Command it routes to, or why it routes to none. */
|
|
6
|
-
export type RoutedLine = {
|
|
7
|
-
readonly ok: true;
|
|
8
|
-
readonly routed: CommandRoute;
|
|
9
|
-
readonly invocation: Invocation;
|
|
10
|
-
} | {
|
|
11
|
-
readonly ok: false;
|
|
12
|
-
readonly reason: string;
|
|
13
|
-
};
|
|
14
|
-
/** Routes `argv`, the line's words after the Run-as, to a Command of `root`. */
|
|
15
|
-
export declare function routeLine(root: SpecNode, runAs: string, argv: ShellWords): RoutedLine;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { route } from "./route.js";
|
|
2
|
-
/** Routes `argv`, the line's words after the Run-as, to a Command of `root`. */
|
|
3
|
-
export function routeLine(root, runAs, argv) {
|
|
4
|
-
if (!argv.ok)
|
|
5
|
-
return { ok: false, reason: `it does not tokenize: ${argv.reason}` };
|
|
6
|
-
const invocation = { runAs, argv: argv.words, flags: [] };
|
|
7
|
-
const routed = route(root, invocation);
|
|
8
|
-
switch (routed.kind) {
|
|
9
|
-
case "usage error":
|
|
10
|
-
return { ok: false, reason: routed.error.message };
|
|
11
|
-
case "help":
|
|
12
|
-
case "version":
|
|
13
|
-
return { ok: false, reason: "it names no Command" };
|
|
14
|
-
case "command":
|
|
15
|
-
return { ok: true, routed, invocation };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=route-line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-line.js","sourceRoot":"","sources":["../../src/command-line/route-line.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,EAAE,MAAM,YAAY,CAAC;AAQtD,gFAAgF;AAChF,MAAM,UAAU,SAAS,CAAC,IAAc,EAAE,KAAa,EAAE,IAAgB;IACvE,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,yBAAyB,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;IACnF,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACvC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,aAAa;YAChB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrD,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS;YACZ,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;QACtD,KAAK,SAAS;YACZ,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|