/** * Permission Pre-Filter — risk-based tool approval matrix. * * Pure functions that determine whether a tool execution should be * auto-approved or require explicit approval, based on the tool's * risk category and the configured permission level. */ import type { PermissionLevel, ToolRiskCategory } from "./types.js"; import type { ToolModule } from "../tools/interface.js"; /** * Check whether a tool should be auto-approved or needs approval. * Falls back to safe defaults for unknown levels or risk categories. */ export declare function checkToolPermission(level: PermissionLevel, risk: ToolRiskCategory): "auto" | "ask"; /** * Look up a tool's risk category by name from the tool module registry. * Returns "destructive" for unknown tools (safe default). */ export declare function getToolRiskCategory(toolName: string, toolModules: ToolModule[]): ToolRiskCategory; /** * Resolve the effective permission level from multiple config sources. * Priority: flag > env var > config file > default. * Invalid values silently fall through to the next source. */ export declare function resolvePermissionLevel(flagLevel?: string, envVar?: string, configLevel?: string): PermissionLevel;