@botonic/webchat-react 2.28.0 → 2.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/index.d.ts +6 -3
  3. package/index.js +61 -57
  4. package/lib/components/message/index.d.ts +1 -0
  5. package/lib/components/message/message/message.d.ts +2 -0
  6. package/lib/components/message/message/use-message.d.ts +2 -0
  7. package/lib/components/message/rating-message/icons/face-angry.d.ts +2 -0
  8. package/lib/components/message/rating-message/icons/face-frown.d.ts +2 -0
  9. package/lib/components/message/rating-message/icons/face-grin-beam.d.ts +2 -0
  10. package/lib/components/message/rating-message/icons/face-meh.d.ts +2 -0
  11. package/lib/components/message/rating-message/icons/face-smile.d.ts +2 -0
  12. package/lib/components/message/rating-message/icons/index.d.ts +7 -0
  13. package/lib/components/message/rating-message/icons/rating-icon-types.d.ts +5 -0
  14. package/lib/components/message/rating-message/icons/star.d.ts +2 -0
  15. package/lib/components/message/rating-message/index.d.ts +1 -0
  16. package/lib/components/message/rating-message/rating-message.d.ts +4 -0
  17. package/lib/components/message/rating-message/use-rating-message.d.ts +34 -0
  18. package/lib/components/message-machine-renderer/message-machine-renderer.d.ts +3 -2
  19. package/lib/components/preview-events/events/ai-agent/ai-agent.d.ts +3 -0
  20. package/lib/components/preview-events/events/ai-agent/executed-tools.d.ts +7 -0
  21. package/lib/components/preview-events/events/ai-agent/index.d.ts +1 -0
  22. package/lib/components/preview-events/events/ai-agent/parse-tools.d.ts +9 -0
  23. package/lib/components/preview-events/events/ai-agent-router/ai-agent-router.d.ts +3 -0
  24. package/lib/components/preview-events/events/ai-agent-router/index.d.ts +1 -0
  25. package/lib/components/preview-events/events/bot-action.d.ts +3 -0
  26. package/lib/components/preview-events/events/components/guardrail-item.d.ts +14 -0
  27. package/lib/components/preview-events/events/components/index.d.ts +2 -0
  28. package/lib/components/preview-events/events/components/sources-section.d.ts +11 -0
  29. package/lib/components/preview-events/events/conditional-channel.d.ts +3 -0
  30. package/lib/components/preview-events/events/conditional-country.d.ts +3 -0
  31. package/lib/components/preview-events/events/conditional-custom.d.ts +3 -0
  32. package/lib/components/preview-events/events/conditional-queue-status.d.ts +3 -0
  33. package/lib/components/preview-events/events/constants.d.ts +32 -0
  34. package/lib/components/preview-events/events/fallback.d.ts +3 -0
  35. package/lib/components/preview-events/events/handoff-success.d.ts +3 -0
  36. package/lib/components/preview-events/events/index.d.ts +15 -0
  37. package/lib/components/preview-events/events/keyword.d.ts +3 -0
  38. package/lib/components/preview-events/events/knowledge-base.d.ts +3 -0
  39. package/lib/components/preview-events/events/redirect-flow.d.ts +3 -0
  40. package/lib/components/preview-events/events/smart-intent.d.ts +3 -0
  41. package/lib/components/preview-events/events/types.d.ts +112 -0
  42. package/lib/components/preview-events/events/webview-action-triggered.d.ts +3 -0
  43. package/lib/components/preview-events/hooks/use-knowledge-base-info.d.ts +19 -0
  44. package/lib/components/preview-events/hooks/use-last-label-position.d.ts +9 -0
  45. package/lib/components/preview-events/icons/ai-router-icon.d.ts +1 -0
  46. package/lib/components/preview-events/icons/ai-specialist-icon.d.ts +1 -0
  47. package/lib/components/preview-events/icons/arrow-progress-icon.d.ts +1 -0
  48. package/lib/components/preview-events/icons/brain-icon.d.ts +1 -0
  49. package/lib/components/preview-events/icons/caret-down-icon.d.ts +1 -0
  50. package/lib/components/preview-events/icons/caret-up-icon.d.ts +1 -0
  51. package/lib/components/preview-events/icons/circle-check-icon.d.ts +1 -0
  52. package/lib/components/preview-events/icons/code-icon.d.ts +1 -0
  53. package/lib/components/preview-events/icons/file-pdf-icon.d.ts +1 -0
  54. package/lib/components/preview-events/icons/file-word-icon.d.ts +1 -0
  55. package/lib/components/preview-events/icons/hand-icon.d.ts +1 -0
  56. package/lib/components/preview-events/icons/head-set-icon.d.ts +1 -0
  57. package/lib/components/preview-events/icons/index.d.ts +19 -0
  58. package/lib/components/preview-events/icons/life-ring-icon.d.ts +1 -0
  59. package/lib/components/preview-events/icons/link-icon.d.ts +1 -0
  60. package/lib/components/preview-events/icons/quote-right-icon.d.ts +1 -0
  61. package/lib/components/preview-events/icons/screwdriver-wrench-icon.d.ts +1 -0
  62. package/lib/components/preview-events/icons/split-icon.d.ts +1 -0
  63. package/lib/components/preview-events/icons/wand-icon.d.ts +1 -0
  64. package/lib/components/preview-events/icons/window-restore-icon.d.ts +1 -0
  65. package/lib/components/preview-events/index.d.ts +3 -0
  66. package/lib/components/preview-events/preview-event-message/index.d.ts +1 -0
  67. package/lib/components/preview-events/preview-event-message/preview-event-message.d.ts +20 -0
  68. package/lib/components/preview-events/preview-event-message/use-preview-event-message.d.ts +17 -0
  69. package/lib/components/preview-events/preview-events-types.d.ts +12 -0
  70. package/lib/components/shared/index.d.ts +4 -2
  71. package/lib/components/shared/markdown-text/index.d.ts +2 -0
  72. package/lib/components/shared/markdown-text/markdown-text.d.ts +6 -0
  73. package/lib/components/shared/quick-reply/index.d.ts +2 -0
  74. package/lib/components/shared/{button-component/button-component.d.ts → quick-reply/quick-reply.d.ts} +4 -4
  75. package/lib/components/webchat-app/webchat-app.d.ts +1 -4
  76. package/lib/components/webchat-messages/use-webchat-messages.d.ts +6 -0
  77. package/lib/components/webchat-overlay/base/index.d.ts +0 -1
  78. package/lib/components/webchat-overlay/base/overlay/use-overlay.d.ts +0 -4
  79. package/lib/components/webchat-overlay/base/overlay-context.d.ts +0 -2
  80. package/lib/components/webchat-overlay/index.d.ts +1 -1
  81. package/lib/components/webchat-provider/webchat-context.d.ts +2 -0
  82. package/lib/hooks/use-update-custom-message-props.d.ts +1 -0
  83. package/lib/hooks/use-webchat-state.d.ts +6 -2
  84. package/lib/types/webchat-props.d.ts +19 -0
  85. package/package.json +8 -4
  86. package/styles.css +52 -1
  87. package/trigger.js +1 -1
  88. package/webchat-app-Cxzk8Q-q.js +5437 -0
  89. package/lib/components/shared/button-component/index.d.ts +0 -2
  90. package/lib/components/webchat-overlay/base/confirm-modal/confirm-modal.d.ts +0 -8
  91. package/lib/components/webchat-overlay/base/confirm-modal/index.d.ts +0 -2
  92. package/webchat-app-I5AArwfY.js +0 -4122
  93. /package/lib/components/shared/{button-component → quick-reply}/external-link-icon.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## 2.30.0 (2026-06-11)
