import type { GeistdocsConfig } from "../../config"; import type { ChatUser } from "./chat-user"; import { type ChatCommandQueue, type ChatCommandState } from "./commands"; import { type ChatSuggestion } from "./options"; /** Page to attach to the next Ask AI message. */ export interface GeistdocsChatPage { /** Title shown on the attached-page card. Falls back to `url`. */ title?: string; /** Site-relative path of the page. For an absolute URL only the path is sent. */ url: string; } /** Public Ask AI controller returned by `useGeistdocsChat`. */ export interface GeistdocsChatController { /** * Open the chat and submit `text` as a user message. Waits for the chat to * load and for any streaming response to finish. Empty text is ignored. */ ask: (text: string) => void; close: () => void; /** `false` when `ai.enabled` is `false`; every action is then a no-op. */ enabled: boolean; isOpen: boolean; open: () => void; /** * Start a new conversation about `page` (default: the current page). The * page is sent with the next message only. */ openWithPage: (page?: GeistdocsChatPage) => void; toggle: () => void; } interface GeistdocsChatContextValue { ask: GeistdocsChatController["ask"]; basePath?: string; /** Unvalidated `ai.endpoint`; resolved inside the chat error boundary. */ chatEndpoint?: string; /** Chat panel heading from `ai.title`. Not the site title. */ chatTitle: string; commandState: ChatCommandState; /** Queue drained by the active chat shell. */ commands: ChatCommandQueue; enabled: boolean; footer?: React.ReactNode; hasBeenOpened: boolean; /** Milliseconds a stored conversation is kept after its last message. */ historyRetentionMs: number; /** Desktop panel fills the viewport. Reset when the chat closes. */ isExpanded: boolean; isOpen: boolean; openWithPage: GeistdocsChatController["openWithPage"]; preloadChat: () => void; prewarmEveAgent: boolean; prompt: string; setIsExpanded: React.Dispatch>; setIsOpen: React.Dispatch>; setPrompt: React.Dispatch>; setUser: React.Dispatch>; suggestions: ChatSuggestion[]; /** Site title from `config.title`; names the chat history database. */ title: string; /** Signed-in reader set at runtime by ``. */ user: ChatUser | null; } export declare const useGeistdocsChatContext: () => GeistdocsChatContextValue; interface GeistdocsChatProviderProps { children: React.ReactNode; config: Pick; } export declare const GeistdocsChatProvider: ({ children, config, }: GeistdocsChatProviderProps) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=context.d.ts.map