@uipath/apollo-react 7.3.2 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/README.md +1 -1
  2. package/dist/canvas/components/Guardrails/centralized-guardrail-utils.cjs +3 -2
  3. package/dist/canvas/components/Guardrails/centralized-guardrail-utils.d.ts +7 -2
  4. package/dist/canvas/components/Guardrails/centralized-guardrail-utils.d.ts.map +1 -1
  5. package/dist/canvas/components/Guardrails/centralized-guardrail-utils.js +3 -2
  6. package/dist/canvas/components/Guardrails/centralized-types.d.ts +1 -0
  7. package/dist/canvas/components/Guardrails/centralized-types.d.ts.map +1 -1
  8. package/dist/canvas/components/Guardrails/index.d.ts +1 -1
  9. package/dist/canvas/components/Guardrails/index.d.ts.map +1 -1
  10. package/dist/canvas/locales/de.cjs +1 -1
  11. package/dist/canvas/locales/de.d.ts.map +1 -1
  12. package/dist/canvas/locales/de.js +1 -1
  13. package/dist/canvas/locales/es-MX.cjs +1 -1
  14. package/dist/canvas/locales/es-MX.d.ts.map +1 -1
  15. package/dist/canvas/locales/es-MX.js +1 -1
  16. package/dist/canvas/locales/es.cjs +1 -1
  17. package/dist/canvas/locales/es.d.ts.map +1 -1
  18. package/dist/canvas/locales/es.js +1 -1
  19. package/dist/canvas/locales/fr.cjs +1 -1
  20. package/dist/canvas/locales/fr.d.ts.map +1 -1
  21. package/dist/canvas/locales/fr.js +1 -1
  22. package/dist/canvas/locales/ja.cjs +1 -1
  23. package/dist/canvas/locales/ja.d.ts.map +1 -1
  24. package/dist/canvas/locales/ja.js +1 -1
  25. package/dist/canvas/locales/ko.cjs +1 -1
  26. package/dist/canvas/locales/ko.d.ts.map +1 -1
  27. package/dist/canvas/locales/ko.js +1 -1
  28. package/dist/canvas/locales/pt-BR.cjs +1 -1
  29. package/dist/canvas/locales/pt-BR.d.ts.map +1 -1
  30. package/dist/canvas/locales/pt-BR.js +1 -1
  31. package/dist/canvas/locales/pt.cjs +1 -1
  32. package/dist/canvas/locales/pt.d.ts.map +1 -1
  33. package/dist/canvas/locales/pt.js +1 -1
  34. package/dist/canvas/locales/ro.cjs +1 -1
  35. package/dist/canvas/locales/ro.d.ts.map +1 -1
  36. package/dist/canvas/locales/ro.js +1 -1
  37. package/dist/canvas/locales/tr.cjs +1 -1
  38. package/dist/canvas/locales/tr.d.ts.map +1 -1
  39. package/dist/canvas/locales/tr.js +1 -1
  40. package/dist/canvas/locales/zh-CN.cjs +1 -1
  41. package/dist/canvas/locales/zh-CN.d.ts.map +1 -1
  42. package/dist/canvas/locales/zh-CN.js +1 -1
  43. package/dist/canvas/locales/zh-TW.cjs +1 -1
  44. package/dist/canvas/locales/zh-TW.d.ts.map +1 -1
  45. package/dist/canvas/locales/zh-TW.js +1 -1
  46. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  47. package/dist/chat/assets/autopilot-logo.cjs +61 -0
  48. package/dist/chat/assets/autopilot-logo.d.ts +3 -0
  49. package/dist/chat/assets/autopilot-logo.d.ts.map +1 -0
  50. package/dist/chat/assets/autopilot-logo.js +27 -0
  51. package/dist/chat/headless/history/history-groups.cjs +87 -0
  52. package/dist/chat/headless/history/history-groups.d.ts +22 -0
  53. package/dist/chat/headless/history/history-groups.d.ts.map +1 -0
  54. package/dist/chat/headless/history/history-groups.js +47 -0
  55. package/dist/chat/headless/hooks/use-attachment-intake.cjs +163 -0
  56. package/dist/chat/headless/hooks/use-attachment-intake.d.ts +13 -0
  57. package/dist/chat/headless/hooks/use-attachment-intake.d.ts.map +1 -0
  58. package/dist/chat/headless/hooks/use-attachment-intake.js +113 -0
  59. package/dist/chat/headless/hooks/use-attachment-limits.cjs +77 -0
  60. package/dist/chat/headless/hooks/use-attachment-limits.d.ts +3 -0
  61. package/dist/chat/headless/hooks/use-attachment-limits.d.ts.map +1 -0
  62. package/dist/chat/headless/hooks/use-attachment-limits.js +33 -0
  63. package/dist/chat/headless/hooks/use-chat-header-actions.cjs +146 -0
  64. package/dist/chat/headless/hooks/use-chat-header-actions.d.ts +32 -0
  65. package/dist/chat/headless/hooks/use-chat-header-actions.d.ts.map +1 -0
  66. package/dist/chat/headless/hooks/use-chat-header-actions.js +99 -0
  67. package/dist/chat/headless/hooks/use-chat-history.cjs +280 -0
  68. package/dist/chat/headless/hooks/use-chat-history.d.ts +24 -0
  69. package/dist/chat/headless/hooks/use-chat-history.d.ts.map +1 -0
  70. package/dist/chat/headless/hooks/use-chat-history.js +226 -0
  71. package/dist/chat/headless/hooks/use-chat-labels.cjs +52 -0
  72. package/dist/chat/headless/hooks/use-chat-labels.d.ts +7 -0
  73. package/dist/chat/headless/hooks/use-chat-labels.d.ts.map +1 -0
  74. package/dist/chat/headless/hooks/use-chat-labels.js +18 -0
  75. package/dist/chat/headless/hooks/use-chat-messages.cjs +110 -0
  76. package/dist/chat/headless/hooks/use-chat-messages.d.ts +6 -0
  77. package/dist/chat/headless/hooks/use-chat-messages.d.ts.map +1 -0
  78. package/dist/chat/headless/hooks/use-chat-messages.js +66 -0
  79. package/dist/chat/headless/hooks/use-chat-scroll-adapter.cjs +112 -0
  80. package/dist/chat/headless/hooks/use-chat-scroll-adapter.d.ts +13 -0
  81. package/dist/chat/headless/hooks/use-chat-scroll-adapter.d.ts.map +1 -0
  82. package/dist/chat/headless/hooks/use-chat-scroll-adapter.js +68 -0
  83. package/dist/chat/headless/hooks/use-citations.cjs +99 -0
  84. package/dist/chat/headless/hooks/use-citations.d.ts +7 -0
  85. package/dist/chat/headless/hooks/use-citations.d.ts.map +1 -0
  86. package/dist/chat/headless/hooks/use-citations.js +52 -0
  87. package/dist/chat/headless/hooks/use-composer-send.cjs +79 -0
  88. package/dist/chat/headless/hooks/use-composer-send.d.ts +8 -0
  89. package/dist/chat/headless/hooks/use-composer-send.d.ts.map +1 -0
  90. package/dist/chat/headless/hooks/use-composer-send.js +35 -0
  91. package/dist/chat/headless/hooks/use-history-item.cjs +152 -0
  92. package/dist/chat/headless/hooks/use-history-item.d.ts +14 -0
  93. package/dist/chat/headless/hooks/use-history-item.d.ts.map +1 -0
  94. package/dist/chat/headless/hooks/use-history-item.js +108 -0
  95. package/dist/chat/headless/hooks/use-injected-message-renderer.cjs +61 -0
  96. package/dist/chat/headless/hooks/use-injected-message-renderer.d.ts +4 -0
  97. package/dist/chat/headless/hooks/use-injected-message-renderer.d.ts.map +1 -0
  98. package/dist/chat/headless/hooks/use-injected-message-renderer.js +17 -0
  99. package/dist/chat/headless/hooks/use-loading-messages.cjs +68 -0
  100. package/dist/chat/headless/hooks/use-loading-messages.d.ts +7 -0
  101. package/dist/chat/headless/hooks/use-loading-messages.d.ts.map +1 -0
  102. package/dist/chat/headless/hooks/use-loading-messages.js +18 -0
  103. package/dist/chat/headless/hooks/use-message-actions.cjs +175 -0
  104. package/dist/chat/headless/hooks/use-message-actions.d.ts +11 -0
  105. package/dist/chat/headless/hooks/use-message-actions.d.ts.map +1 -0
  106. package/dist/chat/headless/hooks/use-message-actions.js +116 -0
  107. package/dist/chat/headless/hooks/use-message-inset.cjs +67 -0
  108. package/dist/chat/headless/hooks/use-message-inset.d.ts +2 -0
  109. package/dist/chat/headless/hooks/use-message-inset.d.ts.map +1 -0
  110. package/dist/chat/headless/hooks/use-message-inset.js +23 -0
  111. package/dist/chat/headless/hooks/use-settings-renderer.cjs +65 -0
  112. package/dist/chat/headless/hooks/use-settings-renderer.d.ts +2 -0
  113. package/dist/chat/headless/hooks/use-settings-renderer.d.ts.map +1 -0
  114. package/dist/chat/headless/hooks/use-settings-renderer.js +21 -0
  115. package/dist/chat/headless/hooks/use-settled-replies.cjs +88 -0
  116. package/dist/chat/headless/hooks/use-settled-replies.d.ts +3 -0
  117. package/dist/chat/headless/hooks/use-settled-replies.d.ts.map +1 -0
  118. package/dist/chat/headless/hooks/use-settled-replies.js +44 -0
  119. package/dist/chat/headless/hooks/use-streamed-message-content.cjs +158 -0
  120. package/dist/chat/headless/hooks/use-streamed-message-content.d.ts +6 -0
  121. package/dist/chat/headless/hooks/use-streamed-message-content.d.ts.map +1 -0
  122. package/dist/chat/headless/hooks/use-streamed-message-content.js +114 -0
  123. package/dist/chat/headless/hooks/use-suggestions.cjs +72 -0
  124. package/dist/chat/headless/hooks/use-suggestions.d.ts +8 -0
  125. package/dist/chat/headless/hooks/use-suggestions.d.ts.map +1 -0
  126. package/dist/chat/headless/hooks/use-suggestions.js +25 -0
  127. package/dist/chat/headless/layout/chat-layout.cjs +48 -0
  128. package/dist/chat/headless/layout/chat-layout.d.ts +18 -0
  129. package/dist/chat/headless/layout/chat-layout.d.ts.map +1 -0
  130. package/dist/chat/headless/layout/chat-layout.js +14 -0
  131. package/dist/chat/headless/markdown/citation-highlight.cjs +85 -0
  132. package/dist/chat/headless/markdown/citation-highlight.d.ts +2 -0
  133. package/dist/chat/headless/markdown/citation-highlight.d.ts.map +1 -0
  134. package/dist/chat/headless/markdown/citation-highlight.js +51 -0
  135. package/dist/chat/headless/markdown/citations.cjs +69 -0
  136. package/dist/chat/headless/markdown/citations.d.ts +13 -0
  137. package/dist/chat/headless/markdown/citations.d.ts.map +1 -0
  138. package/dist/chat/headless/markdown/citations.js +29 -0
  139. package/dist/chat/headless/markdown/html-preview.cjs +41 -0
  140. package/dist/chat/headless/markdown/html-preview.d.ts +4 -0
  141. package/dist/chat/headless/markdown/html-preview.d.ts.map +1 -0
  142. package/dist/chat/headless/markdown/html-preview.js +7 -0
  143. package/dist/chat/headless/markdown/incomplete-tokens.cjs +58 -0
  144. package/dist/chat/headless/markdown/incomplete-tokens.d.ts +6 -0
  145. package/dist/chat/headless/markdown/incomplete-tokens.d.ts.map +1 -0
  146. package/dist/chat/headless/markdown/incomplete-tokens.js +21 -0
  147. package/dist/chat/headless/messages/message-groups.cjs +59 -0
  148. package/dist/chat/headless/messages/message-groups.d.ts +25 -0
  149. package/dist/chat/headless/messages/message-groups.d.ts.map +1 -0
  150. package/dist/chat/headless/messages/message-groups.js +19 -0
  151. package/dist/chat/headless/providers/attachments-provider.cjs +4 -4
  152. package/dist/chat/headless/providers/attachments-provider.d.ts.map +1 -1
  153. package/dist/chat/headless/providers/attachments-provider.js +4 -4
  154. package/dist/chat/headless/providers/chat-scroll-provider.cjs +37 -29
  155. package/dist/chat/headless/providers/chat-scroll-provider.d.ts.map +1 -1
  156. package/dist/chat/headless/providers/chat-scroll-provider.js +37 -29
  157. package/dist/chat/headless/providers/chat-state-provider.cjs +41 -4
  158. package/dist/chat/headless/providers/chat-state-provider.d.ts +11 -1
  159. package/dist/chat/headless/providers/chat-state-provider.d.ts.map +1 -1
  160. package/dist/chat/headless/providers/chat-state-provider.js +39 -5
  161. package/dist/chat/headless/providers/loading-provider.cjs +41 -3
  162. package/dist/chat/headless/providers/loading-provider.d.ts +5 -0
  163. package/dist/chat/headless/providers/loading-provider.d.ts.map +1 -1
  164. package/dist/chat/headless/providers/loading-provider.js +35 -3
  165. package/dist/chat/headless/providers/picker-provider.cjs +2 -1
  166. package/dist/chat/headless/providers/picker-provider.d.ts.map +1 -1
  167. package/dist/chat/headless/providers/picker-provider.js +2 -1
  168. package/dist/chat/headless/providers/theme-provider.cjs +1 -1
  169. package/dist/chat/headless/providers/theme-provider.js +1 -1
  170. package/dist/chat/headless/renderer-registry.cjs +10 -2
  171. package/dist/chat/headless/renderer-registry.d.ts +5 -0
  172. package/dist/chat/headless/renderer-registry.d.ts.map +1 -1
  173. package/dist/chat/headless/renderer-registry.js +6 -1
  174. package/dist/{material/components/ap-tool-call/utils/traceIconUtils.cjs → chat/headless/tool-call/span-icon.cjs} +5 -13
  175. package/dist/chat/headless/tool-call/span-icon.d.ts +3 -0
  176. package/dist/chat/headless/tool-call/span-icon.d.ts.map +1 -0
  177. package/dist/{material/components/ap-tool-call/utils/traceIconUtils.js → chat/headless/tool-call/span-icon.js} +4 -12
  178. package/dist/{material/components/ap-tool-call/assets/spanIcons.d.ts → chat/headless/tool-call/span-icons.d.ts} +1 -1
  179. package/dist/chat/headless/tool-call/span-icons.d.ts.map +1 -0
  180. package/dist/chat/headless/tool-call/tool-call-model.cjs +133 -0
  181. package/dist/chat/headless/tool-call/tool-call-model.d.ts +44 -0
  182. package/dist/chat/headless/tool-call/tool-call-model.d.ts.map +1 -0
  183. package/dist/chat/headless/tool-call/tool-call-model.js +78 -0
  184. package/dist/chat/headless/tree/chat-tree.cjs +64 -0
  185. package/dist/chat/headless/tree/chat-tree.d.ts +26 -0
  186. package/dist/chat/headless/tree/chat-tree.d.ts.map +1 -0
  187. package/dist/chat/headless/tree/chat-tree.js +27 -0
  188. package/dist/chat/headless/utils/file-type.cjs +48 -0
  189. package/dist/chat/headless/utils/file-type.d.ts +3 -0
  190. package/dist/chat/headless/utils/file-type.d.ts.map +1 -0
  191. package/dist/chat/headless/utils/file-type.js +14 -0
  192. package/dist/chat/headless/utils/openable-url.cjs +46 -0
  193. package/dist/chat/headless/utils/openable-url.d.ts +2 -0
  194. package/dist/chat/headless/utils/openable-url.d.ts.map +1 -0
  195. package/dist/chat/headless/utils/openable-url.js +12 -0
  196. package/dist/chat/headless/utils/publish-chat-event.cjs +38 -0
  197. package/dist/chat/headless/utils/publish-chat-event.d.ts +3 -0
  198. package/dist/chat/headless/utils/publish-chat-event.d.ts.map +1 -0
  199. package/dist/chat/headless/utils/publish-chat-event.js +4 -0
  200. package/dist/chat/index.cjs +13 -19
  201. package/dist/chat/index.d.ts.map +1 -1
  202. package/dist/chat/index.js +1 -4
  203. package/dist/chat/locales/en.cjs +1 -1
  204. package/dist/chat/locales/en.d.ts.map +1 -1
  205. package/dist/chat/locales/en.js +1 -1
  206. package/dist/chat/root/ApChat.cjs +8 -0
  207. package/dist/chat/root/ApChat.d.ts.map +1 -1
  208. package/dist/chat/root/ApChat.js +8 -0
  209. package/dist/chat/root/ChatRoot.cjs +14 -2
  210. package/dist/chat/root/ChatRoot.d.ts +2 -1
  211. package/dist/chat/root/ChatRoot.d.ts.map +1 -1
  212. package/dist/chat/root/ChatRoot.js +14 -2
  213. package/dist/chat/service/ChatModel.d.ts +1 -1
  214. package/dist/chat/service/ChatModel.d.ts.map +1 -1
  215. package/dist/chat/service/ChatService.cjs +14 -3
  216. package/dist/chat/service/ChatService.d.ts +2 -0
  217. package/dist/chat/service/ChatService.d.ts.map +1 -1
  218. package/dist/chat/service/ChatService.js +14 -3
  219. package/dist/chat/stories/chat-playground.d.ts +39 -0
  220. package/dist/chat/stories/chat-playground.d.ts.map +1 -0
  221. package/dist/chat/stories/chat-story-confirm.d.ts +2 -0
  222. package/dist/chat/stories/chat-story-confirm.d.ts.map +1 -0
  223. package/dist/chat/stories/chat-story-fixtures.d.ts +334 -0
  224. package/dist/chat/stories/chat-story-fixtures.d.ts.map +1 -0
  225. package/dist/chat/stories/chat-story-frame.d.ts +11 -0
  226. package/dist/chat/stories/chat-story-frame.d.ts.map +1 -0
  227. package/dist/chat/stories/chat-story-scenarios.d.ts +133 -0
  228. package/dist/chat/stories/chat-story-scenarios.d.ts.map +1 -0
  229. package/dist/chat/stories/chat-story-settings.d.ts +2 -0
  230. package/dist/chat/stories/chat-story-settings.d.ts.map +1 -0
  231. package/dist/chat/styles/tailwind.chat.css +1 -1
  232. package/dist/chat/wind/WindChatRenderer.cjs +145 -0
  233. package/dist/chat/wind/WindChatRenderer.d.ts +3 -0
  234. package/dist/chat/wind/WindChatRenderer.d.ts.map +1 -0
  235. package/dist/chat/wind/WindChatRenderer.js +98 -0
  236. package/dist/chat/wind/common/dialog-container.cjs +51 -0
  237. package/dist/chat/wind/common/dialog-container.d.ts +4 -0
  238. package/dist/chat/wind/common/dialog-container.d.ts.map +1 -0
  239. package/dist/chat/wind/common/dialog-container.js +4 -0
  240. package/dist/chat/wind/common/lucide-icon.cjs +64 -0
  241. package/dist/chat/wind/common/lucide-icon.d.ts +5 -0
  242. package/dist/chat/wind/common/lucide-icon.d.ts.map +1 -0
  243. package/dist/chat/wind/common/lucide-icon.js +27 -0
  244. package/dist/chat/wind/common/panel-popover.cjs +138 -0
  245. package/dist/chat/wind/common/panel-popover.d.ts +16 -0
  246. package/dist/chat/wind/common/panel-popover.d.ts.map +1 -0
  247. package/dist/chat/wind/common/panel-popover.js +94 -0
  248. package/dist/chat/wind/common/service-icon-fallback.cjs +54 -0
  249. package/dist/chat/wind/common/service-icon-fallback.d.ts +5 -0
  250. package/dist/chat/wind/common/service-icon-fallback.d.ts.map +1 -0
  251. package/dist/chat/wind/common/service-icon-fallback.js +17 -0
  252. package/dist/chat/wind/common/service-icon.cjs +58 -0
  253. package/dist/chat/wind/common/service-icon.d.ts +4 -0
  254. package/dist/chat/wind/common/service-icon.d.ts.map +1 -0
  255. package/dist/chat/wind/common/service-icon.js +14 -0
  256. package/dist/chat/wind/composer/chat-composer.cjs +215 -0
  257. package/dist/chat/wind/composer/chat-composer.d.ts +2 -0
  258. package/dist/chat/wind/composer/chat-composer.d.ts.map +1 -0
  259. package/dist/chat/wind/composer/chat-composer.js +171 -0
  260. package/dist/chat/wind/composer/chat-dropzone.cjs +92 -0
  261. package/dist/chat/wind/composer/chat-dropzone.d.ts +6 -0
  262. package/dist/chat/wind/composer/chat-dropzone.d.ts.map +1 -0
  263. package/dist/chat/wind/composer/chat-dropzone.js +58 -0
  264. package/dist/chat/wind/composer/composer-strings.cjs +77 -0
  265. package/dist/chat/wind/composer/composer-strings.d.ts +3 -0
  266. package/dist/chat/wind/composer/composer-strings.d.ts.map +1 -0
  267. package/dist/chat/wind/composer/composer-strings.js +33 -0
  268. package/dist/chat/wind/first-run/first-run.cjs +94 -0
  269. package/dist/chat/wind/first-run/first-run.d.ts +10 -0
  270. package/dist/chat/wind/first-run/first-run.d.ts.map +1 -0
  271. package/dist/chat/wind/first-run/first-run.js +57 -0
  272. package/dist/chat/wind/first-run/suggestion-list.cjs +60 -0
  273. package/dist/chat/wind/first-run/suggestion-list.d.ts +7 -0
  274. package/dist/chat/wind/first-run/suggestion-list.d.ts.map +1 -0
  275. package/dist/chat/wind/first-run/suggestion-list.js +26 -0
  276. package/dist/chat/wind/header/chat-header.cjs +128 -0
  277. package/dist/chat/wind/header/chat-header.d.ts +6 -0
  278. package/dist/chat/wind/header/chat-header.d.ts.map +1 -0
  279. package/dist/chat/wind/header/chat-header.js +94 -0
  280. package/dist/chat/wind/header/custom-actions-menu.cjs +123 -0
  281. package/dist/chat/wind/header/custom-actions-menu.d.ts +6 -0
  282. package/dist/chat/wind/header/custom-actions-menu.d.ts.map +1 -0
  283. package/dist/chat/wind/header/custom-actions-menu.js +89 -0
  284. package/dist/chat/wind/header/header-action-button.cjs +74 -0
  285. package/dist/chat/wind/header/header-action-button.d.ts +7 -0
  286. package/dist/chat/wind/header/header-action-button.d.ts.map +1 -0
  287. package/dist/chat/wind/header/header-action-button.js +30 -0
  288. package/dist/chat/wind/history/chat-history.cjs +82 -0
  289. package/dist/chat/wind/history/chat-history.d.ts +6 -0
  290. package/dist/chat/wind/history/chat-history.d.ts.map +1 -0
  291. package/dist/chat/wind/history/chat-history.js +38 -0
  292. package/dist/chat/wind/history/history-item.cjs +147 -0
  293. package/dist/chat/wind/history/history-item.d.ts +5 -0
  294. package/dist/chat/wind/history/history-item.d.ts.map +1 -0
  295. package/dist/chat/wind/history/history-item.js +103 -0
  296. package/dist/chat/wind/history/history-panel.cjs +138 -0
  297. package/dist/chat/wind/history/history-panel.d.ts +7 -0
  298. package/dist/chat/wind/history/history-panel.d.ts.map +1 -0
  299. package/dist/chat/wind/history/history-panel.js +94 -0
  300. package/dist/chat/wind/hooks/use-open-transition.cjs +72 -0
  301. package/dist/chat/wind/hooks/use-open-transition.d.ts +6 -0
  302. package/dist/chat/wind/hooks/use-open-transition.d.ts.map +1 -0
  303. package/dist/chat/wind/hooks/use-open-transition.js +28 -0
  304. package/dist/chat/wind/hooks/use-prefers-reduced-motion.cjs +59 -0
  305. package/dist/chat/wind/hooks/use-prefers-reduced-motion.d.ts +2 -0
  306. package/dist/chat/wind/hooks/use-prefers-reduced-motion.d.ts.map +1 -0
  307. package/dist/chat/wind/hooks/use-prefers-reduced-motion.js +15 -0
  308. package/dist/chat/wind/layout/embedded-layout.cjs +109 -0
  309. package/dist/chat/wind/layout/embedded-layout.d.ts +5 -0
  310. package/dist/chat/wind/layout/embedded-layout.d.ts.map +1 -0
  311. package/dist/chat/wind/layout/embedded-layout.js +65 -0
  312. package/dist/chat/wind/layout/full-screen-layout.cjs +112 -0
  313. package/dist/chat/wind/layout/full-screen-layout.d.ts +5 -0
  314. package/dist/chat/wind/layout/full-screen-layout.d.ts.map +1 -0
  315. package/dist/chat/wind/layout/full-screen-layout.js +68 -0
  316. package/dist/chat/wind/layout/placeholder-region.cjs +46 -0
  317. package/dist/chat/wind/layout/placeholder-region.d.ts +8 -0
  318. package/dist/chat/wind/layout/placeholder-region.d.ts.map +1 -0
  319. package/dist/chat/wind/layout/placeholder-region.js +12 -0
  320. package/dist/chat/wind/{WindChatPlaceholder.cjs → layout/regions.cjs} +8 -6
  321. package/dist/chat/wind/layout/regions.d.ts +2 -0
  322. package/dist/chat/wind/layout/regions.d.ts.map +1 -0
  323. package/dist/chat/wind/layout/regions.js +10 -0
  324. package/dist/chat/wind/layout/side-by-side-placeholder.cjs +48 -0
  325. package/dist/chat/wind/layout/side-by-side-placeholder.d.ts +2 -0
  326. package/dist/chat/wind/layout/side-by-side-placeholder.d.ts.map +1 -0
  327. package/dist/chat/wind/layout/side-by-side-placeholder.js +14 -0
  328. package/dist/chat/wind/messages/chat-message.cjs +111 -0
  329. package/dist/chat/wind/messages/chat-message.d.ts +13 -0
  330. package/dist/chat/wind/messages/chat-message.d.ts.map +1 -0
  331. package/dist/chat/wind/messages/chat-message.js +67 -0
  332. package/dist/chat/wind/messages/injected-message.cjs +57 -0
  333. package/dist/chat/wind/messages/injected-message.d.ts +5 -0
  334. package/dist/chat/wind/messages/injected-message.d.ts.map +1 -0
  335. package/dist/chat/wind/messages/injected-message.js +13 -0
  336. package/dist/chat/wind/messages/message-action-bar.cjs +110 -0
  337. package/dist/chat/wind/messages/message-action-bar.d.ts +7 -0
  338. package/dist/chat/wind/messages/message-action-bar.d.ts.map +1 -0
  339. package/dist/chat/wind/messages/message-action-bar.js +76 -0
  340. package/dist/chat/wind/messages/message-attachments.cjs +94 -0
  341. package/dist/chat/wind/messages/message-attachments.d.ts +13 -0
  342. package/dist/chat/wind/messages/message-attachments.d.ts.map +1 -0
  343. package/dist/chat/wind/messages/message-attachments.js +48 -0
  344. package/dist/chat/wind/messages/message-list.cjs +246 -0
  345. package/dist/chat/wind/messages/message-list.d.ts +5 -0
  346. package/dist/chat/wind/messages/message-list.d.ts.map +1 -0
  347. package/dist/chat/wind/messages/message-list.js +202 -0
  348. package/dist/chat/wind/messages/message-sources.cjs +77 -0
  349. package/dist/chat/wind/messages/message-sources.d.ts +5 -0
  350. package/dist/chat/wind/messages/message-sources.d.ts.map +1 -0
  351. package/dist/chat/wind/messages/message-sources.js +43 -0
  352. package/dist/chat/wind/messages/thinking-row.cjs +48 -0
  353. package/dist/chat/wind/messages/thinking-row.d.ts +2 -0
  354. package/dist/chat/wind/messages/thinking-row.d.ts.map +1 -0
  355. package/dist/chat/wind/messages/thinking-row.js +14 -0
  356. package/dist/chat/wind/renderers/citation-highlights.cjs +77 -0
  357. package/dist/chat/wind/renderers/citation-highlights.d.ts +8 -0
  358. package/dist/chat/wind/renderers/citation-highlights.d.ts.map +1 -0
  359. package/dist/chat/wind/renderers/citation-highlights.js +30 -0
  360. package/dist/chat/wind/renderers/code-block-actions.cjs +176 -0
  361. package/dist/chat/wind/renderers/code-block-actions.d.ts +9 -0
  362. package/dist/chat/wind/renderers/code-block-actions.d.ts.map +1 -0
  363. package/dist/chat/wind/renderers/code-block-actions.js +132 -0
  364. package/dist/chat/wind/renderers/disclosure-tree.cjs +136 -0
  365. package/dist/chat/wind/renderers/disclosure-tree.d.ts +22 -0
  366. package/dist/chat/wind/renderers/disclosure-tree.d.ts.map +1 -0
  367. package/dist/chat/wind/renderers/disclosure-tree.js +92 -0
  368. package/dist/chat/wind/renderers/index.cjs +53 -0
  369. package/dist/chat/wind/renderers/index.d.ts +3 -0
  370. package/dist/chat/wind/renderers/index.d.ts.map +1 -0
  371. package/dist/chat/wind/renderers/index.js +19 -0
  372. package/dist/chat/wind/renderers/markdown-citation.cjs +102 -0
  373. package/dist/chat/wind/renderers/markdown-citation.d.ts +3 -0
  374. package/dist/chat/wind/renderers/markdown-citation.d.ts.map +1 -0
  375. package/dist/chat/wind/renderers/markdown-citation.js +58 -0
  376. package/dist/chat/wind/renderers/markdown-renderer.cjs +127 -0
  377. package/dist/chat/wind/renderers/markdown-renderer.d.ts +10 -0
  378. package/dist/chat/wind/renderers/markdown-renderer.d.ts.map +1 -0
  379. package/dist/chat/wind/renderers/markdown-renderer.js +80 -0
  380. package/dist/chat/wind/renderers/markdown-resource-chip.cjs +53 -0
  381. package/dist/chat/wind/renderers/markdown-resource-chip.d.ts +3 -0
  382. package/dist/chat/wind/renderers/markdown-resource-chip.d.ts.map +1 -0
  383. package/dist/chat/wind/renderers/markdown-resource-chip.js +19 -0
  384. package/dist/chat/wind/renderers/tool-call-renderer.cjs +232 -0
  385. package/dist/chat/wind/renderers/tool-call-renderer.d.ts +8 -0
  386. package/dist/chat/wind/renderers/tool-call-renderer.d.ts.map +1 -0
  387. package/dist/chat/wind/renderers/tool-call-renderer.js +188 -0
  388. package/dist/chat/wind/renderers/tool-call-strings.cjs +161 -0
  389. package/dist/chat/wind/renderers/tool-call-strings.d.ts +12 -0
  390. package/dist/chat/wind/renderers/tool-call-strings.d.ts.map +1 -0
  391. package/dist/chat/wind/renderers/tool-call-strings.js +117 -0
  392. package/dist/chat/wind/renderers/tree-renderer.cjs +103 -0
  393. package/dist/chat/wind/renderers/tree-renderer.d.ts +8 -0
  394. package/dist/chat/wind/renderers/tree-renderer.d.ts.map +1 -0
  395. package/dist/chat/wind/renderers/tree-renderer.js +59 -0
  396. package/dist/chat/wind/settings/chat-settings.cjs +155 -0
  397. package/dist/chat/wind/settings/chat-settings.d.ts +11 -0
  398. package/dist/chat/wind/settings/chat-settings.d.ts.map +1 -0
  399. package/dist/chat/wind/settings/chat-settings.js +108 -0
  400. package/dist/core/tokens/css/theme-variables.css +1 -1
  401. package/dist/core/tokens/css/variables.css +1 -1
  402. package/dist/core/tokens/less/_variables.less +1 -1
  403. package/dist/core/tokens/scss/_css-variables.scss +1 -1
  404. package/dist/core/tokens/scss/_variables.scss +1 -1
  405. package/dist/material/components/ap-chat/MaterialChatRenderer.cjs +22 -11
  406. package/dist/material/components/ap-chat/MaterialChatRenderer.d.ts +8 -0
  407. package/dist/material/components/ap-chat/MaterialChatRenderer.d.ts.map +1 -1
  408. package/dist/material/components/ap-chat/MaterialChatRenderer.js +21 -13
  409. package/dist/material/components/ap-chat/ap-chat-material.cjs +70 -0
  410. package/dist/material/components/ap-chat/ap-chat-material.d.ts +13 -0
  411. package/dist/material/components/ap-chat/ap-chat-material.d.ts.map +1 -0
  412. package/dist/material/components/ap-chat/ap-chat-material.js +26 -0
  413. package/dist/material/components/ap-chat/ap-chat.cjs +5 -32
  414. package/dist/material/components/ap-chat/ap-chat.d.ts +1 -11
  415. package/dist/material/components/ap-chat/ap-chat.d.ts.map +1 -1
  416. package/dist/material/components/ap-chat/ap-chat.js +5 -22
  417. package/dist/material/components/ap-chat/components/dropzone/dropzone.cjs +23 -82
  418. package/dist/material/components/ap-chat/components/dropzone/dropzone.d.ts +2 -0
  419. package/dist/material/components/ap-chat/components/dropzone/dropzone.d.ts.map +1 -1
  420. package/dist/material/components/ap-chat/components/dropzone/dropzone.js +20 -82
  421. package/dist/material/components/ap-chat/components/header/header-actions.cjs +23 -91
  422. package/dist/material/components/ap-chat/components/header/header-actions.d.ts.map +1 -1
  423. package/dist/material/components/ap-chat/components/header/header-actions.js +23 -91
  424. package/dist/material/components/ap-chat/components/header/header.cjs +6 -7
  425. package/dist/material/components/ap-chat/components/header/header.d.ts.map +1 -1
  426. package/dist/material/components/ap-chat/components/header/header.js +6 -6
  427. package/dist/material/components/ap-chat/components/history/chat-history-group.d.ts +2 -2
  428. package/dist/material/components/ap-chat/components/history/chat-history-group.d.ts.map +1 -1
  429. package/dist/material/components/ap-chat/components/history/chat-history-item.cjs +15 -104
  430. package/dist/material/components/ap-chat/components/history/chat-history-item.d.ts +1 -1
  431. package/dist/material/components/ap-chat/components/history/chat-history-item.d.ts.map +1 -1
  432. package/dist/material/components/ap-chat/components/history/chat-history-item.js +13 -102
  433. package/dist/material/components/ap-chat/components/history/chat-history.cjs +5 -170
  434. package/dist/material/components/ap-chat/components/history/chat-history.d.ts +0 -5
  435. package/dist/material/components/ap-chat/components/history/chat-history.d.ts.map +1 -1
  436. package/dist/material/components/ap-chat/components/history/chat-history.js +7 -171
  437. package/dist/material/components/ap-chat/components/input/chat-input-actions.cjs +15 -98
  438. package/dist/material/components/ap-chat/components/input/chat-input-actions.d.ts.map +1 -1
  439. package/dist/material/components/ap-chat/components/input/chat-input-actions.js +15 -98
  440. package/dist/material/components/ap-chat/components/input/chat-input-footer.cjs +3 -7
  441. package/dist/material/components/ap-chat/components/input/chat-input-footer.d.ts.map +1 -1
  442. package/dist/material/components/ap-chat/components/input/chat-input-footer.js +3 -7
  443. package/dist/material/components/ap-chat/components/input/chat-input.cjs +11 -23
  444. package/dist/material/components/ap-chat/components/input/chat-input.d.ts.map +1 -1
  445. package/dist/material/components/ap-chat/components/input/chat-input.js +11 -23
  446. package/dist/material/components/ap-chat/components/input/tiptap/tiptap-editor.cjs +1 -1
  447. package/dist/material/components/ap-chat/components/input/tiptap/tiptap-editor.d.ts.map +1 -1
  448. package/dist/material/components/ap-chat/components/input/tiptap/tiptap-editor.js +1 -1
  449. package/dist/material/components/ap-chat/components/message/actions/chat-actions-list.cjs +2 -23
  450. package/dist/material/components/ap-chat/components/message/actions/chat-actions-list.d.ts.map +1 -1
  451. package/dist/material/components/ap-chat/components/message/actions/chat-actions-list.js +2 -23
  452. package/dist/material/components/ap-chat/components/message/actions/chat-actions.cjs +3 -84
  453. package/dist/material/components/ap-chat/components/message/actions/chat-actions.d.ts +1 -1
  454. package/dist/material/components/ap-chat/components/message/actions/chat-actions.d.ts.map +1 -1
  455. package/dist/material/components/ap-chat/components/message/actions/chat-actions.js +4 -85
  456. package/dist/material/components/ap-chat/components/message/chat-message-content.cjs +4 -39
  457. package/dist/material/components/ap-chat/components/message/chat-message-content.d.ts.map +1 -1
  458. package/dist/material/components/ap-chat/components/message/chat-message-content.js +5 -40
  459. package/dist/material/components/ap-chat/components/message/chat-message.cjs +7 -90
  460. package/dist/material/components/ap-chat/components/message/chat-message.d.ts.map +1 -1
  461. package/dist/material/components/ap-chat/components/message/chat-message.js +9 -92
  462. package/dist/material/components/ap-chat/components/message/chat-scroll-container.cjs +4 -2
  463. package/dist/material/components/ap-chat/components/message/chat-scroll-container.d.ts.map +1 -1
  464. package/dist/material/components/ap-chat/components/message/chat-scroll-container.js +4 -2
  465. package/dist/material/components/ap-chat/components/message/first-run-experience/chat-fre.cjs +2 -2
  466. package/dist/material/components/ap-chat/components/message/first-run-experience/chat-fre.js +2 -2
  467. package/dist/material/components/ap-chat/components/message/loader/chat-loading-text.cjs +25 -46
  468. package/dist/material/components/ap-chat/components/message/loader/chat-loading-text.d.ts.map +1 -1
  469. package/dist/material/components/ap-chat/components/message/loader/chat-loading-text.js +24 -45
  470. package/dist/material/components/ap-chat/components/message/markdown/citation.cjs +26 -84
  471. package/dist/material/components/ap-chat/components/message/markdown/citation.d.ts.map +1 -1
  472. package/dist/material/components/ap-chat/components/message/markdown/citation.js +24 -82
  473. package/dist/material/components/ap-chat/components/message/markdown/code.cjs +2 -1
  474. package/dist/material/components/ap-chat/components/message/markdown/code.d.ts.map +1 -1
  475. package/dist/material/components/ap-chat/components/message/markdown/code.js +2 -1
  476. package/dist/material/components/ap-chat/components/message/markdown/markdown.cjs +2 -117
  477. package/dist/material/components/ap-chat/components/message/markdown/markdown.d.ts +1 -1
  478. package/dist/material/components/ap-chat/components/message/markdown/markdown.d.ts.map +1 -1
  479. package/dist/material/components/ap-chat/components/message/markdown/markdown.js +3 -118
  480. package/dist/material/components/ap-chat/components/message/sources/chat-sources.cjs +8 -55
  481. package/dist/material/components/ap-chat/components/message/sources/chat-sources.d.ts +2 -3
  482. package/dist/material/components/ap-chat/components/message/sources/chat-sources.d.ts.map +1 -1
  483. package/dist/material/components/ap-chat/components/message/sources/chat-sources.js +5 -52
  484. package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.cjs +7 -14
  485. package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.d.ts +1 -1
  486. package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.d.ts.map +1 -1
  487. package/dist/material/components/ap-chat/components/message/suggestions/chat-suggestions.js +4 -11
  488. package/dist/material/components/ap-chat/components/message/tree/tree-renderer.cjs +6 -34
  489. package/dist/material/components/ap-chat/components/message/tree/tree-renderer.d.ts.map +1 -1
  490. package/dist/material/components/ap-chat/components/message/tree/tree-renderer.js +6 -34
  491. package/dist/material/components/ap-chat/components/settings/chat-settings-header.cjs +1 -1
  492. package/dist/material/components/ap-chat/components/settings/chat-settings-header.js +1 -1
  493. package/dist/material/components/ap-chat/components/settings/chat-settings.cjs +6 -20
  494. package/dist/material/components/ap-chat/components/settings/chat-settings.d.ts.map +1 -1
  495. package/dist/material/components/ap-chat/components/settings/chat-settings.js +7 -21
  496. package/dist/material/components/ap-chat/utils/file-to-icon.cjs +11 -28
  497. package/dist/material/components/ap-chat/utils/file-to-icon.d.ts.map +1 -1
  498. package/dist/material/components/ap-chat/utils/file-to-icon.js +11 -28
  499. package/dist/material/components/ap-tool-call/ApToolCall.cjs +40 -96
  500. package/dist/material/components/ap-tool-call/ApToolCall.d.ts.map +1 -1
  501. package/dist/material/components/ap-tool-call/ApToolCall.js +39 -95
  502. package/dist/material/components/ap-tool-call/components/ToolCallSection.cjs +3 -2
  503. package/dist/material/components/ap-tool-call/components/ToolCallSection.d.ts.map +1 -1
  504. package/dist/material/components/ap-tool-call/components/ToolCallSection.js +3 -2
  505. package/dist/material/stories/chat-story-support.d.ts +1 -2
  506. package/dist/material/stories/chat-story-support.d.ts.map +1 -1
  507. package/package.json +10 -6
  508. package/dist/chat/wind/WindChatPlaceholder.d.ts +0 -2
  509. package/dist/chat/wind/WindChatPlaceholder.d.ts.map +0 -1
  510. package/dist/chat/wind/WindChatPlaceholder.js +0 -8
  511. package/dist/material/components/ap-chat/assets/autopilot-logo.cjs +0 -61
  512. package/dist/material/components/ap-chat/assets/autopilot-logo.js +0 -27
  513. package/dist/material/components/ap-tool-call/assets/spanIcons.d.ts.map +0 -1
  514. package/dist/material/components/ap-tool-call/utils/traceIconUtils.d.ts +0 -3
  515. package/dist/material/components/ap-tool-call/utils/traceIconUtils.d.ts.map +0 -1
  516. package/dist/material/stories/chat-story-support.cjs +0 -2563
  517. package/dist/material/stories/chat-story-support.js +0 -2507
  518. package/dist/material/stories/storybook-helpers.cjs +0 -166
  519. package/dist/material/stories/storybook-helpers.js +0 -109
  520. /package/dist/{material/components/ap-tool-call/assets/spanIcons.cjs → chat/headless/tool-call/span-icons.cjs} +0 -0
  521. /package/dist/{material/components/ap-tool-call/assets/spanIcons.js → chat/headless/tool-call/span-icons.js} +0 -0
