/** * `codebase-context` tool — one call that answers "which files does this task * touch, and what is in them?". * * The index already exposed the ingredients: `codebase-search` finds symbols * by name, `codebase-skeleton` shows a file's shape, `codebase-incoming-calls` * finds callers. Composing them was left to the model, which meant re-deriving * the same chain on every task and spending several round trips on plumbing. * This tool runs the composition server-side: lexical search seeds a * personalised PageRank walk over the reference graph, and what comes back is * the ranked file set with the declarations that matter in each. * * It deliberately returns signatures and line numbers rather than source. The * point is to make the subsequent `read` land in the right place, not to * replace it — inlining bodies here would spend the caller's context on code * they may not need. */ import type { Tool } from '@wrongstack/core/types'; import type { ContextEntry } from './context-retrieval.js'; import type { EmbeddingPort } from './embedding-pass.js'; export interface CodebaseContextInput { /** What you are trying to do or understand, in plain words. */ query: string; /** Files to return. Defaults to 12, capped at 50. */ limit?: number | undefined; /** Declarations shown per file. Defaults to 4, capped at 20. */ symbolsPerFile?: number | undefined; /** Restrict results to a project-relative path prefix. */ pathPrefix?: string | undefined; } export interface CodebaseContextOutput { query: string; entries: ContextEntry[]; /** Lexical hits that seeded the walk. */ seedCount: number; /** Semantic hits that also seeded it. Zero without an embedding model. */ semanticSeedCount: number; /** Files the walk reached before truncation to `limit`. */ totalCandidates: number; /** * `ok` — a ranked answer. `no-matches` — the index exists but the query * matched nothing. `unranked` — symbols exist but no reference graph, so * results are lexical only. A missing index or a failed lookup THROWS. */ indexStatus: 'ok' | 'no-matches' | 'unranked'; /** True when a cached answer from a previous generation was served. */ stale?: boolean | undefined; } /** Install (or clear) the query-time embedding model. */ export declare function setContextQueryEmbedder(port: EmbeddingPort | undefined): void; export declare const codebaseContextTool: Tool; //# sourceMappingURL=codebase-context-tool.d.ts.map