@copilotkit/react-core 1.51.4-next.1 → 1.51.4-next.3

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.
@@ -37,16 +37,16 @@ import {
37
37
  } from "../chunk-7DTB7S5V.mjs";
38
38
  import {
39
39
  useCopilotChatHeadless_c
40
- } from "../chunk-XZFIJ7XF.mjs";
40
+ } from "../chunk-MA3CUMCY.mjs";
41
41
  import {
42
42
  useCopilotChatSuggestions
43
43
  } from "../chunk-XDFVCQD3.mjs";
44
44
  import {
45
45
  useCopilotChat
46
- } from "../chunk-NXHQDCZF.mjs";
46
+ } from "../chunk-QDES5PDW.mjs";
47
47
  import {
48
48
  useCopilotChatInternal
49
- } from "../chunk-LO4RRITI.mjs";
49
+ } from "../chunk-KNJHRVKW.mjs";
50
50
  import {
51
51
  useLazyToolRenderer
52
52
  } from "../chunk-ZVF5Q6IH.mjs";
@@ -976,8 +976,10 @@ function useCopilotChatInternal({
976
976
  const reload = useAsyncCallback(
977
977
  (reloadMessageId) => __async(this, null, function* () {
978
978
  var _a2;
979
+ if (!agent)
980
+ return;
979
981
  const messages = (_a2 = agent == null ? void 0 : agent.messages) != null ? _a2 : [];
980
- const isLoading = false;
982
+ const isLoading = agent.isRunning;
981
983
  if (isLoading || messages.length === 0) {
982
984
  return;
983
985
  }
@@ -1015,7 +1017,7 @@ function useCopilotChatInternal({
1015
1017
  }
1016
1018
  return;
1017
1019
  }),
1018
- [agent == null ? void 0 : agent.setMessages, copilotkit == null ? void 0 : copilotkit.runAgent]
1020
+ [agent == null ? void 0 : agent.messages.length, agent == null ? void 0 : agent.isRunning, agent == null ? void 0 : agent.setMessages, copilotkit == null ? void 0 : copilotkit.runAgent]
1019
1021
  );
1020
1022
  const latestSendMessageFunc = useAsyncCallback(
1021
1023
  (message, options) => __async(this, null, function* () {