@meistrari/chat-nuxt 1.0.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 (479) hide show
  1. package/README.md +274 -0
  2. package/dist/module.d.mts +3 -0
  3. package/dist/module.json +9 -0
  4. package/dist/module.mjs +250 -0
  5. package/dist/runtime/assets/css/code-theme.css +1 -0
  6. package/dist/runtime/assets/css/markstream.css +1 -0
  7. package/dist/runtime/components/AppStatusToast.d.vue.ts +3 -0
  8. package/dist/runtime/components/AppStatusToast.vue +42 -0
  9. package/dist/runtime/components/AppStatusToast.vue.d.ts +3 -0
  10. package/dist/runtime/components/TelaChat.d.vue.ts +19 -0
  11. package/dist/runtime/components/TelaChat.vue +25 -0
  12. package/dist/runtime/components/TelaChat.vue.d.ts +19 -0
  13. package/dist/runtime/components/app-markdown-render.d.vue.ts +15 -0
  14. package/dist/runtime/components/app-markdown-render.vue +45 -0
  15. package/dist/runtime/components/app-markdown-render.vue.d.ts +15 -0
  16. package/dist/runtime/components/application-card.d.vue.ts +9 -0
  17. package/dist/runtime/components/application-card.vue +52 -0
  18. package/dist/runtime/components/application-card.vue.d.ts +9 -0
  19. package/dist/runtime/components/audio-preview.d.vue.ts +14 -0
  20. package/dist/runtime/components/audio-preview.vue +52 -0
  21. package/dist/runtime/components/audio-preview.vue.d.ts +14 -0
  22. package/dist/runtime/components/chat/bash-widget.d.vue.ts +9 -0
  23. package/dist/runtime/components/chat/bash-widget.vue +86 -0
  24. package/dist/runtime/components/chat/bash-widget.vue.d.ts +9 -0
  25. package/dist/runtime/components/chat/canvas-selector-modal.d.vue.ts +14 -0
  26. package/dist/runtime/components/chat/canvas-selector-modal.vue +290 -0
  27. package/dist/runtime/components/chat/canvas-selector-modal.vue.d.ts +14 -0
  28. package/dist/runtime/components/chat/context-config.d.vue.ts +30 -0
  29. package/dist/runtime/components/chat/context-config.vue +423 -0
  30. package/dist/runtime/components/chat/context-config.vue.d.ts +30 -0
  31. package/dist/runtime/components/chat/conversation-item.d.vue.ts +20 -0
  32. package/dist/runtime/components/chat/conversation-item.vue +184 -0
  33. package/dist/runtime/components/chat/conversation-item.vue.d.ts +20 -0
  34. package/dist/runtime/components/chat/conversation-list.d.vue.ts +10 -0
  35. package/dist/runtime/components/chat/conversation-list.vue +78 -0
  36. package/dist/runtime/components/chat/conversation-list.vue.d.ts +10 -0
  37. package/dist/runtime/components/chat/doc-sdk-widget.d.vue.ts +9 -0
  38. package/dist/runtime/components/chat/doc-sdk-widget.vue +74 -0
  39. package/dist/runtime/components/chat/doc-sdk-widget.vue.d.ts +9 -0
  40. package/dist/runtime/components/chat/file-preview.d.vue.ts +7 -0
  41. package/dist/runtime/components/chat/file-preview.vue +313 -0
  42. package/dist/runtime/components/chat/file-preview.vue.d.ts +7 -0
  43. package/dist/runtime/components/chat/files-view.d.vue.ts +6 -0
  44. package/dist/runtime/components/chat/files-view.vue +399 -0
  45. package/dist/runtime/components/chat/files-view.vue.d.ts +6 -0
  46. package/dist/runtime/components/chat/generic-tool-widget.d.vue.ts +9 -0
  47. package/dist/runtime/components/chat/generic-tool-widget.vue +334 -0
  48. package/dist/runtime/components/chat/generic-tool-widget.vue.d.ts +9 -0
  49. package/dist/runtime/components/chat/grep-widget.d.vue.ts +9 -0
  50. package/dist/runtime/components/chat/grep-widget.vue +259 -0
  51. package/dist/runtime/components/chat/grep-widget.vue.d.ts +9 -0
  52. package/dist/runtime/components/chat/mention-dropdown.d.vue.ts +14 -0
  53. package/dist/runtime/components/chat/mention-dropdown.vue +90 -0
  54. package/dist/runtime/components/chat/mention-dropdown.vue.d.ts +14 -0
  55. package/dist/runtime/components/chat/message-bubble.d.vue.ts +11 -0
  56. package/dist/runtime/components/chat/message-bubble.vue +288 -0
  57. package/dist/runtime/components/chat/message-bubble.vue.d.ts +11 -0
  58. package/dist/runtime/components/chat/message-input.d.vue.ts +34 -0
  59. package/dist/runtime/components/chat/message-input.vue +428 -0
  60. package/dist/runtime/components/chat/message-input.vue.d.ts +34 -0
  61. package/dist/runtime/components/chat/message-list.d.vue.ts +11 -0
  62. package/dist/runtime/components/chat/message-list.vue +36 -0
  63. package/dist/runtime/components/chat/message-list.vue.d.ts +11 -0
  64. package/dist/runtime/components/chat/model-selector.d.vue.ts +15 -0
  65. package/dist/runtime/components/chat/model-selector.vue +35 -0
  66. package/dist/runtime/components/chat/model-selector.vue.d.ts +15 -0
  67. package/dist/runtime/components/chat/new-conversation-modal.d.vue.ts +14 -0
  68. package/dist/runtime/components/chat/new-conversation-modal.vue +271 -0
  69. package/dist/runtime/components/chat/new-conversation-modal.vue.d.ts +14 -0
  70. package/dist/runtime/components/chat/read-widget.d.vue.ts +9 -0
  71. package/dist/runtime/components/chat/read-widget.vue +195 -0
  72. package/dist/runtime/components/chat/read-widget.vue.d.ts +9 -0
  73. package/dist/runtime/components/chat/reasoning-message.d.vue.ts +13 -0
  74. package/dist/runtime/components/chat/reasoning-message.vue +341 -0
  75. package/dist/runtime/components/chat/reasoning-message.vue.d.ts +13 -0
  76. package/dist/runtime/components/chat/reasoning-step-item.d.vue.ts +37 -0
  77. package/dist/runtime/components/chat/reasoning-step-item.vue +125 -0
  78. package/dist/runtime/components/chat/reasoning-step-item.vue.d.ts +37 -0
  79. package/dist/runtime/components/chat/reasoning-steps.d.vue.ts +12 -0
  80. package/dist/runtime/components/chat/reasoning-steps.vue +47 -0
  81. package/dist/runtime/components/chat/reasoning-steps.vue.d.ts +12 -0
  82. package/dist/runtime/components/chat/reasoning-thought.d.vue.ts +11 -0
  83. package/dist/runtime/components/chat/reasoning-thought.vue +287 -0
  84. package/dist/runtime/components/chat/reasoning-thought.vue.d.ts +11 -0
  85. package/dist/runtime/components/chat/tela-skill-widget.d.vue.ts +9 -0
  86. package/dist/runtime/components/chat/tela-skill-widget.vue +94 -0
  87. package/dist/runtime/components/chat/tela-skill-widget.vue.d.ts +9 -0
  88. package/dist/runtime/components/chat/thinking-indicator.d.vue.ts +3 -0
  89. package/dist/runtime/components/chat/thinking-indicator.vue +52 -0
  90. package/dist/runtime/components/chat/thinking-indicator.vue.d.ts +3 -0
  91. package/dist/runtime/components/chat/thinking-widget.d.vue.ts +8 -0
  92. package/dist/runtime/components/chat/thinking-widget.vue +53 -0
  93. package/dist/runtime/components/chat/thinking-widget.vue.d.ts +8 -0
  94. package/dist/runtime/components/chat/topbar.d.vue.ts +43 -0
  95. package/dist/runtime/components/chat/topbar.vue +223 -0
  96. package/dist/runtime/components/chat/topbar.vue.d.ts +43 -0
  97. package/dist/runtime/components/chat/usage-view.d.vue.ts +8 -0
  98. package/dist/runtime/components/chat/usage-view.vue +393 -0
  99. package/dist/runtime/components/chat/usage-view.vue.d.ts +8 -0
  100. package/dist/runtime/components/chat/vault-link.d.vue.ts +20 -0
  101. package/dist/runtime/components/chat/vault-link.vue +34 -0
  102. package/dist/runtime/components/chat/vault-link.vue.d.ts +20 -0
  103. package/dist/runtime/components/chat/web-search-widget.d.vue.ts +9 -0
  104. package/dist/runtime/components/chat/web-search-widget.vue +121 -0
  105. package/dist/runtime/components/chat/web-search-widget.vue.d.ts +9 -0
  106. package/dist/runtime/components/chat/workstation-query-widget.d.vue.ts +10 -0
  107. package/dist/runtime/components/chat/workstation-query-widget.vue +552 -0
  108. package/dist/runtime/components/chat/workstation-query-widget.vue.d.ts +10 -0
  109. package/dist/runtime/components/chat/workstation-selector-modal.d.vue.ts +14 -0
  110. package/dist/runtime/components/chat/workstation-selector-modal.vue +272 -0
  111. package/dist/runtime/components/chat/workstation-selector-modal.vue.d.ts +14 -0
  112. package/dist/runtime/components/chat/write-widget.d.vue.ts +9 -0
  113. package/dist/runtime/components/chat/write-widget.vue +165 -0
  114. package/dist/runtime/components/chat/write-widget.vue.d.ts +9 -0
  115. package/dist/runtime/components/conversation-files-panel.d.vue.ts +3 -0
  116. package/dist/runtime/components/conversation-files-panel.vue +252 -0
  117. package/dist/runtime/components/conversation-files-panel.vue.d.ts +3 -0
  118. package/dist/runtime/components/csv-preview.d.vue.ts +20 -0
  119. package/dist/runtime/components/csv-preview.vue +157 -0
  120. package/dist/runtime/components/csv-preview.vue.d.ts +20 -0
  121. package/dist/runtime/components/file-preview-panel.d.vue.ts +3 -0
  122. package/dist/runtime/components/file-preview-panel.vue +185 -0
  123. package/dist/runtime/components/file-preview-panel.vue.d.ts +3 -0
  124. package/dist/runtime/components/file-uploader.d.vue.ts +16 -0
  125. package/dist/runtime/components/file-uploader.vue +136 -0
  126. package/dist/runtime/components/file-uploader.vue.d.ts +16 -0
  127. package/dist/runtime/components/icons/anthropic.d.vue.ts +3 -0
  128. package/dist/runtime/components/icons/anthropic.vue +5 -0
  129. package/dist/runtime/components/icons/anthropic.vue.d.ts +3 -0
  130. package/dist/runtime/components/image-preview.d.vue.ts +14 -0
  131. package/dist/runtime/components/image-preview.vue +54 -0
  132. package/dist/runtime/components/image-preview.vue.d.ts +14 -0
  133. package/dist/runtime/components/json-tree-node.d.vue.ts +9 -0
  134. package/dist/runtime/components/json-tree-node.vue +109 -0
  135. package/dist/runtime/components/json-tree-node.vue.d.ts +9 -0
  136. package/dist/runtime/components/json-viewer.d.vue.ts +6 -0
  137. package/dist/runtime/components/json-viewer.vue +88 -0
  138. package/dist/runtime/components/json-viewer.vue.d.ts +6 -0
  139. package/dist/runtime/components/pdf-preview.d.vue.ts +20 -0
  140. package/dist/runtime/components/pdf-preview.vue +89 -0
  141. package/dist/runtime/components/pdf-preview.vue.d.ts +20 -0
  142. package/dist/runtime/components/pdf-viewer.d.vue.ts +10 -0
  143. package/dist/runtime/components/pdf-viewer.vue +265 -0
  144. package/dist/runtime/components/pdf-viewer.vue.d.ts +10 -0
  145. package/dist/runtime/components/powered-by-tela.d.vue.ts +3 -0
  146. package/dist/runtime/components/powered-by-tela.vue +14 -0
  147. package/dist/runtime/components/powered-by-tela.vue.d.ts +3 -0
  148. package/dist/runtime/components/renderers/artifact-display.d.vue.ts +15 -0
  149. package/dist/runtime/components/renderers/artifact-display.vue +105 -0
  150. package/dist/runtime/components/renderers/artifact-display.vue.d.ts +15 -0
  151. package/dist/runtime/components/renderers/audio-renderer.d.vue.ts +7 -0
  152. package/dist/runtime/components/renderers/audio-renderer.vue +52 -0
  153. package/dist/runtime/components/renderers/audio-renderer.vue.d.ts +7 -0
  154. package/dist/runtime/components/renderers/csv-renderer.d.vue.ts +6 -0
  155. package/dist/runtime/components/renderers/csv-renderer.vue +203 -0
  156. package/dist/runtime/components/renderers/csv-renderer.vue.d.ts +6 -0
  157. package/dist/runtime/components/renderers/image-renderer.d.vue.ts +7 -0
  158. package/dist/runtime/components/renderers/image-renderer.vue +44 -0
  159. package/dist/runtime/components/renderers/image-renderer.vue.d.ts +7 -0
  160. package/dist/runtime/components/renderers/markdown-renderer.d.vue.ts +6 -0
  161. package/dist/runtime/components/renderers/markdown-renderer.vue +66 -0
  162. package/dist/runtime/components/renderers/markdown-renderer.vue.d.ts +6 -0
  163. package/dist/runtime/components/renderers/mermaid-diagram.d.vue.ts +7 -0
  164. package/dist/runtime/components/renderers/mermaid-diagram.vue +165 -0
  165. package/dist/runtime/components/renderers/mermaid-diagram.vue.d.ts +7 -0
  166. package/dist/runtime/components/renderers/text-renderer.d.vue.ts +7 -0
  167. package/dist/runtime/components/renderers/text-renderer.vue +70 -0
  168. package/dist/runtime/components/renderers/text-renderer.vue.d.ts +7 -0
  169. package/dist/runtime/components/renderers/video-renderer.d.vue.ts +6 -0
  170. package/dist/runtime/components/renderers/video-renderer.vue +43 -0
  171. package/dist/runtime/components/renderers/video-renderer.vue.d.ts +6 -0
  172. package/dist/runtime/components/text-preview.d.vue.ts +19 -0
  173. package/dist/runtime/components/text-preview.vue +105 -0
  174. package/dist/runtime/components/text-preview.vue.d.ts +19 -0
  175. package/dist/runtime/components/video-preview.d.vue.ts +14 -0
  176. package/dist/runtime/components/video-preview.vue +55 -0
  177. package/dist/runtime/components/video-preview.vue.d.ts +14 -0
  178. package/dist/runtime/composables/PageNavigation.d.ts +13 -0
  179. package/dist/runtime/composables/PageNavigation.js +18 -0
  180. package/dist/runtime/composables/useChat.d.ts +25 -0
  181. package/dist/runtime/composables/useChat.js +512 -0
  182. package/dist/runtime/composables/useChatApi.d.ts +6 -0
  183. package/dist/runtime/composables/useChatApi.js +28 -0
  184. package/dist/runtime/composables/useConversationFiles.d.ts +13 -0
  185. package/dist/runtime/composables/useConversationFiles.js +98 -0
  186. package/dist/runtime/composables/useConversationFilesPanel.d.ts +11 -0
  187. package/dist/runtime/composables/useConversationFilesPanel.js +35 -0
  188. package/dist/runtime/composables/useConversations.d.ts +15 -0
  189. package/dist/runtime/composables/useConversations.js +191 -0
  190. package/dist/runtime/composables/useDiagramExport.d.ts +11 -0
  191. package/dist/runtime/composables/useDiagramExport.js +186 -0
  192. package/dist/runtime/composables/useEmbedConfig.d.ts +13 -0
  193. package/dist/runtime/composables/useEmbedConfig.js +11 -0
  194. package/dist/runtime/composables/useFeatureFlags.d.ts +19 -0
  195. package/dist/runtime/composables/useFeatureFlags.js +67 -0
  196. package/dist/runtime/composables/useFileDrop.d.ts +17 -0
  197. package/dist/runtime/composables/useFileDrop.js +89 -0
  198. package/dist/runtime/composables/useFilePreviewPanel.d.ts +30 -0
  199. package/dist/runtime/composables/useFilePreviewPanel.js +42 -0
  200. package/dist/runtime/composables/useFileUpload.d.ts +7 -0
  201. package/dist/runtime/composables/useFileUpload.js +39 -0
  202. package/dist/runtime/composables/useGitHubSkills.d.ts +6 -0
  203. package/dist/runtime/composables/useGitHubSkills.js +68 -0
  204. package/dist/runtime/composables/useGitHubSkillsCallback.d.ts +5 -0
  205. package/dist/runtime/composables/useGitHubSkillsCallback.js +42 -0
  206. package/dist/runtime/composables/useIDB.d.ts +11 -0
  207. package/dist/runtime/composables/useIDB.js +57 -0
  208. package/dist/runtime/composables/useInputHistory.d.ts +7 -0
  209. package/dist/runtime/composables/useInputHistory.js +36 -0
  210. package/dist/runtime/composables/useKnowledgeSources.d.ts +6 -0
  211. package/dist/runtime/composables/useKnowledgeSources.js +15 -0
  212. package/dist/runtime/composables/useMediaCache.d.ts +13 -0
  213. package/dist/runtime/composables/useMediaCache.js +92 -0
  214. package/dist/runtime/composables/useMentionAutocomplete.d.ts +10 -0
  215. package/dist/runtime/composables/useMentionAutocomplete.js +272 -0
  216. package/dist/runtime/composables/useMermaidRenderer.d.ts +5 -0
  217. package/dist/runtime/composables/useMermaidRenderer.js +121 -0
  218. package/dist/runtime/composables/usePdf.d.ts +21 -0
  219. package/dist/runtime/composables/usePdf.js +138 -0
  220. package/dist/runtime/composables/usePolling.d.ts +12 -0
  221. package/dist/runtime/composables/usePolling.js +55 -0
  222. package/dist/runtime/composables/useSelectedModel.d.ts +4 -0
  223. package/dist/runtime/composables/useSelectedModel.js +46 -0
  224. package/dist/runtime/composables/useSplashScreen.d.ts +3 -0
  225. package/dist/runtime/composables/useSplashScreen.js +4 -0
  226. package/dist/runtime/composables/useStatusToast.d.ts +22 -0
  227. package/dist/runtime/composables/useStatusToast.js +40 -0
  228. package/dist/runtime/composables/useTela.d.ts +12 -0
  229. package/dist/runtime/composables/useTela.js +47 -0
  230. package/dist/runtime/composables/useToolFormatting.d.ts +5 -0
  231. package/dist/runtime/composables/useToolFormatting.js +61 -0
  232. package/dist/runtime/composables/useVault.d.ts +13 -0
  233. package/dist/runtime/composables/useVault.js +35 -0
  234. package/dist/runtime/composables/useVerbConjugation.d.ts +6 -0
  235. package/dist/runtime/composables/useVerbConjugation.js +256 -0
  236. package/dist/runtime/composables/useWorkspaceContextFiles.d.ts +19 -0
  237. package/dist/runtime/composables/useWorkspaceContextFiles.js +74 -0
  238. package/dist/runtime/composables/useWorkspaceCredentials.d.ts +34 -0
  239. package/dist/runtime/composables/useWorkspaceCredentials.js +175 -0
  240. package/dist/runtime/composables/useWorkspaceExternalSkills.d.ts +22 -0
  241. package/dist/runtime/composables/useWorkspaceExternalSkills.js +135 -0
  242. package/dist/runtime/composables/useWorkspaceKnowledgeSources.d.ts +11 -0
  243. package/dist/runtime/composables/useWorkspaceKnowledgeSources.js +88 -0
  244. package/dist/runtime/composables/useWorkspaceMembers.d.ts +13 -0
  245. package/dist/runtime/composables/useWorkspaceMembers.js +37 -0
  246. package/dist/runtime/composables/useWorkspacePersonalization.d.ts +6 -0
  247. package/dist/runtime/composables/useWorkspacePersonalization.js +19 -0
  248. package/dist/runtime/composables/useWorkspaceSettings.d.ts +30 -0
  249. package/dist/runtime/composables/useWorkspaceSettings.js +135 -0
  250. package/dist/runtime/composables/useWorkspaceTelaTools.d.ts +13 -0
  251. package/dist/runtime/composables/useWorkspaceTelaTools.js +91 -0
  252. package/dist/runtime/composables/useWorkspaces.d.ts +5 -0
  253. package/dist/runtime/composables/useWorkspaces.js +14 -0
  254. package/dist/runtime/composables/useZoomPan.d.ts +18 -0
  255. package/dist/runtime/composables/useZoomPan.js +130 -0
  256. package/dist/runtime/embed/components/ChatEmbed.d.vue.ts +23 -0
  257. package/dist/runtime/embed/components/ChatEmbed.vue +27 -0
  258. package/dist/runtime/embed/components/ChatEmbed.vue.d.ts +23 -0
  259. package/dist/runtime/embed/components/ChatEmbedInner.d.vue.ts +19 -0
  260. package/dist/runtime/embed/components/ChatEmbedInner.vue +604 -0
  261. package/dist/runtime/embed/components/ChatEmbedInner.vue.d.ts +19 -0
  262. package/dist/runtime/public/favicon.svg +4 -0
  263. package/dist/runtime/public/files/archive.svg +9 -0
  264. package/dist/runtime/public/files/audio.svg +4 -0
  265. package/dist/runtime/public/files/c.svg +4 -0
  266. package/dist/runtime/public/files/cpp.svg +6 -0
  267. package/dist/runtime/public/files/css.svg +4 -0
  268. package/dist/runtime/public/files/doc.svg +5 -0
  269. package/dist/runtime/public/files/generic.svg +7 -0
  270. package/dist/runtime/public/files/go.svg +6 -0
  271. package/dist/runtime/public/files/html.svg +4 -0
  272. package/dist/runtime/public/files/image.svg +3 -0
  273. package/dist/runtime/public/files/java.svg +7 -0
  274. package/dist/runtime/public/files/javascript.svg +4 -0
  275. package/dist/runtime/public/files/json.svg +5 -0
  276. package/dist/runtime/public/files/markdown.svg +5 -0
  277. package/dist/runtime/public/files/pdf.svg +5 -0
  278. package/dist/runtime/public/files/presentation.svg +5 -0
  279. package/dist/runtime/public/files/python.svg +5 -0
  280. package/dist/runtime/public/files/ruby.svg +5 -0
  281. package/dist/runtime/public/files/rust.svg +13 -0
  282. package/dist/runtime/public/files/sheet.svg +9 -0
  283. package/dist/runtime/public/files/shell.svg +5 -0
  284. package/dist/runtime/public/files/sql.svg +6 -0
  285. package/dist/runtime/public/files/typescript.svg +5 -0
  286. package/dist/runtime/public/files/video.svg +5 -0
  287. package/dist/runtime/public/files/yaml.svg +7 -0
  288. package/dist/runtime/public/github.svg +3 -0
  289. package/dist/runtime/public/robots.txt +1 -0
  290. package/dist/runtime/server/api/admin/trigger-usage-report.post.d.ts +2 -0
  291. package/dist/runtime/server/api/admin/trigger-usage-report.post.js +15 -0
  292. package/dist/runtime/server/api/chat/conversations/[id]/cancel.post.d.ts +1 -0
  293. package/dist/runtime/server/api/chat/conversations/[id]/cancel.post.js +1 -0
  294. package/dist/runtime/server/api/chat/conversations/[id]/clear.post.d.ts +1 -0
  295. package/dist/runtime/server/api/chat/conversations/[id]/clear.post.js +1 -0
  296. package/dist/runtime/server/api/chat/conversations/[id]/duplicate.post.d.ts +1 -0
  297. package/dist/runtime/server/api/chat/conversations/[id]/duplicate.post.js +1 -0
  298. package/dist/runtime/server/api/chat/conversations/[id]/files.get.d.ts +1 -0
  299. package/dist/runtime/server/api/chat/conversations/[id]/files.get.js +1 -0
  300. package/dist/runtime/server/api/chat/conversations/[id]/index.delete.d.ts +1 -0
  301. package/dist/runtime/server/api/chat/conversations/[id]/index.delete.js +1 -0
  302. package/dist/runtime/server/api/chat/conversations/[id]/index.get.d.ts +1 -0
  303. package/dist/runtime/server/api/chat/conversations/[id]/index.get.js +1 -0
  304. package/dist/runtime/server/api/chat/conversations/[id]/index.patch.d.ts +1 -0
  305. package/dist/runtime/server/api/chat/conversations/[id]/index.patch.js +1 -0
  306. package/dist/runtime/server/api/chat/conversations/[id]/messages/[messageId]/retry.post.d.ts +1 -0
  307. package/dist/runtime/server/api/chat/conversations/[id]/messages/[messageId]/retry.post.js +1 -0
  308. package/dist/runtime/server/api/chat/conversations/[id]/messages/index.get.d.ts +1 -0
  309. package/dist/runtime/server/api/chat/conversations/[id]/messages/index.get.js +1 -0
  310. package/dist/runtime/server/api/chat/conversations/[id]/messages/index.post.d.ts +1 -0
  311. package/dist/runtime/server/api/chat/conversations/[id]/messages/index.post.js +1 -0
  312. package/dist/runtime/server/api/chat/conversations/[id]/usage.get.d.ts +1 -0
  313. package/dist/runtime/server/api/chat/conversations/[id]/usage.get.js +1 -0
  314. package/dist/runtime/server/api/chat/conversations/generate-title.post.d.ts +1 -0
  315. package/dist/runtime/server/api/chat/conversations/generate-title.post.js +1 -0
  316. package/dist/runtime/server/api/chat/conversations/index.get.d.ts +1 -0
  317. package/dist/runtime/server/api/chat/conversations/index.get.js +1 -0
  318. package/dist/runtime/server/api/chat/conversations/index.post.d.ts +1 -0
  319. package/dist/runtime/server/api/chat/conversations/index.post.js +1 -0
  320. package/dist/runtime/server/api/chat/workspace/settings.get.d.ts +2 -0
  321. package/dist/runtime/server/api/chat/workspace/settings.get.js +14 -0
  322. package/dist/runtime/server/api/conversations/[id]/cancel.post.d.ts +2 -0
  323. package/dist/runtime/server/api/conversations/[id]/cancel.post.js +58 -0
  324. package/dist/runtime/server/api/conversations/[id]/clear.post.d.ts +2 -0
  325. package/dist/runtime/server/api/conversations/[id]/clear.post.js +38 -0
  326. package/dist/runtime/server/api/conversations/[id]/duplicate.post.d.ts +2 -0
  327. package/dist/runtime/server/api/conversations/[id]/duplicate.post.js +41 -0
  328. package/dist/runtime/server/api/conversations/[id]/files.get.d.ts +2 -0
  329. package/dist/runtime/server/api/conversations/[id]/files.get.js +131 -0
  330. package/dist/runtime/server/api/conversations/[id]/index.delete.d.ts +2 -0
  331. package/dist/runtime/server/api/conversations/[id]/index.delete.js +35 -0
  332. package/dist/runtime/server/api/conversations/[id]/index.get.d.ts +2 -0
  333. package/dist/runtime/server/api/conversations/[id]/index.get.js +34 -0
  334. package/dist/runtime/server/api/conversations/[id]/index.patch.d.ts +2 -0
  335. package/dist/runtime/server/api/conversations/[id]/index.patch.js +54 -0
  336. package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.d.ts +2 -0
  337. package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.js +168 -0
  338. package/dist/runtime/server/api/conversations/[id]/messages/index.get.d.ts +2 -0
  339. package/dist/runtime/server/api/conversations/[id]/messages/index.get.js +220 -0
  340. package/dist/runtime/server/api/conversations/[id]/messages/index.post.d.ts +2 -0
  341. package/dist/runtime/server/api/conversations/[id]/messages/index.post.js +181 -0
  342. package/dist/runtime/server/api/conversations/[id]/usage.get.d.ts +8 -0
  343. package/dist/runtime/server/api/conversations/[id]/usage.get.js +96 -0
  344. package/dist/runtime/server/api/conversations/generate-title.post.d.ts +2 -0
  345. package/dist/runtime/server/api/conversations/generate-title.post.js +49 -0
  346. package/dist/runtime/server/api/conversations/index.get.d.ts +2 -0
  347. package/dist/runtime/server/api/conversations/index.get.js +11 -0
  348. package/dist/runtime/server/api/conversations/index.post.d.ts +2 -0
  349. package/dist/runtime/server/api/conversations/index.post.js +41 -0
  350. package/dist/runtime/server/api/external-skills/discover.post.d.ts +2 -0
  351. package/dist/runtime/server/api/external-skills/discover.post.js +65 -0
  352. package/dist/runtime/server/api/github/disconnect.post.d.ts +2 -0
  353. package/dist/runtime/server/api/github/disconnect.post.js +21 -0
  354. package/dist/runtime/server/api/github/status.get.d.ts +2 -0
  355. package/dist/runtime/server/api/github/status.get.js +23 -0
  356. package/dist/runtime/server/api/tela/canvas.get.d.ts +2 -0
  357. package/dist/runtime/server/api/tela/canvas.get.js +18 -0
  358. package/dist/runtime/server/api/tela/projects.get.d.ts +2 -0
  359. package/dist/runtime/server/api/tela/projects.get.js +9 -0
  360. package/dist/runtime/server/api/tela/workspaces.get.d.ts +2 -0
  361. package/dist/runtime/server/api/tela/workspaces.get.js +9 -0
  362. package/dist/runtime/server/api/tela/workstations.get.d.ts +2 -0
  363. package/dist/runtime/server/api/tela/workstations.get.js +24 -0
  364. package/dist/runtime/server/api/vault/permalink-metadata.post.d.ts +2 -0
  365. package/dist/runtime/server/api/vault/permalink-metadata.post.js +77 -0
  366. package/dist/runtime/server/api/vault/resolve.post.d.ts +2 -0
  367. package/dist/runtime/server/api/vault/resolve.post.js +82 -0
  368. package/dist/runtime/server/api/vault/upload.post.d.ts +2 -0
  369. package/dist/runtime/server/api/vault/upload.post.js +55 -0
  370. package/dist/runtime/server/api/workspace/credentials/[id].delete.d.ts +2 -0
  371. package/dist/runtime/server/api/workspace/credentials/[id].delete.js +18 -0
  372. package/dist/runtime/server/api/workspace/credentials/[id].put.d.ts +2 -0
  373. package/dist/runtime/server/api/workspace/credentials/[id].put.js +28 -0
  374. package/dist/runtime/server/api/workspace/credentials/index.get.d.ts +2 -0
  375. package/dist/runtime/server/api/workspace/credentials/index.get.js +10 -0
  376. package/dist/runtime/server/api/workspace/credentials/index.post.d.ts +2 -0
  377. package/dist/runtime/server/api/workspace/credentials/index.post.js +33 -0
  378. package/dist/runtime/server/api/workspace/settings.get.d.ts +2 -0
  379. package/dist/runtime/server/api/workspace/settings.get.js +27 -0
  380. package/dist/runtime/server/api/workspace/settings.patch.d.ts +2 -0
  381. package/dist/runtime/server/api/workspace/settings.patch.js +86 -0
  382. package/dist/runtime/server/api/workspace/usage.get.d.ts +48 -0
  383. package/dist/runtime/server/api/workspace/usage.get.js +186 -0
  384. package/dist/runtime/server/db/index.d.ts +6 -0
  385. package/dist/runtime/server/db/index.js +19 -0
  386. package/dist/runtime/server/db/schema/conversation-usage.d.ts +438 -0
  387. package/dist/runtime/server/db/schema/conversation-usage.js +34 -0
  388. package/dist/runtime/server/db/schema/conversations.d.ts +197 -0
  389. package/dist/runtime/server/db/schema/conversations.js +18 -0
  390. package/dist/runtime/server/db/schema/external-skills.d.ts +235 -0
  391. package/dist/runtime/server/db/schema/external-skills.js +26 -0
  392. package/dist/runtime/server/db/schema/index.d.ts +5 -0
  393. package/dist/runtime/server/db/schema/index.js +5 -0
  394. package/dist/runtime/server/db/schema/messages.d.ts +221 -0
  395. package/dist/runtime/server/db/schema/messages.js +19 -0
  396. package/dist/runtime/server/db/schema/workspace-settings.d.ts +164 -0
  397. package/dist/runtime/server/db/schema/workspace-settings.js +15 -0
  398. package/dist/runtime/server/db/schema.d.ts +1 -0
  399. package/dist/runtime/server/db/schema.js +1 -0
  400. package/dist/runtime/server/middleware/domain-validation.d.ts +2 -0
  401. package/dist/runtime/server/middleware/domain-validation.js +22 -0
  402. package/dist/runtime/server/middleware/request-logger.d.ts +2 -0
  403. package/dist/runtime/server/middleware/request-logger.js +15 -0
  404. package/dist/runtime/server/prompts/base-system.d.ts +2 -0
  405. package/dist/runtime/server/prompts/base-system.js +100 -0
  406. package/dist/runtime/server/prompts/base-system.md +99 -0
  407. package/dist/runtime/server/prompts/knowledge-sources.d.ts +2 -0
  408. package/dist/runtime/server/prompts/knowledge-sources.js +37 -0
  409. package/dist/runtime/server/prompts/knowledge-sources.md +36 -0
  410. package/dist/runtime/server/tasks/send-daily-usage-report.d.ts +2 -0
  411. package/dist/runtime/server/tasks/send-daily-usage-report.js +73 -0
  412. package/dist/runtime/server/tsconfig.json +21 -0
  413. package/dist/runtime/server/utils/agent-api.d.ts +39 -0
  414. package/dist/runtime/server/utils/agent-api.js +169 -0
  415. package/dist/runtime/server/utils/auth-api.d.ts +1 -0
  416. package/dist/runtime/server/utils/auth-api.js +25 -0
  417. package/dist/runtime/server/utils/auth.d.ts +17 -0
  418. package/dist/runtime/server/utils/auth.js +28 -0
  419. package/dist/runtime/server/utils/billing.d.ts +37 -0
  420. package/dist/runtime/server/utils/billing.js +68 -0
  421. package/dist/runtime/server/utils/chat-context.d.ts +9 -0
  422. package/dist/runtime/server/utils/chat-context.js +24 -0
  423. package/dist/runtime/server/utils/chat-message-builder.d.ts +4 -0
  424. package/dist/runtime/server/utils/chat-message-builder.js +39 -0
  425. package/dist/runtime/server/utils/chat-prompts.d.ts +7 -0
  426. package/dist/runtime/server/utils/chat-prompts.js +9 -0
  427. package/dist/runtime/server/utils/chat-workspace-settings.d.ts +16 -0
  428. package/dist/runtime/server/utils/chat-workspace-settings.js +115 -0
  429. package/dist/runtime/server/utils/external-skills.d.ts +2 -0
  430. package/dist/runtime/server/utils/external-skills.js +15 -0
  431. package/dist/runtime/server/utils/logger.d.ts +2 -0
  432. package/dist/runtime/server/utils/logger.js +12 -0
  433. package/dist/runtime/server/utils/slack.d.ts +32 -0
  434. package/dist/runtime/server/utils/slack.js +102 -0
  435. package/dist/runtime/server/utils/tela-api.d.ts +2 -0
  436. package/dist/runtime/server/utils/tela-api.js +29 -0
  437. package/dist/runtime/server/utils/vault.d.ts +3 -0
  438. package/dist/runtime/server/utils/vault.js +52 -0
  439. package/dist/runtime/server/utils/workspace-settings-resolver.stub.d.ts +2 -0
  440. package/dist/runtime/server/utils/workspace-settings-resolver.stub.js +1 -0
  441. package/dist/runtime/server/utils/workspace.d.ts +4 -0
  442. package/dist/runtime/server/utils/workspace.js +21 -0
  443. package/dist/runtime/types/agent.d.ts +168 -0
  444. package/dist/runtime/types/agent.js +95 -0
  445. package/dist/runtime/types/chat-workspace-settings-resolver.d.ts +4 -0
  446. package/dist/runtime/types/chat.d.ts +81 -0
  447. package/dist/runtime/types/chat.js +12 -0
  448. package/dist/runtime/types/credential.d.ts +8 -0
  449. package/dist/runtime/types/credential.js +0 -0
  450. package/dist/runtime/types/csv.d.ts +4 -0
  451. package/dist/runtime/types/csv.js +0 -0
  452. package/dist/runtime/types/external-skills.d.ts +8 -0
  453. package/dist/runtime/types/external-skills.js +0 -0
  454. package/dist/runtime/types/feature-flags.d.ts +7 -0
  455. package/dist/runtime/types/feature-flags.js +6 -0
  456. package/dist/runtime/types/reasoning.d.ts +17 -0
  457. package/dist/runtime/types/reasoning.js +0 -0
  458. package/dist/runtime/types/tela.d.ts +46 -0
  459. package/dist/runtime/types/tela.js +0 -0
  460. package/dist/runtime/types/workspace.d.ts +20 -0
  461. package/dist/runtime/types/workspace.js +0 -0
  462. package/dist/runtime/utils/calculate-usage.d.ts +48 -0
  463. package/dist/runtime/utils/calculate-usage.js +63 -0
  464. package/dist/runtime/utils/code-detection.d.ts +1 -0
  465. package/dist/runtime/utils/code-detection.js +24 -0
  466. package/dist/runtime/utils/export-conversation.d.ts +2 -0
  467. package/dist/runtime/utils/export-conversation.js +43 -0
  468. package/dist/runtime/utils/file.d.ts +46 -0
  469. package/dist/runtime/utils/file.js +500 -0
  470. package/dist/runtime/utils/format-time.d.ts +22 -0
  471. package/dist/runtime/utils/format-time.js +96 -0
  472. package/dist/runtime/utils/markdown-nodes.d.ts +22 -0
  473. package/dist/runtime/utils/markdown-nodes.js +40 -0
  474. package/dist/runtime/utils/string.d.ts +4 -0
  475. package/dist/runtime/utils/string.js +5 -0
  476. package/dist/runtime/utils/tela-chat.d.ts +19 -0
  477. package/dist/runtime/utils/tela-chat.js +20 -0
  478. package/dist/types.d.mts +7 -0
  479. package/package.json +72 -0
