/**
 * Permission system — controls tool execution based on permission mode.
 *
 * Three modes:
 * - `yolo`: All tools allowed without prompting
 * - `auto`: Read-only tools allowed; destructive tools require confirmation
 * - `ask`: All non-read-only tools require confirmation
 *
 * Users can type "always" when prompted to upgrade to `auto` mode
 * for the rest of the session (and persist to config).
 */
import * as readline from 'node:readline/promises';
import type { Tool } from './tools/types.js';
import type { GrawkusConfig } from './types.js';
export interface PermissionExplanation {
    decision: 'allow' | 'prompt' | 'deny';
    reason: string;
    lines: string[];
}
export declare function explainPermission(tool: Pick<Tool, 'name' | 'isReadOnly' | 'isDestructive'>, input: Record<string, unknown>, config: GrawkusConfig): PermissionExplanation;
/**
 * Check if a tool call is allowed under the current permission mode.
 * Returns true if allowed, false if denied.
 *
 * @param tool - The tool being invoked
 * @param input - The tool's input arguments
 * @param config - Current Grawkus configuration (may be mutated if user types "always")
 * @param rl - Readline interface for prompting the user
 * @returns True if the tool call is allowed, false if denied
 */
export declare function checkPermission(tool: Tool, input: Record<string, unknown>, config: GrawkusConfig, rl: readline.Interface): Promise<boolean>;
