@copilotkit/vue 2.0.0-rc.3 → 2.0.0-rc.30
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/CONTRIBUTOR_GUIDE.md +1 -1
- package/PARITY.md +3 -3
- 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 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +365 -16920
- package/dist/index.mjs.map +1 -1
- package/dist/use-render-activity-message-BZJ33B_r.cjs +113 -0
- package/dist/use-render-activity-message-BZJ33B_r.cjs.map +1 -0
- package/dist/use-render-activity-message-DrR407LQ.js +15901 -0
- package/dist/use-render-activity-message-DrR407LQ.js.map +1 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts +14 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -1
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts +10 -3
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -1
- package/dist/v2/components/CopilotKitInspector.vue.d.ts +5 -1
- package/dist/v2/components/CopilotKitInspector.vue.d.ts.map +1 -1
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts.map +1 -1
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts +2 -2
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -1
- package/dist/v2/components/MCPAppsActivityRenderer.d.ts.map +1 -1
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +13 -59
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +3 -11
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +10 -15
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -1
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts +14 -130
- package/dist/v2/components/a2ui/A2UIRecoveryStates.d.ts.map +1 -1
- package/dist/v2/components/a2ui/catalog.d.ts.map +1 -1
- package/dist/v2/components/a2ui/utils.d.ts +3 -15
- package/dist/v2/components/a2ui/utils.d.ts.map +1 -1
- package/dist/v2/components/a2ui.d.ts +9 -8
- package/dist/v2/components/a2ui.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +2 -2
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
- 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 +4 -8
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatFeedbackCommentPopover.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +7 -286
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatInspectorButton.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatLightbox.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +1 -1
- 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/CopilotChatToolCallGroup.vue.d.ts +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallGroup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallItem.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +1 -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 +3 -3
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotChatWorkSummary.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +8 -3
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +5 -3
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +8 -3
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +6 -4
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +6 -4
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/CopilotThreadsDrawer.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/StreamingMarkdownDefault.vue.d.ts +1 -0
- package/dist/v2/components/chat/StreamingMarkdownDefault.vue.d.ts.map +1 -1
- package/dist/v2/components/chat/audioRecorder.d.ts +3 -4
- package/dist/v2/components/chat/audioRecorder.d.ts.map +1 -1
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts +4 -4
- package/dist/v2/components/chat/copilotChatToolCallItemRender.d.ts.map +1 -1
- package/dist/v2/components/chat/forwarded-slots.d.ts +12 -0
- package/dist/v2/components/chat/forwarded-slots.d.ts.map +1 -0
- package/dist/v2/components/chat/index.d.ts +34 -31
- package/dist/v2/components/chat/index.d.ts.map +1 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts +2 -1
- package/dist/v2/components/chat/inspector-shortcuts.d.ts.map +1 -1
- package/dist/v2/components/chat/message-feedback.d.ts +38 -49
- package/dist/v2/components/chat/message-feedback.d.ts.map +1 -1
- package/dist/v2/components/chat/tool-call-display-context.d.ts +4 -19
- package/dist/v2/components/chat/tool-call-display-context.d.ts.map +1 -1
- package/dist/v2/components/chat/tool-call-group-parts.d.ts +7 -20
- package/dist/v2/components/chat/tool-call-group-parts.d.ts.map +1 -1
- package/dist/v2/components/chat/turn-work.d.ts +0 -2
- package/dist/v2/components/chat/turn-work.d.ts.map +1 -1
- package/dist/v2/components/chat/types.d.ts +9 -4
- 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-copy-feedback.d.ts +11 -0
- package/dist/v2/components/chat/use-copy-feedback.d.ts.map +1 -0
- package/dist/v2/components/chat/use-lightbox.d.ts.map +1 -1
- 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 +1 -1
- package/dist/v2/components/ui/CopilotDropdownMenuContent.vue.d.ts.map +1 -1
- package/dist/v2/hooks/use-agent-context.d.ts +2 -3
- package/dist/v2/hooks/use-agent-context.d.ts.map +1 -1
- package/dist/v2/hooks/use-agent.d.ts +4 -1
- package/dist/v2/hooks/use-agent.d.ts.map +1 -1
- package/dist/v2/hooks/use-attachments.d.ts +7 -0
- package/dist/v2/hooks/use-attachments.d.ts.map +1 -1
- package/dist/v2/hooks/use-capabilities.d.ts.map +1 -1
- package/dist/v2/hooks/use-component.d.ts +1 -0
- package/dist/v2/hooks/use-component.d.ts.map +1 -1
- package/dist/v2/hooks/use-configure-suggestions.d.ts +4 -9
- package/dist/v2/hooks/use-configure-suggestions.d.ts.map +1 -1
- package/dist/v2/hooks/use-default-render-tool.d.ts +2 -7
- 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-human-in-the-loop.d.ts +2 -1
- package/dist/v2/hooks/use-human-in-the-loop.d.ts.map +1 -1
- package/dist/v2/hooks/use-interrupt.d.ts +0 -1
- package/dist/v2/hooks/use-interrupt.d.ts.map +1 -1
- package/dist/v2/hooks/use-keyboard-height.d.ts +1 -1
- package/dist/v2/hooks/use-keyboard-height.d.ts.map +1 -1
- package/dist/v2/hooks/use-pin-to-send.d.ts +4 -12
- package/dist/v2/hooks/use-pin-to-send.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 +1 -1
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -1
- package/dist/v2/hooks/use-suggestions.d.ts.map +1 -1
- package/dist/v2/hooks/use-threads.d.ts +6 -23
- package/dist/v2/hooks/use-threads.d.ts.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +197 -200
- package/dist/v2/index.mjs.map +1 -1
- package/dist/v2/lib/processPartialHtml.d.ts +1 -2
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -1
- package/dist/v2/lib/shallow-stable.d.ts.map +1 -1
- package/dist/v2/lib/vue-core.d.ts +33 -19
- 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 +9 -129
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -1
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +9 -10
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
- package/dist/v2/providers/chat-configuration-store-key.d.ts +8 -0
- package/dist/v2/providers/chat-configuration-store-key.d.ts.map +1 -0
- package/dist/v2/providers/markdown-renderer.d.ts +4 -2
- package/dist/v2/providers/markdown-renderer.d.ts.map +1 -1
- package/dist/v2/providers/types.d.ts +3 -46
- package/dist/v2/providers/types.d.ts.map +1 -1
- package/dist/v2/providers/use-inspector-thread-override.d.ts +5 -0
- package/dist/v2/providers/use-inspector-thread-override.d.ts.map +1 -1
- package/dist/v2/types/defineToolCallRenderer.d.ts +1 -1
- 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 -35
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -1
- package/package.json +12 -13
- package/src/__tests__/build-entries.test.ts +29 -0
- 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 +10 -0
- package/src/v2/__tests__/mocks/web-inspector.ts +6 -0
- package/src/v2/__tests__/utils/test-helpers.ts +34 -4
- package/src/v2/components/A2UIMessageRenderer.ts +98 -68
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +68 -103
- package/src/v2/components/CopilotKitInspector.vue +104 -51
- package/src/v2/components/InlineFeatureWarning.vue +20 -21
- package/src/v2/components/LicenseWarningBanner.vue +27 -135
- package/src/v2/components/MCPAppsActivityRenderer.ts +75 -201
- package/src/v2/components/OpenGenerativeUIRenderer.ts +122 -446
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +171 -8
- package/src/v2/components/__tests__/CopilotKitInspector.test.ts +42 -0
- package/src/v2/components/__tests__/LicenseWarningBanner.test.ts +60 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +64 -8
- package/src/v2/components/__tests__/OpenGenerativeUIToolRenderer.test.ts +38 -0
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +6 -26
- package/src/v2/components/a2ui/A2UICatalogContext.ts +27 -185
- package/src/v2/components/a2ui/A2UIRecoveryStates.ts +127 -327
- package/src/v2/components/a2ui/catalog.ts +3 -3
- package/src/v2/components/a2ui/utils.ts +13 -65
- package/src/v2/components/a2ui.ts +15 -22
- package/src/v2/components/chat/CopilotChat.vue +121 -498
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +47 -184
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +36 -55
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +14 -6
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +19 -246
- package/src/v2/components/chat/CopilotChatFeedbackCommentPopover.vue +12 -77
- package/src/v2/components/chat/CopilotChatInput.vue +139 -654
- package/src/v2/components/chat/CopilotChatInspectorButton.vue +45 -108
- package/src/v2/components/chat/CopilotChatLightbox.vue +10 -31
- package/src/v2/components/chat/CopilotChatMessageView.vue +96 -274
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +27 -62
- package/src/v2/components/chat/CopilotChatToolCallGroup.vue +63 -71
- package/src/v2/components/chat/CopilotChatToolCallItem.vue +8 -6
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +31 -32
- package/src/v2/components/chat/CopilotChatUserMessage.vue +24 -112
- package/src/v2/components/chat/CopilotChatView.vue +123 -161
- package/src/v2/components/chat/CopilotChatWorkSummary.vue +26 -36
- package/src/v2/components/chat/CopilotModalHeader.vue +11 -23
- package/src/v2/components/chat/CopilotPopup.vue +23 -25
- package/src/v2/components/chat/CopilotPopupView.vue +10 -39
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +49 -185
- package/src/v2/components/chat/CopilotSidebar.vue +23 -25
- package/src/v2/components/chat/CopilotSidebarView.vue +10 -39
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +56 -100
- package/src/v2/components/chat/CopilotThreadsDrawer.vue +43 -105
- package/src/v2/components/chat/StreamingMarkdownDefault.vue +15 -28
- package/src/v2/components/chat/__tests__/CopilotChat.labels.test.ts +19 -4
- package/src/v2/components/chat/__tests__/CopilotChat.test.ts +12 -10
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +26 -9
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.learningFeedback.test.ts +5 -5
- package/src/v2/components/chat/__tests__/CopilotChatAttachmentQueue.test.ts +28 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +132 -1
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +247 -403
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.toolCallDisplay.test.ts +1 -99
- package/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.ts +43 -1
- package/src/v2/components/chat/__tests__/CopilotPopup.test.ts +90 -1
- package/src/v2/components/chat/__tests__/CopilotPopupView.test.ts +19 -0
- package/src/v2/components/chat/__tests__/CopilotSidebar.test.ts +90 -1
- package/src/v2/components/chat/__tests__/CopilotSidebarView.position.test.ts +32 -8
- package/src/v2/components/chat/__tests__/CopilotSidebarView.test.ts +2 -1
- package/src/v2/components/chat/__tests__/StreamingMarkdownDefault.test.ts +54 -0
- package/src/v2/components/chat/audioRecorder.ts +4 -7
- package/src/v2/components/chat/copilotChatToolCallItemRender.ts +25 -90
- package/src/v2/components/chat/forwarded-slots.ts +17 -0
- package/src/v2/components/chat/index.ts +0 -1
- package/src/v2/components/chat/inspector-shortcuts.ts +10 -16
- package/src/v2/components/chat/message-feedback.ts +92 -195
- package/src/v2/components/chat/tool-call-display-context.ts +6 -22
- package/src/v2/components/chat/tool-call-group-parts.ts +47 -108
- package/src/v2/components/chat/turn-work.ts +0 -9
- package/src/v2/components/chat/types.ts +12 -4
- package/src/v2/components/chat/use-chat-labels.ts +16 -0
- package/src/v2/components/chat/use-copy-feedback.ts +21 -0
- package/src/v2/components/chat/use-lightbox.ts +15 -33
- package/src/v2/components/icons/__tests__/icons.test.ts +72 -68
- package/src/v2/components/icons/index.ts +109 -27
- package/src/v2/hooks/__tests__/use-agent-error-state.test.ts +5 -3
- package/src/v2/hooks/__tests__/use-agent-stability.test.ts +25 -4
- package/src/v2/hooks/__tests__/use-agent-throttle.test.ts +5 -1
- package/src/v2/hooks/__tests__/use-agent.test.ts +6 -3
- package/src/v2/hooks/__tests__/use-component.test.ts +21 -0
- package/src/v2/hooks/__tests__/use-configure-suggestions.test.ts +30 -1
- package/src/v2/hooks/__tests__/use-default-render-tool.test.ts +10 -10
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +66 -1
- package/src/v2/hooks/__tests__/use-human-in-the-loop.e2e.test.ts +6 -1
- package/src/v2/hooks/__tests__/use-human-in-the-loop.test.ts +187 -12
- package/src/v2/hooks/__tests__/use-interrupt.test.ts +97 -0
- package/src/v2/hooks/__tests__/use-render-activity-message.test.ts +106 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +3 -6
- package/src/v2/hooks/__tests__/use-threads.test.ts +48 -6
- package/src/v2/hooks/__tests__/zod-regression.test.ts +5 -4
- package/src/v2/hooks/use-agent-context.ts +4 -10
- package/src/v2/hooks/use-agent.ts +86 -290
- package/src/v2/hooks/use-attachments.ts +48 -168
- package/src/v2/hooks/use-capabilities.ts +2 -7
- package/src/v2/hooks/use-component.ts +7 -4
- package/src/v2/hooks/use-configure-suggestions.ts +29 -220
- package/src/v2/hooks/use-default-render-tool.ts +31 -152
- package/src/v2/hooks/use-frontend-tool.ts +15 -25
- package/src/v2/hooks/use-human-in-the-loop.ts +11 -80
- package/src/v2/hooks/use-interrupt.ts +29 -308
- package/src/v2/hooks/use-keyboard-height.ts +17 -40
- package/src/v2/hooks/use-pin-to-send.ts +15 -99
- package/src/v2/hooks/use-render-activity-message.ts +35 -57
- package/src/v2/hooks/use-render-custom-messages.ts +24 -88
- package/src/v2/hooks/use-render-tool.ts +2 -4
- package/src/v2/hooks/use-suggestions.ts +17 -36
- package/src/v2/hooks/use-threads.ts +49 -288
- package/src/v2/lib/__tests__/shallow-stable.test.ts +54 -0
- package/src/v2/lib/__tests__/vue-core-renderers.test.ts +42 -0
- package/src/v2/lib/processPartialHtml.ts +6 -21
- package/src/v2/lib/shallow-stable.ts +2 -16
- package/src/v2/lib/vue-core.ts +90 -85
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +48 -186
- package/src/v2/providers/CopilotKitProvider.types.ts +12 -132
- package/src/v2/providers/CopilotKitProvider.vue +291 -641
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.test.ts +22 -2
- package/src/v2/providers/__tests__/CopilotKitProvider.a2ui.test.ts +38 -2
- package/src/v2/providers/__tests__/CopilotKitProvider.config.test.ts +124 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.headersAtSendTime.test.ts +3 -3
- package/src/v2/providers/__tests__/CopilotKitProvider.learning.test.ts +3 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.sandboxFunctions.test.ts +4 -1
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +88 -28
- package/src/v2/providers/chat-configuration-store-key.ts +9 -0
- package/src/v2/providers/markdown-renderer.ts +8 -2
- package/src/v2/providers/types.ts +3 -49
- package/src/v2/providers/use-inspector-thread-override.ts +22 -80
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +28 -33
- package/src/v2/types/defineToolCallRenderer.ts +7 -6
- 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 -38
- package/tsconfig.json +0 -1
- package/vite.config.ts +8 -5
- package/vitest.config.ts +12 -7
- 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/components/chat/normalize-auto-scroll.d.ts +0 -3
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts.map +0 -1
- package/dist/v2/components/chat/tool-call-layout.d.ts +0 -115
- package/dist/v2/components/chat/tool-call-layout.d.ts.map +0 -1
- package/dist/v2/lib/is-mobile-viewport.d.ts +0 -15
- package/dist/v2/lib/is-mobile-viewport.d.ts.map +0 -1
- package/dist/v2/lib/message-feedback.d.ts +0 -33
- package/dist/v2/lib/message-feedback.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/src/v2/components/__tests__/A2UICatalogContext.test.ts +0 -63
- package/src/v2/components/a2ui/__tests__/A2UIRecoveryStates.test.ts +0 -175
- package/src/v2/components/chat/BasicMarkdown.vue +0 -160
- package/src/v2/components/chat/__tests__/BasicMarkdown.test.ts +0 -69
- package/src/v2/components/chat/__tests__/normalize-auto-scroll.test.ts +0 -39
- package/src/v2/components/chat/normalize-auto-scroll.ts +0 -17
- package/src/v2/components/chat/tool-call-layout.ts +0 -304
- package/src/v2/lib/__tests__/is-mobile-viewport.test.ts +0 -48
- package/src/v2/lib/__tests__/message-feedback.test.ts +0 -152
- 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/is-mobile-viewport.ts +0 -23
- package/src/v2/lib/message-feedback.ts +0 -120
- package/src/v2/lib/transcription-client.ts +0 -151
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { computed, onBeforeUnmount,
|
|
1
|
+
import { computed, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
2
2
|
import type { Ref } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
emitInspectorActiveThread,
|
|
5
|
-
emitInspectorViewThreadResult,
|
|
6
|
-
isInspectorThreadBridgeEnabled,
|
|
7
|
-
onInspectorStopViewing,
|
|
8
|
-
onInspectorViewThread,
|
|
9
|
-
} from "@copilotkit/core";
|
|
10
|
-
|
|
11
|
-
type InspectorOverride = {
|
|
12
|
-
requestId: string;
|
|
13
|
-
threadId: string;
|
|
14
|
-
agentId: string;
|
|
15
|
-
previousThreadId: string;
|
|
16
|
-
};
|
|
3
|
+
import { ɵInspectorThreadOverride } from "@copilotkit/core";
|
|
17
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Apply the Inspector's "view this thread" requests to a chat. Core's
|
|
7
|
+
* `ɵInspectorThreadOverride` owns the state machine; this composable binds it
|
|
8
|
+
* to the component's lifetime and Vue reactivity.
|
|
9
|
+
*/
|
|
18
10
|
export function useInspectorThreadOverride(args: {
|
|
19
11
|
agentId: Ref<string>;
|
|
20
12
|
baseThreadId: Ref<string>;
|
|
@@ -23,77 +15,27 @@ export function useInspectorThreadOverride(args: {
|
|
|
23
15
|
inspectorRequestId: Ref<string | null>;
|
|
24
16
|
failInspectorOverride: (requestId: string) => void;
|
|
25
17
|
} {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
) => {
|
|
32
|
-
override.value =
|
|
33
|
-
|
|
34
|
-
requestId: current.requestId,
|
|
35
|
-
threadId: nextThreadId,
|
|
36
|
-
agentId: current.agentId,
|
|
37
|
-
source: "app",
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const failInspectorOverride = (requestId: string) => {
|
|
42
|
-
const current = override.value;
|
|
43
|
-
if (!current || current.requestId !== requestId) return;
|
|
44
|
-
emitInspectorViewThreadResult({
|
|
45
|
-
requestId,
|
|
46
|
-
threadId: current.threadId,
|
|
47
|
-
agentId: current.agentId,
|
|
48
|
-
ok: false,
|
|
49
|
-
reason: "connect-failed",
|
|
50
|
-
});
|
|
51
|
-
restoreOverride(current, current.previousThreadId);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
if (isInspectorThreadBridgeEnabled()) {
|
|
55
|
-
const offView = onInspectorViewThread((payload) => {
|
|
56
|
-
if (payload.agentId !== args.agentId.value) return false;
|
|
57
|
-
override.value = override.value
|
|
58
|
-
? { ...override.value, ...payload }
|
|
59
|
-
: {
|
|
60
|
-
...payload,
|
|
61
|
-
previousThreadId: args.baseThreadId.value,
|
|
62
|
-
};
|
|
63
|
-
emitInspectorViewThreadResult({ ...payload, ok: true });
|
|
64
|
-
emitInspectorActiveThread({ ...payload, source: "override" });
|
|
65
|
-
return true;
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const offStop = onInspectorStopViewing((payload) => {
|
|
69
|
-
const current = override.value;
|
|
70
|
-
if (!current) return;
|
|
71
|
-
if (payload.requestId !== current.requestId) return;
|
|
72
|
-
if (payload.agentId !== current.agentId) return;
|
|
73
|
-
restoreOverride(current, current.previousThreadId);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
onBeforeUnmount(() => {
|
|
77
|
-
offView();
|
|
78
|
-
offStop();
|
|
79
|
-
});
|
|
80
|
-
}
|
|
18
|
+
const controller = new ɵInspectorThreadOverride({
|
|
19
|
+
agentId: args.agentId.value,
|
|
20
|
+
baseThreadId: args.baseThreadId.value,
|
|
21
|
+
});
|
|
22
|
+
const override = shallowRef(controller.getSnapshot());
|
|
23
|
+
const unsubscribe = controller.subscribe(() => {
|
|
24
|
+
override.value = controller.getSnapshot();
|
|
25
|
+
});
|
|
81
26
|
|
|
82
27
|
watch([args.agentId, args.baseThreadId], ([agentId, baseThreadId]) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (baseThreadId === current.previousThreadId) return;
|
|
90
|
-
if (baseThreadId === current.threadId) return;
|
|
91
|
-
restoreOverride(current, baseThreadId);
|
|
28
|
+
controller.update({ agentId, baseThreadId });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
onBeforeUnmount(() => {
|
|
32
|
+
unsubscribe();
|
|
33
|
+
controller.dispose();
|
|
92
34
|
});
|
|
93
35
|
|
|
94
36
|
return {
|
|
95
37
|
inspectorThreadId: computed(() => override.value?.threadId ?? null),
|
|
96
38
|
inspectorRequestId: computed(() => override.value?.requestId ?? null),
|
|
97
|
-
failInspectorOverride,
|
|
39
|
+
failInspectorOverride: controller.fail,
|
|
98
40
|
};
|
|
99
41
|
}
|
|
@@ -2,11 +2,30 @@ import { describe, it, expect } from "vitest";
|
|
|
2
2
|
import { defineComponent, h } from "vue";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ToolCallStatus } from "@copilotkit/core";
|
|
5
|
+
import type { VNode } from "vue";
|
|
5
6
|
import { defineToolCallRenderer } from "../defineToolCallRenderer";
|
|
6
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
VueToolCallRenderer,
|
|
9
|
+
VueToolCallRendererRenderProps,
|
|
10
|
+
} from "../vue-tool-call-renderer";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calls a renderer built from a render function. `render` is typed as a
|
|
14
|
+
* function or a component, and TypeScript cannot tell which one this test
|
|
15
|
+
* passed, so the narrowing cast lives here once.
|
|
16
|
+
*/
|
|
17
|
+
function callRender<T>(
|
|
18
|
+
renderer: VueToolCallRenderer<T>,
|
|
19
|
+
props: VueToolCallRendererRenderProps<T>,
|
|
20
|
+
) {
|
|
21
|
+
const render = renderer.render as (
|
|
22
|
+
props: VueToolCallRendererRenderProps<T>,
|
|
23
|
+
) => VNode;
|
|
24
|
+
return render(props);
|
|
25
|
+
}
|
|
7
26
|
|
|
8
27
|
describe("defineToolCallRenderer", () => {
|
|
9
|
-
it("defaults wildcard args to
|
|
28
|
+
it("defaults wildcard args to a schema that accepts any value and preserves runtime tool name", () => {
|
|
10
29
|
const wildcardRenderer = defineToolCallRenderer({
|
|
11
30
|
name: "*",
|
|
12
31
|
render: ({ name, args, status }) =>
|
|
@@ -18,19 +37,11 @@ describe("defineToolCallRenderer", () => {
|
|
|
18
37
|
});
|
|
19
38
|
|
|
20
39
|
expect(wildcardRenderer.name).toBe("*");
|
|
21
|
-
expect(
|
|
22
|
-
true,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const rendered = (
|
|
26
|
-
wildcardRenderer.render as (props: {
|
|
27
|
-
name: string;
|
|
28
|
-
toolCallId: string;
|
|
29
|
-
args: Record<string, unknown>;
|
|
30
|
-
status: ToolCallStatus;
|
|
31
|
-
result: string | undefined;
|
|
32
|
-
}) => ReturnType<typeof h>
|
|
33
|
-
)({
|
|
40
|
+
expect(
|
|
41
|
+
wildcardRenderer.args["~standard"].validate({ anything: true }),
|
|
42
|
+
).toEqual({ value: { anything: true } });
|
|
43
|
+
|
|
44
|
+
const rendered = callRender(wildcardRenderer, {
|
|
34
45
|
name: "customTool",
|
|
35
46
|
toolCallId: "tc-wildcard-1",
|
|
36
47
|
args: { x: 1 },
|
|
@@ -53,15 +64,7 @@ describe("defineToolCallRenderer", () => {
|
|
|
53
64
|
),
|
|
54
65
|
});
|
|
55
66
|
|
|
56
|
-
const rendered = (
|
|
57
|
-
wildcardRenderer.render as (props: {
|
|
58
|
-
name: string;
|
|
59
|
-
toolCallId: string;
|
|
60
|
-
args: Record<string, unknown>;
|
|
61
|
-
status: ToolCallStatus;
|
|
62
|
-
result: string | undefined;
|
|
63
|
-
}) => ReturnType<typeof h>
|
|
64
|
-
)({
|
|
67
|
+
const rendered = callRender(wildcardRenderer, {
|
|
65
68
|
name: "customTool",
|
|
66
69
|
toolCallId: "tc-123",
|
|
67
70
|
args: {},
|
|
@@ -136,15 +139,7 @@ describe("defineToolCallRenderer", () => {
|
|
|
136
139
|
},
|
|
137
140
|
});
|
|
138
141
|
|
|
139
|
-
const rendered = (
|
|
140
|
-
typedRenderer.render as (props: {
|
|
141
|
-
name: string;
|
|
142
|
-
toolCallId: string;
|
|
143
|
-
args: { location: string; units?: "celsius" | "fahrenheit" };
|
|
144
|
-
status: ToolCallStatus;
|
|
145
|
-
result: string | undefined;
|
|
146
|
-
}) => ReturnType<typeof h>
|
|
147
|
-
)({
|
|
142
|
+
const rendered = callRender(typedRenderer, {
|
|
148
143
|
name: "get_weather",
|
|
149
144
|
toolCallId: "tc-weather-1",
|
|
150
145
|
args: { location: "Paris", units: "celsius" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ɵanySchema } from "@copilotkit/shared";
|
|
2
2
|
import type { StandardSchemaV1, InferSchemaOutput } from "@copilotkit/shared";
|
|
3
3
|
import type { VueToolCallRenderer } from "./vue-tool-call-renderer";
|
|
4
4
|
import type { VueToolCallRendererRenderFn } from "./vue-tool-call-renderer";
|
|
@@ -8,7 +8,7 @@ export function defineToolCallRenderer(def: {
|
|
|
8
8
|
render: VueToolCallRendererRenderFn<unknown>;
|
|
9
9
|
agentId?: string;
|
|
10
10
|
group?: boolean;
|
|
11
|
-
}): VueToolCallRenderer
|
|
11
|
+
}): VueToolCallRenderer;
|
|
12
12
|
|
|
13
13
|
export function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
14
14
|
name: string;
|
|
@@ -24,12 +24,13 @@ export function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
|
24
24
|
render: VueToolCallRendererRenderFn<unknown>;
|
|
25
25
|
agentId?: string;
|
|
26
26
|
group?: boolean;
|
|
27
|
-
}): VueToolCallRenderer
|
|
28
|
-
|
|
27
|
+
}): VueToolCallRenderer {
|
|
28
|
+
// Only a "*" renderer may leave out `args`; it accepts any arguments.
|
|
29
|
+
const args = def.args ?? ɵanySchema;
|
|
29
30
|
return {
|
|
30
31
|
name: def.name,
|
|
31
|
-
args
|
|
32
|
-
render: def.render
|
|
32
|
+
args,
|
|
33
|
+
render: def.render,
|
|
33
34
|
...(def.agentId ? { agentId: def.agentId } : {}),
|
|
34
35
|
...(def.group ? { group: true } : {}),
|
|
35
36
|
};
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import type { FrontendTool,
|
|
1
|
+
import type { FrontendTool, HumanInTheLoopRenderProps } from "@copilotkit/core";
|
|
2
2
|
import type { Component, VNodeChild } from "vue";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
status: ToolCallStatus.InProgress;
|
|
12
|
-
result: undefined;
|
|
13
|
-
respond: undefined;
|
|
14
|
-
}
|
|
15
|
-
| {
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
toolCallId: string;
|
|
19
|
-
agentId?: string;
|
|
20
|
-
args: T;
|
|
21
|
-
status: ToolCallStatus.Executing;
|
|
22
|
-
result: undefined;
|
|
23
|
-
respond: (result: unknown) => Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
| {
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
toolCallId: string;
|
|
29
|
-
agentId?: string;
|
|
30
|
-
args: T;
|
|
31
|
-
status: ToolCallStatus.Complete;
|
|
32
|
-
result: string;
|
|
33
|
-
respond: undefined;
|
|
34
|
-
};
|
|
4
|
+
/**
|
|
5
|
+
* Props a Vue human-in-the-loop renderer receives. Same as core's
|
|
6
|
+
* `HumanInTheLoopRenderProps`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The shape of the tool arguments.
|
|
9
|
+
*/
|
|
10
|
+
export type VueHumanInTheLoopRenderProps<T> = HumanInTheLoopRenderProps<T>;
|
|
35
11
|
|
|
36
12
|
export type VueHumanInTheLoopRenderFn<T> =
|
|
37
13
|
| ((props: VueHumanInTheLoopRenderProps<T>) => VNodeChild)
|
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type InterruptResolveFn = (
|
|
9
|
-
payload?: unknown,
|
|
10
|
-
interruptId?: string,
|
|
11
|
-
) => Promise<RunAgentResult | void>;
|
|
12
|
-
export type InterruptCancelFn = (
|
|
13
|
-
interruptId?: string,
|
|
14
|
-
) => Promise<RunAgentResult | void>;
|
|
15
|
-
|
|
16
|
-
export interface InterruptHandlerProps<TValue = unknown> {
|
|
17
|
-
event: InterruptEvent<TValue>;
|
|
18
|
-
interrupt: Interrupt | null;
|
|
19
|
-
interrupts: Interrupt[];
|
|
20
|
-
resolve: InterruptResolveFn;
|
|
21
|
-
cancel: InterruptCancelFn;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
|
|
25
|
-
event: InterruptEvent<TValue>;
|
|
26
|
-
interrupt: Interrupt | null;
|
|
27
|
-
interrupts: Interrupt[];
|
|
28
|
-
result: TResult;
|
|
29
|
-
resolve: InterruptResolveFn;
|
|
30
|
-
cancel: InterruptCancelFn;
|
|
31
|
-
}
|
|
1
|
+
export type {
|
|
2
|
+
InterruptEvent,
|
|
3
|
+
InterruptResolveFn,
|
|
4
|
+
InterruptCancelFn,
|
|
5
|
+
InterruptHandlerProps,
|
|
6
|
+
InterruptRenderProps,
|
|
7
|
+
} from "@copilotkit/core";
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ActivityMessageRenderProps,
|
|
3
|
+
ActivityMessageRendererDef,
|
|
4
|
+
} from "@copilotkit/core";
|
|
4
5
|
import type { Component, VNodeChild } from "vue";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Props a Vue activity message renderer receives. Same as core's
|
|
9
|
+
* `ActivityMessageRenderProps`.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam TActivityContent - The shape of the activity content.
|
|
12
|
+
*/
|
|
13
|
+
export type VueActivityMessageRendererProps<TActivityContent> =
|
|
14
|
+
ActivityMessageRenderProps<TActivityContent>;
|
|
12
15
|
|
|
13
16
|
export type VueActivityMessageRendererRenderFn<TActivityContent> =
|
|
14
17
|
| ((props: VueActivityMessageRendererProps<TActivityContent>) => VNodeChild)
|
|
15
18
|
| Component<VueActivityMessageRendererProps<TActivityContent>>;
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A Vue activity message renderer registration. `content` takes any
|
|
22
|
+
* Standard Schema (zod, valibot, arktype, and so on). The chat validates the
|
|
23
|
+
* activity content with it and passes the result to `render`.
|
|
24
|
+
*
|
|
25
|
+
* @typeParam TActivityContent - The shape of the activity content.
|
|
26
|
+
*/
|
|
27
|
+
export type VueActivityMessageRenderer<TActivityContent> =
|
|
28
|
+
ActivityMessageRendererDef<
|
|
29
|
+
TActivityContent,
|
|
30
|
+
VueActivityMessageRendererRenderFn<TActivityContent>
|
|
31
|
+
>;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CustomMessageRendererDef,
|
|
3
|
+
CustomMessageRendererPosition,
|
|
4
|
+
CustomMessageRenderProps,
|
|
5
|
+
} from "@copilotkit/core";
|
|
2
6
|
import type { Component, VNodeChild } from "vue";
|
|
3
7
|
|
|
4
|
-
|
|
8
|
+
/** Where a custom message renderer draws. Same as core's type. */
|
|
9
|
+
export type VueCustomMessageRendererPosition = CustomMessageRendererPosition;
|
|
5
10
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
position: VueCustomMessageRendererPosition;
|
|
9
|
-
runId: string;
|
|
10
|
-
messageIndex: number;
|
|
11
|
-
messageIndexInRun: number;
|
|
12
|
-
numberOfMessagesInRun: number;
|
|
13
|
-
agentId: string;
|
|
14
|
-
stateSnapshot: unknown;
|
|
15
|
-
}
|
|
11
|
+
/** Props a Vue custom message renderer receives. Same as core's type. */
|
|
12
|
+
export type VueCustomMessageRendererProps = CustomMessageRenderProps;
|
|
16
13
|
|
|
17
14
|
export type VueCustomMessageRendererRenderFn =
|
|
18
15
|
| ((props: VueCustomMessageRendererProps) => VNodeChild)
|
|
19
16
|
| Component<VueCustomMessageRendererProps>;
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
/** A Vue custom message renderer registration. */
|
|
19
|
+
export type VueCustomMessageRenderer =
|
|
20
|
+
CustomMessageRendererDef<VueCustomMessageRendererRenderFn>;
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ToolCallRenderProps,
|
|
3
|
+
ToolCallRendererDef,
|
|
4
|
+
} from "@copilotkit/core";
|
|
3
5
|
import type { Component, VNodeChild } from "vue";
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
|
-
* Props passed to a Vue tool call render function.
|
|
8
|
+
* Props passed to a Vue tool call render function. Same as core's
|
|
9
|
+
* `ToolCallRenderProps`.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam T - The shape of the tool arguments.
|
|
7
12
|
*/
|
|
8
|
-
export type VueToolCallRendererRenderProps<T> =
|
|
9
|
-
| {
|
|
10
|
-
name: string;
|
|
11
|
-
toolCallId: string;
|
|
12
|
-
args: Partial<T>;
|
|
13
|
-
status: ToolCallStatus.InProgress;
|
|
14
|
-
result: undefined;
|
|
15
|
-
}
|
|
16
|
-
| {
|
|
17
|
-
name: string;
|
|
18
|
-
toolCallId: string;
|
|
19
|
-
args: T;
|
|
20
|
-
status: ToolCallStatus.Executing;
|
|
21
|
-
result: undefined;
|
|
22
|
-
}
|
|
23
|
-
| {
|
|
24
|
-
name: string;
|
|
25
|
-
toolCallId: string;
|
|
26
|
-
args: T;
|
|
27
|
-
status: ToolCallStatus.Complete;
|
|
28
|
-
result: string;
|
|
29
|
-
};
|
|
13
|
+
export type VueToolCallRendererRenderProps<T> = ToolCallRenderProps<T>;
|
|
30
14
|
|
|
31
15
|
/**
|
|
32
16
|
* Vue component or render function for tool call rendering.
|
|
@@ -36,16 +20,17 @@ export type VueToolCallRendererRenderFn<T> =
|
|
|
36
20
|
| ((props: VueToolCallRendererRenderProps<T>) => VNodeChild)
|
|
37
21
|
| Component<VueToolCallRendererRenderProps<T>>;
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
23
|
+
type VueToolCallRendererDef<T> = ToolCallRendererDef<
|
|
24
|
+
T,
|
|
25
|
+
VueToolCallRendererRenderFn<T>
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Vue tool call renderer registration: core's `ToolCallRendererDef` with a
|
|
30
|
+
* Vue render function. `args` is required here. Use `defineToolCallRenderer`
|
|
31
|
+
* to build one; it fills in `args` for a `"*"` renderer that has no schema.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam T - The shape of the tool arguments.
|
|
34
|
+
*/
|
|
35
|
+
export type VueToolCallRenderer<T = unknown> = VueToolCallRendererDef<T> &
|
|
36
|
+
Required<Pick<VueToolCallRendererDef<T>, "args">>;
|
package/tsconfig.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default defineConfig({
|
|
|
13
13
|
lib: {
|
|
14
14
|
entry: {
|
|
15
15
|
index: resolve(__dirname, "src/index.ts"),
|
|
16
|
-
"v2/index": resolve(__dirname, "src/index.ts"),
|
|
16
|
+
"v2/index": resolve(__dirname, "src/v2/index.ts"),
|
|
17
17
|
},
|
|
18
18
|
name: "CopilotKitVue",
|
|
19
19
|
formats: ["es", "cjs"],
|
|
@@ -28,6 +28,11 @@ export default defineConfig({
|
|
|
28
28
|
"@a2ui/web_core/v0_9/basic_catalog",
|
|
29
29
|
"@ag-ui/client",
|
|
30
30
|
"@ag-ui/core",
|
|
31
|
+
// The framework-neutral A2UI catalog description subpath (no React).
|
|
32
|
+
"@copilotkit/a2ui-renderer/catalog-schema",
|
|
33
|
+
// The framework-neutral A2UI engine subpath (no React).
|
|
34
|
+
"@copilotkit/a2ui-renderer/engine",
|
|
35
|
+
"@copilotkit/a2ui-renderer/engine-core",
|
|
31
36
|
// Core and its `/styles` subpath, so the stylesheet isn't bundled here.
|
|
32
37
|
/^@copilotkit\/core(\/.*)?$/,
|
|
33
38
|
// Keep the shared MCP Apps host + its subpaths external. The root entry
|
|
@@ -38,7 +43,8 @@ export default defineConfig({
|
|
|
38
43
|
// statically for activity registration.
|
|
39
44
|
/^@copilotkit\/mcp-apps-renderer(\/.*)?$/,
|
|
40
45
|
"@copilotkit/shared",
|
|
41
|
-
|
|
46
|
+
// The Inspector and its `/mount` subpath stay runtime imports.
|
|
47
|
+
/^@copilotkit\/web-inspector(\/.*)?$/,
|
|
42
48
|
// Keep @copilotkit/web-components (the Lit drawer element) + its subpaths
|
|
43
49
|
// external. It's a runtime dependency loaded via the drawer wrapper's
|
|
44
50
|
// client-only dynamic import; bundling it inline would ship a duplicate
|
|
@@ -46,10 +52,7 @@ export default defineConfig({
|
|
|
46
52
|
// (duplicate top-level lit binding → "Identifier 'h' has already been
|
|
47
53
|
// declared") and risks double custom-element registration.
|
|
48
54
|
/^@copilotkit\/web-components(\/.*)?$/,
|
|
49
|
-
"@jetbrains/websandbox",
|
|
50
|
-
"lucide-vue-next",
|
|
51
55
|
"zod",
|
|
52
|
-
"zod-to-json-schema",
|
|
53
56
|
],
|
|
54
57
|
output: {
|
|
55
58
|
globals: { vue: "Vue" },
|
package/vitest.config.ts
CHANGED
|
@@ -12,12 +12,17 @@ export default defineConfig({
|
|
|
12
12
|
reporters: [["default", { summary: false }]],
|
|
13
13
|
},
|
|
14
14
|
resolve: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
// Exact match, so the real `@copilotkit/web-inspector/mount` subpath
|
|
16
|
+
// still resolves while the Inspector bundle itself is mocked.
|
|
17
|
+
alias: [
|
|
18
|
+
{ find: "@", replacement: resolve(__dirname, "./src") },
|
|
19
|
+
{
|
|
20
|
+
find: /^@copilotkit\/web-inspector$/,
|
|
21
|
+
replacement: resolve(
|
|
22
|
+
__dirname,
|
|
23
|
+
"./src/v2/__tests__/mocks/web-inspector.ts",
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
22
27
|
},
|
|
23
28
|
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
content: string;
|
|
3
|
-
isStreaming?: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
-
isStreaming: boolean;
|
|
7
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
-
export default _default;
|
|
9
|
-
//# sourceMappingURL=BasicMarkdown.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BasicMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/BasicMarkdown.vue"],"names":[],"mappings":"AAuKA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;;iBAAV,OAAO;;AAiM3D,wBAOG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-auto-scroll.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/normalize-auto-scroll.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,aAAa,GAAG,MAAM,CAAC;AAQtE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS,GAC1C,cAAc,CAMhB"}
|