The classifier only matched English usage wording, so every Chinese-language
usage error, every enterprise-selection failure, and every Zod/SyntaxError
fell through to exit 1 ("upstream failure"), while environment safety guards
were reported as exit 2 or 1. Add two semantic codes:
- 13 (validationError): well-formed command, unusable value — missing --corp,
unparseable enterprise JSON, missing required parameter, ambiguous webhook
channel selection.
- 14 (safetyBlocked): the target environment forbids the action — replaying
into production, regression outside a test tenant.
classifyCliError now recognises Chinese usage wording, enterprise-selection
phrasing, local file problems, Zod issue lists (structural, not textual) and
SyntaxError; English Usage:/Unknown-command stays 2, domain failures and
quality gates stay 1. Docs (AGENTS, cli-protocol, skill cli.md) and the exit
code assertions follow.
13 lines
320 B
TypeScript
13 lines
320 B
TypeScript
// Re-export from core — this file is the legacy entry point.
|
|
// Domain-layer code should import from "../core/errors.js" directly.
|
|
export {
|
|
type CliExitCode,
|
|
CliError,
|
|
PayloadTooLargeError,
|
|
usageError,
|
|
validationError,
|
|
safetyBlocked,
|
|
confirmationRequired,
|
|
classifyCliError
|
|
} from "../core/errors.js";
|