@copilotkit/react-core 1.68.1 → 1.68.3-canary.1786716392

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.
Files changed (37) hide show
  1. package/dist/{copilotkit-BICg0AyJ.d.cts → copilotkit-B1K0Tgnz.d.cts} +47 -3
  2. package/dist/copilotkit-B1K0Tgnz.d.cts.map +1 -0
  3. package/dist/{copilotkit-BrfN8YeF.d.mts → copilotkit-CZjzQPdq.d.mts} +47 -3
  4. package/dist/copilotkit-CZjzQPdq.d.mts.map +1 -0
  5. package/dist/{copilotkit-Ck0RL8hh.mjs → copilotkit-DT2FmOwK.mjs} +263 -19
  6. package/dist/copilotkit-DT2FmOwK.mjs.map +1 -0
  7. package/dist/{copilotkit-8KSSmCH_.cjs → copilotkit-EFunREg5.cjs} +268 -18
  8. package/dist/copilotkit-EFunREg5.cjs.map +1 -0
  9. package/dist/index.cjs +14 -7
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +1 -1
  12. package/dist/index.d.mts +1 -1
  13. package/dist/index.mjs +14 -7
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/index.umd.js +62 -16
  16. package/dist/index.umd.js.map +1 -1
  17. package/dist/v2/headless.cjs +2 -0
  18. package/dist/v2/headless.cjs.map +1 -1
  19. package/dist/v2/headless.d.cts +2 -0
  20. package/dist/v2/headless.d.cts.map +1 -1
  21. package/dist/v2/headless.d.mts +2 -0
  22. package/dist/v2/headless.d.mts.map +1 -1
  23. package/dist/v2/headless.mjs +2 -0
  24. package/dist/v2/headless.mjs.map +1 -1
  25. package/dist/v2/index.cjs +2 -1
  26. package/dist/v2/index.css +1 -1
  27. package/dist/v2/index.d.cts +2 -2
  28. package/dist/v2/index.d.mts +2 -2
  29. package/dist/v2/index.mjs +2 -2
  30. package/dist/v2/index.umd.js +262 -17
  31. package/dist/v2/index.umd.js.map +1 -1
  32. package/package.json +8 -8
  33. package/skills/react-core/SKILL.md +1 -1
  34. package/dist/copilotkit-8KSSmCH_.cjs.map +0 -1
  35. package/dist/copilotkit-BICg0AyJ.d.cts.map +0 -1
  36. package/dist/copilotkit-BrfN8YeF.d.mts.map +0 -1
  37. package/dist/copilotkit-Ck0RL8hh.mjs.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { $n as LangGraphInterruptActionSetterArgs, Cr as RenderFunctionStatus, Gn as CoagentInChatRenderFunction, Jn as CopilotContextParams, Kn as CopilotApiConfig, Qn as LangGraphInterruptActionSetter, Sr as FrontendActionAvailability, X as useAgent, Xn as CoAgentStateRender, Yn as useCopilotContext, Zn as LangGraphInterruptAction, _r as ActionRenderPropsNoArgsWait, ar as CrewsResponse, br as CatchAllFrontendAction, cr as CrewsTaskStateItem, dr as SystemMessageFunction, er as LangGraphInterruptRender, fr as DocumentPointer, gr as ActionRenderPropsNoArgs, hr as ActionRenderProps, ir as CrewsAgentState, lr as CrewsToolStateItem, mr as TreeNode, n as defaultCopilotContextCategories, nr as LangGraphInterruptRenderProps, or as CrewsResponseStatus, pr as Tree, qn as CopilotContext, r as CopilotKitProps, rr as QueuedInterruptEvent, sr as CrewsStateItem, t as CopilotKit, tr as LangGraphInterruptRenderHandlerProps, ur as CopilotChatSuggestionConfiguration, vr as ActionRenderPropsWait, xr as FrontendAction, yr as CatchAllActionRenderProps, yt as useRenderToolCall$1 } from "./copilotkit-BICg0AyJ.cjs";
