/**
 * Permission Configuration System
 *
 * Based on Cursor CLI's permission model:
 * - JSON-based configuration
 * - Path restrictions
 * - Command allowlists/blocklists
 * - Network access control
 * - Sandboxed execution support
 *
 * Provides fine-grained control over what the AI agent can do.
 */
import { EventEmitter } from 'events';
export interface PermissionConfig {
    version: string;
    fileSystem: {
        allowedReadPaths: string[];
        allowedWritePaths: string[];
        blockedPaths: string[];
        maxFileSize: number;
        allowCreate: boolean;
        allowDelete: boolean;
    };
    commands: {
        allowedCommands: string[];
        blockedCommands: string[];
        allowArbitraryCommands: boolean;
        maxExecutionTime: number;
        allowSudo: boolean;
    };
    network: {
        allowOutgoing: boolean;
        allowedHosts: string[];
        blockedHosts: string[];
        allowLocalhost: boolean;
    };
    tools: {
        requireConfirmation: string[];
        disabled: string[];
        autoApproved: string[];
    };
    safety: {
        sandboxMode: boolean;
        confirmDestructive: boolean;
        dryRunMode: boolean;
        maxOperationsPerSession: number;
    };
}
export interface PermissionCheckResult {
    allowed: boolean;
    reason?: string;
    requiresConfirmation?: boolean;
}
export declare class PermissionManager extends EventEmitter {
    private config;
    private configPath;
    private operationCount;
    constructor(configPath?: string);
    /**
     * Load configuration from file or use defaults
     */
    private loadConfig;
    /**
     * Merge loaded config with defaults (for missing fields)
     */
    private mergeWithDefaults;
    /**
     * Save configuration to file
     */
    saveConfig(): void;
    /**
     * Check if a file path is allowed for reading
     */
    checkReadPermission(filePath: string): PermissionCheckResult;
    /**
     * Check if a file path is allowed for writing
     */
    checkWritePermission(filePath: string, isCreate?: boolean): PermissionCheckResult;
    /**
     * Check if a command is allowed
     */
    checkCommandPermission(command: string): PermissionCheckResult;
    /**
     * Check if a tool can be used
     */
    checkToolPermission(toolName: string): PermissionCheckResult;
    /**
     * Check network permission for a host
     */
    checkNetworkPermission(host: string): PermissionCheckResult;
    /**
     * Record an operation (for rate limiting)
     */
    recordOperation(): void;
    /**
     * Reset operation count
     */
    resetOperationCount(): void;
    /**
     * Check if path matches any of the patterns
     */
    private matchesAnyPattern;
    /**
     * Check if path matches a glob pattern
     */
    private pathMatches;
    /**
     * Check if command matches a pattern
     */
    private commandMatches;
    /**
     * Get current configuration
     */
    getConfig(): PermissionConfig;
    /**
     * Update configuration
     */
    updateConfig(updates: Partial<PermissionConfig>): void;
    /**
     * Enable sandbox mode
     */
    enableSandbox(): void;
    /**
     * Enable dry-run mode
     */
    enableDryRun(): void;
    /**
     * Check if in sandbox mode
     */
    isSandboxed(): boolean;
    /**
     * Check if in dry-run mode
     */
    isDryRun(): boolean;
    /**
     * Dispose and cleanup resources
     */
    dispose(): void;
}
export declare function getPermissionManager(configPath?: string): PermissionManager;
export declare function resetPermissionManager(): void;
