/** * Classifier, assigns a CommandClassification to each command segment * and computes the highest-risk classification for a full command. * * Classification priority (highest → lowest): * destructive > escalation > network > write > read * * Also detects dangerous shell patterns such as rm -rf, force-push, etc. */ import type { CommandClassification, CommandSegment, NormalizedCommand } from './types.js'; /** * Returns a denial reason when the segment is catastrophic, an operation so * irreversible (root filesystem deletion, raw disk destruction, fork bomb) * that it is blocked unconditionally, regardless of permission settings. * * This is deliberately a MUCH narrower net than the 'destructive' * classification: ordinary destructive-class commands (kill, rm on project * paths, truncate) are risk-classified and left to the permission layer, * where user settings and prompts decide. Catastrophic commands have no * legitimate agent use and no configuration surface. * * @param seg - The command segment to check. * @returns A human-readable reason if catastrophic, or null. */ export declare function catastrophicReason(seg: CommandSegment): string | null; /** * Returns the higher-priority classification of two. * * @param a - First classification. * @param b - Second classification. * @returns The classification with higher risk priority. */ export declare function higherPriority(a: CommandClassification, b: CommandClassification): CommandClassification; /** * Classifies a single CommandSegment into a CommandClassification tier. * * For compound tools (git, npm, npx, yarn, pnpm, bun), the first positional * argument (sub-command) determines the sub-classification. * * @param seg - The command segment to classify. * @returns The CommandClassification for this segment. */ export declare function classifySegment(seg: CommandSegment): CommandClassification; /** * Classifies a full normalized command, computing the union of classifications * across all segments and the highest-risk tier. * * @param original - The original command string. * @param segments - The command segments to classify. * @returns A partial NormalizedCommand (without the original field, for composability). */ export declare function classifyCommand(original: string, segments: CommandSegment[]): Omit; //# sourceMappingURL=classifier.d.ts.map