1
+ import { $ as useAgent, $n as CoAgentStateRender, Cr as CatchAllFrontendAction, Er as RenderFunctionStatus, Jn as CoagentInChatRenderFunction, Qn as useCopilotContext, Sr as CatchAllActionRenderProps, St as useRenderToolCall$1, Tr as FrontendActionAvailability, Xn as CopilotContext, Yn as CopilotApiConfig, Zn as CopilotContextParams, _r as TreeNode, ar as LangGraphInterruptRenderProps, br as ActionRenderPropsNoArgsWait, cr as CrewsResponse, dr as CrewsTaskStateItem, er as LangGraphInterruptAction, fr as CrewsToolStateItem, gr as Tree, hr as DocumentPointer, ir as LangGraphInterruptRenderHandlerProps, lr as CrewsResponseStatus, mr as SystemMessageFunction, n as defaultCopilotContextCategories, nr as LangGraphInterruptActionSetterArgs, or as QueuedInterruptEvent, pr as CopilotChatSuggestionConfiguration, r as CopilotKitProps, rr as LangGraphInterruptRender, sr as CrewsAgentState, t as CopilotKit, tr as LangGraphInterruptActionSetter, ur as CrewsStateItem, vr as ActionRenderProps, wr as FrontendAction, xr as ActionRenderPropsWait, yr as ActionRenderPropsNoArgs } from "./copilotkit-B1K0Tgnz.cjs";
2
2
  import "./v2/index.cjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { CopilotRuntimeClient, CopilotRuntimeClientOptions, ForwardedParametersInput, Message } from "@copilotkit/runtime-client-gql";
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $n as LangGraphInterruptActionSetterArgs, Cr as RenderFunctionStatus, Gn as CoagentInChatRenderFunction, Jn as CopilotContextParams, Kn as CopilotApiConfig, Qn as LangGraphInterruptActionSetter, Sr as FrontendActionAvailability, X as useAgent, Xn as CoAgentStateRender, Yn as useCopilotContext, Zn as LangGraphInterruptAction, _r as ActionRenderPropsNoArgsWait, ar as CrewsResponse, br as CatchAllFrontendAction, cr as CrewsTaskStateItem, dr as SystemMessageFunction, er as LangGraphInterruptRender, fr as DocumentPointer, gr as ActionRenderPropsNoArgs, hr as ActionRenderProps, ir as CrewsAgentState, lr as CrewsToolStateItem, mr as TreeNode, n as defaultCopilotContextCategories, nr as LangGraphInterruptRenderProps, or as CrewsResponseStatus, pr as Tree, qn as CopilotContext, r as CopilotKitProps, rr as QueuedInterruptEvent, sr as CrewsStateItem, t as CopilotKit, tr as LangGraphInterruptRenderHandlerProps, ur as CopilotChatSuggestionConfiguration, vr as ActionRenderPropsWait, xr as FrontendAction, yr as CatchAllActionRenderProps, yt as useRenderToolCall$1 } from "./copilotkit-BrfN8YeF.mjs";
1
+ import { $ as useAgent, $n as CoAgentStateRender, Cr as CatchAllFrontendAction, Er as RenderFunctionStatus, Jn as CoagentInChatRenderFunction, Qn as useCopilotContext, Sr as CatchAllActionRenderProps, St as useRenderToolCall$1, Tr as FrontendActionAvailability, Xn as CopilotContext, Yn as CopilotApiConfig, Zn as CopilotContextParams, _r as TreeNode, ar as LangGraphInterruptRenderProps, br as ActionRenderPropsNoArgsWait, cr as CrewsResponse, dr as CrewsTaskStateItem, er as LangGraphInterruptAction, fr as CrewsToolStateItem, gr as Tree, hr as DocumentPointer, ir as LangGraphInterruptRenderHandlerProps, lr as CrewsResponseStatus, mr as SystemMessageFunction, n as defaultCopilotContextCategories, nr as LangGraphInterruptActionSetterArgs, or as QueuedInterruptEvent, pr as CopilotChatSuggestionConfiguration, r as CopilotKitProps, rr as LangGraphInterruptRender, sr as CrewsAgentState, t as CopilotKit, tr as LangGraphInterruptActionSetter, ur as CrewsStateItem, vr as ActionRenderProps, wr as FrontendAction, xr as ActionRenderPropsWait, yr as ActionRenderPropsNoArgs } from "./copilotkit-CZjzQPdq.mjs";
2
2
  import "./v2/index.mjs";
