/** * Prefix matching policy rule evaluator. * * PrefixRule matches tool calls by tool name and optionally the command prefix * of the first string argument. Independently testable, no external dependencies. */ import type { PrefixRule, EvaluationStep } from '../types.js'; /** Result returned by evaluatePrefixRule. */ export interface PrefixRuleResult { matched: boolean; step: EvaluationStep; } /** * extractCommandArgs, Extracts EVERY command string from args. * Understands the exec tool's real shape (`commands: [{ cmd }, ...]`) as well * as flat `command`/`cmd` strings; falls back to the first string value. */ export declare function extractCommandArgs(args: Record): string[]; /** * evaluatePrefixRule, Evaluates a single PrefixRule against a tool call. * * Returns `matched: true` only when: * 1. The tool name matches the rule's `toolPattern`, AND * 2. Either no command constraint is specified, OR the call's command * string(s) match the rule's exactCommands / commandPrefixes * (case-insensitive; allow rules need EVERY command to match, deny * rules need ANY). * * @param rule , The PrefixRule to evaluate. * @param toolName, Name of the tool being called. * @param args , Arguments passed to the tool. */ export declare function evaluatePrefixRule(rule: PrefixRule, toolName: string, args: Record): PrefixRuleResult; //# sourceMappingURL=prefix.d.ts.map