@copilotkit/react-core 1.64.2-canary.1785346263 → 1.64.2-canary.parallel1

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-BrNiD3wI.cjs');
4
+ const require_copilotkit = require('../copilotkit-2v7ami2b.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 useCapabilities, A as CopilotChatMessageView, At as CopilotChatConfigurationProvider, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotKitInspector, D as CopilotChat, Dt as CopilotChatInput_default, E as DefaultOpenIcon, Et as CopilotKitCoreReact, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useThreads, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, Ot as AudioRecorderError, P as IntelligenceIndicatorView, Q as useAgentContext, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as ɵrunMcpFollowUp, T as DefaultCloseIcon, Tt as useCopilotKit, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as SandboxFunctionsContext, at as useComponent, b as CopilotSidebar, bt as MCPAppsActivityRenderer, ct as useRenderCustomMessages, dt as createA2UIMessageRenderer, et as UseAgentUpdate, ft as GenerateSandboxedUiArgsSchema, gt as OpenGenerativeUIToolRenderer, ht as OpenGenerativeUIContentSchema, it as useRenderTool, j as INTELLIGENCE_TURN_HEAD, jt as useCopilotChatConfiguration, k as CopilotChatAttachmentQueue, kt as CopilotChatAudioRecorder, lt as CopilotKitProvider, mt as OpenGenerativeUIActivityType, nt as useHumanInTheLoop, ot as useFrontendTool, pt as OpenGenerativeUIActivityRenderer, q as useMemories, rt as useDefaultRenderTool, st as useRenderActivityMessage, t as CopilotKit, tt as useAgent, ut as defineToolCallRenderer, v as CopilotThreadsDrawer, vt as useSandboxFunctions, w as CopilotChatToggleButton, wt as useRenderToolCall, x as CopilotPopupView, xt as MCPAppsActivityType, y as CopilotPopup, yt as MCPAppsActivityContentSchema, z as CopilotChatAttachmentRenderer } from "../copilotkit-BrZGzZw6.mjs";
3
+ import { $ as useCapabilities, A as CopilotChatMessageView, At as CopilotChatConfigurationProvider, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotKitInspector, D as CopilotChat, Dt as CopilotChatInput_default, E as DefaultOpenIcon, Et as CopilotKitCoreReact, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useThreads, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, Ot as AudioRecorderError, P as IntelligenceIndicatorView, Q as useAgentContext, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as ɵrunMcpFollowUp, T as DefaultCloseIcon, Tt as useCopilotKit, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as SandboxFunctionsContext, at as useComponent, b as CopilotSidebar, bt as MCPAppsActivityRenderer, ct as useRenderCustomMessages, dt as createA2UIMessageRenderer, et as UseAgentUpdate, ft as GenerateSandboxedUiArgsSchema, gt as OpenGenerativeUIToolRenderer, ht as OpenGenerativeUIContentSchema, it as useRenderTool, j as INTELLIGENCE_TURN_HEAD, jt as useCopilotChatConfiguration, k as CopilotChatAttachmentQueue, kt as CopilotChatAudioRecorder, lt as CopilotKitProvider, mt as OpenGenerativeUIActivityType, nt as useHumanInTheLoop, ot as useFrontendTool, pt as OpenGenerativeUIActivityRenderer, q as useMemories, rt as useDefaultRenderTool, st as useRenderActivityMessage, t as CopilotKit, tt as useAgent, ut as defineToolCallRenderer, v as CopilotThreadsDrawer, vt as useSandboxFunctions, w as CopilotChatToggleButton, wt as useRenderToolCall, x as CopilotPopupView, xt as MCPAppsActivityType, y as CopilotPopup, yt as MCPAppsActivityContentSchema, z as CopilotChatAttachmentRenderer } from "../copilotkit-DnlgZWST.mjs";
4
4
  import "./index.css";
5
5
  import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
6
6
 
@@ -3509,6 +3509,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3509
3509
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
3510
3510
  const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
3511
3511
  const [runtimeOpenGenUIEnabled, setRuntimeOpenGenUIEnabled] = (0, react.useState)(false);
3512
+ const [catalogToggleVersion, setCatalogToggleVersion] = (0, react.useState)(0);
3512
3513
  const openGenUIActive = runtimeOpenGenUIEnabled || !!openGenerativeUI;
3513
3514
  const a2uiCatalogProvided = !!a2ui?.catalog;
3514
3515
  const a2uiActive = runtimeA2UIEnabled || a2uiCatalogProvided;
@@ -3531,6 +3532,14 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3531
3532
  });
