@clikvn/agent-widget-embedded 1.1.5-dev-19 → 1.1.5-dev-21

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 (113) hide show
  1. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/AgentThinking.d.ts.map +1 -1
  2. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/AgentThinking.js +2 -11
  3. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/AgentThinking.js.map +1 -1
  4. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingDetail.d.ts +12 -0
  5. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingDetail.d.ts.map +1 -0
  6. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingDetail.js +36 -0
  7. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingDetail.js.map +1 -0
  8. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.d.ts +5 -1
  9. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.d.ts.map +1 -1
  10. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.js +43 -14
  11. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingForm.js.map +1 -1
  12. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingList.d.ts +9 -0
  13. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingList.d.ts.map +1 -0
  14. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingList.js +64 -0
  15. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/BookMeetingList.js.map +1 -0
  16. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.js +13 -13
  17. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Icons.js.map +1 -1
  18. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/LoadingComponent.d.ts +4 -0
  19. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/LoadingComponent.d.ts.map +1 -0
  20. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/LoadingComponent.js +6 -0
  21. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/LoadingComponent.js.map +1 -0
  22. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Markdown.js +1 -1
  23. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Markdown.js.map +1 -1
  24. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.d.ts.map +1 -1
  25. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.js +5 -4
  26. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Message.js.map +1 -1
  27. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/MultimodalInput.d.ts.map +1 -1
  28. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/MultimodalInput.js +2 -2
  29. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/MultimodalInput.js.map +1 -1
  30. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductDetail.d.ts.map +1 -1
  31. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductDetail.js +2 -1
  32. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductDetail.js.map +1 -1
  33. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductList.d.ts.map +1 -1
  34. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductList.js +2 -1
  35. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ProductList.js.map +1 -1
  36. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ScenariosList.d.ts +3 -3
  37. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ScenariosList.d.ts.map +1 -1
  38. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ScenariosList.js +4 -2
  39. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ScenariosList.js.map +1 -1
  40. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Simplified/MultimodalInputSimplified.js +3 -3
  41. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/Simplified/MultimodalInputSimplified.js.map +1 -1
  42. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.d.ts.map +1 -1
  43. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.js +45 -37
  44. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/UserContactForm.js.map +1 -1
  45. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.d.ts.map +1 -1
  46. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.js +1 -1
  47. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/DataPickerCustom.js.map +1 -1
  48. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.d.ts +2 -2
  49. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.d.ts.map +1 -1
  50. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/PhoneNumberInput.js.map +1 -1
  51. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.d.ts.map +1 -1
  52. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.js +3 -3
  53. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBox.js.map +1 -1
  54. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.d.ts +1 -0
  55. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.d.ts.map +1 -1
  56. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.js +2 -2
  57. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/components/Chat/ui/SelectBoxWithIcon.js.map +1 -1
  58. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/toolNames.d.ts +5 -1
  59. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/toolNames.d.ts.map +1 -1
  60. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/toolNames.js +4 -0
  61. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/constants/toolNames.js.map +1 -1
  62. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.d.ts +4 -0
  63. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.d.ts.map +1 -1
  64. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/hooks/useConfiguration.js.map +1 -1
  65. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/register.d.ts +1 -0
  66. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/register.d.ts.map +1 -1
  67. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/register.js.map +1 -1
  68. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.d.ts +4 -0
  69. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.d.ts.map +1 -1
  70. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.js +11 -0
  71. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/bookMeeting.service.js.map +1 -1
  72. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.d.ts +2 -1
  73. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.d.ts.map +1 -1
  74. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.js +2 -1
  75. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/services/userContact.service.js.map +1 -1
  76. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.d.ts +4 -1
  77. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.d.ts.map +1 -1
  78. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/bookMeeting.type.js.map +1 -1
  79. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.d.ts +0 -1
  80. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.d.ts.map +1 -1
  81. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/types/userContact.type.js.map +1 -1
  82. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/agentTraceUtils.js +1 -1
  83. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/agentTraceUtils.js.map +1 -1
  84. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.d.ts +6 -0
  85. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.d.ts.map +1 -1
  86. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.js +14 -5
  87. package/.rollup.cache/Users/tungthai/Desktop/Develop/clik-ai-chatbot-embedded/dist/utils/toolUtils.js.map +1 -1
  88. package/dist/components/Chat/BookMeetingDetail.d.ts +12 -0
  89. package/dist/components/Chat/BookMeetingDetail.d.ts.map +1 -0
  90. package/dist/components/Chat/BookMeetingForm.d.ts +5 -1
  91. package/dist/components/Chat/BookMeetingForm.d.ts.map +1 -1
  92. package/dist/components/Chat/BookMeetingList.d.ts +9 -0
  93. package/dist/components/Chat/BookMeetingList.d.ts.map +1 -0
  94. package/dist/components/Chat/LoadingComponent.d.ts +4 -0
  95. package/dist/components/Chat/LoadingComponent.d.ts.map +1 -0
  96. package/dist/components/Chat/Message.d.ts.map +1 -1
  97. package/dist/components/Chat/MultimodalInput.d.ts.map +1 -1
  98. package/dist/components/Chat/ProductDetail.d.ts.map +1 -1
  99. package/dist/components/Chat/ProductList.d.ts.map +1 -1
  100. package/dist/constants/toolNames.d.ts +5 -1
  101. package/dist/constants/toolNames.d.ts.map +1 -1
  102. package/dist/hooks/useConfiguration.d.ts +4 -0
  103. package/dist/hooks/useConfiguration.d.ts.map +1 -1
  104. package/dist/index.html +7 -5
  105. package/dist/services/bookMeeting.service.d.ts +1 -0
  106. package/dist/services/bookMeeting.service.d.ts.map +1 -1
  107. package/dist/types/bookMeeting.type.d.ts +3 -0
  108. package/dist/types/bookMeeting.type.d.ts.map +1 -1
  109. package/dist/utils/toolUtils.d.ts +6 -0
  110. package/dist/utils/toolUtils.d.ts.map +1 -1
  111. package/dist/web.js +1 -1
  112. package/dist/web.js.map +1 -1
  113. package/package.json +1 -1
@@ -71,6 +71,7 @@ export declare class AgentWidgetComponent extends HTMLElement {
71
71
  buttons?: {
72
72
  textBtnSpeak?: string;
73
73
  textBtnTalk?: string;
74
+ textBtnSubmit?: string;
74
75
  };
75
76
  } & Record<string, unknown>;
