@eloquentai/chat-sdk 0.28.29-dev → 0.29.0-dev.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.
- package/README.md +146 -6
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/chat/chat.d.ts +22 -0
- package/dist/components/chat/hooks/use-chat.d.ts +79 -0
- package/dist/components/chat/{interface-props.hook.d.ts → hooks/use-interface-props.d.ts} +2 -2
- package/dist/components/chat/hooks/use-keyboard-inset.d.ts +6 -0
- package/dist/components/chat/{message-events.hook.d.ts → hooks/use-message-events.d.ts} +5 -5
- package/dist/components/chat/{persistence.hook.d.ts → hooks/use-persistence.d.ts} +5 -2
- package/dist/components/chat/{realtime-socket.hook.d.ts → hooks/use-realtime-socket.d.ts} +5 -4
- package/dist/components/chat/hooks/use-scroll-lock.d.ts +6 -0
- package/dist/components/chat/{sdk-initialization.hook.d.ts → hooks/use-sdk-initialization.d.ts} +4 -2
- package/dist/components/chat/index.d.ts +1 -3
- package/dist/components/chat/message-mapping.d.ts +17 -0
- package/dist/components/chat/validations.d.ts +62 -74
- package/dist/components/chat-interface/chat-interface.d.ts +2 -0
- package/dist/components/chat-interface/content.d.ts +1 -1
- package/dist/components/chat-interface/context.d.ts +2 -2
- package/dist/components/chat-interface/footer.d.ts +1 -1
- package/dist/components/chat-interface/header.d.ts +1 -1
- package/dist/components/chat-interface/index.d.ts +2 -27
- package/dist/components/chat-interface/message-bubble/message-action-buttons.d.ts +6 -0
- package/dist/components/chat-interface/message-bubble/message-animation-state.d.ts +2 -0
- package/dist/components/chat-interface/message-bubble/message-bubble-item.d.ts +7 -0
- package/dist/components/{chat-message-bubble.d.ts → chat-interface/message-bubble/message-bubble.d.ts} +2 -2
- package/dist/components/{chat-rating-bubble.d.ts → chat-interface/rating-message-bubble.d.ts} +1 -1
- package/dist/components/chat-interface/shared.d.ts +11 -1
- package/dist/components/chat-interface/skeleton.d.ts +4 -2
- package/dist/components/chat-interface/suggested-messages.d.ts +20 -0
- package/dist/components/chat-interface/types.d.ts +56 -0
- package/dist/components/embed/chat-bubble.d.ts +6 -0
- package/dist/components/{iframe.d.ts → embed/iframe.d.ts} +1 -1
- package/dist/components/{portal.d.ts → embed/portal.d.ts} +2 -1
- package/dist/components/{chat → embed}/proactive-message.d.ts +1 -1
- package/dist/components/{render-chat.d.ts → embed/render-chat.d.ts} +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/logo.d.ts +1 -1
- package/dist/components/ui/avatar.d.ts +3 -4
- package/dist/components/ui/card.d.ts +7 -7
- package/dist/components/ui/dialog.d.ts +11 -12
- package/dist/components/ui/markdown-viewer.d.ts +1 -1
- package/dist/components/ui/scroll-area.d.ts +5 -5
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/star-rating.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts +1 -2
- package/dist/contexts/{agent-cognition-context-definition.d.ts → agent-cognition/agent-cognition-context.d.ts} +1 -1
- package/dist/contexts/{agent-cognition.context.d.ts → agent-cognition/agent-cognition-provider.d.ts} +1 -1
- package/dist/contexts/{error-handling.utils.d.ts → error-handling/error-context.d.ts} +1 -1
- package/dist/contexts/{constants.d.ts → error-handling/error-messages.d.ts} +4 -0
- package/dist/contexts/error-handling/error-provider.d.ts +4 -0
- package/dist/contexts/theme.context.d.ts +14 -1
- package/dist/embed-loader.d.ts +35 -0
- package/dist/embed-loader.entry.d.ts +1 -0
- package/dist/hooks/use-debounce.d.ts +6 -0
- package/dist/hooks/use-drag-scroll.d.ts +5 -4
- package/dist/hooks/use-latest-ref.d.ts +9 -0
- package/dist/hooks/use-typed-text.d.ts +11 -0
- package/dist/index-hFbiYJI3.js +4165 -0
- package/dist/index-hFbiYJI3.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2288 -7
- package/dist/index.mjs.map +1 -1
- package/dist/lib/appsync-events-client.d.ts +71 -0
- package/dist/lib/color-aura.d.ts +23 -0
- package/dist/lib/color-contrast.d.ts +13 -0
- package/dist/lib/config.d.ts +0 -15
- package/dist/lib/cookies.d.ts +13 -0
- package/dist/lib/eloquent-ai-api-client.d.ts +20 -2
- package/dist/lib/http.d.ts +3 -0
- package/dist/lib/retry.d.ts +10 -0
- package/dist/lib/utils.d.ts +0 -7
- package/dist/lib/wrap-promise.d.ts +7 -0
- package/dist/skeleton-ebiDTqw5.js +18959 -0
- package/dist/skeleton-ebiDTqw5.js.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.mjs +19 -0
- package/dist/ui.mjs.map +1 -0
- package/package.json +59 -31
- package/dist/components/chat/chat.hook.d.ts +0 -47
- package/dist/components/chat-bubble.d.ts +0 -4
- package/dist/components/logo-animated.d.ts +0 -6
- package/dist/components/logo-squared.d.ts +0 -5
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/loading-ellipsis.d.ts +0 -1
- package/dist/components/ui/popover.d.ts +0 -6
- package/dist/contexts/error-handling.context.d.ts +0 -4
- package/dist/contexts/utils.d.ts +0 -2
- package/dist/hooks/useTypewriter.d.ts +0 -1
- package/dist/index-3AnUoCpF.js +0 -30693
- package/dist/index-3AnUoCpF.js.map +0 -1
- package/dist/index-DmtNxqna.js +0 -18793
- package/dist/index-DmtNxqna.js.map +0 -1
- /package/dist/components/chat/{ui-initialization.hook.d.ts → hooks/use-ui-initialization.d.ts} +0 -0
- /package/dist/components/chat/{user-identity.hook.d.ts → hooks/use-user-identity.d.ts} +0 -0
- /package/dist/{hooks → contexts/agent-cognition}/use-agent-cognition-context.d.ts +0 -0
- /package/dist/{hooks → contexts/agent-cognition}/use-agent-cognition.d.ts +0 -0
- /package/dist/hooks/{useFetch.d.ts → use-fetch.d.ts} +0 -0
- /package/dist/{type.d.ts → types/message.d.ts} +0 -0
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ChatInterface, type ChatInterfaceProps, } from './components/chat-interface';
|
|
2
|
+
export { ChatInterfaceProvider } from './components/chat-interface/context';
|
|
3
|
+
export { SkeletonChatInterface } from './components/chat-interface/skeleton';
|
|
4
|
+
export { MessageBubble } from './components/chat-interface/message-bubble/message-bubble';
|
|
5
|
+
export { RatingMessageBubble } from './components/chat-interface/rating-message-bubble';
|
|
6
|
+
export { Banner } from './components/banner';
|
|
7
|
+
export { Logo } from './components/logo';
|
|
8
|
+
export { MarkdownViewer } from './components/ui/markdown-viewer';
|
|
9
|
+
export { ThemeProvider, useTheme, type ThemeContextType, } from './contexts/theme.context';
|
|
10
|
+
export type { Message, MessageData } from './types/message';
|
package/dist/ui.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { B as n, C as t, a as r, L as o, M as f, b, R as i, S as l, T as g, u } from "./skeleton-ebiDTqw5.js";
|
|
2
|
+
try {
|
|
3
|
+
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, a = new e.Error().stack;
|
|
4
|
+
a && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[a] = "f9ed1380-1437-4e00-acb2-cdd914034062", e._sentryDebugIdIdentifier = "sentry-dbid-f9ed1380-1437-4e00-acb2-cdd914034062");
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
n as Banner,
|
|
9
|
+
t as ChatInterface,
|
|
10
|
+
r as ChatInterfaceProvider,
|
|
11
|
+
o as Logo,
|
|
12
|
+
f as MarkdownViewer,
|
|
13
|
+
b as MessageBubble,
|
|
14
|
+
i as RatingMessageBubble,
|
|
15
|
+
l as SkeletonChatInterface,
|
|
16
|
+
g as ThemeProvider,
|
|
17
|
+
u as useTheme
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ui.mjs.map
|
package/dist/ui.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eloquentai/chat-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0-dev.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chat",
|
|
@@ -11,13 +11,21 @@
|
|
|
11
11
|
"javascript"
|
|
12
12
|
],
|
|
13
13
|
"author": "Eloquent AI",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/Eloquent-AI/eloquent-ai-chat-sdk.git"
|
|
17
|
+
},
|
|
14
18
|
"type": "module",
|
|
15
19
|
"main": "dist/index.mjs",
|
|
16
20
|
"types": "dist/index.d.ts",
|
|
17
21
|
"exports": {
|
|
18
22
|
".": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./ui": {
|
|
27
|
+
"types": "./dist/ui.d.ts",
|
|
28
|
+
"import": "./dist/ui.mjs"
|
|
21
29
|
},
|
|
22
30
|
"./index.css": "./dist/index.css"
|
|
23
31
|
},
|
|
@@ -29,65 +37,74 @@
|
|
|
29
37
|
"build": "tsc -b && vite build",
|
|
30
38
|
"build:dev": "VITE_ENVIRONMENT=dev tsc -b && vite build --mode dev",
|
|
31
39
|
"build:prod": "VITE_ENVIRONMENT=prod tsc -b && vite build --mode prod",
|
|
32
|
-
"build:
|
|
33
|
-
"build:vanilla
|
|
34
|
-
"build:vanilla:
|
|
40
|
+
"build:embed-loader": "vite build --config vite.embed-loader.config.ts",
|
|
41
|
+
"build:vanilla": "tsc -b && vite build --config vite.vanilla.config.ts && npm run build:embed-loader && node scripts/verify-embed-bundle.mjs",
|
|
42
|
+
"build:vanilla:dev": "VITE_ENVIRONMENT=dev tsc -b && vite build --config vite.vanilla.config.ts --mode dev && npm run build:embed-loader && node scripts/verify-embed-bundle.mjs",
|
|
43
|
+
"build:vanilla:prod": "VITE_ENVIRONMENT=prod tsc -b && vite build --config vite.vanilla.config.ts --mode prod && npm run build:embed-loader && node scripts/verify-embed-bundle.mjs",
|
|
44
|
+
"build:analyze": "ANALYZE=true npm run build:vanilla:prod",
|
|
45
|
+
"bundle:report": "node scripts/bundle-report.mjs",
|
|
46
|
+
"bundle:baseline": "node scripts/bundle-report.mjs --json > bundle-baseline.json",
|
|
35
47
|
"preview": "vite preview",
|
|
36
48
|
"trunk": "trunk",
|
|
37
49
|
"lint": "trunk check",
|
|
38
50
|
"lint:ci": "trunk check --ci --no-progress",
|
|
39
51
|
"format": "trunk fmt",
|
|
52
|
+
"knip": "knip",
|
|
53
|
+
"knip:fix": "knip --fix",
|
|
40
54
|
"test": "vitest",
|
|
41
55
|
"test:run": "vitest run",
|
|
42
|
-
"preview:dev": "npx http-server ./dev"
|
|
56
|
+
"preview:dev": "npx http-server ./dev",
|
|
57
|
+
"storybook": "storybook dev -p 6007",
|
|
58
|
+
"build-storybook": "storybook build",
|
|
59
|
+
"verify:embed": "node scripts/verify-embed-bundle.mjs"
|
|
43
60
|
},
|
|
44
61
|
"devDependencies": {
|
|
45
62
|
"@eslint/js": "^9.17.0",
|
|
63
|
+
"@sentry/vite-plugin": "^3.6.1",
|
|
64
|
+
"@storybook/addon-a11y": "^10.4.6",
|
|
65
|
+
"@storybook/addon-docs": "^10.4.6",
|
|
66
|
+
"@storybook/react-vite": "^10.4.6",
|
|
67
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
68
|
+
"@testing-library/dom": "^10.4.1",
|
|
46
69
|
"@testing-library/jest-dom": "^6.7.0",
|
|
47
70
|
"@testing-library/react": "^16.3.0",
|
|
48
|
-
"@testing-library/user-event": "^14.6.1",
|
|
49
71
|
"@trunkio/launcher": "^1.3.4",
|
|
50
72
|
"@types/node": "^22.10.2",
|
|
51
73
|
"@types/react": "^18",
|
|
52
74
|
"@types/react-dom": "^18",
|
|
53
75
|
"@vitejs/plugin-react": "^4.3.4",
|
|
54
|
-
"ajv": "^8.
|
|
55
|
-
"autoprefixer": "^10.4.20",
|
|
56
|
-
"aws-amplify": "^6.16.4",
|
|
57
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
76
|
+
"ajv": "^8.20.0",
|
|
58
77
|
"eslint": "^9.39.4",
|
|
59
78
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
60
79
|
"eslint-plugin-react-refresh": "^0.4.16",
|
|
80
|
+
"eslint-plugin-storybook": "^10.4.6",
|
|
61
81
|
"globals": "^15.14.0",
|
|
62
82
|
"jsdom": "^26.1.0",
|
|
63
|
-
"
|
|
83
|
+
"knip": "^6.32.2",
|
|
84
|
+
"postcss": "^8.5.26",
|
|
64
85
|
"prettier": "^3.4.2",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
86
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
87
|
+
"rollup-preserve-directives": "^1.1.3",
|
|
88
|
+
"storybook": "^10.4.6",
|
|
89
|
+
"tailwindcss": "^4.3.3",
|
|
68
90
|
"terser": "^5.46.0",
|
|
69
91
|
"typescript": "~5.7.2",
|
|
70
92
|
"typescript-eslint": "^8.18.2",
|
|
71
|
-
"vite": "^6.4.
|
|
93
|
+
"vite": "^6.4.3",
|
|
72
94
|
"vite-plugin-dts": "^4.5.4",
|
|
73
|
-
"vitest": "^
|
|
95
|
+
"vitest": "^4.1.9"
|
|
74
96
|
},
|
|
75
97
|
"peerDependencies": {
|
|
76
|
-
"aws-amplify": ">=6.8.0",
|
|
77
98
|
"react": ">=18",
|
|
78
99
|
"react-dom": ">=18"
|
|
79
100
|
},
|
|
80
101
|
"dependencies": {
|
|
81
102
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
82
103
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
83
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
84
104
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
85
|
-
"@rive-app/react-canvas": "^4.27.1",
|
|
86
105
|
"@sentry/react": "^9.19.0",
|
|
87
|
-
"@sentry/vite-plugin": "^3.4.0",
|
|
88
|
-
"@uidotdev/usehooks": "^2.4.1",
|
|
89
106
|
"clsx": "^2.1.1",
|
|
90
|
-
"
|
|
107
|
+
"dompurify": "^3.4.13",
|
|
91
108
|
"lucide-react": "^0.577.0",
|
|
92
109
|
"react-markdown": ">=9.0.0",
|
|
93
110
|
"rehype-sanitize": "^6.0.0",
|
|
@@ -98,12 +115,23 @@
|
|
|
98
115
|
},
|
|
99
116
|
"overrides": {
|
|
100
117
|
"fast-xml-parser": "^5.7.0",
|
|
101
|
-
"tar": "^7.5.
|
|
102
|
-
"minimatch@<3.1.4": "3.1.4",
|
|
118
|
+
"tar": "^7.5.22",
|
|
103
119
|
"lodash@<=4.17.23": "4.18.1",
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
"brace-expansion": "^2.1.2",
|
|
121
|
+
"fast-uri": "^3.1.6",
|
|
122
|
+
"js-yaml": "^4.3.2"
|
|
123
|
+
},
|
|
124
|
+
"allowScripts": {
|
|
125
|
+
"esbuild@0.25.12": true,
|
|
126
|
+
"esbuild@0.28.2": true,
|
|
127
|
+
"fsevents@2.3.3": true,
|
|
128
|
+
"@sentry/cli@2.58.6": true
|
|
129
|
+
},
|
|
130
|
+
"sideEffects": [
|
|
131
|
+
"**/*.css",
|
|
132
|
+
"./src/index.ts",
|
|
133
|
+
"./src/instrumentation.ts",
|
|
134
|
+
"./src/components/index.ts",
|
|
135
|
+
"./dist/index.mjs"
|
|
136
|
+
]
|
|
109
137
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Message, MessageData } from '../../type';
|
|
2
|
-
import { ThemeContextType } from '../../contexts/theme.context';
|
|
3
|
-
import { ChatInterfaceProps } from '../chat-interface';
|
|
4
|
-
export interface UseChatProps {
|
|
5
|
-
appId: string;
|
|
6
|
-
userId?: string;
|
|
7
|
-
userName?: string;
|
|
8
|
-
userData?: Record<string, string | number | boolean>;
|
|
9
|
-
theme?: Partial<ThemeContextType>;
|
|
10
|
-
chatProps?: Partial<ChatInterfaceProps>;
|
|
11
|
-
isMobile?: boolean;
|
|
12
|
-
closeButton?: boolean;
|
|
13
|
-
cleanChatButton?: boolean;
|
|
14
|
-
initialOpen?: boolean;
|
|
15
|
-
proactiveMessageHideDelay?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface UseChatReturn {
|
|
18
|
-
isReady: boolean;
|
|
19
|
-
isMobile: boolean;
|
|
20
|
-
chatInterfaceProps: Partial<ChatInterfaceProps>;
|
|
21
|
-
chatOpen: boolean;
|
|
22
|
-
chatOpenDebounced: boolean;
|
|
23
|
-
messages: Message[];
|
|
24
|
-
portalContainer: HTMLElement | null;
|
|
25
|
-
onSendMessage: (message: MessageData) => Promise<void>;
|
|
26
|
-
setChatOpen: (value: boolean | ((prev: boolean) => boolean)) => void;
|
|
27
|
-
onCleanMessages: () => void;
|
|
28
|
-
proactiveMessage?: {
|
|
29
|
-
text: string;
|
|
30
|
-
isVisible: boolean;
|
|
31
|
-
autoHideDelay: number;
|
|
32
|
-
};
|
|
33
|
-
hideProactiveMessage: () => void;
|
|
34
|
-
isChatClosed: boolean;
|
|
35
|
-
onStartNewChat: () => void;
|
|
36
|
-
onRateChat: (rating: number) => Promise<void>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The primary chat hook, responsible for managing the chat state and operations.
|
|
40
|
-
* @param options The hook parameters
|
|
41
|
-
* @returns The chat hook return type
|
|
42
|
-
*/
|
|
43
|
-
export declare function useChat({ environment, apiUrl, appId, userId: initialUserId, userName, userData, chatProps, isMobile: propIsMobile, initialOpen: propInitialOpen, proactiveMessageHideDelay, }: Readonly<Partial<UseChatProps> & {
|
|
44
|
-
environment: "test" | "live";
|
|
45
|
-
apiUrl?: string;
|
|
46
|
-
appId: string;
|
|
47
|
-
}>): UseChatReturn;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function LoadingEllipsis(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
-
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
-
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
export { Popover, PopoverTrigger, PopoverContent };
|
package/dist/contexts/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useTypewriter(text: string, enabled?: boolean): string;
|