@copilotkit/react-core 1.56.4-canary.1777531098 → 1.56.4-canary.1777629975

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/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_copilotkit = require('./copilotkit-DMFu29Kx.cjs');
4
+ const require_copilotkit = require('./copilotkit-tb4zqaMK.cjs');
5
5
  let react = require("react");
6
6
  react = require_copilotkit.__toESM(react);
7
7
  let _copilotkit_core = require("@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-OmIUrWym.mjs";
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-Bd0m5HFp.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";
package/dist/index.umd.js CHANGED
@@ -2838,20 +2838,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2838
2838
  return consumer;
2839
2839
  }, [normalizedConfig, resolvedConsumerAgentId]);
2840
2840
  const isGlobalConfig = rawConsumerAgentId === void 0 || rawConsumerAgentId === "*";
2841
- const isDynamicConfigType = (0, react.useMemo)(() => !!normalizedConfig && "instructions" in normalizedConfig, [normalizedConfig]);
2842
2841
  const requestReload = (0, react.useCallback)(() => {
2843
2842
  if (!normalizedConfig) return;
2844
2843
  if (isGlobalConfig) {
2845
2844
  var _copilotkit$agents;
2846
- const seen = /* @__PURE__ */ new Set();
2847
2845
  const agents = Object.values((_copilotkit$agents = copilotkit.agents) !== null && _copilotkit$agents !== void 0 ? _copilotkit$agents : {});
2848
2846
  for (const entry of agents) {
2849
2847
  const agentId = entry.agentId;
2850
2848
  if (!agentId) continue;
2851
- seen.add(agentId);
2852
2849
  if (!entry.isRunning) copilotkit.reloadSuggestions(agentId);
2853
2850
  }
2854
- if (targetAgentId && !seen.has(targetAgentId)) copilotkit.reloadSuggestions(targetAgentId);
2855
2851
  return;
2856
2852
  }
2857
2853
  if (!targetAgentId) return;
@@ -2896,26 +2892,6 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2896
2892
  requestReload,
2897
2893
  ...extraDeps
2898
2894
  ]);
2899
- (0, react.useEffect)(() => {
2900
- if (!normalizedConfig || !isDynamicConfigType) return;
2901
- if (!targetAgentId) return;
2902
- if (!!copilotkit.getAgent(targetAgentId)) return;
2903
- const subscription = copilotkit.subscribe({ onAgentsChanged: () => {
2904
- if (copilotkit.getAgent(targetAgentId)) {
2905
- requestReload();
2906
- subscription.unsubscribe();
2907
- }
2908
- } });
2909
- return () => {
2910
- subscription.unsubscribe();
2911
- };
2912
- }, [
2913
- copilotkit,
2914
- normalizedConfig,
2915
- isDynamicConfigType,
2916
- targetAgentId,
2917
- requestReload
2918
- ]);
2919
2895
  }
2920
2896
  function isDynamicConfig(config) {
2921
2897
  return "instructions" in config;