@copilotkit/react-core 1.75.1 → 1.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{copilotkit-DIudpHkM.cjs → copilotkit-Beiw32bn.cjs} +5 -16
- package/dist/copilotkit-Beiw32bn.cjs.map +1 -0
- package/dist/{copilotkit-DfsHZUuo.mjs → copilotkit-D9iy3p2l.mjs} +5 -16
- package/dist/copilotkit-D9iy3p2l.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +4 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +3 -14
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.mjs +3 -14
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +4 -15
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/dist/copilotkit-DIudpHkM.cjs.map +0 -1
- package/dist/copilotkit-DfsHZUuo.mjs.map +0 -1
package/dist/v2/headless.cjs
CHANGED
|
@@ -890,7 +890,6 @@ function useInterrupt(config) {
|
|
|
890
890
|
pendingRef.current = pending;
|
|
891
891
|
const [handlerResult, setHandlerResult] = (0, react.useState)(null);
|
|
892
892
|
const interruptStateRef = (0, react.useRef)(new _copilotkit_core.ɵInterruptState());
|
|
893
|
-
const interruptRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
894
893
|
const legacyRunIdRef = (0, react.useRef)(void 0);
|
|
895
894
|
(0, react.useEffect)(() => {
|
|
896
895
|
const interruptState = interruptStateRef.current;
|
|
@@ -904,16 +903,11 @@ function useInterrupt(config) {
|
|
|
904
903
|
};
|
|
905
904
|
},
|
|
906
905
|
onRunFinishedEvent: (params) => {
|
|
907
|
-
if (params.outcome === "interrupt")
|
|
908
|
-
const runId = params.input.runId;
|
|
909
|
-
for (const interrupt of params.interrupts) interruptRunIdsRef.current.set(interrupt.id, runId);
|
|
910
|
-
localStandard = params.interrupts;
|
|
911
|
-
}
|
|
906
|
+
if (params.outcome === "interrupt") localStandard = params.interrupts;
|
|
912
907
|
},
|
|
913
908
|
onRunStartedEvent: () => {
|
|
914
909
|
localLegacy = null;
|
|
915
910
|
localStandard = null;
|
|
916
|
-
interruptRunIdsRef.current.clear();
|
|
917
911
|
legacyRunIdRef.current = void 0;
|
|
918
912
|
interruptState.clear();
|
|
919
913
|
setPending(null);
|
|
@@ -933,7 +927,6 @@ function useInterrupt(config) {
|
|
|
933
927
|
onRunFailed: () => {
|
|
934
928
|
localLegacy = null;
|
|
935
929
|
localStandard = null;
|
|
936
|
-
interruptRunIdsRef.current.clear();
|
|
937
930
|
legacyRunIdRef.current = void 0;
|
|
938
931
|
interruptState.clear();
|
|
939
932
|
setPending(null);
|
|
@@ -973,7 +966,6 @@ function useInterrupt(config) {
|
|
|
973
966
|
return;
|
|
974
967
|
}
|
|
975
968
|
if (decision.kind !== "resume") return;
|
|
976
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
977
969
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
978
970
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
979
971
|
role: "tool",
|
|
@@ -983,8 +975,7 @@ function useInterrupt(config) {
|
|
|
983
975
|
try {
|
|
984
976
|
return await copilotkit.runAgent({
|
|
985
977
|
agent,
|
|
986
|
-
resume: decision.resume
|
|
987
|
-
...runId !== void 0 ? { runId } : {}
|
|
978
|
+
resume: decision.resume
|
|
988
979
|
});
|
|
989
980
|
} catch (err) {
|
|
990
981
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
@@ -1011,7 +1002,6 @@ function useInterrupt(config) {
|
|
|
1011
1002
|
return;
|
|
1012
1003
|
}
|
|
1013
1004
|
if (decision.kind !== "resume") return;
|
|
1014
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
1015
1005
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
1016
1006
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
1017
1007
|
role: "tool",
|
|
@@ -1021,8 +1011,7 @@ function useInterrupt(config) {
|
|
|
1021
1011
|
try {
|
|
1022
1012
|
return await copilotkit.runAgent({
|
|
1023
1013
|
agent,
|
|
1024
|
-
resume: decision.resume
|
|
1025
|
-
...runId !== void 0 ? { runId } : {}
|
|
1014
|
+
resume: decision.resume
|
|
1026
1015
|
});
|
|
1027
1016
|
} catch (err) {
|
|
1028
1017
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|