@botonic/webchat-react 2.29.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 (69) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/index.d.ts +2 -2
  3. package/index.js +48 -46
  4. package/lib/components/message/rating-message/use-rating-message.d.ts +12 -9
  5. package/lib/components/message-machine-renderer/message-machine-renderer.d.ts +2 -1
  6. package/lib/components/preview-events/events/ai-agent/ai-agent.d.ts +3 -0
  7. package/lib/components/preview-events/events/ai-agent/executed-tools.d.ts +7 -0
  8. package/lib/components/preview-events/events/ai-agent/index.d.ts +1 -0
  9. package/lib/components/preview-events/events/ai-agent/parse-tools.d.ts +9 -0
  10. package/lib/components/preview-events/events/ai-agent-router/ai-agent-router.d.ts +3 -0
  11. package/lib/components/preview-events/events/ai-agent-router/index.d.ts +1 -0
  12. package/lib/components/preview-events/events/bot-action.d.ts +3 -0
  13. package/lib/components/preview-events/events/components/guardrail-item.d.ts +14 -0
  14. package/lib/components/preview-events/events/components/index.d.ts +2 -0
  15. package/lib/components/preview-events/events/components/sources-section.d.ts +11 -0
  16. package/lib/components/preview-events/events/conditional-channel.d.ts +3 -0
  17. package/lib/components/preview-events/events/conditional-country.d.ts +3 -0
  18. package/lib/components/preview-events/events/conditional-custom.d.ts +3 -0
  19. package/lib/components/preview-events/events/conditional-queue-status.d.ts +3 -0
  20. package/lib/components/preview-events/events/constants.d.ts +32 -0
  21. package/lib/components/preview-events/events/fallback.d.ts +3 -0
  22. package/lib/components/preview-events/events/handoff-success.d.ts +3 -0
  23. package/lib/components/preview-events/events/index.d.ts +15 -0
  24. package/lib/components/preview-events/events/keyword.d.ts +3 -0
  25. package/lib/components/preview-events/events/knowledge-base.d.ts +3 -0
  26. package/lib/components/preview-events/events/redirect-flow.d.ts +3 -0
  27. package/lib/components/preview-events/events/smart-intent.d.ts +3 -0
  28. package/lib/components/preview-events/events/types.d.ts +112 -0
  29. package/lib/components/preview-events/events/webview-action-triggered.d.ts +3 -0
  30. package/lib/components/preview-events/hooks/use-knowledge-base-info.d.ts +19 -0
  31. package/lib/components/preview-events/hooks/use-last-label-position.d.ts +9 -0
  32. package/lib/components/preview-events/icons/ai-router-icon.d.ts +1 -0
  33. package/lib/components/preview-events/icons/ai-specialist-icon.d.ts +1 -0
  34. package/lib/components/preview-events/icons/arrow-progress-icon.d.ts +1 -0
  35. package/lib/components/preview-events/icons/brain-icon.d.ts +1 -0
  36. package/lib/components/preview-events/icons/caret-down-icon.d.ts +1 -0
  37. package/lib/components/preview-events/icons/caret-up-icon.d.ts +1 -0
  38. package/lib/components/preview-events/icons/circle-check-icon.d.ts +1 -0
  39. package/lib/components/preview-events/icons/code-icon.d.ts +1 -0
  40. package/lib/components/preview-events/icons/file-pdf-icon.d.ts +1 -0
  41. package/lib/components/preview-events/icons/file-word-icon.d.ts +1 -0
  42. package/lib/components/preview-events/icons/hand-icon.d.ts +1 -0
  43. package/lib/components/preview-events/icons/head-set-icon.d.ts +1 -0
  44. package/lib/components/preview-events/icons/index.d.ts +19 -0
  45. package/lib/components/preview-events/icons/life-ring-icon.d.ts +1 -0
  46. package/lib/components/preview-events/icons/link-icon.d.ts +1 -0
  47. package/lib/components/preview-events/icons/quote-right-icon.d.ts +1 -0
  48. package/lib/components/preview-events/icons/screwdriver-wrench-icon.d.ts +1 -0
  49. package/lib/components/preview-events/icons/split-icon.d.ts +1 -0
  50. package/lib/components/preview-events/icons/wand-icon.d.ts +1 -0
  51. package/lib/components/preview-events/icons/window-restore-icon.d.ts +1 -0
  52. package/lib/components/preview-events/index.d.ts +3 -0
  53. package/lib/components/preview-events/preview-event-message/index.d.ts +1 -0
  54. package/lib/components/preview-events/preview-event-message/preview-event-message.d.ts +20 -0
  55. package/lib/components/preview-events/preview-event-message/use-preview-event-message.d.ts +17 -0
  56. package/lib/components/preview-events/preview-events-types.d.ts +12 -0
  57. package/lib/components/shared/index.d.ts +2 -0
  58. package/lib/components/shared/markdown-text/index.d.ts +2 -0
  59. package/lib/components/shared/markdown-text/markdown-text.d.ts +6 -0
  60. package/lib/components/webchat-messages/use-webchat-messages.d.ts +1 -1
  61. package/lib/components/webchat-provider/webchat-context.d.ts +2 -0
  62. package/lib/hooks/use-webchat-state.d.ts +2 -6
  63. package/lib/types/webchat-props.d.ts +19 -0
  64. package/package.json +8 -4
  65. package/styles.css +13 -8
  66. package/trigger.js +1 -1
  67. package/webchat-app-Cxzk8Q-q.js +5437 -0
  68. package/lib/hooks/webchat-output-renderers.d.ts +0 -6
  69. package/webchat-app-C3YH_yqx.js +0 -4293
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
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
+
1
13
  ## 2.29.0 (2026-05-12)
