@eloquentai/chat-sdk 0.29.0-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.
Files changed (98) hide show
  1. package/README.md +146 -6
  2. package/dist/components/banner.d.ts +1 -1
  3. package/dist/components/chat/chat.d.ts +22 -0
  4. package/dist/components/chat/hooks/use-chat.d.ts +79 -0
  5. package/dist/components/chat/{interface-props.hook.d.ts → hooks/use-interface-props.d.ts} +2 -2
  6. package/dist/components/chat/hooks/use-keyboard-inset.d.ts +6 -0
  7. package/dist/components/chat/{message-events.hook.d.ts → hooks/use-message-events.d.ts} +5 -5
  8. package/dist/components/chat/{persistence.hook.d.ts → hooks/use-persistence.d.ts} +5 -2
  9. package/dist/components/chat/{realtime-socket.hook.d.ts → hooks/use-realtime-socket.d.ts} +5 -4
  10. package/dist/components/chat/hooks/use-scroll-lock.d.ts +6 -0
  11. package/dist/components/chat/{sdk-initialization.hook.d.ts → hooks/use-sdk-initialization.d.ts} +4 -2
  12. package/dist/components/chat/index.d.ts +1 -3
  13. package/dist/components/chat/message-mapping.d.ts +17 -0
  14. package/dist/components/chat/validations.d.ts +62 -74
  15. package/dist/components/chat-interface/chat-interface.d.ts +2 -0
  16. package/dist/components/chat-interface/content.d.ts +1 -1
  17. package/dist/components/chat-interface/context.d.ts +2 -2
  18. package/dist/components/chat-interface/footer.d.ts +1 -1
  19. package/dist/components/chat-interface/header.d.ts +1 -1
  20. package/dist/components/chat-interface/index.d.ts +2 -27
  21. package/dist/components/chat-interface/message-bubble/message-action-buttons.d.ts +6 -0
  22. package/dist/components/chat-interface/message-bubble/message-animation-state.d.ts +2 -0
  23. package/dist/components/chat-interface/message-bubble/message-bubble-item.d.ts +7 -0
  24. package/dist/components/{chat-message-bubble.d.ts → chat-interface/message-bubble/message-bubble.d.ts} +2 -2
  25. package/dist/components/{chat-rating-bubble.d.ts → chat-interface/rating-message-bubble.d.ts} +1 -1
  26. package/dist/components/chat-interface/shared.d.ts +11 -1
  27. package/dist/components/chat-interface/skeleton.d.ts +4 -2
  28. package/dist/components/chat-interface/suggested-messages.d.ts +20 -0
  29. package/dist/components/chat-interface/types.d.ts +56 -0
  30. package/dist/components/embed/chat-bubble.d.ts +6 -0
  31. package/dist/components/{iframe.d.ts → embed/iframe.d.ts} +1 -1
  32. package/dist/components/{portal.d.ts → embed/portal.d.ts} +2 -1
  33. package/dist/components/{chat → embed}/proactive-message.d.ts +1 -1
  34. package/dist/components/{render-chat.d.ts → embed/render-chat.d.ts} +1 -1
  35. package/dist/components/index.d.ts +2 -2
  36. package/dist/components/logo.d.ts +1 -1
  37. package/dist/components/ui/avatar.d.ts +3 -4
  38. package/dist/components/ui/card.d.ts +7 -7
  39. package/dist/components/ui/dialog.d.ts +11 -12
  40. package/dist/components/ui/markdown-viewer.d.ts +1 -1
  41. package/dist/components/ui/scroll-area.d.ts +5 -5
  42. package/dist/components/ui/skeleton.d.ts +2 -1
  43. package/dist/components/ui/star-rating.d.ts +1 -1
  44. package/dist/components/ui/textarea.d.ts +1 -2
  45. package/dist/contexts/{agent-cognition-context-definition.d.ts → agent-cognition/agent-cognition-context.d.ts} +1 -1
  46. package/dist/contexts/{agent-cognition.context.d.ts → agent-cognition/agent-cognition-provider.d.ts} +1 -1
  47. package/dist/contexts/{error-handling.utils.d.ts → error-handling/error-context.d.ts} +1 -1
  48. package/dist/contexts/{constants.d.ts → error-handling/error-messages.d.ts} +4 -0
  49. package/dist/contexts/error-handling/error-provider.d.ts +4 -0
  50. package/dist/contexts/theme.context.d.ts +14 -1
  51. package/dist/embed-loader.d.ts +35 -0
  52. package/dist/embed-loader.entry.d.ts +1 -0
  53. package/dist/hooks/use-debounce.d.ts +6 -0
  54. package/dist/hooks/use-drag-scroll.d.ts +5 -4
  55. package/dist/hooks/use-latest-ref.d.ts +9 -0
  56. package/dist/hooks/use-typed-text.d.ts +11 -0
  57. package/dist/index-hFbiYJI3.js +4165 -0
  58. package/dist/index-hFbiYJI3.js.map +1 -0
  59. package/dist/index.css +1 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.mjs +2288 -7
  62. package/dist/index.mjs.map +1 -1
  63. package/dist/lib/appsync-events-client.d.ts +71 -0
  64. package/dist/lib/color-aura.d.ts +23 -0
  65. package/dist/lib/color-contrast.d.ts +13 -0
  66. package/dist/lib/config.d.ts +0 -15
  67. package/dist/lib/cookies.d.ts +13 -0
  68. package/dist/lib/eloquent-ai-api-client.d.ts +20 -2
  69. package/dist/lib/http.d.ts +3 -0
  70. package/dist/lib/retry.d.ts +10 -0
  71. package/dist/lib/utils.d.ts +0 -7
  72. package/dist/lib/wrap-promise.d.ts +7 -0
  73. package/dist/skeleton-ebiDTqw5.js +18959 -0
  74. package/dist/skeleton-ebiDTqw5.js.map +1 -0
  75. package/dist/ui.d.ts +10 -0
  76. package/dist/ui.mjs +19 -0
  77. package/dist/ui.mjs.map +1 -0
  78. package/package.json +59 -31
  79. package/dist/components/chat/chat.hook.d.ts +0 -47
  80. package/dist/components/chat-bubble.d.ts +0 -4
  81. package/dist/components/logo-animated.d.ts +0 -6
  82. package/dist/components/logo-squared.d.ts +0 -5
  83. package/dist/components/ui/input.d.ts +0 -3
  84. package/dist/components/ui/loading-ellipsis.d.ts +0 -1
  85. package/dist/components/ui/popover.d.ts +0 -6
  86. package/dist/contexts/error-handling.context.d.ts +0 -4
  87. package/dist/contexts/utils.d.ts +0 -2
  88. package/dist/hooks/useTypewriter.d.ts +0 -1
  89. package/dist/index-DaMnFGD6.js +0 -18793
  90. package/dist/index-DaMnFGD6.js.map +0 -1
  91. package/dist/index-DySyj7Hm.js +0 -30694
  92. package/dist/index-DySyj7Hm.js.map +0 -1
  93. /package/dist/components/chat/{ui-initialization.hook.d.ts → hooks/use-ui-initialization.d.ts} +0 -0
  94. /package/dist/components/chat/{user-identity.hook.d.ts → hooks/use-user-identity.d.ts} +0 -0
  95. /package/dist/{hooks → contexts/agent-cognition}/use-agent-cognition-context.d.ts +0 -0
  96. /package/dist/{hooks → contexts/agent-cognition}/use-agent-cognition.d.ts +0 -0
  97. /package/dist/hooks/{useFetch.d.ts → use-fetch.d.ts} +0 -0
  98. /package/dist/{type.d.ts → types/message.d.ts} +0 -0
