import type { ChatOptions, ChatReply, TokenUsage, ToolDef, ToolExecutor } from './index.js'; /** One completed consult — what the executor asked, what the advisor said. */ export interface ConsultInfo { /** The executor's question, verbatim from the tool call. */ question: string; /** The excerpt the executor attached, when it attached one. */ context?: string; /** The advisor's reply text, as returned to the executor. */ answer: string; /** The advisor call's usage, when the bound `chat` reported it via `onUsage`. */ usage?: TokenUsage; } /** How to reach the advisor and how it should judge. */ export interface AdvisorConfig { /** Any adapter's `chat`, caller-bound — the advisor model behind the tool. */ chat: (opts: ChatOptions) => Promise; /** The bar the advisor holds — its system prompt for every consult. */ systemPrompt: string; /** Override for the consult tool's name. Default `consult_advisor`. */ toolName?: string; /** Override for the consult tool's description — the consult-calibration lever. */ description?: string; /** * Consult-rate metrics hook, fired after each successful consult. Fail-soft: * a throw is caught and warned, never breaking the consult. NOT fired when * the advisor call itself fails — there is no answer to report. */ onConsult?: (info: ConsultInfo) => void; } /** * Wrap a tool set + executor so the model can consult a stronger advisor. * Returns a NEW tools array with the consult tool appended (the input is never * mutated) and an executor that routes consult calls to `advisor.chat` — every * other tool call passes through to `executor` untouched. Pass the result to * any adapter's `chatWithToolLoop`. * * A tool already named like the consult tool is a programmer error: throws at * wrap time. A failing advisor is a runtime condition: the wrapped executor * returns a legible "advisor unavailable" result instead of throwing, so a * dead advisor never kills the work. */ export declare function withAdvisor(tools: ToolDef[], executor: ToolExecutor, advisor: AdvisorConfig): { tools: ToolDef[]; executor: ToolExecutor; }; //# sourceMappingURL=pair.d.ts.map