@@ -1,2507 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import Box from "@mui/material/Box";
3
- import Button from "@mui/material/Button";
4
- import Checkbox from "@mui/material/Checkbox";
5
- import Divider from "@mui/material/Divider";
6
- import FormControlLabel from "@mui/material/FormControlLabel";
7
- import TextField from "@mui/material/TextField";
8
- import Typography from "@mui/material/Typography";
9
- import { useCallback, useEffect, useRef, useState } from "react";
10
- import { FontVariantToken } from "../../core/index.js";
11
- import { ApChat, ApTypography, AutopilotChatEvent, AutopilotChatMode, AutopilotChatRole, AutopilotChatService, ConversationalDisplayModeTypes } from "../components/index.js";
12
- const CHAT_LOCALES = [
13
- 'en',
14
- 'de',
15
- 'es',
16
- 'es-MX',
17
- 'fr',
18
- 'ja',
19
- 'ko',
20
- 'pt',
21
- 'pt-BR',
22
- 'ro',
23
- 'ru',
24
- 'tr',
25
- 'zh-CN',
26
- 'zh-TW'
27
- ];
28
- function mapToChatLocale(globalLocale) {
29
- return CHAT_LOCALES.includes(globalLocale) ? globalLocale : 'en';
30
- }
31
- function mapToChatTheme(globalTheme) {
32
- switch(globalTheme){
33
- case 'light':
34
- return 'light';
35
- case 'light-hc':
36
- return 'light-hc';
37
- case 'dark':
38
- return 'dark';
39
- case 'dark-hc':
40
- return 'dark-hc';
41
- case 'future-light':
42
- return 'light';
43
- case 'future-dark':
44
- return 'dark';
45
- default:
46
- return 'dark';
47
- }
48
- }
49
- function Section({ children }) {
50
- return /*#__PURE__*/ jsxs(Box, {
51
- sx: {
52
- mb: 3,
53
- '&:last-child': {
54
- mb: 0,
55
- '& > .MuiDivider-root': {
56
- display: 'none'
57
- }
58
- }
59
- },
60
- children: [
61
- children,
62
- /*#__PURE__*/ jsx(Divider, {
63
- sx: {
64
- mt: 3
65
- }
66
- })
67
- ]
68
- });
69
- }
70
- function SectionTitle({ children }) {
71
- return /*#__PURE__*/ jsx(ApTypography, {
72
- variant: FontVariantToken.fontSizeMBold,
73
- component: "h3",
74
- sx: {
75
- mb: 2
76
- },
77
- children: children
78
- });
79
- }
80
- function ButtonGroup({ children }) {
81
- return /*#__PURE__*/ jsx(Box, {
82
- sx: {
83
- display: 'flex',
84
- flexWrap: 'wrap',
85
- gap: 1,
86
- mb: 1.5
87
- },
88
- children: children
89
- });
90
- }
91
- function DemoButton({ primary = false, children, onClick, disabled, title }) {
92
- return /*#__PURE__*/ jsx(Button, {
93
- variant: primary ? 'contained' : 'outlined',
94
- size: "small",
95
- onClick: onClick,
96
- disabled: disabled,
97
- title: title,
98
- sx: {
99
- whiteSpace: 'nowrap'
100
- },
101
- children: children
102
- });
103
- }
104
- function DemoInput({ style, type, min, max, value, onChange, placeholder, disabled }) {
105
- return /*#__PURE__*/ jsx(TextField, {
106
- size: "small",
107
- fullWidth: true,
108
- type: type,
109
- value: value,
110
- placeholder: placeholder,
111
- disabled: disabled,
112
- onChange: onChange,
113
- inputProps: {
114
- min,
115
- max
116
- },
117
- sx: {
118
- mb: 1.5
119
- },
120
- style: style
121
- });
122
- }
123
- function DemoTextArea({ style, value, onChange, placeholder, disabled }) {
124
- return /*#__PURE__*/ jsx(TextField, {
125
- size: "small",
126
- fullWidth: true,
127
- multiline: true,
128
- minRows: 3,
129
- value: value,
130
- placeholder: placeholder,
131
- disabled: disabled,
132
- onChange: onChange,
133
- sx: {
134
- mb: 1.5
135
- },
136
- style: style
137
- });
138
- }
139
- function DemoSelect({ style, children, value, onChange, disabled }) {
140
- return /*#__PURE__*/ jsx(TextField, {
141
- select: true,
142
- size: "small",
143
- fullWidth: true,
144
- value: value,
145
- disabled: disabled,
146
- onChange: onChange,
147
- SelectProps: {
148
- native: true
149
- },
150
- sx: {
151
- mb: 1.5
152
- },
153
- style: style,
154
- children: children
155
- });
156
- }
157
- function InfoText({ children, style }) {
158
- return /*#__PURE__*/ jsx(Typography, {
159
- component: "p",
160
- variant: "body2",
161
- sx: {
162
- color: 'text.secondary',
163
- mt: 1
164
- },
165
- style: style,
166
- children: children
167
- });
168
- }
169
- function ChatShowcaseDemo({ theme, instanceName, initialMode = AutopilotChatMode.SideBySide, locale = 'en' }) {
170
- const embeddedContainerRef = useRef(null);
171
- const [chatService, setChatService] = useState(null);
172
- const [chatMode, setChatMode] = useState(initialMode);
173
- const [customMessage, setCustomMessage] = useState('Hello, how can I help you today?');
174
- const [errorMessage, setErrorMessage] = useState('An error occurred. Please try again.');
175
- const [streamingText, setStreamingText] = useState('This is a streaming response that will appear word by word...');
176
- const [loadingMessage, setLoadingMessage] = useState('Thinking...');
177
- const [waitForMore, setWaitForMore] = useState(false);
178
- const [autoScroll, setAutoScroll] = useState(true);
179
- const [isWaiting, setIsWaiting] = useState(false);
180
- const [isShowLoading, setIsShowLoading] = useState(false);
181
- const [features, setFeatures] = useState({
182
- history: true,
183
- settings: true,
184
- attachments: true,
185
- audio: false,
186
- audioStreaming: false,
187
- htmlPreview: true,
188
- renameChat: true,
189
- headerSeparator: false,
190
- fullHeight: true,
191
- resize: true,
192
- close: true,
193
- feedback: true,
194
- model: true,
195
- agentMode: true,
196
- sendOnClick: false,
197
- paginatedMessages: false,
198
- compactMode: false,
199
- customScrollTheme: false,
200
- copy: true,
201
- stopResponse: true,
202
- attachmentsAsync: false,
203
- readOnly: false
204
- });
205
- const [selectedAgentMode, setSelectedAgentMode] = useState('agent');
206
- const [selectedModel, setSelectedModel] = useState('gpt-4');
207
- const [primaryFontToken, setPrimaryFontToken] = useState(FontVariantToken.fontSizeM);
208
- const [promptBoxMinRows, setPromptBoxMinRows] = useState(2);
209
- const [promptBoxMaxRows, setPromptBoxMaxRows] = useState(12);
210
- const [resourcePaginationEnabled, setResourcePaginationEnabled] = useState(true);
211
- const [resourcePageSize, setResourcePageSize] = useState(10);
212
- const createResourceManager = useCallback(()=>{
213
- const topLevelItems = [
214
- {
215
- id: 'variables',
216
- type: 'category',
217
- displayName: 'Variables',
218
- icon: 'data_object',
219
- hasNestedResources: true
220
- },
221
- {
222
- id: 'files',
223
- type: 'category',
224
- displayName: 'This is an intentionally very very long category name',
225
- icon: 'folder',
226
- hasNestedResources: true
227
- },
228
- {
229
- id: 'current-user',
230
- type: 'context',
231
- displayName: 'This is an intentionally very very long resource name',
232
- icon: 'person',
233
- tooltip: 'The currently logged in user context',
234
- hasNestedResources: false
235
- },
236
- {
237
- id: 'current-date',
238
- type: 'context',
239
- displayName: 'Current Date',
240
- icon: 'calendar_today',
241
- tooltip: "Today's date in ISO format",
242
- hasNestedResources: false
243
- }
244
- ];
245
- const variableIcons = [
246
- 'text_fields',
247
- 'mail',
248
- 'numbers',
249
- 'toggle_on',
250
- 'settings',
251
- 'person',
252
- 'calendar_today',
253
- 'list',
254
- 'data_object',
255
- 'code'
256
- ];
257
- const variableItems = Array.from({
258
- length: 50
259
- }, (_, i)=>({
260
- id: `var-${i}`,
261
- type: 'variable',
262
- displayName: `variable_${i.toString().padStart(2, '0')}`,
263
- icon: variableIcons[i % variableIcons.length],
264
- tooltip: `Variable ${i} - This is a sample variable for testing pagination`
265
- }));
266
- const fileIcons = [
267
- "description",
268
- 'table_chart',
269
- 'picture_as_pdf',
270
- 'image',
271
- 'code',
272
- 'folder'
273
- ];
274
- const fileExtensions = [
275
- '.json',
276
- '.csv',
277
- '.pdf',
278
- '.png',
279
- '.ts',
280
- '.txt',
281
- '.xml',
282
- '.yaml'
283
- ];
284
- const fileItems = Array.from({
285
- length: 30
286
- }, (_, i)=>({
287
- id: `file-${i}`,
288
- type: 'file',
289
- displayName: `document_${i.toString().padStart(2, '0')}${fileExtensions[i % fileExtensions.length]}`,
290
- icon: fileIcons[i % fileIcons.length],
291
- tooltip: `File ${i} - Sample file for testing pagination`
292
- }));
293
- const paginate = (items, skip, pageSize, paginationEnabled)=>{
294
- if (!paginationEnabled) return {
295
- paginatedItems: items,
296
- done: true
297
- };
298
- const paginatedItems = items.slice(skip, skip + pageSize);
299
- const done = skip + pageSize >= items.length;
300
- return {
301
- paginatedItems,
302
- done
303
- };
304
- };
305
- return {
306
- getTopLevelResources: ()=>topLevelItems,
307
- getNestedResources: async (resourceId, options)=>{
308
- await new Promise((resolve)=>setTimeout(resolve, 300));
309
- let items = [];
310
- if ('variables' === resourceId) items = variableItems;
311
- else if ('files' === resourceId) items = fileItems;
312
- if (options?.searchText) {
313
- const searchLower = options.searchText.toLowerCase();
314
- items = items.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
315
- }
316
- const skip = options?.skip ?? 0;
317
- const { paginatedItems, done } = paginate(items, skip, resourcePageSize, resourcePaginationEnabled);
318
- console.log(`[ResourceManager] getNestedResources: resourceId=${resourceId}, skip=${skip}, returned=${paginatedItems.length}, done=${done}`);
319
- return {
320
- items: paginatedItems,
321
- done
322
- };
323
- },
324
- globalSearch: async (options)=>{
325
- await new Promise((resolve)=>setTimeout(resolve, 300));
326
- let allItems = [
327
- ...variableItems,
328
- ...fileItems
329
- ];
330
- const skip = options.skip ?? 0;
331
- if (options.searchText) {
332
- const searchLower = options.searchText.toLowerCase();
333
- if (0 === skip) {
334
- const matchingTopLevel = topLevelItems.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
335
- allItems = [
336
- ...matchingTopLevel,
337
- ...allItems
338
- ];
339
- }
340
- allItems = allItems.filter((item)=>item.displayName.toLowerCase().includes(searchLower));
341
- }
342
- const { paginatedItems, done } = paginate(allItems, skip, resourcePageSize, resourcePaginationEnabled);
343
- console.log(`[ResourceManager] globalSearch: searchText="${options.searchText ?? ''}", skip=${skip}, returned=${paginatedItems.length}, done=${done}`);
344
- return {
345
- items: paginatedItems,
346
- done
347
- };
348
- },
349
- onResourceSelected: (item)=>{
350
- console.log('Resource selected:', item.displayName);
351
- }
352
- };
353
- }, [
354
- resourcePaginationEnabled,
355
- resourcePageSize
356
- ]);
357
- const createSettingsRenderer = useCallback(()=>(container)=>{
358
- const settingsDiv = document.createElement('div');
359
- settingsDiv.style.padding = '24px';
360
- settingsDiv.style.color = 'var(--color-foreground)';
361
- settingsDiv.innerHTML = `
362
- <h2 style="margin: 0 0 16px 0; font-size: 20px; font-weight: 600;">Chat Settings</h2>
363
-
364
- <div style="margin-bottom: 24px;">
365
- <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Appearance</h3>
366
- <label style="display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px;">
367
- <input type="checkbox" id="darkMode" style="cursor: pointer;" />
368
- <span>Dark Mode</span>
369
- </label>
370
- <label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
371
- <input type="checkbox" id="compactMode" checked style="cursor: pointer;" />
372
- <span>Compact Mode</span>
373
- </label>
374
- </div>
375
-
376
- <div style="margin-bottom: 24px;">
377
- <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Behavior</h3>
378
- <label style="display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px;">
379
- <input type="checkbox" id="autoScroll" checked style="cursor: pointer;" />
380
- <span>Auto-scroll to new messages</span>
381
- </label>
382
- <label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
383
- <input type="checkbox" id="soundEnabled" style="cursor: pointer;" />
384
- <span>Enable sound notifications</span>
385
- </label>
386
- </div>
387
-
388
- <div style="margin-bottom: 24px;">
389
- <h3 style="margin: 0 0 12px 0; font-size: 16px; font-weight: 500;">Advanced</h3>
390
- <label style="display: block; margin-bottom: 8px;">
391
- <span style="display: block; margin-bottom: 4px;">Max Messages</span>
392
- <input type="number" id="maxMessages" value="100" min="10" max="500"
393
- style="padding: 8px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-background); color: var(--color-foreground); width: 100px;" />
394
- </label>
395
- <label style="display: block;">
396
- <span style="display: block; margin-bottom: 4px;">Response Delay (ms)</span>
397
- <input type="number" id="responseDelay" value="0" min="0" max="5000" step="100"
398
- style="padding: 8px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-background); color: var(--color-foreground); width: 100px;" />
399
- </label>
400
- </div>
401
-
402
- <div style="display: flex; gap: 12px;">
403
- <button id="saveSettings" style="padding: 8px 16px; background: var(--color-primary); color: var(--color-foreground-on-accent); border: none; border-radius: 4px; cursor: pointer; font-weight: 500;">
404
- Save Settings
405
- </button>
406
- <button id="resetSettings" style="padding: 8px 16px; background: transparent; color: var(--color-foreground); border: 1px solid var(--color-border); border-radius: 4px; cursor: pointer;">
407
- Reset to Defaults
408
- </button>
409
- </div>
410
- `;
411
- const darkModeCheckbox = settingsDiv.querySelector('#darkMode');
412
- darkModeCheckbox?.addEventListener('change', (e)=>{
413
- console.log('Dark mode:', e.target.checked);
414
- });
415
- const saveButton = settingsDiv.querySelector('#saveSettings');
416
- saveButton?.addEventListener('click', ()=>{
417
- console.log('Settings saved:', {
418
- darkMode: settingsDiv.querySelector('#darkMode').checked,
419
- compactMode: settingsDiv.querySelector('#compactMode').checked,
420
- autoScroll: settingsDiv.querySelector('#autoScroll').checked,
421
- soundEnabled: settingsDiv.querySelector('#soundEnabled').checked,
422
- maxMessages: settingsDiv.querySelector('#maxMessages').value,
423
- responseDelay: settingsDiv.querySelector('#responseDelay').value
424
- });
425
- console.log('Settings saved successfully!');
426
- });
427
- const resetButton = settingsDiv.querySelector('#resetSettings');
428
- resetButton?.addEventListener('click', ()=>{
429
- settingsDiv.querySelector('#darkMode').checked = false;
430
- settingsDiv.querySelector('#compactMode').checked = true;
431
- settingsDiv.querySelector('#autoScroll').checked = true;
432
- settingsDiv.querySelector('#soundEnabled').checked = false;
433
- settingsDiv.querySelector('#maxMessages').value = '100';
434
- settingsDiv.querySelector('#responseDelay').value = '0';
435
- console.log('Settings reset to defaults');
436
- });
437
- container.appendChild(settingsDiv);
438
- }, []);
439
- useEffect(()=>{
440
- const service = AutopilotChatService.Instantiate({
441
- instanceName,
442
- config: {
443
- mode: initialMode,
444
- readOnly: features.readOnly,
445
- disabledFeatures: {
446
- history: !features.history,
447
- settings: !features.settings,
448
- attachments: !features.attachments,
449
- audio: !features.audio,
450
- audioStreaming: !features.audioStreaming,
451
- htmlPreview: !features.htmlPreview,
452
- headerSeparator: !features.headerSeparator,
453
- fullHeight: !features.fullHeight,
454
- resize: !features.resize,
455
- close: !features.close,
456
- feedback: !features.feedback,
457
- copy: !features.copy,
458
- renameChat: !features.renameChat,
459
- stopResponse: !features.stopResponse
460
- },
461
- settingsRenderer: createSettingsRenderer()
462
- }
463
- });
464
- setChatService(service);
465
- const unsubscribes = [];
466
- service.setModels([
467
- {
468
- id: 'gpt-4',
469
- name: 'GPT-4',
470
- description: 'Most capable model'
471
- },
472
- {
473
- id: 'gpt-3.5',
474
- name: 'GPT-3.5 Turbo',
475
- description: 'Fast and efficient'
476
- },
477
- {
478
- id: 'claude-3',
479
- name: 'Claude 3',
480
- description: 'Anthropic model'
481
- }
482
- ]);
483
- service.setSelectedModel('gpt-4');
484
- service.setAgentModes([
485
- {
486
- id: 'agent',
487
- name: 'Agent',
488
- description: 'AI-powered autonomous agent mode',
489
- icon: 'smart_toy'
490
- },
491
- {
492
- id: 'plan',
493
- name: 'Plan',
494
- description: 'Create and review execution plans',
495
- icon: 'edit_note'
496
- },
497
- {
498
- id: 'attended',
499
- name: 'Attended',
500
- description: 'Human assisted execution',
501
- icon: 'play_arrow'
502
- }
503
- ]);
504
- service.setAgentMode('agent');
505
- service.setCustomHeaderActions([
506
- {
507
- id: 'export',
508
- name: 'Export Chat',
509
- icon: 'download'
510
- },
511
- {
512
- id: 'share',
513
- name: 'Share',
514
- icon: 'share'
515
- }
516
- ]);
517
- service.setSuggestions([
518
- {
519
- label: 'What can you do?',
520
- prompt: 'What can you do?'
521
- },
522
- {
523
- label: 'Show me an example',
524
- prompt: 'Show me an example'
525
- },
526
- {
527
- label: 'Help me with code',
528
- prompt: 'Help me with code'
529
- }
530
- ]);
531
- service.setDefaultLoadingMessages([
532
- 'Thinking...',
533
- 'Processing your request...',
534
- 'Analyzing...',
535
- 'Working on it...'
536
- ]);
537
- service.setResourceManager(createResourceManager());
538
- unsubscribes.push(service.on(AutopilotChatEvent.Request, (data)=>{
539
- console.log('Request sent:', data);
540
- }));
541
- unsubscribes.push(service.on(AutopilotChatEvent.ModeChange, (mode)=>{
542
- console.log('Mode changed:', mode);
543
- }));
544
- unsubscribes.push(service.on(AutopilotChatEvent.SetSelectedModel, (model)=>{
545
- console.log('Model changed:', model);
546
- setSelectedModel(model.id || model);
547
- }));
548
- unsubscribes.push(service.on(AutopilotChatEvent.SetSelectedAgentMode, (mode)=>{
549
- console.log('Agent mode changed:', mode);
550
- setSelectedAgentMode(mode.id);
551
- }));
552
- unsubscribes.push(service.on(AutopilotChatEvent.ModeChange, (mode)=>{
553
- console.log('Chat mode changed:', mode);
554
- setChatMode(mode);
555
- }));
556
- unsubscribes.push(service.on('feedback', (data)=>{
557
- const { isPositive, message } = data;
558
- console.log(`Feedback: ${isPositive ? 'Positive' : 'Negative'}`, message);
559
- }));
560
- unsubscribes.push(service.on('copy', (message)=>{
561
- console.log('Copy event:', message);
562
- }));
563
- unsubscribes.push(service.on('attachments', (attachments)=>{
564
- console.log('Attachments:', attachments);
565
- }));
566
- unsubscribes.push(service.on('stopResponse', ()=>{
567
- console.log('Stop response event');
568
- }));
569
- unsubscribes.push(service.on(AutopilotChatEvent.RenameConversation, (payload)=>{
570
- const { conversationId, name } = payload;
571
- console.log(`[Rename] conversation ${conversationId} renamed to "${name}"`);
572
- }));
573
- const fakeSttPhrases = [
574
- 'How do I schedule an unattended robot to run every weekday at 9 AM',
575
- 'Show me the last ten failed jobs and group them by process name',
576
- 'Can you walk me through setting up Document Understanding for invoices'
577
- ];
578
- let sttPhraseIndex = 0;
579
- let sttDictationInterval = null;
580
- unsubscribes.push(service.on(AutopilotChatEvent.SpeechToTextToggle, (isActive)=>{
581
- console.log('[STT] toggle:', isActive);
582
- if (isActive) {
583
- const phrase = fakeSttPhrases[sttPhraseIndex % fakeSttPhrases.length] ?? '';
584
- sttPhraseIndex++;
585
- const words = phrase.split(' ');
586
- let wordIndex = 0;
587
- let transcript = '';
588
- sttDictationInterval = setInterval(()=>{
589
- if (wordIndex < words.length) {
590
- transcript += (0 === wordIndex ? '' : ' ') + words[wordIndex];
591
- service.setPrompt(transcript);
592
- wordIndex++;
593
- } else if (sttDictationInterval) {
594
- clearInterval(sttDictationInterval);
595
- sttDictationInterval = null;
596
- }
597
- }, 150);
598
- } else if (sttDictationInterval) {
599
- clearInterval(sttDictationInterval);
600
- sttDictationInterval = null;
601
- }
602
- }));
603
- unsubscribes.push(()=>{
604
- if (sttDictationInterval) {
605
- clearInterval(sttDictationInterval);
606
- sttDictationInterval = null;
607
- }
608
- });
609
- const fakeVoiceUserTurns = [
610
- 'How do I debug a workflow in UiPath Studio?',
611
- 'Can you suggest a retry strategy for flaky selectors?',
612
- 'What is the difference between Attended and Unattended automations?'
613
- ];
614
- const fakeVoiceAssistantReplies = [
615
- 'Start by enabling **Debug mode** in UiPath Studio and setting breakpoints on the activities you want to inspect. Use **Step Into** to walk through each action, and open the **Locals** panel to watch variables change.',
616
- 'Wrap the click/type activity in a **Retry Scope** with 3-5 attempts and a short delay (500ms-2s). Pair it with a **Check App State** condition so the retry fires only when the expected element is missing.',
617
- "**Attended** automations run on a user's machine alongside them. **Unattended** automations run on dedicated VMs without any user present; they're scheduled or queue-driven and scale across a robot fleet."
618
- ];
619
- let voiceTurnIndex = 0;
620
- let voicePendingTimeouts = [];
621
- let voicePendingInterval = null;
622
- let voiceActiveStreamId = null;
623
- const clearVoicePending = ()=>{
624
- for (const id of voicePendingTimeouts)clearTimeout(id);
625
- voicePendingTimeouts = [];
626
- if (voicePendingInterval) {
627
- clearInterval(voicePendingInterval);
628
- voicePendingInterval = null;
629
- }
630
- };
631
- unsubscribes.push(service.on(AutopilotChatEvent.InputStream, (event)=>{
632
- const ev = event;
633
- if (ev.activityStart) {
634
- console.log('[voice] activityStart', ev.activityStart);
635
- const userContent = fakeVoiceUserTurns[voiceTurnIndex % fakeVoiceUserTurns.length] ?? '';
636
- const assistantContent = fakeVoiceAssistantReplies[voiceTurnIndex % fakeVoiceAssistantReplies.length] ?? '';
637
- voiceTurnIndex++;
638
- voiceActiveStreamId = `voice-stream-${voiceTurnIndex}`;
639
- voicePendingTimeouts.push(setTimeout(()=>{
640
- service.sendRequest({
641
- content: userContent
642
- });
643
- voicePendingTimeouts.push(setTimeout(()=>{
644
- const words = assistantContent.split(' ');
645
- const streamId = voiceActiveStreamId ?? void 0;
646
- let wordIndex = 0;
647
- voicePendingInterval = setInterval(()=>{
648
- if (wordIndex < words.length) {
649
- service.sendResponse({
650
- id: streamId,
651
- content: (words[wordIndex] ?? '') + (wordIndex < words.length - 1 ? ' ' : ''),
652
- stream: true,
653
- created_at: new Date().toISOString(),
654
- widget: 'apollo-markdown-renderer'
655
- });
656
- wordIndex++;
657
- } else {
658
- if (voicePendingInterval) {
659
- clearInterval(voicePendingInterval);
660
- voicePendingInterval = null;
661
- }
662
- service.sendResponse({
663
- id: streamId,
664
- content: '',
665
- stream: true,
666
- done: true,
667
- created_at: new Date().toISOString(),
668
- widget: 'apollo-markdown-renderer'
669
- });
670
- }
671
- }, 80);
672
- }, 400));
673
- }, 600));
674
- }
675
- if (ev.mediaChunks) console.log('[voice] mediaChunks', ev.mediaChunks.length);
676
- if (ev.activityEnd) {
677
- console.log('[voice] activityEnd', ev.activityEnd);
678
- const wasStreaming = null !== voicePendingInterval;
679
- clearVoicePending();
680
- if (wasStreaming && voiceActiveStreamId) service.sendResponse({
681
- id: voiceActiveStreamId,
682
- content: '',
683
- stream: true,
684
- done: true,
685
- created_at: new Date().toISOString(),
686
- widget: 'apollo-markdown-renderer'
687
- });
688
- voiceActiveStreamId = null;
689
- }
690
- }));
691
- unsubscribes.push(()=>clearVoicePending());
692
- unsubscribes.push(service.on('customHeaderActionClicked', (action)=>{
693
- const actionData = action;
694
- console.log('Custom header action clicked:', actionData);
695
- let responseContent = '';
696
- switch(actionData.id){
697
- case 'export-pdf':
698
- responseContent = '📄 **Exporting as PDF...**\n\nYour conversation has been exported to a PDF file.';
699
- break;
700
- case 'export-docx':
701
- responseContent = '📝 **Exporting as DOCX...**\n\nYour conversation has been exported to a Word document.';
702
- break;
703
- case 'export-json':
704
- responseContent = '💾 **Exporting as JSON...**\n\nYour conversation has been exported as JSON data.';
705
- break;
706
- case 'export-txt':
707
- responseContent = '📋 **Exporting as Text...**\n\nYour conversation has been exported as plain text.';
708
- break;
709
- case 'share':
710
- responseContent = '🔗 **Share Conversation**\n\nA shareable link has been generated:\n`https://example.com/chat/abc123`';
711
- break;
712
- case 'translate-es':
713
- responseContent = '🇪🇸 **Traduciendo al español...**\n\nSu conversación ha sido traducida al español.';
714
- break;
715
- case 'translate-fr':
716
- responseContent = '🇫🇷 **Traduction en français...**\n\nVotre conversation a été traduite en français.';
717
- break;
718
- case 'translate-de':
719
- responseContent = '🇩🇪 **Übersetzung ins Deutsche...**\n\nIhre Unterhaltung wurde ins Deutsche übersetzt.';
720
- break;
721
- case 'translate-ja':
722
- responseContent = '🇯🇵 **日本語に翻訳中...**\n\n会話が日本語に翻訳されました。';
723
- break;
724
- case 'translate-zh':
725
- responseContent = '🇨🇳 **正在翻译成中文...**\n\n您的对话已翻译成中文。';
726
- break;
727
- case 'print':
728
- responseContent = '🖨️ **Print Conversation**\n\nPreparing conversation for printing...';
729
- break;
730
- default:
731
- responseContent = `✅ Action triggered: **${actionData.name}** (ID: ${actionData.id})`;
732
- }
733
- service.sendResponse({
734
- content: responseContent,
735
- groupId: `custom-action-${actionData.id}`,
736
- created_at: '22-10-2025',
737
- widget: 'apollo-markdown-renderer'
738
- });
739
- }));
740
- return ()=>{
741
- for (const unsubscribe of unsubscribes)unsubscribe();
742
- service.close();
743
- };
744
- }, [
745
- instanceName,
746
- initialMode,
747
- createResourceManager,
748
- createSettingsRenderer,
749
- features.attachments,
750
- features.audio,
751
- features.audioStreaming,
752
- features.close,
753
- features.copy,
754
- features.feedback,
755
- features.fullHeight,
756
- features.headerSeparator,
757
- features.history,
758
- features.htmlPreview,
759
- features.renameChat,
760
- features.resize,
761
- features.settings,
762
- features.stopResponse,
763
- features.readOnly
764
- ]);
765
- useEffect(()=>{
766
- if (chatService && chatMode === AutopilotChatMode.Embedded && embeddedContainerRef.current) chatService.patchConfig({
767
- mode: AutopilotChatMode.Embedded,
768
- embeddedContainer: embeddedContainerRef.current
769
- });
770
- }, [
771
- chatService,
772
- chatMode
773
- ]);
774
- useEffect(()=>{
775
- if (chatService) {
776
- chatService.initialize({
777
- mode: chatMode,
778
- readOnly: features.readOnly,
779
- disabledFeatures: {
780
- history: !features.history,
781
- settings: !features.settings,
782
- attachments: !features.attachments,
783
- audio: !features.audio,
784
- audioStreaming: !features.audioStreaming,
785
- htmlPreview: !features.htmlPreview,
786
- headerSeparator: !features.headerSeparator,
787
- fullHeight: !features.fullHeight,
788
- resize: !features.resize,
789
- close: !features.close,
790
- feedback: !features.feedback,
791
- copy: !features.copy,
792
- renameChat: !features.renameChat,
793
- stopResponse: !features.stopResponse
794
- },
795
- settingsRenderer: createSettingsRenderer(),
796
- ...chatMode === AutopilotChatMode.Embedded && embeddedContainerRef.current && {
797
- embeddedContainer: embeddedContainerRef.current
798
- }
799
- });
800
- if (features.model) {
801
- chatService.setModels([
802
- {
803
- id: 'gpt-4',
804
- name: 'GPT-4',
805
- description: 'Most capable model'
806
- },
807
- {
808
- id: 'gpt-3.5',
809
- name: 'GPT-3.5 Turbo',
810
- description: 'Fast and efficient'
811
- },
812
- {
813
- id: 'claude-3',
814
- name: 'Claude 3',
815
- description: 'Anthropic model'
816
- }
817
- ]);
818
- chatService.setSelectedModel(selectedModel);
819
- } else chatService.setModels([]);
820
- if (features.agentMode) {
821
- chatService.setAgentModes([
822
- {
823
- id: 'agent',
824
- name: 'Agent',
825
- description: 'AI-powered autonomous agent mode',
826
- icon: 'smart_toy'
827
- },
828
- {
829
- id: 'plan',
830
- name: 'Plan',
831
- description: 'Create and review execution plans',
832
- icon: 'edit_note'
833
- },
834
- {
835
- id: 'attended',
836
- name: 'Attended',
837
- description: 'Human assisted execution',
838
- icon: 'play_arrow'
839
- }
840
- ]);
841
- chatService.setAgentMode(selectedAgentMode);
842
- } else chatService.setAgentModes([]);
843
- chatService.patchConfig({
844
- paginatedMessages: features.paginatedMessages,
845
- paginatedResources: resourcePaginationEnabled,
846
- spacing: {
847
- compactMode: features.compactMode,
848
- ...features.compactMode ? {} : {
849
- primaryFontToken,
850
- promptBox: {
851
- minRows: promptBoxMinRows,
852
- maxRows: promptBoxMaxRows
853
- }
854
- }
855
- },
856
- theming: {
857
- scrollBar: features.customScrollTheme ? {
858
- scrollThumbColor: '#000000',
859
- scrollSize: '16px',
860
- scrollHoverColor: '#888888',
861
- scrollBorderRadius: '8px'
862
- } : void 0
863
- }
864
- });
865
- if (features.attachmentsAsync) chatService.on('setAttachments', (attachments)=>{
866
- const attachmentsData = attachments;
867
- chatService.setAttachmentsLoading([
868
- ...attachmentsData.added.map((attachment)=>({
869
- ...attachment,
870
- loading: true
871
- }))
872
- ]);
873
- setTimeout(()=>{
874
- chatService.setAttachmentsLoading([
875
- ...attachmentsData.added.map((attachment)=>({
876
- ...attachment,
877
- loading: false
878
- }))
879
- ]);
880
- }, 2000);
881
- });
882
- else chatService.setAttachmentsLoading([]);
883
- }
884
- }, [
885
- features,
886
- chatService,
887
- selectedModel,
888
- selectedAgentMode,
889
- createSettingsRenderer,
890
- chatMode,
891
- primaryFontToken,
892
- promptBoxMinRows,
893
- promptBoxMaxRows,
894
- resourcePaginationEnabled
895
- ]);
896
- const openChat = ()=>chatService?.open();
897
- const closeChat = ()=>chatService?.close();
898
- const setFullScreen = ()=>{
899
- chatService?.setChatMode(AutopilotChatMode.FullScreen);
900
- setChatMode(AutopilotChatMode.FullScreen);
901
- };
902
- const setSideBySide = ()=>{
903
- chatService?.setChatMode(AutopilotChatMode.SideBySide);
904
- setChatMode(AutopilotChatMode.SideBySide);
905
- };
906
- const setEmbedded = ()=>{
907
- setChatMode(AutopilotChatMode.Embedded);
908
- chatService?.setChatMode(AutopilotChatMode.Embedded);
909
- };
910
- const sendSimpleRequest = ()=>{
911
- chatService?.sendRequest({
912
- content: customMessage
913
- });
914
- };
915
- const sendSimpleResponse = ()=>{
916
- chatService?.sendResponse({
917
- content: customMessage,
918
- created_at: '22-10-2025',
919
- widget: 'apollo-markdown-renderer',
920
- shouldWaitForMoreMessages: waitForMore
921
- });
922
- };
923
- const sendResponseWithActions = ()=>{
924
- chatService?.sendResponse({
925
- content: 'Here is a response with custom actions. Try the buttons below!',
926
- created_at: '22-10-2025',
927
- widget: 'apollo-markdown-renderer',
928
- actions: [
929
- {
930
- name: 'copy-action',
931
- label: 'Copy to Clipboard',
932
- icon: 'content_copy',
933
- eventName: 'copy-custom'
934
- },
935
- {
936
- name: 'regenerate-action',
937
- label: 'Regenerate',
938
- icon: 'refresh',
939
- eventName: 'regenerate-custom'
940
- }
941
- ]
942
- });
943
- chatService?.on('copy-custom', ()=>{
944
- navigator.clipboard.writeText('Response copied!');
945
- console.log('Copied to clipboard!');
946
- });
947
- chatService?.on('regenerate-custom', ()=>{
948
- console.log('Regenerating response...');
949
- });
950
- };
951
- const sendResponseWithCitations = ()=>{
952
- chatService?.sendResponse({
953
- content: 'According to research, the sky is blue due to Rayleigh scattering. See references below for more information.',
954
- widget: 'default',
955
- contentParts: [
956
- {
957
- text: 'According to research, the sky is blue due to Rayleigh scattering. ',
958
- citations: [
959
- {
960
- id: 1,
961
- title: 'Why is the Sky Blue?',
962
- url: 'https://example.com/sky'
963
- }
964
- ]
965
- },
966
- {
967
- text: 'See references below for more information.',
968
- citations: [
969
- {
970
- id: 2,
971
- title: 'Atmospheric Science',
972
- url: 'https://example.com/atmosphere'
973
- }
974
- ]
975
- }
976
- ]
977
- });
978
- };
979
- const sendStreamingResponse = ()=>{
980
- chatService?.sendResponse({
981
- content: streamingText,
982
- fakeStream: true,
983
- shouldWaitForMoreMessages: waitForMore
984
- });
985
- };
986
- const sendCodeBlock = ()=>{
987
- const codeContent = `\`\`\`typescript
988
- // This is a long comment line that should wrap properly when displayed in the code block to test the wrapping functionality
989
- interface UserProfile {
990
- id: number;
991
- username: string;
992
- email: string;
993
- firstName: string;
994
- lastName: string;
995
- createdAt: Date;
996
- updatedAt: Date;
997
- preferences: { theme: 'light' | 'dark'; language: string; notifications: boolean };
998
- }
999
-
1000
- function processUserData(user: UserProfile, additionalMetadata: Record<string, unknown>): string {
1001
- const fullName = \`\${user.firstName} \${user.lastName}\`;
1002
- const metadataString = JSON.stringify(additionalMetadata, null, 2);
1003
-
1004
- return \`User: \${fullName} (\${user.email}) - Created: \${user.createdAt.toISOString()} - Metadata: \${metadataString}\`;
1005
- }
1006
-
1007
- const exampleUser: UserProfile = {
1008
- id: 12345,
1009
- username: 'john_doe_with_a_very_long_username_that_should_test_wrapping',
1010
- email: 'john.doe.with.a.very.long.email.address@example-domain-name.com',
1011
- firstName: 'John',
1012
- lastName: 'Doe',
1013
- createdAt: new Date(),
1014
- updatedAt: new Date(),
1015
- preferences: { theme: 'dark', language: 'en-US', notifications: true }
1016
- };
1017
-
1018
- console.log(processUserData(exampleUser, { source: 'web', ipAddress: '192.168.1.1', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' }));
1019
- \`\`\``;
1020
- chatService?.sendResponse({
1021
- content: `Here's a TypeScript example with long lines to test wrapping:\n\n${codeContent}`,
1022
- widget: 'default'
1023
- });
1024
- };
1025
- const sendHTMLPreview = ()=>{
1026
- const htmlContent = `\`\`\`html
1027
- <!DOCTYPE html>
1028
- <html>
1029
- <head>
1030
- <title>Hello World</title>
1031
- <style>
1032
- body { font-family: Arial; text-align: center; padding: 50px; }
1033
- h1 { color: #fa4616; }
1034
- </style>
1035
- </head>
1036
- <body>
1037
- <h1>Hello, World!</h1>
1038
- <p>This is an HTML preview example.</p>
1039
- </body>
1040
- </html>
1041
- \`\`\``;
1042
- chatService?.sendResponse({
1043
- content: `Here's an HTML example with live preview:\n\n${htmlContent}`,
1044
- widget: 'default'
1045
- });
1046
- };
1047
- const showLoading = ()=>{
1048
- chatService?.setLoadingMessage(loadingMessage);
1049
- };
1050
- const hideLoading = ()=>{
1051
- chatService?.setLoadingMessage('');
1052
- };
1053
- const showError = ()=>{
1054
- chatService?.setError(errorMessage);
1055
- };
1056
- const showWarning = ()=>{
1057
- chatService?.setError('This is a warning message.');
1058
- };
1059
- const clearErrors = ()=>{
1060
- chatService?.clearError();
1061
- };
1062
- const toggleHistory = ()=>{
1063
- chatService?.toggleHistory();
1064
- };
1065
- const addHistoryItems = ()=>{
1066
- chatService?.setHistory([
1067
- {
1068
- id: '1',
1069
- name: 'Previous Conversation 1',
1070
- timestamp: new Date(Date.now() - 86400000).toISOString()
1071
- },
1072
- {
1073
- id: '2',
1074
- name: 'Previous Conversation 2',
1075
- timestamp: new Date(Date.now() - 172800000).toISOString()
1076
- },
1077
- {
1078
- id: '3',
1079
- name: 'Previous Conversation 3',
1080
- timestamp: new Date(Date.now() - 259200000).toISOString()
1081
- }
1082
- ]);
1083
- };
1084
- const clearChat = ()=>{
1085
- chatService?.newChat();
1086
- };
1087
- const toggleFeature = (feature)=>{
1088
- setFeatures((prev)=>({
1089
- ...prev,
1090
- [feature]: !prev[feature]
1091
- }));
1092
- };
1093
- const setPrompt = ()=>{
1094
- chatService?.setPrompt('I need something to be done');
1095
- };
1096
- const resetPrompt = ()=>{
1097
- chatService?.setPrompt('');
1098
- };
1099
- const stopResponse = ()=>{
1100
- chatService?.stopResponse();
1101
- };
1102
- const toggleAutoScroll = ()=>{
1103
- const newValue = !autoScroll;
1104
- setAutoScroll(newValue);
1105
- chatService?.toggleAutoScroll(newValue);
1106
- };
1107
- const setAllowedAttachments = ()=>{
1108
- chatService?.setAllowedAttachments({
1109
- types: {
1110
- 'text/csv': [
1111
- '.csv'
1112
- ]
1113
- },
1114
- maxSize: 1048576,
1115
- multiple: false
1116
- });
1117
- console.log('Allowed attachments set to: CSV files only, max 1MB');
1118
- };
1119
- const setFirstRunExperience = ()=>{
1120
- chatService?.setFirstRunExperience({
1121
- title: 'Welcome to UiPath Autopilot',
1122
- description: "I'm here to help you build, understand, and troubleshoot your automation projects.",
1123
- suggestions: [
1124
- {
1125
- label: 'New process',
1126
- prompt: 'Can you provide a detailed step-by-step guide on how to create a new automation process?'
1127
- },
1128
- {
1129
- label: 'Debug workflow',
1130
- prompt: "I'm having trouble with my workflow execution. Can you explain debugging techniques?"
1131
- },
1132
- {
1133
- label: 'Studio updates',
1134
- prompt: 'What are the latest features in UiPath Studio?'
1135
- }
1136
- ]
1137
- });
1138
- };
1139
- const setConversation = ()=>{
1140
- chatService?.setConversation([
1141
- {
1142
- id: '1',
1143
- role: AutopilotChatRole.User,
1144
- content: 'How do I create a workflow that extracts data from invoices?',
1145
- created_at: '22-10-2022',
1146
- widget: ''
1147
- },
1148
- {
1149
- id: '2',
1150
- role: AutopilotChatRole.Assistant,
1151
- content: 'To extract data from invoices, you can use UiPath Document Understanding. Here\'s a step-by-step approach:\n\n1. Install the Document Understanding package\n2. Create a new workflow and add the "Digitize Document" activity\n3. Configure it to use ML skills\n4. Use the "Data Extraction" activity\n5. Validate the extracted data',
1152
- created_at: '23-10-2022',
1153
- widget: ''
1154
- }
1155
- ]);
1156
- };
1157
- const setSuggestions = ()=>{
1158
- chatService?.setSuggestions([
1159
- {
1160
- label: 'What can you do?',
1161
- prompt: 'What can you do?'
1162
- },
1163
- {
1164
- label: 'Show me an example',
1165
- prompt: 'Show me an example'
1166
- },
1167
- {
1168
- label: 'Help me with code',
1169
- prompt: 'Help me with code'
1170
- }
1171
- ], true);
1172
- };
1173
- const sendToolCall = (displayMode)=>{
1174
- const now = new Date().toISOString();
1175
- const start = new Date(Date.now() - 2500).toISOString();
1176
- if (displayMode === ConversationalDisplayModeTypes.FullTrace) return void chatService?.sendResponse({
1177
- content: 'Tool call response',
1178
- widget: 'apollo-agents-tool-call',
1179
- meta: {
1180
- displayMode,
1181
- span: {
1182
- key: 'multi-web-search',
1183
- name: 'Tool call - Multi_Web_Search',
1184
- data: {
1185
- id: 'root-span',
1186
- name: 'Tool call - Multi_Web_Search',
1187
- startTime: new Date(Date.now() - 25000).toISOString(),
1188
- endTime: now,
1189
- status: 'ok',
1190
- type: 'toolCall',
1191
- attributes: {
1192
- toolName: 'Multi_Web_Search',
1193
- toolType: 'Agent',
1194
- arguments: {
1195
- query: 'what are trending right now'
1196
- },
1197
- result: {
1198
- result: 'Multi web search completed successfully.'
1199
- }
1200
- }
1201
- },
1202
- children: [
1203
- {
1204
- key: 'autonomous-web-search',
1205
- name: 'Autonomous Web Search',
1206
- data: {
1207
- id: 'agentTool-1',
1208
- name: 'Autonomous Web Search',
1209
- startTime: new Date(Date.now() - 25000).toISOString(),
1210
- endTime: now,
1211
- status: 'ok',
1212
- type: 'agentTool'
1213
- },
1214
- children: [
1215
- {
1216
- key: 'agent-run-1',
1217
- name: 'Agent run - Autonomous Web Search',
1218
- data: {
1219
- id: 'agentRun-1',
1220
- name: 'Agent run - Autonomous Web Search',
1221
- startTime: new Date(Date.now() - 23000).toISOString(),
1222
- endTime: now,
1223
- status: 'ok',
1224
- type: 'agentRun'
1225
- },
1226
- children: [
1227
- {
1228
- key: 'tool-call-web-search-1',
1229
- name: 'Tool call - Web_Search',
1230
- data: {
1231
- id: 'ws1',
1232
- name: 'Tool call - Web_Search',
1233
- type: 'toolCall',
1234
- status: 'ok',
1235
- startTime: new Date(Date.now() - 21000).toISOString(),
1236
- endTime: new Date(Date.now() - 17000).toISOString()
1237
- },
1238
- children: []
1239
- },
1240
- {
1241
- key: 'tool-call-web-search-2',
1242
- name: 'Tool call - Web_Search',
1243
- data: {
1244
- id: 'ws2',
1245
- name: 'Tool call - Web_Search',
1246
- type: 'toolCall',
1247
- status: 'ok',
1248
- startTime: new Date(Date.now() - 16000).toISOString(),
1249
- endTime: new Date(Date.now() - 10000).toISOString()
1250
- },
1251
- children: []
1252
- }
1253
- ]
1254
- }
1255
- ]
1256
- }
1257
- ]
1258
- }
1259
- }
1260
- });
1261
- chatService?.sendResponse({
1262
- content: 'Tool call response',
1263
- widget: 'apollo-agents-tool-call',
1264
- meta: {
1265
- displayMode,
1266
- input: {
1267
- provider: 'GoogleCustomSearch',
1268
- query: 'most interesting scientific fact discovered recently 2025',
1269
- num: 5
1270
- },
1271
- output: {
1272
- results: [
1273
- {
1274
- snippet: 'Breaking science news and articles...',
1275
- title: 'ScienceDaily: Latest Research News',
1276
- url: 'https://www.sciencedaily.com/'
1277
- }
1278
- ]
1279
- },
1280
- isError: false,
1281
- startTime: start,
1282
- endTime: now,
1283
- toolName: 'Web_Search'
1284
- }
1285
- });
1286
- };
1287
- const sendResponseDisabledActions = ()=>{
1288
- chatService?.sendResponse({
1289
- content: 'Message with no actions',
1290
- disableActions: true
1291
- });
1292
- };
1293
- const setPreHook = ()=>{
1294
- const actions = [
1295
- 'new-chat',
1296
- 'toggle-history',
1297
- 'toggle-chat',
1298
- 'close-chat',
1299
- 'feedback',
1300
- 'rename-conversation'
1301
- ];
1302
- actions.forEach((action)=>{
1303
- chatService?.setPreHook(action, async ()=>window.confirm(`${action} pre hook. Continue?`));
1304
- });
1305
- console.log('Pre-hooks set for all actions');
1306
- };
1307
- const setCustomHeaderActions = ()=>{
1308
- chatService?.setCustomHeaderActions([
1309
- {
1310
- id: 'export',
1311
- name: 'Export',
1312
- icon: 'download',
1313
- description: 'Export conversation in various formats',
1314
- children: [
1315
- {
1316
- id: 'export-pdf',
1317
- name: 'Export as PDF',
1318
- icon: 'picture_as_pdf',
1319
- description: 'Download conversation as PDF file'
1320
- },
1321
- {
1322
- id: 'export-docx',
1323
- name: 'Export as DOCX',
1324
- icon: "description",
1325
- description: 'Download conversation as Word document'
1326
- },
1327
- {
1328
- id: 'export-json',
1329
- name: 'Export as JSON',
1330
- icon: 'data_object',
1331
- description: 'Download conversation as JSON file'
1332
- },
1333
- {
1334
- id: 'export-txt',
1335
- name: 'Export as Text',
1336
- icon: 'text_snippet',
1337
- description: 'Download conversation as plain text'
1338
- }
1339
- ]
1340
- },
1341
- {
1342
- id: 'share',
1343
- name: 'Share Conversation',
1344
- icon: 'share',
1345
- description: 'Share this conversation with others'
1346
- },
1347
- {
1348
- id: 'translate',
1349
- name: 'Translate',
1350
- icon: 'translate',
1351
- description: 'Translate conversation to different languages',
1352
- children: [
1353
- {
1354
- id: 'translate-es',
1355
- name: 'Spanish',
1356
- icon: 'language',
1357
- description: 'Translate to Spanish'
1358
- },
1359
- {
1360
- id: 'translate-fr',
1361
- name: 'French',
1362
- icon: 'language',
1363
- description: 'Translate to French'
1364
- },
1365
- {
1366
- id: 'translate-de',
1367
- name: 'German',
1368
- icon: 'language',
1369
- description: 'Translate to German'
1370
- },
1371
- {
1372
- id: 'translate-ja',
1373
- name: 'Japanese',
1374
- icon: 'language',
1375
- description: 'Translate to Japanese'
1376
- },
1377
- {
1378
- id: 'translate-zh',
1379
- name: 'Chinese',
1380
- icon: 'language',
1381
- description: 'Translate to Chinese'
1382
- }
1383
- ]
1384
- },
1385
- {
1386
- id: 'print',
1387
- name: 'Print',
1388
- icon: 'print',
1389
- description: 'Print conversation'
1390
- },
1391
- {
1392
- id: 'advanced',
1393
- name: 'Advanced Settings',
1394
- icon: 'tune',
1395
- description: 'Advanced configuration options',
1396
- disabled: true
1397
- }
1398
- ]);
1399
- console.log('Custom header actions set');
1400
- };
1401
- const clearCustomHeaderActions = ()=>{
1402
- chatService?.setCustomHeaderActions([]);
1403
- console.log('Custom header actions cleared');
1404
- };
1405
- const setResourceManager = ()=>{
1406
- chatService?.setResourceManager(createResourceManager());
1407
- console.log('Resource manager set');
1408
- };
1409
- const clearResourceManager = ()=>{
1410
- chatService?.setResourceManager(null);
1411
- console.log('Resource manager cleared');
1412
- };
1413
- useEffect(()=>{
1414
- if (chatService) {
1415
- chatService.setResourceManager(createResourceManager());
1416
- console.log(`Resource manager updated: pagination=${resourcePaginationEnabled}, pageSize=${resourcePageSize}`);
1417
- }
1418
- }, [
1419
- chatService,
1420
- createResourceManager,
1421
- resourcePaginationEnabled,
1422
- resourcePageSize
1423
- ]);
1424
- const sendResponseWithVariables = ()=>{
1425
- chatService?.sendResponse({
1426
- content: 'I will update [[resource-token:{"id":"var-email","type":"variable","icon":"mail","displayName":"email"}]] and [[resource-token:{"id":"var-long","type":"variable","icon":"data_object","displayName":"this_is_a_very_long_variable_name_that_should_test_truncation"}]] in the system, then notify [[resource-token:{"id":"var-username","type":"variable","icon":"person","displayName":"username"}]] when complete.',
1427
- created_at: '02-02-2026',
1428
- widget: 'default'
1429
- });
1430
- console.log('Sent response with resource tokens');
1431
- };
1432
- const streamWithResourceTokens = ()=>{
1433
- const messageId = `streaming-resources-${Date.now()}`;
1434
- let chunkIndex = 0;
1435
- const chunks = [
1436
- 'I will update the ',
1437
- '[[resource-token:',
1438
- '{"id":"var-',
1439
- 'email","type":"variable",',
1440
- '"icon":"mail","displayName":"email"}]]',
1441
- ' variable in the system.\n\n',
1442
- "Then I'll notify ",
1443
- '[[resource-token:{',
1444
- '"id":"var-username",',
1445
- '"type":"variable","icon":"person",',
1446
- '"displayName":"username"}]]',
1447
- ' when the process is complete.\n\n',
1448
- "I'll also update ",
1449
- '[[resource-token:{',
1450
- '"id":"var-long","type":"variable",',
1451
- '"icon":"data_object","displayName":',
1452
- '"this_is_a_very_long_variable_name_that_should_test_truncation"}]]',
1453
- ' for testing.\n\n',
1454
- "Finally, I'll log the result to ",
1455
- '[[resource-token:{"id":"var-log","type":"variable","icon":"description","displayName":"activity_log"}]]',
1456
- '.'
1457
- ];
1458
- const streamChunk = ()=>{
1459
- if (chunkIndex >= chunks.length) return;
1460
- const chunk = chunks[chunkIndex] ?? '';
1461
- const isDone = chunkIndex === chunks.length - 1;
1462
- chatService?.sendResponse({
1463
- id: messageId,
1464
- content: chunk,
1465
- stream: true,
1466
- done: isDone,
1467
- created_at: '02-02-2026',
1468
- widget: 'default'
1469
- });
1470
- const preview = chunk.slice(0, 30);
1471
- const suffix = chunk.length > 30 ? '...' : '';
1472
- console.log(`[StreamWithResourceTokens] Chunk ${chunkIndex + 1}/${chunks.length}: "${preview}${suffix}" (done: ${isDone})`);
1473
- chunkIndex++;
1474
- if (!isDone) setTimeout(streamChunk, 150);
1475
- };
1476
- streamChunk();
1477
- };
1478
- const streamWithCitations = ()=>{
1479
- const messageId = `streaming-citations-${Date.now()}`;
1480
- let streamIndex = 0;
1481
- const streamingParts = [
1482
- {
1483
- index: 0,
1484
- text: 'Based on the search results'
1485
- },
1486
- {
1487
- index: 0,
1488
- text: ", I'll"
1489
- },
1490
- {
1491
- index: 0,
1492
- text: ' create a comprehensive'
1493
- },
1494
- {
1495
- index: 0,
1496
- text: ' summary about UiPath with'
1497
- },
1498
- {
1499
- index: 0,
1500
- text: ' citations:\n\n##'
1501
- },
1502
- {
1503
- index: 0,
1504
- text: ' Company Background'
1505
- },
1506
- {
1507
- index: 0,
1508
- text: '\n- '
1509
- },
1510
- {
1511
- index: 1,
1512
- text: '**UiPath Inc**'
1513
- },
1514
- {
1515
- index: 1,
1516
- text: '. is a global'
1517
- },
1518
- {
1519
- index: 1,
1520
- text: ' software company that was'
1521
- },
1522
- {
1523
- index: 1,
1524
- text: ' founded in '
1525
- },
1526
- {
1527
- index: 1,
1528
- text: '_Bucharest, Romania_'
1529
- },
1530
- {
1531
- index: 1,
1532
- text: ', by'
1533
- },
1534
- {
1535
- index: 1,
1536
- text: ' **Daniel Dines**'
1537
- },
1538
- {
1539
- index: 1,
1540
- text: '',
1541
- citation: {
1542
- id: 1,
1543
- title: 'UiPath - Wikipedia',
1544
- url: 'https://en.wikipedia.org/wiki/UiPath'
1545
- }
1546
- },
1547
- {
1548
- index: 2,
1549
- text: '. '
1550
- },
1551
- {
1552
- index: 3,
1553
- text: 'The'
1554
- },
1555
- {
1556
- index: 3,
1557
- text: ' company starte'
1558
- },
1559
- {
1560
- index: 3,
1561
- text: 'd its journey'
1562
- },
1563
- {
1564
- index: 3,
1565
- text: ' in 2005'
1566
- },
1567
- {
1568
- index: 3,
1569
- text: ' and has'
1570
- },
1571
- {
1572
- index: 3,
1573
- text: ' grown to become a leading'
1574
- },
1575
- {
1576
- index: 3,
1577
- text: ' enterprise automation software ven'
1578
- },
1579
- {
1580
- index: 3,
1581
- text: 'dor',
1582
- citation: {
1583
- id: 1,
1584
- title: 'UiPath - Wikipedia',
1585
- url: 'https://en.wikipedia.org/wiki/UiPath'
1586
- }
1587
- },
1588
- {
1589
- index: 3,
1590
- text: '',
1591
- citation: {
1592
- id: 2,
1593
- title: 'UiPath, Inc. (PATH)',
1594
- url: 'https://ir.uipath.com/'
1595
- }
1596
- },
1597
- {
1598
- index: 4,
1599
- text: '. \n\n## Core'
1600
- },
1601
- {
1602
- index: 4,
1603
- text: ' Business'
1604
- },
1605
- {
1606
- index: 4,
1607
- text: '\nU'
1608
- },
1609
- {
1610
- index: 4,
1611
- text: 'iPath special'
1612
- },
1613
- {
1614
- index: 4,
1615
- text: 'izes in several'
1616
- },
1617
- {
1618
- index: 4,
1619
- text: ' key areas:\n\n1'
1620
- },
1621
- {
1622
- index: 4,
1623
- text: '. **Rob'
1624
- },
1625
- {
1626
- index: 4,
1627
- text: 'otic Process Automation'
1628
- },
1629
- {
1630
- index: 4,
1631
- text: ':**'
1632
- },
1633
- {
1634
- index: 4,
1635
- text: '\n'
1636
- },
1637
- {
1638
- index: 5,
1639
- text: 'R'
1640
- },
1641
- {
1642
- index: 5,
1643
- text: 'PA has'
1644
- },
1645
- {
1646
- index: 5,
1647
- text: ' revolutionized how work'
1648
- },
1649
- {
1650
- index: 5,
1651
- text: ' gets done globally'
1652
- },
1653
- {
1654
- index: 5,
1655
- text: ' by eliminating time'
1656
- },
1657
- {
1658
- index: 5,
1659
- text: '-consuming, repet'
1660
- },
1661
- {
1662
- index: 5,
1663
- text: 'itive tasks from employees'
1664
- },
1665
- {
1666
- index: 5,
1667
- text: "' worklo"
1668
- },
1669
- {
1670
- index: 5,
1671
- text: 'ads',
1672
- citation: {
1673
- id: 3,
1674
- title: 'Discovery Phase Guide',
1675
- download_url: 'https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf',
1676
- page_number: 2
1677
- }
1678
- },
1679
- {
1680
- index: 6,
1681
- text: '.'
1682
- },
1683
- {
1684
- index: 6,
1685
- text: '\n\n2. **'
1686
- },
1687
- {
1688
- index: 6,
1689
- text: 'Business Automation Platform**'
1690
- },
1691
- {
1692
- index: 6,
1693
- text: '\n'
1694
- },
1695
- {
1696
- index: 7,
1697
- text: 'The platform'
1698
- },
1699
- {
1700
- index: 7,
1701
- text: ' offers en'
1702
- },
1703
- {
1704
- index: 7,
1705
- text: 'd-to-en'
1706
- },
1707
- {
1708
- index: 7,
1709
- text: 'd process transformation'
1710
- },
1711
- {
1712
- index: 7,
1713
- text: ' capabilities on'
1714
- },
1715
- {
1716
- index: 7,
1717
- text: ' a single platform,'
1718
- },
1719
- {
1720
- index: 7,
1721
- text: ' featuring fully'
1722
- },
1723
- {
1724
- index: 7,
1725
- text: ' governed agentic'
1726
- },
1727
- {
1728
- index: 7,
1729
- text: ' automation that integ'
1730
- },
1731
- {
1732
- index: 7,
1733
- text: 'rates with existing systems'
1734
- },
1735
- {
1736
- index: 7,
1737
- text: '',
1738
- citation: {
1739
- id: 4,
1740
- title: 'UiPath Business Automation Platform | UiPath',
1741
- url: 'https://www.uipath.com/product'
1742
- }
1743
- }
1744
- ];
1745
- const streamChunk = ()=>{
1746
- if (streamIndex >= streamingParts.length) return;
1747
- const chunk = streamingParts[streamIndex];
1748
- if (!chunk) return;
1749
- chatService?.sendResponse({
1750
- id: messageId,
1751
- contentPartChunk: {
1752
- index: chunk.index,
1753
- text: chunk.text,
1754
- ...chunk.citation && {
1755
- citation: chunk.citation
1756
- }
1757
- },
1758
- stream: true,
1759
- done: streamIndex === streamingParts.length - 1
1760
- });
1761
- streamIndex++;
1762
- if (streamIndex < streamingParts.length) setTimeout(streamChunk, 100);
1763
- };
1764
- streamChunk();
1765
- };
1766
- const handleAgentModeChange = (mode)=>{
1767
- setSelectedAgentMode(mode);
1768
- chatService?.setAgentMode(mode);
1769
- };
1770
- const handleModelChange = (modelId)=>{
1771
- setSelectedModel(modelId);
1772
- chatService?.setSelectedModel(modelId);
1773
- };
1774
- return /*#__PURE__*/ jsxs(Box, {
1775
- sx: {
1776
- display: 'flex',
1777
- width: '100%'
1778
- },
1779
- children: [
1780
- /*#__PURE__*/ jsxs(Box, {
1781
- sx: {
1782
- display: chatMode === AutopilotChatMode.FullScreen ? 'none' : 'flex',
1783
- flexDirection: 'column',
1784
- flexGrow: 1,
1785
- gap: 1,
1786
- maxHeight: '100vh',
1787
- overflowY: 'auto',
1788
- p: '16px 0 0 16px',
1789
- boxSizing: 'border-box'
1790
- },
1791
- children: [
1792
- /*#__PURE__*/ jsx(ApTypography, {
1793
- variant: FontVariantToken.fontSizeH3Bold,
1794
- component: "h2",
1795
- sx: {
1796
- mb: 3
1797
- },
1798
- children: "ApChat Showcase"
1799
- }),
1800
- /*#__PURE__*/ jsxs(Section, {
1801
- children: [
1802
- /*#__PURE__*/ jsx(SectionTitle, {
1803
- children: "Chat Mode Controls"
1804
- }),
1805
- /*#__PURE__*/ jsxs(ButtonGroup, {
1806
- children: [
1807
- /*#__PURE__*/ jsx(DemoButton, {
1808
- primary: true,
1809
- onClick: openChat,
1810
- children: "Open Chat"
1811
- }),
1812
- /*#__PURE__*/ jsx(DemoButton, {
1813
- onClick: closeChat,
1814
- children: "Close Chat"
1815
- })
1816
- ]
1817
- }),
1818
- /*#__PURE__*/ jsxs(ButtonGroup, {
1819
- children: [
1820
- /*#__PURE__*/ jsx(DemoButton, {
1821
- onClick: setSideBySide,
1822
- children: "Side by Side"
1823
- }),
1824
- /*#__PURE__*/ jsx(DemoButton, {
1825
- onClick: setFullScreen,
1826
- children: "Full Screen"
1827
- }),
1828
- /*#__PURE__*/ jsx(DemoButton, {
1829
- onClick: setEmbedded,
1830
- children: "Embedded"
1831
- })
1832
- ]
1833
- }),
1834
- /*#__PURE__*/ jsxs(ButtonGroup, {
1835
- children: [
1836
- /*#__PURE__*/ jsx(DemoButton, {
1837
- onClick: toggleAutoScroll,
1838
- children: "Toggle Auto Scroll"
1839
- }),
1840
- /*#__PURE__*/ jsx(DemoButton, {
1841
- onClick: clearChat,
1842
- children: "Clear Chat"
1843
- })
1844
- ]
1845
- })
1846
- ]
1847
- }),
1848
- /*#__PURE__*/ jsxs(Section, {
1849
- children: [
1850
- /*#__PURE__*/ jsx(SectionTitle, {
1851
- children: "Chat Setup"
1852
- }),
1853
- /*#__PURE__*/ jsxs(ButtonGroup, {
1854
- children: [
1855
- /*#__PURE__*/ jsx(DemoButton, {
1856
- onClick: setAllowedAttachments,
1857
- children: "Set Allowed Attachments"
1858
- }),
1859
- /*#__PURE__*/ jsx(DemoButton, {
1860
- onClick: setPreHook,
1861
- children: "Set Pre Hook"
1862
- })
1863
- ]
1864
- }),
1865
- /*#__PURE__*/ jsx(ButtonGroup, {
1866
- children: /*#__PURE__*/ jsx(DemoButton, {
1867
- onClick: setFirstRunExperience,
1868
- children: "Set First Run Experience"
1869
- })
1870
- })
1871
- ]
1872
- }),
1873
- /*#__PURE__*/ jsxs(Section, {
1874
- children: [
1875
- /*#__PURE__*/ jsx(SectionTitle, {
1876
- children: "Custom Header Actions"
1877
- }),
1878
- /*#__PURE__*/ jsxs(ButtonGroup, {
1879
- children: [
1880
- /*#__PURE__*/ jsx(DemoButton, {
1881
- onClick: setCustomHeaderActions,
1882
- children: "Set Custom Header Actions"
1883
- }),
1884
- /*#__PURE__*/ jsx(DemoButton, {
1885
- onClick: clearCustomHeaderActions,
1886
- children: "Clear Custom Header Actions"
1887
- })
1888
- ]
1889
- })
1890
- ]
1891
- }),
1892
- /*#__PURE__*/ jsxs(Section, {
1893
- children: [
1894
- /*#__PURE__*/ jsx(SectionTitle, {
1895
- children: "Resource Manager"
1896
- }),
1897
- /*#__PURE__*/ jsxs(ButtonGroup, {
1898
- children: [
1899
- /*#__PURE__*/ jsx(DemoButton, {
1900
- onClick: setResourceManager,
1901
- children: "Set Resource Manager"
1902
- }),
1903
- /*#__PURE__*/ jsx(DemoButton, {
1904
- onClick: clearResourceManager,
1905
- children: "Clear Resource Manager"
1906
- })
1907
- ]
1908
- }),
1909
- /*#__PURE__*/ jsx(FormControlLabel, {
1910
- control: /*#__PURE__*/ jsx(Checkbox, {
1911
- size: "small",
1912
- checked: resourcePaginationEnabled,
1913
- onChange: ()=>setResourcePaginationEnabled(!resourcePaginationEnabled)
1914
- }),
1915
- label: "Enable Pagination (50 vars, 30 files)"
1916
- }),
1917
- /*#__PURE__*/ jsxs(InfoText, {
1918
- style: {
1919
- marginTop: 8
1920
- },
1921
- children: [
1922
- "Page Size: ",
1923
- resourcePageSize
1924
- ]
1925
- }),
1926
- /*#__PURE__*/ jsx(DemoInput, {
1927
- type: "number",
1928
- min: 1,
1929
- max: 20,
1930
- value: resourcePageSize,
1931
- onChange: (e)=>setResourcePageSize(Number(e.target.value)),
1932
- style: {
1933
- width: 80
1934
- }
1935
- }),
1936
- /*#__PURE__*/ jsx(InfoText, {
1937
- children: "Type @ in the chat input to trigger the picker. Test keyboard navigation (↑/↓), selection (Enter/Tab), and escape behavior."
1938
- })
1939
- ]
1940
- }),
1941
- /*#__PURE__*/ jsxs(Section, {
1942
- children: [
1943
- /*#__PURE__*/ jsx(SectionTitle, {
1944
- children: "Model Selection"
1945
- }),
1946
- /*#__PURE__*/ jsxs(DemoSelect, {
1947
- value: selectedModel,
1948
- onChange: (e)=>handleModelChange(e.target.value),
1949
- children: [
1950
- /*#__PURE__*/ jsx("option", {
1951
- value: "gpt-4",
1952
- children: "GPT-4"
1953
- }),
1954
- /*#__PURE__*/ jsx("option", {
1955
- value: "gpt-3.5",
1956
- children: "GPT-3.5 Turbo"
1957
- }),
1958
- /*#__PURE__*/ jsx("option", {
1959
- value: "claude-3",
1960
- children: "Claude 3"
1961
- })
1962
- ]
1963
- })
1964
- ]
1965
- }),
1966
- /*#__PURE__*/ jsxs(Section, {
1967
- children: [
1968
- /*#__PURE__*/ jsx(SectionTitle, {
1969
- children: "Agent Mode"
1970
- }),
1971
- /*#__PURE__*/ jsxs(DemoSelect, {
1972
- value: selectedAgentMode,
1973
- onChange: (e)=>handleAgentModeChange(e.target.value),
1974
- children: [
1975
- /*#__PURE__*/ jsx("option", {
1976
- value: "agent",
1977
- children: "Agent"
1978
- }),
1979
- /*#__PURE__*/ jsx("option", {
1980
- value: "plan",
1981
- children: "Plan"
1982
- }),
1983
- /*#__PURE__*/ jsx("option", {
1984
- value: "attended",
1985
- children: "Attended"
1986
- })
1987
- ]
1988
- })
1989
- ]
1990
- }),
1991
- /*#__PURE__*/ jsxs(Section, {
1992
- children: [
1993
- /*#__PURE__*/ jsx(SectionTitle, {
1994
- children: "Input Styling"
1995
- }),
1996
- /*#__PURE__*/ jsx(InfoText, {
1997
- children: "Primary Font Token"
1998
- }),
1999
- /*#__PURE__*/ jsxs(DemoSelect, {
2000
- value: primaryFontToken,
2001
- onChange: (e)=>setPrimaryFontToken(e.target.value),
2002
- children: [
2003
- /*#__PURE__*/ jsx("option", {
2004
- value: FontVariantToken.fontSizeXs,
2005
- children: "XS (fontSizeXs)"
2006
- }),
2007
- /*#__PURE__*/ jsx("option", {
2008
- value: FontVariantToken.fontSizeS,
2009
- children: "S (fontSizeS)"
2010
- }),
2011
- /*#__PURE__*/ jsx("option", {
2012
- value: FontVariantToken.fontSizeM,
2013
- children: "M (fontSizeM)"
2014
- }),
2015
- /*#__PURE__*/ jsx("option", {
2016
- value: FontVariantToken.fontSizeL,
2017
- children: "L (fontSizeL)"
2018
- })
2019
- ]
2020
- }),
2021
- /*#__PURE__*/ jsxs(InfoText, {
2022
- style: {
2023
- marginTop: 12
2024
- },
2025
- children: [
2026
- "Prompt Box Min Rows: ",
2027
- promptBoxMinRows
2028
- ]
2029
- }),
2030
- /*#__PURE__*/ jsx(DemoInput, {
2031
- type: "number",
2032
- min: 1,
2033
- max: 10,
2034
- value: promptBoxMinRows,
2035
- onChange: (e)=>setPromptBoxMinRows(Number(e.target.value))
2036
- }),
2037
- /*#__PURE__*/ jsxs(InfoText, {
2038
- style: {
2039
- marginTop: 12
2040
- },
2041
- children: [
2042
- "Prompt Box Max Rows: ",
2043
- promptBoxMaxRows
2044
- ]
2045
- }),
2046
- /*#__PURE__*/ jsx(DemoInput, {
2047
- type: "number",
2048
- min: 1,
2049
- max: 20,
2050
- value: promptBoxMaxRows,
2051
- onChange: (e)=>setPromptBoxMaxRows(Number(e.target.value))
2052
- })
2053
- ]
2054
- }),
2055
- /*#__PURE__*/ jsxs(Section, {
2056
- children: [
2057
- /*#__PURE__*/ jsx(SectionTitle, {
2058
- children: "Message Controls"
2059
- }),
2060
- /*#__PURE__*/ jsxs(ButtonGroup, {
2061
- children: [
2062
- /*#__PURE__*/ jsx(DemoButton, {
2063
- onClick: setPrompt,
2064
- children: "Set Prompt"
2065
- }),
2066
- /*#__PURE__*/ jsx(DemoButton, {
2067
- onClick: resetPrompt,
2068
- children: "Reset Prompt"
2069
- })
2070
- ]
2071
- }),
2072
- /*#__PURE__*/ jsx(DemoInput, {
2073
- placeholder: "Custom message",
2074
- value: customMessage,
2075
- onChange: (e)=>setCustomMessage(e.target.value)
2076
- }),
2077
- /*#__PURE__*/ jsxs(ButtonGroup, {
2078
- children: [
2079
- /*#__PURE__*/ jsx(DemoButton, {
2080
- onClick: sendSimpleRequest,
2081
- children: "Send Request"
2082
- }),
2083
- /*#__PURE__*/ jsx(DemoButton, {
2084
- onClick: sendSimpleResponse,
2085
- children: "Send Response"
2086
- }),
2087
- /*#__PURE__*/ jsx(DemoButton, {
2088
- onClick: stopResponse,
2089
- children: "Stop Response"
2090
- })
2091
- ]
2092
- }),
2093
- /*#__PURE__*/ jsxs(ButtonGroup, {
2094
- children: [
2095
- /*#__PURE__*/ jsx(DemoButton, {
2096
- onClick: sendResponseWithActions,
2097
- children: "With Actions"
2098
- }),
2099
- /*#__PURE__*/ jsx(DemoButton, {
2100
- onClick: sendResponseWithCitations,
2101
- children: "With Citations"
2102
- }),
2103
- /*#__PURE__*/ jsx(DemoButton, {
2104
- onClick: sendResponseWithVariables,
2105
- children: "With Resource Tokens"
2106
- })
2107
- ]
2108
- }),
2109
- /*#__PURE__*/ jsxs(ButtonGroup, {
2110
- children: [
2111
- /*#__PURE__*/ jsx(DemoButton, {
2112
- onClick: sendCodeBlock,
2113
- children: "Code Block"
2114
- }),
2115
- /*#__PURE__*/ jsx(DemoButton, {
2116
- onClick: sendHTMLPreview,
2117
- children: "HTML Preview"
2118
- })
2119
- ]
2120
- }),
2121
- /*#__PURE__*/ jsxs(ButtonGroup, {
2122
- children: [
2123
- /*#__PURE__*/ jsx(DemoButton, {
2124
- onClick: ()=>sendToolCall(ConversationalDisplayModeTypes.ToolNameOnly),
2125
- children: "Tool Call: Name Only"
2126
- }),
2127
- /*#__PURE__*/ jsx(DemoButton, {
2128
- onClick: ()=>sendToolCall(ConversationalDisplayModeTypes.InputsAndOutputs),
2129
- children: "Tool Call: I/O"
2130
- }),
2131
- /*#__PURE__*/ jsx(DemoButton, {
2132
- onClick: ()=>sendToolCall(ConversationalDisplayModeTypes.FullTrace),
2133
- children: "Tool Call: Full Trace"
2134
- }),
2135
- /*#__PURE__*/ jsx(DemoButton, {
2136
- onClick: sendResponseDisabledActions,
2137
- children: "Disabled Actions"
2138
- })
2139
- ]
2140
- }),
2141
- /*#__PURE__*/ jsxs(ButtonGroup, {
2142
- children: [
2143
- /*#__PURE__*/ jsx(DemoButton, {
2144
- onClick: setConversation,
2145
- children: "Set Conversation"
2146
- }),
2147
- /*#__PURE__*/ jsx(DemoButton, {
2148
- onClick: setSuggestions,
2149
- children: "Set Suggestions"
2150
- })
2151
- ]
2152
- }),
2153
- /*#__PURE__*/ jsx(FormControlLabel, {
2154
- control: /*#__PURE__*/ jsx(Checkbox, {
2155
- size: "small",
2156
- checked: waitForMore,
2157
- onChange: ()=>setWaitForMore(!waitForMore)
2158
- }),
2159
- label: "Wait For More Messages"
2160
- })
2161
- ]
2162
- }),
2163
- /*#__PURE__*/ jsxs(Section, {
2164
- children: [
2165
- /*#__PURE__*/ jsx(SectionTitle, {
2166
- children: "Streaming"
2167
- }),
2168
- /*#__PURE__*/ jsx(DemoTextArea, {
2169
- placeholder: "Text to stream",
2170
- value: streamingText,
2171
- onChange: (e)=>setStreamingText(e.target.value)
2172
- }),
2173
- /*#__PURE__*/ jsxs(ButtonGroup, {
2174
- children: [
2175
- /*#__PURE__*/ jsx(DemoButton, {
2176
- onClick: sendStreamingResponse,
2177
- children: "Stream Response"
2178
- }),
2179
- /*#__PURE__*/ jsx(DemoButton, {
2180
- onClick: streamWithCitations,
2181
- children: "Stream With Citations"
2182
- }),
2183
- /*#__PURE__*/ jsx(DemoButton, {
2184
- onClick: streamWithResourceTokens,
2185
- children: "Stream Resource Tokens"
2186
- })
2187
- ]
2188
- }),
2189
- /*#__PURE__*/ jsx(InfoText, {
2190
- children: 'Streams text progressively. "Stream Resource Tokens" demonstrates buffering of incomplete tokens to prevent flickering.'
2191
- })
2192
- ]
2193
- }),
2194
- /*#__PURE__*/ jsxs(Section, {
2195
- children: [
2196
- /*#__PURE__*/ jsx(SectionTitle, {
2197
- children: "Loading & Error States"
2198
- }),
2199
- /*#__PURE__*/ jsx(DemoInput, {
2200
- placeholder: "Loading message",
2201
- value: loadingMessage,
2202
- onChange: (e)=>setLoadingMessage(e.target.value)
2203
- }),
2204
- /*#__PURE__*/ jsxs(ButtonGroup, {
2205
- children: [
2206
- /*#__PURE__*/ jsx(DemoButton, {
2207
- onClick: showLoading,
2208
- children: "Show Loading"
2209
- }),
2210
- /*#__PURE__*/ jsx(DemoButton, {
2211
- onClick: hideLoading,
2212
- children: "Hide Loading"
2213
- })
2214
- ]
2215
- }),
2216
- /*#__PURE__*/ jsx(DemoInput, {
2217
- placeholder: "Error message",
2218
- value: errorMessage,
2219
- onChange: (e)=>setErrorMessage(e.target.value)
2220
- }),
2221
- /*#__PURE__*/ jsxs(ButtonGroup, {
2222
- children: [
2223
- /*#__PURE__*/ jsx(DemoButton, {
2224
- onClick: showError,
2225
- children: "Show Error"
2226
- }),
2227
- /*#__PURE__*/ jsx(DemoButton, {
2228
- onClick: showWarning,
2229
- children: "Show Warning"
2230
- }),
2231
- /*#__PURE__*/ jsx(DemoButton, {
2232
- onClick: clearErrors,
2233
- children: "Clear Errors"
2234
- })
2235
- ]
2236
- })
2237
- ]
2238
- }),
2239
- /*#__PURE__*/ jsxs(Section, {
2240
- children: [
2241
- /*#__PURE__*/ jsx(SectionTitle, {
2242
- children: "History"
2243
- }),
2244
- /*#__PURE__*/ jsxs(ButtonGroup, {
2245
- children: [
2246
- /*#__PURE__*/ jsx(DemoButton, {
2247
- onClick: addHistoryItems,
2248
- children: "Add History Items"
2249
- }),
2250
- /*#__PURE__*/ jsx(DemoButton, {
2251
- onClick: toggleHistory,
2252
- children: "Toggle History Panel"
2253
- })
2254
- ]
2255
- })
2256
- ]
2257
- }),
2258
- /*#__PURE__*/ jsxs(Section, {
2259
- children: [
2260
- /*#__PURE__*/ jsx(SectionTitle, {
2261
- children: "Feature Toggles"
2262
- }),
2263
- /*#__PURE__*/ jsx(FormControlLabel, {
2264
- control: /*#__PURE__*/ jsx(Checkbox, {
2265
- size: "small",
2266
- checked: features.history,
2267
- onChange: ()=>toggleFeature('history')
2268
- }),
2269
- label: "History"
2270
- }),
2271
- /*#__PURE__*/ jsx(FormControlLabel, {
2272
- control: /*#__PURE__*/ jsx(Checkbox, {
2273
- size: "small",
2274
- checked: features.renameChat,
2275
- onChange: ()=>toggleFeature('renameChat')
2276
- }),
2277
- label: "Rename Chat"
2278
- }),
2279
- /*#__PURE__*/ jsx(FormControlLabel, {
2280
- control: /*#__PURE__*/ jsx(Checkbox, {
2281
- size: "small",
2282
- checked: features.settings,
2283
- onChange: ()=>toggleFeature('settings')
2284
- }),
2285
- label: "Settings"
2286
- }),
2287
- /*#__PURE__*/ jsx(FormControlLabel, {
2288
- control: /*#__PURE__*/ jsx(Checkbox, {
2289
- size: "small",
2290
- checked: features.attachments,
2291
- onChange: ()=>toggleFeature('attachments')
2292
- }),
2293
- label: "Attachments"
2294
- }),
2295
- /*#__PURE__*/ jsx(FormControlLabel, {
2296
- control: /*#__PURE__*/ jsx(Checkbox, {
2297
- size: "small",
2298
- checked: features.audio,
2299
- onChange: ()=>toggleFeature('audio')
2300
- }),
2301
- label: "STT Dictate"
2302
- }),
2303
- /*#__PURE__*/ jsx(FormControlLabel, {
2304
- control: /*#__PURE__*/ jsx(Checkbox, {
2305
- size: "small",
2306
- checked: features.audioStreaming,
2307
- onChange: ()=>toggleFeature('audioStreaming')
2308
- }),
2309
- label: "Voice Interaction"
2310
- }),
2311
- /*#__PURE__*/ jsx(FormControlLabel, {
2312
- control: /*#__PURE__*/ jsx(Checkbox, {
2313
- size: "small",
2314
- checked: features.htmlPreview,
2315
- onChange: ()=>toggleFeature('htmlPreview')
2316
- }),
2317
- label: "HTML Preview"
2318
- }),
2319
- /*#__PURE__*/ jsx(FormControlLabel, {
2320
- control: /*#__PURE__*/ jsx(Checkbox, {
2321
- size: "small",
2322
- checked: features.headerSeparator,
2323
- onChange: ()=>toggleFeature('headerSeparator')
2324
- }),
2325
- label: "Header Separator"
2326
- }),
2327
- /*#__PURE__*/ jsx(FormControlLabel, {
2328
- control: /*#__PURE__*/ jsx(Checkbox, {
2329
- size: "small",
2330
- checked: features.fullHeight,
2331
- onChange: ()=>toggleFeature('fullHeight')
2332
- }),
2333
- label: "Full Height"
2334
- }),
2335
- /*#__PURE__*/ jsx(FormControlLabel, {
2336
- control: /*#__PURE__*/ jsx(Checkbox, {
2337
- size: "small",
2338
- checked: features.resize,
2339
- onChange: ()=>toggleFeature('resize')
2340
- }),
2341
- label: "Resize"
2342
- }),
2343
- /*#__PURE__*/ jsx(FormControlLabel, {
2344
- control: /*#__PURE__*/ jsx(Checkbox, {
2345
- size: "small",
2346
- checked: features.close,
2347
- onChange: ()=>toggleFeature('close')
2348
- }),
2349
- label: "Close"
2350
- }),
2351
- /*#__PURE__*/ jsx(FormControlLabel, {
2352
- control: /*#__PURE__*/ jsx(Checkbox, {
2353
- size: "small",
2354
- checked: features.feedback,
2355
- onChange: ()=>toggleFeature('feedback')
2356
- }),
2357
- label: "Feedback"
2358
- }),
2359
- /*#__PURE__*/ jsx(FormControlLabel, {
2360
- control: /*#__PURE__*/ jsx(Checkbox, {
2361
- size: "small",
2362
- checked: features.model,
2363
- onChange: ()=>toggleFeature('model')
2364
- }),
2365
- label: "Model"
2366
- }),
2367
- /*#__PURE__*/ jsx(FormControlLabel, {
2368
- control: /*#__PURE__*/ jsx(Checkbox, {
2369
- size: "small",
2370
- checked: features.agentMode,
2371
- onChange: ()=>toggleFeature('agentMode')
2372
- }),
2373
- label: "Agent Mode"
2374
- }),
2375
- /*#__PURE__*/ jsx(FormControlLabel, {
2376
- control: /*#__PURE__*/ jsx(Checkbox, {
2377
- size: "small",
2378
- checked: features.sendOnClick,
2379
- onChange: ()=>toggleFeature('sendOnClick')
2380
- }),
2381
- label: "Send On Click"
2382
- }),
2383
- /*#__PURE__*/ jsx(FormControlLabel, {
2384
- control: /*#__PURE__*/ jsx(Checkbox, {
2385
- size: "small",
2386
- checked: features.paginatedMessages,
2387
- onChange: ()=>toggleFeature('paginatedMessages')
2388
- }),
2389
- label: "Paginated Messages"
2390
- }),
2391
- /*#__PURE__*/ jsx(FormControlLabel, {
2392
- control: /*#__PURE__*/ jsx(Checkbox, {
2393
- size: "small",
2394
- checked: features.compactMode,
2395
- onChange: ()=>toggleFeature('compactMode')
2396
- }),
2397
- label: "Compact Mode"
2398
- }),
2399
- /*#__PURE__*/ jsx(FormControlLabel, {
2400
- control: /*#__PURE__*/ jsx(Checkbox, {
2401
- size: "small",
2402
- checked: features.customScrollTheme,
2403
- onChange: ()=>toggleFeature('customScrollTheme')
2404
- }),
2405
- label: "Custom Scroll Theme"
2406
- }),
2407
- /*#__PURE__*/ jsx(FormControlLabel, {
2408
- control: /*#__PURE__*/ jsx(Checkbox, {
2409
- size: "small",
2410
- checked: features.copy,
2411
- onChange: ()=>toggleFeature('copy')
2412
- }),
2413
- label: "Copy"
2414
- }),
2415
- /*#__PURE__*/ jsx(FormControlLabel, {
2416
- control: /*#__PURE__*/ jsx(Checkbox, {
2417
- size: "small",
2418
- checked: features.stopResponse,
2419
- onChange: ()=>toggleFeature('stopResponse')
2420
- }),
2421
- label: "Stop Response"
2422
- }),
2423
- /*#__PURE__*/ jsx(FormControlLabel, {
2424
- control: /*#__PURE__*/ jsx(Checkbox, {
2425
- size: "small",
2426
- checked: features.attachmentsAsync,
2427
- onChange: ()=>toggleFeature('attachmentsAsync')
2428
- }),
2429
- label: "Attachments Async"
2430
- }),
2431
- /*#__PURE__*/ jsx(FormControlLabel, {
2432
- control: /*#__PURE__*/ jsx(Checkbox, {
2433
- size: "small",
2434
- checked: features.readOnly,
2435
- onChange: ()=>toggleFeature('readOnly')
2436
- }),
2437
- label: "Read Only"
2438
- })
2439
- ]
2440
- }),
2441
- /*#__PURE__*/ jsxs(Section, {
2442
- children: [
2443
- /*#__PURE__*/ jsx(SectionTitle, {
2444
- children: "State Controls"
2445
- }),
2446
- /*#__PURE__*/ jsx(FormControlLabel, {
2447
- control: /*#__PURE__*/ jsx(Checkbox, {
2448
- size: "small",
2449
- checked: isWaiting,
2450
- onChange: ()=>{
2451
- setIsWaiting(!isWaiting);
2452
- chatService?.setWaiting(!isWaiting);
2453
- }
2454
- }),
2455
- label: "Set Waiting"
2456
- }),
2457
- /*#__PURE__*/ jsx(FormControlLabel, {
2458
- control: /*#__PURE__*/ jsx(Checkbox, {
2459
- size: "small",
2460
- checked: isShowLoading,
2461
- onChange: ()=>{
2462
- setIsShowLoading(!isShowLoading);
2463
- chatService?.setShowLoading(!isShowLoading);
2464
- }
2465
- }),
2466
- label: "Set Show Loading"
2467
- })
2468
- ]
2469
- })
2470
- ]
2471
- }),
2472
- chatService && /*#__PURE__*/ jsx(Box, {
2473
- sx: {
2474
- justifySelf: 'flex-end',
2475
- background: 'var(--color-background)'
2476
- },
2477
- children: /*#__PURE__*/ jsx(ApChat, {
2478
- chatServiceInstance: chatService,
2479
- locale: locale,
2480
- theme: theme
2481
- })
2482
- }),
2483
- /*#__PURE__*/ jsx(Box, {
2484
- ref: embeddedContainerRef,
2485
- sx: {
2486
- position: 'fixed',
2487
- bottom: 24,
2488
- right: 24,
2489
- width: 400,
2490
- height: 600,
2491
- boxShadow: 'var(--shadow-xl, 0 12px 32px rgba(0, 0, 0, 0.35))',
2492
- borderRadius: '12px',
2493
- overflow: 'hidden',
2494
- zIndex: 1000,
2495
- '& > *': {
2496
- position: 'relative'
2497
- }
2498
- },
2499
- style: {
2500
- background: 'var(--color-background)',
2501
- display: chatMode === AutopilotChatMode.Embedded ? 'block' : 'none'
2502
- }
2503
- })
2504
- ]
2505
- });
2506
- }
2507
- export { ChatShowcaseDemo, mapToChatLocale, mapToChatTheme };