@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,740 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
getCurrentInstance,
|
|
5
|
+
nextTick,
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
onMounted,
|
|
8
|
+
ref,
|
|
9
|
+
useSlots,
|
|
10
|
+
watch,
|
|
11
|
+
} from "vue";
|
|
12
|
+
import type { Message } from "@ag-ui/core";
|
|
13
|
+
import type { Suggestion } from "@copilotkit/core";
|
|
14
|
+
import type { Attachment } from "@copilotkit/shared";
|
|
15
|
+
import { useCopilotChatConfiguration } from "../../providers/useCopilotChatConfiguration";
|
|
16
|
+
import { CopilotChatDefaultLabels } from "../../providers/types";
|
|
17
|
+
import { useKeyboardHeight } from "../../hooks/use-keyboard-height";
|
|
18
|
+
import { usePinToSend } from "../../hooks/use-pin-to-send";
|
|
19
|
+
import { IconChevronDown } from "../icons";
|
|
20
|
+
import CopilotChatInput from "./CopilotChatInput.vue";
|
|
21
|
+
import CopilotChatAttachmentQueue from "./CopilotChatAttachmentQueue.vue";
|
|
22
|
+
import CopilotChatMessageView from "./CopilotChatMessageView.vue";
|
|
23
|
+
import CopilotChatSuggestionView from "./CopilotChatSuggestionView.vue";
|
|
24
|
+
import { normalizeAutoScroll } from "./normalize-auto-scroll";
|
|
25
|
+
import type {
|
|
26
|
+
CopilotChatInputMode,
|
|
27
|
+
CopilotChatInterruptSlotProps,
|
|
28
|
+
CopilotChatViewProps,
|
|
29
|
+
ToolsMenuItem,
|
|
30
|
+
} from "./types";
|
|
31
|
+
|
|
32
|
+
// Vertical gap between the scroll-to-bottom button and the input container.
|
|
33
|
+
// Mirrors React `CopilotChatView` `SCROLL_BUTTON_OFFSET`.
|
|
34
|
+
const SCROLL_BUTTON_OFFSET = 16;
|
|
35
|
+
const SCROLL_BOTTOM_THRESHOLD = 12;
|
|
36
|
+
|
|
37
|
+
const props = withDefaults(defineProps<CopilotChatViewProps>(), {
|
|
38
|
+
messages: () => [],
|
|
39
|
+
autoScroll: true,
|
|
40
|
+
isRunning: false,
|
|
41
|
+
suggestions: () => [],
|
|
42
|
+
suggestionLoadingIndexes: () => [],
|
|
43
|
+
welcomeScreen: true,
|
|
44
|
+
inputValue: undefined,
|
|
45
|
+
inputMode: "input",
|
|
46
|
+
inputToolsMenu: () => [],
|
|
47
|
+
isConnecting: false,
|
|
48
|
+
hasExplicitThreadId: false,
|
|
49
|
+
onFinishTranscribeWithAudio: undefined,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
defineSlots<{
|
|
53
|
+
"message-view"?: (props: {
|
|
54
|
+
messages: Message[];
|
|
55
|
+
isRunning: boolean;
|
|
56
|
+
}) => unknown;
|
|
57
|
+
"scroll-view"?: (props: {
|
|
58
|
+
messages: Message[];
|
|
59
|
+
isRunning: boolean;
|
|
60
|
+
suggestions: Suggestion[];
|
|
61
|
+
loadingIndexes: ReadonlyArray<number>;
|
|
62
|
+
messagePaddingBottom: string;
|
|
63
|
+
showScrollToBottomButton: boolean;
|
|
64
|
+
onSelectSuggestion: (suggestion: Suggestion, index: number) => void;
|
|
65
|
+
onScroll: () => void;
|
|
66
|
+
scrollToBottom: () => void;
|
|
67
|
+
}) => unknown;
|
|
68
|
+
feather?: () => unknown;
|
|
69
|
+
"scroll-to-bottom-button"?: (props: { onClick: () => void }) => unknown;
|
|
70
|
+
interrupt?: (props: CopilotChatInterruptSlotProps) => unknown;
|
|
71
|
+
input?: (props: {
|
|
72
|
+
modelValue: string;
|
|
73
|
+
isRunning: boolean;
|
|
74
|
+
inputMode: CopilotChatInputMode;
|
|
75
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
76
|
+
attachments: Attachment[];
|
|
77
|
+
onUpdateModelValue: (value: string) => void;
|
|
78
|
+
onSubmitMessage: (value: string) => void;
|
|
79
|
+
onStop?: () => void;
|
|
80
|
+
onAddFile: () => void;
|
|
81
|
+
onStartTranscribe: () => void;
|
|
82
|
+
onCancelTranscribe: () => void;
|
|
83
|
+
onFinishTranscribe: () => void;
|
|
84
|
+
onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
|
|
85
|
+
}) => unknown;
|
|
86
|
+
"suggestion-view"?: (props: {
|
|
87
|
+
suggestions: Suggestion[];
|
|
88
|
+
loadingIndexes: ReadonlyArray<number>;
|
|
89
|
+
onSelectSuggestion: (suggestion: Suggestion, index: number) => void;
|
|
90
|
+
}) => unknown;
|
|
91
|
+
"welcome-screen"?: (props: {
|
|
92
|
+
suggestions: Suggestion[];
|
|
93
|
+
loadingIndexes: ReadonlyArray<number>;
|
|
94
|
+
attachments: Attachment[];
|
|
95
|
+
modelValue: string;
|
|
96
|
+
isRunning: boolean;
|
|
97
|
+
inputMode: CopilotChatInputMode;
|
|
98
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
99
|
+
onUpdateModelValue: (value: string) => void;
|
|
100
|
+
onSubmitMessage: (value: string) => void;
|
|
101
|
+
onStop?: () => void;
|
|
102
|
+
onAddFile: () => void;
|
|
103
|
+
onStartTranscribe: () => void;
|
|
104
|
+
onCancelTranscribe: () => void;
|
|
105
|
+
onFinishTranscribe: () => void;
|
|
106
|
+
onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
|
|
107
|
+
onSelectSuggestion: (suggestion: Suggestion, index: number) => void;
|
|
108
|
+
}) => unknown;
|
|
109
|
+
"welcome-message"?: () => unknown;
|
|
110
|
+
[key: string]: ((props: any) => unknown) | undefined;
|
|
111
|
+
}>();
|
|
112
|
+
|
|
113
|
+
const emit = defineEmits<{
|
|
114
|
+
"submit-message": [value: string];
|
|
115
|
+
stop: [];
|
|
116
|
+
"input-change": [value: string];
|
|
117
|
+
"select-suggestion": [suggestion: Suggestion, index: number];
|
|
118
|
+
"add-file": [];
|
|
119
|
+
"start-transcribe": [];
|
|
120
|
+
"cancel-transcribe": [];
|
|
121
|
+
"finish-transcribe": [];
|
|
122
|
+
}>();
|
|
123
|
+
|
|
124
|
+
const config = useCopilotChatConfiguration();
|
|
125
|
+
const labels = computed(() => config.value?.labels ?? CopilotChatDefaultLabels);
|
|
126
|
+
const instance = getCurrentInstance();
|
|
127
|
+
const componentSlots = useSlots();
|
|
128
|
+
|
|
129
|
+
const scrollContainerRef = ref<HTMLElement | null>(null);
|
|
130
|
+
const scrollContentRef = ref<HTMLElement | null>(null);
|
|
131
|
+
const spacerRef = ref<HTMLElement | null>(null);
|
|
132
|
+
const inputContainerRef = ref<HTMLElement | null>(null);
|
|
133
|
+
const inputContainerHeight = ref(0);
|
|
134
|
+
const isAtBottom = ref(true);
|
|
135
|
+
const isControlledInput = computed(() => props.inputValue !== undefined);
|
|
136
|
+
const localInputValue = ref(props.inputValue ?? "");
|
|
137
|
+
|
|
138
|
+
// Normalize the `autoScroll` prop into the canonical mode triplet
|
|
139
|
+
// (`pin-to-bottom` | `pin-to-send` | `none`). Boolean back-compat is
|
|
140
|
+
// preserved by `normalizeAutoScroll` (parity with React).
|
|
141
|
+
const autoScrollMode = computed(() => normalizeAutoScroll(props.autoScroll));
|
|
142
|
+
const isPinToBottomMode = computed(
|
|
143
|
+
() => autoScrollMode.value === "pin-to-bottom",
|
|
144
|
+
);
|
|
145
|
+
const isPinToSendMode = computed(() => autoScrollMode.value === "pin-to-send");
|
|
146
|
+
|
|
147
|
+
// `usePinToSend` is always wired but bails internally when the spacer ref
|
|
148
|
+
// is null — i.e. unless `pin-to-send` mode is active and the spacer div
|
|
149
|
+
// has been mounted in the template.
|
|
150
|
+
usePinToSend({
|
|
151
|
+
scrollRef: scrollContainerRef,
|
|
152
|
+
contentRef: scrollContentRef,
|
|
153
|
+
spacerRef,
|
|
154
|
+
topOffset: 16,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Track mobile keyboard state so the input can translate itself above the
|
|
158
|
+
// on-screen keyboard (matches React CopilotChatView behavior).
|
|
159
|
+
const { isKeyboardOpen, keyboardHeight } = useKeyboardHeight();
|
|
160
|
+
const effectiveKeyboardHeight = computed(() =>
|
|
161
|
+
isKeyboardOpen.value ? keyboardHeight.value : 0,
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
const resolvedInputValue = computed(() =>
|
|
165
|
+
isControlledInput.value ? (props.inputValue ?? "") : localInputValue.value,
|
|
166
|
+
);
|
|
167
|
+
const hasSuggestions = computed(
|
|
168
|
+
() =>
|
|
169
|
+
!props.isConnecting &&
|
|
170
|
+
!props.isRunning &&
|
|
171
|
+
Array.isArray(props.suggestions) &&
|
|
172
|
+
props.suggestions.length > 0,
|
|
173
|
+
);
|
|
174
|
+
const hasAttachments = computed(
|
|
175
|
+
() => Array.isArray(props.attachments) && props.attachments.length > 0,
|
|
176
|
+
);
|
|
177
|
+
const vnodeProps = computed(
|
|
178
|
+
() => (instance?.vnode.props ?? {}) as Record<string, unknown>,
|
|
179
|
+
);
|
|
180
|
+
const forwardedMessageViewSlotNames = computed(() =>
|
|
181
|
+
Object.keys(componentSlots).filter(
|
|
182
|
+
(slotName) =>
|
|
183
|
+
slotName !== "message-view" &&
|
|
184
|
+
slotName !== "scroll-view" &&
|
|
185
|
+
slotName !== "feather" &&
|
|
186
|
+
slotName !== "scroll-to-bottom-button" &&
|
|
187
|
+
slotName !== "input" &&
|
|
188
|
+
slotName !== "suggestion-view" &&
|
|
189
|
+
slotName !== "welcome-screen" &&
|
|
190
|
+
slotName !== "welcome-message",
|
|
191
|
+
),
|
|
192
|
+
);
|
|
193
|
+
const shouldShowWelcomeScreen = computed(
|
|
194
|
+
() =>
|
|
195
|
+
props.messages.length === 0 &&
|
|
196
|
+
props.welcomeScreen !== false &&
|
|
197
|
+
!props.isConnecting &&
|
|
198
|
+
!props.hasExplicitThreadId,
|
|
199
|
+
);
|
|
200
|
+
const hasAddFileAction = computed(() => hasListener("onAddFile"));
|
|
201
|
+
const hasStopAction = computed(() => hasListener("onStop"));
|
|
202
|
+
const hasStartTranscribeAction = computed(() =>
|
|
203
|
+
hasListener("onStartTranscribe"),
|
|
204
|
+
);
|
|
205
|
+
const hasCancelTranscribeAction = computed(() =>
|
|
206
|
+
hasListener("onCancelTranscribe"),
|
|
207
|
+
);
|
|
208
|
+
const hasFinishTranscribeAction = computed(() =>
|
|
209
|
+
hasListener("onFinishTranscribe"),
|
|
210
|
+
);
|
|
211
|
+
const hasFinishTranscribeWithAudioAction = computed(
|
|
212
|
+
() => typeof props.onFinishTranscribeWithAudio === "function",
|
|
213
|
+
);
|
|
214
|
+
// Mirrors React: `paddingBottom = inputContainerHeight + (hasSuggestions ? 4 : 32)`.
|
|
215
|
+
// React intentionally does NOT add bonus padding for attachments — the
|
|
216
|
+
// attachment queue lives inside the input overlay, so its height is already
|
|
217
|
+
// captured by the overlay's measured `inputContainerHeight`.
|
|
218
|
+
const messagePaddingBottom = computed(
|
|
219
|
+
() => `${inputContainerHeight.value + (hasSuggestions.value ? 4 : 32)}px`,
|
|
220
|
+
);
|
|
221
|
+
const showScrollToBottomButton = computed(
|
|
222
|
+
() => !shouldShowWelcomeScreen.value && !isAtBottom.value,
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
let inputResizeObserver: ResizeObserver | null = null;
|
|
226
|
+
let contentResizeObserver: ResizeObserver | null = null;
|
|
227
|
+
|
|
228
|
+
function attachInputOverlayObserver() {
|
|
229
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
230
|
+
|
|
231
|
+
inputResizeObserver?.disconnect();
|
|
232
|
+
inputResizeObserver = null;
|
|
233
|
+
|
|
234
|
+
const el = inputContainerRef.value;
|
|
235
|
+
if (!el) return;
|
|
236
|
+
|
|
237
|
+
inputResizeObserver = new ResizeObserver((entries) => {
|
|
238
|
+
const wasAtBottom = isAtBottom.value;
|
|
239
|
+
const measured = entries[0]?.contentRect?.height;
|
|
240
|
+
if (typeof measured === "number") {
|
|
241
|
+
inputContainerHeight.value = measured;
|
|
242
|
+
} else {
|
|
243
|
+
syncInputContainerHeight();
|
|
244
|
+
}
|
|
245
|
+
updateIsAtBottom();
|
|
246
|
+
if (isPinToBottomMode.value && wasAtBottom) {
|
|
247
|
+
scrollToBottom("auto");
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
inputResizeObserver.observe(el);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function attachScrollContentObserver() {
|
|
254
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
255
|
+
|
|
256
|
+
contentResizeObserver?.disconnect();
|
|
257
|
+
contentResizeObserver = null;
|
|
258
|
+
|
|
259
|
+
const el = scrollContentRef.value;
|
|
260
|
+
if (!el) return;
|
|
261
|
+
|
|
262
|
+
contentResizeObserver = new ResizeObserver(() => {
|
|
263
|
+
const wasAtBottom = isAtBottom.value;
|
|
264
|
+
updateIsAtBottom();
|
|
265
|
+
if (isPinToBottomMode.value && wasAtBottom) {
|
|
266
|
+
scrollToBottom("auto");
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
contentResizeObserver.observe(el);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// When the welcome screen disappears and the main chat view (with the input
|
|
273
|
+
// overlay) appears, the template-ref elements become non-null. Re-attach
|
|
274
|
+
// observers that were skipped during the initial mount.
|
|
275
|
+
watch(shouldShowWelcomeScreen, async (show) => {
|
|
276
|
+
if (show) return;
|
|
277
|
+
await nextTick();
|
|
278
|
+
syncInputContainerHeight();
|
|
279
|
+
attachInputOverlayObserver();
|
|
280
|
+
attachScrollContentObserver();
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
watch(
|
|
284
|
+
() => props.inputValue,
|
|
285
|
+
(next) => {
|
|
286
|
+
if (isControlledInput.value) {
|
|
287
|
+
localInputValue.value = next ?? "";
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
watch(
|
|
293
|
+
[() => props.messages, () => props.suggestions, () => props.isRunning],
|
|
294
|
+
async () => {
|
|
295
|
+
const wasAtBottom = isAtBottom.value;
|
|
296
|
+
await nextTick();
|
|
297
|
+
if (!isPinToBottomMode.value || !wasAtBottom) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
scrollToBottom("auto");
|
|
301
|
+
if (typeof requestAnimationFrame === "function") {
|
|
302
|
+
requestAnimationFrame(() => {
|
|
303
|
+
scrollToBottom("auto");
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{ deep: true },
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
function updateIsAtBottom() {
|
|
311
|
+
const element = scrollContainerRef.value;
|
|
312
|
+
if (!element) {
|
|
313
|
+
isAtBottom.value = true;
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const distance =
|
|
318
|
+
element.scrollHeight - element.scrollTop - element.clientHeight;
|
|
319
|
+
isAtBottom.value = distance <= SCROLL_BOTTOM_THRESHOLD;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function syncInputContainerHeight() {
|
|
323
|
+
const element = inputContainerRef.value;
|
|
324
|
+
inputContainerHeight.value = element?.offsetHeight ?? 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function scrollToBottom(behavior: ScrollBehavior = "smooth") {
|
|
328
|
+
const element = scrollContainerRef.value;
|
|
329
|
+
if (!element) return;
|
|
330
|
+
|
|
331
|
+
if (typeof element.scrollTo === "function") {
|
|
332
|
+
element.scrollTo({
|
|
333
|
+
top: element.scrollHeight,
|
|
334
|
+
behavior,
|
|
335
|
+
});
|
|
336
|
+
} else {
|
|
337
|
+
element.scrollTop = element.scrollHeight;
|
|
338
|
+
}
|
|
339
|
+
updateIsAtBottom();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function handleScroll() {
|
|
343
|
+
updateIsAtBottom();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function hasListener(listenerName: string) {
|
|
347
|
+
const listener = vnodeProps.value[listenerName];
|
|
348
|
+
if (Array.isArray(listener)) {
|
|
349
|
+
return listener.length > 0;
|
|
350
|
+
}
|
|
351
|
+
return !!listener;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function handleInputValueChange(value: string) {
|
|
355
|
+
if (!isControlledInput.value) {
|
|
356
|
+
localInputValue.value = value;
|
|
357
|
+
}
|
|
358
|
+
emit("input-change", value);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function handleSubmitMessage(value: string) {
|
|
362
|
+
emit("submit-message", value);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function handleStop() {
|
|
366
|
+
emit("stop");
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function handleSelectSuggestion(suggestion: Suggestion, index: number) {
|
|
370
|
+
emit("select-suggestion", suggestion, index);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function handleAddFile() {
|
|
374
|
+
emit("add-file");
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function handleDragOver(event: DragEvent) {
|
|
378
|
+
props.onDragOver?.(event);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function handleDragLeave(event: DragEvent) {
|
|
382
|
+
props.onDragLeave?.(event);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function handleDrop(event: DragEvent) {
|
|
386
|
+
void props.onDrop?.(event);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function handleStartTranscribe() {
|
|
390
|
+
emit("start-transcribe");
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function handleCancelTranscribe() {
|
|
394
|
+
emit("cancel-transcribe");
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function handleFinishTranscribe() {
|
|
398
|
+
emit("finish-transcribe");
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
async function handleFinishTranscribeWithAudio(audioBlob: Blob) {
|
|
402
|
+
await props.onFinishTranscribeWithAudio?.(audioBlob);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const inputEventProps = computed(() => {
|
|
406
|
+
const listeners: Record<string, unknown> = {
|
|
407
|
+
"onUpdate:modelValue": handleInputValueChange,
|
|
408
|
+
onSubmitMessage: handleSubmitMessage,
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
if (hasStopAction.value) {
|
|
412
|
+
listeners.onStop = handleStop;
|
|
413
|
+
}
|
|
414
|
+
if (hasAddFileAction.value) {
|
|
415
|
+
listeners.onAddFile = handleAddFile;
|
|
416
|
+
}
|
|
417
|
+
if (hasStartTranscribeAction.value) {
|
|
418
|
+
listeners.onStartTranscribe = handleStartTranscribe;
|
|
419
|
+
}
|
|
420
|
+
if (hasCancelTranscribeAction.value) {
|
|
421
|
+
listeners.onCancelTranscribe = handleCancelTranscribe;
|
|
422
|
+
}
|
|
423
|
+
if (hasFinishTranscribeAction.value) {
|
|
424
|
+
listeners.onFinishTranscribe = handleFinishTranscribe;
|
|
425
|
+
}
|
|
426
|
+
if (hasFinishTranscribeWithAudioAction.value) {
|
|
427
|
+
listeners.onFinishTranscribeWithAudio = handleFinishTranscribeWithAudio;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return listeners;
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
onMounted(async () => {
|
|
434
|
+
await nextTick();
|
|
435
|
+
syncInputContainerHeight();
|
|
436
|
+
updateIsAtBottom();
|
|
437
|
+
if (isPinToBottomMode.value) {
|
|
438
|
+
scrollToBottom("auto");
|
|
439
|
+
if (typeof requestAnimationFrame === "function") {
|
|
440
|
+
requestAnimationFrame(() => {
|
|
441
|
+
scrollToBottom("auto");
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
attachInputOverlayObserver();
|
|
447
|
+
attachScrollContentObserver();
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
onBeforeUnmount(() => {
|
|
451
|
+
inputResizeObserver?.disconnect();
|
|
452
|
+
contentResizeObserver?.disconnect();
|
|
453
|
+
inputResizeObserver = null;
|
|
454
|
+
contentResizeObserver = null;
|
|
455
|
+
});
|
|
456
|
+
</script>
|
|
457
|
+
|
|
458
|
+
<template>
|
|
459
|
+
<div
|
|
460
|
+
data-copilotkit
|
|
461
|
+
class="cpk:relative cpk:h-full"
|
|
462
|
+
data-testid="copilot-chat-view"
|
|
463
|
+
v-bind="$attrs"
|
|
464
|
+
@dragover="handleDragOver"
|
|
465
|
+
@dragleave="handleDragLeave"
|
|
466
|
+
@drop="handleDrop"
|
|
467
|
+
>
|
|
468
|
+
<div
|
|
469
|
+
v-if="dragOver"
|
|
470
|
+
class="cpk:absolute cpk:inset-0 cpk:z-50 cpk:pointer-events-none cpk:flex cpk:items-center cpk:justify-center cpk:bg-primary/5 cpk:border-2 cpk:border-dashed cpk:border-primary/40 cpk:rounded-lg cpk:m-2"
|
|
471
|
+
data-testid="copilot-chat-drop-overlay"
|
|
472
|
+
>
|
|
473
|
+
<span class="cpk:text-sm cpk:font-medium cpk:text-primary/70">
|
|
474
|
+
Drop files here
|
|
475
|
+
</span>
|
|
476
|
+
</div>
|
|
477
|
+
<slot
|
|
478
|
+
v-if="shouldShowWelcomeScreen"
|
|
479
|
+
name="welcome-screen"
|
|
480
|
+
:suggestions="suggestions"
|
|
481
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
482
|
+
:attachments="attachments ?? []"
|
|
483
|
+
:model-value="resolvedInputValue"
|
|
484
|
+
:is-running="isRunning"
|
|
485
|
+
:input-mode="inputMode"
|
|
486
|
+
:input-tools-menu="inputToolsMenu"
|
|
487
|
+
:on-update-model-value="handleInputValueChange"
|
|
488
|
+
:on-submit-message="handleSubmitMessage"
|
|
489
|
+
:on-stop="hasStopAction ? handleStop : undefined"
|
|
490
|
+
:on-add-file="handleAddFile"
|
|
491
|
+
:on-start-transcribe="handleStartTranscribe"
|
|
492
|
+
:on-cancel-transcribe="handleCancelTranscribe"
|
|
493
|
+
:on-finish-transcribe="handleFinishTranscribe"
|
|
494
|
+
:on-finish-transcribe-with-audio="handleFinishTranscribeWithAudio"
|
|
495
|
+
:on-select-suggestion="handleSelectSuggestion"
|
|
496
|
+
>
|
|
497
|
+
<div
|
|
498
|
+
class="cpk:flex cpk:h-full cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4"
|
|
499
|
+
data-testid="copilot-chat-view-welcome-screen"
|
|
500
|
+
>
|
|
501
|
+
<div
|
|
502
|
+
class="cpk:w-full cpk:max-w-3xl cpk:flex cpk:flex-col cpk:items-center"
|
|
503
|
+
>
|
|
504
|
+
<div class="cpk:mb-6">
|
|
505
|
+
<slot name="welcome-message">
|
|
506
|
+
<h1
|
|
507
|
+
class="cpk:text-xl cpk:sm:text-2xl cpk:font-medium cpk:text-foreground cpk:text-center"
|
|
508
|
+
>
|
|
509
|
+
{{ labels.welcomeMessageText }}
|
|
510
|
+
</h1>
|
|
511
|
+
</slot>
|
|
512
|
+
</div>
|
|
513
|
+
|
|
514
|
+
<div class="cpk:w-full">
|
|
515
|
+
<CopilotChatAttachmentQueue
|
|
516
|
+
v-if="hasAttachments"
|
|
517
|
+
:attachments="attachments ?? []"
|
|
518
|
+
class-name="cpk:mb-2"
|
|
519
|
+
@remove-attachment="
|
|
520
|
+
(id: string) => onRemoveAttachment && onRemoveAttachment(id)
|
|
521
|
+
"
|
|
522
|
+
/>
|
|
523
|
+
<slot
|
|
524
|
+
name="input"
|
|
525
|
+
:model-value="resolvedInputValue"
|
|
526
|
+
:is-running="isRunning"
|
|
527
|
+
:input-mode="inputMode"
|
|
528
|
+
:input-tools-menu="inputToolsMenu"
|
|
529
|
+
:attachments="attachments ?? []"
|
|
530
|
+
:on-update-model-value="handleInputValueChange"
|
|
531
|
+
:on-submit-message="handleSubmitMessage"
|
|
532
|
+
:on-stop="hasStopAction ? handleStop : undefined"
|
|
533
|
+
:on-add-file="handleAddFile"
|
|
534
|
+
:on-start-transcribe="handleStartTranscribe"
|
|
535
|
+
:on-cancel-transcribe="handleCancelTranscribe"
|
|
536
|
+
:on-finish-transcribe="handleFinishTranscribe"
|
|
537
|
+
:on-finish-transcribe-with-audio="handleFinishTranscribeWithAudio"
|
|
538
|
+
>
|
|
539
|
+
<CopilotChatInput
|
|
540
|
+
:model-value="resolvedInputValue"
|
|
541
|
+
:is-running="isRunning"
|
|
542
|
+
:mode="inputMode"
|
|
543
|
+
:tools-menu="inputToolsMenu"
|
|
544
|
+
positioning="static"
|
|
545
|
+
:show-disclaimer="true"
|
|
546
|
+
:keyboard-height="effectiveKeyboardHeight"
|
|
547
|
+
v-bind="inputEventProps"
|
|
548
|
+
/>
|
|
549
|
+
</slot>
|
|
550
|
+
</div>
|
|
551
|
+
|
|
552
|
+
<div
|
|
553
|
+
v-if="hasSuggestions"
|
|
554
|
+
class="cpk:mt-4 cpk:flex cpk:justify-center"
|
|
555
|
+
>
|
|
556
|
+
<slot
|
|
557
|
+
name="suggestion-view"
|
|
558
|
+
:suggestions="suggestions"
|
|
559
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
560
|
+
:on-select-suggestion="handleSelectSuggestion"
|
|
561
|
+
>
|
|
562
|
+
<CopilotChatSuggestionView
|
|
563
|
+
:suggestions="suggestions"
|
|
564
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
565
|
+
@select-suggestion="handleSelectSuggestion"
|
|
566
|
+
/>
|
|
567
|
+
</slot>
|
|
568
|
+
</div>
|
|
569
|
+
</div>
|
|
570
|
+
</div>
|
|
571
|
+
</slot>
|
|
572
|
+
|
|
573
|
+
<template v-else>
|
|
574
|
+
<slot
|
|
575
|
+
name="scroll-view"
|
|
576
|
+
:messages="messages"
|
|
577
|
+
:is-running="isRunning"
|
|
578
|
+
:suggestions="suggestions"
|
|
579
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
580
|
+
:message-padding-bottom="messagePaddingBottom"
|
|
581
|
+
:show-scroll-to-bottom-button="showScrollToBottomButton"
|
|
582
|
+
:on-select-suggestion="handleSelectSuggestion"
|
|
583
|
+
:on-scroll="handleScroll"
|
|
584
|
+
:scroll-to-bottom="scrollToBottom"
|
|
585
|
+
>
|
|
586
|
+
<div
|
|
587
|
+
ref="scrollContainerRef"
|
|
588
|
+
data-testid="copilot-chat-view-scroll"
|
|
589
|
+
class="cpk:h-full cpk:max-h-full cpk:min-h-0 cpk:overflow-y-scroll cpk:overflow-x-hidden cpk:relative"
|
|
590
|
+
@scroll="handleScroll"
|
|
591
|
+
>
|
|
592
|
+
<div
|
|
593
|
+
class="cpk:px-4 cpk:sm:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6"
|
|
594
|
+
>
|
|
595
|
+
<div
|
|
596
|
+
ref="scrollContentRef"
|
|
597
|
+
data-testid="copilot-scroll-content"
|
|
598
|
+
:style="{ paddingBottom: messagePaddingBottom }"
|
|
599
|
+
>
|
|
600
|
+
<div class="cpk:max-w-3xl cpk:mx-auto">
|
|
601
|
+
<slot
|
|
602
|
+
name="message-view"
|
|
603
|
+
:messages="messages"
|
|
604
|
+
:is-running="isRunning"
|
|
605
|
+
>
|
|
606
|
+
<CopilotChatMessageView
|
|
607
|
+
:messages="messages"
|
|
608
|
+
:is-running="isRunning"
|
|
609
|
+
>
|
|
610
|
+
<template
|
|
611
|
+
v-for="slotName in forwardedMessageViewSlotNames"
|
|
612
|
+
:key="slotName"
|
|
613
|
+
#[slotName]="slotProps"
|
|
614
|
+
>
|
|
615
|
+
<slot :name="slotName" v-bind="slotProps" />
|
|
616
|
+
</template>
|
|
617
|
+
</CopilotChatMessageView>
|
|
618
|
+
</slot>
|
|
619
|
+
<div
|
|
620
|
+
v-if="hasSuggestions"
|
|
621
|
+
class="cpk:mt-4 cpk:pl-0 cpk:pr-4 cpk:sm:px-0"
|
|
622
|
+
>
|
|
623
|
+
<slot
|
|
624
|
+
name="suggestion-view"
|
|
625
|
+
:suggestions="suggestions"
|
|
626
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
627
|
+
:on-select-suggestion="handleSelectSuggestion"
|
|
628
|
+
>
|
|
629
|
+
<CopilotChatSuggestionView
|
|
630
|
+
class="cpk:mb-3 cpk:lg:ml-4 cpk:lg:mr-4 cpk:ml-0 cpk:mr-0"
|
|
631
|
+
:suggestions="suggestions"
|
|
632
|
+
:loading-indexes="suggestionLoadingIndexes"
|
|
633
|
+
@select-suggestion="handleSelectSuggestion"
|
|
634
|
+
/>
|
|
635
|
+
</slot>
|
|
636
|
+
</div>
|
|
637
|
+
</div>
|
|
638
|
+
</div>
|
|
639
|
+
<!--
|
|
640
|
+
`pin-to-send` spacer. Sized to anchor the latest user message
|
|
641
|
+
near the top of the viewport while the assistant streams a
|
|
642
|
+
response. `usePinToSend` reads this ref and only activates
|
|
643
|
+
when the spacer is present in the tree.
|
|
644
|
+
-->
|
|
645
|
+
<div
|
|
646
|
+
v-if="isPinToSendMode"
|
|
647
|
+
ref="spacerRef"
|
|
648
|
+
data-pin-to-send-spacer
|
|
649
|
+
aria-hidden="true"
|
|
650
|
+
:style="{ height: '0px', flex: '0 0 auto' }"
|
|
651
|
+
/>
|
|
652
|
+
</div>
|
|
653
|
+
</div>
|
|
654
|
+
</slot>
|
|
655
|
+
|
|
656
|
+
<slot name="feather">
|
|
657
|
+
<!--
|
|
658
|
+
Default renders an empty div — no visual, but the element is
|
|
659
|
+
still in the tree so a slot override / consumer styling can
|
|
660
|
+
still apply (mirrors React `CopilotChatView.Feather`).
|
|
661
|
+
-->
|
|
662
|
+
<div data-testid="copilot-chat-view-feather" />
|
|
663
|
+
</slot>
|
|
664
|
+
|
|
665
|
+
<div
|
|
666
|
+
v-if="showScrollToBottomButton"
|
|
667
|
+
class="cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none"
|
|
668
|
+
:style="{ bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` }"
|
|
669
|
+
>
|
|
670
|
+
<slot name="scroll-to-bottom-button" :on-click="() => scrollToBottom()">
|
|
671
|
+
<button
|
|
672
|
+
type="button"
|
|
673
|
+
data-testid="copilot-chat-view-scroll-to-bottom"
|
|
674
|
+
class="cpk:rounded-full cpk:w-10 cpk:h-10 cpk:p-0 cpk:pointer-events-auto cpk:bg-white cpk:dark:bg-gray-900 cpk:shadow-lg cpk:border cpk:border-gray-200 cpk:dark:border-gray-700 cpk:hover:bg-gray-50 cpk:dark:hover:bg-gray-800 cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer"
|
|
675
|
+
@click="scrollToBottom()"
|
|
676
|
+
>
|
|
677
|
+
<IconChevronDown
|
|
678
|
+
class="cpk:w-4 cpk:h-4 cpk:text-gray-600 cpk:dark:text-white"
|
|
679
|
+
/>
|
|
680
|
+
</button>
|
|
681
|
+
</slot>
|
|
682
|
+
</div>
|
|
683
|
+
|
|
684
|
+
<!--
|
|
685
|
+
Input overlay. Mirrors React `CopilotChatView` `copilot-input-overlay`:
|
|
686
|
+
absolutely positioned at the bottom, holds both the attachment queue
|
|
687
|
+
and the chat input. The input itself uses `positioning="static"` so
|
|
688
|
+
the overlay wrapper alone owns the absolute positioning, and the
|
|
689
|
+
attachment queue is layered visually above the input via DOM order.
|
|
690
|
+
The welcome-screen path intentionally does NOT use this overlay.
|
|
691
|
+
-->
|
|
692
|
+
<div
|
|
693
|
+
ref="inputContainerRef"
|
|
694
|
+
class="cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0 cpk:z-20 cpk:pointer-events-none"
|
|
695
|
+
data-testid="copilot-input-overlay"
|
|
696
|
+
>
|
|
697
|
+
<div
|
|
698
|
+
v-if="hasAttachments"
|
|
699
|
+
class="cpk:max-w-3xl cpk:mx-auto cpk:w-full cpk:pointer-events-auto"
|
|
700
|
+
>
|
|
701
|
+
<CopilotChatAttachmentQueue
|
|
702
|
+
:attachments="attachments ?? []"
|
|
703
|
+
class-name="cpk:px-4"
|
|
704
|
+
@remove-attachment="
|
|
705
|
+
(id: string) => onRemoveAttachment && onRemoveAttachment(id)
|
|
706
|
+
"
|
|
707
|
+
/>
|
|
708
|
+
</div>
|
|
709
|
+
<slot
|
|
710
|
+
name="input"
|
|
711
|
+
:model-value="resolvedInputValue"
|
|
712
|
+
:is-running="isRunning"
|
|
713
|
+
:input-mode="inputMode"
|
|
714
|
+
:input-tools-menu="inputToolsMenu"
|
|
715
|
+
:attachments="attachments ?? []"
|
|
716
|
+
:on-update-model-value="handleInputValueChange"
|
|
717
|
+
:on-submit-message="handleSubmitMessage"
|
|
718
|
+
:on-stop="hasStopAction ? handleStop : undefined"
|
|
719
|
+
:on-add-file="handleAddFile"
|
|
720
|
+
:on-start-transcribe="handleStartTranscribe"
|
|
721
|
+
:on-cancel-transcribe="handleCancelTranscribe"
|
|
722
|
+
:on-finish-transcribe="handleFinishTranscribe"
|
|
723
|
+
:on-finish-transcribe-with-audio="handleFinishTranscribeWithAudio"
|
|
724
|
+
>
|
|
725
|
+
<CopilotChatInput
|
|
726
|
+
:model-value="resolvedInputValue"
|
|
727
|
+
:is-running="isRunning"
|
|
728
|
+
:mode="inputMode"
|
|
729
|
+
:tools-menu="inputToolsMenu"
|
|
730
|
+
positioning="static"
|
|
731
|
+
:show-disclaimer="true"
|
|
732
|
+
:keyboard-height="effectiveKeyboardHeight"
|
|
733
|
+
:bottom-anchored="true"
|
|
734
|
+
v-bind="inputEventProps"
|
|
735
|
+
/>
|
|
736
|
+
</slot>
|
|
737
|
+
</div>
|
|
738
|
+
</template>
|
|
739
|
+
</div>
|
|
740
|
+
</template>
|