/** * Path Security * * Provides path validation and sandboxing to prevent * directory traversal and unauthorized file access. */ /** * Path security configuration */ export interface PathConfig { /** Allowed directories for file operations (absolute paths) */ allowedDirectories: string[]; /** Whether to allow operations outside allowed directories */ strictMode: boolean; /** Maximum path length */ maxPathLength: number; } /** * Default path configuration */ export declare const DEFAULT_PATH_CONFIG: PathConfig; /** * Path validation result */ export interface PathValidationResult { valid: boolean; normalizedPath?: string; error?: string; } /** * Check if a path is safe (no traversal sequences) */ export declare function isPathSafe(inputPath: string): boolean; /** * Validate and normalize a path against security rules */ export declare function validatePath(inputPath: string, config?: Partial): PathValidationResult; /** * Ensure a directory exists and is within allowed paths */ export declare function ensureSafeDirectory(dirPath: string, config?: Partial): Promise; /** * Get workspace directory from environment or default */ export declare function getWorkspaceDirectory(): string; /** * Load allowed directories from environment */ export declare function loadAllowedDirectoriesFromEnv(): string[]; /** * Create a path validator with pre-configured settings */ export declare function createPathValidator(config?: Partial): { validate: (inputPath: string) => PathValidationResult; isAllowed: (inputPath: string) => boolean; normalize: (inputPath: string) => string; config: PathConfig; }; //# sourceMappingURL=paths.d.ts.map