@copilotkit/react-core 1.63.3-canary.rc-1 → 1.64.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/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-rYTwMndy.cjs');
4
+ const require_copilotkit = require('./copilotkit-DiLTL1ZM.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 { Tt as useCopilotKit, 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, jt as useCopilotChatConfiguration, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, nt as useHumanInTheLoop$1, o as useThreads, ot as useFrontendTool$1, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, tt as useAgent, u as useAsyncCallback, ut as defineToolCallRenderer, wt as useRenderToolCall$1 } from "./copilotkit-DL0LvmwQ.mjs";
3
+ import { Tt as useCopilotKit, 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, jt as useCopilotChatConfiguration, l as useCoAgentStateRenders, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, nt as useHumanInTheLoop$1, o as useThreads, ot as useFrontendTool$1, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, tt as useAgent, u as useAsyncCallback, ut as defineToolCallRenderer, wt as useRenderToolCall$1 } from "./copilotkit-D_Ao1X-u.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
@@ -2863,17 +2863,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2863
2863
  const status = copilotkit.runtimeConnectionStatus;
2864
2864
  if (isRuntimeConfigured && (status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Disconnected || status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connecting)) {
2865
2865
  const cached = provisionalAgentCache.current.get(resolvedAgentId);
2866
- if (cached) {
2867
- copilotkit.applyHeadersToAgent(cached);
2868
- return {
2869
- agent: cached,
2870
- isReady: false
2871
- };
2872
- }
2866
+ if (cached) return {
2867
+ agent: cached,
2868
+ isReady: false
2869
+ };
2873
2870
  const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
2874
2871
  runtimeUrl: copilotkit.runtimeUrl,
2875
2872
  agentId: resolvedAgentId,
2876
2873
  transport: copilotkit.runtimeTransport,
2874
+ credentials: copilotkit.credentials,
2877
2875
  runtimeMode: "pending"
2878
2876
  });
2879
2877
  copilotkit.applyHeadersToAgent(provisional);
@@ -2885,17 +2883,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2885
2883
  }
2886
2884
  if (isRuntimeConfigured && status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Error) {
2887
2885
  const cached = provisionalAgentCache.current.get(resolvedAgentId);
2888
- if (cached) {
2889
- copilotkit.applyHeadersToAgent(cached);
2890
- return {
2891
- agent: cached,
2892
- isReady: false
2893
- };
2894
- }
2886
+ if (cached) return {
2887
+ agent: cached,
2888
+ isReady: false
2889
+ };
2895
2890
  const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
2896
2891
  runtimeUrl: copilotkit.runtimeUrl,
2897
2892
  agentId: resolvedAgentId,
2898
2893
  transport: copilotkit.runtimeTransport,
2894
+ credentials: copilotkit.credentials,
2899
2895
  runtimeMode: "pending"
2900
2896
  });
2901
2897
  copilotkit.applyHeadersToAgent(provisional);
@@ -2914,6 +2910,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2914
2910
  copilotkit.runtimeConnectionStatus,
2915
2911
  copilotkit.runtimeUrl,
2916
2912
  copilotkit.runtimeTransport,
2913
+ copilotkit.credentials,
2917
2914
  JSON.stringify(copilotkit.headers)
2918
2915
  ]);
2919
2916
  (0, react.useEffect)(() => {
@@ -2953,7 +2950,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
2953
2950
  ]);
2954
2951
  (0, react.useEffect)(() => {
2955
2952
  if (agent instanceof _ag_ui_client.HttpAgent) copilotkit.applyHeadersToAgent(agent);
2956
- }, [agent, JSON.stringify(copilotkit.headers)]);
2953
+ if (agent instanceof _copilotkit_core.ProxiedCopilotRuntimeAgent) agent.credentials = copilotkit.credentials;
2954
+ }, [
2955
+ agent,
2956
+ JSON.stringify(copilotkit.headers),
2957
+ copilotkit.credentials
2958
+ ]);
2957
2959
  const configThreadId = chatConfig?.threadId;
2958
2960
  const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
2959
2961
  (0, react.useEffect)(() => {