@inkeep/cxkit-types 0.5.6 → 0.5.8

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +161 -217
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -2,18 +2,6 @@ import { ComponentType } from 'react';
2
2
  import { HTMLProps } from 'react';
3
3
  import { ReactNode } from 'react';
4
4
 
5
- export declare interface AIChatBotResponseReceivedEvent {
6
- eventName: 'chat_message_bot_response_received';
7
- properties: {
8
- messages: Message[];
9
- messageId: string;
10
- question: string;
11
- responseMessage: Message;
12
- linksUsedInResponse: SourceItem[];
13
- workflowId?: string;
14
- };
15
- }
16
-
17
5
  export declare interface AIChatDisclaimerSettings {
18
6
  /**
19
7
  * Controls whether the disclaimer message is shown.
@@ -34,6 +22,36 @@ export declare interface AIChatDisclaimerSettings {
34
22
  tooltip?: string;
35
23
  }
36
24
 
25
+ export declare interface AIChatFormButtons {
26
+ submit: {
27
+ label?: string;
28
+ onSubmit: SubmitCallback;
29
+ };
30
+ close?: {
31
+ action: CloseFormAction;
32
+ };
33
+ }
34
+
35
+ declare interface AIChatFormDoneButton {
36
+ label: string;
37
+ icon?: InkeepCustomIcon;
38
+ action: CloseFormAction;
39
+ }
40
+
41
+ export declare interface AIChatFormSettings {
42
+ heading?: string;
43
+ description?: string;
44
+ buttons: AIChatFormButtons;
45
+ fields: FormField[];
46
+ successView: AIChatFormSuccessView;
47
+ }
48
+
49
+ declare interface AIChatFormSuccessView {
50
+ heading: string;
51
+ message: string;
52
+ doneButton: AIChatFormDoneButton;
53
+ }
54
+
37
55
  export declare interface AIChatFunctions {
38
56
  /**
39
57
  * Programmatically sends a message in the chat.
@@ -52,9 +70,9 @@ export declare interface AIChatFunctions {
52
70
  clearChat: () => void;
53
71
  /**
54
72
  * Displays a form overlay in the chat interface.
55
- * @param formConfig Configuration object defining the form's fields and behavior
73
+ * @param formSettings Configuration object defining the form's fields and behavior
56
74
  */
57
- openForm: (formConfig: FormConfig) => void;
75
+ openForm: (formSettings: AIChatFormSettings) => void;
58
76
  /**
59
77
  * Programmatically sets focus to the chat input field.
60
78
  * Useful after programmatic updates or when showing the chat interface.
@@ -62,85 +80,6 @@ export declare interface AIChatFunctions {
62
80
  focusInput: () => void;
63
81
  }
64
82
 
65
- export declare interface AIChatGetHelpOptionClickedEvent {
66
- eventName: 'get_help_option_clicked';
67
- properties: {
68
- actionType?: ChatActionType;
69
- name: string;
70
- url?: string;
71
- conversationId: string;
72
- };
73
- }
74
-
75
- export declare interface AIChatHistoryClearedEvent {
76
- eventName: 'chat_history_cleared';
77
- properties: {
78
- conversationId: string | null;
79
- };
80
- }
81
-
82
- export declare interface AIChatMessageCopiedEvent {
83
- eventName: 'chat_message_copied';
84
- properties: {
85
- messageId: string;
86
- };
87
- }
88
-
89
- export declare interface AIChatMessageSubmittedEvent {
90
- eventName: 'chat_message_submitted';
91
- properties: {
92
- messages: Message[];
93
- messageId: string;
94
- content: string;
95
- workflowId?: string;
96
- };
97
- }
98
-
99
- export declare interface AIChatResponseLinkOpenedEvent {
100
- eventName: 'chat_response_link_opened';
101
- properties: {
102
- messageId: string;
103
- title?: string;
104
- url?: string;
105
- };
106
- }
107
-
108
- export declare interface AIChatResponseSourceItemClickedEvent {
109
- eventName: 'chat_response_source_item_clicked';
110
- properties: {
111
- messageId: string;
112
- sourceType: SourceItem['type'];
113
- title?: string;
114
- url?: string;
115
- };
116
- }
117
-
118
- export declare interface AIChatShareButtonClickedEvent {
119
- eventName: 'chat_share_button_clicked';
120
- properties: {
121
- sharedChatUrl: string;
122
- sharedConversationId: string;
123
- originalConversationId: string;
124
- };
125
- }
126
-
127
- export declare interface AIChatSharedSessionLoadedEvent {
128
- eventName: 'chat_shared_session_loaded';
129
- properties: {
130
- conversationId: string;
131
- };
132
- }
133
-
134
- export declare interface AIChatThumbsDownFeedbackSubmittedEvent {
135
- eventName: 'chat_thumbs_down_feedback_submitted';
136
- properties: FeedbackProperties;
137
- }
138
-
139
- export declare interface AIChatThumbsUpFeedbackSubmittedEvent {
140
- eventName: 'chat_thumbs_up_feedback_submitted';
141
- properties: FeedbackProperties;
142
- }
143
-
144
83
  export declare interface AIChatToolbarButtonLabels {
145
84
  /**
146
85
  * Text shown on the button that clears the chat history.
@@ -169,25 +108,62 @@ export declare interface AIChatToolbarButtonLabels {
169
108
  copyChat?: string;
170
109
  }
171
110
 
172
- export declare interface AIChatToolCallActionClickedEvent {
173
- eventName: 'toolcall_action_clicked';
111
+ export declare type AnswerConfidence = 'very_confident' | 'somewhat_confident' | 'not_confident' | 'no_sources' | 'other';
112
+
113
+ export declare interface AssistantCodeBlockCopiedEvent {
114
+ eventName: 'assistant_code_block_copied';
174
115
  properties: {
175
- actionType: ChatActionType;
176
- conversationId: string;
177
- question?: string;
178
- answer?: string;
179
- answerId?: string;
180
- workflowId?: string;
116
+ conversation: ConversationResponse;
117
+ language: string;
118
+ code: string;
181
119
  };
182
120
  }
183
121
 
184
- export declare type AnswerConfidence = 'very_confident' | 'somewhat_confident' | 'not_confident' | 'no_sources' | 'other';
185
-
186
122
  export declare interface AssistantMessage extends MessageBase {
187
123
  role: 'assistant';
188
124
  links: SourceItem[];
189
125
  }
190
126
 
127
+ export declare interface AssistantMessageCopiedEvent {
128
+ eventName: 'assistant_message_copied';
129
+ properties: {
130
+ conversation: ConversationResponse;
131
+ };
132
+ }
133
+
134
+ export declare interface AssistantMessageLinkOpenedEvent {
135
+ eventName: 'assistant_message_inline_link_opened';
136
+ properties: {
137
+ title?: string;
138
+ url?: string;
139
+ };
140
+ }
141
+
142
+ export declare interface AssistantMessageReceivedEvent {
143
+ eventName: 'assistant_message_received';
144
+ properties: {
145
+ conversation?: ConversationResponse;
146
+ };
147
+ }
148
+
149
+ export declare interface AssistantNegativeFeedbackSubmittedEvent {
150
+ eventName: 'assistant_positive_feedback_submitted';
151
+ properties: FeedbackProperties;
152
+ }
153
+
154
+ export declare interface AssistantPositiveFeedbackSubmittedEvent {
155
+ eventName: 'assistant_negative_feedback_submitted';
156
+ properties: FeedbackProperties;
157
+ }
158
+
159
+ export declare interface AssistantSourceItemClickedEvent {
160
+ eventName: 'assistant_source_item_clicked';
161
+ properties: {
162
+ conversation: ConversationResponse;
163
+ link: TransformedSource;
164
+ };
165
+ }
166
+
191
167
  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';
192
168
 
193
169
  export declare interface BaseFormField {
@@ -202,7 +178,14 @@ declare type ChatAction = InvokeCallbackAction | OpenFormAction | OpenUrlAction;
202
178
 
203
179
  export declare type ChatActionType = ChatAction['type'];
204
180
 
205
- export declare type ChatEvent = AIChatBotResponseReceivedEvent | AIChatMessageSubmittedEvent | AIChatSharedSessionLoadedEvent | AIChatThumbsDownFeedbackSubmittedEvent | AIChatThumbsUpFeedbackSubmittedEvent | AIChatHistoryClearedEvent | AIChatMessageCopiedEvent | AIChatGetHelpOptionClickedEvent | AIChatToolCallActionClickedEvent | AIChatShareButtonClickedEvent | AIChatResponseSourceItemClickedEvent | AIChatResponseLinkOpenedEvent | CodeBlockCopiedEvent;
181
+ export declare interface ChatClearButtonClickedEvent {
182
+ eventName: 'chat_clear_button_clicked';
183
+ properties: {
184
+ conversation: ConversationResponse;
185
+ };
186
+ }
187
+
188
+ export declare type ChatEvent = AssistantMessageReceivedEvent | UserMessageSubmittedEvent | SharedChatLoadedEvent | AssistantPositiveFeedbackSubmittedEvent | AssistantNegativeFeedbackSubmittedEvent | ChatClearButtonClickedEvent | AssistantMessageCopiedEvent | GetHelpOptionClickedEvent | ChatShareButtonClickedEvent | AssistantSourceItemClickedEvent | AssistantMessageLinkOpenedEvent | AssistantCodeBlockCopiedEvent;
206
189
 
207
190
  export declare enum ChatModel {
208
191
  /**
@@ -212,26 +195,23 @@ export declare enum ChatModel {
212
195
  QA_EXPERT = "inkeep-qa-expert"
213
196
  }
214
197
 
198
+ export declare interface ChatShareButtonClickedEvent {
199
+ eventName: 'chat_share_button_clicked';
200
+ properties: {
201
+ sharedChatUrl: string;
202
+ sharedConversationId: string;
203
+ originalConversationId: string;
204
+ conversation: ConversationResponse;
205
+ };
206
+ }
207
+
215
208
  declare interface CheckboxField extends BaseFormField {
216
209
  inputType: 'checkbox';
217
210
  defaultValue?: boolean;
218
211
  }
219
212
 
220
- export declare interface Client {
221
- currentUrl: string;
222
- }
223
-
224
213
  export declare type CloseFormAction = 'return_to_chat' | 'close_modal';
225
214
 
226
- export declare interface CodeBlockCopiedEvent {
227
- eventName: 'chat_code_block_copied';
228
- properties: {
229
- conversationId: string;
230
- language: string;
231
- code: string;
232
- };
233
- }
234
-
235
215
  export declare interface ColorMode extends Omit<ColorModeProviderProps, 'children' | 'rootId' | 'shadowHostId'> {
236
216
  /**
237
217
  * Configuration for syncing the widget's color mode with an external element.
@@ -285,7 +265,7 @@ export declare interface ColorModeProviderProps {
285
265
  }
286
266
 
287
267
  declare interface CommonProperties {
288
- conversationId: string;
268
+ conversation: ConversationResponse;
289
269
  componentType: any;
290
270
  tags: string[];
291
271
  }
@@ -306,7 +286,10 @@ export declare interface ConversationMessage {
306
286
  createdAt: string;
307
287
  updatedAt: string;
308
288
  role: 'assistant' | 'system' | 'user';
309
- content: string;
289
+ content: string | {
290
+ type: 'text';
291
+ text: string;
292
+ }[];
310
293
  name: string;
311
294
  links: SourceItem[];
312
295
  properties: Record<string, unknown>;
@@ -385,12 +368,8 @@ export declare interface FeedbackBody {
385
368
  export declare type FeedbackItemType = keyof MessageFeedback;
386
369
 
387
370
  declare interface FeedbackProperties {
388
- conversationId: string;
389
- messageId: string;
390
- question: string;
391
- answer: string;
371
+ conversation?: ConversationResponse;
392
372
  reasons: FeebackReason[];
393
- workflowId?: string;
394
373
  }
395
374
 
396
375
  export declare type FeedbackType = 'positive' | 'negative';
@@ -401,24 +380,6 @@ declare interface FileField extends BaseFormField {
401
380
  inputType: 'file';
402
381
  }
403
382
 
404
- export declare interface FormButtons {
405
- submit: {
406
- label?: string;
407
- onSubmit: SubmitCallback;
408
- };
409
- close?: {
410
- action: CloseFormAction;
411
- };
412
- }
413
-
414
- export declare interface FormConfig {
415
- heading?: string;
416
- description?: string;
417
- buttons: FormButtons;
418
- fields: FormField[];
419
- successView: SuccessView;
420
- }
421
-
422
383
  export declare type FormField = CheckboxField | FileField | SelectField | TextField | IncludeChatSessionField;
423
384
 
424
385
  export declare type FormInputType = NonNullable<FormField['inputType']>;
@@ -430,6 +391,14 @@ export declare interface GetHelpOption {
430
391
  action: ChatAction;
431
392
  }
432
393
 
394
+ export declare interface GetHelpOptionClickedEvent {
395
+ eventName: 'get_help_option_clicked';
396
+ properties: {
397
+ getHelpOption: GetHelpOption;
398
+ conversation?: ConversationResponse;
399
+ };
400
+ }
401
+
433
402
  export declare enum GitHubIssueState {
434
403
  Closed = "CLOSED",
435
404
  Open = "OPEN"
@@ -449,7 +418,7 @@ export declare interface IncludeChatSessionField extends BaseFormField {
449
418
  defaultValue?: boolean;
450
419
  }
451
420
 
452
- export declare interface InkeepAIChatSettings extends ToolConfig {
421
+ export declare interface InkeepAIChatSettings {
453
422
  /**
454
423
  * The placeholder text to display in the chat input field when empty.
455
424
  * Use this to provide guidance on what kind of questions users can ask.
@@ -840,15 +809,39 @@ export declare interface InkeepSearchSettings {
840
809
 
841
810
  export declare type InputMaybe<T> = T | null;
842
811
 
843
- export declare interface IntelligentFormAIErrorEvent {
844
- eventName: 'intelligent_form_ai_error';
812
+ export declare interface IntelligentFormAIResponseProvidedEvent {
813
+ eventName: 'intelligent_form_ai_response_provided';
814
+ properties: {
815
+ conversation?: ConversationResponse;
816
+ recordsConsidered?: SourceItem[];
817
+ };
818
+ }
819
+
820
+ export declare interface IntelligentFormButtons {
821
+ /** Callback function called when form is submitted */
822
+ submit: {
823
+ label?: string;
824
+ onSubmit: SubmitCallback;
825
+ };
826
+ }
827
+
828
+ export declare type IntelligentFormEvent = IntelligentFormPrimarySectionSubmittedEvent | IntelligentFormAIResponseProvidedEvent | IntelligentFormSubmittedEvent;
829
+
830
+ export declare type IntelligentFormField = Exclude<FormField, IncludeChatSessionField> & {
831
+ /**
832
+ * Controls whether to prefill the field with the AI's response
833
+ */
834
+ shouldPrefillWithAI?: boolean;
835
+ };
836
+
837
+ export declare interface IntelligentFormPrimarySectionSubmittedEvent {
838
+ eventName: 'intelligent_form_primary_section_submitted';
845
839
  properties: {
846
- conversationId: string;
847
- error: string;
840
+ conversation?: ConversationResponse;
848
841
  };
849
842
  }
