@intentius/chant-lexicon-fountain 0.124.45 → 0.124.48

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,CA4DnF"}
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"}
@@ -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". ' +
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "5b97b72f9d13d07bdea9e25dadc95ac95e5f080f5ef5d3469881bc0c7621ecac",
4
+ "manifest.json": "671c9bfd5c4e7e9e62f8568c1e1bfe9c064351bcd94da727b5689c737f8f4368",
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": "de8e407cc75b9efb1fab56e6cdb4e93ce177f57a276d56281f1e62673f7c714a"
24
+ "composite": "278e0313350e047517e52346cc35641c3231d6bbc9e6c631c0485ea6cb6f6874"
25
25
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fountain",
3
- "version": "0.124.45",
3
+ "version": "0.124.48",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Fountain",
6
6
  "specVersion": "v0.29.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-fountain",
3
- "version": "0.124.45",
3
+ "version": "0.124.48",
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.45",
53
+ "@intentius/chant": "^0.124.48",
54
54
  "zod": "^4.3.6"
55
55
  },
56
56
  "devDependencies": {
@@ -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", () => {
@@ -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 " +