2
14
 
3
15
  ### 🚀 Features
package/index.d.ts CHANGED
@@ -53,16 +53,16 @@ export { useWebchatInput } from './lib/components/webchat-input/use-webchat-inpu
53
53
  export { useWebchatMessages } from './lib/components/webchat-messages/use-webchat-messages';
54
54
  export { useUpdateCustomMessageProps } from './lib/hooks/use-update-custom-message-props';
55
55
  export { useWebchatState, type WebchatCustomMessageComponents, type WebchatStateProps, } from './lib/hooks/use-webchat-state';
56
- export { WEBCHAT_OUTPUT_RENDERERS } from './lib/hooks/webchat-output-renderers';
57
56
  export { DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG, getMessageActorCount, mergeWebchatHeroHeaderLayoutConfig, useWebchatHeroHeaderLayout, type UseWebchatHeroHeaderLayoutParams, type WebchatHeroHeaderLayoutConfig, type WebchatHeroHeaderLayoutResult, } from './lib/hero-header-layout';
58
57
  export { Message, type MessageProps } from './lib/components/message/message';
59
58
  export { MessageBubble, type MessageBubbleProps, } from './lib/components/message/message/message-bubble';
60
59
  export { RatingMessage, type RatingMessageProps, } from './lib/components/message/rating-message';
61
60
  export { TypingIndicator } from './lib/components/message/typing-message';
62
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';
63
63
  export { Backdrop, Dialog, type DialogAction, DialogContext, type DialogControls, type DialogOpenProps, DialogProvider, type DialogState, type DialogVariant, useDialog, } from './lib/components/dialog';
64
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 { QuickReply, type QuickReplyProps } from './lib/components/shared';
65
+ export { MarkdownText, type MarkdownTextProps, QuickReply, type QuickReplyProps, } from './lib/components/shared';
66
66
  export * from './lib/types/primitives';
67
67
  export * from './lib/types/webchat-props';
68
68
  export type { WebchatConfig, WebchatController, WebchatEmittedEvent, } from '@botonic/webchat-core';
package/index.js CHANGED
@@ -1,11 +1,11 @@
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, i as p, j as W, O as b, k as C, l as M, m as v, n as y, o as O, Q as T, R as D, T as H, W as m, p as R, q as S, r as x, s as B, t as E, u as I, v as A, w, x as _, y as F, z as L, A as U, E as f, F as k, G as P, H as G, I as N, J as Q, K as j, L as q } from "./webchat-app-C3YH_yqx.js";
2
- import { Badge as J, Banner as K, Button as Y, Checkbox as V, Multiselect as X, MultiselectWithSections as Z, Select as $, SelectWithSections as ee, Slider as ae, Spinner as se, Switch as te, Tag as oe, TextArea as re, TextInput as ne, Tooltip as ue } 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
- Y as Button,
8
- V as Checkbox,
5
+ N as Badge,
6
+ V as Banner,
7
+ X as Button,
8
+ Z as Checkbox,
9
9
  t as CloseButton,
10
10
  o as DEFAULT_WEBCHAT_HERO_HEADER_LAYOUT_CONFIG,
11
11
  r as Dialog,
@@ -15,49 +15,51 @@ export {
15
15
  c as DropdownMenuItemResetConversation,
16
16
  l as DropdownMenuItemResetSession,
17
17
  g as DropdownMenuItemSounds,
18
- d as MenuTriggerButton,
18
+ d as MarkdownText,
19
+ M as MenuTriggerButton,
19
20
  h as Message,
20
21
  p as MessageBubble,
21
- W as MessageMachineRenderer,
22
- X as Multiselect,
23
- Z as MultiselectWithSections,
24
- b as Overlay,
25
- C as OverlayContent,
26
- M as OverlayContext,
27
- v as OverlayCoverFrame,
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,
28
29
  y as OverlayHeader,
29
30
  O as OverlayWebviewFrame,
30
- T as QuickReply,
31
- D as RatingMessage,
32
- $ as Select,
33
- ee as SelectWithSections,
34
- ae as Slider,
35
- se as Spinner,
36
- te as Switch,
37
- oe as Tag,
38
- re as TextArea,
39
- ne as TextInput,
40
- ue as Tooltip,
41
- H as TypingIndicator,
42
- m as WEBCHAT_OUTPUT_RENDERERS,
43
- R as WebchatApp,
44
- S as WebchatContainer,
45
- x as WebchatHeader,
46
- B as WebchatInput,
47
- E as WebchatMessages,
48
- I as WebchatProvider,
49
- A as getMessageActorCount,
50
- w as mergeWebchatHeroHeaderLayoutConfig,
51
- _ as useDialog,
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,
52
54
  F as useOverlay,
53
- L as useOverlayContext,
54
- U as useOverlayHeader,
55
- f as useUpdateCustomMessageProps,
56
- k as useWebchatContainer,
57
- P as useWebchatContext,
58
- G as useWebchatHeader,
59
- N as useWebchatHeroHeaderLayout,
60
- Q as useWebchatInput,
61
- j as useWebchatMessages,
62
- 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
63
65
  };
