@copilotkit/react-core 1.8.5-next.0 → 1.8.5-next.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/CHANGELOG.md +15 -0
- package/dist/{chunk-FUO5LKSJ.mjs → chunk-3SEVLFCA.mjs} +20 -13
- package/dist/chunk-3SEVLFCA.mjs.map +1 -0
- package/dist/{chunk-37LXOL6B.mjs → chunk-7L3NZ62H.mjs} +4 -4
- package/dist/{chunk-OKBPP25E.mjs → chunk-D7RMRLCH.mjs} +7 -7
- package/dist/{chunk-S3XGAWBE.mjs → chunk-PFJ3BDPT.mjs} +12 -9
- package/dist/chunk-PFJ3BDPT.mjs.map +1 -0
- package/dist/{chunk-XFL2DWUF.mjs → chunk-QN2TX22X.mjs} +2 -2
- package/dist/{chunk-TUEB3WSW.mjs → chunk-SSK37F2G.mjs} +5 -5
- package/dist/{chunk-5XQEGQL3.mjs → chunk-VYCMSWE4.mjs} +2 -2
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit.mjs +5 -5
- package/dist/components/copilot-provider/index.mjs +5 -5
- package/dist/components/index.mjs +5 -5
- package/dist/context/index.mjs +4 -4
- package/dist/hooks/index.js +25 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +25 -25
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +19 -12
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +1 -1
- package/dist/hooks/use-coagent.js +25 -15
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +9 -9
- package/dist/hooks/use-copilot-chat.d.ts +1 -1
- package/dist/hooks/use-copilot-chat.js +25 -15
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +8 -8
- package/dist/hooks/use-langgraph-interrupt-render.mjs +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +25 -15
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +9 -9
- package/dist/index.js +25 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -29
- package/dist/lib/copilot-task.mjs +6 -6
- package/dist/lib/index.mjs +6 -6
- package/dist/utils/extract.mjs +5 -5
- package/dist/utils/index.mjs +5 -5
- package/package.json +3 -3
- package/src/hooks/use-chat.ts +21 -13
- package/src/hooks/use-copilot-chat.ts +7 -4
- package/dist/chunk-FUO5LKSJ.mjs.map +0 -1
- package/dist/chunk-S3XGAWBE.mjs.map +0 -1
- /package/dist/{chunk-37LXOL6B.mjs.map → chunk-7L3NZ62H.mjs.map} +0 -0
- /package/dist/{chunk-OKBPP25E.mjs.map → chunk-D7RMRLCH.mjs.map} +0 -0
- /package/dist/{chunk-XFL2DWUF.mjs.map → chunk-QN2TX22X.mjs.map} +0 -0
- /package/dist/{chunk-TUEB3WSW.mjs.map → chunk-SSK37F2G.mjs.map} +0 -0
- /package/dist/{chunk-5XQEGQL3.mjs.map → chunk-VYCMSWE4.mjs.map} +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultSystemMessage,
|
|
3
3
|
useCopilotChat
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PFJ3BDPT.mjs";
|
|
5
|
+
import "../chunk-YPSGKPDA.mjs";
|
|
6
|
+
import "../chunk-D7RMRLCH.mjs";
|
|
6
7
|
import "../chunk-534J55RX.mjs";
|
|
7
8
|
import "../chunk-MLAS4QUR.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-5FHSUKQL.mjs";
|
|
9
|
+
import "../chunk-7L3NZ62H.mjs";
|
|
10
10
|
import "../chunk-6U3UH3KO.mjs";
|
|
11
11
|
import "../chunk-PMAFHQ7P.mjs";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-YPSGKPDA.mjs";
|
|
14
|
-
import "../chunk-PTSWFERP.mjs";
|
|
12
|
+
import "../chunk-5FHSUKQL.mjs";
|
|
15
13
|
import "../chunk-DCTJZ742.mjs";
|
|
16
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-D34OH4VN.mjs";
|
|
15
|
+
import "../chunk-3SEVLFCA.mjs";
|
|
17
16
|
import "../chunk-4CEQJ2X6.mjs";
|
|
18
17
|
import "../chunk-BKTARDXX.mjs";
|
|
18
|
+
import "../chunk-PTSWFERP.mjs";
|
|
19
19
|
import "../chunk-22ENANUU.mjs";
|
|
20
20
|
import "../chunk-O7ARI5CV.mjs";
|
|
21
21
|
import "../chunk-SKC7AJIV.mjs";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
useLangGraphInterruptRender
|
|
3
3
|
} from "../chunk-7XNZHQWJ.mjs";
|
|
4
4
|
import "../chunk-YPSGKPDA.mjs";
|
|
5
|
-
import "../chunk-PTSWFERP.mjs";
|
|
6
5
|
import "../chunk-DCTJZ742.mjs";
|
|
6
|
+
import "../chunk-PTSWFERP.mjs";
|
|
7
7
|
import "../chunk-SKC7AJIV.mjs";
|
|
8
8
|
export {
|
|
9
9
|
useLangGraphInterruptRender
|
|
@@ -762,18 +762,25 @@ function useChat(options) {
|
|
|
762
762
|
}),
|
|
763
763
|
[isLoading, messages, setMessages, runChatCompletionAndHandleFunctionCall]
|
|
764
764
|
);
|
|
765
|
-
const reload = useAsyncCallback(
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
765
|
+
const reload = useAsyncCallback(
|
|
766
|
+
(messageId) => __async(this, null, function* () {
|
|
767
|
+
if (isLoading || messages.length === 0) {
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
const index = messages.findIndex((msg) => msg.id === messageId);
|
|
771
|
+
if (index === -1) {
|
|
772
|
+
console.warn(`Message with id ${messageId} not found`);
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
let newMessages = messages.slice(0, index);
|
|
776
|
+
if (newMessages.length > 0 && newMessages[newMessages.length - 1].isAgentStateMessage()) {
|
|
777
|
+
newMessages = newMessages.slice(0, newMessages.length - 1);
|
|
778
|
+
}
|
|
779
|
+
setMessages(newMessages);
|
|
780
|
+
return runChatCompletionAndHandleFunctionCall(newMessages);
|
|
781
|
+
}),
|
|
782
|
+
[isLoading, messages, setMessages, runChatCompletionAndHandleFunctionCall]
|
|
783
|
+
);
|
|
777
784
|
const stop = () => {
|
|
778
785
|
var _a;
|
|
779
786
|
(_a = chatAbortControllerRef.current) == null ? void 0 : _a.abort("Stop was called");
|
|
@@ -991,9 +998,12 @@ function useCopilotChat(_a = {}) {
|
|
|
991
998
|
[latestAppend]
|
|
992
999
|
);
|
|
993
1000
|
const latestReload = useUpdatedRef(reload);
|
|
994
|
-
const latestReloadFunc = useAsyncCallback(
|
|
995
|
-
|
|
996
|
-
|
|
1001
|
+
const latestReloadFunc = useAsyncCallback(
|
|
1002
|
+
(messageId) => __async(this, null, function* () {
|
|
1003
|
+
return yield latestReload.current(messageId);
|
|
1004
|
+
}),
|
|
1005
|
+
[latestReload]
|
|
1006
|
+
);
|
|
997
1007
|
const latestStop = useUpdatedRef(stop);
|
|
998
1008
|
const latestStopFunc = (0, import_react8.useCallback)(() => {
|
|
999
1009
|
return latestStop.current();
|