@copilotkit/react-core 1.51.4-next.7 → 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 +10 -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
package/dist/components/index.js
CHANGED
|
@@ -120,7 +120,9 @@ var emptyCopilotContext = {
|
|
|
120
120
|
},
|
|
121
121
|
copilotApiConfig: new class {
|
|
122
122
|
get chatApiEndpoint() {
|
|
123
|
-
throw new Error(
|
|
123
|
+
throw new Error(
|
|
124
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
125
|
+
);
|
|
124
126
|
}
|
|
125
127
|
get headers() {
|
|
126
128
|
return {};
|
|
@@ -182,12 +184,16 @@ var CopilotContext = import_react.default.createContext(emptyCopilotContext);
|
|
|
182
184
|
function useCopilotContext() {
|
|
183
185
|
const context = import_react.default.useContext(CopilotContext);
|
|
184
186
|
if (context === emptyCopilotContext) {
|
|
185
|
-
throw new Error(
|
|
187
|
+
throw new Error(
|
|
188
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
189
|
+
);
|
|
186
190
|
}
|
|
187
191
|
return context;
|
|
188
192
|
}
|
|
189
193
|
function returnAndThrowInDebug(_value) {
|
|
190
|
-
throw new Error(
|
|
194
|
+
throw new Error(
|
|
195
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
196
|
+
);
|
|
191
197
|
}
|
|
192
198
|
|
|
193
199
|
// src/hooks/use-tree.ts
|
|
@@ -305,7 +311,10 @@ var useTree = () => {
|
|
|
305
311
|
if (index !== 0) {
|
|
306
312
|
output += "\n";
|
|
307
313
|
}
|
|
308
|
-
output += printNode(
|
|
314
|
+
output += printNode(
|
|
315
|
+
node,
|
|
316
|
+
`${treeIndentationRepresentation(index, 0)}. `
|
|
317
|
+
);
|
|
309
318
|
});
|
|
310
319
|
return output;
|
|
311
320
|
},
|
|
@@ -336,16 +345,19 @@ var useFlatCategoryStore = () => {
|
|
|
336
345
|
flatCategoryStoreReducer,
|
|
337
346
|
/* @__PURE__ */ new Map()
|
|
338
347
|
);
|
|
339
|
-
const addElement = (0, import_react3.useCallback)(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
const addElement = (0, import_react3.useCallback)(
|
|
349
|
+
(value, categories) => {
|
|
350
|
+
const newId = (0, import_shared2.randomId)();
|
|
351
|
+
dispatch({
|
|
352
|
+
type: "ADD_ELEMENT",
|
|
353
|
+
value,
|
|
354
|
+
id: newId,
|
|
355
|
+
categories
|
|
356
|
+
});
|
|
357
|
+
return newId;
|
|
358
|
+
},
|
|
359
|
+
[]
|
|
360
|
+
);
|
|
349
361
|
const removeElement = (0, import_react3.useCallback)((id) => {
|
|
350
362
|
dispatch({ type: "REMOVE_ELEMENT", id });
|
|
351
363
|
}, []);
|
|
@@ -472,7 +484,9 @@ function ToastProvider({
|
|
|
472
484
|
children
|
|
473
485
|
}) {
|
|
474
486
|
const [toasts, setToasts] = (0, import_react5.useState)([]);
|
|
475
|
-
const [bannerError, setBannerErrorState] = (0, import_react5.useState)(
|
|
487
|
+
const [bannerError, setBannerErrorState] = (0, import_react5.useState)(
|
|
488
|
+
null
|
|
489
|
+
);
|
|
476
490
|
const removeToast = (0, import_react5.useCallback)((id) => {
|
|
477
491
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
478
492
|
}, []);
|
|
@@ -506,7 +520,9 @@ function ToastProvider({
|
|
|
506
520
|
[enabled]
|
|
507
521
|
);
|
|
508
522
|
const addGraphQLErrorsToast = (0, import_react5.useCallback)((errors) => {
|
|
509
|
-
console.warn(
|
|
523
|
+
console.warn(
|
|
524
|
+
"addGraphQLErrorsToast is deprecated. All errors now show as banners."
|
|
525
|
+
);
|
|
510
526
|
}, []);
|
|
511
527
|
const value = {
|
|
512
528
|
toasts,
|
|
@@ -606,7 +622,9 @@ function ToastProvider({
|
|
|
606
622
|
},
|
|
607
623
|
children: (() => {
|
|
608
624
|
let message = bannerError.message;
|
|
609
|
-
const jsonMatch = message.match(
|
|
625
|
+
const jsonMatch = message.match(
|
|
626
|
+
/'message':\s*'([^']+)'/
|
|
627
|
+
);
|
|
610
628
|
if (jsonMatch) {
|
|
611
629
|
return jsonMatch[1];
|
|
612
630
|
}
|
|
@@ -734,7 +752,9 @@ function useMessagesTap() {
|
|
|
734
752
|
throw new Error("useMessagesTap must be used inside <MessagesTapProvider>");
|
|
735
753
|
return tap;
|
|
736
754
|
}
|
|
737
|
-
function MessagesTapProvider({
|
|
755
|
+
function MessagesTapProvider({
|
|
756
|
+
children
|
|
757
|
+
}) {
|
|
738
758
|
const messagesRef = (0, import_react6.useRef)([]);
|
|
739
759
|
const tapRef = (0, import_react6.useRef)({
|
|
740
760
|
getMessagesFromTap: () => messagesRef.current,
|
|
@@ -787,10 +807,14 @@ function CopilotMessages({ children }) {
|
|
|
787
807
|
const originalError = extensions == null ? void 0 : extensions.originalError;
|
|
788
808
|
if (originalError == null ? void 0 : originalError.stack) {
|
|
789
809
|
if (originalError.stack.includes("CopilotApiDiscoveryError")) {
|
|
790
|
-
return new import_shared4.CopilotKitApiDiscoveryError({
|
|
810
|
+
return new import_shared4.CopilotKitApiDiscoveryError({
|
|
811
|
+
message: originalError.message
|
|
812
|
+
});
|
|
791
813
|
}
|
|
792
814
|
if (originalError.stack.includes("CopilotKitRemoteEndpointDiscoveryError")) {
|
|
793
|
-
return new import_shared4.CopilotKitRemoteEndpointDiscoveryError({
|
|
815
|
+
return new import_shared4.CopilotKitRemoteEndpointDiscoveryError({
|
|
816
|
+
message: originalError.message
|
|
817
|
+
});
|
|
794
818
|
}
|
|
795
819
|
if (originalError.stack.includes("CopilotKitAgentDiscoveryError")) {
|
|
796
820
|
return new import_shared4.CopilotKitAgentDiscoveryError({
|
|
@@ -816,7 +840,10 @@ function CopilotMessages({ children }) {
|
|
|
816
840
|
const visibility = extensions == null ? void 0 : extensions.visibility;
|
|
817
841
|
const isDev = shouldShowDevConsole(showDevConsole);
|
|
818
842
|
if (!isDev) {
|
|
819
|
-
console.error(
|
|
843
|
+
console.error(
|
|
844
|
+
"CopilotKit Error (hidden in production):",
|
|
845
|
+
gqlError.message
|
|
846
|
+
);
|
|
820
847
|
return;
|
|
821
848
|
}
|
|
822
849
|
if (visibility === import_shared4.ErrorVisibility.SILENT) {
|
|
@@ -1065,7 +1092,11 @@ var getErrorActions = (error) => {
|
|
|
1065
1092
|
return {
|
|
1066
1093
|
primary: {
|
|
1067
1094
|
label: "Upgrade",
|
|
1068
|
-
onClick: () => window.open(
|
|
1095
|
+
onClick: () => window.open(
|
|
1096
|
+
"https://cloud.copilotkit.ai",
|
|
1097
|
+
"_blank",
|
|
1098
|
+
"noopener,noreferrer"
|
|
1099
|
+
)
|
|
1069
1100
|
}
|
|
1070
1101
|
};
|
|
1071
1102
|
default:
|
|
@@ -1188,16 +1219,19 @@ var CopilotErrorBoundary = class extends import_react7.default.Component {
|
|
|
1188
1219
|
// src/context/coagent-state-renders-context.tsx
|
|
1189
1220
|
var import_react8 = require("react");
|
|
1190
1221
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1191
|
-
var CoAgentStateRendersContext = (0, import_react8.createContext)(
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1222
|
+
var CoAgentStateRendersContext = (0, import_react8.createContext)(void 0);
|
|
1223
|
+
function CoAgentStateRendersProvider({
|
|
1224
|
+
children
|
|
1225
|
+
}) {
|
|
1195
1226
|
const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react8.useState)({});
|
|
1196
|
-
const setCoAgentStateRender = (0, import_react8.useCallback)(
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1227
|
+
const setCoAgentStateRender = (0, import_react8.useCallback)(
|
|
1228
|
+
(id, stateRender) => {
|
|
1229
|
+
setCoAgentStateRenders((prevPoints) => __spreadProps(__spreadValues({}, prevPoints), {
|
|
1230
|
+
[id]: stateRender
|
|
1231
|
+
}));
|
|
1232
|
+
},
|
|
1233
|
+
[]
|
|
1234
|
+
);
|
|
1201
1235
|
const removeCoAgentStateRender = (0, import_react8.useCallback)((id) => {
|
|
1202
1236
|
setCoAgentStateRenders((prevPoints) => {
|
|
1203
1237
|
const newPoints = __spreadValues({}, prevPoints);
|
|
@@ -1222,7 +1256,9 @@ function CoAgentStateRendersProvider({ children }) {
|
|
|
1222
1256
|
function useCoAgentStateRenders() {
|
|
1223
1257
|
const context = (0, import_react8.useContext)(CoAgentStateRendersContext);
|
|
1224
1258
|
if (!context) {
|
|
1225
|
-
throw new Error(
|
|
1259
|
+
throw new Error(
|
|
1260
|
+
"useCoAgentStateRenders must be used within CoAgentStateRendersProvider"
|
|
1261
|
+
);
|
|
1226
1262
|
}
|
|
1227
1263
|
return context;
|
|
1228
1264
|
}
|
|
@@ -1235,8 +1271,13 @@ var import_react12 = require("react");
|
|
|
1235
1271
|
var import_react9 = require("react");
|
|
1236
1272
|
var import_shared8 = require("@copilotkit/shared");
|
|
1237
1273
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1238
|
-
var ThreadsContext = (0, import_react9.createContext)(
|
|
1239
|
-
|
|
1274
|
+
var ThreadsContext = (0, import_react9.createContext)(
|
|
1275
|
+
void 0
|
|
1276
|
+
);
|
|
1277
|
+
function ThreadsProvider({
|
|
1278
|
+
children,
|
|
1279
|
+
threadId: explicitThreadId
|
|
1280
|
+
}) {
|
|
1240
1281
|
const [internalThreadId, setThreadId] = (0, import_react9.useState)(() => (0, import_shared8.randomUUID)());
|
|
1241
1282
|
const threadId = explicitThreadId != null ? explicitThreadId : internalThreadId;
|
|
1242
1283
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -1419,7 +1460,13 @@ function selectSnapshot({
|
|
|
1419
1460
|
cachedSnapshot = caches.byStateRenderAndRun[`${stateRenderId}::latest`];
|
|
1420
1461
|
}
|
|
1421
1462
|
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;
|
|
1422
|
-
return {
|
|
1463
|
+
return {
|
|
1464
|
+
snapshot,
|
|
1465
|
+
hasSnapshotKeys,
|
|
1466
|
+
cachedSnapshot,
|
|
1467
|
+
allowEmptySnapshot,
|
|
1468
|
+
snapshotForClaim
|
|
1469
|
+
};
|
|
1423
1470
|
}
|
|
1424
1471
|
|
|
1425
1472
|
// src/hooks/use-coagent-state-render-registry.ts
|
|
@@ -1524,7 +1571,9 @@ function useStateRenderRegistry({
|
|
|
1524
1571
|
});
|
|
1525
1572
|
}
|
|
1526
1573
|
if (existingClaim && !existingClaim.locked && (agentMessages == null ? void 0 : agentMessages.length)) {
|
|
1527
|
-
const indexInAgentMessages = agentMessages.findIndex(
|
|
1574
|
+
const indexInAgentMessages = agentMessages.findIndex(
|
|
1575
|
+
(msg) => msg.id === message.id
|
|
1576
|
+
);
|
|
1528
1577
|
if (indexInAgentMessages >= 0 && indexInAgentMessages < agentMessages.length - 1) {
|
|
1529
1578
|
existingClaim.locked = true;
|
|
1530
1579
|
}
|
|
@@ -1556,7 +1605,10 @@ function useStateRenderRegistry({
|
|
|
1556
1605
|
snapshotCache[`${stateRenderId}::latest`] = snapshotForClaim;
|
|
1557
1606
|
store[LAST_SNAPSHOTS_BY_RENDER_AND_RUN] = snapshotCache;
|
|
1558
1607
|
const messageCache = __spreadValues({}, (_f = store[LAST_SNAPSHOTS_BY_MESSAGE]) != null ? _f : {});
|
|
1559
|
-
messageCache[message.id] = {
|
|
1608
|
+
messageCache[message.id] = {
|
|
1609
|
+
snapshot: snapshotForClaim,
|
|
1610
|
+
runId: effectiveRunId
|
|
1611
|
+
};
|
|
1560
1612
|
store[LAST_SNAPSHOTS_BY_MESSAGE] = messageCache;
|
|
1561
1613
|
}
|
|
1562
1614
|
}
|
|
@@ -1596,18 +1648,23 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
1596
1648
|
}, [agentId, nodeName]);
|
|
1597
1649
|
const getStateRender = (0, import_react12.useCallback)(
|
|
1598
1650
|
(messageId) => {
|
|
1599
|
-
return Object.entries(coAgentStateRenders).find(
|
|
1600
|
-
|
|
1601
|
-
|
|
1651
|
+
return Object.entries(coAgentStateRenders).find(
|
|
1652
|
+
([stateRenderId2, stateRender2]) => {
|
|
1653
|
+
if (claimsRef.current[messageId]) {
|
|
1654
|
+
return stateRenderId2 === claimsRef.current[messageId].stateRenderId;
|
|
1655
|
+
}
|
|
1656
|
+
const matchingAgentName = stateRender2.name === agentId;
|
|
1657
|
+
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
1658
|
+
return matchingAgentName && matchesNodeContext;
|
|
1602
1659
|
}
|
|
1603
|
-
|
|
1604
|
-
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
1605
|
-
return matchingAgentName && matchesNodeContext;
|
|
1606
|
-
});
|
|
1660
|
+
);
|
|
1607
1661
|
},
|
|
1608
1662
|
[coAgentStateRenders, nodeName, agentId]
|
|
1609
1663
|
);
|
|
1610
|
-
const stateRenderEntry = (0, import_react12.useMemo)(
|
|
1664
|
+
const stateRenderEntry = (0, import_react12.useMemo)(
|
|
1665
|
+
() => getStateRender(message.id),
|
|
1666
|
+
[getStateRender, message.id]
|
|
1667
|
+
);
|
|
1611
1668
|
const stateRenderId = stateRenderEntry == null ? void 0 : stateRenderEntry[0];
|
|
1612
1669
|
const stateRender = stateRenderEntry == null ? void 0 : stateRenderEntry[1];
|
|
1613
1670
|
const registryMessage = __spreadProps(__spreadValues({}, message), {
|
|
@@ -1681,7 +1738,10 @@ var usePredictStateSubscription = (agent) => {
|
|
|
1681
1738
|
predictStateToolsRef.current.forEach((t) => {
|
|
1682
1739
|
if ((t == null ? void 0 : t.tool) !== toolCallName)
|
|
1683
1740
|
return;
|
|
1684
|
-
const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared11.parseJson)(
|
|
1741
|
+
const emittedState = typeof partialToolCallArgs === "string" ? (0, import_shared11.parseJson)(
|
|
1742
|
+
partialToolCallArgs,
|
|
1743
|
+
partialToolCallArgs
|
|
1744
|
+
) : partialToolCallArgs;
|
|
1685
1745
|
agent2.setState({
|
|
1686
1746
|
[t.state_key]: emittedState[t.state_key]
|
|
1687
1747
|
});
|
|
@@ -1710,7 +1770,13 @@ function CopilotListeners() {
|
|
|
1710
1770
|
(0, import_react13.useEffect)(() => {
|
|
1711
1771
|
const subscriber = {
|
|
1712
1772
|
onError: ({ error }) => {
|
|
1713
|
-
setBannerError(
|
|
1773
|
+
setBannerError(
|
|
1774
|
+
new import_shared12.CopilotKitLowLevelError({
|
|
1775
|
+
error,
|
|
1776
|
+
message: error.message,
|
|
1777
|
+
url: typeof window !== "undefined" ? window.location.href : ""
|
|
1778
|
+
})
|
|
1779
|
+
);
|
|
1714
1780
|
}
|
|
1715
1781
|
};
|
|
1716
1782
|
const subscription = copilotkit.subscribe(subscriber);
|
|
@@ -1729,15 +1795,22 @@ function CopilotKit(_a) {
|
|
|
1729
1795
|
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
1730
1796
|
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
1731
1797
|
const renderArr = (0, import_react15.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
|
|
1732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1799
|
+
CopilotErrorBoundary,
|
|
1800
|
+
{
|
|
1801
|
+
publicApiKey,
|
|
1802
|
+
showUsageBanner: enabled,
|
|
1803
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ThreadsProvider, { threadId: props.threadId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1804
|
+
import_react16.CopilotKitProvider,
|
|
1805
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1806
|
+
showDevConsole: showInspector,
|
|
1807
|
+
renderCustomMessages: renderArr,
|
|
1808
|
+
useSingleEndpoint: true,
|
|
1809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children }))
|
|
1810
|
+
})
|
|
1811
|
+
) })
|
|
1812
|
+
}
|
|
1813
|
+
) });
|
|
1741
1814
|
}
|
|
1742
1815
|
function CopilotKitErrorBridge() {
|
|
1743
1816
|
const { copilotkit } = (0, import_react16.useCopilotKit)();
|
|
@@ -1784,7 +1857,9 @@ function CopilotKitInternal(cpkProps) {
|
|
|
1784
1857
|
validateProps(cpkProps);
|
|
1785
1858
|
const publicApiKey = props.publicLicenseKey || props.publicApiKey;
|
|
1786
1859
|
const chatApiEndpoint = props.runtimeUrl || import_shared13.COPILOT_CLOUD_CHAT_URL;
|
|
1787
|
-
const [actions, setActions] = (0, import_react15.useState)(
|
|
1860
|
+
const [actions, setActions] = (0, import_react15.useState)(
|
|
1861
|
+
{}
|
|
1862
|
+
);
|
|
1788
1863
|
const [registeredActionConfigs, setRegisteredActionConfigs] = (0, import_react15.useState)(/* @__PURE__ */ new Map());
|
|
1789
1864
|
const chatComponentsCache = (0, import_react15.useRef)({
|
|
1790
1865
|
actions: {},
|
|
@@ -1845,7 +1920,9 @@ ${nonDocumentStrings}`;
|
|
|
1845
1920
|
}, [getAllElements]);
|
|
1846
1921
|
const getFunctionCallHandler = (0, import_react15.useCallback)(
|
|
1847
1922
|
(customEntryPoints) => {
|
|
1848
|
-
return entryPointsToFunctionCallHandler(
|
|
1923
|
+
return entryPointsToFunctionCallHandler(
|
|
1924
|
+
Object.values(customEntryPoints || actions)
|
|
1925
|
+
);
|
|
1849
1926
|
},
|
|
1850
1927
|
[actions]
|
|
1851
1928
|
);
|
|
@@ -1915,12 +1992,17 @@ ${nonDocumentStrings}`;
|
|
|
1915
1992
|
}
|
|
1916
1993
|
return acc;
|
|
1917
1994
|
}, {});
|
|
1918
|
-
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? {
|
|
1995
|
+
return __spreadValues(__spreadValues(__spreadValues({}, copilotApiConfig.headers || {}), copilotApiConfig.publicApiKey ? {
|
|
1996
|
+
[import_shared13.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey
|
|
1997
|
+
} : {}), authHeaders);
|
|
1919
1998
|
}, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
|
|
1920
1999
|
const [internalErrorHandlers, _setInternalErrorHandler] = (0, import_react15.useState)({});
|
|
1921
|
-
const setInternalErrorHandler = (0, import_react15.useCallback)(
|
|
1922
|
-
|
|
1923
|
-
|
|
2000
|
+
const setInternalErrorHandler = (0, import_react15.useCallback)(
|
|
2001
|
+
(handler) => {
|
|
2002
|
+
_setInternalErrorHandler((prev) => __spreadValues(__spreadValues({}, prev), handler));
|
|
2003
|
+
},
|
|
2004
|
+
[]
|
|
2005
|
+
);
|
|
1924
2006
|
const removeInternalErrorHandler = (0, import_react15.useCallback)((key) => {
|
|
1925
2007
|
_setInternalErrorHandler((prev) => {
|
|
1926
2008
|
const _a2 = prev, { [key]: _removed } = _a2, rest = __objRest(_a2, [__restKey(key)]);
|
|
@@ -1990,7 +2072,9 @@ ${nonDocumentStrings}`;
|
|
|
1990
2072
|
agentName: props.agent
|
|
1991
2073
|
};
|
|
1992
2074
|
}
|
|
1993
|
-
const [agentSession, setAgentSession] = (0, import_react15.useState)(
|
|
2075
|
+
const [agentSession, setAgentSession] = (0, import_react15.useState)(
|
|
2076
|
+
initialAgentSession
|
|
2077
|
+
);
|
|
1994
2078
|
(0, import_react15.useEffect)(() => {
|
|
1995
2079
|
if (props.agent) {
|
|
1996
2080
|
setAgentSession({
|
|
@@ -2004,7 +2088,9 @@ ${nonDocumentStrings}`;
|
|
|
2004
2088
|
const setThreadId = (0, import_react15.useCallback)(
|
|
2005
2089
|
(value) => {
|
|
2006
2090
|
if (props.threadId) {
|
|
2007
|
-
throw new Error(
|
|
2091
|
+
throw new Error(
|
|
2092
|
+
"Cannot call setThreadId() when threadId is provided via props."
|
|
2093
|
+
);
|
|
2008
2094
|
}
|
|
2009
2095
|
setInternalThreadId(value);
|
|
2010
2096
|
},
|
|
@@ -2014,17 +2100,20 @@ ${nonDocumentStrings}`;
|
|
|
2014
2100
|
const chatAbortControllerRef = (0, import_react15.useRef)(null);
|
|
2015
2101
|
const showDevConsole = shouldShowDevConsole(props.showDevConsole);
|
|
2016
2102
|
const [interruptActions, _setInterruptActions] = (0, import_react15.useState)({});
|
|
2017
|
-
const setInterruptAction = (0, import_react15.useCallback)(
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2103
|
+
const setInterruptAction = (0, import_react15.useCallback)(
|
|
2104
|
+
(action) => {
|
|
2105
|
+
_setInterruptActions((prev) => {
|
|
2106
|
+
var _a2;
|
|
2107
|
+
if (action == null || !action.id) {
|
|
2108
|
+
return prev;
|
|
2109
|
+
}
|
|
2110
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
2111
|
+
[action.id]: __spreadValues(__spreadValues({}, (_a2 = prev[action.id]) != null ? _a2 : {}), action)
|
|
2112
|
+
});
|
|
2025
2113
|
});
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2114
|
+
},
|
|
2115
|
+
[]
|
|
2116
|
+
);
|
|
2028
2117
|
const removeInterruptAction = (0, import_react15.useCallback)((actionId) => {
|
|
2029
2118
|
_setInterruptActions((prev) => {
|
|
2030
2119
|
const _a2 = prev, { [actionId]: _ } = _a2, rest = __objRest(_a2, [__restKey(actionId)]);
|
|
@@ -2090,15 +2179,18 @@ ${nonDocumentStrings}`;
|
|
|
2090
2179
|
},
|
|
2091
2180
|
[setAuthStates]
|
|
2092
2181
|
);
|
|
2093
|
-
const handleSetRegisteredActions = (0, import_react15.useCallback)(
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2182
|
+
const handleSetRegisteredActions = (0, import_react15.useCallback)(
|
|
2183
|
+
(actionConfig) => {
|
|
2184
|
+
const key = actionConfig.action.name || (0, import_shared13.randomUUID)();
|
|
2185
|
+
setRegisteredActionConfigs((prev) => {
|
|
2186
|
+
const newMap = new Map(prev);
|
|
2187
|
+
newMap.set(key, actionConfig);
|
|
2188
|
+
return newMap;
|
|
2189
|
+
});
|
|
2190
|
+
return key;
|
|
2191
|
+
},
|
|
2192
|
+
[]
|
|
2193
|
+
);
|
|
2102
2194
|
const handleRemoveRegisteredAction = (0, import_react15.useCallback)((actionKey) => {
|
|
2103
2195
|
setRegisteredActionConfigs((prev) => {
|
|
2104
2196
|
const newMap = new Map(prev);
|
|
@@ -2204,7 +2296,10 @@ ${nonDocumentStrings}`;
|
|
|
2204
2296
|
}
|
|
2205
2297
|
var defaultCopilotContextCategories = ["global"];
|
|
2206
2298
|
function entryPointsToFunctionCallHandler(actions) {
|
|
2207
|
-
return (_0) => __async(this, [_0], function* ({
|
|
2299
|
+
return (_0) => __async(this, [_0], function* ({
|
|
2300
|
+
name,
|
|
2301
|
+
args
|
|
2302
|
+
}) {
|
|
2208
2303
|
let actionsByFunctionName = {};
|
|
2209
2304
|
for (let action2 of actions) {
|
|
2210
2305
|
actionsByFunctionName[action2.name] = action2;
|