guideai-app 0.5.0 → 0.5.1-2

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 (36) hide show
  1. package/dist/GuideAI.js +1 -1
  2. package/dist/GuideAI.js.map +1 -1
  3. package/dist/__mocks__/fileMock.d.ts +2 -0
  4. package/dist/components/AnimatedSettingsItem.d.ts +1 -1
  5. package/dist/components/AudioConfigDialog.d.ts +20 -0
  6. package/dist/components/ConfigButton.d.ts +10 -0
  7. package/dist/components/Microphone.d.ts +3 -1
  8. package/dist/components/SettingsMenu.d.ts +4 -1
  9. package/dist/components/TranscriptBox.d.ts +7 -1
  10. package/dist/components/TranscriptTextInput.d.ts +4 -1
  11. package/dist/components/TranscriptToggle.d.ts +1 -1
  12. package/dist/hooks/useGuideAIAPI.d.ts +1 -0
  13. package/dist/hooks/useWebRTC.d.ts +16 -4
  14. package/dist/types/GuideAI.types.d.ts +10 -1
  15. package/dist/types/audioConfig.types.d.ts +71 -0
  16. package/dist/utils/api.d.ts +19 -8
  17. package/dist/utils/clickElement.d.ts +7 -0
  18. package/dist/utils/constants.d.ts +0 -1
  19. package/dist/utils/dataChannel.d.ts +29 -4
  20. package/dist/utils/dataChannelHelpers.d.ts +28 -0
  21. package/dist/utils/elementInteractions.d.ts +110 -21
  22. package/dist/utils/fillField.d.ts +2 -0
  23. package/dist/utils/goToAElmLink.d.ts +6 -1
  24. package/dist/utils/highlight.d.ts +2 -0
  25. package/dist/utils/highlightThenClick.d.ts +6 -2
  26. package/dist/utils/hover.d.ts +1 -1
  27. package/dist/utils/hoverThenClick.d.ts +5 -1
  28. package/dist/utils/localStorageHelper.d.ts +18 -0
  29. package/dist/utils/logger.d.ts +8 -8
  30. package/dist/utils/navigateTo.d.ts +2 -0
  31. package/dist/utils/reactHooks.d.ts +13 -0
  32. package/dist/utils/toolRegistry.d.ts +27 -0
  33. package/dist/utils/webrtcConnection.d.ts +6 -1
  34. package/dist/visualContext/debug-overlay.d.ts +1 -1
  35. package/dist/visualContext/index.d.ts +1 -1
  36. package/package.json +8 -2
@@ -9,6 +9,8 @@ declare const STORAGE_KEYS: {
9
9
  readonly HAS_INTERACTED: "guideAI_hasInteracted";
10
10
  readonly IS_MUTED: "guideAI_isMuted";
11
11
  readonly LOGGER_ENABLED: "guideAI_loggerEnabled";
12
+ readonly AUDIO_CONFIG: "guideAI_audioConfig";
13
+ readonly CONFIG_ENABLED: "guideAI_configEnabled";
12
14
  };
13
15
  /**
14
16
  * Check if localStorage is available
@@ -51,6 +53,22 @@ export declare const getLoggerEnabled: () => boolean;
51
53
  * Set logger enabled flag
52
54
  */
53
55
  export declare const setLoggerEnabled: (value: boolean) => void;
56
+ /**
57
+ * Get stored audio configuration
58
+ */
59
+ export declare const getAudioConfig: () => import("../types/audioConfig.types").StoredAudioConfig | null;
60
+ /**
61
+ * Save audio configuration
62
+ */
63
+ export declare const setAudioConfig: (value: import("../types/audioConfig.types").StoredAudioConfig | null) => void;
64
+ /**
65
+ * Get configuration button enabled flag
66
+ */
67
+ export declare const getConfigEnabled: () => boolean;
68
+ /**
69
+ * Set configuration button enabled flag and dispatch event for live updates
70
+ */
71
+ export declare const setConfigEnabled: (value: boolean) => void;
54
72
  /**
55
73
  * Export storage keys for reference (read-only)
56
74
  */
