@copilotkit/vue 2.0.0-rc.1 → 2.0.0-rc.10
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-CTR_ziWV.js +18097 -0
- package/dist/use-render-activity-message-CTR_ziWV.js.map +1 -0
- package/dist/use-render-activity-message-Dky9_GRG.cjs +92 -0
- package/dist/use-render-activity-message-Dky9_GRG.cjs.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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { CopilotKitCore } from "@copilotkit/core";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
getMessageFeedback,
|
|
5
|
+
subscribeToMessageFeedback,
|
|
6
|
+
MESSAGE_FEEDBACK_EVENT_NAME,
|
|
7
|
+
setMessageFeedback,
|
|
8
|
+
ɵresetMessageFeedbackCache,
|
|
9
|
+
} from "../message-feedback";
|
|
10
|
+
|
|
11
|
+
const emoji = "👍";
|
|
12
|
+
|
|
13
|
+
/** A Core that records what it emits, with its agent-text choice stubbed. */
|
|
14
|
+
function capturingCore({ agentText = true } = {}) {
|
|
15
|
+
const copilotkit = new CopilotKitCore({});
|
|
16
|
+
vi.spyOn(copilotkit, "ɵlearningCapturesAgentText", "get").mockReturnValue(
|
|
17
|
+
agentText,
|
|
18
|
+
);
|
|
19
|
+
const emit = vi
|
|
20
|
+
.spyOn(copilotkit, "emitTrajectoryEvent")
|
|
21
|
+
.mockImplementation(() => {});
|
|
22
|
+
return { copilotkit, emit };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const reply = { id: "m1", role: "assistant" as const, content: "Approved." };
|
|
26
|
+
|
|
27
|
+
const rate = (
|
|
28
|
+
copilotkit: CopilotKitCore,
|
|
29
|
+
feedback: { rating: "up" | "down"; comment?: string } | null,
|
|
30
|
+
message: { id: string; role: "assistant"; content: string } = reply,
|
|
31
|
+
) =>
|
|
32
|
+
setMessageFeedback({
|
|
33
|
+
copilotkit,
|
|
34
|
+
agentId: "agent",
|
|
35
|
+
threadId: "thread",
|
|
36
|
+
message,
|
|
37
|
+
feedback,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe("message feedback store", () => {
|
|
41
|
+
beforeEach(() => ɵresetMessageFeedbackCache());
|
|
42
|
+
afterEach(() => vi.restoreAllMocks());
|
|
43
|
+
|
|
44
|
+
it("cuts long text without splitting a character", () => {
|
|
45
|
+
const { copilotkit, emit } = capturingCore();
|
|
46
|
+
|
|
47
|
+
rate(
|
|
48
|
+
copilotkit,
|
|
49
|
+
{ rating: "up", comment: emoji.repeat(1200) },
|
|
50
|
+
{ id: "m1", role: "assistant", content: emoji.repeat(600) },
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const [name, value] = emit.mock.calls[0]!;
|
|
54
|
+
expect(name).toBe(MESSAGE_FEEDBACK_EVENT_NAME);
|
|
55
|
+
expect(value).toMatchObject({
|
|
56
|
+
response: emoji.repeat(500),
|
|
57
|
+
comment: emoji.repeat(1000),
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("keeps the rating and sends each change, a removal as null", () => {
|
|
62
|
+
const { copilotkit, emit } = capturingCore();
|
|
63
|
+
|
|
64
|
+
rate(copilotkit, { rating: "up" });
|
|
65
|
+
expect(getMessageFeedback("agent", "thread", "m1")).toEqual({
|
|
66
|
+
rating: "up",
|
|
67
|
+
});
|
|
68
|
+
rate(copilotkit, null);
|
|
69
|
+
|
|
70
|
+
expect(getMessageFeedback("agent", "thread", "m1")).toBeUndefined();
|
|
71
|
+
expect(emit.mock.calls.map(([, value]) => value)).toEqual([
|
|
72
|
+
expect.objectContaining({ feedbackId: "thread:m1", rating: "up" }),
|
|
73
|
+
expect.objectContaining({ feedbackId: "thread:m1", rating: null }),
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("trims a comment and drops a blank one", () => {
|
|
78
|
+
const { copilotkit } = capturingCore();
|
|
79
|
+
|
|
80
|
+
rate(copilotkit, { rating: "down", comment: " " });
|
|
81
|
+
expect(getMessageFeedback("agent", "thread", "m1")).toEqual({
|
|
82
|
+
rating: "down",
|
|
83
|
+
});
|
|
84
|
+
rate(copilotkit, { rating: "down", comment: " padded " });
|
|
85
|
+
|
|
86
|
+
expect(getMessageFeedback("agent", "thread", "m1")).toEqual({
|
|
87
|
+
rating: "down",
|
|
88
|
+
comment: "padded",
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("tells only the rated Thread's listeners", () => {
|
|
93
|
+
const { copilotkit } = capturingCore();
|
|
94
|
+
const rated = vi.fn();
|
|
95
|
+
const other = vi.fn();
|
|
96
|
+
subscribeToMessageFeedback("agent", "thread", rated);
|
|
97
|
+
subscribeToMessageFeedback("agent", "other", other);
|
|
98
|
+
|
|
99
|
+
rate(copilotkit, { rating: "up" });
|
|
100
|
+
|
|
101
|
+
expect(rated).toHaveBeenCalledTimes(1);
|
|
102
|
+
expect(other).not.toHaveBeenCalled();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("keeps the object of a rating that did not change", () => {
|
|
106
|
+
const { copilotkit } = capturingCore();
|
|
107
|
+
rate(copilotkit, { rating: "up" });
|
|
108
|
+
const before = getMessageFeedback("agent", "thread", "m1");
|
|
109
|
+
|
|
110
|
+
rate(
|
|
111
|
+
copilotkit,
|
|
112
|
+
{ rating: "down" },
|
|
113
|
+
{ id: "m2", role: "assistant", content: "No." },
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
expect(getMessageFeedback("agent", "thread", "m1")).toBe(before);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("treats message ids like object keys as plain ids", () => {
|
|
120
|
+
const { copilotkit } = capturingCore();
|
|
121
|
+
|
|
122
|
+
rate(
|
|
123
|
+
copilotkit,
|
|
124
|
+
{ rating: "up" },
|
|
125
|
+
{ id: "__proto__", role: "assistant", content: "" },
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
expect(getMessageFeedback("agent", "thread", "__proto__")).toEqual({
|
|
129
|
+
rating: "up",
|
|
130
|
+
});
|
|
131
|
+
expect(
|
|
132
|
+
getMessageFeedback("agent", "thread", "constructor"),
|
|
133
|
+
).toBeUndefined();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("leaves out the reply text when capture omits agent text", () => {
|
|
137
|
+
const { copilotkit, emit } = capturingCore({ agentText: false });
|
|
138
|
+
|
|
139
|
+
rate(copilotkit, { rating: "up" });
|
|
140
|
+
|
|
141
|
+
expect(emit.mock.calls[0]![1]).not.toHaveProperty("response");
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("names the reply's run when Core knows it", () => {
|
|
145
|
+
const { copilotkit, emit } = capturingCore();
|
|
146
|
+
vi.spyOn(copilotkit, "getRunIdForMessage").mockReturnValue("run-9");
|
|
147
|
+
|
|
148
|
+
rate(copilotkit, { rating: "up" });
|
|
149
|
+
|
|
150
|
+
expect(emit.mock.calls[0]![1]).toMatchObject({ runId: "run-9" });
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@ag-ui/core";
|
|
2
|
+
import type { CopilotKitCore } from "@copilotkit/core";
|
|
3
|
+
|
|
4
|
+
/** Trajectory event name for a rating of one assistant message. */
|
|
5
|
+
export const MESSAGE_FEEDBACK_EVENT_NAME = "message.feedback";
|
|
6
|
+
|
|
7
|
+
/** Longest comment kept, in characters; the rest is cut so the event stays small. */
|
|
8
|
+
export const MESSAGE_FEEDBACK_MAX_COMMENT_LENGTH = 1000;
|
|
9
|
+
|
|
10
|
+
/** Longest excerpt of the rated response sent with the rating, in characters. */
|
|
11
|
+
const RESPONSE_EXCERPT_LENGTH = 500;
|
|
12
|
+
|
|
13
|
+
export type MessageFeedbackRating = "up" | "down";
|
|
14
|
+
|
|
15
|
+
/** The rating this page gave one assistant message. */
|
|
16
|
+
export interface MessageFeedback {
|
|
17
|
+
readonly rating: MessageFeedbackRating;
|
|
18
|
+
readonly comment?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Ratings given on this page, by message. Kept outside Vue, so a rated
|
|
22
|
+
// message that scrolls out of a virtual list still shows its rating when it
|
|
23
|
+
// comes back. Intelligence holds the ratings across page loads.
|
|
24
|
+
const ratings = new Map<string, MessageFeedback>();
|
|
25
|
+
const listeners = new Map<string, Set<() => void>>();
|
|
26
|
+
|
|
27
|
+
const threadKey = (agentId: string, threadId: string) =>
|
|
28
|
+
JSON.stringify([agentId, threadId]);
|
|
29
|
+
|
|
30
|
+
const messageKey = (agentId: string, threadId: string, messageId: string) =>
|
|
31
|
+
JSON.stringify([agentId, threadId, messageId]);
|
|
32
|
+
|
|
33
|
+
/** Cuts `text` to `max` characters without splitting a surrogate pair. */
|
|
34
|
+
const clip = (text: string, max: number): string => {
|
|
35
|
+
const characters = Array.from(text);
|
|
36
|
+
return characters.length > max ? characters.slice(0, max).join("") : text;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** The comment as kept and sent: trimmed and capped, or none. */
|
|
40
|
+
const normalizeComment = (comment: unknown): string | undefined => {
|
|
41
|
+
if (typeof comment !== "string") return undefined;
|
|
42
|
+
const text = clip(comment.trim(), MESSAGE_FEEDBACK_MAX_COMMENT_LENGTH);
|
|
43
|
+
return text === "" ? undefined : text;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** The rating this page gave one message, if any. */
|
|
47
|
+
export function getMessageFeedback(
|
|
48
|
+
agentId: string,
|
|
49
|
+
threadId: string,
|
|
50
|
+
messageId: string,
|
|
51
|
+
): MessageFeedback | undefined {
|
|
52
|
+
return ratings.get(messageKey(agentId, threadId, messageId));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Calls `listener` whenever a rating in this Thread changes. */
|
|
56
|
+
export function subscribeToMessageFeedback(
|
|
57
|
+
agentId: string,
|
|
58
|
+
threadId: string,
|
|
59
|
+
listener: () => void,
|
|
60
|
+
): () => void {
|
|
61
|
+
const key = threadKey(agentId, threadId);
|
|
62
|
+
let set = listeners.get(key);
|
|
63
|
+
if (set === undefined) {
|
|
64
|
+
set = new Set();
|
|
65
|
+
listeners.set(key, set);
|
|
66
|
+
}
|
|
67
|
+
set.add(listener);
|
|
68
|
+
return () => {
|
|
69
|
+
set.delete(listener);
|
|
70
|
+
if (set.size === 0) listeners.delete(key);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sets (or, with `null`, clears) this page's rating of one message and sends
|
|
76
|
+
* it to the active Trajectory. Every change is a new event; the newest event
|
|
77
|
+
* for a `feedbackId` is the current one. Like any Trajectory event, a change
|
|
78
|
+
* made while no Trajectory captures, for example during a reconnect, is not
|
|
79
|
+
* sent; the page still shows it.
|
|
80
|
+
*/
|
|
81
|
+
export function setMessageFeedback(params: {
|
|
82
|
+
copilotkit: CopilotKitCore;
|
|
83
|
+
agentId: string;
|
|
84
|
+
threadId: string;
|
|
85
|
+
message: AssistantMessage;
|
|
86
|
+
feedback: MessageFeedback | null;
|
|
87
|
+
}): void {
|
|
88
|
+
const { copilotkit, agentId, threadId, message } = params;
|
|
89
|
+
const comment = normalizeComment(params.feedback?.comment);
|
|
90
|
+
const feedback: MessageFeedback | null = params.feedback && {
|
|
91
|
+
rating: params.feedback.rating,
|
|
92
|
+
...(comment ? { comment } : {}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const key = messageKey(agentId, threadId, message.id);
|
|
96
|
+
if (feedback) ratings.set(key, feedback);
|
|
97
|
+
else ratings.delete(key);
|
|
98
|
+
for (const listener of listeners.get(threadKey(agentId, threadId)) ?? [])
|
|
99
|
+
listener();
|
|
100
|
+
|
|
101
|
+
const runId = copilotkit.getRunIdForMessage(agentId, threadId, message.id);
|
|
102
|
+
copilotkit.emitTrajectoryEvent(MESSAGE_FEEDBACK_EVENT_NAME, {
|
|
103
|
+
feedbackId: `${threadId}:${message.id}`,
|
|
104
|
+
threadId,
|
|
105
|
+
messageId: message.id,
|
|
106
|
+
agentId,
|
|
107
|
+
...(runId ? { runId } : {}),
|
|
108
|
+
rating: feedback?.rating ?? null,
|
|
109
|
+
...(feedback?.comment ? { comment: feedback.comment } : {}),
|
|
110
|
+
// A custom sink set to omit agent text gets no excerpt of the reply.
|
|
111
|
+
...(copilotkit.ɵlearningCapturesAgentText
|
|
112
|
+
? { response: clip(message.content ?? "", RESPONSE_EXCERPT_LENGTH) }
|
|
113
|
+
: {}),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** @internal Forgets every rating, so each test starts empty. */
|
|
118
|
+
export function ɵresetMessageFeedbackCache(): void {
|
|
119
|
+
ratings.clear();
|
|
120
|
+
}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let result = html;
|
|
8
|
-
|
|
9
|
-
result = result.replace(/<[^>]*$/, "");
|
|
10
|
-
result = result.replace(/<(style|script|head)\b[^>]*>[\s\S]*?<\/\1>/gi, "");
|
|
11
|
-
result = result.replace(/<(style|script|head)\b[^>]*>[\s\S]*$/gi, "");
|
|
12
|
-
result = result.replace(/&[a-zA-Z0-9#]*$/, "");
|
|
13
|
-
|
|
14
|
-
const bodyMatch = result.match(/<body[^>]*>([\s\S]*)/i);
|
|
15
|
-
if (bodyMatch) {
|
|
16
|
-
result = bodyMatch[1]!;
|
|
17
|
-
result = result.replace(/<\/body>[\s\S]*/i, "");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
1
|
+
// The partial-HTML helpers live in @copilotkit/core; these names stay for
|
|
2
|
+
// existing imports.
|
|
3
|
+
export {
|
|
4
|
+
ɵextractCompleteStyles as extractCompleteStyles,
|
|
5
|
+
ɵprocessPartialHtml as processPartialHtml,
|
|
6
|
+
} from "@copilotkit/core";
|
package/src/v2/lib/vue-core.ts
CHANGED
|
@@ -44,7 +44,9 @@ export class CopilotKitCoreVue extends CopilotKitCore {
|
|
|
44
44
|
private _interruptState: InterruptRenderProps<unknown, unknown> | null = null;
|
|
45
45
|
|
|
46
46
|
constructor(config: CopilotKitCoreVueConfig) {
|
|
47
|
-
|
|
47
|
+
// Tool handlers can change reactive state. `nextTick` lets Vue flush those
|
|
48
|
+
// updates before core starts the follow-up run.
|
|
49
|
+
super({ ...config, ɵwaitForFrameworkUpdates: () => nextTick() });
|
|
48
50
|
this._renderToolCalls = config.renderToolCalls ?? [];
|
|
49
51
|
this._renderCustomMessages = config.renderCustomMessages ?? [];
|
|
50
52
|
this._renderActivityMessages = config.renderActivityMessages ?? [];
|
|
@@ -154,8 +156,4 @@ export class CopilotKitCoreVue extends CopilotKitCore {
|
|
|
154
156
|
): CopilotKitCoreSubscription {
|
|
155
157
|
return super.subscribe(subscriber);
|
|
156
158
|
}
|
|
157
|
-
|
|
158
|
-
async waitForPendingFrameworkUpdates(): Promise<void> {
|
|
159
|
-
await nextTick();
|
|
160
|
-
}
|
|
161
159
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, inject, provide, ref } from "vue";
|
|
2
|
+
import { computed, inject, onMounted, provide, ref, watch } from "vue";
|
|
3
3
|
import type { ComputedRef } from "vue";
|
|
4
4
|
import { DEFAULT_AGENT_ID, randomUUID } from "@copilotkit/shared";
|
|
5
|
-
import {
|
|
5
|
+
import type { OpenThreadRegistration } from "@copilotkit/core";
|
|
6
|
+
import { CopilotChatConfigurationKey, CopilotKitKey } from "./keys";
|
|
6
7
|
import { CopilotChatDefaultLabels } from "./types";
|
|
7
8
|
import type { CopilotChatConfigurationValue, CopilotChatLabels } from "./types";
|
|
8
9
|
import type { CopilotChatConfigurationProviderProps } from "./CopilotChatConfigurationProvider.types";
|
|
@@ -61,6 +62,32 @@ const resolvedThreadId = computed(() => {
|
|
|
61
62
|
return fallbackThreadId;
|
|
62
63
|
});
|
|
63
64
|
|
|
65
|
+
// Tell Core which Thread this view shows, so captured interactions can link
|
|
66
|
+
// to it. This provider also works without a CopilotKitProvider, and then there
|
|
67
|
+
// is nothing to register with. Registration starts on mount, so a server
|
|
68
|
+
// render never registers a Thread that it can't unregister.
|
|
69
|
+
const copilotKitContext = inject(CopilotKitKey, null);
|
|
70
|
+
let openThread: OpenThreadRegistration | null = null;
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
watch(
|
|
73
|
+
() => [copilotKitContext?.copilotkit.value, resolvedAgentId.value] as const,
|
|
74
|
+
([core, agentId], _previous, onCleanup) => {
|
|
75
|
+
if (!core) return;
|
|
76
|
+
const registration = core.registerOpenThread({
|
|
77
|
+
agentId,
|
|
78
|
+
threadId: resolvedThreadId.value,
|
|
79
|
+
});
|
|
80
|
+
openThread = registration;
|
|
81
|
+
onCleanup(() => {
|
|
82
|
+
registration.unregister();
|
|
83
|
+
openThread = null;
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
{ immediate: true },
|
|
87
|
+
);
|
|
88
|
+
watch(resolvedThreadId, (threadId) => openThread?.update(threadId));
|
|
89
|
+
});
|
|
90
|
+
|
|
64
91
|
const resolvedHasExplicitThreadId = computed(() => {
|
|
65
92
|
if (propIsAuthoritative.value) return true;
|
|
66
93
|
const own = activeThreadOverride.value
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { A2UIRecoveryRendererOptions } from "../components/a2ui/A2UIRecoveryStates";
|
|
1
2
|
import type { AbstractAgent } from "@ag-ui/client";
|
|
2
3
|
import type {
|
|
3
4
|
CopilotKitCoreErrorCode,
|
|
4
5
|
CopilotKitHeadersSource,
|
|
5
6
|
CopilotKitMessageFilter,
|
|
7
|
+
LearningConfig,
|
|
6
8
|
} from "@copilotkit/core";
|
|
7
9
|
import type { DebugConfig } from "@copilotkit/shared";
|
|
8
10
|
import type {
|
|
@@ -26,6 +28,17 @@ export interface CopilotKitProviderProps {
|
|
|
26
28
|
*/
|
|
27
29
|
headers?: CopilotKitHeadersSource;
|
|
28
30
|
credentials?: RequestCredentials;
|
|
31
|
+
/**
|
|
32
|
+
* CSP nonce for the `<style>` tag CopilotKit adds. Set it when your
|
|
33
|
+
* Content-Security-Policy limits `style-src` to a nonce.
|
|
34
|
+
*/
|
|
35
|
+
nonce?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Set to `false` when you import `@copilotkit/core/styles.css` yourself, so
|
|
38
|
+
* browsers cache the CSS as a file. CopilotKit then adds no `<style>` tag.
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
injectStyles?: boolean;
|
|
29
42
|
/**
|
|
30
43
|
* Rewrites the message list sent to runtime agents on every run.
|
|
31
44
|
*
|
|
@@ -71,11 +84,6 @@ export interface CopilotKitProviderProps {
|
|
|
71
84
|
sandboxFunctions?: SandboxFunction[];
|
|
72
85
|
designSkill?: string;
|
|
73
86
|
};
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated This prop no longer controls the Inspector. Use
|
|
76
|
-
* `enableInspector` instead.
|
|
77
|
-
*/
|
|
78
|
-
showDevConsole?: boolean | "auto";
|
|
79
87
|
/**
|
|
80
88
|
* Disable the CopilotKit Inspector in development.
|
|
81
89
|
* The Inspector is enabled by default in development browser builds and is
|
|
@@ -107,6 +115,12 @@ export interface CopilotKitProviderProps {
|
|
|
107
115
|
* `a2ui_params["guidelines"]["composition_guide"]` in Python).
|
|
108
116
|
*/
|
|
109
117
|
includeSchema?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Options for the A2UI error-recovery status UI: how long before the
|
|
120
|
+
* transient "Retrying…" hint appears, after how many attempts, and how
|
|
121
|
+
* much retry/debug detail to surface. When omitted, defaults apply.
|
|
122
|
+
*/
|
|
123
|
+
recovery?: A2UIRecoveryRendererOptions;
|
|
110
124
|
};
|
|
111
125
|
/** Configuration for the built-in MCP Apps renderer. */
|
|
112
126
|
mcpApps?: {
|
|
@@ -137,4 +151,42 @@ export interface CopilotKitProviderProps {
|
|
|
137
151
|
* - `{ events?: boolean; lifecycle?: boolean; verbose?: boolean }` for granular control.
|
|
138
152
|
*/
|
|
139
153
|
debug?: DebugConfig;
|
|
154
|
+
/**
|
|
155
|
+
* Turns on interaction capture (`@copilotkit/learning`). `learning` (short
|
|
156
|
+
* for `:learning="true"`) records with the default options; pass an object
|
|
157
|
+
* for options. `false` or omitting the prop turns capture off and cancels
|
|
158
|
+
* startup. Without a sink, Core authenticates with the runtime and sends
|
|
159
|
+
* browser events to Intelligence; a custom sink keeps the standalone
|
|
160
|
+
* collector behavior. Updated settings apply to the next Trajectory.
|
|
161
|
+
*
|
|
162
|
+
* Capture starts after mount. Set `trajectoryId` to use your own ID;
|
|
163
|
+
* otherwise the provider generates one. The generated ID stays the same
|
|
164
|
+
* across rerenders, reconnects and option changes; turning capture off,
|
|
165
|
+
* setting `autoStart: false` or supplying a `trajectoryId` ends it, and the
|
|
166
|
+
* next generated Trajectory gets a new ID. Read the active ID from
|
|
167
|
+
* `copilotkit.trajectoryId`.
|
|
168
|
+
*
|
|
169
|
+
* Set `autoStart: false` to start capture yourself with `startTrajectory()`.
|
|
170
|
+
* Capture stops on unmount, including manually started Trajectories.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* <CopilotKitProvider runtime-url="/api/copilotkit" learning>
|
|
174
|
+
*/
|
|
175
|
+
learning?: boolean | CopilotKitLearningOptions;
|
|
140
176
|
}
|
|
177
|
+
|
|
178
|
+
/** The object form of the `learning` prop. */
|
|
179
|
+
export type CopilotKitLearningOptions = LearningConfig & {
|
|
180
|
+
/**
|
|
181
|
+
* Starts a Trajectory after mount. Defaults to `true`; set `false` to call
|
|
182
|
+
* `startTrajectory()` yourself.
|
|
183
|
+
*/
|
|
184
|
+
autoStart?: boolean;
|
|
185
|
+
trajectoryId?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Used only by explicit custom sinks. Authenticated capture warns and ignores
|
|
188
|
+
* this option; assign Learning Spaces on the server with
|
|
189
|
+
* `getTrajectoryLearningContainerIds` on `CopilotKitIntelligence`.
|
|
190
|
+
*/
|
|
191
|
+
learningContainerIds?: string[];
|
|
192
|
+
};
|