/** * Emits one omp assistant message (a "step") from agy's ACP events: thinking * and text deltas, at most one tool call, then a terminal `done` or `error`. */ import type { PromptResponse } from "@oh-my-pi/pi-utils/acp"; import type { FinalizeResult } from "../../error/finalize.js"; import type { Api, AntigravityCliPayload, AssistantMessage, Model, ToolCall } from "../../types.js"; import type { AssistantMessageEventStream } from "../../utils/event-stream.js"; export declare class StepWriter { #private; readonly output: AssistantMessage; /** Start one assistant stream; subsequent methods are inert after its terminal event. */ constructor(model: Model, stream: AssistantMessageEventStream); /** True once `done` or `error` was emitted. */ get done(): boolean; /** Append a visible text delta, ending any open thinking block first. */ text(delta: string): void; /** Append a thinking delta, ending any open text block first. */ thinking(delta: string): void; /** Emit the host-validated tool call with a complete argument object. */ toolCall(call: ToolCall): void; /** * Records occupied context; a turn end also carries the turn's token totals, * which agy reports only once for all of the turn's steps. */ usage(contextTokens: number, turn?: PromptResponse["usage"]): void; /** Finish once, retaining the conversation fingerprint needed by the next request. */ finish(reason: "stop" | "length" | "toolUse", payload: AntigravityCliPayload): void; /** Fail once without allowing later ACP events to mutate the published result. */ fail(result: FinalizeResult): void; }