import type { PortableTool } from "../portable-tool.js";
export declare const SEARCH_TOOL_NAME: "search";
export type SearchMode = "filename" | "content" | "both";
export interface SearchToolParams {
    mode: SearchMode;
    pattern: string;
    path?: string;
    fileGlob?: string;
    contextLines?: number;
    caseInsensitive?: boolean;
    headLimit?: number;
    offset?: number;
}
export declare const SEARCH_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly mode: {
            readonly type: "string";
            readonly enum: readonly ["filename", "content", "both"];
            readonly description: string;
        };
        readonly pattern: {
            readonly type: "string";
            readonly description: string;
        };
        readonly path: {
            readonly type: "string";
            readonly description: "Directory to search in. Defaults to workdir/cwd if omitted.";
        };
        readonly fileGlob: {
            readonly type: "string";
            readonly description: string;
        };
        readonly contextLines: {
            readonly type: "number";
            readonly description: string;
        };
        readonly caseInsensitive: {
            readonly type: "boolean";
            readonly description: "Case insensitive search (content/both modes). Default: false.";
        };
        readonly headLimit: {
            readonly type: "number";
            readonly description: string;
        };
        readonly offset: {
            readonly type: "number";
            readonly description: "Skip first N results before applying headLimit. Default: 0.";
        };
    };
    readonly required: readonly ["mode", "pattern"];
};
export interface SearchFileResult {
    path: string;
}
export interface SearchContentResult {
    path: string;
    line: number;
    text: string;
    contextBefore?: string[];
    contextAfter?: string[];
}
export interface SearchOutput {
    mode: SearchMode;
    totalMatches: number;
    truncated: boolean;
    fileResults?: SearchFileResult[];
    contentResults?: SearchContentResult[];
}
/** Host-provided search backend. */
export interface SearchToolDeps {
    /**
     * Find files matching a glob pattern.
     * Returns array of relative file paths.
     * The host SHOULD auto-exclude VCS directories (.git, .svn, .hg, .bzr)
     * unless the user explicitly includes them.
     */
    glob(pattern: string, options: {
        cwd: string;
        limit: number;
    }): Promise<{
        files: string[];
        truncated: boolean;
    }>;
    /**
     * Search file contents using regex.
     * The implementation may use ripgrep, native grep, or a custom engine.
     * Returns match records.
     * The host SHOULD auto-exclude VCS directories (.git, .svn, .hg, .bzr)
     * and enforcemax-columns 500 to avoid minified file noise.
     */
    grep(pattern: string, options: {
        cwd: string;
        fileGlob?: string;
        caseInsensitive?: boolean;
        contextLines?: number;
        headLimit?: number;
        offset?: number;
    }): Promise<{
        matches: Array<{
            path: string;
            line: number;
            text: string;
            contextBefore?: string[];
            contextAfter?: string[];
        }>;
        truncated: boolean;
    }>;
    /** Resolve relative path to absolute. If omitted, cwd is used. */
    resolvePath?(input: string): string;
}
export declare function createSearchTool(deps: SearchToolDeps): PortableTool<SearchToolParams>;
