@copilotkitnext/react 0.0.22-alpha.3 → 0.0.22-alpha.5
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/index.d.mts +635 -46
- package/dist/index.d.ts +635 -46
- package/dist/index.js +325 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4286 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-32YJ5VJ4.mjs +0 -157
- package/dist/chunk-32YJ5VJ4.mjs.map +0 -1
- package/dist/chunk-36HFWACS.mjs +0 -1
- package/dist/chunk-36HFWACS.mjs.map +0 -1
- package/dist/chunk-3TA5QBSZ.mjs +0 -122
- package/dist/chunk-3TA5QBSZ.mjs.map +0 -1
- package/dist/chunk-46BZRXWT.mjs +0 -16
- package/dist/chunk-46BZRXWT.mjs.map +0 -1
- package/dist/chunk-4UDBR75C.mjs +0 -106
- package/dist/chunk-4UDBR75C.mjs.map +0 -1
- package/dist/chunk-4XJK5IVQ.mjs +0 -83
- package/dist/chunk-4XJK5IVQ.mjs.map +0 -1
- package/dist/chunk-5AAT4Z3C.mjs +0 -107
- package/dist/chunk-5AAT4Z3C.mjs.map +0 -1
- package/dist/chunk-5JNWVLQI.mjs +0 -72
- package/dist/chunk-5JNWVLQI.mjs.map +0 -1
- package/dist/chunk-5SC3CO5Q.mjs +0 -69
- package/dist/chunk-5SC3CO5Q.mjs.map +0 -1
- package/dist/chunk-6VUKDHOD.mjs +0 -1
- package/dist/chunk-6VUKDHOD.mjs.map +0 -1
- package/dist/chunk-AEFM73CL.mjs +0 -32
- package/dist/chunk-AEFM73CL.mjs.map +0 -1
- package/dist/chunk-AI3Z3CHN.mjs +0 -97
- package/dist/chunk-AI3Z3CHN.mjs.map +0 -1
- package/dist/chunk-AXFRCGH6.mjs +0 -107
- package/dist/chunk-AXFRCGH6.mjs.map +0 -1
- package/dist/chunk-BT6C5OPU.mjs +0 -278
- package/dist/chunk-BT6C5OPU.mjs.map +0 -1
- package/dist/chunk-CGLGXQAU.mjs +0 -78
- package/dist/chunk-CGLGXQAU.mjs.map +0 -1
- package/dist/chunk-CSHBUHRW.mjs +0 -69
- package/dist/chunk-CSHBUHRW.mjs.map +0 -1
- package/dist/chunk-CZ3GI3IF.mjs +0 -283
- package/dist/chunk-CZ3GI3IF.mjs.map +0 -1
- package/dist/chunk-DVUQO72Z.mjs +0 -1
- package/dist/chunk-DVUQO72Z.mjs.map +0 -1
- package/dist/chunk-E4HD4M7R.mjs +0 -76
- package/dist/chunk-E4HD4M7R.mjs.map +0 -1
- package/dist/chunk-E56GYBP3.mjs +0 -101
- package/dist/chunk-E56GYBP3.mjs.map +0 -1
- package/dist/chunk-EJ5ZEAAN.mjs +0 -57
- package/dist/chunk-EJ5ZEAAN.mjs.map +0 -1
- package/dist/chunk-ETWJDCGE.mjs +0 -1
- package/dist/chunk-ETWJDCGE.mjs.map +0 -1
- package/dist/chunk-F43IPGPA.mjs +0 -311
- package/dist/chunk-F43IPGPA.mjs.map +0 -1
- package/dist/chunk-FIBK3DYE.mjs +0 -26
- package/dist/chunk-FIBK3DYE.mjs.map +0 -1
- package/dist/chunk-FVURPXQK.mjs +0 -45
- package/dist/chunk-FVURPXQK.mjs.map +0 -1
- package/dist/chunk-FZR2XQKR.mjs +0 -44
- package/dist/chunk-FZR2XQKR.mjs.map +0 -1
- package/dist/chunk-IA4CLXDM.mjs +0 -76
- package/dist/chunk-IA4CLXDM.mjs.map +0 -1
- package/dist/chunk-IH5VFJ4L.mjs +0 -60
- package/dist/chunk-IH5VFJ4L.mjs.map +0 -1
- package/dist/chunk-IICUCI5S.mjs +0 -43
- package/dist/chunk-IICUCI5S.mjs.map +0 -1
- package/dist/chunk-JLVGSNAO.mjs +0 -311
- package/dist/chunk-JLVGSNAO.mjs.map +0 -1
- package/dist/chunk-JWOIINVV.mjs +0 -237
- package/dist/chunk-JWOIINVV.mjs.map +0 -1
- package/dist/chunk-KCVDFZJX.mjs +0 -873
- package/dist/chunk-KCVDFZJX.mjs.map +0 -1
- package/dist/chunk-KPRUSQ3K.mjs +0 -1
- package/dist/chunk-KPRUSQ3K.mjs.map +0 -1
- package/dist/chunk-MWC5OV7Z.mjs +0 -1
- package/dist/chunk-MWC5OV7Z.mjs.map +0 -1
- package/dist/chunk-N5EP5OD5.mjs +0 -1
- package/dist/chunk-N5EP5OD5.mjs.map +0 -1
- package/dist/chunk-NASFZS3N.mjs +0 -43
- package/dist/chunk-NASFZS3N.mjs.map +0 -1
- package/dist/chunk-NB2GZAKG.mjs +0 -131
- package/dist/chunk-NB2GZAKG.mjs.map +0 -1
- package/dist/chunk-NB4DFAZH.mjs +0 -185
- package/dist/chunk-NB4DFAZH.mjs.map +0 -1
- package/dist/chunk-NNAYEAP2.mjs +0 -49
- package/dist/chunk-NNAYEAP2.mjs.map +0 -1
- package/dist/chunk-NNPKBGD6.mjs +0 -37
- package/dist/chunk-NNPKBGD6.mjs.map +0 -1
- package/dist/chunk-OMPVTGXH.mjs +0 -122
- package/dist/chunk-OMPVTGXH.mjs.map +0 -1
- package/dist/chunk-QFBM3ZT2.mjs +0 -45
- package/dist/chunk-QFBM3ZT2.mjs.map +0 -1
- package/dist/chunk-QJ6DZ645.mjs +0 -78
- package/dist/chunk-QJ6DZ645.mjs.map +0 -1
- package/dist/chunk-R5OLAA3L.mjs +0 -135
- package/dist/chunk-R5OLAA3L.mjs.map +0 -1
- package/dist/chunk-RF2CGPHQ.mjs +0 -215
- package/dist/chunk-RF2CGPHQ.mjs.map +0 -1
- package/dist/chunk-RGD2L3Z4.mjs +0 -96
- package/dist/chunk-RGD2L3Z4.mjs.map +0 -1
- package/dist/chunk-RK5P2LG6.mjs +0 -57
- package/dist/chunk-RK5P2LG6.mjs.map +0 -1
- package/dist/chunk-RRXDJCXI.mjs +0 -60
- package/dist/chunk-RRXDJCXI.mjs.map +0 -1
- package/dist/chunk-SPDE34WC.mjs +0 -283
- package/dist/chunk-SPDE34WC.mjs.map +0 -1
- package/dist/chunk-TAUOEJH2.mjs +0 -120
- package/dist/chunk-TAUOEJH2.mjs.map +0 -1
- package/dist/chunk-TKFOXPXF.mjs +0 -157
- package/dist/chunk-TKFOXPXF.mjs.map +0 -1
- package/dist/chunk-UOX5D73C.mjs +0 -22
- package/dist/chunk-UOX5D73C.mjs.map +0 -1
- package/dist/chunk-US4KNAAV.mjs +0 -1
- package/dist/chunk-US4KNAAV.mjs.map +0 -1
- package/dist/chunk-UZB3CTOY.mjs +0 -873
- package/dist/chunk-UZB3CTOY.mjs.map +0 -1
- package/dist/chunk-VBI6JXPC.mjs +0 -1
- package/dist/chunk-VBI6JXPC.mjs.map +0 -1
- package/dist/chunk-VE3SBLU7.mjs +0 -215
- package/dist/chunk-VE3SBLU7.mjs.map +0 -1
- package/dist/chunk-VUHFLJWI.mjs +0 -185
- package/dist/chunk-VUHFLJWI.mjs.map +0 -1
- package/dist/chunk-VVAXSF3M.mjs +0 -61
- package/dist/chunk-VVAXSF3M.mjs.map +0 -1
- package/dist/chunk-W5DUKRCI.mjs +0 -97
- package/dist/chunk-W5DUKRCI.mjs.map +0 -1
- package/dist/chunk-WNRDFAZ5.mjs +0 -22
- package/dist/chunk-WNRDFAZ5.mjs.map +0 -1
- package/dist/chunk-XO4IRKSC.mjs +0 -11
- package/dist/chunk-XO4IRKSC.mjs.map +0 -1
- package/dist/chunk-XU5CEPYQ.mjs +0 -75
- package/dist/chunk-XU5CEPYQ.mjs.map +0 -1
- package/dist/chunk-YPH4BHOY.mjs +0 -39
- package/dist/chunk-YPH4BHOY.mjs.map +0 -1
- package/dist/chunk-YVPPF62K.mjs +0 -32
- package/dist/chunk-YVPPF62K.mjs.map +0 -1
- package/dist/chunk-YZUPVMHC.mjs +0 -1
- package/dist/chunk-YZUPVMHC.mjs.map +0 -1
- package/dist/chunk-Z3OIGQCZ.mjs +0 -75
- package/dist/chunk-Z3OIGQCZ.mjs.map +0 -1
- package/dist/chunk-ZIDT52TM.mjs +0 -131
- package/dist/chunk-ZIDT52TM.mjs.map +0 -1
- package/dist/components/CopilotKitInspector.d.mts +0 -13
- package/dist/components/CopilotKitInspector.d.ts +0 -13
- package/dist/components/CopilotKitInspector.js +0 -69
- package/dist/components/CopilotKitInspector.js.map +0 -1
- package/dist/components/CopilotKitInspector.mjs +0 -7
- package/dist/components/CopilotKitInspector.mjs.map +0 -1
- package/dist/components/WildcardToolCallRender.d.mts +0 -7
- package/dist/components/WildcardToolCallRender.d.ts +0 -7
- package/dist/components/WildcardToolCallRender.js +0 -106
- package/dist/components/WildcardToolCallRender.js.map +0 -1
- package/dist/components/WildcardToolCallRender.mjs +0 -8
- package/dist/components/WildcardToolCallRender.mjs.map +0 -1
- package/dist/components/chat/CopilotChat.d.mts +0 -30
- package/dist/components/chat/CopilotChat.d.ts +0 -30
- package/dist/components/chat/CopilotChat.js +0 -2934
- package/dist/components/chat/CopilotChat.js.map +0 -1
- package/dist/components/chat/CopilotChat.mjs +0 -37
- package/dist/components/chat/CopilotChat.mjs.map +0 -1
- package/dist/components/chat/CopilotChatAssistantMessage.d.mts +0 -45
- package/dist/components/chat/CopilotChatAssistantMessage.d.ts +0 -45
- package/dist/components/chat/CopilotChatAssistantMessage.js +0 -735
- package/dist/components/chat/CopilotChatAssistantMessage.js.map +0 -1
- package/dist/components/chat/CopilotChatAssistantMessage.mjs +0 -29
- package/dist/components/chat/CopilotChatAssistantMessage.mjs.map +0 -1
- package/dist/components/chat/CopilotChatAudioRecorder.d.mts +0 -11
- package/dist/components/chat/CopilotChatAudioRecorder.d.ts +0 -11
- package/dist/components/chat/CopilotChatAudioRecorder.js +0 -131
- package/dist/components/chat/CopilotChatAudioRecorder.js.map +0 -1
- package/dist/components/chat/CopilotChatAudioRecorder.mjs +0 -9
- package/dist/components/chat/CopilotChatAudioRecorder.mjs.map +0 -1
- package/dist/components/chat/CopilotChatInput.d.mts +0 -67
- package/dist/components/chat/CopilotChatInput.d.ts +0 -67
- package/dist/components/chat/CopilotChatInput.js +0 -1305
- package/dist/components/chat/CopilotChatInput.js.map +0 -1
- package/dist/components/chat/CopilotChatInput.mjs +0 -16
- package/dist/components/chat/CopilotChatInput.mjs.map +0 -1
- package/dist/components/chat/CopilotChatMessageView.d.mts +0 -29
- package/dist/components/chat/CopilotChatMessageView.d.ts +0 -29
- package/dist/components/chat/CopilotChatMessageView.js +0 -1164
- package/dist/components/chat/CopilotChatMessageView.js.map +0 -1
- package/dist/components/chat/CopilotChatMessageView.mjs +0 -31
- package/dist/components/chat/CopilotChatMessageView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionPill.d.mts +0 -11
- package/dist/components/chat/CopilotChatSuggestionPill.d.ts +0 -11
- package/dist/components/chat/CopilotChatSuggestionPill.js +0 -76
- package/dist/components/chat/CopilotChatSuggestionPill.js.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionPill.mjs +0 -10
- package/dist/components/chat/CopilotChatSuggestionPill.mjs.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionView.d.mts +0 -33
- package/dist/components/chat/CopilotChatSuggestionView.d.ts +0 -33
- package/dist/components/chat/CopilotChatSuggestionView.js +0 -179
- package/dist/components/chat/CopilotChatSuggestionView.js.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionView.mjs +0 -12
- package/dist/components/chat/CopilotChatSuggestionView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatToggleButton.d.mts +0 -14
- package/dist/components/chat/CopilotChatToggleButton.d.ts +0 -14
- package/dist/components/chat/CopilotChatToggleButton.js +0 -222
- package/dist/components/chat/CopilotChatToggleButton.js.map +0 -1
- package/dist/components/chat/CopilotChatToggleButton.mjs +0 -16
- package/dist/components/chat/CopilotChatToggleButton.mjs.map +0 -1
- package/dist/components/chat/CopilotChatToolCallsView.d.mts +0 -10
- package/dist/components/chat/CopilotChatToolCallsView.d.ts +0 -10
- package/dist/components/chat/CopilotChatToolCallsView.js +0 -264
- package/dist/components/chat/CopilotChatToolCallsView.js.map +0 -1
- package/dist/components/chat/CopilotChatToolCallsView.mjs +0 -24
- package/dist/components/chat/CopilotChatToolCallsView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatUserMessage.d.mts +0 -52
- package/dist/components/chat/CopilotChatUserMessage.d.ts +0 -52
- package/dist/components/chat/CopilotChatUserMessage.js +0 -523
- package/dist/components/chat/CopilotChatUserMessage.js.map +0 -1
- package/dist/components/chat/CopilotChatUserMessage.mjs +0 -14
- package/dist/components/chat/CopilotChatUserMessage.mjs.map +0 -1
- package/dist/components/chat/CopilotChatView.d.mts +0 -54
- package/dist/components/chat/CopilotChatView.d.ts +0 -54
- package/dist/components/chat/CopilotChatView.js +0 -2640
- package/dist/components/chat/CopilotChatView.js.map +0 -1
- package/dist/components/chat/CopilotChatView.mjs +0 -38
- package/dist/components/chat/CopilotChatView.mjs.map +0 -1
- package/dist/components/chat/CopilotModalHeader.d.mts +0 -22
- package/dist/components/chat/CopilotModalHeader.d.ts +0 -22
- package/dist/components/chat/CopilotModalHeader.js +0 -186
- package/dist/components/chat/CopilotModalHeader.js.map +0 -1
- package/dist/components/chat/CopilotModalHeader.mjs +0 -12
- package/dist/components/chat/CopilotModalHeader.mjs.map +0 -1
- package/dist/components/chat/CopilotPopup.d.mts +0 -33
- package/dist/components/chat/CopilotPopup.d.ts +0 -33
- package/dist/components/chat/CopilotPopup.js +0 -3343
- package/dist/components/chat/CopilotPopup.js.map +0 -1
- package/dist/components/chat/CopilotPopup.mjs +0 -43
- package/dist/components/chat/CopilotPopup.mjs.map +0 -1
- package/dist/components/chat/CopilotPopupView.d.mts +0 -30
- package/dist/components/chat/CopilotPopupView.d.ts +0 -30
- package/dist/components/chat/CopilotPopupView.js +0 -3003
- package/dist/components/chat/CopilotPopupView.js.map +0 -1
- package/dist/components/chat/CopilotPopupView.mjs +0 -41
- package/dist/components/chat/CopilotPopupView.mjs.map +0 -1
- package/dist/components/chat/CopilotSidebar.d.mts +0 -31
- package/dist/components/chat/CopilotSidebar.d.ts +0 -31
- package/dist/components/chat/CopilotSidebar.js +0 -3266
- package/dist/components/chat/CopilotSidebar.js.map +0 -1
- package/dist/components/chat/CopilotSidebar.mjs +0 -43
- package/dist/components/chat/CopilotSidebar.mjs.map +0 -1
- package/dist/components/chat/CopilotSidebarView.d.mts +0 -28
- package/dist/components/chat/CopilotSidebarView.d.ts +0 -28
- package/dist/components/chat/CopilotSidebarView.js +0 -2941
- package/dist/components/chat/CopilotSidebarView.js.map +0 -1
- package/dist/components/chat/CopilotSidebarView.mjs +0 -41
- package/dist/components/chat/CopilotSidebarView.mjs.map +0 -1
- package/dist/components/chat/index.d.mts +0 -23
- package/dist/components/chat/index.d.ts +0 -23
- package/dist/components/chat/index.js +0 -3503
- package/dist/components/chat/index.js.map +0 -1
- package/dist/components/chat/index.mjs +0 -95
- package/dist/components/chat/index.mjs.map +0 -1
- package/dist/components/index.d.mts +0 -29
- package/dist/components/index.d.ts +0 -29
- package/dist/components/index.js +0 -3583
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -104
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/ui/button.d.mts +0 -14
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.js +0 -150
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/button.mjs +0 -10
- package/dist/components/ui/button.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -28
- package/dist/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu.js +0 -291
- package/dist/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -37
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/tooltip.d.mts +0 -10
- package/dist/components/ui/tooltip.d.ts +0 -10
- package/dist/components/ui/tooltip.js +0 -103
- package/dist/components/ui/tooltip.js.map +0 -1
- package/dist/components/ui/tooltip.mjs +0 -14
- package/dist/components/ui/tooltip.mjs.map +0 -1
- package/dist/hooks/index.d.mts +0 -19
- package/dist/hooks/index.d.ts +0 -19
- package/dist/hooks/index.js +0 -691
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -45
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/use-agent-context.d.mts +0 -5
- package/dist/hooks/use-agent-context.d.ts +0 -5
- package/dist/hooks/use-agent-context.js +0 -116
- package/dist/hooks/use-agent-context.js.map +0 -1
- package/dist/hooks/use-agent-context.mjs +0 -10
- package/dist/hooks/use-agent-context.mjs.map +0 -1
- package/dist/hooks/use-agent.d.mts +0 -16
- package/dist/hooks/use-agent.d.ts +0 -16
- package/dist/hooks/use-agent.js +0 -171
- package/dist/hooks/use-agent.js.map +0 -1
- package/dist/hooks/use-agent.mjs +0 -12
- package/dist/hooks/use-agent.mjs.map +0 -1
- package/dist/hooks/use-configure-suggestions.d.mts +0 -13
- package/dist/hooks/use-configure-suggestions.d.ts +0 -13
- package/dist/hooks/use-configure-suggestions.js +0 -232
- package/dist/hooks/use-configure-suggestions.js.map +0 -1
- package/dist/hooks/use-configure-suggestions.mjs +0 -11
- package/dist/hooks/use-configure-suggestions.mjs.map +0 -1
- package/dist/hooks/use-frontend-tool.d.mts +0 -8
- package/dist/hooks/use-frontend-tool.d.ts +0 -8
- package/dist/hooks/use-frontend-tool.js +0 -137
- package/dist/hooks/use-frontend-tool.js.map +0 -1
- package/dist/hooks/use-frontend-tool.mjs +0 -10
- package/dist/hooks/use-frontend-tool.mjs.map +0 -1
- package/dist/hooks/use-human-in-the-loop.d.mts +0 -7
- package/dist/hooks/use-human-in-the-loop.d.ts +0 -7
- package/dist/hooks/use-human-in-the-loop.js +0 -206
- package/dist/hooks/use-human-in-the-loop.js.map +0 -1
- package/dist/hooks/use-human-in-the-loop.mjs +0 -11
- package/dist/hooks/use-human-in-the-loop.mjs.map +0 -1
- package/dist/hooks/use-keyboard-height.d.mts +0 -15
- package/dist/hooks/use-keyboard-height.d.ts +0 -15
- package/dist/hooks/use-keyboard-height.js +0 -68
- package/dist/hooks/use-keyboard-height.js.map +0 -1
- package/dist/hooks/use-keyboard-height.mjs +0 -7
- package/dist/hooks/use-keyboard-height.mjs.map +0 -1
- package/dist/hooks/use-render-activity-message.d.mts +0 -5
- package/dist/hooks/use-render-activity-message.d.ts +0 -5
- package/dist/hooks/use-render-activity-message.js +0 -158
- package/dist/hooks/use-render-activity-message.js.map +0 -1
- package/dist/hooks/use-render-activity-message.mjs +0 -12
- package/dist/hooks/use-render-activity-message.mjs.map +0 -1
- package/dist/hooks/use-render-custom-messages.d.mts +0 -11
- package/dist/hooks/use-render-custom-messages.d.ts +0 -11
- package/dist/hooks/use-render-custom-messages.js +0 -170
- package/dist/hooks/use-render-custom-messages.js.map +0 -1
- package/dist/hooks/use-render-custom-messages.mjs +0 -12
- package/dist/hooks/use-render-custom-messages.mjs.map +0 -1
- package/dist/hooks/use-render-tool-call.d.mts +0 -16
- package/dist/hooks/use-render-tool-call.d.ts +0 -16
- package/dist/hooks/use-render-tool-call.js +0 -208
- package/dist/hooks/use-render-tool-call.js.map +0 -1
- package/dist/hooks/use-render-tool-call.mjs +0 -11
- package/dist/hooks/use-render-tool-call.mjs.map +0 -1
- package/dist/hooks/use-suggestions.d.mts +0 -14
- package/dist/hooks/use-suggestions.d.ts +0 -14
- package/dist/hooks/use-suggestions.js +0 -176
- package/dist/hooks/use-suggestions.js.map +0 -1
- package/dist/hooks/use-suggestions.mjs +0 -11
- package/dist/hooks/use-suggestions.mjs.map +0 -1
- package/dist/lib/react-core.d.mts +0 -33
- package/dist/lib/react-core.d.ts +0 -33
- package/dist/lib/react-core.js +0 -73
- package/dist/lib/react-core.js.map +0 -1
- package/dist/lib/react-core.mjs +0 -7
- package/dist/lib/react-core.mjs.map +0 -1
- package/dist/lib/slots.d.mts +0 -16
- package/dist/lib/slots.d.ts +0 -16
- package/dist/lib/slots.js +0 -60
- package/dist/lib/slots.js.map +0 -1
- package/dist/lib/slots.mjs +0 -7
- package/dist/lib/slots.mjs.map +0 -1
- package/dist/lib/utils.d.mts +0 -5
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +0 -35
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs +0 -7
- package/dist/lib/utils.mjs.map +0 -1
- package/dist/providers/CopilotChatConfigurationProvider.d.mts +0 -43
- package/dist/providers/CopilotChatConfigurationProvider.d.ts +0 -43
- package/dist/providers/CopilotChatConfigurationProvider.js +0 -109
- package/dist/providers/CopilotChatConfigurationProvider.js.map +0 -1
- package/dist/providers/CopilotChatConfigurationProvider.mjs +0 -11
- package/dist/providers/CopilotChatConfigurationProvider.mjs.map +0 -1
- package/dist/providers/CopilotKitProvider.d.mts +0 -33
- package/dist/providers/CopilotKitProvider.d.ts +0 -33
- package/dist/providers/CopilotKitProvider.js +0 -314
- package/dist/providers/CopilotKitProvider.js.map +0 -1
- package/dist/providers/CopilotKitProvider.mjs +0 -12
- package/dist/providers/CopilotKitProvider.mjs.map +0 -1
- package/dist/providers/index.d.mts +0 -13
- package/dist/providers/index.d.ts +0 -13
- package/dist/providers/index.js +0 -396
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/index.mjs +0 -18
- package/dist/providers/index.mjs.map +0 -1
- package/dist/types/defineToolCallRenderer.d.mts +0 -41
- package/dist/types/defineToolCallRenderer.d.ts +0 -41
- package/dist/types/defineToolCallRenderer.js +0 -40
- package/dist/types/defineToolCallRenderer.js.map +0 -1
- package/dist/types/defineToolCallRenderer.mjs +0 -7
- package/dist/types/defineToolCallRenderer.mjs.map +0 -1
- package/dist/types/frontend-tool.d.mts +0 -9
- package/dist/types/frontend-tool.d.ts +0 -9
- package/dist/types/frontend-tool.js +0 -19
- package/dist/types/frontend-tool.js.map +0 -1
- package/dist/types/frontend-tool.mjs +0 -2
- package/dist/types/frontend-tool.mjs.map +0 -1
- package/dist/types/human-in-the-loop.d.mts +0 -29
- package/dist/types/human-in-the-loop.d.ts +0 -29
- package/dist/types/human-in-the-loop.js +0 -19
- package/dist/types/human-in-the-loop.js.map +0 -1
- package/dist/types/human-in-the-loop.mjs +0 -2
- package/dist/types/human-in-the-loop.mjs.map +0 -1
- package/dist/types/index.d.mts +0 -11
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.js +0 -42
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -13
- package/dist/types/index.mjs.map +0 -1
- package/dist/types/react-activity-message-renderer.d.mts +0 -29
- package/dist/types/react-activity-message-renderer.d.ts +0 -29
- package/dist/types/react-activity-message-renderer.js +0 -19
- package/dist/types/react-activity-message-renderer.js.map +0 -1
- package/dist/types/react-activity-message-renderer.mjs +0 -2
- package/dist/types/react-activity-message-renderer.mjs.map +0 -1
- package/dist/types/react-custom-message-renderer.d.mts +0 -18
- package/dist/types/react-custom-message-renderer.d.ts +0 -18
- package/dist/types/react-custom-message-renderer.js +0 -19
- package/dist/types/react-custom-message-renderer.js.map +0 -1
- package/dist/types/react-custom-message-renderer.mjs +0 -2
- package/dist/types/react-custom-message-renderer.mjs.map +0 -1
- package/dist/types/react-tool-call-renderer.d.mts +0 -30
- package/dist/types/react-tool-call-renderer.d.ts +0 -30
- package/dist/types/react-tool-call-renderer.js +0 -19
- package/dist/types/react-tool-call-renderer.js.map +0 -1
- package/dist/types/react-tool-call-renderer.mjs +0 -2
- package/dist/types/react-tool-call-renderer.mjs.map +0 -1
|
@@ -1,735 +0,0 @@
|
|
|
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
|