@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
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-4ZQYMC5F.mjs";
|
|
4
|
+
import "../chunk-AAGMWZCN.mjs";
|
|
5
5
|
import "../chunk-ZVF5Q6IH.mjs";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-6PUNP7CD.mjs";
|
|
6
|
+
import "../chunk-V42VL2JR.mjs";
|
|
7
|
+
import "../chunk-6AWG5FWL.mjs";
|
|
9
8
|
import "../chunk-O7ARI5CV.mjs";
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-I76HKHPJ.mjs";
|
|
10
|
+
import "../chunk-G7SUZGGB.mjs";
|
|
11
|
+
import "../chunk-QXZTCGF4.mjs";
|
|
12
|
+
import "../chunk-7GIBHX6X.mjs";
|
|
11
13
|
import "../chunk-NB2FKV2V.mjs";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-C3YJYDK4.mjs";
|
|
15
|
-
import "../chunk-EFL5OBKN.mjs";
|
|
16
|
-
import "../chunk-QD7EID4N.mjs";
|
|
17
|
-
import "../chunk-AFNWX62Q.mjs";
|
|
14
|
+
import "../chunk-IHMMKEFG.mjs";
|
|
15
|
+
import "../chunk-C7HSVDHD.mjs";
|
|
18
16
|
import "../chunk-DMLQZG75.mjs";
|
|
17
|
+
import "../chunk-SK2XMJUD.mjs";
|
|
18
|
+
import "../chunk-ZP2IMXFY.mjs";
|
|
19
19
|
import "../chunk-SKC7AJIV.mjs";
|
|
20
20
|
export {
|
|
21
21
|
useCopilotChat
|
|
@@ -116,7 +116,9 @@ var emptyCopilotContext = {
|
|
|
116
116
|
},
|
|
117
117
|
copilotApiConfig: new class {
|
|
118
118
|
get chatApiEndpoint() {
|
|
119
|
-
throw new Error(
|
|
119
|
+
throw new Error(
|
|
120
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
121
|
+
);
|
|
120
122
|
}
|
|
121
123
|
get headers() {
|
|
122
124
|
return {};
|
|
@@ -178,12 +180,16 @@ var CopilotContext = import_react.default.createContext(emptyCopilotContext);
|
|
|
178
180
|
function useCopilotContext() {
|
|
179
181
|
const context = import_react.default.useContext(CopilotContext);
|
|
180
182
|
if (context === emptyCopilotContext) {
|
|
181
|
-
throw new Error(
|
|
183
|
+
throw new Error(
|
|
184
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
185
|
+
);
|
|
182
186
|
}
|
|
183
187
|
return context;
|
|
184
188
|
}
|
|
185
189
|
function returnAndThrowInDebug(_value) {
|
|
186
|
-
throw new Error(
|
|
190
|
+
throw new Error(
|
|
191
|
+
"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!"
|
|
192
|
+
);
|
|
187
193
|
}
|
|
188
194
|
|
|
189
195
|
// src/components/error-boundary/error-utils.tsx
|
|
@@ -320,13 +326,13 @@ var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
|
320
326
|
// src/context/coagent-state-renders-context.tsx
|
|
321
327
|
var import_react4 = require("react");
|
|
322
328
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
323
|
-
var CoAgentStateRendersContext = (0, import_react4.createContext)(
|
|
324
|
-
void 0
|
|
325
|
-
);
|
|
329
|
+
var CoAgentStateRendersContext = (0, import_react4.createContext)(void 0);
|
|
326
330
|
function useCoAgentStateRenders() {
|
|
327
331
|
const context = (0, import_react4.useContext)(CoAgentStateRendersContext);
|
|
328
332
|
if (!context) {
|
|
329
|
-
throw new Error(
|
|
333
|
+
throw new Error(
|
|
334
|
+
"useCoAgentStateRenders must be used within CoAgentStateRendersProvider"
|
|
335
|
+
);
|
|
330
336
|
}
|
|
331
337
|
return context;
|
|
332
338
|
}
|
|
@@ -366,7 +372,12 @@ function useAgentNodeName(agentName) {
|
|
|
366
372
|
|
|
367
373
|
// src/hooks/use-langgraph-interrupt-render.ts
|
|
368
374
|
var import_react8 = require("@copilotkitnext/react");
|
|
369
|
-
var InterruptRenderer = ({
|
|
375
|
+
var InterruptRenderer = ({
|
|
376
|
+
event,
|
|
377
|
+
result,
|
|
378
|
+
render,
|
|
379
|
+
resolve
|
|
380
|
+
}) => {
|
|
370
381
|
return render({ event, result, resolve });
|
|
371
382
|
};
|
|
372
383
|
function useLangGraphInterruptRender(agent) {
|
|
@@ -468,7 +479,13 @@ function useLangGraphInterruptRender(agent) {
|
|
|
468
479
|
render,
|
|
469
480
|
resolve: resolveInterrupt
|
|
470
481
|
});
|
|
471
|
-
}, [
|
|
482
|
+
}, [
|
|
483
|
+
interruptActions,
|
|
484
|
+
interruptEventQueue,
|
|
485
|
+
threadId,
|
|
486
|
+
agentSession,
|
|
487
|
+
handleResolve
|
|
488
|
+
]);
|
|
472
489
|
}
|
|
473
490
|
|
|
474
491
|
// src/hooks/use-copilot-chat_internal.ts
|
|
@@ -665,7 +682,13 @@ function selectSnapshot({
|
|
|
665
682
|
cachedSnapshot = caches.byStateRenderAndRun[`${stateRenderId}::latest`];
|
|
666
683
|
}
|
|
667
684
|
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;
|
|
668
|
-
return {
|
|
685
|
+
return {
|
|
686
|
+
snapshot,
|
|
687
|
+
hasSnapshotKeys,
|
|
688
|
+
cachedSnapshot,
|
|
689
|
+
allowEmptySnapshot,
|
|
690
|
+
snapshotForClaim
|
|
691
|
+
};
|
|
669
692
|
}
|
|
670
693
|
|
|
671
694
|
// src/hooks/use-coagent-state-render-registry.ts
|
|
@@ -770,7 +793,9 @@ function useStateRenderRegistry({
|
|
|
770
793
|
});
|
|
771
794
|
}
|
|
772
795
|
if (existingClaim && !existingClaim.locked && (agentMessages == null ? void 0 : agentMessages.length)) {
|
|
773
|
-
const indexInAgentMessages = agentMessages.findIndex(
|
|
796
|
+
const indexInAgentMessages = agentMessages.findIndex(
|
|
797
|
+
(msg) => msg.id === message.id
|
|
798
|
+
);
|
|
774
799
|
if (indexInAgentMessages >= 0 && indexInAgentMessages < agentMessages.length - 1) {
|
|
775
800
|
existingClaim.locked = true;
|
|
776
801
|
}
|
|
@@ -802,7 +827,10 @@ function useStateRenderRegistry({
|
|
|
802
827
|
snapshotCache[`${stateRenderId}::latest`] = snapshotForClaim;
|
|
803
828
|
store[LAST_SNAPSHOTS_BY_RENDER_AND_RUN] = snapshotCache;
|
|
804
829
|
const messageCache = __spreadValues({}, (_f = store[LAST_SNAPSHOTS_BY_MESSAGE]) != null ? _f : {});
|
|
805
|
-
messageCache[message.id] = {
|
|
830
|
+
messageCache[message.id] = {
|
|
831
|
+
snapshot: snapshotForClaim,
|
|
832
|
+
runId: effectiveRunId
|
|
833
|
+
};
|
|
806
834
|
store[LAST_SNAPSHOTS_BY_MESSAGE] = messageCache;
|
|
807
835
|
}
|
|
808
836
|
}
|
|
@@ -842,18 +870,23 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
842
870
|
}, [agentId, nodeName]);
|
|
843
871
|
const getStateRender = (0, import_react13.useCallback)(
|
|
844
872
|
(messageId) => {
|
|
845
|
-
return Object.entries(coAgentStateRenders).find(
|
|
846
|
-
|
|
847
|
-
|
|
873
|
+
return Object.entries(coAgentStateRenders).find(
|
|
874
|
+
([stateRenderId2, stateRender2]) => {
|
|
875
|
+
if (claimsRef.current[messageId]) {
|
|
876
|
+
return stateRenderId2 === claimsRef.current[messageId].stateRenderId;
|
|
877
|
+
}
|
|
878
|
+
const matchingAgentName = stateRender2.name === agentId;
|
|
879
|
+
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
880
|
+
return matchingAgentName && matchesNodeContext;
|
|
848
881
|
}
|
|
849
|
-
|
|
850
|
-
const matchesNodeContext = stateRender2.nodeName ? stateRender2.nodeName === nodeName : true;
|
|
851
|
-
return matchingAgentName && matchesNodeContext;
|
|
852
|
-
});
|
|
882
|
+
);
|
|
853
883
|
},
|
|
854
884
|
[coAgentStateRenders, nodeName, agentId]
|
|
855
885
|
);
|
|
856
|
-
const stateRenderEntry = (0, import_react13.useMemo)(
|
|
886
|
+
const stateRenderEntry = (0, import_react13.useMemo)(
|
|
887
|
+
() => getStateRender(message.id),
|
|
888
|
+
[getStateRender, message.id]
|
|
889
|
+
);
|
|
857
890
|
const stateRenderId = stateRenderEntry == null ? void 0 : stateRenderEntry[0];
|
|
858
891
|
const stateRender = stateRenderEntry == null ? void 0 : stateRenderEntry[1];
|
|
859
892
|
const registryMessage = __spreadProps(__spreadValues({}, message), {
|
|
@@ -980,14 +1013,18 @@ function useCopilotChatInternal({
|
|
|
980
1013
|
if (isLoading || messages.length === 0) {
|
|
981
1014
|
return;
|
|
982
1015
|
}
|
|
983
|
-
const reloadMessageIndex = messages.findIndex(
|
|
1016
|
+
const reloadMessageIndex = messages.findIndex(
|
|
1017
|
+
(msg) => msg.id === reloadMessageId
|
|
1018
|
+
);
|
|
984
1019
|
if (reloadMessageIndex === -1) {
|
|
985
1020
|
console.warn(`Message with id ${reloadMessageId} not found`);
|
|
986
1021
|
return;
|
|
987
1022
|
}
|
|
988
1023
|
const reloadMessageRole = messages[reloadMessageIndex].role;
|
|
989
1024
|
if (reloadMessageRole !== "assistant") {
|
|
990
|
-
console.warn(
|
|
1025
|
+
console.warn(
|
|
1026
|
+
`Regenerate cannot be performed on ${reloadMessageRole} role`
|
|
1027
|
+
);
|
|
991
1028
|
return;
|
|
992
1029
|
}
|
|
993
1030
|
let historyCutoff = [messages[0]];
|
|
@@ -999,7 +1036,10 @@ function useCopilotChatInternal({
|
|
|
999
1036
|
const indexOfLastUserMessageBeforeRegenerate = messages.findIndex(
|
|
1000
1037
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1001
1038
|
);
|
|
1002
|
-
historyCutoff = messages.slice(
|
|
1039
|
+
historyCutoff = messages.slice(
|
|
1040
|
+
0,
|
|
1041
|
+
indexOfLastUserMessageBeforeRegenerate + 1
|
|
1042
|
+
);
|
|
1003
1043
|
}
|
|
1004
1044
|
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1005
1045
|
historyCutoff = [messages[0], messages[1]];
|
|
@@ -1014,7 +1054,12 @@ function useCopilotChatInternal({
|
|
|
1014
1054
|
}
|
|
1015
1055
|
return;
|
|
1016
1056
|
}),
|
|
1017
|
-
[
|
|
1057
|
+
[
|
|
1058
|
+
agent == null ? void 0 : agent.messages.length,
|
|
1059
|
+
agent == null ? void 0 : agent.isRunning,
|
|
1060
|
+
agent == null ? void 0 : agent.setMessages,
|
|
1061
|
+
copilotkit == null ? void 0 : copilotkit.runAgent
|
|
1062
|
+
]
|
|
1018
1063
|
);
|
|
1019
1064
|
const latestSendMessageFunc = useAsyncCallback(
|
|
1020
1065
|
(message, options) => __async(this, null, function* () {
|
|
@@ -1110,7 +1155,10 @@ function useCopilotChatInternal({
|
|
|
1110
1155
|
const bridgeRenderer = legacyCustomMessageRenderer || renderCustomMessage ? () => {
|
|
1111
1156
|
var _a3;
|
|
1112
1157
|
if (legacyCustomMessageRenderer) {
|
|
1113
|
-
return legacyCustomMessageRenderer({
|
|
1158
|
+
return legacyCustomMessageRenderer({
|
|
1159
|
+
message,
|
|
1160
|
+
position: "before"
|
|
1161
|
+
});
|
|
1114
1162
|
}
|
|
1115
1163
|
try {
|
|
1116
1164
|
return (_a3 = renderCustomMessage == null ? void 0 : renderCustomMessage({ message, position: "before" })) != null ? _a3 : null;
|
|
@@ -1130,7 +1178,9 @@ function useCopilotChatInternal({
|
|
|
1130
1178
|
}
|
|
1131
1179
|
return message;
|
|
1132
1180
|
});
|
|
1133
|
-
const hasAssistantMessages = processedMessages.some(
|
|
1181
|
+
const hasAssistantMessages = processedMessages.some(
|
|
1182
|
+
(msg) => msg.role === "assistant"
|
|
1183
|
+
);
|
|
1134
1184
|
const canUseCustomRenderer = Boolean(
|
|
1135
1185
|
renderCustomMessage && ((_a2 = copilotkit == null ? void 0 : copilotkit.getAgent) == null ? void 0 : _a2.call(copilotkit, resolvedAgentId))
|
|
1136
1186
|
);
|
|
@@ -1145,7 +1195,11 @@ function useCopilotChatInternal({
|
|
|
1145
1195
|
}
|
|
1146
1196
|
}
|
|
1147
1197
|
const latestUserMessageId = latestUserIndex >= 0 ? processedMessages[latestUserIndex].id : void 0;
|
|
1148
|
-
const currentRunId = latestUserMessageId ? copilotkit.getRunIdForMessage(
|
|
1198
|
+
const currentRunId = latestUserMessageId ? copilotkit.getRunIdForMessage(
|
|
1199
|
+
resolvedAgentId,
|
|
1200
|
+
effectiveThreadId,
|
|
1201
|
+
latestUserMessageId
|
|
1202
|
+
) || `pending:${latestUserMessageId}` : void 0;
|
|
1149
1203
|
const hasAssistantForCurrentRun = latestUserIndex >= 0 ? processedMessages.slice(latestUserIndex + 1).some((msg) => msg.role === "assistant") : hasAssistantMessages;
|
|
1150
1204
|
if (placeholderRenderer && shouldRenderPlaceholder && !hasAssistantForCurrentRun) {
|
|
1151
1205
|
const placeholderId = currentRunId ? `coagent-state-render-${resolvedAgentId}-${currentRunId}` : `coagent-state-render-${resolvedAgentId}`;
|