import * as ai from 'ai'; import { CodebaseSearchConfig } from './types.js'; import '../utils/resilience.js'; /** * Create Vercel AI SDK codebase_search tool * * @param config - Configuration with repoId * @returns Vercel AI SDK tool definition (execution built-in) * * @example * ```ts * import { generateText } from 'ai'; * import { anthropic } from '@ai-sdk/anthropic'; * import { createCodebaseSearchTool } from 'morphsdk/tools/codebase-search/vercel'; * * const tool = createCodebaseSearchTool({ repoId: 'my-project' }); * * const result = await generateText({ * model: anthropic('claude-3-5-sonnet-20241022'), * tools: { codebaseSearch: tool }, * prompt: "Find authentication code", * maxSteps: 5 * }); * * // Vercel AI SDK automatically executes and handles results * console.log(result.text); * ``` */ declare function createCodebaseSearchTool(config: CodebaseSearchConfig): ai.Tool<{ query: string; target_directories: string[]; explanation: string; limit?: number | undefined; }, { error: string | undefined; results: never[]; found?: undefined; searchTime?: undefined; } | { found: number; searchTime: string; results: { file: string; symbol: string; lines: string; language: string; relevance: string; code: string; }[]; error?: undefined; }>; /** * Get system prompt for Vercel AI SDK */ declare function getSystemPrompt(): string; /** * Default export */ declare const _default: { createCodebaseSearchTool: typeof createCodebaseSearchTool; getSystemPrompt: typeof getSystemPrompt; }; export { createCodebaseSearchTool, _default as default, getSystemPrompt };