/** * Anthropic Messages wire for the inline web search plugin: intercepts an * agent-loop model call, builds a Messages streaming request carrying the * server-side `web_search_20250305` tool, and maps the Anthropic event * stream onto the harness StreamChunk contract. Server-side search blocks * (`server_tool_use` / `web_search_tool_result`) are skipped — the gateway * executes the search inside the same request and the model answers from * its results in the same turn. The generator NEVER throws; every failure * becomes a finish chunk. * @module dsh-github-copilot/wire-anthropic */ import type { GenerateOptions, StreamChunk, TokenUsage } from '@deepseek-ai/dsh-llm'; import type { SearchPlanCandidate } from './plan.ts'; import type { InlineConfig } from './config.ts'; import type { InlineHooks } from './wire.ts'; /** Map an Anthropic usage object onto the harness TokenUsage shape. */ export declare function mapAnthropicUsage(usage: { readonly input_tokens?: number; readonly output_tokens?: number; readonly cache_read_input_tokens?: number; readonly cache_creation_input_tokens?: number; readonly output_tokens_details?: { readonly thinking_tokens?: number; }; }): TokenUsage; /** * Run one inline model call through the Anthropic Messages API with the * server-side web search tool injected. Never throws; always ends with a * finish chunk. * @param request - the frozen agent-loop request. * @param candidate - the settled endpoint facts (probe-verified). * @param hooks - credential hooks. * @param cfg - the current plugin configuration. * @returns the StreamChunk stream for the loop's assembler. */ export declare function inlineAnthropicStream(request: GenerateOptions, candidate: SearchPlanCandidate, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator; //# sourceMappingURL=wire-anthropic.d.ts.map