@@ -1,4 +1,4 @@
1
- type Component = 'GuideAI' | 'API' | 'TranscriptBox' | 'Onboarding' | 'VisualContext' | 'MessageStorage' | 'DataChannel' | 'ConversationManager' | 'LocalStorageHelper' | 'WebRTCConnection';
1
+ type Component = 'GuideAI' | 'API' | 'TranscriptBox' | 'Onboarding' | 'VisualContext' | 'MessageStorage' | 'DataChannel' | 'ConversationManager' | 'LocalStorageHelper' | 'WebRTCConnection' | 'ToolCall';
2
2
  declare class Logger {
3
3
  private static formatMessage;
4
4
  private static checkLoggingEnabled;
@@ -10,22 +10,22 @@ declare class Logger {
10
10
  static init(): void;
11
11
  /**
12
12
  * Enable logging from console, or for a specific component.
13
- * Usage: GuideAILogger.enable() or GuideAILogger.enable('API')
13
+ * Usage: GuideAI.logger.enable() or GuideAI.logger.enable('API')
14
14
  */
15
15
  static enable(component?: Component): void;
16
16
  /**
17
17
  * Disable logging from console, or for a specific component.
18
- * Usage: GuideAILogger.disable() or GuideAILogger.disable('API')
18
+ * Usage: GuideAI.logger.disable() or GuideAI.logger.disable('API')
19
19
  */
20
20
  static disable(component?: Component): void;
21
21
  /**
22
22
  * Enable or disable logging for a specific component
23
- * Usage: GuideAILogger.setComponentEnabled('API', true)
23
+ * Usage: GuideAI.logger.setComponentEnabled('API', true)
24
24
  */
25
25
  static setComponentEnabled(component: Component, enabled: boolean): void;
26
26
  /**
27
27
  * Get current logging status
28
- * Usage: GuideAILogger.getStatus()
28
+ * Usage: GuideAI.logger.getStatus()
29
29
  */
30
30
  static getStatus(): {
31
31
  manualEnabled: boolean;
@@ -33,17 +33,17 @@ declare class Logger {
33
33
  };
34
34
  /**
35
35
  * Disable logging for all components
36
- * Usage: GuideAILogger.disableAllComponents()
36
+ * Usage: GuideAI.logger.disableAllComponents()
37
37
  */
38
38
  static disableAllComponents(): void;
39
39
  /**
40
40
  * Enable logging for all components
41
- * Usage: GuideAILogger.enableAllComponents()
41
+ * Usage: GuideAI.logger.enableAllComponents()
42
42
  */
43
43
  static enableAllComponents(): void;
44
44
  /**
45
45
  * Display help information listing all available Logger functions
46
- * Usage: GuideAILogger.help()
46
+ * Usage: GuideAI.logger.help()
47
47
  */
48
48
  static help(): void;
49
49
  /**
@@ -0,0 +1,2 @@
1
+ import { ToolInput } from './elementInteractions';
2
+ export declare const navigateTo: (out: ToolInput) => Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Safely extract React hooks from the React instance passed as props.
3
+ * Used when the package receives React from the host (e.g. Chrome extension, Next.js).
4
+ */
5
+ import type { UseCallbackHook } from '../types/GuideAI.types';
6
+ export interface ReactHooks {
7
+ useState: typeof import('react').useState;
8
+ useEffect: typeof import('react').useEffect;
9
+ useRef: typeof import('react').useRef;
10
+ useMemo: typeof import('react').useMemo;
11
+ useCallback: UseCallbackHook;
12
+ }
13
+ export declare function getReactHooks(React: typeof import('react')): ReactHooks;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Tool execution registry.
3
+ * Maps function names to handlers for built-in types and api_call.
4
+ * No eval - only registered handlers or HTTP fetch for api_call.
5
+ */
6
+ export declare const BUILT_IN_TOOL_NAMES: string[];
7
+ export interface ToolWithConfig {
8
+ toolConfig: {
9
+ type: string;
10
+ name: string;
11
+ description?: string;
12
+ parameters?: object;
13
+ };
14
+ functionConfig: {
15
+ handlerType: string;
16
+ url?: string;
17
+ };
18
+ }
19
+ /**
20
+ * Get built-in tools as ToolWithConfig[] for only the given names.
21
+ */
22
+ export declare function getBuiltInToolsAsToolWithConfigForNames(names: string[]): ToolWithConfig[];
23
+ /**
24
+ * Execute a tool by name using server-provided tools config and callbacks.
25
+ * Returns the result for function_call_output.
26
+ */
27
+ export declare function executeTool(name: string, args: string, toolsConfig: ToolWithConfig[], propHandlers?: Record<string, (args: Record<string, unknown>) => Promise<unknown>>): Promise<unknown>;
@@ -16,11 +16,16 @@ export interface WebRTCConnectionConfig {
16
16
  audioStream: MediaStream | null;
17
17
  /** Initialize endpoint URL (e.g. /api/initialize) - returns { id, answerSdp } */
18
18
  initializeEndpoint: string;
19
- /** Payload for initialize (organizationKey, user, conversationId */
19
+ /** Payload for initialize (organizationKey, user, conversationId, propTools) */
20
20
  initializePayload: {
21
21
  organizationKey: string;
22
22
  user?: string;
23
23
  conversationId?: string | null;
24
+ propTools?: {
25
+ name: string;
26
+ description: string;
27
+ parameters: object;
28
+ }[];
24
29
  };
25
30
  /** Called when session data is received (id) */
26
31
  onSessionData?: (data: InitializeSessionData) => void;
@@ -6,5 +6,5 @@ interface DebugOverlayProps {
6
6
  onToggleGallery?: () => void;
7
7
  showGallery?: boolean;
8
8
  }
9
- export declare const DebugOverlay: ({ React, frames, latencyMs, onToggleGallery, showGallery }: DebugOverlayProps) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
9
+ export declare const DebugOverlay: ({ React, frames, latencyMs, onToggleGallery, showGallery, }: DebugOverlayProps) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
10
10
  export {};
@@ -8,5 +8,5 @@ export { VisualContextScheduler } from './VisualContextScheduler';
8
8
  export { DebugOverlay } from './debug-overlay';
9
9
  export { useVisualContext } from './useVisualContext';
10
10
  export { createDefaultScreenshotProvider, getDefaultScreenshotProvider } from './defaultProvider';
11
- export type { ScreenshotResponse, ScreenshotFrame, ScreenshotDetail, ScreenshotOptions, ScreenshotProvider, VisualContextConfig } from './types';
11
+ export type { ScreenshotResponse, ScreenshotFrame, ScreenshotDetail, ScreenshotOptions, ScreenshotProvider, VisualContextConfig, } from './types';
12
12
  export { MAX_IMAGE_MESSAGE_BYTES } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guideai-app",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-2",
4
4
  "description": "AI-powered guide component for React applications",
5
5
  "main": "dist/GuideAI.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "dev": "npm run watch",
23
23
  "serve:local": "npm run build:dev && npx serve -l 8080 dist",
24
24
  "prepare": "npm run build",
25
+ "lint": "eslint src --ext .ts,.tsx",
25
26
  "test": "jest",
26
27
  "test:watch": "jest --watch",
27
28
  "test:coverage": "jest --coverage"
@@ -44,10 +45,15 @@
44
45
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
45
46
  },
46
47
  "devDependencies": {
48
+ "@eslint/js": "^10.0.1",
47
49
  "@testing-library/jest-dom": "^6.9.1",
48
50
  "@testing-library/react": "^16.3.0",
49
51
  "@types/jest": "^30.0.0",
50
52
  "@types/react": "^18.2.0",
53
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
54
+ "@typescript-eslint/parser": "^8.56.0",
55
+ "eslint": "^10.0.1",
56
+ "eslint-config-prettier": "^10.1.8",
51
57
  "javascript-obfuscator": "^4.1.0",
52
58
  "jest": "^30.2.0",
53
59
  "jest-circus": "^30.2.0",
@@ -62,4 +68,4 @@
62
68
  "webpack": "^5.98.0",
63
69
  "webpack-cli": "^6.0.1"
64
70
  }
65
- }
71
+ }