@copilotkit/vue 1.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +50 -0
- package/CHANGELOG.md +13 -0
- package/PARITY.md +434 -0
- package/README.md +396 -0
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts +20 -0
- package/dist/components/copilot-provider/CopilotKit.vue.d.ts.map +1 -0
- package/dist/components/copilot-provider/index.d.ts +3 -0
- package/dist/components/copilot-provider/index.d.ts.map +1 -0
- package/dist/components/copilot-provider/types.d.ts +22 -0
- package/dist/components/copilot-provider/types.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-copilot-action.d.ts +27 -0
- package/dist/hooks/use-copilot-action.d.ts.map +1 -0
- package/dist/hooks/use-copilot-readable.d.ts +20 -0
- package/dist/hooks/use-copilot-readable.d.ts.map +1 -0
- package/dist/hooks/use-frontend-tool.d.ts +21 -0
- package/dist/hooks/use-frontend-tool.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +252 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/use-render-activity-message-BRL1Rpl-.cjs +85 -0
- package/dist/use-render-activity-message-BRL1Rpl-.cjs.map +1 -0
- package/dist/use-render-activity-message-CqtxiFSs.js +8927 -0
- package/dist/use-render-activity-message-CqtxiFSs.js.map +1 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts +9 -0
- package/dist/v2/components/A2UIMessageRenderer.d.ts.map +1 -0
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts +16 -0
- package/dist/v2/components/A2UISurfaceActivityRenderer.vue.d.ts.map +1 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts +7 -0
- package/dist/v2/components/CopilotKitInspector.vue.d.ts.map +1 -0
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts +6 -0
- package/dist/v2/components/InlineFeatureWarning.vue.d.ts.map +1 -0
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts +18 -0
- package/dist/v2/components/LicenseWarningBanner.vue.d.ts.map +1 -0
- package/dist/v2/components/MCPAppsActivityRenderer.d.ts +88 -0
- package/dist/v2/components/MCPAppsActivityRenderer.d.ts.map +1 -0
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts +154 -0
- package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -0
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts +19 -0
- package/dist/v2/components/a2ui/A2UIBuiltInToolCallRenderer.d.ts.map +1 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts +16 -0
- package/dist/v2/components/a2ui/A2UICatalogContext.d.ts.map +1 -0
- package/dist/v2/components/a2ui/VueSurface.d.ts +62 -0
- package/dist/v2/components/a2ui/VueSurface.d.ts.map +1 -0
- package/dist/v2/components/a2ui/adapter.d.ts +38 -0
- package/dist/v2/components/a2ui/adapter.d.ts.map +1 -0
- package/dist/v2/components/a2ui/catalog.d.ts +29 -0
- package/dist/v2/components/a2ui/catalog.d.ts.map +1 -0
- package/dist/v2/components/a2ui/index.d.ts +5 -0
- package/dist/v2/components/a2ui/index.d.ts.map +1 -0
- package/dist/v2/components/a2ui/utils.d.ts +18 -0
- package/dist/v2/components/a2ui/utils.d.ts.map +1 -0
- package/dist/v2/components/a2ui.d.ts +12 -0
- package/dist/v2/components/a2ui.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts +50 -0
- package/dist/v2/components/chat/CopilotChat.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts +164 -0
- package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatAttachmentQueue.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts +7 -0
- package/dist/v2/components/chat/CopilotChatAttachmentRenderer.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts +12 -0
- package/dist/v2/components/chat/CopilotChatAudioRecorder.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +290 -0
- package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts +72 -0
- package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts +65 -0
- package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts +27 -0
- package/dist/v2/components/chat/CopilotChatSuggestionPill.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts +26 -0
- package/dist/v2/components/chat/CopilotChatSuggestionView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts +17 -0
- package/dist/v2/components/chat/CopilotChatToggleButton.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonCloseIcon.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonCloseIcon.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonOpenIcon.d.ts +5 -0
- package/dist/v2/components/chat/CopilotChatToggleButtonOpenIcon.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts +21 -0
- package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts +34 -0
- package/dist/v2/components/chat/CopilotChatUserMessage.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts +106 -0
- package/dist/v2/components/chat/CopilotChatView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts +15 -0
- package/dist/v2/components/chat/CopilotModalHeader.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts +5 -0
- package/dist/v2/components/chat/CopilotModalHeaderCloseButton.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts +5 -0
- package/dist/v2/components/chat/CopilotModalHeaderTitle.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts +50 -0
- package/dist/v2/components/chat/CopilotPopup.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts +55 -0
- package/dist/v2/components/chat/CopilotPopupView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts +55 -0
- package/dist/v2/components/chat/CopilotPopupViewInternal.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts +28 -0
- package/dist/v2/components/chat/CopilotPopupWelcomeScreen.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts +48 -0
- package/dist/v2/components/chat/CopilotSidebar.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts +62 -0
- package/dist/v2/components/chat/CopilotSidebarView.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts +53 -0
- package/dist/v2/components/chat/CopilotSidebarViewInternal.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts +28 -0
- package/dist/v2/components/chat/CopilotSidebarWelcomeScreen.vue.d.ts.map +1 -0
- package/dist/v2/components/chat/audioRecorder.d.ts +11 -0
- package/dist/v2/components/chat/audioRecorder.d.ts.map +1 -0
- package/dist/v2/components/chat/index.d.ts +682 -0
- package/dist/v2/components/chat/index.d.ts.map +1 -0
- package/dist/v2/components/chat/last-user-message-context.d.ts +29 -0
- package/dist/v2/components/chat/last-user-message-context.d.ts.map +1 -0
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts +3 -0
- package/dist/v2/components/chat/normalize-auto-scroll.d.ts.map +1 -0
- package/dist/v2/components/chat/types.d.ts +380 -0
- package/dist/v2/components/chat/types.d.ts.map +1 -0
- package/dist/v2/components/icons/index.d.ts +2 -0
- package/dist/v2/components/icons/index.d.ts.map +1 -0
- package/dist/v2/components/index.d.ts +8 -0
- package/dist/v2/components/index.d.ts.map +1 -0
- package/dist/v2/hooks/index.d.ts +24 -0
- package/dist/v2/hooks/index.d.ts.map +1 -0
- package/dist/v2/hooks/use-agent-context.d.ts +24 -0
- package/dist/v2/hooks/use-agent-context.d.ts.map +1 -0
- package/dist/v2/hooks/use-agent.d.ts +53 -0
- package/dist/v2/hooks/use-agent.d.ts.map +1 -0
- package/dist/v2/hooks/use-attachments.d.ts +21 -0
- package/dist/v2/hooks/use-attachments.d.ts.map +1 -0
- package/dist/v2/hooks/use-capabilities.d.ts +16 -0
- package/dist/v2/hooks/use-capabilities.d.ts.map +1 -0
- package/dist/v2/hooks/use-component.d.ts +13 -0
- package/dist/v2/hooks/use-component.d.ts.map +1 -0
- package/dist/v2/hooks/use-configure-suggestions.d.ts +24 -0
- package/dist/v2/hooks/use-configure-suggestions.d.ts.map +1 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts +14 -0
- package/dist/v2/hooks/use-default-render-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts +19 -0
- package/dist/v2/hooks/use-frontend-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-human-in-the-loop.d.ts +19 -0
- package/dist/v2/hooks/use-human-in-the-loop.d.ts.map +1 -0
- package/dist/v2/hooks/use-interrupt.d.ts +36 -0
- package/dist/v2/hooks/use-interrupt.d.ts.map +1 -0
- package/dist/v2/hooks/use-katex-styles.d.ts +22 -0
- package/dist/v2/hooks/use-katex-styles.d.ts.map +1 -0
- package/dist/v2/hooks/use-keyboard-height.d.ts +33 -0
- package/dist/v2/hooks/use-keyboard-height.d.ts.map +1 -0
- package/dist/v2/hooks/use-pin-to-send.d.ts +28 -0
- package/dist/v2/hooks/use-pin-to-send.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-activity-message.d.ts +21 -0
- package/dist/v2/hooks/use-render-activity-message.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-custom-messages.d.ts +27 -0
- package/dist/v2/hooks/use-render-custom-messages.d.ts.map +1 -0
- package/dist/v2/hooks/use-render-tool.d.ts +36 -0
- package/dist/v2/hooks/use-render-tool.d.ts.map +1 -0
- package/dist/v2/hooks/use-suggestions.d.ts +26 -0
- package/dist/v2/hooks/use-suggestions.d.ts.map +1 -0
- package/dist/v2/hooks/use-threads.d.ts +42 -0
- package/dist/v2/hooks/use-threads.d.ts.map +1 -0
- package/dist/v2/index.cjs +2 -0
- package/dist/v2/index.cjs.map +1 -0
- package/dist/v2/index.d.cts +9 -0
- package/dist/v2/index.d.mts +9 -0
- package/dist/v2/index.d.ts +9 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.mjs +75 -0
- package/dist/v2/index.mjs.map +1 -0
- package/dist/v2/lib/processPartialHtml.d.ts +3 -0
- package/dist/v2/lib/processPartialHtml.d.ts.map +1 -0
- package/dist/v2/lib/shallow-stable.d.ts +7 -0
- package/dist/v2/lib/shallow-stable.d.ts.map +1 -0
- package/dist/v2/lib/transcription-client.d.ts +19 -0
- package/dist/v2/lib/transcription-client.d.ts.map +1 -0
- package/dist/v2/lib/vue-core.d.ts +47 -0
- package/dist/v2/lib/vue-core.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.types.d.ts +15 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.types.d.ts.map +1 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts +17 -0
- package/dist/v2/providers/CopilotChatConfigurationProvider.vue.d.ts.map +1 -0
- package/dist/v2/providers/CopilotKitProvider.types.d.ts +61 -0
- package/dist/v2/providers/CopilotKitProvider.types.d.ts.map +1 -0
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts +37 -0
- package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -0
- package/dist/v2/providers/SandboxFunctionsContext.d.ts +4 -0
- package/dist/v2/providers/SandboxFunctionsContext.d.ts.map +1 -0
- package/dist/v2/providers/index.d.ts +13 -0
- package/dist/v2/providers/index.d.ts.map +1 -0
- package/dist/v2/providers/keys.d.ts +17 -0
- package/dist/v2/providers/keys.d.ts.map +1 -0
- package/dist/v2/providers/license-context.d.ts +7 -0
- package/dist/v2/providers/license-context.d.ts.map +1 -0
- package/dist/v2/providers/types.d.ts +38 -0
- package/dist/v2/providers/types.d.ts.map +1 -0
- package/dist/v2/providers/useCopilotChatConfiguration.d.ts +4 -0
- package/dist/v2/providers/useCopilotChatConfiguration.d.ts.map +1 -0
- package/dist/v2/providers/useCopilotKit.d.ts +2 -0
- package/dist/v2/providers/useCopilotKit.d.ts.map +1 -0
- package/dist/v2/providers/useLicenseContext.d.ts +14 -0
- package/dist/v2/providers/useLicenseContext.d.ts.map +1 -0
- package/dist/v2/types/a2ui.d.ts +5 -0
- package/dist/v2/types/a2ui.d.ts.map +1 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts +15 -0
- package/dist/v2/types/defineToolCallRenderer.d.ts.map +1 -0
- package/dist/v2/types/frontend-tool.d.ts +6 -0
- package/dist/v2/types/frontend-tool.d.ts.map +1 -0
- package/dist/v2/types/human-in-the-loop.d.ts +29 -0
- package/dist/v2/types/human-in-the-loop.d.ts.map +1 -0
- package/dist/v2/types/index.d.ts +10 -0
- package/dist/v2/types/index.d.ts.map +1 -0
- package/dist/v2/types/interrupt.d.ts +14 -0
- package/dist/v2/types/interrupt.d.ts.map +1 -0
- package/dist/v2/types/sandbox-function.d.ts +8 -0
- package/dist/v2/types/sandbox-function.d.ts.map +1 -0
- package/dist/v2/types/vue-activity-message-renderer.d.ts +18 -0
- package/dist/v2/types/vue-activity-message-renderer.d.ts.map +1 -0
- package/dist/v2/types/vue-custom-message-renderer.d.ts +19 -0
- package/dist/v2/types/vue-custom-message-renderer.d.ts.map +1 -0
- package/dist/v2/types/vue-tool-call-renderer.d.ts +37 -0
- package/dist/v2/types/vue-tool-call-renderer.d.ts.map +1 -0
- package/env.d.ts +7 -0
- package/eslint.config.mjs +42 -0
- package/package.json +130 -0
- package/scripts/scope-preflight.mjs +100 -0
- package/src/components/copilot-provider/CopilotKit.vue +18 -0
- package/src/components/copilot-provider/index.ts +2 -0
- package/src/components/copilot-provider/types.ts +24 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/use-copilot-action.ts +168 -0
- package/src/hooks/use-copilot-readable.ts +75 -0
- package/src/hooks/use-frontend-tool.ts +76 -0
- package/src/index.ts +12 -0
- package/src/styles/globals.css +314 -0
- package/src/v2/__tests__/exports.test.ts +35 -0
- package/src/v2/__tests__/mocks/web-inspector.ts +5 -0
- package/src/v2/__tests__/setup.ts +141 -0
- package/src/v2/__tests__/utils/agents.ts +391 -0
- package/src/v2/__tests__/utils/mount.ts +83 -0
- package/src/v2/__tests__/utils/test-helpers.ts +712 -0
- package/src/v2/components/A2UIMessageRenderer.ts +125 -0
- package/src/v2/components/A2UISurfaceActivityRenderer.vue +186 -0
- package/src/v2/components/CopilotKitInspector.vue +42 -0
- package/src/v2/components/InlineFeatureWarning.vue +35 -0
- package/src/v2/components/LicenseWarningBanner.vue +196 -0
- package/src/v2/components/MCPAppsActivityRenderer.ts +778 -0
- package/src/v2/components/OpenGenerativeUIRenderer.ts +550 -0
- package/src/v2/components/__tests__/A2UIMessageRenderer.test.ts +271 -0
- package/src/v2/components/__tests__/CopilotKitInspector.test.ts +57 -0
- package/src/v2/components/__tests__/MCPAppsActivityRenderer.e2e.test.ts +851 -0
- package/src/v2/components/__tests__/MCPAppsActivityRenderer.test.ts +237 -0
- package/src/v2/components/__tests__/OpenGenerativeUIRenderer.test.ts +516 -0
- package/src/v2/components/a2ui/A2UIBuiltInToolCallRenderer.ts +295 -0
- package/src/v2/components/a2ui/A2UICatalogContext.ts +190 -0
- package/src/v2/components/a2ui/VueSurface.ts +144 -0
- package/src/v2/components/a2ui/adapter.ts +156 -0
- package/src/v2/components/a2ui/catalog.ts +858 -0
- package/src/v2/components/a2ui/index.ts +7 -0
- package/src/v2/components/a2ui/utils.ts +67 -0
- package/src/v2/components/a2ui.ts +30 -0
- package/src/v2/components/chat/CopilotChat.vue +777 -0
- package/src/v2/components/chat/CopilotChatAssistantMessage.vue +891 -0
- package/src/v2/components/chat/CopilotChatAttachmentQueue.vue +411 -0
- package/src/v2/components/chat/CopilotChatAttachmentRenderer.vue +87 -0
- package/src/v2/components/chat/CopilotChatAudioRecorder.vue +269 -0
- package/src/v2/components/chat/CopilotChatInput.vue +1271 -0
- package/src/v2/components/chat/CopilotChatMessageView.vue +476 -0
- package/src/v2/components/chat/CopilotChatReasoningMessage.vue +247 -0
- package/src/v2/components/chat/CopilotChatSuggestionPill.vue +56 -0
- package/src/v2/components/chat/CopilotChatSuggestionView.vue +93 -0
- package/src/v2/components/chat/CopilotChatToggleButton.vue +145 -0
- package/src/v2/components/chat/CopilotChatToggleButtonCloseIcon.ts +17 -0
- package/src/v2/components/chat/CopilotChatToggleButtonOpenIcon.ts +18 -0
- package/src/v2/components/chat/CopilotChatToolCallsView.vue +161 -0
- package/src/v2/components/chat/CopilotChatUserMessage.vue +322 -0
- package/src/v2/components/chat/CopilotChatView.vue +740 -0
- package/src/v2/components/chat/CopilotModalHeader.vue +73 -0
- package/src/v2/components/chat/CopilotModalHeaderCloseButton.ts +38 -0
- package/src/v2/components/chat/CopilotModalHeaderTitle.ts +22 -0
- package/src/v2/components/chat/CopilotPopup.vue +182 -0
- package/src/v2/components/chat/CopilotPopupView.vue +168 -0
- package/src/v2/components/chat/CopilotPopupViewInternal.vue +453 -0
- package/src/v2/components/chat/CopilotPopupWelcomeScreen.vue +140 -0
- package/src/v2/components/chat/CopilotSidebar.vue +178 -0
- package/src/v2/components/chat/CopilotSidebarView.vue +172 -0
- package/src/v2/components/chat/CopilotSidebarViewInternal.vue +366 -0
- package/src/v2/components/chat/CopilotSidebarWelcomeScreen.vue +142 -0
- package/src/v2/components/chat/__tests__/CopilotChat.attachments.test.ts +237 -0
- package/src/v2/components/chat/__tests__/CopilotChat.e2e.test.ts +1240 -0
- package/src/v2/components/chat/__tests__/CopilotChat.licenseWarning.test.ts +138 -0
- package/src/v2/components/chat/__tests__/CopilotChat.onError.test.ts +85 -0
- package/src/v2/components/chat/__tests__/CopilotChat.slots.e2e.test.ts +141 -0
- package/src/v2/components/chat/__tests__/CopilotChat.test.ts +652 -0
- package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.ts +683 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.slots.e2e.test.ts +768 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.test.ts +1108 -0
- package/src/v2/components/chat/__tests__/CopilotChatAssistantMessage.thumbs.test.ts +87 -0
- package/src/v2/components/chat/__tests__/CopilotChatAttachmentQueue.test.ts +277 -0
- package/src/v2/components/chat/__tests__/CopilotChatAttachmentRenderer.test.ts +124 -0
- package/src/v2/components/chat/__tests__/CopilotChatCopyButton.clipboard.test.ts +230 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.bottomAnchored.test.ts +83 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.slots.e2e.test.ts +1139 -0
- package/src/v2/components/chat/__tests__/CopilotChatInput.test.ts +1051 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.slots.e2e.test.ts +141 -0
- package/src/v2/components/chat/__tests__/CopilotChatMessageView.test.ts +494 -0
- package/src/v2/components/chat/__tests__/CopilotChatPropsRerender.e2e.test.ts +181 -0
- package/src/v2/components/chat/__tests__/CopilotChatReasoningMessage.test.ts +73 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionPill.test.ts +73 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.slots.e2e.test.ts +674 -0
- package/src/v2/components/chat/__tests__/CopilotChatSuggestionView.test.ts +91 -0
- package/src/v2/components/chat/__tests__/CopilotChatToggleButton.test.ts +93 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolCallsView.test.ts +382 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolRendering.e2e.test.ts +1019 -0
- package/src/v2/components/chat/__tests__/CopilotChatToolRerenders.e2e.test.ts +516 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.slots.e2e.test.ts +701 -0
- package/src/v2/components/chat/__tests__/CopilotChatUserMessage.test.ts +337 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.connectingGate.test.ts +135 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.inputOverlay.test.ts +278 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.onClick.e2e.test.ts +1082 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.ts +166 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.slots.e2e.test.ts +1145 -0
- package/src/v2/components/chat/__tests__/CopilotChatView.test.ts +374 -0
- package/src/v2/components/chat/__tests__/CopilotModalHeader.slots.e2e.test.ts +636 -0
- package/src/v2/components/chat/__tests__/CopilotModalHeader.test.ts +112 -0
- package/src/v2/components/chat/__tests__/CopilotPopup.test.ts +58 -0
- package/src/v2/components/chat/__tests__/CopilotPopupView.slots.e2e.test.ts +725 -0
- package/src/v2/components/chat/__tests__/CopilotPopupView.test.ts +112 -0
- package/src/v2/components/chat/__tests__/CopilotSidebar.test.ts +58 -0
- package/src/v2/components/chat/__tests__/CopilotSidebarView.slots.e2e.test.ts +603 -0
- package/src/v2/components/chat/__tests__/CopilotSidebarView.test.ts +214 -0
- package/src/v2/components/chat/__tests__/MCPAppsUiMessage.e2e.test.ts +394 -0
- package/src/v2/components/chat/__tests__/copilot-chat-throttle.test.ts +82 -0
- package/src/v2/components/chat/__tests__/normalize-auto-scroll.test.ts +39 -0
- package/src/v2/components/chat/audioRecorder.ts +15 -0
- package/src/v2/components/chat/index.ts +52 -0
- package/src/v2/components/chat/last-user-message-context.ts +39 -0
- package/src/v2/components/chat/normalize-auto-scroll.ts +17 -0
- package/src/v2/components/chat/types.ts +481 -0
- package/src/v2/components/icons/__tests__/icons.test.ts +86 -0
- package/src/v2/components/icons/index.ts +22 -0
- package/src/v2/components/index.ts +7 -0
- package/src/v2/hooks/__tests__/standard-schema-types.test.ts +149 -0
- package/src/v2/hooks/__tests__/standard-schema.test.ts +315 -0
- package/src/v2/hooks/__tests__/use-agent-context-timing.e2e.test.ts +144 -0
- package/src/v2/hooks/__tests__/use-agent-context.test.ts +271 -0
- package/src/v2/hooks/__tests__/use-agent-error-state.test.ts +64 -0
- package/src/v2/hooks/__tests__/use-agent-stability.test.ts +268 -0
- package/src/v2/hooks/__tests__/use-agent-thread-isolation.test.ts +433 -0
- package/src/v2/hooks/__tests__/use-agent-throttle.test.ts +747 -0
- package/src/v2/hooks/__tests__/use-agent.e2e.test.ts +187 -0
- package/src/v2/hooks/__tests__/use-agent.test.ts +126 -0
- package/src/v2/hooks/__tests__/use-attachments.test.ts +181 -0
- package/src/v2/hooks/__tests__/use-component.test.ts +145 -0
- package/src/v2/hooks/__tests__/use-configure-suggestions.e2e.test.ts +527 -0
- package/src/v2/hooks/__tests__/use-configure-suggestions.test.ts +399 -0
- package/src/v2/hooks/__tests__/use-default-render-tool.test.ts +214 -0
- package/src/v2/hooks/__tests__/use-frontend-tool-available.test.ts +220 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.e2e.test.ts +2320 -0
- package/src/v2/hooks/__tests__/use-frontend-tool.test.ts +648 -0
- package/src/v2/hooks/__tests__/use-human-in-the-loop.e2e.test.ts +1379 -0
- package/src/v2/hooks/__tests__/use-human-in-the-loop.test.ts +282 -0
- package/src/v2/hooks/__tests__/use-interrupt.test.ts +345 -0
- package/src/v2/hooks/__tests__/use-katex-styles.test.ts +69 -0
- package/src/v2/hooks/__tests__/use-keyboard-height.test.ts +199 -0
- package/src/v2/hooks/__tests__/use-pin-to-send.test.ts +363 -0
- package/src/v2/hooks/__tests__/use-render-tool.test.ts +329 -0
- package/src/v2/hooks/__tests__/use-suggestions.e2e.test.ts +397 -0
- package/src/v2/hooks/__tests__/use-suggestions.test.ts +198 -0
- package/src/v2/hooks/__tests__/use-threads.test.ts +1041 -0
- package/src/v2/hooks/__tests__/zod-regression.test.ts +339 -0
- package/src/v2/hooks/index.ts +29 -0
- package/src/v2/hooks/use-agent-context.ts +55 -0
- package/src/v2/hooks/use-agent.ts +345 -0
- package/src/v2/hooks/use-attachments.ts +261 -0
- package/src/v2/hooks/use-capabilities.ts +30 -0
- package/src/v2/hooks/use-component.ts +46 -0
- package/src/v2/hooks/use-configure-suggestions.ts +252 -0
- package/src/v2/hooks/use-default-render-tool.ts +130 -0
- package/src/v2/hooks/use-frontend-tool.ts +68 -0
- package/src/v2/hooks/use-human-in-the-loop.ts +90 -0
- package/src/v2/hooks/use-interrupt.ts +257 -0
- package/src/v2/hooks/use-katex-styles.ts +44 -0
- package/src/v2/hooks/use-keyboard-height.ts +87 -0
- package/src/v2/hooks/use-pin-to-send.ts +160 -0
- package/src/v2/hooks/use-render-activity-message.ts +92 -0
- package/src/v2/hooks/use-render-custom-messages.ts +129 -0
- package/src/v2/hooks/use-render-tool.ts +128 -0
- package/src/v2/hooks/use-suggestions.ts +98 -0
- package/src/v2/hooks/use-threads.ts +208 -0
- package/src/v2/index.ts +11 -0
- package/src/v2/lib/__tests__/processPartialHtml.test.ts +84 -0
- package/src/v2/lib/__tests__/transcription-client.test.ts +65 -0
- package/src/v2/lib/processPartialHtml.ts +21 -0
- package/src/v2/lib/shallow-stable.ts +54 -0
- package/src/v2/lib/transcription-client.ts +151 -0
- package/src/v2/lib/vue-core.ts +161 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.types.ts +15 -0
- package/src/v2/providers/CopilotChatConfigurationProvider.vue +95 -0
- package/src/v2/providers/CopilotKitProvider.types.ts +66 -0
- package/src/v2/providers/CopilotKitProvider.vue +653 -0
- package/src/v2/providers/SandboxFunctionsContext.ts +11 -0
- package/src/v2/providers/__tests__/CopilotChatConfigurationProvider.test.ts +309 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.debug.test.ts +295 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.license.test.ts +110 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.onError.test.ts +67 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.renderCustomMessages.e2e.test.ts +901 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.sandboxFunctions.test.ts +141 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.stability.test.ts +871 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.test.ts +603 -0
- package/src/v2/providers/__tests__/CopilotKitProvider.wildcard.test.ts +104 -0
- package/src/v2/providers/index.ts +21 -0
- package/src/v2/providers/keys.ts +25 -0
- package/src/v2/providers/license-context.ts +16 -0
- package/src/v2/providers/types.ts +40 -0
- package/src/v2/providers/useCopilotChatConfiguration.ts +11 -0
- package/src/v2/providers/useCopilotKit.ts +11 -0
- package/src/v2/providers/useLicenseContext.ts +21 -0
- package/src/v2/types/__tests__/defineToolCallRenderer.test.ts +157 -0
- package/src/v2/types/a2ui.ts +5 -0
- package/src/v2/types/defineToolCallRenderer.ts +32 -0
- package/src/v2/types/frontend-tool.ts +8 -0
- package/src/v2/types/human-in-the-loop.ts +38 -0
- package/src/v2/types/index.ts +9 -0
- package/src/v2/types/interrupt.ts +15 -0
- package/src/v2/types/sandbox-function.ts +8 -0
- package/src/v2/types/vue-activity-message-renderer.ts +22 -0
- package/src/v2/types/vue-custom-message-renderer.ts +24 -0
- package/src/v2/types/vue-tool-call-renderer.ts +44 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +49 -0
- package/vitest.config.ts +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# @copilotkit/vue
|
|
2
|
+
|
|
3
|
+
Vue 3 bindings for CopilotKit2: providers, composables, and chat rendering primitives for integrating AI agents into Vue applications.
|
|
4
|
+
|
|
5
|
+
## Documentation Location
|
|
6
|
+
|
|
7
|
+
Vue-specific documentation does not belong in the shared `docs/` V2 reference unless the repository adds a dedicated Vue docs section there.
|
|
8
|
+
|
|
9
|
+
- Keep package usage and API guidance in this README.
|
|
10
|
+
- Keep parity policy, architectural translation decisions, strict test-port rules, and the living React-to-Vue matrix in [PARITY.md](./PARITY.md).
|
|
11
|
+
- Put public-facing Vue API and component documentation in Vue Storybook under `examples/v2/vue/storybook`.
|
|
12
|
+
|
|
13
|
+
## Parity Delivery Checklist
|
|
14
|
+
|
|
15
|
+
The parity checklist and strict translatability rules are maintained in [PARITY.md](./PARITY.md). Use it as the source of truth for parity completion and for deciding when tests must mirror React literally.
|
|
16
|
+
|
|
17
|
+
## Parity Workflow
|
|
18
|
+
|
|
19
|
+
Follow [PARITY.md](./PARITY.md) for parity workflow. If a feature is not clearly near-100% translatable, discuss the API/test divergence before introducing a Vue-specific translation. Update the matrix in the same change when behavior or tests change.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @copilotkit/vue @copilotkit/core
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Import package styles once in your app entry:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import "@copilotkit/vue/styles.css";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`styles.css` is generated from `src/styles/globals.css` via Tailwind (`pnpm -C packages/vue build:css`).
|
|
34
|
+
The Vue package styles are self-contained and do not require importing `@copilotkit/react/styles.css`.
|
|
35
|
+
|
|
36
|
+
## Basic Usage
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { CopilotKitProvider } from "@copilotkit/vue";
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<CopilotKitProvider runtime-url="/api/copilotkit">
|
|
45
|
+
<slot />
|
|
46
|
+
</CopilotKitProvider>
|
|
47
|
+
</template>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Provider Parity: `selfManagedAgents`, `onError`, and `a2ui`
|
|
51
|
+
|
|
52
|
+
`CopilotKitProvider` supports React-parity provider controls for local agent registration and runtime error handling.
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<script setup lang="ts">
|
|
56
|
+
import { CopilotKitProvider } from "@copilotkit/vue";
|
|
57
|
+
import type { CopilotKitCoreErrorCode } from "@copilotkit/core";
|
|
58
|
+
|
|
59
|
+
function onProviderError(event: {
|
|
60
|
+
error: Error;
|
|
61
|
+
code: CopilotKitCoreErrorCode;
|
|
62
|
+
context: Record<string, any>;
|
|
63
|
+
}) {
|
|
64
|
+
console.error(
|
|
65
|
+
"CopilotKit provider error",
|
|
66
|
+
event.code,
|
|
67
|
+
event.context,
|
|
68
|
+
event.error,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<CopilotKitProvider
|
|
75
|
+
runtime-url="/api/copilotkit"
|
|
76
|
+
:self-managed-agents="{}"
|
|
77
|
+
:on-error="onProviderError"
|
|
78
|
+
:a2ui="{ theme: { mode: 'light' } }"
|
|
79
|
+
>
|
|
80
|
+
<slot />
|
|
81
|
+
</CopilotKitProvider>
|
|
82
|
+
</template>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Notes:
|
|
86
|
+
|
|
87
|
+
- `selfManagedAgents` is merged with `agents__unsafe_dev_only`, with `selfManagedAgents` taking precedence for duplicate IDs.
|
|
88
|
+
- `onError` receives provider-scope core errors and is independent from chat-level `CopilotChat.onError`.
|
|
89
|
+
- `a2ui.theme` customizes the built-in `a2ui-surface` fallback renderer when the runtime reports `a2uiEnabled: true`.
|
|
90
|
+
|
|
91
|
+
### Provider `debug` logging
|
|
92
|
+
|
|
93
|
+
`CopilotKitProvider` accepts a `debug` prop that mirrors the React `debug` surface. It toggles client-side debug logging on the underlying core and is kept in sync at runtime as the prop changes.
|
|
94
|
+
|
|
95
|
+
Supported values match React parity:
|
|
96
|
+
|
|
97
|
+
- `true` / `false` — enables or disables event + lifecycle logging (verbose payloads stay off).
|
|
98
|
+
- `{ events?: boolean; lifecycle?: boolean; verbose?: boolean }` — granular control; `verbose` opts into full event payloads.
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<script setup lang="ts">
|
|
102
|
+
import { CopilotKitProvider, type DebugConfig } from "@copilotkit/vue";
|
|
103
|
+
|
|
104
|
+
const debug: DebugConfig = { events: true, lifecycle: true, verbose: false };
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<template>
|
|
108
|
+
<CopilotKitProvider runtime-url="/api/copilotkit" :debug="debug">
|
|
109
|
+
<slot />
|
|
110
|
+
</CopilotKitProvider>
|
|
111
|
+
</template>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Prop updates are forwarded to the stable `CopilotKitCoreVue` instance via `setDebug(...)`, so changing `debug` at runtime does not recreate the provider or the core instance.
|
|
115
|
+
|
|
116
|
+
## Chat Error Parity: `CopilotChat.onError`
|
|
117
|
+
|
|
118
|
+
`CopilotChat` also exposes an `onError` callback with React-parity filtering semantics.
|
|
119
|
+
It only forwards errors for the resolved chat agent (or global errors without an `agentId`).
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<script setup lang="ts">
|
|
123
|
+
import { CopilotChat } from "@copilotkit/vue";
|
|
124
|
+
|
|
125
|
+
function onChatError(event: {
|
|
126
|
+
error: Error;
|
|
127
|
+
code: string;
|
|
128
|
+
context: Record<string, any>;
|
|
129
|
+
}) {
|
|
130
|
+
console.error("CopilotChat error", event.code, event.context, event.error);
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
<template>
|
|
135
|
+
<CopilotChat agent-id="default" :on-error="onChatError" />
|
|
136
|
+
</template>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Notes:
|
|
140
|
+
|
|
141
|
+
- Provider `onError` and chat `onError` are independent subscriptions and can both fire for the same matching error.
|
|
142
|
+
- Chat `onError` ignores errors scoped to other `agentId` values.
|
|
143
|
+
|
|
144
|
+
## Chat Rendering (Slot-Based)
|
|
145
|
+
|
|
146
|
+
`@copilotkit/vue` uses Vue named/scoped slots for message, activity, and tool rendering:
|
|
147
|
+
|
|
148
|
+
- `CopilotChatMessageView`
|
|
149
|
+
- `CopilotChatToolCallsView`
|
|
150
|
+
- `CopilotChatInput`
|
|
151
|
+
|
|
152
|
+
```vue
|
|
153
|
+
<template>
|
|
154
|
+
<CopilotChatMessageView :messages="messages" :is-running="isRunning">
|
|
155
|
+
<template #message-before="{ message, runId, messageIndexInRun }">
|
|
156
|
+
<MessageMeta
|
|
157
|
+
:id="message.id"
|
|
158
|
+
:run-id="runId"
|
|
159
|
+
:index-in-run="messageIndexInRun"
|
|
160
|
+
/>
|
|
161
|
+
</template>
|
|
162
|
+
|
|
163
|
+
<template #assistant-message="{ message }">
|
|
164
|
+
<AssistantBubble :content="message.content" />
|
|
165
|
+
</template>
|
|
166
|
+
|
|
167
|
+
<template #activity-mcp-apps="{ content }">
|
|
168
|
+
<MyMcpActivity :content="content" />
|
|
169
|
+
</template>
|
|
170
|
+
|
|
171
|
+
<template #tool-call-search_docs="{ args, status, result }">
|
|
172
|
+
<SearchDocsToolCall :args="args" :status="status" :result="result" />
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<template #tool-call="{ name, args, status }">
|
|
176
|
+
<GenericToolCall :name="name" :args="args" :status="status" />
|
|
177
|
+
</template>
|
|
178
|
+
</CopilotChatMessageView>
|
|
179
|
+
</template>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Supported message-level slots:
|
|
183
|
+
|
|
184
|
+
- `message-before`
|
|
185
|
+
- `assistant-message`
|
|
186
|
+
- `user-message`
|
|
187
|
+
- `reasoning-message`
|
|
188
|
+
- `activity-<activityType>` (dynamic)
|
|
189
|
+
- `activity-message` (fallback)
|
|
190
|
+
- `message-after`
|
|
191
|
+
- `cursor`
|
|
192
|
+
|
|
193
|
+
Supported tool-level slots:
|
|
194
|
+
|
|
195
|
+
- `tool-call-<toolName>` (dynamic)
|
|
196
|
+
- `tool-call` (fallback)
|
|
197
|
+
|
|
198
|
+
## Programmatic Custom Message Registration
|
|
199
|
+
|
|
200
|
+
Slots remain the primary Vue customization path for chat/message rendering. When you need reusable shared renderers with provider-managed ordering or agent scoping, `CopilotKitProvider` also accepts `render-custom-messages` as a secondary API.
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<script setup lang="ts">
|
|
204
|
+
import { CopilotKitProvider, CopilotChat } from "@copilotkit/vue";
|
|
205
|
+
import { defineComponent } from "vue";
|
|
206
|
+
|
|
207
|
+
const AuditBadge = defineComponent({
|
|
208
|
+
props: {
|
|
209
|
+
message: { type: Object, required: true },
|
|
210
|
+
position: { type: String, required: true },
|
|
211
|
+
},
|
|
212
|
+
template: `
|
|
213
|
+
<div
|
|
214
|
+
v-if="position === 'after' && message.role === 'assistant'"
|
|
215
|
+
:data-testid="'audit-' + message.id"
|
|
216
|
+
>
|
|
217
|
+
Audited
|
|
218
|
+
</div>
|
|
219
|
+
`,
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const renderCustomMessages = [
|
|
223
|
+
{ render: AuditBadge },
|
|
224
|
+
{ agentId: "sales-agent", render: AuditBadge },
|
|
225
|
+
];
|
|
226
|
+
</script>
|
|
227
|
+
|
|
228
|
+
<template>
|
|
229
|
+
<CopilotKitProvider
|
|
230
|
+
runtime-url="/api/copilotkit"
|
|
231
|
+
:render-custom-messages="renderCustomMessages"
|
|
232
|
+
>
|
|
233
|
+
<CopilotChat agent-id="sales-agent" />
|
|
234
|
+
</CopilotKitProvider>
|
|
235
|
+
</template>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Use:
|
|
239
|
+
|
|
240
|
+
- `#message-before` / `#message-after` for local template-level customization in a specific chat or message view
|
|
241
|
+
- provider `render-custom-messages` for reusable renderer registration, ordered evaluation, and agent-scoped overrides
|
|
242
|
+
|
|
243
|
+
## Reasoning Messages
|
|
244
|
+
|
|
245
|
+
`CopilotChatMessageView` supports reasoning messages via the `reasoning-message` slot, with a default `CopilotChatReasoningMessage` fallback.
|
|
246
|
+
|
|
247
|
+
Default reasoning behavior mirrors React semantics:
|
|
248
|
+
|
|
249
|
+
- Shows `Thinking…` while the reasoning message is the latest streaming message.
|
|
250
|
+
- Switches to `Thought for ...` when reasoning finishes.
|
|
251
|
+
- Auto-opens while streaming and auto-collapses on completion.
|
|
252
|
+
- Hides the chat-level cursor when the latest message is reasoning.
|
|
253
|
+
|
|
254
|
+
## Current Scope
|
|
255
|
+
|
|
256
|
+
- **Providers**: `CopilotKitProvider`, `CopilotChatConfigurationProvider`
|
|
257
|
+
- **Composables**: `useCopilotKit`, `useCopilotChatConfiguration`, `useAgent`, `useAgentContext`, `useFrontendTool`, `useRenderTool`, `useDefaultRenderTool`, `useComponent`, `useHumanInTheLoop`, `useSuggestions`, `useConfigureSuggestions`, `useThreads`, `useInterrupt`
|
|
258
|
+
- **Components**: `CopilotChat`, `CopilotKitInspector`, `CopilotChatAssistantMessage`, `CopilotChatUserMessage`, `CopilotChatReasoningMessage`, `CopilotChatMessageView`, `CopilotChatSuggestionPill`, `CopilotChatSuggestionView`, `CopilotChatInput`, `CopilotChatToggleButton`, `CopilotModalHeader`, `CopilotChatView`, `CopilotChatToolCallsView`, `CopilotSidebarView`, `CopilotPopupView`, `CopilotSidebar`, `CopilotPopup`, `MCPAppsActivityRenderer`, `A2UISurfaceActivityRenderer`
|
|
259
|
+
- **Markdown Renderer**: `CopilotChatAssistantMessage` uses `streamdown-vue` (with KaTeX support)
|
|
260
|
+
- **Core**: `CopilotKitCoreVue`
|
|
261
|
+
|
|
262
|
+
## Threads
|
|
263
|
+
|
|
264
|
+
```vue
|
|
265
|
+
<script setup lang="ts">
|
|
266
|
+
import { useThreads } from "@copilotkit/vue";
|
|
267
|
+
|
|
268
|
+
const {
|
|
269
|
+
threads,
|
|
270
|
+
isLoading,
|
|
271
|
+
hasMoreThreads,
|
|
272
|
+
isFetchingMoreThreads,
|
|
273
|
+
fetchMoreThreads,
|
|
274
|
+
renameThread,
|
|
275
|
+
deleteThread,
|
|
276
|
+
} = useThreads({
|
|
277
|
+
agentId: "agent-1",
|
|
278
|
+
includeArchived: false,
|
|
279
|
+
limit: 20,
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
function loadMoreThreads() {
|
|
283
|
+
if (hasMoreThreads.value && !isFetchingMoreThreads.value) {
|
|
284
|
+
fetchMoreThreads();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
</script>
|
|
288
|
+
|
|
289
|
+
<template>
|
|
290
|
+
<div v-if="isLoading">Loading…</div>
|
|
291
|
+
<ul v-else>
|
|
292
|
+
<li v-for="thread in threads" :key="thread.id">
|
|
293
|
+
{{ thread.name ?? "Untitled" }}
|
|
294
|
+
<button @click="renameThread(thread.id, 'Renamed')">Rename</button>
|
|
295
|
+
<button @click="deleteThread(thread.id)">Delete</button>
|
|
296
|
+
</li>
|
|
297
|
+
</ul>
|
|
298
|
+
<button
|
|
299
|
+
v-if="hasMoreThreads"
|
|
300
|
+
:disabled="isFetchingMoreThreads"
|
|
301
|
+
@click="loadMoreThreads"
|
|
302
|
+
>
|
|
303
|
+
{{ isFetchingMoreThreads ? "Loading..." : "Load more" }}
|
|
304
|
+
</button>
|
|
305
|
+
</template>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
`useThreads` is a headless composable for Intelligence-platform thread lists scoped to the runtime-authenticated user and provided `agentId`. It supports optional `includeArchived` and `limit` inputs, subscribes to realtime metadata updates when the runtime exposes a websocket URL, and returns reactive refs for `threads`, `isLoading`, `error`, `hasMoreThreads`, and `isFetchingMoreThreads`, plus `fetchMoreThreads()`.
|
|
309
|
+
|
|
310
|
+
### `useInterrupt`
|
|
311
|
+
|
|
312
|
+
`useInterrupt` handles agent `on_interrupt` events without requiring Vue users to write render functions or TSX.
|
|
313
|
+
|
|
314
|
+
For in-chat usage, combine the composable with the `#interrupt` slot on `CopilotChat`:
|
|
315
|
+
|
|
316
|
+
```vue
|
|
317
|
+
<script setup lang="ts">
|
|
318
|
+
import { useInterrupt } from "@copilotkit/vue";
|
|
319
|
+
|
|
320
|
+
useInterrupt({
|
|
321
|
+
handler: async ({ event }) => ({ label: String(event.value) }),
|
|
322
|
+
});
|
|
323
|
+
</script>
|
|
324
|
+
|
|
325
|
+
<template>
|
|
326
|
+
<CopilotChat>
|
|
327
|
+
<template #interrupt="{ event, result, resolve }">
|
|
328
|
+
<button @click="resolve({ approved: true, value: event.value })">
|
|
329
|
+
{{ result?.label ?? event.value }}
|
|
330
|
+
</button>
|
|
331
|
+
</template>
|
|
332
|
+
</CopilotChat>
|
|
333
|
+
</template>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
For manual placement, use `renderInChat: false` and consume the returned refs:
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
const { interrupt, result, hasInterrupt, resolveInterrupt } = useInterrupt({
|
|
340
|
+
renderInChat: false,
|
|
341
|
+
});
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Icon Foundation (Internal)
|
|
345
|
+
|
|
346
|
+
- Chat/UI components should import icons from `src/components/icons/index.ts`.
|
|
347
|
+
- Do not import from `lucide-vue-next` directly in Vue package components.
|
|
348
|
+
- This adapter is internal and intentionally not exported from the package root.
|
|
349
|
+
|
|
350
|
+
## Text Input
|
|
351
|
+
|
|
352
|
+
```vue
|
|
353
|
+
<script setup lang="ts">
|
|
354
|
+
import { ref } from "vue";
|
|
355
|
+
import {
|
|
356
|
+
CopilotChatConfigurationProvider,
|
|
357
|
+
CopilotChatInput,
|
|
358
|
+
} from "@copilotkit/vue";
|
|
359
|
+
|
|
360
|
+
const input = ref("");
|
|
361
|
+
|
|
362
|
+
function onSubmitMessage(value: string) {
|
|
363
|
+
console.log("submit:", value);
|
|
364
|
+
}
|
|
365
|
+
</script>
|
|
366
|
+
|
|
367
|
+
<template>
|
|
368
|
+
<CopilotChatConfigurationProvider thread-id="thread-1" agent-id="default">
|
|
369
|
+
<CopilotChatInput
|
|
370
|
+
v-model="input"
|
|
371
|
+
:tools-menu="[
|
|
372
|
+
{ label: 'Insert template', action: () => console.log('template') },
|
|
373
|
+
]"
|
|
374
|
+
@submit-message="onSubmitMessage"
|
|
375
|
+
@add-file="() => {}"
|
|
376
|
+
@start-transcribe="() => {}"
|
|
377
|
+
@cancel-transcribe="() => {}"
|
|
378
|
+
@finish-transcribe="() => {}"
|
|
379
|
+
/>
|
|
380
|
+
</CopilotChatConfigurationProvider>
|
|
381
|
+
</template>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Key parity props:
|
|
385
|
+
|
|
386
|
+
- `mode`: `"input" | "transcribe" | "processing"`
|
|
387
|
+
- `toolsMenu`: nested menu items + separators (`"-"`)
|
|
388
|
+
- `positioning`: `"static" | "absolute"`
|
|
389
|
+
- `keyboardHeight`: number (mobile keyboard offset)
|
|
390
|
+
- `showDisclaimer`: explicit override, otherwise defaults by positioning
|
|
391
|
+
|
|
392
|
+
Key slots:
|
|
393
|
+
|
|
394
|
+
- `text-area`, `send-button`, `add-menu-button`
|
|
395
|
+
- `start-transcribe-button`, `cancel-transcribe-button`, `finish-transcribe-button`
|
|
396
|
+
- `audio-recorder`, `disclaimer`, `layout`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 compatibility wrapper for CopilotKitProvider.
|
|
3
|
+
*
|
|
4
|
+
* Accepts the same props as CopilotKitProvider plus legacy v1 props
|
|
5
|
+
* (publicApiKey, publicLicenseKey) and delegates to the v2 provider.
|
|
6
|
+
*/
|
|
7
|
+
import type { CopilotKitProps } from "./types";
|
|
8
|
+
declare var __VLS_5: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_5) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<CopilotKitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CopilotKitProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=CopilotKit.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopilotKit.vue.d.ts","sourceRoot":"","sources":["../../../src/components/copilot-provider/CopilotKit.vue"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA4B/C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe,0SAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/copilot-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CopilotKitProviderProps } from "../../v2/providers/CopilotKitProvider.types";
|
|
2
|
+
/**
|
|
3
|
+
* V1 CopilotKit component props.
|
|
4
|
+
*
|
|
5
|
+
* Extends the v2 CopilotKitProviderProps with legacy v1-specific fields.
|
|
6
|
+
*/
|
|
7
|
+
export interface CopilotKitProps extends CopilotKitProviderProps {
|
|
8
|
+
/**
|
|
9
|
+
* Your Copilot Cloud API key.
|
|
10
|
+
* @deprecated Use publicLicenseKey with the v2 CopilotKitProvider instead.
|
|
11
|
+
*/
|
|
12
|
+
publicApiKey?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Your public license key for accessing premium CopilotKit features.
|
|
15
|
+
*/
|
|
16
|
+
publicLicenseKey?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The endpoint for the Copilot Runtime instance.
|
|
19
|
+
*/
|
|
20
|
+
runtimeUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/copilot-provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAE3F;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,uBAAuB;IAC9D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useCopilotAction } from "./use-copilot-action";
|
|
2
|
+
export type { FrontendAction, CatchAllFrontendAction, } from "./use-copilot-action";
|
|
3
|
+
export { useFrontendTool } from "./use-frontend-tool";
|
|
4
|
+
export type { UseFrontendToolArgs } from "./use-frontend-tool";
|
|
5
|
+
export { useCopilotReadable } from "./use-copilot-readable";
|
|
6
|
+
export type { UseCopilotReadableOptions } from "./use-copilot-readable";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EACV,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 compatibility wrapper for useCopilotAction.
|
|
3
|
+
*
|
|
4
|
+
* Accepts the legacy Parameter[] action format and routes to the appropriate
|
|
5
|
+
* v2 composable (useFrontendTool, useHumanInTheLoop, or useRenderTool).
|
|
6
|
+
*/
|
|
7
|
+
import type { WatchSource } from "vue";
|
|
8
|
+
import type { Parameter, MappedParameterTypes } from "@copilotkit/shared";
|
|
9
|
+
import type { VueFrontendTool } from "../v2/types";
|
|
10
|
+
export interface FrontendAction<T extends Parameter[] | [] = []> {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
parameters?: T;
|
|
14
|
+
handler?: (args: MappedParameterTypes<T>) => unknown | Promise<unknown>;
|
|
15
|
+
followUp?: boolean;
|
|
16
|
+
available?: "disabled" | "enabled" | "remote" | "frontend";
|
|
17
|
+
render?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
18
|
+
renderAndWaitForResponse?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
19
|
+
renderAndWait?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
20
|
+
agentId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CatchAllFrontendAction {
|
|
23
|
+
name: "*";
|
|
24
|
+
render: (props: unknown) => unknown;
|
|
25
|
+
}
|
|
26
|
+
export declare function useCopilotAction<const T extends Parameter[] | [] = []>(action: FrontendAction<T> | CatchAllFrontendAction, deps?: WatchSource<unknown>[]): void;
|
|
27
|
+
//# sourceMappingURL=use-copilot-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-copilot-action.d.ts","sourceRoot":"","sources":["../../src/hooks/use-copilot-action.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAK1E,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,aAAa,CAAC;AAiBtE,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC3D,MAAM,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,wBAAwB,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9E,aAAa,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACrC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,EACpE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,sBAAsB,EAClD,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,GAC5B,IAAI,CAqHN"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 compatibility wrapper for useCopilotReadable.
|
|
3
|
+
*
|
|
4
|
+
* Provides app-state and other information to the Copilot context.
|
|
5
|
+
* Delegates directly to the v2 CopilotKitCoreVue instance.
|
|
6
|
+
*/
|
|
7
|
+
import { type Ref } from "vue";
|
|
8
|
+
import type { WatchSource } from "vue";
|
|
9
|
+
export interface UseCopilotReadableOptions {
|
|
10
|
+
/** The description of the information to be added to the Copilot context. */
|
|
11
|
+
description: string;
|
|
12
|
+
/** The value to be added to the Copilot context. Object values are automatically stringified. */
|
|
13
|
+
value: unknown;
|
|
14
|
+
/** Whether the context is available to the Copilot. */
|
|
15
|
+
available?: "enabled" | "disabled";
|
|
16
|
+
/** Custom conversion function to serialize the value to a string. */
|
|
17
|
+
convert?: (description: string, value: unknown) => string;
|
|
18
|
+
}
|
|
19
|
+
export declare function useCopilotReadable(options: UseCopilotReadableOptions, deps?: WatchSource<unknown>[]): Ref<string | undefined>;
|
|
20
|
+
//# sourceMappingURL=use-copilot-readable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-copilot-readable.d.ts","sourceRoot":"","sources":["../../src/hooks/use-copilot-readable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAc,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAGvC,MAAM,WAAW,yBAAyB;IACxC,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,iGAAiG;IACjG,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACnC,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CAC3D;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,yBAAyB,EAClC,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,GAC5B,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAkDzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 compatibility wrapper for useFrontendTool.
|
|
3
|
+
*
|
|
4
|
+
* Accepts the legacy Parameter[] format and converts to Zod via getZodParameters,
|
|
5
|
+
* then delegates to the v2 composable.
|
|
6
|
+
*/
|
|
7
|
+
import type { WatchSource } from "vue";
|
|
8
|
+
import { type Parameter, type MappedParameterTypes } from "@copilotkit/shared";
|
|
9
|
+
import type { VueFrontendTool } from "../v2/types";
|
|
10
|
+
export interface UseFrontendToolArgs<T extends Parameter[] | [] = []> {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
parameters?: T;
|
|
14
|
+
handler?: (args: MappedParameterTypes<T>) => unknown | Promise<unknown>;
|
|
15
|
+
followUp?: boolean;
|
|
16
|
+
available?: "disabled" | "enabled";
|
|
17
|
+
render?: VueFrontendTool<MappedParameterTypes<T>>["render"];
|
|
18
|
+
agentId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function useFrontendTool<const T extends Parameter[] = []>(tool: UseFrontendToolArgs<T>, deps?: WatchSource<unknown>[]): void;
|
|
21
|
+
//# sourceMappingURL=use-frontend-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-frontend-tool.d.ts","sourceRoot":"","sources":["../../src/hooks/use-frontend-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,oBAAoB,EAG1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,EAC9D,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC5B,IAAI,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,QA8C9B"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@copilotkit/core"),A=require("@ag-ui/client"),e=require("./use-render-activity-message-BRL1Rpl-.cjs"),a=require("vue"),C=require("@copilotkit/shared");function m(n){return typeof n!="function"?n:(o=>{const r=typeof o.result=="string"?{...o,result:C.parseJson(o.result,o.result)}:o;return n(r)})}function _(n,o){const r="parameters"in n?C.getZodParameters(n.parameters):void 0;if(n.name==="*"){e.useRenderTool({name:"*",render:m(n.render),..."agentId"in n?{agentId:n.agentId}:{}},o);return}const t=n;if("renderAndWaitForResponse"in t||"renderAndWait"in t){const l=t.render??t.renderAndWaitForResponse??t.renderAndWait;if(!l){console.warn(`[CopilotKit] useCopilotAction: HITL action '${t.name}' has no render function. Skipping.`);return}e.useHumanInTheLoop({name:t.name,description:t.description,parameters:r,render:m(l),agentId:t.agentId},o);return}if(t.available==="frontend"||t.available==="disabled"){t.render&&r?e.useRenderTool({name:t.name,parameters:r,render:m(t.render),agentId:t.agentId},o):console.warn(`[CopilotKit] useCopilotAction: action '${t.name}' with available="${t.available}" requires both 'render' and 'parameters'. Skipping registration.`);return}const c=t.handler?l=>Promise.resolve(t.handler(l)):void 0;let s;t.available==="remote"?s=!1:t.available!==void 0&&(s=!0),e.useFrontendTool({name:t.name,description:t.description,parameters:r,handler:c,followUp:t.followUp,render:m(t.render),available:s,agentId:t.agentId},o)}function b(n,o){const{name:r,description:t,parameters:c,handler:s,followUp:l,available:f,render:u,agentId:d}=n,p=C.getZodParameters(c),g=s?i=>Promise.resolve(s(i)):void 0,v=typeof u=="function"?(i=>{const h=typeof i.result=="string"?{...i,result:C.parseJson(i.result,i.result)}:i;return u(h)}):u;e.useFrontendTool({name:r,description:t,parameters:p,handler:g,followUp:l,render:v,available:f===void 0?void 0:f!=="disabled",agentId:d},o)}function I(n,o){const{copilotkit:r}=e.useCopilotKit(),t=a.ref(void 0),c=o??[];return a.watch([()=>n.description,()=>n.value,()=>n.convert,()=>n.available,...c],(s,l,f)=>{const u=r.value;if(!u)return;const{description:d,value:p,convert:g,available:v}=n;let i;try{i=g?g(d,p):JSON.stringify(p)}catch(h){console.warn(`[CopilotKit] useCopilotReadable: failed to serialize value for "${d}":`,h),i=String(p)}v!=="disabled"&&(t.value=u.addContext({description:d,value:i}),f(()=>{t.value&&u.removeContext(t.value)}))},{immediate:!0}),t}const R=a.defineComponent({__name:"CopilotKit",props:{publicApiKey:{},publicLicenseKey:{},runtimeUrl:{},headers:{type:[Object,Function]},credentials:{},defaultThrottleMs:{},licenseToken:{},properties:{},useSingleEndpoint:{type:Boolean},agents__unsafe_dev_only:{},selfManagedAgents:{},renderToolCalls:{},renderActivityMessages:{},renderCustomMessages:{},frontendTools:{},humanInTheLoop:{},openGenerativeUI:{},showDevConsole:{type:[Boolean,String]},onError:{type:Function},a2ui:{},inspectorDefaultAnchor:{},debug:{type:[Boolean,Object]}},setup(n){const o=n;return(r,t)=>(a.openBlock(),a.createBlock(e._sfc_main$15,a.normalizeProps(a.guardReactiveProps(o)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16))}});exports.A2UIActivityContentSchema=e.A2UIActivityContentSchema;exports.A2UISurfaceActivityRenderer=e._sfc_main;exports.A2UISurfaceActivityType=e.A2UISurfaceActivityType;exports.CopilotChat=e.CopilotChat;exports.CopilotChatAssistantMessage=e._sfc_main$1;exports.CopilotChatAttachmentQueue=e._sfc_main$2;exports.CopilotChatAttachmentRenderer=e._sfc_main$3;exports.CopilotChatAudioRecorder=e._sfc_main$4;exports.CopilotChatConfigurationProvider=e._sfc_main$5;exports.CopilotChatDefaultLabels=e.CopilotChatDefaultLabels;exports.CopilotChatInput=e._sfc_main$6;exports.CopilotChatMessageView=e._sfc_main$7;exports.CopilotChatReasoningMessage=e._sfc_main$8;exports.CopilotChatSuggestionPill=e._sfc_main$9;exports.CopilotChatSuggestionView=e._sfc_main$10;exports.CopilotChatToggleButton=e.CopilotChatToggleButton;exports.CopilotChatToggleButtonCloseIcon=e.CopilotChatToggleButtonCloseIcon;exports.CopilotChatToggleButtonOpenIcon=e.CopilotChatToggleButtonOpenIcon;exports.CopilotChatToolCallsView=e._sfc_main$11;exports.CopilotChatUserMessage=e._sfc_main$12;exports.CopilotChatView=e._sfc_main$13;exports.CopilotKitCoreVue=e.CopilotKitCoreVue;exports.CopilotKitInspector=e._sfc_main$14;exports.CopilotKitProvider=e._sfc_main$15;exports.CopilotModalHeader=e.CopilotModalHeader;exports.CopilotPopup=e._sfc_main$16;exports.CopilotPopupView=e.CopilotPopupView;exports.CopilotSidebar=e._sfc_main$17;exports.CopilotSidebarView=e.CopilotSidebarView;exports.GenerateSandboxedUiArgsSchema=e.GenerateSandboxedUiArgsSchema;exports.LicenseContextKey=e.LicenseContextKey;exports.MCPAppsActivityContentSchema=e.MCPAppsActivityContentSchema;exports.MCPAppsActivityRenderer=e.MCPAppsActivityRenderer;exports.MCPAppsActivityType=e.MCPAppsActivityType;exports.OpenGenerativeUIActivityRenderer=e.OpenGenerativeUIActivityRenderer;exports.OpenGenerativeUIActivityType=e.OpenGenerativeUIActivityType;exports.OpenGenerativeUIContentSchema=e.OpenGenerativeUIContentSchema;exports.OpenGenerativeUIRenderer=e.OpenGenerativeUIRenderer;exports.OpenGenerativeUIToolRenderer=e.OpenGenerativeUIToolRenderer;exports.UseAgentUpdate=e.UseAgentUpdate;exports.createA2UIMessageRenderer=e.createA2UIMessageRenderer;exports.createDefaultLicenseRef=e.createDefaultLicenseRef;exports.defineToolCallRenderer=e.defineToolCallRenderer;exports.extractCompleteStyles=e.extractCompleteStyles;exports.getOperationSurfaceId=e.getOperationSurfaceId;exports.processPartialHtml=e.processPartialHtml;exports.useAgent=e.useAgent;exports.useAgentContext=e.useAgentContext;exports.useAttachments=e.useAttachments;exports.useCapabilities=e.useCapabilities;exports.useComponent=e.useComponent;exports.useConfigureSuggestions=e.useConfigureSuggestions;exports.useCopilotChatConfiguration=e.useCopilotChatConfiguration;exports.useCopilotKit=e.useCopilotKit;exports.useDefaultRenderTool=e.useDefaultRenderTool;exports.useHumanInTheLoop=e.useHumanInTheLoop;exports.useInterrupt=e.useInterrupt;exports.useKatexStyles=e.useKatexStyles;exports.useKeyboardHeight=e.useKeyboardHeight;exports.useLicenseContext=e.useLicenseContext;exports.useRenderActivityMessage=e.useRenderActivityMessage;exports.useRenderCustomMessages=e.useRenderCustomMessages;exports.useRenderTool=e.useRenderTool;exports.useSandboxFunctions=e.useSandboxFunctions;exports.useSuggestions=e.useSuggestions;exports.useThreads=e.useThreads;Object.defineProperty(exports,"createLicenseContextValue",{enumerable:!0,get:()=>C.createLicenseContextValue});exports.CopilotKit=R;exports.useCopilotAction=_;exports.useCopilotReadable=I;exports.useFrontendTool=b;Object.keys(y).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>y[n]})});Object.keys(A).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>A[n]})});
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/hooks/use-copilot-action.ts","../src/hooks/use-frontend-tool.ts","../src/hooks/use-copilot-readable.ts","../src/components/copilot-provider/CopilotKit.vue"],"sourcesContent":["/**\n * V1 compatibility wrapper for useCopilotAction.\n *\n * Accepts the legacy Parameter[] action format and routes to the appropriate\n * v2 composable (useFrontendTool, useHumanInTheLoop, or useRenderTool).\n */\nimport type { WatchSource } from \"vue\";\nimport type { Parameter, MappedParameterTypes } from \"@copilotkit/shared\";\nimport { getZodParameters, parseJson } from \"@copilotkit/shared\";\nimport { useFrontendTool as useFrontendToolV2 } from \"../v2/hooks/use-frontend-tool\";\nimport { useHumanInTheLoop as useHumanInTheLoopV2 } from \"../v2/hooks/use-human-in-the-loop\";\nimport { useRenderTool as useRenderToolV2 } from \"../v2/hooks/use-render-tool\";\nimport type { VueFrontendTool, VueHumanInTheLoop } from \"../v2/types\";\n\n// Wraps a v1 render function so a JSON-string `result` is parsed before being\n// passed through. Mirrors the v1 React behavior. If render is a Component\n// (object) rather than a function, returns it unchanged — Components receive\n// props through Vue's prop system and the user is responsible for parsing.\nfunction wrapRenderWithJsonResult<R>(render: R): R {\n if (typeof render !== \"function\") return render;\n return ((props: { result?: unknown }) => {\n const next =\n typeof props.result === \"string\"\n ? { ...props, result: parseJson(props.result, props.result) }\n : props;\n return (render as (p: unknown) => unknown)(next);\n }) as R;\n}\n\nexport interface FrontendAction<T extends Parameter[] | [] = []> {\n name: string;\n description?: string;\n parameters?: T;\n handler?: (args: MappedParameterTypes<T>) => unknown | Promise<unknown>;\n followUp?: boolean;\n available?: \"disabled\" | \"enabled\" | \"remote\" | \"frontend\";\n render?: VueFrontendTool<MappedParameterTypes<T>>[\"render\"];\n renderAndWaitForResponse?: VueFrontendTool<MappedParameterTypes<T>>[\"render\"];\n renderAndWait?: VueFrontendTool<MappedParameterTypes<T>>[\"render\"];\n agentId?: string;\n}\n\nexport interface CatchAllFrontendAction {\n name: \"*\";\n render: (props: unknown) => unknown;\n}\n\nexport function useCopilotAction<const T extends Parameter[] | [] = []>(\n action: FrontendAction<T> | CatchAllFrontendAction,\n deps?: WatchSource<unknown>[],\n): void {\n const zodParameters =\n \"parameters\" in action\n ? getZodParameters(action.parameters as T)\n : undefined;\n\n // Catch-all render action\n if (action.name === \"*\") {\n useRenderToolV2(\n {\n name: \"*\",\n render: wrapRenderWithJsonResult(\n (action as CatchAllFrontendAction).render,\n ),\n ...(\"agentId\" in action\n ? { agentId: (action as FrontendAction<T>).agentId }\n : {}),\n },\n deps,\n );\n return;\n }\n\n const typedAction = action as FrontendAction<T>;\n\n // Human-in-the-loop: has renderAndWaitForResponse or renderAndWait\n if (\n \"renderAndWaitForResponse\" in typedAction ||\n \"renderAndWait\" in typedAction\n ) {\n const render =\n typedAction.render ??\n typedAction.renderAndWaitForResponse ??\n typedAction.renderAndWait;\n\n if (!render) {\n console.warn(\n `[CopilotKit] useCopilotAction: HITL action '${typedAction.name}' ` +\n `has no render function. Skipping.`,\n );\n return;\n }\n\n useHumanInTheLoopV2<MappedParameterTypes<T>>(\n {\n name: typedAction.name,\n description: typedAction.description,\n parameters: zodParameters,\n render: wrapRenderWithJsonResult(render) as VueHumanInTheLoop<\n MappedParameterTypes<T>\n >[\"render\"],\n agentId: typedAction.agentId,\n },\n deps,\n );\n return;\n }\n\n // Render-only: available is \"frontend\" or \"disabled\" (no handler invoked remotely)\n if (\n typedAction.available === \"frontend\" ||\n typedAction.available === \"disabled\"\n ) {\n if (typedAction.render && zodParameters) {\n useRenderToolV2(\n {\n name: typedAction.name,\n parameters: zodParameters,\n render: wrapRenderWithJsonResult(\n typedAction.render as (props: unknown) => unknown,\n ),\n agentId: typedAction.agentId,\n },\n deps,\n );\n } else {\n console.warn(\n `[CopilotKit] useCopilotAction: action '${typedAction.name}' ` +\n `with available=\"${typedAction.available}\" requires both ` +\n `'render' and 'parameters'. Skipping registration.`,\n );\n }\n return;\n }\n\n // Default: frontend tool with handler\n // Wrap the v1 handler (single-arg) to match v2's (args, context) => Promise<unknown> signature\n const normalizedHandler = typedAction.handler\n ? (args: MappedParameterTypes<T>) =>\n Promise.resolve(typedAction.handler!(args))\n : undefined;\n\n // Convert v1 available (string enum) to v2 available (boolean)\n // At this point, \"frontend\" and \"disabled\" have been handled above,\n // so remaining values are \"enabled\", \"remote\", or undefined.\n // \"remote\" means server-only: register the tool but mark it as not\n // available on the frontend (matches React's ActionInputAvailability.Remote).\n let normalizedAvailable: boolean | undefined;\n if (typedAction.available === \"remote\") {\n normalizedAvailable = false;\n } else if (typedAction.available !== undefined) {\n normalizedAvailable = true;\n }\n\n useFrontendToolV2<MappedParameterTypes<T>>(\n {\n name: typedAction.name,\n description: typedAction.description,\n parameters: zodParameters,\n handler: normalizedHandler,\n followUp: typedAction.followUp,\n render: wrapRenderWithJsonResult(typedAction.render),\n available: normalizedAvailable,\n agentId: typedAction.agentId,\n },\n deps,\n );\n}\n","/**\n * V1 compatibility wrapper for useFrontendTool.\n *\n * Accepts the legacy Parameter[] format and converts to Zod via getZodParameters,\n * then delegates to the v2 composable.\n */\nimport type { WatchSource } from \"vue\";\nimport {\n type Parameter,\n type MappedParameterTypes,\n getZodParameters,\n parseJson,\n} from \"@copilotkit/shared\";\nimport { useFrontendTool as useFrontendToolV2 } from \"../v2/hooks/use-frontend-tool\";\nimport type { VueFrontendTool } from \"../v2/types\";\n\nexport interface UseFrontendToolArgs<T extends Parameter[] | [] = []> {\n name: string;\n description?: string;\n parameters?: T;\n handler?: (args: MappedParameterTypes<T>) => unknown | Promise<unknown>;\n followUp?: boolean;\n available?: \"disabled\" | \"enabled\";\n render?: VueFrontendTool<MappedParameterTypes<T>>[\"render\"];\n agentId?: string;\n}\n\nexport function useFrontendTool<const T extends Parameter[] = []>(\n tool: UseFrontendToolArgs<T>,\n deps?: WatchSource<unknown>[],\n) {\n const {\n name,\n description,\n parameters,\n handler,\n followUp,\n available,\n render,\n agentId,\n } = tool;\n const zodParameters = getZodParameters(parameters);\n\n // Wrap the v1 handler (single-arg) to match v2's (args, context) => Promise<unknown> signature\n const normalizedHandler = handler\n ? (args: MappedParameterTypes<T>) => Promise.resolve(handler(args))\n : undefined;\n\n // Wrap render to parse JSON-string results before passing them to the\n // user's render function — matches the v1 React behavior. If render is a\n // Component rather than a function, leave it unchanged.\n const normalizedRender =\n typeof render === \"function\"\n ? ((props: { result?: unknown }) => {\n const renderProps =\n typeof props.result === \"string\"\n ? { ...props, result: parseJson(props.result, props.result) }\n : props;\n return (render as (p: unknown) => unknown)(renderProps);\n })\n : render;\n\n useFrontendToolV2<MappedParameterTypes<T>>(\n {\n name,\n description,\n parameters: zodParameters,\n handler: normalizedHandler,\n followUp,\n render: normalizedRender,\n available: available === undefined ? undefined : available !== \"disabled\",\n agentId,\n },\n deps,\n );\n}\n","/**\n * V1 compatibility wrapper for useCopilotReadable.\n *\n * Provides app-state and other information to the Copilot context.\n * Delegates directly to the v2 CopilotKitCoreVue instance.\n */\nimport { watch, ref, type Ref } from \"vue\";\nimport type { WatchSource } from \"vue\";\nimport { useCopilotKit } from \"../v2/providers/useCopilotKit\";\n\nexport interface UseCopilotReadableOptions {\n /** The description of the information to be added to the Copilot context. */\n description: string;\n /** The value to be added to the Copilot context. Object values are automatically stringified. */\n value: unknown;\n /** Whether the context is available to the Copilot. */\n available?: \"enabled\" | \"disabled\";\n /** Custom conversion function to serialize the value to a string. */\n convert?: (description: string, value: unknown) => string;\n}\n\nexport function useCopilotReadable(\n options: UseCopilotReadableOptions,\n deps?: WatchSource<unknown>[],\n): Ref<string | undefined> {\n const { copilotkit } = useCopilotKit();\n const ctxIdRef = ref<string | undefined>(undefined);\n\n const extraDeps = deps ?? [];\n\n watch(\n [\n () => options.description,\n () => options.value,\n () => options.convert,\n () => options.available,\n ...extraDeps,\n ],\n (_newValues, _old, onCleanup) => {\n const core = copilotkit.value;\n if (!core) return;\n\n const { description, value, convert, available } = options;\n\n let serializedValue: string;\n try {\n serializedValue = convert\n ? convert(description, value)\n : JSON.stringify(value);\n } catch (err) {\n console.warn(\n `[CopilotKit] useCopilotReadable: failed to serialize ` +\n `value for \"${description}\":`,\n err,\n );\n serializedValue = String(value);\n }\n\n if (available === \"disabled\") return;\n\n ctxIdRef.value = core.addContext({\n description,\n value: serializedValue,\n });\n\n onCleanup(() => {\n if (!ctxIdRef.value) return;\n core.removeContext(ctxIdRef.value);\n });\n },\n { immediate: true },\n );\n\n return ctxIdRef;\n}\n","<script setup lang=\"ts\">\n/**\n * V1 compatibility wrapper for CopilotKitProvider.\n *\n * Accepts the same props as CopilotKitProvider plus legacy v1 props\n * (publicApiKey, publicLicenseKey) and delegates to the v2 provider.\n */\nimport type { CopilotKitProps } from \"./types\";\nimport CopilotKitProvider from \"../../v2/providers/CopilotKitProvider.vue\";\n\nconst props = defineProps<CopilotKitProps>();\n</script>\n\n<template>\n <CopilotKitProvider v-bind=\"props\">\n <slot />\n </CopilotKitProvider>\n</template>\n"],"names":["wrapRenderWithJsonResult","render","props","next","parseJson","useCopilotAction","action","deps","zodParameters","getZodParameters","useRenderToolV2","typedAction","useHumanInTheLoopV2","normalizedHandler","args","normalizedAvailable","useFrontendToolV2","useFrontendTool","tool","name","description","parameters","handler","followUp","available","agentId","normalizedRender","renderProps","useCopilotReadable","options","copilotkit","useCopilotKit","ctxIdRef","ref","extraDeps","watch","_newValues","_old","onCleanup","core","value","convert","serializedValue","err","__props","_openBlock","_createBlock","CopilotKitProvider","_renderSlot","_ctx"],"mappings":"wPAkBA,SAASA,EAA4BC,EAAc,CACjD,OAAI,OAAOA,GAAW,WAAmBA,GAChCC,GAAgC,CACvC,MAAMC,EACJ,OAAOD,EAAM,QAAW,SACpB,CAAE,GAAGA,EAAO,OAAQE,EAAAA,UAAUF,EAAM,OAAQA,EAAM,MAAM,GACxDA,EACN,OAAQD,EAAmCE,CAAI,CACjD,EACF,CAoBO,SAASE,EACdC,EACAC,EACM,CACN,MAAMC,EACJ,eAAgBF,EACZG,EAAAA,iBAAiBH,EAAO,UAAe,EACvC,OAGN,GAAIA,EAAO,OAAS,IAAK,CACvBI,EAAAA,cACE,CACE,KAAM,IACN,OAAQV,EACLM,EAAkC,MAAA,EAErC,GAAI,YAAaA,EACb,CAAE,QAAUA,EAA6B,OAAA,EACzC,CAAA,CAAC,EAEPC,CAAA,EAEF,MACF,CAEA,MAAMI,EAAcL,EAGpB,GACE,6BAA8BK,GAC9B,kBAAmBA,EACnB,CACA,MAAMV,EACJU,EAAY,QACZA,EAAY,0BACZA,EAAY,cAEd,GAAI,CAACV,EAAQ,CACX,QAAQ,KACN,+CAA+CU,EAAY,IAAI,qCAAA,EAGjE,MACF,CAEAC,EAAAA,kBACE,CACE,KAAMD,EAAY,KAClB,YAAaA,EAAY,YACzB,WAAYH,EACZ,OAAQR,EAAyBC,CAAM,EAGvC,QAASU,EAAY,OAAA,EAEvBJ,CAAA,EAEF,MACF,CAGA,GACEI,EAAY,YAAc,YAC1BA,EAAY,YAAc,WAC1B,CACIA,EAAY,QAAUH,EACxBE,EAAAA,cACE,CACE,KAAMC,EAAY,KAClB,WAAYH,EACZ,OAAQR,EACNW,EAAY,MAAA,EAEd,QAASA,EAAY,OAAA,EAEvBJ,CAAA,EAGF,QAAQ,KACN,0CAA0CI,EAAY,IAAI,qBACrCA,EAAY,SAAS,mEAAA,EAI9C,MACF,CAIA,MAAME,EAAoBF,EAAY,QACjCG,GACC,QAAQ,QAAQH,EAAY,QAASG,CAAI,CAAC,EAC5C,OAOJ,IAAIC,EACAJ,EAAY,YAAc,SAC5BI,EAAsB,GACbJ,EAAY,YAAc,SACnCI,EAAsB,IAGxBC,EAAAA,gBACE,CACE,KAAML,EAAY,KAClB,YAAaA,EAAY,YACzB,WAAYH,EACZ,QAASK,EACT,SAAUF,EAAY,SACtB,OAAQX,EAAyBW,EAAY,MAAM,EACnD,UAAWI,EACX,QAASJ,EAAY,OAAA,EAEvBJ,CAAA,CAEJ,CC5IO,SAASU,EACdC,EACAX,EACA,CACA,KAAM,CACJ,KAAAY,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,OAAAvB,EACA,QAAAwB,CAAA,EACEP,EACEV,EAAgBC,EAAAA,iBAAiBY,CAAU,EAG3CR,EAAoBS,EACrBR,GAAkC,QAAQ,QAAQQ,EAAQR,CAAI,CAAC,EAChE,OAKEY,EACJ,OAAOzB,GAAW,YACZC,GAAgC,CAChC,MAAMyB,EACJ,OAAOzB,EAAM,QAAW,SACpB,CAAE,GAAGA,EAAO,OAAQE,EAAAA,UAAUF,EAAM,OAAQA,EAAM,MAAM,GACxDA,EACN,OAAQD,EAAmC0B,CAAW,CACxD,GACA1B,EAENe,EAAAA,gBACE,CACE,KAAAG,EACA,YAAAC,EACA,WAAYZ,EACZ,QAASK,EACT,SAAAU,EACA,OAAQG,EACR,UAAWF,IAAc,OAAY,OAAYA,IAAc,WAC/D,QAAAC,CAAA,EAEFlB,CAAA,CAEJ,CCtDO,SAASqB,EACdC,EACAtB,EACyB,CACzB,KAAM,CAAE,WAAAuB,CAAA,EAAeC,gBAAA,EACjBC,EAAWC,EAAAA,IAAwB,MAAS,EAE5CC,EAAY3B,GAAQ,CAAA,EAE1B4B,OAAAA,EAAAA,MACE,CACE,IAAMN,EAAQ,YACd,IAAMA,EAAQ,MACd,IAAMA,EAAQ,QACd,IAAMA,EAAQ,UACd,GAAGK,CAAA,EAEL,CAACE,EAAYC,EAAMC,IAAc,CAC/B,MAAMC,EAAOT,EAAW,MACxB,GAAI,CAACS,EAAM,OAEX,KAAM,CAAE,YAAAnB,EAAa,MAAAoB,EAAO,QAAAC,EAAS,UAAAjB,GAAcK,EAEnD,IAAIa,EACJ,GAAI,CACFA,EAAkBD,EACdA,EAAQrB,EAAaoB,CAAK,EAC1B,KAAK,UAAUA,CAAK,CAC1B,OAASG,EAAK,CACZ,QAAQ,KACN,mEACgBvB,CAAW,KAC3BuB,CAAA,EAEFD,EAAkB,OAAOF,CAAK,CAChC,CAEIhB,IAAc,aAElBQ,EAAS,MAAQO,EAAK,WAAW,CAC/B,YAAAnB,EACA,MAAOsB,CAAA,CACR,EAEDJ,EAAU,IAAM,CACTN,EAAS,OACdO,EAAK,cAAcP,EAAS,KAAK,CACnC,CAAC,EACH,EACA,CAAE,UAAW,EAAA,CAAK,EAGbA,CACT,kiBChEA,MAAM9B,EAAQ0C,gBAIZC,EAAAA,UAAA,EAAAC,cAEqBC,EAAAA,mDAFO7C,CAAK,CAAA,EAAA,mBAC/B,IAAQ,CAAR8C,aAAQC,EAAA,OAAA,SAAA,CAAA"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./v2";
|
|
2
|
+
export { useCopilotAction } from "./hooks";
|
|
3
|
+
export type { FrontendAction, CatchAllFrontendAction } from "./hooks";
|
|
4
|
+
export { useFrontendTool } from "./hooks";
|
|
5
|
+
export type { UseFrontendToolArgs } from "./hooks";
|
|
6
|
+
export { useCopilotReadable } from "./hooks";
|
|
7
|
+
export type { UseCopilotReadableOptions } from "./hooks";
|
|
8
|
+
export { CopilotKit } from "./components/copilot-provider";
|
|
9
|
+
export type { CopilotKitProps } from "./components/copilot-provider";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./v2";
|
|
2
|
+
export { useCopilotAction } from "./hooks";
|
|
3
|
+
export type { FrontendAction, CatchAllFrontendAction } from "./hooks";
|
|
4
|
+
export { useFrontendTool } from "./hooks";
|
|
5
|
+
export type { UseFrontendToolArgs } from "./hooks";
|
|
6
|
+
export { useCopilotReadable } from "./hooks";
|
|
7
|
+
export type { UseCopilotReadableOptions } from "./hooks";
|
|
8
|
+
export { CopilotKit } from "./components/copilot-provider";
|
|
9
|
+
export type { CopilotKitProps } from "./components/copilot-provider";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./v2";
|
|
2
|
+
export { useCopilotAction } from "./hooks";
|
|
3
|
+
export type { FrontendAction, CatchAllFrontendAction } from "./hooks";
|
|
4
|
+
export { useFrontendTool } from "./hooks";
|
|
5
|
+
export type { UseFrontendToolArgs } from "./hooks";
|
|
6
|
+
export { useCopilotReadable } from "./hooks";
|
|
7
|
+
export type { UseCopilotReadableOptions } from "./hooks";
|
|
8
|
+
export { CopilotKit } from "./components/copilot-provider";
|
|
9
|
+
export type { CopilotKitProps } from "./components/copilot-provider";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
|