2
+
3
+ ### 🚀 Features
4
+
5
+ - support botonic v2 preview in flow builder ([#916](https://github.com/metis-ai/hubtype-product/pull/916))
6
+ - port preview events into botonic v2 ([#915](https://github.com/metis-ai/hubtype-product/pull/915))
7
+ - support markdown in webchat ([#910](https://github.com/metis-ai/hubtype-product/pull/910))
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Marc Rabat @vanbasten17
12
+
13
+ ## 2.29.0 (2026-05-12)
14
+
15
+ ### 🚀 Features
16
+
17
+ - **botonic:** v2 refinements - update skills, serve-bot defaults, staging bot warning ([#888](https://github.com/metis-ai/hubtype-product/pull/888))
18
+ - rating component ([#882](https://github.com/metis-ai/hubtype-product/pull/882))
19
+
20
+ ### ❤️ Thank You
21
+
22
+ - David Hidalgo @Davidhidalgo
23
+ - Marc Rabat @vanbasten17
24
+
1
25
  ## 2.28.0 (2026-05-06)
2
26
 
3
27
  ### 🚀 Features
package/index.d.ts CHANGED
@@ -51,15 +51,18 @@ export { useWebchatContainer } from './lib/components/webchat-container/use-webc
51
51
  export { useWebchatHeader } from './lib/components/webchat-header/use-webchat-header';
52
52
  export { useWebchatInput } from './lib/components/webchat-input/use-webchat-input';
53
53
  export { useWebchatMessages } from './lib/components/webchat-messages/use-webchat-messages';
54
- export { useWebchatState } from './lib/hooks/use-webchat-state';
54
+ export { useUpdateCustomMessageProps } from './lib/hooks/use-update-custom-message-props';
55
+ export { useWebchatState, type WebchatCustomMessageComponents, type WebchatStateProps, } from './lib/hooks/use-webchat-state';
55
56
  export { DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG, getMessageActorCount, mergeWebchatHeroHeaderLayoutConfig, useWebchatHeroHeaderLayout, type UseWebchatHeroHeaderLayoutParams, type WebchatHeroHeaderLayoutConfig, type WebchatHeroHeaderLayoutResult, } from './lib/hero-header-layout';
56
57
  export { Message, type MessageProps } from './lib/components/message/message';
57
58
  export { MessageBubble, type MessageBubbleProps, } from './lib/components/message/message/message-bubble';
59
+ export { RatingMessage, type RatingMessageProps, } from './lib/components/message/rating-message';
58
60
  export { TypingIndicator } from './lib/components/message/typing-message';
59
61
  export { MessageMachineRenderer } from './lib/components/message-machine-renderer/message-machine-renderer';
62
+ export { type DebugEvent, type DebugEventConfig, PreviewEventMessage, type PreviewEventMessageProps, SYSTEM_MESSAGE_ROLE, } from './lib/components/preview-events';
60
63
  export { Backdrop, Dialog, type DialogAction, DialogContext, type DialogControls, type DialogOpenProps, DialogProvider, type DialogState, type DialogVariant, useDialog, } from './lib/components/dialog';
61
- export { type CoverComponentRegistry, Overlay, OverlayConfirmModal, type OverlayConfirmModalProps, OverlayContent, type OverlayContentProps, OverlayContext, type OverlayContextValue, OverlayCoverFrame, type OverlayCoverFrameProps, OverlayHeader, type OverlayHeaderProps, type OverlayProps, OverlayWebviewFrame, type OverlayWebviewFrameProps, useOverlay, useOverlayContext, useOverlayHeader, } from './lib/components/webchat-overlay';
62
- export { ButtonComponent, type ButtonComponentProps, } from './lib/components/shared';
64
+ export { type CoverComponentRegistry, Overlay, OverlayContent, type OverlayContentProps, OverlayContext, type OverlayContextValue, OverlayCoverFrame, type OverlayCoverFrameProps, OverlayHeader, type OverlayHeaderProps, type OverlayProps, OverlayWebviewFrame, type OverlayWebviewFrameProps, useOverlay, useOverlayContext, useOverlayHeader, } from './lib/components/webchat-overlay';
65
+ export { MarkdownText, type MarkdownTextProps, QuickReply, type QuickReplyProps, } from './lib/components/shared';
63
66
  export * from './lib/types/primitives';
64
67
  export * from './lib/types/webchat-props';
65
68
  export type { WebchatConfig, WebchatController, WebchatEmittedEvent, } from '@botonic/webchat-core';
package/index.js CHANGED
@@ -1,61 +1,65 @@
1
- import { B as s, a as t, C as o, D as r, b as n, c as u, d as i, e as c, f as l, g as d, h, M as b, i as g, j as W, k as p, O as C, l as v, m as M, n as y, o as O, p as m, q as D, T as H, W as T, r as x, s as B, t as I, u as S, v as w, w as A, x as E, y as f, z as F, A as L, E as R, F as _, G as k, H as G, I as P, J as U, K as j, L as q } from "./webchat-app-I5AArwfY.js";
2
- import { Badge as J, Banner as K, Button as N, Checkbox as Y, Multiselect as Q, MultiselectWithSections as V, Select as X, SelectWithSections as Z, Slider as $, Spinner as ee, Switch as ae, Tag as se, TextArea as te, TextInput as oe, Tooltip as re } from "@lilara/ui-web-react";
1
+ import { B as s, C as t, D as o, a as r, b as n, c as u, d as i, e as c, f as l, g, M as d, h as M, i as h, j as p, k as b, O as W, l as v, m as C, n as S, o as y, p as O, P as T, Q as D, R as H, S as m, T as x, W as E, q as w, r as I, s as A, t as B, u as R, v as _, w as L, x as k, y as F, z as P, A as f, E as G, F as U, G as Q, H as Y, I as j, J as q, K as z, L as J } from "./webchat-app-Cxzk8Q-q.js";
2
+ import { Badge as N, Banner as V, Button as X, Checkbox as Z, Multiselect as $, MultiselectWithSections as ee, Select as ae, SelectWithSections as se, Slider as te, Spinner as oe, Switch as re, Tag as ne, TextArea as ue, TextInput as ie, Tooltip as ce } from "@lilara/ui-web-react";
3
3
  export {
4
4
  s as Backdrop,
5
- J as Badge,
6
- K as Banner,
7
- N as Button,
8
- t as ButtonComponent,
9
- Y as Checkbox,
10
- o as CloseButton,
11
- r as DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG,
12
- n as Dialog,
13
- u as DialogContext,
14
- i as DialogProvider,
15
- c as DropdownMenuItemDownloadTranscript,
16
- l as DropdownMenuItemResetConversation,
17
- d as DropdownMenuItemResetSession,
18
- h as DropdownMenuItemSounds,
19
- b as MenuTriggerButton,
20
- g as Message,
21
- W as MessageBubble,
22
- p as MessageMachineRenderer,
23
- Q as Multiselect,
24
- V as MultiselectWithSections,
25
- C as Overlay,
26
- v as OverlayConfirmModal,
27
- M as OverlayContent,
28
- y as OverlayContext,
29
- O as OverlayCoverFrame,
30
- m as OverlayHeader,
31
- D as OverlayWebviewFrame,
32
- X as Select,
33
- Z as SelectWithSections,
34
- $ as Slider,
35
- ee as Spinner,
36
- ae as Switch,
37
- se as Tag,
38
- te as TextArea,
39
- oe as TextInput,
40
- re as Tooltip,
41
- H as TypingIndicator,
42
- T as WebchatApp,
43
- x as WebchatContainer,
44
- B as WebchatHeader,
45
- I as WebchatInput,
46
- S as WebchatMessages,
47
- w as WebchatProvider,
48
- A as getMessageActorCount,
49
- E as mergeWebchatHeroHeaderLayoutConfig,
50
- f as useDialog,
5
+ N as Badge,
6
+ V as Banner,
7
+ X as Button,
8
+ Z as Checkbox,
9
+ t as CloseButton,
10
+ o as DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG,
11
+ r as Dialog,
12
+ n as DialogContext,
13
+ u as DialogProvider,
14
+ i as DropdownMenuItemDownloadTranscript,
15
+ c as DropdownMenuItemResetConversation,
16
+ l as DropdownMenuItemResetSession,
17
+ g as DropdownMenuItemSounds,
18
+ d as MarkdownText,
19
+ M as MenuTriggerButton,
20
+ h as Message,
21
+ p as MessageBubble,
22
+ b as MessageMachineRenderer,
23
+ $ as Multiselect,
24
+ ee as MultiselectWithSections,
25
+ W as Overlay,
26
+ v as OverlayContent,
27
+ C as OverlayContext,
28
+ S as OverlayCoverFrame,
29
+ y as OverlayHeader,
30
+ O as OverlayWebviewFrame,
31
+ T as PreviewEventMessage,
32
+ D as QuickReply,
33
+ H as RatingMessage,
34
+ m as SYSTEM_MESSAGE_ROLE,
35
+ ae as Select,
36
+ se as SelectWithSections,
37
+ te as Slider,
38
+ oe as Spinner,
39
+ re as Switch,
40
+ ne as Tag,
41
+ ue as TextArea,
42
+ ie as TextInput,
43
+ ce as Tooltip,
44
+ x as TypingIndicator,
45
+ E as WebchatApp,
46
+ w as WebchatContainer,
47
+ I as WebchatHeader,
48
+ A as WebchatInput,
49
+ B as WebchatMessages,
50
+ R as WebchatProvider,
51
+ _ as getMessageActorCount,
52
+ L as mergeWebchatHeroHeaderLayoutConfig,
53
+ k as useDialog,
51
54
  F as useOverlay,
52
- L as useOverlayContext,
53
- R as useOverlayHeader,
54
- _ as useWebchatContainer,
55
- k as useWebchatContext,
56
- G as useWebchatHeader,
57
- P as useWebchatHeroHeaderLayout,
58
- U as useWebchatInput,
59
- j as useWebchatMessages,
60
- q as useWebchatState
55
+ P as useOverlayContext,
56
+ f as useOverlayHeader,
57
+ G as useUpdateCustomMessageProps,
58
+ U as useWebchatContainer,
59
+ Q as useWebchatContext,
60
+ Y as useWebchatHeader,
61
+ j as useWebchatHeroHeaderLayout,
62
+ q as useWebchatInput,
63
+ z as useWebchatMessages,
64
+ J as useWebchatState
61
65
  };
@@ -29,6 +29,7 @@ export { type CarouselElement, CarouselMessage, type CarouselMessageProps, } fro
29
29
  export { DocumentMessage, type DocumentMessageProps } from './document-message';
30
30
  export { ImageMessage, type ImageMessageProps } from './image-message';
31
31
  export { LocationMessage, type LocationMessageProps } from './location-message';
32
+ export { RatingMessage, type RatingMessageProps } from './rating-message';
32
33
  export { TextMessage, type TextMessageProps } from './text-message';
33
34
  export { TypingIndicator, type TypingIndicatorProps } from './typing-message';
34
35
  export { VideoMessage, type VideoMessageProps } from './video-message';
@@ -17,6 +17,8 @@ export interface MessageProps {
17
17
  senderName?: string;
18
18
  /** A class name to apply to the message. */
19
19
  className?: string;
20
+ /** Class name merged onto the inner {@link MessageBubble} (e.g. rating card overrides). */
21
+ bubbleClassName?: string;
20
22
  /** The content to render inside the message bubble. */
21
23
  children: React.ReactNode;
22
24
  /** Hide the footer when the next message belongs to the same group. */
@@ -19,6 +19,8 @@ export interface UseMessageProps {
19
19
  senderName?: string;
20
20
  /** A class name to apply to the message. */
21
21
  className?: string;
22
+ /** Class name merged onto {@link MessageBubble}. */
23
+ bubbleClassName?: string;
22
24
  /** The content to render inside the bubble. */
23
25
  children: React.ReactNode;
24
26
  /** Hide the footer when this message is grouped with the next. */
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceAngrySvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceFrownSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceGrinBeamSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceMehSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const FaceSmileSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export { FaceAngrySvg } from './face-angry';
2
+ export { FaceFrownSvg } from './face-frown';
3
+ export { FaceGrinBeamSvg } from './face-grin-beam';
4
+ export { FaceMehSvg } from './face-meh';
5
+ export { FaceSmileSvg } from './face-smile';
6
+ export type { RatingIconProps } from './rating-icon-types';
7
+ export { StarSvg } from './star';
@@ -0,0 +1,5 @@
1
+ /** Mirrors hubtype/botonic `RatingIconProps` (packages/botonic-react rating icons). */
2
+ export interface RatingIconProps {
3
+ color: string;
4
+ selected?: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { RatingIconProps } from './rating-icon-types';
2
+ export declare const StarSvg: ({ color, selected }: RatingIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { RatingMessage, type RatingMessageProps } from './rating-message';
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { RatingMessageProps } from './use-rating-message';
3
+ export type { RatingMessageProps };
4
+ export declare const RatingMessage: React.FC<RatingMessageProps>;
@@ -0,0 +1,34 @@
1
+ import { RatingType, WebchatOutputRatingButton } from '@botonic/shared';
2
+ export interface RatingMessageProps {
3
+ messageId?: string;
4
+ messageProps?: Record<string, unknown>;
5
+ text?: string;
6
+ sendButtonText?: string;
7
+ type?: RatingType;
8
+ buttons?: WebchatOutputRatingButton[];
9
+ /** Persisted state — populated from message.data after interaction */
10
+ selected?: number;
11
+ submitted?: boolean;
12
+ }
13
+ export interface UseRatingMessageReturn {
14
+ state: {
15
+ selected: number | undefined;
16
+ hovered: number | undefined;
17
+ submitted: boolean;
18
+ isSubmitting: boolean;
19
+ };
20
+ handlers: {
21
+ handleSelect: (value: number) => void;
22
+ handleHover: (value: number | undefined) => void;
23
+ handleSubmit: () => Promise<void>;
24
+ };
25
+ resolved: {
26
+ titleText: string;
27
+ text?: string;
28
+ sendButtonText: string;
29
+ messageProps: Record<string, unknown>;
30
+ type: RatingType;
31
+ buttons: WebchatOutputRatingButton[];
32
+ };
33
+ }
34
+ export declare function useRatingMessage(props: RatingMessageProps): UseRatingMessageReturn;
@@ -1,4 +1,4 @@
1
- import { BotonicButtonContent } from '@botonic/shared';
1
+ import { BotonicButtonContent, PreviewUtils } from '@botonic/shared';
2
2
  import { WebchatMessageMachine } from '@botonic/webchat-core';
3
3
  import { default as React } from 'react';
4
4
  import { ActorRefFrom } from 'xstate';
@@ -8,12 +8,13 @@ export interface MessageMachineRendererProps {
8
8
  /** The XState message machine actor */
9
9
  messageActor: ActorRefFrom<typeof WebchatMessageMachine>;
10
10
  /** Custom renderer for custom message types */
11
- customMessageRenderer?: (message: unknown, messageData: unknown, onButtonClick: (button: BotonicButtonContent) => void) => React.ReactNode;
11
+ customMessageRenderer?: (message: unknown, messageData: unknown, onButtonClick: (button: BotonicButtonContent) => void, messageProps: Partial<MessageProps>) => React.ReactNode;
12
12
  /** Additional props to pass to all message components */
13
13
  baseProps?: Partial<MessageProps> & {
14
14
  avatarConfig?: AvatarConfig;
15
15
  customMessages?: any;
16
16
  onUserInteraction?: () => void;
17
+ previewUtils?: PreviewUtils;
17
18
  };
18
19
  /** Callback when content (like images) finishes loading */
19
20
  onContentLoad?: () => void;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../../preview-events-types';
2
+ import { AiAgentDebugEvent } from '../types';
3
+ export declare const getAiAgentEventConfig: (data: AiAgentDebugEvent) => DebugEventConfig;
@@ -0,0 +1,7 @@
1
+ import { ToolExecuted } from '../types';
2
+ interface Props {
3
+ tools: ToolExecuted[];
4
+ onSeeToolDetails: (tool: ToolExecuted) => void;
5
+ }
6
+ export declare const ExecutedTools: ({ tools, onSeeToolDetails }: Props) => import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -0,0 +1 @@
1
+ export { getAiAgentEventConfig } from './ai-agent';
@@ -0,0 +1,9 @@
1
+ import { ToolExecuted } from '../types';
2
+ export declare const RETRIEVE_KNOWLEDGE_TOOL = "retrieve_knowledge";
3
+ export declare function parseTools(tools: ToolExecuted[], excludeTransferTools?: boolean): {
4
+ retrieveKnowledgeTools: ToolExecuted[];
5
+ otherTools: ToolExecuted[];
6
+ allSourcesIds: string[];
7
+ allChunksIds: string[];
8
+ query: string | undefined;
9
+ };
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../../preview-events-types';
2
+ import { AiAgentRouterDebugEvent } from '../types';
3
+ export declare const getAiAgentRouterEventConfig: (data: AiAgentRouterDebugEvent) => DebugEventConfig;
@@ -0,0 +1 @@
1
+ export { getAiAgentRouterEventConfig } from './ai-agent-router';
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { BotActionDebugEvent } from './types';
3
+ export declare const getBotActionEventConfig: (data: BotActionDebugEvent) => DebugEventConfig;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ interface GuardrailItemProps {
3
+ guardrail: string;
4
+ keyPrefix: string;
5
+ isLastItem?: boolean;
6
+ }
7
+ export declare const GuardrailItem: React.FC<GuardrailItemProps>;
8
+ interface GuardrailListProps {
9
+ guardrails: string[];
10
+ keyPrefix: string;
11
+ isLastItem?: boolean;
12
+ }
13
+ export declare const GuardrailList: React.FC<GuardrailListProps>;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ export { GuardrailItem, GuardrailList } from './guardrail-item';
2
+ export { SourcesSection } from './sources-section';
@@ -0,0 +1,11 @@
1
+ import { HubtypeChunk, HubtypeSource } from '@botonic/shared';
2
+ import { default as React } from 'react';
3
+ interface SourcesSectionProps {
4
+ sources: HubtypeSource[];
5
+ chunks: HubtypeChunk[];
6
+ getIconForSourceType: (source: HubtypeSource) => React.ReactNode;
7
+ onSeeChunks: () => void;
8
+ label?: string;
9
+ }
10
+ export declare const SourcesSection: ({ sources, chunks, getIconForSourceType, onSeeChunks, label, }: SourcesSectionProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { ConditionalChannelDebugEvent } from './types';
3
+ export declare const getConditionalChannelEventConfig: (data: ConditionalChannelDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { ConditionalCountryDebugEvent } from './types';
3
+ export declare const getConditionalCountryEventConfig: (data: ConditionalCountryDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { ConditionalCustomDebugEvent } from './types';
3
+ export declare const getConditionalCustomEventConfig: (data: ConditionalCustomDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { ConditionalQueueStatusDebugEvent } from './types';
3
+ export declare const getConditionalQueueStatusEventConfig: (data: ConditionalQueueStatusDebugEvent) => DebugEventConfig;
@@ -0,0 +1,32 @@
1
+ export declare const LABELS: {
2
+ readonly GUARDRAIL_TRIGGERED: "Guardrail triggered";
3
+ readonly KNOWLEDGE_FOUND: "Knowledge found";
4
+ readonly FAITHFUL_ANSWER: "Faithful answer";
5
+ readonly QUERY: "Query";
6
+ readonly SOURCES: "Sources";
7
+ readonly KNOWLEDGE_SOURCES: "Knowledge sources";
8
+ readonly EXECUTED_TOOLS: "Executed tools";
9
+ readonly TOOL_ARGUMENTS: "Tool arguments";
10
+ readonly TOOL_RESULTS: "Tool results";
11
+ readonly NO_TOOLS_EXECUTED: "No tools executed";
12
+ readonly AUTO_ASSIGN_ON: "ON";
13
+ readonly AUTO_ASSIGN_OFF: "OFF";
14
+ readonly EXIT: "Exit";
15
+ readonly ERROR: "Error";
16
+ readonly QUEUE: "Queue";
17
+ readonly AUTO_ASSIGN: "Auto-assign";
18
+ readonly NOTE: "Note";
19
+ readonly KNOWLEDGE_BASE_FAIL_REASON: "Knowledge Base Fail Reason";
20
+ readonly SEE_CHUNKS_BUTTON: "See chunks";
21
+ readonly SEE_TOOL_DETAILS: "Details";
22
+ readonly STATUS: "Status";
23
+ readonly YES: "Yes";
24
+ readonly NO: "No";
25
+ readonly OPEN: "Open";
26
+ readonly CLOSED: "Closed";
27
+ readonly AGENTS_AVAILABLE: "Agents available";
28
+ readonly AVAILABLE_TRANSFERS: "Available transfers";
29
+ readonly SPECIALISTS_AVAILABLE: "Specialists available";
30
+ readonly NO_TRANSFER: "No transfer";
31
+ readonly TRANSFERRED_TO: "Transferred to";
32
+ };
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { FallbackDebugEvent } from './types';
3
+ export declare const getFallbackEventConfig: (data: FallbackDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { HandoffSuccessDebugEvent } from './types';
3
+ export declare const getHandoffSuccessEventConfig: (data: HandoffSuccessDebugEvent) => DebugEventConfig;
@@ -0,0 +1,15 @@
1
+ export { getAiAgentEventConfig } from './ai-agent/ai-agent';
2
+ export { getAiAgentRouterEventConfig } from './ai-agent-router/ai-agent-router';
3
+ export { getBotActionEventConfig } from './bot-action';
4
+ export { getConditionalChannelEventConfig } from './conditional-channel';
5
+ export { getConditionalCountryEventConfig } from './conditional-country';
6
+ export { getConditionalCustomEventConfig } from './conditional-custom';
7
+ export { getConditionalQueueStatusEventConfig } from './conditional-queue-status';
8
+ export { getFallbackEventConfig } from './fallback';
9
+ export { getHandoffSuccessEventConfig } from './handoff-success';
10
+ export { getKeywordEventConfig } from './keyword';
11
+ export { getKnowledgeBaseEventConfig } from './knowledge-base';
12
+ export { getRedirectFlowEventConfig } from './redirect-flow';
13
+ export { getSmartIntentEventConfig } from './smart-intent';
14
+ export type { DebugEvent } from './types';
15
+ export { getWebviewActionTriggeredEventConfig } from './webview-action-triggered';
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { KeywordDebugEvent } from './types';
3
+ export declare const getKeywordEventConfig: (data: KeywordDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { KnowledgeBaseDebugEvent } from './types';
3
+ export declare const getKnowledgeBaseEventConfig: (_data: KnowledgeBaseDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { RedirectFlowDebugEvent } from './types';
3
+ export declare const getRedirectFlowEventConfig: (data: RedirectFlowDebugEvent) => DebugEventConfig;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { SmartIntentDebugEvent } from './types';
3
+ export declare const getSmartIntentEventConfig: (data: SmartIntentDebugEvent) => DebugEventConfig;
@@ -0,0 +1,112 @@
1
+ import { ChunkIdsGroupedBySourceData, EventAction } from '@botonic/shared';
2
+ export interface KeywordDebugEvent {
3
+ action: EventAction.Keyword;
4
+ flow_id: string;
5
+ flow_node_id: string;
6
+ nlu_keyword_is_regex: boolean;
7
+ nlu_keyword_name: string;
8
+ }
9
+ export interface SmartIntentDebugEvent {
10
+ action: EventAction.IntentSmart;
11
+ nlu_intent_smart_title: string;
12
+ }
13
+ export interface FallbackDebugEvent {
14
+ action: EventAction.Fallback;
15
+ user_input: string;
16
+ fallback_out: number;
17
+ fallback_message_id: string;
18
+ }
19
+ export interface BotActionDebugEvent {
20
+ action: EventAction.BotAction;
21
+ payload: string;
22
+ }
23
+ export interface HandoffSuccessDebugEvent {
24
+ action: EventAction.HandoffSuccess;
25
+ handoff_queue_name: string;
26
+ handoff_is_queue_open: boolean;
27
+ handoff_has_auto_assign: boolean;
28
+ handoff_note_id: string;
29
+ }
30
+ export interface RedirectFlowDebugEvent {
31
+ action: EventAction.RedirectFlow;
32
+ flow_id: string;
33
+ flow_name: string;
34
+ flow_target_id: string;
35
+ flow_target_name: string;
36
+ }
37
+ export interface WebviewActionTriggeredDebugEvent {
38
+ action: EventAction.WebviewActionTriggered;
39
+ webview_target_id: string;
40
+ webview_name: string;
41
+ }
42
+ export interface ConditionalChannelDebugEvent {
43
+ action: EventAction.ConditionalChannel;
44
+ channel: string;
45
+ }
46
+ export interface ConditionalCountryDebugEvent {
47
+ action: EventAction.ConditionalCountry;
48
+ country: string;
49
+ }
50
+ export interface ConditionalCustomDebugEvent {
51
+ action: EventAction.ConditionalCustom;
52
+ conditional_variable: string;
53
+ variable_format: string;
54
+ }
55
+ export interface ConditionalQueueStatusDebugEvent {
56
+ action: EventAction.ConditionalQueueStatus;
57
+ queue_id: string;
58
+ queue_name: string;
59
+ is_queue_open: boolean;
60
+ is_available_agent: boolean;
61
+ }
62
+ export interface KnowledgeBaseDebugEvent {
63
+ action: EventAction.Knowledgebase;
64
+ flow_id: string;
65
+ flow_node_id: string;
66
+ knowledgebase_inference_id: string;
67
+ knowledgebase_fail_reason: string;
68
+ knowledgebase_sources_ids: string[];
69
+ knowledgebase_chunks_ids: string[];
70
+ user_input: string;
71
+ knowledge_base_chunks_with_sources?: ChunkIdsGroupedBySourceData[];
72
+ messageId?: string;
73
+ }
74
+ export interface ToolExecuted {
75
+ tool_name: string;
76
+ tool_arguments: Record<string, unknown>;
77
+ tool_results?: string;
78
+ knowledgebase_sources_ids?: string[];
79
+ knowledgebase_chunks_ids?: string[];
80
+ }
81
+ export interface AiAgentDebugEvent {
82
+ action: EventAction.AiAgent;
83
+ flow_node_content_id: string;
84
+ user_input?: string;
85
+ tools_executed: ToolExecuted[];
86
+ input_guardrails_triggered: string[];
87
+ output_guardrails_triggered: string[];
88
+ exit: boolean;
89
+ error: boolean;
90
+ knowledge_base_chunks_with_sources?: ChunkIdsGroupedBySourceData[];
91
+ messageId?: string;
92
+ }
93
+ export interface SpecialistDebugEvent {
94
+ name: string;
95
+ description: string;
96
+ }
97
+ export interface AiAgentRouterDebugEvent {
98
+ action: EventAction.AiAgentRouter;
99
+ flow_node_content_id: string;
100
+ tools_executed: ToolExecuted[];
101
+ memory_length: number;
102
+ input_guardrails_triggered: string[];
103
+ output_guardrails_triggered: string[];
104
+ exit: boolean;
105
+ starting_agent_name: string;
106
+ last_agent_name: string;
107
+ available_specialists: SpecialistDebugEvent[];
108
+ is_transferred_to_specialist: boolean;
109
+ knowledge_base_chunks_with_sources?: ChunkIdsGroupedBySourceData[];
110
+ messageId?: string;
111
+ }
112
+ export type DebugEvent = KeywordDebugEvent | SmartIntentDebugEvent | FallbackDebugEvent | BotActionDebugEvent | HandoffSuccessDebugEvent | RedirectFlowDebugEvent | WebviewActionTriggeredDebugEvent | ConditionalChannelDebugEvent | ConditionalCountryDebugEvent | ConditionalCustomDebugEvent | ConditionalQueueStatusDebugEvent | KnowledgeBaseDebugEvent | AiAgentDebugEvent | AiAgentRouterDebugEvent;
@@ -0,0 +1,3 @@
1
+ import { DebugEventConfig } from '../preview-events-types';
2
+ import { WebviewActionTriggeredDebugEvent } from './types';
3
+ export declare const getWebviewActionTriggeredEventConfig: (data: WebviewActionTriggeredDebugEvent) => DebugEventConfig;
@@ -0,0 +1,19 @@
1
+ import { ChunkIdsGroupedBySourceData, HubtypeChunk, HubtypeSource, PreviewUtils } from '@botonic/shared';
2
+ import { default as React } from 'react';
3
+ interface UseKnowledgeBaseInfoParams {
4
+ sourceIds: string[];
5
+ chunkIds: string[];
6
+ existingChunksWithSources?: ChunkIdsGroupedBySourceData[];
7
+ failReason?: string;
8
+ previewUtils?: PreviewUtils;
9
+ }
10
+ export declare function useKnowledgeBaseInfo({ sourceIds, chunkIds, existingChunksWithSources, failReason, previewUtils, }: UseKnowledgeBaseInfoParams): {
11
+ sources: HubtypeSource[];
12
+ chunks: HubtypeChunk[];
13
+ chunksWithSources: ChunkIdsGroupedBySourceData[];
14
+ isLoading: boolean;
15
+ getIconForSourceType: (source: HubtypeSource) => React.ReactNode;
16
+ hasKnowledge: boolean;
17
+ isFaithful: boolean;
18
+ };
19
+ export {};