guideai-app 0.2.3 → 0.2.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.
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { PopupPosition } from '../types/GuideAI.types';
3
+ interface OnboardingProps {
4
+ position: PopupPosition;
5
+ isVisible: boolean;
6
+ onComplete: () => void;
7
+ onClose: () => void;
8
+ }
9
+ declare const Onboarding: React.FC<OnboardingProps>;
10
+ export default Onboarding;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { PopupPosition } from '../types/GuideAI.types';
3
+ interface WelcomeBubbleProps {
4
+ position: PopupPosition;
5
+ }
6
+ declare const WelcomeBubble: React.FC<WelcomeBubbleProps>;
7
+ export default WelcomeBubble;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import GuideAI from './GuideAI';
2
2
  export default GuideAI;
3
- export type { GuideAIProps } from './GuideAI';
3
+ export type { GuideAIProps } from './types/GuideAI.types';
@@ -0,0 +1 @@
1
+ export declare const guideAIStyles = "\n.sarge-main-ui {\n position: relative;\n}\n\n.sarge-welcome-bubble {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\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.sarge-welcome-bubble.above {\n bottom: calc(100% + 10px);\n}\n\n.sarge-welcome-bubble.below {\n top: calc(100% + 10px);\n}\n\n.sarge-welcome-bubble.above::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.sarge-welcome-bubble.below::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@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.sarge-icon-wrapper {\n width: 100%;\n height: 100%;\n min-width: 30px;\n min-height: 30px;\n max-width: 60px;\n max-height: 60px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, 0.9);\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.sarge-icon-wrapper:not(.initializing):hover {\n transform: scale(1.1);\n}\n\n.sarge-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: sarge-spin 1.5s linear infinite;\n opacity: 0.7;\n cursor: default;\n}\n\n.sarge-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: sarge-pulse 1s infinite alternate;\n}\n\n.sarge-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: sarge-spin 1s linear infinite;\n}\n\n.sarge-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 sarge-pulse {\n 0% { transform: scale(1); }\n 100% { transform: scale(1.05); }\n}\n\n@keyframes sarge-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.sarge-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.sarge-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.sarge-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.sarge-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.sarge-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.sarge-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/* Onboarding styles */\n.sarge-onboarding {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\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: 1002;\n animation: onboarding-fade-in 0.3s ease-out;\n}\n\n.sarge-onboarding.above {\n bottom: calc(100% + 15px);\n}\n\n.sarge-onboarding.below {\n top: calc(100% + 15px);\n}\n\n.sarge-onboarding.above::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.sarge-onboarding.below::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@keyframes onboarding-fade-in {\n from { opacity: 0; transform: translateX(-50%) translateY(-10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n}\n\n.sarge-onboarding-content {\n padding: 16px;\n position: relative;\n}\n\n.sarge-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.sarge-onboarding-close:hover {\n background: #f5f5f5;\n color: #333;\n}\n\n.sarge-onboarding-step {\n text-align: center;\n margin-bottom: 12px;\n}\n\n.sarge-onboarding-icon {\n font-size: 32px;\n margin-bottom: 8px;\n display: inline-block;\n}\n\n.sarge-onboarding-step h3 {\n margin: 0 0 8px;\n font-size: 16px;\n color: #333;\n font-weight: 600;\n}\n\n.sarge-onboarding-step p {\n margin: 0;\n font-size: 13px;\n color: #666;\n line-height: 1.4;\n}\n\n.sarge-onboarding-dots {\n display: flex;\n justify-content: center;\n margin: 12px 0;\n}\n\n.sarge-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.sarge-onboarding-dots .dot.active {\n background: #0066ff;\n transform: scale(1.2);\n}\n\n.sarge-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.sarge-onboarding-next:hover {\n background: #0055cc;\n}\n";
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export type RecordingStatus = 'idle' | 'recording' | 'processing' | 'playing';
3
+ export type UseStateHook = typeof React.useState;
4
+ export type UseEffectHook = typeof React.useEffect;
5
+ export type UseRefHook = typeof React.useRef;
6
+ export interface GuideAIProps {
7
+ organizationKey: string;
8
+ position?: {
9
+ top?: string;
10
+ right?: string;
11
+ bottom?: string;
12
+ left?: string;
13
+ marginTop?: string;
14
+ marginRight?: string;
15
+ marginBottom?: string;
16
+ marginLeft?: string;
17
+ transform?: string;
18
+ };
19
+ onError?: (error: string | Error, context?: string) => void;
20
+ }
21
+ export type PopupPosition = 'above' | 'below';
@@ -0,0 +1,24 @@
1
+ export interface WorkflowOption {
2
+ selectors: string[];
3
+ message?: string;
4
+ next_step?: string;
5
+ }
6
+ export interface WorkflowStep {
7
+ id: string;
8
+ prompt: string;
9
+ options: {
10
+ [response: string]: WorkflowOption;
11
+ };
12
+ }
13
+ export interface Workflow {
14
+ id: string;
15
+ name: string;
16
+ trigger_phrases: string[];
17
+ steps: WorkflowStep[];
18
+ }
19
+ export interface WorkflowState {
20
+ activeWorkflow: Workflow | null;
21
+ currentStepId: string | null;
22
+ stepHistory: string[];
23
+ context: Record<string, any>;
24
+ }
@@ -0,0 +1,8 @@
1
+ interface ConversationData {
2
+ id: string;
3
+ ephemeralToken: string;
4
+ prompt: string;
5
+ }
6
+ export declare const createNewConversation: (organizationKey: string, onError: (error: Error, context: string) => void) => Promise<ConversationData | null>;
7
+ export declare const logMessage: (content: string, sender: "GUIDEAI" | "HUMAN", conversationId: string | null, organizationKey: string, onError: (error: Error, context: string) => void) => Promise<void>;
8
+ export {};
@@ -1,5 +1,7 @@
1
1
  export declare const DEFAULT_PROMPT = "you are Guide AI.\n Your role is to answer any question directly and succinctly that a user has. NEVER DIRECTLY MENTION THE SCREENSHOT, but use its information as much as possible to target your responses.\n If nothing is asked, then your goal is to generally assist them.\n IMPORTANT: NEVER answer in more than 10 words. Always be concise and limit answers to 1 sentence maximum. Be simple and as short as possible.\n Your job is to help them get it done through asking more and more targeted specific questions.";
