@meistrari/chat-nuxt 2.0.0 → 3.1.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 (239) hide show
  1. package/README.md +7 -9
  2. package/dist/module.d.mts +3 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +0 -39
  5. package/dist/runtime/conversations/components/chat-conversation-creator-filter.d.vue.ts +1 -1
  6. package/dist/runtime/conversations/components/chat-conversation-creator-filter.vue.d.ts +1 -1
  7. package/dist/runtime/conversations/components/chat-conversation-item.d.vue.ts +3 -3
  8. package/dist/runtime/conversations/components/chat-conversation-item.vue.d.ts +3 -3
  9. package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +1 -1
  10. package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +1 -1
  11. package/dist/runtime/conversations/components/chat-conversation-new-group-button.d.vue.ts +1 -1
  12. package/dist/runtime/conversations/components/chat-conversation-new-group-button.vue.d.ts +1 -1
  13. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.d.vue.ts +4 -4
  14. package/dist/runtime/conversations/components/chat-conversation-new-group-popover-content.vue.d.ts +4 -4
  15. package/dist/runtime/conversations/components/chat-conversation-search.d.vue.ts +3 -3
  16. package/dist/runtime/conversations/components/chat-conversation-search.vue.d.ts +3 -3
  17. package/dist/runtime/conversations/components/chat-new-conversation-modal.d.vue.ts +23 -5
  18. package/dist/runtime/conversations/components/chat-new-conversation-modal.vue.d.ts +23 -5
  19. package/dist/runtime/conversations/composables/conversation-list.d.ts +58 -1
  20. package/dist/runtime/conversations/composables/conversations.d.ts +1 -4
  21. package/dist/runtime/conversations/composables/conversations.js +3 -6
  22. package/dist/runtime/embed/components/chat-configuration-modal.d.vue.ts +3 -3
  23. package/dist/runtime/embed/components/chat-configuration-modal.vue +59 -176
  24. package/dist/runtime/embed/components/chat-configuration-modal.vue.d.ts +3 -3
  25. package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +3 -3
  26. package/dist/runtime/embed/components/chat-embed-inner.vue +4 -35
  27. package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +3 -3
  28. package/dist/runtime/embed/components/chat-embed.d.vue.ts +6 -3
  29. package/dist/runtime/embed/components/chat-embed.vue +10 -2
  30. package/dist/runtime/embed/components/chat-embed.vue.d.ts +6 -3
  31. package/dist/runtime/embed/components/chat-topbar.d.vue.ts +5 -5
  32. package/dist/runtime/embed/components/chat-topbar.vue.d.ts +5 -5
  33. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.d.vue.ts +13 -0
  34. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue +167 -0
  35. package/dist/runtime/embed/components/configuration/chat-configuration-agent-tab.vue.d.ts +13 -0
  36. package/dist/runtime/embed/components/configuration/chat-configuration-credentials-tab.d.vue.ts +3 -3
  37. package/dist/runtime/embed/components/configuration/chat-configuration-credentials-tab.vue.d.ts +3 -3
  38. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.d.vue.ts +3 -3
  39. package/dist/runtime/embed/components/configuration/chat-configuration-knowledge-sources-tab.vue.d.ts +3 -3
  40. package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.d.vue.ts +3 -3
  41. package/dist/runtime/embed/components/configuration/chat-configuration-mobile-shell.vue.d.ts +3 -3
  42. package/dist/runtime/embed/components/meistrari-chat-embed.vue +9 -1
  43. package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.d.vue.ts +3 -3
  44. package/dist/runtime/embed/components/mobile/chat-mobile-bottom-sheet.vue.d.ts +3 -3
  45. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.d.vue.ts +3 -3
  46. package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue.d.ts +3 -3
  47. package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.d.vue.ts +3 -3
  48. package/dist/runtime/embed/components/mobile/chat-mobile-file-preview.vue.d.ts +3 -3
  49. package/dist/runtime/embed/components/mobile/chat-mobile-files-view.d.vue.ts +3 -3
  50. package/dist/runtime/embed/components/mobile/chat-mobile-files-view.vue.d.ts +3 -3
  51. package/dist/runtime/embed/components/mobile/chat-mobile-header.d.vue.ts +5 -5
  52. package/dist/runtime/embed/components/mobile/chat-mobile-header.vue.d.ts +5 -5
  53. package/dist/runtime/embed/components/mobile/chat-mobile-home-header.d.vue.ts +3 -3
  54. package/dist/runtime/embed/components/mobile/chat-mobile-home-header.vue.d.ts +3 -3
  55. package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.d.vue.ts +3 -3
  56. package/dist/runtime/embed/components/mobile/chat-mobile-home-recents.vue.d.ts +3 -3
  57. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.d.vue.ts +3 -3
  58. package/dist/runtime/embed/components/mobile/chat-mobile-home-suggestions.vue.d.ts +3 -3
  59. package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.d.vue.ts +1 -1
  60. package/dist/runtime/embed/components/mobile/chat-mobile-info-bubble.vue.d.ts +1 -1
  61. package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.d.vue.ts +3 -3
  62. package/dist/runtime/embed/components/mobile/chat-mobile-outdated-settings-sheet.vue.d.ts +3 -3
  63. package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +41 -15
  64. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -12
  65. package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +41 -15
  66. package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.d.vue.ts +1 -1
  67. package/dist/runtime/embed/components/mobile/chat-mobile-usage-view.vue.d.ts +1 -1
  68. package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.d.vue.ts +3 -3
  69. package/dist/runtime/embed/components/mobile/chat-mobile-workspace-sheet.vue.d.ts +3 -3
  70. package/dist/runtime/embed/components/powered-by-tela.d.vue.ts +1 -1
  71. package/dist/runtime/embed/components/powered-by-tela.vue.d.ts +1 -1
  72. package/dist/runtime/embed/composables/embed-config.d.ts +6 -0
  73. package/dist/runtime/embed/composables/embed-config.js +11 -3
  74. package/dist/runtime/embed/feature-config.d.ts +0 -2
  75. package/dist/runtime/embed/feature-config.js +0 -1
  76. package/dist/runtime/embed/types.d.ts +14 -0
  77. package/dist/runtime/files/components/audio-preview.d.vue.ts +3 -3
  78. package/dist/runtime/files/components/audio-preview.vue.d.ts +3 -3
  79. package/dist/runtime/files/components/chat-file-preview.d.vue.ts +1 -1
  80. package/dist/runtime/files/components/chat-file-preview.vue.d.ts +1 -1
  81. package/dist/runtime/files/components/chat-files-view.d.vue.ts +1 -1
  82. package/dist/runtime/files/components/chat-files-view.vue.d.ts +1 -1
  83. package/dist/runtime/files/components/chat-vault-link.d.vue.ts +1 -1
  84. package/dist/runtime/files/components/chat-vault-link.vue.d.ts +1 -1
  85. package/dist/runtime/files/components/conversation-files-panel.d.vue.ts +1 -1
  86. package/dist/runtime/files/components/conversation-files-panel.vue.d.ts +1 -1
  87. package/dist/runtime/files/components/csv-preview.d.vue.ts +3 -3
  88. package/dist/runtime/files/components/csv-preview.vue.d.ts +3 -3
  89. package/dist/runtime/files/components/file-preview-panel.d.vue.ts +1 -1
  90. package/dist/runtime/files/components/file-preview-panel.vue.d.ts +1 -1
  91. package/dist/runtime/files/components/file-uploader.d.vue.ts +3 -3
  92. package/dist/runtime/files/components/file-uploader.vue.d.ts +3 -3
  93. package/dist/runtime/files/components/image-preview.d.vue.ts +3 -3
  94. package/dist/runtime/files/components/image-preview.vue.d.ts +3 -3
  95. package/dist/runtime/files/components/pdf-preview.client.d.vue.ts +3 -3
  96. package/dist/runtime/files/components/pdf-preview.client.vue.d.ts +3 -3
  97. package/dist/runtime/files/components/pdf-viewer.client.d.vue.ts +1 -1
  98. package/dist/runtime/files/components/pdf-viewer.client.vue.d.ts +1 -1
  99. package/dist/runtime/files/components/text-preview.d.vue.ts +3 -3
  100. package/dist/runtime/files/components/text-preview.vue.d.ts +3 -3
  101. package/dist/runtime/files/components/video-preview.d.vue.ts +3 -3
  102. package/dist/runtime/files/components/video-preview.vue.d.ts +3 -3
  103. package/dist/runtime/files/composables/pdf.d.ts +248 -27
  104. package/dist/runtime/files/file-limits.d.ts +2 -0
  105. package/dist/runtime/files/file-limits.js +2 -0
  106. package/dist/runtime/messages/components/chat-canvas-selector-modal.d.vue.ts +23 -5
  107. package/dist/runtime/messages/components/chat-canvas-selector-modal.vue.d.ts +23 -5
  108. package/dist/runtime/messages/components/chat-context-config.d.vue.ts +52 -10
  109. package/dist/runtime/messages/components/chat-context-config.vue +2 -2
  110. package/dist/runtime/messages/components/chat-context-config.vue.d.ts +52 -10
  111. package/dist/runtime/messages/components/chat-mention-dropdown.d.vue.ts +27 -5
  112. package/dist/runtime/messages/components/chat-mention-dropdown.vue.d.ts +27 -5
  113. package/dist/runtime/messages/components/chat-message-bubble.d.vue.ts +3 -3
  114. package/dist/runtime/messages/components/chat-message-bubble.vue +8 -4
  115. package/dist/runtime/messages/components/chat-message-bubble.vue.d.ts +3 -3
  116. package/dist/runtime/messages/components/chat-message-feedback.d.vue.ts +7 -0
  117. package/dist/runtime/messages/components/chat-message-feedback.vue +251 -0
  118. package/dist/runtime/messages/components/chat-message-feedback.vue.d.ts +7 -0
  119. package/dist/runtime/messages/components/chat-message-input.d.vue.ts +38 -16
  120. package/dist/runtime/messages/components/chat-message-input.vue +1 -8
  121. package/dist/runtime/messages/components/chat-message-input.vue.d.ts +38 -16
  122. package/dist/runtime/messages/components/chat-message-list.d.vue.ts +3 -3
  123. package/dist/runtime/messages/components/chat-message-list.vue.d.ts +3 -3
  124. package/dist/runtime/messages/components/chat-workstation-selector-modal.d.vue.ts +19 -5
  125. package/dist/runtime/messages/components/chat-workstation-selector-modal.vue.d.ts +19 -5
  126. package/dist/runtime/messages/components/reasoning/chat-reasoning-message.d.vue.ts +1 -1
  127. package/dist/runtime/messages/components/reasoning/chat-reasoning-message.vue.d.ts +1 -1
  128. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.d.vue.ts +4 -4
  129. package/dist/runtime/messages/components/reasoning/chat-reasoning-step-item.vue.d.ts +4 -4
  130. package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.d.vue.ts +2 -2
  131. package/dist/runtime/messages/components/reasoning/chat-reasoning-steps.vue.d.ts +2 -2
  132. package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.d.vue.ts +1 -1
  133. package/dist/runtime/messages/components/reasoning/chat-reasoning-thought.vue.d.ts +1 -1
  134. package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.d.vue.ts +1 -1
  135. package/dist/runtime/messages/components/reasoning/chat-thinking-indicator.vue.d.ts +1 -1
  136. package/dist/runtime/messages/components/widgets/chat-bash-widget.d.vue.ts +1 -1
  137. package/dist/runtime/messages/components/widgets/chat-bash-widget.vue.d.ts +1 -1
  138. package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.d.vue.ts +1 -1
  139. package/dist/runtime/messages/components/widgets/chat-doc-sdk-widget.vue.d.ts +1 -1
  140. package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.d.vue.ts +1 -1
  141. package/dist/runtime/messages/components/widgets/chat-generic-tool-widget.vue.d.ts +1 -1
  142. package/dist/runtime/messages/components/widgets/chat-grep-widget.d.vue.ts +1 -1
  143. package/dist/runtime/messages/components/widgets/chat-grep-widget.vue.d.ts +1 -1
  144. package/dist/runtime/messages/components/widgets/chat-read-widget.d.vue.ts +1 -1
  145. package/dist/runtime/messages/components/widgets/chat-read-widget.vue.d.ts +1 -1
  146. package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.d.vue.ts +1 -1
  147. package/dist/runtime/messages/components/widgets/chat-tela-skill-widget.vue.d.ts +1 -1
  148. package/dist/runtime/messages/components/widgets/chat-thinking-widget.d.vue.ts +1 -1
  149. package/dist/runtime/messages/components/widgets/chat-thinking-widget.vue.d.ts +1 -1
  150. package/dist/runtime/messages/components/widgets/chat-web-search-widget.d.vue.ts +1 -1
  151. package/dist/runtime/messages/components/widgets/chat-web-search-widget.vue.d.ts +1 -1
  152. package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.d.vue.ts +1 -1
  153. package/dist/runtime/messages/components/widgets/chat-workstation-query-widget.vue.d.ts +1 -1
  154. package/dist/runtime/messages/components/widgets/chat-write-widget.d.vue.ts +1 -1
  155. package/dist/runtime/messages/components/widgets/chat-write-widget.vue.d.ts +1 -1
  156. package/dist/runtime/messages/composables/chat-feedback.d.ts +21 -0
  157. package/dist/runtime/messages/composables/chat-feedback.js +12 -0
  158. package/dist/runtime/messages/composables/chat.d.ts +1 -1
  159. package/dist/runtime/messages/composables/chat.js +37 -14
  160. package/dist/runtime/messages/message-state.d.ts +3 -0
  161. package/dist/runtime/messages/message-state.js +13 -0
  162. package/dist/runtime/rendering/components/app-markdown-render.d.vue.ts +2 -2
  163. package/dist/runtime/rendering/components/app-markdown-render.vue.d.ts +2 -2
  164. package/dist/runtime/rendering/components/renderers/artifact-display.d.vue.ts +3 -3
  165. package/dist/runtime/rendering/components/renderers/artifact-display.vue.d.ts +3 -3
  166. package/dist/runtime/rendering/components/renderers/audio-renderer.d.vue.ts +1 -1
  167. package/dist/runtime/rendering/components/renderers/audio-renderer.vue.d.ts +1 -1
  168. package/dist/runtime/rendering/components/renderers/csv-renderer.d.vue.ts +1 -1
  169. package/dist/runtime/rendering/components/renderers/csv-renderer.vue.d.ts +1 -1
  170. package/dist/runtime/rendering/components/renderers/image-renderer.d.vue.ts +1 -1
  171. package/dist/runtime/rendering/components/renderers/image-renderer.vue.d.ts +1 -1
  172. package/dist/runtime/rendering/components/renderers/markdown-renderer.d.vue.ts +1 -1
  173. package/dist/runtime/rendering/components/renderers/markdown-renderer.vue.d.ts +1 -1
  174. package/dist/runtime/rendering/components/renderers/mermaid-diagram.d.vue.ts +1 -1
  175. package/dist/runtime/rendering/components/renderers/mermaid-diagram.vue.d.ts +1 -1
  176. package/dist/runtime/rendering/components/renderers/text-renderer.d.vue.ts +1 -1
  177. package/dist/runtime/rendering/components/renderers/text-renderer.vue.d.ts +1 -1
  178. package/dist/runtime/rendering/components/renderers/video-renderer.d.vue.ts +1 -1
  179. package/dist/runtime/rendering/components/renderers/video-renderer.vue.d.ts +1 -1
  180. package/dist/runtime/shared/chat-api-error.d.ts +1 -0
  181. package/dist/runtime/shared/chat-api-error.js +5 -0
  182. package/dist/runtime/shared/components/app-status-toast.d.vue.ts +1 -1
  183. package/dist/runtime/shared/components/app-status-toast.vue.d.ts +1 -1
  184. package/dist/runtime/shared/components/icons/anthropic.d.vue.ts +1 -1
  185. package/dist/runtime/shared/components/icons/anthropic.vue.d.ts +1 -1
  186. package/dist/runtime/shared/components/icons/tela-chat.d.vue.ts +1 -1
  187. package/dist/runtime/shared/components/icons/tela-chat.vue.d.ts +1 -1
  188. package/dist/runtime/shared/components/icons/tela-wordmark.d.vue.ts +1 -1
  189. package/dist/runtime/shared/components/icons/tela-wordmark.vue.d.ts +1 -1
  190. package/dist/runtime/types/embed.d.ts +1 -0
  191. package/dist/runtime/types/schemas/chat/conversations.d.ts +2 -3
  192. package/dist/runtime/types/schemas/chat/conversations.js +2 -3
  193. package/dist/runtime/types/schemas/chat/messages.d.ts +6 -48
  194. package/dist/runtime/types/schemas/chat/messages.js +5 -4
  195. package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +33 -0
  196. package/dist/runtime/types/schemas/chat/workspace-agent.js +12 -0
  197. package/dist/runtime/types/schemas/chat/workspace-settings.d.ts +0 -47
  198. package/dist/runtime/types/schemas/chat/workspace-settings.js +0 -1
  199. package/dist/runtime/types/schemas/index.d.ts +1 -0
  200. package/dist/runtime/types/schemas/index.js +1 -0
  201. package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +34 -0
  202. package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
  203. package/dist/runtime/types/workspace-settings.d.ts +1 -1
  204. package/dist/runtime/usage/components/chat-usage-view.d.vue.ts +1 -1
  205. package/dist/runtime/usage/components/chat-usage-view.vue.d.ts +1 -1
  206. package/dist/runtime/workspace/composables/github-skills-callback.js +1 -1
  207. package/dist/runtime/workspace/composables/workspace-agent.d.ts +8 -0
  208. package/dist/runtime/workspace/composables/workspace-agent.js +89 -0
  209. package/dist/runtime/workspace/composables/workspace-settings.d.ts +42 -1
  210. package/dist/types.d.mts +1 -1
  211. package/package.json +15 -15
  212. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.d.vue.ts +0 -22
  213. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue +0 -133
  214. package/dist/runtime/embed/components/configuration/chat-configuration-context-files-tab.vue.d.ts +0 -22
  215. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.d.vue.ts +0 -32
  216. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue +0 -222
  217. package/dist/runtime/embed/components/configuration/chat-configuration-external-skills-tab.vue.d.ts +0 -32
  218. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.d.vue.ts +0 -10
  219. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue +0 -37
  220. package/dist/runtime/embed/components/configuration/chat-configuration-personalization-tab.vue.d.ts +0 -10
  221. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.d.vue.ts +0 -20
  222. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue +0 -146
  223. package/dist/runtime/embed/components/configuration/chat-configuration-tela-tools-tab.vue.d.ts +0 -20
  224. package/dist/runtime/internal/agent-environment-resolver.stub.d.ts +0 -2
  225. package/dist/runtime/internal/agent-environment-resolver.stub.js +0 -1
  226. package/dist/runtime/messages/components/chat-model-selector.d.vue.ts +0 -15
  227. package/dist/runtime/messages/components/chat-model-selector.vue +0 -42
  228. package/dist/runtime/messages/components/chat-model-selector.vue.d.ts +0 -15
  229. package/dist/runtime/messages/composables/selected-model.d.ts +0 -4
  230. package/dist/runtime/messages/composables/selected-model.js +0 -48
  231. package/dist/runtime/types/chat-agent-environment-resolver.d.ts +0 -4
  232. package/dist/runtime/workspace/composables/workspace-context-files.d.ts +0 -19
  233. package/dist/runtime/workspace/composables/workspace-context-files.js +0 -83
  234. package/dist/runtime/workspace/composables/workspace-external-skills.d.ts +0 -22
  235. package/dist/runtime/workspace/composables/workspace-external-skills.js +0 -137
  236. package/dist/runtime/workspace/composables/workspace-personalization.d.ts +0 -6
  237. package/dist/runtime/workspace/composables/workspace-personalization.js +0 -18
  238. package/dist/runtime/workspace/composables/workspace-tela-tools.d.ts +0 -13
  239. package/dist/runtime/workspace/composables/workspace-tela-tools.js +0 -91
