/**
 * Bash Allowlist Types
 *
 * Pattern-based command approval system for persistent allowlisting
 * of bash commands. Supports glob patterns, exact matches, and
 * command prefix matching.
 */
/**
 * Type of pattern matching to use
 */
export type PatternType = 'exact' | 'prefix' | 'glob' | 'regex';
/**
 * Decision for a pattern
 */
export type ApprovalDecision = 'allow' | 'deny';
/**
 * An approval pattern entry
 */
export interface ApprovalPattern {
    /** Unique identifier */
    id: string;
    /** The pattern to match */
    pattern: string;
    /** Type of pattern matching */
    type: PatternType;
    /** Decision for matching commands */
    decision: ApprovalDecision;
    /** Human-readable description/reason */
    description?: string;
    /** Number of times this pattern has been used */
    useCount: number;
    /** When the pattern was created */
    createdAt: Date;
    /** When the pattern was last matched */
    lastUsedAt?: Date;
    /** Optional expiration time (null = never expires) */
    expiresAt?: Date | null;
    /** Whether this pattern is enabled */
    enabled: boolean;
    /** Tags for organization */
    tags?: string[];
    /** Source of this pattern (user, system, plugin) */
    source: PatternSource;
}
/**
 * Where the pattern came from
 */
export type PatternSource = 'user' | 'system' | 'plugin' | 'import';
/**
 * Result of checking a command against the allowlist
 */
export interface AllowlistCheckResult {
    /** Whether a pattern matched */
    matched: boolean;
    /** The matching pattern (if any) */
    pattern?: ApprovalPattern;
    /** Decision (if matched) or fallback */
    decision: ApprovalDecision | 'prompt';
    /** Reason for this result */
    reason: string;
}
/**
 * Options for approval prompts
 */
export interface ApprovalPromptOptions {
    /** Command being executed */
    command: string;
    /** Working directory */
    cwd: string;
    /** Timeout for user response (ms) */
    timeout?: number;
    /** Whether to show "always allow" option */
    showAlwaysAllow?: boolean;
    /** Whether to show "always deny" option */
    showAlwaysDeny?: boolean;
}
/**
 * Result from user approval prompt
 */
export interface ApprovalPromptResult {
    /** User's decision */
    decision: 'allow-once' | 'allow-always' | 'deny-once' | 'deny-always';
    /** Pattern to save (for always options) */
    pattern?: string;
    /** Type of pattern (for always options) */
    patternType?: PatternType;
    /** User-provided description */
    description?: string;
    /** Whether the prompt timed out */
    timedOut?: boolean;
}
/**
 * Persisted allowlist configuration
 */
export interface AllowlistConfig {
    /** Schema version for migrations */
    version: number;
    /** All stored patterns */
    patterns: ApprovalPattern[];
    /** Default settings */
    defaults: {
        /** Default timeout for prompts (ms) */
        timeout: number;
        /** Default decision when no pattern matches and no prompt */
        fallback: ApprovalDecision | 'prompt';
        /** Whether to show "always allow" option in prompts */
        showAlwaysAllow: boolean;
        /** Whether to show "always deny" option in prompts */
        showAlwaysDeny: boolean;
    };
    /** Statistics */
    stats: {
        /** Total commands checked */
        totalChecks: number;
        /** Commands allowed */
        allowed: number;
        /** Commands denied */
        denied: number;
        /** Commands prompted */
        prompted: number;
    };
}
/**
 * Default configuration
 */
export declare const DEFAULT_ALLOWLIST_CONFIG: AllowlistConfig;
/**
 * Allowlist events
 */
export interface AllowlistEvents {
    'pattern:added': ApprovalPattern;
    'pattern:removed': {
        id: string;
    };
    'pattern:matched': {
        command: string;
        pattern: ApprovalPattern;
    };
    'pattern:expired': {
        id: string;
    };
    'check:allowed': {
        command: string;
        pattern?: ApprovalPattern;
    };
    'check:denied': {
        command: string;
        pattern?: ApprovalPattern;
    };
    'check:prompted': {
        command: string;
    };
    'config:saved': AllowlistConfig;
    'config:loaded': AllowlistConfig;
}
/**
 * Default safe patterns (system-provided)
 */
export declare const DEFAULT_SAFE_PATTERNS: Partial<ApprovalPattern>[];
/**
 * Patterns that should always be denied
 */
export declare const DEFAULT_DENY_PATTERNS: Partial<ApprovalPattern>[];
