@copilotkit/vue 2.0.0-rc.1 → 2.0.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PARITY.md +13 -12
- package/README.md +1 -2
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts +3 -1
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts.map +1 -1
- package/dist/hooks/use-copilot-action.d.ts.map +1 -1
- package/dist/hooks/use-frontend-tool.d.ts +1 -1
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/hooks/zod-parameters.d.ts +14 -0
- package/dist/hooks/zod-parameters.d.ts.map +1 -0
- package/dist/index.cjs +1 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +384 -14275
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-2np7y4Qt.cjs +92 -0
- package/dist/use-render-activity-message-2np7y4Qt.cjs.map +1 -0
- package/dist/use-render-activity-message-D59E9t0x.js +18097 -0
- package/dist/use-render-activity-message-D59E9t0x.js.map +1 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts +7 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -1
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -1
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +13 -45
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +11 -2
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts +144 -0
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts.map +1 -0
- package/dist/v2/components/a2ui.d.ts +3 -7
- package/dist/v2/components/a2ui.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +3 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts +16 -0
- package/dist/v2/components/chat/CopilotChatAssistantToolbarButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +21 -232
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts +22 -0
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +20 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts +32 -0
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToolCallItem.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +11 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +1 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +2 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/StreamingMarkdownDefault.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts +0 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts.map +1 -1
- package/dist/v2/components/chat/index.d.ts +17 -1
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts +12 -0
- package/dist/v2/components/chat/inspector-shortcuts.d.ts.map +1 -0
- package/dist/v2/components/chat/message-feedback.d.ts +89 -0
- package/dist/v2/components/chat/message-feedback.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts +39 -0
- package/dist/v2/components/chat/tool-call-capture.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts +22 -0
- package/dist/v2/components/chat/tool-call-display-context.d.ts.map +1 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts +131 -0
- package/dist/v2/components/chat/tool-call-group-parts.d.ts.map +1 -0
- package/dist/v2/components/chat/turn-work.d.ts +33 -0
- package/dist/v2/components/chat/turn-work.d.ts.map +1 -0
- package/dist/v2/components/chat/types.d.ts +104 -5
- package/dist/v2/components/chat/types.d.ts.map +1 -1
- package/dist/v2/components/chat/use-chat-labels.d.ts +8 -0
- package/dist/v2/components/chat/use-chat-labels.d.ts.map +1 -0
- package/dist/v2/components/chat/use-lightbox.d.ts +18 -0
- package/dist/v2/components/chat/use-lightbox.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +968 -1
- package/dist/v2/components/icons/index.d.ts.map +1 -1
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts +55 -0
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts +40 -0
- package/dist/v2/components/ui/CopilotPopover.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts +37 -0
- package/dist/v2/components/ui/CopilotTooltip.vue.d.ts.map +1 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts +14 -0
- package/dist/v2/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/v2/components/ui/floating.d.ts +84 -0
- package/dist/v2/components/ui/floating.d.ts.map +1 -0
- package/dist/v2/components/ui/presence.d.ts +9 -0
- package/dist/v2/components/ui/presence.d.ts.map +1 -0
- package/dist/v2/components/ui/use-id.d.ts +9 -0
- package/dist/v2/components/ui/use-id.d.ts.map +1 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts +6 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-frontend-tool.d.ts +5 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-activity-message.d.ts +13 -9
- package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-custom-messages.d.ts +5 -7
- package/dist/v2/hooks/use-render-custom-messages.d.ts.map +1 -1
- package/dist/v2/hooks/use-render-tool.d.ts +4 -0
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.d.cts +3 -0
- package/dist/v2/index.d.mts +3 -0
- package/dist/v2/index.d.ts +3 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/index.mjs +197 -197
- package/dist/v2/index.mjs.map +1 -1
- package/dist/v2/lib/message-feedback.d.ts +33 -0
- package/dist/v2/lib/message-feedback.d.ts.map +1 -0
- package/dist/v2/lib/processPartialHtml.d.ts +1 -2
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -1
- package/dist/v2/lib/vue-core.d.ts +0 -1
- package/dist/v2/lib/vue-core.d.ts.map +1 -1
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +56 -6
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +6 -2
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/index.d.ts +1 -1
- package/dist/v2/providers/index.d.ts.map +1 -1
- package/dist/v2/providers/keys.d.ts +8 -0
- package/dist/v2/providers/keys.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +3 -37
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/dist/v2/styles/CopilotKitStyles.d.ts +18 -0
- package/dist/v2/styles/CopilotKitStyles.d.ts.map +1 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts +2 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/types/human-in-the-loop.d.ts +8 -29
- package/dist/v2/types/human-in-the-loop.d.ts.map +1 -1
- package/dist/v2/types/interrupt.d.ts +1 -22
- package/dist/v2/types/interrupt.d.ts.map +1 -1
- package/dist/v2/types/vue-activity-message-renderer.d.ts +16 -15
- package/dist/v2/types/vue-activity-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-custom-message-renderer.d.ts +7 -16
- package/dist/v2/types/vue-custom-message-renderer.d.ts.map +1 -1
- package/dist/v2/types/vue-tool-call-renderer.d.ts +16 -28
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -1
- package/package.json +14 -27
- package/src/__tests__/build-entries.test.ts +27 -0
- package/src/components/copilot-provider/CopilotKit.vue +4 -1
- package/src/hooks/__tests__/zod-parameters.test.ts +520 -0
- package/src/hooks/use-copilot-action.ts +2 -1
- package/src/hooks/use-frontend-tool.ts +3 -6
- package/src/hooks/zod-parameters.ts +162 -0
- package/src/v2/__tests__/exports.test.ts +4 -2
- package/src/v2/components/A2UIMessageRenderer.ts +56 -68
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +11 -23
- package/src/v2/components/LicenseWarningBanner.vue +31 -15
- package/src/v2/components/OpenGenerativeUIRenderer.ts +51 -373
- package/src/v2/components/__tests__/A2UIBasicCatalogColors.test.ts +8 -9
- package/src/v2/components/__tests__/A2UICatalogContext.test.ts +1 -1
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +63 -36
- package/src/v2/components/__tests__/LicenseWarningBanner.test.ts +20 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +55 -6
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +15 -258
- package/src/v2/components/a2ui/A2UICatalogContext.ts +10 -102
- package/src/v2/components/a2ui/A2UIRecoveryStates.ts +444 -0
- package/src/v2/components/a2ui/__tests__/A2UIRecoveryStates.test.ts +175 -0
- package/src/v2/components/a2ui.ts +1 -1
- package/src/v2/components/chat/CopilotChat.vue +26 -40
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +267 -67
- package/src/v2/components/chat/CopilotChatAssistantToolbarButton.vue +46 -0
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +150 -173
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +77 -20
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +2 -2
- package/src/v2/components/chat/CopilotChatFeedbackCommentPopover.vue +240 -0
- package/src/v2/components/chat/CopilotChatInput.vue +250 -191
- package/src/v2/components/chat/CopilotChatInspectorButton.vue +331 -0
- package/src/v2/components/chat/CopilotChatLightbox.vue +105 -0
- package/src/v2/components/chat/CopilotChatMessageView.vue +262 -87
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +52 -35
- package/src/v2/components/chat/CopilotChatSuggestionPill.vue +5 -14
- package/src/v2/components/chat/CopilotChatSuggestionView.vue +1 -4
- package/src/v2/components/chat/CopilotChatToggleButton.vue +3 -9
- package/src/v2/components/chat/CopilotChatToggleButtonCloseIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToggleButtonOpenIcon.ts +1 -1
- package/src/v2/components/chat/CopilotChatToolCallGroup.vue +353 -0
- package/src/v2/components/chat/CopilotChatToolCallItem.vue +24 -14
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +194 -21
- package/src/v2/components/chat/CopilotChatUserMessage.vue +105 -42
- package/src/v2/components/chat/CopilotChatView.vue +37 -42
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +111 -0
- package/src/v2/components/chat/CopilotModalHeader.vue +10 -8
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +7 -6
- package/src/v2/components/chat/CopilotModalHeaderTitle.ts +1 -4
- package/src/v2/components/chat/CopilotPopup.vue +3 -0
- package/src/v2/components/chat/CopilotPopupView.vue +1 -0
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +9 -19
- package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +5 -8
- package/src/v2/components/chat/CopilotSidebar.vue +5 -0
- package/src/v2/components/chat/CopilotSidebarView.vue +2 -0
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +24 -17
- package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +7 -10
- package/src/v2/components/chat/StreamingMarkdownDefault.vue +3 -5
- package/src/v2/components/chat/__tests__/CopilotChat.labels.test.ts +19 -4
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +26 -9
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.inspector.test.ts +269 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.learningFeedback.test.ts +760 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.slots.e2e.test.ts +3 -5
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.ts +2 -2
- package/src/v2/components/chat/__tests__/CopilotChatInput.addMenu.test.ts +328 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.slots.e2e.test.ts +6 -3
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +55 -14
- package/src/v2/components/chat/__tests__/CopilotChatLightbox.test.ts +160 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +247 -403
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.toolCallDisplay.test.ts +637 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionPill.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.slots.e2e.test.ts +3 -1
- package/src/v2/components/chat/__tests__/CopilotChatToolCallsView.learning.test.ts +75 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.attachments.test.ts +143 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.inputOverlay.test.ts +5 -4
- package/src/v2/components/chat/__tests__/CopilotChatView.rootWidth.test.ts +7 -33
- package/src/v2/components/chat/__tests__/CopilotModalHeader.slots.e2e.test.ts +1 -1
- package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +3 -3
- package/src/v2/components/chat/__tests__/CopilotSidebarView.position.test.ts +126 -0
- package/src/v2/components/chat/__tests__/messageFeedbackDefaults.test.ts +33 -0
- package/src/v2/components/chat/__tests__/modalChatDisplayProps.test.ts +44 -0
- package/src/v2/components/chat/copilotChatToolCallItemRender.ts +3 -19
- package/src/v2/components/chat/index.ts +2 -1
- package/src/v2/components/chat/inspector-shortcuts.ts +34 -0
- package/src/v2/components/chat/message-feedback.ts +291 -0
- package/src/v2/components/chat/tool-call-capture.ts +55 -0
- package/src/v2/components/chat/tool-call-display-context.ts +28 -0
- package/src/v2/components/chat/tool-call-group-parts.ts +251 -0
- package/src/v2/components/chat/turn-work.ts +52 -0
- package/src/v2/components/chat/types.ts +114 -4
- package/src/v2/components/chat/use-chat-labels.ts +16 -0
- package/src/v2/components/chat/use-lightbox.ts +64 -0
- package/src/v2/components/icons/__tests__/icons.test.ts +72 -68
- package/src/v2/components/icons/index.ts +109 -23
- package/src/v2/components/ui/CopilotDropdownMenuContent.vue +465 -0
- package/src/v2/components/ui/CopilotPopover.vue +138 -0
- package/src/v2/components/ui/CopilotTooltip.vue +237 -0
- package/src/v2/components/ui/__tests__/CopilotTooltip.test.ts +168 -0
- package/src/v2/components/ui/dropdown-menu.ts +15 -0
- package/src/v2/components/ui/floating.ts +321 -0
- package/src/v2/components/ui/presence.ts +54 -0
- package/src/v2/components/ui/use-id.ts +16 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +62 -1
- package/src/v2/hooks/__tests__/use-render-activity-message.test.ts +105 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +3 -6
- package/src/v2/hooks/__tests__/zod-regression.test.ts +5 -4
- package/src/v2/hooks/use-default-render-tool.ts +123 -62
- package/src/v2/hooks/use-frontend-tool.ts +10 -10
- package/src/v2/hooks/use-render-activity-message.ts +27 -48
- package/src/v2/hooks/use-render-custom-messages.ts +14 -35
- package/src/v2/hooks/use-render-tool.ts +8 -0
- package/src/v2/index.ts +3 -0
- package/src/v2/lib/__tests__/message-feedback.test.ts +152 -0
- package/src/v2/lib/message-feedback.ts +120 -0
- package/src/v2/lib/processPartialHtml.ts +6 -21
- package/src/v2/lib/vue-core.ts +3 -5
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +29 -2
- package/src/v2/providers/CopilotKitProvider.types.ts +57 -5
- package/src/v2/providers/CopilotKitProvider.vue +177 -114
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.openThread.test.ts +69 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.a2ui.test.ts +1 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.headersAtSendTime.test.ts +3 -3
- package/src/v2/providers/__tests__/CopilotKitProvider.learning.test.ts +536 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +17 -33
- package/src/v2/providers/index.ts +4 -1
- package/src/v2/providers/keys.ts +12 -0
- package/src/v2/providers/types.ts +3 -38
- package/src/v2/styles/CopilotKitStyles.ts +95 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.client.test.ts +149 -0
- package/src/v2/styles/__tests__/CopilotKitStyles.ssr.test.ts +71 -0
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +28 -33
- package/src/v2/types/defineToolCallRenderer.ts +9 -4
- package/src/v2/types/human-in-the-loop.ts +8 -32
- package/src/v2/types/interrupt.ts +7 -31
- package/src/v2/types/vue-activity-message-renderer.ts +24 -15
- package/src/v2/types/vue-custom-message-renderer.ts +12 -16
- package/src/v2/types/vue-tool-call-renderer.ts +23 -31
- package/vite.config.ts +5 -5
- package/dist/styles.css +0 -2
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts +0 -9
- package/dist/v2/components/chat/BasicMarkdown.vue.d.ts.map +0 -1
- package/dist/v2/lib/transcription-client.d.ts +0 -19
- package/dist/v2/lib/transcription-client.d.ts.map +0 -1
- package/scripts/scope-preflight.mjs +0 -100
- package/src/styles/globals.css +0 -233
- package/src/v2/components/chat/BasicMarkdown.vue +0 -158
- package/src/v2/components/chat/__tests__/BasicMarkdown.test.ts +0 -69
- package/src/v2/lib/__tests__/processPartialHtml.test.ts +0 -84
- package/src/v2/lib/__tests__/transcription-client.test.ts +0 -67
- package/src/v2/lib/transcription-client.ts +0 -151
|
@@ -8,6 +8,7 @@ describe("package exports", () => {
|
|
|
8
8
|
expect(typeof VuePackage.CopilotChat.View).toBe("object");
|
|
9
9
|
expect(typeof VuePackage.CopilotChatMessageView).toBe("object");
|
|
10
10
|
expect(typeof VuePackage.CopilotChatToolCallsView).toBe("object");
|
|
11
|
+
expect(typeof VuePackage.CopilotChatToolCallGroup).toBe("object");
|
|
11
12
|
expect(typeof VuePackage.CopilotChatInput).toBe("object");
|
|
12
13
|
expect(typeof VuePackage.CopilotChatAssistantMessage).toBe("object");
|
|
13
14
|
expect(typeof VuePackage.CopilotChatUserMessage).toBe("object");
|
|
@@ -32,11 +33,12 @@ describe("package exports", () => {
|
|
|
32
33
|
expect(VuePackage.vueBasicCatalog.components.size).toBeGreaterThan(0);
|
|
33
34
|
});
|
|
34
35
|
|
|
35
|
-
it("exports
|
|
36
|
+
it("exports CopilotKitStyles and no stylesheet, since the CSS is injected", () => {
|
|
36
37
|
const packageJson = JSON.parse(readFileSync("package.json", "utf8")) as {
|
|
37
38
|
exports?: Record<string, unknown>;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
expect(
|
|
41
|
+
expect(typeof VuePackage.CopilotKitStyles).toBe("object");
|
|
42
|
+
expect(packageJson.exports?.["./styles.css"]).toBeUndefined();
|
|
41
43
|
});
|
|
42
44
|
});
|
|
@@ -1,89 +1,77 @@
|
|
|
1
1
|
import { computed, defineComponent, h } from "vue";
|
|
2
2
|
import type { PropType } from "vue";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import type { VueActivityMessageRenderer } from "../types";
|
|
5
5
|
import type { A2UITheme } from "../types";
|
|
6
6
|
import A2UISurfaceActivityRenderer from "./A2UISurfaceActivityRenderer.vue";
|
|
7
|
+
import {
|
|
8
|
+
A2UIBuildingState,
|
|
9
|
+
A2UILifecycleFields,
|
|
10
|
+
A2UIRecoveryFailure,
|
|
11
|
+
A2UIRetryingState,
|
|
12
|
+
resolveDebugExposure,
|
|
13
|
+
} from "./a2ui/A2UIRecoveryStates";
|
|
14
|
+
import type { A2UIRecoveryRendererOptions } from "./a2ui/A2UIRecoveryStates";
|
|
7
15
|
|
|
8
16
|
const A2UI_OPERATIONS_KEY = "a2ui_operations";
|
|
9
17
|
|
|
10
18
|
export type A2UIMessageRendererOptions = {
|
|
11
19
|
theme: A2UITheme;
|
|
12
20
|
catalog?: any;
|
|
21
|
+
/** Optional custom loading component shown while the A2UI surface is building. */
|
|
13
22
|
loadingComponent?: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Pre-paint recovery/loading UX options: timing before the "Retrying…"
|
|
25
|
+
* sub-label appears, and how much retry/debug detail to surface.
|
|
26
|
+
*/
|
|
27
|
+
recovery?: A2UIRecoveryRendererOptions;
|
|
14
28
|
};
|
|
15
29
|
|
|
16
30
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `
|
|
20
|
-
*
|
|
21
|
-
*
|
|
31
|
+
* The `a2ui-surface` activity carries the WHOLE generative-UI lifecycle on one
|
|
32
|
+
* stable messageId: pre-paint `status` ("building" | "retrying" | "failed")
|
|
33
|
+
* with recovery detail, then `a2ui_operations` on paint. The states swap in
|
|
34
|
+
* place, so the painted surface replaces the skeleton. `.loose()` keeps
|
|
35
|
+
* the operations and any future fields.
|
|
22
36
|
*/
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
class:
|
|
32
|
-
"cpk:flex cpk:flex-col cpk:gap-3 cpk:rounded-xl cpk:border cpk:border-gray-100 cpk:bg-gray-50/50 cpk:p-5",
|
|
33
|
-
style: { minHeight: "120px" },
|
|
34
|
-
"data-testid": "a2ui-loading",
|
|
35
|
-
},
|
|
36
|
-
[
|
|
37
|
-
h("div", { class: "cpk:flex cpk:items-center cpk:gap-2" }, [
|
|
38
|
-
h("div", {
|
|
39
|
-
class: "cpk:h-3 cpk:w-3 cpk:rounded-full cpk:bg-gray-200",
|
|
40
|
-
style: {
|
|
41
|
-
animation: "cpk-a2ui-pulse 1.5s ease-in-out infinite",
|
|
42
|
-
},
|
|
43
|
-
"data-testid": "a2ui-loading-dot",
|
|
44
|
-
}),
|
|
45
|
-
h(
|
|
46
|
-
"span",
|
|
47
|
-
{
|
|
48
|
-
class: "cpk:text-xs cpk:font-medium cpk:text-gray-400",
|
|
49
|
-
},
|
|
50
|
-
"Generating UI...",
|
|
51
|
-
),
|
|
52
|
-
]),
|
|
53
|
-
h(
|
|
54
|
-
"div",
|
|
55
|
-
{ class: "cpk:flex cpk:flex-col cpk:gap-2" },
|
|
56
|
-
barWidths.map((width, i) =>
|
|
57
|
-
h("div", {
|
|
58
|
-
key: i,
|
|
59
|
-
class: "cpk:h-3 cpk:rounded cpk:bg-gray-200/70",
|
|
60
|
-
style: {
|
|
61
|
-
width: `${width * 100}%`,
|
|
62
|
-
animation: `cpk-a2ui-pulse 1.5s ease-in-out ${i * 0.15}s infinite`,
|
|
63
|
-
},
|
|
64
|
-
"data-testid": "a2ui-loading-bar",
|
|
65
|
-
}),
|
|
66
|
-
),
|
|
67
|
-
),
|
|
68
|
-
h(
|
|
69
|
-
"style",
|
|
70
|
-
{},
|
|
71
|
-
`@keyframes cpk-a2ui-pulse {
|
|
72
|
-
0%, 100% { opacity: 0.4; }
|
|
73
|
-
50% { opacity: 1; }
|
|
74
|
-
}`,
|
|
75
|
-
),
|
|
76
|
-
],
|
|
77
|
-
);
|
|
78
|
-
},
|
|
79
|
-
});
|
|
37
|
+
const A2UISurfaceContentSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
a2ui_operations: z.array(z.any()).optional(),
|
|
40
|
+
...A2UILifecycleFields,
|
|
41
|
+
})
|
|
42
|
+
.loose();
|
|
80
43
|
|
|
81
44
|
export function createA2UIMessageRenderer(
|
|
82
45
|
options: A2UIMessageRendererOptions,
|
|
83
46
|
): VueActivityMessageRenderer<any> {
|
|
47
|
+
const showAfterMs = options.recovery?.showAfterMs ?? 2000;
|
|
48
|
+
const showAfterAttempts = options.recovery?.showAfterAttempts ?? 2;
|
|
49
|
+
const optionDebugExposure = options.recovery?.debugExposure ?? "collapsed";
|
|
50
|
+
|
|
51
|
+
// Renders the pre-paint lifecycle state for a content snapshot.
|
|
52
|
+
const renderLifecycle = (content: any) => {
|
|
53
|
+
const debugExposure = resolveDebugExposure(content, optionDebugExposure);
|
|
54
|
+
if (content?.status === "failed") {
|
|
55
|
+
return h(A2UIRecoveryFailure, { content, debugExposure });
|
|
56
|
+
}
|
|
57
|
+
if (content?.status === "retrying") {
|
|
58
|
+
return h(A2UIRetryingState, {
|
|
59
|
+
content,
|
|
60
|
+
showAfterMs,
|
|
61
|
+
showAfterAttempts,
|
|
62
|
+
debugExposure,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// "building" / default: a host-supplied loader wins; else the skeleton.
|
|
66
|
+
if (options.loadingComponent) {
|
|
67
|
+
return h(options.loadingComponent as any);
|
|
68
|
+
}
|
|
69
|
+
return h(A2UIBuildingState, { content });
|
|
70
|
+
};
|
|
71
|
+
|
|
84
72
|
return {
|
|
85
73
|
activityType: "a2ui-surface",
|
|
86
|
-
content:
|
|
74
|
+
content: A2UISurfaceContentSchema,
|
|
87
75
|
render: defineComponent({
|
|
88
76
|
name: "A2UIMessageRendererHost",
|
|
89
77
|
props: {
|
|
@@ -104,11 +92,11 @@ export function createA2UIMessageRenderer(
|
|
|
104
92
|
);
|
|
105
93
|
|
|
106
94
|
return () => {
|
|
95
|
+
// No painted surface yet → the pre-paint lifecycle state. It shares
|
|
96
|
+
// this activity's messageId, so the painted surface below replaces
|
|
97
|
+
// it in place once operations arrive.
|
|
107
98
|
if (operations.value.length === 0) {
|
|
108
|
-
|
|
109
|
-
return h(options.loadingComponent as any);
|
|
110
|
-
}
|
|
111
|
-
return h(DefaultA2UILoading);
|
|
99
|
+
return renderLifecycle(props.content);
|
|
112
100
|
}
|
|
113
101
|
|
|
114
102
|
return h(A2UISurfaceActivityRenderer, {
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
h,
|
|
5
|
-
onBeforeUnmount,
|
|
6
|
-
shallowRef,
|
|
7
|
-
ref,
|
|
8
|
-
watch,
|
|
9
|
-
type VNode,
|
|
10
|
-
} from "vue";
|
|
2
|
+
import { computed, h, onBeforeUnmount, shallowRef, ref, watch } from "vue";
|
|
3
|
+
import type { VNode } from "vue";
|
|
11
4
|
import type { ActivityMessage } from "@ag-ui/core";
|
|
12
5
|
import type { A2UITheme } from "../types";
|
|
13
6
|
import type { A2UIOperation } from "./a2ui";
|
|
14
7
|
import { getOperationSurfaceId } from "./a2ui";
|
|
15
8
|
import { useCopilotKit } from "../providers";
|
|
16
|
-
import { MessageProcessor
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type VueComponentImplementation,
|
|
21
|
-
} from "./a2ui/index";
|
|
9
|
+
import { MessageProcessor } from "@a2ui/web_core/v0_9";
|
|
10
|
+
import type { SurfaceModel } from "@a2ui/web_core/v0_9";
|
|
11
|
+
import { vueBasicCatalog, A2uiSurface } from "./a2ui/index";
|
|
12
|
+
import type { VueComponentImplementation } from "./a2ui/index";
|
|
22
13
|
|
|
23
14
|
const DEFAULT_SURFACE_ID = "default";
|
|
24
15
|
|
|
@@ -61,7 +52,7 @@ async function handleAction(message: unknown) {
|
|
|
61
52
|
if (!props.agent) return;
|
|
62
53
|
try {
|
|
63
54
|
copilotkit.value.setProperties({
|
|
64
|
-
...
|
|
55
|
+
...copilotkit.value.properties,
|
|
65
56
|
a2uiAction: message,
|
|
66
57
|
});
|
|
67
58
|
await copilotkit.value.runAgent({ agent: props.agent as any });
|
|
@@ -160,24 +151,21 @@ const surfaceEntries = computed(() => {
|
|
|
160
151
|
:data-activity-type="activityType"
|
|
161
152
|
:data-message-id="message.id"
|
|
162
153
|
>
|
|
163
|
-
<div
|
|
164
|
-
v-if="error"
|
|
165
|
-
class="cpk:rounded-lg cpk:border cpk:border-red-200 cpk:bg-red-50 cpk:p-3 cpk:text-sm cpk:text-red-700"
|
|
166
|
-
>
|
|
154
|
+
<div v-if="error" class="cpk-a2ui-message-error">
|
|
167
155
|
A2UI render error: {{ error }}
|
|
168
156
|
</div>
|
|
169
157
|
<div
|
|
170
158
|
v-else
|
|
171
|
-
class="cpk
|
|
159
|
+
class="cpk-a2ui-message-surfaces"
|
|
172
160
|
data-testid="a2ui-activity-renderer"
|
|
173
161
|
>
|
|
174
162
|
<div
|
|
175
163
|
v-for="entry in surfaceEntries"
|
|
176
164
|
:key="entry.surfaceId"
|
|
177
|
-
class="cpk
|
|
165
|
+
class="cpk-a2ui-message-surface-host"
|
|
178
166
|
:data-surface-id="entry.surfaceId"
|
|
179
167
|
>
|
|
180
|
-
<div class="a2ui-surface cpk
|
|
168
|
+
<div class="a2ui-surface cpk-a2ui-message-surface">
|
|
181
169
|
<A2uiSurface :surface="entry.surface" />
|
|
182
170
|
</div>
|
|
183
171
|
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onBeforeUnmount, onMounted } from "vue";
|
|
3
|
+
import { ɵformatLabel } from "@copilotkit/core";
|
|
4
|
+
import { useChatLabels } from "./chat/use-chat-labels";
|
|
3
5
|
|
|
4
6
|
// Total reserved vertical space for the fixed license banner: banner height
|
|
5
7
|
// (~36px) + bottom offset (8px) + visual gap above the chat input (~8px).
|
|
@@ -36,45 +38,59 @@ interface BannerSpec {
|
|
|
36
38
|
actionUrl: string;
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
const labels = useChatLabels();
|
|
42
|
+
|
|
43
|
+
function expiringMessage(days: number | undefined) {
|
|
44
|
+
if (days === undefined) return labels.value.licenseExpiringText;
|
|
45
|
+
const template =
|
|
46
|
+
days === 1
|
|
47
|
+
? labels.value.licenseExpiringInDaysOne
|
|
48
|
+
: labels.value.licenseExpiringInDaysOther;
|
|
49
|
+
return ɵformatLabel(template, { days });
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
const spec = computed<BannerSpec | null>(() => {
|
|
53
|
+
const text = labels.value;
|
|
40
54
|
switch (props.type) {
|
|
41
55
|
case "no_license":
|
|
42
56
|
return {
|
|
43
57
|
severity: "info",
|
|
44
|
-
message:
|
|
45
|
-
actionLabel:
|
|
58
|
+
message: text.licensePoweredByText,
|
|
59
|
+
actionLabel: text.licenseGetLicenseLabel,
|
|
46
60
|
actionUrl: "https://copilotkit.ai/pricing",
|
|
47
61
|
};
|
|
48
62
|
case "feature_unlicensed":
|
|
49
63
|
return {
|
|
50
64
|
severity: "warning",
|
|
51
|
-
message:
|
|
52
|
-
|
|
65
|
+
message: ɵformatLabel(text.licenseFeatureUnlicensedText, {
|
|
66
|
+
feature: props.featureName ?? "",
|
|
67
|
+
}),
|
|
68
|
+
actionLabel: text.licenseGetLicenseLabel,
|
|
53
69
|
actionUrl: "https://copilotkit.ai/pricing",
|
|
54
70
|
};
|
|
55
|
-
case "expiring":
|
|
56
|
-
const days = props.graceRemaining;
|
|
57
|
-
const dayLabel = days === 1 ? "day" : "days";
|
|
71
|
+
case "expiring":
|
|
58
72
|
return {
|
|
59
73
|
severity: "warning",
|
|
60
|
-
message:
|
|
61
|
-
actionLabel:
|
|
74
|
+
message: expiringMessage(props.graceRemaining),
|
|
75
|
+
actionLabel: text.licenseRenewLabel,
|
|
62
76
|
actionUrl: "https://dashboard.operations.copilotkit.ai",
|
|
63
77
|
};
|
|
64
|
-
}
|
|
65
78
|
case "expired":
|
|
66
79
|
return {
|
|
67
80
|
severity: "critical",
|
|
68
|
-
message:
|
|
69
|
-
|
|
81
|
+
message: props.expiryDate
|
|
82
|
+
? ɵformatLabel(text.licenseExpiredOnDateText, {
|
|
83
|
+
date: props.expiryDate,
|
|
84
|
+
})
|
|
85
|
+
: text.licenseExpiredText,
|
|
86
|
+
actionLabel: text.licenseRenewNowLabel,
|
|
70
87
|
actionUrl: "https://copilotkit.ai/pricing",
|
|
71
88
|
};
|
|
72
89
|
case "invalid":
|
|
73
90
|
return {
|
|
74
91
|
severity: "critical",
|
|
75
|
-
message:
|
|
76
|
-
|
|
77
|
-
actionLabel: "Get a license",
|
|
92
|
+
message: text.licenseInvalidText,
|
|
93
|
+
actionLabel: text.licenseGetLicenseLabel,
|
|
78
94
|
actionUrl: "https://copilotkit.ai/pricing",
|
|
79
95
|
};
|
|
80
96
|
default:
|