import type { ComponentType } from 'react'; import { FileUIPart } from 'ai'; import type { HTMLProps } from 'react'; import type { ReactNode } from 'react'; import type { ToolUIPart } from 'ai'; import type { UIMessage } from '@ai-sdk/react'; export declare interface AIChatDisclaimerSettings { /** * Controls whether the disclaimer message is shown. * Enable this when you need to display important notices or legal disclaimers. * @default false */ isEnabled?: boolean /** * The main text content of the disclaimer message. * Should clearly communicate important information about AI usage or limitations. * "AI responses are generated automatically and may require verification." */ label?: string /** * Additional information shown when hovering over the disclaimer. * Use this to provide more detailed explanations or context. */ tooltip?: string } export declare interface AIChatFormButtons { submit: { label?: string; onSubmit: SubmitCallback } close?: { action: CloseFormAction // defaults to BackToChatFormAction } } declare interface AIChatFormDoneButton { label: string icon?: InkeepCustomIcon action: CloseFormAction } export declare interface AIChatFormSettings { heading?: string description?: string buttons: AIChatFormButtons fields: FormField[] successView?: AIChatFormSuccessView } declare interface AIChatFormSuccessView { heading: string message: string doneButton: AIChatFormDoneButton } export declare interface AIChatFunctions { /** * Programmatically sends a message in the chat. * @param message - Optional message text. If omitted, sends the current input value. */ submitMessage: (message?: string) => void /** * Programmatically updates the text in the chat input field. * @param message - The new message text to set */ updateInputMessage: (message: string) => void /** * Resets the chat to its initial state. * Removes all messages and resets the chat. */ clearChat: () => void /** * Displays a form overlay in the chat interface. * @param formSettings - Configuration object defining the form's fields and behavior * @param getHelpOption - Optional getHelpOption that triggered the form (for analytics) */ openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void /** * Programmatically sets focus to the chat input field. * Useful after programmatic updates or when showing the chat interface. */ focusInput: () => void } export declare interface AIChatToolbarButtonLabels { /** * Text shown on the button that clears the chat history. * "Clear Chat" or "Start Over" */ clear?: string /** * Text shown on the button that generates a shareable chat link. * "Share Chat" or "Get Link" */ share?: string /** * Text shown on the button that opens the help options menu. * "Get Help" or "Support Options" */ getHelp?: string /** * Text shown on the button that stops the AI from generating a response. * "Stop" or "Cancel Response" */ stop?: string /** * Text shown on the button that copies the chat transcript. * "Copy Chat" or "Copy Transcript" */ copyChat?: string } export declare type AnswerConfidence = | 'very_confident' | 'somewhat_confident' | 'not_confident' | 'no_sources' | 'other' export declare type ArtifactPart = Extract export declare type ArtifactType = 'citation' | (string & {}) export declare interface AssistantAnswerDisplayedEvent { eventName: 'assistant_answer_displayed' properties: { // message: Message conversationId?: string messageId?: string } } export declare interface AssistantCodeBlockCopiedEvent { eventName: 'assistant_code_block_copied' properties: { // message: Message conversationId: string messageId?: string language: string code: string } } export declare interface AssistantMessageCopiedEvent { eventName: 'assistant_message_copied' properties: { // message: Message conversationId: string messageId?: string } } export declare interface AssistantMessageLinkOpenedEvent { eventName: 'assistant_message_inline_link_opened' properties: { // message: Message conversationId: string messageId?: string title?: string url?: string } } export declare interface AssistantMessageReceivedEvent { eventName: 'assistant_message_received' properties: { // message: Message conversationId?: string messageId?: string } } export declare interface AssistantNegativeFeedbackSubmittedEvent { eventName: 'assistant_negative_feedback_submitted' properties: FeedbackProperties } export declare interface AssistantPositiveFeedbackSubmittedEvent { eventName: 'assistant_positive_feedback_submitted' properties: FeedbackProperties } export declare interface AssistantSourceItemClickedEvent { eventName: 'assistant_source_item_clicked' properties: { // message: Message conversationId: string messageId?: string link: TransformedSource } } export declare type AvailableBuiltInIcons = | 'FaBook' | 'FaGithub' | 'FaDatabase' | 'FaStackOverflow' | 'FaChrome' | 'FaPhone' | 'FaEnvelope' | 'FaPencil' | 'FaBlog' | 'FaSort' | 'FaPenSquare' | 'FaChevronRight' | 'FaChevronUp' | 'FaFilePdf' | 'FaDiscourse' | 'FaDiscord' | 'FaSlack' | 'IoDocumentTextSharp' | 'IoDocumentSharp' | 'IoSend' | 'IoInformationCircleOutline' | 'IoLinkOutline' | 'IoThumbsUpSharp' | 'IoThumbsDownSharp' | 'IoSearch' | 'IoCopyOutline' | 'IoCopy' | 'IoReturnDownBackOutline' | 'IoChevronForwardOutline' | 'IoReturnDownForward' | 'IoCloseOutline' | 'IoCheckmarkOutline' | 'IoBookOutline' | 'IoReaderOutline' | 'IoHelpBuoyOutline' | 'IoPeopleOutline' | 'IoDocumentTextOutline' | 'IoChatbubblesOutline' | 'FaRegFilePdf' | 'IoLogoDiscord' | 'IoLogoGithub' | 'IoTerminal' | 'FaBriefcase' | 'IoPlayCircleOutline' | 'IoPencilOutline' | 'IoCheckmarkDoneOutline' | 'IoHomeOutline' | 'IoMail' | 'IoOpenOutline' | 'FaTelegram' | 'FaTable' | 'FaMagnifyingGlass' | 'LuArrowLeft' | 'LuCircleCheck' | 'LuCommand' | 'LuCopy' | 'LuCheck' | 'LuCornerDownLeft' | 'LuGlobe' | 'LuHistory' | 'LuPanelLeft' | 'LuLink' | 'LuRepeat' | 'LuThumbsDown' | 'LuThumbsUp' | 'LuUsers' | 'LuUser' | 'LuArrowUpRight' | 'LuBookOpen' | 'LuChevronDown' | 'LuLoaderCircle' | 'FiEdit' | 'LuSparkles' | 'LuCornerDownRight' | 'LuCalendar' | 'LuHeadset' | 'LuSend' | 'LuPaperclip' | 'PiFileCsv' | 'PiFileText' | 'PiFileHtml' | 'PiFileMarkdown' | 'PiFileLog' | 'PiFileJson' | 'PiFile' | 'PiFileSql' | 'PiFilePy' export declare interface BaseFormField { name: string // input name -- must be unique label: string isRequired?: boolean isHidden?: boolean description?: string } export declare interface BaseOpenSettings { /** * Controls whether the component is open. */ isOpen?: boolean /** * Handler called when the component opens or closes. */ onOpenChange?: (isOpen: boolean) => void /** * Whether the component is open by default. * @default false */ defaultOpen?: boolean /** * The shortcut key. * * The key to trigger the component when pressed with Cmd (Mac) / Ctrl (Windows). * * Set to `null` to disable the shortcut. * * @default null */ shortcutKey?: string | null /** * The trigger selector. * * The selector to trigger the component when clicked. * * @default undefined */ triggerSelector?: string } declare type ChatAction = ExpandUnion export declare type ChatActionType = ChatAction['type'] export declare interface ChatBubbleClosedEvent { eventName: 'chat_bubble_closed' properties: {} } export declare interface ChatBubbleOpenedEvent { eventName: 'chat_bubble_opened' properties: {} } export declare interface ChatClearButtonClickedEvent { eventName: 'chat_clear_button_clicked' properties: { conversationId: string } } export declare interface ChatConversationChangedEvent { eventName: 'chat_conversation_changed' properties: { conversationId: string previousConversationId: string } } export declare interface ChatErrorEvent { eventName: 'chat_error' properties: { conversationId: string messageId?: string error?: string } } export declare type ChatEvent = | AssistantMessageReceivedEvent | AssistantAnswerDisplayedEvent | UserMessageSubmittedEvent | UserEscalationIndicatedEvent | SharedChatLoadedEvent | AssistantPositiveFeedbackSubmittedEvent | AssistantNegativeFeedbackSubmittedEvent | ChatClearButtonClickedEvent | ChatConversationChangedEvent | AssistantMessageCopiedEvent | GetHelpOptionClickedEvent // | AIChatToolCallActionClickedEvent | ChatShareButtonClickedEvent | AssistantSourceItemClickedEvent | AssistantMessageLinkOpenedEvent | AssistantCodeBlockCopiedEvent | ChatErrorEvent export declare interface ChatShareButtonClickedEvent { eventName: 'chat_share_button_clicked' properties: { sharedChatUrl: string sharedConversationId: string originalConversationId: string conversationId: string } } declare interface CheckboxField extends BaseFormField { inputType: 'checkbox' defaultValue?: boolean } export declare type CloseFormAction = 'return_to_chat' | 'close_modal' export declare interface ColorModeConfig extends Omit { /** * Configuration for syncing the widget's color mode with an external element. * * This allows the widget to automatically match its color mode (light/dark) with your application's theme. * The widget will observe changes to specified attributes on a target element and update its appearance accordingly. * ```ts * colorMode: { * sync: { * // Watch the document root for theme changes * target: document.documentElement, * // Monitor the data-theme attribute * attributes: ['data-theme'], * // Determine dark mode based on attribute value * isDarkMode: (attrs) => attrs['data-theme'] === 'dark', * // Optional callback when color mode changes * onChange: (mode) => console.log('Color mode changed to:', mode) * } * } * ``` */ sync?: SyncColorMode } export declare interface ColorModeProviderProps { /** List of all available colorMode names */ colorModes?: string[] /** Forced colorMode name for the current page */ forcedColorMode?: string /** Whether to switch between dark and light colorModes based on prefers-color-scheme */ enableSystem?: boolean /** Disable all CSS transitions when switching colorModes */ disableTransitionOnChange?: boolean /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */ enableColorScheme?: boolean /** Key used to store colorMode setting in localStorage */ storageKey?: string /** Default colorMode name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default colorMode is light */ defaultColorMode?: string /** HTML attribute modified based on the active colorMode. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */ attribute?: 'class' | (string & {}) /** Mapping of colorMode name to HTML attribute value. Object where key is the colorMode name and value is the attribute value */ value?: ValueObject /** Nonce string to pass to the inline script for CSP headers */ nonce?: string shadowHostId?: string rootId?: string children?: React.ReactNode } declare interface ComboboxField extends BaseFormField { inputType: 'combobox' items: SelectItem[] /** Value is always an array; single selection = array with one value. */ defaultValue?: string[] placeholder?: string multiple?: boolean } declare interface CommonProperties { conversationId: string // biome-ignore lint/suspicious/noExplicitAny: componentType: any tags: string[] } export declare type ComponentsConfig> = { // The widget injects `messageId` (the rendered message's id) into every // custom component's props so in-component handlers can attribute events to // the message without a wrapping context provider. This does not force a // change on existing handlers: a handler typed `(props: A[K]) => void` stays // assignable here by parameter contravariance. [K in keyof A]: ( props: A[K] & { messageId: string }, target: HTMLElement, // TODO: add context context: null, // biome-ignore lint/suspicious/noConfusingVoidType: ) => void | React.ReactNode } & { IkpMessage?( props: { message: Message renderComponent: (name: string, props: Record) => React.ReactNode renderMarkdown: (text: string) => React.ReactNode }, target: HTMLElement, context: null, // biome-ignore lint/suspicious/noConfusingVoidType: ): void | React.ReactNode IkpTool?( props: { tool: ToolUIPart approve: (approved?: boolean) => Promise renderMarkdown: (text: string) => React.ReactNode }, target: HTMLElement, context: null, // biome-ignore lint/suspicious/noConfusingVoidType: ): void | React.ReactNode } export declare type CustomIconMap = { [K in keyof CustomIcons]?: InkeepCustomIcon } export declare interface CustomIcons { search: string thumbsUp: string thumbsDown: string messageCopy: string messageCopied: string messageRevise: string codeCopy: string codeCopied: string openLinkInNewTab: string openLinkInSameTab: string newLine: string breadcrumbSeparator: string switchToSearch: string switchToChat: string chatSubmit: string close: string info: string command: string chatButtonClose: string chatHistory: string chatHistoryPanel: string backToChat: string fileUpload: string filePdf: string fileText: string fileMarkdown: string fileHtml: string fileCsv: string fileLog: string fileJson: string file: string fileSql: string filePy: string } export declare interface CustomMessageAction { label?: string /** * Icon to be displayed next to the label. * * ```ts * icon: { builtIn: 'FaEnvelope' }, * icon: { custom: 'https://example.com/icon.svg' }, * ``` */ icon?: InkeepCustomIcon /** * Action to be performed when the option is clicked. * * ```ts * action: { * type: 'open_form', * formSettings: { * title: 'Open Form', * description: 'Open a form', * }, * }, * ``` * ```ts * action: { * type: 'invoke_message_callback', * callback: (args: InvokeMessageCallbackActionArgs) => { * console.log(args) * }, * } * ``` * ```ts * action: { * type: 'open_link', * url: 'https://example.com', * } * ``` */ action: MessageChatAction } export declare type DataParts = { operation: { type: OperationType ctx: Record message?: string label?: string } summary: { type: string label?: string details?: Record } component: | { type: 'text' text?: string } | { type: 'component' name: string props: Record } artifact: { artifactId: string taskId: string name: string description: string artifactType: string type: ArtifactType artifactSummary: { record_type: 'custom_question_answer' | 'site' title: string url?: string } } } export declare type DeepPartial = { [P in keyof T]?: T[P] extends Record ? DeepPartial : T[P] } export declare type EntityType = 'conversation' | 'message' | 'search' declare type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never declare type ExpandUnion = T extends any ? Expand : never declare type ExtendPropertiesWithCommon = T extends { properties: infer P } ? T & { properties: P & CommonProperties } : T export declare interface FeedbackBody { type: FeedbackType messageId: string createdAt: string details?: string | null userProperties: UserProperties properties?: Record } declare interface FeedbackProperties { conversationId?: string messageId?: string // message: Message details?: string | null } export declare type FeedbackType = 'positive' | 'negative' export declare type FieldValues = Record declare interface FileField extends BaseFormField { inputType: 'file' } export { FileUIPart } export declare type FilterQuery = | Record | { $and: FilterQuery[] } | { $or: FilterQuery[] } export declare type FormField = | CheckboxField | ComboboxField | FileField | SelectField | TextField | IncludeChatSessionField export declare type FormInputType = NonNullable export declare interface GetHelpOption { icon?: InkeepCustomIcon name: string isPinnedToToolbar?: boolean /** * Action to be performed when the option is clicked. * * ```ts * action: { * type: 'open_form', * formSettings: { * title: 'Open Form', * description: 'Open a form', * }, * } * ``` * ```ts * action: { * type: 'open_link', * url: 'https://example.com', * } * ``` * ```ts * action: { * type: 'invoke_callback', * callback: (args: InvokeCallbackArgs) => { * console.log(args) * }, * } * ``` */ action: ChatAction } export declare interface GetHelpOptionClickedEvent { eventName: 'get_help_option_clicked' properties: { getHelpOption: GetHelpOption conversationId?: string messageId?: string } } export declare enum GitHubIssueState { Closed = 'CLOSED', Open = 'OPEN', } export declare interface Heading { anchor?: string | null url?: string | null content: string isMatch?: boolean } export declare type IkpChatAction = GetHelpOption | CustomMessageAction export declare type IkpTheme = DeepPartial export declare type IkpThemeCategory = keyof StrictIkpTheme export declare type IkpThemeEntry = [keyof IkpTheme, Record][] export declare interface IncludeChatSessionField extends BaseFormField { // _type tells special fields apart from standard fields _type: 'include_chat_session' inputType?: 'checkbox' defaultValue?: boolean } export declare interface InkeepAIChatSettings { /** * Headers for requests */ headers?: Record /** * App ID for requests, can be generated in the Inkeep dashboard */ appId?: string /** * Base API URL for token exchange, captcha challenge, and the chat run api * @default https://api.agents.inkeep.com */ baseUrl?: string /** * Base API URL for analytics events (POST /run/v1/events). * Defaults to `baseUrl` when not set. */ analyticsApiBaseUrl?: string /** * @deprecated Use `appId` instead * API key for requests. */ apiKey?: string /** * @deprecated Use `baseUrl` instead * Agent URL for chatstream API. */ agentUrl?: string /** * Context to be passed to the chatstream API. */ context?: Record /* Excluded from this release type: files *//* Excluded from this release type: transformMessageFiles *//** * The placeholder text to display in the chat input field when empty. * Use this to provide guidance on what kind of questions users can ask. * "Ask me anything about our API documentation..." */ placeholder?: string /** * A welcome message shown at the start of a new chat session. * Supports markdown formatting for rich text styling. * Use this to introduce the AI assistant's capabilities and set expectations. * "👋 Hi! I'm here to help you with technical questions about our API..." */ introMessage?: string /** * The name of the product/service/topic that the chat assistant specializes in. * This helps contextualize the chat experience for users. * If not provided, defaults to the organization name from base settings. * "MongoDB Atlas" or "React Router" */ chatSubjectName?: string /** * The display name for the AI assistant in the chat interface. * Choose a name that reflects the assistant's role and your brand. * "Atlas Assistant" or "DevBot" */ aiAssistantName?: string /** * URL to the AI assistant's avatar image. * Should be a square image, recommended size 40x40px. * Supports common image formats (PNG, JPG, SVG). * * You can pass a string or an object to configure for different color modes. * { * light: 'https://example.com/avatar-light.png', * dark: 'https://example.com/avatar-dark.png', * } */ aiAssistantAvatar?: | string | { light: string dark: string } /** * URL to the user's avatar image in the chat interface. * Should be a square image, recommended size 40x40px. * Falls back to a default user icon if not provided. */ userAvatar?: string /** * Controls whether links in chat messages open in new browser tabs. * Enable this to help users maintain their chat context when following links. * @default true */ shouldOpenLinksInNewTab?: boolean /** * Custom heading text for the example questions section. * Use this to better describe your suggested queries. * "Common Questions" or "Try asking about..." */ exampleQuestionsLabel?: string /** * A list of pre-written questions users can click to quickly start a conversation. * These should reflect common use cases and help users understand the AI assistant's capabilities. * ["How do I reset my password?", "What are the API rate limits?"] or [{ value: "How do I reset my password?", label: "How do I reset my password?" }, { value: "What are the API rate limits?", label: "What are the API rate limits?" }] */ exampleQuestions?: | string[] | { value: string label: string }[] /** * Whether to visually emphasize the first example question. * Use this to draw attention to the most important or common query. */ isFirstExampleQuestionHighlighted?: boolean /** * Enables the ability to share chat conversations via URL. * Useful for allowing users to share helpful conversations with teammates. */ isShareButtonVisible?: boolean /** * The base URL path used when generating shareable chat links. * Should match your application's routing structure. * "/shared-chats/" or "/support/conversations/" */ shareChatUrlBasePath?: string /** * Controls the visibility of the copy chat button. * Allows users to copy the entire chat transcript to their clipboard. */ isCopyChatButtonVisible?: boolean /** * Unique identifier for loading a specific conversation. * Use this to restore a previous conversation state. * If the conversation is not found, a new conversation is started. */ conversationId?: string /** * @deprecated Internal use only. Bypasses conversation loading and sets the * conversation ID directly without fetching. Use `conversationId` instead to * restore a previous conversation state. */ conversationIdOverride?: string /** * When enabled, prevents users from sending new messages. * Useful for displaying archived or shared chat sessions. * @default false */ isViewOnly?: boolean /** * Whether to make conversations public by default. * @default undefined (private) */ conversationVisibility?: 'public' | 'private' /** * Controls the visibility of the chat history button, which opens the list of previous chats. * @default true */ isChatHistoryButtonVisible?: boolean /** * Configuration for the chat's disclaimer message. * Use this to display important notices about AI limitations or data usage. */ disclaimerSettings?: AIChatDisclaimerSettings /** * Callback function triggered whenever the user modifies their input message. * * @param message - The current content of the input field */ onInputMessageChange?: (message: string) => void /** * React ref for accessing the chat component's methods. * Enables programmatic control of chat functions from parent components. */ chatFunctionsRef?: React.Ref /** * Array of actions available in the "Get Help" menu. * Use this to provide alternative support options like contact forms or documentation links. */ getHelpOptions?: GetHelpOption[] /** * Array of actions available rendered after each message. */ messageActions?: CustomMessageAction[] /** * Custom labels for the chat interface's action buttons. * Use this for internationalization or to better match your application's terminology. */ toolbarButtonLabels?: AIChatToolbarButtonLabels /** * Filters to apply to the chat results. */ filters?: SearchAndChatFilters /** * Components to be rendered in the chat interface. */ // biome-ignore lint/suspicious/noExplicitAny: components?: ComponentsConfig // biome-ignore lint/suspicious/noExplicitAny: artifacts?: ComponentsConfig /** * Controls whether the chat automatically scrolls to the bottom * during streaming. When false, streaming auto-scroll is disabled * but the chat still scrolls to bottom when the user sends a new message. * @default true */ shouldAutoScroll?: boolean } export declare interface InkeepBaseSettings { /** * The display name of your organization that will be shown in various UI elements. * For example, this may appear in chat messages or headers. */ organizationDisplayName?: string /** * The primary brand color used throughout the widget UI. * This color will be used to generate a cohesive color scheme. * Should be provided as a valid CSS color value (hex, rgb, etc). */ primaryBrandColor: string /** * Settings to control the color mode (light/dark) behavior. * Can be used to sync with your application's theme or set a forced color mode. * @see ColorModeConfig type for detailed configuration options */ colorMode?: ColorModeConfig /** * Theme customization settings for the widget. * Allows customizing colors, typography, component styles, and more. */ theme?: UserTheme /** * Custom icon overrides for the default icon set. * Allows replacing any of the built-in icons with your own components. */ customIcons?: CustomIconMap /** * Properties to identify and provide context about the current user. * Used for personalization and analytics tracking. * @see UserProperties interface for available fields */ userProperties?: UserProperties /** * Authentication token for the current user. * Used for authenticated API requests if required. * @deprecated Use getAuthToken instead for automatic token refresh on 401. */ userAuthToken?: string /** * Async callback that returns a JWT for authenticated chat sessions. * When provided, the widget uses JWT-based auth instead of anonymous sessions. * The callback is re-invoked automatically on 401 responses to refresh the token. */ getAuthToken?: () => Promise /** * Additional properties to be sent with analytics events. * These properties will be merged with the event properties. */ analyticsProperties?: Record /** * Handler for analytics events from the widget. * @param event - The analytics event object * @returns Promise that resolves when the event is logged */ onEvent?: (event: InkeepCallbackEvent) => Promise /** * Handler for feedback events from the widget. * @param feedback - The feedback object * @returns The feedback object */ onFeedback?: ( feedback: InkeepFeedback & { properties?: Record }, ) => Promise /** * Whether to bypass the captcha challenge. Only enable this flag if using a server side API type api key, otherwise the api requests will fail without the challenge solution. * @default false */ shouldBypassCaptcha?: boolean /** * Privacy and cookie preferences configuration. */ privacyPreferences?: PrivacyPreferences /** * Function to transform source data before display. * * @remarks * Allows customizing how source information is presented in the widget. * @param source - The original source data * @param type - The type of source data * @param opts - The options for the transform source * @returns The transformed source data */ transformSource?: TransformSource /** * Reference to the shadow DOM host element if using custom Shadow DOM. * Required when embedding the widget within a Shadow DOM. */ shadowHost?: HTMLElement | null /** * Reference to the root element where the widget is mounted. * Used for positioning and event handling. */ rootElement?: HTMLElement | null /** * Custom tags for widget identification. * Used in analytics to segment and filter widget instances. * Array of string identifiers. */ tags?: string[] /** * Instance of the Prism syntax highlighting library. * Required for code block syntax highlighting functionality. */ // biome-ignore lint/suspicious/noExplicitAny: prism?: any /** * Query parameters to automatically append to URLs in the widget. * Useful for tracking or maintaining context in navigation. * Object mapping parameter names to values. */ urlQueryParamsToAppend?: UrlQueryParam /** * Base-level filters to apply to all search and chat operations. * These are typically organization or user-level filters. */ filters?: SearchAndChatFilters } export declare type InkeepCallbackEvent = InkeepEventWithCommon export declare interface InkeepCloudAIChatSettings extends InkeepAIChatSettings {} export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings { /** * Environment setting for the widget. * Affects API endpoints and debug behaviors. * @default 'production' */ env?: 'development' | 'production' } export declare type InkeepCloudComponentInitializer = { (props: InkeepCloudComponentProps): InkeepComponentInstance | undefined (targetSelector: string, props: InkeepCloudComponentProps): InkeepComponentInstance | undefined } export declare type InkeepCloudComponentProps = InkeepCloudSettings & { // biome-ignore lint/suspicious/noExplicitAny: [key: string]: any } export declare interface InkeepCloudConfig { baseSettings: InkeepCloudBaseSettings aiChatSettings: InkeepCloudAIChatSettings searchSettings: InkeepCloudSearchSettings } export declare type InkeepCloudJS = Partial> export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings { /** * The API key to use for authenticating with Inkeep's services. * Required for accessing Inkeep's API endpoints. */ apiKey?: string /** * Custom base URL for search API endpoints. * Useful when routing API requests through a proxy. * Should include protocol (e.g., 'https://api.your-proxy.com') */ url?: string /** * Search-specific filters to apply to search operations. * These are merged with base filters from baseSettings. */ filters?: SearchAndChatFilters /** * The maximum number of hits to return. * @default 40 */ maxResults?: number /** * Advanced search callback function that handles search with full filter support. * This callback handles the complete search implementation with SearchInput. * * @param searchInput - The search input containing query and filters * @param abortSignal - Signal to abort the search request * @returns Promise that resolves with search results */ onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise } export declare interface InkeepCloudSettings { baseSettings?: InkeepCloudBaseSettings aiChatSettings?: InkeepCloudAIChatSettings searchSettings?: InkeepCloudSearchSettings openSettings?: OpenSettingsModal } export declare type InkeepComponentInitializer = { (props: InkeepComponentProps): InkeepComponentInstance | undefined (targetSelector: string, props: InkeepComponentProps): InkeepComponentInstance | undefined } /** * Represents an instance of any Inkeep component that is returned after initialization. * These instances have methods that can be used to update the component's state. */ export declare interface InkeepComponentInstance { /** * Updates the component with new props * @param newProps - The new props to apply to the component */ update: (newProps: T) => void /** * Unmounts the component from the DOM but preserves its state */ unmount: () => void /** * Remounts a previously unmounted component */ remount: () => void /** * Access to chat-specific functionality (only available for components with chat capabilities) */ chat?: { // biome-ignore lint/suspicious/noExplicitAny: Required for flexible method signatures [key: string]: (...args: any[]) => any } /** * Access to search-specific functionality (only available for components with search capabilities) */ search?: { // biome-ignore lint/suspicious/noExplicitAny: Required for flexible method signatures [key: string]: (...args: any[]) => any } } export declare type InkeepComponentProps = InkeepSettings & { // biome-ignore lint/suspicious/noExplicitAny: [key: string]: any } export declare interface InkeepConfig { /** * The prefix to use for the widget. * @default 'ikp' */ prefix?: string /* Excluded from this release type: componentType */ /** * Configuration for the chat. */ aiChatSettings: InkeepAIChatSettings & { shouldAutoFocusInput?: boolean } /** * Configuration for the base settings. */ baseSettings: InkeepBaseSettings /** * Configuration for the search settings. */ searchSettings: InkeepSearchSettings & { shouldAutoFocusInput?: boolean } } export declare type InkeepCustomIcon = | { builtIn: AvailableBuiltInIcons } | { custom: string // url of svg or png of icon } export declare type InkeepEvent = SearchEvent | ChatEvent | WidgetEvent export declare type InkeepEventWithCommon = ExtendPropertiesWithCommon export declare interface InkeepFeedback { type: FeedbackType messageId: string details?: string | null } export declare type InkeepJS = Partial> /** * Represents the available Inkeep component types that can be rendered * via the global Inkeep object. */ export declare type InkeepJSComponent = | 'EmbeddedChat' | 'EmbeddedSearch' | 'EmbeddedSearchAndChat' | 'ModalChat' | 'ModalSearch' | 'ModalSearchAndChat' | 'ChatButton' | 'ChatButtonModal' | 'SearchBar' | 'SidebarChat' export declare interface InkeepSearchSettings { /** * The placeholder text to use. * @default * 'Search anything...' (desktop) * 'Search' (mobile) */ placeholder?: string /** * The default query to use. * @default '' */ defaultQuery?: string /** * Callback for when the search query changes. */ onQueryChange?: (query: string) => void /** * Search callback function that handles all search functionality. * This callback handles the complete search implementation. * If not provided, the widget will warn and show no results. * * @param query - The search query string * @param abortSignal - Signal to abort the search request * * @returns Promise that resolves with search results */ onSearch?: (query: string, abortSignal: AbortSignal) => Promise /** * The time in milliseconds to wait triggering the search. * @default 0 */ debounceTimeMs?: number /** * Ref to the AIChat component's callable functions */ searchFunctionsRef?: React.Ref /** * Controls whether links should open in a new tab. * @default false */ shouldOpenLinksInNewTab?: boolean /** * Tabs to display in the search results, and in the **desired order**. Each tab can be either a string or a tuple of [string, options]. * * Default tabs if none provided: All, Publications, PDFs, GitHub, Forums, Discord, Slack, StackOverflow * * Behavior: * - Omit 'All' from tabs array to hide the All tab * - Empty tabs array will show all results without tab UI * - Tabs only appear when they have results, unless isAlwaysVisible is set * ```ts * // Basic tabs * tabs: ['Publications', 'GitHub'] * * // With isAlwaysVisible option * tabs: [ * 'Publications', * ['GitHub', { isAlwaysVisible: true }] // Shows even with no results * ] * ``` */ tabs?: (string | SearchTab)[] /** * The key to use for the search query parameter. * * When a user selects a search result, the query is added to the URL as a query parameter. * This is the key of that query parameter. * */ searchQueryParamKey?: string /** * The view to use for the search. * @default 'single-pane' */ view?: 'single-pane' | 'dual-pane' } export declare interface InkeepSettings { baseSettings?: InkeepBaseSettings aiChatSettings?: InkeepAIChatSettings searchSettings?: InkeepSearchSettings openSettings?: OpenSettingsModal } export declare type InputMaybe = T | null export declare interface InvokeCallbackAction { type: 'invoke_callback' callback: (args: InvokeCallbackArgs) => void shouldCloseModal?: boolean } export declare interface InvokeCallbackArgs { conversation: { id: string messages: Message[] } } export declare interface InvokeMessageCallbackAction { type: 'invoke_message_callback' callback: (args: InvokeMessageCallbackActionArgs) => void shouldCloseModal?: boolean } export declare interface InvokeMessageCallbackActionArgs extends InvokeCallbackArgs { messageId?: string } export declare interface JSONSchema { $id?: string | undefined $comment?: string | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 */ type?: JSONSchemaTypeName | JSONSchemaTypeName[] | undefined enum?: JSONSchemaType[] | undefined const?: JSONSchemaType | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 */ multipleOf?: number | undefined maximum?: number | undefined exclusiveMaximum?: number | undefined minimum?: number | undefined exclusiveMinimum?: number | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 */ maxLength?: number | undefined minLength?: number | undefined pattern?: string | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 */ items?: JSONSchemaDefinition | JSONSchemaDefinition[] | undefined additionalItems?: JSONSchemaDefinition | undefined maxItems?: number | undefined minItems?: number | undefined uniqueItems?: boolean | undefined contains?: JSONSchemaDefinition | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 */ maxProperties?: number | undefined minProperties?: number | undefined required?: string[] | undefined properties?: | { [key: string]: JSONSchemaDefinition } | undefined patternProperties?: | { [key: string]: JSONSchemaDefinition } | undefined additionalProperties?: JSONSchemaDefinition | undefined propertyNames?: JSONSchemaDefinition | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 */ if?: JSONSchemaDefinition | undefined then?: JSONSchemaDefinition | undefined else?: JSONSchemaDefinition | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 */ allOf?: JSONSchemaDefinition[] | undefined anyOf?: JSONSchemaDefinition[] | undefined oneOf?: JSONSchemaDefinition[] | undefined not?: JSONSchemaDefinition | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 */ format?: string | undefined /** * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 */ title?: string | undefined description?: string | undefined default?: JSONSchemaType | undefined readOnly?: boolean | undefined writeOnly?: boolean | undefined examples?: JSONSchemaType | undefined } export declare interface JSONSchemaArray extends Array {} /** * JSON Schema v7 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 */ export declare type JSONSchemaDefinition = JSONSchema | boolean export declare interface JSONSchemaObject { [key: string]: JSONSchemaType } /** * Primitive type * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 */ export declare type JSONSchemaType = | string // | number | boolean | JSONSchemaObject | JSONSchemaArray | null /** * Primitive type * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 */ export declare type JSONSchemaTypeName = | ({} & string) | 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null' /** * Meta schema * * Recommended values: * - 'http://json-schema.org/schema#' * - 'http://json-schema.org/hyper-schema#' * - 'http://json-schema.org/draft-07/schema#' * - 'http://json-schema.org/draft-07/hyper-schema#' * * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 */ export declare type JSONSchemaVersion = string export declare type Message = UIMessage export declare type MessageAction = 'copy' | 'upvote' | 'downvote' declare type MessageChatAction = ExpandUnion export declare interface ModalClosedEvent { eventName: 'modal_closed' properties: {} } export declare interface ModalOpenedEvent { eventName: 'modal_opened' properties: {} } export declare type ModalViewTypes = 'chat' | 'search' export declare interface OpenFormAction { type: 'open_form' formSettings: AIChatFormSettings } export declare interface OpenSettingsChatButton extends BaseOpenSettings {} export declare interface OpenSettingsModal extends BaseOpenSettings { /** * The trigger selector. * * The selector to trigger the modal when clicked. * * @default '[data-inkeep-modal-trigger]' */ triggerSelector?: string } export declare interface OpenSettingsSearchBar extends BaseOpenSettings { /** * The shortcut key. * * The key to trigger the searchbar when pressed with Cmd (Mac) / Ctrl (Windows). * * Set to `null` to disable the shortcut. * * @default 'k' */ shortcutKey?: string | null } export declare interface OpenSettingsSidebar extends BaseOpenSettings { /** * The trigger selector for the sidebar chat. * @default '[data-inkeep-sidebar-chat-trigger]' */ triggerSelector?: string /** * Threshold factor for auto-closing when resizing. * When dragging below (minWidth * autoCloseThreshold), the sidebar will auto-close. * @default 0.7 (70% of minimum width) */ autoCloseThreshold?: number } export declare interface OpenUrlAction { type: 'open_link' url: string } export declare type OperationType = | 'error' | 'agent_initializing' | 'completion' | 'agent_generate' | 'agent_reasoning' | 'tool_call' | 'tool_result' | 'transfer' | 'delegation_sent' | 'delegation_returned' | 'artifact_saved' export declare interface PrivacyPreferences { /** * Whether to opt out of analytical cookies. * @default false */ optOutAnalyticalCookies?: boolean /** * Whether to opt out of all analytics. * @default false */ optOutAllAnalytics?: boolean /** * Whether to opt out of functional cookies. * @default false */ optOutFunctionalCookies?: boolean } declare type QueryCondition = { $eq: QueryValue } | { $in: (number | string)[] } declare type QueryValue = boolean | number | string declare type RecordTypes = | 'DocumentationRecord' | 'GitHubIssueRecord' | 'StackOverflowRecord' | 'DiscordRecord' | 'SlackEntry' | 'DiscourseRecord' export declare type RenderFn = ({ children, ssr, root, }: { children: ReactNode ssr: boolean root: ShadowRoot | null }) => ReactNode export declare type Root = Record & ShadowRootProps>> export declare interface SearchAndChatFilters { attributes?: { // biome-ignore lint/suspicious/noExplicitAny: [key: string]: any } } export declare type SearchEvent = | SearchQueryResponseReceivedEvent | SearchQuerySubmittedEvent | SearchResultClickedEvent export declare type SearchFiltersInput = { limit: number } export declare interface SearchFunctions { /** * Update the query. */ updateQuery: (query: string) => void /** * Focus the input. */ focusInput: () => void } export declare interface SearchHit { hitOnRoot: boolean id: string rootRecord: SearchRootRecord title?: string url?: string preview?: string pathHeadings?: { anchor?: string | null content: string }[] content?: { content: string anchor?: string | null } } export declare type SearchInput = { filters?: InputMaybe searchQuery: string } export declare interface SearchQueryResponseReceivedEvent { eventName: 'search_query_response_received' properties: { searchQuery: string totalResults: number } } export declare interface SearchQuerySubmittedEvent { eventName: 'search_query_submitted' properties: { searchQuery: string } } export declare interface SearchResultClickedEvent { eventName: 'search_result_clicked' properties: { searchQuery: string title?: string url?: string } } export declare interface SearchRootRecord { __typename: RecordTypes id: string title?: string url?: string preview?: string pathBreadcrumbs?: string[] contentType?: string topLevelHeadings?: TopLevelHeading[] body?: string state?: `${GitHubIssueState}` // StackOverflow markedAsCorrectAnswer?: { url: string score: number content: string } } export declare interface SearchTab { [0]: string [1]: { isAlwaysVisible?: boolean } } declare interface SelectField extends BaseFormField { inputType: 'select' items: SelectItem[] defaultValue?: string placeholder?: string } export declare interface SelectItem { label: string value: string } export declare interface ShadowRootProps { mode?: 'closed' | 'open' delegatesFocus?: boolean styleSheets?: CSSStyleSheet[] ssr?: boolean children?: ReactNode } export declare interface SharedChatLoadedEvent { eventName: 'shared_chat_loaded' properties: { conversationId?: string } } export declare interface SourceItem { id?: string title: string | undefined url: string description: string | undefined breadcrumbs: string[] type: string contentType?: string tag?: string tabs?: (SourceTab | string)[] headings?: Heading[] preview?: string } export declare interface SourceTab { [0]: string [1]: { breadcrumbs: string[] } } export declare interface StrictIkpTheme { // biome-ignore lint/suspicious/noExplicitAny: colors: Record fontFamily: Record fontSize: Record zIndex: Record } export declare interface Style { /** * A unique identifier for the style. * This is used to prevent duplicate styles and allow for style updates. * key: 'custom-button-styles' */ key?: string /** * The type of style to apply. * - 'link': Adds a tag to load external resources like fonts or stylesheets * - 'style': Injects CSS directly into a