Enforce cross-domain naming charter with silent legacy aliases

Unify the visible command surface on one canonical spelling per
semantic concept while keeping every legacy spelling working as a
silent parser/dispatcher alias (per .agents/rules/cli-protocol.md §6):

- Fix silent-ignore accept-set gaps: webhook resource-pack export now
  reads --out/--output-file and --downloads/--download; approval-runs
  and webhook read canonical --start-date/--end-date; webhook secret
  reveal accepts --reveal/-r alongside legacy --show-secret.
- Add kebab-case parser registrations for camel-only flags (human-result,
  manual-approval-status, include-bridge, rule-version, document-limit,
  context-lines, source-document-sn/-id, simulation-batch-id) and read
  them in rules/documents search, context, approval-runs list/summary/
  bridge/export.
- Retire verbs on the visible surface only: webhook create (add),
  simulation delete (clean), preference thinking-depth policies delete
  (remove); dispatch keeps both. Runtime nextAction suggestions and
  doctor knowledge switch to canonical spellings.
- Add src/cli/naming-charter.test.ts: help surface must be lowercase
  kebab-case and free of retired tokens; canonical/legacy spellings
  must both parse; P0 accept-sets pinned.
- Document the charter in .agents/rules/cli-protocol.md §7; sync
  AGENTS.md, README, and skills/references docs; regenerate cli.md and
  embedded skill artifacts.
This commit is contained in:
gitea committed 2026-10-24 21:56:59 +08:00
1 parent 5d703cec38
commit 245ec33d1a
21 files changed
+298 -110

No files matched your search

+9 -4
View File
@@ -280,6 +280,7 @@ export async function handleWebhookCommand(
? false
: booleanOption(args.options.attachments) !== false;
const outputFile =
stringOption(args.options.out) ??
stringOption(args.options.output) ??
stringOption(args.options.outputFile) ??
stringOption(args.options["output-file"]) ??
@@ -287,7 +288,11 @@ export async function handleWebhookCommand(
stringOption(args.options.file) ??
(args.command[3]?.endsWith(".zip") ? args.command[3] : undefined);
const toDownloads =
booleanOption(args.options.toDownloads) ?? booleanOption(args.options["to-downloads"]) ?? false;
booleanOption(args.options.downloads) ??
booleanOption(args.options.download) ??
booleanOption(args.options.toDownloads) ??
booleanOption(args.options["to-downloads"]) ??
false;
const result = await exportApprovalRunsToResourcePack(client, corp, {
recordId,
@@ -338,7 +343,7 @@ export async function handleWebhookCommand(
throw new CliError(
"当前租户未配置任何 Webhook 集成通道。",
1,
`seal-use webhook add --name <name> --result-url <url> --corp ${corp.id}`
`seal-use webhook create --name <name> --result-url <url> --corp ${corp.id}`
);
}
const result = await pushMaterialPack(input.fileBuffer, input.fileName, {
@@ -368,7 +373,7 @@ export async function handleWebhookCommand(
if (action === "get" || action === "find") {
const selector = maybeName ?? stringOption(args.options.selector) ?? stringOption(args.options.id);
if (!selector) throw usageError("Usage: seal-use webhook get <idOrName> [--show-secret]");
if (!selector) throw usageError("Usage: seal-use webhook get <idOrName> [--reveal]");
await runCapability(
"sealWebhookGet",
client,
@@ -390,7 +395,7 @@ export async function handleWebhookCommand(
stringOption(args.options.outgoingResultWebhook) ??
stringOption(args.options["outgoing-result-webhook"]);
if (!name || !outgoingResultWebhook) {
throw usageError("Usage: seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");
throw usageError("Usage: seal-use webhook create --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic]");
}
const autoApprovalRate = webhookRateOption(args.options);
const materialPackFilePolicy = materialPackFilePolicyOptions(args.options);