76
77
  listeners?: Record<EVENT_TYPE, (props: any) => void>;
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sour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sBAAsB,CAAC,EAAE,CAAC;QAChD,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as ReactDom from 'react-dom';\nimport { agentWidgetElementName } from './constants';\nimport AgentWidget from './features/AgentWidget';\nimport { EVENT_TYPE } from './models';\nimport { SuggestionType } from './types/common.type';\n\ntype ToolType = {\n setInput: (text?: string) => void;\n};\n\nexport type AgentWidgetType = {\n apiHost: string;\n agentId: string;\n voice?: {\n enable?: boolean;\n livekitUrl: string;\n };\n overrideConfig?: {\n chatId?: string | undefined;\n overrideConfig?: Record<string, unknown>;\n suggestedActions?: SuggestionType[];\n skipSuggestion?: boolean;\n } & Record<string, unknown>;\n theme?: {\n simplified?: boolean;\n welcomeMessage?: string;\n noAutoplayMessage?: boolean;\n autoCloseAudioPlayer?: boolean;\n hideAudioMetadata?: boolean;\n avatar?: string;\n input?: {\n placeholder?: string;\n recordingPlaceholder?: string;\n transcribingPlaceholder?: string;\n };\n overview?: {\n title: string;\n description?: string;\n };\n buttons?: {\n textBtnSpeak?: string;\n textBtnTalk?: string;\n };\n } & Record<string, unknown>;\n listeners?: Record<EVENT_TYPE, (props: any) => void>;\n onLoaded?: (tool: ToolType) => void;\n};\n\nexport class AgentWidgetComponent extends HTMLElement {\n apiHost?: string;\n agentId?: string;\n voice?: {\n enable?: boolean;\n livekitUrl: string;\n };\n overrideConfig?: {\n chatId?: string | undefined;\n overrideConfig?: Record<string, unknown>;\n suggestedActions?: SuggestionType[];\n skipSuggestion?: boolean;\n } & Record<string, unknown>;\n theme?: {\n simplified?: boolean;\n welcomeMessage?: string;\n autoCloseAudioPlayer?: boolean;\n hideAudioMetadata?: boolean;\n avatar?: string;\n input?: {\n placeholder?: string;\n recordingPlaceholder?: string;\n transcribingPlaceholder?: string;\n };\n overview?: {\n title: string;\n description?: string;\n };\n buttons?: {\n textBtnSpeak?: string;\n textBtnTalk?: string;\n };\n } & Record<string, unknown>;\n listeners?: Record<EVENT_TYPE, (props: any) => void>;\n onLoaded?: (tool: ToolType) => void;\n\n constructor() {\n super();\n this.updateAttributes = this.updateAttributes.bind(this);\n }\n\n updateAttributes(attributes: AgentWidgetType) {\n this.apiHost = attributes.apiHost;\n this.agentId = attributes.agentId;\n this.overrideConfig = attributes.overrideConfig;\n this.listeners = attributes.listeners;\n this.theme = attributes.theme;\n this.voice = attributes.voice;\n this.onLoaded = attributes.onLoaded;\n this.render();\n }\n\n connectedCallback() {\n if (this.apiHost) {\n this.render();\n }\n }\n\n render() {\n ReactDom.render(\n <AgentWidget\n apiHost={this.apiHost || ''}\n agentId={this.agentId || ''}\n overrideConfig={this.overrideConfig}\n listeners={this.listeners}\n theme={this.theme}\n voice={this.voice}\n onLoaded={this.onLoaded}\n />,\n this\n );\n }\n}\n\nexport const registerWebComponents = () => {\n if (typeof window === 'undefined') return;\n if (!customElements.get(agentWidgetElementName)) {\n customElements.define(agentWidgetElementName, AgentWidgetComponent);\n }\n};\n"]}
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AA8CjD,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IAqCnD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB,CAAC,UAA2B;QAC1C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,QAAQ,CAAC,MAAM,CACb,KAAC,WAAW,IACV,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAC3B,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACvB,EACF,IAAI,CACL,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAChD,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as ReactDom from 'react-dom';\nimport { agentWidgetElementName } from './constants';\nimport AgentWidget from './features/AgentWidget';\nimport { EVENT_TYPE } from './models';\nimport { SuggestionType } from './types/common.type';\n\ntype ToolType = {\n setInput: (text?: string) => void;\n};\n\nexport type AgentWidgetType = {\n apiHost: string;\n agentId: string;\n voice?: {\n enable?: boolean;\n livekitUrl: string;\n };\n overrideConfig?: {\n chatId?: string | undefined;\n overrideConfig?: Record<string, unknown>;\n suggestedActions?: SuggestionType[];\n skipSuggestion?: boolean;\n } & Record<string, unknown>;\n theme?: {\n simplified?: boolean;\n welcomeMessage?: string;\n noAutoplayMessage?: boolean;\n autoCloseAudioPlayer?: boolean;\n hideAudioMetadata?: boolean;\n avatar?: string;\n input?: {\n placeholder?: string;\n recordingPlaceholder?: string;\n transcribingPlaceholder?: string;\n };\n overview?: {\n title: string;\n description?: string;\n };\n buttons?: {\n textBtnSpeak?: string;\n textBtnTalk?: string;\n };\n } & Record<string, unknown>;\n listeners?: Record<EVENT_TYPE, (props: any) => void>;\n onLoaded?: (tool: ToolType) => void;\n};\n\nexport class AgentWidgetComponent extends HTMLElement {\n apiHost?: string;\n agentId?: string;\n voice?: {\n enable?: boolean;\n livekitUrl: string;\n };\n overrideConfig?: {\n chatId?: string | undefined;\n overrideConfig?: Record<string, unknown>;\n suggestedActions?: SuggestionType[];\n skipSuggestion?: boolean;\n } & Record<string, unknown>;\n theme?: {\n simplified?: boolean;\n welcomeMessage?: string;\n autoCloseAudioPlayer?: boolean;\n hideAudioMetadata?: boolean;\n avatar?: string;\n input?: {\n placeholder?: string;\n recordingPlaceholder?: string;\n transcribingPlaceholder?: string;\n };\n overview?: {\n title: string;\n description?: string;\n };\n buttons?: {\n textBtnSpeak?: string;\n textBtnTalk?: string;\n textBtnSubmit?: string;\n };\n } & Record<string, unknown>;\n listeners?: Record<EVENT_TYPE, (props: any) => void>;\n onLoaded?: (tool: ToolType) => void;\n\n constructor() {\n super();\n this.updateAttributes = this.updateAttributes.bind(this);\n }\n\n updateAttributes(attributes: AgentWidgetType) {\n this.apiHost = attributes.apiHost;\n this.agentId = attributes.agentId;\n this.overrideConfig = attributes.overrideConfig;\n this.listeners = attributes.listeners;\n this.theme = attributes.theme;\n this.voice = attributes.voice;\n this.onLoaded = attributes.onLoaded;\n this.render();\n }\n\n connectedCallback() {\n if (this.apiHost) {\n this.render();\n }\n }\n\n render() {\n ReactDom.render(\n <AgentWidget\n apiHost={this.apiHost || ''}\n agentId={this.agentId || ''}\n overrideConfig={this.overrideConfig}\n listeners={this.listeners}\n theme={this.theme}\n voice={this.voice}\n onLoaded={this.onLoaded}\n />,\n this\n );\n }\n}\n\nexport const registerWebComponents = () => {\n if (typeof window === 'undefined') return;\n if (!customElements.get(agentWidgetElementName)) {\n customElements.define(agentWidgetElementName, AgentWidgetComponent);\n }\n};\n"]}
@@ -1,3 +1,7 @@
1
1
  import { BookMeetingType } from '../types/bookMeeting.type';
2
2
  export declare const createBookMeeting: (data: BookMeetingType, apiHost: string) => Promise<any>;
3
+ export declare const getBookMeeting: (apiHost: string, params: {
4
+ id?: string;
5
+ userId?: string;
6
+ }) => Promise<any>;
3
7
  //# sourceMappingURL=bookMeeting.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bookMeeting.service.d.ts","sourceRoot":"","sources":["../../src/services/bookMeeting.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,eAAO,MAAM,iBAAiB,SACtB,eAAe,WACZ,MAAM,KACd,OAAO,CAAC,GAAG,CAYb,CAAC"}
1
+ {"version":3,"file":"bookMeeting.service.d.ts","sourceRoot":"","sources":["../../src/services/bookMeeting.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,eAAO,MAAM,iBAAiB,SACtB,eAAe,WACZ,MAAM,KACd,OAAO,CAAC,GAAG,CAYb,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,UACP;IACN,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KACA,OAAO,CAAC,GAAG,CAUb,CAAC"}
@@ -12,4 +12,15 @@ export const createBookMeeting = async (data, apiHost) => {
12
12
  body: JSON.stringify(data),
13
13
  });
14
14
  };
15
+ export const getBookMeeting = async (apiHost, params) => {
16
+ return request({
17
+ host: apiHost,
18
+ url: `${API_BOOK_MEETING}/search`,
19
+ method: 'GET',
20
+ params: {
21
+ id: params?.id || undefined,
22
+ userId: params?.userId || undefined,
23
+ },
24
+ });
25
+ };
15
26
  //# sourceMappingURL=bookMeeting.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bookMeeting.service.js","sourceRoot":"","sources":["../../src/services/bookMeeting.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,IAAqB,EACrB,OAAe,EACD,EAAE;IAChB,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,gBAAgB,EAAE;QAC1B,OAAO;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { BookMeetingType } from '../types/bookMeeting.type';\nimport { request } from '../utils/requestUtils';\nimport { API_BOOK_MEETING } from './apis';\n\nexport const createBookMeeting = async (\n data: BookMeetingType,\n apiHost: string\n): Promise<any> => {\n const headers = {\n 'Content-Type': 'application/json',\n };\n\n return request({\n host: apiHost,\n url: `${API_BOOK_MEETING}`,\n headers,\n method: 'POST',\n body: JSON.stringify(data),\n });\n};\n"]}
1
+ {"version":3,"file":"bookMeeting.service.js","sourceRoot":"","sources":["../../src/services/bookMeeting.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,IAAqB,EACrB,OAAe,EACD,EAAE;IAChB,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,gBAAgB,EAAE;QAC1B,OAAO;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAAe,EACf,MAGC,EACa,EAAE;IAChB,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,gBAAgB,SAAS;QACjC,MAAM,EAAE,KAAK;QACb,MAAM,EAAE;YACN,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,SAAS;YAC3B,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,SAAS;SACpC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { BookMeetingType } from '../types/bookMeeting.type';\nimport { request } from '../utils/requestUtils';\nimport { API_BOOK_MEETING } from './apis';\n\nexport const createBookMeeting = async (\n data: BookMeetingType,\n apiHost: string\n): Promise<any> => {\n const headers = {\n 'Content-Type': 'application/json',\n };\n\n return request({\n host: apiHost,\n url: `${API_BOOK_MEETING}`,\n headers,\n method: 'POST',\n body: JSON.stringify(data),\n });\n};\n\nexport const getBookMeeting = async (\n apiHost: string,\n params: {\n id?: string;\n userId?: string;\n }\n): Promise<any> => {\n return request({\n host: apiHost,\n url: `${API_BOOK_MEETING}/search`,\n method: 'GET',\n params: {\n id: params?.id || undefined,\n userId: params?.userId || undefined,\n },\n });\n};\n"]}
@@ -1,7 +1,8 @@
1
1
  import { UserContactType } from '../types/userContact.type';
2
2
  export declare const createUserContact: (data: UserContactType, apiHost: string) => Promise<any>;
3
3
  export declare const getUserContact: (apiHost: string, params: {
4
- sessionId?: string;
4
+ id?: string;
5
5
  email?: string;
6
+ contact?: string;
6
7
  }) => Promise<any>;
7
8
  //# sourceMappingURL=userContact.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"userContact.service.d.ts","sourceRoot":"","sources":["../../src/services/userContact.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,eAAO,MAAM,iBAAiB,SACtB,eAAe,WACZ,MAAM,KACd,OAAO,CAAC,GAAG,CAYb,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,UACP;IACN,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KACA,OAAO,CAAC,GAAG,CAUb,CAAC"}
1
+ {"version":3,"file":"userContact.service.d.ts","sourceRoot":"","sources":["../../src/services/userContact.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,eAAO,MAAM,iBAAiB,SACtB,eAAe,WACZ,MAAM,KACd,OAAO,CAAC,GAAG,CAYb,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,UACP;IACN,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KACA,OAAO,CAAC,GAAG,CAWb,CAAC"}
@@ -18,8 +18,9 @@ export const getUserContact = async (apiHost, params) => {
18
18
  url: `${API_USER_CONTACTS}/search`,
19
19
  method: 'GET',
20
20
  params: {
21
- sessionId: params?.sessionId || undefined,
21
+ id: params?.id || undefined,
22
22
  email: params?.email || undefined,
23
+ contact: params?.contact || undefined,
23
24
  },
24
25
  });
