import { WarpGrepStep } from './agent/types.js';
import { W as WarpGrepClientConfig, a as WarpGrepInput, b as WarpGrepResult, G as GitHubSearchInput, e as GitHubReadFileInput, f as GitHubReadFileResult, d as WarpGrepToolConfig } from '../../types-CtkD4o1_.js';
import '../utils/resilience.js';
import './providers/types.js';

/**
 * WarpGrep client for programmatic code search
 */

/**
 * WarpGrep client for programmatic code search
 *
 * @example
 * ```typescript
 * import { WarpGrepClient } from '@morphllm/morphsdk';
 *
 * const client = new WarpGrepClient({ morphApiKey: process.env.MORPH_API_KEY });
 *
 * // Simple usage - defaults to LocalRipgrepProvider
 * const result = await client.execute({
 *   searchTerm: 'Find authentication middleware',
 *   repoRoot: '.'
 * });
 *
 * // With custom excludes
 * const result = await client.execute({
 *   searchTerm: 'Find database models',
 *   repoRoot: '.',
 *   excludes: ['node_modules', '.git', 'dist']
 * });
 * ```
 */
declare class WarpGrepClient {
    private config;
    constructor(config?: WarpGrepClientConfig);
    /**
     * Execute a code search
     *
     * @param input - Search parameters including searchTerm, repoRoot, and optional provider
     * @returns Search results with relevant code contexts, or an AsyncGenerator if streamSteps is true
     *
     * @example
     * ```typescript
     * // Standard execution
     * const result = await client.execute({
     *   searchTerm: 'Find authentication middleware',
     *   repoRoot: '.'
     * });
     *
     * if (result.success) {
     *   for (const ctx of result.contexts) {
     *     console.log(`File: ${ctx.file}`);
     *     console.log(ctx.content);
     *   }
     * }
     *
     * // Streaming execution
     * const stream = client.execute({
     *   searchTerm: 'Find auth middleware',
     *   repoRoot: '.',
     *   streamSteps: true
     * });
     *
     * for await (const step of stream) {
     *   console.log(`Turn ${step.turn}:`, step.toolCalls);
     * }
     * ```
     */
    execute(input: WarpGrepInput & {
        streamSteps: true;
    }): AsyncGenerator<WarpGrepStep, WarpGrepResult, undefined>;
    execute(input: WarpGrepInput & {
        streamSteps?: false | undefined;
    }): Promise<WarpGrepResult>;
    /**
     * Search a public GitHub repository
     *
     * @example
     * ```typescript
     * // Simple usage
     * const result = await client.searchGitHub({
     *   searchTerm: 'Find authentication middleware',
     *   github: 'vercel/next.js',
     * });
     *
     * // With streaming
     * const stream = client.searchGitHub({
     *   searchTerm: 'Find auth middleware',
     *   github: 'https://github.com/vercel/next.js',
     *   streamSteps: true,
     * });
     * for await (const step of stream) {
     *   console.log(`Turn ${step.turn}:`, step.toolCalls);
     * }
     * ```
     */
    searchGitHub(input: GitHubSearchInput & {
        streamSteps: true;
    }): AsyncGenerator<WarpGrepStep, WarpGrepResult, undefined>;
    searchGitHub(input: GitHubSearchInput & {
        streamSteps?: false | undefined;
    }): Promise<WarpGrepResult>;
    /**
     * Read a single file from a public GitHub repository
     *
     * @example
     * ```typescript
     * const result = await client.readGitHubFile({
     *   github: 'vercel/next.js',
     *   path: 'src/server/app-render/index.tsx',
     *   startLine: 1,
     *   endLine: 50,
     * });
     * if (result.success) console.log(result.content);
     * ```
     */
    readGitHubFile(input: GitHubReadFileInput): Promise<GitHubReadFileResult>;
    private _resolveGitHubRepo;
    private _searchGitHubAsync;
    private _searchGitHubStreaming;
}
/**
 * Execute a warp grep search directly
 *
 * @param input - Search parameters
 * @param config - Optional client configuration
 * @returns Search results, or an AsyncGenerator if streamSteps is true
 *
 * @example
 * ```typescript
 * import { executeWarpGrep } from '@morphllm/morphsdk/tools/warp-grep';
 *
 * const result = await executeWarpGrep({
 *   searchTerm: 'Find authentication middleware',
 *   repoRoot: '.'
 * });
 *
 * // Streaming
 * const stream = executeWarpGrep({
 *   searchTerm: 'Find auth',
 *   repoRoot: '.',
 *   streamSteps: true
 * });
 * for await (const step of stream) {
 *   console.log(step.turn, step.toolCalls);
 * }
 * ```
 */
declare function executeWarpGrep(input: WarpGrepInput & {
    streamSteps: true;
}, config?: WarpGrepClientConfig): AsyncGenerator<WarpGrepStep, WarpGrepResult, undefined>;
declare function executeWarpGrep(input: WarpGrepInput & {
    streamSteps?: false | undefined;
}, config?: WarpGrepClientConfig): Promise<WarpGrepResult>;
declare function executeToolCall(input: {
    search_term: string;
} | string, config: WarpGrepToolConfig): Promise<WarpGrepResult>;
/**
 * Streaming version of executeToolCall that yields WarpGrepStep for each turn.
 */
declare function executeToolCallStreaming(input: {
    search_term: string;
} | string, config: WarpGrepToolConfig): AsyncGenerator<WarpGrepStep, WarpGrepResult, undefined>;
/**
 * Read a single file (or line range) from a public GitHub repository
 */
declare function executeGitHubReadFile(input: GitHubReadFileInput, config?: {
    timeout?: number;
}): Promise<GitHubReadFileResult>;
/**
 * Format a GitHub read file result for display or tool responses
 */
declare function formatGitHubReadFileResult(result: GitHubReadFileResult): string;
/**
 * Format warp grep results for display or tool responses
 *
 * @param result - The search result
 * @returns Formatted string representation
 */
declare function formatResult(result: WarpGrepResult): string;

export { WarpGrepClient, executeGitHubReadFile, executeToolCall, executeToolCallStreaming, executeWarpGrep, formatGitHubReadFileResult, formatResult };
