@copilotkit/react-core 1.59.0 → 1.59.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.
package/dist/v2/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-B4ouY7qC.cjs');
4
+ const require_copilotkit = require('../copilotkit-DKPrBplZ.cjs');
5
5
  require("./index.css");
6
6
  let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
7
7
 
package/dist/v2/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { $ as createA2UIMessageRenderer, A as IntelligenceIndicator, B as useInterrupt, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAttachmentRenderer, G as useAgent, H as useSuggestions, I as CopilotChatAssistantMessage_default, J as useFrontendTool, K as useHumanInTheLoop, L as CopilotChatToolCallsView, M as CopilotChatSuggestionPill, N as CopilotChatReasoningMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatUserMessage_default, Q as useAgentContext, R as useAttachments, S as CopilotModalHeader, T as DefaultOpenIcon, U as useCapabilities, V as useConfigureSuggestions, W as UseAgentUpdate, X as useRenderCustomMessages, Y as useRenderActivityMessage, Z as CopilotKitProvider, _ as WildcardToolCallRender, at as CopilotKitInspector, b as CopilotPopupView, ct as useRenderTool, dt as CopilotKitCoreReact, et as SandboxFunctionsContext, ft as CopilotChatInput_default, gt as useCopilotChatConfiguration, ht as CopilotChatConfigurationProvider, it as MCPAppsActivityType, j as CopilotChatSuggestionView, k as CopilotChatMessageView, lt as defineToolCallRenderer, mt as CopilotChatAudioRecorder, nt as MCPAppsActivityContentSchema, ot as useRenderToolCall, pt as AudioRecorderError, q as useComponent, rt as MCPAppsActivityRenderer, st as useDefaultRenderTool, t as CopilotKit, tt as useSandboxFunctions, ut as useCopilotKit, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useThreads } from "../copilotkit-L4mM_JqG.mjs";
3
+ import { $ as createA2UIMessageRenderer, A as IntelligenceIndicator, B as useInterrupt, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAttachmentRenderer, G as useAgent, H as useSuggestions, I as CopilotChatAssistantMessage_default, J as useFrontendTool, K as useHumanInTheLoop, L as CopilotChatToolCallsView, M as CopilotChatSuggestionPill, N as CopilotChatReasoningMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatUserMessage_default, Q as useAgentContext, R as useAttachments, S as CopilotModalHeader, T as DefaultOpenIcon, U as useCapabilities, V as useConfigureSuggestions, W as UseAgentUpdate, X as useRenderCustomMessages, Y as useRenderActivityMessage, Z as CopilotKitProvider, _ as WildcardToolCallRender, at as CopilotKitInspector, b as CopilotPopupView, ct as useRenderTool, dt as CopilotKitCoreReact, et as SandboxFunctionsContext, ft as CopilotChatInput_default, gt as useCopilotChatConfiguration, ht as CopilotChatConfigurationProvider, it as MCPAppsActivityType, j as CopilotChatSuggestionView, k as CopilotChatMessageView, lt as defineToolCallRenderer, mt as CopilotChatAudioRecorder, nt as MCPAppsActivityContentSchema, ot as useRenderToolCall, pt as AudioRecorderError, q as useComponent, rt as MCPAppsActivityRenderer, st as useDefaultRenderTool, t as CopilotKit, tt as useSandboxFunctions, ut as useCopilotKit, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useThreads } from "../copilotkit-CDK5ny-e.mjs";
4
4
  import "./index.css";
5
5
  import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
6
6
 
@@ -3492,6 +3492,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3492
3492
  //#region src/v2/providers/CopilotKitProvider.tsx
3493
3493
  const HEADER_NAME = "X-CopilotCloud-Public-Api-Key";
3494
3494
  const COPILOT_CLOUD_CHAT_URL$1 = "https://api.cloud.copilotkit.ai/copilotkit/v1";
3495
+ const EMPTY_HEADERS = Object.freeze({});
3496
+ const EMPTY_PROPERTIES = Object.freeze({});
3497
+ const EMPTY_AGENTS = Object.freeze({});
3495
3498
  const DEFAULT_DESIGN_SKILL = `When generating UI with generateSandboxedUi, follow these design principles inspired by shadcn/ui:
3496
3499
 
3497
3500
  - Use a minimal, flat aesthetic. Avoid drop shadows and gradients — rely on subtle borders (1px solid, light gray like #e5e7eb) to define surfaces.
@@ -3512,7 +3515,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3512
3515
  }, [value, warningMessage]);
3513
3516
  return value;
3514
3517
  }
3515
- const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = {}, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = {}, agents__unsafe_dev_only: agents = {}, selfManagedAgents = {}, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, showDevConsole = false, useSingleEndpoint, onError, a2ui, defaultThrottleMs, inspectorDefaultAnchor, debug }) => {
3518
+ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, showDevConsole = false, useSingleEndpoint, onError, a2ui, defaultThrottleMs, inspectorDefaultAnchor, debug }) => {
3516
3519
  var _openGenerativeUI$des;
3517
3520
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
3518
3521
  const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
@@ -7184,14 +7187,14 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7184
7187
  const [lastConnectedThreadId, setLastConnectedThreadId] = (0, react.useState)(null);
7185
7188
  const isConnecting = hasExplicitThreadId && lastConnectedThreadId !== resolvedThreadId;
7186
7189
  (0, react.useEffect)(() => {
7190
+ agent.threadId = resolvedThreadId;
7187
7191
  if (!hasExplicitThreadId) return;
7188
7192
  let detached = false;
7189
7193
  const connectAbortController = new AbortController();
7190
7194
  if (agent instanceof _ag_ui_client.HttpAgent) agent.abortController = connectAbortController;
7191
- agent.threadId = resolvedThreadId;
7192
- const connect = async (agent) => {
7195
+ const connect = async (agentToConnect) => {
7193
7196
  try {
7194
- await copilotkit.connectAgent({ agent });
7197
+ await copilotkit.connectAgent({ agent: agentToConnect });
7195
7198
  } catch (error) {
7196
7199
  if (detached) return;
7197
7200
  console.error("CopilotChat: connectAgent failed", error);