/** * The short-circuit wire: intercepts an agent-loop model call, builds a * streaming request carrying the server-side `web_search` tool, and maps the * SSE events onto the harness StreamChunk contract. The generator NEVER * throws — every failure becomes a finish chunk, exactly what the loop's * catch-less `for await` requires. {@link inlineWireStream} settles the plan * first and then dispatches to the protocol the VERIFIED candidate speaks, so * the wire always matches the probe verdict (never the chat route snapshot). * * Server-side `web_search_call` items are skipped: the gateway executes the * search inside the same request and the model answers from its results in * the same turn, so the harness never sees a tool call. (UI search cards * were removed — the added latency outweighed the visual value.) * @module dsh-github-copilot/wire */ import type { GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'; import type { SearchPlan, SearchPlanCandidate } from './plan.ts'; import type { ResponsesReasoningOptions } from './serialize.ts'; import type { ResolvedRequestAuth } from './copilot-request.ts'; import type { InlineConfig } from './config.ts'; /** Credential and cancellation hooks the stream resolves per operation. */ export interface InlineHooks { /** Resolve one credential reference through the credentials seam. */ resolveApiKey: (candidate: SearchPlanCandidate) => Promise; /** Validate effective model/profile reasoning and return its mapped wire value. */ resolveResponsesReasoning?: (request: GenerateOptions, candidate: SearchPlanCandidate) => ResponsesReasoningOptions | undefined; } /** * Whether the request carries an image attachment. Image blocks retain the * harness attachment object that the official vision channel must consume. */ export declare function contentHasImageAttachments(request: GenerateOptions): boolean; /** * Run one inline model call through whichever wire the settled candidate * speaks. The plan is settled HERE — once — so the protocol choice follows * the probe verdict instead of the chat route snapshot taken before the * probe ran. * @param request - the frozen agent-loop request. * @param plan - the search plan owning endpoint facts. * @param hooks - credential hooks. * @param cfg - the current plugin configuration. * @returns the StreamChunk stream for the loop's assembler. */ export declare function inlineWireStream(request: GenerateOptions, plan: SearchPlan, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator; /** * Run one inline model call: fetch the Responses endpoint with the * server-side web tool injected and translate the SSE stream into harness * chunks. 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 inlineStream(request: GenerateOptions, candidate: SearchPlanCandidate, hooks: InlineHooks, cfg: InlineConfig): AsyncGenerator; //# sourceMappingURL=wire.d.ts.map