@copilotkit/react-core 1.10.5-next.4 → 1.10.5-next.6
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 +16 -0
- package/dist/{chunk-XFJNMZ6X.mjs → chunk-AGBNJCIM.mjs} +2 -2
- package/dist/{chunk-OLXYK6PP.mjs → chunk-BKI4I4S2.mjs} +2 -2
- package/dist/{chunk-RLT4KZR4.mjs → chunk-FCRPPUZA.mjs} +2 -2
- package/dist/{chunk-WBBJMOZI.mjs → chunk-IF4OYMFZ.mjs} +6 -4
- package/dist/chunk-IF4OYMFZ.mjs.map +1 -0
- package/dist/{chunk-WRPXFDFL.mjs → chunk-TM5MFTHG.mjs} +2 -2
- package/dist/{chunk-O73FZGSU.mjs → chunk-Y5ZF7AZ3.mjs} +2 -2
- package/dist/hooks/index.js +5 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +6 -6
- package/dist/hooks/use-chat.js +5 -3
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +1 -1
- package/dist/hooks/use-coagent.js +5 -3
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +3 -3
- package/dist/hooks/use-copilot-chat-headless_c.js +5 -3
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +3 -3
- package/dist/hooks/use-copilot-chat.js +5 -3
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +3 -3
- package/dist/hooks/use-copilot-chat_internal.js +5 -3
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt.js +5 -3
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +3 -3
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +3 -3
- package/src/hooks/use-chat.ts +5 -3
- package/dist/chunk-WBBJMOZI.mjs.map +0 -1
- /package/dist/{chunk-XFJNMZ6X.mjs.map → chunk-AGBNJCIM.mjs.map} +0 -0
- /package/dist/{chunk-OLXYK6PP.mjs.map → chunk-BKI4I4S2.mjs.map} +0 -0
- /package/dist/{chunk-RLT4KZR4.mjs.map → chunk-FCRPPUZA.mjs.map} +0 -0
- /package/dist/{chunk-WRPXFDFL.mjs.map → chunk-TM5MFTHG.mjs.map} +0 -0
- /package/dist/{chunk-O73FZGSU.mjs.map → chunk-Y5ZF7AZ3.mjs.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChatHeadless_c
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-FCRPPUZA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultSystemMessage
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-BKI4I4S2.mjs";
|
|
7
7
|
import "../chunk-QF3Q5LUN.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-IF4OYMFZ.mjs";
|
|
9
9
|
import "../chunk-4CEQJ2X6.mjs";
|
|
10
10
|
import "../chunk-ZRDV3MVW.mjs";
|
|
11
11
|
import "../chunk-N4VN2B5S.mjs";
|
|
@@ -765,7 +765,7 @@ function useChat(options) {
|
|
|
765
765
|
preservedStructure: !!originalCode
|
|
766
766
|
});
|
|
767
767
|
setIsLoading(false);
|
|
768
|
-
|
|
768
|
+
throw new Error(structuredError.message);
|
|
769
769
|
} else if (messages2.length > 0) {
|
|
770
770
|
newMessages = [...messages2];
|
|
771
771
|
for (const message of messages2) {
|
|
@@ -1050,8 +1050,8 @@ function useChat(options) {
|
|
|
1050
1050
|
console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);
|
|
1051
1051
|
return;
|
|
1052
1052
|
}
|
|
1053
|
-
let historyCutoff = [];
|
|
1054
|
-
if (messages.length > 2) {
|
|
1053
|
+
let historyCutoff = [messages[0]];
|
|
1054
|
+
if (messages.length > 2 && reloadMessageIndex !== 0) {
|
|
1055
1055
|
const lastUserMessageBeforeRegenerate = messages.slice(0, reloadMessageIndex).reverse().find(
|
|
1056
1056
|
(msg) => (
|
|
1057
1057
|
// @ts-expect-error -- message has role
|
|
@@ -1062,6 +1062,8 @@ function useChat(options) {
|
|
|
1062
1062
|
(msg) => msg.id === lastUserMessageBeforeRegenerate.id
|
|
1063
1063
|
);
|
|
1064
1064
|
historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);
|
|
1065
|
+
} else if (messages.length > 2 && reloadMessageIndex === 0) {
|
|
1066
|
+
historyCutoff = [messages[0], messages[1]];
|
|
1065
1067
|
}
|
|
1066
1068
|
setMessages(historyCutoff);
|
|
1067
1069
|
return runChatCompletionAndHandleFunctionCall(historyCutoff);
|