@docyrus/ui-pro-ai-assistant 0.0.1

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 (308) hide show
  1. package/dist/index.js +26161 -0
  2. package/dist/index.js.map +1 -0
  3. package/package.json +155 -0
  4. package/src/components/assistant-animations.tsx +29 -0
  5. package/src/components/assistant-dialogs.tsx +235 -0
  6. package/src/components/code-view.tsx +278 -0
  7. package/src/components/create-agent-task.tsx +104 -0
  8. package/src/components/create-new-work-version.tsx +30 -0
  9. package/src/components/extract-web.tsx +160 -0
  10. package/src/components/forward-to-agent.tsx +90 -0
  11. package/src/components/generate-chart.tsx +101 -0
  12. package/src/components/generative-action-button.tsx +122 -0
  13. package/src/components/generative-tool.tsx +685 -0
  14. package/src/components/generative-ui-object.tsx +210 -0
  15. package/src/components/input-area.tsx +1209 -0
  16. package/src/components/json-schema-layout.tsx +326 -0
  17. package/src/components/list-item-card.tsx +92 -0
  18. package/src/components/mermaid-diagram.tsx +192 -0
  19. package/src/components/preview-image.tsx +47 -0
  20. package/src/components/request-approval.tsx +48 -0
  21. package/src/components/request-user-input.tsx +270 -0
  22. package/src/components/search-web.tsx +319 -0
  23. package/src/components/sheet-command.tsx +88 -0
  24. package/src/components/shell-canvas.tsx +122 -0
  25. package/src/components/show-advanced-data-table.tsx +352 -0
  26. package/src/components/show-generated-content-options.tsx +93 -0
  27. package/src/components/show-people-cards.tsx +180 -0
  28. package/src/components/subagent-tool.tsx +180 -0
  29. package/src/components/text-editor-tool.tsx +328 -0
  30. package/src/components/work-canvas.tsx +88 -0
  31. package/src/components/work-card.tsx +42 -0
  32. package/src/declarations.d.ts +1 -0
  33. package/src/docy-assistant.tsx +1962 -0
  34. package/src/hooks/index.ts +7 -0
  35. package/src/hooks/use-assistant-api.ts +507 -0
  36. package/src/hooks/use-deployment-data.ts +162 -0
  37. package/src/hooks/use-project-state.ts +347 -0
  38. package/src/hooks/use-session-state.ts +207 -0
  39. package/src/hooks/use-speech-recognition.ts +137 -0
  40. package/src/hooks/use-ui-state.ts +185 -0
  41. package/src/hooks/use-works-state.ts +146 -0
  42. package/src/i18n/context.tsx +253 -0
  43. package/src/i18n/index.ts +19 -0
  44. package/src/i18n/locales/de.json +198 -0
  45. package/src/i18n/locales/el.json +198 -0
  46. package/src/i18n/locales/en.json +226 -0
  47. package/src/i18n/locales/es.json +198 -0
  48. package/src/i18n/locales/fr.json +198 -0
  49. package/src/i18n/locales/it.json +198 -0
  50. package/src/i18n/locales/pt.json +198 -0
  51. package/src/i18n/locales/sl.json +198 -0
  52. package/src/i18n/locales/tr.json +211 -0
  53. package/src/i18n/types.ts +23 -0
  54. package/src/i18n/use-translation.ts +17 -0
  55. package/src/index.ts +18 -0
  56. package/src/internal/plate-editor/editor/auth-context.ts +11 -0
  57. package/src/internal/plate-editor/editor/editor-base-kit.tsx +39 -0
  58. package/src/internal/plate-editor/editor/editor-kit.tsx +89 -0
  59. package/src/internal/plate-editor/editor/plate-editor.tsx +75 -0
  60. package/src/internal/plate-editor/editor/plate-types.ts +126 -0
  61. package/src/internal/plate-editor/editor/plugins/ai-kit.tsx +172 -0
  62. package/src/internal/plate-editor/editor/plugins/autoformat-kit.tsx +211 -0
  63. package/src/internal/plate-editor/editor/plugins/basic-blocks-base-kit.tsx +26 -0
  64. package/src/internal/plate-editor/editor/plugins/basic-blocks-kit.tsx +51 -0
  65. package/src/internal/plate-editor/editor/plugins/basic-marks-base-kit.tsx +24 -0
  66. package/src/internal/plate-editor/editor/plugins/basic-marks-kit.tsx +38 -0
  67. package/src/internal/plate-editor/editor/plugins/basic-nodes-kit.tsx +6 -0
  68. package/src/internal/plate-editor/editor/plugins/block-menu-kit.tsx +14 -0
  69. package/src/internal/plate-editor/editor/plugins/block-placeholder-kit.tsx +17 -0
  70. package/src/internal/plate-editor/editor/plugins/block-selection-kit.tsx +31 -0
  71. package/src/internal/plate-editor/editor/plugins/callout-base-kit.tsx +5 -0
  72. package/src/internal/plate-editor/editor/plugins/callout-kit.tsx +7 -0
  73. package/src/internal/plate-editor/editor/plugins/code-block-base-kit.tsx +23 -0
  74. package/src/internal/plate-editor/editor/plugins/code-block-kit.tsx +26 -0
  75. package/src/internal/plate-editor/editor/plugins/column-base-kit.tsx +8 -0
  76. package/src/internal/plate-editor/editor/plugins/column-kit.tsx +7 -0
  77. package/src/internal/plate-editor/editor/plugins/comment-base-kit.tsx +5 -0
  78. package/src/internal/plate-editor/editor/plugins/comment-kit.tsx +174 -0
  79. package/src/internal/plate-editor/editor/plugins/copilot-kit.tsx +68 -0
  80. package/src/internal/plate-editor/editor/plugins/cursor-overlay-kit.tsx +13 -0
  81. package/src/internal/plate-editor/editor/plugins/date-base-kit.tsx +5 -0
  82. package/src/internal/plate-editor/editor/plugins/date-kit.tsx +7 -0
  83. package/src/internal/plate-editor/editor/plugins/discussion-kit.tsx +36 -0
  84. package/src/internal/plate-editor/editor/plugins/dnd-kit.tsx +27 -0
  85. package/src/internal/plate-editor/editor/plugins/docx-export-kit.tsx +43 -0
  86. package/src/internal/plate-editor/editor/plugins/docx-kit.tsx +6 -0
  87. package/src/internal/plate-editor/editor/plugins/emoji-kit.tsx +15 -0
  88. package/src/internal/plate-editor/editor/plugins/exit-break-kit.tsx +12 -0
  89. package/src/internal/plate-editor/editor/plugins/floating-toolbar-kit.tsx +19 -0
  90. package/src/internal/plate-editor/editor/plugins/font-base-kit.tsx +36 -0
  91. package/src/internal/plate-editor/editor/plugins/font-kit.tsx +47 -0
  92. package/src/internal/plate-editor/editor/plugins/indent-base-kit.tsx +19 -0
  93. package/src/internal/plate-editor/editor/plugins/indent-kit.tsx +22 -0
  94. package/src/internal/plate-editor/editor/plugins/link-base-kit.tsx +5 -0
  95. package/src/internal/plate-editor/editor/plugins/link-kit.tsx +35 -0
  96. package/src/internal/plate-editor/editor/plugins/list-base-kit.tsx +24 -0
  97. package/src/internal/plate-editor/editor/plugins/list-kit.tsx +27 -0
  98. package/src/internal/plate-editor/editor/plugins/markdown-kit.tsx +18 -0
  99. package/src/internal/plate-editor/editor/plugins/math-base-kit.tsx +8 -0
  100. package/src/internal/plate-editor/editor/plugins/math-kit.tsx +10 -0
  101. package/src/internal/plate-editor/editor/plugins/media-base-kit.tsx +37 -0
  102. package/src/internal/plate-editor/editor/plugins/media-kit.tsx +53 -0
  103. package/src/internal/plate-editor/editor/plugins/mention-base-kit.tsx +5 -0
  104. package/src/internal/plate-editor/editor/plugins/mention-kit.tsx +36 -0
  105. package/src/internal/plate-editor/editor/plugins/slash-kit.tsx +17 -0
  106. package/src/internal/plate-editor/editor/plugins/suggestion-base-kit.tsx +5 -0
  107. package/src/internal/plate-editor/editor/plugins/suggestion-kit.tsx +95 -0
  108. package/src/internal/plate-editor/editor/plugins/table-base-kit.tsx +20 -0
  109. package/src/internal/plate-editor/editor/plugins/table-kit.tsx +22 -0
  110. package/src/internal/plate-editor/editor/plugins/toc-base-kit.tsx +5 -0
  111. package/src/internal/plate-editor/editor/plugins/toc-kit.tsx +14 -0
  112. package/src/internal/plate-editor/editor/plugins/toggle-base-kit.tsx +5 -0
  113. package/src/internal/plate-editor/editor/plugins/toggle-kit.tsx +9 -0
  114. package/src/internal/plate-editor/editor/transforms.ts +165 -0
  115. package/src/internal/plate-editor/editor/use-chat.ts +152 -0
  116. package/src/internal/plate-editor/hooks/index.ts +3 -0
  117. package/src/internal/plate-editor/hooks/use-copy-to-clipboard.ts +31 -0
  118. package/src/internal/plate-editor/hooks/use-is-touch-device.ts +26 -0
  119. package/src/internal/plate-editor/hooks/use-lock-scroll.ts +21 -0
  120. package/src/internal/plate-editor/hooks/use-media-query.ts +44 -0
  121. package/src/internal/plate-editor/hooks/use-mounted.ts +18 -0
  122. package/src/internal/plate-editor/hooks/use-on-click-outside.ts +114 -0
  123. package/src/internal/plate-editor/hooks/use-upload-file.ts +81 -0
  124. package/src/internal/plate-editor/i18n/context.tsx +58 -0
  125. package/src/internal/plate-editor/i18n/index.ts +3 -0
  126. package/src/internal/plate-editor/i18n/locales/de.json +57 -0
  127. package/src/internal/plate-editor/i18n/locales/el.json +57 -0
  128. package/src/internal/plate-editor/i18n/locales/en.json +57 -0
  129. package/src/internal/plate-editor/i18n/locales/es.json +57 -0
  130. package/src/internal/plate-editor/i18n/locales/fr.json +57 -0
  131. package/src/internal/plate-editor/i18n/locales/it.json +57 -0
  132. package/src/internal/plate-editor/i18n/locales/pt.json +57 -0
  133. package/src/internal/plate-editor/i18n/locales/sl.json +57 -0
  134. package/src/internal/plate-editor/i18n/locales/tr.json +57 -0
  135. package/src/internal/plate-editor/i18n/types.ts +59 -0
  136. package/src/internal/plate-editor/i18n/use-translation.ts +22 -0
  137. package/src/internal/plate-editor/index.ts +39 -0
  138. package/src/internal/plate-editor/lib/ai-output-converter.ts +153 -0
  139. package/src/internal/plate-editor/lib/download-file.ts +17 -0
  140. package/src/internal/plate-editor/plate-ui/ai-chat-editor.tsx +26 -0
  141. package/src/internal/plate-editor/plate-ui/ai-menu.tsx +828 -0
  142. package/src/internal/plate-editor/plate-ui/ai-node.tsx +41 -0
  143. package/src/internal/plate-editor/plate-ui/ai-toolbar-button.tsx +27 -0
  144. package/src/internal/plate-editor/plate-ui/alert-dialog.tsx +147 -0
  145. package/src/internal/plate-editor/plate-ui/align-toolbar-button.tsx +90 -0
  146. package/src/internal/plate-editor/plate-ui/avatar.tsx +3 -0
  147. package/src/internal/plate-editor/plate-ui/block-context-menu.tsx +106 -0
  148. package/src/internal/plate-editor/plate-ui/block-discussion.tsx +364 -0
  149. package/src/internal/plate-editor/plate-ui/block-draggable.tsx +556 -0
  150. package/src/internal/plate-editor/plate-ui/block-list-static.tsx +78 -0
  151. package/src/internal/plate-editor/plate-ui/block-list.tsx +85 -0
  152. package/src/internal/plate-editor/plate-ui/block-menu.tsx +557 -0
  153. package/src/internal/plate-editor/plate-ui/block-selection.tsx +47 -0
  154. package/src/internal/plate-editor/plate-ui/block-suggestion.tsx +469 -0
  155. package/src/internal/plate-editor/plate-ui/blockquote-node-static.tsx +10 -0
  156. package/src/internal/plate-editor/plate-ui/blockquote-node.tsx +11 -0
  157. package/src/internal/plate-editor/plate-ui/button.tsx +190 -0
  158. package/src/internal/plate-editor/plate-ui/calendar.tsx +3 -0
  159. package/src/internal/plate-editor/plate-ui/callout-node-static.tsx +76 -0
  160. package/src/internal/plate-editor/plate-ui/callout-node.tsx +54 -0
  161. package/src/internal/plate-editor/plate-ui/caption.tsx +48 -0
  162. package/src/internal/plate-editor/plate-ui/checkbox.tsx +3 -0
  163. package/src/internal/plate-editor/plate-ui/code-block-node-static.tsx +172 -0
  164. package/src/internal/plate-editor/plate-ui/code-block-node.tsx +228 -0
  165. package/src/internal/plate-editor/plate-ui/code-node-static.tsx +11 -0
  166. package/src/internal/plate-editor/plate-ui/code-node.tsx +12 -0
  167. package/src/internal/plate-editor/plate-ui/column-node-static.tsx +65 -0
  168. package/src/internal/plate-editor/plate-ui/column-node.tsx +24 -0
  169. package/src/internal/plate-editor/plate-ui/command.tsx +204 -0
  170. package/src/internal/plate-editor/plate-ui/comment-node-static.tsx +12 -0
  171. package/src/internal/plate-editor/plate-ui/comment-node.tsx +45 -0
  172. package/src/internal/plate-editor/plate-ui/comment-toolbar-button.tsx +24 -0
  173. package/src/internal/plate-editor/plate-ui/comment.tsx +619 -0
  174. package/src/internal/plate-editor/plate-ui/cursor-overlay.tsx +85 -0
  175. package/src/internal/plate-editor/plate-ui/date-node-static.tsx +43 -0
  176. package/src/internal/plate-editor/plate-ui/date-node.tsx +56 -0
  177. package/src/internal/plate-editor/plate-ui/dialog.tsx +426 -0
  178. package/src/internal/plate-editor/plate-ui/dropdown-menu.tsx +266 -0
  179. package/src/internal/plate-editor/plate-ui/editor-static.tsx +40 -0
  180. package/src/internal/plate-editor/plate-ui/editor.tsx +148 -0
  181. package/src/internal/plate-editor/plate-ui/emoji-node.tsx +48 -0
  182. package/src/internal/plate-editor/plate-ui/emoji-toolbar-button.tsx +626 -0
  183. package/src/internal/plate-editor/plate-ui/equation-node-static.tsx +155 -0
  184. package/src/internal/plate-editor/plate-ui/equation-node.tsx +226 -0
  185. package/src/internal/plate-editor/plate-ui/equation-toolbar-button.tsx +26 -0
  186. package/src/internal/plate-editor/plate-ui/export-toolbar-button.tsx +208 -0
  187. package/src/internal/plate-editor/plate-ui/fixed-toolbar-buttons.tsx +157 -0
  188. package/src/internal/plate-editor/plate-ui/fixed-toolbar.tsx +27 -0
  189. package/src/internal/plate-editor/plate-ui/floating-discussion.tsx +1129 -0
  190. package/src/internal/plate-editor/plate-ui/floating-toolbar-buttons.tsx +129 -0
  191. package/src/internal/plate-editor/plate-ui/floating-toolbar.tsx +99 -0
  192. package/src/internal/plate-editor/plate-ui/font-color-toolbar-button.tsx +211 -0
  193. package/src/internal/plate-editor/plate-ui/font-size-toolbar-button.tsx +154 -0
  194. package/src/internal/plate-editor/plate-ui/ghost-text.tsx +20 -0
  195. package/src/internal/plate-editor/plate-ui/heading-node-static.tsx +52 -0
  196. package/src/internal/plate-editor/plate-ui/heading-node.tsx +56 -0
  197. package/src/internal/plate-editor/plate-ui/highlight-node-static.tsx +9 -0
  198. package/src/internal/plate-editor/plate-ui/highlight-node.tsx +11 -0
  199. package/src/internal/plate-editor/plate-ui/history-toolbar-button.tsx +52 -0
  200. package/src/internal/plate-editor/plate-ui/hover-card.tsx +7 -0
  201. package/src/internal/plate-editor/plate-ui/hr-node-static.tsx +18 -0
  202. package/src/internal/plate-editor/plate-ui/hr-node.tsx +28 -0
  203. package/src/internal/plate-editor/plate-ui/import-toolbar-button.tsx +124 -0
  204. package/src/internal/plate-editor/plate-ui/indent-toolbar-button.tsx +34 -0
  205. package/src/internal/plate-editor/plate-ui/inline-combobox.tsx +409 -0
  206. package/src/internal/plate-editor/plate-ui/input.tsx +39 -0
  207. package/src/internal/plate-editor/plate-ui/insert-toolbar-button.tsx +260 -0
  208. package/src/internal/plate-editor/plate-ui/label.tsx +1 -0
  209. package/src/internal/plate-editor/plate-ui/line-height-toolbar-button.tsx +71 -0
  210. package/src/internal/plate-editor/plate-ui/link-node-static.tsx +15 -0
  211. package/src/internal/plate-editor/plate-ui/link-node.tsx +33 -0
  212. package/src/internal/plate-editor/plate-ui/link-toolbar-button.tsx +30 -0
  213. package/src/internal/plate-editor/plate-ui/link-toolbar.tsx +149 -0
  214. package/src/internal/plate-editor/plate-ui/list-toolbar-button.tsx +179 -0
  215. package/src/internal/plate-editor/plate-ui/mark-toolbar-button.tsx +36 -0
  216. package/src/internal/plate-editor/plate-ui/media-audio-node-static.tsx +21 -0
  217. package/src/internal/plate-editor/plate-ui/media-audio-node.tsx +32 -0
  218. package/src/internal/plate-editor/plate-ui/media-embed-node.tsx +103 -0
  219. package/src/internal/plate-editor/plate-ui/media-file-node-static.tsx +30 -0
  220. package/src/internal/plate-editor/plate-ui/media-file-node.tsx +52 -0
  221. package/src/internal/plate-editor/plate-ui/media-image-node-static.tsx +37 -0
  222. package/src/internal/plate-editor/plate-ui/media-image-node.tsx +183 -0
  223. package/src/internal/plate-editor/plate-ui/media-placeholder-node.tsx +441 -0
  224. package/src/internal/plate-editor/plate-ui/media-preview-dialog.tsx +127 -0
  225. package/src/internal/plate-editor/plate-ui/media-toolbar-button.tsx +229 -0
  226. package/src/internal/plate-editor/plate-ui/media-toolbar.tsx +216 -0
  227. package/src/internal/plate-editor/plate-ui/media-upload-toast.tsx +73 -0
  228. package/src/internal/plate-editor/plate-ui/media-video-node-static.tsx +35 -0
  229. package/src/internal/plate-editor/plate-ui/media-video-node.tsx +119 -0
  230. package/src/internal/plate-editor/plate-ui/mention-node-static.tsx +46 -0
  231. package/src/internal/plate-editor/plate-ui/mention-node.tsx +79 -0
  232. package/src/internal/plate-editor/plate-ui/menu.tsx +532 -0
  233. package/src/internal/plate-editor/plate-ui/mode-toolbar-button.tsx +126 -0
  234. package/src/internal/plate-editor/plate-ui/more-toolbar-button.tsx +34 -0
  235. package/src/internal/plate-editor/plate-ui/paragraph-node-static.tsx +15 -0
  236. package/src/internal/plate-editor/plate-ui/paragraph-node.tsx +16 -0
  237. package/src/internal/plate-editor/plate-ui/popover.tsx +77 -0
  238. package/src/internal/plate-editor/plate-ui/progress.tsx +1 -0
  239. package/src/internal/plate-editor/plate-ui/remote-cursor-overlay.tsx +81 -0
  240. package/src/internal/plate-editor/plate-ui/resize-handle.tsx +88 -0
  241. package/src/internal/plate-editor/plate-ui/separator.tsx +43 -0
  242. package/src/internal/plate-editor/plate-ui/slash-node.tsx +435 -0
  243. package/src/internal/plate-editor/plate-ui/spinner.tsx +1 -0
  244. package/src/internal/plate-editor/plate-ui/suggestion-node-static.tsx +35 -0
  245. package/src/internal/plate-editor/plate-ui/suggestion-node.tsx +168 -0
  246. package/src/internal/plate-editor/plate-ui/suggestion-toolbar-button.tsx +24 -0
  247. package/src/internal/plate-editor/plate-ui/table-node-static.tsx +85 -0
  248. package/src/internal/plate-editor/plate-ui/table-node.tsx +285 -0
  249. package/src/internal/plate-editor/plate-ui/table-toolbar-button.tsx +254 -0
  250. package/src/internal/plate-editor/plate-ui/tabs.tsx +3 -0
  251. package/src/internal/plate-editor/plate-ui/textarea.tsx +58 -0
  252. package/src/internal/plate-editor/plate-ui/toc-node-static.tsx +142 -0
  253. package/src/internal/plate-editor/plate-ui/toc-node.tsx +57 -0
  254. package/src/internal/plate-editor/plate-ui/toc-sidebar.tsx +50 -0
  255. package/src/internal/plate-editor/plate-ui/toggle-node-static.tsx +18 -0
  256. package/src/internal/plate-editor/plate-ui/toggle-node.tsx +33 -0
  257. package/src/internal/plate-editor/plate-ui/toggle-toolbar-button.tsx +26 -0
  258. package/src/internal/plate-editor/plate-ui/toggle.tsx +3 -0
  259. package/src/internal/plate-editor/plate-ui/toolbar.tsx +380 -0
  260. package/src/internal/plate-editor/plate-ui/tooltip.tsx +149 -0
  261. package/src/internal/plate-editor/plate-ui/turn-into-toolbar-button.tsx +177 -0
  262. package/src/internal/plate-editor/types/index.ts +22 -0
  263. package/src/internal/plate-editor/vite.ts +284 -0
  264. package/src/internal/sheets/components/univer-sheets.tsx +1104 -0
  265. package/src/internal/sheets/i18n/context.tsx +183 -0
  266. package/src/internal/sheets/i18n/index.ts +19 -0
  267. package/src/internal/sheets/i18n/locales/de.json +21 -0
  268. package/src/internal/sheets/i18n/locales/el.json +21 -0
  269. package/src/internal/sheets/i18n/locales/en.json +21 -0
  270. package/src/internal/sheets/i18n/locales/es.json +21 -0
  271. package/src/internal/sheets/i18n/locales/fr.json +21 -0
  272. package/src/internal/sheets/i18n/locales/it.json +21 -0
  273. package/src/internal/sheets/i18n/locales/pt.json +21 -0
  274. package/src/internal/sheets/i18n/locales/sl.json +21 -0
  275. package/src/internal/sheets/i18n/locales/tr.json +21 -0
  276. package/src/internal/sheets/i18n/types.ts +23 -0
  277. package/src/internal/sheets/i18n/use-translation.ts +17 -0
  278. package/src/internal/sheets/index.ts +14 -0
  279. package/src/internal/sheets/types/css.d.ts +11 -0
  280. package/src/internal/sheets/types/index.ts +260 -0
  281. package/src/internal/sheets/xlsx.ts +1169 -0
  282. package/src/lib/api-client.ts +77 -0
  283. package/src/lib/assistant-api-actions.ts +549 -0
  284. package/src/lib/assistant-config.tsx +71 -0
  285. package/src/lib/class-utils.ts +40 -0
  286. package/src/lib/index.ts +7 -0
  287. package/src/lib/message-utils.ts +131 -0
  288. package/src/tools/tools-schema.json +512 -0
  289. package/src/types/index.ts +235 -0
  290. package/src/views/assistant-view.tsx +1137 -0
  291. package/src/views/canvas-app.tsx +839 -0
  292. package/src/views/canvas-code.tsx +93 -0
  293. package/src/views/canvas-deep-research.tsx +44 -0
  294. package/src/views/canvas-image.tsx +25 -0
  295. package/src/views/canvas-record-view.tsx +285 -0
  296. package/src/views/canvas-spreadsheet.tsx +125 -0
  297. package/src/views/canvas-text.tsx +52 -0
  298. package/src/views/canvas.tsx +274 -0
  299. package/src/views/chat-panel.tsx +149 -0
  300. package/src/views/index.ts +20 -0
  301. package/src/views/memories-panel.tsx +365 -0
  302. package/src/views/message-list.tsx +370 -0
  303. package/src/views/project-detail.tsx +257 -0
  304. package/src/views/projects-panel.tsx +131 -0
  305. package/src/views/sessions-list.tsx +98 -0
  306. package/src/views/sidebar-content.tsx +256 -0
  307. package/src/views/work-detail.tsx +98 -0
  308. package/src/vite.ts +284 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * CSS class utility functions for assistant dialog/container styling
