import type { ChatCompletionResponse } from '../types/provider/chat.js';
import type { StreamChunk } from '../types/provider/stream.js';
/**
 * Drains a {@link StreamChunk} async iterable into the equivalent
 * non-streaming {@link ChatCompletionResponse}.
 *
 * Phase 2 of ses_001-tool-stream-events removes `LLMProvider.chat()`; the
 * four internal callers that genuinely need the aggregated view (advisory
 * executor, RouterAgent's deterministic routing decision, compaction's
 * verifier, the instrumentation wrapper) replace `provider.chat(p)` with
 * `collect(provider.chatStream(p))`.
 *
 * Behaviour matches the pre-removal `chat()` contract:
 * - text content is concatenated in delta order;
 * - tool calls are bucketed by `index` into the existing
 *   `Array<{ id, function: { name, arguments } }>` shape;
 * - usage and finishReason fall back to safe defaults when the provider
 *   omits them (defensive — see anthropics/anthropic-sdk-typescript#842
 *   where `message_stop` is occasionally dropped on connection close).
 *
 * The orchestrator does NOT call this helper — it consumes the stream
 * directly so it can emit per-delta `RunEvent`s.
 */
export declare function collect(stream: AsyncIterable<StreamChunk>): Promise<ChatCompletionResponse>;
//# sourceMappingURL=collect.d.ts.map