@sveda-ai/vue 0.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.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/appearance.d.ts +52 -0
- package/dist/appearance.d.ts.map +1 -0
- package/dist/components/chat/AnimatedStreamBlock.vue.d.ts +16 -0
- package/dist/components/chat/AnimatedStreamBlock.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatHistoryDropdown.vue.d.ts +17 -0
- package/dist/components/chat/ChatHistoryDropdown.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatInput.vue.d.ts +30 -0
- package/dist/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageActivityBlock.vue.d.ts +13 -0
- package/dist/components/chat/ChatMessageActivityBlock.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageItem.vue.d.ts +15 -0
- package/dist/components/chat/ChatMessageItem.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatMessageList.vue.d.ts +31 -0
- package/dist/components/chat/ChatMessageList.vue.d.ts.map +1 -0
- package/dist/components/chat/ChatPendingIndicator.vue.d.ts +12 -0
- package/dist/components/chat/ChatPendingIndicator.vue.d.ts.map +1 -0
- package/dist/components/chat/ReasoningStream.vue.d.ts +11 -0
- package/dist/components/chat/ReasoningStream.vue.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +9 -0
- package/dist/components/chat/index.d.ts.map +1 -0
- package/dist/components/shell/SvedaAgentCompletedNotice.vue.d.ts +9 -0
- package/dist/components/shell/SvedaAgentCompletedNotice.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaAgentTasksPanel.vue.d.ts +12 -0
- package/dist/components/shell/SvedaAgentTasksPanel.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaChat.vue.d.ts +22 -0
- package/dist/components/shell/SvedaChat.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaContextUsageBar.vue.d.ts +10 -0
- package/dist/components/shell/SvedaContextUsageBar.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaHistorySheet.vue.d.ts +15 -0
- package/dist/components/shell/SvedaHistorySheet.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaHistorySidebar.vue.d.ts +15 -0
- package/dist/components/shell/SvedaHistorySidebar.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaInputSection.vue.d.ts +25 -0
- package/dist/components/shell/SvedaInputSection.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaLandingView.vue.d.ts +40 -0
- package/dist/components/shell/SvedaLandingView.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaMaxStepsNotice.vue.d.ts +13 -0
- package/dist/components/shell/SvedaMaxStepsNotice.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaMinimizedTrigger.vue.d.ts +15 -0
- package/dist/components/shell/SvedaMinimizedTrigger.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaModelControls.vue.d.ts +12 -0
- package/dist/components/shell/SvedaModelControls.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaModelSelect.vue.d.ts +10 -0
- package/dist/components/shell/SvedaModelSelect.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaQuickPrompts.vue.d.ts +13 -0
- package/dist/components/shell/SvedaQuickPrompts.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaResizeHandles.vue.d.ts +11 -0
- package/dist/components/shell/SvedaResizeHandles.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaTabs.vue.d.ts +17 -0
- package/dist/components/shell/SvedaTabs.vue.d.ts.map +1 -0
- package/dist/components/shell/SvedaToolbar.vue.d.ts +33 -0
- package/dist/components/shell/SvedaToolbar.vue.d.ts.map +1 -0
- package/dist/composables/useSvedaAgentTasks.d.ts +57 -0
- package/dist/composables/useSvedaAgentTasks.d.ts.map +1 -0
- package/dist/composables/useSvedaBootstrap.d.ts +18 -0
- package/dist/composables/useSvedaBootstrap.d.ts.map +1 -0
- package/dist/composables/useSvedaChat.d.ts +264 -0
- package/dist/composables/useSvedaChat.d.ts.map +1 -0
- package/dist/composables/useSvedaChatLayout.d.ts +39 -0
- package/dist/composables/useSvedaChatLayout.d.ts.map +1 -0
- package/dist/composables/useSvedaChatPage.d.ts +309 -0
- package/dist/composables/useSvedaChatPage.d.ts.map +1 -0
- package/dist/composables/useSvedaContextWindow.d.ts +10 -0
- package/dist/composables/useSvedaContextWindow.d.ts.map +1 -0
- package/dist/composables/useSvedaDocuments.d.ts +20 -0
- package/dist/composables/useSvedaDocuments.d.ts.map +1 -0
- package/dist/composables/useSvedaMaxStepsContinue.d.ts +12 -0
- package/dist/composables/useSvedaMaxStepsContinue.d.ts.map +1 -0
- package/dist/composables/useSvedaMessaging.d.ts +55 -0
- package/dist/composables/useSvedaMessaging.d.ts.map +1 -0
- package/dist/composables/useSvedaModel.d.ts +16 -0
- package/dist/composables/useSvedaModel.d.ts.map +1 -0
- package/dist/composables/useSvedaPrompts.d.ts +18 -0
- package/dist/composables/useSvedaPrompts.d.ts.map +1 -0
- package/dist/composables/useSvedaReadable.d.ts +3 -0
- package/dist/composables/useSvedaReadable.d.ts.map +1 -0
- package/dist/composables/useSvedaScroll.d.ts +19 -0
- package/dist/composables/useSvedaScroll.d.ts.map +1 -0
- package/dist/composables/useSvedaShell.d.ts +29 -0
- package/dist/composables/useSvedaShell.d.ts.map +1 -0
- package/dist/composables/useSvedaStreaming.d.ts +46 -0
- package/dist/composables/useSvedaStreaming.d.ts.map +1 -0
- package/dist/composables/useSvedaTool.d.ts +4 -0
- package/dist/composables/useSvedaTool.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +18 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6612 -0
- package/dist/launcherIcons.d.ts +5 -0
- package/dist/launcherIcons.d.ts.map +1 -0
- package/dist/lib/assistantMessage.d.ts +89 -0
- package/dist/lib/assistantMessage.d.ts.map +1 -0
- package/dist/lib/chatHistoryMerge.d.ts +20 -0
- package/dist/lib/chatHistoryMerge.d.ts.map +1 -0
- package/dist/lib/chatI18nKeys.d.ts +2 -0
- package/dist/lib/chatI18nKeys.d.ts.map +1 -0
- package/dist/lib/chatMessageVisibility.d.ts +4 -0
- package/dist/lib/chatMessageVisibility.d.ts.map +1 -0
- package/dist/lib/chatTabs.d.ts +9 -0
- package/dist/lib/chatTabs.d.ts.map +1 -0
- package/dist/lib/chatTitle.d.ts +3 -0
- package/dist/lib/chatTitle.d.ts.map +1 -0
- package/dist/lib/chatUiStorage.d.ts +4 -0
- package/dist/lib/chatUiStorage.d.ts.map +1 -0
- package/dist/lib/finalizeMessages.d.ts +21 -0
- package/dist/lib/finalizeMessages.d.ts.map +1 -0
- package/dist/lib/markdown.d.ts +8 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/modelLabels.d.ts +3 -0
- package/dist/lib/modelLabels.d.ts.map +1 -0
- package/dist/lib/pendingStatusRotation.d.ts +3 -0
- package/dist/lib/pendingStatusRotation.d.ts.map +1 -0
- package/dist/lib/useAnimatedText.d.ts +8 -0
- package/dist/lib/useAnimatedText.d.ts.map +1 -0
- package/dist/lib/userMessage.d.ts +17 -0
- package/dist/lib/userMessage.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/plugin.d.ts +64 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/styles.css +5 -0
- package/dist/ui/alert-dialog/AlertDialog.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialog.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogAction.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogAction.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogCancel.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogCancel.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogContent.vue.d.ts +32 -0
- package/dist/ui/alert-dialog/AlertDialogContent.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogDescription.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogDescription.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogFooter.vue.d.ts +17 -0
- package/dist/ui/alert-dialog/AlertDialogFooter.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogHeader.vue.d.ts +17 -0
- package/dist/ui/alert-dialog/AlertDialogHeader.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogTitle.vue.d.ts +18 -0
- package/dist/ui/alert-dialog/AlertDialogTitle.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/AlertDialogTrigger.vue.d.ts +14 -0
- package/dist/ui/alert-dialog/AlertDialogTrigger.vue.d.ts.map +1 -0
- package/dist/ui/alert-dialog/index.d.ts +10 -0
- package/dist/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/ui/badge/Badge.vue.d.ts +19 -0
- package/dist/ui/badge/Badge.vue.d.ts.map +1 -0
- package/dist/ui/badge/index.d.ts +7 -0
- package/dist/ui/badge/index.d.ts.map +1 -0
- package/dist/ui/button/Button.vue.d.ts +23 -0
- package/dist/ui/button/Button.vue.d.ts.map +1 -0
- package/dist/ui/button/index.d.ts +9 -0
- package/dist/ui/button/index.d.ts.map +1 -0
- package/dist/ui/card/Card.vue.d.ts +17 -0
- package/dist/ui/card/Card.vue.d.ts.map +1 -0
- package/dist/ui/card/CardContent.vue.d.ts +17 -0
- package/dist/ui/card/CardContent.vue.d.ts.map +1 -0
- package/dist/ui/card/CardDescription.vue.d.ts +17 -0
- package/dist/ui/card/CardDescription.vue.d.ts.map +1 -0
- package/dist/ui/card/CardFooter.vue.d.ts +17 -0
- package/dist/ui/card/CardFooter.vue.d.ts.map +1 -0
- package/dist/ui/card/CardHeader.vue.d.ts +17 -0
- package/dist/ui/card/CardHeader.vue.d.ts.map +1 -0
- package/dist/ui/card/CardTitle.vue.d.ts +17 -0
- package/dist/ui/card/CardTitle.vue.d.ts.map +1 -0
- package/dist/ui/card/index.d.ts +7 -0
- package/dist/ui/card/index.d.ts.map +1 -0
- package/dist/ui/checkbox/Checkbox.vue.d.ts +30 -0
- package/dist/ui/checkbox/Checkbox.vue.d.ts.map +1 -0
- package/dist/ui/checkbox/index.d.ts +2 -0
- package/dist/ui/checkbox/index.d.ts.map +1 -0
- package/dist/ui/dialog/Dialog.vue.d.ts +18 -0
- package/dist/ui/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogClose.vue.d.ts +14 -0
- package/dist/ui/dialog/DialogClose.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogContent.vue.d.ts +32 -0
- package/dist/ui/dialog/DialogContent.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogDescription.vue.d.ts +18 -0
- package/dist/ui/dialog/DialogDescription.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogFooter.vue.d.ts +17 -0
- package/dist/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogHeader.vue.d.ts +17 -0
- package/dist/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogScrollContent.vue.d.ts +32 -0
- package/dist/ui/dialog/DialogScrollContent.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogTitle.vue.d.ts +18 -0
- package/dist/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
- package/dist/ui/dialog/DialogTrigger.vue.d.ts +14 -0
- package/dist/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dialog/index.d.ts +10 -0
- package/dist/ui/dialog/index.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenu.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +24 -0
- package/dist/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +32 -0
- package/dist/ui/dropdown-menu/DropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +14 -0
- package/dist/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +19 -0
- package/dist/ui/dropdown-menu/DropdownMenuItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +19 -0
- package/dist/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +22 -0
- package/dist/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +8 -0
- package/dist/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +17 -0
- package/dist/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuSub.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +34 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +18 -0
- package/dist/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +14 -0
- package/dist/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/index.d.ts +16 -0
- package/dist/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/ui/input/Input.vue.d.ts +13 -0
- package/dist/ui/input/Input.vue.d.ts.map +1 -0
- package/dist/ui/input/index.d.ts +2 -0
- package/dist/ui/input/index.d.ts.map +1 -0
- package/dist/ui/label/Label.vue.d.ts +18 -0
- package/dist/ui/label/Label.vue.d.ts.map +1 -0
- package/dist/ui/label/index.d.ts +2 -0
- package/dist/ui/label/index.d.ts.map +1 -0
- package/dist/ui/responsive-dialog/ResponsiveDialog.vue.d.ts +32 -0
- package/dist/ui/responsive-dialog/ResponsiveDialog.vue.d.ts.map +1 -0
- package/dist/ui/responsive-dialog/index.d.ts +2 -0
- package/dist/ui/responsive-dialog/index.d.ts.map +1 -0
- package/dist/ui/scroll-area/ScrollArea.vue.d.ts +18 -0
- package/dist/ui/scroll-area/ScrollArea.vue.d.ts.map +1 -0
- package/dist/ui/scroll-area/ScrollBar.vue.d.ts +10 -0
- package/dist/ui/scroll-area/ScrollBar.vue.d.ts.map +1 -0
- package/dist/ui/scroll-area/index.d.ts +3 -0
- package/dist/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/ui/select/Select.vue.d.ts +21 -0
- package/dist/ui/select/Select.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectContent.vue.d.ts +28 -0
- package/dist/ui/select/SelectContent.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/ui/select/SelectGroup.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectItem.vue.d.ts +18 -0
- package/dist/ui/select/SelectItem.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectItemText.vue.d.ts +14 -0
- package/dist/ui/select/SelectItemText.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectLabel.vue.d.ts +18 -0
- package/dist/ui/select/SelectLabel.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectScrollDownButton.vue.d.ts +18 -0
- package/dist/ui/select/SelectScrollDownButton.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectScrollUpButton.vue.d.ts +18 -0
- package/dist/ui/select/SelectScrollUpButton.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectSeparator.vue.d.ts +8 -0
- package/dist/ui/select/SelectSeparator.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectTrigger.vue.d.ts +18 -0
- package/dist/ui/select/SelectTrigger.vue.d.ts.map +1 -0
- package/dist/ui/select/SelectValue.vue.d.ts +14 -0
- package/dist/ui/select/SelectValue.vue.d.ts.map +1 -0
- package/dist/ui/select/index.d.ts +12 -0
- package/dist/ui/select/index.d.ts.map +1 -0
- package/dist/ui/sheet/Sheet.vue.d.ts +18 -0
- package/dist/ui/sheet/Sheet.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetClose.vue.d.ts +14 -0
- package/dist/ui/sheet/SheetClose.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetContent.vue.d.ts +34 -0
- package/dist/ui/sheet/SheetContent.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetDescription.vue.d.ts +18 -0
- package/dist/ui/sheet/SheetDescription.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetFooter.vue.d.ts +17 -0
- package/dist/ui/sheet/SheetFooter.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetHeader.vue.d.ts +17 -0
- package/dist/ui/sheet/SheetHeader.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetTitle.vue.d.ts +18 -0
- package/dist/ui/sheet/SheetTitle.vue.d.ts.map +1 -0
- package/dist/ui/sheet/SheetTrigger.vue.d.ts +14 -0
- package/dist/ui/sheet/SheetTrigger.vue.d.ts.map +1 -0
- package/dist/ui/sheet/index.d.ts +14 -0
- package/dist/ui/sheet/index.d.ts.map +1 -0
- package/dist/ui/switch/Switch.vue.d.ts +23 -0
- package/dist/ui/switch/Switch.vue.d.ts.map +1 -0
- package/dist/ui/switch/index.d.ts +2 -0
- package/dist/ui/switch/index.d.ts.map +1 -0
- package/dist/ui/textarea/Textarea.vue.d.ts +13 -0
- package/dist/ui/textarea/Textarea.vue.d.ts.map +1 -0
- package/dist/ui/textarea/index.d.ts +2 -0
- package/dist/ui/textarea/index.d.ts.map +1 -0
- package/dist/ui/toast/Toast.vue.d.ts +96 -0
- package/dist/ui/toast/Toast.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastAction.vue.d.ts +18 -0
- package/dist/ui/toast/ToastAction.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastClose.vue.d.ts +8 -0
- package/dist/ui/toast/ToastClose.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastDescription.vue.d.ts +18 -0
- package/dist/ui/toast/ToastDescription.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastProvider.vue.d.ts +14 -0
- package/dist/ui/toast/ToastProvider.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastTitle.vue.d.ts +18 -0
- package/dist/ui/toast/ToastTitle.vue.d.ts.map +1 -0
- package/dist/ui/toast/ToastViewport.vue.d.ts +8 -0
- package/dist/ui/toast/ToastViewport.vue.d.ts.map +1 -0
- package/dist/ui/toast/Toaster.vue.d.ts +3 -0
- package/dist/ui/toast/Toaster.vue.d.ts.map +1 -0
- package/dist/ui/toast/index.d.ts +23 -0
- package/dist/ui/toast/index.d.ts.map +1 -0
- package/dist/ui/toast/use-toast.d.ts +23 -0
- package/dist/ui/toast/use-toast.d.ts.map +1 -0
- package/dist/ui/tooltip/Tooltip.vue.d.ts +18 -0
- package/dist/ui/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipContent.vue.d.ts +26 -0
- package/dist/ui/tooltip/TooltipContent.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipProvider.vue.d.ts +14 -0
- package/dist/ui/tooltip/TooltipProvider.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/TooltipTrigger.vue.d.ts +14 -0
- package/dist/ui/tooltip/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/ui/tooltip/index.d.ts +5 -0
- package/dist/ui/tooltip/index.d.ts.map +1 -0
- package/dist/ui/utils.d.ts +2 -0
- package/dist/ui/utils.d.ts.map +1 -0
- package/dist/vue.css +1 -0
- package/package.json +64 -0
- package/src/appearance.ts +568 -0
- package/src/components/chat/AnimatedStreamBlock.vue +94 -0
- package/src/components/chat/ChatHistoryDropdown.vue +226 -0
- package/src/components/chat/ChatInput.vue +571 -0
- package/src/components/chat/ChatMessageActivityBlock.vue +447 -0
- package/src/components/chat/ChatMessageItem.vue +357 -0
- package/src/components/chat/ChatMessageList.vue +178 -0
- package/src/components/chat/ChatPendingIndicator.vue +163 -0
- package/src/components/chat/ReasoningStream.vue +112 -0
- package/src/components/chat/index.ts +8 -0
- package/src/components/shell/SvedaAgentCompletedNotice.vue +25 -0
- package/src/components/shell/SvedaAgentTasksPanel.vue +146 -0
- package/src/components/shell/SvedaChat.vue +514 -0
- package/src/components/shell/SvedaContextUsageBar.vue +33 -0
- package/src/components/shell/SvedaHistorySheet.vue +52 -0
- package/src/components/shell/SvedaHistorySidebar.vue +41 -0
- package/src/components/shell/SvedaInputSection.vue +53 -0
- package/src/components/shell/SvedaLandingView.vue +93 -0
- package/src/components/shell/SvedaMaxStepsNotice.vue +33 -0
- package/src/components/shell/SvedaMinimizedTrigger.vue +43 -0
- package/src/components/shell/SvedaModelControls.vue +47 -0
- package/src/components/shell/SvedaModelSelect.vue +32 -0
- package/src/components/shell/SvedaQuickPrompts.vue +44 -0
- package/src/components/shell/SvedaResizeHandles.vue +31 -0
- package/src/components/shell/SvedaTabs.vue +123 -0
- package/src/components/shell/SvedaToolbar.vue +171 -0
- package/src/composables/useSvedaAgentTasks.ts +93 -0
- package/src/composables/useSvedaBootstrap.ts +36 -0
- package/src/composables/useSvedaChat.ts +593 -0
- package/src/composables/useSvedaChatLayout.ts +539 -0
- package/src/composables/useSvedaChatPage.ts +339 -0
- package/src/composables/useSvedaContextWindow.ts +31 -0
- package/src/composables/useSvedaDocuments.ts +115 -0
- package/src/composables/useSvedaMaxStepsContinue.ts +68 -0
- package/src/composables/useSvedaMessaging.ts +99 -0
- package/src/composables/useSvedaModel.ts +85 -0
- package/src/composables/useSvedaPrompts.ts +59 -0
- package/src/composables/useSvedaReadable.ts +33 -0
- package/src/composables/useSvedaScroll.ts +93 -0
- package/src/composables/useSvedaShell.ts +91 -0
- package/src/composables/useSvedaStreaming.ts +408 -0
- package/src/composables/useSvedaTool.ts +18 -0
- package/src/i18n/index.ts +72 -0
- package/src/i18n/locales/en.ts +58 -0
- package/src/i18n/locales/ru.ts +59 -0
- package/src/index.ts +141 -0
- package/src/launcherIcons.ts +39 -0
- package/src/lib/assistantMessage.ts +437 -0
- package/src/lib/chatHistoryMerge.ts +93 -0
- package/src/lib/chatI18nKeys.ts +62 -0
- package/src/lib/chatMessageVisibility.ts +50 -0
- package/src/lib/chatTabs.ts +54 -0
- package/src/lib/chatTitle.ts +30 -0
- package/src/lib/chatUiStorage.ts +33 -0
- package/src/lib/finalizeMessages.ts +81 -0
- package/src/lib/markdown.ts +90 -0
- package/src/lib/modelLabels.ts +24 -0
- package/src/lib/pendingStatusRotation.ts +26 -0
- package/src/lib/shims-vue.d.ts +6 -0
- package/src/lib/useAnimatedText.ts +78 -0
- package/src/lib/userMessage.ts +55 -0
- package/src/lib/utils.ts +6 -0
- package/src/plugin.ts +164 -0
- package/src/styles.css +5 -0
- package/src/theme.css +95 -0
- package/src/theme.test.mjs +80 -0
- package/src/ui/alert-dialog/AlertDialog.vue +14 -0
- package/src/ui/alert-dialog/AlertDialogAction.vue +17 -0
- package/src/ui/alert-dialog/AlertDialogCancel.vue +24 -0
- package/src/ui/alert-dialog/AlertDialogContent.vue +39 -0
- package/src/ui/alert-dialog/AlertDialogDescription.vue +22 -0
- package/src/ui/alert-dialog/AlertDialogFooter.vue +21 -0
- package/src/ui/alert-dialog/AlertDialogHeader.vue +16 -0
- package/src/ui/alert-dialog/AlertDialogTitle.vue +19 -0
- package/src/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/ui/alert-dialog/index.ts +9 -0
- package/src/ui/badge/Badge.vue +16 -0
- package/src/ui/badge/index.ts +27 -0
- package/src/ui/button/Button.vue +56 -0
- package/src/ui/button/index.ts +50 -0
- package/src/ui/card/Card.vue +14 -0
- package/src/ui/card/CardContent.vue +14 -0
- package/src/ui/card/CardDescription.vue +14 -0
- package/src/ui/card/CardFooter.vue +14 -0
- package/src/ui/card/CardHeader.vue +14 -0
- package/src/ui/card/CardTitle.vue +14 -0
- package/src/ui/card/index.ts +6 -0
- package/src/ui/checkbox/Checkbox.vue +41 -0
- package/src/ui/checkbox/index.ts +1 -0
- package/src/ui/dialog/Dialog.vue +14 -0
- package/src/ui/dialog/DialogClose.vue +11 -0
- package/src/ui/dialog/DialogContent.vue +50 -0
- package/src/ui/dialog/DialogDescription.vue +24 -0
- package/src/ui/dialog/DialogFooter.vue +19 -0
- package/src/ui/dialog/DialogHeader.vue +16 -0
- package/src/ui/dialog/DialogScrollContent.vue +59 -0
- package/src/ui/dialog/DialogTitle.vue +29 -0
- package/src/ui/dialog/DialogTrigger.vue +11 -0
- package/src/ui/dialog/index.ts +9 -0
- package/src/ui/dropdown-menu/DropdownMenu.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +42 -0
- package/src/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/src/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/ui/dropdown-menu/DropdownMenuItem.vue +30 -0
- package/src/ui/dropdown-menu/DropdownMenuLabel.vue +21 -0
- package/src/ui/dropdown-menu/DropdownMenuRadioGroup.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuRadioItem.vue +43 -0
- package/src/ui/dropdown-menu/DropdownMenuSeparator.vue +21 -0
- package/src/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuSub.vue +14 -0
- package/src/ui/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/src/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/src/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
- package/src/ui/dropdown-menu/index.ts +16 -0
- package/src/ui/input/Input.vue +32 -0
- package/src/ui/input/index.ts +1 -0
- package/src/ui/label/Label.vue +22 -0
- package/src/ui/label/index.ts +1 -0
- package/src/ui/responsive-dialog/ResponsiveDialog.vue +55 -0
- package/src/ui/responsive-dialog/index.ts +1 -0
- package/src/ui/scroll-area/ScrollArea.vue +29 -0
- package/src/ui/scroll-area/ScrollBar.vue +30 -0
- package/src/ui/scroll-area/index.ts +2 -0
- package/src/ui/select/Select.vue +15 -0
- package/src/ui/select/SelectContent.vue +53 -0
- package/src/ui/select/SelectGroup.vue +19 -0
- package/src/ui/select/SelectItem.vue +44 -0
- package/src/ui/select/SelectItemText.vue +11 -0
- package/src/ui/select/SelectLabel.vue +13 -0
- package/src/ui/select/SelectScrollDownButton.vue +24 -0
- package/src/ui/select/SelectScrollUpButton.vue +24 -0
- package/src/ui/select/SelectSeparator.vue +17 -0
- package/src/ui/select/SelectTrigger.vue +31 -0
- package/src/ui/select/SelectValue.vue +11 -0
- package/src/ui/select/index.ts +11 -0
- package/src/ui/sheet/Sheet.vue +14 -0
- package/src/ui/sheet/SheetClose.vue +11 -0
- package/src/ui/sheet/SheetContent.vue +53 -0
- package/src/ui/sheet/SheetDescription.vue +19 -0
- package/src/ui/sheet/SheetFooter.vue +12 -0
- package/src/ui/sheet/SheetHeader.vue +12 -0
- package/src/ui/sheet/SheetTitle.vue +19 -0
- package/src/ui/sheet/SheetTrigger.vue +11 -0
- package/src/ui/sheet/index.ts +29 -0
- package/src/ui/switch/Switch.vue +55 -0
- package/src/ui/switch/index.ts +1 -0
- package/src/ui/textarea/Textarea.vue +24 -0
- package/src/ui/textarea/index.ts +1 -0
- package/src/ui/toast/Toast.vue +28 -0
- package/src/ui/toast/ToastAction.vue +19 -0
- package/src/ui/toast/ToastClose.vue +22 -0
- package/src/ui/toast/ToastDescription.vue +19 -0
- package/src/ui/toast/ToastProvider.vue +11 -0
- package/src/ui/toast/ToastTitle.vue +19 -0
- package/src/ui/toast/ToastViewport.vue +17 -0
- package/src/ui/toast/Toaster.vue +48 -0
- package/src/ui/toast/index.ts +39 -0
- package/src/ui/toast/use-toast.ts +109 -0
- package/src/ui/tooltip/Tooltip.vue +14 -0
- package/src/ui/tooltip/TooltipContent.vue +39 -0
- package/src/ui/tooltip/TooltipProvider.vue +11 -0
- package/src/ui/tooltip/TooltipTrigger.vue +11 -0
- package/src/ui/tooltip/index.ts +4 -0
- package/src/ui/utils.ts +1 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { buildAssistantMessageSegments, collectResourceLinks } from '../../lib/assistantMessage.js';
|
|
3
|
+
import { renderMarkdown } from '../../lib/markdown.js';
|
|
4
|
+
import { useAnimatedText } from '../../lib/useAnimatedText.js';
|
|
5
|
+
import { getUserMessageAttachmentNames, getUserMessageText } from '../../lib/userMessage.js';
|
|
6
|
+
import { useSvedaT } from '../../i18n/index.js';
|
|
7
|
+
import { Paperclip } from 'lucide-vue-next';
|
|
8
|
+
import { computed, nextTick, onUnmounted, ref, watch } from 'vue';
|
|
9
|
+
import ChatMessageActivityBlock from './ChatMessageActivityBlock.vue';
|
|
10
|
+
import ReasoningStream from './ReasoningStream.vue';
|
|
11
|
+
|
|
12
|
+
const t = useSvedaT();
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
message: {
|
|
16
|
+
type: Object,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
contentAnimationsEnabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
followWorkflowStream: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
onResourceLinkClick: {
|
|
28
|
+
type: Function,
|
|
29
|
+
default: null,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
defineEmits(['activity-link-click']);
|
|
34
|
+
|
|
35
|
+
const messageSegments = computed(() => {
|
|
36
|
+
if (props.message.role !== 'assistant') {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return buildAssistantMessageSegments(props.message);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const workflowSegments = computed(() =>
|
|
43
|
+
messageSegments.value.filter(segment => segment.kind === 'activity' || segment.kind === 'comment' || segment.kind === 'reasoning')
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const answerSegments = computed(() => messageSegments.value.filter(segment => segment.kind === 'answer'));
|
|
47
|
+
|
|
48
|
+
const userMessageText = computed(() => (props.message.role === 'user' ? getUserMessageText(props.message) : ''));
|
|
49
|
+
|
|
50
|
+
const displayedContent = useAnimatedText(() => userMessageText.value, {
|
|
51
|
+
enabled: () => false,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const userAttachmentNames = computed(() => (props.message.role === 'user' ? getUserMessageAttachmentNames(props.message) : []));
|
|
55
|
+
|
|
56
|
+
const hasUserText = computed(() => userMessageText.value.length > 0);
|
|
57
|
+
|
|
58
|
+
const hasSegmentText = computed(() =>
|
|
59
|
+
messageSegments.value.some(segment => (segment.kind === 'comment' || segment.kind === 'answer' || segment.kind === 'reasoning') && segment.text.trim())
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const hasActivity = computed(() => props.message.role === 'assistant' && messageSegments.value.some(segment => segment.kind === 'activity'));
|
|
63
|
+
|
|
64
|
+
const isMessageStreaming = computed(() => {
|
|
65
|
+
if (!props.contentAnimationsEnabled) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (props.message.streaming === true) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return props.message.parts?.some(part => part.state === 'streaming') ?? false;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const shouldHideMessage = computed(() => {
|
|
75
|
+
if (props.message.role === 'assistant') {
|
|
76
|
+
const isError = props.message.isError;
|
|
77
|
+
if (!hasSegmentText.value && !hasActivity.value && !isError) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const resourceLinks = computed(() => {
|
|
85
|
+
if (Array.isArray(props.message.resources) && props.message.resources.length > 0) {
|
|
86
|
+
return props.message.resources;
|
|
87
|
+
}
|
|
88
|
+
return collectResourceLinks(props.message);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const renderSegmentMarkdown = (text, { injectResources = false } = {}) =>
|
|
92
|
+
renderMarkdown(text, {
|
|
93
|
+
resources: resourceLinks.value,
|
|
94
|
+
injectResources: injectResources && !isMessageStreaming.value,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const handleContentClick = event => {
|
|
98
|
+
const link = event.target.closest('.resource-inline-link');
|
|
99
|
+
if (!link) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (typeof props.onResourceLinkClick === 'function') {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
props.onResourceLinkClick(link.getAttribute('href'));
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const showAnswerCursor = segment => segment.streaming || (props.contentAnimationsEnabled && isMessageStreaming.value && segment.kind === 'answer');
|
|
110
|
+
|
|
111
|
+
const workflowPanelRef = ref(null);
|
|
112
|
+
const workflowContentRef = ref(null);
|
|
113
|
+
let workflowResizeObserver = null;
|
|
114
|
+
|
|
115
|
+
const shouldFollowWorkflowStream = computed(() => props.followWorkflowStream);
|
|
116
|
+
|
|
117
|
+
const blockWorkflowPanelUserScroll = event => {
|
|
118
|
+
if (shouldFollowWorkflowStream.value) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const workflowScrollSignature = computed(() =>
|
|
124
|
+
JSON.stringify(
|
|
125
|
+
workflowSegments.value.map(segment => {
|
|
126
|
+
if (segment.kind === 'activity') {
|
|
127
|
+
return {
|
|
128
|
+
kind: segment.kind,
|
|
129
|
+
tools: segment.invocations.map(inv => [inv.toolCallId, inv.state, typeof inv.output === 'string' ? inv.output.length : 0]),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
kind: segment.kind,
|
|
135
|
+
length: segment.text?.length ?? 0,
|
|
136
|
+
streaming: segment.streaming,
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const scrollWorkflowPanelToBottom = () => {
|
|
143
|
+
const applyScroll = () => {
|
|
144
|
+
const panel = workflowPanelRef.value;
|
|
145
|
+
if (!panel) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
panel.scrollTop = Math.max(0, panel.scrollHeight - panel.clientHeight);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
nextTick(() => {
|
|
152
|
+
requestAnimationFrame(() => {
|
|
153
|
+
applyScroll();
|
|
154
|
+
requestAnimationFrame(applyScroll);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const stopWorkflowResizeObserver = () => {
|
|
160
|
+
workflowResizeObserver?.disconnect();
|
|
161
|
+
workflowResizeObserver = null;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const startWorkflowResizeObserver = () => {
|
|
165
|
+
stopWorkflowResizeObserver();
|
|
166
|
+
const content = workflowContentRef.value;
|
|
167
|
+
if (!content) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
workflowResizeObserver = new ResizeObserver(() => {
|
|
171
|
+
scrollWorkflowPanelToBottom();
|
|
172
|
+
});
|
|
173
|
+
workflowResizeObserver.observe(content);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
watch(
|
|
177
|
+
[workflowScrollSignature, shouldFollowWorkflowStream],
|
|
178
|
+
([, shouldFollowStream]) => {
|
|
179
|
+
if (!shouldFollowStream || workflowSegments.value.length === 0) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
scrollWorkflowPanelToBottom();
|
|
183
|
+
},
|
|
184
|
+
{ flush: 'post' }
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
watch(
|
|
188
|
+
[shouldFollowWorkflowStream, () => workflowSegments.value.length],
|
|
189
|
+
([shouldFollowStream]) => {
|
|
190
|
+
stopWorkflowResizeObserver();
|
|
191
|
+
if (!shouldFollowStream) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
nextTick(() => {
|
|
195
|
+
startWorkflowResizeObserver();
|
|
196
|
+
scrollWorkflowPanelToBottom();
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
{ flush: 'post', immediate: true }
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
onUnmounted(() => {
|
|
203
|
+
stopWorkflowResizeObserver();
|
|
204
|
+
});
|
|
205
|
+
</script>
|
|
206
|
+
|
|
207
|
+
<template>
|
|
208
|
+
<div
|
|
209
|
+
v-if="shouldHideMessage"
|
|
210
|
+
class="hidden"
|
|
211
|
+
></div>
|
|
212
|
+
<div
|
|
213
|
+
v-else-if="message.role === 'user'"
|
|
214
|
+
class="max-w-[80%] rounded-lg bg-brand-primary-purple p-3 text-white"
|
|
215
|
+
>
|
|
216
|
+
<div
|
|
217
|
+
v-if="userAttachmentNames.length"
|
|
218
|
+
class="mb-2 flex flex-col gap-1.5 border-b border-white/20 pb-2"
|
|
219
|
+
>
|
|
220
|
+
<p class="text-[11px] font-medium uppercase tracking-wide text-white/80">
|
|
221
|
+
{{ t('attachmentsLabel') }}
|
|
222
|
+
</p>
|
|
223
|
+
<div class="flex flex-wrap gap-1.5">
|
|
224
|
+
<span
|
|
225
|
+
v-for="(name, i) in userAttachmentNames"
|
|
226
|
+
:key="`${name}-${i}`"
|
|
227
|
+
class="inline-flex max-w-full items-center gap-1 rounded-md bg-white/15 px-2 py-1 text-xs [overflow-wrap:anywhere]"
|
|
228
|
+
>
|
|
229
|
+
<Paperclip class="h-3 w-3 shrink-0 opacity-90" />
|
|
230
|
+
<span>{{ name }}</span>
|
|
231
|
+
</span>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
<p
|
|
235
|
+
v-if="hasUserText"
|
|
236
|
+
class="whitespace-pre-wrap break-words text-sm [overflow-wrap:anywhere]"
|
|
237
|
+
>
|
|
238
|
+
{{ displayedContent }}
|
|
239
|
+
</p>
|
|
240
|
+
</div>
|
|
241
|
+
<div
|
|
242
|
+
v-else
|
|
243
|
+
class="w-full max-w-full space-y-3"
|
|
244
|
+
>
|
|
245
|
+
<div
|
|
246
|
+
v-if="workflowSegments.length > 0"
|
|
247
|
+
ref="workflowPanelRef"
|
|
248
|
+
class="assistant-workflow-panel max-h-[25dvh] touch-pan-y overflow-y-auto overflow-x-hidden rounded-lg border border-border/50 bg-muted/20 p-2"
|
|
249
|
+
:class="{ 'assistant-workflow-panel--locked': shouldFollowWorkflowStream }"
|
|
250
|
+
@wheel="blockWorkflowPanelUserScroll"
|
|
251
|
+
@touchmove="blockWorkflowPanelUserScroll"
|
|
252
|
+
>
|
|
253
|
+
<div
|
|
254
|
+
ref="workflowContentRef"
|
|
255
|
+
class="space-y-1"
|
|
256
|
+
>
|
|
257
|
+
<template
|
|
258
|
+
v-for="segment in workflowSegments"
|
|
259
|
+
:key="segment.id"
|
|
260
|
+
>
|
|
261
|
+
<ChatMessageActivityBlock
|
|
262
|
+
v-if="segment.kind === 'activity'"
|
|
263
|
+
:invocations="segment.invocations"
|
|
264
|
+
:legacy-activity="segment.legacyActivity"
|
|
265
|
+
:content-animations-enabled="contentAnimationsEnabled"
|
|
266
|
+
@activity-link-click="$emit('activity-link-click', $event)"
|
|
267
|
+
/>
|
|
268
|
+
|
|
269
|
+
<ReasoningStream
|
|
270
|
+
v-else-if="segment.kind === 'reasoning'"
|
|
271
|
+
:text="segment.text"
|
|
272
|
+
:animated="contentAnimationsEnabled"
|
|
273
|
+
@content-resize="scrollWorkflowPanelToBottom"
|
|
274
|
+
/>
|
|
275
|
+
|
|
276
|
+
<div
|
|
277
|
+
v-else-if="segment.kind === 'comment'"
|
|
278
|
+
class="rounded-md border border-border/40 bg-muted/30 px-3 py-2"
|
|
279
|
+
>
|
|
280
|
+
<div
|
|
281
|
+
class="prose prose-sm dark:prose-invert max-w-none break-words text-sm text-muted-foreground [overflow-wrap:anywhere] [&_code]:rounded [&_code]:bg-muted/60 [&_code]:px-1 [&_code]:py-0.5 [&_p:last-child]:mb-0 [&_p]:my-1"
|
|
282
|
+
v-html="renderSegmentMarkdown(segment.text)"
|
|
283
|
+
></div>
|
|
284
|
+
</div>
|
|
285
|
+
</template>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
<template
|
|
290
|
+
v-for="segment in answerSegments"
|
|
291
|
+
:key="segment.id"
|
|
292
|
+
>
|
|
293
|
+
<div :class="message.isError ? 'text-destructive' : ''">
|
|
294
|
+
<div
|
|
295
|
+
class="prose prose-sm dark:prose-invert max-w-none break-words text-sm text-foreground [overflow-wrap:anywhere] [&_code]:rounded [&_code]:bg-muted/60 [&_code]:px-1 [&_code]:py-0.5 [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-muted/50 [&_pre]:p-2 [&_pre]:text-xs"
|
|
296
|
+
@click="handleContentClick"
|
|
297
|
+
>
|
|
298
|
+
<div
|
|
299
|
+
class="[&_a]:break-all [&_blockquote]:break-words [&_h1]:break-words [&_h2]:break-words [&_h3]:break-words [&_h4]:break-words [&_img]:my-2 [&_img]:h-auto [&_img]:max-w-full [&_img]:rounded-md [&_li]:break-words [&_p:last-child]:mb-0 [&_p]:my-1 [&_p]:break-words"
|
|
300
|
+
v-html="renderSegmentMarkdown(segment.text, { injectResources: true })"
|
|
301
|
+
></div>
|
|
302
|
+
<span
|
|
303
|
+
v-if="showAnswerCursor(segment)"
|
|
304
|
+
class="ml-1 inline-block h-4 w-2 animate-pulse bg-primary align-middle"
|
|
305
|
+
></span>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
</template>
|
|
309
|
+
|
|
310
|
+
<div
|
|
311
|
+
v-if="message.isError && messageSegments.length === 0"
|
|
312
|
+
class="text-sm text-destructive"
|
|
313
|
+
>
|
|
314
|
+
{{ message.content }}
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</template>
|
|
318
|
+
|
|
319
|
+
<style scoped>
|
|
320
|
+
:deep(.resource-inline-link) {
|
|
321
|
+
color: hsl(var(--primary));
|
|
322
|
+
text-decoration: underline;
|
|
323
|
+
text-decoration-style: dotted;
|
|
324
|
+
text-underline-offset: 2px;
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
transition:
|
|
327
|
+
color 0.15s ease,
|
|
328
|
+
text-decoration-color 0.15s ease;
|
|
329
|
+
font-weight: 500;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
:deep(.resource-inline-link:hover) {
|
|
333
|
+
color: hsl(var(--primary) / 0.8);
|
|
334
|
+
text-decoration-style: solid;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
:deep(.resource-link-icon) {
|
|
338
|
+
display: inline-block;
|
|
339
|
+
vertical-align: middle;
|
|
340
|
+
margin-left: 2px;
|
|
341
|
+
margin-top: -2px;
|
|
342
|
+
opacity: 0.7;
|
|
343
|
+
transition:
|
|
344
|
+
opacity 0.15s ease,
|
|
345
|
+
transform 0.15s ease;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
:deep(.resource-inline-link:hover .resource-link-icon) {
|
|
349
|
+
opacity: 1;
|
|
350
|
+
transform: translate(1px, -1px);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.assistant-workflow-panel--locked {
|
|
354
|
+
touch-action: none;
|
|
355
|
+
overscroll-behavior: contain;
|
|
356
|
+
}
|
|
357
|
+
</style>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ScrollArea } from '../../ui/scroll-area/index.js';
|
|
3
|
+
import { shouldShowChatPendingIndicator } from '../../lib/chatMessageVisibility.js';
|
|
4
|
+
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue';
|
|
5
|
+
import ChatMessageItem from './ChatMessageItem.vue';
|
|
6
|
+
import ChatPendingIndicator from './ChatPendingIndicator.vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
messages: {
|
|
10
|
+
type: Array,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
isLoading: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
isThinking: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
contentAnimationsEnabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false,
|
|
24
|
+
},
|
|
25
|
+
thinkingMessage: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '',
|
|
28
|
+
},
|
|
29
|
+
pendingStatusMessages: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => [],
|
|
32
|
+
},
|
|
33
|
+
onResourceLinkClick: {
|
|
34
|
+
type: Function,
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
noMtAuto: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const emit = defineEmits(['near-bottom-change', 'scroll-to-bottom', 'stop-generation', 'activity-link-click']);
|
|
44
|
+
|
|
45
|
+
const showPendingIndicator = computed(() => shouldShowChatPendingIndicator(props.isThinking && props.contentAnimationsEnabled, props.messages));
|
|
46
|
+
|
|
47
|
+
const messagesContainer = ref(null);
|
|
48
|
+
const bottomRef = ref(null);
|
|
49
|
+
const isNearBottom = ref(true);
|
|
50
|
+
const SCROLL_BOTTOM_THRESHOLD = 48;
|
|
51
|
+
let scrollViewport = null;
|
|
52
|
+
|
|
53
|
+
const setIsNearBottom = value => {
|
|
54
|
+
if (isNearBottom.value === value) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
isNearBottom.value = value;
|
|
59
|
+
emit('near-bottom-change', value);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const getViewport = () => {
|
|
63
|
+
const root = messagesContainer.value?.$el;
|
|
64
|
+
if (!root) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return root.querySelector('[data-radix-scroll-area-viewport], [data-reka-scroll-area-viewport]') || root.firstElementChild;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const updateIsNearBottom = () => {
|
|
72
|
+
const viewport = getViewport();
|
|
73
|
+
if (!viewport) {
|
|
74
|
+
setIsNearBottom(true);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const remainingScroll = viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight;
|
|
79
|
+
setIsNearBottom(remainingScroll <= SCROLL_BOTTOM_THRESHOLD);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const detachScrollListener = () => {
|
|
83
|
+
if (scrollViewport) {
|
|
84
|
+
scrollViewport.removeEventListener('scroll', updateIsNearBottom);
|
|
85
|
+
scrollViewport = null;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const attachScrollListener = () => {
|
|
90
|
+
detachScrollListener();
|
|
91
|
+
|
|
92
|
+
const viewport = getViewport();
|
|
93
|
+
if (!viewport) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
scrollViewport = viewport;
|
|
98
|
+
scrollViewport.addEventListener('scroll', updateIsNearBottom, { passive: true });
|
|
99
|
+
updateIsNearBottom();
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const scrollToBottom = (options = {}) => {
|
|
103
|
+
const behavior = options.behavior || (options.onlyIfNearBottom ? 'auto' : 'smooth');
|
|
104
|
+
const applyScroll = () => {
|
|
105
|
+
if (options.onlyIfNearBottom && !isNearBottom.value) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const viewport = getViewport();
|
|
110
|
+
if (viewport) {
|
|
111
|
+
if (behavior === 'auto') {
|
|
112
|
+
viewport.scrollTop = viewport.scrollHeight;
|
|
113
|
+
} else {
|
|
114
|
+
viewport.scrollTo({
|
|
115
|
+
top: viewport.scrollHeight,
|
|
116
|
+
behavior,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
setIsNearBottom(true);
|
|
120
|
+
} else if (bottomRef.value) {
|
|
121
|
+
bottomRef.value.scrollIntoView({ behavior, block: 'end' });
|
|
122
|
+
setIsNearBottom(true);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
nextTick(() => {
|
|
127
|
+
applyScroll();
|
|
128
|
+
requestAnimationFrame(applyScroll);
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
onMounted(() => {
|
|
133
|
+
nextTick(attachScrollListener);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
onUnmounted(detachScrollListener);
|
|
137
|
+
|
|
138
|
+
defineExpose({
|
|
139
|
+
scrollToBottom,
|
|
140
|
+
});
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
<template>
|
|
144
|
+
<ScrollArea
|
|
145
|
+
ref="messagesContainer"
|
|
146
|
+
class="min-h-0 flex-1"
|
|
147
|
+
>
|
|
148
|
+
<div class="flex min-h-full flex-col px-4 py-4">
|
|
149
|
+
<div
|
|
150
|
+
class="flex w-full flex-col space-y-4"
|
|
151
|
+
:class="{ 'mt-auto': !noMtAuto }"
|
|
152
|
+
>
|
|
153
|
+
<div
|
|
154
|
+
v-for="(message, index) in messages"
|
|
155
|
+
:key="message.id || index"
|
|
156
|
+
:class="['flex', message.role === 'user' ? 'justify-end' : 'justify-start']"
|
|
157
|
+
>
|
|
158
|
+
<ChatMessageItem
|
|
159
|
+
:message="message"
|
|
160
|
+
:content-animations-enabled="contentAnimationsEnabled"
|
|
161
|
+
:follow-workflow-stream="contentAnimationsEnabled && message.role === 'assistant' && index === messages.length - 1"
|
|
162
|
+
:on-resource-link-click="onResourceLinkClick"
|
|
163
|
+
@activity-link-click="$emit('activity-link-click', $event)"
|
|
164
|
+
@stop-generation="$emit('stop-generation', $event)"
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<ChatPendingIndicator
|
|
169
|
+
:active="showPendingIndicator"
|
|
170
|
+
:status-messages="pendingStatusMessages"
|
|
171
|
+
/>
|
|
172
|
+
|
|
173
|
+
<slot />
|
|
174
|
+
<div ref="bottomRef" />
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</ScrollArea>
|
|
178
|
+
</template>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { SvedaI18nKey, useSvedaT } from '../../i18n/index.js';
|
|
3
|
+
import { buildPendingStatusRotation } from '../../lib/pendingStatusRotation.js';
|
|
4
|
+
import { computed, inject, onUnmounted, ref, watch } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
active: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false,
|
|
10
|
+
},
|
|
11
|
+
intervalMs: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 3200,
|
|
14
|
+
},
|
|
15
|
+
statusMessages: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => [],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const t = useSvedaT();
|
|
22
|
+
const svedaI18n = inject(SvedaI18nKey, null);
|
|
23
|
+
const locale = computed(() => svedaI18n?.locale ?? '');
|
|
24
|
+
|
|
25
|
+
const sourceStatusMessages = computed(() => {
|
|
26
|
+
const provided = props.statusMessages.filter(
|
|
27
|
+
message => typeof message === 'string' && message.trim() !== ''
|
|
28
|
+
);
|
|
29
|
+
if (provided.length > 0) {
|
|
30
|
+
return provided;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const fallback = t('pendingStatus');
|
|
34
|
+
return fallback && fallback !== 'pendingStatus' ? [fallback] : [];
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const rotationMessages = ref([]);
|
|
38
|
+
const currentIndex = ref(0);
|
|
39
|
+
let rotationTimer = null;
|
|
40
|
+
|
|
41
|
+
const rebuildRotationMessages = () => {
|
|
42
|
+
rotationMessages.value = buildPendingStatusRotation(sourceStatusMessages.value);
|
|
43
|
+
currentIndex.value = 0;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const currentMessage = computed(() => {
|
|
47
|
+
const messages = rotationMessages.value;
|
|
48
|
+
if (messages.length === 0) {
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return messages[currentIndex.value % messages.length];
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const stopRotation = () => {
|
|
56
|
+
if (rotationTimer !== null) {
|
|
57
|
+
clearInterval(rotationTimer);
|
|
58
|
+
rotationTimer = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const startRotation = () => {
|
|
63
|
+
stopRotation();
|
|
64
|
+
if (!props.active || rotationMessages.value.length <= 1) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
rotationTimer = setInterval(() => {
|
|
69
|
+
currentIndex.value = (currentIndex.value + 1) % rotationMessages.value.length;
|
|
70
|
+
}, props.intervalMs);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
watch(
|
|
74
|
+
() => props.active,
|
|
75
|
+
active => {
|
|
76
|
+
if (active) {
|
|
77
|
+
rebuildRotationMessages();
|
|
78
|
+
startRotation();
|
|
79
|
+
} else {
|
|
80
|
+
stopRotation();
|
|
81
|
+
rotationMessages.value = [];
|
|
82
|
+
currentIndex.value = 0;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{ immediate: true }
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
watch(sourceStatusMessages, () => {
|
|
89
|
+
if (props.active) {
|
|
90
|
+
rebuildRotationMessages();
|
|
91
|
+
startRotation();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
watch(locale, () => {
|
|
96
|
+
if (props.active) {
|
|
97
|
+
rebuildRotationMessages();
|
|
98
|
+
startRotation();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
onUnmounted(stopRotation);
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<div
|
|
107
|
+
v-if="active && currentMessage"
|
|
108
|
+
class="flex justify-start"
|
|
109
|
+
data-testid="chat-pending-indicator"
|
|
110
|
+
>
|
|
111
|
+
<div class="max-w-[85%] rounded-lg bg-muted px-4 py-3">
|
|
112
|
+
<div class="flex items-center gap-3">
|
|
113
|
+
<div
|
|
114
|
+
class="flex shrink-0 items-center space-x-1"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
>
|
|
117
|
+
<div
|
|
118
|
+
class="h-2 w-2 animate-bounce rounded-full bg-foreground/40"
|
|
119
|
+
style="animation-delay: 0ms"
|
|
120
|
+
/>
|
|
121
|
+
<div
|
|
122
|
+
class="h-2 w-2 animate-bounce rounded-full bg-foreground/40"
|
|
123
|
+
style="animation-delay: 150ms"
|
|
124
|
+
/>
|
|
125
|
+
<div
|
|
126
|
+
class="h-2 w-2 animate-bounce rounded-full bg-foreground/40"
|
|
127
|
+
style="animation-delay: 300ms"
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
<Transition
|
|
131
|
+
name="pending-status"
|
|
132
|
+
mode="out-in"
|
|
133
|
+
>
|
|
134
|
+
<p
|
|
135
|
+
:key="currentMessage"
|
|
136
|
+
class="text-sm text-muted-foreground"
|
|
137
|
+
>
|
|
138
|
+
{{ currentMessage }}
|
|
139
|
+
</p>
|
|
140
|
+
</Transition>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</template>
|
|
145
|
+
|
|
146
|
+
<style scoped>
|
|
147
|
+
.pending-status-enter-active,
|
|
148
|
+
.pending-status-leave-active {
|
|
149
|
+
transition:
|
|
150
|
+
opacity 0.22s ease,
|
|
151
|
+
transform 0.22s ease;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.pending-status-enter-from {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
transform: translateY(4px);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.pending-status-leave-to {
|
|
160
|
+
opacity: 0;
|
|
161
|
+
transform: translateY(-4px);
|
|
162
|
+
}
|
|
163
|
+
</style>
|