@copilotkit/react-core 1.5.15-next.5 → 1.5.15-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/chunk-5M47BILE.mjs +63 -0
- package/dist/chunk-5M47BILE.mjs.map +1 -0
- package/dist/{chunk-DEPX7JPX.mjs → chunk-AXO32FSG.mjs} +2 -2
- package/dist/{chunk-5SGZKEPX.mjs → chunk-BG25THDF.mjs} +15 -6
- package/dist/chunk-BG25THDF.mjs.map +1 -0
- package/dist/{chunk-H2OR7FUU.mjs → chunk-E64HFWRV.mjs} +2 -2
- package/dist/{chunk-6PNZ77RB.mjs → chunk-ET3ABADH.mjs} +2 -2
- package/dist/{chunk-IU7OLWWW.mjs → chunk-NXHL6AOE.mjs} +7 -2
- package/dist/{chunk-IU7OLWWW.mjs.map → chunk-NXHL6AOE.mjs.map} +1 -1
- package/dist/components/copilot-provider/copilot-messages.js +28 -16
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +1 -1
- package/dist/components/copilot-provider/copilotkit.js +33 -16
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.js +33 -16
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/index.js +33 -16
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.js +12 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/use-coagent.js +12 -3
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +4 -4
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +4 -4
- package/dist/index.js +45 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +3 -3
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +2 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +3 -3
- package/src/components/copilot-provider/copilot-messages.tsx +33 -18
- package/src/components/copilot-provider/copilotkit.tsx +5 -0
- package/src/hooks/use-coagent.ts +16 -10
- package/dist/chunk-5SGZKEPX.mjs.map +0 -1
- package/dist/chunk-IHWTLSHY.mjs +0 -51
- package/dist/chunk-IHWTLSHY.mjs.map +0 -1
- /package/dist/{chunk-DEPX7JPX.mjs.map → chunk-AXO32FSG.mjs.map} +0 -0
- /package/dist/{chunk-H2OR7FUU.mjs.map → chunk-E64HFWRV.mjs.map} +0 -0
- /package/dist/{chunk-6PNZ77RB.mjs.map → chunk-ET3ABADH.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../chunk-ZAU4EMBM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useLangGraphInterrupt
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-ET3ABADH.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useMakeCopilotDocumentReadable
|
|
10
10
|
} from "../chunk-XOHLZIZK.mjs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
startAgent,
|
|
17
17
|
stopAgent,
|
|
18
18
|
useCoAgent
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BG25THDF.mjs";
|
|
20
20
|
import {
|
|
21
21
|
useCopilotAuthenticatedAction_c
|
|
22
22
|
} from "../chunk-GANI4ZZM.mjs";
|
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
} from "../chunk-AL3MOOKF.mjs";
|
|
26
26
|
import {
|
|
27
27
|
useCopilotChat
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-AXO32FSG.mjs";
|
|
29
29
|
import {
|
|
30
30
|
useCopilotReadable
|
|
31
31
|
} from "../chunk-7HWSAEOY.mjs";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-NXHL6AOE.mjs";
|
|
33
33
|
import "../chunk-UMQQA6HK.mjs";
|
|
34
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-5M47BILE.mjs";
|
|
35
35
|
import "../chunk-MLAS4QUR.mjs";
|
|
36
36
|
import "../chunk-6U3UH3KO.mjs";
|
|
37
37
|
import "../chunk-PMAFHQ7P.mjs";
|
|
@@ -1003,6 +1003,8 @@ function useCoAgent(options) {
|
|
|
1003
1003
|
const generalContext = useCopilotContext();
|
|
1004
1004
|
const { availableAgents } = generalContext;
|
|
1005
1005
|
const { addToast } = useToast();
|
|
1006
|
+
const lastLoadedThreadId = (0, import_react9.useRef)();
|
|
1007
|
+
const lastLoadedState = (0, import_react9.useRef)();
|
|
1006
1008
|
const isExternalStateManagement = (options2) => {
|
|
1007
1009
|
return "state" in options2 && "setState" in options2;
|
|
1008
1010
|
};
|
|
@@ -1052,13 +1054,20 @@ function useCoAgent(options) {
|
|
|
1052
1054
|
};
|
|
1053
1055
|
(0, import_react9.useEffect)(() => {
|
|
1054
1056
|
const fetchAgentState = () => __async(this, null, function* () {
|
|
1055
|
-
var _a, _b, _c, _d
|
|
1057
|
+
var _a, _b, _c, _d;
|
|
1058
|
+
if (!threadId || threadId === lastLoadedThreadId.current)
|
|
1059
|
+
return;
|
|
1056
1060
|
const result = yield runtimeClient.loadAgentState({
|
|
1057
1061
|
threadId,
|
|
1058
1062
|
agentName: name
|
|
1059
1063
|
});
|
|
1060
|
-
|
|
1061
|
-
|
|
1064
|
+
const newState = (_b = (_a = result.data) == null ? void 0 : _a.loadAgentState) == null ? void 0 : _b.state;
|
|
1065
|
+
if (newState === lastLoadedState.current)
|
|
1066
|
+
return;
|
|
1067
|
+
if (((_d = (_c = result.data) == null ? void 0 : _c.loadAgentState) == null ? void 0 : _d.threadExists) && newState && newState != "{}") {
|
|
1068
|
+
lastLoadedState.current = newState;
|
|
1069
|
+
lastLoadedThreadId.current = threadId;
|
|
1070
|
+
const fetchedState = JSON.parse(newState);
|
|
1062
1071
|
isExternalStateManagement(options) ? options.setState(fetchedState) : setState(fetchedState);
|
|
1063
1072
|
}
|
|
1064
1073
|
});
|