@copilotkitnext/react 0.0.22-alpha.1 → 0.0.22-alpha.3
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/dist/chunk-32YJ5VJ4.mjs +157 -0
- package/dist/chunk-32YJ5VJ4.mjs.map +1 -0
- package/dist/chunk-36HFWACS.mjs +1 -0
- package/dist/chunk-36HFWACS.mjs.map +1 -0
- package/dist/chunk-3TA5QBSZ.mjs +122 -0
- package/dist/chunk-3TA5QBSZ.mjs.map +1 -0
- package/dist/chunk-46BZRXWT.mjs +16 -0
- package/dist/chunk-46BZRXWT.mjs.map +1 -0
- package/dist/chunk-4UDBR75C.mjs +106 -0
- package/dist/chunk-4UDBR75C.mjs.map +1 -0
- package/dist/chunk-4XJK5IVQ.mjs +83 -0
- package/dist/chunk-4XJK5IVQ.mjs.map +1 -0
- package/dist/chunk-5AAT4Z3C.mjs +107 -0
- package/dist/chunk-5AAT4Z3C.mjs.map +1 -0
- package/dist/chunk-5JNWVLQI.mjs +72 -0
- package/dist/chunk-5JNWVLQI.mjs.map +1 -0
- package/dist/chunk-5SC3CO5Q.mjs +69 -0
- package/dist/chunk-5SC3CO5Q.mjs.map +1 -0
- package/dist/chunk-6VUKDHOD.mjs +1 -0
- package/dist/chunk-6VUKDHOD.mjs.map +1 -0
- package/dist/chunk-AEFM73CL.mjs +32 -0
- package/dist/chunk-AEFM73CL.mjs.map +1 -0
- package/dist/chunk-AI3Z3CHN.mjs +97 -0
- package/dist/chunk-AI3Z3CHN.mjs.map +1 -0
- package/dist/chunk-AXFRCGH6.mjs +107 -0
- package/dist/chunk-AXFRCGH6.mjs.map +1 -0
- package/dist/chunk-BT6C5OPU.mjs +278 -0
- package/dist/chunk-BT6C5OPU.mjs.map +1 -0
- package/dist/chunk-CGLGXQAU.mjs +78 -0
- package/dist/chunk-CGLGXQAU.mjs.map +1 -0
- package/dist/chunk-CSHBUHRW.mjs +69 -0
- package/dist/chunk-CSHBUHRW.mjs.map +1 -0
- package/dist/chunk-CZ3GI3IF.mjs +283 -0
- package/dist/chunk-CZ3GI3IF.mjs.map +1 -0
- package/dist/chunk-DVUQO72Z.mjs +1 -0
- package/dist/chunk-DVUQO72Z.mjs.map +1 -0
- package/dist/chunk-E4HD4M7R.mjs +76 -0
- package/dist/chunk-E4HD4M7R.mjs.map +1 -0
- package/dist/chunk-E56GYBP3.mjs +101 -0
- package/dist/chunk-E56GYBP3.mjs.map +1 -0
- package/dist/chunk-EJ5ZEAAN.mjs +57 -0
- package/dist/chunk-EJ5ZEAAN.mjs.map +1 -0
- package/dist/chunk-ETWJDCGE.mjs +1 -0
- package/dist/chunk-ETWJDCGE.mjs.map +1 -0
- package/dist/chunk-F43IPGPA.mjs +311 -0
- package/dist/chunk-F43IPGPA.mjs.map +1 -0
- package/dist/chunk-FIBK3DYE.mjs +26 -0
- package/dist/chunk-FIBK3DYE.mjs.map +1 -0
- package/dist/chunk-FVURPXQK.mjs +45 -0
- package/dist/chunk-FVURPXQK.mjs.map +1 -0
- package/dist/chunk-FZR2XQKR.mjs +44 -0
- package/dist/chunk-FZR2XQKR.mjs.map +1 -0
- package/dist/chunk-IA4CLXDM.mjs +76 -0
- package/dist/chunk-IA4CLXDM.mjs.map +1 -0
- package/dist/chunk-IH5VFJ4L.mjs +60 -0
- package/dist/chunk-IH5VFJ4L.mjs.map +1 -0
- package/dist/chunk-IICUCI5S.mjs +43 -0
- package/dist/chunk-IICUCI5S.mjs.map +1 -0
- package/dist/chunk-JLVGSNAO.mjs +311 -0
- package/dist/chunk-JLVGSNAO.mjs.map +1 -0
- package/dist/chunk-JWOIINVV.mjs +237 -0
- package/dist/chunk-JWOIINVV.mjs.map +1 -0
- package/dist/chunk-KCVDFZJX.mjs +873 -0
- package/dist/chunk-KCVDFZJX.mjs.map +1 -0
- package/dist/chunk-KPRUSQ3K.mjs +1 -0
- package/dist/chunk-KPRUSQ3K.mjs.map +1 -0
- package/dist/chunk-MWC5OV7Z.mjs +1 -0
- package/dist/chunk-MWC5OV7Z.mjs.map +1 -0
- package/dist/chunk-N5EP5OD5.mjs +1 -0
- package/dist/chunk-N5EP5OD5.mjs.map +1 -0
- package/dist/chunk-NASFZS3N.mjs +43 -0
- package/dist/chunk-NASFZS3N.mjs.map +1 -0
- package/dist/chunk-NB2GZAKG.mjs +131 -0
- package/dist/chunk-NB2GZAKG.mjs.map +1 -0
- package/dist/chunk-NB4DFAZH.mjs +185 -0
- package/dist/chunk-NB4DFAZH.mjs.map +1 -0
- package/dist/chunk-NNAYEAP2.mjs +49 -0
- package/dist/chunk-NNAYEAP2.mjs.map +1 -0
- package/dist/chunk-NNPKBGD6.mjs +37 -0
- package/dist/chunk-NNPKBGD6.mjs.map +1 -0
- package/dist/chunk-OMPVTGXH.mjs +122 -0
- package/dist/chunk-OMPVTGXH.mjs.map +1 -0
- package/dist/chunk-QFBM3ZT2.mjs +45 -0
- package/dist/chunk-QFBM3ZT2.mjs.map +1 -0
- package/dist/chunk-QJ6DZ645.mjs +78 -0
- package/dist/chunk-QJ6DZ645.mjs.map +1 -0
- package/dist/chunk-R5OLAA3L.mjs +135 -0
- package/dist/chunk-R5OLAA3L.mjs.map +1 -0
- package/dist/chunk-RF2CGPHQ.mjs +215 -0
- package/dist/chunk-RF2CGPHQ.mjs.map +1 -0
- package/dist/chunk-RGD2L3Z4.mjs +96 -0
- package/dist/chunk-RGD2L3Z4.mjs.map +1 -0
- package/dist/chunk-RK5P2LG6.mjs +57 -0
- package/dist/chunk-RK5P2LG6.mjs.map +1 -0
- package/dist/chunk-RRXDJCXI.mjs +60 -0
- package/dist/chunk-RRXDJCXI.mjs.map +1 -0
- package/dist/chunk-SPDE34WC.mjs +283 -0
- package/dist/chunk-SPDE34WC.mjs.map +1 -0
- package/dist/chunk-TAUOEJH2.mjs +120 -0
- package/dist/chunk-TAUOEJH2.mjs.map +1 -0
- package/dist/chunk-TKFOXPXF.mjs +157 -0
- package/dist/chunk-TKFOXPXF.mjs.map +1 -0
- package/dist/chunk-UOX5D73C.mjs +22 -0
- package/dist/chunk-UOX5D73C.mjs.map +1 -0
- package/dist/chunk-US4KNAAV.mjs +1 -0
- package/dist/chunk-US4KNAAV.mjs.map +1 -0
- package/dist/chunk-UZB3CTOY.mjs +873 -0
- package/dist/chunk-UZB3CTOY.mjs.map +1 -0
- package/dist/chunk-VBI6JXPC.mjs +1 -0
- package/dist/chunk-VBI6JXPC.mjs.map +1 -0
- package/dist/chunk-VE3SBLU7.mjs +215 -0
- package/dist/chunk-VE3SBLU7.mjs.map +1 -0
- package/dist/chunk-VUHFLJWI.mjs +185 -0
- package/dist/chunk-VUHFLJWI.mjs.map +1 -0
- package/dist/chunk-VVAXSF3M.mjs +61 -0
- package/dist/chunk-VVAXSF3M.mjs.map +1 -0
- package/dist/chunk-W5DUKRCI.mjs +97 -0
- package/dist/chunk-W5DUKRCI.mjs.map +1 -0
- package/dist/chunk-WNRDFAZ5.mjs +22 -0
- package/dist/chunk-WNRDFAZ5.mjs.map +1 -0
- package/dist/chunk-XO4IRKSC.mjs +11 -0
- package/dist/chunk-XO4IRKSC.mjs.map +1 -0
- package/dist/chunk-XU5CEPYQ.mjs +75 -0
- package/dist/chunk-XU5CEPYQ.mjs.map +1 -0
- package/dist/chunk-YPH4BHOY.mjs +39 -0
- package/dist/chunk-YPH4BHOY.mjs.map +1 -0
- package/dist/chunk-YVPPF62K.mjs +32 -0
- package/dist/chunk-YVPPF62K.mjs.map +1 -0
- package/dist/chunk-YZUPVMHC.mjs +1 -0
- package/dist/chunk-YZUPVMHC.mjs.map +1 -0
- package/dist/chunk-Z3OIGQCZ.mjs +75 -0
- package/dist/chunk-Z3OIGQCZ.mjs.map +1 -0
- package/dist/chunk-ZIDT52TM.mjs +131 -0
- package/dist/chunk-ZIDT52TM.mjs.map +1 -0
- package/dist/components/CopilotKitInspector.d.mts +13 -0
- package/dist/components/CopilotKitInspector.d.ts +13 -0
- package/dist/components/CopilotKitInspector.js +69 -0
- package/dist/components/CopilotKitInspector.js.map +1 -0
- package/dist/components/CopilotKitInspector.mjs +7 -0
- package/dist/components/CopilotKitInspector.mjs.map +1 -0
- package/dist/components/WildcardToolCallRender.d.mts +7 -0
- package/dist/components/WildcardToolCallRender.d.ts +7 -0
- package/dist/components/WildcardToolCallRender.js +106 -0
- package/dist/components/WildcardToolCallRender.js.map +1 -0
- package/dist/components/WildcardToolCallRender.mjs +8 -0
- package/dist/components/WildcardToolCallRender.mjs.map +1 -0
- package/dist/components/chat/CopilotChat.d.mts +30 -0
- package/dist/components/chat/CopilotChat.d.ts +30 -0
- package/dist/components/chat/CopilotChat.js +2934 -0
- package/dist/components/chat/CopilotChat.js.map +1 -0
- package/dist/components/chat/CopilotChat.mjs +37 -0
- package/dist/components/chat/CopilotChat.mjs.map +1 -0
- package/dist/components/chat/CopilotChatAssistantMessage.d.mts +45 -0
- package/dist/components/chat/CopilotChatAssistantMessage.d.ts +45 -0
- package/dist/components/chat/CopilotChatAssistantMessage.js +735 -0
- package/dist/components/chat/CopilotChatAssistantMessage.js.map +1 -0
- package/dist/components/chat/CopilotChatAssistantMessage.mjs +29 -0
- package/dist/components/chat/CopilotChatAssistantMessage.mjs.map +1 -0
- package/dist/components/chat/CopilotChatAudioRecorder.d.mts +11 -0
- package/dist/components/chat/CopilotChatAudioRecorder.d.ts +11 -0
- package/dist/components/chat/CopilotChatAudioRecorder.js +131 -0
- package/dist/components/chat/CopilotChatAudioRecorder.js.map +1 -0
- package/dist/components/chat/CopilotChatAudioRecorder.mjs +9 -0
- package/dist/components/chat/CopilotChatAudioRecorder.mjs.map +1 -0
- package/dist/components/chat/CopilotChatInput.d.mts +67 -0
- package/dist/components/chat/CopilotChatInput.d.ts +67 -0
- package/dist/components/chat/CopilotChatInput.js +1305 -0
- package/dist/components/chat/CopilotChatInput.js.map +1 -0
- package/dist/components/chat/CopilotChatInput.mjs +16 -0
- package/dist/components/chat/CopilotChatInput.mjs.map +1 -0
- package/dist/components/chat/CopilotChatMessageView.d.mts +29 -0
- package/dist/components/chat/CopilotChatMessageView.d.ts +29 -0
- package/dist/components/chat/CopilotChatMessageView.js +1164 -0
- package/dist/components/chat/CopilotChatMessageView.js.map +1 -0
- package/dist/components/chat/CopilotChatMessageView.mjs +31 -0
- package/dist/components/chat/CopilotChatMessageView.mjs.map +1 -0
- package/dist/components/chat/CopilotChatSuggestionPill.d.mts +11 -0
- package/dist/components/chat/CopilotChatSuggestionPill.d.ts +11 -0
- package/dist/components/chat/CopilotChatSuggestionPill.js +76 -0
- package/dist/components/chat/CopilotChatSuggestionPill.js.map +1 -0
- package/dist/components/chat/CopilotChatSuggestionPill.mjs +10 -0
- package/dist/components/chat/CopilotChatSuggestionPill.mjs.map +1 -0
- package/dist/components/chat/CopilotChatSuggestionView.d.mts +33 -0
- package/dist/components/chat/CopilotChatSuggestionView.d.ts +33 -0
- package/dist/components/chat/CopilotChatSuggestionView.js +179 -0
- package/dist/components/chat/CopilotChatSuggestionView.js.map +1 -0
- package/dist/components/chat/CopilotChatSuggestionView.mjs +12 -0
- package/dist/components/chat/CopilotChatSuggestionView.mjs.map +1 -0
- package/dist/components/chat/CopilotChatToggleButton.d.mts +14 -0
- package/dist/components/chat/CopilotChatToggleButton.d.ts +14 -0
- package/dist/components/chat/CopilotChatToggleButton.js +222 -0
- package/dist/components/chat/CopilotChatToggleButton.js.map +1 -0
- package/dist/components/chat/CopilotChatToggleButton.mjs +16 -0
- package/dist/components/chat/CopilotChatToggleButton.mjs.map +1 -0
- package/dist/components/chat/CopilotChatToolCallsView.d.mts +10 -0
- package/dist/components/chat/CopilotChatToolCallsView.d.ts +10 -0
- package/dist/components/chat/CopilotChatToolCallsView.js +264 -0
- package/dist/components/chat/CopilotChatToolCallsView.js.map +1 -0
- package/dist/components/chat/CopilotChatToolCallsView.mjs +24 -0
- package/dist/components/chat/CopilotChatToolCallsView.mjs.map +1 -0
- package/dist/components/chat/CopilotChatUserMessage.d.mts +52 -0
- package/dist/components/chat/CopilotChatUserMessage.d.ts +52 -0
- package/dist/components/chat/CopilotChatUserMessage.js +523 -0
- package/dist/components/chat/CopilotChatUserMessage.js.map +1 -0
- package/dist/components/chat/CopilotChatUserMessage.mjs +14 -0
- package/dist/components/chat/CopilotChatUserMessage.mjs.map +1 -0
- package/dist/components/chat/CopilotChatView.d.mts +54 -0
- package/dist/components/chat/CopilotChatView.d.ts +54 -0
- package/dist/components/chat/CopilotChatView.js +2640 -0
- package/dist/components/chat/CopilotChatView.js.map +1 -0
- package/dist/components/chat/CopilotChatView.mjs +38 -0
- package/dist/components/chat/CopilotChatView.mjs.map +1 -0
- package/dist/components/chat/CopilotModalHeader.d.mts +22 -0
- package/dist/components/chat/CopilotModalHeader.d.ts +22 -0
- package/dist/components/chat/CopilotModalHeader.js +186 -0
- package/dist/components/chat/CopilotModalHeader.js.map +1 -0
- package/dist/components/chat/CopilotModalHeader.mjs +12 -0
- package/dist/components/chat/CopilotModalHeader.mjs.map +1 -0
- package/dist/components/chat/CopilotPopup.d.mts +33 -0
- package/dist/components/chat/CopilotPopup.d.ts +33 -0
- package/dist/components/chat/CopilotPopup.js +3343 -0
- package/dist/components/chat/CopilotPopup.js.map +1 -0
- package/dist/components/chat/CopilotPopup.mjs +43 -0
- package/dist/components/chat/CopilotPopup.mjs.map +1 -0
- package/dist/components/chat/CopilotPopupView.d.mts +30 -0
- package/dist/components/chat/CopilotPopupView.d.ts +30 -0
- package/dist/components/chat/CopilotPopupView.js +3003 -0
- package/dist/components/chat/CopilotPopupView.js.map +1 -0
- package/dist/components/chat/CopilotPopupView.mjs +41 -0
- package/dist/components/chat/CopilotPopupView.mjs.map +1 -0
- package/dist/components/chat/CopilotSidebar.d.mts +31 -0
- package/dist/components/chat/CopilotSidebar.d.ts +31 -0
- package/dist/components/chat/CopilotSidebar.js +3266 -0
- package/dist/components/chat/CopilotSidebar.js.map +1 -0
- package/dist/components/chat/CopilotSidebar.mjs +43 -0
- package/dist/components/chat/CopilotSidebar.mjs.map +1 -0
- package/dist/components/chat/CopilotSidebarView.d.mts +28 -0
- package/dist/components/chat/CopilotSidebarView.d.ts +28 -0
- package/dist/components/chat/CopilotSidebarView.js +2941 -0
- package/dist/components/chat/CopilotSidebarView.js.map +1 -0
- package/dist/components/chat/CopilotSidebarView.mjs +41 -0
- package/dist/components/chat/CopilotSidebarView.mjs.map +1 -0
- package/dist/components/chat/index.d.mts +23 -0
- package/dist/components/chat/index.d.ts +23 -0
- package/dist/components/chat/index.js +3503 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +95 -0
- package/dist/components/chat/index.mjs.map +1 -0
- package/dist/components/index.d.mts +29 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +3583 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +104 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +14 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.js +150 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/button.mjs +10 -0
- package/dist/components/ui/button.mjs.map +1 -0
- package/dist/components/ui/dropdown-menu.d.mts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.js +291 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/dropdown-menu.mjs +37 -0
- package/dist/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/components/ui/tooltip.d.mts +10 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.js +103 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/tooltip.mjs +14 -0
- package/dist/components/ui/tooltip.mjs.map +1 -0
- package/dist/hooks/index.d.mts +19 -0
- package/dist/hooks/index.d.ts +19 -0
- package/dist/hooks/index.js +691 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +45 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/use-agent-context.d.mts +5 -0
- package/dist/hooks/use-agent-context.d.ts +5 -0
- package/dist/hooks/use-agent-context.js +116 -0
- package/dist/hooks/use-agent-context.js.map +1 -0
- package/dist/hooks/use-agent-context.mjs +10 -0
- package/dist/hooks/use-agent-context.mjs.map +1 -0
- package/dist/hooks/use-agent.d.mts +16 -0
- package/dist/hooks/use-agent.d.ts +16 -0
- package/dist/hooks/use-agent.js +171 -0
- package/dist/hooks/use-agent.js.map +1 -0
- package/dist/hooks/use-agent.mjs +12 -0
- package/dist/hooks/use-agent.mjs.map +1 -0
- package/dist/hooks/use-configure-suggestions.d.mts +13 -0
- package/dist/hooks/use-configure-suggestions.d.ts +13 -0
- package/dist/hooks/use-configure-suggestions.js +232 -0
- package/dist/hooks/use-configure-suggestions.js.map +1 -0
- package/dist/hooks/use-configure-suggestions.mjs +11 -0
- package/dist/hooks/use-configure-suggestions.mjs.map +1 -0
- package/dist/hooks/use-frontend-tool.d.mts +8 -0
- package/dist/hooks/use-frontend-tool.d.ts +8 -0
- package/dist/hooks/use-frontend-tool.js +137 -0
- package/dist/hooks/use-frontend-tool.js.map +1 -0
- package/dist/hooks/use-frontend-tool.mjs +10 -0
- package/dist/hooks/use-frontend-tool.mjs.map +1 -0
- package/dist/hooks/use-human-in-the-loop.d.mts +7 -0
- package/dist/hooks/use-human-in-the-loop.d.ts +7 -0
- package/dist/hooks/use-human-in-the-loop.js +206 -0
- package/dist/hooks/use-human-in-the-loop.js.map +1 -0
- package/dist/hooks/use-human-in-the-loop.mjs +11 -0
- package/dist/hooks/use-human-in-the-loop.mjs.map +1 -0
- package/dist/hooks/use-keyboard-height.d.mts +15 -0
- package/dist/hooks/use-keyboard-height.d.ts +15 -0
- package/dist/hooks/use-keyboard-height.js +68 -0
- package/dist/hooks/use-keyboard-height.js.map +1 -0
- package/dist/hooks/use-keyboard-height.mjs +7 -0
- package/dist/hooks/use-keyboard-height.mjs.map +1 -0
- package/dist/hooks/use-render-activity-message.d.mts +5 -0
- package/dist/hooks/use-render-activity-message.d.ts +5 -0
- package/dist/hooks/use-render-activity-message.js +158 -0
- package/dist/hooks/use-render-activity-message.js.map +1 -0
- package/dist/hooks/use-render-activity-message.mjs +12 -0
- package/dist/hooks/use-render-activity-message.mjs.map +1 -0
- package/dist/hooks/use-render-custom-messages.d.mts +11 -0
- package/dist/hooks/use-render-custom-messages.d.ts +11 -0
- package/dist/hooks/use-render-custom-messages.js +170 -0
- package/dist/hooks/use-render-custom-messages.js.map +1 -0
- package/dist/hooks/use-render-custom-messages.mjs +12 -0
- package/dist/hooks/use-render-custom-messages.mjs.map +1 -0
- package/dist/hooks/use-render-tool-call.d.mts +16 -0
- package/dist/hooks/use-render-tool-call.d.ts +16 -0
- package/dist/hooks/use-render-tool-call.js +208 -0
- package/dist/hooks/use-render-tool-call.js.map +1 -0
- package/dist/hooks/use-render-tool-call.mjs +11 -0
- package/dist/hooks/use-render-tool-call.mjs.map +1 -0
- package/dist/hooks/use-suggestions.d.mts +14 -0
- package/dist/hooks/use-suggestions.d.ts +14 -0
- package/dist/hooks/use-suggestions.js +176 -0
- package/dist/hooks/use-suggestions.js.map +1 -0
- package/dist/hooks/use-suggestions.mjs +11 -0
- package/dist/hooks/use-suggestions.mjs.map +1 -0
- package/dist/index.d.mts +46 -635
- package/dist/index.d.ts +46 -635
- package/dist/index.mjs +110 -3960
- package/dist/index.mjs.map +1 -1
- package/dist/lib/react-core.d.mts +33 -0
- package/dist/lib/react-core.d.ts +33 -0
- package/dist/lib/react-core.js +73 -0
- package/dist/lib/react-core.js.map +1 -0
- package/dist/lib/react-core.mjs +7 -0
- package/dist/lib/react-core.mjs.map +1 -0
- package/dist/lib/slots.d.mts +16 -0
- package/dist/lib/slots.d.ts +16 -0
- package/dist/lib/slots.js +60 -0
- package/dist/lib/slots.js.map +1 -0
- package/dist/lib/slots.mjs +7 -0
- package/dist/lib/slots.mjs.map +1 -0
- package/dist/lib/utils.d.mts +5 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +35 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +7 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/providers/CopilotChatConfigurationProvider.d.mts +43 -0
- package/dist/providers/CopilotChatConfigurationProvider.d.ts +43 -0
- package/dist/providers/CopilotChatConfigurationProvider.js +109 -0
- package/dist/providers/CopilotChatConfigurationProvider.js.map +1 -0
- package/dist/providers/CopilotChatConfigurationProvider.mjs +11 -0
- package/dist/providers/CopilotChatConfigurationProvider.mjs.map +1 -0
- package/dist/providers/CopilotKitProvider.d.mts +33 -0
- package/dist/providers/CopilotKitProvider.d.ts +33 -0
- package/dist/providers/CopilotKitProvider.js +314 -0
- package/dist/providers/CopilotKitProvider.js.map +1 -0
- package/dist/providers/CopilotKitProvider.mjs +12 -0
- package/dist/providers/CopilotKitProvider.mjs.map +1 -0
- package/dist/providers/index.d.mts +13 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.js +396 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +18 -0
- package/dist/providers/index.mjs.map +1 -0
- package/dist/types/defineToolCallRenderer.d.mts +41 -0
- package/dist/types/defineToolCallRenderer.d.ts +41 -0
- package/dist/types/defineToolCallRenderer.js +40 -0
- package/dist/types/defineToolCallRenderer.js.map +1 -0
- package/dist/types/defineToolCallRenderer.mjs +7 -0
- package/dist/types/defineToolCallRenderer.mjs.map +1 -0
- package/dist/types/frontend-tool.d.mts +9 -0
- package/dist/types/frontend-tool.d.ts +9 -0
- package/dist/types/frontend-tool.js +19 -0
- package/dist/types/frontend-tool.js.map +1 -0
- package/dist/types/frontend-tool.mjs +2 -0
- package/dist/types/frontend-tool.mjs.map +1 -0
- package/dist/types/human-in-the-loop.d.mts +29 -0
- package/dist/types/human-in-the-loop.d.ts +29 -0
- package/dist/types/human-in-the-loop.js +19 -0
- package/dist/types/human-in-the-loop.js.map +1 -0
- package/dist/types/human-in-the-loop.mjs +2 -0
- package/dist/types/human-in-the-loop.mjs.map +1 -0
- package/dist/types/index.d.mts +11 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.js +42 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +13 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/react-activity-message-renderer.d.mts +29 -0
- package/dist/types/react-activity-message-renderer.d.ts +29 -0
- package/dist/types/react-activity-message-renderer.js +19 -0
- package/dist/types/react-activity-message-renderer.js.map +1 -0
- package/dist/types/react-activity-message-renderer.mjs +2 -0
- package/dist/types/react-activity-message-renderer.mjs.map +1 -0
- package/dist/types/react-custom-message-renderer.d.mts +18 -0
- package/dist/types/react-custom-message-renderer.d.ts +18 -0
- package/dist/types/react-custom-message-renderer.js +19 -0
- package/dist/types/react-custom-message-renderer.js.map +1 -0
- package/dist/types/react-custom-message-renderer.mjs +2 -0
- package/dist/types/react-custom-message-renderer.mjs.map +1 -0
- package/dist/types/react-tool-call-renderer.d.mts +30 -0
- package/dist/types/react-tool-call-renderer.d.ts +30 -0
- package/dist/types/react-tool-call-renderer.js +19 -0
- package/dist/types/react-tool-call-renderer.js.map +1 -0
- package/dist/types/react-tool-call-renderer.mjs +2 -0
- package/dist/types/react-tool-call-renderer.mjs.map +1 -0
- package/package.json +8 -7
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/chat/CopilotChatAssistantMessage.tsx
|
|
31
|
+
var CopilotChatAssistantMessage_exports = {};
|
|
32
|
+
__export(CopilotChatAssistantMessage_exports, {
|
|
33
|
+
CopilotChatAssistantMessage: () => CopilotChatAssistantMessage,
|
|
34
|
+
default: () => CopilotChatAssistantMessage_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(CopilotChatAssistantMessage_exports);
|
|
37
|
+
var import_react15 = require("react");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
|
|
40
|
+
// src/providers/CopilotChatConfigurationProvider.tsx
|
|
41
|
+
var import_react = require("react");
|
|
42
|
+
var import_shared = require("@copilotkitnext/shared");
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var CopilotChatDefaultLabels = {
|
|
45
|
+
chatInputPlaceholder: "Type a message...",
|
|
46
|
+
chatInputToolbarStartTranscribeButtonLabel: "Transcribe",
|
|
47
|
+
chatInputToolbarCancelTranscribeButtonLabel: "Cancel",
|
|
48
|
+
chatInputToolbarFinishTranscribeButtonLabel: "Finish",
|
|
49
|
+
chatInputToolbarAddButtonLabel: "Add photos or files",
|
|
50
|
+
chatInputToolbarToolsButtonLabel: "Tools",
|
|
51
|
+
assistantMessageToolbarCopyCodeLabel: "Copy",
|
|
52
|
+
assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
|
|
53
|
+
assistantMessageToolbarCopyMessageLabel: "Copy",
|
|
54
|
+
assistantMessageToolbarThumbsUpLabel: "Good response",
|
|
55
|
+
assistantMessageToolbarThumbsDownLabel: "Bad response",
|
|
56
|
+
assistantMessageToolbarReadAloudLabel: "Read aloud",
|
|
57
|
+
assistantMessageToolbarRegenerateLabel: "Regenerate",
|
|
58
|
+
userMessageToolbarCopyMessageLabel: "Copy",
|
|
59
|
+
userMessageToolbarEditMessageLabel: "Edit",
|
|
60
|
+
chatDisclaimerText: "AI can make mistakes. Please verify important information.",
|
|
61
|
+
chatToggleOpenLabel: "Open chat",
|
|
62
|
+
chatToggleCloseLabel: "Close chat",
|
|
63
|
+
modalHeaderTitle: "CopilotKit Chat"
|
|
64
|
+
};
|
|
65
|
+
var CopilotChatConfiguration = (0, import_react.createContext)(null);
|
|
66
|
+
var useCopilotChatConfiguration = () => {
|
|
67
|
+
const configuration = (0, import_react.useContext)(CopilotChatConfiguration);
|
|
68
|
+
return configuration;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/components/chat/CopilotChatAssistantMessage.tsx
|
|
72
|
+
var import_tailwind_merge2 = require("tailwind-merge");
|
|
73
|
+
|
|
74
|
+
// src/components/ui/button.tsx
|
|
75
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
76
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
77
|
+
|
|
78
|
+
// src/lib/utils.ts
|
|
79
|
+
var import_clsx = require("clsx");
|
|
80
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
81
|
+
function cn(...inputs) {
|
|
82
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// src/components/ui/button.tsx
|
|
86
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
87
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
88
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
89
|
+
{
|
|
90
|
+
variants: {
|
|
91
|
+
variant: {
|
|
92
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
93
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
94
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
95
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
96
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 cursor-pointer",
|
|
97
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
98
|
+
assistantMessageToolbarButton: [
|
|
99
|
+
"cursor-pointer",
|
|
100
|
+
// Background and text
|
|
101
|
+
"p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]",
|
|
102
|
+
// Dark mode - lighter gray for better contrast
|
|
103
|
+
"dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]",
|
|
104
|
+
// Shape and sizing
|
|
105
|
+
"h-8 w-8",
|
|
106
|
+
// Interactions
|
|
107
|
+
"transition-colors",
|
|
108
|
+
// Hover states
|
|
109
|
+
"hover:text-[rgb(93,93,93)]",
|
|
110
|
+
"dark:hover:text-[rgb(243,243,243)]"
|
|
111
|
+
],
|
|
112
|
+
chatInputToolbarPrimary: [
|
|
113
|
+
"cursor-pointer",
|
|
114
|
+
// Background and text
|
|
115
|
+
"bg-black text-white",
|
|
116
|
+
// Dark mode
|
|
117
|
+
"dark:bg-white dark:text-black dark:focus-visible:outline-white",
|
|
118
|
+
// Shape and sizing
|
|
119
|
+
"rounded-full",
|
|
120
|
+
// Interactions
|
|
121
|
+
"transition-colors",
|
|
122
|
+
// Focus states
|
|
123
|
+
"focus:outline-none",
|
|
124
|
+
// Hover states
|
|
125
|
+
"hover:opacity-70 disabled:hover:opacity-100",
|
|
126
|
+
// Disabled states
|
|
127
|
+
"disabled:cursor-not-allowed disabled:bg-[#00000014] disabled:text-[rgb(13,13,13)]",
|
|
128
|
+
"dark:disabled:bg-[#454545] dark:disabled:text-white "
|
|
129
|
+
],
|
|
130
|
+
chatInputToolbarSecondary: [
|
|
131
|
+
"cursor-pointer",
|
|
132
|
+
// Background and text
|
|
133
|
+
"bg-transparent text-[#444444]",
|
|
134
|
+
// Dark mode
|
|
135
|
+
"dark:text-white dark:border-[#404040]",
|
|
136
|
+
// Shape and sizing
|
|
137
|
+
"rounded-full",
|
|
138
|
+
// Interactions
|
|
139
|
+
"transition-colors",
|
|
140
|
+
// Focus states
|
|
141
|
+
"focus:outline-none",
|
|
142
|
+
// Hover states
|
|
143
|
+
"hover:bg-[#f8f8f8] hover:text-[#333333]",
|
|
144
|
+
"dark:hover:bg-[#404040] dark:hover:text-[#FFFFFF]",
|
|
145
|
+
// Disabled states
|
|
146
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
147
|
+
"disabled:hover:bg-transparent disabled:hover:text-[#444444]",
|
|
148
|
+
"dark:disabled:hover:bg-transparent dark:disabled:hover:text-[#CCCCCC]"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
size: {
|
|
152
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
153
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
154
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
155
|
+
icon: "size-9",
|
|
156
|
+
chatInputToolbarIcon: [
|
|
157
|
+
// Shape and sizing
|
|
158
|
+
"h-9 w-9 rounded-full"
|
|
159
|
+
],
|
|
160
|
+
chatInputToolbarIconLabel: [
|
|
161
|
+
// Shape and sizing
|
|
162
|
+
"h-9 px-3 rounded-full",
|
|
163
|
+
// Layout
|
|
164
|
+
"gap-2",
|
|
165
|
+
// Typography
|
|
166
|
+
"font-normal"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
defaultVariants: {
|
|
171
|
+
variant: "default",
|
|
172
|
+
size: "default"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
function Button({
|
|
177
|
+
className,
|
|
178
|
+
variant,
|
|
179
|
+
size,
|
|
180
|
+
asChild = false,
|
|
181
|
+
...props
|
|
182
|
+
}) {
|
|
183
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
185
|
+
Comp,
|
|
186
|
+
{
|
|
187
|
+
"data-slot": "button",
|
|
188
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
189
|
+
...props
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/components/ui/tooltip.tsx
|
|
195
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
196
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
197
|
+
function TooltipProvider({
|
|
198
|
+
delayDuration = 0,
|
|
199
|
+
...props
|
|
200
|
+
}) {
|
|
201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
202
|
+
TooltipPrimitive.Provider,
|
|
203
|
+
{
|
|
204
|
+
"data-slot": "tooltip-provider",
|
|
205
|
+
delayDuration,
|
|
206
|
+
...props
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
function Tooltip({
|
|
211
|
+
...props
|
|
212
|
+
}) {
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
214
|
+
}
|
|
215
|
+
function TooltipTrigger({
|
|
216
|
+
...props
|
|
217
|
+
}) {
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
219
|
+
}
|
|
220
|
+
function TooltipContent({
|
|
221
|
+
className,
|
|
222
|
+
sideOffset = 0,
|
|
223
|
+
children,
|
|
224
|
+
...props
|
|
225
|
+
}) {
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
227
|
+
TooltipPrimitive.Content,
|
|
228
|
+
{
|
|
229
|
+
"data-slot": "tooltip-content",
|
|
230
|
+
sideOffset,
|
|
231
|
+
className: cn(
|
|
232
|
+
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
233
|
+
className
|
|
234
|
+
),
|
|
235
|
+
...props,
|
|
236
|
+
children: [
|
|
237
|
+
children,
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
) });
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// src/components/chat/CopilotChatAssistantMessage.tsx
|
|
245
|
+
var import_katex_min = require("katex/dist/katex.min.css");
|
|
246
|
+
|
|
247
|
+
// src/lib/slots.tsx
|
|
248
|
+
var import_react2 = __toESM(require("react"));
|
|
249
|
+
function renderSlot(slot, DefaultComponent, props) {
|
|
250
|
+
if (typeof slot === "string") {
|
|
251
|
+
return import_react2.default.createElement(DefaultComponent, {
|
|
252
|
+
...props,
|
|
253
|
+
className: slot
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
if (typeof slot === "function") {
|
|
257
|
+
const Comp = slot;
|
|
258
|
+
return import_react2.default.createElement(Comp, props);
|
|
259
|
+
}
|
|
260
|
+
if (slot && typeof slot === "object" && !import_react2.default.isValidElement(slot)) {
|
|
261
|
+
return import_react2.default.createElement(DefaultComponent, {
|
|
262
|
+
...props,
|
|
263
|
+
...slot
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return import_react2.default.createElement(DefaultComponent, props);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/components/chat/CopilotChatAssistantMessage.tsx
|
|
270
|
+
var import_streamdown = require("streamdown");
|
|
271
|
+
|
|
272
|
+
// src/hooks/use-render-tool-call.tsx
|
|
273
|
+
var import_react5 = require("react");
|
|
274
|
+
var import_core2 = require("@copilotkitnext/core");
|
|
275
|
+
|
|
276
|
+
// src/providers/CopilotKitProvider.tsx
|
|
277
|
+
var import_react4 = require("react");
|
|
278
|
+
var import_zod = require("zod");
|
|
279
|
+
|
|
280
|
+
// src/lib/react-core.ts
|
|
281
|
+
var import_core = require("@copilotkitnext/core");
|
|
282
|
+
|
|
283
|
+
// src/components/CopilotKitInspector.tsx
|
|
284
|
+
var React3 = __toESM(require("react"));
|
|
285
|
+
var import_react3 = require("@lit-labs/react");
|
|
286
|
+
var import_web_inspector = require("@copilotkitnext/web-inspector");
|
|
287
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
288
|
+
(0, import_web_inspector.defineWebInspector)();
|
|
289
|
+
var CopilotKitInspectorBase = (0, import_react3.createComponent)({
|
|
290
|
+
tagName: import_web_inspector.WEB_INSPECTOR_TAG,
|
|
291
|
+
elementClass: import_web_inspector.WebInspectorElement,
|
|
292
|
+
react: React3
|
|
293
|
+
});
|
|
294
|
+
var CopilotKitInspector = React3.forwardRef(
|
|
295
|
+
({ core, ...rest }, ref) => {
|
|
296
|
+
const innerRef = React3.useRef(null);
|
|
297
|
+
React3.useImperativeHandle(ref, () => innerRef.current, []);
|
|
298
|
+
React3.useEffect(() => {
|
|
299
|
+
if (innerRef.current) {
|
|
300
|
+
innerRef.current.core = core ?? null;
|
|
301
|
+
}
|
|
302
|
+
}, [core]);
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
304
|
+
CopilotKitInspectorBase,
|
|
305
|
+
{
|
|
306
|
+
...rest,
|
|
307
|
+
ref: innerRef
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
313
|
+
|
|
314
|
+
// src/providers/CopilotKitProvider.tsx
|
|
315
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
316
|
+
var CopilotKitContext = (0, import_react4.createContext)({
|
|
317
|
+
copilotkit: null
|
|
318
|
+
});
|
|
319
|
+
var useCopilotKit = () => {
|
|
320
|
+
const context = (0, import_react4.useContext)(CopilotKitContext);
|
|
321
|
+
const [, forceUpdate] = (0, import_react4.useReducer)((x) => x + 1, 0);
|
|
322
|
+
if (!context) {
|
|
323
|
+
throw new Error("useCopilotKit must be used within CopilotKitProvider");
|
|
324
|
+
}
|
|
325
|
+
(0, import_react4.useEffect)(() => {
|
|
326
|
+
const unsubscribe = context.copilotkit.subscribe({
|
|
327
|
+
onRuntimeConnectionStatusChanged: () => {
|
|
328
|
+
forceUpdate();
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
return () => {
|
|
332
|
+
unsubscribe();
|
|
333
|
+
};
|
|
334
|
+
}, []);
|
|
335
|
+
return context;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// src/hooks/use-render-tool-call.tsx
|
|
339
|
+
var import_shared2 = require("@copilotkitnext/shared");
|
|
340
|
+
var import_shared3 = require("@copilotkitnext/shared");
|
|
341
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
342
|
+
function useRenderToolCall() {
|
|
343
|
+
const { copilotkit } = useCopilotKit();
|
|
344
|
+
const config = useCopilotChatConfiguration();
|
|
345
|
+
const agentId = config?.agentId ?? import_shared2.DEFAULT_AGENT_ID;
|
|
346
|
+
const [executingToolCallIds, setExecutingToolCallIds] = (0, import_react5.useState)(() => /* @__PURE__ */ new Set());
|
|
347
|
+
const renderToolCalls = (0, import_react5.useSyncExternalStore)(
|
|
348
|
+
(callback) => {
|
|
349
|
+
return copilotkit.subscribe({
|
|
350
|
+
onRenderToolCallsChanged: callback
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
() => copilotkit.renderToolCalls,
|
|
354
|
+
() => copilotkit.renderToolCalls
|
|
355
|
+
);
|
|
356
|
+
(0, import_react5.useEffect)(() => {
|
|
357
|
+
const unsubscribe = copilotkit.subscribe({
|
|
358
|
+
onToolExecutionStart: ({ toolCallId }) => {
|
|
359
|
+
setExecutingToolCallIds((prev) => {
|
|
360
|
+
if (prev.has(toolCallId)) return prev;
|
|
361
|
+
const next = new Set(prev);
|
|
362
|
+
next.add(toolCallId);
|
|
363
|
+
return next;
|
|
364
|
+
});
|
|
365
|
+
},
|
|
366
|
+
onToolExecutionEnd: ({ toolCallId }) => {
|
|
367
|
+
setExecutingToolCallIds((prev) => {
|
|
368
|
+
if (!prev.has(toolCallId)) return prev;
|
|
369
|
+
const next = new Set(prev);
|
|
370
|
+
next.delete(toolCallId);
|
|
371
|
+
return next;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
return () => unsubscribe();
|
|
376
|
+
}, [copilotkit]);
|
|
377
|
+
const renderToolCall = (0, import_react5.useCallback)(
|
|
378
|
+
({
|
|
379
|
+
toolCall,
|
|
380
|
+
toolMessage
|
|
381
|
+
}) => {
|
|
382
|
+
const exactMatches = renderToolCalls.filter(
|
|
383
|
+
(rc) => rc.name === toolCall.function.name
|
|
384
|
+
);
|
|
385
|
+
const renderConfig = exactMatches.find((rc) => rc.agentId === agentId) || exactMatches.find((rc) => !rc.agentId) || exactMatches[0] || renderToolCalls.find((rc) => rc.name === "*");
|
|
386
|
+
if (!renderConfig) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
const RenderComponent = renderConfig.render;
|
|
390
|
+
const args = (0, import_shared3.partialJSONParse)(toolCall.function.arguments);
|
|
391
|
+
const toolName = toolCall.function.name;
|
|
392
|
+
if (toolMessage) {
|
|
393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
394
|
+
RenderComponent,
|
|
395
|
+
{
|
|
396
|
+
name: toolName,
|
|
397
|
+
args,
|
|
398
|
+
status: import_core2.ToolCallStatus.Complete,
|
|
399
|
+
result: toolMessage.content
|
|
400
|
+
},
|
|
401
|
+
toolCall.id
|
|
402
|
+
);
|
|
403
|
+
} else if (executingToolCallIds.has(toolCall.id)) {
|
|
404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
405
|
+
RenderComponent,
|
|
406
|
+
{
|
|
407
|
+
name: toolName,
|
|
408
|
+
args,
|
|
409
|
+
status: import_core2.ToolCallStatus.Executing,
|
|
410
|
+
result: void 0
|
|
411
|
+
},
|
|
412
|
+
toolCall.id
|
|
413
|
+
);
|
|
414
|
+
} else {
|
|
415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
416
|
+
RenderComponent,
|
|
417
|
+
{
|
|
418
|
+
name: toolName,
|
|
419
|
+
args,
|
|
420
|
+
status: import_core2.ToolCallStatus.InProgress,
|
|
421
|
+
result: void 0
|
|
422
|
+
},
|
|
423
|
+
toolCall.id
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
[renderToolCalls, executingToolCallIds, agentId]
|
|
428
|
+
);
|
|
429
|
+
return renderToolCall;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// src/hooks/use-render-custom-messages.tsx
|
|
433
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
434
|
+
|
|
435
|
+
// src/hooks/use-render-activity-message.tsx
|
|
436
|
+
var import_shared4 = require("@copilotkitnext/shared");
|
|
437
|
+
var import_react6 = require("react");
|
|
438
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
439
|
+
|
|
440
|
+
// src/hooks/use-frontend-tool.tsx
|
|
441
|
+
var import_react7 = require("react");
|
|
442
|
+
|
|
443
|
+
// src/hooks/use-human-in-the-loop.tsx
|
|
444
|
+
var import_react8 = require("react");
|
|
445
|
+
var import_react9 = __toESM(require("react"));
|
|
446
|
+
|
|
447
|
+
// src/hooks/use-agent.tsx
|
|
448
|
+
var import_react10 = require("react");
|
|
449
|
+
var import_shared5 = require("@copilotkitnext/shared");
|
|
450
|
+
|
|
451
|
+
// src/hooks/use-agent-context.tsx
|
|
452
|
+
var import_react11 = require("react");
|
|
453
|
+
|
|
454
|
+
// src/hooks/use-suggestions.tsx
|
|
455
|
+
var import_react12 = require("react");
|
|
456
|
+
var import_shared6 = require("@copilotkitnext/shared");
|
|
457
|
+
|
|
458
|
+
// src/hooks/use-configure-suggestions.tsx
|
|
459
|
+
var import_react13 = require("react");
|
|
460
|
+
var import_shared7 = require("@copilotkitnext/shared");
|
|
461
|
+
|
|
462
|
+
// src/components/chat/CopilotChatToolCallsView.tsx
|
|
463
|
+
var import_react14 = __toESM(require("react"));
|
|
464
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
465
|
+
function CopilotChatToolCallsView({
|
|
466
|
+
message,
|
|
467
|
+
messages = []
|
|
468
|
+
}) {
|
|
469
|
+
const renderToolCall = useRenderToolCall();
|
|
470
|
+
if (!message.toolCalls || message.toolCalls.length === 0) {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: message.toolCalls.map((toolCall) => {
|
|
474
|
+
const toolMessage = messages.find(
|
|
475
|
+
(m) => m.role === "tool" && m.toolCallId === toolCall.id
|
|
476
|
+
);
|
|
477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react14.default.Fragment, { children: renderToolCall({
|
|
478
|
+
toolCall,
|
|
479
|
+
toolMessage
|
|
480
|
+
}) }, toolCall.id);
|
|
481
|
+
}) });
|
|
482
|
+
}
|
|
483
|
+
var CopilotChatToolCallsView_default = CopilotChatToolCallsView;
|
|
484
|
+
|
|
485
|
+
// src/components/chat/CopilotChatAssistantMessage.tsx
|
|
486
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
487
|
+
function CopilotChatAssistantMessage({
|
|
488
|
+
message,
|
|
489
|
+
messages,
|
|
490
|
+
isRunning,
|
|
491
|
+
onThumbsUp,
|
|
492
|
+
onThumbsDown,
|
|
493
|
+
onReadAloud,
|
|
494
|
+
onRegenerate,
|
|
495
|
+
additionalToolbarItems,
|
|
496
|
+
toolbarVisible = true,
|
|
497
|
+
markdownRenderer,
|
|
498
|
+
toolbar,
|
|
499
|
+
copyButton,
|
|
500
|
+
thumbsUpButton,
|
|
501
|
+
thumbsDownButton,
|
|
502
|
+
readAloudButton,
|
|
503
|
+
regenerateButton,
|
|
504
|
+
toolCallsView,
|
|
505
|
+
children,
|
|
506
|
+
className,
|
|
507
|
+
...props
|
|
508
|
+
}) {
|
|
509
|
+
const boundMarkdownRenderer = renderSlot(
|
|
510
|
+
markdownRenderer,
|
|
511
|
+
CopilotChatAssistantMessage.MarkdownRenderer,
|
|
512
|
+
{
|
|
513
|
+
content: message.content || ""
|
|
514
|
+
}
|
|
515
|
+
);
|
|
516
|
+
const boundCopyButton = renderSlot(
|
|
517
|
+
copyButton,
|
|
518
|
+
CopilotChatAssistantMessage.CopyButton,
|
|
519
|
+
{
|
|
520
|
+
onClick: async () => {
|
|
521
|
+
if (message.content) {
|
|
522
|
+
try {
|
|
523
|
+
await navigator.clipboard.writeText(message.content);
|
|
524
|
+
} catch (err) {
|
|
525
|
+
console.error("Failed to copy message:", err);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
);
|
|
531
|
+
const boundThumbsUpButton = renderSlot(
|
|
532
|
+
thumbsUpButton,
|
|
533
|
+
CopilotChatAssistantMessage.ThumbsUpButton,
|
|
534
|
+
{
|
|
535
|
+
onClick: onThumbsUp
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
const boundThumbsDownButton = renderSlot(
|
|
539
|
+
thumbsDownButton,
|
|
540
|
+
CopilotChatAssistantMessage.ThumbsDownButton,
|
|
541
|
+
{
|
|
542
|
+
onClick: onThumbsDown
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
const boundReadAloudButton = renderSlot(
|
|
546
|
+
readAloudButton,
|
|
547
|
+
CopilotChatAssistantMessage.ReadAloudButton,
|
|
548
|
+
{
|
|
549
|
+
onClick: onReadAloud
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
const boundRegenerateButton = renderSlot(
|
|
553
|
+
regenerateButton,
|
|
554
|
+
CopilotChatAssistantMessage.RegenerateButton,
|
|
555
|
+
{
|
|
556
|
+
onClick: onRegenerate
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
const boundToolbar = renderSlot(
|
|
560
|
+
toolbar,
|
|
561
|
+
CopilotChatAssistantMessage.Toolbar,
|
|
562
|
+
{
|
|
563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
564
|
+
boundCopyButton,
|
|
565
|
+
(onThumbsUp || thumbsUpButton) && boundThumbsUpButton,
|
|
566
|
+
(onThumbsDown || thumbsDownButton) && boundThumbsDownButton,
|
|
567
|
+
(onReadAloud || readAloudButton) && boundReadAloudButton,
|
|
568
|
+
(onRegenerate || regenerateButton) && boundRegenerateButton,
|
|
569
|
+
additionalToolbarItems
|
|
570
|
+
] })
|
|
571
|
+
}
|
|
572
|
+
);
|
|
573
|
+
const boundToolCallsView = renderSlot(
|
|
574
|
+
toolCallsView,
|
|
575
|
+
CopilotChatToolCallsView_default,
|
|
576
|
+
{
|
|
577
|
+
message,
|
|
578
|
+
messages
|
|
579
|
+
}
|
|
580
|
+
);
|
|
581
|
+
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
582
|
+
const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
|
|
583
|
+
const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
|
|
584
|
+
if (children) {
|
|
585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: children({
|
|
586
|
+
markdownRenderer: boundMarkdownRenderer,
|
|
587
|
+
toolbar: boundToolbar,
|
|
588
|
+
toolCallsView: boundToolCallsView,
|
|
589
|
+
copyButton: boundCopyButton,
|
|
590
|
+
thumbsUpButton: boundThumbsUpButton,
|
|
591
|
+
thumbsDownButton: boundThumbsDownButton,
|
|
592
|
+
readAloudButton: boundReadAloudButton,
|
|
593
|
+
regenerateButton: boundRegenerateButton,
|
|
594
|
+
message,
|
|
595
|
+
messages,
|
|
596
|
+
isRunning,
|
|
597
|
+
onThumbsUp,
|
|
598
|
+
onThumbsDown,
|
|
599
|
+
onReadAloud,
|
|
600
|
+
onRegenerate,
|
|
601
|
+
additionalToolbarItems,
|
|
602
|
+
toolbarVisible: shouldShowToolbar
|
|
603
|
+
}) });
|
|
604
|
+
}
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
606
|
+
"div",
|
|
607
|
+
{
|
|
608
|
+
className: (0, import_tailwind_merge2.twMerge)(
|
|
609
|
+
"prose max-w-full break-words dark:prose-invert",
|
|
610
|
+
className
|
|
611
|
+
),
|
|
612
|
+
...props,
|
|
613
|
+
"data-message-id": message.id,
|
|
614
|
+
children: [
|
|
615
|
+
boundMarkdownRenderer,
|
|
616
|
+
boundToolCallsView,
|
|
617
|
+
shouldShowToolbar && boundToolbar
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
((CopilotChatAssistantMessage2) => {
|
|
623
|
+
CopilotChatAssistantMessage2.MarkdownRenderer = ({ content, className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_streamdown.Streamdown, { className, ...props, children: content ?? "" });
|
|
624
|
+
CopilotChatAssistantMessage2.Toolbar = ({
|
|
625
|
+
className,
|
|
626
|
+
...props
|
|
627
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
628
|
+
"div",
|
|
629
|
+
{
|
|
630
|
+
className: (0, import_tailwind_merge2.twMerge)(
|
|
631
|
+
"w-full bg-transparent flex items-center -ml-[5px] -mt-[0px]",
|
|
632
|
+
className
|
|
633
|
+
),
|
|
634
|
+
...props
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
CopilotChatAssistantMessage2.ToolbarButton = ({ title, children, ...props }) => {
|
|
638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tooltip, { children: [
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
640
|
+
Button,
|
|
641
|
+
{
|
|
642
|
+
type: "button",
|
|
643
|
+
variant: "assistantMessageToolbarButton",
|
|
644
|
+
"aria-label": title,
|
|
645
|
+
...props,
|
|
646
|
+
children
|
|
647
|
+
}
|
|
648
|
+
) }),
|
|
649
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipContent, { side: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: title }) })
|
|
650
|
+
] });
|
|
651
|
+
};
|
|
652
|
+
CopilotChatAssistantMessage2.CopyButton = ({ className, title, onClick, ...props }) => {
|
|
653
|
+
const config = useCopilotChatConfiguration();
|
|
654
|
+
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
655
|
+
const [copied, setCopied] = (0, import_react15.useState)(false);
|
|
656
|
+
const handleClick = (event) => {
|
|
657
|
+
setCopied(true);
|
|
658
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
659
|
+
if (onClick) {
|
|
660
|
+
onClick(event);
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
664
|
+
CopilotChatAssistantMessage2.ToolbarButton,
|
|
665
|
+
{
|
|
666
|
+
title: title || labels.assistantMessageToolbarCopyMessageLabel,
|
|
667
|
+
onClick: handleClick,
|
|
668
|
+
className,
|
|
669
|
+
...props,
|
|
670
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.Check, { className: "size-[18px]" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.Copy, { className: "size-[18px]" })
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
};
|
|
674
|
+
CopilotChatAssistantMessage2.ThumbsUpButton = ({ title, ...props }) => {
|
|
675
|
+
const config = useCopilotChatConfiguration();
|
|
676
|
+
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
678
|
+
CopilotChatAssistantMessage2.ToolbarButton,
|
|
679
|
+
{
|
|
680
|
+
title: title || labels.assistantMessageToolbarThumbsUpLabel,
|
|
681
|
+
...props,
|
|
682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.ThumbsUp, { className: "size-[18px]" })
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
};
|
|
686
|
+
CopilotChatAssistantMessage2.ThumbsDownButton = ({ title, ...props }) => {
|
|
687
|
+
const config = useCopilotChatConfiguration();
|
|
688
|
+
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
690
|
+
CopilotChatAssistantMessage2.ToolbarButton,
|
|
691
|
+
{
|
|
692
|
+
title: title || labels.assistantMessageToolbarThumbsDownLabel,
|
|
693
|
+
...props,
|
|
694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.ThumbsDown, { className: "size-[18px]" })
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
};
|
|
698
|
+
CopilotChatAssistantMessage2.ReadAloudButton = ({ title, ...props }) => {
|
|
699
|
+
const config = useCopilotChatConfiguration();
|
|
700
|
+
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
702
|
+
CopilotChatAssistantMessage2.ToolbarButton,
|
|
703
|
+
{
|
|
704
|
+
title: title || labels.assistantMessageToolbarReadAloudLabel,
|
|
705
|
+
...props,
|
|
706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.Volume2, { className: "size-[20px]" })
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
};
|
|
710
|
+
CopilotChatAssistantMessage2.RegenerateButton = ({ title, ...props }) => {
|
|
711
|
+
const config = useCopilotChatConfiguration();
|
|
712
|
+
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
714
|
+
CopilotChatAssistantMessage2.ToolbarButton,
|
|
715
|
+
{
|
|
716
|
+
title: title || labels.assistantMessageToolbarRegenerateLabel,
|
|
717
|
+
...props,
|
|
718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.RefreshCw, { className: "size-[18px]" })
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
};
|
|
722
|
+
})(CopilotChatAssistantMessage || (CopilotChatAssistantMessage = {}));
|
|
723
|
+
CopilotChatAssistantMessage.MarkdownRenderer.displayName = "CopilotChatAssistantMessage.MarkdownRenderer";
|
|
724
|
+
CopilotChatAssistantMessage.Toolbar.displayName = "CopilotChatAssistantMessage.Toolbar";
|
|
725
|
+
CopilotChatAssistantMessage.CopyButton.displayName = "CopilotChatAssistantMessage.CopyButton";
|
|
726
|
+
CopilotChatAssistantMessage.ThumbsUpButton.displayName = "CopilotChatAssistantMessage.ThumbsUpButton";
|
|
727
|
+
CopilotChatAssistantMessage.ThumbsDownButton.displayName = "CopilotChatAssistantMessage.ThumbsDownButton";
|
|
728
|
+
CopilotChatAssistantMessage.ReadAloudButton.displayName = "CopilotChatAssistantMessage.ReadAloudButton";
|
|
729
|
+
CopilotChatAssistantMessage.RegenerateButton.displayName = "CopilotChatAssistantMessage.RegenerateButton";
|
|
730
|
+
var CopilotChatAssistantMessage_default = CopilotChatAssistantMessage;
|
|
731
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
732
|
+
0 && (module.exports = {
|
|
733
|
+
CopilotChatAssistantMessage
|
|
734
|
+
});
|
|
735
|
+
//# sourceMappingURL=CopilotChatAssistantMessage.js.map
|