@@ -1,19 +0,0 @@
1
- import type { ContextFile } from '../../types/schemas/chat/files.js';
2
- export declare const MAX_FILES = 10;
3
- export declare const MAX_FILE_SIZE: number;
4
- export declare function useWorkspaceContextFiles(searchQuery: Ref<string>, currentContextFiles: Ref<readonly ContextFile[] | null | undefined> | ComputedRef<readonly ContextFile[] | null | undefined>): {
5
- pendingFiles: any;
6
- filteredContextFiles: any;
7
- filteredPendingFiles: any;
8
- currentFileCount: any;
9
- hasChanges: any;
10
- maxFiles: number;
11
- handleFileSelect: (event: Event) => void;
12
- removePendingFile: (file: File) => void;
13
- removeContextFile: (url: string) => void;
14
- getFileType: (fileName: string) => string;
15
- initialize: () => void;
16
- getPendingFiles: () => File[];
17
- getKeptContextFiles: () => ContextFile[];
18
- clearPendingFiles: () => void;
19
- };
@@ -1,83 +0,0 @@
1
- export const MAX_FILES = 10;
2
- export const MAX_FILE_SIZE = 10 * 1024 * 1024;
3
- export function useWorkspaceContextFiles(searchQuery, currentContextFiles) {
4
- const pendingFiles = ref([]);
5
- const removedUrls = ref(/* @__PURE__ */ new Set());
6
- const effectiveContextFiles = computed(
7
- () => (currentContextFiles.value ?? []).filter((file) => !removedUrls.value.has(file.url))
8
- );
9
- const filteredContextFiles = computed(() => {
10
- if (!searchQuery.value.trim())
11
- return effectiveContextFiles.value;
12
- const query = searchQuery.value.toLowerCase();
13
- return effectiveContextFiles.value.filter(
14
- (file) => file.name.toLowerCase().includes(query)
15
- );
16
- });
17
- const filteredPendingFiles = computed(() => {
18
- if (!searchQuery.value.trim())
19
- return pendingFiles.value;
20
- const query = searchQuery.value.toLowerCase();
21
- return pendingFiles.value.filter(
22
- (file) => file.name.toLowerCase().includes(query)
23
- );
24
- });
25
- const currentFileCount = computed(
26
- () => effectiveContextFiles.value.length + pendingFiles.value.length
27
- );
28
- const hasChanges = computed(
29
- () => pendingFiles.value.length > 0 || removedUrls.value.size > 0
30
- );
31
- function handleFileSelect(event) {
32
- const target = event.target;
33
- if (!target.files)
34
- return;
35
- const newFiles = Array.from(target.files).filter((file) => file.size <= MAX_FILE_SIZE);
36
- const availableSlots = MAX_FILES - currentFileCount.value;
37
- pendingFiles.value = [...pendingFiles.value, ...newFiles.slice(0, availableSlots)];
38
- target.value = "";
39
- }
40
- function removePendingFile(file) {
41
- const idx = pendingFiles.value.indexOf(file);
42
- if (idx !== -1)
43
- pendingFiles.value = pendingFiles.value.filter((_, i) => i !== idx);
44
- }
45
- function removeContextFile(url) {
46
- const next = new Set(removedUrls.value);
47
- next.add(url);
48
- removedUrls.value = next;
49
- }
50
- function getFileType(fileName) {
51
- return fileName.split(".").pop()?.toUpperCase() ?? "";
52
- }
53
- function initialize() {
54
- pendingFiles.value = [];
55
- removedUrls.value = /* @__PURE__ */ new Set();
56
- }
57
- function getPendingFiles() {
58
- return [...pendingFiles.value];
59
- }
60
- function getKeptContextFiles() {
61
- return [...effectiveContextFiles.value];
62
- }
63
- function clearPendingFiles() {
64
- pendingFiles.value = [];
65
- removedUrls.value = /* @__PURE__ */ new Set();
66
- }
67
- return {
68
- pendingFiles: readonly(pendingFiles),
69
- filteredContextFiles,
70
- filteredPendingFiles,
71
- currentFileCount,
72
- hasChanges,
73
- maxFiles: MAX_FILES,
74
- handleFileSelect,
75
- removePendingFile,
76
- removeContextFile,
77
- getFileType,
78
- initialize,
79
- getPendingFiles,
80
- getKeptContextFiles,
81
- clearPendingFiles
82
- };
83
- }
@@ -1,22 +0,0 @@
1
- import type { ExternalSkill } from '../../types/schemas/chat/workspace-settings.js';
2
- export declare function useWorkspaceExternalSkills(currentExternalSkills: Ref<readonly ExternalSkill[] | null | undefined> | ComputedRef<readonly ExternalSkill[] | null | undefined>, searchQuery?: Ref<string>): {
3
- displayedSkills: any;
4
- filteredSkills: any;
5
- hasChanges: any;
6
- isPending: (ref: string) => boolean;
7
- addSkill: (skill: ExternalSkill) => void;
8
- removeSkill: (ref: string) => void;
9
- buildExternalSkills: () => ExternalSkill[] | null;
10
- initialize: () => void;
11
- skillModalOpen: any;
12
- skillRefInput: any;
13
- skillError: any;
14
- discoveringSkills: any;
15
- handleAddSkill: () => Promise<void>;
16
- closeSkillModal: () => void;
17
- handleAddSkillAndClose: () => Promise<void>;
18
- getGitHubButtonText: () => string;
19
- skillsConnection: any;
20
- fetchGitHubConnection: () => Promise<void>;
21
- connectGitHub: () => void;
22
- };
@@ -1,137 +0,0 @@
1
- import { useChatAuth } from "#chat-auth";
2
- import { getChatApiErrorMessage } from "../../shared/chat-api-error.js";
3
- import { useGitHubSkills } from "./github-skills.js";
4
- export function useWorkspaceExternalSkills(currentExternalSkills, searchQuery) {
5
- const { user } = useChatAuth();
6
- const { connection: skillsConnection, fetchConnection: fetchGitHubConnection, connect: connectGitHub } = useGitHubSkills();
7
- const pendingSkills = ref([]);
8
- const removedRefs = ref([]);
9
- const skillModalOpen = ref(false);
10
- const skillRefInput = ref("");
11
- const skillError = ref("");
12
- const discoveringSkills = ref(false);
13
- const displayedSkills = computed(() => {
14
- const current = (currentExternalSkills.value ?? []).filter((s) => !removedRefs.value.includes(s.ref));
15
- return [...current, ...pendingSkills.value];
16
- });
17
- const filteredSkills = computed(() => {
18
- const query = searchQuery?.value?.trim().toLowerCase();
19
- if (!query)
20
- return displayedSkills.value;
21
- return displayedSkills.value.filter(
22
- (skill) => skill.name.toLowerCase().includes(query) || skill.ref.toLowerCase().includes(query)
23
- );
24
- });
25
- const hasChanges = computed(() => {
26
- return pendingSkills.value.length > 0 || removedRefs.value.length > 0;
27
- });
28
- function isPending(ref2) {
29
- return pendingSkills.value.some((s) => s.ref === ref2);
30
- }
31
- function addSkill(skill) {
32
- pendingSkills.value = [...pendingSkills.value, skill];
33
- }
34
- function removeSkill(ref2) {
35
- const pendingIndex = pendingSkills.value.findIndex((s) => s.ref === ref2);
36
- if (pendingIndex !== -1) {
37
- pendingSkills.value = pendingSkills.value.filter((_, i) => i !== pendingIndex);
38
- return;
39
- }
40
- removedRefs.value = [...removedRefs.value, ref2];
41
- }
42
- function buildExternalSkills() {
43
- const currentSkills = (currentExternalSkills.value ?? []).filter((s) => !removedRefs.value.includes(s.ref)).map((s) => ({
44
- ...s,
45
- allowedTools: [...s.allowedTools],
46
- addedBy: { ...s.addedBy }
47
- }));
48
- const finalSkills = [...currentSkills, ...pendingSkills.value];
49
- return finalSkills.length > 0 ? finalSkills : null;
50
- }
51
- async function handleAddSkill() {
52
- const inputRef = skillRefInput.value.trim();
53
- if (!inputRef || discoveringSkills.value)
54
- return;
55
- skillError.value = "";
56
- discoveringSkills.value = true;
57
- try {
58
- const metadata = await $fetch("/api/external-skills/discover", {
59
- method: "POST",
60
- body: { ref: inputRef }
61
- });
62
- const canonicalRef = metadata.ref;
63
- if (displayedSkills.value.some((s) => s.ref === canonicalRef)) {
64
- skillError.value = "Esta skill j\xE1 foi adicionada";
65
- return;
66
- }
67
- const newSkill = {
68
- ref: canonicalRef,
69
- name: metadata.name,
70
- description: metadata.description || "",
71
- runtime: metadata.runtime || "unknown",
72
- allowedTools: metadata.allowedTools || [],
73
- isPublic: metadata.isPublic,
74
- addedBy: {
75
- userId: user.value?.id || "",
76
- username: user.value?.name || skillsConnection.value.accountName || ""
77
- },
78
- addedAt: (/* @__PURE__ */ new Date()).toISOString()
79
- };
80
- addSkill(newSkill);
81
- skillRefInput.value = "";
82
- } catch (error) {
83
- if (error.statusCode === 401)
84
- skillError.value = "Reposit\xF3rio privado. Conecte um provedor para acessar.";
85
- else if (error.statusCode === 404)
86
- skillError.value = "Skill n\xE3o encontrada. Verifique se o caminho cont\xE9m um arquivo SKILL.md";
87
- else
88
- skillError.value = getChatApiErrorMessage(error) ?? "Erro ao buscar skill";
89
- } finally {
90
- discoveringSkills.value = false;
91
- }
92
- }
93
- function closeSkillModal() {
94
- skillModalOpen.value = false;
95
- skillRefInput.value = "";
96
- skillError.value = "";
97
- }
98
- async function handleAddSkillAndClose() {
99
- await handleAddSkill();
100
- if (!skillError.value)
101
- closeSkillModal();
102
- }
103
- function getGitHubButtonText() {
104
- if (skillsConnection.value.connected)
105
- return "Gerenciar GitHub";
106
- return "Conectar GitHub";
107
- }
108
- function initialize() {
109
- pendingSkills.value = [];
110
- removedRefs.value = [];
111
- skillModalOpen.value = false;
112
- skillRefInput.value = "";
113
- skillError.value = "";
114
- discoveringSkills.value = false;
115
- }
116
- return {
117
- displayedSkills,
118
- filteredSkills,
119
- hasChanges,
120
- isPending,
121
- addSkill,
122
- removeSkill,
123
- buildExternalSkills,
124
- initialize,
125
- skillModalOpen,
126
- skillRefInput,
127
- skillError,
128
- discoveringSkills,
129
- handleAddSkill,
130
- closeSkillModal,
131
- handleAddSkillAndClose,
132
- getGitHubButtonText,
133
- skillsConnection,
134
- fetchGitHubConnection,
135
- connectGitHub
136
- };
137
- }
@@ -1,6 +0,0 @@
1
- export declare function useWorkspacePersonalization(currentSystemMessage: Ref<string | null | undefined> | ComputedRef<string | null | undefined>): {
2
- localSystemMessage: any;
3
- hasChanges: any;
4
- getSystemMessage: () => string | null;
5
- initialize: () => void;
6
- };
@@ -1,18 +0,0 @@
1
- export function useWorkspacePersonalization(currentSystemMessage) {
2
- const localSystemMessage = ref("");
3
- const hasChanges = computed(
4
- () => localSystemMessage.value !== (currentSystemMessage.value ?? "")
5
- );
6
- function getSystemMessage() {
7
- return localSystemMessage.value.trim() || null;
8
- }
9
- function initialize() {
10
- localSystemMessage.value = currentSystemMessage.value ?? "";
11
- }
12
- return {
13
- localSystemMessage,
14
- hasChanges,
15
- getSystemMessage,
16
- initialize
17
- };
18
- }
@@ -1,13 +0,0 @@
1
- import type { TelaCanvas, TelaProject } from '../../types/schemas/integrations/tela-api.js';
2
- import type { CanvasTool } from '../../types/schemas/tools/canvas.js';
3
- export declare function useWorkspaceTelaTools(canvas: Ref<TelaCanvas[]> | ComputedRef<TelaCanvas[]>, projects: Ref<TelaProject[]> | ComputedRef<TelaProject[]>, searchQuery: Ref<string>, currentCanvasTools: Ref<readonly CanvasTool[] | null | undefined> | ComputedRef<readonly CanvasTool[] | null | undefined>): {
4
- selectedToolIds: any;
5
- filteredCanvasTools: any;
6
- allToolsSelected: any;
7
- hasChanges: any;
8
- toggleCanvasTool: (canvasId: string) => void;
9
- toggleAllTools: (selected: boolean | "indeterminate") => void;
10
- getProjectName: (projectId: string) => string;
11
- buildCanvasTools: () => CanvasTool[];
12
- initialize: () => void;
13
- };
@@ -1,91 +0,0 @@
1
- export function useWorkspaceTelaTools(canvas, projects, searchQuery, currentCanvasTools) {
2
- const selectedToolIds = ref(/* @__PURE__ */ new Set());
3
- const filteredCanvasTools = computed(() => {
4
- if (!searchQuery.value.trim())
5
- return canvas.value;
6
- const query = searchQuery.value.toLowerCase();
7
- const matchingProjectIds = new Set(
8
- projects.value.filter((p) => p.title.toLowerCase().includes(query)).map((p) => p.id)
9
- );
10
- return canvas.value.filter(
11
- (c) => c.title.toLowerCase().includes(query) || matchingProjectIds.has(c.projectId)
12
- );
13
- });
14
- const allToolsSelected = computed(() => {
15
- const availableTools = filteredCanvasTools.value.filter((c) => c.promotedVersion);
16
- if (availableTools.length === 0)
17
- return false;
18
- return availableTools.every((c) => selectedToolIds.value.has(c.id));
19
- });
20
- const hasChanges = computed(() => {
21
- const currentIds = new Set(currentCanvasTools.value?.map((t) => t.canvasId) ?? []);
22
- if (currentIds.size !== selectedToolIds.value.size)
23
- return true;
24
- for (const id of currentIds) {
25
- if (!selectedToolIds.value.has(id))
26
- return true;
27
- }
28
- return false;
29
- });
30
- function toggleCanvasTool(canvasId) {
31
- const newSet = new Set(selectedToolIds.value);
32
- if (newSet.has(canvasId))
33
- newSet.delete(canvasId);
34
- else
35
- newSet.add(canvasId);
36
- selectedToolIds.value = newSet;
37
- }
38
- function toggleAllTools(selected) {
39
- if (selected === "indeterminate")
40
- return;
41
- const newSet = new Set(selectedToolIds.value);
42
- const availableTools = filteredCanvasTools.value.filter((c) => c.promotedVersion);
43
- if (selected)
44
- availableTools.forEach((c) => newSet.add(c.id));
45
- else
46
- availableTools.forEach((c) => newSet.delete(c.id));
47
- selectedToolIds.value = newSet;
48
- }
49
- function getProjectName(projectId) {
50
- const project = projects.value.find((p) => p.id === projectId);
51
- return project?.title ?? "Sem projeto";
52
- }
53
- function buildCanvasTools() {
54
- const tools = [];
55
- for (const canvasId of selectedToolIds.value) {
56
- const item = canvas.value.find((c) => c.id === canvasId);
57
- if (!item)
58
- continue;
59
- const name = item.title.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
60
- const variables = item.promotedVersion?.variables?.reduce((acc, v) => {
61
- acc[v.name] = {
62
- name: v.name,
63
- description: v.description ?? v.name,
64
- type: v.type
65
- };
66
- return acc;
67
- }, {});
68
- tools.push({
69
- canvasId,
70
- name,
71
- description: item.title,
72
- variables: variables && Object.keys(variables).length > 0 ? variables : void 0
73
- });
74
- }
75
- return tools;
76
- }
77
- function initialize() {
78
- selectedToolIds.value = new Set(currentCanvasTools.value?.map((t) => t.canvasId) ?? []);
79
- }
80
- return {
81
- selectedToolIds,
82
- filteredCanvasTools,
83
- allToolsSelected,
84
- hasChanges,
85
- toggleCanvasTool,
86
- toggleAllTools,
87
- getProjectName,
88
- buildCanvasTools,
89
- initialize
90
- };
91
- }