@debales/ai 1.1.4 → 1.1.5-canary.1
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/dist/browser/ai-browser.js +253 -253
- package/dist/browser/components/common/UserInfoModel.d.ts +1 -9
- package/dist/browser/components/footer/ChatInputBox.d.ts +1 -4
- package/dist/browser/constants/index.d.ts +1 -1
- package/dist/browser/constants/storage-key.d.ts +2 -0
- package/dist/browser/lib/util.d.ts +12 -1
- package/dist/browser/types/debales.d.ts +9 -4
- package/dist/browser/types/index.d.ts +1 -1
- package/dist/module/ai.js +15801 -15738
- package/dist/module/ai.umd.js +279 -279
- package/dist/module/components/common/UserInfoModel.d.ts +1 -9
- package/dist/module/components/footer/ChatInputBox.d.ts +1 -4
- package/dist/module/constants/index.d.ts +1 -1
- package/dist/module/constants/storage-key.d.ts +2 -0
- package/dist/module/lib/util.d.ts +12 -1
- package/dist/module/types/debales.d.ts +9 -4
- package/dist/module/types/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Product, SuggestedQuestionAnswer, UiData } from '../../types';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
2
|
declare global {
|
|
4
3
|
interface Window {
|
|
@@ -7,16 +6,9 @@ declare global {
|
|
|
7
6
|
}
|
|
8
7
|
}
|
|
9
8
|
interface Props {
|
|
10
|
-
uidata: UiData;
|
|
11
|
-
botName?: string;
|
|
12
|
-
botId: string;
|
|
13
|
-
botNameColor: string | undefined;
|
|
14
|
-
showModel: boolean;
|
|
15
9
|
setShowModel: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
|
-
selectedSuggestedQuestionAnswer: SuggestedQuestionAnswer | null;
|
|
17
|
-
sendMessage: (message: string, answer?: string, products?: Product[]) => Promise<void>;
|
|
18
10
|
inChat?: boolean;
|
|
19
11
|
showFormInstructions?: boolean;
|
|
20
12
|
}
|
|
21
|
-
export declare const UserInfoModel: ({
|
|
13
|
+
export declare const UserInfoModel: ({ inChat, showFormInstructions, setShowModel, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
22
14
|
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export default function ChatInputBox({ uiData, onSendMessage, disabled, inputState, }: {
|
|
3
|
-
uiData: UiData;
|
|
4
|
-
onSendMessage: (message: string) => Promise<void>;
|
|
1
|
+
export default function ChatInputBox({ disabled, inputState, }: {
|
|
5
2
|
disabled: boolean;
|
|
6
3
|
inputState: boolean;
|
|
7
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -59,5 +59,16 @@ export declare function splitMessageIntoParagraphs(markdownText: string): string
|
|
|
59
59
|
export declare const isAthflex: (botId: string) => botId is "athflex" | "athflex-2";
|
|
60
60
|
export declare const isGaiabay: (botId: string) => boolean;
|
|
61
61
|
export declare const splitQuestionsIntoGroups: (questions: SuggestedQuestionAnswer[]) => (SuggestedQuestionAnswer | SuggestedQuestionAnswer[])[];
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Creates a storage key with optional botId scoping
|
|
64
|
+
*
|
|
65
|
+
* @param {string} purpose - The purpose identifier for the storage key
|
|
66
|
+
* @param {object} options - Optional configuration
|
|
67
|
+
* @param {string} options.botId - Bot ID for project-specific storage (optional)
|
|
68
|
+
* @param {boolean} options.shared - Whether this is shared across all instances (optional)
|
|
69
|
+
* @return {string} The generated storage key
|
|
70
|
+
*/
|
|
71
|
+
export declare function createStorageKey(purpose: string, options?: {
|
|
72
|
+
botId?: string;
|
|
73
|
+
}): string;
|
|
63
74
|
export {};
|
|
@@ -9,17 +9,19 @@ export interface DebalesContextType {
|
|
|
9
9
|
showUserInfoModel: boolean;
|
|
10
10
|
pendingBulkItems: VariantQuantity[];
|
|
11
11
|
lastedBotmessageId: string | null;
|
|
12
|
-
isFormClosedByUser: boolean;
|
|
13
12
|
uiData: UiData | null;
|
|
14
13
|
storeMetaData: ShopifyStoreMeta | null;
|
|
15
14
|
suggestedQuestions: SuggestedQuestionAnswer[];
|
|
16
|
-
|
|
15
|
+
isUserInfoNeeded: boolean;
|
|
16
|
+
userInfo: UserInfo | null;
|
|
17
|
+
input: string;
|
|
18
|
+
pendingQuestion: SuggestedQuestionAnswer | null;
|
|
19
|
+
isFormClosedByUser: boolean;
|
|
17
20
|
onSendMessage: (message: string, answer?: string, products?: Product[], fromKlaviyo?: boolean, leading_queries?: string[]) => Promise<void>;
|
|
18
21
|
setIsKlaviyoMessage: React.Dispatch<React.SetStateAction<boolean>>;
|
|
19
22
|
setShowUserInfoModel: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
23
|
setPendingBulkItems: React.Dispatch<React.SetStateAction<VariantQuantity[]>>;
|
|
21
24
|
setLastedBotmessageId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
22
|
-
setIsFormClosedByUser: React.Dispatch<React.SetStateAction<boolean>>;
|
|
23
25
|
fetchUiInfo: () => Promise<void>;
|
|
24
26
|
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
25
27
|
setIsMessageLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -28,7 +30,10 @@ export interface DebalesContextType {
|
|
|
28
30
|
saveConversation: (messages: Message[]) => void;
|
|
29
31
|
loadConversation: () => Message[];
|
|
30
32
|
setSuggestedQuestions: React.Dispatch<React.SetStateAction<SuggestedQuestionAnswer[]>>;
|
|
31
|
-
|
|
33
|
+
setInput: React.Dispatch<React.SetStateAction<string>>;
|
|
34
|
+
setPendingQuestion: React.Dispatch<React.SetStateAction<SuggestedQuestionAnswer | null>>;
|
|
35
|
+
setUserInfo: React.Dispatch<React.SetStateAction<UserInfo>>;
|
|
36
|
+
setIsFormClosedByUser: React.Dispatch<React.SetStateAction<boolean>>;
|
|
32
37
|
}
|
|
33
38
|
export interface WebsocketMessageEvent extends MessageEvent {
|
|
34
39
|
type: typeof EventType.MESSAGE | typeof EventType.USER_ACTION;
|