@botzki/react 0.1.2 → 0.1.3

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/dist/index.d.cts CHANGED
@@ -1,8 +1,165 @@
1
1
  import * as React from 'react';
2
- import React__default from 'react';
2
+ import React__default, { CSSProperties } from 'react';
3
3
  import { Citation, ChatResponse, Botzki, BotzkiUser, WidgetOptions } from '@botzki/js';
4
4
  export { BotzkiConfig, BotzkiUser, ChatOptions, ChatResponse, Citation, WidgetOptions } from '@botzki/js';
5
5
 
6
+ type AiBotEmotion = "neutral" | "happy" | "love" | "laugh" | "surprised" | "wow" | "sad" | "thinking" | "sleepy" | "wink";
7
+ type AiBotMotion = "jump" | "spin" | "bounce" | "wiggle" | "float";
8
+ type AiBotActivity = "idle" | "speaking" | "listening";
9
+ type AiBotShape = "pebble" | "circle" | "squircle" | "flower" | "blob";
10
+ interface AiBotOptions {
11
+ emotion?: AiBotEmotion;
12
+ activity?: AiBotActivity;
13
+ shape?: AiBotShape;
14
+ /** Plays once; change `motionKey` to replay the same motion. */
15
+ motion?: AiBotMotion | null;
16
+ motionKey?: number;
17
+ onMotionEnd?: (motion: AiBotMotion) => void;
18
+ /** Idle glances around the room. */
19
+ lookAround?: boolean;
20
+ /** Eyes follow the mouse pointer anywhere in the window. */
21
+ followCursor?: boolean;
22
+ /** Giggles when the pointer touches the body. */
23
+ hoverGiggle?: boolean;
24
+ /** Fires when the pointer starts a giggle. */
25
+ onTickle?: () => void;
26
+ /** Change to make the bot chuckle along softly, as if someone next to it were being tickled. */
27
+ chuckleKey?: number;
28
+ }
29
+
30
+ interface BotziAvatarProps extends AiBotOptions {
31
+ /** Gradient stops, light to dark. Defaults to white pebble with subtle light gray. */
32
+ colors?: readonly [string, string];
33
+ /** Color of eyes and mouth. Defaults to #000000. */
34
+ faceColor?: string;
35
+ /** Color of the eyes. Overrides faceColor. */
36
+ eyeColor?: string;
37
+ /** Color of the mouth. Overrides faceColor. */
38
+ mouthColor?: string;
39
+ /** Outline (stroke) color for the avatar body. */
40
+ outlineColor?: string;
41
+ /** Outline width in px. */
42
+ outlineWidth?: number | string;
43
+ /** Diameter of the body in px. Defaults to 36. */
44
+ size?: number;
45
+ label?: string;
46
+ className?: string;
47
+ style?: CSSProperties;
48
+ }
49
+ /**
50
+ * Official Botzki AI Character Avatar.
51
+ * Fully interactive SVG with cursor-following eyes, blinking, expressions, and physics.
52
+ */
53
+ declare function BotziAvatar({ colors, faceColor, eyeColor, mouthColor, outlineColor, outlineWidth, size, label, className, style, shape, followCursor, ...options }: BotziAvatarProps): React.JSX.Element;
54
+ declare const AiBotAvatar: typeof BotziAvatar;
55
+
56
+ /**
57
+ * Avatar configuration options for customizing the Botzi character.
58
+ */
59
+ interface BotzkiAvatarOptions {
60
+ /**
61
+ * Two-stop gradient colors for the avatar body (e.g. `["#66a6ff", "#0059d4"]`).
62
+ */
63
+ colors?: readonly [string, string];
64
+ /**
65
+ * Color for both eyes and mouth of the Botzi avatar. Defaults to "#ffffff".
66
+ */
67
+ faceColor?: string;
68
+ /**
69
+ * Custom color for the eyes. Overrides faceColor.
70
+ */
71
+ eyeColor?: string;
72
+ /**
73
+ * Custom color for the mouth. Overrides faceColor.
74
+ */
75
+ mouthColor?: string;
76
+ /**
77
+ * Procedural body shape ("pebble" | "circle" | "squircle" | "flower" | "blob").
78
+ * Defaults to "pebble".
79
+ */
80
+ shape?: AiBotShape;
81
+ /**
82
+ * Diameter of the avatar body in pixels.
83
+ */
84
+ size?: number;
85
+ /**
86
+ * Whether avatar eyes follow the user's cursor movements. Defaults to true.
87
+ */
88
+ followCursor?: boolean;
89
+ /**
90
+ * Dynamic motion animation ("jump" | "spin" | "bounce" | "wiggle" | "float").
91
+ */
92
+ motion?: AiBotMotion | null;
93
+ /**
94
+ * Facial expression emotion ("neutral" | "laugh" | "surprised" | "love" | "sad" | "sleepy" | "thinking" | "wink").
95
+ */
96
+ emotion?: AiBotEmotion;
97
+ /**
98
+ * Outline stroke color for the avatar body.
99
+ */
100
+ outlineColor?: string;
101
+ /**
102
+ * Outline stroke width in px.
103
+ */
104
+ outlineWidth?: number | string;
105
+ /**
106
+ * Background container color when nested inside a circular badge.
107
+ */
108
+ background?: string;
109
+ /**
110
+ * Additional avatar props passed directly into the `<BotziAvatar />` component.
111
+ */
112
+ props?: Partial<BotziAvatarProps>;
113
+ }
114
+ /**
115
+ * Floating launcher button customization options.
116
+ */
117
+ interface BotzkiLauncherOptions {
118
+ /**
119
+ * Background color of the floating launcher button when closed.
120
+ * Defaults to "transparent".
121
+ */
122
+ background?: string;
123
+ /**
124
+ * Custom React icon node replacing the default avatar in the closed launcher.
125
+ */
126
+ icon?: React__default.ReactNode;
127
+ /**
128
+ * Additional inline styles for the launcher button.
129
+ */
130
+ style?: React__default.CSSProperties;
131
+ /**
132
+ * Background color for the launcher button when open (showing the 'X' icon).
133
+ * Defaults to primaryColor.
134
+ */
135
+ closeBackground?: string;
136
+ /**
137
+ * Color of the 'X' icon when open. Defaults to "#ffffff".
138
+ */
139
+ closeColor?: string;
140
+ /**
141
+ * Diameter of the launcher button in px. Defaults to 56.
142
+ */
143
+ size?: number;
144
+ }
145
+ /**
146
+ * An action proposed by the autonomous AI engine requiring visitor 2-step confirmation.
147
+ */
148
+ interface ProposedBotAction {
149
+ actionId: string;
150
+ actionName: string;
151
+ displayName?: string;
152
+ description?: string;
153
+ executionType?: "ServerWebhook" | "ClientEvent" | string;
154
+ parameters?: Record<string, any>;
155
+ requiresConfirmation?: boolean;
156
+ confirmationPrompt?: string;
157
+ successMessage?: string;
158
+ token: string;
159
+ status?: "pending" | "executing" | "completed" | "failed" | "cancelled";
160
+ result?: any;
161
+ error?: string;
162
+ }
6
163
  /**
7
164
  * Message representation inside React chat interfaces.
8
165
  */
