Fix architecture review findings and align CLI metadata
This commit is contained in:
1 parent
780a4ba9c0
commit
50e4e492b4
83 files changed
+966
-792
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { normalizeCliArea } from "./area-aliases.js";
|
||||
import { parseArgs } from "./parser.js";
|
||||
|
||||
/**
|
||||
@@ -12,13 +13,6 @@ import { parseArgs } from "./parser.js";
|
||||
* Prefix matching is boundary-safe by construction: `list-evil` does not match `list`.
|
||||
*/
|
||||
|
||||
/** Area aliases the CLI dispatches under an alternative name; mirrors the pairs in runner.ts. */
|
||||
const AREA_ALIASES: Record<string, string> = {
|
||||
corp: "corps",
|
||||
webhooks: "webhook",
|
||||
preferences: "preference"
|
||||
};
|
||||
|
||||
/**
|
||||
* Commands that only read tenant state, produce a local file, or inspect local configuration.
|
||||
* Deliberately excluded even though they look harmless: anything that writes local config
|
||||
@@ -122,7 +116,7 @@ export function describeCliCommand(argv: string[]): { area: string; actionTokens
|
||||
const { command } = parseArgs(argv);
|
||||
const area = (command[0] ?? "").toLowerCase();
|
||||
return {
|
||||
area: AREA_ALIASES[area] ?? area,
|
||||
area: normalizeCliArea(area),
|
||||
actionTokens: command.slice(1).map((token) => token.toLowerCase())
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user