@alxxsck/ai-assistant 1.0.0

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 (56) hide show
  1. package/README.md +345 -0
  2. package/dist/App.d.ts +26 -0
  3. package/dist/Avatar-XISRbl7X.js +29627 -0
  4. package/dist/OrbitControls-XelJ40xM.js +458 -0
  5. package/dist/api/messages.api.d.ts +20 -0
  6. package/dist/api/messages.api.types.d.ts +88 -0
  7. package/dist/api/messages.api.utils.d.ts +2 -0
  8. package/dist/api/voice.api.d.ts +65 -0
  9. package/dist/api/voice.api.types.d.ts +37 -0
  10. package/dist/avatar/AnimationManager.d.ts +39 -0
  11. package/dist/avatar/Avatar.d.ts +69 -0
  12. package/dist/avatar/BlendShapeScenario.d.ts +19 -0
  13. package/dist/bridge-ai-chat-widget.es.js +10194 -0
  14. package/dist/constants.d.ts +2 -0
  15. package/dist/context/ChatWidgetContext.d.ts +32 -0
  16. package/dist/domain/command/CommandRuntime.d.ts +50 -0
  17. package/dist/domain/command/command.types.d.ts +70 -0
  18. package/dist/domain/message/cable/AnyCable.service.d.ts +34 -0
  19. package/dist/domain/message/cable/CableContext.d.ts +17 -0
  20. package/dist/domain/message/cable/CableContext.types.d.ts +19 -0
  21. package/dist/domain/message/cable/WidgetChat.channel.d.ts +4 -0
  22. package/dist/domain/message/cable/widget-message.d.ts +3 -0
  23. package/dist/domain/message/message.store.d.ts +51 -0
  24. package/dist/domain/scenario/scenario-choice.d.ts +17 -0
  25. package/dist/domain/ui/ui.service.d.ts +7 -0
  26. package/dist/domain/voice/voice.store.d.ts +69 -0
  27. package/dist/hooks/useDeviceManager.d.ts +25 -0
  28. package/dist/hooks/useSessionExpiryChecks.d.ts +3 -0
  29. package/dist/index.d.ts +41 -0
  30. package/dist/index.types.d.ts +50 -0
  31. package/dist/lib/isSessionExpired.d.ts +2 -0
  32. package/dist/lib/logger.d.ts +12 -0
  33. package/dist/lib/retrieveContent.d.ts +6 -0
  34. package/dist/lib/utils.d.ts +2 -0
  35. package/dist/lib//321/201ontentRenderer.d.ts +6 -0
  36. package/dist/lil-gui.esm-BicvE3D7.js +1263 -0
  37. package/dist/react/mount.d.ts +3 -0
  38. package/dist/types/index.d.ts +9 -0
  39. package/dist/ui/chat-routes.d.ts +11 -0
  40. package/dist/ui/components/ChatFooter.d.ts +2 -0
  41. package/dist/ui/components/ChatListItem.d.ts +10 -0
  42. package/dist/ui/components/ChatListPage.d.ts +1 -0
  43. package/dist/ui/components/ChatMessage.d.ts +8 -0
  44. package/dist/ui/components/ChatTextMode.d.ts +1 -0
  45. package/dist/ui/components/ChatTopControls.d.ts +1 -0
  46. package/dist/ui/components/ChatTypingIndicator.d.ts +4 -0
  47. package/dist/ui/components/ChatUnreadIndicator.d.ts +1 -0
  48. package/dist/ui/components/ChatVoiceMode.d.ts +1 -0
  49. package/dist/ui/components/ChatWidget.d.ts +4 -0
  50. package/dist/ui/components/ErrorMessage.d.ts +7 -0
  51. package/dist/ui/components/VoiceModeMessage.d.ts +12 -0
  52. package/dist/ui/components/overlays/ChatBlurOverlayBottom.d.ts +1 -0
  53. package/dist/ui/components/overlays/ChatBlurOverlayTop.d.ts +1 -0
  54. package/dist/ui/components/overlays/ChatDarkOverlay.d.ts +1 -0
  55. package/dist/ui/error-messages.d.ts +7 -0
  56. package/package.json +102 -0
