import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { WorkflowClient } from "../client/client.js"; import { type WorkflowSessionView } from "../client/view.js"; import { type WorkflowMessage, type WorkflowTurnStopReason } from "../state/workflow-messages.js"; type SettledTurn = { stopReason: WorkflowTurnStopReason; responseSessionEntryId: string | null; }; type BeforeTurnEnd = (message: WorkflowMessage, end: SettledTurn) => Promise; type DeliveryCallbacks = { beforeTurnEnd?: BeforeTurnEnd; terminalDelivered?: (message: WorkflowMessage) => Promise; }; /** Adds every server-owned workflow message to one Pi session through one public API path. */ export declare class WorkflowMessageCoordinator { private readonly queued; private readonly closedTurnMessages; private readonly finalizedTerminals; private synchronizing; private lastBranchEpoch; private view; private turn; updateView(view: WorkflowSessionView): void; branchChanged(): void; startTurn(): void; endTurn(stopReason: WorkflowTurnStopReason, responseSessionEntryId: string | null): void; activeTurnMessage(): WorkflowMessage | undefined; toolCallBlockReason(toolName: string, input: unknown): string | undefined; synchronize(pi: ExtensionAPI, client: WorkflowClient, ctx: Pick, callbacks?: DeliveryCallbacks): Promise; clear(): void; abortCancelledTurn(ctx: Pick): void; private turnCandidate; private flushTurn; private reportBranch; private hasUnconfirmedBranchEntry; } export declare function branchWorkflowEntries(entries: readonly unknown[]): Map; export declare function responseEntryId(entries: readonly unknown[]): string | null; export {};