import type { ChatSource, MessageSegment } from '../types/message.types'; import type { UnifiedChatState } from '../types/unified-chat-state.types'; import type { ScrollAnchor } from '../utils/scroll-anchor'; export type { ChatTurnMeta } from '../stream/chat-stream-reducer'; /** Source identifier — opaque string ID (registry lookup happens in the * hub-side platform-utils, not in lib). */ export type DocSource = string; /** Re-export: `ChatSource` moved to `message.types` when the NATS transport * started producing it too. Kept so existing `use-sse-chat-adapter` imports * keep resolving. */ export type { ChatSource }; export interface DocChatMessage { id: string; role: 'user' | 'assistant'; /** String form for legacy callers that just want the answer text; structured * segments include thinking blocks too, which the lib's * ChatMessageEnhanced renders as cards. */ content: string; /** Structured segments. When set, callers should prefer this over `content`. */ segments?: MessageSegment[]; sources?: ChatSource[]; /** Per-message viewport-positioning hint emitted by the server. */ scrollAnchor?: ScrollAnchor; /** When true the message is part of the conversation history but is * NOT rendered in the chat UI. */ hidden?: boolean; } export type { StreamingPhase } from '../types/unified-chat-state.types'; /** * Optional dependency-injection options for `useSseChatAdapter`. * * - `tableIdForDocumentType` — looks up the RagTableConfig.id for an * LLM document type. Used by `displayRef` + `discussRef` to translate * an inline-card click into a server-side entity-id filter. * * **Defaults to `defaultTableIdForDocumentType` from * `src/utils/source-icons.ts`** — a lib-baked map covering every * documentType currently registered in the hub's RAG_TABLE_CONFIGS. * Override only for polymorphic / per-tenant document types. */ export interface UseSseChatAdapterOptions { tableIdForDocumentType?: (documentType: string) => string | null; } export interface UseSseChatAdapterRuntimeOptions { /** * When `false` the adapter skips its background slash-command registry * fetch (used to hydrate the `displayRef` table lookup) AND the * mount-time server-history hydration. Mirrors the NATS adapter's * `active` gate: `useUnifiedChat` passes `false` while Guide mode is * configured-but-not-active, so opening the panel in Mingo mode does * NOT hit the commands or history endpoints. Default `true` so * standalone callers keep the eager prefetch. */ active?: boolean; } /** * Stream-driven AI chat hook. Returns the message list, send/stop/clear * controls, and per-turn metadata (model name, token counts, routing * decision) the lib's `` consumes. * * Source identity comes from `useRequiredChatRuntime().source` — no * parameter. An empty `source` falls back to `DEFAULT_CHAT_SOURCE` (used only * for the conversation-id localStorage namespace; never sent on the wire). */ export declare function useSseChatAdapter(options?: UseSseChatAdapterOptions, runtimeOptions?: UseSseChatAdapterRuntimeOptions): UnifiedChatState; //# sourceMappingURL=use-sse-chat-adapter.d.ts.map