@inkeep/agents-ui-js-cloud 0.15.14 → 0.15.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2280 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { HTMLProps } from 'react';
3
+ import type { ReactNode } from 'react';
4
+ import type { ToolUIPart } from 'ai';
5
+ import type { UIMessage } from '@ai-sdk/react';
6
+
7
+ export declare interface AIChatDisclaimerSettings {
8
+ /**
9
+ * Controls whether the disclaimer message is shown.
10
+ * Enable this when you need to display important notices or legal disclaimers.
11
+ * @default false
12
+ */
13
+ isEnabled?: boolean
14
+
15
+ /**
16
+ * The main text content of the disclaimer message.
17
+ * Should clearly communicate important information about AI usage or limitations.
18
+ * "AI responses are generated automatically and may require verification."
19
+ */
20
+ label?: string
21
+
22
+ /**
23
+ * Additional information shown when hovering over the disclaimer.
24
+ * Use this to provide more detailed explanations or context.
25
+ */
26
+ tooltip?: string
27
+ }
28
+
29
+ export declare interface AIChatFormButtons {
30
+ submit: { label?: string; onSubmit: SubmitCallback }
31
+ close?: {
32
+ action: CloseFormAction // defaults to BackToChatFormAction
33
+ }
34
+ }
35
+
36
+ declare interface AIChatFormDoneButton {
37
+ label: string
38
+ icon?: InkeepCustomIcon
39
+ action: CloseFormAction
40
+ }
41
+
42
+ export declare interface AIChatFormSettings {
43
+ heading?: string
44
+ description?: string
45
+ buttons: AIChatFormButtons
46
+ fields: FormField[]
47
+ successView?: AIChatFormSuccessView
48
+ }
49
+
50
+ declare interface AIChatFormSuccessView {
51
+ heading: string
52
+ message: string
53
+ doneButton: AIChatFormDoneButton
54
+ }
55
+
56
+ export declare interface AIChatFunctions {
57
+ /**
58
+ * Programmatically sends a message in the chat.
59
+
60
+ * @param message - Optional message text. If omitted, sends the current input value.
61
+ */
62
+ submitMessage: (message?: string) => void
63
+
64
+ /**
65
+ * Programmatically updates the text in the chat input field.
66
+
67
+ * @param message - The new message text to set
68
+ */
69
+ updateInputMessage: (message: string) => void
70
+
71
+ /**
72
+ * Resets the chat to its initial state.
73
+ * Removes all messages and resets any active workflows.
74
+ */
75
+ clearChat: () => void
76
+
77
+ /**
78
+ * Displays a form overlay in the chat interface.
79
+
80
+ * @param formSettings - Configuration object defining the form's fields and behavior
81
+ * @param getHelpOption - Optional getHelpOption that triggered the form (for analytics)
82
+ */
83
+ openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void
84
+
85
+ /**
86
+ * Programmatically sets focus to the chat input field.
87
+ * Useful after programmatic updates or when showing the chat interface.
88
+ */
89
+ focusInput: () => void
90
+ }
91
+
92
+ export declare interface AIChatToolbarButtonLabels {
93
+ /**
94
+ * Text shown on the button that clears the chat history.
95
+ * "Clear Chat" or "Start Over"
96
+ */
97
+ clear?: string
98
+
99
+ /**
100
+ * Text shown on the button that generates a shareable chat link.
101
+ * "Share Chat" or "Get Link"
102
+ */
103
+ share?: string
104
+
105
+ /**
106
+ * Text shown on the button that opens the help options menu.
107
+ * "Get Help" or "Support Options"
108
+ */
109
+ getHelp?: string
110
+
111
+ /**
112
+ * Text shown on the button that stops the AI from generating a response.
113
+ * "Stop" or "Cancel Response"
114
+ */
115
+ stop?: string
116
+
117
+ /**
118
+ * Text shown on the button that copies the chat transcript.
119
+ * "Copy Chat" or "Copy Transcript"
120
+ */
121
+ copyChat?: string
122
+ }
123
+
124
+ export declare type AnswerConfidence =
125
+ | 'very_confident'
126
+ | 'somewhat_confident'
127
+ | 'not_confident'
128
+ | 'no_sources'
129
+ | 'other'
130
+
131
+ export declare type ArtifactPart = Extract<Message['parts'][number], { type: 'data-artifact' }>
132
+
133
+ export declare type ArtifactType = 'citation' | (string & {})
134
+
135
+ export declare interface AssistantAnswerDisplayedEvent {
136
+ eventName: 'assistant_answer_displayed'
137
+ properties: {
138
+ // message: Message
139
+ conversationId?: string
140
+ }
141
+ }
142
+
143
+ export declare interface AssistantCodeBlockCopiedEvent {
144
+ eventName: 'assistant_code_block_copied'
145
+ properties: {
146
+ // message: Message
147
+ conversationId: string
148
+ language: string
149
+ code: string
150
+ }
151
+ }
152
+
153
+ export declare interface AssistantMessageCopiedEvent {
154
+ eventName: 'assistant_message_copied'
155
+ properties: {
156
+ // message: Message
157
+ conversationId: string
158
+ }
159
+ }
160
+
161
+ export declare interface AssistantMessageLinkOpenedEvent {
162
+ eventName: 'assistant_message_inline_link_opened'
163
+ properties: {
164
+ // message: Message
165
+ title?: string
166
+ url?: string
167
+ }
168
+ }
169
+
170
+ export declare interface AssistantMessageReceivedEvent {
171
+ eventName: 'assistant_message_received'
172
+ properties: {
173
+ // message: Message
174
+ conversationId?: string
175
+ }
176
+ }
177
+
178
+ export declare interface AssistantNegativeFeedbackSubmittedEvent {
179
+ eventName: 'assistant_negative_feedback_submitted'
180
+ properties: FeedbackProperties
181
+ }
182
+
183
+ export declare interface AssistantPositiveFeedbackSubmittedEvent {
184
+ eventName: 'assistant_positive_feedback_submitted'
185
+ properties: FeedbackProperties
186
+ }
187
+
188
+ export declare interface AssistantSourceItemClickedEvent {
189
+ eventName: 'assistant_source_item_clicked'
190
+ properties: {
191
+ // message: Message
192
+ conversationId: string
193
+ link: TransformedSource
194
+ }
195
+ }
196
+
197
+ export declare type AvailableBuiltInIcons =
198
+ | 'FaBook'
199
+ | 'FaGithub'
200
+ | 'FaDatabase'
201
+ | 'FaStackOverflow'
202
+ | 'FaChrome'
203
+ | 'FaPhone'
204
+ | 'FaEnvelope'
205
+ | 'FaPencil'
206
+ | 'FaBlog'
207
+ | 'FaSort'
208
+ | 'FaPenSquare'
209
+ | 'FaChevronRight'
210
+ | 'FaChevronUp'
211
+ | 'FaFilePdf'
212
+ | 'FaDiscourse'
213
+ | 'FaDiscord'
214
+ | 'FaSlack'
215
+ | 'IoDocumentTextSharp'
216
+ | 'IoDocumentSharp'
217
+ | 'IoSend'
218
+ | 'IoInformationCircleOutline'
219
+ | 'IoLinkOutline'
220
+ | 'IoThumbsUpSharp'
221
+ | 'IoThumbsDownSharp'
222
+ | 'IoSearch'
223
+ | 'IoCopyOutline'
224
+ | 'IoCopy'
225
+ | 'IoReturnDownBackOutline'
226
+ | 'IoChevronForwardOutline'
227
+ | 'IoReturnDownForward'
228
+ | 'IoCloseOutline'
229
+ | 'IoCheckmarkOutline'
230
+ | 'IoBookOutline'
231
+ | 'IoReaderOutline'
232
+ | 'IoHelpBuoyOutline'
233
+ | 'IoPeopleOutline'
234
+ | 'IoDocumentTextOutline'
235
+ | 'IoChatbubblesOutline'
236
+ | 'FaRegFilePdf'
237
+ | 'IoLogoDiscord'
238
+ | 'IoLogoGithub'
239
+ | 'IoTerminal'
240
+ | 'FaBriefcase'
241
+ | 'IoPlayCircleOutline'
242
+ | 'IoPencilOutline'
243
+ | 'IoCheckmarkDoneOutline'
244
+ | 'IoHomeOutline'
245
+ | 'IoMail'
246
+ | 'IoOpenOutline'
247
+ | 'FaTelegram'
248
+ | 'FaTable'
249
+ | 'FaMagnifyingGlass'
250
+ | 'LuArrowLeft'
251
+ | 'LuCircleCheck'
252
+ | 'LuCommand'
253
+ | 'LuCopy'
254
+ | 'LuCheck'
255
+ | 'LuCornerDownLeft'
256
+ | 'LuGlobe'
257
+ | 'LuHistory'
258
+ | 'LuPanelLeft'
259
+ | 'LuLink'
260
+ | 'LuRepeat'
261
+ | 'LuThumbsDown'
262
+ | 'LuThumbsUp'
263
+ | 'LuUsers'
264
+ | 'LuUser'
265
+ | 'LuArrowUpRight'
266
+ | 'LuBookOpen'
267
+ | 'LuChevronDown'
268
+ | 'LuLoaderCircle'
269
+ | 'FiEdit'
270
+ | 'LuSparkles'
271
+ | 'LuCornerDownRight'
272
+ | 'LuCalendar'
273
+ | 'LuHeadset'
274
+ | 'LuSend'
275
+
276
+ export declare interface BaseFormField {
277
+ name: string // input name -- must be unique
278
+ label: string
279
+ isRequired?: boolean
280
+ isHidden?: boolean
281
+ description?: string
282
+ }
283
+
284
+ export declare interface BaseOpenSettings {
285
+ /**
286
+ * Controls whether the component is open.
287
+ */
288
+ isOpen?: boolean
289
+ /**
290
+ * Handler called when the component opens or closes.
291
+ */
292
+ onOpenChange?: (isOpen: boolean) => void
293
+ /**
294
+ * Whether the component is open by default.
295
+ * @default false
296
+ */
297
+ defaultOpen?: boolean
298
+ /**
299
+ * The shortcut key.
300
+ *
301
+ * The key to trigger the component when pressed with Cmd (Mac) / Ctrl (Windows).
302
+ *
303
+ * Set to `null` to disable the shortcut.
304
+ *
305
+ * @default null
306
+ */
307
+ shortcutKey?: string | null
308
+ /**
309
+ * The trigger selector.
310
+ *
311
+ * The selector to trigger the component when clicked.
312
+ *
313
+ * @default undefined
314
+ */
315
+ triggerSelector?: string
316
+ }
317
+
318
+ declare type ChatAction = ExpandUnion<InvokeCallbackAction | OpenFormAction | OpenUrlAction>
319
+
320
+ export declare type ChatActionType = ChatAction['type']
321
+
322
+ export declare interface ChatBubbleClosedEvent {
323
+ eventName: 'chat_bubble_closed'
324
+ properties: {}
325
+ }
326
+
327
+ export declare interface ChatBubbleOpenedEvent {
328
+ eventName: 'chat_bubble_opened'
329
+ properties: {}
330
+ }
331
+
332
+ export declare interface ChatClearButtonClickedEvent {
333
+ eventName: 'chat_clear_button_clicked'
334
+ properties: {
335
+ conversationId: string
336
+ }
337
+ }
338
+
339
+ export declare interface ChatErrorEvent {
340
+ eventName: 'chat_error'
341
+ properties: {
342
+ conversationId: string
343
+ error?: string
344
+ }
345
+ }
346
+
347
+ export declare type ChatEvent =
348
+ | AssistantMessageReceivedEvent
349
+ | AssistantAnswerDisplayedEvent
350
+ | UserMessageSubmittedEvent
351
+ | UserEscalationIndicatedEvent
352
+ | SharedChatLoadedEvent
353
+ | AssistantPositiveFeedbackSubmittedEvent
354
+ | AssistantNegativeFeedbackSubmittedEvent
355
+ | ChatClearButtonClickedEvent
356
+ | AssistantMessageCopiedEvent
357
+ | GetHelpOptionClickedEvent
358
+ // | AIChatToolCallActionClickedEvent
359
+ | ChatShareButtonClickedEvent
360
+ | AssistantSourceItemClickedEvent
361
+ | AssistantMessageLinkOpenedEvent
362
+ | AssistantCodeBlockCopiedEvent
363
+ | ChatErrorEvent
364
+
365
+ export declare interface ChatShareButtonClickedEvent {
366
+ eventName: 'chat_share_button_clicked'
367
+ properties: {
368
+ sharedChatUrl: string
369
+ sharedConversationId: string
370
+ originalConversationId: string
371
+ conversationId: string
372
+ }
373
+ }
374
+
375
+ declare interface CheckboxField extends BaseFormField {
376
+ inputType: 'checkbox'
377
+ defaultValue?: boolean
378
+ }
379
+
380
+ export declare type CloseFormAction = 'return_to_chat' | 'close_modal'
381
+
382
+ export declare interface ColorModeConfig
383
+ extends Omit<ColorModeProviderProps, 'children' | 'rootId' | 'shadowHostId'> {
384
+ /**
385
+ * Configuration for syncing the widget's color mode with an external element.
386
+ *
387
+ * This allows the widget to automatically match its color mode (light/dark) with your application's theme.
388
+ * The widget will observe changes to specified attributes on a target element and update its appearance accordingly.
389
+ * ```ts
390
+ * colorMode: {
391
+ * sync: {
392
+ * // Watch the document root for theme changes
393
+ * target: document.documentElement,
394
+ * // Monitor the data-theme attribute
395
+ * attributes: ['data-theme'],
396
+ * // Determine dark mode based on attribute value
397
+ * isDarkMode: (attrs) => attrs['data-theme'] === 'dark',
398
+ * // Optional callback when color mode changes
399
+ * onChange: (mode) => console.log('Color mode changed to:', mode)
400
+ * }
401
+ * }
402
+ * ```
403
+ */
404
+ sync?: SyncColorMode
405
+ }
406
+
407
+ export declare interface ColorModeProviderProps {
408
+ /** List of all available colorMode names */
409
+ colorModes?: string[]
410
+ /** Forced colorMode name for the current page */
411
+ forcedColorMode?: string
412
+ /** Whether to switch between dark and light colorModes based on prefers-color-scheme */
413
+ enableSystem?: boolean
414
+ /** Disable all CSS transitions when switching colorModes */
415
+ disableTransitionOnChange?: boolean
416
+ /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
417
+ enableColorScheme?: boolean
418
+ /** Key used to store colorMode setting in localStorage */
419
+ storageKey?: string
420
+ /** Default colorMode name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default colorMode is light */
421
+ defaultColorMode?: string
422
+ /** HTML attribute modified based on the active colorMode. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */
423
+ attribute?: 'class' | (string & {})
424
+ /** Mapping of colorMode name to HTML attribute value. Object where key is the colorMode name and value is the attribute value */
425
+ value?: ValueObject
426
+ /** Nonce string to pass to the inline script for CSP headers */
427
+ nonce?: string
428
+
429
+ shadowHostId?: string
430
+ rootId?: string
431
+ children?: React.ReactNode
432
+ }
433
+
434
+ declare interface ComboboxField extends BaseFormField {
435
+ inputType: 'combobox'
436
+ items: SelectItem[]
437
+ /** Value is always an array; single selection = array with one value. */
438
+ defaultValue?: string[]
439
+ placeholder?: string
440
+ multiple?: boolean
441
+ }
442
+
443
+ declare interface CommonProperties {
444
+ conversationId: string
445
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
446
+ componentType: any
447
+ tags: string[]
448
+ }
449
+
450
+ export declare type ComponentsConfig<A extends Record<string, unknown>> = {
451
+ [K in keyof A]: (
452
+ props: A[K],
453
+ target: HTMLElement,
454
+ // TODO: add context
455
+ context: null,
456
+ // biome-ignore lint/suspicious/noConfusingVoidType: <explanation>
457
+ ) => void | React.ReactNode
458
+ } & {
459
+ IkpMessage?(
460
+ props: {
461
+ message: Message
462
+ renderComponent: (name: string, props: Record<string, unknown>) => React.ReactNode
463
+ renderMarkdown: (text: string) => React.ReactNode
464
+ },
465
+ target: HTMLElement,
466
+ context: null,
467
+ // biome-ignore lint/suspicious/noConfusingVoidType: <explanation>
468
+ ): void | React.ReactNode
469
+ IkpTool?(
470
+ props: {
471
+ tool: ToolUIPart
472
+ approve: (approved?: boolean) => Promise<void>
473
+ renderMarkdown: (text: string) => React.ReactNode
474
+ },
475
+ target: HTMLElement,
476
+ context: null,
477
+ // biome-ignore lint/suspicious/noConfusingVoidType: <explanation>
478
+ ): void | React.ReactNode
479
+ }
480
+
481
+ export declare type CustomIconMap = {
482
+ [K in keyof CustomIcons]?: InkeepCustomIcon
483
+ }
484
+
485
+ export declare interface CustomIcons {
486
+ search: string
487
+ thumbsUp: string
488
+ thumbsDown: string
489
+ messageCopy: string
490
+ messageCopied: string
491
+ messageRevise: string
492
+ codeCopy: string
493
+ codeCopied: string
494
+ openLinkInNewTab: string
495
+ openLinkInSameTab: string
496
+ newLine: string
497
+ breadcrumbSeparator: string
498
+ switchToSearch: string
499
+ switchToChat: string
500
+ chatSubmit: string
501
+ close: string
502
+ info: string
503
+ command: string
504
+ chatButtonClose: string
505
+ chatHistory: string
506
+ chatHistoryPanel: string
507
+ backToChat: string
508
+ }
509
+
510
+ export declare interface CustomMessageAction {
511
+ label?: string
512
+ /**
513
+ * Icon to be displayed next to the label.
514
+ *
515
+ * ```ts
516
+ * icon: { builtIn: 'FaEnvelope' },
517
+ * icon: { custom: 'https://example.com/icon.svg' },
518
+ * ```
519
+ */
520
+ icon?: InkeepCustomIcon
521
+ /**
522
+ * Action to be performed when the option is clicked.
523
+ *
524
+ * ```ts
525
+ * action: {
526
+ * type: 'open_form',
527
+ * formSettings: {
528
+ * title: 'Open Form',
529
+ * description: 'Open a form',
530
+ * },
531
+ * },
532
+ * ```
533
+ * ```ts
534
+ * action: {
535
+ * type: 'invoke_message_callback',
536
+ * callback: (args: InvokeMessageCallbackActionArgs) => {
537
+ * console.log(args)
538
+ * },
539
+ * }
540
+ * ```
541
+ * ```ts
542
+ * action: {
543
+ * type: 'open_link',
544
+ * url: 'https://example.com',
545
+ * }
546
+ * ```
547
+ */
548
+ action: MessageChatAction
549
+ }
550
+
551
+ export declare type DataParts = {
552
+ operation: {
553
+ type: OperationType
554
+ ctx: Record<string, unknown>
555
+ message?: string
556
+ label?: string
557
+ }
558
+ summary: {
559
+ type: string
560
+ label?: string
561
+ details?: Record<string, unknown>
562
+ }
563
+ component:
564
+ | {
565
+ type: 'text'
566
+ text?: string
567
+ }
568
+ | {
569
+ type: 'component'
570
+ name: string
571
+ props: Record<string, unknown>
572
+ }
573
+
574
+ artifact: {
575
+ artifactId: string
576
+ taskId: string
577
+ name: string
578
+ description: string
579
+ artifactType: string
580
+ type: ArtifactType
581
+ artifactSummary: {
582
+ record_type: 'custom_question_answer' | 'site'
583
+ title: string
584
+ url?: string
585
+ }
586
+ }
587
+ }
588
+
589
+ export declare type DeepPartial<T> = {
590
+ [P in keyof T]?: T[P] extends Record<string, unknown> ? DeepPartial<T[P]> : T[P]
591
+ }
592
+
593
+ export declare type EntityType = 'conversation' | 'message' | 'search'
594
+
595
+ declare type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never
596
+
597
+ declare type ExpandUnion<T> = T extends any ? Expand<T> : never
598
+
599
+ declare type ExtendPropertiesWithCommon<T> = T extends { properties: infer P }
600
+ ? T & { properties: P & CommonProperties }
601
+ : T
602
+
603
+ export declare type FeebackReason = { label: string; details: string }
604
+
605
+ export declare interface FeedbackBody {
606
+ type: FeedbackType
607
+ messageId: string
608
+ createdAt: string
609
+ reasons?:
610
+ | {
611
+ label: string
612
+ details: string
613
+ }[]
614
+ | null
615
+ userProperties: UserProperties
616
+ properties?: Record<string, unknown>
617
+ }
618
+
619
+ export declare type FeedbackItemType = keyof MessageFeedback
620
+
621
+ declare interface FeedbackProperties {
622
+ conversationId?: string
623
+ // message: Message
624
+ reasons: FeebackReason[]
625
+ }
626
+
627
+ export declare type FeedbackType = 'positive' | 'negative'
628
+
629
+ export declare type FieldValues = Record<string, any>
630
+
631
+ declare interface FileField extends BaseFormField {
632
+ inputType: 'file'
633
+ }
634
+
635
+ export declare type FilterQuery =
636
+ | Record<string, QueryCondition | QueryValue | QueryValue[]>
637
+ | { $and: FilterQuery[] }
638
+ | { $or: FilterQuery[] }
639
+
640
+ export declare type FormField =
641
+ | CheckboxField
642
+ | ComboboxField
643
+ | FileField
644
+ | SelectField
645
+ | TextField
646
+ | IncludeChatSessionField
647
+
648
+ export declare type FormInputType = NonNullable<FormField['inputType']>
649
+
650
+ export declare interface GetHelpOption {
651
+ icon?: InkeepCustomIcon
652
+ name: string
653
+ isPinnedToToolbar?: boolean
654
+ /**
655
+ * Action to be performed when the option is clicked.
656
+ *
657
+ * ```ts
658
+ * action: {
659
+ * type: 'open_form',
660
+ * formSettings: {
661
+ * title: 'Open Form',
662
+ * description: 'Open a form',
663
+ * },
664
+ * }
665
+ * ```
666
+ * ```ts
667
+ * action: {
668
+ * type: 'open_link',
669
+ * url: 'https://example.com',
670
+ * }
671
+ * ```
672
+ * ```ts
673
+ * action: {
674
+ * type: 'invoke_callback',
675
+ * callback: (args: InvokeCallbackArgs) => {
676
+ * console.log(args)
677
+ * },
678
+ * }
679
+ * ```
680
+ */
681
+ action: ChatAction
682
+ }
683
+
684
+ export declare interface GetHelpOptionClickedEvent {
685
+ eventName: 'get_help_option_clicked'
686
+ properties: {
687
+ getHelpOption: GetHelpOption
688
+ conversationId?: string
689
+ }
690
+ }
691
+
692
+ export declare enum GitHubIssueState {
693
+ Closed = 'CLOSED',
694
+ Open = 'OPEN',
695
+ }
696
+
697
+ export declare interface Heading {
698
+ anchor?: string | null
699
+ url?: string | null
700
+ content: string
701
+ isMatch?: boolean
702
+ }
703
+
704
+ export declare type IkpChatAction = GetHelpOption | CustomMessageAction
705
+
706
+ export declare type IkpTheme = DeepPartial<StrictIkpTheme>
707
+
708
+ export declare type IkpThemeCategory = keyof StrictIkpTheme
709
+
710
+ export declare type IkpThemeEntry = [keyof IkpTheme, Record<string, unknown>][]
711
+
712
+ export declare interface IncludeChatSessionField extends BaseFormField {
713
+ // _type tells special fields apart from standard fields
714
+ _type: 'include_chat_session'
715
+ inputType?: 'checkbox'
716
+ defaultValue?: boolean
717
+ }
718
+
719
+ export declare interface InkeepAIChatSettings {
720
+ /**
721
+ * Headers for requests
722
+ */
723
+ headers?: Record<string, string>
724
+
725
+ /**
726
+ * App ID for requests, can be generated in the Inkeep dashboard
727
+ */
728
+ appId?: string
729
+
730
+ /**
731
+ * Base API URL for token exchange, captcha challenge, and the chat run api
732
+ * @default https://api.agents.inkeep.com
733
+ */
734
+ baseUrl?: string
735
+
736
+ /**
737
+ * @deprecated Use `appId` instead
738
+ * API key for requests.
739
+ */
740
+ apiKey?: string
741
+
742
+ /**
743
+ * @deprecated Use `baseUrl` instead
744
+ * Agent URL for chatstream API.
745
+ */
746
+ agentUrl?: string
747
+
748
+ /**
749
+ * Context to be passed to the chatstream API.
750
+ */
751
+ context?: Record<string, unknown>
752
+
753
+ /**
754
+ * The placeholder text to display in the chat input field when empty.
755
+ * Use this to provide guidance on what kind of questions users can ask.
756
+ * "Ask me anything about our API documentation..."
757
+ */
758
+ placeholder?: string
759
+
760
+ /**
761
+ * A welcome message shown at the start of a new chat session.
762
+ * Supports markdown formatting for rich text styling.
763
+ * Use this to introduce the AI assistant's capabilities and set expectations.
764
+ * "👋 Hi! I'm here to help you with technical questions about our API..."
765
+ */
766
+ introMessage?: string
767
+
768
+ /**
769
+ * The name of the product/service/topic that the chat assistant specializes in.
770
+ * This helps contextualize the chat experience for users.
771
+ * If not provided, defaults to the organization name from base settings.
772
+ * "MongoDB Atlas" or "React Router"
773
+ */
774
+ chatSubjectName?: string
775
+
776
+ /**
777
+ * The display name for the AI assistant in the chat interface.
778
+ * Choose a name that reflects the assistant's role and your brand.
779
+ * "Atlas Assistant" or "DevBot"
780
+ */
781
+ aiAssistantName?: string
782
+
783
+ /**
784
+ * URL to the AI assistant's avatar image.
785
+ * Should be a square image, recommended size 40x40px.
786
+ * Supports common image formats (PNG, JPG, SVG).
787
+ *
788
+ * You can pass a string or an object to configure for different color modes.
789
+ * {
790
+ * light: 'https://example.com/avatar-light.png',
791
+ * dark: 'https://example.com/avatar-dark.png',
792
+ * }
793
+ */
794
+ aiAssistantAvatar?:
795
+ | string
796
+ | {
797
+ light: string
798
+ dark: string
799
+ }
800
+
801
+ /**
802
+ * URL to the user's avatar image in the chat interface.
803
+ * Should be a square image, recommended size 40x40px.
804
+ * Falls back to a default user icon if not provided.
805
+ */
806
+ userAvatar?: string
807
+
808
+ /**
809
+ * Controls whether links in chat messages open in new browser tabs.
810
+ * Enable this to help users maintain their chat context when following links.
811
+ * @default true
812
+ */
813
+ shouldOpenLinksInNewTab?: boolean
814
+
815
+ /**
816
+ * Custom heading text for the example questions section.
817
+ * Use this to better describe your suggested queries.
818
+ * "Common Questions" or "Try asking about..."
819
+ */
820
+ exampleQuestionsLabel?: string
821
+
822
+ /**
823
+ * A list of pre-written questions users can click to quickly start a conversation.
824
+ * These should reflect common use cases and help users understand the AI assistant's capabilities.
825
+ * ["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?" }]
826
+ */
827
+ exampleQuestions?:
828
+ | string[]
829
+ | {
830
+ value: string
831
+ label: string
832
+ }[]
833
+
834
+ /**
835
+ * Whether to visually emphasize the first example question.
836
+ * Use this to draw attention to the most important or common query.
837
+ */
838
+ isFirstExampleQuestionHighlighted?: boolean
839
+
840
+ /**
841
+ * Enables the ability to share chat conversations via URL.
842
+ * Useful for allowing users to share helpful conversations with teammates.
843
+ */
844
+ isShareButtonVisible?: boolean
845
+
846
+ /**
847
+ * The base URL path used when generating shareable chat links.
848
+ * Should match your application's routing structure.
849
+ * "/shared-chats/" or "/support/conversations/"
850
+ */
851
+ shareChatUrlBasePath?: string
852
+
853
+ /**
854
+ * Controls the visibility of the copy chat button.
855
+ * Allows users to copy the entire chat transcript to their clipboard.
856
+ */
857
+ isCopyChatButtonVisible?: boolean
858
+
859
+ /**
860
+ * Unique identifier for loading a specific conversation.
861
+ * Use this to restore a previous conversation state.
862
+ */
863
+ conversationId?: string
864
+
865
+ /**
866
+ * When enabled, prevents users from sending new messages.
867
+ * Useful for displaying archived or shared chat sessions.
868
+ * @default false
869
+ */
870
+ isViewOnly?: boolean
871
+
872
+ /**
873
+ * Whether to make conversations public by default.
874
+ * @default undefined (private)
875
+ */
876
+ conversationVisibility?: 'public' | 'private'
877
+
878
+ /**
879
+ * Controls the visibility of the chat history button, which opens the list of previous chats.
880
+ * @default true
881
+ */
882
+ isChatHistoryButtonVisible?: boolean
883
+
884
+ /**
885
+ * Configuration for the chat's disclaimer message.
886
+ * Use this to display important notices about AI limitations or data usage.
887
+ */
888
+ disclaimerSettings?: AIChatDisclaimerSettings
889
+
890
+ /**
891
+ * Callback function triggered whenever the user modifies their input message.
892
+ *
893
+
894
+ * @param message - The current content of the input field
895
+ */
896
+ onInputMessageChange?: (message: string) => void
897
+
898
+ /**
899
+ * React ref for accessing the chat component's methods.
900
+ * Enables programmatic control of chat functions from parent components.
901
+ */
902
+ chatFunctionsRef?: React.Ref<AIChatFunctions>
903
+
904
+ /**
905
+ * Array of actions available in the "Get Help" menu.
906
+ * Use this to provide alternative support options like contact forms or documentation links.
907
+ */
908
+ getHelpOptions?: GetHelpOption[]
909
+
910
+ /**
911
+ * Array of actions available rendered after each message.
912
+ */
913
+ messageActions?: CustomMessageAction[]
914
+
915
+ /**
916
+ * Custom heading text for the workflows section.
917
+ * Use this to describe available automated processes or guided flows.
918
+ */
919
+ workflowsHeader?: string
920
+
921
+ /**
922
+ * Collection of interactive workflows that can be triggered during chat.
923
+ * These can guide users through complex processes or data collection.
924
+ */
925
+ // workflows?: Workflow[]
926
+
927
+ /**
928
+ * Custom labels for the chat interface's action buttons.
929
+ * Use this for internationalization or to better match your application's terminology.
930
+ */
931
+ toolbarButtonLabels?: AIChatToolbarButtonLabels
932
+
933
+ /**
934
+ * Filters to apply to the chat results.
935
+ */
936
+ filters?: SearchAndChatFilters
937
+
938
+ /**
939
+ * Components to be rendered in the chat interface.
940
+ */
941
+
942
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
943
+ components?: ComponentsConfig<any>
944
+
945
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
946
+ artifacts?: ComponentsConfig<any>
947
+ }
948
+
949
+ export declare interface InkeepBaseSettings {
950
+ /**
951
+ * The display name of your organization that will be shown in various UI elements.
952
+ * For example, this may appear in chat messages or headers.
953
+ */
954
+ organizationDisplayName?: string
955
+ /**
956
+ * The primary brand color used throughout the widget UI.
957
+ * This color will be used to generate a cohesive color scheme.
958
+ * Should be provided as a valid CSS color value (hex, rgb, etc).
959
+ */
960
+ primaryBrandColor: string
961
+ /**
962
+ * Settings to control the color mode (light/dark) behavior.
963
+ * Can be used to sync with your application's theme or set a forced color mode.
964
+ * @see ColorModeConfig type for detailed configuration options
965
+ */
966
+ colorMode?: ColorModeConfig
967
+ /**
968
+ * Theme customization settings for the widget.
969
+ * Allows customizing colors, typography, component styles, and more.
970
+ */
971
+ theme?: UserTheme
972
+ /**
973
+ * Custom icon overrides for the default icon set.
974
+ * Allows replacing any of the built-in icons with your own components.
975
+ */
976
+ customIcons?: CustomIconMap
977
+ /**
978
+ * Properties to identify and provide context about the current user.
979
+ * Used for personalization and analytics tracking.
980
+ * @see UserProperties interface for available fields
981
+ */
982
+ userProperties?: UserProperties
983
+ /**
984
+ * Authentication token for the current user.
985
+ * Used for authenticated API requests if required.
986
+ */
987
+ userAuthToken?: string
988
+ /**
989
+ * Additional properties to be sent with analytics events.
990
+ * These properties will be merged with the event properties.
991
+ */
992
+ analyticsProperties?: Record<string, unknown>
993
+ /**
994
+ * Handler for analytics events from the widget.
995
+
996
+ * @param event - The analytics event object
997
+ * @returns Promise that resolves when the event is logged
998
+ */
999
+ onEvent?: (event: InkeepCallbackEvent) => Promise<void>
1000
+ /**
1001
+ * Handler for feedback events from the widget.
1002
+
1003
+ * @param feedback - The feedback object
1004
+ * @returns The feedback object
1005
+ */
1006
+ onFeedback?: (
1007
+ feedback: InkeepFeedback & {
1008
+ properties?: Record<string, unknown>
1009
+ },
1010
+ ) => Promise<InkeepFeedback>
1011
+
1012
+ /**
1013
+ * 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.
1014
+ * @default false
1015
+ */
1016
+ shouldBypassCaptcha?: boolean
1017
+ /**
1018
+ * Privacy and cookie preferences configuration.
1019
+ */
1020
+ privacyPreferences?: PrivacyPreferences
1021
+ /**
1022
+ * Function to transform source data before display.
1023
+ *
1024
+ * @remarks
1025
+ * Allows customizing how source information is presented in the widget.
1026
+
1027
+ * @param source - The original source data
1028
+ * @param type - The type of source data
1029
+ * @param opts - The options for the transform source
1030
+ * @returns The transformed source data
1031
+ */
1032
+ transformSource?: TransformSource
1033
+
1034
+ /**
1035
+ * Reference to the shadow DOM host element if using custom Shadow DOM.
1036
+ * Required when embedding the widget within a Shadow DOM.
1037
+ */
1038
+ shadowHost?: HTMLElement | null
1039
+ /**
1040
+ * Reference to the root element where the widget is mounted.
1041
+ * Used for positioning and event handling.
1042
+ */
1043
+ rootElement?: HTMLElement | null
1044
+ /**
1045
+ * Custom tags for widget identification.
1046
+ * Used in analytics to segment and filter widget instances.
1047
+ * Array of string identifiers.
1048
+ */
1049
+ tags?: string[]
1050
+ /**
1051
+ * Instance of the Prism syntax highlighting library.
1052
+ * Required for code block syntax highlighting functionality.
1053
+ */
1054
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1055
+ prism?: any
1056
+ /**
1057
+ * Query parameters to automatically append to URLs in the widget.
1058
+ * Useful for tracking or maintaining context in navigation.
1059
+ * Object mapping parameter names to values.
1060
+ */
1061
+ urlQueryParamsToAppend?: UrlQueryParam
1062
+ /**
1063
+ * Base-level filters to apply to all search and chat operations.
1064
+ * These are typically organization or user-level filters.
1065
+ */
1066
+ filters?: SearchAndChatFilters
1067
+ }
1068
+
1069
+ export declare type InkeepCallbackEvent = InkeepEventWithCommon
1070
+
1071
+ export declare interface InkeepCloudAIChatSettings extends InkeepAIChatSettings {}
1072
+
1073
+ export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings {
1074
+ /**
1075
+ * Custom base URL for analytics API endpoints.
1076
+ * Useful when routing analytics requests through a proxy.
1077
+ * Should include protocol (e.g., 'https://analytics.your-proxy.com')
1078
+ */
1079
+ analyticsApiBaseUrl?: string
1080
+ /**
1081
+ * Environment setting for the widget.
1082
+ * Affects API endpoints and debug behaviors.
1083
+ * @default 'production'
1084
+ */
1085
+ env?: 'development' | 'production'
1086
+ }
1087
+
1088
+ export declare interface InkeepCloudConfig {
1089
+ baseSettings: InkeepCloudBaseSettings
1090
+ aiChatSettings: InkeepCloudAIChatSettings
1091
+ searchSettings: InkeepCloudSearchSettings
1092
+ }
1093
+
1094
+ export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings {
1095
+ /**
1096
+ * The API key to use for authenticating with Inkeep's services.
1097
+ * Required for accessing Inkeep's API endpoints.
1098
+ */
1099
+ apiKey?: string
1100
+ /**
1101
+ * Custom base URL for search API endpoints.
1102
+ * Useful when routing API requests through a proxy.
1103
+ * Should include protocol (e.g., 'https://api.your-proxy.com')
1104
+ */
1105
+ url?: string
1106
+ /**
1107
+ * Search-specific filters to apply to search operations.
1108
+ * These are merged with base filters from baseSettings.
1109
+ */
1110
+ filters?: SearchAndChatFilters
1111
+ /**
1112
+ * The maximum number of hits to return.
1113
+ * @default 40
1114
+ */
1115
+ maxResults?: number
1116
+ /**
1117
+ * Advanced search callback function that handles search with full filter support.
1118
+ * This callback handles the complete search implementation with SearchInput.
1119
+ *
1120
+ * @param searchInput - The search input containing query and filters
1121
+ * @param abortSignal - Signal to abort the search request
1122
+ * @returns Promise that resolves with search results
1123
+ */
1124
+ onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise<SearchHit[]>
1125
+ }
1126
+
1127
+ export declare type InkeepComponentInitializer = {
1128
+ (props: InkeepComponentProps): InkeepComponentInstance | undefined
1129
+ (targetSelector: string, props: InkeepComponentProps): InkeepComponentInstance | undefined
1130
+ }
1131
+
1132
+ /**
1133
+ * Represents an instance of any Inkeep component that is returned after initialization.
1134
+ * These instances have methods that can be used to update the component's state.
1135
+ */
1136
+ export declare interface InkeepComponentInstance {
1137
+ /**
1138
+ * Updates the component with new props
1139
+
1140
+ * @param newProps - The new props to apply to the component
1141
+ */
1142
+ update: <T extends object>(newProps: T) => void
1143
+
1144
+ /**
1145
+ * Unmounts the component from the DOM but preserves its state
1146
+ */
1147
+ unmount: () => void
1148
+
1149
+ /**
1150
+ * Remounts a previously unmounted component
1151
+ */
1152
+ remount: () => void
1153
+
1154
+ /**
1155
+ * Access to chat-specific functionality (only available for components with chat capabilities)
1156
+ */
1157
+ chat?: {
1158
+ // biome-ignore lint/suspicious/noExplicitAny: Required for flexible method signatures
1159
+ [key: string]: (...args: any[]) => any
1160
+ }
1161
+
1162
+ /**
1163
+ * Access to search-specific functionality (only available for components with search capabilities)
1164
+ */
1165
+ search?: {
1166
+ // biome-ignore lint/suspicious/noExplicitAny: Required for flexible method signatures
1167
+ [key: string]: (...args: any[]) => any
1168
+ }
1169
+ }
1170
+
1171
+ export declare type InkeepComponentProps = InkeepSettings & {
1172
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1173
+ [key: string]: any
1174
+ }
1175
+
1176
+ export declare interface InkeepConfig {
1177
+ /**
1178
+ * The prefix to use for the widget.
1179
+ * @default 'ikp'
1180
+ */
1181
+ prefix?: string
1182
+ /* Excluded from this release type: componentType */
1183
+ /**
1184
+ * Configuration for the chat.
1185
+ */
1186
+ aiChatSettings: InkeepAIChatSettings & {
1187
+ shouldAutoFocusInput?: boolean
1188
+ }
1189
+ /**
1190
+ * Configuration for the base settings.
1191
+ */
1192
+ baseSettings: InkeepBaseSettings
1193
+ /**
1194
+ * Configuration for the search settings.
1195
+ */
1196
+ searchSettings: InkeepSearchSettings & {
1197
+ shouldAutoFocusInput?: boolean
1198
+ }
1199
+ }
1200
+
1201
+ export declare type InkeepCustomIcon =
1202
+ | {
1203
+ builtIn: AvailableBuiltInIcons
1204
+ }
1205
+ | {
1206
+ custom: string // url of svg or png of icon
1207
+ }
1208
+
1209
+ export declare type InkeepEvent = SearchEvent | ChatEvent | WidgetEvent
1210
+
1211
+ export declare type InkeepEventWithCommon = ExtendPropertiesWithCommon<InkeepEvent>
1212
+
1213
+ export declare interface InkeepFeedback {
1214
+ type: FeedbackType
1215
+ messageId: string
1216
+ reasons?: FeebackReason[]
1217
+ }
1218
+
1219
+ export declare type InkeepJS = Partial<Record<InkeepJSComponent, InkeepComponentInitializer>>
1220
+
1221
+ /**
1222
+ * Represents the available Inkeep component types that can be rendered
1223
+ * via the global Inkeep object.
1224
+ */
1225
+ export declare type InkeepJSComponent =
1226
+ | 'EmbeddedChat'
1227
+ | 'EmbeddedSearch'
1228
+ | 'EmbeddedSearchAndChat'
1229
+ | 'ModalChat'
1230
+ | 'ModalSearch'
1231
+ | 'ModalSearchAndChat'
1232
+ | 'ChatButton'
1233
+ | 'ChatButtonModal'
1234
+ | 'SearchBar'
1235
+ | 'SidebarChat'
1236
+
1237
+ export declare interface InkeepSearchSettings {
1238
+ /**
1239
+ * The placeholder text to use.
1240
+ * @default
1241
+ * 'Search anything...' (desktop)
1242
+ * 'Search' (mobile)
1243
+ */
1244
+ placeholder?: string
1245
+ /**
1246
+ * The default query to use.
1247
+ * @default ''
1248
+ */
1249
+ defaultQuery?: string
1250
+ /**
1251
+ * Callback for when the search query changes.
1252
+ */
1253
+ onQueryChange?: (query: string) => void
1254
+ /**
1255
+ * Search callback function that handles all search functionality.
1256
+ * This callback handles the complete search implementation.
1257
+ * If not provided, the widget will warn and show no results.
1258
+ *
1259
+
1260
+ * @param query - The search query string
1261
+ * @param abortSignal - Signal to abort the search request
1262
+ *
1263
+ * @returns Promise that resolves with search results
1264
+ */
1265
+ onSearch?: (query: string, abortSignal: AbortSignal) => Promise<SourceItem[]>
1266
+ /**
1267
+ * The time in milliseconds to wait triggering the search.
1268
+ * @default 0
1269
+ */
1270
+ debounceTimeMs?: number
1271
+ /**
1272
+ * Ref to the AIChat component's callable functions
1273
+ */
1274
+ searchFunctionsRef?: React.Ref<SearchFunctions>
1275
+ /**
1276
+ * Controls whether links should open in a new tab.
1277
+ * @default false
1278
+ */
1279
+ shouldOpenLinksInNewTab?: boolean
1280
+ /**
1281
+ * 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].
1282
+ *
1283
+ * Default tabs if none provided: All, Publications, PDFs, GitHub, Forums, Discord, Slack, StackOverflow
1284
+ *
1285
+ * Behavior:
1286
+ * - Omit 'All' from tabs array to hide the All tab
1287
+ * - Empty tabs array will show all results without tab UI
1288
+ * - Tabs only appear when they have results, unless isAlwaysVisible is set
1289
+ * ```ts
1290
+ * // Basic tabs
1291
+ * tabs: ['Publications', 'GitHub']
1292
+ *
1293
+ * // With isAlwaysVisible option
1294
+ * tabs: [
1295
+ * 'Publications',
1296
+ * ['GitHub', { isAlwaysVisible: true }] // Shows even with no results
1297
+ * ]
1298
+ * ```
1299
+ */
1300
+ tabs?: (string | SearchTab)[]
1301
+ /**
1302
+ * The key to use for the search query parameter.
1303
+ *
1304
+ * When a user selects a search result, the query is added to the URL as a query parameter.
1305
+ * This is the key of that query parameter.
1306
+ *
1307
+ */
1308
+ searchQueryParamKey?: string
1309
+ /**
1310
+ * The view to use for the search.
1311
+ * @default 'single-pane'
1312
+ */
1313
+ view?: 'single-pane' | 'dual-pane'
1314
+ }
1315
+
1316
+ export declare interface InkeepSettings {
1317
+ baseSettings?: InkeepBaseSettings
1318
+ aiChatSettings?: InkeepAIChatSettings
1319
+ searchSettings?: InkeepSearchSettings
1320
+ openSettings?: OpenSettingsModal
1321
+ }
1322
+
1323
+ export declare type InputMaybe<T> = T | null
1324
+
1325
+ export declare interface InvokeCallbackAction {
1326
+ type: 'invoke_callback'
1327
+ callback: (args: InvokeCallbackArgs) => void
1328
+ shouldCloseModal?: boolean
1329
+ }
1330
+
1331
+ export declare interface InvokeCallbackArgs {
1332
+ conversation: {
1333
+ id: string
1334
+ messages: Message[]
1335
+ }
1336
+ }
1337
+
1338
+ export declare interface InvokeMessageCallbackAction {
1339
+ type: 'invoke_message_callback'
1340
+ callback: (args: InvokeMessageCallbackActionArgs) => void
1341
+ shouldCloseModal?: boolean
1342
+ }
1343
+
1344
+ export declare interface InvokeMessageCallbackActionArgs extends InvokeCallbackArgs {
1345
+ messageId?: string
1346
+ }
1347
+
1348
+ export declare interface JSONSchema {
1349
+ $id?: string | undefined
1350
+ $comment?: string | undefined
1351
+
1352
+ /**
1353
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
1354
+ */
1355
+ type?: JSONSchemaTypeName | JSONSchemaTypeName[] | undefined
1356
+ enum?: JSONSchemaType[] | undefined
1357
+ const?: JSONSchemaType | undefined
1358
+
1359
+ /**
1360
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
1361
+ */
1362
+ multipleOf?: number | undefined
1363
+ maximum?: number | undefined
1364
+ exclusiveMaximum?: number | undefined
1365
+ minimum?: number | undefined
1366
+ exclusiveMinimum?: number | undefined
1367
+
1368
+ /**
1369
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
1370
+ */
1371
+ maxLength?: number | undefined
1372
+ minLength?: number | undefined
1373
+ pattern?: string | undefined
1374
+
1375
+ /**
1376
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
1377
+ */
1378
+ items?: JSONSchemaDefinition | JSONSchemaDefinition[] | undefined
1379
+ additionalItems?: JSONSchemaDefinition | undefined
1380
+ maxItems?: number | undefined
1381
+ minItems?: number | undefined
1382
+ uniqueItems?: boolean | undefined
1383
+ contains?: JSONSchemaDefinition | undefined
1384
+
1385
+ /**
1386
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
1387
+ */
1388
+ maxProperties?: number | undefined
1389
+ minProperties?: number | undefined
1390
+ required?: string[] | undefined
1391
+ properties?:
1392
+ | {
1393
+ [key: string]: JSONSchemaDefinition
1394
+ }
1395
+ | undefined
1396
+ patternProperties?:
1397
+ | {
1398
+ [key: string]: JSONSchemaDefinition
1399
+ }
1400
+ | undefined
1401
+ additionalProperties?: JSONSchemaDefinition | undefined
1402
+ propertyNames?: JSONSchemaDefinition | undefined
1403
+
1404
+ /**
1405
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
1406
+ */
1407
+ if?: JSONSchemaDefinition | undefined
1408
+ then?: JSONSchemaDefinition | undefined
1409
+ else?: JSONSchemaDefinition | undefined
1410
+
1411
+ /**
1412
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
1413
+ */
1414
+ allOf?: JSONSchemaDefinition[] | undefined
1415
+ anyOf?: JSONSchemaDefinition[] | undefined
1416
+ oneOf?: JSONSchemaDefinition[] | undefined
1417
+ not?: JSONSchemaDefinition | undefined
1418
+
1419
+ /**
1420
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
1421
+ */
1422
+ format?: string | undefined
1423
+
1424
+ /**
1425
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
1426
+ */
1427
+ title?: string | undefined
1428
+ description?: string | undefined
1429
+ default?: JSONSchemaType | undefined
1430
+ readOnly?: boolean | undefined
1431
+ writeOnly?: boolean | undefined
1432
+ examples?: JSONSchemaType | undefined
1433
+ }
1434
+
1435
+ export declare interface JSONSchemaArray extends Array<JSONSchemaType> {}
1436
+
1437
+ /**
1438
+ * JSON Schema v7
1439
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
1440
+ */
1441
+ export declare type JSONSchemaDefinition = JSONSchema | boolean
1442
+
1443
+ export declare interface JSONSchemaObject {
1444
+ [key: string]: JSONSchemaType
1445
+ }
1446
+
1447
+ /**
1448
+ * Primitive type
1449
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
1450
+ */
1451
+ export declare type JSONSchemaType =
1452
+ | string //
1453
+ | number
1454
+ | boolean
1455
+ | JSONSchemaObject
1456
+ | JSONSchemaArray
1457
+ | null
1458
+
1459
+ /**
1460
+ * Primitive type
1461
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
1462
+ */
1463
+ export declare type JSONSchemaTypeName =
1464
+ | ({} & string)
1465
+ | 'string'
1466
+ | 'number'
1467
+ | 'integer'
1468
+ | 'boolean'
1469
+ | 'object'
1470
+ | 'array'
1471
+ | 'null'
1472
+
1473
+ /**
1474
+ * Meta schema
1475
+ *
1476
+ * Recommended values:
1477
+ * - 'http://json-schema.org/schema#'
1478
+ * - 'http://json-schema.org/hyper-schema#'
1479
+ * - 'http://json-schema.org/draft-07/schema#'
1480
+ * - 'http://json-schema.org/draft-07/hyper-schema#'
1481
+ *
1482
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
1483
+ */
1484
+ export declare type JSONSchemaVersion = string
1485
+
1486
+ export declare type Message = UIMessage<unknown, DataParts>
1487
+
1488
+ export declare type MessageAction = 'copy' | 'upvote' | 'downvote'
1489
+
1490
+ export declare interface MessageAttachment {
1491
+ contentType: MessageAttachmentContentType
1492
+ title: string
1493
+ content: string
1494
+ id: string
1495
+ context?: string[]
1496
+ }
1497
+
1498
+ /**
1499
+ * MessageAttachmentContentType represents possible type of information that can be attached to a Workflow.
1500
+ */
1501
+ export declare type MessageAttachmentContentType = WorkflowCodeContentType | WorkflowTextContentType
1502
+
1503
+ export declare interface MessageAttributes {
1504
+ attachments?: MessageAttachment[]
1505
+ workflow?: Workflow
1506
+ }
1507
+
1508
+ declare type MessageChatAction = ExpandUnion<InvokeMessageCallbackAction | OpenFormAction | OpenUrlAction>
1509
+
1510
+ export declare interface MessageFeedback {
1511
+ unrelated_response: boolean
1512
+ inaccurate_statement: boolean
1513
+ inaccurate_code_snippet: boolean
1514
+ irrelevant_citations: boolean
1515
+ }
1516
+
1517
+ export declare interface MessageMetadata {
1518
+ attributes?: MessageAttributes
1519
+ context?: string
1520
+ }
1521
+
1522
+ export declare interface ModalClosedEvent {
1523
+ eventName: 'modal_closed'
1524
+ properties: {}
1525
+ }
1526
+
1527
+ export declare interface ModalOpenedEvent {
1528
+ eventName: 'modal_opened'
1529
+ properties: {}
1530
+ }
1531
+
1532
+ export declare type ModalViewTypes = 'chat' | 'search'
1533
+
1534
+ export declare interface OpenFormAction {
1535
+ type: 'open_form'
1536
+ formSettings: AIChatFormSettings
1537
+ }
1538
+
1539
+ export declare interface OpenSettingsChatButton extends BaseOpenSettings {}
1540
+
1541
+ export declare interface OpenSettingsModal extends BaseOpenSettings {
1542
+ /**
1543
+ * The trigger selector.
1544
+ *
1545
+ * The selector to trigger the modal when clicked.
1546
+ *
1547
+ * @default '[data-inkeep-modal-trigger]'
1548
+ */
1549
+ triggerSelector?: string
1550
+ }
1551
+
1552
+ export declare interface OpenSettingsSearchBar extends BaseOpenSettings {
1553
+ /**
1554
+ * The shortcut key.
1555
+ *
1556
+ * The key to trigger the searchbar when pressed with Cmd (Mac) / Ctrl (Windows).
1557
+ *
1558
+ * Set to `null` to disable the shortcut.
1559
+ *
1560
+ * @default 'k'
1561
+ */
1562
+ shortcutKey?: string | null
1563
+ }
1564
+
1565
+ export declare interface OpenSettingsSidebar extends BaseOpenSettings {
1566
+ /**
1567
+ * The trigger selector for the sidebar chat.
1568
+ * @default '[data-inkeep-sidebar-chat-trigger]'
1569
+ */
1570
+ triggerSelector?: string
1571
+
1572
+ /**
1573
+ * Threshold factor for auto-closing when resizing.
1574
+ * When dragging below (minWidth * autoCloseThreshold), the sidebar will auto-close.
1575
+ * @default 0.7 (70% of minimum width)
1576
+ */
1577
+ autoCloseThreshold?: number
1578
+ }
1579
+
1580
+ export declare interface OpenUrlAction {
1581
+ type: 'open_link'
1582
+ url: string
1583
+ }
1584
+
1585
+ export declare type OperationType =
1586
+ | 'error'
1587
+ | 'agent_initializing'
1588
+ | 'completion'
1589
+ | 'agent_generate'
1590
+ | 'agent_reasoning'
1591
+ | 'tool_call'
1592
+ | 'tool_result'
1593
+ | 'transfer'
1594
+ | 'delegation_sent'
1595
+ | 'delegation_returned'
1596
+ | 'artifact_saved'
1597
+
1598
+ export declare interface PrivacyPreferences {
1599
+ /**
1600
+ * Whether to opt out of analytical cookies.
1601
+ * @default false
1602
+ */
1603
+ optOutAnalyticalCookies?: boolean
1604
+ /**
1605
+ * Whether to opt out of all analytics.
1606
+ * @default false
1607
+ */
1608
+ optOutAllAnalytics?: boolean
1609
+ /**
1610
+ * Whether to opt out of functional cookies.
1611
+ * @default false
1612
+ */
1613
+ optOutFunctionalCookies?: boolean
1614
+ }
1615
+
1616
+ declare type QueryCondition = { $eq: QueryValue } | { $in: (number | string)[] }
1617
+
1618
+ declare type QueryValue = boolean | number | string
1619
+
1620
+ declare type RecordTypes =
1621
+ | 'DocumentationRecord'
1622
+ | 'GitHubIssueRecord'
1623
+ | 'StackOverflowRecord'
1624
+ | 'DiscordRecord'
1625
+ | 'SlackEntry'
1626
+ | 'DiscourseRecord'
1627
+
1628
+ export declare type RenderFn = ({
1629
+ children,
1630
+ ssr,
1631
+ root,
1632
+ }: {
1633
+ children: ReactNode
1634
+ ssr: boolean
1635
+ root: ShadowRoot | null
1636
+ }) => ReactNode
1637
+
1638
+ export declare type Root = Record<string, ComponentType<HTMLProps<HTMLElement> & ShadowRootProps>>
1639
+
1640
+ export declare interface SearchAndChatFilters {
1641
+ attributes?: {
1642
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1643
+ [key: string]: any
1644
+ }
1645
+ }
1646
+
1647
+ export declare type SearchEvent =
1648
+ | SearchQueryResponseReceivedEvent
1649
+ | SearchQuerySubmittedEvent
1650
+ | SearchResultClickedEvent
1651
+
1652
+ export declare type SearchFiltersInput = {
1653
+ limit: number
1654
+ }
1655
+
1656
+ export declare interface SearchFunctions {
1657
+ /**
1658
+ * Update the query.
1659
+ */
1660
+ updateQuery: (query: string) => void
1661
+ /**
1662
+ * Focus the input.
1663
+ */
1664
+ focusInput: () => void
1665
+ }
1666
+
1667
+ export declare interface SearchHit {
1668
+ hitOnRoot: boolean
1669
+ id: string
1670
+ rootRecord: SearchRootRecord
1671
+ title?: string
1672
+ url?: string
1673
+ preview?: string
1674
+ pathHeadings?: {
1675
+ anchor?: string | null
1676
+ content: string
1677
+ }[]
1678
+ content?: {
1679
+ content: string
1680
+ anchor?: string | null
1681
+ }
1682
+ }
1683
+
1684
+ export declare type SearchInput = {
1685
+ filters?: InputMaybe<SearchFiltersInput>
1686
+ searchQuery: string
1687
+ }
1688
+
1689
+ export declare interface SearchQueryResponseReceivedEvent {
1690
+ eventName: 'search_query_response_received'
1691
+ properties: {
1692
+ searchQuery: string
1693
+ totalResults: number
1694
+ }
1695
+ }
1696
+
1697
+ export declare interface SearchQuerySubmittedEvent {
1698
+ eventName: 'search_query_submitted'
1699
+ properties: {
1700
+ searchQuery: string
1701
+ }
1702
+ }
1703
+
1704
+ export declare interface SearchResultClickedEvent {
1705
+ eventName: 'search_result_clicked'
1706
+ properties: {
1707
+ searchQuery: string
1708
+ title?: string
1709
+ url?: string
1710
+ }
1711
+ }
1712
+
1713
+ export declare interface SearchRootRecord {
1714
+ __typename: RecordTypes
1715
+ id: string
1716
+ title?: string
1717
+ url?: string
1718
+ preview?: string
1719
+ pathBreadcrumbs?: string[]
1720
+ contentType?: string
1721
+ topLevelHeadings?: TopLevelHeading[]
1722
+ body?: string
1723
+ state?: `${GitHubIssueState}`
1724
+ // StackOverflow
1725
+ markedAsCorrectAnswer?: {
1726
+ url: string
1727
+ score: number
1728
+ content: string
1729
+ }
1730
+ }
1731
+
1732
+ export declare interface SearchTab {
1733
+ [0]: string
1734
+ [1]: {
1735
+ isAlwaysVisible?: boolean
1736
+ }
1737
+ }
1738
+
1739
+ declare interface SelectField extends BaseFormField {
1740
+ inputType: 'select'
1741
+ items: SelectItem[]
1742
+ defaultValue?: string
1743
+ placeholder?: string
1744
+ }
1745
+
1746
+ export declare interface SelectItem {
1747
+ label: string
1748
+ value: string
1749
+ }
1750
+
1751
+ export declare interface ShadowRootProps {
1752
+ mode?: 'closed' | 'open'
1753
+ delegatesFocus?: boolean
1754
+ styleSheets?: CSSStyleSheet[]
1755
+ ssr?: boolean
1756
+ children?: ReactNode
1757
+ }
1758
+
1759
+ export declare interface SharedChatLoadedEvent {
1760
+ eventName: 'shared_chat_loaded'
1761
+ properties: {
1762
+ conversationId?: string
1763
+ }
1764
+ }
1765
+
1766
+ export declare interface SourceItem {
1767
+ id?: string
1768
+ title: string | undefined
1769
+ url: string
1770
+ description: string | undefined
1771
+ breadcrumbs: string[]
1772
+ type: string
1773
+ contentType?: string
1774
+ tag?: string
1775
+ tabs?: (SourceTab | string)[]
1776
+ headings?: Heading[]
1777
+ preview?: string
1778
+ }
1779
+
1780
+ export declare interface SourceTab {
1781
+ [0]: string
1782
+ [1]: {
1783
+ breadcrumbs: string[]
1784
+ }
1785
+ }
1786
+
1787
+ export declare interface StrictIkpTheme {
1788
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1789
+ colors: Record<string, any>
1790
+ fontFamily: Record<string, string>
1791
+ fontSize: Record<string, string>
1792
+ zIndex: Record<string, string | number>
1793
+ }
1794
+
1795
+ export declare interface Style {
1796
+ /**
1797
+ * A unique identifier for the style.
1798
+ * This is used to prevent duplicate styles and allow for style updates.
1799
+ * key: 'custom-button-styles'
1800
+ */
1801
+ key?: string
1802
+ /**
1803
+ * The type of style to apply.
1804
+ * - 'link': Adds a <link> tag to load external resources like fonts or stylesheets
1805
+ * - 'style': Injects CSS directly into a <style> tag
1806
+ * type: 'link' // For loading external resources
1807
+ * type: 'style' // For inline CSS
1808
+ */
1809
+ type: 'link' | 'style'
1810
+ /**
1811
+ * The content of the style.
1812
+ * For type='link', this should be a valid URL to an external resource.
1813
+ * For type='style', this should be valid CSS code.
1814
+ *
1815
+ * ```ts
1816
+ * // For type='link':
1817
+ * value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
1818
+ *
1819
+ * // For type='style':
1820
+ * value: `.custom-button {
1821
+ * background: blue;
1822
+ * color: white;
1823
+ * }`
1824
+ * ```
1825
+ */
1826
+ value: string
1827
+ }
1828
+
1829
+ export declare type SubmitCallback = (values: SubmitCallbackArgs) => Promise<void> | void
1830
+
1831
+ export declare interface SubmitCallbackArgs {
1832
+ values: FieldValues
1833
+ conversation?: {
1834
+ id: string
1835
+ messages: Message[]
1836
+ }
1837
+ }
1838
+
1839
+ export declare interface SyncColorMode {
1840
+ /**
1841
+ * The HTML element to watch for color mode changes.
1842
+ * This element's attributes will be monitored for changes to determine the color mode.
1843
+ *
1844
+ * Common use cases include watching the document root or a specific app container.
1845
+ * ```ts
1846
+ * // Watch the document root element
1847
+ * target: document.documentElement
1848
+ *
1849
+ * // Watch a specific container element
1850
+ * target: document.querySelector('#app')
1851
+ *
1852
+ * // Watch a specific element by ID
1853
+ * target: '#app'
1854
+ * ```
1855
+ */
1856
+ target: HTMLElement | null | string
1857
+
1858
+ /**
1859
+ * The specific attributes to monitor for color mode changes.
1860
+ * The observer will only trigger when these attributes change on the target element.
1861
+ *
1862
+ * Common attributes used for theming include:
1863
+ * - data-theme: Custom theme attribute
1864
+ * - color-scheme: Standard CSS color scheme
1865
+ * - class: Class-based theming
1866
+ * ```ts
1867
+ * // Watch data-theme attribute
1868
+ * attributes: ['data-theme']
1869
+ *
1870
+ * // Watch color-scheme attribute
1871
+ * attributes: ['color-scheme']
1872
+ *
1873
+ * // Watch class changes
1874
+ * attributes: ['class']
1875
+ * ```
1876
+ */
1877
+ attributes: string[]
1878
+
1879
+ /**
1880
+ * A function that determines if dark mode is active based on the target element's attributes.
1881
+ *
1882
+ * @remarks
1883
+ * The function receives an object containing the current values of all monitored attributes,
1884
+ * where the keys are attribute names and values are the attribute values.
1885
+ *
1886
+
1887
+ * @param attributes - Object containing the current values of monitored attributes
1888
+ * @returns True if dark mode is detected, false otherwise
1889
+ * ```ts
1890
+ * // Check data-theme attribute
1891
+ * isDarkMode: (attributes) => attributes['data-theme'] === 'dark'
1892
+ *
1893
+ * // Check class for dark mode
1894
+ * isDarkMode: (attributes) => /\bdark\b/.test(attributes['class'])
1895
+ *
1896
+ * // Check color-scheme
1897
+ * isDarkMode: (attributes) => attributes['color-scheme'] === 'dark'
1898
+ * ```
1899
+ */
1900
+ isDarkMode?: (attributes: Record<string, string | null>) => boolean
1901
+
1902
+ /**
1903
+ * Optional callback function that is invoked whenever the color mode changes.
1904
+ *
1905
+ * This can be used to perform side effects or sync the color mode with other parts of your application.
1906
+ *
1907
+
1908
+ * @param colorMode - The new color mode value ('light' | 'dark')
1909
+ * ```ts
1910
+ * onChange: (colorMode) => {
1911
+ * console.log(`Color mode changed to: ${colorMode}`);
1912
+ * // Update other UI elements
1913
+ * }
1914
+ * ```
1915
+ */
1916
+ onChange?: (colorMode: string) => void
1917
+ }
1918
+
1919
+ export declare interface SyntaxHighlighterTheme {
1920
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1921
+ lightTheme?: any
1922
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
1923
+ darkTheme?: any
1924
+ }
1925
+
1926
+ declare interface TextField extends BaseFormField {
1927
+ inputType: 'email' | 'text' | 'textarea'
1928
+ defaultValue?: string
1929
+ placeholder?: string
1930
+ }
1931
+
1932
+ export declare interface TopLevelHeading {
1933
+ anchor?: string | null
1934
+ url?: string | null
1935
+ content: string
1936
+ isMatch?: boolean
1937
+ }
1938
+
1939
+ export declare interface TransformedSource {
1940
+ /**
1941
+ * ID of the source.
1942
+ */
1943
+ id?: string
1944
+ /**
1945
+ * Title of the source.
1946
+ */
1947
+ title: string
1948
+ /**
1949
+ * URL of the source.
1950
+ */
1951
+ url: string
1952
+ /**
1953
+ * Description of the source.
1954
+ */
1955
+ description?: string
1956
+ /**
1957
+ * Breadcrumbs for the source.
1958
+ * ```ts
1959
+ * breadcrumbs: ['Subpath', 'Page']
1960
+ * ```
1961
+ */
1962
+ breadcrumbs?: string[]
1963
+ /**
1964
+ * Tabs where this source shows up. (Only for searchResultsItem)
1965
+ * ```ts
1966
+ * tabs: ['Docs']
1967
+ * tabs: ['Docs', 'API']
1968
+ * ```
1969
+ * You can also specify different breadcrumbs for specific tab.
1970
+ *
1971
+ * ```ts
1972
+ * tabs: ['Docs', ['API', { breadcrumbs: ['Guides', 'API'] }]]
1973
+ * ```
1974
+ */
1975
+ tabs?: (SourceTab | string)[]
1976
+ /**
1977
+ * Icon of the source.
1978
+ * ```ts
1979
+ * icon: { builtIn: 'LuBookOpen' }
1980
+ * icon: { custom: 'https://example.com/icon.svg' }
1981
+ * ```
1982
+ */
1983
+ icon: InkeepCustomIcon
1984
+ /**
1985
+ * Whether to open the source in a new tab.
1986
+ */
1987
+ shouldOpenInNewTab?: boolean
1988
+ /**
1989
+ * Search query params to append to the URL.
1990
+ * If you want to know if the source is from chat or search, you can append the source type to the URL.
1991
+ * ```ts
1992
+ * appendToUrl: { from: 'chatSourceItem' }
1993
+ * ```
1994
+ */
1995
+ appendToUrl?: UrlQueryParam
1996
+ /**
1997
+ * Type of the source.
1998
+ */
1999
+ type: string
2000
+ /**
2001
+ * Tag to append to the source.
2002
+ */
2003
+ tag?: string
2004
+ }
2005
+
2006
+ export declare type TransformSource = (
2007
+ source: SourceItem,
2008
+ type: TransformSourceType,
2009
+ opts?: TransformSourceOptions,
2010
+ ) => Partial<TransformedSource>
2011
+
2012
+ export declare interface TransformSourceOptions {
2013
+ organizationDisplayName?: string
2014
+ tabs?: InkeepSearchSettings['tabs']
2015
+ }
2016
+
2017
+ export declare type TransformSourceType = 'chatSourceItem' | 'searchResultItem'
2018
+
2019
+ export declare type UrlQueryParam = Record<string, string>
2020
+
2021
+ export declare interface UseColorModeProps {
2022
+ /** List of all available colorMode names */
2023
+ colorModes: string[]
2024
+ /** Forced colorMode name for the current page */
2025
+ forcedColorMode?: string
2026
+ /** Update the colorMode */
2027
+ setColorMode: (colorMode: string) => void
2028
+ /** Active colorMode name */
2029
+ colorMode?: string
2030
+ /** If `enableSystem` is true and the active colorMode is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `colorMode` */
2031
+ resolvedColorMode?: string
2032
+ /** If enableSystem is true, returns the System colorMode preference ("dark" or "light"), regardless what the active colorMode is */
2033
+ systemColorMode?: 'dark' | 'light'
2034
+ }
2035
+
2036
+ export declare interface UserEscalationIndicatedEvent {
2037
+ eventName: 'user_escalation_indicated'
2038
+ properties: {
2039
+ escalationType: 'downvote' | 'get_help_option' | 'contact_us' | 'support_form'
2040
+ getHelpOption?: GetHelpOption
2041
+ getHelpOptionName?: string
2042
+ conversationId?: string
2043
+ }
2044
+ }
2045
+
2046
+ export declare interface UserMessageSubmittedEvent {
2047
+ eventName: 'user_message_submitted'
2048
+ properties: {
2049
+ // message: Message
2050
+ conversationId?: string
2051
+ }
2052
+ }
2053
+
2054
+ export declare type UserProperties = {
2055
+ /**
2056
+ * The user ID.
2057
+ */
2058
+ id?: string
2059
+ /**
2060
+ * The user email.
2061
+ */
2062
+ email?: string
2063
+ /**
2064
+ * The user name.
2065
+ */
2066
+ name?: string
2067
+ /**
2068
+ * The user cohorts.
2069
+ */
2070
+ cohorts?: string[]
2071
+ } & Record<string, unknown>
2072
+
2073
+ export declare interface UserProvidedColorScheme {
2074
+ textBold?: string
2075
+ textSubtle?: string
2076
+ lighter?: string
2077
+ light?: string
2078
+ lightSubtle?: string
2079
+ medium?: string
2080
+ mediumSubtle?: string
2081
+ strongerLight?: string
2082
+ strong?: string
2083
+ stronger?: string
2084
+ textColorOnPrimary?: string
2085
+ }
2086
+
2087
+ export declare interface UserTheme extends Partial<IkpTheme> {
2088
+ /**
2089
+ * Whether to disable loading the default font.
2090
+ * @default false
2091
+ */
2092
+ disableLoadingDefaultFont?: boolean
2093
+ /**
2094
+ * The syntax highlighter theme configuration for code blocks.
2095
+ * Allows setting different themes for light and dark modes.
2096
+ * ```ts
2097
+ * syntaxHighlighter: {
2098
+ * lightTheme: themes.github,
2099
+ * darkTheme: themes.dracula
2100
+ * }
2101
+ * ```
2102
+ */
2103
+ syntaxHighlighter?: SyntaxHighlighterTheme
2104
+
2105
+ /**
2106
+ * The primary colors used to generate the color scheme.
2107
+ * These colors will be used to create variations for different UI states.
2108
+ * ```ts
2109
+ * primaryColors: {
2110
+ * primary: '#26D6FF',
2111
+ * secondary: '#6366F1'
2112
+ * }
2113
+ * ```
2114
+ */
2115
+ primaryColors?: UserProvidedColorScheme
2116
+
2117
+ /**
2118
+ * The class name for the container that holds CSS variables.
2119
+ * This class will be added to a wrapper div that provides theming context.
2120
+ *
2121
+ * @default 'ikp-variables'
2122
+ */
2123
+ varsClassName?: string
2124
+
2125
+ /**
2126
+ * Custom styles to be injected into the widget.
2127
+ * Supports both inline styles and external stylesheets/resources.
2128
+ * Styles are uniquely identified by their key to prevent duplicates.
2129
+ * ```ts
2130
+ * styles: [
2131
+ * // External stylesheet or font
2132
+ * {
2133
+ * key: 'google-fonts',
2134
+ * type: 'link',
2135
+ * value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
2136
+ * },
2137
+ * // Custom CSS rules
2138
+ * {
2139
+ * key: 'custom-theme',
2140
+ * type: 'style',
2141
+ * value: `
2142
+ * .ikp-ai-chat-message {
2143
+ * border-radius: 8px;
2144
+ * padding: 12px;
2145
+ * }
2146
+ * [data-theme='dark'] .ikp-ai-chat-message {
2147
+ * background: #2D3748;
2148
+ * }
2149
+ * `
2150
+ * }
2151
+ * ]
2152
+ * ```
2153
+ */
2154
+ styles?: Style[]
2155
+ }
2156
+
2157
+ /** Adapted from https://github.com/pacocoursey/next-theme/blob/a385b8d865bbb317ff73a5b6c1319ae566f7d6f1/src/types.ts */
2158
+
2159
+ declare interface ValueObject {
2160
+ [colorModeName: string]: string
2161
+ }
2162
+
2163
+ export declare type WidgetEvent =
2164
+ | ModalOpenedEvent
2165
+ | ModalClosedEvent
2166
+ | ChatBubbleOpenedEvent
2167
+ | ChatBubbleClosedEvent
2168
+
2169
+ export declare interface WidgetView {
2170
+ /**
2171
+ * Callback fired when the user toggles between chat and search views.
2172
+ *
2173
+ * The parent component can use this
2174
+ * to coordinate showing/hiding the appropriate view.
2175
+ */
2176
+ onToggleView?: (opts: { view: ModalViewTypes; query?: string; autoSubmit?: boolean }) => void
2177
+ /**
2178
+ * The label for the Ask AI button.
2179
+ */
2180
+ askAILabel?: string
2181
+ /**
2182
+ * The label for the Search button.
2183
+ */
2184
+ searchLabel?: string
2185
+ /**
2186
+ * The label for the Ask AI card.
2187
+ */
2188
+ askAICardLabel?: string
2189
+ }
2190
+
2191
+ /**
2192
+ * Workflow defines the interaction steps for the AI bot.
2193
+ */
2194
+ export declare interface Workflow {
2195
+ id: string
2196
+ displayName: string
2197
+ goals: string[]
2198
+ informationToCollect: WorkflowInformationToCollect[]
2199
+ botPersona?: string
2200
+ // userPersonna?: string;
2201
+ context?: string[]
2202
+ guidance?: string[]
2203
+ initialReplyMessage: string
2204
+ supportedInputs?: WorkflowInputTypes[]
2205
+ }
2206
+
2207
+ /**
2208
+ * BaseType is a base interface for data types.
2209
+ */
2210
+ declare interface WorkflowBaseContentType {
2211
+ type: string
2212
+ contentInputLabel: string // for serialization
2213
+ attachmentIcon?: InkeepCustomIcon // icon next to the title in the attachment item
2214
+ }
2215
+
2216
+ /**
2217
+ * WorkflowInputType defines the type of attachments in a Workflow.
2218
+ */
2219
+ export declare interface WorkflowBaseInputTypes {
2220
+ id: string
2221
+ type: string
2222
+ displayName: string // button label
2223
+ }
2224
+
2225
+ export declare interface WorkflowCodeContentType extends WorkflowBaseContentType {
2226
+ type: 'CODE'
2227
+ language: string
2228
+ }
2229
+
2230
+ /**
2231
+ * WorkflowFunctionalMultiInput represents a function to be called when the attachment is invoked.
2232
+ */
2233
+ export declare interface WorkflowFunctionalMultiInput extends WorkflowBaseInputTypes {
2234
+ type: 'FUNCTIONAL_MULTI_ATTACHMENT'
2235
+ onInvoke: (
2236
+ workflow: Workflow,
2237
+ selectedInputType: WorkflowInputTypes,
2238
+ callback: (messageAttachments: MessageAttachment[]) => void,
2239
+ currentMessageAttachments: MessageAttachment[],
2240
+ ) => void
2241
+ }
2242
+
2243
+ export declare interface WorkflowInformationToCollect {
2244
+ description: string
2245
+ required: boolean
2246
+ }
2247
+
2248
+ /**
2249
+ * WorkflowInputTypes represents possible ways of collecting attachments in a Workflow.
2250
+ */
2251
+ export declare type WorkflowInputTypes = WorkflowFunctionalMultiInput | WorkflowModalSingleInput
2252
+
2253
+ export declare interface WorkflowModalProps {
2254
+ titleInputLabel?: string // defaults to 'Title'
2255
+ modalHelpText?: string // help text for the modal
2256
+ modalHelpElement?: React.ReactElement // help element for the modal
2257
+ }
2258
+
2259
+ /**
2260
+ * WorkflowModalSingleInput represents a modal input type.
2261
+ */
2262
+ export declare interface WorkflowModalSingleInput extends WorkflowBaseInputTypes {
2263
+ type: 'MODAL'
2264
+ contentType: MessageAttachmentContentType
2265
+ workflowModalProps?: WorkflowModalProps
2266
+ }
2267
+
2268
+ export declare interface WorkflowTextContentType extends WorkflowBaseContentType {
2269
+ type: 'text'
2270
+ }
2271
+
2272
+ export { }
2273
+
2274
+
2275
+ declare global {
2276
+ var Inkeep: import('@inkeep/agents-ui/types').InkeepJS;
2277
+ interface Window {
2278
+ Inkeep: import('@inkeep/agents-ui/types').InkeepJS;
2279
+ }
2280
+ }