2
- export declare const geminiFlash: (prompt: string) => Promise<any>;
3
- export declare const createNewConversation: (organizationKey: string) => Promise<string | null>;
4
- export declare const logMessage: (conversationId: string, content: string, sender: "GUIDEAI" | "HUMAN") => Promise<void>;
5
- export declare const fetchEphemeralToken: (organizationKey: string) => Promise<string | null>;
2
+ export declare const IGNORE_MESSAGE_TYPES: string[];
3
+ export declare const GUIDE_AI_API_BASE = "http://localhost:3001/api";
4
+ export declare const OPENAI_REALTIME_BASE = "https://api.openai.com/v1/realtime";
5
+ export declare const OPENAI_REALTIME_MODEL = "gpt-4o-realtime-preview-2024-12-17";
6
+ export declare const GEMINI_API_KEY = "AIzaSyBiFyzjYVupLyk8BdmfWzBL1GbzX8OUdPc";
7
+ export declare const GEMINI_API_ENDPOINT = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent";
@@ -0,0 +1 @@
1
+ export declare const highlightElement: (selector: string | string[], isHighlighting: boolean, setIsHighlighting: (highlighting: boolean) => void, logMessage: (content: string, sender: "GUIDEAI" | "HUMAN") => void) => Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ export declare const clickElement: (element: Element, rect: DOMRect) => Promise<void>;
2
+ export declare const highlightElement: (selector: string | string[], isHighlighting: boolean, setIsHighlighting: (highlighting: boolean) => void, logMessage: (content: string, sender: "GUIDEAI" | "HUMAN") => void) => Promise<boolean>;
@@ -0,0 +1,26 @@
1
+ export interface StoredMessage {
2
+ content: string;
3
+ sender: 'GUIDEAI' | 'HUMAN';
4
+ timestamp: number;
5
+ }
6
+ export interface StoredConversation {
7
+ conversationId: string;
8
+ messages: StoredMessage[];
9
+ timestamp: number;
10
+ organizationKey: string;
11
+ }
12
+ export declare const CONVERSATION_STORAGE_KEY = "guideai_conversation";
13
+ export declare const CONVERSATION_EXPIRY_MINUTES = 30;
14
+ export declare const MAX_STORED_MESSAGES = 50;
15
+ export declare const isLocalStorageAvailable: () => boolean;
16
+ export declare const isConversationExpired: (conversation: StoredConversation) => boolean;
17
+ export declare const saveConversationToStorage: (conversation: StoredConversation) => void;
18
+ export declare const loadConversationFromStorage: () => StoredConversation | null;
19
+ export declare const clearConversationStorage: () => void;
20
+ export declare const addMessageToStorage: (message: StoredMessage, conversationId: string, organizationKey: string) => void;
21
+ export declare const checkForStoredConversation: (currentOrganizationKey: string) => {
22
+ shouldRestore: boolean;
23
+ conversationId: string | null;
24
+ messages: StoredMessage[] | null;
25
+ };
26
+ export declare const formatConversationContext: (messages: StoredMessage[], maxMessages?: number) => string;
@@ -0,0 +1,26 @@
1
+ export interface StoredMessage {
2
+ content: string;
3
+ sender: 'GUIDEAI' | 'HUMAN';
4
+ timestamp: number;
5
+ }
6
+ export interface StoredConversation {
7
+ conversationId: string;
8
+ messages: StoredMessage[];
9
+ timestamp: number;
10
+ organizationKey: string;
11
+ }
12
+ export declare const CONVERSATION_STORAGE_KEY = "guideai_conversation";
13
+ export declare const CONVERSATION_EXPIRY_MINUTES = 30;
14
+ export declare const MAX_STORED_MESSAGES = 50;
15
+ export declare const isLocalStorageAvailable: () => boolean;
16
+ export declare const isConversationExpired: (conversation: StoredConversation) => boolean;
17
+ export declare const saveConversationToStorage: (conversation: StoredConversation) => void;
18
+ export declare const loadConversationFromStorage: () => StoredConversation | null;
19
+ export declare const clearConversationStorage: () => void;
20
+ export declare const addMessageToStorage: (message: StoredMessage, conversationId: string, organizationKey: string) => void;
21
+ export declare const checkForStoredConversation: (currentOrganizationKey: string) => {
22
+ shouldRestore: boolean;
23
+ conversationId: string | null;
24
+ messages: StoredMessage[] | null;
25
+ };
26
+ export declare const formatConversationContext: (messages: StoredMessage[], maxMessages?: number) => string;
@@ -0,0 +1,3 @@
1
+ import { PopupPosition } from '../types/GuideAI.types';
2
+ export declare const injectStyles: (css: string, id: string) => void;
3
+ export declare const calculateOptimalPosition: (componentRect: DOMRect, elementHeight?: number, spacing?: number) => PopupPosition;
@@ -0,0 +1,17 @@
1
+ import { Workflow, WorkflowStep } from '../types/workflow';
2
+ /**
3
+ * Find workflow that matches user input trigger phrases
4
+ */
5
+ export declare const findWorkflowByTrigger: (userInput: string, workflows: Workflow[]) => Workflow | null;
6
+ /**
7
+ * Get the next step in a workflow based on current step and user response
8
+ */
9
+ export declare const getNextStep: (workflow: Workflow, currentStepId: string, userResponse: string) => WorkflowStep | null;
10
+ /**
11
+ * Get the first step of a workflow
12
+ */
13
+ export declare const getFirstStep: (workflow: Workflow) => WorkflowStep | null;
14
+ /**
15
+ * Check if a step is the final step (has no next_step options)
16
+ */
17
+ export declare const isFinalStep: (step: WorkflowStep) => boolean;
@@ -0,0 +1,17 @@
1
+ import { Workflow, WorkflowStep } from '../types/workflow';
2
+ /**
3
+ * Find workflow that matches user input trigger phrases
4
+ */
5
+ export declare const findWorkflowByTrigger: (userInput: string, workflows: Workflow[]) => Workflow | null;
6
+ /**
7
+ * Get the next step in a workflow based on current step and user response
8
+ */
9
+ export declare const getNextStep: (workflow: Workflow, currentStepId: string, userResponse: string) => WorkflowStep | null;
10
+ /**
11
+ * Get the first step of a workflow
12
+ */
13
+ export declare const getFirstStep: (workflow: Workflow) => WorkflowStep | null;
14
+ /**
15
+ * Check if a step is the final step (has no next_step options)
16
+ */
17
+ export declare const isFinalStep: (step: WorkflowStep) => boolean;
@@ -0,0 +1,7 @@
1
+ import { Workflow } from '../types/workflow';
2
+ /**
3
+ * Sample workflow: Send Certificate for Insured
4
+ * Based on the example from the workflow system PRD
5
+ * This serves as a reference example for workflow structure
6
+ */
7
+ export declare const certificateWorkflow: Workflow;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Workflows index - exports workflow types and reference examples
3
+ * Note: Actual workflows will be loaded dynamically from the backend
4
+ */
5
+ export { certificateWorkflow } from './certificateWorkflow';
6
+ export type { Workflow, WorkflowStep, WorkflowOption } from '../types/workflow';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guideai-app",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "AI-powered guide component for React applications",
5
5
  "main": "dist/GuideAI.js",
