/** * Bridges MCP `sampling/createMessage` server requests to Codeep's host LLM. * * MCP servers that opt into the `sampling` capability send the host * (Codeep) a request to generate a completion on their behalf — usually * because they want LLM reasoning without their own provider keys. Per * spec, the host is free to refuse, swap models, or strip context; we * forward the messages to the active provider via `chat()` and return * just the assistant text. * * Notes on the bridge surface: * - We strip image content (provider matrix varies; safer to skip than * surprise the model). A future iteration can route images through * the vision integration in mcpIntegration.ts. * - We respect `params.modelPreferences.hints[].name` as an *advisory* * model override — only if the user has the provider for it * configured; otherwise we stay on the active model. * - We honour `temperature`, `maxTokens`, `stopSequences` only where * the underlying chat() path supports them (today: none — chat() uses * the agent's configured temperature/maxTokens). Pass-through hooks * are wired so the spec contract is honoured if/when chat() grows * those knobs. * * Cost guard: every sampling request bills the user's active provider, so * a misbehaving server can drain credits. We enforce a per-server rate * limit (≥1 s spacing) and a per-process cap, and surface every accepted * request on stderr so the user can see what's happening. */ import type { SamplingCreateMessageParams, SamplingCreateMessageResult } from './mcpClient.js'; /** Reset the per-server counters. Called on session boundaries. */ export declare function resetSamplingBudget(): void; export declare function handleMcpSamplingRequest(params: SamplingCreateMessageParams, serverName?: string): Promise;