@inkeep/cxkit-types 0.0.0-dev-20250221234142
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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.d.ts +1704 -0
- package/package.json +49 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1704 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { HTMLProps } from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare interface AIChatActionButtonLabels {
|
|
6
|
+
/**
|
|
7
|
+
* Text shown on the button that clears the chat history.
|
|
8
|
+
* @example "Clear Chat" or "Start Over"
|
|
9
|
+
*/
|
|
10
|
+
clearButtonLabel?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Text shown on the button that generates a shareable chat link.
|
|
13
|
+
* @example "Share Chat" or "Get Link"
|
|
14
|
+
*/
|
|
15
|
+
shareButtonLabel?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text shown on the button that opens the help options menu.
|
|
18
|
+
* @example "Get Help" or "Support Options"
|
|
19
|
+
*/
|
|
20
|
+
getHelpButtonLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Text shown on the button that stops the AI from generating a response.
|
|
23
|
+
* @example "Stop" or "Cancel Response"
|
|
24
|
+
*/
|
|
25
|
+
stopButtonLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Text shown on the button that copies the chat transcript.
|
|
28
|
+
* @example "Copy Chat" or "Copy Transcript"
|
|
29
|
+
*/
|
|
30
|
+
copyChatButtonLabel?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare interface AIChatBotResponseReceivedEvent {
|
|
34
|
+
eventName: 'chat_message_bot_response_received';
|
|
35
|
+
properties: {
|
|
36
|
+
messages: Message[];
|
|
37
|
+
messageId: string;
|
|
38
|
+
question: string;
|
|
39
|
+
responseMessage: Message;
|
|
40
|
+
linksUsedInResponse: SourceItem[];
|
|
41
|
+
workflowId?: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare interface AIChatDisclaimerSettings {
|
|
46
|
+
/**
|
|
47
|
+
* Controls whether the disclaimer message is shown.
|
|
48
|
+
* Enable this when you need to display important notices or legal disclaimers.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
enabled?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The main text content of the disclaimer message.
|
|
54
|
+
* Should clearly communicate important information about AI usage or limitations.
|
|
55
|
+
* @example "AI responses are generated automatically and may require verification."
|
|
56
|
+
*/
|
|
57
|
+
label?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Additional information shown when hovering over the disclaimer.
|
|
60
|
+
* Use this to provide more detailed explanations or context.
|
|
61
|
+
*/
|
|
62
|
+
tooltip?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare interface AIChatFunctions {
|
|
66
|
+
/**
|
|
67
|
+
* Programmatically sends a message in the chat.
|
|
68
|
+
* @param message Optional message text. If omitted, sends the current input value.
|
|
69
|
+
*/
|
|
70
|
+
submitMessage: (message?: string) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Programmatically updates the text in the chat input field.
|
|
73
|
+
* @param message The new message text to set
|
|
74
|
+
*/
|
|
75
|
+
updateInputMessage: (message: string) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Resets the chat to its initial state.
|
|
78
|
+
* Removes all messages and resets any active workflows.
|
|
79
|
+
*/
|
|
80
|
+
clearChat: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* Displays a form overlay in the chat interface.
|
|
83
|
+
* @param formConfig Configuration object defining the form's fields and behavior
|
|
84
|
+
*/
|
|
85
|
+
openForm: (formConfig: FormConfig) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Programmatically sets focus to the chat input field.
|
|
88
|
+
* Useful after programmatic updates or when showing the chat interface.
|
|
89
|
+
*/
|
|
90
|
+
focusInput: () => void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare interface AIChatGetHelpOptionClickedEvent {
|
|
94
|
+
eventName: 'get_help_option_clicked';
|
|
95
|
+
properties: {
|
|
96
|
+
actionType?: ChatActionType;
|
|
97
|
+
name: string;
|
|
98
|
+
url?: string;
|
|
99
|
+
conversationId: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export declare interface AIChatHistoryClearedEvent {
|
|
104
|
+
eventName: 'chat_history_cleared';
|
|
105
|
+
properties: {
|
|
106
|
+
conversationId: string | null;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export declare interface AIChatMessageCopiedEvent {
|
|
111
|
+
eventName: 'chat_message_copied';
|
|
112
|
+
properties: {
|
|
113
|
+
messageId: string;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare interface AIChatMessageSubmittedEvent {
|
|
118
|
+
eventName: 'chat_message_submitted';
|
|
119
|
+
properties: {
|
|
120
|
+
messages: Message[];
|
|
121
|
+
messageId: string;
|
|
122
|
+
content: string;
|
|
123
|
+
workflowId?: string;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare interface AIChatResponseLinkOpenedEvent {
|
|
128
|
+
eventName: 'chat_response_link_opened';
|
|
129
|
+
properties: {
|
|
130
|
+
messageId: string;
|
|
131
|
+
title?: string;
|
|
132
|
+
url?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare interface AIChatResponseSourceItemClickedEvent {
|
|
137
|
+
eventName: 'chat_response_source_item_clicked';
|
|
138
|
+
properties: {
|
|
139
|
+
messageId: string;
|
|
140
|
+
sourceType: SourceItem['type'];
|
|
141
|
+
title?: string;
|
|
142
|
+
url?: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export declare interface AIChatShareButtonClickedEvent {
|
|
147
|
+
eventName: 'chat_share_button_clicked';
|
|
148
|
+
properties: {
|
|
149
|
+
sharedChatUrl: string;
|
|
150
|
+
sharedConversationId: string;
|
|
151
|
+
originalConversationId: string;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export declare interface AIChatSharedSessionLoadedEvent {
|
|
156
|
+
eventName: 'chat_shared_session_loaded';
|
|
157
|
+
properties: {
|
|
158
|
+
conversationId: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare interface AIChatThumbsDownFeedbackSubmittedEvent {
|
|
163
|
+
eventName: 'chat_thumbs_down_feedback_submitted';
|
|
164
|
+
properties: FeedbackProperties;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare interface AIChatThumbsUpFeedbackSubmittedEvent {
|
|
168
|
+
eventName: 'chat_thumbs_up_feedback_submitted';
|
|
169
|
+
properties: FeedbackProperties;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare interface AIChatToolCallActionClickedEvent {
|
|
173
|
+
eventName: 'toolcall_action_clicked';
|
|
174
|
+
properties: {
|
|
175
|
+
actionType: ChatActionType;
|
|
176
|
+
conversationId: string;
|
|
177
|
+
question?: string;
|
|
178
|
+
answer?: string;
|
|
179
|
+
answerId?: string;
|
|
180
|
+
workflowId?: string;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export declare interface Analytics {
|
|
185
|
+
/**
|
|
186
|
+
* Whether to opt out of analytical cookies.
|
|
187
|
+
* @default false
|
|
188
|
+
*/
|
|
189
|
+
optOutAnalyticalCookies?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Whether to opt out of all analytics.
|
|
192
|
+
* @default false
|
|
193
|
+
*/
|
|
194
|
+
optOutAllAnalytics?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Whether to opt out of functional cookies.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
optOutFunctionalCookies?: boolean;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export declare type AnswerConfidence = 'very_confident' | 'somewhat_confident' | 'not_confident' | 'no_sources' | 'other';
|
|
203
|
+
|
|
204
|
+
export declare interface AssistantMessage extends MessageBase {
|
|
205
|
+
role: 'assistant';
|
|
206
|
+
links: SourceItem[];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
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' | 'LuRepeat' | 'LuThumbsDown' | 'LuThumbsUp' | 'LuUsers' | 'LuUser' | 'LuArrowUpRight' | 'LuBookOpen' | 'LuChevronDown' | 'LuLoaderCircle' | 'FiEdit' | 'LuSparkles';
|
|
210
|
+
|
|
211
|
+
export declare interface BaseFormField {
|
|
212
|
+
name: string;
|
|
213
|
+
label: string;
|
|
214
|
+
required?: boolean;
|
|
215
|
+
isHidden?: boolean;
|
|
216
|
+
description?: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare type ChatAction = InvokeCallbackAction | OpenFormAction | OpenUrlAction;
|
|
220
|
+
|
|
221
|
+
export declare type ChatActionType = ChatAction['type'];
|
|
222
|
+
|
|
223
|
+
export declare type ChatEvent = AIChatBotResponseReceivedEvent | AIChatMessageSubmittedEvent | AIChatSharedSessionLoadedEvent | AIChatThumbsDownFeedbackSubmittedEvent | AIChatThumbsUpFeedbackSubmittedEvent | AIChatHistoryClearedEvent | AIChatMessageCopiedEvent | AIChatGetHelpOptionClickedEvent | AIChatToolCallActionClickedEvent | AIChatShareButtonClickedEvent | AIChatResponseSourceItemClickedEvent | AIChatResponseLinkOpenedEvent | CodeBlockCopiedEvent;
|
|
224
|
+
|
|
225
|
+
export declare enum ChatModel {
|
|
226
|
+
/**
|
|
227
|
+
* Inkeep's specialized model for technical Q&A interactions.
|
|
228
|
+
* Optimized for developer documentation and API support use cases.
|
|
229
|
+
*/
|
|
230
|
+
QA_EXPERT = "inkeep-qa-expert"
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare interface CheckboxField extends BaseFormField {
|
|
234
|
+
inputType: 'CHECKBOX';
|
|
235
|
+
defaultValue?: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export declare interface Client {
|
|
239
|
+
currentUrl: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export declare type CloseFormAction = 'BACK_TO_CHAT' | 'CLOSE_MODAL';
|
|
243
|
+
|
|
244
|
+
export declare interface CodeBlockCopiedEvent {
|
|
245
|
+
eventName: 'chat_code_block_copied';
|
|
246
|
+
properties: {
|
|
247
|
+
conversationId: string;
|
|
248
|
+
language: string;
|
|
249
|
+
code: string;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare interface ColorMode extends Omit<ColorModeProviderProps, 'children' | 'rootId' | 'shadowHostId'> {
|
|
254
|
+
/**
|
|
255
|
+
* Configuration for syncing the widget's color mode with an external element.
|
|
256
|
+
*
|
|
257
|
+
* This allows the widget to automatically match its color mode (light/dark) with your application's theme.
|
|
258
|
+
* The widget will observe changes to specified attributes on a target element and update its appearance accordingly.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```ts
|
|
262
|
+
* colorMode: {
|
|
263
|
+
* sync: {
|
|
264
|
+
* // Watch the document root for theme changes
|
|
265
|
+
* target: document.documentElement,
|
|
266
|
+
* // Monitor the data-theme attribute
|
|
267
|
+
* attributes: ['data-theme'],
|
|
268
|
+
* // Determine dark mode based on attribute value
|
|
269
|
+
* isDarkMode: (attrs) => attrs['data-theme'] === 'dark',
|
|
270
|
+
* // Optional callback when color mode changes
|
|
271
|
+
* onChange: (mode) => console.log('Color mode changed to:', mode)
|
|
272
|
+
* }
|
|
273
|
+
* }
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
sync?: SyncColorMode;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export declare interface ColorModeProviderProps {
|
|
280
|
+
/** List of all available colorMode names */
|
|
281
|
+
colorModes?: string[];
|
|
282
|
+
/** Forced colorMode name for the current page */
|
|
283
|
+
forcedColorMode?: string;
|
|
284
|
+
/** Whether to switch between dark and light colorModes based on prefers-color-scheme */
|
|
285
|
+
enableSystem?: boolean;
|
|
286
|
+
/** Disable all CSS transitions when switching colorModes */
|
|
287
|
+
disableTransitionOnChange?: boolean;
|
|
288
|
+
/** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
|
|
289
|
+
enableColorScheme?: boolean;
|
|
290
|
+
/** Key used to store colorMode setting in localStorage */
|
|
291
|
+
storageKey?: string;
|
|
292
|
+
/** Default colorMode name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default colorMode is light */
|
|
293
|
+
defaultColorMode?: string;
|
|
294
|
+
/** HTML attribute modified based on the active colorMode. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */
|
|
295
|
+
attribute?: 'class' | (string & {});
|
|
296
|
+
/** Mapping of colorMode name to HTML attribute value. Object where key is the colorMode name and value is the attribute value */
|
|
297
|
+
value?: ValueObject;
|
|
298
|
+
/** Nonce string to pass to the inline script for CSP headers */
|
|
299
|
+
nonce?: string;
|
|
300
|
+
shadowHostId?: string;
|
|
301
|
+
rootId?: string;
|
|
302
|
+
children?: React.ReactNode;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare interface CommonProperties {
|
|
306
|
+
conversationId: string;
|
|
307
|
+
interactionType: any;
|
|
308
|
+
tags: string[];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export declare interface ConversationBody {
|
|
312
|
+
visibility?: 'public' | 'private';
|
|
313
|
+
messages: Message[];
|
|
314
|
+
tags: string[];
|
|
315
|
+
userProperties: UserProperties;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export declare interface ConversationMessage {
|
|
319
|
+
id: string;
|
|
320
|
+
type: 'openai';
|
|
321
|
+
externalId: string;
|
|
322
|
+
externalUrl: string;
|
|
323
|
+
conversationId: string;
|
|
324
|
+
createdAt: string;
|
|
325
|
+
updatedAt: string;
|
|
326
|
+
role: 'assistant' | 'system' | 'user';
|
|
327
|
+
content: string;
|
|
328
|
+
name: string;
|
|
329
|
+
links: SourceItem[];
|
|
330
|
+
properties: Record<string, unknown>;
|
|
331
|
+
userProperties: Record<string, unknown>;
|
|
332
|
+
tool_calls: unknown[];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export declare interface ConversationResponse {
|
|
336
|
+
id: string;
|
|
337
|
+
externalId: string;
|
|
338
|
+
externalUrl: string;
|
|
339
|
+
type: 'openai' | 'support_ticket';
|
|
340
|
+
createdAt: string;
|
|
341
|
+
updatedAt: string;
|
|
342
|
+
projectId: string;
|
|
343
|
+
integrationId: string;
|
|
344
|
+
properties: Record<string, unknown>;
|
|
345
|
+
userProperties: Record<string, unknown>;
|
|
346
|
+
tags: string[];
|
|
347
|
+
messages: ConversationMessage[];
|
|
348
|
+
messagesOpenAIFormat: unknown[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export declare type CustomIconMap = {
|
|
352
|
+
[K in keyof CustomIcons]?: InkeepCustomIcon;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export declare interface CustomIcons {
|
|
356
|
+
search: string;
|
|
357
|
+
thumbsUp: string;
|
|
358
|
+
thumbsDown: string;
|
|
359
|
+
messageCopy: string;
|
|
360
|
+
messageCopied: string;
|
|
361
|
+
messageRevise: string;
|
|
362
|
+
codeCopy: string;
|
|
363
|
+
codeCopied: string;
|
|
364
|
+
openLinkInNewTab: string;
|
|
365
|
+
openLinkInSameTab: string;
|
|
366
|
+
breadcrumbSeparator: string;
|
|
367
|
+
switchToSearch: string;
|
|
368
|
+
switchToChat: string;
|
|
369
|
+
chatSubmit: string;
|
|
370
|
+
close: string;
|
|
371
|
+
info: string;
|
|
372
|
+
command: string;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export declare type DeepPartial<T> = {
|
|
376
|
+
[P in keyof T]?: T[P] extends Record<string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export declare type EntityType = 'conversation' | 'message' | 'search';
|
|
380
|
+
|
|
381
|
+
declare type ExtendPropertiesWithCommon<T> = T extends {
|
|
382
|
+
properties: infer P;
|
|
383
|
+
} ? T & {
|
|
384
|
+
properties: P & CommonProperties;
|
|
385
|
+
} : T;
|
|
386
|
+
|
|
387
|
+
export declare type FeebackReason = {
|
|
388
|
+
label: string;
|
|
389
|
+
details: string;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export declare interface FeedbackBody {
|
|
393
|
+
type: FeedbackType;
|
|
394
|
+
messageId: string;
|
|
395
|
+
createdAt: string;
|
|
396
|
+
reasons?: {
|
|
397
|
+
label: string;
|
|
398
|
+
details: string;
|
|
399
|
+
}[] | null;
|
|
400
|
+
userProperties: UserProperties;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export declare type FeedbackItemType = keyof MessageFeedback;
|
|
404
|
+
|
|
405
|
+
declare interface FeedbackProperties {
|
|
406
|
+
conversationId: string;
|
|
407
|
+
messageId: string;
|
|
408
|
+
question: string;
|
|
409
|
+
answer: string;
|
|
410
|
+
reasons: FeebackReason[];
|
|
411
|
+
workflowId?: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export declare type FeedbackType = 'positive' | 'negative';
|
|
415
|
+
|
|
416
|
+
export declare type FieldValues = Record<string, any>;
|
|
417
|
+
|
|
418
|
+
declare interface FileField extends BaseFormField {
|
|
419
|
+
inputType: 'FILE';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export declare interface FormButtons {
|
|
423
|
+
submit: {
|
|
424
|
+
label?: string;
|
|
425
|
+
onSubmit: SubmitCallback;
|
|
426
|
+
};
|
|
427
|
+
close?: {
|
|
428
|
+
action: CloseFormAction;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export declare interface FormConfig {
|
|
433
|
+
heading?: string;
|
|
434
|
+
description?: string;
|
|
435
|
+
buttons: FormButtons;
|
|
436
|
+
fields: FormField[];
|
|
437
|
+
successView: SuccessView;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export declare type FormField = CheckboxField | FileField | SelectField | TextField | IncludeChatSessionField;
|
|
441
|
+
|
|
442
|
+
export declare type FormInputType = NonNullable<FormField['inputType']>;
|
|
443
|
+
|
|
444
|
+
export declare interface GetHelpCallToAction {
|
|
445
|
+
icon?: InkeepCustomIcon;
|
|
446
|
+
name: string;
|
|
447
|
+
pinToToolbar?: boolean;
|
|
448
|
+
action: ChatAction;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare enum GitHubIssueState {
|
|
452
|
+
Closed = "CLOSED",
|
|
453
|
+
Open = "OPEN"
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export declare type IkpChatAction = GetHelpCallToAction | ToolCallAction;
|
|
457
|
+
|
|
458
|
+
export declare type IkpTheme = DeepPartial<StrictIkpTheme>;
|
|
459
|
+
|
|
460
|
+
export declare type IkpThemeCategory = keyof StrictIkpTheme;
|
|
461
|
+
|
|
462
|
+
export declare type IkpThemeEntry = [keyof IkpTheme, Record<string, unknown>][];
|
|
463
|
+
|
|
464
|
+
export declare interface IncludeChatSessionField extends BaseFormField {
|
|
465
|
+
_type: 'INCLUDE_CHAT_SESSION';
|
|
466
|
+
inputType?: 'CHECKBOX';
|
|
467
|
+
defaultValue?: boolean;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export declare interface InkeepAIChatSettings extends ToolConfig {
|
|
471
|
+
/**
|
|
472
|
+
* The placeholder text to display in the chat input field when empty.
|
|
473
|
+
* Use this to provide guidance on what kind of questions users can ask.
|
|
474
|
+
* @example "Ask me anything about our API documentation..."
|
|
475
|
+
*/
|
|
476
|
+
placeholder?: string;
|
|
477
|
+
/**
|
|
478
|
+
* A welcome message shown at the start of a new chat session.
|
|
479
|
+
* Supports markdown formatting for rich text styling.
|
|
480
|
+
* Use this to introduce the bot's capabilities and set expectations.
|
|
481
|
+
* @example "👋 Hi! I'm here to help you with technical questions about our API..."
|
|
482
|
+
*/
|
|
483
|
+
introMessage?: string;
|
|
484
|
+
/**
|
|
485
|
+
* The name of the product/service/topic that the chat assistant specializes in.
|
|
486
|
+
* This helps contextualize the chat experience for users.
|
|
487
|
+
* If not provided, defaults to the organization name from base settings.
|
|
488
|
+
* @example "MongoDB Atlas" or "React Router"
|
|
489
|
+
*/
|
|
490
|
+
chatSubjectName?: string;
|
|
491
|
+
/**
|
|
492
|
+
* The display name for the AI assistant in the chat interface.
|
|
493
|
+
* Choose a name that reflects the assistant's role and your brand.
|
|
494
|
+
* @example "Atlas Assistant" or "DevBot"
|
|
495
|
+
*/
|
|
496
|
+
botName?: string;
|
|
497
|
+
/**
|
|
498
|
+
* URL to the bot's avatar image for light mode.
|
|
499
|
+
* Should be a square image, recommended size 40x40px.
|
|
500
|
+
* Supports common image formats (PNG, JPG, SVG).
|
|
501
|
+
*/
|
|
502
|
+
botAvatarSrcUrl?: string;
|
|
503
|
+
/**
|
|
504
|
+
* URL to the bot's avatar image for dark mode.
|
|
505
|
+
* Should be a square image, recommended size 40x40px.
|
|
506
|
+
*/
|
|
507
|
+
botAvatarDarkSrcUrl?: string;
|
|
508
|
+
/**
|
|
509
|
+
* URL to the user's avatar image in the chat interface.
|
|
510
|
+
* Should be a square image, recommended size 40x40px.
|
|
511
|
+
* Falls back to a default user icon if not provided.
|
|
512
|
+
*/
|
|
513
|
+
userAvatarSrcUrl?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Controls whether links in chat messages open in new browser tabs.
|
|
516
|
+
* Enable this to help users maintain their chat context when following links.
|
|
517
|
+
* @default true
|
|
518
|
+
*/
|
|
519
|
+
shouldOpenLinksInNewTab?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Custom heading text for the quick questions section.
|
|
522
|
+
* Use this to better describe your suggested queries.
|
|
523
|
+
* @example "Common Questions" or "Try asking about..."
|
|
524
|
+
*/
|
|
525
|
+
quickQuestionsLabel?: string;
|
|
526
|
+
/**
|
|
527
|
+
* A list of pre-written questions users can click to quickly start a conversation.
|
|
528
|
+
* These should reflect common use cases and help users understand the bot's capabilities.
|
|
529
|
+
* @example ["How do I reset my password?", "What are the API rate limits?"]
|
|
530
|
+
*/
|
|
531
|
+
quickQuestions?: string[];
|
|
532
|
+
/**
|
|
533
|
+
* Whether to visually emphasize the first quick question.
|
|
534
|
+
* Use this to draw attention to the most important or common query.
|
|
535
|
+
*/
|
|
536
|
+
shouldHighlightFirstQuickQuestion?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* Enables the ability to share chat conversations via URL.
|
|
539
|
+
* Useful for allowing users to share helpful conversations with teammates.
|
|
540
|
+
*/
|
|
541
|
+
isChatSharingEnabled?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* The base URL path used when generating shareable chat links.
|
|
544
|
+
* Should match your application's routing structure.
|
|
545
|
+
* @example "/shared-chats/" or "/support/conversations/"
|
|
546
|
+
*/
|
|
547
|
+
shareChatUrlBasePath?: string;
|
|
548
|
+
/**
|
|
549
|
+
* Controls the visibility of the copy chat button.
|
|
550
|
+
* Allows users to copy the entire chat transcript to their clipboard.
|
|
551
|
+
*/
|
|
552
|
+
shouldShowCopyChatButton?: boolean;
|
|
553
|
+
/**
|
|
554
|
+
* Unique identifier for loading a specific chat session.
|
|
555
|
+
* Use this to restore a previous conversation state.
|
|
556
|
+
*/
|
|
557
|
+
chatId?: string;
|
|
558
|
+
/**
|
|
559
|
+
* When enabled, prevents users from sending new messages.
|
|
560
|
+
* Useful for displaying archived or shared chat sessions.
|
|
561
|
+
* @default false
|
|
562
|
+
*/
|
|
563
|
+
isViewOnly?: boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Configuration for the chat's disclaimer message.
|
|
566
|
+
* Use this to display important notices about AI limitations or data usage.
|
|
567
|
+
*/
|
|
568
|
+
disclaimerSettings?: AIChatDisclaimerSettings;
|
|
569
|
+
/**
|
|
570
|
+
* Callback function triggered whenever the user modifies their input message.
|
|
571
|
+
* @param message The current content of the input field
|
|
572
|
+
*/
|
|
573
|
+
onInputMessageChange?: (message: string) => void;
|
|
574
|
+
/**
|
|
575
|
+
* React ref for accessing the chat component's methods.
|
|
576
|
+
* Enables programmatic control of chat functions from parent components.
|
|
577
|
+
*/
|
|
578
|
+
chatFunctionsRef?: React.Ref<AIChatFunctions>;
|
|
579
|
+
/**
|
|
580
|
+
* Array of actions available in the "Get Help" menu.
|
|
581
|
+
* Use this to provide alternative support options like contact forms or documentation links.
|
|
582
|
+
*/
|
|
583
|
+
getHelpCallToActions?: GetHelpCallToAction[];
|
|
584
|
+
/**
|
|
585
|
+
* System-level instructions that guide the AI's behavior and responses.
|
|
586
|
+
* Use these to define the assistant's personality, knowledge boundaries, and response style.
|
|
587
|
+
*/
|
|
588
|
+
prompts?: string[];
|
|
589
|
+
/**
|
|
590
|
+
* Custom heading text for the workflows section.
|
|
591
|
+
* Use this to describe available automated processes or guided flows.
|
|
592
|
+
*/
|
|
593
|
+
workflowsHeader?: string;
|
|
594
|
+
/**
|
|
595
|
+
* Collection of interactive workflows that can be triggered during chat.
|
|
596
|
+
* These can guide users through complex processes or data collection.
|
|
597
|
+
*/
|
|
598
|
+
workflows?: Workflow[];
|
|
599
|
+
/**
|
|
600
|
+
* Custom labels for the chat interface's action buttons.
|
|
601
|
+
* Use this for internationalization or to better match your application's terminology.
|
|
602
|
+
*/
|
|
603
|
+
actionButtonLabels?: AIChatActionButtonLabels;
|
|
604
|
+
/**
|
|
605
|
+
* Specifies which AI model to use for generating responses.
|
|
606
|
+
* Different models may have different capabilities or specializations.
|
|
607
|
+
* @default 'inkeep-qa-expert'
|
|
608
|
+
*/
|
|
609
|
+
model?: `${ChatModel}`;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export declare interface InkeepBaseSettings {
|
|
613
|
+
/**
|
|
614
|
+
* The API key to use for authenticating with Inkeep's services.
|
|
615
|
+
* Required for accessing Inkeep's API endpoints.
|
|
616
|
+
*/
|
|
617
|
+
apiKey?: string;
|
|
618
|
+
/**
|
|
619
|
+
* The display name of your organization that will be shown in various UI elements.
|
|
620
|
+
* For example, this may appear in chat messages or headers.
|
|
621
|
+
*/
|
|
622
|
+
organizationDisplayName?: string;
|
|
623
|
+
/**
|
|
624
|
+
* The primary brand color used throughout the widget UI.
|
|
625
|
+
* This color will be used to generate a cohesive color scheme.
|
|
626
|
+
* Should be provided as a valid CSS color value (hex, rgb, etc).
|
|
627
|
+
*/
|
|
628
|
+
primaryBrandColor: string;
|
|
629
|
+
/**
|
|
630
|
+
* Settings to control the color mode (light/dark) behavior.
|
|
631
|
+
* Can be used to sync with your application's theme or set a forced color mode.
|
|
632
|
+
* @see ColorMode type for detailed configuration options
|
|
633
|
+
*/
|
|
634
|
+
colorMode?: ColorMode;
|
|
635
|
+
/**
|
|
636
|
+
* Theme customization settings for the widget.
|
|
637
|
+
* Allows customizing colors, typography, component styles, and more.
|
|
638
|
+
*/
|
|
639
|
+
theme?: UserTheme;
|
|
640
|
+
/**
|
|
641
|
+
* Custom icon overrides for the default icon set.
|
|
642
|
+
* Allows replacing any of the built-in icons with your own components.
|
|
643
|
+
*/
|
|
644
|
+
customIcons?: CustomIconMap;
|
|
645
|
+
/**
|
|
646
|
+
* Properties to identify and provide context about the current user.
|
|
647
|
+
* Used for personalization and analytics tracking.
|
|
648
|
+
* @see UserProperties interface for available fields
|
|
649
|
+
*/
|
|
650
|
+
userProperties?: UserProperties;
|
|
651
|
+
/**
|
|
652
|
+
* Authentication token for the current user.
|
|
653
|
+
* Used for authenticated API requests if required.
|
|
654
|
+
*/
|
|
655
|
+
userAuthToken?: string;
|
|
656
|
+
/**
|
|
657
|
+
* Callback function to handle analytics events from the widget.
|
|
658
|
+
* Receives InkeepCallbackEvent objects containing event details.
|
|
659
|
+
* @param event The analytics event object
|
|
660
|
+
*/
|
|
661
|
+
logEventCallback?: (event: InkeepCallbackEvent) => void;
|
|
662
|
+
/**
|
|
663
|
+
* Configuration for analytics behavior and tracking.
|
|
664
|
+
* Controls what events are tracked and how they are processed.
|
|
665
|
+
*/
|
|
666
|
+
analytics?: Analytics;
|
|
667
|
+
/**
|
|
668
|
+
* Custom base URL for analytics API endpoints.
|
|
669
|
+
* Useful when routing analytics requests through a proxy.
|
|
670
|
+
* Should include protocol (e.g., 'https://analytics.your-proxy.com')
|
|
671
|
+
*/
|
|
672
|
+
analyticsBaseUrl?: string;
|
|
673
|
+
/**
|
|
674
|
+
* Custom base URL for search and chat API endpoints.
|
|
675
|
+
* Useful when routing API requests through a proxy.
|
|
676
|
+
* Should include protocol (e.g., 'https://api.your-proxy.com')
|
|
677
|
+
*/
|
|
678
|
+
baseUrl?: string;
|
|
679
|
+
/**
|
|
680
|
+
* 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.
|
|
681
|
+
* @default false
|
|
682
|
+
*/
|
|
683
|
+
bypassChallenge?: boolean;
|
|
684
|
+
/**
|
|
685
|
+
* Function to transform source data before display.
|
|
686
|
+
* Allows customizing how source information is presented in the widget.
|
|
687
|
+
* @param source The original source data
|
|
688
|
+
* @returns The transformed source data
|
|
689
|
+
*/
|
|
690
|
+
transformSource?: TransformSource;
|
|
691
|
+
/**
|
|
692
|
+
* Environment setting for the widget.
|
|
693
|
+
* Affects API endpoints and debug behaviors.
|
|
694
|
+
* @default 'PRODUCTION'
|
|
695
|
+
*/
|
|
696
|
+
env?: 'DEVELOPMENT' | 'PRODUCTION';
|
|
697
|
+
/**
|
|
698
|
+
* Reference to the shadow DOM host element if using custom Shadow DOM.
|
|
699
|
+
* Required when embedding the widget within a Shadow DOM.
|
|
700
|
+
*/
|
|
701
|
+
shadowHost?: HTMLElement | null;
|
|
702
|
+
/**
|
|
703
|
+
* Reference to the root element where the widget is mounted.
|
|
704
|
+
* Used for positioning and event handling.
|
|
705
|
+
*/
|
|
706
|
+
rootElement?: HTMLElement | null;
|
|
707
|
+
/**
|
|
708
|
+
* Custom tags for widget identification.
|
|
709
|
+
* Used in analytics to segment and filter widget instances.
|
|
710
|
+
* Array of string identifiers.
|
|
711
|
+
*/
|
|
712
|
+
tags?: string[];
|
|
713
|
+
/**
|
|
714
|
+
* Instance of the Prism syntax highlighting library.
|
|
715
|
+
* Required for code block syntax highlighting functionality.
|
|
716
|
+
*/
|
|
717
|
+
prism?: any;
|
|
718
|
+
/**
|
|
719
|
+
* Query parameters to automatically append to URLs in the widget.
|
|
720
|
+
* Useful for tracking or maintaining context in navigation.
|
|
721
|
+
* Object mapping parameter names to values.
|
|
722
|
+
*/
|
|
723
|
+
appendQueryParamsToUrls?: UrlQueryParam;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export declare type InkeepCallbackEvent = InkeepEventWithCommon & {
|
|
727
|
+
userProperties: UserProperties;
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
export declare interface InkeepConfig {
|
|
731
|
+
/**
|
|
732
|
+
* The prefix to use for the widget.
|
|
733
|
+
* @default 'ikp'
|
|
734
|
+
*/
|
|
735
|
+
prefix?: string;
|
|
736
|
+
/**
|
|
737
|
+
* The type widget.
|
|
738
|
+
*/
|
|
739
|
+
interactionType: any;
|
|
740
|
+
/**
|
|
741
|
+
* Configuration for the chat.
|
|
742
|
+
*/
|
|
743
|
+
aiChatSettings: InkeepAIChatSettings & {
|
|
744
|
+
shouldAutoFocusInput?: boolean;
|
|
745
|
+
};
|
|
746
|
+
/**
|
|
747
|
+
* Configuration for the base settings.
|
|
748
|
+
*/
|
|
749
|
+
baseSettings: InkeepBaseSettings;
|
|
750
|
+
/**
|
|
751
|
+
* Configuration for the search settings.
|
|
752
|
+
*/
|
|
753
|
+
searchSettings: InkeepSearchSettings & {
|
|
754
|
+
shouldAutoFocusInput?: boolean;
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export declare type InkeepCustomIcon = {
|
|
759
|
+
builtIn: AvailableBuiltInIcons;
|
|
760
|
+
} | {
|
|
761
|
+
custom: string;
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
export declare type InkeepEvent = SearchEvent | ChatEvent | IntelligentFormEvent;
|
|
765
|
+
|
|
766
|
+
export declare type InkeepEventWithCommon = ExtendPropertiesWithCommon<InkeepEvent>;
|
|
767
|
+
|
|
768
|
+
export declare interface InkeepModalSettings {
|
|
769
|
+
/**
|
|
770
|
+
* Whether the modal is open.
|
|
771
|
+
*/
|
|
772
|
+
open?: boolean;
|
|
773
|
+
/**
|
|
774
|
+
* Callback fired when the modal open state changes.
|
|
775
|
+
*/
|
|
776
|
+
onOpenChange?: (open: boolean) => void;
|
|
777
|
+
/**
|
|
778
|
+
* The shortcut key.
|
|
779
|
+
*
|
|
780
|
+
* The key to trigger the modal when pressed with Cmd (Mac) / Ctrl (Windows).
|
|
781
|
+
*
|
|
782
|
+
* Set to `null` to disable the shortcut.
|
|
783
|
+
*
|
|
784
|
+
* @default 'k'
|
|
785
|
+
*/
|
|
786
|
+
shortcutKey?: string | null;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export declare interface InkeepSearchSettings {
|
|
790
|
+
/**
|
|
791
|
+
* The placeholder text to use.
|
|
792
|
+
* @default
|
|
793
|
+
* 'Search anything...' (desktop)
|
|
794
|
+
* 'Search' (mobile)
|
|
795
|
+
*/
|
|
796
|
+
placeholder?: string;
|
|
797
|
+
/**
|
|
798
|
+
* The default query to use.
|
|
799
|
+
* @default ''
|
|
800
|
+
*/
|
|
801
|
+
defaultQuery?: string;
|
|
802
|
+
/**
|
|
803
|
+
* Callback for when the search query changes.
|
|
804
|
+
*/
|
|
805
|
+
onQueryChange?: (query: string) => void;
|
|
806
|
+
/**
|
|
807
|
+
* The maximum number of hits to return.
|
|
808
|
+
* @default 40
|
|
809
|
+
*/
|
|
810
|
+
maximumHitsLimit?: number;
|
|
811
|
+
/**
|
|
812
|
+
* The time in milliseconds to wait triggering the search.
|
|
813
|
+
* @default 0
|
|
814
|
+
*/
|
|
815
|
+
debounceTime?: number;
|
|
816
|
+
/**
|
|
817
|
+
* Ref to the AIChat component's callable functions
|
|
818
|
+
*/
|
|
819
|
+
searchFunctionsRef?: React.Ref<SearchFunctions>;
|
|
820
|
+
/**
|
|
821
|
+
* Whether to open links in new tab.
|
|
822
|
+
* @default false
|
|
823
|
+
*/
|
|
824
|
+
shouldOpenLinksInNewTab?: boolean;
|
|
825
|
+
/**
|
|
826
|
+
* 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].
|
|
827
|
+
*
|
|
828
|
+
* Default tabs if none provided: All, Publications, PDFs, GitHub, Forums, Discord, Slack, StackOverflow
|
|
829
|
+
*
|
|
830
|
+
* Behavior:
|
|
831
|
+
* - Omit 'All' from tabs array to hide the All tab
|
|
832
|
+
* - Empty tabs array will show all results without tab UI
|
|
833
|
+
* - Tabs only appear when they have results, unless alwaysVisible is set
|
|
834
|
+
*
|
|
835
|
+
* @example
|
|
836
|
+
* ```ts
|
|
837
|
+
* // Basic tabs
|
|
838
|
+
* tabs: ['Publications', 'GitHub']
|
|
839
|
+
*
|
|
840
|
+
* // With alwaysVisible option
|
|
841
|
+
* tabs: [
|
|
842
|
+
* 'Publications',
|
|
843
|
+
* ['GitHub', { alwaysVisible: true }] // Shows even with no results
|
|
844
|
+
* ]
|
|
845
|
+
* ```
|
|
846
|
+
*/
|
|
847
|
+
tabs?: (string | SearchTab)[];
|
|
848
|
+
/**
|
|
849
|
+
* The key to use for the search query parameter.
|
|
850
|
+
*
|
|
851
|
+
* When a user selects a search result, the query is added to the URL as a query parameter.
|
|
852
|
+
* This is the key of that query parameter.
|
|
853
|
+
*
|
|
854
|
+
* @default 'q'
|
|
855
|
+
*/
|
|
856
|
+
searchQueryParamKey?: string;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export declare type InputMaybe<T> = T | null;
|
|
860
|
+
|
|
861
|
+
export declare interface IntelligentFormAIErrorEvent {
|
|
862
|
+
eventName: 'intelligent_form_ai_error';
|
|
863
|
+
properties: {
|
|
864
|
+
conversationId: string;
|
|
865
|
+
error: string;
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export declare interface IntelligentFormConfig {
|
|
870
|
+
/**
|
|
871
|
+
* Primary form section that is always shown
|
|
872
|
+
*/
|
|
873
|
+
primary: {
|
|
874
|
+
/** Array of form fields to display */
|
|
875
|
+
fields: IntelligentFormField[];
|
|
876
|
+
/** Optional description text shown above the fields */
|
|
877
|
+
description?: string;
|
|
878
|
+
};
|
|
879
|
+
/**
|
|
880
|
+
* Secondary form section that can be conditionally shown
|
|
881
|
+
*/
|
|
882
|
+
secondary: {
|
|
883
|
+
/** Array of form fields to display */
|
|
884
|
+
fields: IntelligentFormField[];
|
|
885
|
+
/**
|
|
886
|
+
* Optional description text shown above the fields.
|
|
887
|
+
* Can be either a simple string or an object with different messages
|
|
888
|
+
* based on AI confidence level
|
|
889
|
+
*/
|
|
890
|
+
description?: string | {
|
|
891
|
+
/** Default message shown when AI confidence is low/medium */
|
|
892
|
+
default: string;
|
|
893
|
+
/** Message shown when AI has high confidence */
|
|
894
|
+
confident: string;
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
/** Configuration for the success view shown after form submission */
|
|
898
|
+
successView: IntelligentFormSuccessView;
|
|
899
|
+
/** Callback function called when form is submitted */
|
|
900
|
+
onSubmit: SubmitCallback;
|
|
901
|
+
/** Optional name of the bot shown in the form */
|
|
902
|
+
botName?: string;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
export declare interface IntelligentFormContextSuggestionsEvent {
|
|
906
|
+
eventName: 'intelligent_form_context_suggestions';
|
|
907
|
+
properties: {
|
|
908
|
+
conversationId: string;
|
|
909
|
+
suggestedFields: string[];
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export declare type IntelligentFormEvent = IntelligentFormSubmittedEvent | IntelligentFormSubmissionErrorEvent | IntelligentFormPrimarySubmittedEvent | IntelligentFormQAResponseEvent | IntelligentFormContextSuggestionsEvent | IntelligentFormAIErrorEvent;
|
|
914
|
+
|
|
915
|
+
export declare type IntelligentFormField = Exclude<FormField, IncludeChatSessionField> & {
|
|
916
|
+
/**
|
|
917
|
+
* Controls AI field generation behavior
|
|
918
|
+
*/
|
|
919
|
+
aiGenerated?: boolean;
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
export declare interface IntelligentFormPrimarySubmittedEvent {
|
|
923
|
+
eventName: 'intelligent_form_primary_submitted';
|
|
924
|
+
properties: {
|
|
925
|
+
conversationId: string;
|
|
926
|
+
fields: string[];
|
|
927
|
+
messages: Message[];
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
export declare interface IntelligentFormQAResponseEvent {
|
|
932
|
+
eventName: 'intelligent_form_qa_response';
|
|
933
|
+
properties: {
|
|
934
|
+
conversationId: string;
|
|
935
|
+
messages: Message[];
|
|
936
|
+
answer: string;
|
|
937
|
+
confidence?: AnswerConfidence;
|
|
938
|
+
recordsConsidered?: SourceItem[];
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
export declare interface IntelligentFormSubmissionErrorEvent {
|
|
943
|
+
eventName: 'intelligent_form_submission_error';
|
|
944
|
+
properties: {
|
|
945
|
+
conversationId: string;
|
|
946
|
+
error: string;
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export declare interface IntelligentFormSubmittedEvent {
|
|
951
|
+
eventName: 'intelligent_form_submitted';
|
|
952
|
+
properties: {
|
|
953
|
+
conversationId: string;
|
|
954
|
+
values: Record<string, unknown>;
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export declare interface IntelligentFormSuccessView {
|
|
959
|
+
heading: string;
|
|
960
|
+
message: string;
|
|
961
|
+
icon?: InkeepCustomIcon;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
export declare interface InvokeCallbackAction {
|
|
965
|
+
type: 'INVOKE_CALLBACK';
|
|
966
|
+
callback: (args: InvokeCallbackArgs) => void;
|
|
967
|
+
shouldCloseModal?: boolean;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare interface InvokeCallbackArgs {
|
|
971
|
+
conversation: ConversationResponse;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export declare type Message = AssistantMessage | UserMessage | SystemMessage;
|
|
975
|
+
|
|
976
|
+
export declare type MessageAction = 'copy' | 'upvote' | 'downvote';
|
|
977
|
+
|
|
978
|
+
export declare interface MessageAttachment {
|
|
979
|
+
contentType: MessageAttachmentContentType;
|
|
980
|
+
title: string;
|
|
981
|
+
content: string;
|
|
982
|
+
id: string;
|
|
983
|
+
context?: string[];
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* MessageAttachmentContentType represents possible type of information that can be attached to a Workflow.
|
|
988
|
+
*/
|
|
989
|
+
export declare type MessageAttachmentContentType = WorkflowCodeContentType | WorkflowTextContentType;
|
|
990
|
+
|
|
991
|
+
export declare interface MessageAttributes {
|
|
992
|
+
attachments?: MessageAttachment[];
|
|
993
|
+
workflow?: Workflow;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
declare interface MessageBase {
|
|
997
|
+
content: MessageContent;
|
|
998
|
+
id: string;
|
|
999
|
+
metadata?: MessageMetadata;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export declare type MessageContent = string | {
|
|
1003
|
+
type: 'text';
|
|
1004
|
+
text: string;
|
|
1005
|
+
}[];
|
|
1006
|
+
|
|
1007
|
+
export declare interface MessageFeedback {
|
|
1008
|
+
unrelated_response: boolean;
|
|
1009
|
+
inaccurate_statement: boolean;
|
|
1010
|
+
inaccurate_code_snippet: boolean;
|
|
1011
|
+
irrelevant_citations: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export declare interface MessageMetadata {
|
|
1015
|
+
attributes?: MessageAttributes;
|
|
1016
|
+
context?: string;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export declare type ModalViewTypes = 'chat' | 'search';
|
|
1020
|
+
|
|
1021
|
+
export declare type OnToggleView = (opts: {
|
|
1022
|
+
view: ModalViewTypes;
|
|
1023
|
+
query?: string;
|
|
1024
|
+
autoSubmit?: boolean;
|
|
1025
|
+
}) => void;
|
|
1026
|
+
|
|
1027
|
+
export declare interface OpenFormAction {
|
|
1028
|
+
type: 'OPEN_FORM';
|
|
1029
|
+
formConfig: FormConfig;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
export declare interface OpenUrlAction {
|
|
1033
|
+
type: 'OPEN_LINK';
|
|
1034
|
+
url: string;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
declare type RecordTypes = 'DocumentationRecord' | 'GitHubIssueRecord' | 'StackOverflowRecord' | 'DiscordRecord' | 'SlackEntry' | 'DiscourseRecord';
|
|
1038
|
+
|
|
1039
|
+
export declare type RenderFn = ({ children, ssr, root, }: {
|
|
1040
|
+
children: ReactNode;
|
|
1041
|
+
ssr: boolean;
|
|
1042
|
+
root: ShadowRoot | null;
|
|
1043
|
+
}) => ReactNode;
|
|
1044
|
+
|
|
1045
|
+
export declare type Root = Record<string, ComponentType<HTMLProps<HTMLElement> & ShadowRootProps>>;
|
|
1046
|
+
|
|
1047
|
+
export declare type SearchEvent = SearchQueryResponseReceivedEvent | SearchQuerySubmittedEvent | SearchResultClickedEvent;
|
|
1048
|
+
|
|
1049
|
+
export declare type SearchFiltersInput = {
|
|
1050
|
+
limit: number;
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
export declare interface SearchFunctions {
|
|
1054
|
+
/**
|
|
1055
|
+
* Update the query.
|
|
1056
|
+
*/
|
|
1057
|
+
updateQuery: (query: string) => void;
|
|
1058
|
+
/**
|
|
1059
|
+
* Focus the input.
|
|
1060
|
+
*/
|
|
1061
|
+
focusInput: () => void;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export declare interface SearchHit {
|
|
1065
|
+
hitOnRoot: boolean;
|
|
1066
|
+
id: string;
|
|
1067
|
+
rootRecord: SearchRootRecord;
|
|
1068
|
+
title?: string;
|
|
1069
|
+
url?: string;
|
|
1070
|
+
preview?: string;
|
|
1071
|
+
pathHeadings?: {
|
|
1072
|
+
content: string;
|
|
1073
|
+
}[];
|
|
1074
|
+
content?: {
|
|
1075
|
+
content: string;
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
export declare type SearchInput = {
|
|
1080
|
+
filters?: InputMaybe<SearchFiltersInput>;
|
|
1081
|
+
searchQuery: string;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
export declare interface SearchQueryResponseReceivedEvent {
|
|
1085
|
+
eventName: 'search_query_response_received';
|
|
1086
|
+
properties: {
|
|
1087
|
+
searchQuery: string;
|
|
1088
|
+
totalHits: number;
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export declare interface SearchQuerySubmittedEvent {
|
|
1093
|
+
eventName: 'search_query_submitted';
|
|
1094
|
+
properties: {
|
|
1095
|
+
searchQuery: string;
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
export declare interface SearchResultClickedEvent {
|
|
1100
|
+
eventName: 'search_result_clicked';
|
|
1101
|
+
properties: {
|
|
1102
|
+
searchQuery: string;
|
|
1103
|
+
title?: string;
|
|
1104
|
+
url?: string;
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export declare interface SearchRootRecord {
|
|
1109
|
+
__typename: RecordTypes;
|
|
1110
|
+
id: string;
|
|
1111
|
+
title?: string;
|
|
1112
|
+
url?: string;
|
|
1113
|
+
preview?: string;
|
|
1114
|
+
pathBreadcrumbs?: string[];
|
|
1115
|
+
contentType?: string;
|
|
1116
|
+
body?: string;
|
|
1117
|
+
state?: `${GitHubIssueState}`;
|
|
1118
|
+
markedAsCorrectAnswer?: {
|
|
1119
|
+
url: string;
|
|
1120
|
+
score: number;
|
|
1121
|
+
content: string;
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export declare interface SearchTab {
|
|
1126
|
+
[0]: string;
|
|
1127
|
+
[1]: {
|
|
1128
|
+
alwaysVisible?: boolean;
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
declare interface SelectField extends BaseFormField {
|
|
1133
|
+
inputType: 'SELECT';
|
|
1134
|
+
items: SelectItem[];
|
|
1135
|
+
defaultValue?: string;
|
|
1136
|
+
placeholder?: string;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export declare interface SelectItem {
|
|
1140
|
+
label: string;
|
|
1141
|
+
value: string;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
export declare interface ShadowRootProps {
|
|
1145
|
+
mode?: 'closed' | 'open';
|
|
1146
|
+
delegatesFocus?: boolean;
|
|
1147
|
+
styleSheets?: CSSStyleSheet[];
|
|
1148
|
+
ssr?: boolean;
|
|
1149
|
+
children?: ReactNode;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
export declare interface SourceItem {
|
|
1153
|
+
id?: string;
|
|
1154
|
+
title: string | undefined;
|
|
1155
|
+
url: string;
|
|
1156
|
+
description: string | undefined;
|
|
1157
|
+
breadcrumbs: string[] | undefined;
|
|
1158
|
+
type: `${SourceItemType}`;
|
|
1159
|
+
contentType?: string;
|
|
1160
|
+
tag?: string;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
declare enum SourceItemType {
|
|
1164
|
+
DOCUMENTATION = "documentation",
|
|
1165
|
+
SITE = "site",
|
|
1166
|
+
GITHUB_ISSUE = "github_issue",
|
|
1167
|
+
GITHUB_DISCUSSION = "github_discussion",
|
|
1168
|
+
DISCOURSE = "discourse",
|
|
1169
|
+
DISCOURSE_POST = "discourse_post",
|
|
1170
|
+
STACKOVERFLOW = "stackoverflow",
|
|
1171
|
+
STACKOVERFLOW_QUESTION = "stackoverflow_question",
|
|
1172
|
+
DISCORD = "discord",
|
|
1173
|
+
DISCORD_MESSAGE = "discord_message",
|
|
1174
|
+
DISCORD_FORUM_POST = "discord_forum_post",
|
|
1175
|
+
MANUAL = "manual",
|
|
1176
|
+
SUPPORT_TICKET = "support_ticket",
|
|
1177
|
+
SLACK_MESSAGE = "slack_message"
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
export declare interface SourceTab {
|
|
1181
|
+
[0]: string;
|
|
1182
|
+
[1]: {
|
|
1183
|
+
breadcrumbs: string[];
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export declare interface StrictIkpTheme {
|
|
1188
|
+
colors: Record<string, any>;
|
|
1189
|
+
fontFamily: Record<string, string>;
|
|
1190
|
+
fontSize: Record<string, string>;
|
|
1191
|
+
zIndex: Record<string, string | number>;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export declare interface Style {
|
|
1195
|
+
/**
|
|
1196
|
+
* A unique identifier for the style.
|
|
1197
|
+
* This is used to prevent duplicate styles and allow for style updates.
|
|
1198
|
+
*
|
|
1199
|
+
* @example
|
|
1200
|
+
* key: 'custom-button-styles'
|
|
1201
|
+
*/
|
|
1202
|
+
key?: string;
|
|
1203
|
+
/**
|
|
1204
|
+
* The type of style to apply.
|
|
1205
|
+
* - 'link': Adds a <link> tag to load external resources like fonts or stylesheets
|
|
1206
|
+
* - 'style': Injects CSS directly into a <style> tag
|
|
1207
|
+
*
|
|
1208
|
+
* @example
|
|
1209
|
+
* type: 'link' // For loading external resources
|
|
1210
|
+
* type: 'style' // For inline CSS
|
|
1211
|
+
*/
|
|
1212
|
+
type: 'link' | 'style';
|
|
1213
|
+
/**
|
|
1214
|
+
* The content of the style.
|
|
1215
|
+
* For type='link', this should be a valid URL to an external resource.
|
|
1216
|
+
* For type='style', this should be valid CSS code.
|
|
1217
|
+
*
|
|
1218
|
+
* @example
|
|
1219
|
+
* // For type='link':
|
|
1220
|
+
* value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
|
|
1221
|
+
*
|
|
1222
|
+
* // For type='style':
|
|
1223
|
+
* value: `.custom-button {
|
|
1224
|
+
* background: blue;
|
|
1225
|
+
* color: white;
|
|
1226
|
+
* }`
|
|
1227
|
+
*/
|
|
1228
|
+
value: string;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
export declare type SubmitCallback = (values: SubmitCallbackArgs) => Promise<void> | void;
|
|
1232
|
+
|
|
1233
|
+
export declare interface SubmitCallbackArgs {
|
|
1234
|
+
values: FieldValues;
|
|
1235
|
+
conversation: ConversationResponse | null;
|
|
1236
|
+
client: Client;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
declare interface SuccessView {
|
|
1240
|
+
heading: string;
|
|
1241
|
+
message: string;
|
|
1242
|
+
button: SuccessViewButton;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
declare interface SuccessViewButton {
|
|
1246
|
+
label: string;
|
|
1247
|
+
icon?: InkeepCustomIcon;
|
|
1248
|
+
action: CloseFormAction;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
export declare interface SyncColorMode {
|
|
1252
|
+
/**
|
|
1253
|
+
* The HTML element to watch for color mode changes.
|
|
1254
|
+
* This element's attributes will be monitored for changes to determine the color mode.
|
|
1255
|
+
*
|
|
1256
|
+
* Common use cases include watching the document root or a specific app container.
|
|
1257
|
+
*
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```ts
|
|
1260
|
+
* // Watch the document root element
|
|
1261
|
+
* target: document.documentElement
|
|
1262
|
+
*
|
|
1263
|
+
* // Watch a specific container element
|
|
1264
|
+
* target: document.querySelector('#app')
|
|
1265
|
+
* ```
|
|
1266
|
+
*/
|
|
1267
|
+
target: HTMLElement;
|
|
1268
|
+
/**
|
|
1269
|
+
* The specific attributes to monitor for color mode changes.
|
|
1270
|
+
* The observer will only trigger when these attributes change on the target element.
|
|
1271
|
+
*
|
|
1272
|
+
* Common attributes used for theming include:
|
|
1273
|
+
* - data-theme: Custom theme attribute
|
|
1274
|
+
* - color-scheme: Standard CSS color scheme
|
|
1275
|
+
* - class: Class-based theming
|
|
1276
|
+
*
|
|
1277
|
+
* @example
|
|
1278
|
+
* ```ts
|
|
1279
|
+
* // Watch data-theme attribute
|
|
1280
|
+
* attributes: ['data-theme']
|
|
1281
|
+
*
|
|
1282
|
+
* // Watch color-scheme attribute
|
|
1283
|
+
* attributes: ['color-scheme']
|
|
1284
|
+
*
|
|
1285
|
+
* // Watch class changes
|
|
1286
|
+
* attributes: ['class']
|
|
1287
|
+
* ```
|
|
1288
|
+
*/
|
|
1289
|
+
attributes: string[];
|
|
1290
|
+
/**
|
|
1291
|
+
* A function that determines if dark mode is active based on the target element's attributes.
|
|
1292
|
+
*
|
|
1293
|
+
* The function receives an object containing the current values of all monitored attributes,
|
|
1294
|
+
* where the keys are attribute names and values are the attribute values.
|
|
1295
|
+
*
|
|
1296
|
+
* @param attributes - Object containing the current values of monitored attributes
|
|
1297
|
+
* @returns boolean - True if dark mode is detected, false otherwise
|
|
1298
|
+
*
|
|
1299
|
+
* @example
|
|
1300
|
+
* ```ts
|
|
1301
|
+
* // Check data-theme attribute
|
|
1302
|
+
* isDarkMode: (attributes) => attributes['data-theme'] === 'dark'
|
|
1303
|
+
*
|
|
1304
|
+
* // Check class for dark mode
|
|
1305
|
+
* isDarkMode: (attributes) => /\bdark\b/.test(attributes['class'])
|
|
1306
|
+
*
|
|
1307
|
+
* // Check color-scheme
|
|
1308
|
+
* isDarkMode: (attributes) => attributes['color-scheme'] === 'dark'
|
|
1309
|
+
* ```
|
|
1310
|
+
*/
|
|
1311
|
+
isDarkMode: (attributes: Record<string, string | null>) => boolean;
|
|
1312
|
+
/**
|
|
1313
|
+
* Optional callback function that is invoked whenever the color mode changes.
|
|
1314
|
+
*
|
|
1315
|
+
* This can be used to perform side effects or sync the color mode with other parts of your application.
|
|
1316
|
+
*
|
|
1317
|
+
* @param colorMode - The new color mode value ('light' | 'dark')
|
|
1318
|
+
*
|
|
1319
|
+
* @example
|
|
1320
|
+
* ```ts
|
|
1321
|
+
* onChange: (colorMode) => {
|
|
1322
|
+
* console.log(`Color mode changed to: ${colorMode}`);
|
|
1323
|
+
* // Update other UI elements
|
|
1324
|
+
* }
|
|
1325
|
+
* ```
|
|
1326
|
+
*/
|
|
1327
|
+
onChange?: (colorMode: string) => void;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
export declare interface SyntaxHighlighterTheme {
|
|
1331
|
+
lightTheme?: any;
|
|
1332
|
+
darkTheme?: any;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
export declare interface SystemMessage extends MessageBase {
|
|
1336
|
+
role: 'system';
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
declare interface TextField extends BaseFormField {
|
|
1340
|
+
inputType: 'EMAIL' | 'TEXT' | 'TEXTAREA';
|
|
1341
|
+
defaultValue?: string;
|
|
1342
|
+
placeholder?: string;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
export declare interface Tool {
|
|
1346
|
+
type: 'function';
|
|
1347
|
+
function: {
|
|
1348
|
+
name: string;
|
|
1349
|
+
description: string;
|
|
1350
|
+
parameters: ToolsJSONSchema | unknown;
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
export declare interface ToolCall {
|
|
1355
|
+
name: string;
|
|
1356
|
+
arguments: string;
|
|
1357
|
+
index: number;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
export declare interface ToolCallAction {
|
|
1361
|
+
label?: string;
|
|
1362
|
+
icon?: InkeepCustomIcon;
|
|
1363
|
+
action: ChatAction;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export declare interface ToolConfig {
|
|
1367
|
+
/**
|
|
1368
|
+
* Array of custom function tools that can be called by the AI assistant during chat interactions.
|
|
1369
|
+
* Each tool must have a type (currently only 'function' is supported), a unique name, description,
|
|
1370
|
+
* and a JSON Schema defining its parameters. Tools enable the AI to trigger actions in your application
|
|
1371
|
+
* based on its responses, such as opening forms, links, or performing callbacks.
|
|
1372
|
+
*/
|
|
1373
|
+
tools?: Tool[];
|
|
1374
|
+
/**
|
|
1375
|
+
* Callback function that handles tool calls triggered by the AI assistant.
|
|
1376
|
+
* @param toolCall - Object containing the tool call details:
|
|
1377
|
+
* - name: The name of the function being called
|
|
1378
|
+
* - arguments: JSON string containing the arguments passed to the function
|
|
1379
|
+
* - index: The index of the tool call
|
|
1380
|
+
* @returns A ToolCallAction object defining the action to perform (e.g., opening a link, displaying a form),
|
|
1381
|
+
* or undefined if no action should be taken
|
|
1382
|
+
*/
|
|
1383
|
+
onToolCall?: (toolCall: ToolCall) => ToolCallAction | undefined;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
export declare type ToolsJSONSchema = {
|
|
1387
|
+
type: string;
|
|
1388
|
+
properties?: Record<string, unknown>;
|
|
1389
|
+
items?: unknown;
|
|
1390
|
+
required?: string[];
|
|
1391
|
+
description?: string;
|
|
1392
|
+
enum?: unknown[];
|
|
1393
|
+
const?: unknown;
|
|
1394
|
+
anyOf?: unknown[];
|
|
1395
|
+
allOf?: unknown[];
|
|
1396
|
+
oneOf?: unknown[];
|
|
1397
|
+
not?: unknown;
|
|
1398
|
+
[key: string]: unknown;
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
export declare interface TransformedSource {
|
|
1402
|
+
/**
|
|
1403
|
+
* ID of the source.
|
|
1404
|
+
*/
|
|
1405
|
+
id?: string;
|
|
1406
|
+
/**
|
|
1407
|
+
* Title of the source.
|
|
1408
|
+
*/
|
|
1409
|
+
title: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* URL of the source.
|
|
1412
|
+
*/
|
|
1413
|
+
url: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* Description of the source.
|
|
1416
|
+
*/
|
|
1417
|
+
description?: string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Breadcrumbs for the source.
|
|
1420
|
+
*
|
|
1421
|
+
* @example
|
|
1422
|
+
* ```ts
|
|
1423
|
+
* breadcrumbs: ['Subpath', 'Page']
|
|
1424
|
+
* ```
|
|
1425
|
+
*/
|
|
1426
|
+
breadcrumbs?: string[];
|
|
1427
|
+
/**
|
|
1428
|
+
* Tabs where this source shows up. (Only for searchResultsItem)
|
|
1429
|
+
*
|
|
1430
|
+
* @example
|
|
1431
|
+
* ```ts
|
|
1432
|
+
* tabs: ['Docs']
|
|
1433
|
+
* tabs: ['Docs', 'API']
|
|
1434
|
+
* ```
|
|
1435
|
+
* You can also specify different breadcrumbs for specific tab.
|
|
1436
|
+
* @example
|
|
1437
|
+
* ```ts
|
|
1438
|
+
* tabs: ['Docs', ['API', { breadcrumbs: ['Guides', 'API'] }]]
|
|
1439
|
+
* ```
|
|
1440
|
+
*/
|
|
1441
|
+
tabs?: (SourceTab | string)[];
|
|
1442
|
+
/**
|
|
1443
|
+
* Icon of the source.
|
|
1444
|
+
*
|
|
1445
|
+
* @example
|
|
1446
|
+
* ```ts
|
|
1447
|
+
* icon: { builtIn: 'LuBookOpen' }
|
|
1448
|
+
* icon: { custom: 'https://example.com/icon.svg' }
|
|
1449
|
+
* ```
|
|
1450
|
+
*/
|
|
1451
|
+
icon: InkeepCustomIcon;
|
|
1452
|
+
/**
|
|
1453
|
+
* Whether to open the source in a new tab.
|
|
1454
|
+
*/
|
|
1455
|
+
shouldOpenInNewTab?: boolean;
|
|
1456
|
+
/**
|
|
1457
|
+
* Search query params to append to the URL.
|
|
1458
|
+
*
|
|
1459
|
+
* @example
|
|
1460
|
+
* If you want to know if the source is from chat or search, you can append the source type to the URL.
|
|
1461
|
+
* ```ts
|
|
1462
|
+
* appendToUrl: { from: 'chatSourceItem' }
|
|
1463
|
+
* ```
|
|
1464
|
+
*/
|
|
1465
|
+
appendToUrl?: UrlQueryParam;
|
|
1466
|
+
/**
|
|
1467
|
+
* Type of the source.
|
|
1468
|
+
*/
|
|
1469
|
+
type: SourceItemType | `${SourceItemType}`;
|
|
1470
|
+
/**
|
|
1471
|
+
* Tag to append to the source.
|
|
1472
|
+
*/
|
|
1473
|
+
tag?: string;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
export declare type TransformSource = (source: SourceItem, type: TransformSourceType, opts?: TransformSourceOptions) => TransformedSource;
|
|
1477
|
+
|
|
1478
|
+
export declare interface TransformSourceOptions {
|
|
1479
|
+
organizationDisplayName?: string;
|
|
1480
|
+
tabs?: InkeepSearchSettings['tabs'];
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
export declare type TransformSourceType = 'chatSourceItem' | 'searchResultItem' | 'intelligentFormSource';
|
|
1484
|
+
|
|
1485
|
+
export declare type UrlQueryParam = Record<string, string>;
|
|
1486
|
+
|
|
1487
|
+
export declare interface UseColorModeProps {
|
|
1488
|
+
/** List of all available colorMode names */
|
|
1489
|
+
colorModes: string[];
|
|
1490
|
+
/** Forced colorMode name for the current page */
|
|
1491
|
+
forcedColorMode?: string;
|
|
1492
|
+
/** Update the colorMode */
|
|
1493
|
+
setColorMode: (colorMode: string) => void;
|
|
1494
|
+
/** Active colorMode name */
|
|
1495
|
+
colorMode?: string;
|
|
1496
|
+
/** 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` */
|
|
1497
|
+
resolvedColorMode?: string;
|
|
1498
|
+
/** If enableSystem is true, returns the System colorMode preference ("dark" or "light"), regardless what the active colorMode is */
|
|
1499
|
+
systemColorMode?: 'dark' | 'light';
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
export declare interface UserMessage extends MessageBase {
|
|
1503
|
+
role: 'user';
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
export declare interface UserProperties {
|
|
1507
|
+
/**
|
|
1508
|
+
* The user ID.
|
|
1509
|
+
*/
|
|
1510
|
+
id?: string;
|
|
1511
|
+
/**
|
|
1512
|
+
* The user email.
|
|
1513
|
+
*/
|
|
1514
|
+
email?: string;
|
|
1515
|
+
/**
|
|
1516
|
+
* The user name.
|
|
1517
|
+
*/
|
|
1518
|
+
name?: string;
|
|
1519
|
+
/**
|
|
1520
|
+
* The user cohorts.
|
|
1521
|
+
*/
|
|
1522
|
+
cohorts?: string[];
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
export declare interface UserProvidedColorScheme {
|
|
1526
|
+
textBold?: string;
|
|
1527
|
+
textSubtle?: string;
|
|
1528
|
+
lighter?: string;
|
|
1529
|
+
light?: string;
|
|
1530
|
+
lightSubtle?: string;
|
|
1531
|
+
medium?: string;
|
|
1532
|
+
mediumSubtle?: string;
|
|
1533
|
+
strong?: string;
|
|
1534
|
+
stronger?: string;
|
|
1535
|
+
textColorOnPrimary?: string;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
export declare interface UserTheme extends Partial<IkpTheme> {
|
|
1539
|
+
/**
|
|
1540
|
+
* The syntax highlighter theme configuration for code blocks.
|
|
1541
|
+
* Allows setting different themes for light and dark modes.
|
|
1542
|
+
*
|
|
1543
|
+
* @example
|
|
1544
|
+
* ```ts
|
|
1545
|
+
* syntaxHighlighter: {
|
|
1546
|
+
* lightTheme: themes.github,
|
|
1547
|
+
* darkTheme: themes.dracula
|
|
1548
|
+
* }
|
|
1549
|
+
* ```
|
|
1550
|
+
*/
|
|
1551
|
+
syntaxHighlighter?: SyntaxHighlighterTheme;
|
|
1552
|
+
/**
|
|
1553
|
+
* The primary colors used to generate the color scheme.
|
|
1554
|
+
* These colors will be used to create variations for different UI states.
|
|
1555
|
+
*
|
|
1556
|
+
* @example
|
|
1557
|
+
* ```ts
|
|
1558
|
+
* primaryColors: {
|
|
1559
|
+
* primary: '#26D6FF',
|
|
1560
|
+
* secondary: '#6366F1'
|
|
1561
|
+
* }
|
|
1562
|
+
* ```
|
|
1563
|
+
*/
|
|
1564
|
+
primaryColors?: UserProvidedColorScheme;
|
|
1565
|
+
/**
|
|
1566
|
+
* The class name for the container that holds CSS variables.
|
|
1567
|
+
* This class will be added to a wrapper div that provides theming context.
|
|
1568
|
+
*
|
|
1569
|
+
* @default 'ikp-variables'
|
|
1570
|
+
*/
|
|
1571
|
+
varsClassName?: string;
|
|
1572
|
+
/**
|
|
1573
|
+
* Custom styles to be injected into the widget.
|
|
1574
|
+
* Supports both inline styles and external stylesheets/resources.
|
|
1575
|
+
* Styles are uniquely identified by their key to prevent duplicates.
|
|
1576
|
+
*
|
|
1577
|
+
* @example
|
|
1578
|
+
* ```ts
|
|
1579
|
+
* styles: [
|
|
1580
|
+
* // External stylesheet or font
|
|
1581
|
+
* {
|
|
1582
|
+
* key: 'google-fonts',
|
|
1583
|
+
* type: 'link',
|
|
1584
|
+
* value: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'
|
|
1585
|
+
* },
|
|
1586
|
+
* // Custom CSS rules
|
|
1587
|
+
* {
|
|
1588
|
+
* key: 'custom-theme',
|
|
1589
|
+
* type: 'style',
|
|
1590
|
+
* value: `
|
|
1591
|
+
* .ikp-ai-chat-message {
|
|
1592
|
+
* border-radius: 8px;
|
|
1593
|
+
* padding: 12px;
|
|
1594
|
+
* }
|
|
1595
|
+
* [data-theme='dark'] .ikp-ai-chat-message {
|
|
1596
|
+
* background: #2D3748;
|
|
1597
|
+
* }
|
|
1598
|
+
* `
|
|
1599
|
+
* }
|
|
1600
|
+
* ]
|
|
1601
|
+
* ```
|
|
1602
|
+
*/
|
|
1603
|
+
styles?: Style[];
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/** Adapted from https://github.com/pacocoursey/next-theme/blob/a385b8d865bbb317ff73a5b6c1319ae566f7d6f1/src/types.ts */
|
|
1607
|
+
declare interface ValueObject {
|
|
1608
|
+
[colorModeName: string]: string;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
export declare interface WidgetView {
|
|
1612
|
+
/**
|
|
1613
|
+
* Callback fired when the user toggles between chat and search views.
|
|
1614
|
+
*
|
|
1615
|
+
* The parent component can use this
|
|
1616
|
+
* to coordinate showing/hiding the appropriate view.
|
|
1617
|
+
*/
|
|
1618
|
+
onToggleView?: OnToggleView;
|
|
1619
|
+
/**
|
|
1620
|
+
* The label for the Ask AI button.
|
|
1621
|
+
*/
|
|
1622
|
+
askAILabel?: string;
|
|
1623
|
+
/**
|
|
1624
|
+
* The label for the Search button.
|
|
1625
|
+
*/
|
|
1626
|
+
searchLabel?: string;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Workflow defines the interaction steps for the AI bot.
|
|
1631
|
+
*/
|
|
1632
|
+
export declare interface Workflow {
|
|
1633
|
+
id: string;
|
|
1634
|
+
displayName: string;
|
|
1635
|
+
goals: string[];
|
|
1636
|
+
informationToCollect: WorkflowInformationToCollect[];
|
|
1637
|
+
botPersona?: string;
|
|
1638
|
+
context?: string[];
|
|
1639
|
+
guidance?: string[];
|
|
1640
|
+
initialReplyMessage: string;
|
|
1641
|
+
supportedInputs?: WorkflowInputTypes[];
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* BaseType is a base interface for data types.
|
|
1646
|
+
*/
|
|
1647
|
+
declare interface WorkflowBaseContentType {
|
|
1648
|
+
type: string;
|
|
1649
|
+
contentInputLabel: string;
|
|
1650
|
+
attachmentIcon?: InkeepCustomIcon;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* WorkflowInputType defines the type of attachments in a Workflow.
|
|
1655
|
+
*/
|
|
1656
|
+
export declare interface WorkflowBaseInputTypes {
|
|
1657
|
+
id: string;
|
|
1658
|
+
type: string;
|
|
1659
|
+
displayName: string;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
export declare interface WorkflowCodeContentType extends WorkflowBaseContentType {
|
|
1663
|
+
type: 'CODE';
|
|
1664
|
+
language: string;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* WorkflowFunctionalMultiInput represents a function to be called when the attachment is invoked.
|
|
1669
|
+
*/
|
|
1670
|
+
export declare interface WorkflowFunctionalMultiInput extends WorkflowBaseInputTypes {
|
|
1671
|
+
type: 'FUNCTIONAL_MULTI_ATTACHMENT';
|
|
1672
|
+
onInvoke: (workflow: Workflow, selectedInputType: WorkflowInputTypes, callback: (messageAttachments: MessageAttachment[]) => void, currentMessageAttachments: MessageAttachment[]) => void;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
export declare interface WorkflowInformationToCollect {
|
|
1676
|
+
description: string;
|
|
1677
|
+
required: boolean;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* WorkflowInputTypes represents possible ways of collecting attachments in a Workflow.
|
|
1682
|
+
*/
|
|
1683
|
+
export declare type WorkflowInputTypes = WorkflowFunctionalMultiInput | WorkflowModalSingleInput;
|
|
1684
|
+
|
|
1685
|
+
export declare interface WorkflowModalProps {
|
|
1686
|
+
titleInputLabel?: string;
|
|
1687
|
+
modalHelpText?: string;
|
|
1688
|
+
modalHelpElement?: React.ReactElement;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* WorkflowModalSingleInput represents a modal input type.
|
|
1693
|
+
*/
|
|
1694
|
+
export declare interface WorkflowModalSingleInput extends WorkflowBaseInputTypes {
|
|
1695
|
+
type: 'MODAL';
|
|
1696
|
+
contentType: MessageAttachmentContentType;
|
|
1697
|
+
workflowModalProps?: WorkflowModalProps;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
export declare interface WorkflowTextContentType extends WorkflowBaseContentType {
|
|
1701
|
+
type: 'TEXT';
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
export { }
|