import { WarpGrepProvider, GrepResult, ReadResult, ListDirectoryEntry, GlobResult } from './types.js'; import { R as RemoteCommands } from '../../../types-qwD753FR.js'; import '../../utils/resilience.js'; /** * RemoteCommandsProvider - wraps simple RemoteCommands into WarpGrepProvider * * Handles parsing of raw stdout from grep/read/listDir commands. * Users just return stdout, SDK handles all format conversion. */ /** * Wraps simple RemoteCommands functions into a full WarpGrepProvider. * * This allows users to provide three simple functions that return raw stdout, * and the SDK handles all parsing internally. * * @example * ```typescript * const provider = new RemoteCommandsProvider('/home/repo', { * grep: async (pattern, path) => { * const r = await sandbox.run(`rg '${pattern}' '${path}'`); * return r.stdout; * }, * read: async (path, start, end) => { * const r = await sandbox.run(`sed -n '${start},${end}p' '${path}'`); * return r.stdout; * }, * listDir: async (path, maxDepth) => { * const r = await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`); * return r.stdout; * }, * }); * ``` */ declare class RemoteCommandsProvider implements WarpGrepProvider { private readonly repoRoot; private readonly commands; constructor(repoRoot: string, commands: RemoteCommands); /** * Run grep command and parse ripgrep output */ grep(params: { pattern: string; path: string; glob?: string; }): Promise; /** * Read file and add line numbers */ read(params: { path: string; start?: number; end?: number; }): Promise; /** * List directory and parse find output */ listDirectory(params: { path: string; pattern?: string | null; maxResults?: number; maxDepth?: number; }): Promise; /** * Glob search - finds files matching a pattern. * Falls back to a grep --files approach via the listDir command. */ glob(params: { pattern: string; path?: string; }): Promise; } export { RemoteCommandsProvider };