@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.
@@ -172,8 +172,8 @@ declare const standardUI: GenerativeUI<_copilotkit_shared_generative_ui0.Generat
172
172
  badge: zod.ZodOptional<zod.ZodObject<{
173
173
  label: zod.ZodString;
174
174
  color: zod.ZodOptional<zod.ZodEnum<{
175
- secondary: "secondary";
176
175
  success: "success";
176
+ secondary: "secondary";
177
177
  info: "info";
178
178
  warning: "warning";
179
179
  danger: "danger";
@@ -1244,8 +1244,8 @@ declare const standardUI: GenerativeUI<_copilotkit_shared_generative_ui0.Generat
1244
1244
  Badge: zod.ZodObject<{
1245
1245
  label: zod.ZodString;
1246
1246
  color: zod.ZodOptional<zod.ZodEnum<{
1247
- secondary: "secondary";
1248
1247
  success: "success";
1248
+ secondary: "secondary";
1249
1249
  info: "info";
1250
1250
  warning: "warning";
1251
1251
  danger: "danger";
@@ -172,8 +172,8 @@ declare const standardUI: GenerativeUI<_copilotkit_shared_generative_ui0.Generat
172
172
  badge: zod.ZodOptional<zod.ZodObject<{
173
173
  label: zod.ZodString;
174
174
  color: zod.ZodOptional<zod.ZodEnum<{
175
- secondary: "secondary";
176
175
  success: "success";
176
+ secondary: "secondary";
177
177
  info: "info";
178
178
  warning: "warning";
179
179
  danger: "danger";
@@ -1244,8 +1244,8 @@ declare const standardUI: GenerativeUI<_copilotkit_shared_generative_ui0.Generat
1244
1244
  Badge: zod.ZodObject<{
1245
1245
  label: zod.ZodString;
1246
1246
  color: zod.ZodOptional<zod.ZodEnum<{
1247
- secondary: "secondary";
1248
1247
  success: "success";
1248
+ secondary: "secondary";
1249
1249
  info: "info";
1250
1250
  warning: "warning";
1251
1251
  danger: "danger";
package/dist/index.cjs CHANGED
@@ -805,7 +805,7 @@ function ɵuseOwnedCore(ref, create) {
805
805
 
806
806
  //#endregion
807
807
  //#region package.json
808
- var version$1 = "2.0.0-rc.59";
808
+ var version$1 = "2.0.0-rc.60";
809
809
 
810
810
  //#endregion
811
811
  //#region src/components/CopilotKitInspector.tsx
@@ -1309,6 +1309,19 @@ const SameOriginMCPAppsActivityRenderer = (props) => /* @__PURE__ */ (0, react_j
1309
1309
  ...props,
1310
1310
  allowSameOriginFallback: true
1311
1311
  });
1312
+ /**
1313
+ * The `generativeUI` prop with the options of the deprecated `a2ui` prop:
1314
+ * `a2ui.catalog` is the `ui` and `a2ui.theme` the `theme`, unless
1315
+ * `generativeUI` sets them.
1316
+ */
1317
+ function withA2UIOptions(generativeUI, a2ui) {
1318
+ if (!(a2ui.catalog !== void 0 || a2ui.theme !== void 0)) return generativeUI;
1319
+ return {
1320
+ ...generativeUI,
1321
+ ui: generativeUI?.ui ?? a2ui.catalog,
1322
+ theme: generativeUI?.theme ?? a2ui.theme
1323
+ };
1324
+ }
1312
1325
  function useStableArrayProp(prop, name) {
1313
1326
  const empty = (0, react.useMemo)(() => [], []);
1314
1327
  const value = prop ?? empty;
@@ -1320,7 +1333,7 @@ function useStableArrayProp(prop, name) {
1320
1333
  return value;
1321
1334
  }
1322
1335
  /** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */
1323
- 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 }) => {
1336
+ 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 }) => {
1324
1337
  const learningConfig = (0, react.useMemo)(() => (0, _copilotkit_core.ɵtoLearningConfig)(learning), [learning]);
1325
1338
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
1326
1339
  const [inspectorVisible, setInspectorVisible] = (0, react.useState)(false);
@@ -1338,7 +1351,16 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
1338
1351
  runtimeEnabled: runtimeInfo?.openGenerativeUIEnabled ?? false,
1339
1352
  configured: !!openGenerativeUI
1340
1353
  });
1341
- const generativeUIConfig = useStandardUIFallback(generativeUI, runtimeInfo);
1354
+ const a2uiCatalog = a2ui?.catalog;
1355
+ const a2uiTheme = a2ui?.theme;
1356
+ const generativeUIConfig = useStandardUIFallback((0, react.useMemo)(() => withA2UIOptions(generativeUI, {
1357
+ catalog: a2uiCatalog,
1358
+ theme: a2uiTheme
1359
+ }), [
1360
+ generativeUI,
1361
+ a2uiCatalog,
1362
+ a2uiTheme
1363
+ ]), runtimeInfo);
1342
1364
  const generativeUIActive = !!generativeUIConfig?.ui;
1343
1365
  const runtimeLicenseStatus = runtimeInfo?.licenseStatus;
1344
1366
  const runtimeEntitlements = runtimeInfo?.runtimeEntitlements;