guideai-app 0.4.3-2 → 0.4.3-4
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/README.md +86 -2
- package/dist/GuideAI.d.ts +1 -1
- package/dist/GuideAI.js +1 -1
- package/dist/GuideAI.js.map +1 -1
- package/dist/components/Microphone.d.ts +3 -1
- package/dist/components/MuteButton.d.ts +15 -0
- package/dist/components/ResetButton.d.ts +13 -0
- package/dist/components/TranscriptBox.d.ts +14 -8
- package/dist/components/TranscriptMessages.d.ts +2 -2
- package/dist/components/TranscriptTextInput.d.ts +5 -4
- package/dist/components/TranscriptToggle.d.ts +3 -3
- package/dist/styles/GuideAI.styles.d.ts +7 -1
- package/dist/types/GuideAI.types.d.ts +4 -8
- package/dist/utils/api.d.ts +1 -7
- package/dist/utils/constants.d.ts +0 -2
- package/dist/utils/elementInteractions.d.ts +32 -1
- package/dist/utils/hover.d.ts +2 -0
- package/dist/utils/logger.d.ts +1 -5
- package/dist/utils/messageStorage.d.ts +16 -1
- package/package.json +6 -5
|
@@ -11,7 +11,9 @@ interface MicrophoneProps {
|
|
|
11
11
|
isConnecting: boolean;
|
|
12
12
|
status: RecordingStatus;
|
|
13
13
|
handleToggleConversation: () => void;
|
|
14
|
+
showTranscript: boolean;
|
|
15
|
+
hasMic: boolean;
|
|
14
16
|
React: typeof import('react');
|
|
15
17
|
}
|
|
16
|
-
declare const Microphone: ({ componentRef, baseStyles, hasInteracted, ephemeralToken, popupPosition, showOnboarding, handleOnboardingComplete, handleOnboardingClose, isConnecting, status, handleToggleConversation, React }: MicrophoneProps) => import("react").JSX.Element;
|
|
18
|
+
declare const Microphone: ({ componentRef, baseStyles, hasInteracted, ephemeralToken, popupPosition, showOnboarding, handleOnboardingComplete, handleOnboardingClose, isConnecting, status, handleToggleConversation, showTranscript, hasMic, React }: MicrophoneProps) => import("react").JSX.Element;
|
|
17
19
|
export default Microphone;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TranscriptPosition, MicButtonPosition } from '../types/GuideAI.types';
|
|
2
|
+
interface MuteButtonProps {
|
|
3
|
+
transcriptPosition: TranscriptPosition;
|
|
4
|
+
micPosition?: MicButtonPosition;
|
|
5
|
+
hasMic: boolean;
|
|
6
|
+
isMuted?: boolean;
|
|
7
|
+
handleToggleMute?: () => void;
|
|
8
|
+
isConversationActive?: boolean;
|
|
9
|
+
React: typeof import('react');
|
|
10
|
+
}
|
|
11
|
+
declare const MuteButton: {
|
|
12
|
+
({ transcriptPosition, micPosition, hasMic, isMuted, handleToggleMute, isConversationActive, React }: MuteButtonProps): import("react").JSX.Element | null;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default MuteButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TranscriptPosition, MicButtonPosition } from '../types/GuideAI.types';
|
|
2
|
+
interface ResetButtonProps {
|
|
3
|
+
transcriptPosition: TranscriptPosition;
|
|
4
|
+
micPosition?: MicButtonPosition;
|
|
5
|
+
isConversationActive?: boolean;
|
|
6
|
+
handleResetChatHistory?: () => void;
|
|
7
|
+
React: typeof import('react');
|
|
8
|
+
}
|
|
9
|
+
declare const ResetButton: {
|
|
10
|
+
({ transcriptPosition, micPosition, isConversationActive, handleResetChatHistory, React }: ResetButtonProps): import("react").JSX.Element | null;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default ResetButton;
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { StoredMessage } from '../utils/messageStorage';
|
|
2
2
|
import { TranscriptPosition, MicButtonPosition } from '../types/GuideAI.types';
|
|
3
3
|
interface TranscriptBoxProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
allMessages: StoredMessage[];
|
|
5
|
+
showTranscript: boolean;
|
|
6
|
+
handleCloseTranscript: () => void;
|
|
7
7
|
showToggleButton?: boolean;
|
|
8
|
-
|
|
8
|
+
handleToggleTranscript?: () => void;
|
|
9
9
|
showTextInput?: boolean;
|
|
10
10
|
textInput?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
setTextInput?: (value: string) => void;
|
|
12
|
+
handleTextSubmit?: () => void;
|
|
13
|
+
handleTextKeyPress?: (event: React.KeyboardEvent) => void;
|
|
14
14
|
textPlaceholder?: string;
|
|
15
15
|
micPosition?: MicButtonPosition;
|
|
16
16
|
transcriptPosition: TranscriptPosition;
|
|
17
|
+
hasMic: boolean;
|
|
18
|
+
isMuted?: boolean;
|
|
19
|
+
handleToggleMute?: () => void;
|
|
20
|
+
isConversationActive?: boolean;
|
|
21
|
+
handleResetChatHistory?: () => void;
|
|
22
|
+
isDataChannelOpen?: boolean;
|
|
17
23
|
React: typeof import('react');
|
|
18
24
|
}
|
|
19
25
|
declare const TranscriptBox: {
|
|
20
|
-
(
|
|
26
|
+
({ allMessages, showTranscript, handleCloseTranscript, showToggleButton, handleToggleTranscript, showTextInput, textInput, setTextInput, handleTextSubmit, handleTextKeyPress, textPlaceholder, micPosition, transcriptPosition, hasMic, isMuted, handleToggleMute, isConversationActive, handleResetChatHistory, isDataChannelOpen, React }: TranscriptBoxProps): import("react").JSX.Element | null;
|
|
21
27
|
displayName: string;
|
|
22
28
|
};
|
|
23
29
|
export default TranscriptBox;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StoredMessage } from '../utils/messageStorage';
|
|
2
2
|
interface TranscriptMessagesProps {
|
|
3
|
-
|
|
3
|
+
allMessages: StoredMessage[];
|
|
4
4
|
messagesEndRef: React.RefObject<HTMLDivElement>;
|
|
5
5
|
React: typeof import('react');
|
|
6
6
|
}
|
|
7
|
-
declare const TranscriptMessages: ({
|
|
7
|
+
declare const TranscriptMessages: ({ allMessages, messagesEndRef, React }: TranscriptMessagesProps) => import("react").JSX.Element;
|
|
8
8
|
export default TranscriptMessages;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
interface TranscriptTextInputProps {
|
|
2
2
|
textInput?: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
setTextInput?: (value: string) => void;
|
|
4
|
+
handleTextSubmit?: () => void;
|
|
5
|
+
handleTextKeyPress?: (event: React.KeyboardEvent) => void;
|
|
6
6
|
textPlaceholder?: string;
|
|
7
|
+
isDataChannelOpen?: boolean;
|
|
7
8
|
React: typeof import('react');
|
|
8
9
|
}
|
|
9
|
-
declare const TranscriptTextInput: ({ textInput,
|
|
10
|
+
declare const TranscriptTextInput: ({ textInput, setTextInput, handleTextSubmit, handleTextKeyPress, textPlaceholder, isDataChannelOpen, React }: TranscriptTextInputProps) => import("react").JSX.Element;
|
|
10
11
|
export default TranscriptTextInput;
|
|
@@ -2,9 +2,9 @@ import { TranscriptPosition, MicButtonPosition } from '../types/GuideAI.types';
|
|
|
2
2
|
interface TranscriptToggleProps {
|
|
3
3
|
transcriptPosition: TranscriptPosition;
|
|
4
4
|
micPosition?: MicButtonPosition;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
showTranscript: boolean;
|
|
6
|
+
handleToggleTranscript?: () => void;
|
|
7
7
|
React: typeof import('react');
|
|
8
8
|
}
|
|
9
|
-
declare const TranscriptToggle: ({ transcriptPosition, micPosition,
|
|
9
|
+
declare const TranscriptToggle: ({ transcriptPosition, micPosition, showTranscript, handleToggleTranscript, React }: TranscriptToggleProps) => import("react").JSX.Element;
|
|
10
10
|
export default TranscriptToggle;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export declare const guideAIStyles = "\n.guideai-main-ui {\n position: relative;\n}\n\n.guideai-main-controls {\n display: flex;\n align-items: center;\n gap: 12px;\n position: relative;\n}\n\n.guideai-welcome-bubble {\n position: absolute;\n background: #0066ff;\n color: white;\n padding: 10px 16px;\n border-radius: 20px;\n font-size: 14px;\n white-space: normal;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n animation: bubble-pulse 2s infinite;\n max-width: 280px;\n min-width: 200px;\n text-align: center;\n line-height: 1.3;\n}\n\n/* Vertical positioning - backwards compatible */\n.guideai-welcome-bubble.above,\n.guideai-welcome-bubble.above-center,\n.guideai-welcome-bubble.above-left,\n.guideai-welcome-bubble.above-right {\n bottom: calc(100% + 10px);\n}\n\n.guideai-welcome-bubble.below,\n.guideai-welcome-bubble.below-center,\n.guideai-welcome-bubble.below-left,\n.guideai-welcome-bubble.below-right {\n top: calc(100% + 10px);\n}\n\n/* Horizontal positioning - centered (default) */\n.guideai-welcome-bubble.above,\n.guideai-welcome-bubble.above-center,\n.guideai-welcome-bubble.below,\n.guideai-welcome-bubble.below-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\n/* Horizontal positioning - left aligned */\n.guideai-welcome-bubble.above-left,\n.guideai-welcome-bubble.below-left {\n left: 0;\n transform: translateX(0);\n animation: bubble-pulse-left 2s infinite;\n}\n\n/* Horizontal positioning - right aligned */\n.guideai-welcome-bubble.above-right,\n.guideai-welcome-bubble.below-right {\n left: auto;\n right: 0;\n transform: translateX(0);\n animation: bubble-pulse-right 2s infinite;\n}\n\n/* Arrow pointers - centered versions */\n.guideai-welcome-bubble.above::after,\n.guideai-welcome-bubble.above-center::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid #0066ff;\n}\n\n.guideai-welcome-bubble.below::after,\n.guideai-welcome-bubble.below-center::after {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid #0066ff;\n}\n\n/* Arrow pointers - left aligned versions */\n.guideai-welcome-bubble.above-left::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid #0066ff;\n}\n\n.guideai-welcome-bubble.below-left::after {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid #0066ff;\n}\n\n/* Arrow pointers - right aligned versions */\n.guideai-welcome-bubble.above-right::after {\n content: '';\n position: absolute;\n top: 100%;\n right: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid #0066ff;\n}\n\n.guideai-welcome-bubble.below-right::after {\n content: '';\n position: absolute;\n bottom: 100%;\n right: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid #0066ff;\n}\n\n@keyframes bubble-pulse {\n 0% { transform: translateX(-50%) scale(1); }\n 50% { transform: translateX(-50%) scale(1.05); }\n 100% { transform: translateX(-50%) scale(1); }\n}\n\n@keyframes bubble-pulse-left {\n 0% { transform: translateX(0) scale(1); }\n 50% { transform: translateX(0) scale(1.05); }\n 100% { transform: translateX(0) scale(1); }\n}\n\n@keyframes bubble-pulse-right {\n 0% { transform: translateX(0) scale(1); }\n 50% { transform: translateX(0) scale(1.05); }\n 100% { transform: translateX(0) scale(1); }\n}\n\n.guideai-icon-wrapper {\n width: 50px;\n height: 50px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, 0.9);\n border: 2px solid transparent;\n border-radius: 50%;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.guideai-icon-wrapper:not(.initializing):hover {\n transform: scale(1.1);\n}\n\n.guideai-icon-wrapper.initializing {\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 0 0 2px rgba(128, 128, 128, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);\n animation: guideai-spin 1.5s linear infinite;\n opacity: 0.7;\n cursor: default;\n}\n\n.guideai-icon-wrapper.recording {\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);\n animation: guideai-pulse 1s infinite alternate;\n}\n\n.guideai-icon-wrapper.processing {\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);\n animation: guideai-spin 1s linear infinite;\n}\n\n.guideai-icon-wrapper.playing {\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 0 0 2px rgba(0, 128, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);\n}\n\n@keyframes guideai-pulse {\n 0% { transform: scale(1); }\n 100% { transform: scale(1.05); }\n}\n\n@keyframes guideai-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes click-ripple-animation {\n 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }\n 50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }\n 100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }\n}\n\n@keyframes click-dot-animation {\n 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }\n 60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }\n 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }\n}\n\n@keyframes cursor-jiggle {\n 0% { transform: translate(-50%, 0) scale(1); }\n 25% { transform: translate(-50%, -5px) scale(1.1); }\n 50% { transform: translate(-50%, 0) scale(1); }\n 75% { transform: translate(-50%, 5px) scale(1.1); }\n 100% { transform: translate(-50%, 0) scale(1); filter: drop-shadow(0 0 8px #0066ff); }\n}\n\n.guideai-icon {\n width: 60%;\n height: 60%;\n min-width: 16px;\n min-height: 16px;\n max-width: 40px;\n max-height: 40px;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.guideai-icon.initializing {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"%23808080\" d=\"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z\"/></svg>');\n}\n\n.guideai-icon.microphone {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path fill=\"%230000FF\" d=\"M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z\"/></svg>');\n}\n\n.guideai-icon.recording {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><circle cx=\"256\" cy=\"256\" r=\"128\" fill=\"%23FF0000\"/><circle cx=\"256\" cy=\"256\" r=\"200\" stroke=\"%23FF0000\" stroke-width=\"20\" fill=\"none\"/></svg>');\n}\n\n.guideai-icon.processing {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"%23FFA500\" d=\"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z\"/></svg>');\n}\n\n.guideai-icon.playing {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"%23008000\" d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\"/></svg>');\n}\n\n.guideai-icon.text-mode {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"%230066ff\" d=\"M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM7 10v2h2v-2H7zm6 2h-2v-2h2v2zm4 0h-2v-2h2v2z\"/></svg>');\n}\n\n.guideai-icon.voice-mode {\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path fill=\"%23008000\" d=\"M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z\"/></svg>');\n}\n\n\n/* Onboarding styles */\n.guideai-onboarding {\n position: absolute;\n background: white;\n border-radius: 12px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n width: 300px;\n max-width: 90vw;\n z-index: 90009000;\n animation: onboarding-fade-in 0.3s ease-out;\n}\n\n/* Vertical positioning - backwards compatible */\n.guideai-onboarding.above,\n.guideai-onboarding.above-center,\n.guideai-onboarding.above-left,\n.guideai-onboarding.above-right {\n bottom: calc(100% + 15px);\n}\n\n.guideai-onboarding.below,\n.guideai-onboarding.below-center,\n.guideai-onboarding.below-left,\n.guideai-onboarding.below-right {\n top: calc(100% + 15px);\n}\n\n/* Horizontal positioning - centered (default) */\n.guideai-onboarding.above,\n.guideai-onboarding.above-center,\n.guideai-onboarding.below,\n.guideai-onboarding.below-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\n/* Horizontal positioning - left aligned (prevents right overflow) */\n.guideai-onboarding.above-left,\n.guideai-onboarding.below-left {\n left: 0;\n transform: translateX(0);\n}\n\n/* Horizontal positioning - right aligned (prevents left overflow) */\n.guideai-onboarding.above-right,\n.guideai-onboarding.below-right {\n left: auto;\n right: 0;\n transform: translateX(0);\n}\n\n/* Arrow pointers - centered versions */\n.guideai-onboarding.above::after,\n.guideai-onboarding.above-center::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid white;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n}\n\n.guideai-onboarding.below::after,\n.guideai-onboarding.below-center::after {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid white;\n filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));\n}\n\n/* Arrow pointers - left aligned versions */\n.guideai-onboarding.above-left::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid white;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n}\n\n.guideai-onboarding.below-left::after {\n content: '';\n position: absolute;\n bottom: 100%;\n left: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid white;\n filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));\n}\n\n/* Arrow pointers - right aligned versions */\n.guideai-onboarding.above-right::after {\n content: '';\n position: absolute;\n top: 100%;\n right: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid white;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n}\n\n.guideai-onboarding.below-right::after {\n content: '';\n position: absolute;\n bottom: 100%;\n right: 25px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 8px solid white;\n filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));\n}\n\n@keyframes onboarding-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.guideai-onboarding-content {\n padding: 16px;\n position: relative;\n}\n\n.guideai-onboarding-close {\n position: absolute;\n top: 10px;\n right: 10px;\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n color: #999;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n}\n\n.guideai-onboarding-close:hover {\n background: #f5f5f5;\n color: #333;\n}\n\n.guideai-onboarding-step {\n text-align: center;\n margin-bottom: 12px;\n}\n\n.guideai-onboarding-icon {\n font-size: 32px;\n margin-bottom: 8px;\n display: inline-block;\n}\n\n.guideai-onboarding-step h3 {\n margin: 0 0 8px;\n font-size: 16px;\n color: #333;\n font-weight: 600;\n}\n\n.guideai-onboarding-step p {\n margin: 0;\n font-size: 13px;\n color: #666;\n line-height: 1.4;\n}\n\n.guideai-onboarding-dots {\n display: flex;\n justify-content: center;\n margin: 12px 0;\n}\n\n.guideai-onboarding-dots .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #ddd;\n margin: 0 4px;\n transition: all 0.3s ease;\n}\n\n.guideai-onboarding-dots .dot.active {\n background: #0066ff;\n transform: scale(1.2);\n}\n\n.guideai-onboarding-next {\n display: block;\n width: 100%;\n padding: 10px;\n background: #0066ff;\n color: white;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s ease;\n}\n\n.guideai-onboarding-next:hover {\n background: #0055cc;\n}\n\n/* Transcript Box Styles */\n.guideai-transcript-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: transparent;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n z-index: 90009000;\n animation: transcript-fade-in 0.3s ease-out;\n pointer-events: none;\n}\n\n.guideai-transcript-box {\n background: rgba(40, 44, 52, 0.85);\n backdrop-filter: blur(20px);\n -webkit-backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: \n 0 8px 32px rgba(0, 0, 0, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2),\n inset 0 -1px 0 rgba(0, 0, 0, 0.1);\n width: 280px;\n max-height: 280px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n animation: transcript-slide-up 0.4s ease-out;\n pointer-events: auto;\n position: relative;\n}\n\n.guideai-transcript-box::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);\n border-radius: 16px 16px 0 0;\n}\n\n\n\n.guideai-transcript-messages {\n flex: 1;\n overflow-y: auto;\n padding: 8px 12px;\n max-height: 200px;\n}\n\n.guideai-transcript-messages::-webkit-scrollbar {\n width: 6px;\n}\n\n.guideai-transcript-messages::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.05);\n border-radius: 3px;\n}\n\n.guideai-transcript-messages::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n}\n\n.guideai-transcript-messages::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.3);\n}\n\n.guideai-transcript-empty {\n text-align: center;\n padding: 20px 12px;\n color: rgba(255, 255, 255, 0.6);\n}\n\n.guideai-transcript-empty-icon {\n font-size: 24px;\n margin-bottom: 8px;\n opacity: 0.5;\n}\n\n.guideai-transcript-empty p {\n margin: 0;\n font-size: 11px;\n color: rgba(255, 255, 255, 0.6);\n}\n\n.guideai-transcript-message {\n margin-bottom: 8px;\n animation: message-fade-in 0.3s ease-out;\n}\n\n.guideai-transcript-message.human {\n text-align: right;\n}\n\n.guideai-transcript-message.guideai {\n text-align: left;\n}\n\n.guideai-transcript-message-content {\n display: inline-block;\n max-width: 85%;\n padding: 6px 10px;\n border-radius: 12px;\n position: relative;\n}\n\n.guideai-transcript-message.human .guideai-transcript-message-content {\n background: rgba(255, 255, 255, 0.15);\n color: rgba(255, 255, 255, 0.95);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-bottom-right-radius: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n}\n\n.guideai-transcript-message.guideai .guideai-transcript-message-content {\n background: rgba(0, 0, 0, 0.1);\n color: rgba(255, 255, 255, 0.9);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-bottom-left-radius: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n}\n\n.guideai-transcript-message-sender {\n font-size: 9px;\n font-weight: 600;\n margin-bottom: 2px;\n opacity: 0.8;\n}\n\n.guideai-transcript-message-text {\n font-size: 11px;\n line-height: 1.3;\n word-wrap: break-word;\n}\n\n.guideai-transcript-message-time {\n font-size: 8px;\n opacity: 0.6;\n margin-top: 2px;\n}\n\n\n\n@keyframes transcript-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes transcript-slide-up {\n from { \n opacity: 0; \n transform: translateX(40px) scale(0.95); \n }\n to { \n opacity: 1; \n transform: translateX(0) scale(1); \n }\n}\n\n@keyframes message-fade-in {\n from { \n opacity: 0; \n transform: translateY(10px); \n }\n to { \n opacity: 1; \n transform: translateY(0); \n }\n}\n\n/* Transcript Toggle Button Styles - positioned directly above mic button */\n.guideai-transcript-toggle-button {\n position: fixed;\n width: 36px;\n height: 36px;\n background: rgba(40, 44, 52, 0.9);\n backdrop-filter: blur(10px);\n -webkit-backdrop-filter: blur(10px);\n border: 1px solid rgba(255, 255, 255, 0.15);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);\n transition: all 0.2s ease;\n z-index: 90009000;\n font-size: 14px;\n padding: 0;\n color: rgba(255, 255, 255, 0.9);\n animation: toggle-fade-in 0.3s ease-out;\n pointer-events: auto;\n}\n\n.guideai-transcript-toggle-button:hover {\n background: rgba(40, 44, 52, 1);\n transform: scale(1.1);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);\n}\n\n.guideai-transcript-toggle-button:active {\n transform: scale(0.95);\n}\n\n.guideai-transcript-toggle-icon {\n display: inline-block;\n transition: all 0.2s ease;\n filter: none;\n}\n\n/* Position transcript toggle button based on transcript position */\n.guideai-transcript-overlay {\n pointer-events: none;\n}\n\n/* Input Options Container - Two Stage Layout */\n.guideai-input-options {\n display: flex;\n align-items: center;\n gap: 12px;\n position: relative;\n animation: options-slide-in 0.4s ease-out;\n}\n\n@keyframes options-slide-in {\n 0% {\n opacity: 0;\n transform: scale(0.8);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n/* Individual Input Option Button */\n.guideai-input-option {\n width: 50px;\n height: 50px;\n background: rgba(255, 255, 255, 0.9);\n border: 2px solid rgba(0, 0, 0, 0.1);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n transition: all 0.3s ease;\n font-size: 18px;\n padding: 0;\n position: relative;\n}\n\n.guideai-input-option:hover:not(:disabled) {\n background: rgba(255, 255, 255, 1);\n transform: scale(1.1);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);\n}\n\n.guideai-input-option:active:not(:disabled) {\n transform: scale(0.95);\n}\n\n.guideai-input-option:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n}\n\n/* Voice Option Specific Styling */\n.guideai-input-option.voice-option {\n background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));\n border-color: rgba(76, 175, 80, 0.3);\n}\n\n.guideai-input-option.voice-option:hover:not(:disabled) {\n background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(139, 195, 74, 0.2));\n border-color: rgba(76, 175, 80, 0.5);\n}\n\n/* Text Option Specific Styling */\n.guideai-input-option.text-option {\n background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(63, 81, 181, 0.1));\n border-color: rgba(33, 150, 243, 0.3);\n}\n\n.guideai-input-option.text-option:hover:not(:disabled) {\n background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(63, 81, 181, 0.2));\n border-color: rgba(33, 150, 243, 0.5);\n}\n\n.guideai-input-option-icon {\n display: inline-block;\n transition: all 0.2s ease;\n filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));\n}\n\n/* Text Input integrated into Transcript Box */\n.guideai-transcript-text-input {\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n padding: 12px;\n display: flex;\n gap: 8px;\n align-items: flex-end;\n background: rgba(0, 0, 0, 0.02);\n border-radius: 0 0 16px 16px;\n animation: text-input-fade-in 0.3s ease-out;\n}\n\n.guideai-transcript-input-field {\n flex: 1;\n background: rgba(255, 255, 255, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 8px;\n padding: 8px 12px;\n color: rgba(255, 255, 255, 0.95);\n font-size: 12px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n resize: none;\n outline: none;\n transition: all 0.2s ease;\n min-height: 32px;\n}\n\n.guideai-transcript-input-field::placeholder {\n color: rgba(255, 255, 255, 0.6);\n}\n\n.guideai-transcript-input-field:focus {\n border-color: rgba(255, 255, 255, 0.4);\n background: rgba(255, 255, 255, 0.2);\n box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);\n}\n\n.guideai-transcript-send-button {\n background: rgba(255, 255, 255, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n padding: 6px 10px;\n color: rgba(255, 255, 255, 0.9);\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n height: 32px;\n}\n\n.guideai-transcript-send-button:hover:not(:disabled) {\n background: rgba(255, 255, 255, 0.25);\n border-color: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n}\n\n.guideai-transcript-send-button:active:not(:disabled) {\n transform: translateY(0);\n}\n\n.guideai-transcript-send-button:disabled {\n background: rgba(255, 255, 255, 0.05);\n border-color: rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.4);\n cursor: not-allowed;\n transform: none;\n}\n\n.guideai-transcript-send-icon {\n font-size: 11px;\n}\n\n/* Animation for text input appearance */\n@keyframes text-input-fade-in {\n from { \n opacity: 0; \n transform: translateY(10px); \n }\n to { \n opacity: 1; \n transform: translateY(0); \n }\n}\n\n@keyframes toggle-fade-in {\n from { \n opacity: 0; \n transform: scale(0.8); \n }\n to { \n opacity: 1; \n transform: scale(1); \n }\n}\n\n/* Hover effect animations */\n@keyframes hover-pulse {\n 0%, 100% {\n opacity: 0.6;\n transform: scale(1);\n box-shadow: 0 0 10px rgba(255, 165, 0, 0.6);\n }\n 25% {\n opacity: 0.9;\n transform: scale(1.03);\n box-shadow: 0 0 20px rgba(255, 165, 0, 0.8);\n }\n 50% {\n opacity: 1;\n transform: scale(1.05);\n box-shadow: 0 0 25px rgba(255, 165, 0, 1);\n }\n 75% {\n opacity: 0.9;\n transform: scale(1.03);\n box-shadow: 0 0 20px rgba(255, 165, 0, 0.8);\n }\n}\n\n@keyframes hover-indicator-fade {\n from { \n opacity: 0; \n transform: translateX(-50%) translateY(-10px); \n }\n to { \n opacity: 1; \n transform: translateX(-50%) translateY(0); \n }\n}\n\n@keyframes cursor-hover-float {\n 0%, 100% {\n transform: translate(-50%, 0) translateY(0px);\n }\n 25% {\n transform: translate(-50%, 0) translateY(-3px);\n }\n 50% {\n transform: translate(-50%, 0) translateY(-6px);\n }\n 75% {\n transform: translate(-50%, 0) translateY(-3px);\n }\n}\n\n\n";
|
|
1
|
+
export interface ZIndexConfig {
|
|
2
|
+
main: number;
|
|
3
|
+
transcript: number;
|
|
4
|
+
microphone: number;
|
|
5
|
+
onboarding: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const guideAIStyles: (zIndexConfig: ZIndexConfig) => string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MetadataConfig, UserMetadata } from './metadata.types';
|
|
2
1
|
import { VisualContextConfig } from '../visualContext/types';
|
|
3
2
|
export type RecordingStatus = 'idle' | 'recording' | 'processing' | 'playing';
|
|
4
3
|
export type UseStateHook = <T>(initialState: T | (() => T)) => [T, (value: T | ((prev: T) => T)) => void];
|
|
@@ -8,7 +7,7 @@ export type UseRefHook = <T>(initialValue: T) => {
|
|
|
8
7
|
};
|
|
9
8
|
export type UseCallbackHook = <T extends (...args: any[]) => any>(callback: T, deps: any[]) => T;
|
|
10
9
|
export type GuideAIEnvironment = 'development' | 'production' | 'local';
|
|
11
|
-
export type
|
|
10
|
+
export type GuideAIPosition = {
|
|
12
11
|
top?: string;
|
|
13
12
|
right?: string;
|
|
14
13
|
bottom?: string;
|
|
@@ -18,20 +17,17 @@ export type MicButtonPosition = {
|
|
|
18
17
|
marginBottom?: string;
|
|
19
18
|
marginLeft?: string;
|
|
20
19
|
transform?: string;
|
|
20
|
+
zIndex?: number;
|
|
21
21
|
};
|
|
22
|
+
export type MicButtonPosition = GuideAIPosition;
|
|
22
23
|
export interface GuideAIProps {
|
|
23
24
|
organizationKey: string;
|
|
24
25
|
workflowKey?: string;
|
|
25
26
|
environment?: GuideAIEnvironment;
|
|
26
27
|
React: typeof import('react');
|
|
27
28
|
ReactDOM: any;
|
|
28
|
-
position?:
|
|
29
|
+
position?: GuideAIPosition;
|
|
29
30
|
onError?: (error: string | Error, context?: string) => void;
|
|
30
|
-
metadata?: {
|
|
31
|
-
config?: MetadataConfig;
|
|
32
|
-
initialUserData?: Partial<UserMetadata>;
|
|
33
|
-
onMetadataUpdate?: (metadata: UserMetadata) => void;
|
|
34
|
-
};
|
|
35
31
|
transcript?: {
|
|
36
32
|
enabled?: boolean;
|
|
37
33
|
showToggleButton?: boolean;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MetadataUpdate } from '../types/metadata.types';
|
|
2
1
|
import { GuideAIEnvironment } from '../types/GuideAI.types';
|
|
3
2
|
interface Workflow {
|
|
4
3
|
id: string;
|
|
@@ -11,17 +10,12 @@ interface Workflow {
|
|
|
11
10
|
updatedAt: string;
|
|
12
11
|
}
|
|
13
12
|
interface ConversationData {
|
|
13
|
+
tokenExpiresAt: number;
|
|
14
14
|
id: string;
|
|
15
15
|
ephemeralToken: string;
|
|
16
16
|
prompt: string;
|
|
17
17
|
workflows: Workflow[];
|
|
18
|
-
userMetadata?: {
|
|
19
|
-
visitCount: number;
|
|
20
|
-
loginCount?: number;
|
|
21
|
-
email?: string;
|
|
22
|
-
};
|
|
23
18
|
}
|
|
24
19
|
export declare const createNewConversation: (organizationKey: string, onError: (error: Error, context: string) => void, workflowKey?: string, environment?: GuideAIEnvironment) => Promise<ConversationData | null>;
|
|
25
20
|
export type { Workflow };
|
|
26
21
|
export declare const logMessage: (content: string, sender: "GUIDEAI" | "HUMAN", conversationId: string | null, organizationKey: string, onError: (error: Error, context: string) => void, environment?: GuideAIEnvironment) => Promise<void>;
|
|
27
|
-
export declare const sendMetadataUpdates: (updates: MetadataUpdate[], organizationKey: string, onError: (error: Error, context: string) => void, environment?: GuideAIEnvironment) => Promise<boolean>;
|
|
@@ -5,7 +5,5 @@ export declare const GUIDE_AI_API_BASE_DEV = "https://dev.getguide.ai/api";
|
|
|
5
5
|
export declare const GUIDE_AI_API_BASE_LOCAL = "http://localhost:3000/api";
|
|
6
6
|
export declare const getApiBaseUrl: (environment?: "development" | "production" | "local") => string;
|
|
7
7
|
export declare const GUIDE_AI_API_BASE = "https://www.getguide.ai/api";
|
|
8
|
-
export declare const METADATA_API_BASE = "http://localhost:3000/api";
|
|
9
8
|
export declare const OPENAI_REALTIME_BASE = "https://api.openai.com/v1/realtime";
|
|
10
|
-
export declare const OPENAI_REALTIME_MODEL = "gpt-realtime-2025-08-28";
|
|
11
9
|
export type ElementInteractionType = "HIGHLIGHT" | "HOVERANDCLICK";
|
|
@@ -17,7 +17,7 @@ export declare const findElementBySelector: (selector: string) => Element | null
|
|
|
17
17
|
export declare const interactWithElement: (element: Element, cursorElement: HTMLElement | null, state: ElementInteractionType, hoverTime?: number) => Promise<HTMLElement | null>;
|
|
18
18
|
export declare const processSelectorsInteraction: (selectors: string | string[], isInteracting: boolean, setIsInteracting: (interacting: boolean) => void, onEachElement: (element: Element, cursor: HTMLElement | null, index: number) => Promise<HTMLElement | null>, onComplete?: (lastElement: Element | null, cursor: HTMLElement | null) => Promise<void>) => Promise<boolean>;
|
|
19
19
|
export declare const parseArgs: (argsToUse: string) => Promise<any>;
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const Highlight_Click_Tool: {
|
|
21
21
|
type: string;
|
|
22
22
|
name: string;
|
|
23
23
|
description: string;
|
|
@@ -42,6 +42,37 @@ export declare const Highlight_Tool: {
|
|
|
42
42
|
required: string[];
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
|
+
export declare const Hover_Click_Tool: {
|
|
46
|
+
type: string;
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
parameters: {
|
|
50
|
+
type: string;
|
|
51
|
+
properties: {
|
|
52
|
+
selector: {
|
|
53
|
+
oneOf: ({
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
items?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
items: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
description: string;
|
|
63
|
+
})[];
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
hoverTime: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
minimum: number;
|
|
70
|
+
maximum: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
required: string[];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
45
76
|
export declare const Hover_Tool: {
|
|
46
77
|
type: string;
|
|
47
78
|
name: string;
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Component = 'GuideAI' | '
|
|
1
|
+
type Component = 'GuideAI' | 'API' | 'TranscriptBox' | 'Onboarding' | 'VisualContext' | 'MessageStorage';
|
|
2
2
|
declare class Logger {
|
|
3
3
|
private static formatMessage;
|
|
4
4
|
private static checkLoggingEnabled;
|
|
@@ -30,9 +30,5 @@ declare class Logger {
|
|
|
30
30
|
* Conversation flow tracking
|
|
31
31
|
*/
|
|
32
32
|
static conversation(action: string, data?: any): void;
|
|
33
|
-
/**
|
|
34
|
-
* Metadata tracking logging
|
|
35
|
-
*/
|
|
36
|
-
static metadata(action: string, data?: any): void;
|
|
37
33
|
}
|
|
38
34
|
export default Logger;
|
|
@@ -5,15 +5,25 @@ export interface StoredMessage {
|
|
|
5
5
|
}
|
|
6
6
|
export interface StoredConversation {
|
|
7
7
|
conversationId: string;
|
|
8
|
+
conversationKey?: string;
|
|
8
9
|
messages: StoredMessage[];
|
|
9
10
|
timestamp: number;
|
|
10
11
|
organizationKey: string;
|
|
12
|
+
keyExpiresAt?: number;
|
|
13
|
+
sessionExpiresAt?: number;
|
|
11
14
|
}
|
|
12
15
|
export declare const CONVERSATION_STORAGE_KEY = "guideai_conversation";
|
|
13
16
|
export declare const CONVERSATION_EXPIRY_MINUTES = 30;
|
|
14
17
|
export declare const MAX_STORED_MESSAGES = 100;
|
|
15
18
|
export declare const isLocalStorageAvailable: () => boolean;
|
|
16
|
-
export declare const
|
|
19
|
+
export declare const initializeConversationStorage: (organizationKey: string, conversationId: string, conversationKey: string, keyExpiresAt: number) => void;
|
|
20
|
+
export declare const getConversationKey: (organizationKey: string) => string | null | undefined;
|
|
21
|
+
export declare const resetConversationKey: (organizationKey: string) => void;
|
|
22
|
+
export declare const isKeyExpired: (organizationKey: string) => boolean;
|
|
23
|
+
export declare const isSessionExpired: (organizationKey: string) => boolean;
|
|
24
|
+
export declare const isConversationExpired: (organizationKey: string) => boolean;
|
|
25
|
+
export declare const updateSessionExpiresAt: (organizationKey: string, sessionExpiresAt: number) => void;
|
|
26
|
+
export declare const getConversationId: (organizationKey: string) => string | null;
|
|
17
27
|
export declare const saveConversationToStorage: (conversation: StoredConversation) => void;
|
|
18
28
|
export declare const loadConversationFromStorage: () => StoredConversation | null;
|
|
19
29
|
export declare const clearConversationStorage: () => void;
|
|
@@ -24,3 +34,8 @@ export declare const checkForStoredConversation: (currentOrganizationKey: string
|
|
|
24
34
|
messages: StoredMessage[] | null;
|
|
25
35
|
};
|
|
26
36
|
export declare const formatConversationContext: (messages: StoredMessage[], maxMessages?: number) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Get messages from localStorage as the single source of truth
|
|
39
|
+
* This ensures all components read from the same storage location
|
|
40
|
+
*/
|
|
41
|
+
export declare const getMessagesFromStorage: (organizationKey: string) => StoredMessage[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guideai-app",
|
|
3
|
-
"version": "0.4.3-
|
|
3
|
+
"version": "0.4.3-4",
|
|
4
4
|
"description": "AI-powered guide component for React applications",
|
|
5
5
|
"main": "dist/GuideAI.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"registry": "https://npm.pkg.github.com"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "webpack && tsc --emitDeclarationOnly && javascript-obfuscator dist/GuideAI.js --config obfuscator.json --output dist/GuideAI.js",
|
|
19
|
+
"build": "webpack --mode=production && tsc --emitDeclarationOnly && javascript-obfuscator dist/GuideAI.js --config obfuscator.json --output dist/GuideAI.js",
|
|
20
|
+
"build:dev": "webpack --mode=development && tsc --emitDeclarationOnly",
|
|
20
21
|
"prepare": "npm run build",
|
|
21
22
|
"test": "jest",
|
|
22
23
|
"test:watch": "jest --watch",
|
|
@@ -37,8 +38,8 @@
|
|
|
37
38
|
"openai": "^4.28.0"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
41
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
41
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
42
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -59,4 +60,4 @@
|
|
|
59
60
|
"webpack": "^5.98.0",
|
|
60
61
|
"webpack-cli": "^6.0.1"
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
}
|