3
+ */
4
+
5
+ interface DialogClassOptions {
6
+ isExpanded: boolean;
7
+ isDocked: boolean;
8
+ }
9
+
10
+ interface ContainerClassOptions {
11
+ isExpanded: boolean;
12
+ isDocked: boolean;
13
+ }
14
+
15
+ /**
16
+ * Returns the appropriate className for the dialog based on its state
17
+ * Handles expanded, docked, and default states
18
+ */
19
+ export function getDialogClassName({ isExpanded, isDocked }: DialogClassOptions): string {
20
+ const baseClass = 'p-0 border-0 max-w-none bg-transparent transition-all duration-300 ease-out';
21
+
22
+ if (isExpanded) {
23
+ return `${baseClass} w-screen h-screen fixed inset-0 translate-x-0 translate-y-0`;
24
+ } else if (isDocked) {
25
+ return `${baseClass} w-[700px] h-screen fixed top-0 left-0 translate-x-0 translate-y-0`;
26
+ } else {
27
+ return `${baseClass} w-[80vw] h-[95vh] min-w-[80vw] max-w-none max-h-none fixed top-1/2 left-1/2 translate-x-[-50%] translate-y-[-50%]`;
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Returns the appropriate className for the container based on its state
33
+ * Handles rounded corners and overflow for different display modes
34
+ */
35
+ export function getContainerClassName({ isExpanded, isDocked }: ContainerClassOptions): string {
36
+ const baseClass = 'relative flex h-full bg-background text-foreground w-full shadow-xl border border-border';
37
+
38
+ // Keep overflow-hidden for main container to maintain chat scrolling
39
+ return `${baseClass} overflow-hidden ${isExpanded || isDocked ? 'rounded-none' : 'rounded-2xl'}`;
40
+ }
@@ -0,0 +1,7 @@
1
+ export { useApiClient } from './api-client';
2
+ export type { ApiResponse } from './api-client';
3
+ export { AssistantProvider, useAssistantConfig } from './assistant-config';
4
+ export type { AssistantConfig, AssistantProviderProps, AssistantUser } from './assistant-config';
5
+ export { getContainerClassName, getDialogClassName } from './class-utils';
6
+ export { processMessagesData } from './message-utils';
7
+ export type { ProcessedMessage } from './message-utils';
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Message processing utilities for AI SDK format conversion
3
+ */
4
+
5
+ interface RawMessage {
6
+ id?: string;
7
+ body_json?: string | object;
8
+ body_text?: string;
9
+ body?: string;
10
+ role?: 'user' | 'assistant';
11
+ sender_name?: string;
12
+ tool_calls?: ToolCall[];
13
+ created_on: string | Date;
14
+ }
15
+
16
+ interface ToolCall {
17
+ id: string;
18
+ type?: string;
19
+ function?: {
20
+ name?: string;
21
+ arguments?: string | object;
22
+ };
23
+ }
24
+
25
+ interface MessagePart {
26
+ type: string;
27
+ text?: string;
28
+ toolCallId?: string;
29
+ toolName?: string;
30
+ args?: object;
31
+ }
32
+
33
+ export interface ProcessedMessage {
34
+ id: string;
35
+ role: 'user' | 'assistant';
36
+ content: string;
37
+ parts: MessagePart[];
38
+ }
39
+
40
+ /**
41
+ * Processes raw message data from the API into AI SDK message format
42
+ * Handles various message formats including tool calls and parts structure
43
+ */
44
+ export function processMessagesData(rawData: RawMessage[]): ProcessedMessage[] {
45
+ // Sort messages by created_on in ascending order
46
+ const sortedData = [...rawData].sort((a, b) => {
47
+ const dateA = new Date(a.created_on).getTime();
48
+ const dateB = new Date(b.created_on).getTime();
49
+
50
+ return dateA - dateB;
51
+ });
52
+
53
+ // Convert to AI SDK message format
54
+ return sortedData
55
+ .map((messageData: RawMessage, index: number) => {
56
+ if (messageData.body_json || messageData.tool_calls) {
57
+ let messageContent = messageData.body_json;
58
+
59
+ // If body_json is a string, parse it
60
+ if (typeof messageContent === 'string') {
61
+ try {
62
+ messageContent = JSON.parse(messageContent);
63
+ } catch (parseError) {
64
+ console.error('Error parsing message body_json:', parseError);
65
+ messageContent = { type: 'text', text: messageContent };
66
+ }
67
+ }
68
+
69
+ // Use role field directly from the API or infer from sender
70
+ const role: 'user' | 'assistant' = messageData.role || (messageData.sender_name === 'Assistant' ? 'assistant' : 'user');
71
+ const content = messageData.body_text || messageData.body || '';
72
+ let parts: MessagePart[] = [];
73
+
74
+ // Handle message with parts structure
75
+ const contentObj = messageContent as { parts?: MessagePart[]; type?: string; toolCalls?: ToolCall[] };
76
+
77
+ if (contentObj && contentObj.parts && Array.isArray(contentObj.parts)) {
78
+ ({ parts } = contentObj);
79
+ } else if (contentObj && contentObj.type === 'toolCalls' && contentObj.toolCalls) {
80
+ // Handle tool calls format from your backend
81
+ parts = [
82
+ {
83
+ type: 'text',
84
+ text: content
85
+ },
86
+ ...contentObj.toolCalls.map((tc: ToolCall) => ({
87
+ type: 'tool-call',
88
+ toolCallId: tc.id,
89
+ toolName: tc.function?.name || tc.type,
90
+ args: tc.function?.arguments ? typeof tc.function.arguments === 'string' ? JSON.parse(tc.function.arguments) : tc.function.arguments : {}
91
+ }))
92
+ ];
93
+ } else if (Array.isArray(messageContent)) {
94
+ // Direct content array (fallback)
95
+ parts = messageContent as MessagePart[];
96
+ } else if (content) {
97
+ // Simple text message
98
+ parts = [{ type: 'text', text: content }];
99
+ }
100
+
101
+ // Also handle tool_calls array at message level (legacy format)
102
+ if (messageData.tool_calls && Array.isArray(messageData.tool_calls)) {
103
+ // Add tool calls to parts if not already present
104
+ const toolCallParts = messageData.tool_calls.map((tc: ToolCall) => ({
105
+ type: 'tool-call',
106
+ toolCallId: tc.id,
107
+ toolName: tc.function?.name || tc.type,
108
+ args: tc.function?.arguments ? typeof tc.function.arguments === 'string' ? JSON.parse(tc.function.arguments) : tc.function.arguments : {}
109
+ }));
110
+
111
+ // If parts only has text, add tool calls
112
+ if (parts.length === 1 && parts[0].type === 'text') {
113
+ parts = [...parts, ...toolCallParts];
114
+ } else if (parts.length === 0) {
115
+ parts = [{ type: 'text', text: content }, ...toolCallParts];
116
+ }
117
+ }
118
+
119
+ // UIMessage format for AI SDK v5
120
+ return {
121
+ id: messageData.id || `msg-${index}`,
122
+ role,
123
+ content, // Add content field for easy access
124
+ parts
125
+ };
126
+ }
127
+
128
+ return null;
129
+ })
130
+ .filter((msg): msg is ProcessedMessage => msg !== null);
131
+ }
@@ -0,0 +1,512 @@
1
+ [
2
+ {
3
+ "name": "getDataSourceList",
4
+ "description": "Gets the list of available data sources",
5
+ "userMessage": "Getting data source list...",
6
+ "requestsUserInput": false,
7
+ "parameters": {
8
+ "$schema": "http://json-schema.org/draft-07/schema#",
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "properties": {}
12
+ }
13
+ },
14
+ {
15
+ "name": "getDataSourceMetadata",
16
+ "description": "Gets the metadata and columns of a data source by ID",
17
+ "userMessage": "Getting data source metadata...",
18
+ "requestsUserInput": false,
19
+ "parameters": {
20
+ "$schema": "http://json-schema.org/draft-07/schema#",
21
+ "type": "object",
22
+ "required": ["data_source_id"],
23
+ "additionalProperties": false,
24
+ "properties": {
25
+ "data_source_id": {
26
+ "type": "string",
27
+ "description": "The ID of the data source to get metadata for"
28
+ }
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "name": "queryDatabase",
34
+ "description": "Runs an SQL query in database and returns the result set",
35
+ "userMessage": "Executing SQL query...",
36
+ "requestsUserInput": false,
37
+ "parameters": {
38
+ "$schema": "http://json-schema.org/draft-07/schema#",
39
+ "type": "object",
40
+ "required": ["sql_query"],
41
+ "additionalProperties": false,
42
+ "properties": {
43
+ "sql_query": {
44
+ "type": "string",
45
+ "description": "The SQL query to execute"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ {
51
+ "name": "readDataFromDataSource",
52
+ "description": "Reads data from a specific data source with filtering, sorting, and pagination options",
53
+ "userMessage": "Reading data from data source...",
54
+ "requestsUserInput": false,
55
+ "parameters": {
56
+ "$schema": "http://json-schema.org/draft-07/schema#",
57
+ "type": "object",
58
+ "required": ["dataSourceId"],
59
+ "additionalProperties": false,
60
+ "properties": {
61
+ "dataSourceId": {
62
+ "type": "string",
63
+ "description": "The ID of the data source to read from"
64
+ },
65
+ "recordId": {
66
+ "type": "string",
67
+ "description": "Specific record ID to fetch"
68
+ },
69
+ "columns": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ },
74
+ "description": "Columns to select"
75
+ },
76
+ "filters": {
77
+ "type": "object",
78
+ "description": "Filter conditions for the query"
79
+ },
80
+ "filterKeyword": {
81
+ "type": "string",
82
+ "description": "Keyword to filter by"
83
+ },
84
+ "limit": {
85
+ "type": "number",
86
+ "description": "Maximum number of records to return"
87
+ },
88
+ "offset": {
89
+ "type": "number",
90
+ "description": "Number of records to skip"
91
+ },
92
+ "orderBy": {
93
+ "type": "array",
94
+ "items": {
95
+ "type": "object",
96
+ "properties": {
97
+ "field": {
98
+ "type": "string"
99
+ },
100
+ "direction": {
101
+ "type": "string",
102
+ "enum": ["asc", "desc"]
103
+ }
104
+ }
105
+ },
106
+ "description": "Sort criteria"
107
+ },
108
+ "fullCount": {
109
+ "type": "boolean",
110
+ "description": "Whether to return full count of records"
111
+ }
112
+ }
113
+ }
114
+ },
115
+ {
116
+ "name": "showDataTable",
117
+ "description": "Shows data in a data table to the user",
118
+ "userMessage": "Displaying data table...",
119
+ "requestsUserInput": false,
120
+ "parameters": {
121
+ "$schema": "http://json-schema.org/draft-07/schema#",
122
+ "type": "object",
123
+ "required": ["title", "columns", "data"],
124
+ "additionalProperties": false,
125
+ "properties": {
126
+ "title": {
127
+ "type": "string",
128
+ "description": "Title of the data table"
129
+ },
130
+ "description": {
131
+ "type": "string",
132
+ "description": "Description of the data table"
133
+ },
134
+ "columns": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "string"
138
+ },
139
+ "description": "Columns of the data table"
140
+ },
141
+ "data": {
142
+ "type": "string",
143
+ "description": "JSON string of data array"
144
+ },
145
+ "additionalComments": {
146
+ "type": "string",
147
+ "description": "Additional comments to be shown to the user"
148
+ }
149
+ }
150
+ }
151
+ },
152
+ {
153
+ "name": "showCreateRecordForm",
154
+ "description": "Opens a form to create a new record",
155
+ "userMessage": "Opening create record form...",
156
+ "requestsUserInput": true,
157
+ "parameters": {
158
+ "$schema": "http://json-schema.org/draft-07/schema#",
159
+ "type": "object",
160
+ "required": ["dataSourceId"],
161
+ "additionalProperties": false,
162
+ "properties": {
163
+ "dataSourceId": {
164
+ "type": "string",
165
+ "description": "ID value of the database table to use as a data source"
166
+ },
167
+ "defaultValues": {
168
+ "type": "string",
169
+ "description": "JSON string of default values. Keys are slugs of data source columns"
170
+ }
171
+ }
172
+ }
173
+ },
174
+ {
175
+ "name": "showRecordDetailsForm",
176
+ "description": "Opens a form to view a record",
177
+ "userMessage": "Opening record details form...",
178
+ "requestsUserInput": false,
179
+ "parameters": {
180
+ "$schema": "http://json-schema.org/draft-07/schema#",
181
+ "type": "object",
182
+ "required": ["dataSourceId", "recordId"],
183
+ "additionalProperties": false,
184
+ "properties": {
185
+ "dataSourceId": {
186
+ "type": "string",
187
+ "description": "ID value of the database table to use as a data source"
188
+ },
189
+ "recordId": {
190
+ "type": "string",
191
+ "description": "ID value of the record to view"
192
+ }
193
+ }
194
+ }
195
+ },
196
+ {
197
+ "name": "showChart",
198
+ "description": "Shows a chart to the user",
199
+ "userMessage": "Displaying chart...",
200
+ "requestsUserInput": false,
201
+ "parameters": {
202
+ "$schema": "http://json-schema.org/draft-07/schema#",
203
+ "type": "object",
204
+ "required": ["dataSourceId", "title", "chartType", "categoryColumns", "valueColumn", "aggregateFunction"],
205
+ "additionalProperties": false,
206
+ "properties": {
207
+ "dataSourceId": {
208
+ "type": "string",
209
+ "description": "ID value of the database table to use as a data source"
210
+ },
211
+ "title": {
212
+ "type": "string",
213
+ "description": "Title of the chart"
214
+ },
215
+ "description": {
216
+ "type": "string",
217
+ "description": "Description of the chart"
218
+ },
219
+ "chartType": {
220
+ "type": "string",
221
+ "enum": ["bar", "pie", "line"],
222
+ "description": "Type of the chart"
223
+ },
224
+ "categoryColumns": {
225
+ "type": "array",
226
+ "items": {
227
+ "type": "string"
228
+ },
229
+ "description": "Columns to use as category in chart drawing"
230
+ },
231
+ "valueColumn": {
232
+ "type": "string",
233
+ "description": "Column name to use as value in chart drawing"
234
+ },
235
+ "aggregateFunction": {
236
+ "type": "string",
237
+ "enum": ["COUNT", "MIN", "MAX", "AVG", "SUM"],
238
+ "description": "Name of the aggregate function"
239
+ },
240
+ "additionalComments": {
241
+ "type": "string",
242
+ "description": "Additional comments to be shown to the user"
243
+ }
244
+ }
245
+ }
246
+ },
247
+ {
248
+ "name": "showImage",
249
+ "description": "Shows an image to the user",
250
+ "userMessage": "Displaying image...",
251
+ "requestsUserInput": false,
252
+ "parameters": {
253
+ "$schema": "http://json-schema.org/draft-07/schema#",
254
+ "type": "object",
255
+ "required": ["imageUrl"],
256
+ "additionalProperties": false,
257
+ "properties": {
258
+ "imageUrl": {
259
+ "type": "string",
260
+ "description": "URL of the image to show"
261
+ },
262
+ "additionalComments": {
263
+ "type": "string",
264
+ "description": "Additional comments to be shown to the user"
265
+ }
266
+ }
267
+ }
268
+ },
269
+ {
270
+ "name": "drawChart",
271
+ "description": "Generates JSON configuration of charting library to draw a chart",
272
+ "userMessage": "Generating chart configuration...",
273
+ "requestsUserInput": false,
274
+ "parameters": {
275
+ "$schema": "http://json-schema.org/draft-07/schema#",
276
+ "type": "object",
277
+ "required": ["chart_type", "category_columns", "value_column", "aggregate_function", "data_source_id"],
278
+ "additionalProperties": false,
279
+ "properties": {
280
+ "chart_type": {
281
+ "type": "string",
282
+ "enum": ["bar", "pie", "line"],
283
+ "description": "Type of chart to generate"
284
+ },
285
+ "category_columns": {
286
+ "type": "array",
287
+ "items": {
288
+ "type": "string"
289
+ },
290
+ "description": "Columns to use as categories"
291
+ },
292
+ "value_column": {
293
+ "type": "string",
294
+ "description": "Column to use for values"
295
+ },
296
+ "aggregate_function": {
297
+ "type": "string",
298
+ "enum": ["COUNT", "MIN", "MAX", "AVG", "SUM"],
299
+ "description": "Aggregation function to apply"
300
+ },
301
+ "data_source_id": {
302
+ "type": "string",
303
+ "description": "ID of the data source to use"
304
+ }
305
+ }
306
+ }
307
+ },
308
+ {
309
+ "name": "getWeatherInfo",
310
+ "description": "Fetches the current weather information for a given city",
311
+ "userMessage": "Getting weather information...",
312
+ "requestsUserInput": false,
313
+ "parameters": {
314
+ "$schema": "http://json-schema.org/draft-07/schema#",
315
+ "type": "object",
316
+ "required": ["city"],
317
+ "additionalProperties": false,
318
+ "properties": {
319
+ "city": {
320
+ "type": "string",
321
+ "description": "Name of the city to get weather information for"
322
+ }
323
+ }
324
+ }
325
+ },
326
+ {
327
+ "name": "readDocumentAtURL",
328
+ "description": "Fetches a document from the given URL and extracts text content as markdown",
329
+ "userMessage": "Reading document from URL...",
330
+ "requestsUserInput": false,
331
+ "parameters": {
332
+ "$schema": "http://json-schema.org/draft-07/schema#",
333
+ "type": "object",
334
+ "required": ["url"],
335
+ "additionalProperties": false,
336
+ "properties": {
337
+ "url": {
338
+ "type": "string",
339
+ "format": "uri",
340
+ "description": "URL of the document to read"
341
+ }
342
+ }
343
+ }
344
+ },
345
+ {
346
+ "name": "readDOCX",
347
+ "description": "Fetches a DOCX file from the given URL and extracts text content as markdown",
348
+ "userMessage": "Reading DOCX file...",
349
+ "requestsUserInput": false,
350
+ "parameters": {
351
+ "$schema": "http://json-schema.org/draft-07/schema#",
352
+ "type": "object",
353
+ "required": ["url"],
354
+ "additionalProperties": false,
355
+ "properties": {
356
+ "url": {
357
+ "type": "string",
358
+ "format": "uri",
359
+ "description": "URL of the DOCX file to read"
360
+ }
361
+ }
362
+ }
363
+ },
364
+ {
365
+ "name": "readPDF",
366
+ "description": "Fetches a PDF file from the given URL and extracts text content, file info and metadata",
367
+ "userMessage": "Reading PDF file...",
368
+ "requestsUserInput": false,
369
+ "parameters": {
370
+ "$schema": "http://json-schema.org/draft-07/schema#",
371
+ "type": "object",
372
+ "required": ["url"],
373
+ "additionalProperties": false,
374
+ "properties": {
375
+ "url": {
376
+ "type": "string",
377
+ "format": "uri",
378
+ "description": "URL of the PDF file to read"
379
+ }
380
+ }
381
+ }
382
+ },
383
+ {
384
+ "name": "readWebPage",
385
+ "description": "Fetches a web page from the given URL and extracts text content in markdown format along with metatags in YAML format",
386
+ "userMessage": "Reading web page content...",
387
+ "requestsUserInput": false,
388
+ "parameters": {
389
+ "$schema": "http://json-schema.org/draft-07/schema#",
390
+ "type": "object",
391
+ "required": ["url"],
392
+ "additionalProperties": false,
393
+ "properties": {
394
+ "url": {
395
+ "type": "string",
396
+ "format": "uri",
397
+ "description": "URL of the web page to read"
398
+ }
399
+ }
400
+ }
401
+ },
402
+ {
403
+ "name": "searchKnowledgeBase",
404
+ "description": "Searches the knowledge base for relevant documents using vector search",
405
+ "userMessage": "Searching knowledge base...",
406
+ "requestsUserInput": false,
407
+ "parameters": {
408
+ "$schema": "http://json-schema.org/draft-07/schema#",
409
+ "type": "object",
410
+ "required": ["query"],
411
+ "additionalProperties": false,
412
+ "properties": {
413
+ "query": {
414
+ "type": "string",
415
+ "description": "Search query to find relevant documents"
416
+ }
417
+ }
418
+ }
419
+ },
420
+ {
421
+ "name": "requestApproval",
422
+ "description": "Ask the end user to approve/deny a specific action",
423
+ "userMessage": "Requesting approval for: {{action}}",
424
+ "requestsUserInput": true,
425
+ "parameters": {
426
+ "$schema": "http://json-schema.org/draft-07/schema#",
427
+ "type": "object",
428
+ "required": ["action"],
429
+ "additionalProperties": false,
430
+ "properties": {
431
+ "action": {
432
+ "type": "string",
433
+ "description": "Short name of the action that needs approval"
434
+ },
435
+ "details": {
436
+ "type": "string",
437
+ "description": "Optional extra info shown to user"
438
+ }
439
+ }
440
+ }
441
+ },
442
+ {
443
+ "name": "searchWeb",
444
+ "description": "Fetches data from duckduckgo search engine for a given query",
445
+ "userMessage": "Searching the web...",
446
+ "requestsUserInput": false,
447
+ "parameters": {
448
+ "$schema": "http://json-schema.org/draft-07/schema#",
449
+ "type": "object",
450
+ "required": ["query"],
451
+ "additionalProperties": false,
452
+ "properties": {
453
+ "query": {
454
+ "type": "string",
455
+ "description": "Search query"
456
+ },
457
+ "region": {
458
+ "type": "string",
459
+ "description": "Region code for search results"
460
+ }
461
+ }
462
+ }
463
+ },
464
+ {
465
+ "name": "previewCode",
466
+ "description": "Previews code to the user in a code viewer and runs the code in a sandboxed environment",
467
+ "icon": "fal code",
468
+ "userMessage": "Previewing code...",
469
+ "requestsUserInput": false,
470
+ "work": true,
471
+ "parameters": {
472
+ "$schema": "http://json-schema.org/draft-07/schema#",
473
+ "type": "object",
474
+ "required": ["title", "code"],
475
+ "additionalProperties": false,
476
+ "properties": {
477
+ "title": {
478
+ "type": "string",
479
+ "description": "A title for the code snippet"
480
+ },
481
+ "code": {
482
+ "type": "string",
483
+ "description": "The code to preview and run"
484
+ }
485
+ }
486
+ }
487
+ },
488
+ {
489
+ "name": "generateImage",
490
+ "description": "Generates an image based on the given prompt",
491
+ "icon": "fal image",
492
+ "userMessage": "Generating image...",
493
+ "requestsUserInput": false,
494
+ "work": true,
495
+ "parameters": {
496
+ "$schema": "http://json-schema.org/draft-07/schema#",
497
+ "type": "object",
498
+ "required": ["title", "src"],
499
+ "additionalProperties": false,
500
+ "properties": {
501
+ "title": {
502
+ "type": "string",
503
+ "description": "A title for the image"
504
+ },
505
+ "src": {
506
+ "type": "string",
507
+ "description": "The image URL"
508
+ }
509
+ }
510
+ }
511
+ }
512
+ ]