import type { Tool, ToolInvocation, Tree } from '@variance-authority/mcp/tools'; import type { Help } from '@variance-authority/package/help'; import type { SearchIndex } from './search-index.js'; import { type Unopened } from './search-read.js'; import type { ImportingOf } from './tools/published-match.js'; /** What a verb's tool is handed: what this host read, asked through its shell. */ export declare function invocationOf(read: Omit, 'shell'>): ToolInvocation; export declare function toolNamed(verb: string): Tool; /** * `--name value` pairs, refused against the tool's own schema. * * A misspelled flag is refused here rather than ignored, because a tool whose * arguments are all optional would answer a typo with a plausible wrong answer — * `uses --form packages/cli/src/run.ts` would silently rank by nothing and read * exactly like a repository where nothing is written near you. */ export declare function inputFrom(tool: Tool, args: readonly string[]): Record; /** * One answer, as the text the same tool would have sent over the wire. * * `walk` is how a verb that takes a path gets one. A tool cannot read a * repository — that is the whole reason the set is pure — so the source tree * arrives from out here, exactly as it does over MCP, and `search --from` would * otherwise be a flag this file accepts and the answer refuses. It is a * function rather than a tree because the verbs that name no path are most of * them, and folding a graph for `symbol` would charge every question for the * one feature it did not use. * * `root` is the checkout the question is about, handed to the tool as the host * was told it, so a tool that opens what the checkout published reads that * checkout and not the working directory. */ export declare function ask(help: Help, verb: string, args: readonly string[], walk?: () => Tree | undefined, root?: string, unseen?: boolean | string): string; /** The same answer as data: the generation is a field, and absent when unknown. */ export declare function askSearchJson(index: SearchIndex, args: readonly string[], walk?: () => Tree | undefined, unseen?: boolean, unopened?: readonly Unopened[], importing?: ImportingOf): string; /** `search`, answered from its published index rather than the whole value. */ export declare function askSearch(index: SearchIndex, args: readonly string[], walk?: () => Tree | undefined, unseen?: boolean, unopened?: readonly Unopened[], importing?: ImportingOf): string; /** Every verb and what it answers, for the usage text and for `--help`. */ export declare function verbs(): readonly (readonly [string, string])[]; //# sourceMappingURL=ask.d.ts.map