import { z } from 'zod'; export { WarpGrepClient, executeGitHubReadFile, executeToolCall, executeWarpGrep, formatGitHubReadFileResult, formatResult } from './client.js'; export { e as GitHubReadFileInput, f as GitHubReadFileResult, h as GitHubReadFileToolConfig, G as GitHubSearchInput, g as GitHubSearchToolConfig, R as RemoteCommands, W as WarpGrepClientConfig, c as WarpGrepContext, a as WarpGrepInput, b as WarpGrepResult, d as WarpGrepToolConfig } from '../../types-qwD753FR.js'; export { GrepResult, ListDirectoryEntry, ReadResult, WarpGrepProvider } from './providers/types.js'; export { LocalRipgrepProvider } from './providers/local.js'; export { RemoteCommandsProvider } from './providers/remote.js'; export { CodeStorageHttpConfig, createCodeStorageHttpCommands } from './providers/code_storage_http.js'; export { fixPathRepetition } from './utils/paths.js'; export { runWarpGrep, runWarpGrepStreaming } from './agent/runner.js'; export { AgentRunResult, ChatMessage, SessionConfig, WarpGrepStep } from './agent/types.js'; export { n as normalizeFinishFiles, r as readFinishFiles, t as toolGrep, b as toolListDirectory, a as toolRead } from '../../finish-Ddj1MPGt.js'; import '../../core/client.js'; import '../utils/resilience.js'; import '../../core/resource.js'; /** * Prompts and descriptions for codebase_search */ /** * Default tool name for the warp grep tool */ declare const WARP_GREP_TOOL_NAME = "codebase_search"; /** * Default tool description for the warp grep tool */ declare const WARP_GREP_DESCRIPTION: string; declare const GITHUB_SEARCH_TOOL_NAME = "github_codebase_search"; declare const GITHUB_SEARCH_DESCRIPTION: string; declare const GITHUB_SEARCH_INPUT_SCHEMA: { type: "object"; properties: { search_term: { type: "string"; description: string; }; github_url: { type: "string"; description: string; }; owner_repo: { type: "string"; description: string; }; branch: { type: "string"; description: string; }; }; required: readonly ["search_term"]; }; declare const GITHUB_READ_FILE_TOOL_NAME = "readfile_github_search"; declare const GITHUB_READ_FILE_DESCRIPTION: string; declare const GITHUB_READ_FILE_INPUT_SCHEMA: { type: "object"; properties: { github: { type: "string"; description: string; }; path: { type: "string"; description: string; }; startLine: { type: "number"; description: string; }; endLine: { type: "number"; description: string; }; branch: { type: "string"; description: string; }; }; required: readonly ["github", "path"]; }; /** * Morph Warp Grep SDK * * Fast and accurate code search tool for AI agents. * Uses ripgrep locally, or use `remoteCommands` for sandbox environments. * * @example Local usage * ```typescript * // With MorphClient (recommended) * import { MorphClient } from '@morphllm/morphsdk'; * * const morph = new MorphClient({ morphApiKey: process.env.MORPH_API_KEY }); * const result = await morph.warpGrep.execute({ * searchTerm: 'Find authentication middleware', * repoRoot: '.' * }); * ``` * * @example * ```typescript * // Standalone client * import { WarpGrepClient } from '@morphllm/morphsdk/tools/warp-grep'; * * const client = new WarpGrepClient({ morphApiKey: process.env.MORPH_API_KEY }); * const result = await client.execute({ * searchTerm: 'Find authentication middleware', * repoRoot: '.' * }); * ``` * * @example * ```typescript * // As a tool for AI agents * import { createWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/anthropic'; * * const tool = createWarpGrepTool({ repoRoot: '.' }); * // Pass to Claude, GPT, Gemini, etc. * ``` * * @example Remote sandbox (E2B, Modal, Daytona, etc.) * ```typescript * import { createMorphWarpGrepTool } from '@morphllm/morphsdk/tools/warp-grep/anthropic'; * * const tool = createMorphWarpGrepTool({ * repoRoot: '/home/repo', * remoteCommands: { * grep: async (pattern, path) => (await sandbox.run(`rg '${pattern}' '${path}'`)).stdout, * read: async (path, start, end) => (await sandbox.run(`sed -n '${start},${end}p' '${path}'`)).stdout, * listDir: async (path, maxDepth) => (await sandbox.run(`find '${path}' -maxdepth ${maxDepth}`)).stdout, * }, * }); * ``` * * @example Provider-agnostic usage (bring your own tool abstraction) * ```typescript * import { * warpGrepInputSchema, * executeToolCall, * WARP_GREP_TOOL_NAME, * WARP_GREP_DESCRIPTION, * } from '@morphllm/morphsdk/tools/warp-grep'; * * // Use with your own tool definition abstraction * const toolDef = createToolDef({ * name: WARP_GREP_TOOL_NAME, * description: WARP_GREP_DESCRIPTION, * schema: warpGrepInputSchema, * }); * * // Execute * const result = await executeToolCall( * { search_term: 'Find auth middleware' }, * { repoRoot: '.', morphApiKey: process.env.MORPH_API_KEY } * ); * ``` */ /** Provider-agnostic Zod schema for warp grep input */ declare const warpGrepInputSchema: z.ZodObject<{ search_term: z.ZodString; }, "strip", z.ZodTypeAny, { search_term: string; }, { search_term: string; }>; type WarpGrepInputSchema = z.infer; export { GITHUB_READ_FILE_DESCRIPTION, GITHUB_READ_FILE_INPUT_SCHEMA, GITHUB_READ_FILE_TOOL_NAME, GITHUB_SEARCH_DESCRIPTION, GITHUB_SEARCH_INPUT_SCHEMA, GITHUB_SEARCH_TOOL_NAME, WARP_GREP_DESCRIPTION, WARP_GREP_TOOL_NAME, type WarpGrepInputSchema, warpGrepInputSchema };