/** * ┌─────────────────────────────────────────────────────────────────────────┐ * │ PATH RESOLVER UTILITY - Intelligent File Path Resolution │ * ├─────────────────────────────────────────────────────────────────────────┤ * │ Filename: path-resolver.ts │ * │ Language: TypeScript │ * │ MCP Server: PDF Operations Server │ * │ │ * │ Purpose: │ * │ Intelligently resolves file paths from various formats including │ * │ absolute paths, relative paths, workspace paths, and attachment URIs. │ * │ Makes it easy for users to reference files without full paths. │ * │ │ * │ Why this file exists: │ * │ - Users shouldn't need to provide full absolute paths │ * │ - Support for Claude attachments and VS Code workspace files │ * │ - Automatic path detection and resolution │ * │ - Security validation for resolved paths │ * │ │ * │ Features: │ * │ - Resolves absolute paths │ * │ - Resolves relative paths from current working directory │ * │ - Detects and resolves workspace-relative paths │ * │ - Handles file:// URIs │ * │ - Searches common directories (Downloads, Documents, Desktop) │ * │ - Validates file existence and accessibility │ * │ │ * │ Security Considerations: │ * │ - Prevents path traversal attacks │ * │ - Validates resolved paths are within safe boundaries │ * │ - Ensures file is readable and accessible │ * │ │ * │ Dependencies: │ * │ - fs/promises: File system operations │ * │ - path: Path manipulation │ * │ - os: User home directory detection │ * │ │ * │ Author: PDF MCP Team │ * │ Created: 2025-10-29 │ * │ Version: 1.0.0 │ * └─────────────────────────────────────────────────────────────────────────┘ */ /** * Intelligently resolves a file path from various formats * * Supports: * - Absolute paths: /Users/username/file.pdf * - Relative paths: ./file.pdf, ../file.pdf * - File URIs: file:///Users/username/file.pdf * - Filename only: file.pdf (searches common directories) * - Workspace relative: Documents/file.pdf * * @param inputPath - Input path in any supported format * @returns Resolved absolute file path * @throws Error if file cannot be found or accessed */ export declare function resolveFilePath(inputPath: string): Promise; /** * Validates that a resolved path is a PDF file * * @param filePath - Path to validate * @throws Error if not a PDF file */ export declare function validatePDFExtension(filePath: string): void; /** * Resolves and validates a PDF file path * Combines path resolution with PDF validation * * @param inputPath - Input path in any supported format * @returns Resolved absolute path to PDF file * @throws Error if file not found or not a PDF */ export declare function resolvePDFPath(inputPath: string): Promise; //# sourceMappingURL=path-resolver.d.ts.map