@copilotkit/react-core 1.10.0-next.12 → 1.10.0-next.13

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-Q573EMPD.mjs → chunk-2GRWTU7W.mjs} +2 -2
  3. package/dist/{chunk-2PL3WCKM.mjs → chunk-5P46WS5M.mjs} +17 -12
  4. package/dist/chunk-5P46WS5M.mjs.map +1 -0
  5. package/dist/{chunk-OKRZF3DD.mjs → chunk-6ZLPNY7X.mjs} +2 -2
  6. package/dist/{chunk-OKRZF3DD.mjs.map → chunk-6ZLPNY7X.mjs.map} +1 -1
  7. package/dist/{chunk-OGXCE54J.mjs → chunk-BEFEBKKI.mjs} +2 -2
  8. package/dist/{chunk-MO2BUFJD.mjs → chunk-F26O2HTO.mjs} +3 -3
  9. package/dist/chunk-F26O2HTO.mjs.map +1 -0
  10. package/dist/{chunk-7TFJCTYY.mjs → chunk-JY3STRON.mjs} +2 -2
  11. package/dist/{chunk-IKWGQG5V.mjs → chunk-N4VN2B5S.mjs} +2 -2
  12. package/dist/{chunk-BVRWKRDI.mjs → chunk-NTH42BY5.mjs} +2 -2
  13. package/dist/{chunk-PYPPRFZ6.mjs → chunk-YIBUNEBN.mjs} +2 -2
  14. package/dist/chunk-YIBUNEBN.mjs.map +1 -0
  15. package/dist/components/copilot-provider/copilotkit-props.d.ts +9 -1
  16. package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
  17. package/dist/components/copilot-provider/copilotkit.js +15 -10
  18. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  19. package/dist/components/copilot-provider/copilotkit.mjs +3 -3
  20. package/dist/components/copilot-provider/index.js +15 -10
  21. package/dist/components/copilot-provider/index.js.map +1 -1
  22. package/dist/components/copilot-provider/index.mjs +3 -3
  23. package/dist/components/error-boundary/error-boundary.js +1 -1
  24. package/dist/components/error-boundary/error-boundary.js.map +1 -1
  25. package/dist/components/error-boundary/error-boundary.mjs +2 -2
  26. package/dist/components/index.js +15 -10
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/index.mjs +3 -3
  29. package/dist/components/usage-banner.js +1 -1
  30. package/dist/components/usage-banner.js.map +1 -1
  31. package/dist/components/usage-banner.mjs +1 -1
  32. package/dist/hooks/index.js +1 -1
  33. package/dist/hooks/index.js.map +1 -1
  34. package/dist/hooks/index.mjs +8 -8
  35. package/dist/hooks/use-coagent.js.map +1 -1
  36. package/dist/hooks/use-coagent.mjs +5 -5
  37. package/dist/hooks/use-copilot-chat-headless_c.js +1 -1
  38. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  39. package/dist/hooks/use-copilot-chat-headless_c.mjs +5 -5
  40. package/dist/hooks/use-copilot-chat.d.ts +42 -3
  41. package/dist/hooks/use-copilot-chat.js.map +1 -1
  42. package/dist/hooks/use-copilot-chat.mjs +5 -5
  43. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  44. package/dist/hooks/use-copilot-chat_internal.mjs +4 -4
  45. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  46. package/dist/hooks/use-langgraph-interrupt.mjs +5 -5
  47. package/dist/index.js +16 -11
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +9 -9
  50. package/dist/lib/copilot-task.js.map +1 -1
  51. package/dist/lib/copilot-task.mjs +4 -4
  52. package/dist/lib/index.js.map +1 -1
  53. package/dist/lib/index.mjs +4 -4
  54. package/dist/utils/extract.js.map +1 -1
  55. package/dist/utils/extract.mjs +3 -3
  56. package/dist/utils/index.js.map +1 -1
  57. package/dist/utils/index.mjs +3 -3
  58. package/dist/utils/suggestions.js.map +1 -1
  59. package/dist/utils/suggestions.mjs +3 -3
  60. package/package.json +3 -3
  61. package/src/components/copilot-provider/copilotkit-props.tsx +10 -1
  62. package/src/components/copilot-provider/copilotkit.tsx +20 -10
  63. package/src/components/usage-banner.tsx +1 -1
  64. package/src/hooks/use-copilot-chat-headless_c.ts +79 -9
  65. package/src/hooks/use-copilot-chat.ts +42 -3
  66. package/dist/chunk-2PL3WCKM.mjs.map +0 -1
  67. package/dist/chunk-MO2BUFJD.mjs.map +0 -1
  68. package/dist/chunk-PYPPRFZ6.mjs.map +0 -1
  69. /package/dist/{chunk-Q573EMPD.mjs.map → chunk-2GRWTU7W.mjs.map} +0 -0
  70. /package/dist/{chunk-OGXCE54J.mjs.map → chunk-BEFEBKKI.mjs.map} +0 -0
  71. /package/dist/{chunk-7TFJCTYY.mjs.map → chunk-JY3STRON.mjs.map} +0 -0
  72. /package/dist/{chunk-IKWGQG5V.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
  73. /package/dist/{chunk-BVRWKRDI.mjs.map → chunk-NTH42BY5.mjs.map} +0 -0
@@ -2,8 +2,8 @@ import {
2
2
  CopilotKit,
3
3
  CopilotKitInternal,
4
4
  defaultCopilotContextCategories
5
- } from "../../chunk-2PL3WCKM.mjs";
6
- import "../../chunk-IKWGQG5V.mjs";
5
+ } from "../../chunk-5P46WS5M.mjs";
6
+ import "../../chunk-N4VN2B5S.mjs";
7
7
  import "../../chunk-MUDXTKXE.mjs";
