@copilotkit/react-core 0.0.0-fix-thread-id-prop-20260123171313 → 0.0.0-fix-shared-agent-state-20260123211820
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 +5 -5
- package/dist/{chunk-U2ZHE3ND.mjs → chunk-5AD2IPFP.mjs} +2 -2
- package/dist/{chunk-PZ2SR7P3.mjs → chunk-6NUVZ5CP.mjs} +3 -3
- package/dist/{chunk-LMHB2D4J.mjs → chunk-F555TVE4.mjs} +3 -3
- package/dist/chunk-F555TVE4.mjs.map +1 -0
- package/dist/{chunk-W5BKJN46.mjs → chunk-IHLIHD47.mjs} +2 -2
- package/dist/{chunk-M7U7RZLU.mjs → chunk-TBYDA4HF.mjs} +2 -2
- package/dist/{chunk-OBXQSB7S.mjs → chunk-TFXMWZMK.mjs} +2 -2
- package/dist/{chunk-QNUAXSDP.mjs → chunk-YA2XQ5X2.mjs} +8 -6
- package/dist/{chunk-QNUAXSDP.mjs.map → chunk-YA2XQ5X2.mjs.map} +1 -1
- package/dist/components/copilot-provider/copilotkit.js +9 -7
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +3 -3
- package/dist/components/copilot-provider/index.js +9 -7
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +3 -3
- package/dist/components/index.js +9 -7
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/context/threads-context.js +2 -2
- package/dist/context/threads-context.js.map +1 -1
- package/dist/context/threads-context.mjs +1 -1
- package/dist/hooks/index.js +7 -5
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/use-coagent-state-render-bridge.js +7 -5
- package/dist/hooks/use-coagent-state-render-bridge.js.map +1 -1
- package/dist/hooks/use-coagent-state-render-bridge.mjs +2 -2
- package/dist/hooks/use-copilot-chat-headless_c.js +7 -5
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +4 -4
- package/dist/hooks/use-copilot-chat.js +7 -5
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +4 -4
- package/dist/hooks/use-copilot-chat_internal.js +7 -5
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +3 -3
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/lib/copilot-task.mjs +4 -4
- package/dist/lib/index.mjs +4 -4
- package/dist/setupTests.js +2 -2
- package/dist/setupTests.js.map +1 -1
- package/dist/setupTests.mjs +2 -2
- package/dist/setupTests.mjs.map +1 -1
- package/package.json +7 -7
- package/src/context/threads-context.tsx +2 -2
- package/src/hooks/__tests__/use-coagent-state-render.e2e.test.tsx +163 -0
- package/src/hooks/use-coagent-state-render-bridge.tsx +11 -5
- package/src/setupTests.ts +1 -1
- package/dist/chunk-LMHB2D4J.mjs.map +0 -1
- package/src/context/__tests__/threads-context.test.tsx +0 -28
- /package/dist/{chunk-U2ZHE3ND.mjs.map → chunk-5AD2IPFP.mjs.map} +0 -0
- /package/dist/{chunk-PZ2SR7P3.mjs.map → chunk-6NUVZ5CP.mjs.map} +0 -0
- /package/dist/{chunk-W5BKJN46.mjs.map → chunk-IHLIHD47.mjs.map} +0 -0
- /package/dist/{chunk-M7U7RZLU.mjs.map → chunk-TBYDA4HF.mjs.map} +0 -0
- /package/dist/{chunk-OBXQSB7S.mjs.map → chunk-TFXMWZMK.mjs.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CopilotKit,
|
|
3
3
|
CopilotKitInternal,
|
|
4
4
|
defaultCopilotContextCategories
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-6NUVZ5CP.mjs";
|
|
6
6
|
import "../../chunk-FJEI7IBX.mjs";
|
|
7
7
|
import "../../chunk-CYDWEPFL.mjs";
|
|
8
8
|
import "../../chunk-2IDV5OHF.mjs";
|
|
@@ -13,9 +13,9 @@ import "../../chunk-PMAFHQ7P.mjs";
|
|
|
13
13
|
import "../../chunk-YYN33GSG.mjs";
|
|
14
14
|
import "../../chunk-BVBFFI7K.mjs";
|
|
15
15
|
import "../../chunk-O7ARI5CV.mjs";
|
|
16
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-YA2XQ5X2.mjs";
|
|
17
17
|
import "../../chunk-NB2FKV2V.mjs";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-F555TVE4.mjs";
|
|
19
19
|
import "../../chunk-WF65O6HX.mjs";
|
|
20
20
|
import "../../chunk-EFL5OBKN.mjs";
|
|
21
21
|
import "../../chunk-6ZLPNY7X.mjs";
|
|
@@ -1237,8 +1237,8 @@ var import_shared8 = require("@copilotkit/shared");
|
|
|
1237
1237
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1238
1238
|
var ThreadsContext = (0, import_react9.createContext)(void 0);
|
|
1239
1239
|
function ThreadsProvider({ children, threadId: explicitThreadId }) {
|
|
1240
|
-
const [internalThreadId, setThreadId] = (0, import_react9.useState)(
|
|
1241
|
-
const threadId =
|
|
1240
|
+
const [internalThreadId, setThreadId] = (0, import_react9.useState)(explicitThreadId != null ? explicitThreadId : (0, import_shared8.randomUUID)());
|
|
1241
|
+
const threadId = internalThreadId;
|
|
1242
1242
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1243
1243
|
ThreadsContext.Provider,
|
|
1244
1244
|
{
|
|
@@ -1370,12 +1370,14 @@ function useCoagentStateRenderBridge(agentId, props) {
|
|
|
1370
1370
|
if (!canRender) {
|
|
1371
1371
|
return null;
|
|
1372
1372
|
}
|
|
1373
|
-
if (snapshot
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
} else {
|
|
1373
|
+
if (snapshot) {
|
|
1374
|
+
const existingSnapshot = claimsRef.current[message.id].stateSnapshot;
|
|
1375
|
+
const snapshotChanged = stateSnapshot && existingSnapshot !== void 0 && !areStatesEquals(existingSnapshot, snapshot);
|
|
1376
|
+
if (!claimsRef.current[message.id].locked || snapshotChanged) {
|
|
1378
1377
|
claimsRef.current[message.id].stateSnapshot = snapshot;
|
|
1378
|
+
if (stateSnapshot) {
|
|
1379
|
+
claimsRef.current[message.id].locked = true;
|
|
1380
|
+
}
|
|
1379
1381
|
}
|
|
1380
1382
|
}
|
|
1381
1383
|
if (stateRender.handler) {
|