@@ -11,9 +168,126 @@ interface BotzkiMessage {
11
168
  role: "user" | "assistant" | "system";
12
169
  content: string;
13
170
  createdAt: Date;
171
+ imageBase64?: string;
172
+ imageUrl?: string;
173
+ audioUrl?: string;
174
+ audioDuration?: number;
175
+ fileUrl?: string;
176
+ fileName?: string;
177
+ fileSize?: number;
178
+ deliveryStatus?: string;
179
+ deliveryChannel?: string;
180
+ isTranscribing?: boolean;
14
181
  citations?: Citation[];
15
182
  isStreaming?: boolean;
16
183
  error?: string;
184
+ senderType?: "user" | "assistant" | "system" | "operator";
185
+ senderName?: string;
186
+ escalation?: {
187
+ type?: string;
188
+ title?: string;
189
+ description?: string;
190
+ url?: string;
191
+ buttonText?: string;
192
+ };
193
+ proposedAction?: ProposedBotAction;
194
+ modelUsed?: string;
195
+ fallbackTriggered?: boolean;
196
+ piiRedacted?: boolean;
197
+ redactionsCount?: number;
198
+ localPrivacyMode?: boolean;
199
+ }
200
+ /**
201
+ * Persisted conversation session structure for multi-session chat history.
202
+ */
203
+ interface BotzkiChatSession {
204
+ id: string;
205
+ title: string;
206
+ createdAt: string;
207
+ updatedAt: string;
208
+ messages: BotzkiMessage[];
209
+ }
210
+ /**
211
+ * Render properties passed to custom header render functions (`renderHeader`).
212
+ */
213
+ interface BotzkiHeaderProps {
214
+ title: string;
215
+ subtitle: string;
216
+ isDark: boolean;
217
+ primaryColor: string;
218
+ isOpen?: boolean;
219
+ isExpanded?: boolean;
220
+ isHistoryOpen?: boolean;
221
+ botAvatar?: React__default.ReactNode | string;
222
+ onClose?: () => void;
223
+ onClear?: () => void;
224
+ onNewChat?: () => void;
225
+ toggleHistory?: () => void;
226
+ toggleExpand?: () => void;
227
+ }
228
+ /**
229
+ * Render properties passed to custom message render functions (`renderMessage`).
230
+ */
231
+ interface BotzkiMessageRenderProps {
232
+ message: BotzkiMessage;
233
+ index: number;
234
+ isUser: boolean;
235
+ isDark: boolean;
236
+ primaryColor: string;
237
+ onCopy?: () => void;
238
+ onSpeak?: () => void;
239
+ onFeedback?: (rating: "up" | "down") => void;
240
+ }
241
+ /**
242
+ * Options for sending a message through `sendMessage`.
243
+ */
244
+ interface SendMessageOptions {
245
+ imageBase64?: string;
246
+ imageMimeType?: string;
247
+ imageUrl?: string;
248
+ audioUrl?: string;
249
+ audioDuration?: number;
250
+ fileUrl?: string;
251
+ fileName?: string;
252
+ fileSize?: number;
253
+ }
254
+ /**
255
+ * Render properties passed to custom composer render functions (`renderComposer`).
256
+ */
257
+ interface BotzkiComposerRenderProps {
258
+ input: string;
259
+ setInput: (val: string) => void;
260
+ sendMessage: (text: string, options?: SendMessageOptions) => Promise<void>;
261
+ sendVoiceMessage?: (blob: Blob, options?: {
262
+ audioDuration?: number;
263
+ }) => Promise<void>;
264
+ isLoading: boolean;
265
+ isStreaming: boolean;
266
+ primaryColor: string;
267
+ isDark: boolean;
268
+ attachImage?: () => void;
269
+ pendingImage?: {
270
+ dataUrl: string;
271
+ name: string;
272
+ } | null;
273
+ removeImage?: () => void;
274
+ isListening?: boolean;
275
+ toggleListening?: () => void;
276
+ isRecordingVoiceNote?: boolean;
277
+ startVoiceRecording?: () => void;
278
+ stopVoiceRecording?: () => void;
279
+ cancelVoiceRecording?: () => void;
280
+ voiceRecordingDuration?: number;
281
+ }
282
+ /**
283
+ * Render properties passed to custom launcher render functions (`renderLauncher`).
284
+ */
285
+ interface BotzkiLauncherRenderProps {
286
+ isOpen: boolean;
287
+ unreadCount?: number;
288
+ onClick: () => void;
289
+ primaryColor: string;
290
+ isHovered: boolean;
17
291
  }
18
292
  /**
19
293
  * Configuration options for the `useChat` hook.
@@ -45,13 +319,21 @@ interface UseChatOptions {
45
319
  initialMessages?: BotzkiMessage[];
46
320
  /**
47
321
  * Whether to persist the conversation and session in browser localStorage.
48
- * @default true
322
+ * @default false
49
323
  */
50
324
  persistSession?: boolean;
51
325
  /**
52
326
  * Custom localStorage key prefix for session and message caching.
53
327
  */
54
328
  storageKey?: string;
329
+ /**
330
+ * Custom visitor CRM metadata attributes (e.g. membership: 'premium', account_status: 'locked').
331
+ */
332
+ visitorData?: Record<string, string>;
333
+ /**
334
+ * Custom tags / segments for conversation categorization (e.g. ['vip', 'billing']).
335
+ */
336
+ tags?: string[];
55
337
  /**
56
338
  * Preferred ISO 639-1 language code (e.g. 'en', 'es', 'de').
57
339
  */