8
8
  import "../../chunk-3BASANUO.mjs";
9
9
  import "../../chunk-WSXTUD36.mjs";
@@ -17,7 +17,7 @@ import "../../chunk-ICIK2BSB.mjs";
17
17
  import "../../chunk-N4WEHORG.mjs";
18
18
  import "../../chunk-O7ARI5CV.mjs";
19
19
  import "../../chunk-EFL5OBKN.mjs";
20
- import "../../chunk-OKRZF3DD.mjs";
20
+ import "../../chunk-6ZLPNY7X.mjs";
21
21
  import "../../chunk-TEMLWRRT.mjs";
22
22
  import "../../chunk-ZLQVRPDS.mjs";
23
23
  import "../../chunk-SKC7AJIV.mjs";
@@ -1086,7 +1086,7 @@ var getErrorActions = (error) => {
1086
1086
  primary: {
1087
1087
  label: "Show me how",
1088
1088
  onClick: () => window.open(
1089
- "https://docs.copilotkit.ai/docs/guides/subscription",
1089
+ "https://docs.copilotkit.ai/premium#how-do-i-get-access-to-premium-features",
1090
1090
  "_blank",
1091
1091
  "noopener,noreferrer"
1092
1092
  )
@@ -2305,11 +2305,13 @@ var import_jsx_runtime8 = require("react/jsx-runtime");
2305
2305
  function CopilotKit(_a) {
2306
2306
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
2307
2307
  const enabled = shouldShowDevConsole(props.showDevConsole);
2308
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotErrorBoundary, { publicApiKey: props.publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) }) });
2308
+ const publicApiKey = props.publicApiKey || props.publicLicenseKey;
2309
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) }) });
2309
2310
  }
2310
2311
  function CopilotKitInternal(cpkProps) {
2311
2312
  const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
2312
2313
  validateProps(cpkProps);
2314
+ const publicApiKey = props.publicLicenseKey || props.publicApiKey;
2313
2315
  const chatApiEndpoint = props.runtimeUrl || import_shared10.COPILOT_CLOUD_CHAT_URL;
2314
2316
  const [actions, setActions] = (0, import_react11.useState)({});
2315
2317
  const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react11.useState)({});
@@ -2411,7 +2413,7 @@ ${nonDocumentStrings}`;
2411
2413
  const copilotApiConfig = (0, import_react11.useMemo)(() => {
2412
2414
  var _a2, _b;
2413
2415
  let cloud = void 0;
2414
- if (props.publicApiKey) {
2416
+ if (publicApiKey) {
2415
2417
  cloud = {
2416
2418
  guardrails: {
2417
2419
  input: {
@@ -2425,7 +2427,7 @@ ${nonDocumentStrings}`;
2425
2427
  };
2426
2428
  }
2427
2429
  return __spreadProps(__spreadValues({
2428
- publicApiKey: props.publicApiKey
2430
+ publicApiKey
2429
2431
  }, cloud ? { cloud } : {}), {
2430
2432
  chatApiEndpoint,
2431
2433
  headers: props.headers || {},
@@ -2435,7 +2437,7 @@ ${nonDocumentStrings}`;
2435
2437
  credentials: props.credentials
2436
2438
  });
2437
2439
  }, [
2438
- props.publicApiKey,
2440
+ publicApiKey,
2439
2441
  props.headers,
2440
2442
  props.properties,
2441
2443
  props.transcribeAudioUrl,
@@ -2460,7 +2462,7 @@ ${nonDocumentStrings}`;
2460
2462
  }, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
2461
2463
  const runtimeClient = useCopilotRuntimeClient({
2462
2464
  url: copilotApiConfig.chatApiEndpoint,
2463
- publicApiKey: copilotApiConfig.publicApiKey,
2465
+ publicApiKey,
2464
2466
  headers,
2465
2467
  credentials: copilotApiConfig.credentials,
2466
2468
  showDevConsole: shouldShowDevConsole(props.showDevConsole),
@@ -2703,12 +2705,15 @@ function formatFeatureName(featureName) {
2703
2705
  }
2704
2706
  function validateProps(props) {
2705
2707
  const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
2706
- if (!props.runtimeUrl && !props.publicApiKey) {
2707
- throw new import_shared10.ConfigurationError("Missing required prop: 'runtimeUrl' or 'publicApiKey'");
2708
+ const hasApiKey = props.publicApiKey || props.publicLicenseKey;
2709
+ if (!props.runtimeUrl && !hasApiKey) {
2710
+ throw new import_shared10.ConfigurationError(
2711
+ "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
2712
+ );
2708
2713
  }
2709
- if (cloudFeatures.length > 0 && !props.publicApiKey) {
2714
+ if (cloudFeatures.length > 0 && !hasApiKey) {
2710
2715
  throw new import_shared10.MissingPublicApiKeyError(
2711
- `Missing required prop: 'publicApiKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
2716
+ `Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
2712
2717
  );
2713
2718
  }
2714
2719
  }