@copilotkit/react-core 2.0.0-rc.59 → 2.0.0-rc.60

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.umd.js CHANGED
@@ -1377,7 +1377,7 @@ _radix_ui_react_popover = __toESM(_radix_ui_react_popover);
1377
1377
 
1378
1378
  //#endregion
1379
1379
  //#region package.json
1380
- var version$1 = "2.0.0-rc.59";
1380
+ var version$1 = "2.0.0-rc.60";
1381
1381
 
1382
1382
  //#endregion
1383
1383
  //#region src/components/CopilotKitInspector.tsx
@@ -9233,6 +9233,19 @@ _radix_ui_react_popover = __toESM(_radix_ui_react_popover);
9233
9233
  ...props,
9234
9234
  allowSameOriginFallback: true
9235
9235
  });
9236
+ /**
9237
+ * The `generativeUI` prop with the options of the deprecated `a2ui` prop:
9238
+ * `a2ui.catalog` is the `ui` and `a2ui.theme` the `theme`, unless
9239
+ * `generativeUI` sets them.
9240
+ */
9241
+ function withA2UIOptions(generativeUI, a2ui) {
9242
+ if (!(a2ui.catalog !== void 0 || a2ui.theme !== void 0)) return generativeUI;
9243
+ return {
9244
+ ...generativeUI,
9245
+ ui: generativeUI?.ui ?? a2ui.catalog,
9246
+ theme: generativeUI?.theme ?? a2ui.theme
9247
+ };
9248
+ }
9236
9249
  function useStableArrayProp(prop, name) {
9237
9250
  const empty = (0, react.useMemo)(() => [], []);
9238
9251
  const value = prop ?? empty;
@@ -9244,7 +9257,7 @@ _radix_ui_react_popover = __toESM(_radix_ui_react_popover);
9244
9257
  return value;
9245
9258
  }
9246
9259
  /** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */
9247
- const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, nonce, injectStyles = true, messageFilter, publicApiKey, publicLicenseKey, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, markdownRenderer, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, generativeUI, mcpApps, defaultThrottleMs, debug, learning }) => {
9260
+ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, nonce, injectStyles = true, messageFilter, publicApiKey, publicLicenseKey, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, markdownRenderer, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, generativeUI, a2ui, mcpApps, defaultThrottleMs, debug, learning }) => {
9248
9261
  const learningConfig = (0, react.useMemo)(() => (0, _copilotkit_core.ɵtoLearningConfig)(learning), [learning]);
9249
9262
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
9250
9263
  const [inspectorVisible, setInspectorVisible] = (0, react.useState)(false);
@@ -9262,7 +9275,16 @@ _radix_ui_react_popover = __toESM(_radix_ui_react_popover);
9262
9275
  runtimeEnabled: runtimeInfo?.openGenerativeUIEnabled ?? false,
9263
9276
  configured: !!openGenerativeUI
9264
9277
  });
9265
- const generativeUIConfig = useStandardUIFallback(generativeUI, runtimeInfo);
9278
+ const a2uiCatalog = a2ui?.catalog;
9279
+ const a2uiTheme = a2ui?.theme;
9280
+ const generativeUIConfig = useStandardUIFallback((0, react.useMemo)(() => withA2UIOptions(generativeUI, {
9281
+ catalog: a2uiCatalog,
9282
+ theme: a2uiTheme
9283
+ }), [
9284
+ generativeUI,
9285
+ a2uiCatalog,
9286
+ a2uiTheme
9287
+ ]), runtimeInfo);
9266
9288
  const generativeUIActive = !!generativeUIConfig?.ui;
9267
9289
  const runtimeLicenseStatus = runtimeInfo?.licenseStatus;
9268
9290
  const runtimeEntitlements = runtimeInfo?.runtimeEntitlements;