@@ -1,27 +1,2 @@
1
- import { Message, MessageData } from '../../type';
2
- import { ThemeContextType } from '../../contexts/theme.context';
3
- export interface ChatInterfaceProps {
4
- displayWelcomeMessages?: boolean;
5
- theme?: Partial<ThemeContextType>;
6
- isOpen?: boolean;
7
- isMobile?: boolean;
8
- messages?: Message[];
9
- assistantName?: string;
10
- assistantLogo?: string;
11
- legalText?: string;
12
- closeButton: boolean;
13
- cleanChatButton: boolean;
14
- hideCopyButton?: boolean;
15
- collectUserFeedback?: boolean;
16
- suggestedMessages?: boolean;
17
- title?: string;
18
- subtitle?: string;
19
- onSendMessage?: (message: MessageData) => Promise<void>;
20
- onMessageClick?: (message: MessageData) => void;
21
- onClose?: () => void;
22
- onCleanChat?: () => void;
23
- isChatClosed?: boolean;
24
- onStartNewChat?: () => void;
25
- onRateChat?: (rating: number) => void;
26
- }
27
- export declare function ChatInterface(props: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
1
+ export { ChatInterface } from './chat-interface';
2
+ export type { ChatInterfaceProps } from './types';
@@ -0,0 +1,6 @@
1
+ import { MessageData } from '../../../types/message';
2
+ type MessageActionButtonsProps = Readonly<{
3
+ messageData: MessageData;
4
+ }>;
5
+ export declare function MessageActionButtons({ messageData, }: MessageActionButtonsProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function hasAnimated(key: string): boolean;
2
+ export declare function markAnimated(key: string): void;
@@ -0,0 +1,7 @@
1
+ import { MessageData } from '../../../types/message';
2
+ export declare function MessageBubbleItem({ messageData, isBot, isSibling, }: {
3
+ messageData: MessageData;
4
+ isBot: boolean;
5
+ isSameSender: boolean;
6
+ isSibling?: boolean;
7
+ }): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { Message } from '../type';
1
+ import { Message } from '../../../types/message';
2
2
  type MessageBubbleProps = Readonly<{
3
3
  className?: string;
4
4
  message: Message;
5
5
  nextMessage?: Message;
6
6
  assistantLogo?: string;
7
7
  }>;
8
- export declare function MessageBubble({ className, message, nextMessage, assistantLogo, }: MessageBubbleProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function MessageBubble({ className, message, nextMessage, assistantLogo, }: MessageBubbleProps): import("react").JSX.Element;
9
9
  export {};
@@ -1,5 +1,5 @@
1
1
  interface RatingMessageBubbleProps {
2
2
  onRate: (rating: number) => void;
3
3
  }
4
- export declare function RatingMessageBubble({ onRate }: RatingMessageBubbleProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function RatingMessageBubble({ onRate }: RatingMessageBubbleProps): import("react").JSX.Element;
5
5
  export {};
@@ -1,4 +1,14 @@
1
- export declare const cardContainerClassName: ({ isOpen, isMobile, }: {
1
+ /**
2
+ * Header row layout, shared between the real header and its loading skeleton
3
+ * so the skeleton cannot drift out of alignment with what it mimics.
4
+ */
5
+ export declare const headerRowClassName = "eloq:p-4 eloq:flex eloq:flex-row eloq:items-center eloq:justify-between eloq:space-y-0";
6
+ /** Avatar + title cluster on the left side of the header row. */
7
+ export declare const headerTitleGroupClassName = "eloq:flex eloq:flex-row eloq:items-center eloq:space-x-3";
8
+ /** Secondary text beside a title (header subtitle, bubble assistant name). */
9
+ export declare const subtitleTextClassName = "eloq:text-xs eloq:text-gray-500 eloq:dark:text-muted-foreground";
10
+ export declare const cardContainerClassName: ({ isOpen, isMobile, skipAnimation, }: {
2
11
  isOpen: boolean;
3
12
  isMobile: boolean | undefined;
13
+ skipAnimation?: boolean;
4
14
  }) => string;
@@ -1,4 +1,6 @@
1
- export declare function SkeletonChatInterface({ isOpen, isMobile, }: {
1
+ export declare function SkeletonChatInterface({ isOpen, isMobile, skipAnimation, }: {
2
2
  isOpen?: boolean;
3
3
  isMobile: boolean | undefined;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ /** Render in place without the panel entrance — for embedded remounts, where the frame replaces a widget that was already on screen. */
5
+ skipAnimation?: boolean;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ export interface SuggestedMessagesProps {
2
+ /** Called with the pill's text; the footer fills and focuses the input. */
3
+ onSelect: (message: string) => void;
4
+ }
5
+ /**
6
+ * The quick-reply pill row shown above the composer. Renders nothing unless
7
+ * `suggestedMessages` is enabled in the chat-interface context AND
8
+ * `suggestedMessageTexts` is non-empty (there are no placeholder examples),
9
+ * and only until the conversation starts: the pills disappear the moment the
10
+ * user sends their first message (they reappear when the chat is cleared,
11
+ * since the message list resets). Clicking a pill only fills the composer —
12
+ * the pills stay until the message is actually sent. Two independently
13
+ * toggleable effects highlight the first (primary) pill:
14
+ * - `hasSuggestedMessageAura` — a rotating conic-gradient frame in a
15
+ * saturated/soft pair derived from the pill background (or the user-bubble
16
+ * colour when the pills use the default muted background);
17
+ * - `hasSuggestedMessageShine` — a banner-style light streak flashing across
18
+ * the pill at random 4–9 second intervals.
19
+ */
20
+ export declare function SuggestedMessages({ onSelect }: SuggestedMessagesProps): import("react").JSX.Element | null;
@@ -0,0 +1,56 @@
1
+ import { ThemeContextType } from '../../contexts/theme.context';
2
+ import { Message, MessageData } from '../../types/message';
3
+ export interface ChatInterfaceProps {
4
+ displayWelcomeMessages?: boolean;
5
+ theme?: Partial<ThemeContextType>;
6
+ isOpen?: boolean;
7
+ isMobile?: boolean;
8
+ /** Current on-screen keyboard overlap (px), used to lift the input above it. */
9
+ keyboardInset?: number;
10
+ messages?: Message[];
11
+ assistantName?: string;
12
+ assistantLogo?: string;
13
+ legalText?: string;
14
+ /** Show the close (X) button in the chat header. Defaults to true. */
15
+ hasCloseButton?: boolean;
16
+ /** Show the clear-conversation button in the chat header. Defaults to true. */
17
+ hasCleanChatButton?: boolean;
18
+ /** @deprecated Use `hasCloseButton` instead. Ignored when `hasCloseButton` is set. */
19
+ closeButton?: boolean;
20
+ /** @deprecated Use `hasCleanChatButton` instead. Ignored when `hasCleanChatButton` is set. */
21
+ cleanChatButton?: boolean;
22
+ /** Show the copy-message button on assistant messages. Defaults to true. */
23
+ hasCopyButton?: boolean;
24
+ /** @deprecated Use `hasCopyButton` instead. Ignored when `hasCopyButton` is set. */
25
+ hideCopyButton?: boolean;
26
+ collectUserFeedback?: boolean;
27
+ suggestedMessages?: boolean;
28
+ /** Quick-reply pill texts; the row renders nothing when empty. */
29
+ suggestedMessageTexts?: string[];
30
+ /** Rotating conic-gradient frame around the first suggestion pill, colored from the pill/user-bubble background. */
31
+ hasSuggestedMessageAura?: boolean;
32
+ /** Banner-style light streak flashing across the first suggestion pill at random intervals. */
33
+ hasSuggestedMessageShine?: boolean;
34
+ title?: string;
35
+ subtitle?: string;
36
+ /**
37
+ * Play the popup-style panel entrance animation, defaulting to true — the
38
+ * embed widget's existing behavior. With false the interface renders as
39
+ * plain page content with no entrance; read-only transcript views (and
40
+ * server rendering) want this.
41
+ */
42
+ hasIntroAnimation?: boolean;
43
+ /**
44
+ * Mark the widget as running against a test (non-live) agent: a yellow/black
45
+ * caution stripe is drawn down the widget's left edge so a test session can
46
+ * never be mistaken for the production one.
47
+ */
48
+ isTestMode?: boolean;
49
+ onSendMessage?: (message: MessageData) => Promise<void>;
50
+ onMessageClick?: (message: MessageData) => void;
51
+ onClose?: () => void;
52
+ onCleanChat?: () => void;
53
+ isChatClosed?: boolean;
54
+ onStartNewChat?: () => void;
55
+ onRateChat?: (rating: number) => void;
56
+ }
@@ -0,0 +1,6 @@
1
+ export declare function ChatBubble({ toggleBubble, isDarkMode, }: {
2
+ isOpen: boolean;
3
+ toggleBubble: () => void;
4
+ /** Renders in its own iframe (no `.dark` ancestor), so the mode arrives as a prop. */
5
+ isDarkMode?: boolean;
6
+ }): import("react").JSX.Element;
@@ -2,5 +2,5 @@ import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
2
  type IframeProps = PropsWithChildren<HTMLAttributes<HTMLIFrameElement>> & {
3
3
  head: ReactNode;
4
4
  };
5
- export declare function Iframe({ children, head, ...props }: IframeProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Iframe({ children, head, ...props }: IframeProps): import("react").JSX.Element;
6
6
  export {};
@@ -1,5 +1,6 @@
1
+ import { ReactNode } from 'react';
1
2
  interface PortalProps {
2
- children: React.ReactNode;
3
+ children: ReactNode;
3
4
  container: HTMLElement;
4
5
  }
5
6
  export declare function Portal({ children, container }: PortalProps): import('react').ReactPortal;
@@ -5,4 +5,4 @@ export interface ProactiveMessageProps {
5
5
  onMessageClick?: () => void;
6
6
  autoHideDelay?: number;
7
7
  }
8
- export declare function ProactiveMessage({ message, isVisible, onDismiss, onMessageClick, autoHideDelay, }: ProactiveMessageProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function ProactiveMessage({ message, isVisible, onDismiss, onMessageClick, autoHideDelay, }: ProactiveMessageProps): import("react").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { ChatProps } from './chat';
1
+ import { ChatProps } from '../chat';
2
2
  type UnmountFunction = () => void;
3
3
  export declare function renderChat(container: HTMLElement, props: ChatProps): UnmountFunction;
4
4
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Chat, ChatProps } from './chat';
2
- import { renderChat } from './render-chat';
2
+ import { renderChat } from './embed/render-chat';
3
3
  import { ChatInterface, ChatInterfaceProps } from './chat-interface';
4
- import { useRealtimeSocket, UseRealtimeSocketOptions, UseRealtimeSocketReturn } from './chat/realtime-socket.hook';
4
+ import { useRealtimeSocket, UseRealtimeSocketOptions, UseRealtimeSocketReturn } from './chat/hooks/use-realtime-socket';
5
5
  import { ChatResponse } from './chat/validations';
6
6
  import { BootResponse, MessageResponse } from '../lib/eloquent-ai-api-client';
7
7
  export { Chat, type ChatProps, ChatInterface, type ChatInterfaceProps, renderChat, useRealtimeSocket, type UseRealtimeSocketOptions, type UseRealtimeSocketReturn, type ChatResponse, type BootResponse, type MessageResponse, };
@@ -4,4 +4,4 @@ export interface LogoProps {
4
4
  fgColor?: string;
5
5
  src?: string;
6
6
  }
7
- export declare function Logo(props: LogoProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Logo(props: LogoProps): import("react").JSX.Element;
@@ -1,6 +1,5 @@
1
- import * as React from "react";
2
1
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
- declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
4
- declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
5
- declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
2
+ declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & import('react').RefAttributes<HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
3
+ declare const AvatarImage: import('react').ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & import('react').RefAttributes<HTMLImageElement>, "ref"> & import('react').RefAttributes<HTMLImageElement>>;
4
+ declare const AvatarFallback: import('react').ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & import('react').RefAttributes<HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
6
5
  export { Avatar, AvatarImage, AvatarFallback };
@@ -1,8 +1,8 @@
1
- import * as React from "react";
2
- declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
1
+ import { HTMLAttributes } from 'react';
2
+ declare const Card: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
3
+ declare const CardHeader: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
4
+ declare const CardTitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
5
+ declare const CardDescription: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
6
+ declare const CardContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
7
+ declare const CardFooter: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
8
8
  export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
@@ -1,19 +1,18 @@
1
- import * as React from "react";
1
+ import { HTMLAttributes } from 'react';
2
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
3
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
- declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const Dialog: import('react').FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogOverlay: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
+ declare const DialogContent: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
9
8
  declare const DialogHeader: {
10
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
9
+ ({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
11
10
  displayName: string;
12
11
  };
13
12
  declare const DialogFooter: {
14
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
13
+ ({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
15
14
  displayName: string;
16
15
  };
17
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
- export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
16
+ declare const DialogTitle: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>, "ref"> & import('react').RefAttributes<HTMLHeadingElement>>;
17
+ declare const DialogDescription: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>, "ref"> & import('react').RefAttributes<HTMLParagraphElement>>;
18
+ export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,5 +1,5 @@
1
1
  interface MarkdownViewerProps {
2
2
  text: string;
3
3
  }
4
- export declare const MarkdownViewer: ({ text }: MarkdownViewerProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const MarkdownViewer: ({ text }: MarkdownViewerProps) => import("react").JSX.Element;
5
5
  export {};
@@ -1,7 +1,7 @@
1
- import * as React from "react";
1
+ import { UIEvent } from 'react';
2
2
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
- declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
4
- onViewportScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
5
- } & React.RefAttributes<HTMLDivElement>>;
6
- declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const ScrollArea: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
4
+ onViewportScroll?: (event: UIEvent<HTMLDivElement>) => void;
5
+ } & import('react').RefAttributes<HTMLDivElement>>;
6
+ declare const ScrollBar: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
7
  export { ScrollArea, ScrollBar };
@@ -1,2 +1,3 @@
1
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
1
+ import { HTMLAttributes } from 'react';
2
+ declare function Skeleton({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
2
3
  export { Skeleton };
@@ -3,5 +3,5 @@ interface StarRatingProps {
3
3
  onChange: (rating: number) => void;
4
4
  disabled?: boolean;
5
5
  }
6
- export declare function StarRating({ value, onChange, disabled, }: StarRatingProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function StarRating({ value, onChange, disabled, }: StarRatingProps): import("react").JSX.Element;
7
7
  export {};
@@ -1,3 +1,2 @@
1
- import * as React from "react";
2
- declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
1
+ declare const Textarea: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
3
2
  export { Textarea };
@@ -1,2 +1,2 @@
1
- import { UseAgentCognitionReturn } from '../hooks/use-agent-cognition';
1
+ import { UseAgentCognitionReturn } from './use-agent-cognition';
2
2
  export declare const AgentCognitionContext: import('react').Context<UseAgentCognitionReturn | null>;
@@ -2,5 +2,5 @@ import { ReactNode } from 'react';
2
2
  interface AgentCognitionProviderProps {
3
3
  children: ReactNode;
4
4
  }
5
- export declare function AgentCognitionProvider({ children, }: AgentCognitionProviderProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AgentCognitionProvider({ children, }: AgentCognitionProviderProps): import("react").JSX.Element;
6
6
  export {};
@@ -1,4 +1,4 @@
1
- import { ServerError } from '../lib/http';
1
+ import { ServerError } from '../../lib/http';
2
2
  export interface SdkError {
3
3
  code: number;
4
4
  message: string;
@@ -1,6 +1,10 @@
1
1
  export declare enum ERROR_CODES {
2
2
  NETWORK_ERROR = 0,
3
3
  MAINTENANCE_MODE = 5031,
4
+ CHAT_DISABLED = 5032,
5
+ RATE_LIMITED_NEW_CONVERSATION = 5033,
6
+ RATE_LIMITED_MESSAGE = 5034,
4
7
  TECHNICAL_DIFFICULTIES = 5001
5
8
  }
6
9
  export declare const ERROR_MESSAGES: Record<ERROR_CODES | string, string>;
10
+ export declare const getErrorMessage: (code: ERROR_CODES) => string;
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const ErrorProvider: ({ children }: {
3
+ children: ReactNode;
4
+ }) => import("react").JSX.Element;
@@ -3,11 +3,24 @@ export interface ThemeContextType {
3
3
  mode: string;
4
4
  botBubbleColor: string;
5
5
  userBubbleColor: string;
6
+ /** Background of the suggested-message quick-reply pills. Empty string falls back to the default muted style. */
7
+ suggestedMessageBubbleColor: string;
8
+ /** Explicit text color for user bubbles. Empty string = auto (black/white by contrast). */
9
+ userBubbleTextColor: string;
10
+ /** Explicit text color for bot bubbles. Empty string = auto (black/white by contrast). */
11
+ botBubbleTextColor: string;
12
+ /** Explicit text color for the suggested-message pills. Empty string = auto (black/white by contrast). */
13
+ suggestedMessageBubbleTextColor: string;
6
14
  legalText: string;
7
15
  }
8
16
  export declare function ThemeProvider(props: PropsWithChildren<{
9
17
  mode?: string;
18
+ botBubbleColor?: string | undefined;
10
19
  userBubbleColor?: string | undefined;
20
+ suggestedMessageBubbleColor?: string | undefined;
21
+ userBubbleTextColor?: string | undefined;
22
+ botBubbleTextColor?: string | undefined;
23
+ suggestedMessageBubbleTextColor?: string | undefined;
11
24
  legalText?: string;
12
- }>): import("react/jsx-runtime").JSX.Element;
25
+ }>): import("react").JSX.Element;
13
26
  export declare const useTheme: () => ThemeContextType;
@@ -0,0 +1,35 @@
1
+ export declare const EMBED_MODULE_FILE_NAME = "index.embed.js";
2
+ export declare const EMBED_GLOBAL_NAME = "EloquentChatSDK";
3
+ type UnmountFunction = () => void;
4
+ type RenderChatFunction = (container: HTMLElement, props: Record<string, unknown>) => UnmountFunction;
5
+ /** The shape of the dynamically imported SDK module the loader hands off to. */
6
+ export type EmbedSdkModule = Record<string, unknown> & {
7
+ renderChat: RenderChatFunction;
8
+ };
9
+ export type EmbedSdkGlobal = Record<string, unknown> & {
10
+ renderChat: RenderChatFunction;
11
+ /** Resolves with the SDK module, or null when loading failed. */
12
+ ready: Promise<EmbedSdkModule | null>;
13
+ };
14
+ /** Resolves the ES module URL next to the loader's own script URL. */
15
+ export declare function resolveEmbedModuleUrl(loaderScriptUrl: string): string;
16
+ /**
17
+ * Finds the absolute URL of the loader's own <script> tag.
18
+ * `document.currentScript` is only populated during the initial synchronous
19
+ * evaluation, which is exactly when the loader runs; the tag scan is a
20
+ * fallback for exotic loading strategies (e.g. the snippet injected the tag
21
+ * without src-based execution order guarantees).
22
+ */
23
+ export declare function findLoaderScriptUrl(documentReference: Document): string | null;
24
+ export type InstallEmbedLoaderOptions = {
25
+ globalObject: Record<string, unknown>;
26
+ documentReference: Document;
27
+ importModule: (moduleUrl: string) => Promise<EmbedSdkModule>;
28
+ };
29
+ /**
30
+ * Installs the queueing SDK global and kicks off the module import.
31
+ * Returns the module (or null on failure) — the same promise exposed as
32
+ * `window.EloquentChatSDK.ready`.
33
+ */
34
+ export declare function installEmbedLoader({ globalObject, documentReference, importModule, }: InstallEmbedLoaderOptions): Promise<EmbedSdkModule | null>;
35
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns `value` delayed by `delayMilliseconds`: the returned value only
3
+ * updates once the input has stayed unchanged for the full delay. Drop-in
4
+ * replacement for `useDebounce` from `@uidotdev/usehooks`.
5
+ */
6
+ export declare function useDebounce<Type>(value: Type, delayMilliseconds: number): Type;
@@ -1,6 +1,7 @@
1
+ import { MouseEvent } from 'react';
1
2
  export declare function useDragScroll(): {
2
- onMouseDown: (e: React.MouseEvent<HTMLDivElement>) => void;
3
- onMouseUp: (e: React.MouseEvent<HTMLDivElement>) => void;
4
- onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
5
- onMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
3
+ onMouseDown: (e: MouseEvent<HTMLDivElement>) => void;
4
+ onMouseUp: (e: MouseEvent<HTMLDivElement>) => void;
5
+ onMouseLeave: (e: MouseEvent<HTMLDivElement>) => void;
6
+ onMouseMove: (e: MouseEvent<HTMLDivElement>) => void;
6
7
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns a ref that always holds the latest `value`, updated after every
3
+ * render. The "latest ref" pattern: long-lived closures (timers, socket
4
+ * subscriptions) read `ref.current` at call time instead of capturing a
5
+ * stale value, without needing the value in any dependency array.
6
+ */
7
+ export declare function useLatestRef<Type>(value: Type): {
8
+ readonly current: Type;
9
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Reveals `text` one character at a time, restarting whenever the text changes.
3
+ *
4
+ * Distinct from message rendering, which reveals whole messages at once: cognition
5
+ * labels are a few words that replace each other, so typing them in is what
6
+ * makes the swap read as the agent moving on to the next step rather than the
7
+ * text glitching.
8
+ *
9
+ * Returns the full text immediately when the reader prefers reduced motion.
10
+ */
11
+ export declare function useTypedText(text: string, isEnabled?: boolean): string;