import { ChatMessage, FinishFileSpec } from './agent/types.js'; export { ToolCall, ToolCallRef, ToolName } from './agent/types.js'; import { WarpGrepProvider, ListDirectoryEntry } from './providers/types.js'; export { GlobResult, GrepResult, ReadResult } from './providers/types.js'; export { extractPathFromCommand, parseFinishFiles, parseReadLines } from './agent/parser.js'; export { formatAgentToolOutput as formatToolResult } from './agent/formatter.js'; export { n as normalizeFinishFiles, r as readFinishFiles, t as toolGrep, b as toolListDirectory, a as toolRead } from '../../finish-Ddj1MPGt.js'; export { AGENT_CONFIG, DEFAULT_EXCLUDES } from './agent/config.js'; export { LocalRipgrepProvider } from './providers/local.js'; import '../utils/resilience.js'; declare function toolGlob(provider: WarpGrepProvider, args: { pattern: string; path?: string; }): Promise; /** * Shared helper functions for warp-grep agent loop. * Used by both the internal runner and exported for harness users. */ /** * Format the turn counter message shown to the model. */ declare function formatTurnMessage(turnsUsed: number, maxTurns: number): string; /** * Calculate and format the context budget indicator. */ declare function calculateContextBudget(messages: ChatMessage[]): string; /** * Build the initial state message containing repo structure and search term. */ declare function buildInitialState(repoRoot: string, searchTerm: string, provider: WarpGrepProvider, options?: { search_type?: string; }): Promise; /** * Format directory entries as an indented tree string. */ declare function formatListDirectoryTree(entries: ListDirectoryEntry[]): string; /** * Warp Grep Harness Primitives * * Building blocks for custom agent harnesses. * Use these when you want to control the agent loop yourself. * * @example * ```typescript * import { * parseFinishFiles, * parseReadLines, * extractPathFromCommand, * formatToolResult, * formatTurnMessage, * formatListDirectoryTree, * calculateContextBudget, * buildInitialState, * toolGrep, * toolRead, * toolListDirectory, * toolGlob, * resolveFinishFiles, * AGENT_CONFIG, * LocalRipgrepProvider, * type ToolCall, * type WarpGrepProvider, * } from '@morphllm/morphsdk/tools/warp-grep/harness'; * * const provider = new LocalRipgrepProvider(repoRoot); * const messages = [ * { role: 'user', content: await buildInitialState(repoRoot, searchTerm, provider) }, * ]; * * // With OpenAI native tool calling, tool_calls come structured from the API response. * // Use parseFinishFiles, parseReadLines, extractPathFromCommand to parse string args. * ``` */ type ResolvedFile = { path: string; content: string; }; declare function resolveFinishFiles(provider: WarpGrepProvider, files: FinishFileSpec[]): Promise; export { ChatMessage, FinishFileSpec, ListDirectoryEntry, type ResolvedFile, WarpGrepProvider, buildInitialState, calculateContextBudget, formatListDirectoryTree, formatTurnMessage, resolveFinishFiles, toolGlob };