/** * File Organizer MCP Server Configuration * Secure defaults with platform-aware directory access */ import type { PrivacyMode } from "./types.js"; export declare const CONFIG: { VERSION: string; security: { enablePathValidation: boolean; allowCustomDirectories: boolean; logAccess: boolean; maxScanDepth: number; maxFilesPerOperation: number; }; paths: { defaultAllowed: string[]; customAllowed: string[]; alwaysBlocked: RegExp[]; }; }; /** * User configuration structure */ export interface UserConfig { /** Custom directories allowed for file operations */ customAllowedDirectories?: string[]; /** * Allow directories outside the home directory, such as external drives and * network mounts (e.g. /Volumes/ on macOS, /mnt or /media on Linux). * Set to true only for paths you explicitly trust. */ allowExternalVolumes?: boolean; /** Conflict resolution strategy */ conflictStrategy?: "rename" | "skip" | "overwrite"; /** Auto-organize schedule settings */ autoOrganize?: { enabled: boolean; schedule?: "hourly" | "daily" | "weekly"; }; /** Security settings */ settings?: { maxScanDepth?: number; logAccess?: boolean; enablePathValidation?: boolean; allowCustomDirectories?: boolean; }; /** Organization rules */ rules?: Array<{ pattern: string; destination: string; overwrite?: boolean; }>; /** Watch list for smart scheduling */ watchList?: WatchConfig[]; /** History logging settings */ historyLogging?: { enabled?: boolean; maxFileSizeMB?: number; keepRotatedFiles?: number; privacyMode?: PrivacyMode; }; } /** * Watch configuration for per-directory scheduling */ export interface WatchConfig { /** Directory path to watch */ directory: string; /** Cron expression for scheduling (e.g., "0 9 * * *" for 9am daily) */ schedule: string; /** Organization rules for this watch */ rules: { /** Enable auto-organization */ auto_organize: boolean; /** Minimum file age in minutes before organizing (prevents organizing files being written) */ min_file_age_minutes?: number; /** Maximum files to process per run (0 or undefined = unlimited) */ max_files_per_run?: number; /** Catchup behavior when server starts */ catchup_mode?: "smart" | "always" | "never"; }; } /** * Load custom allowed directories from user config file * * SECURITY JUSTIFICATION: * - The configPath is determined by getUserConfigPath() which returns an internal, * application-managed path (e.g., %APPDATA%/file-organizer-mcp/config.json) * - This is NOT user-provided input - it's an application config file created and * managed by this application * - readFileSync is used here for synchronous loading at startup which is acceptable * since this is a one-time initialization operation with a known, fixed file path */ export declare function loadUserConfig(): UserConfig; /** * Update user config with deep merge (preserves existing settings) * @deprecated Use updateUserConfig instead */ export declare function saveConfig(config: Partial): void; /** * Update user config with deep merge (preserves existing settings) * @returns true if successful, false otherwise */ export declare function updateUserConfig(updates: Partial): boolean; /** * Get path to user config file */ export declare function getUserConfigPath(): string; /** * Get the history directory path */ export declare function getHistoryDirectory(): string; /** * Get the history file path */ export declare function getHistoryFilePath(): string; export declare const HISTORY_LOGGING_CONFIG: { DEFAULT_MAX_FILE_SIZE_MB: number; DEFAULT_KEEP_ROTATED_FILES: number; DEFAULT_PRIVACY_MODE: PrivacyMode; MAX_ENTRIES_PER_FLUSH: number; FLUSH_TIMEOUT_MS: number; LOCK_FILE_TIMEOUT_MS: number; MAX_RETRY_ATTEMPTS: number; }; /** * Create default user config file if it doesn't exist */ export declare function initializeUserConfig(): void; export declare const MAX_FILE_SIZE: number; export declare const MAX_FILES: number; export declare const MAX_DEPTH: number; export declare const SKIP_DIRECTORIES: readonly ["node_modules", ".git", "__pycache__", ".venv"]; export declare const SKIP_PATTERNS: { readonly HIDDEN_FILES: RegExp; }; //# sourceMappingURL=config.d.ts.map