@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,314 @@
|
|
|
1
|
+
@import "tailwindcss" prefix(cpk);
|
|
2
|
+
@plugin "@tailwindcss/typography";
|
|
3
|
+
@source "../**/*.{ts,tsx,vue}";
|
|
4
|
+
@source "../../node_modules/streamdown-vue/dist/**/*.{js,mjs,cjs}";
|
|
5
|
+
|
|
6
|
+
@import "tw-animate-css";
|
|
7
|
+
|
|
8
|
+
@custom-variant dark (&:is(.dark *));
|
|
9
|
+
|
|
10
|
+
[data-copilotkit] {
|
|
11
|
+
--background: oklch(1 0 0);
|
|
12
|
+
--foreground: oklch(0.145 0 0);
|
|
13
|
+
--card: oklch(1 0 0);
|
|
14
|
+
--card-foreground: oklch(0.145 0 0);
|
|
15
|
+
--popover: oklch(1 0 0);
|
|
16
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
17
|
+
--primary: oklch(0.205 0 0);
|
|
18
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
19
|
+
--secondary: oklch(0.97 0 0);
|
|
20
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
21
|
+
--muted: oklch(0.97 0 0);
|
|
22
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
23
|
+
--accent: oklch(0.97 0 0);
|
|
24
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
25
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
26
|
+
--destructive-foreground: oklch(0.577 0.245 27.325);
|
|
27
|
+
--border: oklch(0.922 0 0);
|
|
28
|
+
--input: oklch(0.922 0 0);
|
|
29
|
+
--ring: oklch(0.708 0 0);
|
|
30
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
31
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
32
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
33
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
34
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
35
|
+
--radius: 0.625rem;
|
|
36
|
+
--sidebar: oklch(0.985 0 0);
|
|
37
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
38
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
39
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
40
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
41
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
42
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
43
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dark [data-copilotkit],
|
|
47
|
+
[data-copilotkit].dark {
|
|
48
|
+
--background: oklch(0.145 0 0);
|
|
49
|
+
--foreground: oklch(0.985 0 0);
|
|
50
|
+
--card: oklch(0.145 0 0);
|
|
51
|
+
--card-foreground: oklch(0.985 0 0);
|
|
52
|
+
--popover: oklch(0.145 0 0);
|
|
53
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
54
|
+
--primary: oklch(0.985 0 0);
|
|
55
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
56
|
+
--secondary: oklch(0.269 0 0);
|
|
57
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
58
|
+
--muted: oklch(0.269 0 0);
|
|
59
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
60
|
+
--accent: oklch(0.269 0 0);
|
|
61
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
62
|
+
--destructive: oklch(0.396 0.141 25.723);
|
|
63
|
+
--destructive-foreground: oklch(0.637 0.237 25.331);
|
|
64
|
+
--border: oklch(0.269 0 0);
|
|
65
|
+
--input: oklch(0.269 0 0);
|
|
66
|
+
--ring: oklch(0.556 0 0);
|
|
67
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
68
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
69
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
70
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
71
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
72
|
+
--sidebar: oklch(0.205 0 0);
|
|
73
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
74
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
75
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
76
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
77
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
78
|
+
--sidebar-border: oklch(0.269 0 0);
|
|
79
|
+
--sidebar-ring: oklch(0.439 0 0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@theme inline {
|
|
83
|
+
--color-background: var(--background);
|
|
84
|
+
--color-foreground: var(--foreground);
|
|
85
|
+
--color-card: var(--card);
|
|
86
|
+
--color-card-foreground: var(--card-foreground);
|
|
87
|
+
--color-popover: var(--popover);
|
|
88
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
89
|
+
--color-primary: var(--primary);
|
|
90
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
91
|
+
--color-secondary: var(--secondary);
|
|
92
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
93
|
+
--color-muted: var(--muted);
|
|
94
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
95
|
+
--color-accent: var(--accent);
|
|
96
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
97
|
+
--color-destructive: var(--destructive);
|
|
98
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
99
|
+
--color-border: var(--border);
|
|
100
|
+
--color-input: var(--input);
|
|
101
|
+
--color-ring: var(--ring);
|
|
102
|
+
--color-chart-1: var(--chart-1);
|
|
103
|
+
--color-chart-2: var(--chart-2);
|
|
104
|
+
--color-chart-3: var(--chart-3);
|
|
105
|
+
--color-chart-4: var(--chart-4);
|
|
106
|
+
--color-chart-5: var(--chart-5);
|
|
107
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
108
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
109
|
+
--radius-lg: var(--radius);
|
|
110
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
111
|
+
--color-sidebar: var(--sidebar);
|
|
112
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
113
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
114
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
115
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
116
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
117
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
118
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@theme {
|
|
122
|
+
--animate-pulse-cursor: pulse-cursor 0.9s cubic-bezier(0.4, 0, 0.2, 1)
|
|
123
|
+
infinite;
|
|
124
|
+
@keyframes pulse-cursor {
|
|
125
|
+
0%,
|
|
126
|
+
100% {
|
|
127
|
+
transform: scale(1);
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
50% {
|
|
131
|
+
transform: scale(1.5);
|
|
132
|
+
opacity: 0.8;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@layer base {
|
|
138
|
+
* {
|
|
139
|
+
@apply cpk:border-border cpk:outline-ring/50;
|
|
140
|
+
}
|
|
141
|
+
/* Apply foreground/background on CopilotKit roots (replaces body rule) */
|
|
142
|
+
[data-copilotkit] {
|
|
143
|
+
color: var(--foreground);
|
|
144
|
+
background-color: var(--background);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Mobile viewport support */
|
|
148
|
+
@supports (height: 100dvh) {
|
|
149
|
+
[data-copilot-sidebar] {
|
|
150
|
+
height: 100dvh;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Responsive sidebar width */
|
|
155
|
+
@media (min-width: 768px) {
|
|
156
|
+
[data-copilot-sidebar] {
|
|
157
|
+
width: var(--sidebar-width, 480px) !important;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Mobile optimizations */
|
|
162
|
+
@media (max-width: 767px) {
|
|
163
|
+
[data-copilot-sidebar] {
|
|
164
|
+
width: 100% !important;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Improve touch scrolling on iOS */
|
|
168
|
+
[data-copilot-sidebar] {
|
|
169
|
+
-webkit-overflow-scrolling: touch;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Better scrolling performance */
|
|
173
|
+
[data-sidebar-chat] {
|
|
174
|
+
touch-action: pan-y;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
[data-copilotkit] div[data-streamdown="code-block"] > pre {
|
|
180
|
+
@apply cpk:mt-0 cpk:mb-0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[data-copilotkit] .prose input[type="checkbox"] {
|
|
184
|
+
appearance: none;
|
|
185
|
+
background-color: #fff;
|
|
186
|
+
background-origin: border-box;
|
|
187
|
+
border-color: #9b9b9b;
|
|
188
|
+
border-width: 1px;
|
|
189
|
+
color: #004f99;
|
|
190
|
+
display: inline-block;
|
|
191
|
+
flex-shrink: 0;
|
|
192
|
+
height: 1rem;
|
|
193
|
+
padding: 0;
|
|
194
|
+
-webkit-print-color-adjust: exact;
|
|
195
|
+
print-color-adjust: exact;
|
|
196
|
+
-webkit-user-select: none;
|
|
197
|
+
user-select: none;
|
|
198
|
+
vertical-align: middle;
|
|
199
|
+
width: 1rem;
|
|
200
|
+
border-radius: 2px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
[data-copilotkit] .prose input[type="checkbox"]:checked {
|
|
204
|
+
background-color: #004f99;
|
|
205
|
+
border-color: #004f99;
|
|
206
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
|
|
207
|
+
background-position: center;
|
|
208
|
+
background-repeat: no-repeat;
|
|
209
|
+
background-size: 100% 100%;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-block"] {
|
|
213
|
+
@apply cpk:my-4 cpk:w-full cpk:overflow-hidden cpk:rounded-xl cpk:border cpk:border-border cpk:bg-transparent;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-block-header"] {
|
|
217
|
+
@apply cpk:flex cpk:items-center cpk:justify-between cpk:p-3 cpk:text-xs cpk:text-muted-foreground;
|
|
218
|
+
background-color: transparent !important;
|
|
219
|
+
border-bottom: 0 !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-lang"] {
|
|
223
|
+
@apply cpk:ml-1 cpk:font-mono cpk:lowercase;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.copilot-chat-assistant-markdown [data-streamdown="h2"] {
|
|
227
|
+
margin-bottom: 0.5rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.copilot-chat-assistant-markdown [data-streamdown="inline-code"] {
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
padding-left: 0 !important;
|
|
233
|
+
padding-right: 0 !important;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.copilot-chat-assistant-markdown .sr-only {
|
|
237
|
+
position: absolute;
|
|
238
|
+
width: 1px;
|
|
239
|
+
height: 1px;
|
|
240
|
+
padding: 0;
|
|
241
|
+
margin: -1px;
|
|
242
|
+
overflow: hidden;
|
|
243
|
+
clip: rect(0, 0, 0, 0);
|
|
244
|
+
white-space: nowrap;
|
|
245
|
+
border: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-actions"] {
|
|
249
|
+
@apply cpk:flex cpk:items-center cpk:gap-2;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-actions"] button span {
|
|
253
|
+
position: absolute;
|
|
254
|
+
width: 1px;
|
|
255
|
+
height: 1px;
|
|
256
|
+
padding: 0;
|
|
257
|
+
margin: -1px;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
clip: rect(0, 0, 0, 0);
|
|
260
|
+
white-space: nowrap;
|
|
261
|
+
border: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.copilot-chat-assistant-markdown [data-streamdown="download-button"],
|
|
265
|
+
.copilot-chat-assistant-markdown [data-streamdown="copy-button"] {
|
|
266
|
+
@apply cpk:cursor-pointer cpk:p-1 cpk:text-muted-foreground cpk:transition-all cpk:hover:text-foreground cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50;
|
|
267
|
+
background: transparent !important;
|
|
268
|
+
border: 0 !important;
|
|
269
|
+
border-radius: 0 !important;
|
|
270
|
+
opacity: 1 !important;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-body"] {
|
|
274
|
+
@apply cpk:overflow-x-auto cpk:p-0;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-body"] pre {
|
|
278
|
+
@apply cpk:overflow-x-auto cpk:border-t cpk:border-border cpk:p-4 cpk:text-sm;
|
|
279
|
+
background-color: transparent !important;
|
|
280
|
+
margin: 0 !important;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-body"] pre.shiki {
|
|
284
|
+
--shiki-light-bg: transparent !important;
|
|
285
|
+
background-color: transparent !important;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.copilot-chat-assistant-markdown [data-streamdown="code"] .line {
|
|
289
|
+
display: block;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.copilot-chat-assistant-markdown [data-streamdown="code-line-number"] {
|
|
293
|
+
@apply cpk:mr-4 cpk:inline-block cpk:w-4 cpk:select-none cpk:text-right cpk:font-mono cpk:text-[13px] cpk:text-muted-foreground/50;
|
|
294
|
+
opacity: 1 !important;
|
|
295
|
+
padding-right: 0 !important;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.copilot-chat-assistant-markdown [data-streamdown="table-header"],
|
|
299
|
+
.copilot-chat-assistant-markdown [data-streamdown="thead"] {
|
|
300
|
+
@apply cpk:bg-muted/80;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.copilot-chat-assistant-markdown [data-streamdown="table-body"],
|
|
304
|
+
.copilot-chat-assistant-markdown [data-streamdown="tbody"] {
|
|
305
|
+
@apply cpk:divide-y cpk:divide-border cpk:bg-muted/40;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.copilot-chat-assistant-markdown [data-streamdown="th"] {
|
|
309
|
+
@apply cpk:whitespace-nowrap cpk:px-4 cpk:py-2 cpk:text-left cpk:font-semibold cpk:text-sm;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.copilot-chat-assistant-markdown [data-streamdown="td"] {
|
|
313
|
+
@apply cpk:px-4 cpk:py-2 cpk:text-sm;
|
|
314
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import * as VuePackage from "../index";
|
|
4
|
+
|
|
5
|
+
describe("package exports", () => {
|
|
6
|
+
it("exports chat components and built-in activity renderers from the package root", () => {
|
|
7
|
+
expect(typeof VuePackage.CopilotChat).toBe("object");
|
|
8
|
+
expect(typeof VuePackage.CopilotChat.View).toBe("object");
|
|
9
|
+
expect(typeof VuePackage.CopilotChatMessageView).toBe("object");
|
|
10
|
+
expect(typeof VuePackage.CopilotChatToolCallsView).toBe("object");
|
|
11
|
+
expect(typeof VuePackage.CopilotChatInput).toBe("object");
|
|
12
|
+
expect(typeof VuePackage.CopilotChatAssistantMessage).toBe("object");
|
|
13
|
+
expect(typeof VuePackage.CopilotChatUserMessage).toBe("object");
|
|
14
|
+
expect(typeof VuePackage.CopilotChatReasoningMessage).toBe("object");
|
|
15
|
+
expect(typeof VuePackage.CopilotChatSuggestionPill).toBe("object");
|
|
16
|
+
expect(typeof VuePackage.CopilotChatSuggestionView).toBe("object");
|
|
17
|
+
expect(typeof VuePackage.CopilotChatView).toBe("object");
|
|
18
|
+
expect(typeof VuePackage.CopilotPopupView).toBe("object");
|
|
19
|
+
expect(typeof VuePackage.CopilotPopupView.WelcomeScreen).toBe("object");
|
|
20
|
+
expect(typeof VuePackage.CopilotPopup).toBe("object");
|
|
21
|
+
expect(typeof VuePackage.CopilotSidebar).toBe("object");
|
|
22
|
+
expect(VuePackage.MCPAppsActivityType).toBe("mcp-apps");
|
|
23
|
+
expect(typeof VuePackage.MCPAppsActivityRenderer).toBe("object");
|
|
24
|
+
expect(VuePackage.A2UISurfaceActivityType).toBe("a2ui-surface");
|
|
25
|
+
expect(typeof VuePackage.A2UISurfaceActivityRenderer).toBe("object");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("exports the vue stylesheet entrypoint", () => {
|
|
29
|
+
const packageJson = JSON.parse(readFileSync("package.json", "utf8")) as {
|
|
30
|
+
exports?: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
expect(packageJson.exports?.["./styles.css"]).toBe("./dist/styles.css");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
if (typeof window !== "undefined" && typeof window.matchMedia !== "function") {
|
|
4
|
+
vi.stubGlobal("matchMedia", (query: string) => ({
|
|
5
|
+
matches: false,
|
|
6
|
+
media: query,
|
|
7
|
+
onchange: null,
|
|
8
|
+
addListener: vi.fn(),
|
|
9
|
+
removeListener: vi.fn(),
|
|
10
|
+
addEventListener: vi.fn(),
|
|
11
|
+
removeEventListener: vi.fn(),
|
|
12
|
+
dispatchEvent: vi.fn(),
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class MockMediaRecorder {
|
|
17
|
+
static isTypeSupported() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public state: RecordingState = "inactive";
|
|
22
|
+
public mimeType = "audio/webm";
|
|
23
|
+
public ondataavailable: ((event: BlobEvent) => void) | null = null;
|
|
24
|
+
public onstop: (() => void) | null = null;
|
|
25
|
+
public onerror: (() => void) | null = null;
|
|
26
|
+
private readonly listeners = new Map<string, Set<(...args: any[]) => void>>();
|
|
27
|
+
|
|
28
|
+
constructor(_stream: MediaStream, _options?: MediaRecorderOptions) {
|
|
29
|
+
void _stream;
|
|
30
|
+
void _options;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
addEventListener(type: string, listener: (...args: any[]) => void) {
|
|
34
|
+
const existing = this.listeners.get(type) ?? new Set();
|
|
35
|
+
existing.add(listener);
|
|
36
|
+
this.listeners.set(type, existing);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
removeEventListener(type: string, listener: (...args: any[]) => void) {
|
|
40
|
+
this.listeners.get(type)?.delete(listener);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private dispatch(type: string, ...args: any[]) {
|
|
44
|
+
for (const listener of this.listeners.get(type) ?? []) {
|
|
45
|
+
listener(...args);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
start() {
|
|
50
|
+
this.state = "recording";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
stop() {
|
|
54
|
+
if (this.state !== "recording") {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.state = "inactive";
|
|
58
|
+
const dataEvent = {
|
|
59
|
+
data: new Blob(["mock-audio"], { type: this.mimeType }),
|
|
60
|
+
} as BlobEvent;
|
|
61
|
+
this.ondataavailable?.(dataEvent);
|
|
62
|
+
this.dispatch("dataavailable", dataEvent);
|
|
63
|
+
this.onstop?.();
|
|
64
|
+
this.dispatch("stop");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class MockAudioContext {
|
|
69
|
+
public state: AudioContextState = "running";
|
|
70
|
+
|
|
71
|
+
createMediaStreamSource() {
|
|
72
|
+
return {
|
|
73
|
+
connect: vi.fn(),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
createAnalyser() {
|
|
78
|
+
return {
|
|
79
|
+
fftSize: 2048,
|
|
80
|
+
getByteTimeDomainData: (target: Uint8Array) => {
|
|
81
|
+
target.fill(128);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
close() {
|
|
87
|
+
this.state = "closed";
|
|
88
|
+
return Promise.resolve();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (typeof window !== "undefined") {
|
|
93
|
+
if (!window.ResizeObserver) {
|
|
94
|
+
vi.stubGlobal(
|
|
95
|
+
"ResizeObserver",
|
|
96
|
+
class {
|
|
97
|
+
observe() {}
|
|
98
|
+
disconnect() {}
|
|
99
|
+
unobserve() {}
|
|
100
|
+
},
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!window.MediaRecorder) {
|
|
105
|
+
vi.stubGlobal(
|
|
106
|
+
"MediaRecorder",
|
|
107
|
+
MockMediaRecorder as unknown as typeof MediaRecorder,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!window.AudioContext) {
|
|
112
|
+
vi.stubGlobal(
|
|
113
|
+
"AudioContext",
|
|
114
|
+
MockAudioContext as unknown as typeof AudioContext,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!window.navigator.mediaDevices) {
|
|
119
|
+
Object.defineProperty(window.navigator, "mediaDevices", {
|
|
120
|
+
value: {},
|
|
121
|
+
configurable: true,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (typeof window.navigator.mediaDevices.getUserMedia !== "function") {
|
|
126
|
+
window.navigator.mediaDevices.getUserMedia = vi.fn(async () => ({
|
|
127
|
+
getTracks: () => [{ stop: vi.fn() }],
|
|
128
|
+
})) as typeof window.navigator.mediaDevices.getUserMedia;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
Object.defineProperty(HTMLCanvasElement.prototype, "getContext", {
|
|
132
|
+
configurable: true,
|
|
133
|
+
value: vi.fn(() => ({
|
|
134
|
+
scale: vi.fn(),
|
|
135
|
+
clearRect: vi.fn(),
|
|
136
|
+
fillRect: vi.fn(),
|
|
137
|
+
fillStyle: "#000",
|
|
138
|
+
globalAlpha: 1,
|
|
139
|
+
})),
|
|
140
|
+
});
|
|
141
|
+
}
|