@copilotkit/vue 1.57.1
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/AGENTS.md +50 -0
- package/CHANGELOG.md +13 -0
- package/PARITY.md +434 -0
- package/README.md +396 -0
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts +20 -0
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts.map +1 -0
- package/dist/components/copilot-provider/index.d.ts +3 -0
- package/dist/components/copilot-provider/index.d.ts.map +1 -0
- package/dist/components/copilot-provider/types.d.ts +22 -0
- package/dist/components/copilot-provider/types.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-copilot-action.d.ts +27 -0
- package/dist/hooks/use-copilot-action.d.ts.map +1 -0
- package/dist/hooks/use-copilot-readable.d.ts +20 -0
- package/dist/hooks/use-copilot-readable.d.ts.map +1 -0
- package/dist/hooks/use-frontend-tool.d.ts +21 -0
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +252 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/use-render-activity-message-BRL1Rpl-.cjs +85 -0
- package/dist/use-render-activity-message-BRL1Rpl-.cjs.map +1 -0
- package/dist/use-render-activity-message-CqtxiFSs.js +8927 -0
- package/dist/use-render-activity-message-CqtxiFSs.js.map +1 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts +9 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -0
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts +16 -0
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts +7 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts.map +1 -0
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts +6 -0
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts.map +1 -0
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts +18 -0
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -0
- package/dist/v2/components/MCPAppsActivityRenderer.d.ts +88 -0
- package/dist/v2/components/MCPAppsActivityRenderer.d.ts.map +1 -0
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +154 -0
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -0
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +19 -0
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +16 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -0
- package/dist/v2/components/a2ui/VueSurface.d.ts +62 -0
- package/dist/v2/components/a2ui/VueSurface.d.ts.map +1 -0
- package/dist/v2/components/a2ui/adapter.d.ts +38 -0
- package/dist/v2/components/a2ui/adapter.d.ts.map +1 -0
- package/dist/v2/components/a2ui/catalog.d.ts +29 -0
- package/dist/v2/components/a2ui/catalog.d.ts.map +1 -0
- package/dist/v2/components/a2ui/index.d.ts +5 -0
- package/dist/v2/components/a2ui/index.d.ts.map +1 -0
- package/dist/v2/components/a2ui/utils.d.ts +18 -0
- package/dist/v2/components/a2ui/utils.d.ts.map +1 -0
- package/dist/v2/components/a2ui.d.ts +12 -0
- package/dist/v2/components/a2ui.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +50 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +164 -0
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts +7 -0
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +290 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +72 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts +65 -0
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts +27 -0
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts +26 -0
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts +17 -0
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonCloseIcon.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonCloseIcon.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonOpenIcon.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonOpenIcon.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +21 -0
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts +34 -0
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +106 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts +15 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts +5 -0
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts +5 -0
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +50 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +55 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +55 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts +28 -0
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +48 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +62 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +53 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts +28 -0
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/audioRecorder.d.ts +11 -0
- package/dist/v2/components/chat/audioRecorder.d.ts.map +1 -0
- package/dist/v2/components/chat/index.d.ts +682 -0
- package/dist/v2/components/chat/index.d.ts.map +1 -0
- package/dist/v2/components/chat/last-user-message-context.d.ts +29 -0
- package/dist/v2/components/chat/last-user-message-context.d.ts.map +1 -0
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts +3 -0
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts.map +1 -0
- package/dist/v2/components/chat/types.d.ts +380 -0
- package/dist/v2/components/chat/types.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +2 -0
- package/dist/v2/components/icons/index.d.ts.map +1 -0
- package/dist/v2/components/index.d.ts +8 -0
- package/dist/v2/components/index.d.ts.map +1 -0
- package/dist/v2/hooks/index.d.ts +24 -0
- package/dist/v2/hooks/index.d.ts.map +1 -0
- package/dist/v2/hooks/use-agent-context.d.ts +24 -0
- package/dist/v2/hooks/use-agent-context.d.ts.map +1 -0
- package/dist/v2/hooks/use-agent.d.ts +53 -0
- package/dist/v2/hooks/use-agent.d.ts.map +1 -0
- package/dist/v2/hooks/use-attachments.d.ts +21 -0
- package/dist/v2/hooks/use-attachments.d.ts.map +1 -0
- package/dist/v2/hooks/use-capabilities.d.ts +16 -0
- package/dist/v2/hooks/use-capabilities.d.ts.map +1 -0
- package/dist/v2/hooks/use-component.d.ts +13 -0
- package/dist/v2/hooks/use-component.d.ts.map +1 -0
- package/dist/v2/hooks/use-configure-suggestions.d.ts +24 -0
- package/dist/v2/hooks/use-configure-suggestions.d.ts.map +1 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts +14 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts +19 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-human-in-the-loop.d.ts +19 -0
- package/dist/v2/hooks/use-human-in-the-loop.d.ts.map +1 -0
- package/dist/v2/hooks/use-interrupt.d.ts +36 -0
- package/dist/v2/hooks/use-interrupt.d.ts.map +1 -0
- package/dist/v2/hooks/use-katex-styles.d.ts +22 -0
- package/dist/v2/hooks/use-katex-styles.d.ts.map +1 -0
- package/dist/v2/hooks/use-keyboard-height.d.ts +33 -0
- package/dist/v2/hooks/use-keyboard-height.d.ts.map +1 -0
- package/dist/v2/hooks/use-pin-to-send.d.ts +28 -0
- package/dist/v2/hooks/use-pin-to-send.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-activity-message.d.ts +21 -0
- package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-custom-messages.d.ts +27 -0
- package/dist/v2/hooks/use-render-custom-messages.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-tool.d.ts +36 -0
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-suggestions.d.ts +26 -0
- package/dist/v2/hooks/use-suggestions.d.ts.map +1 -0
- package/dist/v2/hooks/use-threads.d.ts +42 -0
- package/dist/v2/hooks/use-threads.d.ts.map +1 -0
- package/dist/v2/index.cjs +2 -0
- package/dist/v2/index.cjs.map +1 -0
- package/dist/v2/index.d.cts +9 -0
- package/dist/v2/index.d.mts +9 -0
- package/dist/v2/index.d.ts +9 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.mjs +75 -0
- package/dist/v2/index.mjs.map +1 -0
- package/dist/v2/lib/processPartialHtml.d.ts +3 -0
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -0
- package/dist/v2/lib/shallow-stable.d.ts +7 -0
- package/dist/v2/lib/shallow-stable.d.ts.map +1 -0
- package/dist/v2/lib/transcription-client.d.ts +19 -0
- package/dist/v2/lib/transcription-client.d.ts.map +1 -0
- package/dist/v2/lib/vue-core.d.ts +47 -0
- package/dist/v2/lib/vue-core.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.types.d.ts +15 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.types.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts +17 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -0
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +61 -0
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -0
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +37 -0
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -0
- package/dist/v2/providers/SandboxFunctionsContext.d.ts +4 -0
- package/dist/v2/providers/SandboxFunctionsContext.d.ts.map +1 -0
- package/dist/v2/providers/index.d.ts +13 -0
- package/dist/v2/providers/index.d.ts.map +1 -0
- package/dist/v2/providers/keys.d.ts +17 -0
- package/dist/v2/providers/keys.d.ts.map +1 -0
- package/dist/v2/providers/license-context.d.ts +7 -0
- package/dist/v2/providers/license-context.d.ts.map +1 -0
- package/dist/v2/providers/types.d.ts +38 -0
- package/dist/v2/providers/types.d.ts.map +1 -0
- package/dist/v2/providers/useCopilotChatConfiguration.d.ts +4 -0
- package/dist/v2/providers/useCopilotChatConfiguration.d.ts.map +1 -0
- package/dist/v2/providers/useCopilotKit.d.ts +2 -0
- package/dist/v2/providers/useCopilotKit.d.ts.map +1 -0
- package/dist/v2/providers/useLicenseContext.d.ts +14 -0
- package/dist/v2/providers/useLicenseContext.d.ts.map +1 -0
- package/dist/v2/types/a2ui.d.ts +5 -0
- package/dist/v2/types/a2ui.d.ts.map +1 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts +15 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts.map +1 -0
- package/dist/v2/types/frontend-tool.d.ts +6 -0
- package/dist/v2/types/frontend-tool.d.ts.map +1 -0
- package/dist/v2/types/human-in-the-loop.d.ts +29 -0
- package/dist/v2/types/human-in-the-loop.d.ts.map +1 -0
- package/dist/v2/types/index.d.ts +10 -0
- package/dist/v2/types/index.d.ts.map +1 -0
- package/dist/v2/types/interrupt.d.ts +14 -0
- package/dist/v2/types/interrupt.d.ts.map +1 -0
- package/dist/v2/types/sandbox-function.d.ts +8 -0
- package/dist/v2/types/sandbox-function.d.ts.map +1 -0
- package/dist/v2/types/vue-activity-message-renderer.d.ts +18 -0
- package/dist/v2/types/vue-activity-message-renderer.d.ts.map +1 -0
- package/dist/v2/types/vue-custom-message-renderer.d.ts +19 -0
- package/dist/v2/types/vue-custom-message-renderer.d.ts.map +1 -0
- package/dist/v2/types/vue-tool-call-renderer.d.ts +37 -0
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -0
- package/env.d.ts +7 -0
- package/eslint.config.mjs +42 -0
- package/package.json +130 -0
- package/scripts/scope-preflight.mjs +100 -0
- package/src/components/copilot-provider/CopilotKit.vue +18 -0
- package/src/components/copilot-provider/index.ts +2 -0
- package/src/components/copilot-provider/types.ts +24 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/use-copilot-action.ts +168 -0
- package/src/hooks/use-copilot-readable.ts +75 -0
- package/src/hooks/use-frontend-tool.ts +76 -0
- package/src/index.ts +12 -0
- package/src/styles/globals.css +314 -0
- package/src/v2/__tests__/exports.test.ts +35 -0
- package/src/v2/__tests__/mocks/web-inspector.ts +5 -0
- package/src/v2/__tests__/setup.ts +141 -0
- package/src/v2/__tests__/utils/agents.ts +391 -0
- package/src/v2/__tests__/utils/mount.ts +83 -0
- package/src/v2/__tests__/utils/test-helpers.ts +712 -0
- package/src/v2/components/A2UIMessageRenderer.ts +125 -0
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +186 -0
- package/src/v2/components/CopilotKitInspector.vue +42 -0
- package/src/v2/components/InlineFeatureWarning.vue +35 -0
- package/src/v2/components/LicenseWarningBanner.vue +196 -0
- package/src/v2/components/MCPAppsActivityRenderer.ts +778 -0
- package/src/v2/components/OpenGenerativeUIRenderer.ts +550 -0
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +271 -0
- package/src/v2/components/__tests__/CopilotKitInspector.test.ts +57 -0
- package/src/v2/components/__tests__/MCPAppsActivityRenderer.e2e.test.ts +851 -0
- package/src/v2/components/__tests__/MCPAppsActivityRenderer.test.ts +237 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +516 -0
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +295 -0
- package/src/v2/components/a2ui/A2UICatalogContext.ts +190 -0
- package/src/v2/components/a2ui/VueSurface.ts +144 -0
- package/src/v2/components/a2ui/adapter.ts +156 -0
- package/src/v2/components/a2ui/catalog.ts +858 -0
- package/src/v2/components/a2ui/index.ts +7 -0
- package/src/v2/components/a2ui/utils.ts +67 -0
- package/src/v2/components/a2ui.ts +30 -0
- package/src/v2/components/chat/CopilotChat.vue +777 -0
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +891 -0
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +411 -0
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +87 -0
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +269 -0
- package/src/v2/components/chat/CopilotChatInput.vue +1271 -0
- package/src/v2/components/chat/CopilotChatMessageView.vue +476 -0
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +247 -0
- package/src/v2/components/chat/CopilotChatSuggestionPill.vue +56 -0
- package/src/v2/components/chat/CopilotChatSuggestionView.vue +93 -0
- package/src/v2/components/chat/CopilotChatToggleButton.vue +145 -0
- package/src/v2/components/chat/CopilotChatToggleButtonCloseIcon.ts +17 -0
- package/src/v2/components/chat/CopilotChatToggleButtonOpenIcon.ts +18 -0
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +161 -0
- package/src/v2/components/chat/CopilotChatUserMessage.vue +322 -0
- package/src/v2/components/chat/CopilotChatView.vue +740 -0
- package/src/v2/components/chat/CopilotModalHeader.vue +73 -0
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +38 -0
- package/src/v2/components/chat/CopilotModalHeaderTitle.ts +22 -0
- package/src/v2/components/chat/CopilotPopup.vue +182 -0
- package/src/v2/components/chat/CopilotPopupView.vue +168 -0
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +453 -0
- package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +140 -0
- package/src/v2/components/chat/CopilotSidebar.vue +178 -0
- package/src/v2/components/chat/CopilotSidebarView.vue +172 -0
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +366 -0
- package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +142 -0
- package/src/v2/components/chat/__tests__/CopilotChat.attachments.test.ts +237 -0
- package/src/v2/components/chat/__tests__/CopilotChat.e2e.test.ts +1240 -0
- package/src/v2/components/chat/__tests__/CopilotChat.licenseWarning.test.ts +138 -0
- package/src/v2/components/chat/__tests__/CopilotChat.onError.test.ts +85 -0
- package/src/v2/components/chat/__tests__/CopilotChat.slots.e2e.test.ts +141 -0
- package/src/v2/components/chat/__tests__/CopilotChat.test.ts +652 -0
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +683 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.slots.e2e.test.ts +768 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.ts +1108 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.thumbs.test.ts +87 -0
- package/src/v2/components/chat/__tests__/CopilotChatAttachmentQueue.test.ts +277 -0
- package/src/v2/components/chat/__tests__/CopilotChatAttachmentRenderer.test.ts +124 -0
- package/src/v2/components/chat/__tests__/CopilotChatCopyButton.clipboard.test.ts +230 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.bottomAnchored.test.ts +83 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.slots.e2e.test.ts +1139 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +1051 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.slots.e2e.test.ts +141 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +494 -0
- package/src/v2/components/chat/__tests__/CopilotChatPropsRerender.e2e.test.ts +181 -0
- package/src/v2/components/chat/__tests__/CopilotChatReasoningMessage.test.ts +73 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionPill.test.ts +73 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.slots.e2e.test.ts +674 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.test.ts +91 -0
- package/src/v2/components/chat/__tests__/CopilotChatToggleButton.test.ts +93 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolCallsView.test.ts +382 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolRendering.e2e.test.ts +1019 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolRerenders.e2e.test.ts +516 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.slots.e2e.test.ts +701 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.test.ts +337 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.connectingGate.test.ts +135 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.inputOverlay.test.ts +278 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.onClick.e2e.test.ts +1082 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.ts +166 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.slots.e2e.test.ts +1145 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.test.ts +374 -0
- package/src/v2/components/chat/__tests__/CopilotModalHeader.slots.e2e.test.ts +636 -0
- package/src/v2/components/chat/__tests__/CopilotModalHeader.test.ts +112 -0
- package/src/v2/components/chat/__tests__/CopilotPopup.test.ts +58 -0
- package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +725 -0
- package/src/v2/components/chat/__tests__/CopilotPopupView.test.ts +112 -0
- package/src/v2/components/chat/__tests__/CopilotSidebar.test.ts +58 -0
- package/src/v2/components/chat/__tests__/CopilotSidebarView.slots.e2e.test.ts +603 -0
- package/src/v2/components/chat/__tests__/CopilotSidebarView.test.ts +214 -0
- package/src/v2/components/chat/__tests__/MCPAppsUiMessage.e2e.test.ts +394 -0
- package/src/v2/components/chat/__tests__/copilot-chat-throttle.test.ts +82 -0
- package/src/v2/components/chat/__tests__/normalize-auto-scroll.test.ts +39 -0
- package/src/v2/components/chat/audioRecorder.ts +15 -0
- package/src/v2/components/chat/index.ts +52 -0
- package/src/v2/components/chat/last-user-message-context.ts +39 -0
- package/src/v2/components/chat/normalize-auto-scroll.ts +17 -0
- package/src/v2/components/chat/types.ts +481 -0
- package/src/v2/components/icons/__tests__/icons.test.ts +86 -0
- package/src/v2/components/icons/index.ts +22 -0
- package/src/v2/components/index.ts +7 -0
- package/src/v2/hooks/__tests__/standard-schema-types.test.ts +149 -0
- package/src/v2/hooks/__tests__/standard-schema.test.ts +315 -0
- package/src/v2/hooks/__tests__/use-agent-context-timing.e2e.test.ts +144 -0
- package/src/v2/hooks/__tests__/use-agent-context.test.ts +271 -0
- package/src/v2/hooks/__tests__/use-agent-error-state.test.ts +64 -0
- package/src/v2/hooks/__tests__/use-agent-stability.test.ts +268 -0
- package/src/v2/hooks/__tests__/use-agent-thread-isolation.test.ts +433 -0
- package/src/v2/hooks/__tests__/use-agent-throttle.test.ts +747 -0
- package/src/v2/hooks/__tests__/use-agent.e2e.test.ts +187 -0
- package/src/v2/hooks/__tests__/use-agent.test.ts +126 -0
- package/src/v2/hooks/__tests__/use-attachments.test.ts +181 -0
- package/src/v2/hooks/__tests__/use-component.test.ts +145 -0
- package/src/v2/hooks/__tests__/use-configure-suggestions.e2e.test.ts +527 -0
- package/src/v2/hooks/__tests__/use-configure-suggestions.test.ts +399 -0
- package/src/v2/hooks/__tests__/use-default-render-tool.test.ts +214 -0
- package/src/v2/hooks/__tests__/use-frontend-tool-available.test.ts +220 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +2320 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.test.ts +648 -0
- package/src/v2/hooks/__tests__/use-human-in-the-loop.e2e.test.ts +1379 -0
- package/src/v2/hooks/__tests__/use-human-in-the-loop.test.ts +282 -0
- package/src/v2/hooks/__tests__/use-interrupt.test.ts +345 -0
- package/src/v2/hooks/__tests__/use-katex-styles.test.ts +69 -0
- package/src/v2/hooks/__tests__/use-keyboard-height.test.ts +199 -0
- package/src/v2/hooks/__tests__/use-pin-to-send.test.ts +363 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +329 -0
- package/src/v2/hooks/__tests__/use-suggestions.e2e.test.ts +397 -0
- package/src/v2/hooks/__tests__/use-suggestions.test.ts +198 -0
- package/src/v2/hooks/__tests__/use-threads.test.ts +1041 -0
- package/src/v2/hooks/__tests__/zod-regression.test.ts +339 -0
- package/src/v2/hooks/index.ts +29 -0
- package/src/v2/hooks/use-agent-context.ts +55 -0
- package/src/v2/hooks/use-agent.ts +345 -0
- package/src/v2/hooks/use-attachments.ts +261 -0
- package/src/v2/hooks/use-capabilities.ts +30 -0
- package/src/v2/hooks/use-component.ts +46 -0
- package/src/v2/hooks/use-configure-suggestions.ts +252 -0
- package/src/v2/hooks/use-default-render-tool.ts +130 -0
- package/src/v2/hooks/use-frontend-tool.ts +68 -0
- package/src/v2/hooks/use-human-in-the-loop.ts +90 -0
- package/src/v2/hooks/use-interrupt.ts +257 -0
- package/src/v2/hooks/use-katex-styles.ts +44 -0
- package/src/v2/hooks/use-keyboard-height.ts +87 -0
- package/src/v2/hooks/use-pin-to-send.ts +160 -0
- package/src/v2/hooks/use-render-activity-message.ts +92 -0
- package/src/v2/hooks/use-render-custom-messages.ts +129 -0
- package/src/v2/hooks/use-render-tool.ts +128 -0
- package/src/v2/hooks/use-suggestions.ts +98 -0
- package/src/v2/hooks/use-threads.ts +208 -0
- package/src/v2/index.ts +11 -0
- package/src/v2/lib/__tests__/processPartialHtml.test.ts +84 -0
- package/src/v2/lib/__tests__/transcription-client.test.ts +65 -0
- package/src/v2/lib/processPartialHtml.ts +21 -0
- package/src/v2/lib/shallow-stable.ts +54 -0
- package/src/v2/lib/transcription-client.ts +151 -0
- package/src/v2/lib/vue-core.ts +161 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.types.ts +15 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +95 -0
- package/src/v2/providers/CopilotKitProvider.types.ts +66 -0
- package/src/v2/providers/CopilotKitProvider.vue +653 -0
- package/src/v2/providers/SandboxFunctionsContext.ts +11 -0
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.test.ts +309 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.debug.test.ts +295 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.license.test.ts +110 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.onError.test.ts +67 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.renderCustomMessages.e2e.test.ts +901 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.sandboxFunctions.test.ts +141 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.stability.test.ts +871 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +603 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.wildcard.test.ts +104 -0
- package/src/v2/providers/index.ts +21 -0
- package/src/v2/providers/keys.ts +25 -0
- package/src/v2/providers/license-context.ts +16 -0
- package/src/v2/providers/types.ts +40 -0
- package/src/v2/providers/useCopilotChatConfiguration.ts +11 -0
- package/src/v2/providers/useCopilotKit.ts +11 -0
- package/src/v2/providers/useLicenseContext.ts +21 -0
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +157 -0
- package/src/v2/types/a2ui.ts +5 -0
- package/src/v2/types/defineToolCallRenderer.ts +32 -0
- package/src/v2/types/frontend-tool.ts +8 -0
- package/src/v2/types/human-in-the-loop.ts +38 -0
- package/src/v2/types/index.ts +9 -0
- package/src/v2/types/interrupt.ts +15 -0
- package/src/v2/types/sandbox-function.ts +8 -0
- package/src/v2/types/vue-activity-message-renderer.ts +22 -0
- package/src/v2/types/vue-custom-message-renderer.ts +24 -0
- package/src/v2/types/vue-tool-call-renderer.ts +44 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +49 -0
- package/vitest.config.ts +23 -0
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
AGUIConnectNotImplementedError,
|
|
4
|
+
AbstractAgent,
|
|
5
|
+
HttpAgent,
|
|
6
|
+
} from "@ag-ui/client";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_AGENT_ID,
|
|
9
|
+
randomUUID,
|
|
10
|
+
TranscriptionErrorCode,
|
|
11
|
+
} from "@copilotkit/shared";
|
|
12
|
+
import {
|
|
13
|
+
computed,
|
|
14
|
+
onBeforeUnmount,
|
|
15
|
+
onMounted,
|
|
16
|
+
provide,
|
|
17
|
+
ref,
|
|
18
|
+
shallowRef,
|
|
19
|
+
useAttrs,
|
|
20
|
+
useSlots,
|
|
21
|
+
watch,
|
|
22
|
+
} from "vue";
|
|
23
|
+
import type { Suggestion } from "@copilotkit/core";
|
|
24
|
+
import CopilotChatConfigurationProvider from "../../providers/CopilotChatConfigurationProvider.vue";
|
|
25
|
+
import { useCopilotChatConfiguration } from "../../providers/useCopilotChatConfiguration";
|
|
26
|
+
import { useCopilotKit } from "../../providers/useCopilotKit";
|
|
27
|
+
import { useLicenseContext } from "../../providers/useLicenseContext";
|
|
28
|
+
import InlineFeatureWarning from "../InlineFeatureWarning.vue";
|
|
29
|
+
import { useAgent } from "../../hooks/use-agent";
|
|
30
|
+
import { useSuggestions } from "../../hooks/use-suggestions";
|
|
31
|
+
import { useAttachments } from "../../hooks/use-attachments";
|
|
32
|
+
import { useShallowStableRef } from "../../lib/shallow-stable";
|
|
33
|
+
import {
|
|
34
|
+
transcribeAudio,
|
|
35
|
+
TranscriptionError,
|
|
36
|
+
} from "../../lib/transcription-client";
|
|
37
|
+
import CopilotChatView from "./CopilotChatView.vue";
|
|
38
|
+
import {
|
|
39
|
+
LastUserMessageKey,
|
|
40
|
+
type LastUserMessageState,
|
|
41
|
+
} from "./last-user-message-context";
|
|
42
|
+
import type { Message } from "@ag-ui/core";
|
|
43
|
+
import type { InputContent } from "@copilotkit/shared";
|
|
44
|
+
import type {
|
|
45
|
+
CopilotChatInputSlotProps,
|
|
46
|
+
CopilotChatProps,
|
|
47
|
+
CopilotChatInterruptSlotProps,
|
|
48
|
+
CopilotChatSuggestionViewSlotProps,
|
|
49
|
+
CopilotChatViewOverrideSlotProps,
|
|
50
|
+
CopilotChatWelcomeScreenSlotProps,
|
|
51
|
+
} from "./types";
|
|
52
|
+
|
|
53
|
+
defineOptions({ inheritAttrs: false });
|
|
54
|
+
|
|
55
|
+
const props = withDefaults(defineProps<CopilotChatProps>(), {
|
|
56
|
+
autoScroll: true,
|
|
57
|
+
welcomeScreen: true,
|
|
58
|
+
inputValue: undefined,
|
|
59
|
+
inputMode: "input",
|
|
60
|
+
inputToolsMenu: () => [],
|
|
61
|
+
onFinishTranscribeWithAudio: undefined,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
defineSlots<{
|
|
65
|
+
"chat-view"?: (props: CopilotChatViewOverrideSlotProps) => unknown;
|
|
66
|
+
"message-view"?: (props: {
|
|
67
|
+
messages: Message[];
|
|
68
|
+
isRunning: boolean;
|
|
69
|
+
}) => unknown;
|
|
70
|
+
interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
|
|
71
|
+
input?: (props: CopilotChatInputSlotProps) => unknown;
|
|
72
|
+
"suggestion-view"?: (props: CopilotChatSuggestionViewSlotProps) => unknown;
|
|
73
|
+
"welcome-screen"?: (props: CopilotChatWelcomeScreenSlotProps) => unknown;
|
|
74
|
+
"welcome-message"?: () => unknown;
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
[key: string]: ((props: any) => unknown) | undefined;
|
|
77
|
+
}>();
|
|
78
|
+
|
|
79
|
+
const emit = defineEmits<{
|
|
80
|
+
"submit-message": [value: string];
|
|
81
|
+
stop: [];
|
|
82
|
+
"input-change": [value: string];
|
|
83
|
+
"select-suggestion": [suggestion: Suggestion, index: number];
|
|
84
|
+
"add-file": [];
|
|
85
|
+
"start-transcribe": [];
|
|
86
|
+
"cancel-transcribe": [];
|
|
87
|
+
"finish-transcribe": [];
|
|
88
|
+
}>();
|
|
89
|
+
|
|
90
|
+
const attrs = useAttrs();
|
|
91
|
+
const componentSlots = useSlots();
|
|
92
|
+
const existingConfig = useCopilotChatConfiguration();
|
|
93
|
+
const { copilotkit } = useCopilotKit();
|
|
94
|
+
const forwardedChatViewSlotNames = computed(() =>
|
|
95
|
+
Object.keys(componentSlots).filter((slotName) => slotName !== "chat-view"),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const generatedThreadId = ref(randomUUID());
|
|
99
|
+
const transcribeMode = ref<"input" | "transcribe" | "processing">("input");
|
|
100
|
+
const inputValue = ref(props.inputValue ?? "");
|
|
101
|
+
const transcriptionError = ref<string | null>(null);
|
|
102
|
+
const isTranscribing = ref(false);
|
|
103
|
+
const isMounted = ref(false);
|
|
104
|
+
const isUnmounting = ref(false);
|
|
105
|
+
|
|
106
|
+
type ActiveConnectCycle = {
|
|
107
|
+
core: object;
|
|
108
|
+
agent: AbstractAgent;
|
|
109
|
+
threadId: string;
|
|
110
|
+
abortController: AbortController;
|
|
111
|
+
detached: boolean;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const activeConnectCycle = shallowRef<ActiveConnectCycle | null>(null);
|
|
115
|
+
|
|
116
|
+
const resolvedAgentId = computed(
|
|
117
|
+
() => props.agentId ?? existingConfig.value?.agentId ?? DEFAULT_AGENT_ID,
|
|
118
|
+
);
|
|
119
|
+
// "Provided" — supplied by either the caller's prop or a wrapping
|
|
120
|
+
// CopilotChatConfigurationProvider. Distinct from `resolvedThreadId`, which
|
|
121
|
+
// falls back to a locally minted UUID when neither source is set. We only
|
|
122
|
+
// gate `/connect` on a provided id; the local UUID has never been seen by
|
|
123
|
+
// the backend and would always 404.
|
|
124
|
+
const providedThreadId = computed(
|
|
125
|
+
() => props.threadId ?? existingConfig.value?.threadId,
|
|
126
|
+
);
|
|
127
|
+
const resolvedThreadId = computed(
|
|
128
|
+
() => providedThreadId.value ?? generatedThreadId.value,
|
|
129
|
+
);
|
|
130
|
+
// "Explicit" means the caller actually picked this thread — via the
|
|
131
|
+
// `threadId` prop on CopilotChat or a wrapping provider that flagged its
|
|
132
|
+
// threadId as caller-chosen. An auto-minted UUID leaking down through a
|
|
133
|
+
// CopilotChatConfigurationProvider does NOT count.
|
|
134
|
+
const hasExplicitThreadId = computed(
|
|
135
|
+
() => !!props.threadId || !!existingConfig.value?.hasExplicitThreadId,
|
|
136
|
+
);
|
|
137
|
+
const lastConnectedThreadId = ref<string | null>(null);
|
|
138
|
+
const isConnecting = computed(
|
|
139
|
+
() =>
|
|
140
|
+
hasExplicitThreadId.value &&
|
|
141
|
+
lastConnectedThreadId.value !== resolvedThreadId.value,
|
|
142
|
+
);
|
|
143
|
+
const stableLabels = useShallowStableRef(computed(() => props.labels));
|
|
144
|
+
const resolvedLabels = computed(() => stableLabels.value);
|
|
145
|
+
|
|
146
|
+
const { agent } = useAgent({
|
|
147
|
+
agentId: resolvedAgentId,
|
|
148
|
+
threadId: resolvedThreadId,
|
|
149
|
+
throttleMs: computed(() => props.throttleMs),
|
|
150
|
+
});
|
|
151
|
+
const { suggestions: autoSuggestions } = useSuggestions({
|
|
152
|
+
agentId: resolvedAgentId,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const license = useLicenseContext();
|
|
156
|
+
const isChatLicensed = computed(() => license.value.checkFeature("chat"));
|
|
157
|
+
|
|
158
|
+
watch(
|
|
159
|
+
isChatLicensed,
|
|
160
|
+
(licensed) => {
|
|
161
|
+
if (!licensed) {
|
|
162
|
+
console.warn(
|
|
163
|
+
'[CopilotKit] Warning: "chat" feature is not licensed. Visit copilotkit.ai/pricing',
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{ immediate: true },
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const isTranscriptionEnabled = computed(
|
|
171
|
+
() => copilotkit.value.audioFileTranscriptionEnabled,
|
|
172
|
+
);
|
|
173
|
+
const isMediaRecorderSupported = computed(
|
|
174
|
+
() => typeof window !== "undefined" && typeof MediaRecorder !== "undefined",
|
|
175
|
+
);
|
|
176
|
+
const showTranscription = computed(
|
|
177
|
+
() => isTranscriptionEnabled.value && isMediaRecorderSupported.value,
|
|
178
|
+
);
|
|
179
|
+
const {
|
|
180
|
+
attachments,
|
|
181
|
+
enabled: attachmentsEnabled,
|
|
182
|
+
dragOver,
|
|
183
|
+
fileInputRef,
|
|
184
|
+
containerRef: attachmentContainerRef,
|
|
185
|
+
handleFileUpload,
|
|
186
|
+
handleDragOver,
|
|
187
|
+
handleDragLeave,
|
|
188
|
+
handleDrop,
|
|
189
|
+
removeAttachment,
|
|
190
|
+
consumeAttachments,
|
|
191
|
+
} = useAttachments({
|
|
192
|
+
config: computed(() => props.attachments),
|
|
193
|
+
});
|
|
194
|
+
const effectiveMode = computed<"input" | "transcribe" | "processing">(() =>
|
|
195
|
+
isTranscribing.value ? "processing" : transcribeMode.value,
|
|
196
|
+
);
|
|
197
|
+
const runLifecycleTick = ref(0);
|
|
198
|
+
const messages = computed(() => [...(agent.value?.messages ?? [])]);
|
|
199
|
+
const isRunning = computed(() => {
|
|
200
|
+
void runLifecycleTick.value;
|
|
201
|
+
return agent.value?.isRunning ?? false;
|
|
202
|
+
});
|
|
203
|
+
const shouldAllowStop = computed(
|
|
204
|
+
() => isRunning.value && messages.value.length > 0,
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
// Track the latest user message id so descendants (notably `usePinToSend`
|
|
208
|
+
// inside `CopilotChatView`) can anchor to the most recent user turn.
|
|
209
|
+
// Mirrors React `CopilotChat.tsx` `lastUserMessageId` + `sendNonce` state.
|
|
210
|
+
const lastUserMessageId = computed<string | null>(() => {
|
|
211
|
+
for (let i = messages.value.length - 1; i >= 0; i--) {
|
|
212
|
+
const message = messages.value[i];
|
|
213
|
+
if (message?.role === "user") return message.id;
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
});
|
|
217
|
+
const sendNonce = ref(0);
|
|
218
|
+
// Seed with the current value so restoring a thread with existing messages
|
|
219
|
+
// does not count as a new send. Only later id transitions bump.
|
|
220
|
+
let prevLastUserMessageId: string | null = lastUserMessageId.value;
|
|
221
|
+
watch(lastUserMessageId, (next) => {
|
|
222
|
+
if (next && next !== prevLastUserMessageId) {
|
|
223
|
+
sendNonce.value += 1;
|
|
224
|
+
prevLastUserMessageId = next;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
const lastUserMessageState = computed<LastUserMessageState>(() => ({
|
|
228
|
+
id: lastUserMessageId.value,
|
|
229
|
+
sendNonce: sendNonce.value,
|
|
230
|
+
}));
|
|
231
|
+
provide(LastUserMessageKey, lastUserMessageState);
|
|
232
|
+
|
|
233
|
+
watch(
|
|
234
|
+
() => agent.value,
|
|
235
|
+
(currentAgent, _previous, onCleanup) => {
|
|
236
|
+
if (!currentAgent) return;
|
|
237
|
+
const sub = currentAgent.subscribe({
|
|
238
|
+
onRunStartedEvent: () => {
|
|
239
|
+
runLifecycleTick.value += 1;
|
|
240
|
+
},
|
|
241
|
+
onRunFinishedEvent: () => {
|
|
242
|
+
runLifecycleTick.value += 1;
|
|
243
|
+
},
|
|
244
|
+
onRunErrorEvent: () => {
|
|
245
|
+
runLifecycleTick.value += 1;
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
onCleanup(() => sub.unsubscribe());
|
|
249
|
+
},
|
|
250
|
+
{ immediate: true },
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
watch(
|
|
254
|
+
() => props.inputValue,
|
|
255
|
+
(next) => {
|
|
256
|
+
if (next !== undefined) {
|
|
257
|
+
inputValue.value = next;
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
watch(
|
|
263
|
+
[() => props.threadId, () => existingConfig.value?.threadId],
|
|
264
|
+
([threadId, inheritedThreadId], previousValues) => {
|
|
265
|
+
if (threadId || inheritedThreadId) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (previousValues && (previousValues[0] || previousValues[1])) {
|
|
270
|
+
generatedThreadId.value = randomUUID();
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
watch(
|
|
276
|
+
[() => copilotkit.value, resolvedAgentId, () => props.onError],
|
|
277
|
+
([core, agentId, onError], _old, onCleanup) => {
|
|
278
|
+
if (!onError) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const subscription = core.subscribe({
|
|
283
|
+
onError: (event) => {
|
|
284
|
+
if (event.context?.agentId === agentId || !event.context?.agentId) {
|
|
285
|
+
void onError({
|
|
286
|
+
error: event.error,
|
|
287
|
+
code: event.code,
|
|
288
|
+
context: event.context,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
onCleanup(() => subscription.unsubscribe());
|
|
295
|
+
},
|
|
296
|
+
{ immediate: true },
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
watch(
|
|
300
|
+
[
|
|
301
|
+
isMounted,
|
|
302
|
+
() => copilotkit.value,
|
|
303
|
+
() => agent.value,
|
|
304
|
+
resolvedThreadId,
|
|
305
|
+
hasExplicitThreadId,
|
|
306
|
+
],
|
|
307
|
+
([mounted, core, currentAgent, threadId, isExplicit], _old, onCleanup) => {
|
|
308
|
+
if (!mounted) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (typeof window === "undefined") {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (!currentAgent) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
// When the caller hasn't picked a specific thread, resolvedThreadId is
|
|
318
|
+
// a UUID minted locally. The backend has never seen it, so /connect
|
|
319
|
+
// would always 404 — skip the call. A real thread is only created
|
|
320
|
+
// once the user runs the agent for the first time.
|
|
321
|
+
if (!isExplicit) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const abstractAgentPrototype = AbstractAgent.prototype as unknown as {
|
|
326
|
+
connect?: unknown;
|
|
327
|
+
connectAgent?: unknown;
|
|
328
|
+
};
|
|
329
|
+
const inspectableAgent = currentAgent as unknown as {
|
|
330
|
+
connect?: unknown;
|
|
331
|
+
connectAgent?: unknown;
|
|
332
|
+
};
|
|
333
|
+
const hasCustomConnect =
|
|
334
|
+
inspectableAgent.connect !== abstractAgentPrototype.connect;
|
|
335
|
+
const hasCustomConnectAgent =
|
|
336
|
+
inspectableAgent.connectAgent !== abstractAgentPrototype.connectAgent;
|
|
337
|
+
if (!hasCustomConnect && !hasCustomConnectAgent) {
|
|
338
|
+
// No custom connect to wait for — mark as connected so the welcome
|
|
339
|
+
// suppression / suggestion gating release immediately.
|
|
340
|
+
lastConnectedThreadId.value = threadId;
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const existingCycle = activeConnectCycle.value;
|
|
345
|
+
const hasSameDeps =
|
|
346
|
+
existingCycle &&
|
|
347
|
+
existingCycle.core === (core as object) &&
|
|
348
|
+
existingCycle.agent === currentAgent &&
|
|
349
|
+
existingCycle.threadId === threadId;
|
|
350
|
+
|
|
351
|
+
let cycle: ActiveConnectCycle;
|
|
352
|
+
if (hasSameDeps && existingCycle) {
|
|
353
|
+
cycle = existingCycle;
|
|
354
|
+
} else {
|
|
355
|
+
const connectAbortController = new AbortController();
|
|
356
|
+
if (currentAgent instanceof HttpAgent) {
|
|
357
|
+
currentAgent.abortController = connectAbortController;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
cycle = {
|
|
361
|
+
core: core as object,
|
|
362
|
+
agent: currentAgent,
|
|
363
|
+
threadId,
|
|
364
|
+
abortController: connectAbortController,
|
|
365
|
+
detached: false,
|
|
366
|
+
};
|
|
367
|
+
activeConnectCycle.value = cycle;
|
|
368
|
+
|
|
369
|
+
void core
|
|
370
|
+
.connectAgent({ agent: currentAgent })
|
|
371
|
+
.catch((error: unknown) => {
|
|
372
|
+
if (cycle.detached) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (error instanceof AGUIConnectNotImplementedError) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
console.error("CopilotChat: connectAgent failed", error);
|
|
379
|
+
})
|
|
380
|
+
.finally(() => {
|
|
381
|
+
// Whether the connect succeeded or failed, we're no longer in
|
|
382
|
+
// the transitional "connecting" state for this thread — release
|
|
383
|
+
// the welcome / suggestion gating so the view can settle.
|
|
384
|
+
//
|
|
385
|
+
// Defer one animation frame so any trailing reactive commits
|
|
386
|
+
// from the bootstrap replay (final assistant message content)
|
|
387
|
+
// paint before isConnecting flips off. Without this, suggestions
|
|
388
|
+
// can briefly render against an incompletely-laid-out message
|
|
389
|
+
// tree and visibly snap once the last text chunk lands.
|
|
390
|
+
if (cycle.detached) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const raf =
|
|
394
|
+
typeof requestAnimationFrame === "function"
|
|
395
|
+
? requestAnimationFrame
|
|
396
|
+
: (cb: () => void) => setTimeout(cb, 16);
|
|
397
|
+
raf(() => {
|
|
398
|
+
if (cycle.detached) return;
|
|
399
|
+
lastConnectedThreadId.value = cycle.threadId;
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
onCleanup(() => {
|
|
405
|
+
const activeCycle = activeConnectCycle.value;
|
|
406
|
+
if (!activeCycle || activeCycle !== cycle) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const shouldDetach =
|
|
411
|
+
isUnmounting.value ||
|
|
412
|
+
copilotkit.value !== activeCycle.core ||
|
|
413
|
+
agent.value !== activeCycle.agent ||
|
|
414
|
+
resolvedThreadId.value !== activeCycle.threadId;
|
|
415
|
+
if (!shouldDetach) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
activeCycle.detached = true;
|
|
420
|
+
activeCycle.abortController.abort();
|
|
421
|
+
void activeCycle.agent.detachActiveRun?.();
|
|
422
|
+
activeConnectCycle.value = null;
|
|
423
|
+
});
|
|
424
|
+
},
|
|
425
|
+
{ immediate: true },
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
onBeforeUnmount(() => {
|
|
429
|
+
isUnmounting.value = true;
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
onMounted(() => {
|
|
433
|
+
isMounted.value = true;
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
watch(transcriptionError, (next, _old, onCleanup) => {
|
|
437
|
+
if (!next) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
const timer = setTimeout(() => {
|
|
441
|
+
transcriptionError.value = null;
|
|
442
|
+
}, 5000);
|
|
443
|
+
onCleanup(() => clearTimeout(timer));
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
async function runCurrentAgent() {
|
|
447
|
+
const currentAgent = agent.value;
|
|
448
|
+
if (!currentAgent) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
try {
|
|
453
|
+
const activeCycle = activeConnectCycle.value;
|
|
454
|
+
if (
|
|
455
|
+
activeCycle &&
|
|
456
|
+
activeCycle.agent === currentAgent &&
|
|
457
|
+
activeCycle.threadId === resolvedThreadId.value
|
|
458
|
+
) {
|
|
459
|
+
activeCycle.detached = true;
|
|
460
|
+
activeCycle.abortController.abort();
|
|
461
|
+
activeConnectCycle.value = null;
|
|
462
|
+
await activeCycle.agent.detachActiveRun?.();
|
|
463
|
+
}
|
|
464
|
+
await copilotkit.value.runAgent({ agent: currentAgent });
|
|
465
|
+
} catch (error) {
|
|
466
|
+
console.error("CopilotChat: runAgent failed", error);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
async function handleSubmitMessage(value: string) {
|
|
471
|
+
const hasUploading = attachments.value.some(
|
|
472
|
+
(attachment) => attachment.status === "uploading",
|
|
473
|
+
);
|
|
474
|
+
if (hasUploading) {
|
|
475
|
+
console.error("[CopilotKit] Cannot send while attachments are uploading");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
emit("submit-message", value);
|
|
480
|
+
|
|
481
|
+
if (!agent.value) {
|
|
482
|
+
console.error("[CopilotKit] Cannot send message: no agent available");
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const readyAttachments = consumeAttachments();
|
|
487
|
+
if (readyAttachments.length > 0) {
|
|
488
|
+
const contentParts: InputContent[] = [];
|
|
489
|
+
if (value.trim()) {
|
|
490
|
+
contentParts.push({ type: "text", text: value });
|
|
491
|
+
}
|
|
492
|
+
for (const attachment of readyAttachments) {
|
|
493
|
+
contentParts.push({
|
|
494
|
+
type: attachment.type,
|
|
495
|
+
source: attachment.source,
|
|
496
|
+
metadata: {
|
|
497
|
+
...(attachment.filename ? { filename: attachment.filename } : {}),
|
|
498
|
+
...attachment.metadata,
|
|
499
|
+
},
|
|
500
|
+
} as InputContent);
|
|
501
|
+
}
|
|
502
|
+
agent.value.addMessage({
|
|
503
|
+
id: randomUUID(),
|
|
504
|
+
role: "user",
|
|
505
|
+
content: contentParts,
|
|
506
|
+
});
|
|
507
|
+
} else {
|
|
508
|
+
agent.value.addMessage({
|
|
509
|
+
id: randomUUID(),
|
|
510
|
+
role: "user",
|
|
511
|
+
content: value,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
inputValue.value = "";
|
|
516
|
+
await runCurrentAgent();
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
async function handleSelectSuggestion(suggestion: Suggestion, index: number) {
|
|
520
|
+
emit("select-suggestion", suggestion, index);
|
|
521
|
+
agent.value?.addMessage({
|
|
522
|
+
id: randomUUID(),
|
|
523
|
+
role: "user",
|
|
524
|
+
content: suggestion.message,
|
|
525
|
+
});
|
|
526
|
+
await runCurrentAgent();
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function stopCurrentRun() {
|
|
530
|
+
const currentAgent = agent.value;
|
|
531
|
+
if (!currentAgent) {
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
try {
|
|
536
|
+
copilotkit.value.stopAgent({ agent: currentAgent });
|
|
537
|
+
} catch (error) {
|
|
538
|
+
console.error("CopilotChat: stopAgent failed", error);
|
|
539
|
+
try {
|
|
540
|
+
currentAgent.abortRun();
|
|
541
|
+
} catch (abortError) {
|
|
542
|
+
console.error("CopilotChat: abortRun fallback failed", abortError);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function handleStop() {
|
|
548
|
+
emit("stop");
|
|
549
|
+
if (shouldAllowStop.value) {
|
|
550
|
+
stopCurrentRun();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
function handleInputChange(value: string) {
|
|
555
|
+
inputValue.value = value;
|
|
556
|
+
emit("input-change", value);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function handleAddFile() {
|
|
560
|
+
emit("add-file");
|
|
561
|
+
if (!attachmentsEnabled.value) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
setTimeout(() => {
|
|
565
|
+
fileInputRef.value?.click();
|
|
566
|
+
}, 100);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function handleStartTranscribe() {
|
|
570
|
+
transcriptionError.value = null;
|
|
571
|
+
transcribeMode.value = "transcribe";
|
|
572
|
+
emit("start-transcribe");
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function handleCancelTranscribe() {
|
|
576
|
+
transcriptionError.value = null;
|
|
577
|
+
transcribeMode.value = "input";
|
|
578
|
+
emit("cancel-transcribe");
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function handleFinishTranscribe() {
|
|
582
|
+
transcribeMode.value = "input";
|
|
583
|
+
emit("finish-transcribe");
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
async function handleFinishTranscribeWithAudio(audioBlob: Blob) {
|
|
587
|
+
if (props.onFinishTranscribeWithAudio) {
|
|
588
|
+
await props.onFinishTranscribeWithAudio(audioBlob);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
isTranscribing.value = true;
|
|
593
|
+
try {
|
|
594
|
+
transcriptionError.value = null;
|
|
595
|
+
const result = await transcribeAudio(copilotkit.value, audioBlob);
|
|
596
|
+
const trimmedPrevious = inputValue.value.trim();
|
|
597
|
+
inputValue.value = trimmedPrevious
|
|
598
|
+
? `${trimmedPrevious} ${result.text}`
|
|
599
|
+
: result.text;
|
|
600
|
+
} catch (error) {
|
|
601
|
+
console.error("CopilotChat: Transcription failed", error);
|
|
602
|
+
if (error instanceof TranscriptionError) {
|
|
603
|
+
const { code, retryable, message } = error.info;
|
|
604
|
+
switch (code) {
|
|
605
|
+
case TranscriptionErrorCode.RATE_LIMITED:
|
|
606
|
+
transcriptionError.value = "Too many requests. Please wait a moment.";
|
|
607
|
+
break;
|
|
608
|
+
case TranscriptionErrorCode.AUTH_FAILED:
|
|
609
|
+
transcriptionError.value =
|
|
610
|
+
"Authentication error. Please check your configuration.";
|
|
611
|
+
break;
|
|
612
|
+
case TranscriptionErrorCode.AUDIO_TOO_LONG:
|
|
613
|
+
transcriptionError.value =
|
|
614
|
+
"Recording is too long. Please try a shorter recording.";
|
|
615
|
+
break;
|
|
616
|
+
case TranscriptionErrorCode.AUDIO_TOO_SHORT:
|
|
617
|
+
transcriptionError.value =
|
|
618
|
+
"Recording is too short. Please try again.";
|
|
619
|
+
break;
|
|
620
|
+
case TranscriptionErrorCode.INVALID_AUDIO_FORMAT:
|
|
621
|
+
transcriptionError.value = "Audio format not supported.";
|
|
622
|
+
break;
|
|
623
|
+
case TranscriptionErrorCode.SERVICE_NOT_CONFIGURED:
|
|
624
|
+
transcriptionError.value = "Transcription service is not available.";
|
|
625
|
+
break;
|
|
626
|
+
case TranscriptionErrorCode.NETWORK_ERROR:
|
|
627
|
+
transcriptionError.value =
|
|
628
|
+
"Network error. Please check your connection.";
|
|
629
|
+
break;
|
|
630
|
+
default:
|
|
631
|
+
transcriptionError.value = retryable
|
|
632
|
+
? "Transcription failed. Please try again."
|
|
633
|
+
: message;
|
|
634
|
+
}
|
|
635
|
+
} else {
|
|
636
|
+
transcriptionError.value = "Transcription failed. Please try again.";
|
|
637
|
+
}
|
|
638
|
+
} finally {
|
|
639
|
+
isTranscribing.value = false;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
const chatViewSlotProps = computed<CopilotChatViewOverrideSlotProps>(() => ({
|
|
644
|
+
messages: messages.value,
|
|
645
|
+
autoScroll: props.autoScroll,
|
|
646
|
+
isRunning: isRunning.value,
|
|
647
|
+
suggestions: autoSuggestions.value,
|
|
648
|
+
suggestionLoadingIndexes: [],
|
|
649
|
+
welcomeScreen: props.welcomeScreen,
|
|
650
|
+
attachments: attachments.value,
|
|
651
|
+
dragOver: dragOver.value,
|
|
652
|
+
inputValue: inputValue.value,
|
|
653
|
+
inputMode: effectiveMode.value,
|
|
654
|
+
inputToolsMenu: props.inputToolsMenu,
|
|
655
|
+
isConnecting: isConnecting.value,
|
|
656
|
+
hasExplicitThreadId: hasExplicitThreadId.value,
|
|
657
|
+
onSubmitMessage: handleSubmitMessage,
|
|
658
|
+
onStop: shouldAllowStop.value ? handleStop : undefined,
|
|
659
|
+
onInputChange: handleInputChange,
|
|
660
|
+
onSelectSuggestion: handleSelectSuggestion,
|
|
661
|
+
onRemoveAttachment: removeAttachment,
|
|
662
|
+
onAddFile: attachmentsEnabled.value ? handleAddFile : undefined,
|
|
663
|
+
onDragOver: attachmentsEnabled.value ? handleDragOver : undefined,
|
|
664
|
+
onDragLeave: attachmentsEnabled.value ? handleDragLeave : undefined,
|
|
665
|
+
onDrop: attachmentsEnabled.value ? handleDrop : undefined,
|
|
666
|
+
onStartTranscribe: showTranscription.value
|
|
667
|
+
? handleStartTranscribe
|
|
668
|
+
: undefined,
|
|
669
|
+
onCancelTranscribe: showTranscription.value
|
|
670
|
+
? handleCancelTranscribe
|
|
671
|
+
: undefined,
|
|
672
|
+
onFinishTranscribe: showTranscription.value
|
|
673
|
+
? handleFinishTranscribe
|
|
674
|
+
: undefined,
|
|
675
|
+
onFinishTranscribeWithAudio: showTranscription.value
|
|
676
|
+
? handleFinishTranscribeWithAudio
|
|
677
|
+
: undefined,
|
|
678
|
+
}));
|
|
679
|
+
|
|
680
|
+
const defaultChatViewBindings = computed(() => {
|
|
681
|
+
const listeners: Record<string, unknown> = {
|
|
682
|
+
...attrs,
|
|
683
|
+
onSubmitMessage: handleSubmitMessage,
|
|
684
|
+
onInputChange: handleInputChange,
|
|
685
|
+
onSelectSuggestion: handleSelectSuggestion,
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
if (shouldAllowStop.value) {
|
|
689
|
+
listeners.onStop = handleStop;
|
|
690
|
+
}
|
|
691
|
+
if (attachmentsEnabled.value) {
|
|
692
|
+
listeners.onAddFile = handleAddFile;
|
|
693
|
+
listeners.attachments = attachments.value;
|
|
694
|
+
listeners.onRemoveAttachment = removeAttachment;
|
|
695
|
+
listeners.dragOver = dragOver.value;
|
|
696
|
+
listeners.onDragOver = handleDragOver;
|
|
697
|
+
listeners.onDragLeave = handleDragLeave;
|
|
698
|
+
listeners.onDrop = handleDrop;
|
|
699
|
+
}
|
|
700
|
+
if (showTranscription.value) {
|
|
701
|
+
listeners.onStartTranscribe = handleStartTranscribe;
|
|
702
|
+
listeners.onCancelTranscribe = handleCancelTranscribe;
|
|
703
|
+
listeners.onFinishTranscribe = handleFinishTranscribe;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return listeners;
|
|
707
|
+
});
|
|
708
|
+
</script>
|
|
709
|
+
|
|
710
|
+
<template>
|
|
711
|
+
<CopilotChatConfigurationProvider
|
|
712
|
+
:agent-id="resolvedAgentId"
|
|
713
|
+
:thread-id="resolvedThreadId"
|
|
714
|
+
:has-explicit-thread-id="hasExplicitThreadId"
|
|
715
|
+
:labels="resolvedLabels"
|
|
716
|
+
>
|
|
717
|
+
<div ref="attachmentContainerRef" style="display: contents">
|
|
718
|
+
<input
|
|
719
|
+
v-if="attachmentsEnabled"
|
|
720
|
+
ref="fileInputRef"
|
|
721
|
+
type="file"
|
|
722
|
+
multiple
|
|
723
|
+
:accept="props.attachments?.accept ?? '*/*'"
|
|
724
|
+
style="display: none"
|
|
725
|
+
@change="(event) => void handleFileUpload(event)"
|
|
726
|
+
/>
|
|
727
|
+
<InlineFeatureWarning v-if="!isChatLicensed" feature-name="Chat" />
|
|
728
|
+
<div
|
|
729
|
+
v-if="transcriptionError"
|
|
730
|
+
style="
|
|
731
|
+
position: absolute;
|
|
732
|
+
bottom: 100px;
|
|
733
|
+
left: 50%;
|
|
734
|
+
transform: translateX(-50%);
|
|
735
|
+
background-color: #ef4444;
|
|
736
|
+
color: white;
|
|
737
|
+
padding: 8px 16px;
|
|
738
|
+
border-radius: 8px;
|
|
739
|
+
font-size: 14px;
|
|
740
|
+
z-index: 50;
|
|
741
|
+
"
|
|
742
|
+
>
|
|
743
|
+
{{ transcriptionError }}
|
|
744
|
+
</div>
|
|
745
|
+
|
|
746
|
+
<slot name="chat-view" v-bind="chatViewSlotProps">
|
|
747
|
+
<CopilotChatView
|
|
748
|
+
v-bind="defaultChatViewBindings"
|
|
749
|
+
:messages="chatViewSlotProps.messages"
|
|
750
|
+
:auto-scroll="chatViewSlotProps.autoScroll"
|
|
751
|
+
:is-running="chatViewSlotProps.isRunning"
|
|
752
|
+
:suggestions="chatViewSlotProps.suggestions"
|
|
753
|
+
:suggestion-loading-indexes="
|
|
754
|
+
chatViewSlotProps.suggestionLoadingIndexes
|
|
755
|
+
"
|
|
756
|
+
:welcome-screen="chatViewSlotProps.welcomeScreen"
|
|
757
|
+
:input-value="chatViewSlotProps.inputValue"
|
|
758
|
+
:input-mode="chatViewSlotProps.inputMode"
|
|
759
|
+
:input-tools-menu="chatViewSlotProps.inputToolsMenu"
|
|
760
|
+
:is-connecting="chatViewSlotProps.isConnecting"
|
|
761
|
+
:has-explicit-thread-id="chatViewSlotProps.hasExplicitThreadId"
|
|
762
|
+
:on-finish-transcribe-with-audio="
|
|
763
|
+
chatViewSlotProps.onFinishTranscribeWithAudio
|
|
764
|
+
"
|
|
765
|
+
>
|
|
766
|
+
<template
|
|
767
|
+
v-for="slotName in forwardedChatViewSlotNames"
|
|
768
|
+
:key="slotName"
|
|
769
|
+
#[slotName]="slotProps"
|
|
770
|
+
>
|
|
771
|
+
<slot :name="slotName" v-bind="slotProps" />
|
|
772
|
+
</template>
|
|
773
|
+
</CopilotChatView>
|
|
774
|
+
</slot>
|
|
775
|
+
</div>
|
|
776
|
+
</CopilotChatConfigurationProvider>
|
|
777
|
+
</template>
|