25
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"userContact.service.js","sourceRoot":"","sources":["../../src/services/userContact.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,IAAqB,EACrB,OAAe,EACD,EAAE;IAChB,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,iBAAiB,EAAE;QAC3B,OAAO;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAAe,EACf,MAGC,EACa,EAAE;IAChB,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,iBAAiB,SAAS;QAClC,MAAM,EAAE,KAAK;QACb,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,SAAS;YACzC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,SAAS;SAClC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { UserContactType } from '../types/userContact.type';\nimport { request } from '../utils/requestUtils';\nimport { API_USER_CONTACTS } from './apis';\n\nexport const createUserContact = async (\n data: UserContactType,\n apiHost: string\n): Promise<any> => {\n const headers = {\n 'Content-Type': 'application/json',\n };\n\n return request({\n host: apiHost,\n url: `${API_USER_CONTACTS}`,\n headers,\n method: 'POST',\n body: JSON.stringify(data),\n });\n};\n\nexport const getUserContact = async (\n apiHost: string,\n params: {\n sessionId?: string;\n email?: string;\n }\n): Promise<any> => {\n return request({\n host: apiHost,\n url: `${API_USER_CONTACTS}/search`,\n method: 'GET',\n params: {\n sessionId: params?.sessionId || undefined,\n email: params?.email || undefined,\n },\n });\n};\n"]}
1
+ {"version":3,"file":"userContact.service.js","sourceRoot":"","sources":["../../src/services/userContact.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,IAAqB,EACrB,OAAe,EACD,EAAE;IAChB,MAAM,OAAO,GAAG;QACd,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,iBAAiB,EAAE;QAC3B,OAAO;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAAe,EACf,MAIC,EACa,EAAE;IAChB,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,GAAG,iBAAiB,SAAS;QAClC,MAAM,EAAE,KAAK;QACb,MAAM,EAAE;YACN,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,SAAS;YAC3B,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,SAAS;YACjC,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,SAAS;SACtC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { UserContactType } from '../types/userContact.type';\nimport { request } from '../utils/requestUtils';\nimport { API_USER_CONTACTS } from './apis';\n\nexport const createUserContact = async (\n data: UserContactType,\n apiHost: string\n): Promise<any> => {\n const headers = {\n 'Content-Type': 'application/json',\n };\n\n return request({\n host: apiHost,\n url: `${API_USER_CONTACTS}`,\n headers,\n method: 'POST',\n body: JSON.stringify(data),\n });\n};\n\nexport const getUserContact = async (\n apiHost: string,\n params: {\n id?: string;\n email?: string;\n contact?: string;\n }\n): Promise<any> => {\n return request({\n host: apiHost,\n url: `${API_USER_CONTACTS}/search`,\n method: 'GET',\n params: {\n id: params?.id || undefined,\n email: params?.email || undefined,\n contact: params?.contact || undefined,\n },\n });\n};\n"]}
@@ -1,9 +1,12 @@
1
1
  export interface BookMeetingType {
2
+ id?: string;
2
3
  startDate: string;
3
4
  startTime: string;
4
5
  duration: string;
5
6
  channel: string;
6
- host: string;
7
+ hostId: string;
7
8
  title: string;
9
+ chatId: string;
10
+ brand: string;
8
11
  }
9
12
  //# sourceMappingURL=bookMeeting.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bookMeeting.type.d.ts","sourceRoot":"","sources":["../../src/types/bookMeeting.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"bookMeeting.type.d.ts","sourceRoot":"","sources":["../../src/types/bookMeeting.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"bookMeeting.type.js","sourceRoot":"","sources":["../../src/types/bookMeeting.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface BookMeetingType {\n startDate: string;\n startTime: string;\n duration: string;\n channel: string;\n host: string;\n title: string;\n}\n"]}
