import { type AssistantMessage, type AssistantMessageEventStream } from "@earendil-works/pi-ai"; import type { ResponseStreamEvent } from "openai/resources/responses/responses.js"; import type { GrammarToolInputJsonBuffer } from "../../constrained-sampling.js"; import { type ResponsesToolCall } from "../native-items.ts"; import type { OpenAIResponsesStreamOptions } from "../shared.ts"; type ThinkingBlock = Extract; type TextBlock = Extract; type ToolCallBlock = ResponsesToolCall & { partialJson?: string | undefined; }; type ReasoningState = { kind: "reasoning"; blockIndex: number; block: ThinkingBlock; summaryParts: Map; contentParts: Map; }; type MessageState = { kind: "message"; blockIndex: number; block: TextBlock; parts: Map; }; type FunctionCallState = { kind: "function_call"; blockIndex: number; block: ToolCallBlock; }; export type CustomToolCallState = { kind: "custom_tool_call"; blockIndex: number; block: ToolCallBlock; input: string; property: string; jsonBuffer: GrammarToolInputJsonBuffer; }; export type OutputState = ReasoningState | MessageState | FunctionCallState | CustomToolCallState; export interface ResponsesStreamOutput { output: AssistantMessage; stream: Pick; outputStates: Map; options: OpenAIResponsesStreamOptions | undefined; } export declare function startResponsesOutputItem(event: Extract, state: ResponsesStreamOutput): void; export declare function finishResponsesOutputItem(event: Extract, state: ResponsesStreamOutput): void; export {};