@copilotkit/react-core 1.55.3-canary.1776260990 → 1.56.0

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-9l47K1Ot.cjs');
4
+ const require_copilotkit = require('../copilotkit-Cvb6WpAX.cjs');
5
5
  require("./index.css");
6
6
  let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
7
7
 
@@ -1,4 +1,4 @@
1
- import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-9_JxoZgF.cjs";
1
+ import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-Dv8zU8_U.cjs";
2
2
  import "./index.css";
3
3
  import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
4
4
  export * from "@copilotkit/core";
@@ -1,4 +1,4 @@
1
- import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-Dcf7Lkjb.mjs";
1
+ import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-f2Uq0RwG.mjs";
2
2
  import "./index.css";
3
3
  import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
4
4
  export * from "@copilotkit/core";
package/dist/v2/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { $ as CopilotKitProvider, A as CopilotChatSuggestionView, B as useConfigureSuggestions, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAssistantMessage_default, G as useRenderTool, H as useCapabilities, I as CopilotChatToolCallsView, J as useRenderActivityMessage, K as useComponent, L as useAttachments, M as CopilotChatReasoningMessage_default, N as CopilotChatUserMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatAttachmentRenderer, Q as useRenderToolCall, R as useThreads, S as CopilotModalHeader, T as DefaultOpenIcon, U as useHumanInTheLoop, V as useSuggestions, W as useDefaultRenderTool, X as UseAgentUpdate, Y as useRenderCustomMessages, Z as useAgent, _ as WildcardToolCallRender, at as SandboxFunctionsContext, b as CopilotPopupView, ct as MCPAppsActivityRenderer, dt as CopilotChatInput_default, et as useCopilotKit, ft as AudioRecorderError, ht as useCopilotChatConfiguration, it as createA2UIMessageRenderer, j as CopilotChatSuggestionPill, k as CopilotChatMessageView, lt as MCPAppsActivityType, mt as CopilotChatConfigurationProvider, nt as useAgentContext, ot as useSandboxFunctions, pt as CopilotChatAudioRecorder, q as useFrontendTool, rt as defineToolCallRenderer, st as MCPAppsActivityContentSchema, t as CopilotKit, tt as CopilotKitCoreReact, ut as CopilotKitInspector, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useInterrupt } from "../copilotkit-a2pL_KeT.mjs";
3
+ import { $ as CopilotKitProvider, A as CopilotChatSuggestionView, B as useConfigureSuggestions, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAssistantMessage_default, G as useRenderTool, H as useCapabilities, I as CopilotChatToolCallsView, J as useRenderActivityMessage, K as useComponent, L as useAttachments, M as CopilotChatReasoningMessage_default, N as CopilotChatUserMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatAttachmentRenderer, Q as useRenderToolCall, R as useThreads, S as CopilotModalHeader, T as DefaultOpenIcon, U as useHumanInTheLoop, V as useSuggestions, W as useDefaultRenderTool, X as UseAgentUpdate, Y as useRenderCustomMessages, Z as useAgent, _ as WildcardToolCallRender, at as SandboxFunctionsContext, b as CopilotPopupView, ct as MCPAppsActivityRenderer, dt as CopilotChatInput_default, et as useCopilotKit, ft as AudioRecorderError, ht as useCopilotChatConfiguration, it as createA2UIMessageRenderer, j as CopilotChatSuggestionPill, k as CopilotChatMessageView, lt as MCPAppsActivityType, mt as CopilotChatConfigurationProvider, nt as useAgentContext, ot as useSandboxFunctions, pt as CopilotChatAudioRecorder, q as useFrontendTool, rt as defineToolCallRenderer, st as MCPAppsActivityContentSchema, t as CopilotKit, tt as CopilotKitCoreReact, ut as CopilotKitInspector, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useInterrupt } from "../copilotkit-BebqQrYT.mjs";
4
4
  import "./index.css";
5
5
  import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
6
6
 
@@ -3108,7 +3108,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3108
3108
  }, [value, warningMessage]);
3109
3109
  return value;
3110
3110
  }
3111
- 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 }) => {
3111
+ 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 }) => {
3112
3112
  var _openGenerativeUI$des;
3113
3113
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
3114
3114
  const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
@@ -3272,7 +3272,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3272
3272
  tools: allTools,
3273
3273
  renderToolCalls: allRenderToolCalls,
3274
3274
  renderActivityMessages: allActivityRenderers,
3275
- renderCustomMessages: renderCustomMessagesList
3275
+ renderCustomMessages: renderCustomMessagesList,
3276
+ debug
3276
3277
  });
3277
3278
  if (defaultThrottleMs !== void 0) copilotkitRef.current.setDefaultThrottleMs(defaultThrottleMs);
3278
3279
  }
@@ -3346,6 +3347,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3346
3347
  copilotkit.setCredentials(credentials);
3347
3348
  copilotkit.setProperties(properties);
3348
3349
  copilotkit.setAgents__unsafe_dev_only(mergedAgents);
3350
+ copilotkit.setDebug(debug);
3349
3351
  }, [
3350
3352
  copilotkit,
3351
3353
  chatApiEndpoint,
@@ -3353,7 +3355,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3353
3355
  credentials,
3354
3356
  properties,
3355
3357
  mergedAgents,
3356
- useSingleEndpoint
3358
+ useSingleEndpoint,
3359
+ debug
3357
3360
  ]);
3358
3361
  const didMountRef = (0, react.useRef)(false);
3359
3362
  (0, react.useEffect)(() => {
@@ -4535,10 +4538,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4535
4538
  * ```
4536
4539
  */
4537
4540
  function useInterrupt(config) {
4538
- var _config$agent;
4539
4541
  const { copilotkit } = useCopilotKit();
4540
- const { agent: internalAgent } = useAgent({ agentId: config.agentId });
4541
- const agent = (_config$agent = config.agent) !== null && _config$agent !== void 0 ? _config$agent : internalAgent;
4542
+ const { agent } = useAgent({ agentId: config.agentId });
4542
4543
  const [pendingEvent, setPendingEvent] = (0, react.useState)(null);
4543
4544
  const pendingEventRef = (0, react.useRef)(pendingEvent);
4544
4545
  pendingEventRef.current = pendingEvent;