@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.
- package/README.md +274 -0
- package/dist/module.d.mts +3 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +250 -0
- package/dist/runtime/assets/css/code-theme.css +1 -0
- package/dist/runtime/assets/css/markstream.css +1 -0
- package/dist/runtime/components/AppStatusToast.d.vue.ts +3 -0
- package/dist/runtime/components/AppStatusToast.vue +42 -0
- package/dist/runtime/components/AppStatusToast.vue.d.ts +3 -0
- package/dist/runtime/components/TelaChat.d.vue.ts +19 -0
- package/dist/runtime/components/TelaChat.vue +25 -0
- package/dist/runtime/components/TelaChat.vue.d.ts +19 -0
- package/dist/runtime/components/app-markdown-render.d.vue.ts +15 -0
- package/dist/runtime/components/app-markdown-render.vue +45 -0
- package/dist/runtime/components/app-markdown-render.vue.d.ts +15 -0
- package/dist/runtime/components/application-card.d.vue.ts +9 -0
- package/dist/runtime/components/application-card.vue +52 -0
- package/dist/runtime/components/application-card.vue.d.ts +9 -0
- package/dist/runtime/components/audio-preview.d.vue.ts +14 -0
- package/dist/runtime/components/audio-preview.vue +52 -0
- package/dist/runtime/components/audio-preview.vue.d.ts +14 -0
- package/dist/runtime/components/chat/bash-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/bash-widget.vue +86 -0
- package/dist/runtime/components/chat/bash-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/canvas-selector-modal.d.vue.ts +14 -0
- package/dist/runtime/components/chat/canvas-selector-modal.vue +290 -0
- package/dist/runtime/components/chat/canvas-selector-modal.vue.d.ts +14 -0
- package/dist/runtime/components/chat/context-config.d.vue.ts +30 -0
- package/dist/runtime/components/chat/context-config.vue +423 -0
- package/dist/runtime/components/chat/context-config.vue.d.ts +30 -0
- package/dist/runtime/components/chat/conversation-item.d.vue.ts +20 -0
- package/dist/runtime/components/chat/conversation-item.vue +184 -0
- package/dist/runtime/components/chat/conversation-item.vue.d.ts +20 -0
- package/dist/runtime/components/chat/conversation-list.d.vue.ts +10 -0
- package/dist/runtime/components/chat/conversation-list.vue +78 -0
- package/dist/runtime/components/chat/conversation-list.vue.d.ts +10 -0
- package/dist/runtime/components/chat/doc-sdk-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/doc-sdk-widget.vue +74 -0
- package/dist/runtime/components/chat/doc-sdk-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/file-preview.d.vue.ts +7 -0
- package/dist/runtime/components/chat/file-preview.vue +313 -0
- package/dist/runtime/components/chat/file-preview.vue.d.ts +7 -0
- package/dist/runtime/components/chat/files-view.d.vue.ts +6 -0
- package/dist/runtime/components/chat/files-view.vue +399 -0
- package/dist/runtime/components/chat/files-view.vue.d.ts +6 -0
- package/dist/runtime/components/chat/generic-tool-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/generic-tool-widget.vue +334 -0
- package/dist/runtime/components/chat/generic-tool-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/grep-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/grep-widget.vue +259 -0
- package/dist/runtime/components/chat/grep-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/mention-dropdown.d.vue.ts +14 -0
- package/dist/runtime/components/chat/mention-dropdown.vue +90 -0
- package/dist/runtime/components/chat/mention-dropdown.vue.d.ts +14 -0
- package/dist/runtime/components/chat/message-bubble.d.vue.ts +11 -0
- package/dist/runtime/components/chat/message-bubble.vue +288 -0
- package/dist/runtime/components/chat/message-bubble.vue.d.ts +11 -0
- package/dist/runtime/components/chat/message-input.d.vue.ts +34 -0
- package/dist/runtime/components/chat/message-input.vue +428 -0
- package/dist/runtime/components/chat/message-input.vue.d.ts +34 -0
- package/dist/runtime/components/chat/message-list.d.vue.ts +11 -0
- package/dist/runtime/components/chat/message-list.vue +36 -0
- package/dist/runtime/components/chat/message-list.vue.d.ts +11 -0
- package/dist/runtime/components/chat/model-selector.d.vue.ts +15 -0
- package/dist/runtime/components/chat/model-selector.vue +35 -0
- package/dist/runtime/components/chat/model-selector.vue.d.ts +15 -0
- package/dist/runtime/components/chat/new-conversation-modal.d.vue.ts +14 -0
- package/dist/runtime/components/chat/new-conversation-modal.vue +271 -0
- package/dist/runtime/components/chat/new-conversation-modal.vue.d.ts +14 -0
- package/dist/runtime/components/chat/read-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/read-widget.vue +195 -0
- package/dist/runtime/components/chat/read-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/reasoning-message.d.vue.ts +13 -0
- package/dist/runtime/components/chat/reasoning-message.vue +341 -0
- package/dist/runtime/components/chat/reasoning-message.vue.d.ts +13 -0
- package/dist/runtime/components/chat/reasoning-step-item.d.vue.ts +37 -0
- package/dist/runtime/components/chat/reasoning-step-item.vue +125 -0
- package/dist/runtime/components/chat/reasoning-step-item.vue.d.ts +37 -0
- package/dist/runtime/components/chat/reasoning-steps.d.vue.ts +12 -0
- package/dist/runtime/components/chat/reasoning-steps.vue +47 -0
- package/dist/runtime/components/chat/reasoning-steps.vue.d.ts +12 -0
- package/dist/runtime/components/chat/reasoning-thought.d.vue.ts +11 -0
- package/dist/runtime/components/chat/reasoning-thought.vue +287 -0
- package/dist/runtime/components/chat/reasoning-thought.vue.d.ts +11 -0
- package/dist/runtime/components/chat/tela-skill-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/tela-skill-widget.vue +94 -0
- package/dist/runtime/components/chat/tela-skill-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/thinking-indicator.d.vue.ts +3 -0
- package/dist/runtime/components/chat/thinking-indicator.vue +52 -0
- package/dist/runtime/components/chat/thinking-indicator.vue.d.ts +3 -0
- package/dist/runtime/components/chat/thinking-widget.d.vue.ts +8 -0
- package/dist/runtime/components/chat/thinking-widget.vue +53 -0
- package/dist/runtime/components/chat/thinking-widget.vue.d.ts +8 -0
- package/dist/runtime/components/chat/topbar.d.vue.ts +43 -0
- package/dist/runtime/components/chat/topbar.vue +223 -0
- package/dist/runtime/components/chat/topbar.vue.d.ts +43 -0
- package/dist/runtime/components/chat/usage-view.d.vue.ts +8 -0
- package/dist/runtime/components/chat/usage-view.vue +393 -0
- package/dist/runtime/components/chat/usage-view.vue.d.ts +8 -0
- package/dist/runtime/components/chat/vault-link.d.vue.ts +20 -0
- package/dist/runtime/components/chat/vault-link.vue +34 -0
- package/dist/runtime/components/chat/vault-link.vue.d.ts +20 -0
- package/dist/runtime/components/chat/web-search-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/web-search-widget.vue +121 -0
- package/dist/runtime/components/chat/web-search-widget.vue.d.ts +9 -0
- package/dist/runtime/components/chat/workstation-query-widget.d.vue.ts +10 -0
- package/dist/runtime/components/chat/workstation-query-widget.vue +552 -0
- package/dist/runtime/components/chat/workstation-query-widget.vue.d.ts +10 -0
- package/dist/runtime/components/chat/workstation-selector-modal.d.vue.ts +14 -0
- package/dist/runtime/components/chat/workstation-selector-modal.vue +272 -0
- package/dist/runtime/components/chat/workstation-selector-modal.vue.d.ts +14 -0
- package/dist/runtime/components/chat/write-widget.d.vue.ts +9 -0
- package/dist/runtime/components/chat/write-widget.vue +165 -0
- package/dist/runtime/components/chat/write-widget.vue.d.ts +9 -0
- package/dist/runtime/components/conversation-files-panel.d.vue.ts +3 -0
- package/dist/runtime/components/conversation-files-panel.vue +252 -0
- package/dist/runtime/components/conversation-files-panel.vue.d.ts +3 -0
- package/dist/runtime/components/csv-preview.d.vue.ts +20 -0
- package/dist/runtime/components/csv-preview.vue +157 -0
- package/dist/runtime/components/csv-preview.vue.d.ts +20 -0
- package/dist/runtime/components/file-preview-panel.d.vue.ts +3 -0
- package/dist/runtime/components/file-preview-panel.vue +185 -0
- package/dist/runtime/components/file-preview-panel.vue.d.ts +3 -0
- package/dist/runtime/components/file-uploader.d.vue.ts +16 -0
- package/dist/runtime/components/file-uploader.vue +136 -0
- package/dist/runtime/components/file-uploader.vue.d.ts +16 -0
- package/dist/runtime/components/icons/anthropic.d.vue.ts +3 -0
- package/dist/runtime/components/icons/anthropic.vue +5 -0
- package/dist/runtime/components/icons/anthropic.vue.d.ts +3 -0
- package/dist/runtime/components/image-preview.d.vue.ts +14 -0
- package/dist/runtime/components/image-preview.vue +54 -0
- package/dist/runtime/components/image-preview.vue.d.ts +14 -0
- package/dist/runtime/components/json-tree-node.d.vue.ts +9 -0
- package/dist/runtime/components/json-tree-node.vue +109 -0
- package/dist/runtime/components/json-tree-node.vue.d.ts +9 -0
- package/dist/runtime/components/json-viewer.d.vue.ts +6 -0
- package/dist/runtime/components/json-viewer.vue +88 -0
- package/dist/runtime/components/json-viewer.vue.d.ts +6 -0
- package/dist/runtime/components/pdf-preview.d.vue.ts +20 -0
- package/dist/runtime/components/pdf-preview.vue +89 -0
- package/dist/runtime/components/pdf-preview.vue.d.ts +20 -0
- package/dist/runtime/components/pdf-viewer.d.vue.ts +10 -0
- package/dist/runtime/components/pdf-viewer.vue +265 -0
- package/dist/runtime/components/pdf-viewer.vue.d.ts +10 -0
- package/dist/runtime/components/powered-by-tela.d.vue.ts +3 -0
- package/dist/runtime/components/powered-by-tela.vue +14 -0
- package/dist/runtime/components/powered-by-tela.vue.d.ts +3 -0
- package/dist/runtime/components/renderers/artifact-display.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/artifact-display.vue +105 -0
- package/dist/runtime/components/renderers/artifact-display.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/audio-renderer.d.vue.ts +7 -0
- package/dist/runtime/components/renderers/audio-renderer.vue +52 -0
- package/dist/runtime/components/renderers/audio-renderer.vue.d.ts +7 -0
- package/dist/runtime/components/renderers/csv-renderer.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/csv-renderer.vue +203 -0
- package/dist/runtime/components/renderers/csv-renderer.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/image-renderer.d.vue.ts +7 -0
- package/dist/runtime/components/renderers/image-renderer.vue +44 -0
- package/dist/runtime/components/renderers/image-renderer.vue.d.ts +7 -0
- package/dist/runtime/components/renderers/markdown-renderer.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/markdown-renderer.vue +66 -0
- package/dist/runtime/components/renderers/markdown-renderer.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/mermaid-diagram.d.vue.ts +7 -0
- package/dist/runtime/components/renderers/mermaid-diagram.vue +165 -0
- package/dist/runtime/components/renderers/mermaid-diagram.vue.d.ts +7 -0
- package/dist/runtime/components/renderers/text-renderer.d.vue.ts +7 -0
- package/dist/runtime/components/renderers/text-renderer.vue +70 -0
- package/dist/runtime/components/renderers/text-renderer.vue.d.ts +7 -0
- package/dist/runtime/components/renderers/video-renderer.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/video-renderer.vue +43 -0
- package/dist/runtime/components/renderers/video-renderer.vue.d.ts +6 -0
- package/dist/runtime/components/text-preview.d.vue.ts +19 -0
- package/dist/runtime/components/text-preview.vue +105 -0
- package/dist/runtime/components/text-preview.vue.d.ts +19 -0
- package/dist/runtime/components/video-preview.d.vue.ts +14 -0
- package/dist/runtime/components/video-preview.vue +55 -0
- package/dist/runtime/components/video-preview.vue.d.ts +14 -0
- package/dist/runtime/composables/PageNavigation.d.ts +13 -0
- package/dist/runtime/composables/PageNavigation.js +18 -0
- package/dist/runtime/composables/useChat.d.ts +25 -0
- package/dist/runtime/composables/useChat.js +512 -0
- package/dist/runtime/composables/useChatApi.d.ts +6 -0
- package/dist/runtime/composables/useChatApi.js +28 -0
- package/dist/runtime/composables/useConversationFiles.d.ts +13 -0
- package/dist/runtime/composables/useConversationFiles.js +98 -0
- package/dist/runtime/composables/useConversationFilesPanel.d.ts +11 -0
- package/dist/runtime/composables/useConversationFilesPanel.js +35 -0
- package/dist/runtime/composables/useConversations.d.ts +15 -0
- package/dist/runtime/composables/useConversations.js +191 -0
- package/dist/runtime/composables/useDiagramExport.d.ts +11 -0
- package/dist/runtime/composables/useDiagramExport.js +186 -0
- package/dist/runtime/composables/useEmbedConfig.d.ts +13 -0
- package/dist/runtime/composables/useEmbedConfig.js +11 -0
- package/dist/runtime/composables/useFeatureFlags.d.ts +19 -0
- package/dist/runtime/composables/useFeatureFlags.js +67 -0
- package/dist/runtime/composables/useFileDrop.d.ts +17 -0
- package/dist/runtime/composables/useFileDrop.js +89 -0
- package/dist/runtime/composables/useFilePreviewPanel.d.ts +30 -0
- package/dist/runtime/composables/useFilePreviewPanel.js +42 -0
- package/dist/runtime/composables/useFileUpload.d.ts +7 -0
- package/dist/runtime/composables/useFileUpload.js +39 -0
- package/dist/runtime/composables/useGitHubSkills.d.ts +6 -0
- package/dist/runtime/composables/useGitHubSkills.js +68 -0
- package/dist/runtime/composables/useGitHubSkillsCallback.d.ts +5 -0
- package/dist/runtime/composables/useGitHubSkillsCallback.js +42 -0
- package/dist/runtime/composables/useIDB.d.ts +11 -0
- package/dist/runtime/composables/useIDB.js +57 -0
- package/dist/runtime/composables/useInputHistory.d.ts +7 -0
- package/dist/runtime/composables/useInputHistory.js +36 -0
- package/dist/runtime/composables/useKnowledgeSources.d.ts +6 -0
- package/dist/runtime/composables/useKnowledgeSources.js +15 -0
- package/dist/runtime/composables/useMediaCache.d.ts +13 -0
- package/dist/runtime/composables/useMediaCache.js +92 -0
- package/dist/runtime/composables/useMentionAutocomplete.d.ts +10 -0
- package/dist/runtime/composables/useMentionAutocomplete.js +272 -0
- package/dist/runtime/composables/useMermaidRenderer.d.ts +5 -0
- package/dist/runtime/composables/useMermaidRenderer.js +121 -0
- package/dist/runtime/composables/usePdf.d.ts +21 -0
- package/dist/runtime/composables/usePdf.js +138 -0
- package/dist/runtime/composables/usePolling.d.ts +12 -0
- package/dist/runtime/composables/usePolling.js +55 -0
- package/dist/runtime/composables/useSelectedModel.d.ts +4 -0
- package/dist/runtime/composables/useSelectedModel.js +46 -0
- package/dist/runtime/composables/useSplashScreen.d.ts +3 -0
- package/dist/runtime/composables/useSplashScreen.js +4 -0
- package/dist/runtime/composables/useStatusToast.d.ts +22 -0
- package/dist/runtime/composables/useStatusToast.js +40 -0
- package/dist/runtime/composables/useTela.d.ts +12 -0
- package/dist/runtime/composables/useTela.js +47 -0
- package/dist/runtime/composables/useToolFormatting.d.ts +5 -0
- package/dist/runtime/composables/useToolFormatting.js +61 -0
- package/dist/runtime/composables/useVault.d.ts +13 -0
- package/dist/runtime/composables/useVault.js +35 -0
- package/dist/runtime/composables/useVerbConjugation.d.ts +6 -0
- package/dist/runtime/composables/useVerbConjugation.js +256 -0
- package/dist/runtime/composables/useWorkspaceContextFiles.d.ts +19 -0
- package/dist/runtime/composables/useWorkspaceContextFiles.js +74 -0
- package/dist/runtime/composables/useWorkspaceCredentials.d.ts +34 -0
- package/dist/runtime/composables/useWorkspaceCredentials.js +175 -0
- package/dist/runtime/composables/useWorkspaceExternalSkills.d.ts +22 -0
- package/dist/runtime/composables/useWorkspaceExternalSkills.js +135 -0
- package/dist/runtime/composables/useWorkspaceKnowledgeSources.d.ts +11 -0
- package/dist/runtime/composables/useWorkspaceKnowledgeSources.js +88 -0
- package/dist/runtime/composables/useWorkspaceMembers.d.ts +13 -0
- package/dist/runtime/composables/useWorkspaceMembers.js +37 -0
- package/dist/runtime/composables/useWorkspacePersonalization.d.ts +6 -0
- package/dist/runtime/composables/useWorkspacePersonalization.js +19 -0
- package/dist/runtime/composables/useWorkspaceSettings.d.ts +30 -0
- package/dist/runtime/composables/useWorkspaceSettings.js +135 -0
- package/dist/runtime/composables/useWorkspaceTelaTools.d.ts +13 -0
- package/dist/runtime/composables/useWorkspaceTelaTools.js +91 -0
- package/dist/runtime/composables/useWorkspaces.d.ts +5 -0
- package/dist/runtime/composables/useWorkspaces.js +14 -0
- package/dist/runtime/composables/useZoomPan.d.ts +18 -0
- package/dist/runtime/composables/useZoomPan.js +130 -0
- package/dist/runtime/embed/components/ChatEmbed.d.vue.ts +23 -0
- package/dist/runtime/embed/components/ChatEmbed.vue +27 -0
- package/dist/runtime/embed/components/ChatEmbed.vue.d.ts +23 -0
- package/dist/runtime/embed/components/ChatEmbedInner.d.vue.ts +19 -0
- package/dist/runtime/embed/components/ChatEmbedInner.vue +604 -0
- package/dist/runtime/embed/components/ChatEmbedInner.vue.d.ts +19 -0
- package/dist/runtime/public/favicon.svg +4 -0
- package/dist/runtime/public/files/archive.svg +9 -0
- package/dist/runtime/public/files/audio.svg +4 -0
- package/dist/runtime/public/files/c.svg +4 -0
- package/dist/runtime/public/files/cpp.svg +6 -0
- package/dist/runtime/public/files/css.svg +4 -0
- package/dist/runtime/public/files/doc.svg +5 -0
- package/dist/runtime/public/files/generic.svg +7 -0
- package/dist/runtime/public/files/go.svg +6 -0
- package/dist/runtime/public/files/html.svg +4 -0
- package/dist/runtime/public/files/image.svg +3 -0
- package/dist/runtime/public/files/java.svg +7 -0
- package/dist/runtime/public/files/javascript.svg +4 -0
- package/dist/runtime/public/files/json.svg +5 -0
- package/dist/runtime/public/files/markdown.svg +5 -0
- package/dist/runtime/public/files/pdf.svg +5 -0
- package/dist/runtime/public/files/presentation.svg +5 -0
- package/dist/runtime/public/files/python.svg +5 -0
- package/dist/runtime/public/files/ruby.svg +5 -0
- package/dist/runtime/public/files/rust.svg +13 -0
- package/dist/runtime/public/files/sheet.svg +9 -0
- package/dist/runtime/public/files/shell.svg +5 -0
- package/dist/runtime/public/files/sql.svg +6 -0
- package/dist/runtime/public/files/typescript.svg +5 -0
- package/dist/runtime/public/files/video.svg +5 -0
- package/dist/runtime/public/files/yaml.svg +7 -0
- package/dist/runtime/public/github.svg +3 -0
- package/dist/runtime/public/robots.txt +1 -0
- package/dist/runtime/server/api/admin/trigger-usage-report.post.d.ts +2 -0
- package/dist/runtime/server/api/admin/trigger-usage-report.post.js +15 -0
- package/dist/runtime/server/api/chat/conversations/[id]/cancel.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/cancel.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/clear.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/clear.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/duplicate.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/duplicate.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/files.get.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/files.get.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.delete.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.delete.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.get.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.get.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.patch.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/index.patch.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/[messageId]/retry.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/[messageId]/retry.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/index.get.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/index.get.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/index.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/messages/index.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/usage.get.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/[id]/usage.get.js +1 -0
- package/dist/runtime/server/api/chat/conversations/generate-title.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/generate-title.post.js +1 -0
- package/dist/runtime/server/api/chat/conversations/index.get.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/index.get.js +1 -0
- package/dist/runtime/server/api/chat/conversations/index.post.d.ts +1 -0
- package/dist/runtime/server/api/chat/conversations/index.post.js +1 -0
- package/dist/runtime/server/api/chat/workspace/settings.get.d.ts +2 -0
- package/dist/runtime/server/api/chat/workspace/settings.get.js +14 -0
- package/dist/runtime/server/api/conversations/[id]/cancel.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/cancel.post.js +58 -0
- package/dist/runtime/server/api/conversations/[id]/clear.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/clear.post.js +38 -0
- package/dist/runtime/server/api/conversations/[id]/duplicate.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/duplicate.post.js +41 -0
- package/dist/runtime/server/api/conversations/[id]/files.get.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/files.get.js +131 -0
- package/dist/runtime/server/api/conversations/[id]/index.delete.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/index.delete.js +35 -0
- package/dist/runtime/server/api/conversations/[id]/index.get.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/index.get.js +34 -0
- package/dist/runtime/server/api/conversations/[id]/index.patch.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/index.patch.js +54 -0
- package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/messages/[messageId]/retry.post.js +168 -0
- package/dist/runtime/server/api/conversations/[id]/messages/index.get.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/messages/index.get.js +220 -0
- package/dist/runtime/server/api/conversations/[id]/messages/index.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/[id]/messages/index.post.js +181 -0
- package/dist/runtime/server/api/conversations/[id]/usage.get.d.ts +8 -0
- package/dist/runtime/server/api/conversations/[id]/usage.get.js +96 -0
- package/dist/runtime/server/api/conversations/generate-title.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/generate-title.post.js +49 -0
- package/dist/runtime/server/api/conversations/index.get.d.ts +2 -0
- package/dist/runtime/server/api/conversations/index.get.js +11 -0
- package/dist/runtime/server/api/conversations/index.post.d.ts +2 -0
- package/dist/runtime/server/api/conversations/index.post.js +41 -0
- package/dist/runtime/server/api/external-skills/discover.post.d.ts +2 -0
- package/dist/runtime/server/api/external-skills/discover.post.js +65 -0
- package/dist/runtime/server/api/github/disconnect.post.d.ts +2 -0
- package/dist/runtime/server/api/github/disconnect.post.js +21 -0
- package/dist/runtime/server/api/github/status.get.d.ts +2 -0
- package/dist/runtime/server/api/github/status.get.js +23 -0
- package/dist/runtime/server/api/tela/canvas.get.d.ts +2 -0
- package/dist/runtime/server/api/tela/canvas.get.js +18 -0
- package/dist/runtime/server/api/tela/projects.get.d.ts +2 -0
- package/dist/runtime/server/api/tela/projects.get.js +9 -0
- package/dist/runtime/server/api/tela/workspaces.get.d.ts +2 -0
- package/dist/runtime/server/api/tela/workspaces.get.js +9 -0
- package/dist/runtime/server/api/tela/workstations.get.d.ts +2 -0
- package/dist/runtime/server/api/tela/workstations.get.js +24 -0
- package/dist/runtime/server/api/vault/permalink-metadata.post.d.ts +2 -0
- package/dist/runtime/server/api/vault/permalink-metadata.post.js +77 -0
- package/dist/runtime/server/api/vault/resolve.post.d.ts +2 -0
- package/dist/runtime/server/api/vault/resolve.post.js +82 -0
- package/dist/runtime/server/api/vault/upload.post.d.ts +2 -0
- package/dist/runtime/server/api/vault/upload.post.js +55 -0
- package/dist/runtime/server/api/workspace/credentials/[id].delete.d.ts +2 -0
- package/dist/runtime/server/api/workspace/credentials/[id].delete.js +18 -0
- package/dist/runtime/server/api/workspace/credentials/[id].put.d.ts +2 -0
- package/dist/runtime/server/api/workspace/credentials/[id].put.js +28 -0
- package/dist/runtime/server/api/workspace/credentials/index.get.d.ts +2 -0
- package/dist/runtime/server/api/workspace/credentials/index.get.js +10 -0
- package/dist/runtime/server/api/workspace/credentials/index.post.d.ts +2 -0
- package/dist/runtime/server/api/workspace/credentials/index.post.js +33 -0
- package/dist/runtime/server/api/workspace/settings.get.d.ts +2 -0
- package/dist/runtime/server/api/workspace/settings.get.js +27 -0
- package/dist/runtime/server/api/workspace/settings.patch.d.ts +2 -0
- package/dist/runtime/server/api/workspace/settings.patch.js +86 -0
- package/dist/runtime/server/api/workspace/usage.get.d.ts +48 -0
- package/dist/runtime/server/api/workspace/usage.get.js +186 -0
- package/dist/runtime/server/db/index.d.ts +6 -0
- package/dist/runtime/server/db/index.js +19 -0
- package/dist/runtime/server/db/schema/conversation-usage.d.ts +438 -0
- package/dist/runtime/server/db/schema/conversation-usage.js +34 -0
- package/dist/runtime/server/db/schema/conversations.d.ts +197 -0
- package/dist/runtime/server/db/schema/conversations.js +18 -0
- package/dist/runtime/server/db/schema/external-skills.d.ts +235 -0
- package/dist/runtime/server/db/schema/external-skills.js +26 -0
- package/dist/runtime/server/db/schema/index.d.ts +5 -0
- package/dist/runtime/server/db/schema/index.js +5 -0
- package/dist/runtime/server/db/schema/messages.d.ts +221 -0
- package/dist/runtime/server/db/schema/messages.js +19 -0
- package/dist/runtime/server/db/schema/workspace-settings.d.ts +164 -0
- package/dist/runtime/server/db/schema/workspace-settings.js +15 -0
- package/dist/runtime/server/db/schema.d.ts +1 -0
- package/dist/runtime/server/db/schema.js +1 -0
- package/dist/runtime/server/middleware/domain-validation.d.ts +2 -0
- package/dist/runtime/server/middleware/domain-validation.js +22 -0
- package/dist/runtime/server/middleware/request-logger.d.ts +2 -0
- package/dist/runtime/server/middleware/request-logger.js +15 -0
- package/dist/runtime/server/prompts/base-system.d.ts +2 -0
- package/dist/runtime/server/prompts/base-system.js +100 -0
- package/dist/runtime/server/prompts/base-system.md +99 -0
- package/dist/runtime/server/prompts/knowledge-sources.d.ts +2 -0
- package/dist/runtime/server/prompts/knowledge-sources.js +37 -0
- package/dist/runtime/server/prompts/knowledge-sources.md +36 -0
- package/dist/runtime/server/tasks/send-daily-usage-report.d.ts +2 -0
- package/dist/runtime/server/tasks/send-daily-usage-report.js +73 -0
- package/dist/runtime/server/tsconfig.json +21 -0
- package/dist/runtime/server/utils/agent-api.d.ts +39 -0
- package/dist/runtime/server/utils/agent-api.js +169 -0
- package/dist/runtime/server/utils/auth-api.d.ts +1 -0
- package/dist/runtime/server/utils/auth-api.js +25 -0
- package/dist/runtime/server/utils/auth.d.ts +17 -0
- package/dist/runtime/server/utils/auth.js +28 -0
- package/dist/runtime/server/utils/billing.d.ts +37 -0
- package/dist/runtime/server/utils/billing.js +68 -0
- package/dist/runtime/server/utils/chat-context.d.ts +9 -0
- package/dist/runtime/server/utils/chat-context.js +24 -0
- package/dist/runtime/server/utils/chat-message-builder.d.ts +4 -0
- package/dist/runtime/server/utils/chat-message-builder.js +39 -0
- package/dist/runtime/server/utils/chat-prompts.d.ts +7 -0
- package/dist/runtime/server/utils/chat-prompts.js +9 -0
- package/dist/runtime/server/utils/chat-workspace-settings.d.ts +16 -0
- package/dist/runtime/server/utils/chat-workspace-settings.js +115 -0
- package/dist/runtime/server/utils/external-skills.d.ts +2 -0
- package/dist/runtime/server/utils/external-skills.js +15 -0
- package/dist/runtime/server/utils/logger.d.ts +2 -0
- package/dist/runtime/server/utils/logger.js +12 -0
- package/dist/runtime/server/utils/slack.d.ts +32 -0
- package/dist/runtime/server/utils/slack.js +102 -0
- package/dist/runtime/server/utils/tela-api.d.ts +2 -0
- package/dist/runtime/server/utils/tela-api.js +29 -0
- package/dist/runtime/server/utils/vault.d.ts +3 -0
- package/dist/runtime/server/utils/vault.js +52 -0
- package/dist/runtime/server/utils/workspace-settings-resolver.stub.d.ts +2 -0
- package/dist/runtime/server/utils/workspace-settings-resolver.stub.js +1 -0
- package/dist/runtime/server/utils/workspace.d.ts +4 -0
- package/dist/runtime/server/utils/workspace.js +21 -0
- package/dist/runtime/types/agent.d.ts +168 -0
- package/dist/runtime/types/agent.js +95 -0
- package/dist/runtime/types/chat-workspace-settings-resolver.d.ts +4 -0
- package/dist/runtime/types/chat.d.ts +81 -0
- package/dist/runtime/types/chat.js +12 -0
- package/dist/runtime/types/credential.d.ts +8 -0
- package/dist/runtime/types/credential.js +0 -0
- package/dist/runtime/types/csv.d.ts +4 -0
- package/dist/runtime/types/csv.js +0 -0
- package/dist/runtime/types/external-skills.d.ts +8 -0
- package/dist/runtime/types/external-skills.js +0 -0
- package/dist/runtime/types/feature-flags.d.ts +7 -0
- package/dist/runtime/types/feature-flags.js +6 -0
- package/dist/runtime/types/reasoning.d.ts +17 -0
- package/dist/runtime/types/reasoning.js +0 -0
- package/dist/runtime/types/tela.d.ts +46 -0
- package/dist/runtime/types/tela.js +0 -0
- package/dist/runtime/types/workspace.d.ts +20 -0
- package/dist/runtime/types/workspace.js +0 -0
- package/dist/runtime/utils/calculate-usage.d.ts +48 -0
- package/dist/runtime/utils/calculate-usage.js +63 -0
- package/dist/runtime/utils/code-detection.d.ts +1 -0
- package/dist/runtime/utils/code-detection.js +24 -0
- package/dist/runtime/utils/export-conversation.d.ts +2 -0
- package/dist/runtime/utils/export-conversation.js +43 -0
- package/dist/runtime/utils/file.d.ts +46 -0
- package/dist/runtime/utils/file.js +500 -0
- package/dist/runtime/utils/format-time.d.ts +22 -0
- package/dist/runtime/utils/format-time.js +96 -0
- package/dist/runtime/utils/markdown-nodes.d.ts +22 -0
- package/dist/runtime/utils/markdown-nodes.js +40 -0
- package/dist/runtime/utils/string.d.ts +4 -0
- package/dist/runtime/utils/string.js +5 -0
- package/dist/runtime/utils/tela-chat.d.ts +19 -0
- package/dist/runtime/utils/tela-chat.js +20 -0
- package/dist/types.d.mts +7 -0
- package/package.json +72 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
export function useMentionAutocomplete(options) {
|
|
2
|
+
const { editorRef, fileItems, skillItems, disabled, onInsert } = options;
|
|
3
|
+
const activeTrigger = ref(null);
|
|
4
|
+
const query = ref("");
|
|
5
|
+
const highlightedIndex = ref(-1);
|
|
6
|
+
const lastQuery = ref("");
|
|
7
|
+
let triggerTextOffset = -1;
|
|
8
|
+
const isOpen = computed(() => activeTrigger.value !== null);
|
|
9
|
+
const filteredItems = computed(() => {
|
|
10
|
+
if (!activeTrigger.value)
|
|
11
|
+
return [];
|
|
12
|
+
const items = activeTrigger.value === "@" ? fileItems.value : skillItems.value;
|
|
13
|
+
if (!query.value)
|
|
14
|
+
return items;
|
|
15
|
+
const q = query.value.toLowerCase();
|
|
16
|
+
return items.filter(
|
|
17
|
+
(item) => item.label.toLowerCase().includes(q) || item.description?.toLowerCase().includes(q)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
function getTextBeforeCursor() {
|
|
21
|
+
const sel = window.getSelection();
|
|
22
|
+
if (!sel || sel.rangeCount === 0 || !editorRef.value)
|
|
23
|
+
return "";
|
|
24
|
+
const range = sel.getRangeAt(0);
|
|
25
|
+
const preRange = document.createRange();
|
|
26
|
+
preRange.selectNodeContents(editorRef.value);
|
|
27
|
+
preRange.setEnd(range.startContainer, range.startOffset);
|
|
28
|
+
return preRange.toString();
|
|
29
|
+
}
|
|
30
|
+
function detectTrigger() {
|
|
31
|
+
if (disabled?.value) {
|
|
32
|
+
activeTrigger.value = null;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const textBefore = getTextBeforeCursor();
|
|
36
|
+
for (let i = textBefore.length - 1; i >= 0; i--) {
|
|
37
|
+
const char = textBefore[i];
|
|
38
|
+
if (char === " " || char === "\n" || char === "\xA0") {
|
|
39
|
+
activeTrigger.value = null;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (char === "@" || char === "/") {
|
|
43
|
+
activeTrigger.value = char;
|
|
44
|
+
triggerTextOffset = i;
|
|
45
|
+
const newQuery = textBefore.slice(i + 1);
|
|
46
|
+
if (newQuery !== lastQuery.value) {
|
|
47
|
+
highlightedIndex.value = -1;
|
|
48
|
+
lastQuery.value = newQuery;
|
|
49
|
+
}
|
|
50
|
+
query.value = newQuery;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
activeTrigger.value = null;
|
|
55
|
+
}
|
|
56
|
+
function getCaretRangeAtOffset(offset) {
|
|
57
|
+
const editor = editorRef.value;
|
|
58
|
+
if (!editor)
|
|
59
|
+
return null;
|
|
60
|
+
let current = 0;
|
|
61
|
+
function walkNode(node) {
|
|
62
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
63
|
+
const len = node.textContent?.length ?? 0;
|
|
64
|
+
if (current + len >= offset) {
|
|
65
|
+
const r = document.createRange();
|
|
66
|
+
r.setStart(node, offset - current);
|
|
67
|
+
r.collapse(true);
|
|
68
|
+
return r;
|
|
69
|
+
}
|
|
70
|
+
current += len;
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (node.nodeName === "BR") {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.contentEditable === "false") {
|
|
77
|
+
const len = node.textContent?.length ?? 0;
|
|
78
|
+
if (current + len > offset) {
|
|
79
|
+
const r = document.createRange();
|
|
80
|
+
r.setStartBefore(node);
|
|
81
|
+
r.collapse(true);
|
|
82
|
+
return r;
|
|
83
|
+
}
|
|
84
|
+
current += len;
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
for (const child of node.childNodes) {
|
|
88
|
+
const result = walkNode(child);
|
|
89
|
+
if (result)
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return walkNode(editor);
|
|
95
|
+
}
|
|
96
|
+
function escapeAttr(value) {
|
|
97
|
+
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
98
|
+
}
|
|
99
|
+
function selectItem(item) {
|
|
100
|
+
if (!editorRef.value || triggerTextOffset < 0)
|
|
101
|
+
return;
|
|
102
|
+
const sel = window.getSelection();
|
|
103
|
+
if (!sel || sel.rangeCount === 0)
|
|
104
|
+
return;
|
|
105
|
+
const textBeforeCursor = getTextBeforeCursor();
|
|
106
|
+
const charBeforeTrigger = triggerTextOffset > 0 ? textBeforeCursor[triggerTextOffset - 1] : null;
|
|
107
|
+
const needsSpaceBefore = charBeforeTrigger !== null && charBeforeTrigger !== " " && charBeforeTrigger !== "\n" && charBeforeTrigger !== "\xA0";
|
|
108
|
+
const triggerRange = getCaretRangeAtOffset(triggerTextOffset);
|
|
109
|
+
if (!triggerRange)
|
|
110
|
+
return;
|
|
111
|
+
const currentRange = sel.getRangeAt(0);
|
|
112
|
+
const deleteRange = document.createRange();
|
|
113
|
+
deleteRange.setStart(triggerRange.startContainer, triggerRange.startOffset);
|
|
114
|
+
deleteRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
|
115
|
+
deleteRange.deleteContents();
|
|
116
|
+
const span = document.createElement("span");
|
|
117
|
+
span.className = `mention-tag mention-tag-${item.category}`;
|
|
118
|
+
span.contentEditable = "false";
|
|
119
|
+
span.dataset.mentionId = item.id;
|
|
120
|
+
span.dataset.mentionCategory = item.category;
|
|
121
|
+
span.dataset.mentionLabel = item.label;
|
|
122
|
+
if (item.description)
|
|
123
|
+
span.dataset.mentionDescription = item.description;
|
|
124
|
+
if (item.variables)
|
|
125
|
+
span.dataset.mentionVariables = JSON.stringify(item.variables);
|
|
126
|
+
const iconClass = item.category === "file" ? "i-ph-note-blank" : item.category === "canvas" ? "i-ph-wrench" : "i-ph-hexagon";
|
|
127
|
+
const icon = document.createElement("span");
|
|
128
|
+
icon.className = iconClass;
|
|
129
|
+
icon.setAttribute("aria-hidden", "true");
|
|
130
|
+
span.appendChild(icon);
|
|
131
|
+
span.appendChild(document.createTextNode(item.label));
|
|
132
|
+
deleteRange.insertNode(span);
|
|
133
|
+
if (needsSpaceBefore)
|
|
134
|
+
span.before(document.createTextNode(" "));
|
|
135
|
+
const space = document.createTextNode("\xA0");
|
|
136
|
+
span.after(space);
|
|
137
|
+
const newRange = document.createRange();
|
|
138
|
+
newRange.setStartAfter(space);
|
|
139
|
+
newRange.collapse(true);
|
|
140
|
+
sel.removeAllRanges();
|
|
141
|
+
sel.addRange(newRange);
|
|
142
|
+
activeTrigger.value = null;
|
|
143
|
+
lastQuery.value = "";
|
|
144
|
+
highlightedIndex.value = -1;
|
|
145
|
+
triggerTextOffset = -1;
|
|
146
|
+
onInsert?.();
|
|
147
|
+
}
|
|
148
|
+
function buildTaggedContent() {
|
|
149
|
+
if (!editorRef.value)
|
|
150
|
+
return "";
|
|
151
|
+
let accumulated = false;
|
|
152
|
+
function walkNode(node) {
|
|
153
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
154
|
+
const text = node.textContent ?? "";
|
|
155
|
+
if (text)
|
|
156
|
+
accumulated = true;
|
|
157
|
+
return text;
|
|
158
|
+
}
|
|
159
|
+
if (node.nodeName === "BR") {
|
|
160
|
+
if (node.dataset?.sentinel)
|
|
161
|
+
return "";
|
|
162
|
+
accumulated = true;
|
|
163
|
+
return "\n";
|
|
164
|
+
}
|
|
165
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
166
|
+
const el = node;
|
|
167
|
+
if (el.contentEditable === "false" && el.dataset.mentionCategory) {
|
|
168
|
+
const { mentionCategory, mentionId, mentionLabel, mentionDescription } = el.dataset;
|
|
169
|
+
if (mentionCategory === "file") {
|
|
170
|
+
const urlAttr = mentionId ? ` url="${escapeAttr(mentionId)}"` : "";
|
|
171
|
+
accumulated = true;
|
|
172
|
+
return `<file_mention name="${escapeAttr(mentionLabel ?? "")}"${urlAttr}>Foque neste arquivo espec\xEDfico na sua resposta.</file_mention>`;
|
|
173
|
+
}
|
|
174
|
+
if (mentionCategory === "canvas") {
|
|
175
|
+
const idAttr = mentionId ? ` canvas-id="${escapeAttr(mentionId)}"` : "";
|
|
176
|
+
const descAttr = mentionDescription ? ` description="${escapeAttr(mentionDescription)}"` : "";
|
|
177
|
+
const { mentionVariables } = el.dataset;
|
|
178
|
+
let variablesBlock = "";
|
|
179
|
+
if (mentionVariables) {
|
|
180
|
+
try {
|
|
181
|
+
const vars = JSON.parse(mentionVariables);
|
|
182
|
+
const varLines = Object.values(vars).map((v) => `- ${v.name} (${v.type}): ${v.description}`).join("\n");
|
|
183
|
+
variablesBlock = `
|
|
184
|
+
Vari\xE1veis obrigat\xF3rias (use EXATAMENTE estes nomes no JSON):
|
|
185
|
+
${varLines}
|
|
186
|
+
`;
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
accumulated = true;
|
|
191
|
+
return `<canvas_mention name="${escapeAttr(mentionLabel ?? "")}"${idAttr}${descAttr}>O usu\xE1rio quer usar este canvas do Tela.${variablesBlock}Invoque via Bash: bun run .claude/skills/tela/run.ts "${escapeAttr(mentionId ?? "")}" com as vari\xE1veis em JSON.</canvas_mention>`;
|
|
192
|
+
}
|
|
193
|
+
if (mentionCategory === "skill") {
|
|
194
|
+
const refAttr = mentionId ? ` ref="${escapeAttr(mentionId)}"` : "";
|
|
195
|
+
const descAttr = mentionDescription ? ` description="${escapeAttr(mentionDescription)}"` : "";
|
|
196
|
+
accumulated = true;
|
|
197
|
+
return `<skill_mention name="${escapeAttr(mentionLabel ?? "")}"${refAttr}${descAttr}>O usu\xE1rio quer usar esta skill. Invoque-a diretamente.</skill_mention>`;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
let text = "";
|
|
201
|
+
if (el.tagName === "DIV" && accumulated)
|
|
202
|
+
text += "\n";
|
|
203
|
+
for (const child of el.childNodes)
|
|
204
|
+
text += walkNode(child);
|
|
205
|
+
return text;
|
|
206
|
+
}
|
|
207
|
+
return "";
|
|
208
|
+
}
|
|
209
|
+
let result = "";
|
|
210
|
+
for (const child of editorRef.value.childNodes)
|
|
211
|
+
result += walkNode(child);
|
|
212
|
+
return result.replace(/\u00A0/g, " ");
|
|
213
|
+
}
|
|
214
|
+
function resetMentions() {
|
|
215
|
+
if (editorRef.value)
|
|
216
|
+
editorRef.value.innerHTML = "";
|
|
217
|
+
triggerTextOffset = -1;
|
|
218
|
+
activeTrigger.value = null;
|
|
219
|
+
lastQuery.value = "";
|
|
220
|
+
query.value = "";
|
|
221
|
+
}
|
|
222
|
+
function dismiss() {
|
|
223
|
+
activeTrigger.value = null;
|
|
224
|
+
lastQuery.value = "";
|
|
225
|
+
highlightedIndex.value = -1;
|
|
226
|
+
}
|
|
227
|
+
function handleKeydown(e) {
|
|
228
|
+
if (!isOpen.value)
|
|
229
|
+
return;
|
|
230
|
+
if (e.key === "Escape" || e.key === "Tab") {
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
dismiss();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const count = filteredItems.value.length;
|
|
236
|
+
if (count === 0)
|
|
237
|
+
return;
|
|
238
|
+
if (e.key === "ArrowDown") {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
highlightedIndex.value = (highlightedIndex.value + 1) % count;
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (e.key === "ArrowUp") {
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
highlightedIndex.value = highlightedIndex.value <= 0 ? count - 1 : highlightedIndex.value - 1;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (e.key === "Enter") {
|
|
249
|
+
const item = filteredItems.value[highlightedIndex.value];
|
|
250
|
+
if (item) {
|
|
251
|
+
e.preventDefault();
|
|
252
|
+
selectItem(item);
|
|
253
|
+
} else {
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
dismiss();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return reactive({
|
|
260
|
+
isOpen,
|
|
261
|
+
activeTrigger: readonly(activeTrigger),
|
|
262
|
+
query: readonly(query),
|
|
263
|
+
filteredItems,
|
|
264
|
+
highlightedIndex,
|
|
265
|
+
handleKeydown,
|
|
266
|
+
selectItem,
|
|
267
|
+
dismiss,
|
|
268
|
+
detectTrigger,
|
|
269
|
+
buildTaggedContent,
|
|
270
|
+
resetMentions
|
|
271
|
+
});
|
|
272
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { renderMermaidSVG } from "beautiful-mermaid";
|
|
2
|
+
let mermaidLoader = null;
|
|
3
|
+
async function loadMermaid() {
|
|
4
|
+
if (!mermaidLoader) {
|
|
5
|
+
mermaidLoader = import("mermaid").then(({ default: mermaid }) => {
|
|
6
|
+
mermaid.initialize({
|
|
7
|
+
startOnLoad: false,
|
|
8
|
+
securityLevel: "strict",
|
|
9
|
+
theme: "base",
|
|
10
|
+
fontFamily: 'Inter, "Inter Fallback: Arial", sans-serif',
|
|
11
|
+
themeVariables: {
|
|
12
|
+
primaryColor: "#f8fafc",
|
|
13
|
+
primaryTextColor: "#18181b",
|
|
14
|
+
primaryBorderColor: "#d1d5db",
|
|
15
|
+
lineColor: "#64748b",
|
|
16
|
+
secondaryColor: "#eff6ff",
|
|
17
|
+
tertiaryColor: "#ffffff",
|
|
18
|
+
background: "#ffffff",
|
|
19
|
+
mainBkg: "#f8fafc",
|
|
20
|
+
secondBkg: "#eff6ff",
|
|
21
|
+
tertiaryBkg: "#ffffff",
|
|
22
|
+
textColor: "#18181b",
|
|
23
|
+
edgeLabelBackground: "#ffffff",
|
|
24
|
+
clusterBkg: "#f8fafc",
|
|
25
|
+
clusterBorder: "#d1d5db",
|
|
26
|
+
actorBkg: "#f8fafc",
|
|
27
|
+
actorBorder: "#d1d5db",
|
|
28
|
+
actorTextColor: "#18181b",
|
|
29
|
+
labelBoxBkgColor: "#ffffff",
|
|
30
|
+
labelBoxBorderColor: "#d1d5db",
|
|
31
|
+
cScale0: "#dbeafe",
|
|
32
|
+
cScale1: "#bfdbfe",
|
|
33
|
+
cScale2: "#93c5fd",
|
|
34
|
+
cScale3: "#60a5fa",
|
|
35
|
+
cScale4: "#3b82f6",
|
|
36
|
+
pie1: "#2563eb",
|
|
37
|
+
pie2: "#60a5fa",
|
|
38
|
+
pie3: "#93c5fd",
|
|
39
|
+
pie4: "#bfdbfe",
|
|
40
|
+
pie5: "#dbeafe"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return mermaid;
|
|
44
|
+
}).catch((err) => {
|
|
45
|
+
mermaidLoader = null;
|
|
46
|
+
throw err;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return mermaidLoader;
|
|
50
|
+
}
|
|
51
|
+
export function useMermaidRenderer(diagramSource, svgContainerRef) {
|
|
52
|
+
const instance = getCurrentInstance();
|
|
53
|
+
const renderIdBase = `mermaid-diagram-${instance?.uid ?? Math.random().toString(36).slice(2)}`;
|
|
54
|
+
const fallbackSvg = ref("");
|
|
55
|
+
const fallbackError = ref(null);
|
|
56
|
+
const isFallbackRendering = ref(false);
|
|
57
|
+
const beautifulResult = computed(() => {
|
|
58
|
+
if (!diagramSource.value) {
|
|
59
|
+
return { svg: "", error: null };
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
return {
|
|
63
|
+
svg: renderMermaidSVG(diagramSource.value, {
|
|
64
|
+
bg: "var(--mermaid-bg, #ffffff)",
|
|
65
|
+
fg: "var(--mermaid-fg, #18181b)",
|
|
66
|
+
line: "var(--mermaid-line, #64748b)",
|
|
67
|
+
accent: "var(--mermaid-accent, #2563eb)",
|
|
68
|
+
muted: "var(--mermaid-muted, #6b7280)",
|
|
69
|
+
surface: "var(--mermaid-surface, #f8fafc)",
|
|
70
|
+
border: "var(--mermaid-border, #d1d5db)",
|
|
71
|
+
font: 'Inter, "Inter Fallback: Arial", sans-serif',
|
|
72
|
+
padding: 24,
|
|
73
|
+
transparent: true,
|
|
74
|
+
interactive: true
|
|
75
|
+
}),
|
|
76
|
+
error: null
|
|
77
|
+
};
|
|
78
|
+
} catch (error) {
|
|
79
|
+
return {
|
|
80
|
+
svg: "",
|
|
81
|
+
error: error instanceof Error ? error.message : String(error)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const renderedSvg = computed(() => beautifulResult.value.svg || fallbackSvg.value);
|
|
86
|
+
const renderedError = computed(() => {
|
|
87
|
+
if (renderedSvg.value || isFallbackRendering.value) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return fallbackError.value ?? beautifulResult.value.error;
|
|
91
|
+
});
|
|
92
|
+
watch(diagramSource, async (source) => {
|
|
93
|
+
fallbackSvg.value = "";
|
|
94
|
+
fallbackError.value = null;
|
|
95
|
+
isFallbackRendering.value = false;
|
|
96
|
+
if (!source || beautifulResult.value.svg || !beautifulResult.value.error || !import.meta.client) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
isFallbackRendering.value = true;
|
|
100
|
+
try {
|
|
101
|
+
const mermaid = await loadMermaid();
|
|
102
|
+
const renderId = `${renderIdBase}-${Date.now()}`;
|
|
103
|
+
const { svg, bindFunctions } = await mermaid.render(renderId, source);
|
|
104
|
+
fallbackSvg.value = svg;
|
|
105
|
+
fallbackError.value = null;
|
|
106
|
+
await nextTick();
|
|
107
|
+
if (svgContainerRef.value && typeof bindFunctions === "function") {
|
|
108
|
+
bindFunctions(svgContainerRef.value);
|
|
109
|
+
}
|
|
110
|
+
} catch (error) {
|
|
111
|
+
fallbackError.value = error instanceof Error ? error.message : String(error);
|
|
112
|
+
} finally {
|
|
113
|
+
isFallbackRendering.value = false;
|
|
114
|
+
}
|
|
115
|
+
}, { immediate: true });
|
|
116
|
+
return {
|
|
117
|
+
renderedSvg,
|
|
118
|
+
renderedError,
|
|
119
|
+
isFallbackRendering
|
|
120
|
+
};
|
|
121
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
|
2
|
+
export interface PdfState {
|
|
3
|
+
pdfDoc: PDFDocumentProxy | null;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
loadError: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface RenderPageOptions {
|
|
9
|
+
pageNum: number;
|
|
10
|
+
canvas: HTMLCanvasElement;
|
|
11
|
+
textLayer?: HTMLDivElement | null;
|
|
12
|
+
scale: number;
|
|
13
|
+
highlight?: string | null;
|
|
14
|
+
highlightPage?: number | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function usePdf(url: Ref<string>): {
|
|
17
|
+
state: any;
|
|
18
|
+
loadPdf: () => Promise<PDFDocumentProxy | null>;
|
|
19
|
+
renderPage: (options: RenderPageOptions) => Promise<void>;
|
|
20
|
+
cleanup: () => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/nuxt";
|
|
2
|
+
import * as pdfjsLib from "pdfjs-dist";
|
|
3
|
+
import { markRaw } from "vue";
|
|
4
|
+
pdfjsLib.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjsLib.version}/build/pdf.worker.min.mjs`;
|
|
5
|
+
export function usePdf(url) {
|
|
6
|
+
const state = reactive({
|
|
7
|
+
pdfDoc: null,
|
|
8
|
+
totalPages: 0,
|
|
9
|
+
isLoading: true,
|
|
10
|
+
loadError: null
|
|
11
|
+
});
|
|
12
|
+
let isUnmounted = false;
|
|
13
|
+
async function loadPdf() {
|
|
14
|
+
if (isUnmounted)
|
|
15
|
+
return null;
|
|
16
|
+
state.isLoading = true;
|
|
17
|
+
state.loadError = null;
|
|
18
|
+
try {
|
|
19
|
+
const loadingTask = pdfjsLib.getDocument(url.value);
|
|
20
|
+
const doc = await loadingTask.promise;
|
|
21
|
+
if (isUnmounted) {
|
|
22
|
+
doc.destroy();
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
state.pdfDoc = markRaw(doc);
|
|
26
|
+
state.totalPages = doc.numPages;
|
|
27
|
+
state.isLoading = false;
|
|
28
|
+
return doc;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
if (isUnmounted)
|
|
31
|
+
return null;
|
|
32
|
+
Sentry.captureException(err);
|
|
33
|
+
state.loadError = `Falha ao carregar o PDF: ${err?.message || "Erro desconhecido"}`;
|
|
34
|
+
state.isLoading = false;
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function renderPage(options) {
|
|
39
|
+
if (isUnmounted || !state.pdfDoc)
|
|
40
|
+
return;
|
|
41
|
+
const { pageNum, canvas, textLayer, scale, highlight, highlightPage } = options;
|
|
42
|
+
try {
|
|
43
|
+
const page = await state.pdfDoc.getPage(pageNum);
|
|
44
|
+
if (isUnmounted)
|
|
45
|
+
return;
|
|
46
|
+
const viewport = page.getViewport({ scale });
|
|
47
|
+
const context = canvas.getContext("2d");
|
|
48
|
+
if (!context)
|
|
49
|
+
return;
|
|
50
|
+
canvas.height = viewport.height;
|
|
51
|
+
canvas.width = viewport.width;
|
|
52
|
+
await page.render({
|
|
53
|
+
canvasContext: context,
|
|
54
|
+
viewport,
|
|
55
|
+
canvas
|
|
56
|
+
}).promise;
|
|
57
|
+
if (isUnmounted)
|
|
58
|
+
return;
|
|
59
|
+
if (textLayer) {
|
|
60
|
+
await renderTextLayer(page, viewport, textLayer, highlight, highlightPage, pageNum);
|
|
61
|
+
}
|
|
62
|
+
} catch (err) {
|
|
63
|
+
if (!isUnmounted) {
|
|
64
|
+
Sentry.captureException(err);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async function renderTextLayer(page, viewport, textLayer, highlight, highlightPage, pageNum) {
|
|
69
|
+
if (isUnmounted)
|
|
70
|
+
return;
|
|
71
|
+
textLayer.innerHTML = "";
|
|
72
|
+
textLayer.style.width = `${viewport.width}px`;
|
|
73
|
+
textLayer.style.height = `${viewport.height}px`;
|
|
74
|
+
const textContent = await page.getTextContent();
|
|
75
|
+
if (isUnmounted)
|
|
76
|
+
return;
|
|
77
|
+
const textItems = textContent.items;
|
|
78
|
+
const searchWords = [];
|
|
79
|
+
const shouldHighlight = highlight && (!highlightPage || highlightPage === pageNum);
|
|
80
|
+
if (shouldHighlight && highlight) {
|
|
81
|
+
const normalized = highlight.toLowerCase().normalize("NFD").replace(/[\u0300-\u036F]/g, "").replace(/[^\w\s]/g, " ").trim();
|
|
82
|
+
normalized.split(/\s+/).forEach((word) => {
|
|
83
|
+
if (word.length >= 3) {
|
|
84
|
+
searchWords.push(word);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (normalized.length >= 3) {
|
|
88
|
+
searchWords.push(normalized);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const item of textItems) {
|
|
92
|
+
if (isUnmounted)
|
|
93
|
+
return;
|
|
94
|
+
const div = document.createElement("span");
|
|
95
|
+
const tx = pdfjsLib.Util.transform(viewport.transform, item.transform);
|
|
96
|
+
div.textContent = item.str;
|
|
97
|
+
div.style.position = "absolute";
|
|
98
|
+
div.style.left = `${tx[4]}px`;
|
|
99
|
+
div.style.top = `${tx[5] - item.height}px`;
|
|
100
|
+
div.style.fontSize = `${Math.abs(tx[0])}px`;
|
|
101
|
+
div.style.fontFamily = "sans-serif";
|
|
102
|
+
div.style.color = "transparent";
|
|
103
|
+
div.style.whiteSpace = "nowrap";
|
|
104
|
+
if (searchWords.length > 0 && item.str.trim()) {
|
|
105
|
+
const itemText = item.str.toLowerCase().normalize("NFD").replace(/[\u0300-\u036F]/g, "").trim();
|
|
106
|
+
if (itemText.length >= 2) {
|
|
107
|
+
const isMatch = searchWords.some((word) => {
|
|
108
|
+
return word.includes(itemText) || itemText.includes(word);
|
|
109
|
+
});
|
|
110
|
+
if (isMatch) {
|
|
111
|
+
div.style.backgroundColor = "rgba(255, 235, 59, 0.7)";
|
|
112
|
+
div.style.borderRadius = "2px";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
textLayer.appendChild(div);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function cleanup() {
|
|
120
|
+
isUnmounted = true;
|
|
121
|
+
if (state.pdfDoc) {
|
|
122
|
+
state.pdfDoc.destroy();
|
|
123
|
+
state.pdfDoc = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
watch(url, () => {
|
|
127
|
+
loadPdf();
|
|
128
|
+
});
|
|
129
|
+
onUnmounted(() => {
|
|
130
|
+
cleanup();
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
state,
|
|
134
|
+
loadPdf,
|
|
135
|
+
renderPage,
|
|
136
|
+
cleanup
|
|
137
|
+
};
|
|
138
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function usePolling({ callback, interval, stopCondition, onFinish, }: {
|
|
2
|
+
callback: () => Promise<void>;
|
|
3
|
+
interval: MaybeRef<number>;
|
|
4
|
+
stopCondition: Ref<boolean>;
|
|
5
|
+
onFinish?: () => void;
|
|
6
|
+
}): {
|
|
7
|
+
isPolling: Readonly<import("vue").ShallowRef<boolean>>;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
start: () => void;
|
|
10
|
+
resume: import("@vueuse/core").Fn;
|
|
11
|
+
waitForResult: () => Promise<void>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useIntervalFn } from "@vueuse/core";
|
|
2
|
+
export function usePolling({
|
|
3
|
+
callback,
|
|
4
|
+
interval,
|
|
5
|
+
stopCondition,
|
|
6
|
+
onFinish
|
|
7
|
+
}) {
|
|
8
|
+
let isRunning = false;
|
|
9
|
+
let hasFinished = false;
|
|
10
|
+
const { isActive, resume, pause } = useIntervalFn(async () => {
|
|
11
|
+
if (isRunning)
|
|
12
|
+
return;
|
|
13
|
+
if (stopCondition.value) {
|
|
14
|
+
if (!hasFinished) {
|
|
15
|
+
hasFinished = true;
|
|
16
|
+
pause();
|
|
17
|
+
onFinish?.();
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
isRunning = true;
|
|
22
|
+
await callback();
|
|
23
|
+
isRunning = false;
|
|
24
|
+
}, interval, { immediate: false });
|
|
25
|
+
function stop() {
|
|
26
|
+
if (!hasFinished) {
|
|
27
|
+
hasFinished = true;
|
|
28
|
+
pause();
|
|
29
|
+
onFinish?.();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function start() {
|
|
33
|
+
hasFinished = false;
|
|
34
|
+
isRunning = false;
|
|
35
|
+
resume();
|
|
36
|
+
}
|
|
37
|
+
const waitForResult = () => new Promise((resolve) => {
|
|
38
|
+
if (stopCondition.value) {
|
|
39
|
+
return resolve();
|
|
40
|
+
}
|
|
41
|
+
const unwatch = watchEffect(() => {
|
|
42
|
+
if (stopCondition.value) {
|
|
43
|
+
unwatch();
|
|
44
|
+
resolve();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
isPolling: isActive,
|
|
50
|
+
stop,
|
|
51
|
+
start,
|
|
52
|
+
resume,
|
|
53
|
+
waitForResult
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DEFAULT_MODEL } from "../types/chat.js";
|
|
2
|
+
export function useSelectedModel(conversation) {
|
|
3
|
+
const chatApi = useChatApi();
|
|
4
|
+
const statusToast = useStatusToast();
|
|
5
|
+
const override = ref(null);
|
|
6
|
+
let requestSeq = 0;
|
|
7
|
+
if (conversation) {
|
|
8
|
+
watch(() => conversation.value?.id, () => {
|
|
9
|
+
override.value = null;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const model = computed({
|
|
13
|
+
get() {
|
|
14
|
+
if (override.value) {
|
|
15
|
+
return override.value;
|
|
16
|
+
}
|
|
17
|
+
if (conversation?.value?.model) {
|
|
18
|
+
return conversation.value.model;
|
|
19
|
+
}
|
|
20
|
+
return DEFAULT_MODEL;
|
|
21
|
+
},
|
|
22
|
+
set(value) {
|
|
23
|
+
const previous = override.value;
|
|
24
|
+
override.value = value;
|
|
25
|
+
if (conversation?.value?.id) {
|
|
26
|
+
const seq = ++requestSeq;
|
|
27
|
+
$fetch(
|
|
28
|
+
chatApi.path(`/conversations/${conversation.value.id}`),
|
|
29
|
+
chatApi.withChatHeaders({
|
|
30
|
+
method: "PATCH",
|
|
31
|
+
body: { model: value }
|
|
32
|
+
})
|
|
33
|
+
).catch(() => {
|
|
34
|
+
if (seq !== requestSeq)
|
|
35
|
+
return;
|
|
36
|
+
override.value = previous;
|
|
37
|
+
statusToast.update({
|
|
38
|
+
text: "Erro ao salvar modelo selecionado",
|
|
39
|
+
icon: "i-ph-warning"
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return model;
|
|
46
|
+
}
|