import type { ConversationState } from "#client/conversation-state.js"; import { EveAgentProjection, type EveAgentEventLog } from "#client/eve-agent-projection.js"; import type { SendTurnPayload } from "#client/types.js"; import type { EveAgentReducerEvent } from "#client/reducer.js"; import type { MessageStreamEvent } from "#protocol/message.js"; import type { InputResponse } from "#shared/input.js"; import { SessionEventStream, type SessionEventStreamOptions } from "#client/session-event-stream.js"; import type { ClientSession } from "#client/session.js"; /** Owns the canonical conversation and its root and agent-session transports for one client session. */ export declare class ConversationClient { #private; readonly projection: EveAgentProjection; constructor(projection: EveAgentProjection, onChange: (data: TData, previous: TData) => void, onConversationChange?: (state: ConversationState, previous: ConversationState) => void); get data(): TData; get conversation(): ConversationState; get projections(): readonly EveAgentEventLog[]; get following(): boolean; append(event: EveAgentReducerEvent): void; /** Projects submitted answers; the returned callback withdraws them if the server never accepts. */ projectResponses(responses: readonly InputResponse[] | undefined): (() => void) | undefined; /** Swaps projected answers for a prepared payload's, which must still be answerable. */ replaceResponses(retract: (() => void) | undefined, input: SendTurnPayload): (() => void) | undefined; /** Admit and project a root event before the agent sessions it announces are followed. */ observe(event: MessageStreamEvent, options?: { /** The store reconciles optimistic messages instead of directly appending the event. */ project?: (event: MessageStreamEvent) => void; /** Record the accepted event before projection or child notifications. */ onAccepted?: (event: MessageStreamEvent) => void; /** The store publishes after updating its event log and status. */ notify?: boolean; }): boolean; /** Admit and project a hydrated root event without notifying subscribers. */ hydrate(event: MessageStreamEvent): boolean; /** Start following the agent sessions the root stream has announced so far. */ follow(session: ClientSession, events?: readonly MessageStreamEvent[]): void; /** Follows the root session continuously; operation readers subscribe to this one stream. */ stream(session: ClientSession, options: SessionEventStreamOptions): SessionEventStream; stop(): void; reset(): void; }