import type { AssistantMessage } from "@bastani/pi-ai/compat"; import type { JsonAgentSessionEvent } from "../json-event.ts"; type JsonMessageUpdateEvent = Extract; /** The delta payload a wire `message_update` frame carries, with `partial` stripped. */ export type StreamingAssistantDelta = JsonMessageUpdateEvent["assistantMessageEvent"]; /** * Take private ownership of the assistant message a consumer will assemble. * * Deltas are applied in place, and an in-process subscriber is handed the * provider's own live partial: pi-agent-core emits `{ ...partial }`, whose * `content` array is the array pi-ai keeps appending to as the stream runs. * Assembling into that array would add every delta on top of the accumulation * the provider already did, so each seeding point copies the message and its * content blocks first. */ export declare function beginStreamingAssistantMessage(message: AssistantMessage): AssistantMessage; /** * Apply one streaming delta to the assistant message being rendered. * * Public consumers receive delta-only `message_update` events: `message_start` * seeds the message, the deltas build it, and `message_end` supplies the final * authoritative message. Interactive consumers apply the deltas here so they * can render incrementally without a cumulative snapshot. * * Returns whether the message changed, so the caller can skip a redraw when it did not. * `toolcall_start`/`toolcall_delta` carry an unparsable JSON argument fragment and are * deliberately ignored: the tool card is created by `tool_execution_start`, and * `toolcall_end` installs the complete, parsed call. */ export declare function applyAssistantMessageDelta(message: AssistantMessage, event: StreamingAssistantDelta): boolean; export {}; //# sourceMappingURL=streaming-assistant-message.d.ts.map