3532
3533
  const renderCustomMessagesList = useStableArrayProp(renderCustomMessages, "renderCustomMessages must be a stable array.");
3533
3534
  const renderActivityMessagesList = useStableArrayProp(renderActivityMessages, "renderActivityMessages must be a stable array.");
3535
+ const copilotkitRef = (0, react.useRef)(null);
3536
+ const rawCatalog = a2ui?.catalog;
3537
+ const filteredCatalog = (0, react.useMemo)(() => {
3538
+ if (!rawCatalog) return rawCatalog;
3539
+ if (!(rawCatalog instanceof _copilotkit_a2ui_renderer.Catalog)) return rawCatalog;
3540
+ const core = copilotkitRef.current;
3541
+ return (0, _copilotkit_a2ui_renderer.filterCatalog)(rawCatalog, (name) => core ? core.isCatalogComponentEnabled(name) : true);
3542
+ }, [rawCatalog, catalogToggleVersion]);
3534
3543
  const builtInActivityRenderers = (0, react.useMemo)(() => {
3535
3544
  const renderers = [{
3536
3545
  activityType: MCPAppsActivityType,
@@ -3544,7 +3553,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3544
3553
  });
3545
3554
  if (a2uiActive) renderers.unshift(createA2UIMessageRenderer({
3546
3555
  theme: a2ui?.theme ?? _copilotkit_a2ui_renderer.viewerTheme,
3547
- catalog: a2ui?.catalog,
3556
+ catalog: filteredCatalog,
3548
3557
  loadingComponent: a2ui?.loadingComponent,
3549
3558
  recovery: a2ui?.recovery
3550
3559
  }));
@@ -3552,7 +3561,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3552
3561
  }, [
3553
3562
  a2uiActive,
3554
3563
  openGenUIActive,
3555
- a2ui
3564
+ a2ui,
3565
+ filteredCatalog
3556
3566
  ]);
3557
3567
  const allActivityRenderers = (0, react.useMemo)(() => {
3558
3568
  return [...renderActivityMessagesList, ...builtInActivityRenderers];
@@ -3657,7 +3667,6 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3657
3667
  builtInFrontendTools,
3658
3668
  processedHumanInTheLoopTools
3659
3669
  ]);
3660
- const copilotkitRef = (0, react.useRef)(null);
3661
3670
  if (copilotkitRef.current === null) {
3662
3671
  copilotkitRef.current = new CopilotKitCoreReact({
3663
3672
  runtimeUrl: chatApiEndpoint,
@@ -3676,6 +3685,20 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3676
3685
  if (defaultThrottleMs !== void 0) copilotkitRef.current.setDefaultThrottleMs(defaultThrottleMs);
3677
3686
  }
3678
3687
  const copilotkit = copilotkitRef.current;
3688
+ (0, react.useEffect)(() => {
3689
+ if (!rawCatalog) return;
3690
+ if (!(rawCatalog instanceof _copilotkit_a2ui_renderer.Catalog)) return;
3691
+ const components = Array.from(rawCatalog.components.values()).map((comp) => ({
3692
+ name: comp.name,
3693
+ description: void 0,
3694
+ schema: comp.schema
3695
+ }));
3696
+ copilotkit.setCatalogComponents(components);
3697
+ const subscription = copilotkit.subscribe({ onCatalogComponentsChanged: () => {
3698
+ setCatalogToggleVersion((v) => v + 1);
3699
+ } });
3700
+ return () => subscription.unsubscribe();
3701
+ }, [copilotkit, rawCatalog]);
3679
3702
  (0, react.useEffect)(() => {
3680
3703
  const syncRuntimeInfo = () => {
3681
3704
  setRuntimeA2UIEnabled(copilotkit.a2uiEnabled);
@@ -3831,7 +3854,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3831
3854
  children: [
3832
3855
  a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UIBuiltInToolCallRenderer, {}),
3833
3856
  a2uiActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(A2UICatalogContext, {
3834
- catalog: a2ui?.catalog,
3857
+ catalog: filteredCatalog,
3835
3858
  includeSchema: a2ui?.includeSchema
3836
3859
  }),
3837
3860
  children,