@copilotkit/vue 2.0.0-rc.1 → 2.0.0-rc.10
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/PARITY.md +13 -12
- package/README.md +1 -2
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts +3 -1
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts.map +1 -1
- package/dist/hooks/use-copilot-action.d.ts.map +1 -1
- package/dist/hooks/use-frontend-tool.d.ts +1 -1
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/hooks/zod-parameters.d.ts +14 -0
- package/dist/hooks/zod-parameters.d.ts.map +1 -0
- package/dist/index.cjs +1 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +384 -14275
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-CTR_ziWV.js +18097 -0
- package/dist/use-render-activity-message-CTR_ziWV.js.map +1 -0
- package/dist/use-render-activity-message-Dky9_GRG.cjs +92 -0
- package/dist/use-render-activity-message-Dky9_GRG.cjs.map +1 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts +7 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -1
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -1
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +13 -45
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +11 -2
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts +144 -0
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts.map +1 -0
- package/dist/v2/components/a2ui.d.ts +3 -7
- package/dist/v2/components/a2ui.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +3 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts +16 -0
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +21 -232
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +20 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts +32 -0
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToolCallItem.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +11 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/StreamingMarkdownDefault.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts +0 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts.map +1 -1
- package/dist/v2/components/chat/index.d.ts +17 -1
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts +12 -0
- package/dist/v2/components/chat/inspector-shortcuts.d.ts.map +1 -0
- package/dist/v2/components/chat/message-feedback.d.ts +89 -0
- package/dist/v2/components/chat/message-feedback.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts +39 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts +22 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts +131 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts.map +1 -0
- package/dist/v2/components/chat/turn-work.d.ts +33 -0
- package/dist/v2/components/chat/turn-work.d.ts.map +1 -0
- package/dist/v2/components/chat/types.d.ts +104 -5
- package/dist/v2/components/chat/types.d.ts.map +1 -1
- package/dist/v2/components/chat/use-chat-labels.d.ts +8 -0
- package/dist/v2/components/chat/use-chat-labels.d.ts.map +1 -0
- package/dist/v2/components/chat/use-lightbox.d.ts +18 -0
- package/dist/v2/components/chat/use-lightbox.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +968 -1
- package/dist/v2/components/icons/index.d.ts.map +1 -1
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts +55 -0
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts +40 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts +37 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts +14 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/v2/components/ui/floating.d.ts +84 -0
- package/dist/v2/components/ui/floating.d.ts.map +1 -0
- package/dist/v2/components/ui/presence.d.ts +9 -0
- package/dist/v2/components/ui/presence.d.ts.map +1 -0
- package/dist/v2/components/ui/use-id.d.ts +9 -0
- package/dist/v2/components/ui/use-id.d.ts.map +1 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts +6 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-frontend-tool.d.ts +5 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-activity-message.d.ts +13 -9
- package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-custom-messages.d.ts +5 -7
- package/dist/v2/hooks/use-render-custom-messages.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-tool.d.ts +4 -0
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.d.cts +3 -0
- package/dist/v2/index.d.mts +3 -0
- package/dist/v2/index.d.ts +3 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/index.mjs +197 -197
- package/dist/v2/index.mjs.map +1 -1
- package/dist/v2/lib/message-feedback.d.ts +33 -0
- package/dist/v2/lib/message-feedback.d.ts.map +1 -0
- package/dist/v2/lib/processPartialHtml.d.ts +1 -2
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -1
- package/dist/v2/lib/vue-core.d.ts +0 -1
- package/dist/v2/lib/vue-core.d.ts.map +1 -1
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +56 -6
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +6 -2
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/index.d.ts +1 -1
- package/dist/v2/providers/index.d.ts.map +1 -1
- package/dist/v2/providers/keys.d.ts +8 -0
- package/dist/v2/providers/keys.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +3 -37
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/dist/v2/styles/CopilotKitStyles.d.ts +18 -0
- package/dist/v2/styles/CopilotKitStyles.d.ts.map +1 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts +2 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/types/human-in-the-loop.d.ts +8 -29
- package/dist/v2/types/human-in-the-loop.d.ts.map +1 -1
- package/dist/v2/types/interrupt.d.ts +1 -22
- package/dist/v2/types/interrupt.d.ts.map +1 -1
- package/dist/v2/types/vue-activity-message-renderer.d.ts +16 -15
- package/dist/v2/types/vue-activity-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-custom-message-renderer.d.ts +7 -16
- package/dist/v2/types/vue-custom-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-tool-call-renderer.d.ts +16 -28
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -1
- package/package.json +14 -27
- package/src/__tests__/build-entries.test.ts +27 -0
- package/src/components/copilot-provider/CopilotKit.vue +4 -1
- package/src/hooks/__tests__/zod-parameters.test.ts +520 -0
- package/src/hooks/use-copilot-action.ts +2 -1
- package/src/hooks/use-frontend-tool.ts +3 -6
- package/src/hooks/zod-parameters.ts +162 -0
- package/src/v2/__tests__/exports.test.ts +4 -2
- package/src/v2/components/A2UIMessageRenderer.ts +56 -68
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +11 -23
- package/src/v2/components/LicenseWarningBanner.vue +31 -15
- package/src/v2/components/OpenGenerativeUIRenderer.ts +51 -373
- package/src/v2/components/__tests__/A2UIBasicCatalogColors.test.ts +8 -9
- package/src/v2/components/__tests__/A2UICatalogContext.test.ts +1 -1
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +63 -36
- package/src/v2/components/__tests__/LicenseWarningBanner.test.ts +20 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +55 -6
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +15 -258
- package/src/v2/components/a2ui/A2UICatalogContext.ts +10 -102
- package/src/v2/components/a2ui/A2UIRecoveryStates.ts +444 -0
- package/src/v2/components/a2ui/__tests__/A2UIRecoveryStates.test.ts +175 -0
- package/src/v2/components/a2ui.ts +1 -1
- package/src/v2/components/chat/CopilotChat.vue +26 -40
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +267 -67
- package/src/v2/components/chat/CopilotChatAssistantToolbarButton.vue +46 -0
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +150 -173
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +77 -20
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +2 -2
- package/src/v2/components/chat/CopilotChatFeedbackCommentPopover.vue +240 -0
- package/src/v2/components/chat/CopilotChatInput.vue +250 -191
- package/src/v2/components/chat/CopilotChatInspectorButton.vue +331 -0
- package/src/v2/components/chat/CopilotChatLightbox.vue +105 -0
- package/src/v2/components/chat/CopilotChatMessageView.vue +262 -87
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +52 -35
- package/src/v2/components/chat/CopilotChatSuggestionPill.vue +5 -14
- package/src/v2/components/chat/CopilotChatSuggestionView.vue +1 -4
- package/src/v2/components/chat/CopilotChatToggleButton.vue +3 -9
- package/src/v2/components/chat/CopilotChatToggleButtonCloseIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToggleButtonOpenIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToolCallGroup.vue +353 -0
- package/src/v2/components/chat/CopilotChatToolCallItem.vue +24 -14
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +194 -21
- package/src/v2/components/chat/CopilotChatUserMessage.vue +105 -42
- package/src/v2/components/chat/CopilotChatView.vue +37 -42
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +111 -0
- package/src/v2/components/chat/CopilotModalHeader.vue +10 -8
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +7 -6
- package/src/v2/components/chat/CopilotModalHeaderTitle.ts +1 -4
- package/src/v2/components/chat/CopilotPopup.vue +3 -0
- package/src/v2/components/chat/CopilotPopupView.vue +1 -0
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +9 -19
- package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +5 -8
- package/src/v2/components/chat/CopilotSidebar.vue +5 -0
- package/src/v2/components/chat/CopilotSidebarView.vue +2 -0
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +24 -17
- package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +7 -10
- package/src/v2/components/chat/StreamingMarkdownDefault.vue +3 -5
- package/src/v2/components/chat/__tests__/CopilotChat.labels.test.ts +19 -4
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +26 -9
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.inspector.test.ts +269 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.learningFeedback.test.ts +760 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.slots.e2e.test.ts +3 -5
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.ts +2 -2
- package/src/v2/components/chat/__tests__/CopilotChatInput.addMenu.test.ts +328 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.slots.e2e.test.ts +6 -3
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +55 -14
- package/src/v2/components/chat/__tests__/CopilotChatLightbox.test.ts +160 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +247 -403
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.toolCallDisplay.test.ts +637 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionPill.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.slots.e2e.test.ts +3 -1
- package/src/v2/components/chat/__tests__/CopilotChatToolCallsView.learning.test.ts +75 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.attachments.test.ts +143 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.inputOverlay.test.ts +5 -4
- package/src/v2/components/chat/__tests__/CopilotChatView.rootWidth.test.ts +7 -33
- package/src/v2/components/chat/__tests__/CopilotModalHeader.slots.e2e.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +3 -3
- package/src/v2/components/chat/__tests__/CopilotSidebarView.position.test.ts +126 -0
- package/src/v2/components/chat/__tests__/messageFeedbackDefaults.test.ts +33 -0
- package/src/v2/components/chat/__tests__/modalChatDisplayProps.test.ts +44 -0
- package/src/v2/components/chat/copilotChatToolCallItemRender.ts +3 -19
- package/src/v2/components/chat/index.ts +2 -1
- package/src/v2/components/chat/inspector-shortcuts.ts +34 -0
- package/src/v2/components/chat/message-feedback.ts +291 -0
- package/src/v2/components/chat/tool-call-capture.ts +55 -0
- package/src/v2/components/chat/tool-call-display-context.ts +28 -0
- package/src/v2/components/chat/tool-call-group-parts.ts +251 -0
- package/src/v2/components/chat/turn-work.ts +52 -0
- package/src/v2/components/chat/types.ts +114 -4
- package/src/v2/components/chat/use-chat-labels.ts +16 -0
- package/src/v2/components/chat/use-lightbox.ts +64 -0
- package/src/v2/components/icons/__tests__/icons.test.ts +72 -68
- package/src/v2/components/icons/index.ts +109 -23
- package/src/v2/components/ui/CopilotDropdownMenuContent.vue +465 -0
- package/src/v2/components/ui/CopilotPopover.vue +138 -0
- package/src/v2/components/ui/CopilotTooltip.vue +237 -0
- package/src/v2/components/ui/__tests__/CopilotTooltip.test.ts +168 -0
- package/src/v2/components/ui/dropdown-menu.ts +15 -0
- package/src/v2/components/ui/floating.ts +321 -0
- package/src/v2/components/ui/presence.ts +54 -0
- package/src/v2/components/ui/use-id.ts +16 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +62 -1
- package/src/v2/hooks/__tests__/use-render-activity-message.test.ts +105 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +3 -6
- package/src/v2/hooks/__tests__/zod-regression.test.ts +5 -4
- package/src/v2/hooks/use-default-render-tool.ts +123 -62
- package/src/v2/hooks/use-frontend-tool.ts +10 -10
- package/src/v2/hooks/use-render-activity-message.ts +27 -48
- package/src/v2/hooks/use-render-custom-messages.ts +14 -35
- package/src/v2/hooks/use-render-tool.ts +8 -0
- package/src/v2/index.ts +3 -0
- package/src/v2/lib/__tests__/message-feedback.test.ts +152 -0
- package/src/v2/lib/message-feedback.ts +120 -0
- package/src/v2/lib/processPartialHtml.ts +6 -21
- package/src/v2/lib/vue-core.ts +3 -5
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +29 -2
- package/src/v2/providers/CopilotKitProvider.types.ts +57 -5
- package/src/v2/providers/CopilotKitProvider.vue +177 -114
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.openThread.test.ts +69 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.a2ui.test.ts +1 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.headersAtSendTime.test.ts +3 -3
- package/src/v2/providers/__tests__/CopilotKitProvider.learning.test.ts +536 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +17 -33
- package/src/v2/providers/index.ts +4 -1
- package/src/v2/providers/keys.ts +12 -0
- package/src/v2/providers/types.ts +3 -38
- package/src/v2/styles/CopilotKitStyles.ts +95 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.client.test.ts +149 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.ssr.test.ts +71 -0
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +28 -33
- package/src/v2/types/defineToolCallRenderer.ts +9 -4
- package/src/v2/types/human-in-the-loop.ts +8 -32
- package/src/v2/types/interrupt.ts +7 -31
- package/src/v2/types/vue-activity-message-renderer.ts +24 -15
- package/src/v2/types/vue-custom-message-renderer.ts +12 -16
- package/src/v2/types/vue-tool-call-renderer.ts +23 -31
- package/vite.config.ts +5 -5
- package/dist/styles.css +0 -2
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts +0 -9
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts.map +0 -1
- package/dist/v2/lib/transcription-client.d.ts +0 -19
- package/dist/v2/lib/transcription-client.d.ts.map +0 -1
- package/scripts/scope-preflight.mjs +0 -100
- package/src/styles/globals.css +0 -233
- package/src/v2/components/chat/BasicMarkdown.vue +0 -158
- package/src/v2/components/chat/__tests__/BasicMarkdown.test.ts +0 -69
- package/src/v2/lib/__tests__/processPartialHtml.test.ts +0 -84
- package/src/v2/lib/__tests__/transcription-client.test.ts +0 -67
- package/src/v2/lib/transcription-client.ts +0 -151
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
import type { Message } from "@ag-ui/core";
|
|
12
12
|
import type { Suggestion } from "@copilotkit/core";
|
|
13
13
|
import type { Attachment } from "@copilotkit/shared";
|
|
14
|
-
import {
|
|
15
|
-
import { CopilotChatDefaultLabels } from "../../providers/types";
|
|
14
|
+
import { useChatLabels } from "./use-chat-labels";
|
|
16
15
|
import { useKeyboardHeight } from "../../hooks/use-keyboard-height";
|
|
17
16
|
import { usePinToSend } from "../../hooks/use-pin-to-send";
|
|
18
|
-
import { IconChevronDown } from "../icons";
|
|
17
|
+
import { IconChevronDown, IconUpload } from "../icons";
|
|
19
18
|
import CopilotChatInput from "./CopilotChatInput.vue";
|
|
20
19
|
import CopilotChatAttachmentQueue from "./CopilotChatAttachmentQueue.vue";
|
|
21
20
|
import CopilotChatMessageView from "./CopilotChatMessageView.vue";
|
|
@@ -34,6 +33,7 @@ const SCROLL_BUTTON_OFFSET = 16;
|
|
|
34
33
|
const SCROLL_BOTTOM_THRESHOLD = 12;
|
|
35
34
|
|
|
36
35
|
const props = withDefaults(defineProps<CopilotChatViewProps>(), {
|
|
36
|
+
messageFeedback: true,
|
|
37
37
|
messages: () => [],
|
|
38
38
|
autoScroll: true,
|
|
39
39
|
isRunning: false,
|
|
@@ -126,8 +126,7 @@ const emit = defineEmits<{
|
|
|
126
126
|
"finish-transcribe": [];
|
|
127
127
|
}>();
|
|
128
128
|
|
|
129
|
-
const
|
|
130
|
-
const labels = computed(() => config.value?.labels ?? CopilotChatDefaultLabels);
|
|
129
|
+
const labels = useChatLabels();
|
|
131
130
|
const componentSlots = useSlots();
|
|
132
131
|
|
|
133
132
|
const scrollContainerRef = ref<HTMLElement | null>(null);
|
|
@@ -441,8 +440,9 @@ onBeforeUnmount(() => {
|
|
|
441
440
|
<template>
|
|
442
441
|
<div
|
|
443
442
|
data-copilotkit
|
|
444
|
-
class="copilotKitChat cpk
|
|
443
|
+
class="copilotKitChat cpk-chat-view"
|
|
445
444
|
data-testid="copilot-chat-view"
|
|
445
|
+
:data-copilot-running="isRunning ? 'true' : 'false'"
|
|
446
446
|
v-bind="$attrs"
|
|
447
447
|
@dragover="handleDragOver"
|
|
448
448
|
@dragleave="handleDragLeave"
|
|
@@ -450,12 +450,15 @@ onBeforeUnmount(() => {
|
|
|
450
450
|
>
|
|
451
451
|
<div
|
|
452
452
|
v-if="dragOver"
|
|
453
|
-
class="cpk
|
|
453
|
+
class="cpk-chat-view-drop-overlay"
|
|
454
454
|
data-testid="copilot-chat-drop-overlay"
|
|
455
455
|
>
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
456
|
+
<div class="cpk-chat-view-drop-overlay-content">
|
|
457
|
+
<IconUpload class="cpk-chat-view-drop-overlay-icon" />
|
|
458
|
+
<span class="cpk-chat-view-drop-overlay-label">{{
|
|
459
|
+
labels.chatDropFilesLabel
|
|
460
|
+
}}</span>
|
|
461
|
+
</div>
|
|
459
462
|
</div>
|
|
460
463
|
<slot
|
|
461
464
|
v-if="shouldShowWelcomeScreen"
|
|
@@ -481,27 +484,25 @@ onBeforeUnmount(() => {
|
|
|
481
484
|
:on-select-suggestion="handleSelectSuggestion"
|
|
482
485
|
>
|
|
483
486
|
<div
|
|
484
|
-
class="cpk
|
|
487
|
+
class="cpk-chat-view-welcome-screen"
|
|
485
488
|
data-testid="copilot-chat-view-welcome-screen"
|
|
486
489
|
>
|
|
487
|
-
<div
|
|
488
|
-
class="cpk
|
|
489
|
-
>
|
|
490
|
-
<div class="cpk:mb-6">
|
|
490
|
+
<div class="cpk-chat-view-welcome-screen-content">
|
|
491
|
+
<div class="cpk-chat-view-welcome-screen-message">
|
|
491
492
|
<slot name="welcome-message">
|
|
492
|
-
<h1
|
|
493
|
-
class="cpk:text-xl cpk:sm:text-2xl cpk:font-medium cpk:text-foreground cpk:text-center"
|
|
494
|
-
>
|
|
493
|
+
<h1 class="cpk-chat-view-welcome-message">
|
|
495
494
|
{{ labels.welcomeMessageText }}
|
|
496
495
|
</h1>
|
|
497
496
|
</slot>
|
|
498
497
|
</div>
|
|
499
498
|
|
|
500
|
-
<div
|
|
499
|
+
<div
|
|
500
|
+
class="cpk-chat-view-welcome-screen-input cpk-chat-view-welcome-input-group"
|
|
501
|
+
>
|
|
501
502
|
<CopilotChatAttachmentQueue
|
|
502
503
|
v-if="hasAttachments"
|
|
503
504
|
:attachments="attachments ?? []"
|
|
504
|
-
class-name="cpk
|
|
505
|
+
class-name="cpk-chat-view-welcome-attachment-queue"
|
|
505
506
|
@remove-attachment="
|
|
506
507
|
(id: string) => onRemoveAttachment && onRemoveAttachment(id)
|
|
507
508
|
"
|
|
@@ -540,7 +541,7 @@ onBeforeUnmount(() => {
|
|
|
540
541
|
|
|
541
542
|
<div
|
|
542
543
|
v-if="hasSuggestions"
|
|
543
|
-
class="cpk
|
|
544
|
+
class="cpk-chat-view-welcome-screen-suggestions"
|
|
544
545
|
>
|
|
545
546
|
<slot
|
|
546
547
|
name="suggestion-view"
|
|
@@ -549,6 +550,7 @@ onBeforeUnmount(() => {
|
|
|
549
550
|
:on-select-suggestion="handleSelectSuggestion"
|
|
550
551
|
>
|
|
551
552
|
<CopilotChatSuggestionView
|
|
553
|
+
class="cpk-chat-view-suggestion-view"
|
|
552
554
|
:suggestions="suggestions"
|
|
553
555
|
:loading-indexes="suggestionLoadingIndexes"
|
|
554
556
|
@select-suggestion="handleSelectSuggestion"
|
|
@@ -575,18 +577,16 @@ onBeforeUnmount(() => {
|
|
|
575
577
|
<div
|
|
576
578
|
ref="scrollContainerRef"
|
|
577
579
|
data-testid="copilot-chat-view-scroll"
|
|
578
|
-
class="cpk
|
|
580
|
+
class="cpk-chat-view-scroll-area cpk-chat-view-scroll-viewport"
|
|
579
581
|
@scroll="handleScroll"
|
|
580
582
|
>
|
|
581
|
-
<div
|
|
582
|
-
class="cpk:px-4 cpk:@3xl:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6"
|
|
583
|
-
>
|
|
583
|
+
<div class="cpk-chat-view-scroll-content">
|
|
584
584
|
<div
|
|
585
585
|
ref="scrollContentRef"
|
|
586
586
|
data-testid="copilot-scroll-content"
|
|
587
587
|
:style="{ paddingBottom: messagePaddingBottom }"
|
|
588
588
|
>
|
|
589
|
-
<div class="cpk
|
|
589
|
+
<div class="cpk-chat-view-feed">
|
|
590
590
|
<slot
|
|
591
591
|
name="message-view"
|
|
592
592
|
:messages="messages"
|
|
@@ -595,6 +595,8 @@ onBeforeUnmount(() => {
|
|
|
595
595
|
<CopilotChatMessageView
|
|
596
596
|
:messages="messages"
|
|
597
597
|
:is-running="isRunning"
|
|
598
|
+
:tool-call-display="toolCallDisplay"
|
|
599
|
+
:message-feedback="messageFeedback"
|
|
598
600
|
>
|
|
599
601
|
<template
|
|
600
602
|
v-for="slotName in forwardedMessageViewSlotNames"
|
|
@@ -605,10 +607,7 @@ onBeforeUnmount(() => {
|
|
|
605
607
|
</template>
|
|
606
608
|
</CopilotChatMessageView>
|
|
607
609
|
</slot>
|
|
608
|
-
<div
|
|
609
|
-
v-if="hasSuggestions"
|
|
610
|
-
class="cpk:mt-4 cpk:pl-0 cpk:pr-4 cpk:@3xl:px-0"
|
|
611
|
-
>
|
|
610
|
+
<div v-if="hasSuggestions" class="cpk-chat-view-suggestions">
|
|
612
611
|
<slot
|
|
613
612
|
name="suggestion-view"
|
|
614
613
|
:suggestions="suggestions"
|
|
@@ -616,7 +615,7 @@ onBeforeUnmount(() => {
|
|
|
616
615
|
:on-select-suggestion="handleSelectSuggestion"
|
|
617
616
|
>
|
|
618
617
|
<CopilotChatSuggestionView
|
|
619
|
-
class="cpk
|
|
618
|
+
class="cpk-chat-view-suggestion-view"
|
|
620
619
|
:suggestions="suggestions"
|
|
621
620
|
:loading-indexes="suggestionLoadingIndexes"
|
|
622
621
|
@select-suggestion="handleSelectSuggestion"
|
|
@@ -653,7 +652,7 @@ onBeforeUnmount(() => {
|
|
|
653
652
|
|
|
654
653
|
<div
|
|
655
654
|
v-if="showScrollToBottomButton"
|
|
656
|
-
class="cpk
|
|
655
|
+
class="cpk-chat-view-scroll-to-bottom"
|
|
657
656
|
:style="{ bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` }"
|
|
658
657
|
>
|
|
659
658
|
<slot name="scroll-to-bottom-button" :on-click="() => scrollToBottom()">
|
|
@@ -661,12 +660,11 @@ onBeforeUnmount(() => {
|
|
|
661
660
|
type="button"
|
|
662
661
|
data-testid="copilot-chat-view-scroll-to-bottom"
|
|
663
662
|
:aria-label="labels.chatScrollToBottomLabel"
|
|
664
|
-
|
|
663
|
+
data-slot="button"
|
|
664
|
+
class="cpk-button cpk-button-outline cpk-button-size-sm cpk-chat-view-scroll-to-bottom-button"
|
|
665
665
|
@click="scrollToBottom()"
|
|
666
666
|
>
|
|
667
|
-
<IconChevronDown
|
|
668
|
-
class="cpk:w-4 cpk:h-4 cpk:text-gray-600 cpk:dark:text-white"
|
|
669
|
-
/>
|
|
667
|
+
<IconChevronDown class="cpk-chat-view-scroll-to-bottom-icon" />
|
|
670
668
|
</button>
|
|
671
669
|
</slot>
|
|
672
670
|
</div>
|
|
@@ -681,16 +679,13 @@ onBeforeUnmount(() => {
|
|
|
681
679
|
-->
|
|
682
680
|
<div
|
|
683
681
|
ref="inputContainerRef"
|
|
684
|
-
class="cpk
|
|
682
|
+
class="cpk-chat-view-input-overlay"
|
|
685
683
|
data-testid="copilot-input-overlay"
|
|
686
684
|
>
|
|
687
|
-
<div
|
|
688
|
-
v-if="hasAttachments"
|
|
689
|
-
class="cpk:max-w-3xl cpk:mx-auto cpk:w-full cpk:pointer-events-auto"
|
|
690
|
-
>
|
|
685
|
+
<div v-if="hasAttachments" class="cpk-chat-view-attachments">
|
|
691
686
|
<CopilotChatAttachmentQueue
|
|
692
687
|
:attachments="attachments ?? []"
|
|
693
|
-
class-name="cpk
|
|
688
|
+
class-name="cpk-chat-view-attachment-queue"
|
|
694
689
|
@remove-attachment="
|
|
695
690
|
(id: string) => onRemoveAttachment && onRemoveAttachment(id)
|
|
696
691
|
"
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The line at the top of a reply in the `"turn"` tool-call display. While the
|
|
4
|
+
* agent works it reads "Working 4s"; once the reply is done it reads "Worked
|
|
5
|
+
* for 9s · 7 tools" and toggles the work it folded away.
|
|
6
|
+
*/
|
|
7
|
+
import { computed, ref, watch } from "vue";
|
|
8
|
+
import {
|
|
9
|
+
ɵcountFailedToolCalls,
|
|
10
|
+
ɵformatLabel,
|
|
11
|
+
ɵformatWorkDuration,
|
|
12
|
+
ɵformatCountLabel,
|
|
13
|
+
} from "@copilotkit/core";
|
|
14
|
+
import { IconChevronRight } from "../icons";
|
|
15
|
+
import type { CopilotChatWorkSummarySlotProps } from "./types";
|
|
16
|
+
import { useChatLabels } from "./use-chat-labels";
|
|
17
|
+
|
|
18
|
+
// `onClick` falls through to the button.
|
|
19
|
+
const props = defineProps<Omit<CopilotChatWorkSummarySlotProps, "onClick">>();
|
|
20
|
+
|
|
21
|
+
// The current time, updated every second while the agent works.
|
|
22
|
+
const now = ref(Date.now());
|
|
23
|
+
watch(
|
|
24
|
+
() => props.isWorking,
|
|
25
|
+
(working, _previous, onCleanup) => {
|
|
26
|
+
if (!working) return;
|
|
27
|
+
now.value = Date.now();
|
|
28
|
+
const timer = setInterval(() => {
|
|
29
|
+
now.value = Date.now();
|
|
30
|
+
}, 1000);
|
|
31
|
+
onCleanup(() => clearInterval(timer));
|
|
32
|
+
},
|
|
33
|
+
{ immediate: true },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const labels = useChatLabels();
|
|
37
|
+
const failed = computed(() => ɵcountFailedToolCalls(props.calls));
|
|
38
|
+
const liveMs = computed(() =>
|
|
39
|
+
props.elapsedMs !== undefined && props.workingSince !== undefined
|
|
40
|
+
? props.elapsedMs + Math.max(0, now.value - props.workingSince)
|
|
41
|
+
: undefined,
|
|
42
|
+
);
|
|
43
|
+
// A finished reply worked for at least a second.
|
|
44
|
+
const duration = computed(() =>
|
|
45
|
+
props.elapsedMs !== undefined
|
|
46
|
+
? ɵformatWorkDuration(Math.max(1000, props.elapsedMs))
|
|
47
|
+
: undefined,
|
|
48
|
+
);
|
|
49
|
+
const toolCount = computed(() =>
|
|
50
|
+
ɵformatCountLabel(props.calls.length, {
|
|
51
|
+
one: labels.value.toolCallToolCountOne,
|
|
52
|
+
other: labels.value.toolCallToolCountOther,
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
const doneLabel = computed(() =>
|
|
56
|
+
duration.value
|
|
57
|
+
? ɵformatLabel(labels.value.workSummaryWorkedForLabel, {
|
|
58
|
+
duration: duration.value,
|
|
59
|
+
})
|
|
60
|
+
: ɵformatCountLabel(props.calls.length, {
|
|
61
|
+
one: labels.value.toolCallUsedToolsOne,
|
|
62
|
+
other: labels.value.toolCallUsedToolsOther,
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
const liveDuration = computed(() =>
|
|
66
|
+
liveMs.value !== undefined ? ɵformatWorkDuration(liveMs.value) : undefined,
|
|
67
|
+
);
|
|
68
|
+
const failedLabel = computed(() =>
|
|
69
|
+
ɵformatLabel(labels.value.toolCallFailedCountLabel, {
|
|
70
|
+
count: failed.value,
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
data-copilotkit
|
|
79
|
+
data-testid="copilot-work-summary"
|
|
80
|
+
:data-state="isWorking ? 'working' : 'done'"
|
|
81
|
+
:aria-expanded="isOpen ? 'true' : 'false'"
|
|
82
|
+
class="cpk-work-summary"
|
|
83
|
+
>
|
|
84
|
+
<template v-if="isWorking">
|
|
85
|
+
<span class="cpk-work-summary-label cpk-shimmer">{{
|
|
86
|
+
labels.workSummaryWorkingLabel
|
|
87
|
+
}}</span>
|
|
88
|
+
<span
|
|
89
|
+
v-if="liveDuration !== undefined"
|
|
90
|
+
class="cpk-work-summary-detail cpk-work-summary-timer"
|
|
91
|
+
>{{ liveDuration }}</span
|
|
92
|
+
>
|
|
93
|
+
</template>
|
|
94
|
+
<template v-else>
|
|
95
|
+
<span class="cpk-work-summary-label">{{ doneLabel }}</span>
|
|
96
|
+
<span v-if="duration" class="cpk-work-summary-detail">{{
|
|
97
|
+
toolCount
|
|
98
|
+
}}</span>
|
|
99
|
+
<span v-if="failed > 0" class="cpk-work-summary-failed">{{
|
|
100
|
+
failedLabel
|
|
101
|
+
}}</span>
|
|
102
|
+
</template>
|
|
103
|
+
<IconChevronRight
|
|
104
|
+
aria-hidden="true"
|
|
105
|
+
:class="[
|
|
106
|
+
'cpk-work-summary-chevron',
|
|
107
|
+
isOpen && 'cpk-work-summary-chevron-open',
|
|
108
|
+
]"
|
|
109
|
+
/>
|
|
110
|
+
</button>
|
|
111
|
+
</template>
|
|
@@ -33,8 +33,7 @@ const resolvedTitle = computed(
|
|
|
33
33
|
CopilotChatDefaultLabels.modalHeaderTitle,
|
|
34
34
|
);
|
|
35
35
|
const headerClass = computed(() => [
|
|
36
|
-
"
|
|
37
|
-
"cpk:bg-background/95 cpk:backdrop-blur cpk:supports-[backdrop-filter]:bg-background/80",
|
|
36
|
+
"copilotKitHeader cpk-modal-header",
|
|
38
37
|
attrs.class,
|
|
39
38
|
]);
|
|
40
39
|
const headerAttrs = computed(() => {
|
|
@@ -99,13 +98,13 @@ function toggleDrawer() {
|
|
|
99
98
|
v-bind="headerAttrs"
|
|
100
99
|
>
|
|
101
100
|
<slot name="layout" :title="resolvedTitle" :on-close="handleClose">
|
|
102
|
-
<div class="cpk
|
|
103
|
-
<div class="cpk
|
|
101
|
+
<div class="cpk-modal-header-content">
|
|
102
|
+
<div class="cpk-modal-header-start">
|
|
104
103
|
<button
|
|
105
104
|
v-if="showDrawerLauncher"
|
|
106
105
|
type="button"
|
|
107
106
|
data-testid="drawer-launcher"
|
|
108
|
-
class="cpk
|
|
107
|
+
class="cpk-modal-header-drawer-launcher"
|
|
109
108
|
:aria-expanded="config?.drawerOpen ?? false"
|
|
110
109
|
:aria-label="
|
|
111
110
|
config?.labels.modalHeaderThreadsButtonLabel ??
|
|
@@ -113,18 +112,21 @@ function toggleDrawer() {
|
|
|
113
112
|
"
|
|
114
113
|
@click="toggleDrawer"
|
|
115
114
|
>
|
|
116
|
-
<IconPanelLeftOpen
|
|
115
|
+
<IconPanelLeftOpen
|
|
116
|
+
class="cpk-modal-header-drawer-launcher-icon"
|
|
117
|
+
aria-hidden="true"
|
|
118
|
+
/>
|
|
117
119
|
</button>
|
|
118
120
|
<span v-else aria-hidden="true" />
|
|
119
121
|
</div>
|
|
120
|
-
<div class="cpk
|
|
122
|
+
<div class="cpk-modal-header-center">
|
|
121
123
|
<slot name="title-content" :title="resolvedTitle">
|
|
122
124
|
<CopilotModalHeaderTitle>
|
|
123
125
|
{{ resolvedTitle }}
|
|
124
126
|
</CopilotModalHeaderTitle>
|
|
125
127
|
</slot>
|
|
126
128
|
</div>
|
|
127
|
-
<div class="cpk
|
|
129
|
+
<div class="cpk-modal-header-end">
|
|
128
130
|
<slot name="close-button" :on-close="handleClose">
|
|
129
131
|
<CopilotModalHeaderCloseButton @click="handleClose" />
|
|
130
132
|
</slot>
|
|
@@ -32,16 +32,17 @@ export default defineComponent({
|
|
|
32
32
|
{
|
|
33
33
|
...rest,
|
|
34
34
|
type: typeof type === "string" ? type : "button",
|
|
35
|
-
class: [
|
|
36
|
-
"cpk:inline-flex cpk:size-8 cpk:items-center cpk:justify-center cpk:rounded-full cpk:text-muted-foreground cpk:transition cpk:cursor-pointer",
|
|
37
|
-
"cpk:hover:bg-muted cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring",
|
|
38
|
-
className,
|
|
39
|
-
],
|
|
35
|
+
class: ["cpk-modal-header-close-button", className],
|
|
40
36
|
"aria-label": ariaLabel.value,
|
|
41
37
|
},
|
|
42
38
|
slots.default
|
|
43
39
|
? slots.default()
|
|
44
|
-
: [
|
|
40
|
+
: [
|
|
41
|
+
h(IconX, {
|
|
42
|
+
class: "cpk-modal-header-close-icon",
|
|
43
|
+
"aria-hidden": true,
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
45
46
|
);
|
|
46
47
|
};
|
|
47
48
|
},
|
|
@@ -10,10 +10,7 @@ export default defineComponent({
|
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
...rest,
|
|
13
|
-
class: [
|
|
14
|
-
"cpk:w-full cpk:text-base cpk:font-medium cpk:leading-none cpk:tracking-tight cpk:text-foreground",
|
|
15
|
-
className,
|
|
16
|
-
],
|
|
13
|
+
class: ["cpk-modal-header-title", className],
|
|
17
14
|
},
|
|
18
15
|
slots.default ? slots.default() : [],
|
|
19
16
|
);
|
|
@@ -36,6 +36,7 @@ function popupViewEventBindings(slotProps: CopilotChatViewOverrideSlotProps) {
|
|
|
36
36
|
|
|
37
37
|
const props = withDefaults(defineProps<CopilotPopupProps>(), {
|
|
38
38
|
autoScroll: true,
|
|
39
|
+
messageFeedback: true,
|
|
39
40
|
welcomeScreen: true,
|
|
40
41
|
inputValue: undefined,
|
|
41
42
|
inputMode: "input",
|
|
@@ -116,6 +117,8 @@ watch(
|
|
|
116
117
|
:input-mode="slotProps.inputMode"
|
|
117
118
|
:input-tools-menu="slotProps.inputToolsMenu"
|
|
118
119
|
:width="width"
|
|
120
|
+
:tool-call-display="slotProps.toolCallDisplay"
|
|
121
|
+
:message-feedback="slotProps.messageFeedback"
|
|
119
122
|
:height="height"
|
|
120
123
|
:click-outside-to-close="clickOutsideToClose"
|
|
121
124
|
:default-open="defaultOpen"
|
|
@@ -20,6 +20,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
20
20
|
const props = withDefaults(defineProps<CopilotPopupViewProps>(), {
|
|
21
21
|
messages: () => [],
|
|
22
22
|
autoScroll: true,
|
|
23
|
+
messageFeedback: true,
|
|
23
24
|
isRunning: false,
|
|
24
25
|
suggestions: () => [],
|
|
25
26
|
suggestionLoadingIndexes: () => [],
|
|
@@ -37,6 +37,7 @@ const props = withDefaults(
|
|
|
37
37
|
{
|
|
38
38
|
messages: () => [],
|
|
39
39
|
autoScroll: true,
|
|
40
|
+
messageFeedback: true,
|
|
40
41
|
isRunning: false,
|
|
41
42
|
suggestions: () => [],
|
|
42
43
|
suggestionLoadingIndexes: () => [],
|
|
@@ -96,8 +97,8 @@ const labels = computed(() => config.value?.labels ?? CopilotChatDefaultLabels);
|
|
|
96
97
|
const headerTitle = computed(() => labels.value.modalHeaderTitle);
|
|
97
98
|
const popupAnimationClass = computed(() =>
|
|
98
99
|
isPopupOpen.value && !isAnimatingOut.value
|
|
99
|
-
? "cpk
|
|
100
|
-
:
|
|
100
|
+
? "cpk-popup-view-window-open"
|
|
101
|
+
: undefined,
|
|
101
102
|
);
|
|
102
103
|
const popupStyle = computed(
|
|
103
104
|
() =>
|
|
@@ -109,10 +110,6 @@ const popupStyle = computed(
|
|
|
109
110
|
),
|
|
110
111
|
"--copilot-popup-max-width": "calc(100vw - 3rem)",
|
|
111
112
|
"--copilot-popup-max-height": "calc(100dvh - 7.5rem)",
|
|
112
|
-
width: "var(--copilot-popup-width)",
|
|
113
|
-
height: "var(--copilot-popup-height)",
|
|
114
|
-
maxWidth: "var(--copilot-popup-max-width)",
|
|
115
|
-
maxHeight: "var(--copilot-popup-max-height)",
|
|
116
113
|
paddingTop: "env(safe-area-inset-top)",
|
|
117
114
|
paddingBottom: "env(safe-area-inset-bottom)",
|
|
118
115
|
paddingLeft: "env(safe-area-inset-left)",
|
|
@@ -349,11 +346,7 @@ onBeforeUnmount(() => {
|
|
|
349
346
|
<CopilotChatToggleButton />
|
|
350
347
|
</slot>
|
|
351
348
|
|
|
352
|
-
<div
|
|
353
|
-
v-if="isRendered"
|
|
354
|
-
data-copilotkit
|
|
355
|
-
class="cpk:fixed cpk:inset-0 cpk:z-[1200] cpk:flex cpk:max-w-full cpk:flex-col cpk:items-stretch cpk:bg-transparent cpk:md:inset-auto cpk:md:bottom-24 cpk:md:right-6 cpk:md:items-end cpk:md:gap-4"
|
|
356
|
-
>
|
|
349
|
+
<div v-if="isRendered" data-copilotkit class="cpk-popup-view">
|
|
357
350
|
<div
|
|
358
351
|
ref="containerRef"
|
|
359
352
|
tabindex="-1"
|
|
@@ -361,13 +354,7 @@ onBeforeUnmount(() => {
|
|
|
361
354
|
:aria-label="labels.modalHeaderTitle"
|
|
362
355
|
data-copilot-popup
|
|
363
356
|
:class="[
|
|
364
|
-
'
|
|
365
|
-
'cpk:origin-bottom cpk:focus:outline-none cpk:transform-gpu cpk:transition-transform cpk:transition-opacity cpk:duration-200 cpk:ease-out',
|
|
366
|
-
'cpk:md:transition-transform cpk:md:transition-opacity',
|
|
367
|
-
'cpk:rounded-none cpk:border cpk:border-border/0 cpk:shadow-none cpk:ring-0',
|
|
368
|
-
'cpk:md:h-[var(--copilot-popup-height)] cpk:md:w-[var(--copilot-popup-width)]',
|
|
369
|
-
'cpk:md:max-h-[var(--copilot-popup-max-height)] cpk:md:max-w-[var(--copilot-popup-max-width)]',
|
|
370
|
-
'cpk:md:origin-bottom-right cpk:md:rounded-2xl cpk:md:border-border cpk:md:shadow-xl cpk:md:ring-1 cpk:md:ring-border/40',
|
|
357
|
+
'copilotKitPopup copilotKitWindow cpk-popup-view-window',
|
|
371
358
|
popupAnimationClass,
|
|
372
359
|
]"
|
|
373
360
|
:style="popupStyle"
|
|
@@ -381,8 +368,9 @@ onBeforeUnmount(() => {
|
|
|
381
368
|
<CopilotModalHeader :title="headerTitle" />
|
|
382
369
|
</slot>
|
|
383
370
|
|
|
384
|
-
<div class="cpk
|
|
371
|
+
<div class="cpk-popup-view-chat" data-popup-chat>
|
|
385
372
|
<CopilotChatView
|
|
373
|
+
class="cpk-popup-view-chat-view"
|
|
386
374
|
:messages="messages"
|
|
387
375
|
:auto-scroll="autoScroll"
|
|
388
376
|
:is-running="isRunning"
|
|
@@ -392,6 +380,8 @@ onBeforeUnmount(() => {
|
|
|
392
380
|
:input-value="inputValue"
|
|
393
381
|
:input-mode="inputMode"
|
|
394
382
|
:input-tools-menu="inputToolsMenu"
|
|
383
|
+
:tool-call-display="toolCallDisplay"
|
|
384
|
+
:message-feedback="messageFeedback"
|
|
395
385
|
:on-finish-transcribe-with-audio="onFinishTranscribeWithAudio"
|
|
396
386
|
v-bind="chatViewBindings"
|
|
397
387
|
>
|
|
@@ -127,25 +127,22 @@ const inputEventProps = computed(() => {
|
|
|
127
127
|
<slot name="layout" v-bind="layoutSlotProps">
|
|
128
128
|
<div
|
|
129
129
|
data-copilotkit
|
|
130
|
-
class="cpk
|
|
130
|
+
class="cpk-popup-view-welcome-screen"
|
|
131
131
|
data-testid="copilot-popup-welcome-screen"
|
|
132
132
|
>
|
|
133
|
-
<div
|
|
134
|
-
class="cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4"
|
|
135
|
-
>
|
|
133
|
+
<div class="cpk-popup-view-welcome-screen-message">
|
|
136
134
|
<slot name="welcome-message">
|
|
137
|
-
<h1
|
|
138
|
-
class="cpk:text-xl cpk:sm:text-2xl cpk:font-medium cpk:text-foreground cpk:text-center"
|
|
139
|
-
>
|
|
135
|
+
<h1 class="cpk-chat-view-welcome-message">
|
|
140
136
|
{{ labels.welcomeMessageText }}
|
|
141
137
|
</h1>
|
|
142
138
|
</slot>
|
|
143
139
|
</div>
|
|
144
140
|
|
|
145
141
|
<div>
|
|
146
|
-
<div class="cpk
|
|
142
|
+
<div class="cpk-popup-view-welcome-screen-suggestions">
|
|
147
143
|
<slot name="suggestion-view" v-bind="suggestionViewSlotProps">
|
|
148
144
|
<CopilotChatSuggestionView
|
|
145
|
+
class="cpk-chat-view-suggestion-view"
|
|
149
146
|
:suggestions="suggestions"
|
|
150
147
|
:loading-indexes="loadingIndexes"
|
|
151
148
|
@select-suggestion="onSelectSuggestion"
|
|
@@ -36,12 +36,14 @@ function sidebarViewEventBindings(slotProps: CopilotChatViewOverrideSlotProps) {
|
|
|
36
36
|
|
|
37
37
|
const props = withDefaults(defineProps<CopilotSidebarProps>(), {
|
|
38
38
|
autoScroll: true,
|
|
39
|
+
messageFeedback: true,
|
|
39
40
|
welcomeScreen: true,
|
|
40
41
|
inputValue: undefined,
|
|
41
42
|
inputMode: "input",
|
|
42
43
|
inputToolsMenu: () => [],
|
|
43
44
|
width: undefined,
|
|
44
45
|
defaultOpen: true,
|
|
46
|
+
position: "right",
|
|
45
47
|
onFinishTranscribeWithAudio: undefined,
|
|
46
48
|
});
|
|
47
49
|
|
|
@@ -114,7 +116,10 @@ watch(
|
|
|
114
116
|
:input-mode="slotProps.inputMode"
|
|
115
117
|
:input-tools-menu="slotProps.inputToolsMenu"
|
|
116
118
|
:width="width"
|
|
119
|
+
:tool-call-display="slotProps.toolCallDisplay"
|
|
120
|
+
:message-feedback="slotProps.messageFeedback"
|
|
117
121
|
:default-open="defaultOpen"
|
|
122
|
+
:position="position"
|
|
118
123
|
:on-finish-transcribe-with-audio="slotProps.onFinishTranscribeWithAudio"
|
|
119
124
|
v-bind="sidebarViewEventBindings(slotProps)"
|
|
120
125
|
>
|
|
@@ -18,6 +18,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
18
18
|
const props = withDefaults(defineProps<CopilotSidebarViewProps>(), {
|
|
19
19
|
messages: () => [],
|
|
20
20
|
autoScroll: true,
|
|
21
|
+
messageFeedback: true,
|
|
21
22
|
isRunning: false,
|
|
22
23
|
suggestions: () => [],
|
|
23
24
|
suggestionLoadingIndexes: () => [],
|
|
@@ -27,6 +28,7 @@ const props = withDefaults(defineProps<CopilotSidebarViewProps>(), {
|
|
|
27
28
|
inputToolsMenu: () => [],
|
|
28
29
|
width: undefined,
|
|
29
30
|
defaultOpen: true,
|
|
31
|
+
position: "right",
|
|
30
32
|
onFinishTranscribeWithAudio: undefined,
|
|
31
33
|
});
|
|
32
34
|
|