import type { PromptResult } from "../../hooks/useMCPPrompts"; import type { AuthConfig, LLMConfig, Message, MessageAttachment, StreamProtocol } from "./types"; interface WidgetModelContext { content?: Array<{ type: string; text: string; }>; structuredContent?: Record; } interface UseChatMessagesProps { mcpServerUrl: string; llmConfig: LLMConfig | null; authConfig: AuthConfig | null; isConnected: boolean; /** Custom API endpoint URL for chat streaming. Defaults to "/inspector/api/chat/stream". */ chatApiUrl?: string; /** When chatApiUrl is not yet available, called before sending to resolve the URL. Useful for background initialization. */ waitForChatApiUrl?: () => Promise; /** Active widget model contexts to inject into the LLM conversation */ widgetModelContexts?: Map; /** Pre-populate the chat with messages from a previous session (e.g. when restoring history). */ initialMessages?: Message[]; /** Tool names the user has disabled via the tool selector. Sent to the server so it can exclude them. */ disabledTools?: Set; /** * Wire protocol used by the streaming endpoint. * - `"sse"` (default): Inspector SSE protocol (`data: {"type":"text","content":"..."}\n\n`) * - `"data-stream"`: Vercel AI SDK data-stream protocol (`0:"text"`, `9:{...}`, etc.) */ streamProtocol?: StreamProtocol; /** Credentials policy for the fetch request (e.g. `"include"` for cross-origin cookie auth). */ credentials?: RequestCredentials; /** Extra headers to send with every streaming request. */ extraHeaders?: Record; /** * Custom body builder. Receives the serialised messages array and returns the * object that will be JSON-stringified as the request body. * When omitted, the default body includes `mcpServerUrl`, `llmConfig`, * `authConfig`, and `messages`. * Use this to send only `{ messages }` to a server-managed backend. */ body?: (messages: Array<{ role: string; content: unknown; attachments?: unknown; }>) => unknown; } export declare function useChatMessages({ mcpServerUrl, llmConfig, authConfig, isConnected, chatApiUrl, waitForChatApiUrl, widgetModelContexts, initialMessages, disabledTools, streamProtocol, credentials, extraHeaders, body: bodyBuilder, }: UseChatMessagesProps): { messages: Message[]; isLoading: boolean; attachments: MessageAttachment[]; rateLimitInfo: { loginUrl: string; } | null; mcpServerAuthRequired: { mcpServerUrl: string; message?: string; } | null; sendMessage: (userInput: string, promptResults: PromptResult[], extraAttachments?: MessageAttachment[]) => Promise; clearMessages: () => void; clearRateLimitInfo: () => void; clearMcpServerAuthRequired: () => void; setMessages: import("react").Dispatch>; stop: () => void; addAttachment: (file: File) => Promise; removeAttachment: (index: number) => void; clearAttachments: () => void; }; export {}; //# sourceMappingURL=useChatMessages.d.ts.map