@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
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent, h, ref } from "vue";
|
|
1
|
+
import { defineComponent, h, inject, ref } from "vue";
|
|
2
2
|
import type { WatchSource } from "vue";
|
|
3
3
|
import type { Component, VNodeChild } from "vue";
|
|
4
4
|
import { ToolCallStatus } from "@copilotkit/core";
|
|
5
5
|
import { useRenderTool } from "./use-render-tool";
|
|
6
|
+
import { ToolCallGroupContextKey } from "../components/chat/tool-call-display-context";
|
|
7
|
+
import { ToolCallRow } from "../components/chat/tool-call-group-parts";
|
|
6
8
|
|
|
7
9
|
type DefaultRenderProps = {
|
|
8
10
|
name: string;
|
|
@@ -135,8 +137,34 @@ const DefaultToolCallRenderer = defineComponent({
|
|
|
135
137
|
},
|
|
136
138
|
setup(props) {
|
|
137
139
|
const isExpanded = ref(false);
|
|
140
|
+
const groupContext = inject(ToolCallGroupContextKey, null);
|
|
138
141
|
|
|
139
142
|
return () => {
|
|
143
|
+
const group = groupContext?.value;
|
|
144
|
+
// Inside a group of calls, a row that fits the group instead of a card.
|
|
145
|
+
if (group) {
|
|
146
|
+
return h(ToolCallRow, {
|
|
147
|
+
"data-testid": "copilot-tool-render",
|
|
148
|
+
"data-tool-name": props.name,
|
|
149
|
+
"data-tool-call-id": props.toolCallId,
|
|
150
|
+
"data-status": props.status,
|
|
151
|
+
"data-args": safeStringifyForAttr(props.parameters),
|
|
152
|
+
"data-result": safeStringifyForAttr(props.result),
|
|
153
|
+
name: props.name,
|
|
154
|
+
parameters: props.parameters,
|
|
155
|
+
result: props.result,
|
|
156
|
+
status:
|
|
157
|
+
props.status === "complete"
|
|
158
|
+
? group.failedIds.has(props.toolCallId)
|
|
159
|
+
? "failed"
|
|
160
|
+
: "done"
|
|
161
|
+
: group.active
|
|
162
|
+
? "running"
|
|
163
|
+
: "stopped",
|
|
164
|
+
appearance: group.appearance,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
140
168
|
const isActive =
|
|
141
169
|
props.status === "inProgress" || props.status === "executing";
|
|
142
170
|
const isComplete = props.status === "complete";
|
|
@@ -145,7 +173,10 @@ const DefaultToolCallRenderer = defineComponent({
|
|
|
145
173
|
: isComplete
|
|
146
174
|
? "Done"
|
|
147
175
|
: props.status;
|
|
176
|
+
const tone = isActive ? "running" : isComplete ? "done" : "other";
|
|
148
177
|
|
|
178
|
+
// Markup and classes match React's DefaultToolCallRenderer; styles live
|
|
179
|
+
// in @copilotkit/core (default-tool-call.css).
|
|
149
180
|
return h(
|
|
150
181
|
"div",
|
|
151
182
|
{
|
|
@@ -155,77 +186,99 @@ const DefaultToolCallRenderer = defineComponent({
|
|
|
155
186
|
"data-status": props.status,
|
|
156
187
|
"data-args": safeStringifyForAttr(props.parameters),
|
|
157
188
|
"data-result": safeStringifyForAttr(props.result),
|
|
158
|
-
|
|
189
|
+
class: "cpk-default-tool-call",
|
|
159
190
|
},
|
|
160
191
|
[
|
|
161
|
-
h(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
[
|
|
172
|
-
h(
|
|
173
|
-
"button",
|
|
174
|
-
{
|
|
175
|
-
type: "button",
|
|
176
|
-
"aria-expanded": String(isExpanded.value),
|
|
177
|
-
onClick: () => {
|
|
178
|
-
isExpanded.value = !isExpanded.value;
|
|
179
|
-
},
|
|
180
|
-
style: {
|
|
181
|
-
width: "100%",
|
|
182
|
-
display: "flex",
|
|
183
|
-
alignItems: "center",
|
|
184
|
-
justifyContent: "space-between",
|
|
185
|
-
gap: "10px",
|
|
186
|
-
cursor: "pointer",
|
|
187
|
-
border: "none",
|
|
188
|
-
padding: 0,
|
|
189
|
-
margin: 0,
|
|
190
|
-
background: "transparent",
|
|
191
|
-
textAlign: "left",
|
|
192
|
-
},
|
|
192
|
+
h("div", { class: "cpk-default-tool-call-card" }, [
|
|
193
|
+
h(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
type: "button",
|
|
197
|
+
"aria-expanded": String(isExpanded.value),
|
|
198
|
+
onClick: () => {
|
|
199
|
+
isExpanded.value = !isExpanded.value;
|
|
193
200
|
},
|
|
194
|
-
|
|
201
|
+
class: "cpk-default-tool-call-header",
|
|
202
|
+
style: { font: "inherit" },
|
|
203
|
+
},
|
|
204
|
+
[
|
|
205
|
+
h("div", { class: "cpk-default-tool-call-title" }, [
|
|
195
206
|
h(
|
|
196
|
-
"
|
|
207
|
+
"svg",
|
|
197
208
|
{
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
class: [
|
|
210
|
+
"cpk-default-tool-call-chevron",
|
|
211
|
+
isExpanded.value &&
|
|
212
|
+
"cpk-default-tool-call-chevron-open",
|
|
213
|
+
],
|
|
214
|
+
fill: "none",
|
|
215
|
+
viewBox: "0 0 24 24",
|
|
216
|
+
"stroke-width": 2,
|
|
217
|
+
stroke: "currentColor",
|
|
200
218
|
},
|
|
201
|
-
|
|
219
|
+
[
|
|
220
|
+
h("path", {
|
|
221
|
+
"stroke-linecap": "round",
|
|
222
|
+
"stroke-linejoin": "round",
|
|
223
|
+
d: "M8.25 4.5l7.5 7.5-7.5 7.5",
|
|
224
|
+
}),
|
|
225
|
+
],
|
|
202
226
|
),
|
|
227
|
+
h("span", {
|
|
228
|
+
class: `cpk-default-tool-call-dot cpk-default-tool-call-dot-${tone}`,
|
|
229
|
+
}),
|
|
203
230
|
h(
|
|
204
231
|
"span",
|
|
205
|
-
{
|
|
206
|
-
|
|
232
|
+
{
|
|
233
|
+
"data-testid": "copilot-tool-render-name",
|
|
234
|
+
class: "cpk-default-tool-call-name",
|
|
235
|
+
},
|
|
236
|
+
props.name,
|
|
207
237
|
),
|
|
208
|
-
],
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
238
|
+
]),
|
|
239
|
+
h(
|
|
240
|
+
"span",
|
|
241
|
+
{
|
|
242
|
+
"data-testid": "copilot-tool-render-status",
|
|
243
|
+
class: `cpk-default-tool-call-badge cpk-default-tool-call-badge-${tone}`,
|
|
244
|
+
},
|
|
245
|
+
statusLabel,
|
|
246
|
+
),
|
|
247
|
+
],
|
|
248
|
+
),
|
|
249
|
+
isExpanded.value
|
|
250
|
+
? h("div", { class: "cpk-default-tool-call-details" }, [
|
|
251
|
+
h("div", [
|
|
252
|
+
h(
|
|
253
|
+
"div",
|
|
254
|
+
{ class: "cpk-default-tool-call-label" },
|
|
255
|
+
"Arguments",
|
|
256
|
+
),
|
|
257
|
+
h(
|
|
258
|
+
"pre",
|
|
259
|
+
{ class: "cpk-default-tool-call-code" },
|
|
260
|
+
safeStringifyForPre(props.parameters ?? {}),
|
|
261
|
+
),
|
|
262
|
+
]),
|
|
263
|
+
props.result !== undefined
|
|
264
|
+
? h("div", [
|
|
265
|
+
h(
|
|
266
|
+
"div",
|
|
267
|
+
{ class: "cpk-default-tool-call-label" },
|
|
268
|
+
"Result",
|
|
269
|
+
),
|
|
270
|
+
h(
|
|
271
|
+
"pre",
|
|
272
|
+
{ class: "cpk-default-tool-call-code" },
|
|
273
|
+
typeof props.result === "string"
|
|
274
|
+
? props.result
|
|
275
|
+
: safeStringifyForPre(props.result),
|
|
276
|
+
),
|
|
277
|
+
])
|
|
278
|
+
: null,
|
|
279
|
+
])
|
|
280
|
+
: null,
|
|
281
|
+
]),
|
|
229
282
|
],
|
|
230
283
|
);
|
|
231
284
|
};
|
|
@@ -259,6 +312,12 @@ export function useDefaultRenderTool(
|
|
|
259
312
|
render?:
|
|
260
313
|
| ((props: DefaultRenderProps) => VNodeChild)
|
|
261
314
|
| Component<DefaultRenderProps>;
|
|
315
|
+
/**
|
|
316
|
+
* Let the chat group calls your `render` draws, like it groups the
|
|
317
|
+
* built-in card's (see `toolCallDisplay` on `CopilotChatMessageView`).
|
|
318
|
+
* Off by default for a custom `render`, since it may draw nothing.
|
|
319
|
+
*/
|
|
320
|
+
group?: boolean;
|
|
262
321
|
},
|
|
263
322
|
deps?: WatchSource<unknown>[],
|
|
264
323
|
): void {
|
|
@@ -312,6 +371,8 @@ export function useDefaultRenderTool(
|
|
|
312
371
|
{
|
|
313
372
|
name: "*",
|
|
314
373
|
render: registeredRender,
|
|
374
|
+
// The built-in card draws a row inside a group; a custom render opts in.
|
|
375
|
+
group: userRender ? config?.group === true : true,
|
|
315
376
|
},
|
|
316
377
|
deps,
|
|
317
378
|
);
|
|
@@ -12,6 +12,11 @@ const EMPTY_DEPS: WatchSource<unknown>[] = [];
|
|
|
12
12
|
* The tool registration is reactive to provided dependencies and is cleaned up
|
|
13
13
|
* automatically when the current scope is disposed.
|
|
14
14
|
*
|
|
15
|
+
* A tool with the same name and `agentId` as a tool that is already
|
|
16
|
+
* registered (for example a provider `frontendTools` entry) takes its place
|
|
17
|
+
* while this scope is active. When the scope is disposed, the earlier tool is
|
|
18
|
+
* active again.
|
|
19
|
+
*
|
|
15
20
|
* @example
|
|
16
21
|
* ```ts
|
|
17
22
|
* useFrontendTool({
|
|
@@ -42,13 +47,10 @@ export function useFrontendTool<T extends Record<string, unknown>>(
|
|
|
42
47
|
const core = copilotkit.value;
|
|
43
48
|
const name = tool.name;
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
core.removeTool(name, tool.agentId);
|
|
50
|
-
}
|
|
51
|
-
core.addTool(tool);
|
|
50
|
+
// Registrations stack in core: this one shadows an earlier tool with the
|
|
51
|
+
// same name and agentId (a provider tool, or another component's), and
|
|
52
|
+
// unregistering it brings that tool back.
|
|
53
|
+
const unregister = core.addTool(tool);
|
|
52
54
|
|
|
53
55
|
// The render function is registered even when tool.parameters is
|
|
54
56
|
// undefined — tools like HITL confirm dialogs have no parameters
|
|
@@ -62,9 +64,7 @@ export function useFrontendTool<T extends Record<string, unknown>>(
|
|
|
62
64
|
} as VueToolCallRenderer<unknown>);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
onCleanup(
|
|
66
|
-
core.removeTool(name, tool.agentId);
|
|
67
|
-
});
|
|
67
|
+
onCleanup(unregister);
|
|
68
68
|
},
|
|
69
69
|
{ immediate: true },
|
|
70
70
|
);
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import type { Component } from "vue";
|
|
3
3
|
import type { ActivityMessage } from "@ag-ui/core";
|
|
4
|
-
import
|
|
4
|
+
import { ɵresolveActivityRenderer } from "@copilotkit/core";
|
|
5
5
|
import { DEFAULT_AGENT_ID } from "@copilotkit/shared";
|
|
6
6
|
import { useCopilotKit } from "../providers/useCopilotKit";
|
|
7
7
|
import { useCopilotChatConfiguration } from "../providers/useCopilotChatConfiguration";
|
|
8
|
-
import type {
|
|
9
|
-
VueActivityMessageRenderer,
|
|
10
|
-
VueActivityMessageRendererProps,
|
|
11
|
-
} from "../types";
|
|
12
|
-
|
|
13
|
-
interface ActivityRendererResult {
|
|
14
|
-
renderer: Component<VueActivityMessageRendererProps<unknown>>;
|
|
15
|
-
props: VueActivityMessageRendererProps<unknown>;
|
|
16
|
-
}
|
|
8
|
+
import type { VueActivityMessageRendererProps } from "../types";
|
|
17
9
|
|
|
18
10
|
/**
|
|
19
11
|
* Returns helpers for rendering activity messages.
|
|
@@ -21,70 +13,57 @@ interface ActivityRendererResult {
|
|
|
21
13
|
* Matches the React `useRenderActivityMessage` API: `findRenderer` locates a
|
|
22
14
|
* registered renderer by activity type (preferring agent-scoped over global,
|
|
23
15
|
* with `"*"` as a wildcard fallback), and `renderActivityMessage` resolves the
|
|
24
|
-
* renderer and validates the content schema
|
|
16
|
+
* renderer and validates the content with the renderer's `content` schema
|
|
17
|
+
* (any Standard Schema, such as zod).
|
|
25
18
|
*/
|
|
26
19
|
export function useRenderActivityMessage() {
|
|
27
20
|
const { copilotkit } = useCopilotKit();
|
|
28
21
|
const config = useCopilotChatConfiguration();
|
|
29
22
|
const agentId = computed(() => config.value?.agentId ?? DEFAULT_AGENT_ID);
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
function findRenderer(
|
|
36
|
-
activityType: string,
|
|
37
|
-
): VueActivityMessageRenderer<unknown> | null {
|
|
38
|
-
const list = renderers.value;
|
|
39
|
-
if (!list.length) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const matches = list.filter(
|
|
24
|
+
function findRenderer(activityType: string) {
|
|
25
|
+
const renderers = copilotkit.value.renderActivityMessages;
|
|
26
|
+
const matches = renderers.filter(
|
|
44
27
|
(renderer) => renderer.activityType === activityType,
|
|
45
28
|
);
|
|
46
29
|
|
|
47
30
|
return (
|
|
48
31
|
matches.find((candidate) => candidate.agentId === agentId.value) ??
|
|
49
32
|
matches.find((candidate) => candidate.agentId === undefined) ??
|
|
50
|
-
|
|
33
|
+
renderers.find((candidate) => candidate.activityType === "*") ??
|
|
51
34
|
null
|
|
52
35
|
);
|
|
53
36
|
}
|
|
54
37
|
|
|
55
|
-
function renderActivityMessage(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const parseResult = renderer.content.safeParse(message.content);
|
|
38
|
+
function renderActivityMessage(message: ActivityMessage) {
|
|
39
|
+
const match = ɵresolveActivityRenderer(
|
|
40
|
+
copilotkit.value.renderActivityMessages,
|
|
41
|
+
{
|
|
42
|
+
activityType: message.activityType,
|
|
43
|
+
agentId: agentId.value,
|
|
44
|
+
content: message.content,
|
|
45
|
+
},
|
|
46
|
+
);
|
|
65
47
|
|
|
66
|
-
if (!
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
if (!match) {
|
|
49
|
+
if (findRenderer(message.activityType)) {
|
|
50
|
+
console.warn(
|
|
51
|
+
`Failed to validate content for activity message ` +
|
|
52
|
+
`'${message.activityType}'.`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
72
55
|
return null;
|
|
73
56
|
}
|
|
74
57
|
|
|
75
|
-
const agent: AbstractAgent | undefined = copilotkit.value.getAgent(
|
|
76
|
-
agentId.value,
|
|
77
|
-
);
|
|
78
|
-
|
|
79
58
|
return {
|
|
80
|
-
renderer: renderer.render as Component<
|
|
59
|
+
renderer: match.renderer.render as Component<
|
|
81
60
|
VueActivityMessageRendererProps<unknown>
|
|
82
61
|
>,
|
|
83
62
|
props: {
|
|
84
63
|
activityType: message.activityType,
|
|
85
|
-
content:
|
|
64
|
+
content: match.content,
|
|
86
65
|
message,
|
|
87
|
-
agent,
|
|
66
|
+
agent: copilotkit.value.getAgent(agentId.value),
|
|
88
67
|
},
|
|
89
68
|
};
|
|
90
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Component, VNodeChild } from "vue";
|
|
2
1
|
import type { Message } from "@ag-ui/core";
|
|
2
|
+
import { ɵresolveCustomMessageRenderers } from "@copilotkit/core";
|
|
3
3
|
import { DEFAULT_AGENT_ID } from "@copilotkit/shared";
|
|
4
4
|
import { useCopilotKit } from "../providers/useCopilotKit";
|
|
5
5
|
import { useCopilotChatConfiguration } from "../providers/useCopilotChatConfiguration";
|
|
@@ -13,13 +13,6 @@ interface UseRenderCustomMessagesParams {
|
|
|
13
13
|
position: VueCustomMessageRendererPosition;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface CustomMessageRendererResult {
|
|
17
|
-
renderer:
|
|
18
|
-
| Component<VueCustomMessageRendererProps>
|
|
19
|
-
| ((props: VueCustomMessageRendererProps) => VNodeChild);
|
|
20
|
-
props: VueCustomMessageRendererProps;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
16
|
/**
|
|
24
17
|
* Returns a function that resolves the appropriate custom message renderer for
|
|
25
18
|
* a given message and position.
|
|
@@ -37,9 +30,7 @@ export function useRenderCustomMessages() {
|
|
|
37
30
|
const { copilotkit } = useCopilotKit();
|
|
38
31
|
const config = useCopilotChatConfiguration();
|
|
39
32
|
|
|
40
|
-
return function renderCustomMessage(
|
|
41
|
-
params: UseRenderCustomMessagesParams,
|
|
42
|
-
): CustomMessageRendererResult | null {
|
|
33
|
+
return function renderCustomMessage(params: UseRenderCustomMessagesParams) {
|
|
43
34
|
const configValue = config.value;
|
|
44
35
|
if (!configValue) return null;
|
|
45
36
|
|
|
@@ -47,17 +38,10 @@ export function useRenderCustomMessages() {
|
|
|
47
38
|
const { threadId } = configValue;
|
|
48
39
|
const core = copilotkit.value;
|
|
49
40
|
|
|
50
|
-
const customMessageRenderers =
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
.sort((a, b) => {
|
|
56
|
-
const aHasAgent = a.agentId !== undefined;
|
|
57
|
-
const bHasAgent = b.agentId !== undefined;
|
|
58
|
-
if (aHasAgent === bHasAgent) return 0;
|
|
59
|
-
return aHasAgent ? -1 : 1;
|
|
60
|
-
});
|
|
41
|
+
const customMessageRenderers = ɵresolveCustomMessageRenderers(
|
|
42
|
+
core.renderCustomMessages,
|
|
43
|
+
agentId,
|
|
44
|
+
);
|
|
61
45
|
|
|
62
46
|
if (!customMessageRenderers.length) {
|
|
63
47
|
return null;
|
|
@@ -101,7 +85,7 @@ export function useRenderCustomMessages() {
|
|
|
101
85
|
? core.getStateByRun(agentId, threadId, resolvedRunId)
|
|
102
86
|
: undefined;
|
|
103
87
|
|
|
104
|
-
const props:
|
|
88
|
+
const props: VueCustomMessageRendererProps = {
|
|
105
89
|
message,
|
|
106
90
|
position,
|
|
107
91
|
runId,
|
|
@@ -112,18 +96,13 @@ export function useRenderCustomMessages() {
|
|
|
112
96
|
stateSnapshot,
|
|
113
97
|
};
|
|
114
98
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
renderer: candidate.render as CustomMessageRendererResult["renderer"],
|
|
123
|
-
props,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
99
|
+
// Agent-scoped renderers come first. Use the first one that has a
|
|
100
|
+
// render function.
|
|
101
|
+
const selected = customMessageRenderers.find(
|
|
102
|
+
(candidate) => candidate.render,
|
|
103
|
+
);
|
|
104
|
+
if (!selected) return null;
|
|
126
105
|
|
|
127
|
-
return
|
|
106
|
+
return { renderer: selected.render, props };
|
|
128
107
|
};
|
|
129
108
|
}
|
|
@@ -46,6 +46,7 @@ type RenderToolConfig<S extends StandardSchemaV1> = {
|
|
|
46
46
|
| ((props: RenderToolProps<S>) => VNodeChild)
|
|
47
47
|
| Component<RenderToolProps<S>>;
|
|
48
48
|
agentId?: string;
|
|
49
|
+
group?: boolean;
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
export function useRenderTool(
|
|
@@ -53,6 +54,8 @@ export function useRenderTool(
|
|
|
53
54
|
name: "*";
|
|
54
55
|
render: ((props: any) => VNodeChild) | Component<any>;
|
|
55
56
|
agentId?: string;
|
|
57
|
+
/** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
|
|
58
|
+
group?: boolean;
|
|
56
59
|
},
|
|
57
60
|
deps?: WatchSource<unknown>[],
|
|
58
61
|
): void;
|
|
@@ -65,6 +68,8 @@ export function useRenderTool<S extends StandardSchemaV1>(
|
|
|
65
68
|
| ((props: RenderToolProps<S>) => VNodeChild)
|
|
66
69
|
| Component<RenderToolProps<S>>;
|
|
67
70
|
agentId?: string;
|
|
71
|
+
/** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
|
|
72
|
+
group?: boolean;
|
|
68
73
|
},
|
|
69
74
|
deps?: WatchSource<unknown>[],
|
|
70
75
|
): void;
|
|
@@ -81,6 +86,7 @@ export function useRenderTool<S extends StandardSchemaV1>(
|
|
|
81
86
|
() => copilotkit.value,
|
|
82
87
|
() => config.name,
|
|
83
88
|
() => config.agentId,
|
|
89
|
+
() => config.group,
|
|
84
90
|
() => extraDeps.length,
|
|
85
91
|
...extraDeps,
|
|
86
92
|
],
|
|
@@ -104,6 +110,7 @@ export function useRenderTool<S extends StandardSchemaV1>(
|
|
|
104
110
|
parameters: props.args,
|
|
105
111
|
} as RenderToolProps<S>),
|
|
106
112
|
...(config.agentId ? { agentId: config.agentId } : {}),
|
|
113
|
+
...(config.group ? { group: true } : {}),
|
|
107
114
|
})
|
|
108
115
|
: defineToolCallRenderer({
|
|
109
116
|
name: config.name,
|
|
@@ -116,6 +123,7 @@ export function useRenderTool<S extends StandardSchemaV1>(
|
|
|
116
123
|
parameters: props.args,
|
|
117
124
|
} as RenderToolProps<S>),
|
|
118
125
|
...(config.agentId ? { agentId: config.agentId } : {}),
|
|
126
|
+
...(config.group ? { group: true } : {}),
|
|
119
127
|
});
|
|
120
128
|
|
|
121
129
|
copilotkit.value.addHookRenderToolCall(
|
package/src/v2/index.ts
CHANGED
|
@@ -16,6 +16,9 @@ export * from "./components";
|
|
|
16
16
|
export { vueBasicCatalog } from "./components/a2ui/catalog";
|
|
17
17
|
export * from "./hooks";
|
|
18
18
|
export * from "./providers";
|
|
19
|
+
export { CopilotKitStyles } from "./styles/CopilotKitStyles";
|
|
20
|
+
export type { A2UIMessageRendererOptions } from "./components/A2UIMessageRenderer";
|
|
21
|
+
export type { A2UIRecoveryRendererOptions } from "./components/a2ui/A2UIRecoveryStates";
|
|
19
22
|
export * from "./types";
|
|
20
23
|
export * from "./lib/vue-core";
|
|
21
24
|
export * from "./lib/processPartialHtml";
|