@copilotkit/react-core 1.51.4-next.6 → 1.51.4-next.8
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/CHANGELOG.md +20 -0
- package/README.md +18 -12
- package/dist/{chunk-DQXCQWSG.mjs → chunk-2JZZD4RP.mjs} +93 -58
- package/dist/chunk-2JZZD4RP.mjs.map +1 -0
- package/dist/{chunk-6ESSSQ7Q.mjs → chunk-2RSAYTXH.mjs} +6 -3
- package/dist/chunk-2RSAYTXH.mjs.map +1 -0
- package/dist/chunk-3LZZ4RVM.mjs +37 -0
- package/dist/{chunk-ABWT4DRT.mjs.map → chunk-3LZZ4RVM.mjs.map} +1 -1
- package/dist/{chunk-QDES5PDW.mjs → chunk-4ZQYMC5F.mjs} +2 -2
- package/dist/{chunk-QDES5PDW.mjs.map → chunk-4ZQYMC5F.mjs.map} +1 -1
- package/dist/{chunk-6PUNP7CD.mjs → chunk-6AWG5FWL.mjs} +2 -2
- package/dist/chunk-6AWG5FWL.mjs.map +1 -0
- package/dist/{chunk-C3YJYDK4.mjs → chunk-7GIBHX6X.mjs} +8 -2
- package/dist/chunk-7GIBHX6X.mjs.map +1 -0
- package/dist/{chunk-PIF5KJYI.mjs → chunk-7PJKPWMD.mjs} +15 -6
- package/dist/chunk-7PJKPWMD.mjs.map +1 -0
- package/dist/{chunk-7JTI6ZL4.mjs → chunk-7U3DNFBF.mjs} +6 -3
- package/dist/chunk-7U3DNFBF.mjs.map +1 -0
- package/dist/{chunk-KNJHRVKW.mjs → chunk-AAGMWZCN.mjs} +45 -14
- package/dist/chunk-AAGMWZCN.mjs.map +1 -0
- package/dist/{chunk-AFNWX62Q.mjs → chunk-C7HSVDHD.mjs} +10 -4
- package/dist/chunk-C7HSVDHD.mjs.map +1 -0
- package/dist/{chunk-ZYTXB6HH.mjs → chunk-CZT7JUIM.mjs} +4 -2
- package/dist/chunk-CZT7JUIM.mjs.map +1 -0
- package/dist/{chunk-VP43SLSZ.mjs → chunk-DAQORGBP.mjs} +10 -5
- package/dist/chunk-DAQORGBP.mjs.map +1 -0
- package/dist/{chunk-BKMJ4LC7.mjs → chunk-G7SUZGGB.mjs} +19 -12
- package/dist/chunk-G7SUZGGB.mjs.map +1 -0
- package/dist/{chunk-7IBF6RBW.mjs → chunk-GY3FQICF.mjs} +2 -2
- package/dist/{chunk-4RRMC7L2.mjs → chunk-IGYMBU43.mjs} +18 -7
- package/dist/chunk-IGYMBU43.mjs.map +1 -0
- package/dist/{chunk-QD7EID4N.mjs → chunk-IHMMKEFG.mjs} +16 -11
- package/dist/chunk-IHMMKEFG.mjs.map +1 -0
- package/dist/{chunk-YYN33GSG.mjs → chunk-K5OXUXCG.mjs} +14 -11
- package/dist/chunk-K5OXUXCG.mjs.map +1 -0
- package/dist/{chunk-6ZLPNY7X.mjs → chunk-L7GPCF2V.mjs} +6 -2
- package/dist/{chunk-6ZLPNY7X.mjs.map → chunk-L7GPCF2V.mjs.map} +1 -1
- package/dist/{chunk-7DTB7S5V.mjs → chunk-LNGBARXE.mjs} +5 -2
- package/dist/chunk-LNGBARXE.mjs.map +1 -0
- package/dist/{chunk-NBK4KBLX.mjs → chunk-MBJ7OLYI.mjs} +9 -5
- package/dist/chunk-MBJ7OLYI.mjs.map +1 -0
- package/dist/{chunk-LHERIF3L.mjs → chunk-NINJMAND.mjs} +10 -7
- package/dist/chunk-NINJMAND.mjs.map +1 -0
- package/dist/{chunk-MA3CUMCY.mjs → chunk-P6ZPE4XJ.mjs} +3 -3
- package/dist/{chunk-MA3CUMCY.mjs.map → chunk-P6ZPE4XJ.mjs.map} +1 -1
- package/dist/{chunk-77IVITG3.mjs → chunk-QXZTCGF4.mjs} +9 -4
- package/dist/chunk-QXZTCGF4.mjs.map +1 -0
- package/dist/{chunk-RKTVJRK7.mjs → chunk-R7BV32X4.mjs} +5 -2
- package/dist/chunk-R7BV32X4.mjs.map +1 -0
- package/dist/{chunk-VKNLTZJE.mjs → chunk-S65UEHGI.mjs} +30 -21
- package/dist/chunk-S65UEHGI.mjs.map +1 -0
- package/dist/{chunk-YCG6SNAU.mjs → chunk-SBRCWA4S.mjs} +186 -32
- package/dist/chunk-SBRCWA4S.mjs.map +1 -0
- package/dist/{chunk-HE22TZMF.mjs → chunk-SFOKX4MH.mjs} +18 -9
- package/dist/chunk-SFOKX4MH.mjs.map +1 -0
- package/dist/{chunk-LMHB2D4J.mjs → chunk-SK2XMJUD.mjs} +13 -4
- package/dist/chunk-SK2XMJUD.mjs.map +1 -0
- package/dist/{chunk-XDFVCQD3.mjs → chunk-SYGQHN3H.mjs} +1 -1
- package/dist/{chunk-XDFVCQD3.mjs.map → chunk-SYGQHN3H.mjs.map} +1 -1
- package/dist/{chunk-SRJT5VVY.mjs → chunk-TFZXOEY4.mjs} +6 -4
- package/dist/{chunk-SRJT5VVY.mjs.map → chunk-TFZXOEY4.mjs.map} +1 -1
- package/dist/{chunk-4CEQJ2X6.mjs → chunk-TPN7WC53.mjs} +4 -2
- package/dist/{chunk-4CEQJ2X6.mjs.map → chunk-TPN7WC53.mjs.map} +1 -1
- package/dist/{chunk-VGL3DGUW.mjs → chunk-UA23VX5J.mjs} +4 -2
- package/dist/chunk-UA23VX5J.mjs.map +1 -0
- package/dist/{chunk-VV56AVPB.mjs → chunk-V42VL2JR.mjs} +15 -4
- package/dist/chunk-V42VL2JR.mjs.map +1 -0
- package/dist/{chunk-RBGVEVWY.mjs → chunk-VZ4NSOFQ.mjs} +4 -4
- package/dist/chunk-VZ4NSOFQ.mjs.map +1 -0
- package/dist/{chunk-WF65O6HX.mjs → chunk-WRALJIW5.mjs} +18 -5
- package/dist/chunk-WRALJIW5.mjs.map +1 -0
- package/dist/{chunk-PMAFHQ7P.mjs → chunk-WV2EA7SX.mjs} +1 -1
- package/dist/chunk-WV2EA7SX.mjs.map +1 -0
- package/dist/{chunk-EFL5OBKN.mjs → chunk-ZP2IMXFY.mjs} +10 -4
- package/dist/chunk-ZP2IMXFY.mjs.map +1 -0
- package/dist/components/CopilotListeners.js +11 -2
- package/dist/components/CopilotListeners.js.map +1 -1
- package/dist/components/CopilotListeners.mjs +2 -2
- package/dist/components/copilot-provider/copilot-messages.d.ts +1 -1
- package/dist/components/copilot-provider/copilot-messages.js +22 -7
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +3 -3
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +179 -84
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +16 -16
- package/dist/components/copilot-provider/index.js +179 -84
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +16 -16
- package/dist/components/dev-console/console-trigger.d.ts +1 -1
- package/dist/components/dev-console/console-trigger.js +227 -42
- package/dist/components/dev-console/console-trigger.js.map +1 -1
- package/dist/components/dev-console/console-trigger.mjs +24 -8
- package/dist/components/dev-console/console-trigger.mjs.map +1 -1
- package/dist/components/dev-console/developer-console-modal.d.ts +1 -1
- package/dist/components/dev-console/developer-console-modal.js +206 -37
- package/dist/components/dev-console/developer-console-modal.js.map +1 -1
- package/dist/components/dev-console/developer-console-modal.mjs +3 -3
- package/dist/components/dev-console/icons.js +14 -5
- package/dist/components/dev-console/icons.js.map +1 -1
- package/dist/components/dev-console/icons.mjs +1 -1
- package/dist/components/error-boundary/error-boundary.d.ts +1 -1
- package/dist/components/error-boundary/error-boundary.js +9 -2
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +5 -5
- package/dist/components/error-boundary/error-utils.js.map +1 -1
- package/dist/components/error-boundary/error-utils.mjs +2 -2
- package/dist/components/index.js +179 -84
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +16 -16
- package/dist/components/toast/toast-provider.js +9 -3
- package/dist/components/toast/toast-provider.js.map +1 -1
- package/dist/components/toast/toast-provider.mjs +1 -1
- package/dist/components/usage-banner.js +5 -1
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +1 -1
- package/dist/context/coagent-state-renders-context.d.ts +1 -1
- package/dist/context/coagent-state-renders-context.js +15 -10
- package/dist/context/coagent-state-renders-context.js.map +1 -1
- package/dist/context/coagent-state-renders-context.mjs +1 -1
- package/dist/context/copilot-context.js +9 -3
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.js +31 -15
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +7 -7
- package/dist/context/threads-context.d.ts +1 -1
- package/dist/context/threads-context.js +7 -2
- package/dist/context/threads-context.js.map +1 -1
- package/dist/context/threads-context.mjs +1 -1
- package/dist/hooks/index.js +162 -61
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +26 -26
- package/dist/hooks/use-coagent-state-render-bridge.helpers.js +7 -1
- package/dist/hooks/use-coagent-state-render-bridge.helpers.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.helpers.mjs +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.js +31 -15
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.mjs +6 -6
- package/dist/hooks/use-coagent-state-render-registry.js +14 -3
- package/dist/hooks/use-coagent-state-render-registry.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-registry.mjs +2 -2
- package/dist/hooks/use-coagent-state-render.js +34 -21
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +4 -4
- package/dist/hooks/use-coagent.js +3 -1
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +1 -1
- package/dist/hooks/use-configure-chat-suggestions.js.map +1 -1
- package/dist/hooks/use-configure-chat-suggestions.mjs.map +1 -1
- package/dist/hooks/use-copilot-action.js +13 -9
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +4 -4
- package/dist/hooks/use-copilot-additional-instructions.d.ts +1 -1
- package/dist/hooks/use-copilot-additional-instructions.js +26 -7
- package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
- package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +25 -13
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +6 -6
- package/dist/hooks/use-copilot-chat-headless_c.js +81 -27
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +12 -12
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.mjs +1 -1
- package/dist/hooks/use-copilot-chat.js +81 -27
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +12 -12
- package/dist/hooks/use-copilot-chat_internal.js +81 -27
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +11 -11
- package/dist/hooks/use-copilot-runtime-client.js +4 -1
- package/dist/hooks/use-copilot-runtime-client.js.map +1 -1
- package/dist/hooks/use-copilot-runtime-client.mjs +2 -2
- package/dist/hooks/use-default-tool.js +17 -10
- package/dist/hooks/use-default-tool.js.map +1 -1
- package/dist/hooks/use-default-tool.mjs +5 -5
- package/dist/hooks/use-flat-category-store.js +13 -10
- package/dist/hooks/use-flat-category-store.js.map +1 -1
- package/dist/hooks/use-flat-category-store.mjs +1 -1
- package/dist/hooks/use-frontend-tool.js.map +1 -1
- package/dist/hooks/use-frontend-tool.mjs +1 -1
- package/dist/hooks/use-human-in-the-loop.js.map +1 -1
- package/dist/hooks/use-human-in-the-loop.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.js +22 -5
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +4 -4
- package/dist/hooks/use-langgraph-interrupt.js +19 -4
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +3 -3
- package/dist/hooks/use-make-copilot-document-readable.js +9 -3
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/hooks/use-render-tool-call.d.ts +1 -1
- package/dist/hooks/use-render-tool-call.js +13 -9
- package/dist/hooks/use-render-tool-call.js.map +1 -1
- package/dist/hooks/use-render-tool-call.mjs +1 -1
- package/dist/hooks/use-tree.js +4 -1
- package/dist/hooks/use-tree.js.map +1 -1
- package/dist/hooks/use-tree.mjs +1 -1
- package/dist/index.js +311 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -52
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/copilot-task.js +10 -3
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +18 -18
- package/dist/lib/index.js +10 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +18 -18
- package/dist/lib/status-checker.js.map +1 -1
- package/dist/lib/status-checker.mjs +1 -1
- package/dist/types/coagent-action.js.map +1 -1
- package/dist/types/frontend-action.js +3 -1
- package/dist/types/frontend-action.js.map +1 -1
- package/dist/types/frontend-action.mjs +1 -1
- package/dist/types/interrupt-action.js.map +1 -1
- package/dist/v2/index.umd.js.map +1 -1
- package/jest.config.js +1 -0
- package/package.json +5 -6
- package/src/__mocks__/analytics-node.js +9 -0
- package/src/components/CopilotListeners.tsx +21 -5
- package/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx +3 -1
- package/src/components/copilot-provider/copilot-messages.tsx +36 -11
- package/src/components/copilot-provider/copilotkit-props.tsx +4 -1
- package/src/components/copilot-provider/copilotkit.tsx +116 -50
- package/src/components/dev-console/console-trigger.tsx +39 -10
- package/src/components/dev-console/developer-console-modal.tsx +207 -57
- package/src/components/dev-console/icons.tsx +6 -1
- package/src/components/error-boundary/error-boundary.tsx +10 -2
- package/src/components/error-boundary/error-utils.tsx +8 -3
- package/src/components/toast/toast-provider.tsx +16 -6
- package/src/components/usage-banner.tsx +9 -2
- package/src/context/coagent-state-renders-context.tsx +24 -12
- package/src/context/copilot-context.tsx +48 -15
- package/src/context/index.ts +8 -2
- package/src/context/threads-context.tsx +14 -3
- package/src/hooks/__tests__/use-coagent-state-render-bridge.helpers.test.ts +11 -4
- package/src/hooks/__tests__/use-coagent-state-render.e2e.test.tsx +175 -47
- package/src/hooks/__tests__/use-coagent-state-render.test.tsx +31 -10
- package/src/hooks/__tests__/use-frontend-tool-remount.e2e.test.tsx +10 -2
- package/src/hooks/use-coagent-state-render-bridge.helpers.ts +49 -16
- package/src/hooks/use-coagent-state-render-bridge.tsx +30 -13
- package/src/hooks/use-coagent-state-render-registry.ts +36 -21
- package/src/hooks/use-coagent-state-render.ts +30 -19
- package/src/hooks/use-coagent.ts +15 -4
- package/src/hooks/use-configure-chat-suggestions.tsx +14 -4
- package/src/hooks/use-copilot-action.ts +12 -3
- package/src/hooks/use-copilot-additional-instructions.ts +17 -4
- package/src/hooks/use-copilot-authenticated-action.ts +4 -1
- package/src/hooks/use-copilot-chat-headless_c.ts +8 -2
- package/src/hooks/use-copilot-chat-suggestions.tsx +14 -4
- package/src/hooks/use-copilot-chat.ts +3 -1
- package/src/hooks/use-copilot-chat_internal.ts +72 -19
- package/src/hooks/use-copilot-runtime-client.ts +20 -6
- package/src/hooks/use-default-tool.ts +8 -2
- package/src/hooks/use-flat-category-store.ts +15 -11
- package/src/hooks/use-frontend-tool.ts +35 -25
- package/src/hooks/use-human-in-the-loop.ts +21 -5
- package/src/hooks/use-langgraph-interrupt-render.ts +13 -2
- package/src/hooks/use-langgraph-interrupt.ts +13 -3
- package/src/hooks/use-render-tool-call.ts +20 -11
- package/src/hooks/use-tree.ts +20 -5
- package/src/lib/copilot-task.ts +20 -6
- package/src/lib/status-checker.ts +4 -1
- package/src/types/coagent-action.ts +6 -2
- package/src/types/frontend-action.ts +16 -5
- package/src/types/interrupt-action.ts +15 -5
- package/tsconfig.json +1 -1
- package/dist/chunk-4RRMC7L2.mjs.map +0 -1
- package/dist/chunk-6ESSSQ7Q.mjs.map +0 -1
- package/dist/chunk-6PUNP7CD.mjs.map +0 -1
- package/dist/chunk-77IVITG3.mjs.map +0 -1
- package/dist/chunk-7DTB7S5V.mjs.map +0 -1
- package/dist/chunk-7JTI6ZL4.mjs.map +0 -1
- package/dist/chunk-ABWT4DRT.mjs +0 -24
- package/dist/chunk-AFNWX62Q.mjs.map +0 -1
- package/dist/chunk-BKMJ4LC7.mjs.map +0 -1
- package/dist/chunk-C3YJYDK4.mjs.map +0 -1
- package/dist/chunk-DQXCQWSG.mjs.map +0 -1
- package/dist/chunk-EFL5OBKN.mjs.map +0 -1
- package/dist/chunk-HE22TZMF.mjs.map +0 -1
- package/dist/chunk-KNJHRVKW.mjs.map +0 -1
- package/dist/chunk-LHERIF3L.mjs.map +0 -1
- package/dist/chunk-LMHB2D4J.mjs.map +0 -1
- package/dist/chunk-NBK4KBLX.mjs.map +0 -1
- package/dist/chunk-PIF5KJYI.mjs.map +0 -1
- package/dist/chunk-PMAFHQ7P.mjs.map +0 -1
- package/dist/chunk-QD7EID4N.mjs.map +0 -1
- package/dist/chunk-RBGVEVWY.mjs.map +0 -1
- package/dist/chunk-RKTVJRK7.mjs.map +0 -1
- package/dist/chunk-VGL3DGUW.mjs.map +0 -1
- package/dist/chunk-VKNLTZJE.mjs.map +0 -1
- package/dist/chunk-VP43SLSZ.mjs.map +0 -1
- package/dist/chunk-VV56AVPB.mjs.map +0 -1
- package/dist/chunk-WF65O6HX.mjs.map +0 -1
- package/dist/chunk-YCG6SNAU.mjs.map +0 -1
- package/dist/chunk-YYN33GSG.mjs.map +0 -1
- package/dist/chunk-ZYTXB6HH.mjs.map +0 -1
- /package/dist/{chunk-7IBF6RBW.mjs.map → chunk-GY3FQICF.mjs.map} +0 -0
|
@@ -119,7 +119,9 @@ var emptyCopilotContext = {
|
|
|
119
119
|
},
|
|
120
120
|
copilotApiConfig: new class {
|
|
121
121
|
get chatApiEndpoint() {
|
|
122
|
-
throw new Error(
|
|
122
|
+
throw new Error(
|
|
123
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
124
|
+
);
|
|
123
125
|
}
|
|
124
126
|
get headers() {
|
|
125
127
|
return {};
|
|
@@ -181,12 +183,16 @@ var CopilotContext = import_react.default.createContext(emptyCopilotContext);
|
|
|
181
183
|
function useCopilotContext() {
|
|
182
184
|
const context = import_react.default.useContext(CopilotContext);
|
|
183
185
|
if (context === emptyCopilotContext) {
|
|
184
|
-
throw new Error(
|
|
186
|
+
throw new Error(
|
|
187
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
188
|
+
);
|
|
185
189
|
}
|
|
186
190
|
return context;
|
|
187
191
|
}
|
|
188
192
|
function returnAndThrowInDebug(_value) {
|
|
189
|
-
throw new Error(
|
|
193
|
+
throw new Error(
|
|
194
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
195
|
+
);
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
// src/hooks/use-tree.ts
|
|
@@ -304,7 +310,10 @@ var useTree = () => {
|
|
|
304
310
|
if (index !== 0) {
|
|
305
311
|
output += "\n";
|
|
306
312
|
}
|
|
307
|
-
output += printNode(
|
|
313
|
+
output += printNode(
|
|
314
|
+
node,
|
|
315
|
+
`${treeIndentationRepresentation(index, 0)}. `
|
|
316
|
+
);
|
|
308
317
|
});
|
|
309
318
|
return output;
|
|
310
319
|
},
|
|
@@ -335,16 +344,19 @@ var useFlatCategoryStore = () => {
|
|
|
335
344
|
flatCategoryStoreReducer,
|
|
336
345
|
/* @__PURE__ */ new Map()
|
|
337
346
|
);
|
|
338
|
-
const addElement = (0, import_react3.useCallback)(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
const addElement = (0, import_react3.useCallback)(
|
|
348
|
+
(value, categories) => {
|
|
349
|
+
const newId = (0, import_shared2.randomId)();
|
|
350
|
+
dispatch({
|
|
351
|
+
type: "ADD_ELEMENT",
|
|
352
|
+
value,
|
|
353
|
+
id: newId,
|
|
354
|
+
categories
|
|
355
|
+
});
|
|
356
|
+
return newId;
|
|
357
|
+
},
|
|
358
|
+
[]
|
|
359
|
+
);
|
|
348
360
|
const removeElement = (0, import_react3.useCallback)((id) => {
|
|
349
361
|
dispatch({ type: "REMOVE_ELEMENT", id });
|
|
350
362
|
}, []);
|
|
@@ -471,7 +483,9 @@ function ToastProvider({
|
|
|
471
483
|
children
|
|
472
484
|
}) {
|
|
473
485
|
const [toasts, setToasts] = (0, import_react5.useState)([]);
|
|
474
|
-
const [bannerError, setBannerErrorState] = (0, import_react5.useState)(
|
|
486
|
+
const [bannerError, setBannerErrorState] = (0, import_react5.useState)(
|
|
487
|
+
null
|
|
488
|
+
);
|
|
475
489
|
const removeToast = (0, import_react5.useCallback)((id) => {
|
|
476
490
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
477
491
|
}, []);
|
|
@@ -505,7 +519,9 @@ function ToastProvider({
|
|
|
505
519
|
[enabled]
|
|
506
520
|
);
|
|
507
521
|
const addGraphQLErrorsToast = (0, import_react5.useCallback)((errors) => {
|
|
508
|
-
console.warn(
|
|
522
|
+
console.warn(
|
|
523
|
+
"addGraphQLErrorsToast is deprecated. All errors now show as banners."
|
|
524
|
+
);
|
|
509
525
|
}, []);
|
|
510
526
|
const value = {
|
|
511
527
|
toasts,
|
|
@@ -605,7 +621,9 @@ function ToastProvider({
|
|
|
605
621
|
},
|
|
606
622
|
children: (() => {
|
|
607
623
|
let message = bannerError.message;
|
|
608
|
-
const jsonMatch = message.match(
|
|
624
|
+
const jsonMatch = message.match(
|
|
625
|
+
/'message':\s*'([^']+)'/
|
|
626
|
+
);
|
|
609
627
|
if (jsonMatch) {
|
|
610
628
|
return jsonMatch[1];
|
|
611
629
|
}
|
|
@@ -733,7 +751,9 @@ function useMessagesTap() {
|
|
|
733
751
|
throw new Error("useMessagesTap must be used inside <MessagesTapProvider>");
|
|
734
752
|
return tap;
|
|
735
753
|
}
|
|
736
|
-
function MessagesTapProvider({
|
|
754
|
+
function MessagesTapProvider({
|
|
755
|
+
children
|
|
756
|
+
}) {
|
|
737
757
|
const messagesRef = (0, import_react6.useRef)([]);
|
|
738
758
|
const tapRef = (0, import_react6.useRef)({
|
|
739
759
|
getMessagesFromTap: () => messagesRef.current,
|
|
@@ -786,10 +806,14 @@ function CopilotMessages({ children }) {
|
|
|
786
806
|
const originalError = extensions == null ? void 0 : extensions.originalError;
|
|
787
807
|
if (originalError == null ? void 0 : originalError.stack) {
|
|
788
808
|
if (originalError.stack.includes("CopilotApiDiscoveryError")) {
|
|
789
|
-
return new import_shared4.CopilotKitApiDiscoveryError({
|
|
809
|
+
return new import_shared4.CopilotKitApiDiscoveryError({
|
|
810
|
+
message: originalError.message
|
|
811
|
+
});
|
|
790
812
|
}
|
|
791
813
|
if (originalError.stack.includes("CopilotKitRemoteEndpointDiscoveryError")) {
|
|
792
|
-
return new import_shared4.CopilotKitRemoteEndpointDiscoveryError({
|
|
814
|
+
return new import_shared4.CopilotKitRemoteEndpointDiscoveryError({
|
|
815
|
+
message: originalError.message
|
|
816
|
+
});
|
|
793
817
|
}
|
|
794
818
|
if (originalError.stack.includes("CopilotKitAgentDiscoveryError")) {
|
|
795
819
|
return new import_shared4.CopilotKitAgentDiscoveryError({
|
|
@@ -815,7 +839,10 @@ function CopilotMessages({ children }) {
|
|
|
815
839
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
816
840
|
const isDev = shouldShowDevConsole(showDevConsole);
|
|
817
841
|
if (!isDev) {
|
|
818
|
-
console.error(
|
|
842
|
+
console.error(
|
|
843
|
+
"CopilotKit Error (hidden in production):",
|
|
844
|
+
gqlError.message
|
|
845
|
+
);
|
|
819
846
|
return;
|
|
820
847
|
}
|
|
821
848
|
if (visibility === import_shared4.ErrorVisibility.SILENT) {
|
|
@@ -1064,7 +1091,11 @@ var getErrorActions = (error) => {
|
|
|
1064
1091
|
return {
|
|
1065
1092
|
primary: {
|
|
1066
1093
|
label: "Upgrade",
|
|
1067
|
-
onClick: () => window.open(
|
|
1094
|
+
onClick: () => window.open(
|
|
1095
|
+
"https://cloud.copilotkit.ai",
|
|
1096
|
+
"_blank",
|
|
1097
|
+
"noopener,noreferrer"
|
|
1098
|
+
)
|
|
1068
1099
|
}
|
|
1069
1100
|
};
|
|
1070
1101
|
default:
|
|
@@ -1187,16 +1218,19 @@ var CopilotErrorBoundary = class extends import_react7.default.Component {
|
|
|
1187
1218
|
// src/context/coagent-state-renders-context.tsx
|
|
1188
1219
|
var import_react8 = require("react");
|
|
1189
1220
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1190
|
-
var CoAgentStateRendersContext = (0, import_react8.createContext)(
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1221
|
+
var CoAgentStateRendersContext = (0, import_react8.createContext)(void 0);
|
|
1222
|
+
function CoAgentStateRendersProvider({
|
|
1223
|
+
children
|
|
1224
|
+
}) {
|
|
1194
1225
|
const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react8.useState)({});
|
|
1195
|
-
const setCoAgentStateRender = (0, import_react8.useCallback)(
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1226
|
+
const setCoAgentStateRender = (0, import_react8.useCallback)(
|
|
1227
|
+
(id, stateRender) => {
|
|
1228
|
+
setCoAgentStateRenders((prevPoints) => __spreadProps(__spreadValues({}, prevPoints), {
|
|
1229
|
+
[id]: stateRender
|
|
1230
|
+
}));
|
|
1231
|
+
},
|
|
1232
|
+
[]
|
|
1233
|
+
);
|
|
1200
1234
|
const removeCoAgentStateRender = (0, import_react8.useCallback)((id) => {
|
|
1201
1235
|
setCoAgentStateRenders((prevPoints) => {
|
|
1202
1236
|
const newPoints = __spreadValues({}, prevPoints);
|
|
@@ -1221,7 +1255,9 @@ function CoAgentStateRendersProvider({ children }) {
|
|
|
1221
1255
|
function useCoAgentStateRenders() {
|
|
1222
1256
|
const context = (0, import_react8.useContext)(CoAgentStateRendersContext);
|
|
1223
1257
|
if (!context) {
|
|
1224
|
-
throw new Error(
|
|
1258
|
+
throw new Error(
|
|
1259
|
+
"useCoAgentStateRenders must be used within CoAgentStateRendersProvider"
|
|
1260
|
+
);
|
|
1225
1261
|
}
|
|
1226
1262
|
return context;
|
|
1227
1263
|
}
|
|
@@ -1234,8 +1270,13 @@ var import_react12 = require("react");
|
|
|
1234
1270
|
var import_react9 = require("react");
|
|
1235
1271
|
var import_shared8 = require("@copilotkit/shared");
|
|
1236
1272
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1237
|
-
var ThreadsContext = (0, import_react9.createContext)(
|
|
1238
|
-
|
|
1273
|
+
var ThreadsContext = (0, import_react9.createContext)(
|
|
1274
|
+
void 0
|
|
1275
|
+
);
|
|
1276
|
+
function ThreadsProvider({
|
|
1277
|
+
children,
|
|
1278
|
+
threadId: explicitThreadId
|
|
1279
|
+
}) {
|
|
1239
1280
|
const [internalThreadId, setThreadId] = (0, import_react9.useState)(() => (0, import_shared8.randomUUID)());
|
|
1240
1281
|
const threadId = explicitThreadId != null ? explicitThreadId : internalThreadId;
|
|
1241
1282
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -1418,7 +1459,13 @@ function selectSnapshot({
|
|
|
1418
1459
|
cachedSnapshot = caches.byStateRenderAndRun[`${stateRenderId}::latest`];
|
|
1419
1460
|
}
|
|
1420
1461
|
const snapshotForClaim = (existingClaim == null ? void 0 : existingClaim.locked) ? (_e = existingClaim.stateSnapshot) != null ? _e : cachedSnapshot : hasSnapshotKeys ? snapshot : (_f = existingClaim == null ? void 0 : existingClaim.stateSnapshot) != null ? _f : cachedSnapshot;
|
|
1421
|
-
return {
|
|
1462
|
+
return {
|
|
1463
|
+
snapshot,
|
|
1464
|
+
hasSnapshotKeys,
|
|
1465
|
+
cachedSnapshot,
|
|
1466
|
+
allowEmptySnapshot,
|
|
1467
|
+
snapshotForClaim
|
|
1468
|
+
};
|
|
1422
1469
|
}
|
|
1423
1470
|
|
|
1424
1471
|
// src/hooks/use-coagent-state-render-registry.ts
|
|
@@ -1523,7 +1570,9 @@ function useStateRenderRegistry({
|
|
|
1523
1570
|
});
|
|
1524
1571
|
}
|
|
1525
1572
|
if (existingClaim && !existingClaim.locked && (agentMessages == null ? void 0 : agentMessages.length)) {
|
|
1526
|
-
const indexInAgentMessages = agentMessages.findIndex(
|
|
1573
|
+
const indexInAgentMessages = agentMessages.findIndex(
|
|
1574
|
+
(msg) => msg.id === message.id
|
|
1575
|
+
);
|
|
1527
1576
|
if (indexInAgentMessages >= 0 && indexInAgentMessages < agentMessages.length - 1) {
|
|
1528
1577
|
existingClaim.locked = true;
|
|
1529
1578
|
}
|
|
@@ -1555,7 +1604,10 @@ function useStateRenderRegistry({
|
|
|
1555
1604
|
snapshotCache[`${stateRenderId}::latest`] = snapshotForClaim;
|
|
1556
1605
|
store[LAST_SNAPSHOTS_BY_RENDER_AND_RUN] = snapshotCache;
|
|
1557
1606
|
const messageCache = __spreadValues({}, (_f = store[LAST_SNAPSHOTS_BY_MESSAGE]) != null ? _f : {});
|
|
1558
|
-
messageCache[message.id] = {
|
|
1607
|
+
messageCache[message.id] = {
|
|
1608
|
+
snapshot: snapshotForClaim,
|
|
1609
|
+
runId: effectiveRunId
|
|
1610
|
+
};
|
|
1559
1611
|
store[LAST_SNAPSHOTS_BY_MESSAGE] = messageCache;
|
|
1560
1612
|
}
|
|
1561
1613
|
}
|
|
@@ -1595,18 +1647,23 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
1595
1647
|
}, [agentId, nodeName]);
|
|
1596
1648
|
const getStateRender = (0, import_react12.useCallback)(
|
|
1597
1649
|
(messageId) => {
|
|
1598
|
-
return Object.entries(coAgentStateRenders).find(
|
|
1599
|
-
|
|
1600
|
-
|
|
1650
|
+
return Object.entries(coAgentStateRenders).find(
|
|
1651
|
+
([stateRenderId2, stateRender2]) => {
|
|
1652
|
+
if (claimsRef.current[messageId]) {
|
|
1653
|
+
return stateRenderId2 === claimsRef.current[messageId].stateRenderId;
|
|
1654
|
+
}
|
|
1655
|
+
const matchingAgentName = stateRender2.name === agentId;
|
|
1656
|
+
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
1657
|
+
return matchingAgentName && matchesNodeContext;
|
|
1601
1658
|
}
|
|
1602
|
-
|
|
1603
|
-
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
1604
|
-
return matchingAgentName && matchesNodeContext;
|
|
1605
|
-
});
|
|
1659
|
+
);
|
|
1606
1660
|
},
|
|
1607
1661
|
[coAgentStateRenders, nodeName, agentId]
|
|
1608
1662
|
);
|
|
1609
|
-
const stateRenderEntry = (0, import_react12.useMemo)(
|
|
1663
|
+
const stateRenderEntry = (0, import_react12.useMemo)(
|
|
1664
|
+
() => getStateRender(message.id),
|
|
1665
|
+
[getStateRender, message.id]
|
|
1666
|
+
);
|
|
1610
1667
|
const stateRenderId = stateRenderEntry == null ? void 0 : stateRenderEntry[0];
|
|
1611
1668
|
const stateRender = stateRenderEntry == null ? void 0 : stateRenderEntry[1];
|
|
1612
1669
|
const registryMessage = __spreadProps(__spreadValues({}, message), {
|
|
@@ -1680,7 +1737,10 @@ var usePredictStateSubscription = (agent) => {
|
|
|
1680
1737
|
predictStateToolsRef.current.forEach((t) => {
|
|
1681
1738
|
if ((t == null ? void 0 : t.tool) !== toolCallName)
|
|
1682
1739
|
return;
|
|
1683
|
-
const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared11.parseJson)(
|
|
1740
|
+
const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared11.parseJson)(
|
|
1741
|
+
partialToolCallArgs,
|
|
1742
|
+
partialToolCallArgs
|
|
1743
|
+
) : partialToolCallArgs;
|
|
1684
1744
|
agent2.setState({
|
|
1685
1745
|
[t.state_key]: emittedState[t.state_key]
|
|
1686
1746
|
});
|
|
@@ -1709,7 +1769,13 @@ function CopilotListeners() {
|
|
|
1709
1769
|
(0, import_react13.useEffect)(() => {
|
|
1710
1770
|
const subscriber = {
|
|
1711
1771
|
onError: ({ error }) => {
|
|
1712
|
-
setBannerError(
|
|
1772
|
+
setBannerError(
|
|
1773
|
+
new import_shared12.CopilotKitLowLevelError({
|
|
1774
|
+
error,
|
|
1775
|
+
message: error.message,
|
|
1776
|
+
url: typeof window !== "undefined" ? window.location.href : ""
|
|
1777
|
+
})
|
|
1778
|
+
);
|
|
1713
1779
|
}
|
|
1714
1780
|
};
|
|
1715
1781
|
const subscription = copilotkit.subscribe(subscriber);
|
|
@@ -1728,15 +1794,22 @@ function CopilotKit(_a) {
|
|
|
1728
1794
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
1729
1795
|
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
1730
1796
|
const renderArr = (0, import_react15.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
|
|
1731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1798
|
+
CopilotErrorBoundary,
|
|
1799
|
+
{
|
|
1800
|
+
publicApiKey,
|
|
1801
|
+
showUsageBanner: enabled,
|
|
1802
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1803
|
+
import_react16.CopilotKitProvider,
|
|
1804
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1805
|
+
showDevConsole: showInspector,
|
|
1806
|
+
renderCustomMessages: renderArr,
|
|
1807
|
+
useSingleEndpoint: true,
|
|
1808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
|
|
1809
|
+
})
|
|
1810
|
+
) })
|
|
1811
|
+
}
|
|
1812
|
+
) });
|
|
1740
1813
|
}
|
|
1741
1814
|
function CopilotKitErrorBridge() {
|
|
1742
1815
|
const { copilotkit } = (0, import_react16.useCopilotKit)();
|
|
@@ -1783,7 +1856,9 @@ function CopilotKitInternal(cpkProps) {
|
|
|
1783
1856
|
validateProps(cpkProps);
|
|
1784
1857
|
const publicApiKey = props.publicLicenseKey || props.publicApiKey;
|
|
1785
1858
|
const chatApiEndpoint = props.runtimeUrl || import_shared13.COPILOT_CLOUD_CHAT_URL;
|
|
1786
|
-
const [actions, setActions] = (0, import_react15.useState)(
|
|
1859
|
+
const [actions, setActions] = (0, import_react15.useState)(
|
|
1860
|
+
{}
|
|
1861
|
+
);
|
|
1787
1862
|
const [registeredActionConfigs, setRegisteredActionConfigs] = (0, import_react15.useState)(/* @__PURE__ */ new Map());
|
|
1788
1863
|
const chatComponentsCache = (0, import_react15.useRef)({
|
|
1789
1864
|
actions: {},
|
|
@@ -1844,7 +1919,9 @@ ${nonDocumentStrings}`;
|
|
|
1844
1919
|
}, [getAllElements]);
|
|
1845
1920
|
const getFunctionCallHandler = (0, import_react15.useCallback)(
|
|
1846
1921
|
(customEntryPoints) => {
|
|
1847
|
-
return entryPointsToFunctionCallHandler(
|
|
1922
|
+
return entryPointsToFunctionCallHandler(
|
|
1923
|
+
Object.values(customEntryPoints || actions)
|
|
1924
|
+
);
|
|
1848
1925
|
},
|
|
1849
1926
|
[actions]
|
|
1850
1927
|
);
|
|
@@ -1914,12 +1991,17 @@ ${nonDocumentStrings}`;
|
|
|
1914
1991
|
}
|
|
1915
1992
|
return acc;
|
|
1916
1993
|
}, {});
|
|
1917
|
-
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? {
|
|
1994
|
+
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? {
|
|
1995
|
+
[import_shared13.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey
|
|
1996
|
+
} : {}), authHeaders);
|
|
1918
1997
|
}, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
|
|
1919
1998
|
const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react15.useState)({});
|
|
1920
|
-
const setInternalErrorHandler = (0, import_react15.useCallback)(
|
|
1921
|
-
|
|
1922
|
-
|
|
1999
|
+
const setInternalErrorHandler = (0, import_react15.useCallback)(
|
|
2000
|
+
(handler) => {
|
|
2001
|
+
_setInternalErrorHandler((prev) => __spreadValues(__spreadValues({}, prev), handler));
|
|
2002
|
+
},
|
|
2003
|
+
[]
|
|
2004
|
+
);
|
|
1923
2005
|
const removeInternalErrorHandler = (0, import_react15.useCallback)((key) => {
|
|
1924
2006
|
_setInternalErrorHandler((prev) => {
|
|
1925
2007
|
const _a2 = prev, { [key]: _removed } = _a2, rest = __objRest(_a2, [__restKey(key)]);
|
|
@@ -1989,7 +2071,9 @@ ${nonDocumentStrings}`;
|
|
|
1989
2071
|
agentName: props.agent
|
|
1990
2072
|
};
|
|
1991
2073
|
}
|
|
1992
|
-
const [agentSession, setAgentSession] = (0, import_react15.useState)(
|
|
2074
|
+
const [agentSession, setAgentSession] = (0, import_react15.useState)(
|
|
2075
|
+
initialAgentSession
|
|
2076
|
+
);
|
|
1993
2077
|
(0, import_react15.useEffect)(() => {
|
|
1994
2078
|
if (props.agent) {
|
|
1995
2079
|
setAgentSession({
|
|
@@ -2003,7 +2087,9 @@ ${nonDocumentStrings}`;
|
|
|
2003
2087
|
const setThreadId = (0, import_react15.useCallback)(
|
|
2004
2088
|
(value) => {
|
|
2005
2089
|
if (props.threadId) {
|
|
2006
|
-
throw new Error(
|
|
2090
|
+
throw new Error(
|
|
2091
|
+
"Cannot call setThreadId() when threadId is provided via props."
|
|
2092
|
+
);
|
|
2007
2093
|
}
|
|
2008
2094
|
setInternalThreadId(value);
|
|
2009
2095
|
},
|
|
@@ -2013,17 +2099,20 @@ ${nonDocumentStrings}`;
|
|
|
2013
2099
|
const chatAbortControllerRef = (0, import_react15.useRef)(null);
|
|
2014
2100
|
const showDevConsole = shouldShowDevConsole(props.showDevConsole);
|
|
2015
2101
|
const [interruptActions, _setInterruptActions] = (0, import_react15.useState)({});
|
|
2016
|
-
const setInterruptAction = (0, import_react15.useCallback)(
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2102
|
+
const setInterruptAction = (0, import_react15.useCallback)(
|
|
2103
|
+
(action) => {
|
|
2104
|
+
_setInterruptActions((prev) => {
|
|
2105
|
+
var _a2;
|
|
2106
|
+
if (action == null || !action.id) {
|
|
2107
|
+
return prev;
|
|
2108
|
+
}
|
|
2109
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
2110
|
+
[action.id]: __spreadValues(__spreadValues({}, (_a2 = prev[action.id]) != null ? _a2 : {}), action)
|
|
2111
|
+
});
|
|
2024
2112
|
});
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2113
|
+
},
|
|
2114
|
+
[]
|
|
2115
|
+
);
|
|
2027
2116
|
const removeInterruptAction = (0, import_react15.useCallback)((actionId) => {
|
|
2028
2117
|
_setInterruptActions((prev) => {
|
|
2029
2118
|
const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
|
|
@@ -2089,15 +2178,18 @@ ${nonDocumentStrings}`;
|
|
|
2089
2178
|
},
|
|
2090
2179
|
[setAuthStates]
|
|
2091
2180
|
);
|
|
2092
|
-
const handleSetRegisteredActions = (0, import_react15.useCallback)(
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2181
|
+
const handleSetRegisteredActions = (0, import_react15.useCallback)(
|
|
2182
|
+
(actionConfig) => {
|
|
2183
|
+
const key = actionConfig.action.name || (0, import_shared13.randomUUID)();
|
|
2184
|
+
setRegisteredActionConfigs((prev) => {
|
|
2185
|
+
const newMap = new Map(prev);
|
|
2186
|
+
newMap.set(key, actionConfig);
|
|
2187
|
+
return newMap;
|
|
2188
|
+
});
|
|
2189
|
+
return key;
|
|
2190
|
+
},
|
|
2191
|
+
[]
|
|
2192
|
+
);
|
|
2101
2193
|
const handleRemoveRegisteredAction = (0, import_react15.useCallback)((actionKey) => {
|
|
2102
2194
|
setRegisteredActionConfigs((prev) => {
|
|
2103
2195
|
const newMap = new Map(prev);
|
|
@@ -2203,7 +2295,10 @@ ${nonDocumentStrings}`;
|
|
|
2203
2295
|
}
|
|
2204
2296
|
var defaultCopilotContextCategories = ["global"];
|
|
2205
2297
|
function entryPointsToFunctionCallHandler(actions) {
|
|
2206
|
-
return (_0) => __async(this, [_0], function* ({
|
|
2298
|
+
return (_0) => __async(this, [_0], function* ({
|
|
2299
|
+
name,
|
|
2300
|
+
args
|
|
2301
|
+
}) {
|
|
2207
2302
|
let actionsByFunctionName = {};
|
|
2208
2303
|
for (let action2 of actions) {
|
|
2209
2304
|
actionsByFunctionName[action2.name] = action2;
|