3
3
  import React, { ReactNode, RefObject, SetStateAction } from "react";
4
4
  import { StaticSuggestionsConfig, Suggestion } from "@copilotkit/core";
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { Dt as useRenderToolCall$1, Mt as useCopilotChatConfiguration, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, a as ThreadsProvider, c as CoAgentStateRendersProvider, ct as useRenderCustomMessages, d as shouldShowDevConsole, f as useToast, g as useCopilotContext, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, nt as useHumanInTheLoop$1, o as useThreads, ot as useFrontendTool$1, p as CopilotMessagesContext, pt as defineToolCallRenderer, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, tt as useAgent, u as useAsyncCallback, ut as useCopilotKit } from "./copilotkit-Ck0RL8hh.mjs";
3
+ import { Nt as useCopilotChatConfiguration, Ot as useRenderToolCall$1, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, dt as useCopilotKit, f as useToast, g as useCopilotContext, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, lt as useRenderCustomMessages, m as useCopilotMessagesContext, mt as defineToolCallRenderer, n as defaultCopilotContextCategories, nt as useAgent, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, rt as useHumanInTheLoop$1, s as CoAgentStateRendersContext, st as useFrontendTool$1, t as CopilotKit, u as useAsyncCallback } from "./copilotkit-DT2FmOwK.mjs";
4
4
  import React, { Fragment, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { CopilotKitCoreRuntimeConnectionStatus, ToolCallStatus } from "@copilotkit/core";
6
6
  import { AGUIConnectNotImplementedError, HttpAgent } from "@ag-ui/client";
@@ -1136,30 +1136,37 @@ function useCopilotReadable({ description, value, convert, available = "enabled"
1136
1136
 
1137
1137
  //#endregion
1138
1138
  //#region src/hooks/use-agent-nodename.ts
1139
+ /**
1140
+ * Tracks the node the agent is currently executing.
1141
+ *
1142
+ * Backed by state rather than a ref: mutating a ref schedules no render, so
1143
+ * consumers such as `useCoAgent().nodeName` kept reporting whichever node was
1144
+ * current at their last render and never updated on their own.
1145
+ */
1139
1146
  function useAgentNodeName(agentName) {
1140
1147
  const { agent } = useAgent({ agentId: agentName });
1141
- const nodeNameRef = useRef("start");
1148
+ const [nodeName, setNodeName] = useState("start");
1142
1149
  useEffect(() => {
1143
1150
  if (!agent) return;
1144
1151
  const subscription = agent.subscribe({
1145
1152
  onStepStartedEvent: ({ event }) => {
1146
- nodeNameRef.current = event.stepName;
1153
+ setNodeName(event.stepName);
1147
1154
  },
1148
1155
  onRunStartedEvent: () => {
1149
- nodeNameRef.current = "start";
1156
+ setNodeName("start");
1150
1157
  },
1151
1158
  onRunFinishedEvent: () => {
1152
- nodeNameRef.current = "end";
1159
+ setNodeName("end");
1153
1160
  },
1154
1161
  onRunErrorEvent: () => {
1155
- nodeNameRef.current = "end";
1162
+ setNodeName("end");
1156
1163
  }
1157
1164
  });
1158
1165
  return () => {
1159
1166
  subscription.unsubscribe();
1160
1167
  };
1161
1168
  }, [agent]);
1162
- return nodeNameRef.current;
1169
+ return nodeName;
1163
1170
  }
1164
1171
 
1165
1172
  //#endregion