@@ -1,31 +1,34 @@
1
- import { WebchatOutputRatingProps } from '@botonic/shared';
2
- export interface RatingMessageProps extends WebchatOutputRatingProps {
1
+ import { RatingType, WebchatOutputRatingButton } from '@botonic/shared';
2
+ export interface RatingMessageProps {
3
3
  messageId?: string;
4
4
  messageProps?: Record<string, unknown>;
5
- /** Persisted state — populated from message.data.props after interaction */
5
+ text?: string;
6
+ sendButtonText?: string;
7
+ type?: RatingType;
8
+ buttons?: WebchatOutputRatingButton[];
9
+ /** Persisted state — populated from message.data after interaction */
6
10
  selected?: number;
7
- comment?: string;
8
11
  submitted?: boolean;
9
12
  }
10
13
  export interface UseRatingMessageReturn {
11
14
  state: {
12
15
  selected: number | undefined;
13
16
  hovered: number | undefined;
14
- comment: string;
15
17
  submitted: boolean;
16
18
  isSubmitting: boolean;
17
19
  };
18
20
  handlers: {
19
21
  handleSelect: (value: number) => void;
20
22
  handleHover: (value: number | undefined) => void;
21
- handleCommentChange: (value: string) => void;
22
23
  handleSubmit: () => Promise<void>;
23
24
  };
24
25
  resolved: {
25
- messageText: string;
26
- buttonText: string;
26
+ titleText: string;
27
+ text?: string;
28
+ sendButtonText: string;
27
29
  messageProps: Record<string, unknown>;
28
- ratingType: 'stars' | 'smileys';
30
+ type: RatingType;
31
+ buttons: WebchatOutputRatingButton[];
29
32
  };
30
33
  }
31
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';
@@ -14,6 +14,7 @@ export interface MessageMachineRendererProps {
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 {};
@@ -0,0 +1,9 @@
1
+ import { RefObject } from 'react';
2
+ interface UseLastLabelPositionProps {
3
+ wrapperRef: RefObject<HTMLDivElement | null>;
4
+ isExpanded: boolean;
5
+ debugEvent: unknown;
6
+ isCollapsible: boolean;
7
+ }
8
+ export declare function useLastLabelPosition({ wrapperRef, isExpanded, debugEvent, isCollapsible, }: UseLastLabelPositionProps): void;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare function AiRouterIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function AiSpecialistIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ArrowProgressIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function BrainIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CaretDownIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CaretUpIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CircleCheckIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function CodeIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function FilePdfIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function FileWordIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function HandIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function HeadSetIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ export { AiRouterIcon } from './ai-router-icon';
2
+ export { AiSpecialistIcon } from './ai-specialist-icon';
3
+ export { ArrowProgressIcon } from './arrow-progress-icon';
4
+ export { BrainIcon } from './brain-icon';
5
+ export { CaretDownIcon } from './caret-down-icon';
6
+ export { CaretUpIcon } from './caret-up-icon';
7
+ export { CircleCheckIcon } from './circle-check-icon';
8
+ export { CodeIcon } from './code-icon';
9
+ export { FilePdfIcon } from './file-pdf-icon';
10
+ export { FileWordIcon } from './file-word-icon';
11
+ export { HandIcon } from './hand-icon';
12
+ export { HeadSetIcon } from './head-set-icon';
13
+ export { LifeRingIcon } from './life-ring-icon';
14
+ export { LinkIcon } from './link-icon';
15
+ export { QuoteRightIcon } from './quote-right-icon';
16
+ export { ScrewdriverWrenchIcon } from './screwdriver-wrench-icon';
17
+ export { SplitIcon } from './split-icon';
18
+ export { WandIcon } from './wand-icon';
19
+ export { WindowRestoreIcon } from './window-restore-icon';
@@ -0,0 +1 @@
1
+ export declare function LifeRingIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function LinkIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function QuoteRightIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ScrewdriverWrenchIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function SplitIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function WandIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function WindowRestoreIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export type { DebugEvent } from './events/types';
2
+ export { PreviewEventMessage, type PreviewEventMessageProps, SYSTEM_MESSAGE_ROLE, } from './preview-event-message';
3
+ export type { DebugEventConfig } from './preview-events-types';
@@ -0,0 +1 @@
1
+ export { PreviewEventMessage, type PreviewEventMessageProps, SYSTEM_MESSAGE_ROLE, } from './preview-event-message';