/** * Schema-driven CLI flag bridge. The JSON schemas in `src/server/tool-schemas.ts` * are the single source of truth for every tool's parameters; this module derives * `--flag` names, coercion rules, and the boolean-flag set from them, then layers * a curated set of shorthand aliases on top. It does NOT own any tool behaviour — * it only turns raw string flags into a typed tool-input object. */ /** Coercion kinds inferred from a JSON-schema property. */ export type FlagKind = 'string' | 'number' | 'boolean' | 'enum' | 'array-string' | 'array-object' | 'object' | 'oneof-string-array'; export interface FlagSpec { /** Kebab-case flag name (no leading dashes). */ flag: string; /** Canonical schema property key this flag sets. */ key: string; kind: FlagKind; /** Allowed values for `kind === 'enum'`. */ enumValues?: string[]; /** Schema property description, for help rendering. */ description?: string; } /** * Properties that are NOT reachable via a derived `--flag` because they are * mapped some other way (positional, verb, subcommand, or curated string-wrap). * Keyed by canonical tool name. The parity test pins the same set. */ export declare const ROUND_TRIP_EXCLUSIONS: Record>; /** Derive one FlagSpec per schema property (kebab flag + coercion kind). */ export declare function toolFlagSpecs(command: string): FlagSpec[]; /** * Boolean flags that take NO value — the parser must not let them swallow the * next positional token. Union of: schema booleans, their `no-` variants, and * the curated boolean aliases that apply to this tool. */ export declare function booleanFlagsFor(command: string): Set; /** * Coerce a tool's raw string flags into a typed tool-input object per the * schema-driven matrix. Unknown flags produce an error (with a nearest-match * suggestion when levenshtein distance ≤ 2). Curated aliases win over * schema-derived flags of the same name. */ export declare function coerceFlags(command: string, flags: Record): { input: Record; errors: string[]; }; /** * Merge schema-derived bridge output into a curated tool-input object. Keys the * executor already set (curated mappings) WIN over bridge-derived values. The * one cast-through-unknown lives here so executors stay `as`-free; every tool * input is a plain object literal, so this widening is sound. */ export declare function mergeBridged(curated: T, bridged: Record): T; //# sourceMappingURL=flag-bridge.d.ts.map