import type { ToolDefinition } from "../ToolTypes.js"; import type { DocdexClient } from "../../docdex/DocdexClient.js"; /** * Rewrites a path into the repo-relative form docdex accepts. * * Docdex answers `invalid path` for a leading slash, a `./` prefix, or an * absolute path, and a model asked to list a repository reaches for exactly * those. That took out every "which files are in X" question: the tool was * chosen correctly and then rejected on a formatting detail. Normalising here * is the adapter's job — the caller meant the same directory either way. * * Returns undefined for "the whole repository", which is what docdex wants when * no path is given. */ export declare const toRepoRelativePath: (value: string | undefined, workspaceRoot?: string) => string | undefined; /** Test seam: forget any open circuit. */ export declare const resetWebResearchBackoff: () => void; export declare const normalizeWebQuery: (value: unknown) => string | undefined; /** * Judges whether search results actually answer the question. * * Needed because presence is not relevance. The local index returns *something* * for almost any query — "GDP of France 2025" scores 29.07 against this * repository, higher than "gateway planner class" at 14.35, because a test * fixture happens to contain the phrase. A score threshold would therefore be * both arbitrary and wrong, and keyword rules ("if the query mentions GDP, go * to the web") are exactly the hardcoding this project rules out. * * So the judgement is delegated to a model: cheap, generic, and it degrades to * the old presence-based behaviour when no judge is supplied. */ export type RelevanceJudge = (input: { query: string; results: unknown; }) => Promise; export interface DocdexToolOptions { judgeRelevance?: RelevanceJudge; } export declare const createDocdexTools: (client: DocdexClient, options?: DocdexToolOptions) => ToolDefinition[]; //# sourceMappingURL=DocdexTools.d.ts.map