import { type UseSseChatAdapterOptions } from './use-sse-chat-adapter'; import { type UseNatsChatAdapterConfig } from './use-nats-chat-adapter'; import type { UnifiedChatState } from '../types/unified-chat-state.types'; /** Discriminator for the active transport mode. */ export type ChatMode = 'guide' | 'mingo'; /** * Per-mode configuration. Each slot is optional — consumers that only * need one mode leave the other undefined. The active mode MUST have * its config populated; passing `activeMode: 'mingo'` while `modes.mingo` * is undefined is a programming error and surfaces as a thrown * `sendMessage`. */ export interface UseUnifiedChatModes { /** * Guide mode (SSE → hub). Currently `useSseChatAdapter` reads its * config from the ambient `ChatRuntimeContext` rather than props, * so this slot is just an opt-in flag plus its adapter options. * The presence of the key signals "guide mode is configured". */ guide?: UseSseChatAdapterOptions; /** * Mingo mode (NATS → openframe). All wiring is explicit: dialog id, * NATS URL builder, publish callback, optional catchup fetcher. * See `UseNatsChatAdapterConfig` for the field-by-field contract. */ mingo?: UseNatsChatAdapterConfig; } export interface UseUnifiedChatOptions { modes: UseUnifiedChatModes; activeMode: ChatMode; /** * Pre-built Mingo-mode state, supplied by the host instead of letting * the internal `useNatsChatAdapter` own it. When provided AND the active * mode is `'mingo'`, this object is used verbatim as the active state and * the internal NATS adapter stays idle (the host should also omit * `modes.mingo` so no live subscription is opened here). * * This is the seam that lets a host keep chat data/streaming in its own * store + cache (so it survives the panel unmounting) rather than in this * hook's local React state. Guide mode is unaffected. */ mingoStateOverride?: UnifiedChatState; } export declare function useUnifiedChat(options: UseUnifiedChatOptions): UnifiedChatState; //# sourceMappingURL=use-unified-chat.d.ts.map