@copilotkit/react-core 1.57.0 → 1.57.1

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 (82) hide show
  1. package/dist/{copilotkit-DFaI4j2r.d.mts → copilotkit-BN4I_y1n.d.mts} +64 -8
  2. package/dist/copilotkit-BN4I_y1n.d.mts.map +1 -0
  3. package/dist/{copilotkit-DGbvw8n2.cjs → copilotkit-C3k13WZn.cjs} +572 -435
  4. package/dist/copilotkit-C3k13WZn.cjs.map +1 -0
  5. package/dist/{copilotkit-CPe2-340.mjs → copilotkit-DjxXMYHG.mjs} +571 -440
  6. package/dist/copilotkit-DjxXMYHG.mjs.map +1 -0
  7. package/dist/{copilotkit-Dg4r4Gi_.d.cts → copilotkit-sQWiKtxA.d.cts} +64 -8
  8. package/dist/copilotkit-sQWiKtxA.d.cts.map +1 -0
  9. package/dist/index.cjs +2 -5
  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 +2 -5
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/index.umd.js +449 -502
  16. package/dist/index.umd.js.map +1 -1
  17. package/dist/v2/context.cjs +135 -0
  18. package/dist/v2/context.cjs.map +1 -0
  19. package/dist/v2/context.d.cts +148 -0
  20. package/dist/v2/context.d.cts.map +1 -0
  21. package/dist/v2/context.d.mts +148 -0
  22. package/dist/v2/context.d.mts.map +1 -0
  23. package/dist/v2/context.mjs +129 -0
  24. package/dist/v2/context.mjs.map +1 -0
  25. package/dist/v2/headless.cjs +1043 -0
  26. package/dist/v2/headless.cjs.map +1 -0
  27. package/dist/v2/headless.d.cts +605 -0
  28. package/dist/v2/headless.d.cts.map +1 -0
  29. package/dist/v2/headless.d.mts +512 -0
  30. package/dist/v2/headless.d.mts.map +1 -0
  31. package/dist/v2/headless.mjs +997 -0
  32. package/dist/v2/headless.mjs.map +1 -0
  33. package/dist/v2/index.cjs +2 -1
  34. package/dist/v2/index.css +1 -1
  35. package/dist/v2/index.d.cts +2 -2
  36. package/dist/v2/index.d.mts +2 -2
  37. package/dist/v2/index.mjs +2 -2
  38. package/dist/v2/index.umd.js +584 -441
  39. package/dist/v2/index.umd.js.map +1 -1
  40. package/package.json +14 -6
  41. package/src/hooks/__tests__/use-copilot-chat-internal-connect.test.tsx +5 -6
  42. package/src/hooks/use-copilot-chat_internal.ts +0 -1
  43. package/src/v2/components/chat/CopilotChat.tsx +2 -1
  44. package/src/v2/components/chat/CopilotChatMessageView.tsx +24 -9
  45. package/src/v2/components/chat/CopilotChatView.tsx +2 -2
  46. package/src/v2/components/chat/__tests__/CopilotChat.welcomeGate.test.tsx +1 -3
  47. package/src/v2/components/chat/__tests__/CopilotChatActivityRendering.e2e.test.tsx +29 -25
  48. package/src/v2/components/chat/__tests__/MCPAppsUiMessage.e2e.test.tsx +5 -60
  49. package/src/v2/components/index.ts +1 -0
  50. package/src/v2/components/intelligence-indicator/IntelligenceIndicator.tsx +286 -0
  51. package/src/v2/components/intelligence-indicator/__tests__/IntelligenceIndicator.e2e.test.tsx +464 -0
  52. package/src/v2/components/intelligence-indicator/index.ts +2 -0
  53. package/src/v2/context.ts +62 -0
  54. package/src/v2/headless.ts +42 -0
  55. package/src/v2/hooks/__tests__/standard-schema.test.tsx +2 -2
  56. package/src/v2/hooks/__tests__/use-agent-context.test.tsx +3 -3
  57. package/src/v2/hooks/__tests__/use-agent-stability.test.tsx +3 -3
  58. package/src/v2/hooks/__tests__/use-agent-throttle.test.tsx +85 -85
  59. package/src/v2/hooks/__tests__/use-interrupt.test.tsx +2 -2
  60. package/src/v2/hooks/__tests__/use-render-tool.test.tsx +2 -2
  61. package/src/v2/hooks/__tests__/use-threads.test.tsx +2 -2
  62. package/src/v2/hooks/__tests__/zod-regression.test.tsx +2 -2
  63. package/src/v2/hooks/use-agent-context.tsx +1 -1
  64. package/src/v2/hooks/use-agent.tsx +9 -118
  65. package/src/v2/hooks/use-configure-suggestions.tsx +1 -1
  66. package/src/v2/hooks/use-frontend-tool.tsx +2 -2
  67. package/src/v2/hooks/use-human-in-the-loop.tsx +1 -1
  68. package/src/v2/hooks/use-interrupt.tsx +1 -1
  69. package/src/v2/hooks/use-render-activity-message.tsx +3 -11
  70. package/src/v2/hooks/use-render-custom-messages.tsx +1 -6
  71. package/src/v2/hooks/use-render-tool-call.tsx +1 -1
  72. package/src/v2/hooks/use-render-tool.tsx +2 -2
  73. package/src/v2/hooks/use-suggestions.tsx +1 -1
  74. package/src/v2/hooks/use-threads.tsx +1 -1
  75. package/src/v2/providers/CopilotKitProvider.tsx +19 -59
  76. package/src/v2/styles/globals.css +118 -0
  77. package/tsdown.config.ts +75 -0
  78. package/dist/copilotkit-CPe2-340.mjs.map +0 -1
  79. package/dist/copilotkit-DFaI4j2r.d.mts.map +0 -1
  80. package/dist/copilotkit-DGbvw8n2.cjs.map +0 -1
  81. package/dist/copilotkit-Dg4r4Gi_.d.cts.map +0 -1
  82. package/src/v2/hooks/__tests__/use-agent-thread-isolation.test.tsx +0 -333
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { An as CatchAllFrontendAction, Cn as Tree, Dn as ActionRenderPropsNoArgsWait, En as ActionRenderPropsNoArgs, Mn as FrontendActionAvailability, N as useAgent, Nn as RenderFunctionStatus, On as ActionRenderPropsWait, Q as useRenderToolCall$1, Sn as DocumentPointer, Tn as ActionRenderProps, _n as CrewsStateItem, an as useCopilotContext, bn as CopilotChatSuggestionConfiguration, cn as LangGraphInterruptActionSetter, dn as LangGraphInterruptRenderHandlerProps, fn as LangGraphInterruptRenderProps, gn as CrewsResponseStatus, hn as CrewsResponse, in as CopilotContextParams, jn as FrontendAction, kn as CatchAllActionRenderProps, ln as LangGraphInterruptActionSetterArgs, mn as CrewsAgentState, n as defaultCopilotContextCategories, nn as CopilotApiConfig, on as CoAgentStateRender, pn as QueuedInterruptEvent, r as CopilotKitProps, rn as CopilotContext, sn as LangGraphInterruptAction, t as CopilotKit, tn as CoagentInChatRenderFunction, un as LangGraphInterruptRender, vn as CrewsTaskStateItem, wn as TreeNode, xn as SystemMessageFunction, yn as CrewsToolStateItem } from "./copilotkit-Dg4r4Gi_.cjs";
1
+ import { An as ActionRenderPropsWait, Cn as SystemMessageFunction, Dn as ActionRenderProps, En as TreeNode, Fn as RenderFunctionStatus, Mn as CatchAllFrontendAction, N as useAgent, Nn as FrontendAction, On as ActionRenderPropsNoArgs, Pn as FrontendActionAvailability, Q as useRenderToolCall$1, Sn as CopilotChatSuggestionConfiguration, Tn as Tree, _n as CrewsResponse, an as CopilotContext, bn as CrewsTaskStateItem, cn as CoAgentStateRender, dn as LangGraphInterruptActionSetterArgs, fn as LangGraphInterruptRender, gn as CrewsAgentState, hn as QueuedInterruptEvent, in as CopilotApiConfig, jn as CatchAllActionRenderProps, kn as ActionRenderPropsNoArgsWait, ln as LangGraphInterruptAction, mn as LangGraphInterruptRenderProps, n as defaultCopilotContextCategories, on as CopilotContextParams, pn as LangGraphInterruptRenderHandlerProps, r as CopilotKitProps, rn as CoagentInChatRenderFunction, sn as useCopilotContext, t as CopilotKit, un as LangGraphInterruptActionSetter, vn as CrewsResponseStatus, wn as DocumentPointer, xn as CrewsToolStateItem, yn as CrewsStateItem } from "./copilotkit-sQWiKtxA.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 { An as CatchAllFrontendAction, Cn as Tree, Dn as ActionRenderPropsNoArgsWait, En as ActionRenderPropsNoArgs, Mn as FrontendActionAvailability, N as useAgent, Nn as RenderFunctionStatus, On as ActionRenderPropsWait, Q as useRenderToolCall$1, Sn as DocumentPointer, Tn as ActionRenderProps, _n as CrewsStateItem, an as useCopilotContext, bn as CopilotChatSuggestionConfiguration, cn as LangGraphInterruptActionSetter, dn as LangGraphInterruptRenderHandlerProps, fn as LangGraphInterruptRenderProps, gn as CrewsResponseStatus, hn as CrewsResponse, in as CopilotContextParams, jn as FrontendAction, kn as CatchAllActionRenderProps, ln as LangGraphInterruptActionSetterArgs, mn as CrewsAgentState, n as defaultCopilotContextCategories, nn as CopilotApiConfig, on as CoAgentStateRender, pn as QueuedInterruptEvent, r as CopilotKitProps, rn as CopilotContext, sn as LangGraphInterruptAction, t as CopilotKit, tn as CoagentInChatRenderFunction, un as LangGraphInterruptRender, vn as CrewsTaskStateItem, wn as TreeNode, xn as SystemMessageFunction, yn as CrewsToolStateItem } from "./copilotkit-DFaI4j2r.mjs";
1
+ import { An as ActionRenderPropsWait, Cn as SystemMessageFunction, Dn as ActionRenderProps, En as TreeNode, Fn as RenderFunctionStatus, Mn as CatchAllFrontendAction, N as useAgent, Nn as FrontendAction, On as ActionRenderPropsNoArgs, Pn as FrontendActionAvailability, Q as useRenderToolCall$1, Sn as CopilotChatSuggestionConfiguration, Tn as Tree, _n as CrewsResponse, an as CopilotContext, bn as CrewsTaskStateItem, cn as CoAgentStateRender, dn as LangGraphInterruptActionSetterArgs, fn as LangGraphInterruptRender, gn as CrewsAgentState, hn as QueuedInterruptEvent, in as CopilotApiConfig, jn as CatchAllActionRenderProps, kn as ActionRenderPropsNoArgsWait, ln as LangGraphInterruptAction, mn as LangGraphInterruptRenderProps, n as defaultCopilotContextCategories, on as CopilotContextParams, pn as LangGraphInterruptRenderHandlerProps, r as CopilotKitProps, rn as CoagentInChatRenderFunction, sn as useCopilotContext, t as CopilotKit, un as LangGraphInterruptActionSetter, vn as CrewsResponseStatus, wn as DocumentPointer, xn as CrewsToolStateItem, yn as CrewsStateItem } from "./copilotkit-BN4I_y1n.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 { B as useConfigureSuggestions, Q as useRenderToolCall$1, U as useHumanInTheLoop$1, V as useSuggestions, Y as useRenderCustomMessages, Z as useAgent, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, et as useCopilotKit, f as useToast, g as useCopilotContext, h as CopilotContext, ht as useCopilotChatConfiguration, i as ThreadsContext, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, o as useThreads, p as CopilotMessagesContext, q as useFrontendTool$1, r as CoAgentStateRenderBridge, rt as defineToolCallRenderer, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, z as useInterrupt } from "./copilotkit-CPe2-340.mjs";
3
+ import { B as useInterrupt, G as useAgent, H as useSuggestions, K as useHumanInTheLoop$1, Q as useRenderCustomMessages, V as useConfigureSuggestions, X as useFrontendTool$1, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, f as useToast, g as useCopilotContext, gt as useCopilotChatConfiguration, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, lt as useRenderToolCall$1, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, o as useThreads, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, tt as defineToolCallRenderer, u as useAsyncCallback, ut as useCopilotKit } from "./copilotkit-DjxXMYHG.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";
@@ -40,10 +40,7 @@ function useCopilotChatInternal({ suggestions, onInProgress, onSubmitMessage, on
40
40
  const existingConfig = useCopilotChatConfiguration();
41
41
  const [agentAvailable, setAgentAvailable] = useState(false);
42
42
  const resolvedAgentId = existingConfig?.agentId ?? "default";
43
- const { agent } = useAgent({
44
- agentId: resolvedAgentId,
45
- threadId: existingConfig?.threadId
46
- });
43
+ const { agent } = useAgent({ agentId: resolvedAgentId });
47
44
  const lastConnectedAgentRef = useRef(null);
48
45
  useEffect(() => {
49
46
  let detached = false;