@copilotkitnext/react 0.0.22-alpha.4 → 0.0.22-alpha.6
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-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-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-7HM7CU5A.mjs +0 -122
- package/dist/chunk-7HM7CU5A.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-BNT754Z2.mjs +0 -185
- package/dist/chunk-BNT754Z2.mjs.map +0 -1
- package/dist/chunk-BT6C5OPU.mjs +0 -278
- package/dist/chunk-BT6C5OPU.mjs.map +0 -1
- package/dist/chunk-CDSO65ZY.mjs +0 -157
- package/dist/chunk-CDSO65ZY.mjs.map +0 -1
- package/dist/chunk-CGLGXQAU.mjs +0 -78
- package/dist/chunk-CGLGXQAU.mjs.map +0 -1
- package/dist/chunk-DVUQO72Z.mjs +0 -1
- package/dist/chunk-DVUQO72Z.mjs.map +0 -1
- package/dist/chunk-E56GYBP3.mjs +0 -101
- package/dist/chunk-E56GYBP3.mjs.map +0 -1
- package/dist/chunk-ETWJDCGE.mjs +0 -1
- package/dist/chunk-ETWJDCGE.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-GK4NXPLC.mjs +0 -60
- package/dist/chunk-GK4NXPLC.mjs.map +0 -1
- package/dist/chunk-IA4CLXDM.mjs +0 -76
- package/dist/chunk-IA4CLXDM.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-N5HC66HU.mjs +0 -311
- package/dist/chunk-N5HC66HU.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-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-TBE7ZI5G.mjs +0 -45
- package/dist/chunk-TBE7ZI5G.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-VVAXSF3M.mjs +0 -61
- package/dist/chunk-VVAXSF3M.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-YZUPVMHC.mjs +0 -1
- package/dist/chunk-YZUPVMHC.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
package/dist/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
9
12
|
var __export = (target, all) => {
|
|
10
13
|
for (var name in all)
|
|
11
14
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -28,6 +31,242 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
31
|
));
|
|
29
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
33
|
|
|
34
|
+
// ../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/options.js
|
|
35
|
+
var require_options = __commonJS({
|
|
36
|
+
"../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/options.js"(exports2) {
|
|
37
|
+
"use strict";
|
|
38
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
39
|
+
exports2.Allow = exports2.ALL = exports2.COLLECTION = exports2.ATOM = exports2.SPECIAL = exports2.INF = exports2._INFINITY = exports2.INFINITY = exports2.NAN = exports2.BOOL = exports2.NULL = exports2.OBJ = exports2.ARR = exports2.NUM = exports2.STR = void 0;
|
|
40
|
+
exports2.STR = 1;
|
|
41
|
+
exports2.NUM = 2;
|
|
42
|
+
exports2.ARR = 4;
|
|
43
|
+
exports2.OBJ = 8;
|
|
44
|
+
exports2.NULL = 16;
|
|
45
|
+
exports2.BOOL = 32;
|
|
46
|
+
exports2.NAN = 64;
|
|
47
|
+
exports2.INFINITY = 128;
|
|
48
|
+
exports2._INFINITY = 256;
|
|
49
|
+
exports2.INF = exports2.INFINITY | exports2._INFINITY;
|
|
50
|
+
exports2.SPECIAL = exports2.NULL | exports2.BOOL | exports2.INF | exports2.NAN;
|
|
51
|
+
exports2.ATOM = exports2.STR | exports2.NUM | exports2.SPECIAL;
|
|
52
|
+
exports2.COLLECTION = exports2.ARR | exports2.OBJ;
|
|
53
|
+
exports2.ALL = exports2.ATOM | exports2.COLLECTION;
|
|
54
|
+
exports2.Allow = { STR: exports2.STR, NUM: exports2.NUM, ARR: exports2.ARR, OBJ: exports2.OBJ, NULL: exports2.NULL, BOOL: exports2.BOOL, NAN: exports2.NAN, INFINITY: exports2.INFINITY, _INFINITY: exports2._INFINITY, INF: exports2.INF, SPECIAL: exports2.SPECIAL, ATOM: exports2.ATOM, COLLECTION: exports2.COLLECTION, ALL: exports2.ALL };
|
|
55
|
+
exports2.default = exports2.Allow;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// ../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/index.js
|
|
60
|
+
var require_dist = __commonJS({
|
|
61
|
+
"../../node_modules/.pnpm/partial-json@0.1.7/node_modules/partial-json/dist/index.js"(exports2) {
|
|
62
|
+
"use strict";
|
|
63
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
64
|
+
if (k2 === void 0) k2 = k;
|
|
65
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
66
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
67
|
+
desc = { enumerable: true, get: function() {
|
|
68
|
+
return m[k];
|
|
69
|
+
} };
|
|
70
|
+
}
|
|
71
|
+
Object.defineProperty(o, k2, desc);
|
|
72
|
+
} : function(o, m, k, k2) {
|
|
73
|
+
if (k2 === void 0) k2 = k;
|
|
74
|
+
o[k2] = m[k];
|
|
75
|
+
});
|
|
76
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
77
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
78
|
+
};
|
|
79
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
80
|
+
exports2.Allow = exports2.MalformedJSON = exports2.PartialJSON = exports2.parseJSON = exports2.parse = void 0;
|
|
81
|
+
var options_1 = require_options();
|
|
82
|
+
Object.defineProperty(exports2, "Allow", { enumerable: true, get: function() {
|
|
83
|
+
return options_1.Allow;
|
|
84
|
+
} });
|
|
85
|
+
__exportStar(require_options(), exports2);
|
|
86
|
+
var PartialJSON2 = class extends Error {
|
|
87
|
+
};
|
|
88
|
+
exports2.PartialJSON = PartialJSON2;
|
|
89
|
+
var MalformedJSON = class extends Error {
|
|
90
|
+
};
|
|
91
|
+
exports2.MalformedJSON = MalformedJSON;
|
|
92
|
+
function parseJSON(jsonString, allowPartial = options_1.Allow.ALL) {
|
|
93
|
+
if (typeof jsonString !== "string") {
|
|
94
|
+
throw new TypeError(`expecting str, got ${typeof jsonString}`);
|
|
95
|
+
}
|
|
96
|
+
if (!jsonString.trim()) {
|
|
97
|
+
throw new Error(`${jsonString} is empty`);
|
|
98
|
+
}
|
|
99
|
+
return _parseJSON(jsonString.trim(), allowPartial);
|
|
100
|
+
}
|
|
101
|
+
exports2.parseJSON = parseJSON;
|
|
102
|
+
var _parseJSON = (jsonString, allow) => {
|
|
103
|
+
const length = jsonString.length;
|
|
104
|
+
let index = 0;
|
|
105
|
+
const markPartialJSON = (msg) => {
|
|
106
|
+
throw new PartialJSON2(`${msg} at position ${index}`);
|
|
107
|
+
};
|
|
108
|
+
const throwMalformedError = (msg) => {
|
|
109
|
+
throw new MalformedJSON(`${msg} at position ${index}`);
|
|
110
|
+
};
|
|
111
|
+
const parseAny = () => {
|
|
112
|
+
skipBlank();
|
|
113
|
+
if (index >= length)
|
|
114
|
+
markPartialJSON("Unexpected end of input");
|
|
115
|
+
if (jsonString[index] === '"')
|
|
116
|
+
return parseStr();
|
|
117
|
+
if (jsonString[index] === "{")
|
|
118
|
+
return parseObj();
|
|
119
|
+
if (jsonString[index] === "[")
|
|
120
|
+
return parseArr();
|
|
121
|
+
if (jsonString.substring(index, index + 4) === "null" || options_1.Allow.NULL & allow && length - index < 4 && "null".startsWith(jsonString.substring(index))) {
|
|
122
|
+
index += 4;
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
if (jsonString.substring(index, index + 4) === "true" || options_1.Allow.BOOL & allow && length - index < 4 && "true".startsWith(jsonString.substring(index))) {
|
|
126
|
+
index += 4;
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
if (jsonString.substring(index, index + 5) === "false" || options_1.Allow.BOOL & allow && length - index < 5 && "false".startsWith(jsonString.substring(index))) {
|
|
130
|
+
index += 5;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (jsonString.substring(index, index + 8) === "Infinity" || options_1.Allow.INFINITY & allow && length - index < 8 && "Infinity".startsWith(jsonString.substring(index))) {
|
|
134
|
+
index += 8;
|
|
135
|
+
return Infinity;
|
|
136
|
+
}
|
|
137
|
+
if (jsonString.substring(index, index + 9) === "-Infinity" || options_1.Allow._INFINITY & allow && 1 < length - index && length - index < 9 && "-Infinity".startsWith(jsonString.substring(index))) {
|
|
138
|
+
index += 9;
|
|
139
|
+
return -Infinity;
|
|
140
|
+
}
|
|
141
|
+
if (jsonString.substring(index, index + 3) === "NaN" || options_1.Allow.NAN & allow && length - index < 3 && "NaN".startsWith(jsonString.substring(index))) {
|
|
142
|
+
index += 3;
|
|
143
|
+
return NaN;
|
|
144
|
+
}
|
|
145
|
+
return parseNum();
|
|
146
|
+
};
|
|
147
|
+
const parseStr = () => {
|
|
148
|
+
const start = index;
|
|
149
|
+
let escape = false;
|
|
150
|
+
index++;
|
|
151
|
+
while (index < length && (jsonString[index] !== '"' || escape && jsonString[index - 1] === "\\")) {
|
|
152
|
+
escape = jsonString[index] === "\\" ? !escape : false;
|
|
153
|
+
index++;
|
|
154
|
+
}
|
|
155
|
+
if (jsonString.charAt(index) == '"') {
|
|
156
|
+
try {
|
|
157
|
+
return JSON.parse(jsonString.substring(start, ++index - Number(escape)));
|
|
158
|
+
} catch (e) {
|
|
159
|
+
throwMalformedError(String(e));
|
|
160
|
+
}
|
|
161
|
+
} else if (options_1.Allow.STR & allow) {
|
|
162
|
+
try {
|
|
163
|
+
return JSON.parse(jsonString.substring(start, index - Number(escape)) + '"');
|
|
164
|
+
} catch (e) {
|
|
165
|
+
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("\\")) + '"');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
markPartialJSON("Unterminated string literal");
|
|
169
|
+
};
|
|
170
|
+
const parseObj = () => {
|
|
171
|
+
index++;
|
|
172
|
+
skipBlank();
|
|
173
|
+
const obj = {};
|
|
174
|
+
try {
|
|
175
|
+
while (jsonString[index] !== "}") {
|
|
176
|
+
skipBlank();
|
|
177
|
+
if (index >= length && options_1.Allow.OBJ & allow)
|
|
178
|
+
return obj;
|
|
179
|
+
const key = parseStr();
|
|
180
|
+
skipBlank();
|
|
181
|
+
index++;
|
|
182
|
+
try {
|
|
183
|
+
const value = parseAny();
|
|
184
|
+
obj[key] = value;
|
|
185
|
+
} catch (e) {
|
|
186
|
+
if (options_1.Allow.OBJ & allow)
|
|
187
|
+
return obj;
|
|
188
|
+
else
|
|
189
|
+
throw e;
|
|
190
|
+
}
|
|
191
|
+
skipBlank();
|
|
192
|
+
if (jsonString[index] === ",")
|
|
193
|
+
index++;
|
|
194
|
+
}
|
|
195
|
+
} catch (e) {
|
|
196
|
+
if (options_1.Allow.OBJ & allow)
|
|
197
|
+
return obj;
|
|
198
|
+
else
|
|
199
|
+
markPartialJSON("Expected '}' at end of object");
|
|
200
|
+
}
|
|
201
|
+
index++;
|
|
202
|
+
return obj;
|
|
203
|
+
};
|
|
204
|
+
const parseArr = () => {
|
|
205
|
+
index++;
|
|
206
|
+
const arr = [];
|
|
207
|
+
try {
|
|
208
|
+
while (jsonString[index] !== "]") {
|
|
209
|
+
arr.push(parseAny());
|
|
210
|
+
skipBlank();
|
|
211
|
+
if (jsonString[index] === ",") {
|
|
212
|
+
index++;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
} catch (e) {
|
|
216
|
+
if (options_1.Allow.ARR & allow) {
|
|
217
|
+
return arr;
|
|
218
|
+
}
|
|
219
|
+
markPartialJSON("Expected ']' at end of array");
|
|
220
|
+
}
|
|
221
|
+
index++;
|
|
222
|
+
return arr;
|
|
223
|
+
};
|
|
224
|
+
const parseNum = () => {
|
|
225
|
+
if (index === 0) {
|
|
226
|
+
if (jsonString === "-")
|
|
227
|
+
throwMalformedError("Not sure what '-' is");
|
|
228
|
+
try {
|
|
229
|
+
return JSON.parse(jsonString);
|
|
230
|
+
} catch (e) {
|
|
231
|
+
if (options_1.Allow.NUM & allow)
|
|
232
|
+
try {
|
|
233
|
+
return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf("e")));
|
|
234
|
+
} catch (e2) {
|
|
235
|
+
}
|
|
236
|
+
throwMalformedError(String(e));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const start = index;
|
|
240
|
+
if (jsonString[index] === "-")
|
|
241
|
+
index++;
|
|
242
|
+
while (jsonString[index] && ",]}".indexOf(jsonString[index]) === -1)
|
|
243
|
+
index++;
|
|
244
|
+
if (index == length && !(options_1.Allow.NUM & allow))
|
|
245
|
+
markPartialJSON("Unterminated number literal");
|
|
246
|
+
try {
|
|
247
|
+
return JSON.parse(jsonString.substring(start, index));
|
|
248
|
+
} catch (e) {
|
|
249
|
+
if (jsonString.substring(start, index) === "-")
|
|
250
|
+
markPartialJSON("Not sure what '-' is");
|
|
251
|
+
try {
|
|
252
|
+
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf("e")));
|
|
253
|
+
} catch (e2) {
|
|
254
|
+
throwMalformedError(String(e2));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const skipBlank = () => {
|
|
259
|
+
while (index < length && " \n\r ".includes(jsonString[index])) {
|
|
260
|
+
index++;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
return parseAny();
|
|
264
|
+
};
|
|
265
|
+
var parse2 = parseJSON;
|
|
266
|
+
exports2.parse = parse2;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
31
270
|
// src/index.ts
|
|
32
271
|
var index_exports = {};
|
|
33
272
|
__export(index_exports, {
|
|
@@ -77,7 +316,78 @@ var import_lucide_react2 = require("lucide-react");
|
|
|
77
316
|
|
|
78
317
|
// src/providers/CopilotChatConfigurationProvider.tsx
|
|
79
318
|
var import_react = require("react");
|
|
80
|
-
|
|
319
|
+
|
|
320
|
+
// ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js
|
|
321
|
+
var byteToHex = [];
|
|
322
|
+
for (let i = 0; i < 256; ++i) {
|
|
323
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
324
|
+
}
|
|
325
|
+
function unsafeStringify(arr, offset = 0) {
|
|
326
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js
|
|
330
|
+
var import_crypto = require("crypto");
|
|
331
|
+
var rnds8Pool = new Uint8Array(256);
|
|
332
|
+
var poolPtr = rnds8Pool.length;
|
|
333
|
+
function rng() {
|
|
334
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
335
|
+
(0, import_crypto.randomFillSync)(rnds8Pool);
|
|
336
|
+
poolPtr = 0;
|
|
337
|
+
}
|
|
338
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js
|
|
342
|
+
var import_crypto2 = require("crypto");
|
|
343
|
+
var native_default = { randomUUID: import_crypto2.randomUUID };
|
|
344
|
+
|
|
345
|
+
// ../../node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js
|
|
346
|
+
function v4(options, buf, offset) {
|
|
347
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
348
|
+
return native_default.randomUUID();
|
|
349
|
+
}
|
|
350
|
+
options = options || {};
|
|
351
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
352
|
+
if (rnds.length < 16) {
|
|
353
|
+
throw new Error("Random bytes length must be >= 16");
|
|
354
|
+
}
|
|
355
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
356
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
357
|
+
if (buf) {
|
|
358
|
+
offset = offset || 0;
|
|
359
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
360
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
361
|
+
}
|
|
362
|
+
for (let i = 0; i < 16; ++i) {
|
|
363
|
+
buf[offset + i] = rnds[i];
|
|
364
|
+
}
|
|
365
|
+
return buf;
|
|
366
|
+
}
|
|
367
|
+
return unsafeStringify(rnds);
|
|
368
|
+
}
|
|
369
|
+
var v4_default = v4;
|
|
370
|
+
|
|
371
|
+
// ../shared/src/utils.ts
|
|
372
|
+
var PartialJSON = __toESM(require_dist());
|
|
373
|
+
function randomUUID2() {
|
|
374
|
+
return v4_default();
|
|
375
|
+
}
|
|
376
|
+
function partialJSONParse(json) {
|
|
377
|
+
try {
|
|
378
|
+
return PartialJSON.parse(json);
|
|
379
|
+
} catch (error) {
|
|
380
|
+
return {};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// ../shared/src/constants.ts
|
|
385
|
+
var DEFAULT_AGENT_ID = "default";
|
|
386
|
+
|
|
387
|
+
// ../shared/src/finalize-events.ts
|
|
388
|
+
var import_client = require("@ag-ui/client");
|
|
389
|
+
|
|
390
|
+
// src/providers/CopilotChatConfigurationProvider.tsx
|
|
81
391
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
82
392
|
var CopilotChatDefaultLabels = {
|
|
83
393
|
chatInputPlaceholder: "Type a message...",
|
|
@@ -111,7 +421,7 @@ var CopilotChatConfigurationProvider = ({ children, labels, agentId, threadId, i
|
|
|
111
421
|
}),
|
|
112
422
|
[labels, parentConfig?.labels]
|
|
113
423
|
);
|
|
114
|
-
const resolvedAgentId = agentId ?? parentConfig?.agentId ??
|
|
424
|
+
const resolvedAgentId = agentId ?? parentConfig?.agentId ?? DEFAULT_AGENT_ID;
|
|
115
425
|
const resolvedThreadId = (0, import_react.useMemo)(() => {
|
|
116
426
|
if (threadId) {
|
|
117
427
|
return threadId;
|
|
@@ -119,7 +429,7 @@ var CopilotChatConfigurationProvider = ({ children, labels, agentId, threadId, i
|
|
|
119
429
|
if (parentConfig?.threadId) {
|
|
120
430
|
return parentConfig.threadId;
|
|
121
431
|
}
|
|
122
|
-
return (
|
|
432
|
+
return randomUUID2();
|
|
123
433
|
}, [threadId, parentConfig?.threadId]);
|
|
124
434
|
const resolvedDefaultOpen = isModalDefaultOpen ?? parentConfig?.isModalDefaultOpen ?? true;
|
|
125
435
|
const [internalModalOpen, setInternalModalOpen] = (0, import_react.useState)(
|
|
@@ -1673,13 +1983,11 @@ var useCopilotKit = () => {
|
|
|
1673
1983
|
};
|
|
1674
1984
|
|
|
1675
1985
|
// src/hooks/use-render-tool-call.tsx
|
|
1676
|
-
var import_shared2 = require("@copilotkitnext/shared");
|
|
1677
|
-
var import_shared3 = require("@copilotkitnext/shared");
|
|
1678
1986
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1679
1987
|
function useRenderToolCall() {
|
|
1680
1988
|
const { copilotkit } = useCopilotKit();
|
|
1681
1989
|
const config = useCopilotChatConfiguration();
|
|
1682
|
-
const agentId = config?.agentId ??
|
|
1990
|
+
const agentId = config?.agentId ?? DEFAULT_AGENT_ID;
|
|
1683
1991
|
const [executingToolCallIds, setExecutingToolCallIds] = (0, import_react7.useState)(() => /* @__PURE__ */ new Set());
|
|
1684
1992
|
const renderToolCalls = (0, import_react7.useSyncExternalStore)(
|
|
1685
1993
|
(callback) => {
|
|
@@ -1724,7 +2032,7 @@ function useRenderToolCall() {
|
|
|
1724
2032
|
return null;
|
|
1725
2033
|
}
|
|
1726
2034
|
const RenderComponent = renderConfig.render;
|
|
1727
|
-
const args =
|
|
2035
|
+
const args = partialJSONParse(toolCall.function.arguments);
|
|
1728
2036
|
const toolName = toolCall.function.name;
|
|
1729
2037
|
if (toolMessage) {
|
|
1730
2038
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1825,13 +2133,12 @@ function useRenderCustomMessages() {
|
|
|
1825
2133
|
}
|
|
1826
2134
|
|
|
1827
2135
|
// src/hooks/use-render-activity-message.tsx
|
|
1828
|
-
var import_shared4 = require("@copilotkitnext/shared");
|
|
1829
2136
|
var import_react8 = require("react");
|
|
1830
2137
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1831
2138
|
function useRenderActivityMessage() {
|
|
1832
2139
|
const { copilotkit } = useCopilotKit();
|
|
1833
2140
|
const config = useCopilotChatConfiguration();
|
|
1834
|
-
const agentId = config?.agentId ??
|
|
2141
|
+
const agentId = config?.agentId ?? DEFAULT_AGENT_ID;
|
|
1835
2142
|
const renderers = copilotkit.renderActivityMessages;
|
|
1836
2143
|
return (0, import_react8.useCallback)(
|
|
1837
2144
|
(message) => {
|
|
@@ -1974,14 +2281,13 @@ function useHumanInTheLoop(tool) {
|
|
|
1974
2281
|
|
|
1975
2282
|
// src/hooks/use-agent.tsx
|
|
1976
2283
|
var import_react12 = require("react");
|
|
1977
|
-
var import_shared5 = require("@copilotkitnext/shared");
|
|
1978
2284
|
var ALL_UPDATES = [
|
|
1979
2285
|
"OnMessagesChanged" /* OnMessagesChanged */,
|
|
1980
2286
|
"OnStateChanged" /* OnStateChanged */,
|
|
1981
2287
|
"OnRunStatusChanged" /* OnRunStatusChanged */
|
|
1982
2288
|
];
|
|
1983
2289
|
function useAgent({ agentId, updates } = {}) {
|
|
1984
|
-
agentId ??=
|
|
2290
|
+
agentId ??= DEFAULT_AGENT_ID;
|
|
1985
2291
|
const { copilotkit } = useCopilotKit();
|
|
1986
2292
|
const [, forceUpdate] = (0, import_react12.useReducer)((x) => x + 1, 0);
|
|
1987
2293
|
const updateFlags = (0, import_react12.useMemo)(
|
|
@@ -2049,11 +2355,10 @@ function useAgentContext(context) {
|
|
|
2049
2355
|
|
|
2050
2356
|
// src/hooks/use-suggestions.tsx
|
|
2051
2357
|
var import_react14 = require("react");
|
|
2052
|
-
var import_shared6 = require("@copilotkitnext/shared");
|
|
2053
2358
|
function useSuggestions({ agentId } = {}) {
|
|
2054
2359
|
const { copilotkit } = useCopilotKit();
|
|
2055
2360
|
const config = useCopilotChatConfiguration();
|
|
2056
|
-
const resolvedAgentId = (0, import_react14.useMemo)(() => agentId ?? config?.agentId ??
|
|
2361
|
+
const resolvedAgentId = (0, import_react14.useMemo)(() => agentId ?? config?.agentId ?? DEFAULT_AGENT_ID, [agentId, config?.agentId]);
|
|
2057
2362
|
const [suggestions, setSuggestions] = (0, import_react14.useState)(() => {
|
|
2058
2363
|
const result = copilotkit.getSuggestions(resolvedAgentId);
|
|
2059
2364
|
return result.suggestions;
|
|
@@ -2113,13 +2418,12 @@ function useSuggestions({ agentId } = {}) {
|
|
|
2113
2418
|
|
|
2114
2419
|
// src/hooks/use-configure-suggestions.tsx
|
|
2115
2420
|
var import_react15 = require("react");
|
|
2116
|
-
var import_shared7 = require("@copilotkitnext/shared");
|
|
2117
2421
|
var EMPTY_DEPS = [];
|
|
2118
2422
|
function useConfigureSuggestions(config, options) {
|
|
2119
2423
|
const { copilotkit } = useCopilotKit();
|
|
2120
2424
|
const chatConfig = useCopilotChatConfiguration();
|
|
2121
2425
|
const extraDeps = options?.deps ?? EMPTY_DEPS;
|
|
2122
|
-
const resolvedConsumerAgentId = (0, import_react15.useMemo)(() => chatConfig?.agentId ??
|
|
2426
|
+
const resolvedConsumerAgentId = (0, import_react15.useMemo)(() => chatConfig?.agentId ?? DEFAULT_AGENT_ID, [chatConfig?.agentId]);
|
|
2123
2427
|
const rawConsumerAgentId = (0, import_react15.useMemo)(() => config ? config.consumerAgentId : void 0, [config]);
|
|
2124
2428
|
const normalizationCacheRef = (0, import_react15.useRef)({
|
|
2125
2429
|
serialized: null,
|
|
@@ -3266,16 +3570,15 @@ function CopilotChatView({
|
|
|
3266
3570
|
var CopilotChatView_default = CopilotChatView;
|
|
3267
3571
|
|
|
3268
3572
|
// src/components/chat/CopilotChat.tsx
|
|
3269
|
-
var import_shared8 = require("@copilotkitnext/shared");
|
|
3270
3573
|
var import_react23 = require("react");
|
|
3271
3574
|
var import_ts_deepmerge = require("ts-deepmerge");
|
|
3272
|
-
var
|
|
3575
|
+
var import_client2 = require("@ag-ui/client");
|
|
3273
3576
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3274
3577
|
function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen, ...props }) {
|
|
3275
3578
|
const existingConfig = useCopilotChatConfiguration();
|
|
3276
|
-
const resolvedAgentId = agentId ?? existingConfig?.agentId ??
|
|
3579
|
+
const resolvedAgentId = agentId ?? existingConfig?.agentId ?? DEFAULT_AGENT_ID;
|
|
3277
3580
|
const resolvedThreadId = (0, import_react23.useMemo)(
|
|
3278
|
-
() => threadId ?? existingConfig?.threadId ?? (
|
|
3581
|
+
() => threadId ?? existingConfig?.threadId ?? randomUUID2(),
|
|
3279
3582
|
[threadId, existingConfig?.threadId]
|
|
3280
3583
|
);
|
|
3281
3584
|
const { agent } = useAgent({ agentId: resolvedAgentId });
|
|
@@ -3292,7 +3595,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
3292
3595
|
try {
|
|
3293
3596
|
await copilotkit.connectAgent({ agent: agent2 });
|
|
3294
3597
|
} catch (error) {
|
|
3295
|
-
if (error instanceof
|
|
3598
|
+
if (error instanceof import_client2.AGUIConnectNotImplementedError) {
|
|
3296
3599
|
} else {
|
|
3297
3600
|
throw error;
|
|
3298
3601
|
}
|
|
@@ -3308,7 +3611,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
3308
3611
|
const onSubmitInput = (0, import_react23.useCallback)(
|
|
3309
3612
|
async (value) => {
|
|
3310
3613
|
agent?.addMessage({
|
|
3311
|
-
id: (
|
|
3614
|
+
id: randomUUID2(),
|
|
3312
3615
|
role: "user",
|
|
3313
3616
|
content: value
|
|
3314
3617
|
});
|
|
@@ -3328,7 +3631,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
3328
3631
|
return;
|
|
3329
3632
|
}
|
|
3330
3633
|
agent.addMessage({
|
|
3331
|
-
id: (
|
|
3634
|
+
id: randomUUID2(),
|
|
3332
3635
|
role: "user",
|
|
3333
3636
|
content: suggestion.message
|
|
3334
3637
|
});
|