UNPKG

@xcud/remote-commander

Version:

MCP server for remote file operations via REST API

76 lines (75 loc) 2.41 kB
export interface FileResult { content: string; mimeType: string; isImage: boolean; } export interface MultiFileResult { path: string; content?: string; mimeType?: string; isImage?: boolean; error?: string; } /** * Placeholder for path validation - now handled by HTTP client */ export declare function validatePath(inputPath: string): Promise<string>; /** * Read file from URL (keep original functionality for URLs) */ export declare function readFileFromUrl(url: string, timeout?: number): Promise<FileResult>; /** * Read file from remote server via API */ export declare function readFileFromDisk(filePath: string, offset?: number, length?: number): Promise<FileResult>; /** * Main read file function - routes to remote API */ export declare function readFile(path: string, isUrl?: boolean, offset?: number, length?: number): Promise<FileResult>; /** * Internal read file function (alias for readFile) */ export declare function readFileInternal(filePath: string, offset?: number, length?: number): Promise<string>; /** * Write file via remote API */ export declare function writeFile(path: string, content: string, mode?: 'rewrite' | 'append'): Promise<void>; /** * Read multiple files via remote API */ export declare function readMultipleFiles(paths: string[]): Promise<MultiFileResult[]>; /** * Create directory via remote API */ export declare function createDirectory(path: string): Promise<void>; /** * List directory via remote API */ export declare function listDirectory(path: string): Promise<string[]>; /** * Move/rename file via remote API */ export declare function moveFile(source: string, destination: string): Promise<void>; /** * Search files via remote API */ export declare function searchFiles(path: string, pattern: string, timeoutMs?: number): Promise<string[]>; /** * Get file info via remote API */ export declare function getFileInfo(path: string): Promise<any>; /** * Search code via remote API */ export declare function searchCode(path: string, pattern: string, options?: { contextLines?: number; filePattern?: string; ignoreCase?: boolean; includeHidden?: boolean; maxResults?: number; timeoutMs?: number; }): Promise<any>; /** * Edit block via remote API */ export declare function editBlock(filePath: string, oldString: string, newString: string, expectedReplacements?: number): Promise<any>;