import type { AgentClientType, AgentRuntime, CanonRuntimeActivityItem, RuntimeInfoPayload, TurnOutputBlock } from './types.js'; import { type AgentSessionSnapshotPatch, type RTDBClientHandle, type SessionStatePayload, type TurnStatePayload } from './rtdb-rest.js'; export interface RuntimeStatePublisherOptions { agentId: string; clientType: AgentClientType; hostMode: boolean; /** Scoped RTDB client from `initRTDBAuth`. */ rtdb: RTDBClientHandle; } export interface RuntimeStreamingPayload { text: string; status: 'thinking' | 'streaming' | 'tool' | 'waiting_input'; messageId?: string; turnId?: string | null; blocks?: TurnOutputBlock[]; updatedAt?: number | { '.sv': 'timestamp'; }; } export interface ClearRuntimeActivityOptions { itemIds?: ReadonlyArray; terminalOnly?: boolean; olderThanMs?: number; all?: boolean; } export interface RuntimeStatePublisher { publishAgentRuntime(runtime: AgentRuntime): Promise; clearAgentRuntime(): Promise; writeSessionState(conversationId: string, state: Omit): Promise; clearSessionState(conversationId: string): Promise; writeTurnState(conversationId: string, state: Omit): Promise; clearTurnState(conversationId: string): Promise; patchAgentSessionSnapshot(conversationId: string, snapshot: Omit): Promise; writeRuntimeInfo(conversationId: string, payload: Omit): Promise; patchRuntimeInfo(conversationId: string, payload: Partial>): Promise; clearRuntimeInfo(conversationId: string): Promise; writeRuntimeActivity(conversationId: string, item: CanonRuntimeActivityItem): Promise; clearRuntimeActivity(conversationId: string, options?: ClearRuntimeActivityOptions): Promise; writeStreaming(conversationId: string, payload: RuntimeStreamingPayload): Promise; clearStreaming(conversationId: string): Promise; } export declare function createRuntimeStatePublisher(options: RuntimeStatePublisherOptions): RuntimeStatePublisher;