/** * Configuration for workspace path resolution */ export interface WorkspacePathResolverConfig { /** The working directory to resolve relative paths against */ workspace: string; } /** * Tool call arguments that may contain path parameters */ export interface ToolCallArgs { [key: string]: unknown; path?: string; paths?: string[]; directory?: string; cwd?: string; source?: string; destination?: string; } /** * Mapping of tool names to their path parameter names */ export interface PathParameterMapping { [toolName: string]: string[]; } /** * Default mapping of tool names to their path parameter names */ export declare const DEFAULT_PATH_PARAMETER_MAPPING: PathParameterMapping; /** * WorkspacePathResolver - Resolves relative paths to absolute paths within workspace context * * This utility class provides a centralized way to handle path resolution for tools * that operate on files and directories, ensuring they respect the configured workspace. * * Key features: * - Converts relative paths to absolute paths within workspace * - Supports configurable path parameter mappings for different tools * - Preserves absolute paths that are already correctly specified * - Provides type-safe path resolution with proper error handling */ export declare class WorkspacePathResolver { private readonly config; private readonly pathMapping; /** * Create a new workspace path resolver * * @param config - Configuration for path resolution * @param pathMapping - Custom mapping of tool names to path parameters (optional) */ constructor(config: WorkspacePathResolverConfig, pathMapping?: PathParameterMapping); /** * Resolve path parameters in tool call arguments based on workspace context * * @param toolName - Name of the tool being called * @param args - Tool call arguments that may contain path parameters * @returns Modified arguments with resolved paths */ resolveToolPaths(toolName: string, args: ToolCallArgs): ToolCallArgs; /** * Resolve a single path relative to the workspace directory * * @param inputPath - The path to resolve * @returns Absolute path resolved within workspace context */ private resolvePath; /** * Check if a tool has path parameters that can be resolved * * @param toolName - Name of the tool to check * @returns True if the tool has resolvable path parameters */ hasPathParameters(toolName: string): boolean; /** * Get the list of path parameter names for a specific tool * * @param toolName - Name of the tool * @returns Array of path parameter names, or empty array if none */ getPathParameters(toolName: string): string[]; /** * Get the current working directory * * @returns The configured working directory */ getWorkingDirectory(): string; /** * Update the path parameter mapping for additional tools * * @param additionalMapping - Additional tool-to-path-parameters mapping */ addPathMapping(additionalMapping: PathParameterMapping): void; } //# sourceMappingURL=workspace-path-resolver.d.ts.map