6
6
  "types": "dist/GuideAI.d.ts",
package/types/index.d.ts CHANGED
@@ -14,7 +14,11 @@ export interface GuideAIProps {
14
14
  right?: string;
15
15
  bottom?: string;
16
16
  left?: string;
17
+ marginTop?: string;
18
+ marginRight?: string;
19
+ marginBottom?: string;
17
20
  marginLeft?: string;
21
+ transform?: string;
18
22
  };
19
23
  onError?: (error: string | Error, context?: string) => void;
20
24
  }
@@ -1,11 +0,0 @@
1
- import { ConversationItem } from '../types';
2
- export declare const useConversation: (organizationKey: string, onError: (error: string | Error, context?: string) => void) => {
3
- conversationItems: ConversationItem[];
4
- conversationIdRef: import("react").MutableRefObject<string | null>;
5
- storeConversationItem: (eventData: any) => void;
6
- updateConversationItem: (itemId: string, updateData: Partial<any>) => void;
7
- logMessageToConversation: (content: string, sender: "GUIDEAI" | "HUMAN") => Promise<void>;
8
- addConversationHistory: (sendMessageFn: (message: any) => void) => void;
9
- isAddingHistoryContext: import("react").MutableRefObject<boolean>;
10
- hasCreatedConversationRef: import("react").MutableRefObject<boolean>;
11
- };
@@ -1,12 +0,0 @@
1
- import { RecordingStatus } from '../types';
2
- export declare const useRecording: (organizationKey: string, onError: (error: string | Error, context?: string) => void, logMessageFn: (message: string, sender: "GUIDEAI" | "HUMAN") => Promise<void>, addConversationHistoryFn: (sendMessageFn: (message: any) => void) => void, storeConversationItemFn: (item: any) => void, updateConversationItem: (itemId: string, updateData: Partial<any>) => void, isAddingHistoryContextRef: React.MutableRefObject<boolean>) => {
3
- status: RecordingStatus;
4
- isSessionReady: boolean;
5
- isConversationActive: boolean;
6
- toggleRecording: () => Promise<void>;
7
- toggleConversation: () => Promise<void>;
8
- cleanupWebRTC: () => void;
9
- audioElementRef: import("react").MutableRefObject<HTMLAudioElement | null>;
10
- ephemeralToken: string | null;
11
- setEphemeralToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
12
- };
@@ -1,2 +0,0 @@
1
- export declare const clickElement: (element: Element, rect: DOMRect) => Promise<void>;
2
- export declare const highlightElement: (selector: string | string[], logMessageFn?: (message: string, sender: "GUIDEAI" | "HUMAN") => void) => Promise<boolean>;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export type UseStateHook = typeof React.useState;
3
- export type UseEffectHook = typeof React.useEffect;
4
- export type UseRefHook = typeof React.useRef;
5
- export declare const getReactHooks: () => {
6
- useState: UseStateHook;
7
- useEffect: UseEffectHook;
8
- useRef: UseRefHook;
9
- };
@@ -1,14 +0,0 @@
1
- export declare const STORAGE_PREFIX = "guideAI_";
2
- export declare const STORAGE_KEYS: {
3
- CONVERSATION_ITEMS: string;
4
- CONVERSATION_ID: string;
5
- HAS_INTERACTED: string;
6
- LAST_ACTIVITY: string;
7
- MIC_PERMISSION_GRANTED: string;
8
- CONVERSATION_ACTIVE: string;
9
- EPHEMERAL_TOKEN: string;
10
- TOKEN_TIMESTAMP: string;
11
- };
12
- export declare const saveToStorage: (key: string, value: any) => void;
13
- export declare const getFromStorage: <T>(key: string, defaultValue: T) => T;
14
- export declare const isTokenValid: () => boolean;
package/utils/webrtc.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const initializeWebRTC: (audioStream: MediaStream, token: string, audioElementRef: React.RefObject<HTMLAudioElement>, peerConnectionRef: React.MutableRefObject<RTCPeerConnection | null>, dataChannelRef: React.MutableRefObject<RTCDataChannel | null>, onMessage: (message: any) => void, onOpen?: () => void) => Promise<boolean>;
3
- export declare const sendMessage: (dataChannel: RTCDataChannel | null, message: any) => boolean;