@@ -0,0 +1,3 @@
1
+ import { type AppApi } from "@/App";
2
+ import type { WidgetConfig } from "@/index.types";
3
+ export declare function mountWidget(mount: HTMLElement, config: WidgetConfig, api: AppApi): import("react-dom/client").Root;
@@ -0,0 +1,9 @@
1
+ import type { ExternallyAvailableActions } from "@/avatar/Avatar";
2
+ export type CustomerInteractionSession = {
3
+ accessToken: string;
4
+ chatId: string;
5
+ /** Lola Backend interaction session id. Defaults to chatId for compatibility transports. */
6
+ sessionId?: string;
7
+ expiresAt: string;
8
+ };
9
+ export type OnAvatarReady = (playAnimation: (name: ExternallyAvailableActions) => void) => void;
@@ -0,0 +1,11 @@
1
+ export declare enum ChatMode {
2
+ Voice = "voice",
3
+ Text = "text"
4
+ }
5
+ export declare const CHAT_PATHS: {
6
+ readonly list: "/chats";
7
+ readonly voice: "/chat/voice";
8
+ readonly text: "/chat/text";
9
+ };
10
+ export declare function getChatModeFromPathname(pathname: string): ChatMode;
11
+ export declare function isChatListPath(pathname: string): boolean;
@@ -0,0 +1,2 @@
1
+ import type React from "react";
2
+ export declare function ChatFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { MessageData } from "@/api/messages.api.types";
2
+ export interface ChatListItemProps {
3
+ chat: {
4
+ threadId: string;
5
+ message: MessageData;
6
+ };
7
+ isSelected?: boolean;
8
+ onSelect: () => void;
9
+ }
10
+ export declare function ChatListItem({ chat, isSelected, onSelect, }: ChatListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ChatListPage({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type MessageData } from "@/api/messages.api.types";
2
+ import { type ComponentProps } from "react";
3
+ export type MessageAuthor = "me" | "them";
4
+ type ChatMessageProps = ComponentProps<"div"> & {
5
+ message: MessageData;
6
+ };
7
+ export declare function ChatMessage({ message, className, ...props }: ChatMessageProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ChatTextMode(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ChatTopControls({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { ComponentProps } from "react";
2
+ type ChatTypingIndicatorProps = ComponentProps<"div">;
3
+ export declare function ChatTypingIndicator({ className }: ChatTypingIndicatorProps): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ChatUnreadIndicator(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ChatVoiceMode({ className }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { CHAT_PATHS, ChatMode } from "@/ui/chat-routes";
2
+ export declare const DEFAULT_WIDGET_WIDTH = 360;
3
+ export declare const DEFAULT_WIDGET_HEIGHT = 680;
4
+ export declare function ChatWidget(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ComponentProps } from "react";
2
+ export type MessageAuthor = "me" | "them";
3
+ type ErrorMessageProps = ComponentProps<"div"> & {
4
+ message: string;
5
+ };
6
+ export declare function ErrorMessage({ message, className, ...props }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ComponentProps } from "react";
2
+ import { ParticipantType } from "@/api/messages.api.types";
3
+ export declare enum VoiceModeMessageSourceType {
4
+ ReactionMessage = "REACTION_MESSAGE"
5
+ }
6
+ export type VoiceModeMessageSource = ParticipantType | VoiceModeMessageSourceType;
7
+ type ChatMessageProps = ComponentProps<"div"> & {
8
+ message: string;
9
+ source: VoiceModeMessageSource;
10
+ };
11
+ export declare function VoiceModeMessage({ message, source, className, ...props }: ChatMessageProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ChatBlurOverlayBottom({ className, }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ChatBlurOverlayTop({ className }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ChatDarkOverlay({ className }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export declare const CHAT_ERROR_MESSAGES: {
2
+ readonly connectionFailed: "Connection failed";
3
+ readonly offline: "You're offline";
4
+ readonly agentResponseFailed: "Agent response failed";
5
+ readonly sendMessageFallback: "Failed to send message";
6
+ readonly conversationClosed: "This chat is closed. Select or create another chat.";
7
+ };
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@alxxsck/ai-assistant",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "description": "Embeddable chat widget for communication with Bridge AI agent",
6
+ "type": "module",
7
+ "main": "dist/bridge-ai-chat-widget.es.js",
8
+ "module": "dist/bridge-ai-chat-widget.es.js",
9
+ "types": "dist/index.types.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.types.d.ts",
13
+ "import": "./dist/bridge-ai-chat-widget.es.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "peerDependencies": {
23
+ "react": ">=19",
24
+ "react-dom": ">=19"
25
+ },
26
+ "browserslist": [
27
+ "> 1%",
28
+ "last 2 versions"
29
+ ],
30
+ "scripts": {
31
+ "dev": "vite",
32
+ "lint": "eslint .",
33
+ "lint-fix": "eslint . --fix",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check .",
36
+ "test": "vitest run",
37
+ "deploy-g-spot-prod": "npm run build-dev && npm run clean-g-spot-prod-bucket && npm run upload-g-spot-prod-bucket",
38
+ "deploy-bridge-demo": "npm run build-dev && npm run clean-bridge-demo-bucket && npm run upload-bridge-demo-bucket",
39
+ "build-dev": "vite build",
40
+ "build-lib": "vite build --config vite.config.lib.ts && tsc -p tsconfig.build.json",
41
+ "preview": "vite preview",
42
+ "prepublishOnly": "npm run build-lib",
43
+ "clean-g-spot-prod-bucket": "aws s3 rm s3://bridgeapp-ai-chat-widget-dev.com --recursive",
44
+ "upload-g-spot-prod-bucket": "aws s3 cp dist s3://bridgeapp-ai-chat-widget-dev.com/g-spot-prod --recursive",
45
+ "clean-bridge-demo-bucket": "aws s3 rm s3://bridge-ai-assistant --recursive",
46
+ "upload-bridge-demo-bucket": "aws s3 cp dist s3://bridge-ai-assistant/bridge-demo --recursive",
47
+ "push-assets-metamediastatic": "bash scripts/push-assets-to-metamediastatic.sh"
48
+ },
49
+ "dependencies": {
50
+ "@anycable/web": "^1.1.0",
51
+ "@headlessui/react": "^2.2.9",
52
+ "@tiptap/static-renderer": "^3.19.0",
53
+ "@types/lodash-es": "^4.17.12",
54
+ "class-variance-authority": "^0.7.1",
55
+ "clsx": "^2.1.1",
56
+ "gsap": "^3.14.2",
57
+ "howler": "^2.2.4",
58
+ "lil-gui": "^0.21.0",
59
+ "lodash-es": "^4.17.23",
60
+ "lucide-react": "^0.562.0",
61
+ "react-error-boundary": "^6.1.1",
62
+ "react-router-dom": "^7.13.1",
63
+ "react-use": "^17.6.0",
64
+ "tailwind-merge": "^3.4.0",
65
+ "three": "^0.182.0",
66
+ "vite-plugin-lib-inject-css": "^2.2.2",
67
+ "vite-plugin-mkcert": "^2.0.0",
68
+ "vite-plugin-svgr": "^4.5.0",
69
+ "zukeeper": "^1.0.2",
70
+ "zustand": "^5.0.10"
71
+ },
72
+ "devDependencies": {
73
+ "@eslint/js": "^9.39.1",
74
+ "@tailwindcss/postcss": "^4.1.18",
75
+ "@tailwindcss/vite": "^4.1.18",
76
+ "@types/howler": "^2.2.12",
77
+ "@types/node": "^24.10.4",
78
+ "@types/react": "^19.2.5",
79
+ "@types/react-dom": "^19.2.3",
80
+ "@types/three": "^0.182.0",
81
+ "@vitejs/plugin-react-swc": "^4.2.2",
82
+ "autoprefixer": "^10.4.24",
83
+ "eslint": "^9.39.1",
84
+ "eslint-plugin-react-hooks": "^7.0.1",
85
+ "eslint-plugin-react-refresh": "^0.4.24",
86
+ "globals": "^16.5.0",
87
+ "jsdom": "^29.1.1",
88
+ "postcss-prefix-selector": "^2.1.1",
89
+ "prettier": "^3.7.4",
90
+ "prettier-plugin-tailwindcss": "^0.7.2",
91
+ "react": "^19.2.5",
92
+ "react-dom": "^19.2.5",
93
+ "rollup-plugin-visualizer": "^7.0.1",
94
+ "tailwindcss": "^4.1.18",
95
+ "tw-animate-css": "^1.4.0",
96
+ "typescript": "~5.9.3",
97
+ "typescript-eslint": "^8.46.4",
98
+ "vite": "^7.2.4",
99
+ "vite-plugin-static-copy": "^3.2.0",
100
+ "vitest": "^4.1.10"
101
+ }
102
+ }