1
+ {"version":3,"file":"bookMeeting.type.js","sourceRoot":"","sources":["../../src/types/bookMeeting.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface BookMeetingType {\n id?: string;\n startDate: string;\n startTime: string;\n duration: string;\n channel: string;\n hostId: string;\n title: string;\n chatId: string;\n brand: string;\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  export interface UserContactType {
2
- sessionId: string;
3
2
  name: {
4
3
  firstName: string;
5
4
  lastName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"userContact.type.d.ts","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;CACH"}
1
+ {"version":3,"file":"userContact.type.d.ts","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"userContact.type.js","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface UserContactType {\n sessionId: string;\n name: {\n firstName: string;\n lastName?: string;\n };\n emails?: {\n primaryEmail?: string;\n };\n phones?: {\n primaryPhoneNumber?: string;\n primaryPhoneCountryCode?: string;\n primaryPhoneCallingCode?: string;\n };\n}\n"]}
1
+ {"version":3,"file":"userContact.type.js","sourceRoot":"","sources":["../../src/types/userContact.type.ts"],"names":[],"mappings":"","sourcesContent":["export interface UserContactType {\n name: {\n firstName: string;\n lastName?: string;\n };\n emails?: {\n primaryEmail?: string;\n };\n phones?: {\n primaryPhoneNumber?: string;\n primaryPhoneCountryCode?: string;\n primaryPhoneCallingCode?: string;\n };\n}\n"]}
@@ -371,7 +371,7 @@ export function parseTraceEventMessage(rawMessage) {
371
371
  const nodeInfo = finishedNodes
372
372
  .map((node) => `${node.nodeLabel} (${node.nodeId})`)
373
373
  .join(', ');
374
- const content = `Multi-agent workflow completed successfully • Executed: ${nodeInfo}`;
374
+ const content = `Multi-agent workflow completed successfully`;
375
375
  return {
376
376
  id: `workflow-summary-${Date.now()}`,
377
377
  type: 'agent_flow_complete',
@@ -1 +1 @@
1
- {"version":3,"file":"agentTraceUtils.js","sourceRoot":"","sources":["../../src/utils/agentTraceUtils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAmB;IACvD,MAAM,KAAK,GAAgB,EAAE,CAAC;IAE9B,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB;gBAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAoB,CAAC;gBAE3D,IAAI,UAAU,CAAC,KAAK,KAAK,aAAa,IAAI,UAAU,CAAC,IAAI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AAsC,EAAE,KAAK,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { AgentStep, AgentTraceEvent } from 'types/flowise.type';\n\n/**\n * Parse agent trace events from streaming data and convert to AgentStep format\n */\nexport function parseAgentTraceEvents(traceData: string[]): AgentStep[] {\n const steps: AgentStep[] = [];\n\n traceData.forEach((data, index) => {\n try {\n // Parse the trace event data\n if (data.startsWith('data:')) {\n const jsonData = data.substring(5); // Remove 'data:' prefix\n const traceEvent = JSON.parse(jsonData) as AgentTraceEvent;\n\n if (traceEvent.event === 'agent_trace' && traceEvent.data) {\n const { step, action, name, input, output, runId, parentRunId } =\n traceEvent.data;\n\n let stepType: 'agent_action' | 'tool_start' | 'tool_end' =\n 'agent_action';\n let content = '';\n let toolName = '';\n let toolInput: any = null;\n let toolOutput: any = null;\n\n switch (step) {\n case 'agent_action':\n stepType = 'agent_action';\n content = action || 'Agent action';\n // Try to extract tool information from action\n try {\n if (action) {\n const actionData = JSON.parse(action);\n if (actionData.tool) {\n toolName = actionData.tool;\n toolInput = actionData.toolInput;\n }\n }\n } catch {\n // If parsing fails, use action as-is\n content = action || 'Agent taking action';\n }\n break;\n\n case 'tool_start':\n stepType = 'tool_start';\n toolName = name || 'unknown-tool';\n content = `Starting ${toolName}`;\n try {\n toolInput = input ? JSON.parse(input) : null;\n } catch {\n toolInput = input;\n }\n break;\n\n case 'tool_end':\n stepType = 'tool_end';\n toolName = name || 'unknown-tool';\n content = `Completed ${toolName}`;\n try {\n toolOutput = output ? JSON.parse(output) : null;\n } catch {\n toolOutput = output;\n }\n break;\n\n default:\n content = action || step || 'Unknown step';\n }\n\n steps.push({\n id: `${runId}-${index}`,\n type: stepType,\n content,\n timestamp: Date.now(),\n toolName: toolName || undefined,\n toolInput,\n toolOutput,\n runId,\n parentRunId,\n });\n }\n }\n } catch (error) {\n console.warn('Failed to parse agent trace event:', error);\n }\n });\n\n return steps;\n}\n\n/**\n * Group agent steps by their parent-child relationships\n * Agent actions become parent groups with their related tool steps as children\n */\nexport function groupChatflowSteps(steps: AgentStep[]): AgentStep[] {\n const grouped: AgentStep[] = [];\n const stepMap = new Map<string, AgentStep>();\n // First, create a map of all steps by their runId\n const getKey = (id: string, step: AgentStep) => {\n return `${id}-${step.toolName}-${JSON.stringify(step.toolInput)}`;\n };\n steps.forEach((step) => {\n if (step.runId && !step.parentRunId) {\n stepMap.set(getKey(step.runId, step), { ...step });\n }\n });\n\n // Process steps to build parent-child relationships\n steps.forEach((step) => {\n let parentStep;\n if (step.parentRunId) {\n parentStep = stepMap.get(getKey(step.parentRunId, step));\n if (parentStep) {\n // Initialize childSteps array if it doesn't exist\n if (!parentStep.childSteps) {\n parentStep.childSteps = [];\n }\n // Add this step as a child\n parentStep.childSteps.push(step);\n }\n } else {\n if (step.runId) {\n parentStep = stepMap.get(getKey(step.runId, step));\n if (parentStep) {\n grouped.push(parentStep);\n }\n }\n }\n });\n\n return grouped;\n}\n\n/**\n * Group AgentFlow steps by nodeId to show individual node execution\n * Groups steps by their nodeId to show each node's start and completion\n */\nexport function groupAgentFlowSteps(steps: AgentStep[]): AgentStep[] {\n const grouped: AgentStep[] = [];\n const nodeMap = new Map<string, AgentStep>();\n\n steps.forEach((step) => {\n if (step.nodeId) {\n const existingNode = nodeMap.get(step.nodeId);\n\n if (!existingNode) {\n // Create a new node group\n const nodeGroup: AgentStep = {\n ...step,\n id: `${step.nodeId}-group`,\n content: step.content,\n childSteps: [{ ...step }],\n };\n nodeMap.set(step.nodeId, nodeGroup);\n grouped.push(nodeGroup);\n } else {\n // Add step to existing node group\n if (!existingNode.childSteps) {\n existingNode.childSteps = [];\n }\n existingNode.childSteps.push({ ...step });\n\n // Update parent with latest step data (for completion status)\n if (step.type === 'agent_flow_complete') {\n existingNode.type = 'agent_flow_complete';\n existingNode.content = step.content;\n existingNode.toolOutput = step.toolOutput;\n existingNode.executedNodes = step.executedNodes;\n existingNode.usageMetadata = step.usageMetadata;\n existingNode.nodeData = step.nodeData;\n }\n }\n } else {\n // For workflow-level events without nodeId, add directly\n grouped.push({ ...step });\n }\n });\n return grouped;\n}\n\n/**\n * Parse a single trace event message from SSE stream\n */\nexport function parseTraceEventMessage(rawMessage: string): AgentStep | null {\n try {\n // Handle both formats: raw \"data:...\" string or direct chunk object\n let traceEvent: any;\n\n if (typeof rawMessage === 'string' && rawMessage.startsWith('data:')) {\n const jsonData = rawMessage.substring(5);\n traceEvent = JSON.parse(jsonData);\n } else if (typeof rawMessage === 'object') {\n traceEvent = rawMessage;\n } else {\n return null;\n }\n\n if (!traceEvent.event || !traceEvent.data) {\n return null;\n }\n\n // Handle AgentFlow events\n if (traceEvent.event === 'agentFlowEvent') {\n return {\n id: `agentflow-${Date.now()}`,\n type:\n traceEvent.data === 'INPROGRESS'\n ? 'agent_flow_start'\n : 'agent_flow_complete',\n content:\n traceEvent.data === 'INPROGRESS'\n ? 'Starting multi-agent workflow...'\n : 'Completed multi-agent workflow',\n timestamp: Date.now(),\n status: traceEvent.data,\n };\n }\n\n if (traceEvent.event === 'nextAgentFlow') {\n const { nodeId, nodeLabel, status } = traceEvent.data;\n\n // Generate more detailed content based on status and node type\n let content = '';\n let processingInfo = '';\n\n if (status === 'INPROGRESS') {\n // Determine node type based on nodeId or nodeLabel patterns\n if (nodeId.includes('start')) {\n content = `🚀 Starting ${nodeLabel} • Initializing workflow entry point`;\n processingInfo = 'Preparing workflow execution environment';\n } else if (nodeId.includes('agent')) {\n content = `🤖 Starting ${nodeLabel} • Processing agent logic`;\n processingInfo = 'Executing AI agent reasoning and decision making';\n } else if (nodeId.includes('function')) {\n content = `⚙️ Starting ${nodeLabel} • Executing custom logic`;\n processingInfo = 'Running custom function implementation';\n } else if (nodeId.includes('condition')) {\n content = `🔀 Starting ${nodeLabel} • Evaluating conditions`;\n processingInfo = 'Analyzing input to determine routing path';\n } else {\n content = `⏳ Starting ${nodeLabel} • Processing node execution`;\n processingInfo = 'Executing node-specific operations';\n }\n } else if (status === 'FINISHED') {\n // Success completion messages\n if (nodeId.includes('start')) {\n content = `✅ ${nodeLabel} completed • Workflow initialized successfully`;\n processingInfo = 'Ready to proceed to next workflow step';\n } else if (nodeId.includes('agent')) {\n content = `✅ ${nodeLabel} completed • Agent processing finished`;\n processingInfo = 'AI reasoning complete, results available';\n } else if (nodeId.includes('function')) {\n content = `✅ ${nodeLabel} completed • Function executed successfully`;\n processingInfo = 'Custom logic processing completed';\n } else if (nodeId.includes('condition')) {\n content = `✅ ${nodeLabel} completed • Condition evaluation finished`;\n processingInfo =\n 'Routing decision made, proceeding with selected path';\n } else {\n content = `✅ ${nodeLabel} completed • Node execution finished`;\n processingInfo = 'Processing completed successfully';\n }\n } else {\n // Handle other status types\n content = `${status} ${nodeLabel} • Status: ${status}`;\n processingInfo = `Node status updated to ${status}`;\n }\n\n return {\n id: `${nodeId}-${Date.now()}`,\n type: 'agent_flow_progress',\n content,\n timestamp: Date.now(),\n nodeId,\n nodeLabel,\n status,\n // Add processing info as additional metadata\n toolOutput: processingInfo,\n };\n }\n\n if (traceEvent.event === 'calledTools') {\n // Parse called tools data to show tool invocations\n let toolsData: any[] = [];\n\n try {\n // The data comes as a JSON string containing an array of tool calls\n if (typeof traceEvent.data === 'string') {\n toolsData = JSON.parse(traceEvent.data);\n } else if (Array.isArray(traceEvent.data)) {\n toolsData = traceEvent.data;\n }\n\n if (Array.isArray(toolsData) && toolsData.length > 0) {\n // Create a step for each tool call\n const toolCall = toolsData[0]; // Focus on the first tool call for the main step\n const { name, args, id, type } = toolCall;\n\n // Generate readable content based on tool name and arguments\n let content = `🔧 Calling tool: ${name}`;\n let processingInfo = `Executing ${name} with provided parameters`;\n\n // Add context based on tool name\n if (name === 'knowledge_doc_ci') {\n const query = args?.input || 'unknown query';\n content = `🔍 Searching knowledge base for: \"${query}\"`;\n processingInfo =\n 'Retrieving relevant information from the knowledge database';\n } else if (name === 'showroom_products_search') {\n const query = args?.textQuery || 'products';\n content = `🛍️ Searching products for: \"${query}\"`;\n processingInfo =\n 'Finding matching products in the showroom catalog';\n } else if (name.includes('search') || name.includes('retriever')) {\n const query = args?.input || args?.query || 'information';\n content = `🔍 Searching for: \"${query}\"`;\n processingInfo = 'Performing search operation';\n }\n\n return {\n id: `tool-call-${id || Date.now()}`,\n type: 'tool_start',\n content,\n timestamp: Date.now(),\n toolName: name,\n toolInput: args,\n toolOutput: processingInfo,\n // Store additional tool call metadata\n toolCallId: id,\n toolCallType: type,\n // Store all tool calls if multiple\n allToolCalls: toolsData.length > 1 ? toolsData : undefined,\n };\n }\n } catch (error) {\n console.warn('Failed to parse calledTools data:', error);\n return {\n id: `tool-call-${Date.now()}`,\n type: 'tool_start',\n content: '🔧 Tool invocation in progress',\n timestamp: Date.now(),\n toolOutput: 'Processing tool execution...',\n };\n }\n }\n\n if (traceEvent.event === 'agentFlowExecutedData') {\n // Parse executed data for completion summary with detailed info\n const executedNodes = traceEvent.data;\n if (Array.isArray(executedNodes)) {\n const finishedNodes = executedNodes.filter(\n (node) => node.status === 'FINISHED'\n );\n\n // Extract detailed information from the last completed node\n const lastNode = finishedNodes[finishedNodes.length - 1];\n let nodeData = {};\n let usageMetadata = {};\n\n if (lastNode?.data) {\n // Extract comprehensive node data\n nodeData = {\n input: lastNode.data.input,\n output: lastNode.data.output,\n availableTools: lastNode.data.availableTools || [],\n chatHistory: lastNode.data.chatHistory || [],\n // Additional data from the agent configuration\n agentModel: lastNode.data.input?.agentModel,\n agentTools: lastNode.data.input?.agentTools || [],\n modelConfig: lastNode.data.input?.agentModelConfig,\n };\n\n // Extract usage metadata from multiple sources\n if (lastNode.data.output?.usageMetadata) {\n usageMetadata = lastNode.data.output.usageMetadata;\n } else if (lastNode.data.output?.responseMetadata?.usage) {\n // Alternative usage metadata format\n const { usage } = lastNode.data.output.responseMetadata;\n usageMetadata = {\n input_tokens: usage.prompt_tokens,\n output_tokens: usage.completion_tokens,\n total_tokens: usage.total_tokens,\n };\n }\n }\n\n // Create content with more details\n const nodeInfo = finishedNodes\n .map((node) => `${node.nodeLabel} (${node.nodeId})`)\n .join(', ');\n const content = `Multi-agent workflow completed successfully • Executed: ${nodeInfo}`;\n\n return {\n id: `workflow-summary-${Date.now()}`,\n type: 'agent_flow_complete',\n content,\n timestamp: Date.now(),\n toolOutput: executedNodes,\n nodeData,\n usageMetadata,\n // Store individual node details for expanded view\n executedNodes: finishedNodes.map((node) => ({\n nodeId: node.nodeId,\n nodeLabel: node.nodeLabel,\n input: node.data?.input,\n output: node.data?.output,\n status: node.status,\n availableTools: node.data?.availableTools?.length || 0,\n usageMetadata: node.data?.output?.usageMetadata,\n })),\n };\n }\n }\n\n // Handle original agent_trace events\n if (traceEvent.event !== 'agent_trace' || !traceEvent.data) {\n return null;\n }\n\n const { step, action, name, input, output, runId, parentRunId } =\n traceEvent.data;\n\n let stepType: 'agent_action' | 'tool_start' | 'tool_end' = 'agent_action';\n let content = '';\n let toolName = '';\n let toolInput: any = null;\n let toolOutput: any = null;\n\n switch (step) {\n case 'agent_action':\n stepType = 'agent_action';\n try {\n if (action) {\n const actionData = JSON.parse(action);\n if (actionData.tool) {\n toolName = actionData.tool;\n toolInput = actionData.toolInput;\n content = `Using tool: ${actionData.tool}`;\n\n // Extract additional information if available\n if (actionData.log) {\n content = actionData.log.replace(/\\\\n/g, ' ').trim();\n }\n } else {\n content = action;\n }\n } else {\n content = 'Agent taking action';\n }\n } catch {\n content = action || 'Agent taking action';\n }\n break;\n\n case 'tool_start':\n stepType = 'tool_start';\n toolName = name || 'unknown-tool';\n content = `Starting ${toolName}`;\n try {\n toolInput = input ? JSON.parse(input) : null;\n } catch {\n toolInput = input;\n }\n break;\n\n case 'tool_end':\n stepType = 'tool_end';\n toolName = name || 'unknown-tool';\n content = `Completed ${toolName}`;\n try {\n // Handle the complex nested output structure from your example\n if (output) {\n const outputArray = JSON.parse(output);\n if (Array.isArray(outputArray) && outputArray[0]?.text) {\n try {\n // Try to parse the nested JSON in the text field\n const nestedData = JSON.parse(outputArray[0].text);\n toolOutput = nestedData;\n } catch {\n // If nested parsing fails, use the text as-is\n toolOutput = outputArray[0].text;\n }\n } else {\n toolOutput = outputArray;\n }\n }\n } catch {\n toolOutput = output;\n }\n break;\n\n default:\n content = action || step || 'Unknown step';\n }\n\n return {\n id: `${runId}-${Date.now()}`,\n type: stepType,\n content,\n timestamp: Date.now(),\n toolName: toolName || undefined,\n toolInput,\n toolOutput,\n runId,\n parentRunId,\n };\n } catch (error) {\n console.warn('Failed to parse trace event message:', error);\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"agentTraceUtils.js","sourceRoot":"","sources":["../../src/utils/agentTraceUtils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAmB;IACvD,MAAM,KAAK,GAAgB,EAAE,CAAC;IAE9B,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,CAAC;YACH,6BAA6B;YAC7B,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB;gBAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAoB,CAAC;gBAE3D,IAAI,UAAU,CAAC,KAAK,KAAK,aAAa,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;oBAC1D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAC7D,UAAU,CAAC,IAAI,CAAC;oBAElB,IAAI,QAAQ,GACV,cAAc,CAAC;oBACjB,IAAI,OAAO,GAAG,EAAE,CAAC;oBACjB,IAAI,QAAQ,GAAG,EAAE,CAAC;oBAClB,IAAI,SAAS,GAAQ,IAAI,CAAC;oBAC1B,IAAI,UAAU,GAAQ,IAAI,CAAC;oBAE3B,QAAQ,IAA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E,CAAC;4BACvD,IAAI,CAAC;gCACH,iDAAiD;gCACjD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gCACnD,UAAU,GAAG,UAAU,CAAC;4BAC1B,CAAC;4BAAC,MAAM,CAAC;gCACP,8CAA8C;gCAC9C,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;4BACnC,CAAC;wBACH,CAAC;6BAAM,CAAC;4BACN,UAAU,GAAG,WAAW,CAAC;wBAC3B,CAAC;oBACH,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,UAAU,GAAG,MAAM,CAAC;gBACtB,CAAC;gBACD,MAAM;YAER;gBACE,OAAO,GAAG,MAAM,IAAI,IAAI,IAAI,cAAc,CAAC;QAC/C,CAAC;QAED,OAAO;YACL,EAAE,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE;YAC5B,IAAI,EAAE,QAAQ;YACd,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,QAAQ,EAAE,QAAQ,IAAI,SAAS;YAC/B,SAAS;YACT,UAAU;YACV,KAAK;YACL,WAAW;SACZ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { AgentStep, AgentTraceEvent } from 'types/flowise.type';\n\n/**\n * Parse agent trace events from streaming data and convert to AgentStep format\n */\nexport function parseAgentTraceEvents(traceData: string[]): AgentStep[] {\n const steps: AgentStep[] = [];\n\n traceData.forEach((data, index) => {\n try {\n // Parse the trace event data\n if (data.startsWith('data:')) {\n const jsonData = data.substring(5); // Remove 'data:' prefix\n const traceEvent = JSON.parse(jsonData) as AgentTraceEvent;\n\n if (traceEvent.event === 'agent_trace' && traceEvent.data) {\n const { step, action, name, input, output, runId, parentRunId } =\n traceEvent.data;\n\n let stepType: 'agent_action' | 'tool_start' | 'tool_end' =\n 'agent_action';\n let content = '';\n let toolName = '';\n let toolInput: any = null;\n let toolOutput: any = null;\n\n switch (step) {\n case 'agent_action':\n stepType = 'agent_action';\n content = action || 'Agent action';\n // Try to extract tool information from action\n try {\n if (action) {\n const actionData = JSON.parse(action);\n if (actionData.tool) {\n toolName = actionData.tool;\n toolInput = actionData.toolInput;\n }\n }\n } catch {\n // If parsing fails, use action as-is\n content = action || 'Agent taking action';\n }\n break;\n\n case 'tool_start':\n stepType = 'tool_start';\n toolName = name || 'unknown-tool';\n content = `Starting ${toolName}`;\n try {\n toolInput = input ? JSON.parse(input) : null;\n } catch {\n toolInput = input;\n }\n break;\n\n case 'tool_end':\n stepType = 'tool_end';\n toolName = name || 'unknown-tool';\n content = `Completed ${toolName}`;\n try {\n toolOutput = output ? JSON.parse(output) : null;\n } catch {\n toolOutput = output;\n }\n break;\n\n default:\n content = action || step || 'Unknown step';\n }\n\n steps.push({\n id: `${runId}-${index}`,\n type: stepType,\n content,\n timestamp: Date.now(),\n toolName: toolName || undefined,\n toolInput,\n toolOutput,\n runId,\n parentRunId,\n });\n }\n }\n } catch (error) {\n console.warn('Failed to parse agent trace event:', error);\n }\n });\n\n return steps;\n}\n\n/**\n * Group agent steps by their parent-child relationships\n * Agent actions become parent groups with their related tool steps as children\n */\nexport function groupChatflowSteps(steps: AgentStep[]): AgentStep[] {\n const grouped: AgentStep[] = [];\n const stepMap = new Map<string, AgentStep>();\n // First, create a map of all steps by their runId\n const getKey = (id: string, step: AgentStep) => {\n return `${id}-${step.toolName}-${JSON.stringify(step.toolInput)}`;\n };\n steps.forEach((step) => {\n if (step.runId && !step.parentRunId) {\n stepMap.set(getKey(step.runId, step), { ...step });\n }\n });\n\n // Process steps to build parent-child relationships\n steps.forEach((step) => {\n let parentStep;\n if (step.parentRunId) {\n parentStep = stepMap.get(getKey(step.parentRunId, step));\n if (parentStep) {\n // Initialize childSteps array if it doesn't exist\n if (!parentStep.childSteps) {\n parentStep.childSteps = [];\n }\n // Add this step as a child\n parentStep.childSteps.push(step);\n }\n } else {\n if (step.runId) {\n parentStep = stepMap.get(getKey(step.runId, step));\n if (parentStep) {\n grouped.push(parentStep);\n }\n }\n }\n });\n\n return grouped;\n}\n\n/**\n * Group AgentFlow steps by nodeId to show individual node execution\n * Groups steps by their nodeId to show each node's start and completion\n */\nexport function groupAgentFlowSteps(steps: AgentStep[]): AgentStep[] {\n const grouped: AgentStep[] = [];\n const nodeMap = new Map<string, AgentStep>();\n\n steps.forEach((step) => {\n if (step.nodeId) {\n const existingNode = nodeMap.get(step.nodeId);\n\n if (!existingNode) {\n // Create a new node group\n const nodeGroup: AgentStep = {\n ...step,\n id: `${step.nodeId}-group`,\n content: step.content,\n childSteps: [{ ...step }],\n };\n nodeMap.set(step.nodeId, nodeGroup);\n grouped.push(nodeGroup);\n } else {\n // Add step to existing node group\n if (!existingNode.childSteps) {\n existingNode.childSteps = [];\n }\n existingNode.childSteps.push({ ...step });\n\n // Update parent with latest step data (for completion status)\n if (step.type === 'agent_flow_complete') {\n existingNode.type = 'agent_flow_complete';\n existingNode.content = step.content;\n existingNode.toolOutput = step.toolOutput;\n existingNode.executedNodes = step.executedNodes;\n existingNode.usageMetadata = step.usageMetadata;\n existingNode.nodeData = step.nodeData;\n }\n }\n } else {\n // For workflow-level events without nodeId, add directly\n grouped.push({ ...step });\n }\n });\n return grouped;\n}\n\n/**\n * Parse a single trace event message from SSE stream\n */\nexport function parseTraceEventMessage(rawMessage: string): AgentStep | null {\n try {\n // Handle both formats: raw \"data:...\" string or direct chunk object\n let traceEvent: any;\n\n if (typeof rawMessage === 'string' && rawMessage.startsWith('data:')) {\n const jsonData = rawMessage.substring(5);\n traceEvent = JSON.parse(jsonData);\n } else if (typeof rawMessage === 'object') {\n traceEvent = rawMessage;\n } else {\n return null;\n }\n\n if (!traceEvent.event || !traceEvent.data) {\n return null;\n }\n\n // Handle AgentFlow events\n if (traceEvent.event === 'agentFlowEvent') {\n return {\n id: `agentflow-${Date.now()}`,\n type:\n traceEvent.data === 'INPROGRESS'\n ? 'agent_flow_start'\n : 'agent_flow_complete',\n content:\n traceEvent.data === 'INPROGRESS'\n ? 'Starting multi-agent workflow...'\n : 'Completed multi-agent workflow',\n timestamp: Date.now(),\n status: traceEvent.data,\n };\n }\n\n if (traceEvent.event === 'nextAgentFlow') {\n const { nodeId, nodeLabel, status } = traceEvent.data;\n\n // Generate more detailed content based on status and node type\n let content = '';\n let processingInfo = '';\n\n if (status === 'INPROGRESS') {\n // Determine node type based on nodeId or nodeLabel patterns\n if (nodeId.includes('start')) {\n content = `🚀 Starting ${nodeLabel} • Initializing workflow entry point`;\n processingInfo = 'Preparing workflow execution environment';\n } else if (nodeId.includes('agent')) {\n content = `🤖 Starting ${nodeLabel} • Processing agent logic`;\n processingInfo = 'Executing AI agent reasoning and decision making';\n } else if (nodeId.includes('function')) {\n content = `⚙️ Starting ${nodeLabel} • Executing custom logic`;\n processingInfo = 'Running custom function implementation';\n } else if (nodeId.includes('condition')) {\n content = `🔀 Starting ${nodeLabel} • Evaluating conditions`;\n processingInfo = 'Analyzing input to determine routing path';\n } else {\n content = `⏳ Starting ${nodeLabel} • Processing node execution`;\n processingInfo = 'Executing node-specific operations';\n }\n } else if (status === 'FINISHED') {\n // Success completion messages\n if (nodeId.includes('start')) {\n content = `✅ ${nodeLabel} completed • Workflow initialized successfully`;\n processingInfo = 'Ready to proceed to next workflow step';\n } else if (nodeId.includes('agent')) {\n content = `✅ ${nodeLabel} completed • Agent processing finished`;\n processingInfo = 'AI reasoning complete, results available';\n } else if (nodeId.includes('function')) {\n content = `✅ ${nodeLabel} completed • Function executed successfully`;\n processingInfo = 'Custom logic processing completed';\n } else if (nodeId.includes('condition')) {\n content = `✅ ${nodeLabel} completed • Condition evaluation finished`;\n processingInfo =\n 'Routing decision made, proceeding with selected path';\n } else {\n content = `✅ ${nodeLabel} completed • Node execution finished`;\n processingInfo = 'Processing completed successfully';\n }\n } else {\n // Handle other status types\n content = `${status} ${nodeLabel} • Status: ${status}`;\n processingInfo = `Node status updated to ${status}`;\n }\n\n return {\n id: `${nodeId}-${Date.now()}`,\n type: 'agent_flow_progress',\n content,\n timestamp: Date.now(),\n nodeId,\n nodeLabel,\n status,\n // Add processing info as additional metadata\n toolOutput: processingInfo,\n };\n }\n\n if (traceEvent.event === 'calledTools') {\n // Parse called tools data to show tool invocations\n let toolsData: any[] = [];\n\n try {\n // The data comes as a JSON string containing an array of tool calls\n if (typeof traceEvent.data === 'string') {\n toolsData = JSON.parse(traceEvent.data);\n } else if (Array.isArray(traceEvent.data)) {\n toolsData = traceEvent.data;\n }\n\n if (Array.isArray(toolsData) && toolsData.length > 0) {\n // Create a step for each tool call\n const toolCall = toolsData[0]; // Focus on the first tool call for the main step\n const { name, args, id, type } = toolCall;\n\n // Generate readable content based on tool name and arguments\n let content = `🔧 Calling tool: ${name}`;\n let processingInfo = `Executing ${name} with provided parameters`;\n\n // Add context based on tool name\n if (name === 'knowledge_doc_ci') {\n const query = args?.input || 'unknown query';\n content = `🔍 Searching knowledge base for: \"${query}\"`;\n processingInfo =\n 'Retrieving relevant information from the knowledge database';\n } else if (name === 'showroom_products_search') {\n const query = args?.textQuery || 'products';\n content = `🛍️ Searching products for: \"${query}\"`;\n processingInfo =\n 'Finding matching products in the showroom catalog';\n } else if (name.includes('search') || name.includes('retriever')) {\n const query = args?.input || args?.query || 'information';\n content = `🔍 Searching for: \"${query}\"`;\n processingInfo = 'Performing search operation';\n }\n\n return {\n id: `tool-call-${id || Date.now()}`,\n type: 'tool_start',\n content,\n timestamp: Date.now(),\n toolName: name,\n toolInput: args,\n toolOutput: processingInfo,\n // Store additional tool call metadata\n toolCallId: id,\n toolCallType: type,\n // Store all tool calls if multiple\n allToolCalls: toolsData.length > 1 ? toolsData : undefined,\n };\n }\n } catch (error) {\n console.warn('Failed to parse calledTools data:', error);\n return {\n id: `tool-call-${Date.now()}`,\n type: 'tool_start',\n content: '🔧 Tool invocation in progress',\n timestamp: Date.now(),\n toolOutput: 'Processing tool execution...',\n };\n }\n }\n\n if (traceEvent.event === 'agentFlowExecutedData') {\n // Parse executed data for completion summary with detailed info\n const executedNodes = traceEvent.data;\n if (Array.isArray(executedNodes)) {\n const finishedNodes = executedNodes.filter(\n (node) => node.status === 'FINISHED'\n );\n\n // Extract detailed information from the last completed node\n const lastNode = finishedNodes[finishedNodes.length - 1];\n let nodeData = {};\n let usageMetadata = {};\n\n if (lastNode?.data) {\n // Extract comprehensive node data\n nodeData = {\n input: lastNode.data.input,\n output: lastNode.data.output,\n availableTools: lastNode.data.availableTools || [],\n chatHistory: lastNode.data.chatHistory || [],\n // Additional data from the agent configuration\n agentModel: lastNode.data.input?.agentModel,\n agentTools: lastNode.data.input?.agentTools || [],\n modelConfig: lastNode.data.input?.agentModelConfig,\n };\n\n // Extract usage metadata from multiple sources\n if (lastNode.data.output?.usageMetadata) {\n usageMetadata = lastNode.data.output.usageMetadata;\n } else if (lastNode.data.output?.responseMetadata?.usage) {\n // Alternative usage metadata format\n const { usage } = lastNode.data.output.responseMetadata;\n usageMetadata = {\n input_tokens: usage.prompt_tokens,\n output_tokens: usage.completion_tokens,\n total_tokens: usage.total_tokens,\n };\n }\n }\n\n // Create content with more details\n const nodeInfo = finishedNodes\n .map((node) => `${node.nodeLabel} (${node.nodeId})`)\n .join(', ');\n const content = `Multi-agent workflow completed successfully`;\n\n return {\n id: `workflow-summary-${Date.now()}`,\n type: 'agent_flow_complete',\n content,\n timestamp: Date.now(),\n toolOutput: executedNodes,\n nodeData,\n usageMetadata,\n // Store individual node details for expanded view\n executedNodes: finishedNodes.map((node) => ({\n nodeId: node.nodeId,\n nodeLabel: node.nodeLabel,\n input: node.data?.input,\n output: node.data?.output,\n status: node.status,\n availableTools: node.data?.availableTools?.length || 0,\n usageMetadata: node.data?.output?.usageMetadata,\n })),\n };\n }\n }\n\n // Handle original agent_trace events\n if (traceEvent.event !== 'agent_trace' || !traceEvent.data) {\n return null;\n }\n\n const { step, action, name, input, output, runId, parentRunId } =\n traceEvent.data;\n\n let stepType: 'agent_action' | 'tool_start' | 'tool_end' = 'agent_action';\n let content = '';\n let toolName = '';\n let toolInput: any = null;\n let toolOutput: any = null;\n\n switch (step) {\n case 'agent_action':\n stepType = 'agent_action';\n try {\n if (action) {\n const actionData = JSON.parse(action);\n if (actionData.tool) {\n toolName = actionData.tool;\n toolInput = actionData.toolInput;\n content = `Using tool: ${actionData.tool}`;\n\n // Extract additional information if available\n if (actionData.log) {\n content = actionData.log.replace(/\\\\n/g, ' ').trim();\n }\n } else {\n content = action;\n }\n } else {\n content = 'Agent taking action';\n }\n } catch {\n content = action || 'Agent taking action';\n }\n break;\n\n case 'tool_start':\n stepType = 'tool_start';\n toolName = name || 'unknown-tool';\n content = `Starting ${toolName}`;\n try {\n toolInput = input ? JSON.parse(input) : null;\n } catch {\n toolInput = input;\n }\n break;\n\n case 'tool_end':\n stepType = 'tool_end';\n toolName = name || 'unknown-tool';\n content = `Completed ${toolName}`;\n try {\n // Handle the complex nested output structure from your example\n if (output) {\n const outputArray = JSON.parse(output);\n if (Array.isArray(outputArray) && outputArray[0]?.text) {\n try {\n // Try to parse the nested JSON in the text field\n const nestedData = JSON.parse(outputArray[0].text);\n toolOutput = nestedData;\n } catch {\n // If nested parsing fails, use the text as-is\n toolOutput = outputArray[0].text;\n }\n } else {\n toolOutput = outputArray;\n }\n }\n } catch {\n toolOutput = output;\n }\n break;\n\n default:\n content = action || step || 'Unknown step';\n }\n\n return {\n id: `${runId}-${Date.now()}`,\n type: stepType,\n content,\n timestamp: Date.now(),\n toolName: toolName || undefined,\n toolInput,\n toolOutput,\n runId,\n parentRunId,\n };\n } catch (error) {\n console.warn('Failed to parse trace event message:', error);\n return null;\n }\n}\n"]}
@@ -42,6 +42,12 @@ export declare const isDisplayContactFormTool: (toolName: string) => boolean;
42
42
  * @returns True if the is a display booking form tool
43
43
  */
44
44
  export declare const isDisplayBookingFormTool: (toolName: string) => boolean;
45
+ /**
46
+ * Check if a tool is a display booking list tool by prefix
47
+ * @param toolName - Tool name to check
48
+ * @returns True if the is a display booking list tool
49
+ */
50
+ export declare const isDisplayBookingListTool: (toolName: string) => boolean;
45
51
  /**
46
52
  * Check if a tool is a command tool
47
53
  * @param tool - Tool name to check
@@ -1 +1 @@
1
- {"version":3,"file":"toolUtils.d.ts","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,eAAe,eAAgB,GAAG,QAkB9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,aAAc,MAAM,UAAU,MAAM,KAAG,OAEhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAAc,MAAM,KAAG,OAI3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,aAAc,MAAM,KAAG,OAO7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,OAOzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAAc,MAAM,KAAG,OAK3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAAc,MAAM,KAAG,OAK3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,OAE5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,OAE5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,OAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,cAAe,SAAS,KAAG,OAGpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,OA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MAAM,cAAc,SAAU,MAAM,KAAG,OAK7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,cAAe,SAAS,KAAG,OAGpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,OAW3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,KAAG,OAOpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,cACf,SAAS,EAAE,iBACR,OAAO;;;;CAsBtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,cAAe,SAAS,EAAE,KAAG,OAK3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAC7B,MAAM,GAAG,SAAS,aAChB,SAAS,EAAE,KACrB,MAaF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { COMMAND_TOOL_VALUES, DISPLAY_BOOKING_FORM_TOOL_PREFIXES, DISPLAY_CONTACT_FORM_TOOL_PREFIXES, DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES, DISPLAY_GUIDED_TOURS_TOOL_PREFIXES, LOCATION_TOOLS, WEATHER_TOOLS, } from '../constants/toolNames';
1
+ import { COMMAND_TOOL_VALUES, DISPLAY_BOOKING_FORM_TOOL_PREFIXES, DISPLAY_BOOKING_LIST_TOOL_PREFIXES, DISPLAY_CONTACT_FORM_TOOL_PREFIXES, DISPLAY_GUIDED_TOURS_TOOL_PREFIXES, DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES, LOCATION_TOOLS, WEATHER_TOOLS } from '../constants/toolNames';
2
2
  /**
3
3
  * Parse tool output data from JSON string
4
4
  * @param outputData - The tool output data to parse
@@ -38,7 +38,7 @@ export const hasToolPrefix = (toolName, prefix) => {
38
38
  * @returns True if the tool is a product list tool
39
39
  */
40
40
  export const isDisplayProductListTool = (toolName) => {
41
- return (hasToolPrefix(toolName, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS));
41
+ return hasToolPrefix(toolName, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS);
42
42
  };
43
43
  /**
44
44
  * Check if a tool is a product detail tool by prefix
@@ -46,7 +46,7 @@ export const isDisplayProductListTool = (toolName) => {
46
46
  * @returns True if the tool is a product detail tool
47
47
  */
48
48
  export const isDisplayProductDetailTool = (toolName) => {
49
- return (hasToolPrefix(toolName, DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT));
49
+ return hasToolPrefix(toolName, DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT);
50
50
  };
51
51
  /**
52
52
  * Check if a tool is a scenarios tool by prefix
@@ -54,7 +54,7 @@ export const isDisplayProductDetailTool = (toolName) => {
54
54
  * @returns True if the tool is a scenarios tool
55
55
  */
56
56
  export const isDisplayScenariosTool = (toolName) => {
57
- return (hasToolPrefix(toolName, DISPLAY_GUIDED_TOURS_TOOL_PREFIXES.DISPLAY_GUIDED_TOURS));
57
+ return hasToolPrefix(toolName, DISPLAY_GUIDED_TOURS_TOOL_PREFIXES.DISPLAY_GUIDED_TOURS);
58
58
  };
59
59
  /**
60
60
  * Check if a tool is a display contact form tool by prefix
@@ -72,6 +72,14 @@ export const isDisplayContactFormTool = (toolName) => {
72
72
  export const isDisplayBookingFormTool = (toolName) => {
73
73
  return hasToolPrefix(toolName, DISPLAY_BOOKING_FORM_TOOL_PREFIXES.DISPLAY_BOOKING_FORM);
74
74
  };
75
+ /**
76
+ * Check if a tool is a display booking list tool by prefix
77
+ * @param toolName - Tool name to check
78
+ * @returns True if the is a display booking list tool
79
+ */
80
+ export const isDisplayBookingListTool = (toolName) => {
81
+ return hasToolPrefix(toolName, DISPLAY_BOOKING_LIST_TOOL_PREFIXES.DISPLAY_BOOKINGS);
82
+ };
75
83
  /**
76
84
  * Check if a tool is a command tool
77
85
  * @param tool - Tool name to check
@@ -118,7 +126,8 @@ export const isCustomTool = (tool) => {
118
126
  isDisplayProductDetailTool(tool) ||
119
127
  isDisplayScenariosTool(tool) ||
120
128
  isDisplayBookingFormTool(tool) ||
121
- isDisplayContactFormTool(tool));
129
+ isDisplayContactFormTool(tool) ||
130
+ isDisplayBookingListTool(tool));
122
131
  };
123
132
  /**
124
133
  * Check if a tool should focus the tool output (hide message content)
@@ -1 +1 @@
1
- {"version":3,"file":"toolUtils.js","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,kCAAkC,EAClC,kCAAkC,EAClC,cAAc,EACd,aAAa,GACd,MAAM,wBAAwB,CAAC;AAGhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAe,EAAE,EAAE;IACjD,IAAI,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,IAAI,GAAG,QAAQ,CAAC;QACpB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,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":["import {\n COMMAND_TOOL_VALUES,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES,\n DISPLAY_GUIDED_TOURS_TOOL_PREFIXES,\n LOCATION_TOOLS,\n WEATHER_TOOLS,\n} from '../constants/toolNames';\nimport { ToolUsage } from '../types/flowise.type';\n\n/**\n * Parse tool output data from JSON string\n * @param outputData - The tool output data to parse\n * @returns Parsed JSON object or null if parsing fails\n */\nexport const parseToolOutput = (outputData: any) => {\n try {\n if (!outputData) {\n return null;\n }\n \n const jsonData = JSON.parse(outputData);\n let data = jsonData;\n if (Array.isArray(jsonData)) {\n data = jsonData[0];\n }\n if (data.type === 'text') {\n return JSON.parse(data.text);\n }\n return data;\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Check if a tool name matches a specific prefix\n * @param toolName - Tool name to check\n * @param prefix - Prefix to match against\n * @returns True if the tool name starts with the prefix\n */\nexport const hasToolPrefix = (toolName: string, prefix: string): boolean => {\n return toolName.startsWith(prefix);\n};\n\n/**\n * Check if a tool is a product list tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product list tool\n */\nexport const isDisplayProductListTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(toolName, DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS)\n );\n};\n\n/**\n * Check if a tool is a product detail tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product detail tool\n */\nexport const isDisplayProductDetailTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT\n )\n );\n};\n\n/**\n * Check if a tool is a scenarios tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a scenarios tool\n */\nexport const isDisplayScenariosTool = (toolName: string): boolean => {\n return (\n hasToolPrefix(\n toolName,\n DISPLAY_GUIDED_TOURS_TOOL_PREFIXES.DISPLAY_GUIDED_TOURS\n )\n );\n};\n\n/**\n * Check if a tool is a display contact form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a display contact form tool\n */\nexport const isDisplayContactFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES.DISPLAY_CONTACT_FORM\n );\n};\n\n/**\n * Check if a tool is a display booking form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the is a display booking form tool\n */\nexport const isDisplayBookingFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES.DISPLAY_BOOKING_FORM\n );\n};\n\n/**\n * Check if a tool is a command tool\n * @param tool - Tool name to check\n * @returns True if the tool is a command tool\n */\nexport const isCommandTool = (tool: string): boolean => {\n return COMMAND_TOOL_VALUES.includes(tool as any);\n};\n\n/**\n * Check if a tool is a weather tool\n * @param tool - Tool name to check\n * @returns True if the tool is a weather tool\n */\nexport const isWeatherTool = (tool: string): boolean => {\n return tool === WEATHER_TOOLS.GET_WEATHER;\n};\n\n/**\n * Check if a tool is a location tool\n * @param tool - Tool name to check\n * @returns True if the tool is a location tool\n */\nexport const isLocationTool = (tool: string): boolean => {\n return (\n tool === LOCATION_TOOLS.GET_ASSIGNED_LOCATION_DETAIL ||\n tool === LOCATION_TOOLS.SEARCH_TRAVELING_PLACES\n );\n};\n\n/**\n * Check if a tool usage contains HTML content\n * @param toolUsage - The tool usage object to check\n * @returns True if the tool contains HTML content\n */\nexport const isHtmlContent = (toolUsage: ToolUsage): boolean => {\n const outputData = parseToolOutput(toolUsage.toolOutput);\n return outputData?.type === 'HTML';\n};\n\n/**\n * Check if a tool should be treated as a custom tool result\n * @param tool - Tool name to check\n * @returns True if the tool is a custom tool\n */\nexport const isCustomTool = (tool: string): boolean => {\n return (\n isWeatherTool(tool) ||\n isLocationTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool) ||\n isDisplayBookingFormTool(tool) ||\n isDisplayContactFormTool(tool)\n );\n};\n\n/**\n * Check if a tool should focus the tool output (hide message content)\n * @param tool - Tool name to check\n * @returns True if the tool should focus output\n */\nexport const shouldFocusToolOutput = (tool: string): boolean => {\n return (\n isCommandTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool)\n );\n};\n\n/**\n * Categorize tools from a list of tool usages\n * @param usedTools - Array of tool usages\n * @param isNewMessage - Whether this is a new message\n * @returns Categorized tools object\n */\nexport const categorizeTools = (\n usedTools: ToolUsage[],\n isNewMessage: boolean = false\n) => {\n const customToolResults: ToolUsage[] = [];\n const toolResults: ToolUsage[] = [];\n let cmdToolResult: ToolUsage | null = null;\n\n usedTools.forEach((usedTool) => {\n if (isCommandTool(usedTool.tool)) {\n if (isNewMessage) {\n cmdToolResult = usedTool;\n }\n } else if (isCustomTool(usedTool.tool) || isHtmlContent(usedTool)) {\n customToolResults.push(usedTool);\n } else {\n toolResults.push(usedTool);\n }\n });\n return {\n customToolResults,\n toolResults,\n cmdToolResult,\n };\n};\n\n/**\n * Check if any tool in the list should focus output\n * @param usedTools - Array of tool usages\n * @returns True if any tool should focus output\n */\nexport const hasFocusToolOutput = (usedTools: ToolUsage[]): boolean => {\n return usedTools.some(\n (usedTool) =>\n shouldFocusToolOutput(usedTool.tool) || isHtmlContent(usedTool)\n );\n};\n\n/**\n * Remove tool output from message content\n * @param content - Original message content (can be undefined)\n * @param usedTools - Array of tool usages\n * @returns Content with tool outputs removed, or empty string if content is undefined\n */\nexport const removeToolOutputFromContent = (\n content: string | undefined,\n usedTools: ToolUsage[]\n): string => {\n if (!content) {\n return '';\n }\n\n let cleanedContent = content;\n\n usedTools.forEach((tool) => {\n const { toolOutput } = tool;\n cleanedContent = cleanedContent?.replaceAll(toolOutput, '');\n });\n\n return cleanedContent;\n};"]}
1
+ {"version":3,"file":"toolUtils.js","sourceRoot":"","sources":["../../src/utils/toolUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EAClC,oCAAoC,EACpC,kCAAkC,EAClC,cAAc,EACd,aAAa,EACd,MAAM,wBAAwB,CAAC;AAGhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAe,EAAE,EAAE;IACjD,IAAI,CAAC;QACH,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,IAAI,GAAG,QAAQ,CAAC;QACpB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAW,EAAE;IACzE,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAW,EAAE;IACpE,OAAO,aAAa,CAClB,QAAQ,EACR,kCAAkC,CAAC,gBAAgB,CACpD,CAAC;AACJ,CAAC,CAAC;AA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DISPLAY_CONTACT_FORM_TOOL_PREFIXES,\n DISPLAY_GUIDED_TOURS_TOOL_PREFIXES,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES,\n LOCATION_TOOLS,\n WEATHER_TOOLS\n} from '../constants/toolNames';\nimport { ToolUsage } from '../types/flowise.type';\n\n/**\n * Parse tool output data from JSON string\n * @param outputData - The tool output data to parse\n * @returns Parsed JSON object or null if parsing fails\n */\nexport const parseToolOutput = (outputData: any) => {\n try {\n if (!outputData) {\n return null;\n }\n\n const jsonData = JSON.parse(outputData);\n let data = jsonData;\n if (Array.isArray(jsonData)) {\n data = jsonData[0];\n }\n if (data.type === 'text') {\n return JSON.parse(data.text);\n }\n return data;\n } catch (e) {\n return null;\n }\n};\n\n/**\n * Check if a tool name matches a specific prefix\n * @param toolName - Tool name to check\n * @param prefix - Prefix to match against\n * @returns True if the tool name starts with the prefix\n */\nexport const hasToolPrefix = (toolName: string, prefix: string): boolean => {\n return toolName.startsWith(prefix);\n};\n\n/**\n * Check if a tool is a product list tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product list tool\n */\nexport const isDisplayProductListTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_LIST_TOOL_PREFIXES.DISPLAY_PRODUCTS\n );\n};\n\n/**\n * Check if a tool is a product detail tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a product detail tool\n */\nexport const isDisplayProductDetailTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_PRODUCT_DETAIL_TOOL_PREFIXES.DISPLAY_PRODUCT\n );\n};\n\n/**\n * Check if a tool is a scenarios tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a scenarios tool\n */\nexport const isDisplayScenariosTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_GUIDED_TOURS_TOOL_PREFIXES.DISPLAY_GUIDED_TOURS\n );\n};\n\n/**\n * Check if a tool is a display contact form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the tool is a display contact form tool\n */\nexport const isDisplayContactFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_CONTACT_FORM_TOOL_PREFIXES.DISPLAY_CONTACT_FORM\n );\n};\n\n/**\n * Check if a tool is a display booking form tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the is a display booking form tool\n */\nexport const isDisplayBookingFormTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_BOOKING_FORM_TOOL_PREFIXES.DISPLAY_BOOKING_FORM\n );\n};\n\n/**\n * Check if a tool is a display booking list tool by prefix\n * @param toolName - Tool name to check\n * @returns True if the is a display booking list tool\n */\nexport const isDisplayBookingListTool = (toolName: string): boolean => {\n return hasToolPrefix(\n toolName,\n DISPLAY_BOOKING_LIST_TOOL_PREFIXES.DISPLAY_BOOKINGS\n );\n};\n\n/**\n * Check if a tool is a command tool\n * @param tool - Tool name to check\n * @returns True if the tool is a command tool\n */\nexport const isCommandTool = (tool: string): boolean => {\n return COMMAND_TOOL_VALUES.includes(tool as any);\n};\n\n/**\n * Check if a tool is a weather tool\n * @param tool - Tool name to check\n * @returns True if the tool is a weather tool\n */\nexport const isWeatherTool = (tool: string): boolean => {\n return tool === WEATHER_TOOLS.GET_WEATHER;\n};\n\n/**\n * Check if a tool is a location tool\n * @param tool - Tool name to check\n * @returns True if the tool is a location tool\n */\nexport const isLocationTool = (tool: string): boolean => {\n return (\n tool === LOCATION_TOOLS.GET_ASSIGNED_LOCATION_DETAIL ||\n tool === LOCATION_TOOLS.SEARCH_TRAVELING_PLACES\n );\n};\n\n/**\n * Check if a tool usage contains HTML content\n * @param toolUsage - The tool usage object to check\n * @returns True if the tool contains HTML content\n */\nexport const isHtmlContent = (toolUsage: ToolUsage): boolean => {\n const outputData = parseToolOutput(toolUsage.toolOutput);\n return outputData?.type === 'HTML';\n};\n\n/**\n * Check if a tool should be treated as a custom tool result\n * @param tool - Tool name to check\n * @returns True if the tool is a custom tool\n */\nexport const isCustomTool = (tool: string): boolean => {\n return (\n isWeatherTool(tool) ||\n isLocationTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool) ||\n isDisplayBookingFormTool(tool) ||\n isDisplayContactFormTool(tool) ||\n isDisplayBookingListTool(tool)\n );\n};\n\n/**\n * Check if a tool should focus the tool output (hide message content)\n * @param tool - Tool name to check\n * @returns True if the tool should focus output\n */\nexport const shouldFocusToolOutput = (tool: string): boolean => {\n return (\n isCommandTool(tool) ||\n isDisplayProductListTool(tool) ||\n isDisplayProductDetailTool(tool) ||\n isDisplayScenariosTool(tool)\n );\n};\n\n/**\n * Categorize tools from a list of tool usages\n * @param usedTools - Array of tool usages\n * @param isNewMessage - Whether this is a new message\n * @returns Categorized tools object\n */\nexport const categorizeTools = (\n usedTools: ToolUsage[],\n isNewMessage: boolean = false\n) => {\n const customToolResults: ToolUsage[] = [];\n const toolResults: ToolUsage[] = [];\n let cmdToolResult: ToolUsage | null = null;\n\n usedTools.forEach((usedTool) => {\n if (isCommandTool(usedTool.tool)) {\n if (isNewMessage) {\n cmdToolResult = usedTool;\n }\n } else if (isCustomTool(usedTool.tool) || isHtmlContent(usedTool)) {\n customToolResults.push(usedTool);\n } else {\n toolResults.push(usedTool);\n }\n });\n return {\n customToolResults,\n toolResults,\n cmdToolResult,\n };\n};\n\n/**\n * Check if any tool in the list should focus output\n * @param usedTools - Array of tool usages\n * @returns True if any tool should focus output\n */\nexport const hasFocusToolOutput = (usedTools: ToolUsage[]): boolean => {\n return usedTools.some(\n (usedTool) =>\n shouldFocusToolOutput(usedTool.tool) || isHtmlContent(usedTool)\n );\n};\n\n/**\n * Remove tool output from message content\n * @param content - Original message content (can be undefined)\n * @param usedTools - Array of tool usages\n * @returns Content with tool outputs removed, or empty string if content is undefined\n */\nexport const removeToolOutputFromContent = (\n content: string | undefined,\n usedTools: ToolUsage[]\n): string => {\n if (!content) {\n return '';\n }\n\n let cleanedContent = content;\n\n usedTools.forEach((tool) => {\n const { toolOutput } = tool;\n cleanedContent = cleanedContent?.replaceAll(toolOutput, '');\n });\n\n return cleanedContent;\n};\n"]}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { BookMeetingType } from 'types/bookMeeting.type';
3
+ import { UserContactType } from 'types/userContact.type';
4
+ interface Props {
5
+ hostData?: UserContactType;
6
+ booking: BookMeetingType;
7
+ loading: boolean;
8
+ theme?: Record<string, any>;
9
+ }
10
+ declare const BookMeetingDetail: FC<Props>;
11
+ export default BookMeetingDetail;
12
+ //# sourceMappingURL=BookMeetingDetail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BookMeetingDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/BookMeetingDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQzD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAyGhC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,4 +1,8 @@
1
1
  import { FC } from 'react';
2
- declare const BookMeetingForm: FC;
2
+ type PropsType = {
3
+ chatId: string;
4
+ brandAlias: string;
5
+ };
6
+ declare const BookMeetingForm: FC<PropsType>;
3
7
  export default BookMeetingForm;
4
8
  //# sourceMappingURL=BookMeetingForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookMeetingForm.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/BookMeetingForm.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAUhD,QAAA,MAAM,eAAe,EAAE,EAgWtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"BookMeetingForm.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/BookMeetingForm.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAUhD,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,SAAS,CAqWlC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ apiHost: string;
4
+ userId?: string;
5
+ theme?: Record<string, any>;
6
+ }
7
+ declare const BookMeetingList: FC<Props>;
8
+ export default BookMeetingList;
9
+ //# sourceMappingURL=BookMeetingList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BookMeetingList.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/BookMeetingList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAgC,MAAM,OAAO,CAAC;AAQzD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,KAAK,CAgG9B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ declare const LoadingComponent: FC;
3
+ export default LoadingComponent;
4
+ //# sourceMappingURL=LoadingComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingComponent.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/LoadingComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,QAAA,MAAM,gBAAgB,EAAE,EAYvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAa,MAAM,0BAA0B,CAAC;AAoCtE,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA+LF,eAAO,MAAM,eAAe,YAAa;IAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,4CAyC/D,CAAC;;AAEF,wBAA0C"}
1
+ {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAa,MAAM,0BAA0B,CAAC;AAsCtE,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA0MF,eAAO,MAAM,eAAe,YAAa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E,OAAO,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,SAAS,CAyoBzC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductDetail.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAaxE,UAAU,SAAS;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AA8QD,wBAAyC"}
1
+ {"version":3,"file":"ProductDetail.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductDetail.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAcxE,UAAU,SAAS;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AAiQD,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProductList.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAiBxE,UAAU,SAAS;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AA+QD,wBAAuC"}
1
+ {"version":3,"file":"ProductList.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/ProductList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAkBxE,UAAU,SAAS;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;AAkQD,wBAAuC"}