850
843
 
851
- export declare interface IntelligentFormConfig {
844
+ export declare interface IntelligentFormSettings {
852
845
  /**
853
846
  * Primary form section that is always shown
854
847
  */
@@ -878,61 +871,16 @@ export declare interface IntelligentFormConfig {
878
871
  };
879
872
  /** Configuration for the success view shown after form submission */
880
873
  successView: IntelligentFormSuccessView;
881
- /** Callback function called when form is submitted */
882
- onSubmit: SubmitCallback;
874
+ /** Configuration for the buttons shown in the form */
875
+ buttons: IntelligentFormButtons;
883
876
  /** Optional name of the assistant shown in the form */
884
877
  aiAssistantName?: string;
885
878
  }
886
879
 
887
- export declare interface IntelligentFormContextSuggestionsEvent {
888
- eventName: 'intelligent_form_context_suggestions';
889
- properties: {
890
- conversationId: string;
891
- suggestedFields: string[];
892
- };
893
- }
894
-
895
- export declare type IntelligentFormEvent = IntelligentFormSubmittedEvent | IntelligentFormSubmissionErrorEvent | IntelligentFormPrimarySubmittedEvent | IntelligentFormQAResponseEvent | IntelligentFormContextSuggestionsEvent | IntelligentFormAIErrorEvent;
896
-
897
- export declare type IntelligentFormField = Exclude<FormField, IncludeChatSessionField> & {
898
- /**
899
- * Controls whether to prefill the field with the AI's response
900
- */
901
- shouldPrefillWithAI?: boolean;
902
- };
903
-
904
- export declare interface IntelligentFormPrimarySubmittedEvent {
905
- eventName: 'intelligent_form_primary_submitted';
906
- properties: {
907
- conversationId: string;
908
- fields: string[];
909
- messages: Message[];
910
- };
911
- }
912
-
913
- export declare interface IntelligentFormQAResponseEvent {
914
- eventName: 'intelligent_form_qa_response';
915
- properties: {
916
- conversationId: string;
917
- messages: Message[];
918
- answer: string;
919
- confidence?: AnswerConfidence;
920
- recordsConsidered?: SourceItem[];
921
- };
922
- }
923
-
924
- export declare interface IntelligentFormSubmissionErrorEvent {
925
- eventName: 'intelligent_form_submission_error';
926
- properties: {
927
- conversationId: string;
928
- error: string;
929
- };
930
- }
931
-
932
880
  export declare interface IntelligentFormSubmittedEvent {
933
881
  eventName: 'intelligent_form_submitted';
934
882
  properties: {
935
- conversationId: string;
883
+ conversation: ConversationResponse;
936
884
  values: Record<string, unknown>;
937
885
  };
938
886
  }
@@ -976,16 +924,11 @@ export declare interface MessageAttributes {
976
924
  }
977
925
 
978
926
  declare interface MessageBase {
979
- content: MessageContent;
927
+ content: ConversationResponse['messages'][number]['content'];
980
928
  id: string;
981
929
  metadata?: MessageMetadata;
982
930
  }
983
931
 
984
- export declare type MessageContent = string | {
985
- type: 'text';
986
- text: string;
987
- }[];
988
-
989
932
  export declare interface MessageFeedback {
990
933
  unrelated_response: boolean;
991
934
  inaccurate_statement: boolean;
@@ -1008,7 +951,7 @@ export declare type OnToggleView = (opts: {
1008
951
 
1009
952
  export declare interface OpenFormAction {
1010
953
  type: 'open_form';
1011
- formConfig: FormConfig;
954
+ formSettings: AIChatFormSettings;
1012
955
  }
1013
956
 
1014
957
  export declare interface OpenUrlAction {
@@ -1085,7 +1028,7 @@ export declare interface SearchQueryResponseReceivedEvent {
1085
1028
  eventName: 'search_query_response_received';
1086
1029
  properties: {
1087
1030
  searchQuery: string;
1088
- totalHits: number;
1031
+ totalResults: number;
1089
1032
  };
1090
1033
  }
1091
1034
 
@@ -1149,6 +1092,13 @@ export declare interface ShadowRootProps {
1149
1092
  children?: ReactNode;
1150
1093
  }
1151
1094
 
1095
+ export declare interface SharedChatLoadedEvent {
1096
+ eventName: 'shared_chat_loaded';
1097
+ properties: {
1098
+ conversation?: ConversationResponse;
1099
+ };
1100
+ }
1101
+
1152
1102
  export declare interface SourceItem {
1153
1103
  id?: string;
1154
1104
  title: string | undefined;
@@ -1233,19 +1183,6 @@ export declare type SubmitCallback = (values: SubmitCallbackArgs) => Promise<voi
1233
1183
  export declare interface SubmitCallbackArgs {
1234
1184
  values: FieldValues;
1235
1185
  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
1186
  }
1250
1187
 
1251
1188
  export declare interface SyncColorMode {
@@ -1506,6 +1443,13 @@ export declare interface UserMessage extends MessageBase {
1506
1443
  role: 'user';
1507
1444
  }
1508
1445
 
1446
+ export declare interface UserMessageSubmittedEvent {
1447
+ eventName: 'user_message_submitted';
1448
+ properties: {
1449
+ conversation?: ConversationResponse;
1450
+ };
1451
+ }
1452
+
1509
1453
  export declare interface UserProperties {
1510
1454
  /**
1511
1455
  * The user ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/cxkit-types",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",