@@ -61,6 +343,25 @@ interface UseChatOptions {
61
343
  * @default true
62
344
  */
63
345
  stream?: boolean;
346
+ /**
347
+ * Whether to play the synthesized Web Audio notification chime on incoming messages when backgrounded.
348
+ * @default true
349
+ */
350
+ enableSoundAlert?: boolean;
351
+ /**
352
+ * Whether to flash the browser document title on incoming messages when backgrounded.
353
+ * @default true
354
+ */
355
+ enableTabTitleNotification?: boolean;
356
+ /**
357
+ * Whether Zero-Install Ghost Co-Browsing screen assist is enabled on the client.
358
+ * @default true
359
+ */
360
+ enableCoBrowse?: boolean;
361
+ /**
362
+ * Callback fired immediately when a user sends a message.
363
+ */
364
+ onSendMessage?: (message: BotzkiMessage) => void;
64
365
  /**
65
366
  * Callback fired whenever a full response is received from the bot.
66
367
  */
@@ -73,6 +374,50 @@ interface UseChatOptions {
73
374
  * Callback fired when an error occurs during message transmission.
74
375
  */
75
376
  onError?: (error: Error) => void;
377
+ /**
378
+ * Callback fired when the visitor requests escalation to a human support operator.
379
+ */
380
+ onEscalationRequest?: (details: {
381
+ reason?: string;
382
+ visitorName?: string;
383
+ visitorEmail?: string;
384
+ }) => void;
385
+ /**
386
+ * Callback fired when a human support operator joins / takes over the conversation.
387
+ */
388
+ onOperatorJoined?: (operator: {
389
+ id?: string;
390
+ name: string;
391
+ avatarUrl?: string;
392
+ }) => void;
393
+ /**
394
+ * Callback fired when the human support operator marks the ticket as Resolved.
395
+ */
396
+ onTicketResolved?: (ticketId: string) => void;
397
+ /**
398
+ * Callback fired when the visitor submits a 1-5 star CSAT rating after resolution.
399
+ */
400
+ onCsatSubmit?: (rating: number, feedback?: string) => void;
401
+ /**
402
+ * Callback fired when the AI proposes an autonomous action card (2-step guardrail).
403
+ */
404
+ onActionProposed?: (action: ProposedBotAction) => void;
405
+ /**
406
+ * Callback fired when the visitor confirms and executes a proposed action.
407
+ */
408
+ onActionExecuted?: (action: ProposedBotAction, result: any) => void;
409
+ /**
410
+ * Callback fired when the visitor cancels a proposed action.
411
+ */
412
+ onActionCancelled?: (action: ProposedBotAction, reason?: string) => void;
413
+ /**
414
+ * Callback fired when the visitor accepts a Ghost Co-Browsing screen assist session.
415
+ */
416
+ onCoBrowseStart?: (operatorName?: string | null) => void;
417
+ /**
418
+ * Callback fired when a Ghost Co-Browsing screen assist session ends.
419
+ */
420
+ onCoBrowseEnd?: () => void;
76
421
  }
77
422
  /**
78
423
  * Return type and state of the `useChat` hook.
@@ -102,11 +447,15 @@ interface UseChatReturn {
102
447
  imageMimeType?: string;
103
448
  }) => Promise<void>;
104
449
  /**
105
- * Programmatically sends a message with optional image attachment.
450
+ * Programmatically sends a message with optional image attachment or audio voice message.
106
451
  */
107
- sendMessage: (content: string, options?: {
108
- imageBase64?: string;
109
- imageMimeType?: string;
452
+ sendMessage: (content: string, options?: SendMessageOptions) => Promise<void>;
453
+ /**
454
+ * Programmatically sends an audio voice note recording, transcribing it and requesting an assistant response.
455
+ */
456
+ sendVoiceMessage?: (blob: Blob, options?: {
457
+ audioDuration?: number;
458
+ audioUrl?: string;
110
459
  }) => Promise<void>;
111
460
  /**
112
461
  * Appends a message to the conversation history without triggering an API call.
@@ -150,6 +499,96 @@ interface UseChatReturn {
150
499
  * Sets or updates active conversation session identifier.
151
500
  */
152
501
  setSessionId: (id: string) => void;
502
+ /**
503
+ * Whether the chat is currently in human operator mode or waiting for an agent.
504
+ */
505
+ isHumanHandoffActive?: boolean;
506
+ /**
507
+ * Whether the visitor is in queue waiting for a human agent to take over.
508
+ */
509
+ isWaitingForHuman?: boolean;
510
+ /**
511
+ * Information about the assigned human operator (if connected).
512
+ */
513
+ assignedOperator?: {
514
+ id?: string;
515
+ name: string;
516
+ avatarUrl?: string;
517
+ } | null;
518
+ /**
519
+ * Whether the human operator is currently typing.
520
+ */
521
+ isOperatorTyping?: boolean;
522
+ /**
523
+ * Requests escalation to a human support operator.
524
+ */
525
+ requestHumanHandoff?: (reason?: string, visitorName?: string, visitorEmail?: string, metadata?: {
526
+ customData?: Record<string, string>;
527
+ tags?: string[];
528
+ lastBrowsedPages?: string[];
529
+ }) => Promise<void>;
530
+ /**
531
+ * Cancels the active human escalation and returns to autonomous bot mode.
532
+ */
533
+ cancelHumanHandoff?: () => Promise<void>;
534
+ /**
535
+ * ID of a recently resolved support ticket awaiting visitor CSAT rating.
536
+ */
537
+ pendingCsatTicketId?: string | null;
538
+ /**
539
+ * Submits a 1-5 star CSAT rating and optional feedback for a resolved live chat session.
540
+ */
541
+ submitHandoffFeedback?: (rating: number, feedback?: string) => Promise<void>;
542
+ /**
543
+ * Confirms and executes an autonomous action proposal (2-step confirmation guardrail).
544
+ */
545
+ executeProposedAction?: (messageId: string, actionToken: string, confirmedParams?: Record<string, any>) => Promise<{
546
+ success: boolean;
547
+ result?: any;
548
+ error?: string;
549
+ }>;
550
+ /**
551
+ * Cancels a proposed autonomous action.
552
+ */
553
+ cancelProposedAction?: (messageId: string, reason?: string) => Promise<void>;
554
+ /**
555
+ * Ghost Co-Browsing state and controls (Zero-Install Screen Assist).
556
+ */
557
+ coBrowse?: CoBrowseState;
558
+ }
559
+ interface CoBrowsePointer {
560
+ xPercent: number;
561
+ yPercent: number;
562
+ selector?: string | null;
563
+ label?: string | null;
564
+ action: "move" | "click" | "highlight";
565
+ }
566
+ interface CoBrowseScroll {
567
+ scrollY: number;
568
+ scrollX?: number | null;
569
+ selector?: string | null;
570
+ }
571
+ interface CoBrowseSnapshot {
572
+ url: string;
573
+ pathname: string;
574
+ title: string;
575
+ viewportWidth: number;
576
+ viewportHeight: number;
577
+ scrollX: number;
578
+ scrollY: number;
579
+ htmlSnapshot: string;
580
+ timestamp: number;
581
+ }
582
+ interface CoBrowseState {
583
+ enabled: boolean;
584
+ isRequested: boolean;
585
+ isActive: boolean;
586
+ operatorName: string | null;
587
+ pointer: CoBrowsePointer | null;
588
+ highlightedSelector: string | null;
589
+ accept: () => Promise<void>;
590
+ decline: (reason?: string) => Promise<void>;
591
+ stop: (reason?: string) => Promise<void>;
153
592
  }
154
593
  /**
155
594
  * Properties for `<BotzkiProvider>`.
@@ -221,17 +660,383 @@ interface BotzkiWidgetRef {
221
660
  sendMessage: (message: string, imageBase64?: string) => Promise<void>;
222
661
  /** Clears widget chat history */
223
662
  clearMessages: () => void;
663
+ /** Starts a new fresh chat session */
664
+ newChat: () => void;
665
+ /** Expands the widget modal into maximized mode */
666
+ expand: () => void;
667
+ /** Collapses the widget modal back to compact size */
668
+ collapse: () => void;
669
+ /** Returns true if currently in expanded view */
670
+ isExpanded: () => boolean;
671
+ /** Opens the multi-session chat history drawer */
672
+ openHistory: () => void;
673
+ /** Closes the multi-session chat history drawer */
674
+ closeHistory: () => void;
675
+ /** Exports conversation as markdown or JSON */
676
+ exportChat: (format?: "markdown" | "json") => string;
224
677
  /** Dynamically updates widget theme */
225
678
  setTheme: (theme: "light" | "dark" | "auto") => void;
226
679
  /** Dynamically updates widget primary accent color */
227
680
  setPrimaryColor: (color: string) => void;
228
681
  /** Updates identified visitor details */
229
682
  setUser: (user: BotzkiUser) => void;
683
+ /** Returns the current unread message count */
684
+ getUnreadCount: () => number;
685
+ /** Clears unread message count and marks all messages as read */
686
+ markAsRead: () => void;
687
+ /** Programmatically requests human operator escalation */
688
+ requestHumanHandoff: (reason?: string, visitorName?: string, visitorEmail?: string) => Promise<void>;
689
+ /** Cancels active human escalation and returns to autonomous AI mode */
690
+ cancelHumanHandoff: () => Promise<void>;
691
+ /** Returns the current list of messages in the conversation */
692
+ getMessages: () => BotzkiMessage[];
693
+ /** Returns the active conversation session ID */
694
+ getSessionId: () => string;
695
+ /** Updates the active conversation session ID */
696
+ setSessionId: (id: string) => void;
697
+ /** Aborts active token streaming immediately */
698
+ stopStreaming: () => void;
699
+ /** Regenerates the last assistant response */
700
+ reloadLastMessage: () => Promise<void>;
230
701
  }
231
702
  /**
232
703
  * Props for `<BotzkiWidget />`.
233
704
  */
234
- interface BotzkiWidgetProps extends WidgetOptions {
705
+ interface BotzkiWidgetProps extends Omit<WidgetOptions, "botAvatar"> {
706
+ /**
707
+ * Structured avatar customization options (colors, shape, size, eyes, face, emotions).
708
+ */
709
+ avatar?: BotzkiAvatarOptions;
710
+ /**
711
+ * Structured launcher button customization options (background, icon, size, close styling).
712
+ */
713
+ launcher?: BotzkiLauncherOptions;
714
+ /**
715
+ * Custom launcher button render function to completely replace default launcher button.
716
+ */
717
+ renderLauncher?: (props: BotzkiLauncherRenderProps) => React__default.ReactNode;
718
+ /**
719
+ * Custom header render function replacing the default header.
720
+ */
721
+ renderHeader?: (props: BotzkiHeaderProps) => React__default.ReactNode;
722
+ /**
723
+ * Developer's custom React component rendered as the chat header.
724
+ */
725
+ customHeader?: React__default.ReactNode;
726
+ /**
727
+ * Custom message bubble renderer slot.
728
+ */
729
+ renderMessage?: (props: BotzkiMessageRenderProps) => React__default.ReactNode;
730
+ /**
731
+ * Custom composer input bar renderer slot.
732
+ */
733
+ renderComposer?: (props: BotzkiComposerRenderProps) => React__default.ReactNode;
734
+ /**
735
+ * Custom welcome / empty screen renderer slot.
736
+ */
737
+ renderWelcome?: () => React__default.ReactNode;
738
+ /**
739
+ * Custom visitor CRM metadata attributes passed during human escalation (e.g. membership: 'premium').
740
+ */
741
+ visitorData?: Record<string, string>;
742
+ /**
743
+ * Custom tags / segments for conversation categorization (e.g. ['vip', 'billing']).
744
+ */
745
+ tags?: string[];
746
+ /**
747
+ * Width of the floating chat window when collapsed (e.g. "380px" or 380).
748
+ * @default "380px"
749
+ */
750
+ width?: string | number;
751
+ /**
752
+ * Height of the floating chat window when collapsed (e.g. "580px" or 580).
753
+ * @default "580px"
754
+ */
755
+ height?: string | number;
756
+ /**
757
+ * Width of the floating chat window when expanded.
758
+ * @default "720px"
759
+ */
760
+ expandedWidth?: string | number;
761
+ /**
762
+ * Height of the floating chat window when expanded.
763
+ * @default "calc(100vh - 100px)"
764
+ */
765
+ expandedHeight?: string | number;
766
+ /**
767
+ * Whether to allow expanding / maximizing the widget window.
768
+ * @default true
769
+ */
770
+ allowExpand?: boolean;
771
+ /**
772
+ * Whether to display the "+ New Chat" button in the header.
773
+ * @default true
774
+ */
775
+ showNewChatButton?: boolean;
776
+ /**
777
+ * Whether to display the multi-session history button in the header.
778
+ * @default true
779
+ */
780
+ showHistoryButton?: boolean;
781
+ /**
782
+ * Whether to display the 1-click Download Transcript button in the header.
783
+ * @default true
784
+ */
785
+ showExportButton?: boolean;
786
+ /**
787
+ * Whether the floating chat window should start open on mount.
788
+ * @default false
789
+ */
790
+ defaultOpen?: boolean;
791
+ /**
792
+ * Whether the floating chat window should start in maximized / expanded view.
793
+ * @default false
794
+ */
795
+ defaultExpanded?: boolean;
796
+ /**
797
+ * Whether to play the synthesized Web Audio notification chime on incoming messages.
798
+ * @default true
799
+ */
800
+ enableSoundAlert?: boolean;
801
+ /**
802
+ * Whether to show the "Talk to Support" human escalation button in the header.
803
+ * @default true
804
+ */
805
+ enableHumanHandoff?: boolean;
806
+ /**
807
+ * Whether Zero-Install Ghost Co-Browsing screen assist is enabled on the client.
808
+ * @default true
809
+ */
810
+ enableCoBrowse?: boolean;
811
+ /**
812
+ * Whether 2-Step Autonomous Action Confirmation Cards are enabled on the client.
813
+ * @default true
814
+ */
815
+ enableActionEngine?: boolean;
816
+ /**
817
+ * Whether audio voice note recording is enabled in the composer toolbar.
818
+ * @default true
819
+ */
820
+ enableVoiceNotes?: boolean;
821
+ /**
822
+ * Callback fired when the widget expand / collapse state changes.
823
+ */
824
+ onExpandChange?: (isExpanded: boolean) => void;
825
+ /**
826
+ * Callback fired immediately when a user sends a message.
827
+ */
828
+ onSendMessage?: (message: BotzkiMessage) => void;
829
+ /**
830
+ * Callback fired whenever a full response is received from the bot.
831
+ */
832
+ onResponse?: (response: ChatResponse) => void;
833
+ /**
834
+ * Callback fired when a message turn finishes streaming.
835
+ */
836
+ onFinish?: (message: BotzkiMessage) => void;
837
+ /**
838
+ * Callback fired when the visitor requests human support escalation.
839
+ */
840
+ onEscalationRequest?: (details: {
841
+ reason?: string;
842
+ visitorName?: string;
843
+ visitorEmail?: string;
844
+ }) => void;
845
+ /**
846
+ * Callback fired when a human support operator joins the conversation.
847
+ */
848
+ onOperatorJoined?: (operator: {
849
+ id?: string;
850
+ name: string;
851
+ avatarUrl?: string;
852
+ }) => void;
853
+ /**
854
+ * Callback fired when the human operator resolves the conversation.
855
+ */
856
+ onTicketResolved?: (ticketId: string) => void;
857
+ /**
858
+ * Callback fired when the visitor submits a 1-5 star CSAT rating.
859
+ */
860
+ onCsatSubmit?: (rating: number, feedback?: string) => void;
861
+ /**
862
+ * Callback fired when the AI proposes an autonomous action card.
863
+ */
864
+ onActionProposed?: (action: ProposedBotAction) => void;
865
+ /**
866
+ * Callback fired when the visitor confirms and executes a proposed action.
867
+ */
868
+ onActionExecuted?: (action: ProposedBotAction, result: any) => void;
869
+ /**
870
+ * Callback fired when the visitor cancels a proposed action.
871
+ */
872
+ onActionCancelled?: (action: ProposedBotAction, reason?: string) => void;
873
+ /**
874
+ * Callback fired when the visitor accepts Ghost Co-Browsing screen assist.
875
+ */
876
+ onCoBrowseStart?: (operatorName?: string | null) => void;
877
+ /**
878
+ * Callback fired when Ghost Co-Browsing screen assist ends.
879
+ */
880
+ onCoBrowseEnd?: () => void;
881
+ /**
882
+ * Callback fired when the visitor clicks thumbs-up or thumbs-down on an answer.
883
+ */
884
+ onFeedbackSubmit?: (messageId: string, rating: "up" | "down") => void;
885
+ /**
886
+ * Callback fired when the visitor clicks a grounded document citation.
887
+ */
888
+ onCitationClick?: (citation: Citation) => void;
889
+ /**
890
+ * Callback fired when a proactive trigger activates.
891
+ */
892
+ onTriggerActivated?: (trigger: {
893
+ id?: string;
894
+ name?: string;
895
+ triggerType?: string;
896
+ headline?: string;
897
+ message?: string;
898
+ }) => void;
899
+ /**
900
+ * Proactive teaser message displayed in a floating bubble next to launcher before opening.
901
+ */
902
+ proactiveMessage?: string;
903
+ /**
904
+ * Milliseconds delay before displaying proactive message teaser. Defaults to 3000ms.
905
+ */
906
+ proactiveDelay?: number;
907
+ /**
908
+ * Whether to evaluate and execute backend-defined proactive triggers (e.g. exit-intent, time on page, scroll).
909
+ * Defaults to true.
910
+ */
911
+ enableTriggers?: boolean;
912
+ /**
913
+ * Unread notification count badge to display on top of launcher button.
914
+ * If omitted, unread messages are automatically tracked when widget is closed.
915
+ */
916
+ unreadCount?: number;
917
+ /**
918
+ * Callback fired whenever the unread message count changes.
919
+ */
920
+ onUnreadCountChange?: (count: number) => void;
921
+ /**
922
+ * Whether to display unread message count alert in browser document title when tab is backgrounded.
923
+ * @default true
924
+ */
925
+ enableTabTitleNotification?: boolean;
926
+ /**
927
+ * Whether global keyboard shortcuts are active (Cmd+K / Ctrl+K to toggle, Escape to close).
928
+ * @default true
929
+ */
930
+ enableHotkey?: boolean;
931
+ /**
932
+ * Callback fired when a new chat session is started.
933
+ */
934
+ onNewChat?: () => void;
935
+ /**
936
+ * Custom avatar for the user shown next to user chat messages.
937
+ * Can be an image URL string or a React node. Defaults to a clean user icon.
938
+ */
939
+ userAvatar?: React__default.ReactNode | string;
940
+ /**
941
+ * Whether to display avatars beside chat messages. Defaults to true.
942
+ */
943
+ showAvatars?: boolean;
944
+ /**
945
+ * Whether to enable image/file upload attachments in the chat bar. Defaults to true.
946
+ */
947
+ enableImageUpload?: boolean;
948
+ /**
949
+ * Whether to enable microphone voice input (speech-to-text). Defaults to true.
950
+ */
951
+ enableVoiceInput?: boolean;
952
+ /**
953
+ * Whether to enable text-to-speech read aloud on assistant responses. Defaults to true.
954
+ */
955
+ enableVoiceOutput?: boolean;
956
+ /**
957
+ * Whether to show thumbs-up / thumbs-down helpful feedback buttons on assistant messages. Defaults to true.
958
+ */
959
+ showFeedback?: boolean;
960
+ /**
961
+ * Whether to show grounded document citation badges beneath assistant answers. Defaults to true.
962
+ */
963
+ showCitations?: boolean;
964
+ /**
965
+ * Whether to display "Powered by Botzki" in the footer. Defaults to true.
966
+ */
967
+ showBranding?: boolean;
968
+ /**
969
+ * Whether to display a copy button on assistant messages. Defaults to true.
970
+ */
971
+ showCopyButton?: boolean;
972
+ /**
973
+ * Custom React icon to show in the closed floating launcher bubble.
974
+ * If omitted, defaults to the animated Botzi mascot avatar.
975
+ */
976
+ launcherIcon?: React__default.ReactNode;
977
+ /**
978
+ * Background color for the launcher button when closed.
979
+ * Defaults to "transparent", letting the Botzi avatar float naturally with no colored circle behind it.
980
+ */
981
+ launcherBackground?: string;
982
+ /**
983
+ * Additional inline styles for the floating launcher button.
984
+ */
985
+ launcherStyle?: React__default.CSSProperties;
986
+ /**
987
+ * Background color for the launcher button when the chat window is open (showing the 'X' close icon).
988
+ * Defaults to primaryColor.
989
+ */
990
+ closeButtonBackground?: string;
991
+ /**
992
+ * Color for the 'X' close icon. Defaults to "#ffffff".
993
+ */
994
+ closeButtonColor?: string;
995
+ /**
996
+ * Custom gradient colors for the Botzi avatar body (e.g. `["#66a6ff", "#0059d4"]`).
997
+ */
998
+ avatarColors?: readonly [string, string];
999
+ /**
1000
+ * Color for both eyes and mouth of the Botzi avatar. Defaults to "#ffffff".
1001
+ */
1002
+ avatarFaceColor?: string;
1003
+ /**
1004
+ * Custom color for the eyes. Overrides avatarFaceColor.
1005
+ */
1006
+ avatarEyeColor?: string;
1007
+ /**
1008
+ * Custom color for the mouth. Overrides avatarFaceColor.
1009
+ */
1010
+ avatarMouthColor?: string;
1011
+ /**
1012
+ * Body shape of the avatar ("pebble" | "circle" | "squircle" | "flower" | "blob").
1013
+ * Defaults to "pebble".
1014
+ */
1015
+ avatarShape?: AiBotShape;
1016
+ /**
1017
+ * Size of the avatar inside the launcher button in px. Defaults to 54.
1018
+ */
1019
+ avatarSize?: number;
1020
+ /**
1021
+ * Whether avatar eyes follow mouse cursor. Defaults to true.
1022
+ */
1023
+ avatarFollowCursor?: boolean;
1024
+ /**
1025
+ * Complete avatar props object passed directly into `<BotziAvatar />`.
1026
+ */
1027
+ avatarProps?: Partial<BotziAvatarProps>;
1028
+ /**
1029
+ * Whether the Visual Empathy Engine is enabled.
1030
+ * When true, the avatar's procedural facial expressions and micro-motions react
1031
+ * dynamically to visitor sentiment (frustration, delight, curiosity, thinking).
1032
+ * Defaults to true.
1033
+ */
1034
+ enableEmpathyEngine?: boolean;
1035
+ /**
1036
+ * Custom avatar to display in the chat window header (React node or image URL).
1037
+ * Defaults to the Botzi mascot avatar.
1038
+ */
1039
+ botAvatar?: React__default.ReactNode | string;
235
1040
  /**
236
1041
  * Optional bot ID. If omitted, uses value from `<BotzkiProvider>`.
237
1042
  */
@@ -256,6 +1061,62 @@ interface BotzkiWidgetProps extends WidgetOptions {
256
1061
  * Callback fired when the widget chat window closes.
257
1062
  */
258
1063
  onClose?: () => void;
1064
+ /**
1065
+ * Custom placeholder text for the message input textarea. Defaults to "Ask a question...".
1066
+ */
1067
+ placeholder?: string;
1068
+ /**
1069
+ * Custom inline styles for the message input textarea.
1070
+ */
1071
+ inputStyle?: React__default.CSSProperties;
1072
+ /**
1073
+ * Custom inline styles for the bottom composer input bar.
1074
+ */
1075
+ composerStyle?: React__default.CSSProperties;
1076
+ /**
1077
+ * Custom background color for user message bubbles. Defaults to primaryColor.
1078
+ */
1079
+ userBubbleColor?: string;
1080
+ /**
1081
+ * Custom text color for user message bubbles. Defaults to "#ffffff".
1082
+ */
1083
+ userTextColor?: string;
1084
+ /**
1085
+ * Custom background color for assistant message bubbles.
1086
+ */
1087
+ assistantBubbleColor?: string;
1088
+ /**
1089
+ * Custom text color for assistant message bubbles.
1090
+ */
1091
+ assistantTextColor?: string;
1092
+ /**
1093
+ * Custom font family for the chat widget.
1094
+ */
1095
+ fontFamily?: string;
1096
+ /**
1097
+ * Custom base font size (e.g. "14px" or 14).
1098
+ */
1099
+ fontSize?: string | number;
1100
+ /**
1101
+ * Custom inline styles for the chat header.
1102
+ */
1103
+ headerStyle?: React__default.CSSProperties;
1104
+ /**
1105
+ * Custom inline styles for the messages scroll container.
1106
+ */
1107
+ messagesContainerStyle?: React__default.CSSProperties;
1108
+ /**
1109
+ * Custom inline styles for the embedded chat container inside the widget.
1110
+ */
1111
+ chatStyle?: React__default.CSSProperties;
1112
+ /**
1113
+ * Custom inline styles for the unread message count badge.
1114
+ */
1115
+ badgeStyle?: React__default.CSSProperties;
1116
+ /**
1117
+ * Custom inline styles for the send/stop action button.
1118
+ */
1119
+ sendButtonStyle?: React__default.CSSProperties;
259
1120
  }
260
1121
 
261
1122
  /**
@@ -293,6 +1154,52 @@ interface BotzkiChatProps extends UseChatOptions {
293
1154
  * Title shown in the chat window header. Defaults to bot name or "AI Assistant".
294
1155
  */
295
1156
  title?: string;
1157
+ /**
1158
+ * Structured avatar customization options object.
1159
+ */
1160
+ avatar?: BotzkiAvatarOptions;
1161
+ /**
1162
+ * Custom avatar to display for the bot (React node or image URL).
1163
+ * Overrides the default animated Botzi character.
1164
+ */
1165
+ botAvatar?: React__default.ReactNode | string;
1166
+ /**
1167
+ * Custom avatar to display for the user (React node or image URL).
1168
+ * Defaults to a sleek user silhouette icon.
1169
+ */
1170
+ userAvatar?: React__default.ReactNode | string;
1171
+ /**
1172
+ * Whether to display avatars beside chat bubbles. Defaults to true.
1173
+ */
1174
+ showAvatars?: boolean;
1175
+ /**
1176
+ * Whether to enable image/file upload attachments in the chat bar. Defaults to true.
1177
+ */
1178
+ enableImageUpload?: boolean;
1179
+ /**
1180
+ * Whether to enable microphone speech-to-text dictation. Defaults to true.
1181
+ */
1182
+ enableVoiceInput?: boolean;
1183
+ /**
1184
+ * Whether to enable text-to-speech read aloud on assistant responses. Defaults to true.
1185
+ */
1186
+ enableVoiceOutput?: boolean;
1187
+ /**
1188
+ * Whether to show thumbs-up / thumbs-down helpful feedback buttons. Defaults to true.
1189
+ */
1190
+ showFeedback?: boolean;
1191
+ /**
1192
+ * Whether to show document citation pills beneath assistant answers. Defaults to true.
1193
+ */
1194
+ showCitations?: boolean;
1195
+ /**
1196
+ * Whether to display "Powered by Botzki" in the footer. Defaults to true.
1197
+ */
1198
+ showBranding?: boolean;
1199
+ /**
1200
+ * Whether to display a copy button on assistant messages. Defaults to true.
1201
+ */
1202
+ showCopyButton?: boolean;
296
1203
  /**
297
1204
  * Subtitle shown in the chat window header. Defaults to "Online".
298
1205
  */
@@ -337,17 +1244,221 @@ interface BotzkiChatProps extends UseChatOptions {
337
1244
  * Whether to display the clear messages button. Defaults to true.
338
1245
  */
339
1246
  showClearButton?: boolean;
1247
+ /**
1248
+ * Whether to show the "+ New Chat" button in the header. Defaults to true.
1249
+ */
1250
+ showNewChatButton?: boolean;
1251
+ /**
1252
+ * Whether to show the chat history drawer button in the header. Defaults to true.
1253
+ */
1254
+ showHistoryButton?: boolean;
1255
+ /**
1256
+ * Whether to display the maximize/minimize expand button in the header. Defaults to false.
1257
+ */
1258
+ allowExpand?: boolean;
1259
+ /**
1260
+ * Controlled state of whether widget is expanded.
1261
+ */
1262
+ isExpanded?: boolean;
1263
+ /**
1264
+ * Callback fired when the user toggles expand / minimize.
1265
+ */
1266
+ onToggleExpand?: () => void;
1267
+ /**
1268
+ * Callback fired when a new chat session is started.
1269
+ */
1270
+ onNewChat?: () => void;
1271
+ /**
1272
+ * Developer's custom header render function.
1273
+ */
1274
+ renderHeader?: (props: BotzkiHeaderProps) => React__default.ReactNode;
1275
+ /**
1276
+ * Developer's custom React component rendered as the chat header.
1277
+ */
1278
+ customHeader?: React__default.ReactNode;
1279
+ /**
1280
+ * Developer's custom message bubble renderer slot.
1281
+ */
1282
+ renderMessage?: (props: BotzkiMessageRenderProps) => React__default.ReactNode;
1283
+ /**
1284
+ * Developer's custom composer input bar renderer slot.
1285
+ */
1286
+ renderComposer?: (props: BotzkiComposerRenderProps) => React__default.ReactNode;
1287
+ /**
1288
+ * Developer's custom welcome / empty screen renderer slot.
1289
+ */
1290
+ renderWelcome?: () => React__default.ReactNode;
1291
+ /**
1292
+ * Number of unread messages to highlight in the message list with a 'New Messages' separator.
1293
+ */
1294
+ unreadCount?: number;
1295
+ /**
1296
+ * Index of the first unread message where the 'New Messages' divider is rendered.
1297
+ */
1298
+ unreadFromIndex?: number;
1299
+ /**
1300
+ * Custom inline style overrides for the message input textarea.
1301
+ */
1302
+ inputStyle?: React__default.CSSProperties;
1303
+ /**
1304
+ * Custom inline style overrides for the bottom composer container bar.
1305
+ */
1306
+ composerStyle?: React__default.CSSProperties;
1307
+ /**
1308
+ * Custom background color for user message bubbles. Defaults to primaryColor.
1309
+ */
1310
+ userBubbleColor?: string;
1311
+ /**
1312
+ * Custom text color for user message bubbles. Defaults to "#ffffff".
1313
+ */
1314
+ userTextColor?: string;
1315
+ /**
1316
+ * Custom background color for assistant message bubbles.
1317
+ */
1318
+ assistantBubbleColor?: string;
1319
+ /**
1320
+ * Custom text color for assistant message bubbles.
1321
+ */
1322
+ assistantTextColor?: string;
1323
+ /**
1324
+ * Custom font family for the chat widget.
1325
+ */
1326
+ fontFamily?: string;
1327
+ /**
1328
+ * Custom base font size (e.g. "14px" or 14).
1329
+ */
1330
+ fontSize?: string | number;
1331
+ /**
1332
+ * Custom inline styles for the chat header.
1333
+ */
1334
+ headerStyle?: React__default.CSSProperties;
1335
+ /**
1336
+ * Custom inline styles for the messages scroll container.
1337
+ */
1338
+ messagesContainerStyle?: React__default.CSSProperties;
1339
+ /**
1340
+ * Custom inline styles for the send/stop action button.
1341
+ */
1342
+ sendButtonStyle?: React__default.CSSProperties;
340
1343
  /**
341
1344
  * Optional external chat instance from useChat().
342
1345
  */
343
1346
  chat?: ReturnType<typeof useChat>;
1347
+ avatarColors?: readonly [string, string];
1348
+ avatarFaceColor?: string;
1349
+ avatarEyeColor?: string;
1350
+ avatarMouthColor?: string;
1351
+ avatarShape?: AiBotShape;
1352
+ avatarSize?: number;
1353
+ headerAvatarBackground?: string;
1354
+ avatarFollowCursor?: boolean;
1355
+ avatarProps?: Partial<BotziAvatarProps>;
1356
+ enableEmpathyEngine?: boolean;
1357
+ /**
1358
+ * Whether to display the 1-click Download Transcript button in the header. Defaults to true.
1359
+ */
1360
+ showExportButton?: boolean;
1361
+ /**
1362
+ * Whether to show the "Talk to Support" human escalation button in the header. Defaults to true.
1363
+ */
1364
+ enableHumanHandoff?: boolean;
1365
+ /**
1366
+ * Whether 2-Step Autonomous Action Confirmation Cards are enabled. Defaults to true.
1367
+ */
1368
+ enableActionEngine?: boolean;
1369
+ /**
1370
+ * Whether audio voice note recording is enabled in the composer toolbar. Defaults to true.
1371
+ */
1372
+ enableVoiceNotes?: boolean;
1373
+ /**
1374
+ * Optional controlled state for the multi-session history drawer.
1375
+ */
1376
+ isHistoryOpen?: boolean;
1377
+ /**
1378
+ * Callback fired when the history drawer open state changes.
1379
+ */
1380
+ onHistoryOpenChange?: (open: boolean) => void;
1381
+ /**
1382
+ * Callback fired when the visitor clicks thumbs-up or thumbs-down on an answer.
1383
+ */
1384
+ onFeedbackSubmit?: (messageId: string, rating: "up" | "down") => void;
1385
+ /**
1386
+ * Callback fired when the visitor clicks a grounded document citation.
1387
+ */
1388
+ onCitationClick?: (citation: any) => void;
344
1389
  }
345
1390
  /**
346
1391
  * Embedded, full-featured AI chat container for dashboards, sidebars, and dedicated support pages.
347
1392
  * Fully responsive and self-contained with no external CSS dependencies.
348
1393
  */
349
- declare function BotzkiChat({ title, subtitle, greeting, starterQuestions, theme, primaryColor, className, style, placeholder, onClose, showCloseButton, showClearButton, chat: externalChat, ...chatOptions }: BotzkiChatProps): React__default.JSX.Element;
1394
+ declare function BotzkiChat({ title, avatar, botAvatar, userAvatar, showAvatars, enableImageUpload, enableVoiceInput, enableVoiceOutput, enableVoiceNotes, enableHumanHandoff, enableActionEngine, showFeedback, showCitations, showBranding, showCopyButton, showExportButton, avatarColors, avatarFaceColor, avatarEyeColor, avatarMouthColor, avatarShape, avatarSize, headerAvatarBackground, avatarFollowCursor, avatarProps, enableEmpathyEngine, subtitle, greeting, starterQuestions, theme, primaryColor, className, style, placeholder, onClose, showCloseButton, showClearButton, showNewChatButton, showHistoryButton, allowExpand, isExpanded, onToggleExpand, onNewChat, isHistoryOpen: controlledHistoryOpen, onHistoryOpenChange, onFeedbackSubmit, onCitationClick, renderHeader, customHeader, renderMessage, renderComposer, renderWelcome, unreadCount, unreadFromIndex, inputStyle, composerStyle, userBubbleColor, userTextColor, assistantBubbleColor, assistantTextColor, fontFamily, fontSize, headerStyle, messagesContainerStyle, sendButtonStyle, chat: externalChat, ...chatOptions }: BotzkiChatProps): React__default.JSX.Element;
1395
+
1396
+ interface BotzkiMarkdownProps {
1397
+ content: string;
1398
+ isUser?: boolean;
1399
+ primaryColor?: string;
1400
+ isDark?: boolean;
1401
+ }
1402
+ /**
1403
+ * High-performance, zero-dependency Markdown renderer designed specifically for AI chat streams.
1404
+ * Handles bold, italic, code blocks with copy, inline code, headings, lists, links, and blockquotes.
1405
+ */
1406
+ declare function BotzkiMarkdown({ content, isUser, primaryColor, isDark, }: BotzkiMarkdownProps): React__default.JSX.Element | null;
350
1407
 
1408
+ interface BotzkiAudioPlayerProps {
1409
+ /**
1410
+ * URL of the audio file or blob object URL to play.
1411
+ */
1412
+ audioUrl: string;
1413
+ /**
1414
+ * Pre-calculated audio duration in seconds.
1415
+ */
1416
+ duration?: number;
1417
+ /**
1418
+ * Whether the player is inside a user chat bubble.
1419
+ * Controls waveform and button contrast colors.
1420
+ */
1421
+ isUser?: boolean;
1422
+ /**
1423
+ * Brand primary accent color.
1424
+ */
1425
+ primaryColor?: string;
1426
+ /**
1427
+ * Whether dark mode is active.
1428
+ */
1429
+ isDark?: boolean;
1430
+ /**
1431
+ * Custom CSS class name.
1432
+ */
1433
+ className?: string;
1434
+ /**
1435
+ * Custom inline styles.
1436
+ */
1437
+ style?: React__default.CSSProperties;
1438
+ }
1439
+ /**
1440
+ * Modern, interactive Crisp/WhatsApp-style voice note player with waveform visualization,
1441
+ * seek scrubber, playback speed multiplier, and time tracking.
1442
+ */
1443
+ declare function BotzkiAudioPlayer({ audioUrl, duration: initialDuration, isUser, primaryColor, isDark, className, style, }: BotzkiAudioPlayerProps): React__default.JSX.Element;
1444
+
1445
+ interface CoBrowseLaserPointerProps {
1446
+ coBrowse: CoBrowseState;
1447
+ }
1448
+ declare const CoBrowseLaserPointer: React__default.FC<CoBrowseLaserPointerProps>;
1449
+
1450
+ interface ProactiveTriggerInfo {
1451
+ id: string;
1452
+ name: string;
1453
+ urlPattern?: string;
1454
+ triggerType: "TimeOnPage" | "ScrollPercentage" | "ExitIntent";
1455
+ delaySeconds?: number;
1456
+ scrollPercentage?: number;
1457
+ headline: string;
1458
+ message: string;
1459
+ suggestedPrompts?: string[];
1460
+ priority?: number;
1461
+ }
351
1462
  interface BotInfoData {
352
1463
  id?: string;
353
1464
  name?: string;
@@ -358,6 +1469,17 @@ interface BotInfoData {
358
1469
  greeting?: string;
359
1470
  starterQuestions?: string[];
360
1471
  capabilities?: string[];
1472
+ humanHandoffEnabled?: boolean;
1473
+ handoffType?: string;
1474
+ handoffUrl?: string;
1475
+ handoffButtonText?: string;
1476
+ liveChatEnabled?: boolean;
1477
+ liveChatRequireEmail?: boolean;
1478
+ liveChatOfflineMessage?: string;
1479
+ liveChatWelcomeMessage?: string;
1480
+ liveChatIsOnline?: boolean;
1481
+ liveChatOutOfHoursBehavior?: string;
1482
+ activeTriggers?: ProactiveTriggerInfo[];
361
1483
  [key: string]: unknown;
362
1484
  }
363
1485
  interface UseBotInfoReturn {
@@ -423,4 +1545,109 @@ interface UseVoiceTranscriptionReturn {
423
1545
  */
424
1546
  declare function useVoiceTranscription(): UseVoiceTranscriptionReturn;
425
1547
 
426
- export { type BotInfoData, BotzkiChat, type BotzkiChatProps, type BotzkiContextValue, type BotzkiMessage, BotzkiProvider, type BotzkiProviderProps, BotzkiWidget, type BotzkiWidgetProps, type BotzkiWidgetRef, type FeedbackPayload, type LeadCapturePayload, type UseBotInfoReturn, type UseChatOptions, type UseChatReturn, type UseFeedbackReturn, type UseLeadCaptureReturn, type UseVoiceTranscriptionReturn, useBotInfo, useBotzki, useChat, useFeedback, useLeadCapture, useOptionalBotzki, useVoiceTranscription };
1548
+ type VisitorSentiment = "frustrated" | "delighted" | "happy" | "curious" | "thinking" | "neutral";
1549
+ interface EmpathyEngineOptions {
1550
+ /** The message history to observe for visitor emotion cues. */
1551
+ messages?: BotzkiMessage[];
1552
+ /** Whether the AI assistant is currently thinking / streaming a response. */
1553
+ isLoading?: boolean;
1554
+ /** Whether streaming tokens are actively being appended. */
1555
+ isStreaming?: boolean;
1556
+ /** Whether visitor is waiting for a human agent handoff. */
1557
+ isWaitingForHuman?: boolean;
1558
+ /** Whether a human support operator is currently active in the chat. */
1559
+ isHumanHandoffActive?: boolean;
1560
+ /** Recent CSAT or message feedback rating ("up" | "down"). */
1561
+ feedbackRating?: "up" | "down" | null;
1562
+ /** Force an emotion override (disables auto-empathy until cleared). */
1563
+ manualEmotion?: AiBotEmotion;
1564
+ /** Force a motion override. */
1565
+ manualMotion?: AiBotMotion;
1566
+ /** Whether the empathy engine is active. Defaults to true. */
1567
+ enabled?: boolean;
1568
+ /** Cooldown in ms before returning to neutral after an emotional reaction. Defaults to 5000ms. */
1569
+ reactionCooldownMs?: number;
1570
+ }
1571
+ interface EmpathyEngineReturn {
1572
+ /** The active procedural emotion for the reactive avatar. */
1573
+ emotion: AiBotEmotion;
1574
+ /** The active procedural micro-motion for the reactive avatar. */
1575
+ motion: AiBotMotion | undefined;
1576
+ /** Numeric motion trigger key to re-trigger one-shot animations. */
1577
+ motionKey: number;
1578
+ /** Detected visitor sentiment profile. */
1579
+ sentiment: VisitorSentiment;
1580
+ /** Sentiment confidence score between -1.0 (deeply frustrated) to +1.0 (ecstatic). */
1581
+ sentimentScore: number;
1582
+ /** Human-readable explanation of why the avatar assumed this emotional state. */
1583
+ empathyReason: string;
1584
+ /** Trigger a manual celebration pulse (e.g. on successful checkout or issue resolved). */
1585
+ triggerCelebration: () => void;
1586
+ /** Trigger a sympathetic listening pulse (e.g. on operator escalation). */
1587
+ triggerSympathy: () => void;
1588
+ /** Reset avatar back to calm neutral baseline. */
1589
+ resetToNeutral: () => void;
1590
+ }
1591
+ /**
1592
+ * Rapid client-side lexical sentiment analyzer.
1593
+ * Returns sentiment class, polarity score (-1 to 1), and primary trigger word.
1594
+ */
1595
+ declare function analyzeVisitorSentiment(text: string): {
1596
+ sentiment: VisitorSentiment;
1597
+ score: number;
1598
+ triggerWord?: string;
1599
+ };
1600
+ /**
1601
+ * Official Botzki "Visual Empathy Engine" Hook.
1602
+ * Synchronizes procedural SVG/Canvas avatar expressions, eye contact, and physics
1603
+ * with real-time visitor sentiment, conversation milestones, and support states.
1604
+ */
1605
+ declare function useEmpathyEngine({ messages, isLoading, isStreaming, isWaitingForHuman, isHumanHandoffActive, feedbackRating, manualEmotion, manualMotion, enabled, reactionCooldownMs, }?: EmpathyEngineOptions): EmpathyEngineReturn;
1606
+
1607
+ interface UseCoBrowseOptions {
1608
+ botId: string;
1609
+ baseUrl?: string;
1610
+ sessionId: string;
1611
+ isHumanHandoffActive?: boolean;
1612
+ }
1613
+ declare function useCoBrowse({ botId, baseUrl, sessionId, isHumanHandoffActive, }: UseCoBrowseOptions): CoBrowseState;
1614
+
1615
+ /**
1616
+ * Ghost Co-Browsing DOM Snapshot Serializer
1617
+ * Zero-install, client-side, ephemeral DOM serialization with strict PII masking.
1618
+ */
1619
+
1620
+ interface SnapshotOptions {
1621
+ maskInputs?: boolean;
1622
+ maxHtmlBytes?: number;
1623
+ }
1624
+ /**
1625
+ * Creates a sanitized, PII-masked DOM snapshot of the current document.
1626
+ */
1627
+ declare function captureDomSnapshot(options?: SnapshotOptions): CoBrowseSnapshot;
1628
+
1629
+ /**
1630
+ * Official Web Audio API chime & tab-title alert utility for @botzki/react.
1631
+ * Provides soft synthesized chimes and tab title flashing when incoming
1632
+ * messages arrive while the visitor is viewing another browser tab.
1633
+ */
1634
+ /**
1635
+ * Synthesizes a soft, pleasant notification chime using the native Web Audio API.
1636
+ * Two smooth sine waves (D5 587.33Hz -> A5 880Hz) with gentle exponential decay.
1637
+ * Zero external audio files, zero network bandwidth, zero CORS issues.
1638
+ */
1639
+ declare function playVisitorNotificationChime(): void;
1640
+ /**
1641
+ * Flashes the browser tab title when an incoming message arrives while the tab is hidden.
1642
+ * Restores original document title as soon as the visitor focuses or returns to the page.
1643
+ */
1644
+ declare function startTabTitleAlert(alertTitle?: string): void;
1645
+ /**
1646
+ * Triggers audio chime and tab-title alert if document is currently hidden.
1647
+ */
1648
+ declare function notifyVisitorIncomingMessage(alertTitle?: string, options?: {
1649
+ enableSound?: boolean;
1650
+ enableTabTitle?: boolean;
1651
+ }): void;
1652
+
1653
+ export { type AiBotActivity, AiBotAvatar, type AiBotEmotion, type AiBotMotion, type AiBotShape, type BotInfoData, BotziAvatar, type BotziAvatarProps, BotzkiAudioPlayer, type BotzkiAudioPlayerProps, type BotzkiAvatarOptions, BotzkiChat, type BotzkiChatProps, type BotzkiChatSession, type BotzkiComposerRenderProps, type BotzkiContextValue, type BotzkiHeaderProps, type BotzkiLauncherOptions, type BotzkiLauncherRenderProps, BotzkiMarkdown, type BotzkiMarkdownProps, type BotzkiMessage, type BotzkiMessageRenderProps, BotzkiProvider, type BotzkiProviderProps, BotzkiWidget, type BotzkiWidgetProps, type BotzkiWidgetRef, CoBrowseLaserPointer, type CoBrowseLaserPointerProps, type CoBrowsePointer, type CoBrowseScroll, type CoBrowseSnapshot, type CoBrowseState, type EmpathyEngineOptions, type EmpathyEngineReturn, type FeedbackPayload, type LeadCapturePayload, type ProactiveTriggerInfo, type ProposedBotAction, type SendMessageOptions, type SnapshotOptions, type UseBotInfoReturn, type UseChatOptions, type UseChatReturn, type UseCoBrowseOptions, type UseFeedbackReturn, type UseLeadCaptureReturn, type UseVoiceTranscriptionReturn, type VisitorSentiment, analyzeVisitorSentiment, captureDomSnapshot, notifyVisitorIncomingMessage, playVisitorNotificationChime, startTabTitleAlert, useBotInfo, useBotzki, useChat, useCoBrowse, useEmpathyEngine, useFeedback, useLeadCapture, useOptionalBotzki, useVoiceTranscription };