/**
 * Bash Allowlist Types
 *
 * Pattern-based command approval system for persistent allowlisting
 * of bash commands. Supports glob patterns, exact matches, and
 * command prefix matching.
 */
/**
 * Default configuration
 */
export const DEFAULT_ALLOWLIST_CONFIG = {
    version: 1,
    patterns: [],
    defaults: {
        timeout: 30000,
        fallback: 'prompt',
        showAlwaysAllow: true,
        showAlwaysDeny: true,
    },
    stats: {
        totalChecks: 0,
        allowed: 0,
        denied: 0,
        prompted: 0,
    },
};
// ============================================================================
// Predefined Patterns
// ============================================================================
/**
 * Default safe patterns (system-provided)
 */
export const DEFAULT_SAFE_PATTERNS = [
    // Package managers - read operations
    {
        pattern: 'npm list*',
        type: 'glob',
        decision: 'allow',
        description: 'npm list commands are safe read operations',
        tags: ['npm', 'package-manager', 'safe'],
    },
    {
        pattern: 'npm outdated*',
        type: 'glob',
        decision: 'allow',
        description: 'npm outdated is a safe read operation',
        tags: ['npm', 'package-manager', 'safe'],
    },
    {
        pattern: 'npm view*',
        type: 'glob',
        decision: 'allow',
        description: 'npm view is a safe read operation',
        tags: ['npm', 'package-manager', 'safe'],
    },
    // Git - read operations
    {
        pattern: 'git status*',
        type: 'glob',
        decision: 'allow',
        description: 'git status is a safe read operation',
        tags: ['git', 'vcs', 'safe'],
    },
    {
        pattern: 'git log*',
        type: 'glob',
        decision: 'allow',
        description: 'git log is a safe read operation',
        tags: ['git', 'vcs', 'safe'],
    },
    {
        pattern: 'git diff*',
        type: 'glob',
        decision: 'allow',
        description: 'git diff is a safe read operation',
        tags: ['git', 'vcs', 'safe'],
    },
    {
        pattern: 'git branch*',
        type: 'glob',
        decision: 'allow',
        description: 'git branch (without -d/-D) is safe',
        tags: ['git', 'vcs', 'safe'],
    },
    {
        pattern: 'git show*',
        type: 'glob',
        decision: 'allow',
        description: 'git show is a safe read operation',
        tags: ['git', 'vcs', 'safe'],
    },
    // Testing
    {
        pattern: 'npm test*',
        type: 'glob',
        decision: 'allow',
        description: 'npm test commands run project tests',
        tags: ['npm', 'testing', 'safe'],
    },
    {
        pattern: 'npm run test*',
        type: 'glob',
        decision: 'allow',
        description: 'npm run test commands',
        tags: ['npm', 'testing', 'safe'],
    },
    {
        pattern: 'jest*',
        type: 'glob',
        decision: 'allow',
        description: 'Jest test runner',
        tags: ['testing', 'jest', 'safe'],
    },
    // Linting/formatting
    {
        pattern: 'npm run lint*',
        type: 'glob',
        decision: 'allow',
        description: 'Linting commands',
        tags: ['npm', 'lint', 'safe'],
    },
    {
        pattern: 'eslint*',
        type: 'glob',
        decision: 'allow',
        description: 'ESLint commands',
        tags: ['lint', 'eslint', 'safe'],
    },
    {
        pattern: 'prettier*',
        type: 'glob',
        decision: 'allow',
        description: 'Prettier commands',
        tags: ['format', 'prettier', 'safe'],
    },
    // Build
    {
        pattern: 'npm run build*',
        type: 'glob',
        decision: 'allow',
        description: 'Build commands',
        tags: ['npm', 'build', 'safe'],
    },
    {
        pattern: 'tsc*',
        type: 'glob',
        decision: 'allow',
        description: 'TypeScript compiler',
        tags: ['typescript', 'build', 'safe'],
    },
];
/**
 * Patterns that should always be denied
 */
export const DEFAULT_DENY_PATTERNS = [
    {
        pattern: 'rm -rf /*',
        type: 'glob',
        decision: 'deny',
        description: 'Prevents recursive deletion of root',
        tags: ['dangerous', 'destructive'],
    },
    {
        pattern: 'rm -rf ~/*',
        type: 'glob',
        decision: 'deny',
        description: 'Prevents recursive deletion of home directory',
        tags: ['dangerous', 'destructive'],
    },
    {
        pattern: 'sudo rm*',
        type: 'glob',
        decision: 'deny',
        description: 'Blocks privileged deletion',
        tags: ['dangerous', 'sudo'],
    },
    {
        pattern: ':(){ :|:& };:',
        type: 'exact',
        decision: 'deny',
        description: 'Fork bomb',
        tags: ['dangerous', 'fork-bomb'],
    },
];
//# sourceMappingURL=types.js.map