import type { MessageSegment } from '../types/message.types'; import type { ScrollAnchor } from '../utils/scroll-anchor'; import type { UnifiedChatState } from '../types/unified-chat-state.types'; 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; export interface ChatSource { index: number; name: string; path: string; documentType: string; externalUrl?: string; /** Platform that owns the destination at `externalUrl`. */ targetPlatform?: string | null; /** Primary-key value for single-row chips. */ id?: string; /** Per-row items for grouped chips. */ items?: Array<{ id: string; documentType: string; name: string; externalUrl?: string; targetPlatform?: string | null; /** In-app doc-tree path for markdown / data-room-doc rows so the * grouped chip's anchor can trigger an in-page doc-tree swap via * `handleChatNavClick` (parity with single-row chips + cards). */ path?: string | null; }>; /** RagTableConfig.id for this source. */ sourceRepo?: string; /** Optional display label override returned by the chat API. */ label?: string; } 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