import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
export type StreamState = {
    readonly stage: "idle";
} | {
    readonly stage: "connecting";
    readonly executionId: string;
} | {
    readonly stage: "streaming";
    readonly executionId: string;
} | {
    readonly stage: "complete";
    readonly executionId: string;
} | {
    readonly stage: "error";
    readonly executionId: string;
    readonly error: Error;
};
type Listener = () => void;
/**
 * Framework-agnostic store that holds the active execution snapshot
 * with structural sharing. Implements the contract required by
 * React's `useSyncExternalStore`.
 *
 * - `ingestSnapshot` applies structural sharing so unchanged nested
 *   entities keep their previous reference.
 * - Listeners are notified only when state actually changes.
 * - `getExecution` and `getStreamState` return stable references
 *   suitable as `useSyncExternalStore` snapshot selectors.
 */
export declare class ConversationStore {
    private _execution;
    private _streamState;
    private _listeners;
    /**
     * Ingest a new execution snapshot. Applies structural sharing
     * against the previous snapshot and notifies listeners only if
     * the resulting reference changed.
     */
    ingestSnapshot(snapshot: AgentExecution): void;
    /**
     * Transition the stream lifecycle state. Notifies listeners only
     * when the stage or executionId actually changes.
     */
    setStreamState(state: StreamState): void;
    /**
     * Reset to initial state. Used when the session identity changes
     * or the hook unmounts.
     */
    reset(): void;
    /**
     * Subscribe a listener that is called whenever any store state
     * changes. Returns an unsubscribe function.
     */
    subscribe: (listener: Listener) => (() => void);
    /** Stable snapshot selector for the current execution. */
    getExecution: () => AgentExecution | null;
    /** Stable snapshot selector for the stream lifecycle state. */
    getStreamState: () => StreamState;
    private _notify;
}
export {};
//# sourceMappingURL=conversation-store.d.ts.map