@copilotkit/react-core 1.75.0 → 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-D2emzYuj.cjs → copilotkit-Beiw32bn.cjs} +6 -16
- package/dist/copilotkit-Beiw32bn.cjs.map +1 -0
- package/dist/{copilotkit-CoWG8EAX.mjs → copilotkit-D9iy3p2l.mjs} +6 -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 +5 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +4 -14
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.mjs +4 -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 +5 -15
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/dist/copilotkit-CoWG8EAX.mjs.map +0 -1
- package/dist/copilotkit-D2emzYuj.cjs.map +0 -1
|
@@ -1635,7 +1635,7 @@ function useRenderToolCall() {
|
|
|
1635
1635
|
|
|
1636
1636
|
//#endregion
|
|
1637
1637
|
//#region package.json
|
|
1638
|
-
var version = "1.75.
|
|
1638
|
+
var version = "1.75.2";
|
|
1639
1639
|
|
|
1640
1640
|
//#endregion
|
|
1641
1641
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
@@ -4665,6 +4665,7 @@ function useAgent({ agentId, threadId, runtimeAgentId, updates, throttleMs } = {
|
|
|
4665
4665
|
if (updateFlags.includes(UseAgentUpdate.OnStateChanged)) handlers.onStateChanged = batchedForceUpdate;
|
|
4666
4666
|
if (updateFlags.includes(UseAgentUpdate.OnRunStatusChanged)) {
|
|
4667
4667
|
handlers.onRunInitialized = batchedForceUpdate;
|
|
4668
|
+
handlers.onRunStartedEvent = batchedForceUpdate;
|
|
4668
4669
|
handlers.onRunFinalized = batchedForceUpdate;
|
|
4669
4670
|
handlers.onRunFailed = batchedForceUpdate;
|
|
4670
4671
|
handlers.onRunErrorEvent = batchedForceUpdate;
|
|
@@ -5020,7 +5021,6 @@ function useInterrupt(config) {
|
|
|
5020
5021
|
pendingRef.current = pending;
|
|
5021
5022
|
const [handlerResult, setHandlerResult] = (0, react.useState)(null);
|
|
5022
5023
|
const interruptStateRef = (0, react.useRef)(new _copilotkit_core.ɵInterruptState());
|
|
5023
|
-
const interruptRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
5024
5024
|
const legacyRunIdRef = (0, react.useRef)(void 0);
|
|
5025
5025
|
(0, react.useEffect)(() => {
|
|
5026
5026
|
const interruptState = interruptStateRef.current;
|
|
@@ -5034,16 +5034,11 @@ function useInterrupt(config) {
|
|
|
5034
5034
|
};
|
|
5035
5035
|
},
|
|
5036
5036
|
onRunFinishedEvent: (params) => {
|
|
5037
|
-
if (params.outcome === "interrupt")
|
|
5038
|
-
const runId = params.input.runId;
|
|
5039
|
-
for (const interrupt of params.interrupts) interruptRunIdsRef.current.set(interrupt.id, runId);
|
|
5040
|
-
localStandard = params.interrupts;
|
|
5041
|
-
}
|
|
5037
|
+
if (params.outcome === "interrupt") localStandard = params.interrupts;
|
|
5042
5038
|
},
|
|
5043
5039
|
onRunStartedEvent: () => {
|
|
5044
5040
|
localLegacy = null;
|
|
5045
5041
|
localStandard = null;
|
|
5046
|
-
interruptRunIdsRef.current.clear();
|
|
5047
5042
|
legacyRunIdRef.current = void 0;
|
|
5048
5043
|
interruptState.clear();
|
|
5049
5044
|
setPending(null);
|
|
@@ -5063,7 +5058,6 @@ function useInterrupt(config) {
|
|
|
5063
5058
|
onRunFailed: () => {
|
|
5064
5059
|
localLegacy = null;
|
|
5065
5060
|
localStandard = null;
|
|
5066
|
-
interruptRunIdsRef.current.clear();
|
|
5067
5061
|
legacyRunIdRef.current = void 0;
|
|
5068
5062
|
interruptState.clear();
|
|
5069
5063
|
setPending(null);
|
|
@@ -5103,7 +5097,6 @@ function useInterrupt(config) {
|
|
|
5103
5097
|
return;
|
|
5104
5098
|
}
|
|
5105
5099
|
if (decision.kind !== "resume") return;
|
|
5106
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
5107
5100
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
5108
5101
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
5109
5102
|
role: "tool",
|
|
@@ -5113,8 +5106,7 @@ function useInterrupt(config) {
|
|
|
5113
5106
|
try {
|
|
5114
5107
|
return await copilotkit.runAgent({
|
|
5115
5108
|
agent,
|
|
5116
|
-
resume: decision.resume
|
|
5117
|
-
...runId !== void 0 ? { runId } : {}
|
|
5109
|
+
resume: decision.resume
|
|
5118
5110
|
});
|
|
5119
5111
|
} catch (err) {
|
|
5120
5112
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
@@ -5141,7 +5133,6 @@ function useInterrupt(config) {
|
|
|
5141
5133
|
return;
|
|
5142
5134
|
}
|
|
5143
5135
|
if (decision.kind !== "resume") return;
|
|
5144
|
-
const runId = decision.resume.map((entry) => interruptRunIdsRef.current.get(entry.interruptId)).find((candidate) => candidate !== void 0);
|
|
5145
5136
|
for (const toolResult of decision.toolResults) agent.addMessage({
|
|
5146
5137
|
id: (0, _ag_ui_client.randomUUID)(),
|
|
5147
5138
|
role: "tool",
|
|
@@ -5151,8 +5142,7 @@ function useInterrupt(config) {
|
|
|
5151
5142
|
try {
|
|
5152
5143
|
return await copilotkit.runAgent({
|
|
5153
5144
|
agent,
|
|
5154
|
-
resume: decision.resume
|
|
5155
|
-
...runId !== void 0 ? { runId } : {}
|
|
5145
|
+
resume: decision.resume
|
|
5156
5146
|
});
|
|
5157
5147
|
} catch (err) {
|
|
5158
5148
|
console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
|
|
@@ -13115,4 +13105,4 @@ Object.defineProperty(exports, 'useToast', {
|
|
|
13115
13105
|
return useToast;
|
|
13116
13106
|
}
|
|
13117
13107
|
});
|
|
13118
|
-
//# sourceMappingURL=copilotkit-
|
|
13108
|
+
//# sourceMappingURL=copilotkit-Beiw32bn.cjs.map
|