@copilotkit/react-core 1.9.2-next.21 → 1.9.2-next.23
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 +17 -0
- package/dist/{chunk-MTAJI7HV.mjs → chunk-6ZLSC4KB.mjs} +20 -15
- package/dist/chunk-6ZLSC4KB.mjs.map +1 -0
- package/dist/{chunk-DGON3GZX.mjs → chunk-BSAVFYRQ.mjs} +4 -4
- package/dist/{chunk-RAQK4M64.mjs → chunk-CUAFWKTQ.mjs} +4 -4
- package/dist/{chunk-QKEH3O4S.mjs → chunk-GEE5AMYL.mjs} +8 -8
- package/dist/{chunk-N2M65NJ2.mjs → chunk-GIMSRCVW.mjs} +6 -6
- package/dist/{chunk-DDIBJUWK.mjs → chunk-KLENTCQV.mjs} +33 -7
- package/dist/{chunk-DDIBJUWK.mjs.map → chunk-KLENTCQV.mjs.map} +1 -1
- package/dist/{chunk-4URMLOBR.mjs → chunk-NGQN3JRJ.mjs} +2 -2
- package/dist/{chunk-SJJNFYGQ.mjs → chunk-SGF6C7I6.mjs} +4 -4
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit.mjs +8 -8
- package/dist/components/copilot-provider/index.mjs +8 -8
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.mjs +8 -8
- package/dist/context/index.mjs +4 -4
- package/dist/hooks/index.js +42 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +14 -14
- package/dist/hooks/use-chat.js +16 -11
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +3 -3
- package/dist/hooks/use-coagent.js +42 -11
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +13 -13
- package/dist/hooks/use-copilot-chat.js +16 -11
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +12 -12
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +16 -11
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +13 -13
- package/dist/index.js +42 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/lib/copilot-task.mjs +10 -10
- package/dist/lib/index.mjs +10 -10
- package/dist/setupTests.d.ts +2 -0
- package/dist/setupTests.js +26 -0
- package/dist/setupTests.js.map +1 -0
- package/dist/setupTests.mjs +24 -0
- package/dist/setupTests.mjs.map +1 -0
- package/dist/utils/extract.mjs +8 -8
- package/dist/utils/index.mjs +8 -8
- package/jest.config.js +4 -0
- package/package.json +6 -3
- package/src/hooks/__tests__/use-coagent-config.test.ts +284 -0
- package/src/hooks/use-chat.ts +2 -0
- package/src/hooks/use-coagent.ts +36 -0
- package/src/setupTests.ts +26 -0
- package/tsconfig.json +2 -2
- package/dist/chunk-MTAJI7HV.mjs.map +0 -1
- /package/dist/{chunk-DGON3GZX.mjs.map → chunk-BSAVFYRQ.mjs.map} +0 -0
- /package/dist/{chunk-RAQK4M64.mjs.map → chunk-CUAFWKTQ.mjs.map} +0 -0
- /package/dist/{chunk-QKEH3O4S.mjs.map → chunk-GEE5AMYL.mjs.map} +0 -0
- /package/dist/{chunk-N2M65NJ2.mjs.map → chunk-GIMSRCVW.mjs.map} +0 -0
- /package/dist/{chunk-4URMLOBR.mjs.map → chunk-NGQN3JRJ.mjs.map} +0 -0
- /package/dist/{chunk-SJJNFYGQ.mjs.map → chunk-SGF6C7I6.mjs.map} +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useLangGraphInterrupt
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-NGQN3JRJ.mjs";
|
|
4
|
+
import "../chunk-GEE5AMYL.mjs";
|
|
5
|
+
import "../chunk-6ZLSC4KB.mjs";
|
|
6
|
+
import "../chunk-4CEQJ2X6.mjs";
|
|
7
|
+
import "../chunk-GIMSRCVW.mjs";
|
|
8
|
+
import "../chunk-SGF6C7I6.mjs";
|
|
9
|
+
import "../chunk-BSAVFYRQ.mjs";
|
|
10
|
+
import "../chunk-PMAFHQ7P.mjs";
|
|
8
11
|
import "../chunk-5FHSUKQL.mjs";
|
|
9
12
|
import "../chunk-RKTVJRK7.mjs";
|
|
10
|
-
import "../chunk-PMAFHQ7P.mjs";
|
|
11
|
-
import "../chunk-57K2ZJ5F.mjs";
|
|
12
|
-
import "../chunk-YPSGKPDA.mjs";
|
|
13
|
-
import "../chunk-DCTJZ742.mjs";
|
|
14
|
-
import "../chunk-MTAJI7HV.mjs";
|
|
15
|
-
import "../chunk-4CEQJ2X6.mjs";
|
|
16
|
-
import "../chunk-3OQM3NEK.mjs";
|
|
17
|
-
import "../chunk-O7ARI5CV.mjs";
|
|
18
13
|
import "../chunk-JWAXDYOW.mjs";
|
|
19
14
|
import "../chunk-GFJW4RIM.mjs";
|
|
15
|
+
import "../chunk-3OQM3NEK.mjs";
|
|
16
|
+
import "../chunk-O7ARI5CV.mjs";
|
|
20
17
|
import "../chunk-YAF2LATQ.mjs";
|
|
18
|
+
import "../chunk-57K2ZJ5F.mjs";
|
|
19
|
+
import "../chunk-YPSGKPDA.mjs";
|
|
21
20
|
import "../chunk-DKZTPL66.mjs";
|
|
21
|
+
import "../chunk-DCTJZ742.mjs";
|
|
22
22
|
import "../chunk-SKC7AJIV.mjs";
|
|
23
23
|
export {
|
|
24
24
|
useLangGraphInterrupt
|
package/dist/index.js
CHANGED
|
@@ -2444,17 +2444,22 @@ function useChat(options) {
|
|
|
2444
2444
|
lastAgentStateMessage.state.messages
|
|
2445
2445
|
);
|
|
2446
2446
|
}
|
|
2447
|
-
setCoagentStatesWithRef((prevAgentStates) =>
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2447
|
+
setCoagentStatesWithRef((prevAgentStates) => {
|
|
2448
|
+
var _a2;
|
|
2449
|
+
return __spreadProps(__spreadValues({}, prevAgentStates), {
|
|
2450
|
+
[lastAgentStateMessage.agentName]: {
|
|
2451
|
+
name: lastAgentStateMessage.agentName,
|
|
2452
|
+
state: lastAgentStateMessage.state,
|
|
2453
|
+
running: lastAgentStateMessage.running,
|
|
2454
|
+
active: lastAgentStateMessage.active,
|
|
2455
|
+
threadId: lastAgentStateMessage.threadId,
|
|
2456
|
+
nodeName: lastAgentStateMessage.nodeName,
|
|
2457
|
+
runId: lastAgentStateMessage.runId,
|
|
2458
|
+
// Preserve existing config from previous state
|
|
2459
|
+
config: (_a2 = prevAgentStates[lastAgentStateMessage.agentName]) == null ? void 0 : _a2.config
|
|
2460
|
+
}
|
|
2461
|
+
});
|
|
2462
|
+
});
|
|
2458
2463
|
if (lastAgentStateMessage.running) {
|
|
2459
2464
|
setAgentSession({
|
|
2460
2465
|
threadId: lastAgentStateMessage.threadId,
|
|
@@ -3354,6 +3359,32 @@ function useCoAgent(options) {
|
|
|
3354
3359
|
// reset initialstate on reset
|
|
3355
3360
|
coagentStates[name] === void 0
|
|
3356
3361
|
]);
|
|
3362
|
+
(0, import_react17.useEffect)(() => {
|
|
3363
|
+
const newConfig = options.config ? options.config : options.configurable ? { configurable: options.configurable } : void 0;
|
|
3364
|
+
if (newConfig === void 0)
|
|
3365
|
+
return;
|
|
3366
|
+
setCoagentStatesWithRef((prev) => {
|
|
3367
|
+
var _a;
|
|
3368
|
+
const existing = (_a = prev[name]) != null ? _a : {
|
|
3369
|
+
name,
|
|
3370
|
+
state: isInternalStateManagementWithInitial(options) ? options.initialState : {},
|
|
3371
|
+
config: {},
|
|
3372
|
+
running: false,
|
|
3373
|
+
active: false,
|
|
3374
|
+
threadId: void 0,
|
|
3375
|
+
nodeName: void 0,
|
|
3376
|
+
runId: void 0
|
|
3377
|
+
};
|
|
3378
|
+
if (JSON.stringify(existing.config) === JSON.stringify(newConfig)) {
|
|
3379
|
+
return prev;
|
|
3380
|
+
}
|
|
3381
|
+
return __spreadProps(__spreadValues({}, prev), {
|
|
3382
|
+
[name]: __spreadProps(__spreadValues({}, existing), {
|
|
3383
|
+
config: newConfig
|
|
3384
|
+
})
|
|
3385
|
+
});
|
|
3386
|
+
});
|
|
3387
|
+
}, [JSON.stringify(options.config), JSON.stringify(options.configurable)]);
|
|
3357
3388
|
const runAgentCallback = useAsyncCallback(
|
|
3358
3389
|
(hint) => __async(this, null, function* () {
|
|
3359
3390
|
yield runAgent(name, context, appendMessage, runChatCompletion, hint);
|