@intentius/chant-lexicon-fountain 0.124.44 → 0.124.46
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-line.d.ts","sourceRoot":"","sources":["../../src/acp/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsC/C;AAED,yDAAyD;AACzD,MAAM,MAAM,YAAY,GACpB;IACE,6EAA6E;IAC7E,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GACD;IACE,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEN,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"command-line.d.ts","sourceRoot":"","sources":["../../src/acp/command-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsC/C;AAED,yDAAyD;AACzD,MAAM,MAAM,YAAY,GACpB;IACE,6EAA6E;IAC7E,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GACD;IACE,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEN,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsEnF"}
|
package/dist/acp/command-line.js
CHANGED
|
@@ -100,6 +100,16 @@ export async function parseChantCommandLine(text) {
|
|
|
100
100
|
args = parseArgs(argv);
|
|
101
101
|
}
|
|
102
102
|
catch (err) {
|
|
103
|
+
// A flag problem is only worth reporting for a real chant verb. For
|
|
104
|
+
// anything else (`rm -rf /`), core's unknown-flag refusal (#4369) would
|
|
105
|
+
// mask the reason that matters, which is that the prompt is not chant.
|
|
106
|
+
if (!isChantVerb(parseArgs, resolveCommand, commandRegistry, argv[0])) {
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
message: `"${argv[0]}" is not a chant command`,
|
|
110
|
+
hint: usageHint(),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
103
113
|
return {
|
|
104
114
|
ok: false,
|
|
105
115
|
message: err instanceof Error ? err.message : String(err),
|
|
@@ -127,6 +137,15 @@ export async function parseChantCommandLine(text) {
|
|
|
127
137
|
command: { kind: "verb", name: match.def.name, def: match.def, compound: match.compound, args, argv },
|
|
128
138
|
};
|
|
129
139
|
}
|
|
140
|
+
/** Whether the leading word alone resolves to a registered chant verb. */
|
|
141
|
+
function isChantVerb(parseArgs, resolveCommand, registry, word) {
|
|
142
|
+
try {
|
|
143
|
+
return resolveCommand(parseArgs([word]), registry) !== null;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
130
149
|
function usageHint() {
|
|
131
150
|
return ("A prompt is a chant command line, not a shell line — for example " +
|
|
132
151
|
'"chant run prod-apply --env prod" or "chant lifecycle diff --live". ' +
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "5e30a126fc56b02ec27d2de12fa5c63eaf8e0dcec9acca2b45f3fb430bc58d0a",
|
|
5
5
|
"meta.json": "d7801fa823ef8598cda899fe181e20fc13ec6a5af1c0ff05399f3db031a11482",
|
|
6
6
|
"types/index.d.ts": "b0a929cf94d7a57769a66df8c6805e7e5303e776b39b3f39260b7081dc38701a",
|
|
7
7
|
"rules/ftn001-no-secret-literals.ts": "dd1b54db3919afadcb5b8261db9a5db7c316a5f263c86f7a551fddb19f6ac532",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"skills/chant-fountain-ops.md": "3f613763a0aa9cf76e2872d6216ca4aa9a22d700f2d161e7e2865ed826591c42",
|
|
22
22
|
"skills/chant-fountain-locked-sandboxes.md": "04b6cbf94cb193bb8e8fc1fde6c61e2f2a0a8f0cf3d6ef7ffbb0d7995a0d1b62"
|
|
23
23
|
},
|
|
24
|
-
"composite": "
|
|
24
|
+
"composite": "7431cfdd6c94c8d8a2d4b8baa67c08e73ab7d3c07da2df596c1642bbf76a1040"
|
|
25
25
|
}
|
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-fountain",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.46",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fountain lexicon for chant — sandboxed agent environments, vaults, and agents as typed estate",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"bundle": "tsx src/package-cli.ts"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@intentius/chant": "^0.124.
|
|
53
|
+
"@intentius/chant": "^0.124.46",
|
|
54
54
|
"zod": "^4.3.6"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
package/src/acp/acp.test.ts
CHANGED
|
@@ -330,6 +330,12 @@ describe("parseChantCommandLine", () => {
|
|
|
330
330
|
expect(parsed.ok).toBe(false);
|
|
331
331
|
if (!parsed.ok) expect(parsed.message).toContain("not a chant command");
|
|
332
332
|
});
|
|
333
|
+
|
|
334
|
+
it("still reports an unknown flag on a real chant verb (#4369)", async () => {
|
|
335
|
+
const parsed = await parseChantCommandLine("build -z");
|
|
336
|
+
expect(parsed.ok).toBe(false);
|
|
337
|
+
if (!parsed.ok) expect(parsed.message).toContain("Unknown flag: -z");
|
|
338
|
+
});
|
|
333
339
|
});
|
|
334
340
|
|
|
335
341
|
describe("chant acp", () => {
|
package/src/acp/command-line.ts
CHANGED
|
@@ -128,6 +128,16 @@ export async function parseChantCommandLine(text: string): Promise<CommandLinePa
|
|
|
128
128
|
try {
|
|
129
129
|
args = parseArgs(argv);
|
|
130
130
|
} catch (err) {
|
|
131
|
+
// A flag problem is only worth reporting for a real chant verb. For
|
|
132
|
+
// anything else (`rm -rf /`), core's unknown-flag refusal (#4369) would
|
|
133
|
+
// mask the reason that matters, which is that the prompt is not chant.
|
|
134
|
+
if (!isChantVerb(parseArgs, resolveCommand, commandRegistry, argv[0])) {
|
|
135
|
+
return {
|
|
136
|
+
ok: false,
|
|
137
|
+
message: `"${argv[0]}" is not a chant command`,
|
|
138
|
+
hint: usageHint(),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
131
141
|
return {
|
|
132
142
|
ok: false,
|
|
133
143
|
message: err instanceof Error ? err.message : String(err),
|
|
@@ -159,6 +169,20 @@ export async function parseChantCommandLine(text: string): Promise<CommandLinePa
|
|
|
159
169
|
};
|
|
160
170
|
}
|
|
161
171
|
|
|
172
|
+
/** Whether the leading word alone resolves to a registered chant verb. */
|
|
173
|
+
function isChantVerb(
|
|
174
|
+
parseArgs: (argv: string[]) => ParsedArgs,
|
|
175
|
+
resolveCommand: (args: ParsedArgs, registry: CommandDef[]) => unknown,
|
|
176
|
+
registry: CommandDef[],
|
|
177
|
+
word: string,
|
|
178
|
+
): boolean {
|
|
179
|
+
try {
|
|
180
|
+
return resolveCommand(parseArgs([word]), registry) !== null;
|
|
181
|
+
} catch {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
162
186
|
function usageHint(): string {
|
|
163
187
|
return (
|
|
164
188
|
"A prompt is a chant command line, not a shell line — for example " +
|