@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,39 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
normalizeAutoScroll,
|
|
4
|
+
type AutoScrollMode,
|
|
5
|
+
} from "../normalize-auto-scroll";
|
|
6
|
+
|
|
7
|
+
// Strict counterpart of React `normalize-auto-scroll.test.ts`.
|
|
8
|
+
// Keep case order and wording aligned 1:1 with the React suite.
|
|
9
|
+
describe("normalizeAutoScroll", () => {
|
|
10
|
+
it("returns 'pin-to-bottom' for undefined (default)", () => {
|
|
11
|
+
expect(normalizeAutoScroll(undefined)).toBe("pin-to-bottom");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("maps true -> 'pin-to-bottom'", () => {
|
|
15
|
+
expect(normalizeAutoScroll(true)).toBe("pin-to-bottom");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("maps false -> 'none'", () => {
|
|
19
|
+
expect(normalizeAutoScroll(false)).toBe("none");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("passes 'pin-to-bottom' through", () => {
|
|
23
|
+
expect(normalizeAutoScroll("pin-to-bottom")).toBe("pin-to-bottom");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("passes 'pin-to-send' through", () => {
|
|
27
|
+
expect(normalizeAutoScroll("pin-to-send")).toBe("pin-to-send");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("passes 'none' through", () => {
|
|
31
|
+
expect(normalizeAutoScroll("none")).toBe("none");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("falls back to 'pin-to-bottom' for unknown strings", () => {
|
|
35
|
+
expect(normalizeAutoScroll("bogus" as AutoScrollMode)).toBe(
|
|
36
|
+
"pin-to-bottom",
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AudioRecorderState = "idle" | "recording" | "processing";
|
|
2
|
+
|
|
3
|
+
export class AudioRecorderError extends Error {
|
|
4
|
+
constructor(message: string) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = "AudioRecorderError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CopilotChatAudioRecorderRef {
|
|
11
|
+
state: AudioRecorderState;
|
|
12
|
+
start: () => Promise<void>;
|
|
13
|
+
stop: () => Promise<Blob>;
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export * from "./types";
|
|
2
|
+
export { default as CopilotChatAssistantMessage } from "./CopilotChatAssistantMessage.vue";
|
|
3
|
+
export { default as CopilotChatAudioRecorder } from "./CopilotChatAudioRecorder.vue";
|
|
4
|
+
import _CopilotChat from "./CopilotChat.vue";
|
|
5
|
+
import _CopilotChatView from "./CopilotChatView.vue";
|
|
6
|
+
export { default as CopilotChatInput } from "./CopilotChatInput.vue";
|
|
7
|
+
export { default as CopilotChatAttachmentQueue } from "./CopilotChatAttachmentQueue.vue";
|
|
8
|
+
export { default as CopilotChatAttachmentRenderer } from "./CopilotChatAttachmentRenderer.vue";
|
|
9
|
+
export { default as CopilotChatMessageView } from "./CopilotChatMessageView.vue";
|
|
10
|
+
export { default as CopilotChatReasoningMessage } from "./CopilotChatReasoningMessage.vue";
|
|
11
|
+
export { default as CopilotChatSuggestionPill } from "./CopilotChatSuggestionPill.vue";
|
|
12
|
+
export { default as CopilotChatSuggestionView } from "./CopilotChatSuggestionView.vue";
|
|
13
|
+
export { default as CopilotChatToolCallsView } from "./CopilotChatToolCallsView.vue";
|
|
14
|
+
export { default as CopilotChatUserMessage } from "./CopilotChatUserMessage.vue";
|
|
15
|
+
export { default as CopilotChatView } from "./CopilotChatView.vue";
|
|
16
|
+
import _CopilotChatToggleButton from "./CopilotChatToggleButton.vue";
|
|
17
|
+
import CopilotChatToggleButtonCloseIcon from "./CopilotChatToggleButtonCloseIcon";
|
|
18
|
+
import CopilotChatToggleButtonOpenIcon from "./CopilotChatToggleButtonOpenIcon";
|
|
19
|
+
import _CopilotModalHeader from "./CopilotModalHeader.vue";
|
|
20
|
+
import CopilotModalHeaderCloseButton from "./CopilotModalHeaderCloseButton";
|
|
21
|
+
import CopilotModalHeaderTitle from "./CopilotModalHeaderTitle";
|
|
22
|
+
import _CopilotPopupView from "./CopilotPopupView.vue";
|
|
23
|
+
import CopilotPopupWelcomeScreen from "./CopilotPopupWelcomeScreen.vue";
|
|
24
|
+
import _CopilotSidebarView from "./CopilotSidebarView.vue";
|
|
25
|
+
import CopilotSidebarWelcomeScreen from "./CopilotSidebarWelcomeScreen.vue";
|
|
26
|
+
|
|
27
|
+
export const CopilotChat = Object.assign(_CopilotChat, {
|
|
28
|
+
View: _CopilotChatView,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const CopilotChatToggleButton = Object.assign(_CopilotChatToggleButton, {
|
|
32
|
+
OpenIcon: CopilotChatToggleButtonOpenIcon,
|
|
33
|
+
CloseIcon: CopilotChatToggleButtonCloseIcon,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { CopilotChatToggleButtonOpenIcon, CopilotChatToggleButtonCloseIcon };
|
|
37
|
+
|
|
38
|
+
export const CopilotModalHeader = Object.assign(_CopilotModalHeader, {
|
|
39
|
+
Title: CopilotModalHeaderTitle,
|
|
40
|
+
CloseButton: CopilotModalHeaderCloseButton,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const CopilotPopupView = Object.assign(_CopilotPopupView, {
|
|
44
|
+
WelcomeScreen: CopilotPopupWelcomeScreen,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { default as CopilotPopup } from "./CopilotPopup.vue";
|
|
48
|
+
export { default as CopilotSidebar } from "./CopilotSidebar.vue";
|
|
49
|
+
|
|
50
|
+
export const CopilotSidebarView = Object.assign(_CopilotSidebarView, {
|
|
51
|
+
WelcomeScreen: CopilotSidebarWelcomeScreen,
|
|
52
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from "vue";
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Vue counterpart of React's `LastUserMessageContext`.
|
|
6
|
+
*
|
|
7
|
+
* Used by `CopilotChatView` to announce the latest user message
|
|
8
|
+
* to descendants (notably `usePinToSend`), so scroll logic can anchor
|
|
9
|
+
* the viewport to the most recent user turn in "pin-to-send" mode.
|
|
10
|
+
*
|
|
11
|
+
* `sendNonce` increments on each new send so repeated IDs (e.g., message
|
|
12
|
+
* edits that preserve the ID) still trigger dependent effects.
|
|
13
|
+
*
|
|
14
|
+
* Vue divergence: React exposes a `React.Context` whose value is replaced
|
|
15
|
+
* via `<Provider value={...}>`. Vue idiomatically provides a `Ref` so
|
|
16
|
+
* descendant `watch` effects fire when the value changes; the underlying
|
|
17
|
+
* `{ id, sendNonce }` shape and semantics match React 1:1.
|
|
18
|
+
*/
|
|
19
|
+
export type LastUserMessageState = {
|
|
20
|
+
id: string | null;
|
|
21
|
+
sendNonce: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_LAST_USER_MESSAGE_STATE: LastUserMessageState = {
|
|
25
|
+
id: null,
|
|
26
|
+
sendNonce: 0,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const LastUserMessageKey: InjectionKey<Ref<LastUserMessageState>> =
|
|
30
|
+
Symbol("LastUserMessage");
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Returns the default `LastUserMessageState` ref used when no provider
|
|
34
|
+
* has been mounted above the consumer. Mirrors React's context default
|
|
35
|
+
* value (`{ id: null, sendNonce: 0 }`).
|
|
36
|
+
*/
|
|
37
|
+
export function createDefaultLastUserMessageRef(): Ref<LastUserMessageState> {
|
|
38
|
+
return ref({ ...DEFAULT_LAST_USER_MESSAGE_STATE });
|
|
39
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AutoScrollMode = "pin-to-bottom" | "pin-to-send" | "none";
|
|
2
|
+
|
|
3
|
+
const VALID: readonly AutoScrollMode[] = [
|
|
4
|
+
"pin-to-bottom",
|
|
5
|
+
"pin-to-send",
|
|
6
|
+
"none",
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function normalizeAutoScroll(
|
|
10
|
+
value: AutoScrollMode | boolean | undefined,
|
|
11
|
+
): AutoScrollMode {
|
|
12
|
+
if (value === undefined) return "pin-to-bottom";
|
|
13
|
+
if (value === true) return "pin-to-bottom";
|
|
14
|
+
if (value === false) return "none";
|
|
15
|
+
if ((VALID as readonly string[]).includes(value)) return value;
|
|
16
|
+
return "pin-to-bottom";
|
|
17
|
+
}
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AssistantMessage,
|
|
3
|
+
Message,
|
|
4
|
+
ReasoningMessage,
|
|
5
|
+
ToolCall,
|
|
6
|
+
ToolMessage,
|
|
7
|
+
UserMessage,
|
|
8
|
+
} from "@ag-ui/core";
|
|
9
|
+
import type { CopilotKitCoreErrorCode, ToolCallStatus } from "@copilotkit/core";
|
|
10
|
+
import type { Suggestion } from "@copilotkit/core";
|
|
11
|
+
import type {
|
|
12
|
+
Attachment,
|
|
13
|
+
AttachmentsConfig,
|
|
14
|
+
AttachmentModality,
|
|
15
|
+
} from "@copilotkit/shared";
|
|
16
|
+
import type { CopilotChatLabels } from "../../providers/types";
|
|
17
|
+
import type { InterruptEvent } from "../../types";
|
|
18
|
+
import type { AutoScrollMode } from "./normalize-auto-scroll";
|
|
19
|
+
|
|
20
|
+
export type CopilotChatInputMode = "input" | "transcribe" | "processing";
|
|
21
|
+
export type { Attachment, AttachmentsConfig, AttachmentModality };
|
|
22
|
+
export type { AutoScrollMode };
|
|
23
|
+
|
|
24
|
+
export interface CopilotChatAttachmentRendererProps {
|
|
25
|
+
type: AttachmentModality;
|
|
26
|
+
source: Attachment["source"];
|
|
27
|
+
filename?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CopilotChatAttachmentQueueProps {
|
|
32
|
+
attachments: Attachment[];
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CopilotChatViewProps {
|
|
37
|
+
messages?: Message[];
|
|
38
|
+
/**
|
|
39
|
+
* Controls how the chat view scrolls as new messages stream in.
|
|
40
|
+
*
|
|
41
|
+
* Accepts the modern `AutoScrollMode` strings or the legacy boolean
|
|
42
|
+
* shorthand. Defaults to `"pin-to-bottom"` when unspecified.
|
|
43
|
+
*
|
|
44
|
+
* - `"pin-to-bottom"` / `true`: stick to the bottom while at the bottom.
|
|
45
|
+
* - `"pin-to-send"`: anchor the latest user message near the top of
|
|
46
|
+
* the viewport while the assistant streams a response (parity with
|
|
47
|
+
* React's `usePinToSend`).
|
|
48
|
+
* - `"none"` / `false`: never auto-scroll.
|
|
49
|
+
*/
|
|
50
|
+
autoScroll?: AutoScrollMode | boolean;
|
|
51
|
+
isRunning?: boolean;
|
|
52
|
+
suggestions?: Suggestion[];
|
|
53
|
+
suggestionLoadingIndexes?: ReadonlyArray<number>;
|
|
54
|
+
welcomeScreen?: boolean;
|
|
55
|
+
attachments?: Attachment[];
|
|
56
|
+
dragOver?: boolean;
|
|
57
|
+
inputValue?: string;
|
|
58
|
+
inputMode?: CopilotChatInputMode;
|
|
59
|
+
inputToolsMenu?: (ToolsMenuItem | "-")[];
|
|
60
|
+
/**
|
|
61
|
+
* When `true`, suppresses the welcome screen while a thread's initial
|
|
62
|
+
* connect is in flight. Prevents the "How can I help you today?" flash
|
|
63
|
+
* that would otherwise appear between mounting an empty cloned agent and
|
|
64
|
+
* the bootstrap messages arriving from `/connect`.
|
|
65
|
+
*/
|
|
66
|
+
isConnecting?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* When `true`, the caller has explicitly picked a thread (via `threadId`
|
|
69
|
+
* prop or `CopilotChatConfigurationProvider`). Suppresses the welcome
|
|
70
|
+
* screen unconditionally — a caller-managed thread targets a specific
|
|
71
|
+
* conversation and should render its messages (or an empty panel during
|
|
72
|
+
* connect) rather than a generic "start a new chat" greeting.
|
|
73
|
+
*/
|
|
74
|
+
hasExplicitThreadId?: boolean;
|
|
75
|
+
onRemoveAttachment?: (id: string) => void;
|
|
76
|
+
onAddFile?: () => void;
|
|
77
|
+
onDragOver?: (event: DragEvent) => void;
|
|
78
|
+
onDragLeave?: (event: DragEvent) => void;
|
|
79
|
+
onDrop?: (event: DragEvent) => void;
|
|
80
|
+
onFinishTranscribeWithAudio?: (audioBlob: Blob) => void | Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface CopilotChatProps extends Omit<
|
|
84
|
+
CopilotChatViewProps,
|
|
85
|
+
| "messages"
|
|
86
|
+
| "isRunning"
|
|
87
|
+
| "suggestions"
|
|
88
|
+
| "suggestionLoadingIndexes"
|
|
89
|
+
| "attachments"
|
|
90
|
+
| "onRemoveAttachment"
|
|
91
|
+
| "onAddFile"
|
|
92
|
+
| "dragOver"
|
|
93
|
+
| "onDragOver"
|
|
94
|
+
| "onDragLeave"
|
|
95
|
+
| "onDrop"
|
|
96
|
+
> {
|
|
97
|
+
agentId?: string;
|
|
98
|
+
threadId?: string;
|
|
99
|
+
throttleMs?: number;
|
|
100
|
+
labels?: Partial<CopilotChatLabels>;
|
|
101
|
+
attachments?: AttachmentsConfig;
|
|
102
|
+
onError?: (event: {
|
|
103
|
+
error: Error;
|
|
104
|
+
code: CopilotKitCoreErrorCode;
|
|
105
|
+
context: Record<string, any>;
|
|
106
|
+
}) => void | Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface CopilotChatViewOverrideSlotProps extends CopilotChatViewProps {
|
|
110
|
+
onSubmitMessage: (value: string) => void | Promise<void>;
|
|
111
|
+
onStop?: () => void;
|
|
112
|
+
onInputChange: (value: string) => void;
|
|
113
|
+
onSelectSuggestion: (
|
|
114
|
+
suggestion: Suggestion,
|
|
115
|
+
index: number,
|
|
116
|
+
) => void | Promise<void>;
|
|
117
|
+
onAddFile?: () => void;
|
|
118
|
+
onStartTranscribe?: () => void;
|
|
119
|
+
onCancelTranscribe?: () => void;
|
|
120
|
+
onFinishTranscribe?: () => void;
|
|
121
|
+
onFinishTranscribeWithAudio?: (audioBlob: Blob) => void | Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface CopilotChatMessageViewSlotProps {
|
|
125
|
+
messages: Message[];
|
|
126
|
+
isRunning: boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface CopilotChatScrollToBottomButtonSlotProps {
|
|
130
|
+
onClick: () => void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface CopilotChatFeatherSlotProps {}
|
|
134
|
+
|
|
135
|
+
export interface CopilotChatScrollViewSlotProps
|
|
136
|
+
extends CopilotChatMessageViewSlotProps, CopilotChatSuggestionViewSlotProps {
|
|
137
|
+
messagePaddingBottom: string;
|
|
138
|
+
showScrollToBottomButton: boolean;
|
|
139
|
+
onScroll: () => void;
|
|
140
|
+
scrollToBottom: () => void;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface CopilotChatInterruptSlotProps<
|
|
144
|
+
TValue = unknown,
|
|
145
|
+
TResult = unknown,
|
|
146
|
+
> {
|
|
147
|
+
event: InterruptEvent<TValue>;
|
|
148
|
+
result: TResult;
|
|
149
|
+
resolve: (response: unknown) => void;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface CopilotChatInputSlotProps {
|
|
153
|
+
modelValue: string;
|
|
154
|
+
isRunning: boolean;
|
|
155
|
+
inputMode: CopilotChatInputMode;
|
|
156
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
157
|
+
onUpdateModelValue: (value: string) => void;
|
|
158
|
+
onSubmitMessage: (value: string) => void;
|
|
159
|
+
onStop?: () => void;
|
|
160
|
+
onAddFile: () => void;
|
|
161
|
+
onStartTranscribe: () => void;
|
|
162
|
+
onCancelTranscribe: () => void;
|
|
163
|
+
onFinishTranscribe: () => void;
|
|
164
|
+
onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface CopilotChatSuggestionViewSlotProps {
|
|
168
|
+
suggestions: Suggestion[];
|
|
169
|
+
loadingIndexes: ReadonlyArray<number>;
|
|
170
|
+
onSelectSuggestion: (suggestion: Suggestion, index: number) => void;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface CopilotChatSuggestionViewSuggestionSlotProps {
|
|
174
|
+
suggestion: Suggestion;
|
|
175
|
+
index: number;
|
|
176
|
+
isLoading: boolean;
|
|
177
|
+
onSelect: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface CopilotChatSuggestionViewContainerSlotProps extends CopilotChatSuggestionViewSlotProps {
|
|
181
|
+
containerClass: unknown[];
|
|
182
|
+
containerAttrs: Record<string, unknown>;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface CopilotChatSuggestionViewLayoutSlotProps extends CopilotChatSuggestionViewContainerSlotProps {}
|
|
186
|
+
|
|
187
|
+
export interface CopilotChatWelcomeScreenSlotProps extends CopilotChatSuggestionViewSlotProps {
|
|
188
|
+
modelValue: string;
|
|
189
|
+
isRunning: boolean;
|
|
190
|
+
inputMode: CopilotChatInputMode;
|
|
191
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
192
|
+
onUpdateModelValue: (value: string) => void;
|
|
193
|
+
onSubmitMessage: (value: string) => void;
|
|
194
|
+
onStop?: () => void;
|
|
195
|
+
onAddFile: () => void;
|
|
196
|
+
onStartTranscribe: () => void;
|
|
197
|
+
onCancelTranscribe: () => void;
|
|
198
|
+
onFinishTranscribe: () => void;
|
|
199
|
+
onFinishTranscribeWithAudio: (audioBlob: Blob) => void | Promise<void>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type ToolsMenuItem = {
|
|
203
|
+
label: string;
|
|
204
|
+
} & (
|
|
205
|
+
| {
|
|
206
|
+
action: () => void;
|
|
207
|
+
items?: never;
|
|
208
|
+
}
|
|
209
|
+
| {
|
|
210
|
+
action?: never;
|
|
211
|
+
items: (ToolsMenuItem | "-")[];
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
export interface CopilotChatUserMessageOnEditMessageProps {
|
|
216
|
+
message: UserMessage;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface CopilotChatUserMessageOnSwitchToBranchProps {
|
|
220
|
+
message: UserMessage;
|
|
221
|
+
branchIndex: number;
|
|
222
|
+
numberOfBranches: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface CopilotChatUserMessageMessageRendererSlotProps {
|
|
226
|
+
message: UserMessage;
|
|
227
|
+
content: string;
|
|
228
|
+
isMultiline: boolean;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface CopilotChatUserMessageToolbarSlotProps {
|
|
232
|
+
message: UserMessage;
|
|
233
|
+
showBranchNavigation: boolean;
|
|
234
|
+
hasEditAction: boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface CopilotChatUserMessageCopyButtonSlotProps {
|
|
238
|
+
onCopy: () => Promise<void>;
|
|
239
|
+
copied: boolean;
|
|
240
|
+
label: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface CopilotChatUserMessageEditButtonSlotProps {
|
|
244
|
+
onEdit: () => void;
|
|
245
|
+
label: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface CopilotChatUserMessageBranchNavigationSlotProps {
|
|
249
|
+
branchIndex: number;
|
|
250
|
+
numberOfBranches: number;
|
|
251
|
+
canGoPrev: boolean;
|
|
252
|
+
canGoNext: boolean;
|
|
253
|
+
goPrev: () => void;
|
|
254
|
+
goNext: () => void;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface CopilotChatUserMessageLayoutSlotProps {
|
|
258
|
+
message: UserMessage;
|
|
259
|
+
content: string;
|
|
260
|
+
isMultiline: boolean;
|
|
261
|
+
showBranchNavigation: boolean;
|
|
262
|
+
hasEditAction: boolean;
|
|
263
|
+
branchIndex: number;
|
|
264
|
+
numberOfBranches: number;
|
|
265
|
+
canGoPrev: boolean;
|
|
266
|
+
canGoNext: boolean;
|
|
267
|
+
onCopy: () => Promise<void>;
|
|
268
|
+
onEdit: () => void;
|
|
269
|
+
goPrev: () => void;
|
|
270
|
+
goNext: () => void;
|
|
271
|
+
copied: boolean;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface CopilotChatAssistantMessageMessageRendererSlotProps {
|
|
275
|
+
message: AssistantMessage;
|
|
276
|
+
content: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface CopilotChatAssistantMessageToolbarSlotProps {
|
|
280
|
+
message: AssistantMessage;
|
|
281
|
+
shouldShowToolbar: boolean;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export interface CopilotChatAssistantMessageCopyButtonSlotProps {
|
|
285
|
+
onCopy: () => Promise<void>;
|
|
286
|
+
copied: boolean;
|
|
287
|
+
label: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface CopilotChatAssistantMessageThumbsUpButtonSlotProps {
|
|
291
|
+
onThumbsUp: () => void;
|
|
292
|
+
label: string;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface CopilotChatAssistantMessageThumbsDownButtonSlotProps {
|
|
296
|
+
onThumbsDown: () => void;
|
|
297
|
+
label: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface CopilotChatAssistantMessageReadAloudButtonSlotProps {
|
|
301
|
+
onReadAloud: () => void;
|
|
302
|
+
label: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface CopilotChatAssistantMessageRegenerateButtonSlotProps {
|
|
306
|
+
onRegenerate: () => void;
|
|
307
|
+
label: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export interface CopilotChatAssistantMessageToolCallsViewSlotProps {
|
|
311
|
+
message: AssistantMessage;
|
|
312
|
+
messages: Message[];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface CopilotChatAssistantMessageLayoutSlotProps {
|
|
316
|
+
message: AssistantMessage;
|
|
317
|
+
content: string;
|
|
318
|
+
isRunning: boolean;
|
|
319
|
+
toolbarVisible: boolean;
|
|
320
|
+
shouldShowToolbar: boolean;
|
|
321
|
+
messageRenderer: unknown;
|
|
322
|
+
toolbar: unknown;
|
|
323
|
+
copyButton: unknown;
|
|
324
|
+
thumbsUpButton: unknown;
|
|
325
|
+
thumbsDownButton: unknown;
|
|
326
|
+
readAloudButton: unknown;
|
|
327
|
+
regenerateButton: unknown;
|
|
328
|
+
toolCallsView: unknown;
|
|
329
|
+
onCopy: () => Promise<void>;
|
|
330
|
+
onThumbsUp: () => void;
|
|
331
|
+
onThumbsDown: () => void;
|
|
332
|
+
onReadAloud: () => void;
|
|
333
|
+
onRegenerate: () => void;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface CopilotChatReasoningMessageHeaderSlotProps {
|
|
337
|
+
isOpen: boolean;
|
|
338
|
+
label: string;
|
|
339
|
+
hasContent: boolean;
|
|
340
|
+
isStreaming: boolean;
|
|
341
|
+
onClick?: () => void;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface CopilotChatReasoningMessageContentViewSlotProps {
|
|
345
|
+
isStreaming: boolean;
|
|
346
|
+
hasContent: boolean;
|
|
347
|
+
content: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface CopilotChatReasoningMessageToggleSlotProps {
|
|
351
|
+
isOpen: boolean;
|
|
352
|
+
contentView: CopilotChatReasoningMessageContentViewSlotProps;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface CopilotChatReasoningMessageLayoutSlotProps {
|
|
356
|
+
message: ReasoningMessage;
|
|
357
|
+
messages: Message[];
|
|
358
|
+
isRunning: boolean;
|
|
359
|
+
header: CopilotChatReasoningMessageHeaderSlotProps;
|
|
360
|
+
contentView: CopilotChatReasoningMessageContentViewSlotProps;
|
|
361
|
+
toggle: CopilotChatReasoningMessageToggleSlotProps;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export interface CopilotChatToolCallRenderSlotProps {
|
|
365
|
+
name: string;
|
|
366
|
+
args: unknown;
|
|
367
|
+
status: ToolCallStatus;
|
|
368
|
+
result: string | undefined;
|
|
369
|
+
toolCall: ToolCall;
|
|
370
|
+
toolMessage: ToolMessage | undefined;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface CopilotChatToggleButtonProps {
|
|
374
|
+
disabled?: boolean;
|
|
375
|
+
type?: "button" | "submit" | "reset";
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface CopilotChatToggleButtonIconSlotProps {
|
|
379
|
+
iconClass: string;
|
|
380
|
+
isOpen: boolean;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface CopilotModalHeaderProps {
|
|
384
|
+
title?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface CopilotModalHeaderTitleContentSlotProps {
|
|
388
|
+
title: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export interface CopilotModalHeaderCloseButtonSlotProps {
|
|
392
|
+
onClose: () => void;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface CopilotModalHeaderLayoutSlotProps {
|
|
396
|
+
title: string;
|
|
397
|
+
onClose: () => void;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export interface CopilotSidebarWelcomeScreenInputSlotProps {
|
|
401
|
+
modelValue: string;
|
|
402
|
+
isRunning: boolean;
|
|
403
|
+
inputMode: CopilotChatInputMode;
|
|
404
|
+
inputToolsMenu: (ToolsMenuItem | "-")[];
|
|
405
|
+
onUpdateModelValue: (value: string) => void;
|
|
406
|
+
onSubmitMessage: (value: string) => void;
|
|
407
|
+
onStop?: () => void;
|
|
408
|
+
onAddFile?: () => void;
|
|
409
|
+
onStartTranscribe?: () => void;
|
|
410
|
+
onCancelTranscribe?: () => void;
|
|
411
|
+
onFinishTranscribe?: () => void;
|
|
412
|
+
onFinishTranscribeWithAudio?: (audioBlob: Blob) => void | Promise<void>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface CopilotSidebarWelcomeScreenSuggestionViewSlotProps {
|
|
416
|
+
suggestions: Suggestion[];
|
|
417
|
+
loadingIndexes: ReadonlyArray<number>;
|
|
418
|
+
onSelectSuggestion: (suggestion: Suggestion, index: number) => void;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface CopilotSidebarWelcomeScreenLayoutSlotProps
|
|
422
|
+
extends
|
|
423
|
+
CopilotSidebarWelcomeScreenInputSlotProps,
|
|
424
|
+
CopilotSidebarWelcomeScreenSuggestionViewSlotProps {}
|
|
425
|
+
|
|
426
|
+
export type CopilotSidebarWelcomeScreenProps =
|
|
427
|
+
CopilotSidebarWelcomeScreenLayoutSlotProps;
|
|
428
|
+
|
|
429
|
+
export interface CopilotSidebarViewHeaderSlotProps {
|
|
430
|
+
title: string;
|
|
431
|
+
onClose: () => void;
|
|
432
|
+
isOpen: boolean;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export interface CopilotSidebarViewToggleButtonSlotProps {
|
|
436
|
+
isOpen: boolean;
|
|
437
|
+
toggle: () => void;
|
|
438
|
+
open: () => void;
|
|
439
|
+
close: () => void;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface CopilotSidebarViewProps extends CopilotChatViewProps {
|
|
443
|
+
width?: number | string;
|
|
444
|
+
defaultOpen?: boolean;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export type CopilotPopupViewHeaderSlotProps = CopilotSidebarViewHeaderSlotProps;
|
|
448
|
+
|
|
449
|
+
export type CopilotPopupViewToggleButtonSlotProps =
|
|
450
|
+
CopilotSidebarViewToggleButtonSlotProps;
|
|
451
|
+
|
|
452
|
+
export type CopilotPopupWelcomeScreenInputSlotProps =
|
|
453
|
+
CopilotSidebarWelcomeScreenInputSlotProps;
|
|
454
|
+
|
|
455
|
+
export type CopilotPopupWelcomeScreenSuggestionViewSlotProps =
|
|
456
|
+
CopilotSidebarWelcomeScreenSuggestionViewSlotProps;
|
|
457
|
+
|
|
458
|
+
export type CopilotPopupWelcomeScreenLayoutSlotProps =
|
|
459
|
+
CopilotSidebarWelcomeScreenLayoutSlotProps;
|
|
460
|
+
|
|
461
|
+
export type CopilotPopupWelcomeScreenProps =
|
|
462
|
+
CopilotPopupWelcomeScreenLayoutSlotProps;
|
|
463
|
+
|
|
464
|
+
export interface CopilotPopupViewProps extends CopilotChatViewProps {
|
|
465
|
+
width?: number | string;
|
|
466
|
+
height?: number | string;
|
|
467
|
+
clickOutsideToClose?: boolean;
|
|
468
|
+
defaultOpen?: boolean;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface CopilotPopupProps extends CopilotChatProps {
|
|
472
|
+
width?: number | string;
|
|
473
|
+
height?: number | string;
|
|
474
|
+
clickOutsideToClose?: boolean;
|
|
475
|
+
defaultOpen?: boolean;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export interface CopilotSidebarProps extends CopilotChatProps {
|
|
479
|
+
width?: number | string;
|
|
480
|
+
defaultOpen?: boolean;
|
|
481
|
+
}
|