@copilotkit/react-core 1.10.5-next.3 → 1.10.5-next.5
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-667MDI44.mjs → chunk-5SPC4UVI.mjs} +5 -3
- package/dist/{chunk-667MDI44.mjs.map → chunk-5SPC4UVI.mjs.map} +1 -1
- package/dist/{chunk-G5C5THRU.mjs → chunk-6R5PM7YT.mjs} +2 -2
- package/dist/{chunk-7VVST2XL.mjs → chunk-7D4OASUM.mjs} +2 -2
- package/dist/{chunk-FIYI7ZK4.mjs → chunk-7LZXD5RJ.mjs} +4 -4
- package/dist/{chunk-QSXY7DMT.mjs → chunk-AOQEZ7AY.mjs} +2 -2
- package/dist/{chunk-KOQSZFJQ.mjs → chunk-DHGLYDRF.mjs} +3 -3
- package/dist/{chunk-FAHEDJFT.mjs → chunk-VQVTXQFI.mjs} +2 -2
- package/dist/{chunk-SIMMEOMI.mjs → chunk-WZSSCA5T.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -8
- package/dist/hooks/use-chat.js +4 -2
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +1 -1
- package/dist/hooks/use-coagent.js +4 -2
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +5 -5
- package/dist/hooks/use-copilot-chat-headless_c.js +4 -2
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +5 -5
- package/dist/hooks/use-copilot-chat.js +4 -2
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +5 -5
- package/dist/hooks/use-copilot-chat_internal.js +4 -2
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +4 -4
- package/dist/hooks/use-langgraph-interrupt.js +4 -2
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +5 -5
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/lib/copilot-task.mjs +3 -3
- package/dist/lib/index.mjs +3 -3
- package/dist/utils/extract.mjs +2 -2
- package/dist/utils/index.mjs +2 -2
- package/dist/utils/suggestions.mjs +2 -2
- package/package.json +3 -3
- package/src/hooks/use-chat.ts +4 -2
- /package/dist/{chunk-G5C5THRU.mjs.map → chunk-6R5PM7YT.mjs.map} +0 -0
- /package/dist/{chunk-7VVST2XL.mjs.map → chunk-7D4OASUM.mjs.map} +0 -0
- /package/dist/{chunk-FIYI7ZK4.mjs.map → chunk-7LZXD5RJ.mjs.map} +0 -0
- /package/dist/{chunk-QSXY7DMT.mjs.map → chunk-AOQEZ7AY.mjs.map} +0 -0
- /package/dist/{chunk-KOQSZFJQ.mjs.map → chunk-DHGLYDRF.mjs.map} +0 -0
- /package/dist/{chunk-FAHEDJFT.mjs.map → chunk-VQVTXQFI.mjs.map} +0 -0
- /package/dist/{chunk-SIMMEOMI.mjs.map → chunk-WZSSCA5T.mjs.map} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultSystemMessage,
|
|
3
3
|
useCopilotChat
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-DHGLYDRF.mjs";
|
|
5
5
|
import "../chunk-QF3Q5LUN.mjs";
|
|
6
6
|
import "../chunk-YPSGKPDA.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-7LZXD5RJ.mjs";
|
|
8
8
|
import "../chunk-L3I57GMV.mjs";
|
|
9
|
+
import "../chunk-MY2BUA6F.mjs";
|
|
9
10
|
import "../chunk-G2GQX4FI.mjs";
|
|
10
11
|
import "../chunk-23SOG4FI.mjs";
|
|
11
12
|
import "../chunk-PIF5KJYI.mjs";
|
|
12
|
-
import "../chunk-MY2BUA6F.mjs";
|
|
13
13
|
import "../chunk-2IDV5OHF.mjs";
|
|
14
14
|
import "../chunk-PMAFHQ7P.mjs";
|
|
15
15
|
import "../chunk-5FHSUKQL.mjs";
|
|
16
16
|
import "../chunk-RKTVJRK7.mjs";
|
|
17
17
|
import "../chunk-ZLQVRPDS.mjs";
|
|
18
18
|
import "../chunk-6ZLPNY7X.mjs";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-5SPC4UVI.mjs";
|
|
20
20
|
import "../chunk-4CEQJ2X6.mjs";
|
|
21
21
|
import "../chunk-N4WEHORG.mjs";
|
|
22
22
|
import "../chunk-O7ARI5CV.mjs";
|
|
@@ -1051,8 +1051,8 @@ function useChat(options) {
|
|
|
1051
1051
|
console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
|
|
1052
1052
|
return;
|
|
1053
1053
|
}
|
|
1054
|
-
let historyCutoff = [];
|
|
1055
|
-
if (messages.length > 2) {
|
|
1054
|
+
let historyCutoff = [messages[0]];
|
|
1055
|
+
if (messages.length > 2 && reloadMessageIndex !== 0) {
|
|
1056
1056
|
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
|
|
1057
1057
|
(msg) => (
|
|
1058
1058
|
// @ts-expect-error -- message has role
|
|
@@ -1063,6 +1063,8 @@ function useChat(options) {
|
|
|
1063
1063
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1064
1064
|
);
|
|
1065
1065
|
historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
|
|
1066
|
+
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1067
|
+
historyCutoff = [messages[0], messages[1]];
|
|
1066
1068
|
}
|
|
1067
1069
|
setMessages(historyCutoff);
|
|
1068
1070
|
return runChatCompletionAndHandleFunctionCall(historyCutoff);
|