@@ -0,0 +1,221 @@
1
+ export type MessageFile = {
2
+ url: string;
3
+ vaultReference?: string;
4
+ name: string;
5
+ mimeType?: string;
6
+ source: 'user' | 'assistant';
7
+ size?: number;
8
+ };
9
+ export declare const messages: import("drizzle-orm/pg-core").PgTableWithColumns<{
10
+ name: "messages";
11
+ schema: undefined;
12
+ columns: {
13
+ id: import("drizzle-orm/pg-core").PgColumn<{
14
+ name: "id";
15
+ tableName: "messages";
16
+ dataType: "string";
17
+ columnType: "PgUUID";
18
+ data: string;
19
+ driverParam: string;
20
+ notNull: true;
21
+ hasDefault: true;
22
+ isPrimaryKey: true;
23
+ isAutoincrement: false;
24
+ hasRuntimeDefault: false;
25
+ enumValues: undefined;
26
+ baseColumn: never;
27
+ identity: undefined;
28
+ generated: undefined;
29
+ }, {}, {}>;
30
+ conversationId: import("drizzle-orm/pg-core").PgColumn<{
31
+ name: "conversation_id";
32
+ tableName: "messages";
33
+ dataType: "string";
34
+ columnType: "PgUUID";
35
+ data: string;
36
+ driverParam: string;
37
+ notNull: true;
38
+ hasDefault: false;
39
+ isPrimaryKey: false;
40
+ isAutoincrement: false;
41
+ hasRuntimeDefault: false;
42
+ enumValues: undefined;
43
+ baseColumn: never;
44
+ identity: undefined;
45
+ generated: undefined;
46
+ }, {}, {}>;
47
+ role: import("drizzle-orm/pg-core").PgColumn<{
48
+ name: "role";
49
+ tableName: "messages";
50
+ dataType: "string";
51
+ columnType: "PgText";
52
+ data: "user" | "assistant";
53
+ driverParam: string;
54
+ notNull: true;
55
+ hasDefault: false;
56
+ isPrimaryKey: false;
57
+ isAutoincrement: false;
58
+ hasRuntimeDefault: false;
59
+ enumValues: ["user", "assistant"];
60
+ baseColumn: never;
61
+ identity: undefined;
62
+ generated: undefined;
63
+ }, {}, {}>;
64
+ content: import("drizzle-orm/pg-core").PgColumn<{
65
+ name: "content";
66
+ tableName: "messages";
67
+ dataType: "string";
68
+ columnType: "PgText";
69
+ data: string;
70
+ driverParam: string;
71
+ notNull: true;
72
+ hasDefault: false;
73
+ isPrimaryKey: false;
74
+ isAutoincrement: false;
75
+ hasRuntimeDefault: false;
76
+ enumValues: [string, ...string[]];
77
+ baseColumn: never;
78
+ identity: undefined;
79
+ generated: undefined;
80
+ }, {}, {}>;
81
+ status: import("drizzle-orm/pg-core").PgColumn<{
82
+ name: "status";
83
+ tableName: "messages";
84
+ dataType: "string";
85
+ columnType: "PgText";
86
+ data: "pending" | "completed" | "failed";
87
+ driverParam: string;
88
+ notNull: false;
89
+ hasDefault: true;
90
+ isPrimaryKey: false;
91
+ isAutoincrement: false;
92
+ hasRuntimeDefault: false;
93
+ enumValues: ["pending", "completed", "failed"];
94
+ baseColumn: never;
95
+ identity: undefined;
96
+ generated: undefined;
97
+ }, {}, {}>;
98
+ reasoningData: import("drizzle-orm/pg-core").PgColumn<{
99
+ name: "reasoning_data";
100
+ tableName: "messages";
101
+ dataType: "json";
102
+ columnType: "PgJsonb";
103
+ data: unknown;
104
+ driverParam: unknown;
105
+ notNull: false;
106
+ hasDefault: false;
107
+ isPrimaryKey: false;
108
+ isAutoincrement: false;
109
+ hasRuntimeDefault: false;
110
+ enumValues: undefined;
111
+ baseColumn: never;
112
+ identity: undefined;
113
+ generated: undefined;
114
+ }, {}, {}>;
115
+ files: import("drizzle-orm/pg-core").PgColumn<{
116
+ name: "files";
117
+ tableName: "messages";
118
+ dataType: "json";
119
+ columnType: "PgJsonb";
120
+ data: MessageFile[];
121
+ driverParam: unknown;
122
+ notNull: false;
123
+ hasDefault: false;
124
+ isPrimaryKey: false;
125
+ isAutoincrement: false;
126
+ hasRuntimeDefault: false;
127
+ enumValues: undefined;
128
+ baseColumn: never;
129
+ identity: undefined;
130
+ generated: undefined;
131
+ }, {}, {
132
+ $type: MessageFile[];
133
+ }>;
134
+ externalUuid: import("drizzle-orm/pg-core").PgColumn<{
135
+ name: "external_uuid";
136
+ tableName: "messages";
137
+ dataType: "string";
138
+ columnType: "PgText";
139
+ data: string;
140
+ driverParam: string;
141
+ notNull: false;
142
+ hasDefault: false;
143
+ isPrimaryKey: false;
144
+ isAutoincrement: false;
145
+ hasRuntimeDefault: false;
146
+ enumValues: [string, ...string[]];
147
+ baseColumn: never;
148
+ identity: undefined;
149
+ generated: undefined;
150
+ }, {}, {}>;
151
+ ttft: import("drizzle-orm/pg-core").PgColumn<{
152
+ name: "ttft";
153
+ tableName: "messages";
154
+ dataType: "string";
155
+ columnType: "PgText";
156
+ data: string;
157
+ driverParam: string;
158
+ notNull: false;
159
+ hasDefault: false;
160
+ isPrimaryKey: false;
161
+ isAutoincrement: false;
162
+ hasRuntimeDefault: false;
163
+ enumValues: [string, ...string[]];
164
+ baseColumn: never;
165
+ identity: undefined;
166
+ generated: undefined;
167
+ }, {}, {}>;
168
+ createdBy: import("drizzle-orm/pg-core").PgColumn<{
169
+ name: "created_by";
170
+ tableName: "messages";
171
+ dataType: "string";
172
+ columnType: "PgText";
173
+ data: string;
174
+ driverParam: string;
175
+ notNull: false;
176
+ hasDefault: false;
177
+ isPrimaryKey: false;
178
+ isAutoincrement: false;
179
+ hasRuntimeDefault: false;
180
+ enumValues: [string, ...string[]];
181
+ baseColumn: never;
182
+ identity: undefined;
183
+ generated: undefined;
184
+ }, {}, {}>;
185
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
186
+ name: "created_at";
187
+ tableName: "messages";
188
+ dataType: "date";
189
+ columnType: "PgTimestamp";
190
+ data: Date;
191
+ driverParam: string;
192
+ notNull: true;
193
+ hasDefault: true;
194
+ isPrimaryKey: false;
195
+ isAutoincrement: false;
196
+ hasRuntimeDefault: false;
197
+ enumValues: undefined;
198
+ baseColumn: never;
199
+ identity: undefined;
200
+ generated: undefined;
201
+ }, {}, {}>;
202
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
203
+ name: "updated_at";
204
+ tableName: "messages";
205
+ dataType: "date";
206
+ columnType: "PgTimestamp";
207
+ data: Date;
208
+ driverParam: string;
209
+ notNull: false;
210
+ hasDefault: false;
211
+ isPrimaryKey: false;
212
+ isAutoincrement: false;
213
+ hasRuntimeDefault: false;
214
+ enumValues: undefined;
215
+ baseColumn: never;
216
+ identity: undefined;
217
+ generated: undefined;
218
+ }, {}, {}>;
219
+ };
220
+ dialect: "pg";
221
+ }>;
@@ -0,0 +1,19 @@
1
+ import { pgTable, uuid, text, timestamp, index, jsonb } from "drizzle-orm/pg-core";
2
+ import { conversations } from "./conversations.js";
3
+ export const messages = pgTable("messages", {
4
+ id: uuid("id").primaryKey().defaultRandom(),
5
+ conversationId: uuid("conversation_id").notNull().references(() => conversations.id, { onDelete: "cascade" }),
6
+ role: text("role", { enum: ["user", "assistant"] }).notNull(),
7
+ content: text("content").notNull(),
8
+ status: text("status", { enum: ["pending", "completed", "failed"] }).default("completed"),
9
+ reasoningData: jsonb("reasoning_data"),
10
+ files: jsonb("files").$type(),
11
+ externalUuid: text("external_uuid"),
12
+ ttft: text("ttft"),
13
+ createdBy: text("created_by"),
14
+ createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
15
+ updatedAt: timestamp("updated_at", { withTimezone: true })
16
+ }, (table) => [
17
+ index("idx_messages_conversation").on(table.conversationId),
18
+ index("idx_messages_created").on(table.createdAt)
19
+ ]);
@@ -0,0 +1,164 @@
1
+ import type { CanvasTool } from '#chat-runtime/types/agent';
2
+ import type { KnowledgeSource } from '#chat-runtime/types/chat';
3
+ export type ContextFile = {
4
+ url: string;
5
+ vaultReference?: string;
6
+ name: string;
7
+ mimeType?: string;
8
+ };
9
+ export type ExternalSkill = {
10
+ ref: string;
11
+ name: string;
12
+ description: string;
13
+ runtime: string;
14
+ allowedTools: string[];
15
+ isPublic: boolean;
16
+ addedBy: {
17
+ userId: string;
18
+ username: string;
19
+ };
20
+ addedAt: string;
21
+ };
22
+ export type ResolvedWorkspaceSettings = {
23
+ systemMessage: string | null;
24
+ contextFiles: ContextFile[] | null;
25
+ canvasTools: CanvasTool[] | null;
26
+ knowledgeSources: KnowledgeSource[] | null;
27
+ externalSkills: ExternalSkill[] | null;
28
+ updatedAt: Date | string;
29
+ };
30
+ export declare const workspaceSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{
31
+ name: "workspace_settings";
32
+ schema: undefined;
33
+ columns: {
34
+ workspaceId: import("drizzle-orm/pg-core").PgColumn<{
35
+ name: "workspace_id";
36
+ tableName: "workspace_settings";
37
+ dataType: "string";
38
+ columnType: "PgText";
39
+ data: string;
40
+ driverParam: string;
41
+ notNull: true;
42
+ hasDefault: false;
43
+ isPrimaryKey: true;
44
+ isAutoincrement: false;
45
+ hasRuntimeDefault: false;
46
+ enumValues: [string, ...string[]];
47
+ baseColumn: never;
48
+ identity: undefined;
49
+ generated: undefined;
50
+ }, {}, {}>;
51
+ systemMessage: import("drizzle-orm/pg-core").PgColumn<{
52
+ name: "system_message";
53
+ tableName: "workspace_settings";
54
+ dataType: "string";
55
+ columnType: "PgText";
56
+ data: string;
57
+ driverParam: string;
58
+ notNull: false;
59
+ hasDefault: false;
60
+ isPrimaryKey: false;
61
+ isAutoincrement: false;
62
+ hasRuntimeDefault: false;
63
+ enumValues: [string, ...string[]];
64
+ baseColumn: never;
65
+ identity: undefined;
66
+ generated: undefined;
67
+ }, {}, {}>;
68
+ contextFiles: import("drizzle-orm/pg-core").PgColumn<{
69
+ name: "context_files";
70
+ tableName: "workspace_settings";
71
+ dataType: "json";
72
+ columnType: "PgJsonb";
73
+ data: ContextFile[];
74
+ driverParam: unknown;
75
+ notNull: false;
76
+ hasDefault: false;
77
+ isPrimaryKey: false;
78
+ isAutoincrement: false;
79
+ hasRuntimeDefault: false;
80
+ enumValues: undefined;
81
+ baseColumn: never;
82
+ identity: undefined;
83
+ generated: undefined;
84
+ }, {}, {
85
+ $type: ContextFile[];
86
+ }>;
87
+ canvasTools: import("drizzle-orm/pg-core").PgColumn<{
88
+ name: "canvas_tools";
89
+ tableName: "workspace_settings";
90
+ dataType: "json";
91
+ columnType: "PgJsonb";
92
+ data: CanvasTool[];
93
+ driverParam: unknown;
94
+ notNull: false;
95
+ hasDefault: false;
96
+ isPrimaryKey: false;
97
+ isAutoincrement: false;
98
+ hasRuntimeDefault: false;
99
+ enumValues: undefined;
100
+ baseColumn: never;
101
+ identity: undefined;
102
+ generated: undefined;
103
+ }, {}, {
104
+ $type: CanvasTool[];
105
+ }>;
106
+ knowledgeSources: import("drizzle-orm/pg-core").PgColumn<{
107
+ name: "knowledge_sources";
108
+ tableName: "workspace_settings";
109
+ dataType: "json";
110
+ columnType: "PgJsonb";
111
+ data: KnowledgeSource[];
112
+ driverParam: unknown;
113
+ notNull: false;
114
+ hasDefault: false;
115
+ isPrimaryKey: false;
116
+ isAutoincrement: false;
117
+ hasRuntimeDefault: false;
118
+ enumValues: undefined;
119
+ baseColumn: never;
120
+ identity: undefined;
121
+ generated: undefined;
122
+ }, {}, {
123
+ $type: KnowledgeSource[];
124
+ }>;
125
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
126
+ name: "created_at";
127
+ tableName: "workspace_settings";
128
+ dataType: "date";
129
+ columnType: "PgTimestamp";
130
+ data: Date;
131
+ driverParam: string;
132
+ notNull: true;
133
+ hasDefault: true;
134
+ isPrimaryKey: false;
135
+ isAutoincrement: false;
136
+ hasRuntimeDefault: false;
137
+ enumValues: undefined;
138
+ baseColumn: never;
139
+ identity: undefined;
140
+ generated: undefined;
141
+ }, {}, {}>;
142
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
143
+ name: "updated_at";
144
+ tableName: "workspace_settings";
145
+ dataType: "date";
146
+ columnType: "PgTimestamp";
147
+ data: Date;
148
+ driverParam: string;
149
+ notNull: true;
150
+ hasDefault: true;
151
+ isPrimaryKey: false;
152
+ isAutoincrement: false;
153
+ hasRuntimeDefault: false;
154
+ enumValues: undefined;
155
+ baseColumn: never;
156
+ identity: undefined;
157
+ generated: undefined;
158
+ }, {}, {}>;
159
+ };
160
+ dialect: "pg";
161
+ }>;
162
+ export declare const workspaceSettingsRelations: import("drizzle-orm").Relations<"workspace_settings", {
163
+ externalSkills: import("drizzle-orm").Many<"external_skills">;
164
+ }>;
@@ -0,0 +1,15 @@
1
+ import { pgTable, text, timestamp, jsonb } from "drizzle-orm/pg-core";
2
+ import { relations } from "drizzle-orm";
3
+ import { externalSkills } from "./external-skills.js";
4
+ export const workspaceSettings = pgTable("workspace_settings", {
5
+ workspaceId: text("workspace_id").primaryKey(),
6
+ systemMessage: text("system_message"),
7
+ contextFiles: jsonb("context_files").$type(),
8
+ canvasTools: jsonb("canvas_tools").$type(),
9
+ knowledgeSources: jsonb("knowledge_sources").$type(),
10
+ createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
11
+ updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull()
12
+ });
13
+ export const workspaceSettingsRelations = relations(workspaceSettings, ({ many }) => ({
14
+ externalSkills: many(externalSkills)
15
+ }));
@@ -0,0 +1 @@
1
+ export * from './schema/index.js';
@@ -0,0 +1 @@
1
+ export * from "./schema/index.js";
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { logger } from "#chat-runtime/server/utils/logger";
2
+ export default defineEventHandler(async (event) => {
3
+ const config = useRuntimeConfig(event);
4
+ const auth = event.context.auth;
5
+ if (!auth?.user)
6
+ return;
7
+ const allowedDomainsStr = config.auth?.allowedEmailDomains;
8
+ if (!allowedDomainsStr)
9
+ return;
10
+ const allowedDomains = allowedDomainsStr.split(",").map((domain) => domain.trim().toLowerCase().replace(/^@/, "")).filter(Boolean);
11
+ if (allowedDomains.length === 0)
12
+ return;
13
+ const email = auth.user.email;
14
+ const emailDomain = email?.split("@")[1]?.toLowerCase();
15
+ if (!emailDomain || !allowedDomains.includes(emailDomain)) {
16
+ logger.warn({ emailDomain, allowedDomains }, "Domain validation failed");
17
+ throw createError({
18
+ statusCode: 403,
19
+ statusMessage: "Access Denied: Email domain not allowed"
20
+ });
21
+ }
22
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { logger } from "#chat-runtime/server/utils/logger";
2
+ export default defineEventHandler((event) => {
3
+ const path = getRequestURL(event).pathname;
4
+ if (!path.startsWith("/api/"))
5
+ return;
6
+ const start = performance.now();
7
+ const method = getMethod(event);
8
+ event.node.res.on("close", () => {
9
+ const duration = Math.round(performance.now() - start);
10
+ logger.info(
11
+ { method, path, statusCode: event.node.res.statusCode, durationMs: duration },
12
+ "HTTP request"
13
+ );
14
+ });
15
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: "# Instru\u00E7\u00F5es do Assistente\n\nVoc\u00EA \u00E9 um assistente especializado em an\u00E1lise de documentos e dados. Seu objetivo \u00E9 ajudar o usu\u00E1rio de forma clara, precisa e objetiva.\n\n## Regras Absolutas (NEVER/ALWAYS)\n\nEstas regras n\u00E3o t\u00EAm exce\u00E7\u00F5es:\n\n- NEVER mencione detalhes t\u00E9cnicos internos (tasks, workstations, skills, queries, IDs de sistema)\n- NEVER exponha estruturas de dados internas ao usu\u00E1rio\n- ALWAYS fale em termos de \"documentos\", \"informa\u00E7\u00F5es\", \"dados extra\u00EDdos\"\n- ALWAYS referencie o documento original ao citar informa\u00E7\u00F5es\n- ALWAYS seja conciso e direto nas respostas\n\n## Refer\u00EAncias de Arquivos do Vault (STRICTLY ENFORCED)\n\nCRITICAL: Ao referenciar arquivos do Vault, voc\u00EA DEVE incluir metadados na URL usando fragmentos (#).\n\n<format_rules>\nFormato obrigat\u00F3rio: `https://{{VAULT_HOST}}/permalinks/<id>#param1=value1&param2=value2`\n\nPar\u00E2metros dispon\u00EDveis:\n- `filename=<nome>` - Nome do arquivo (SEMPRE inclua para clareza do usu\u00E1rio)\n- `page_number=<N>` - N\u00FAmero da p\u00E1gina ao citar informa\u00E7\u00F5es espec\u00EDficas\n</format_rules>\n\n<examples>\nCORRETO:\n- `[Contrato ABC](https://{{VAULT_HOST}}/permalinks/abc123#filename=contrato-abc.pdf&page_number=5)`\n- `[Relat\u00F3rio Financeiro](https://{{VAULT_HOST}}/permalinks/xyz789#filename=relatorio-2024.pdf)`\n- `[Ver p\u00E1gina 12](https://{{VAULT_HOST}}/permalinks/def456#filename=manual.pdf&page_number=12)`\n\nINCORRETO:\n- `[Ver documento](https://{{VAULT_HOST}}/permalinks/abc123)` (falta filename)\n- `[Link](https://{{VAULT_HOST}}/permalinks/abc123#page=5)` (par\u00E2metro errado, falta filename)\n- `abc123` (apenas ID, sem URL completa)\n</examples>\n\n## Prioridade de Fontes de Dados\n\nIMPORTANT: Siga esta ordem de prioridade ao buscar informa\u00E7\u00F5es:\n\n1. **Dados j\u00E1 extra\u00EDdos** (fontes de conhecimento) - Use primeiro quando dispon\u00EDveis\n2. **Arquivos originais** - Use apenas quando:\n - A informa\u00E7\u00E3o n\u00E3o est\u00E1 nos dados extra\u00EDdos\n - O usu\u00E1rio solicita explicitamente ver o documento original\n - Precisa de contexto visual (imagens, gr\u00E1ficos, layouts)\n\n## Comportamentos Padr\u00E3o (WHEN IN DOUBT)\n\n- WHEN IN DOUBT sobre formato: Seja conciso, use listas e formata\u00E7\u00E3o clara\n- WHEN IN DOUBT sobre fonte: Prefira dados extra\u00EDdos sobre arquivos brutos\n- WHEN IN DOUBT sobre refer\u00EAncia: Sempre inclua link com filename e page_number\n- WHEN IN DOUBT sobre linguagem: Responda no mesmo idioma do usu\u00E1rio\n\n## Men\u00E7\u00F5es de Arquivos e Skills\n\nQuando o usu\u00E1rio menciona arquivos com `@` ou skills com `/`, eles aparecem na mensagem como tags estruturadas. Estas tags t\u00EAm prioridade sobre instru\u00E7\u00F5es gen\u00E9ricas.\n\n### `<file_mention>`\n\n```xml\n<file_mention name=\"relatorio.pdf\" url=\"https://{{VAULT_HOST}}/permalinks/abc123\">...</file_mention>\n```\n\n- ALWAYS acesse o arquivo usando o atributo `url`\n- ALWAYS foque a sua resposta no conte\u00FAdo deste arquivo espec\u00EDfico\n- Se m\u00FAltiplos `<file_mention>` estiverem presentes, use todos os arquivos listados\n\n### `<canvas_mention>`\n\n```xml\n<canvas_mention name=\"meu_canvas\" canvas-id=\"uuid-do-canvas\" description=\"Descri\u00E7\u00E3o do canvas\">\nO usu\u00E1rio quer usar este canvas do Tela.\nVari\u00E1veis obrigat\u00F3rias (use EXATAMENTE estes nomes no JSON):\n- nome_variavel (text): Descri\u00E7\u00E3o da vari\u00E1vel\nInvoque via Bash: bun run .claude/skills/tela/run.ts \"uuid-do-canvas\" com as vari\u00E1veis em JSON.\n</canvas_mention>\n```\n\n- Este \u00E9 um Canvas do Tela. Para invoc\u00E1-lo, use a tool Bash com o comando:\n `bun run .claude/skills/tela/run.ts \"<canvas-id>\" '<variables-json>'`\n- O atributo `canvas-id` cont\u00E9m o ID do canvas \u2014 passe como primeiro argumento\n- O conte\u00FAdo da tag lista as **vari\u00E1veis obrigat\u00F3rias** com seus nomes e tipos exatos\n- CRITICAL: Use EXATAMENTE os nomes de vari\u00E1veis listados na tag. Nomes incorretos causam erro 400\n- Passe vari\u00E1veis como JSON no segundo argumento usando os nomes exatos (ex: `'{\"nome_variavel\": \"valor\"}'`)\n- Vari\u00E1veis do tipo `text` recebem texto. Vari\u00E1veis do tipo `file` recebem URL do arquivo\n- O atributo `description` descreve o que o canvas faz \u2014 use como contexto\n- Se o canvas precisar de vari\u00E1veis e o usu\u00E1rio n\u00E3o forneceu os valores, solicite-os antes de invocar\n\n### `<skill_mention>`\n\n```xml\n<skill_mention name=\"MinhaSkill\" ref=\"skill-ref-id\" description=\"Descri\u00E7\u00E3o da skill\">...</skill_mention>\n```\n\n- ALWAYS invoque a skill usando o atributo `ref`\n- O atributo `description` descreve o que a skill faz \u2014 use como contexto\n- Se o usu\u00E1rio n\u00E3o forneceu par\u00E2metros adicionais e a skill precisar deles, solicite-os antes de invocar\n";
2
+ export default _default;
@@ -0,0 +1,100 @@
1
+ export default `# Instru\xE7\xF5es do Assistente
2
+
3
+ Voc\xEA \xE9 um assistente especializado em an\xE1lise de documentos e dados. Seu objetivo \xE9 ajudar o usu\xE1rio de forma clara, precisa e objetiva.
4
+
5
+ ## Regras Absolutas (NEVER/ALWAYS)
6
+
7
+ Estas regras n\xE3o t\xEAm exce\xE7\xF5es:
8
+
9
+ - NEVER mencione detalhes t\xE9cnicos internos (tasks, workstations, skills, queries, IDs de sistema)
10
+ - NEVER exponha estruturas de dados internas ao usu\xE1rio
11
+ - ALWAYS fale em termos de "documentos", "informa\xE7\xF5es", "dados extra\xEDdos"
12
+ - ALWAYS referencie o documento original ao citar informa\xE7\xF5es
13
+ - ALWAYS seja conciso e direto nas respostas
14
+
15
+ ## Refer\xEAncias de Arquivos do Vault (STRICTLY ENFORCED)
16
+
17
+ CRITICAL: Ao referenciar arquivos do Vault, voc\xEA DEVE incluir metadados na URL usando fragmentos (#).
18
+
19
+ <format_rules>
20
+ Formato obrigat\xF3rio: \`https://{{VAULT_HOST}}/permalinks/<id>#param1=value1&param2=value2\`
21
+
22
+ Par\xE2metros dispon\xEDveis:
23
+ - \`filename=<nome>\` - Nome do arquivo (SEMPRE inclua para clareza do usu\xE1rio)
24
+ - \`page_number=<N>\` - N\xFAmero da p\xE1gina ao citar informa\xE7\xF5es espec\xEDficas
25
+ </format_rules>
26
+
27
+ <examples>
28
+ CORRETO:
29
+ - \`[Contrato ABC](https://{{VAULT_HOST}}/permalinks/abc123#filename=contrato-abc.pdf&page_number=5)\`
30
+ - \`[Relat\xF3rio Financeiro](https://{{VAULT_HOST}}/permalinks/xyz789#filename=relatorio-2024.pdf)\`
31
+ - \`[Ver p\xE1gina 12](https://{{VAULT_HOST}}/permalinks/def456#filename=manual.pdf&page_number=12)\`
32
+
33
+ INCORRETO:
34
+ - \`[Ver documento](https://{{VAULT_HOST}}/permalinks/abc123)\` (falta filename)
35
+ - \`[Link](https://{{VAULT_HOST}}/permalinks/abc123#page=5)\` (par\xE2metro errado, falta filename)
36
+ - \`abc123\` (apenas ID, sem URL completa)
37
+ </examples>
38
+
39
+ ## Prioridade de Fontes de Dados
40
+
41
+ IMPORTANT: Siga esta ordem de prioridade ao buscar informa\xE7\xF5es:
42
+
43
+ 1. **Dados j\xE1 extra\xEDdos** (fontes de conhecimento) - Use primeiro quando dispon\xEDveis
44
+ 2. **Arquivos originais** - Use apenas quando:
45
+ - A informa\xE7\xE3o n\xE3o est\xE1 nos dados extra\xEDdos
46
+ - O usu\xE1rio solicita explicitamente ver o documento original
47
+ - Precisa de contexto visual (imagens, gr\xE1ficos, layouts)
48
+
49
+ ## Comportamentos Padr\xE3o (WHEN IN DOUBT)
50
+
51
+ - WHEN IN DOUBT sobre formato: Seja conciso, use listas e formata\xE7\xE3o clara
52
+ - WHEN IN DOUBT sobre fonte: Prefira dados extra\xEDdos sobre arquivos brutos
53
+ - WHEN IN DOUBT sobre refer\xEAncia: Sempre inclua link com filename e page_number
54
+ - WHEN IN DOUBT sobre linguagem: Responda no mesmo idioma do usu\xE1rio
55
+
56
+ ## Men\xE7\xF5es de Arquivos e Skills
57
+
58
+ Quando o usu\xE1rio menciona arquivos com \`@\` ou skills com \`/\`, eles aparecem na mensagem como tags estruturadas. Estas tags t\xEAm prioridade sobre instru\xE7\xF5es gen\xE9ricas.
59
+
60
+ ### \`<file_mention>\`
61
+
62
+ \`\`\`xml
63
+ <file_mention name="relatorio.pdf" url="https://{{VAULT_HOST}}/permalinks/abc123">...</file_mention>
64
+ \`\`\`
65
+
66
+ - ALWAYS acesse o arquivo usando o atributo \`url\`
67
+ - ALWAYS foque a sua resposta no conte\xFAdo deste arquivo espec\xEDfico
68
+ - Se m\xFAltiplos \`<file_mention>\` estiverem presentes, use todos os arquivos listados
69
+
70
+ ### \`<canvas_mention>\`
71
+
72
+ \`\`\`xml
73
+ <canvas_mention name="meu_canvas" canvas-id="uuid-do-canvas" description="Descri\xE7\xE3o do canvas">
74
+ O usu\xE1rio quer usar este canvas do Tela.
75
+ Vari\xE1veis obrigat\xF3rias (use EXATAMENTE estes nomes no JSON):
76
+ - nome_variavel (text): Descri\xE7\xE3o da vari\xE1vel
77
+ Invoque via Bash: bun run .claude/skills/tela/run.ts "uuid-do-canvas" com as vari\xE1veis em JSON.
78
+ </canvas_mention>
79
+ \`\`\`
80
+
81
+ - Este \xE9 um Canvas do Tela. Para invoc\xE1-lo, use a tool Bash com o comando:
82
+ \`bun run .claude/skills/tela/run.ts "<canvas-id>" '<variables-json>'\`
83
+ - O atributo \`canvas-id\` cont\xE9m o ID do canvas \u2014 passe como primeiro argumento
84
+ - O conte\xFAdo da tag lista as **vari\xE1veis obrigat\xF3rias** com seus nomes e tipos exatos
85
+ - CRITICAL: Use EXATAMENTE os nomes de vari\xE1veis listados na tag. Nomes incorretos causam erro 400
86
+ - Passe vari\xE1veis como JSON no segundo argumento usando os nomes exatos (ex: \`'{"nome_variavel": "valor"}'\`)
87
+ - Vari\xE1veis do tipo \`text\` recebem texto. Vari\xE1veis do tipo \`file\` recebem URL do arquivo
88
+ - O atributo \`description\` descreve o que o canvas faz \u2014 use como contexto
89
+ - Se o canvas precisar de vari\xE1veis e o usu\xE1rio n\xE3o forneceu os valores, solicite-os antes de invocar
90
+
91
+ ### \`<skill_mention>\`
92
+
93
+ \`\`\`xml
94
+ <skill_mention name="MinhaSkill" ref="skill-ref-id" description="Descri\xE7\xE3o da skill">...</skill_mention>
95
+ \`\`\`
96
+
97
+ - ALWAYS invoque a skill usando o atributo \`ref\`
98
+ - O atributo \`description\` descreve o que a skill faz \u2014 use como contexto
99
+ - Se o usu\xE1rio n\xE3o forneceu par\xE2metros adicionais e a skill precisar deles, solicite-os antes de invocar
100
+ `;