@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.
@@ -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: ({ uidata, botId, showModel, setShowModel, selectedSuggestedQuestionAnswer, sendMessage, botNameColor, inChat, showFormInstructions, }: Props) => import("react/jsx-runtime").JSX.Element | null;
13
+ export declare const UserInfoModel: ({ inChat, showFormInstructions, setShowModel, }: Props) => import("react/jsx-runtime").JSX.Element | null;
22
14
  export {};
@@ -1,7 +1,4 @@
1
- import { UiData } from '../../types';
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;
@@ -1,4 +1,4 @@
1
- export declare const isProduction = true;
1
+ export declare const isProduction = false;
2
2
  declare const API_BASE_URL: string;
3
3
  export declare const WEBSOCKET_BASE_URL: string;
4
4
  declare const ENABLE_MIXPANEL = true;
@@ -7,4 +7,6 @@ export declare const STORAGE_KEY_PURPOSE: {
7
7
  CHAT_RATING: string;
8
8
  SHOPIFY_META_DATA: string;
9
9
  SESSION_ID: string;
10
+ USER_INFO: string;
11
+ IS_FORM_CLOSED_BY_USER: string;
10
12
  };
@@ -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
- export declare function createStorageKey(botId: string, purpose: string): string;
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
- needUserInfo: boolean;
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
- setNeedUserInfo: React.Dispatch<React.SetStateAction<boolean>>;
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;
@@ -78,7 +78,7 @@ export interface Product {
78
78
  }
79
79
  export interface SuggestedQuestionAnswer {
80
80
  question: string;
81
- answer: string;
81
+ answer?: string;
82
82
  products?: Product[];
83
83
  path: string;
84
84
  nameSpace: string;