@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
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useLangGraphInterrupt
3
- } from "../chunk-BVRWKRDI.mjs";
4
- import "../chunk-7TFJCTYY.mjs";
3
+ } from "../chunk-NTH42BY5.mjs";
4
+ import "../chunk-JY3STRON.mjs";
5
5
  import "../chunk-IN7GE4NO.mjs";
6
6
  import "../chunk-KH27ZS4Y.mjs";
7
7
  import "../chunk-4CEQJ2X6.mjs";
8
- import "../chunk-2PL3WCKM.mjs";
9
- import "../chunk-IKWGQG5V.mjs";
8
+ import "../chunk-5P46WS5M.mjs";
9
+ import "../chunk-N4VN2B5S.mjs";
10
10
  import "../chunk-MUDXTKXE.mjs";
11
11
  import "../chunk-3BASANUO.mjs";
12
12
  import "../chunk-WSXTUD36.mjs";
@@ -20,7 +20,7 @@ import "../chunk-ICIK2BSB.mjs";
20
20
  import "../chunk-N4WEHORG.mjs";
21
21
  import "../chunk-O7ARI5CV.mjs";
22
22
  import "../chunk-EFL5OBKN.mjs";
23
- import "../chunk-OKRZF3DD.mjs";
23
+ import "../chunk-6ZLPNY7X.mjs";
24
24
  import "../chunk-YPSGKPDA.mjs";
25
25
  import "../chunk-TEMLWRRT.mjs";
26
26
  import "../chunk-ZLQVRPDS.mjs";
package/dist/index.js CHANGED
@@ -1112,7 +1112,7 @@ var getErrorActions = (error) => {
1112
1112
  primary: {
1113
1113
  label: "Show me how",
1114
1114
  onClick: () => window.open(
1115
- "https://docs.copilotkit.ai/docs/guides/subscription",
1115
+ "https://docs.copilotkit.ai/premium#how-do-i-get-access-to-premium-features",
1116
1116
  "_blank",
1117
1117
  "noopener,noreferrer"
1118
1118
  )
@@ -2720,11 +2720,13 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
2720
2720
  function CopilotKit(_a) {
2721
2721
  var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
2722
2722
  const enabled = shouldShowDevConsole(props.showDevConsole);
2723
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotErrorBoundary, { publicApiKey: props.publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) }) });
2723
+ const publicApiKey = props.publicApiKey || props.publicLicenseKey;
2724
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ToastProvider, { enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotErrorBoundary, { publicApiKey, showUsageBanner: enabled, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CopilotKitInternal, __spreadProps(__spreadValues({}, props), { children })) }) });
2724
2725
  }
2725
2726
  function CopilotKitInternal(cpkProps) {
2726
2727
  const _a = cpkProps, { children } = _a, props = __objRest(_a, ["children"]);
2727
2728
  validateProps(cpkProps);
2729
+ const publicApiKey = props.publicLicenseKey || props.publicApiKey;
2728
2730
  const chatApiEndpoint = props.runtimeUrl || import_shared12.COPILOT_CLOUD_CHAT_URL;
2729
2731
  const [actions, setActions] = (0, import_react12.useState)({});
2730
2732
  const [coAgentStateRenders, setCoAgentStateRenders] = (0, import_react12.useState)({});
@@ -2826,7 +2828,7 @@ ${nonDocumentStrings}`;
2826
2828
  const copilotApiConfig = (0, import_react12.useMemo)(() => {
2827
2829
  var _a2, _b;
2828
2830
  let cloud = void 0;
2829
- if (props.publicApiKey) {
2831
+ if (publicApiKey) {
2830
2832
  cloud = {
2831
2833
  guardrails: {
2832
2834
  input: {
@@ -2840,7 +2842,7 @@ ${nonDocumentStrings}`;
2840
2842
  };
2841
2843
  }
2842
2844
  return __spreadProps(__spreadValues({
2843
- publicApiKey: props.publicApiKey
2845
+ publicApiKey
2844
2846
  }, cloud ? { cloud } : {}), {
2845
2847
  chatApiEndpoint,
2846
2848
  headers: props.headers || {},
@@ -2850,7 +2852,7 @@ ${nonDocumentStrings}`;
2850
2852
  credentials: props.credentials
2851
2853
  });
2852
2854
  }, [
2853
- props.publicApiKey,
2855
+ publicApiKey,
2854
2856
  props.headers,
2855
2857
  props.properties,
2856
2858
  props.transcribeAudioUrl,
@@ -2875,7 +2877,7 @@ ${nonDocumentStrings}`;
2875
2877
  }, [copilotApiConfig.headers, copilotApiConfig.publicApiKey, authStates]);
2876
2878
  const runtimeClient = useCopilotRuntimeClient({
2877
2879
  url: copilotApiConfig.chatApiEndpoint,
2878
- publicApiKey: copilotApiConfig.publicApiKey,
2880
+ publicApiKey,
2879
2881
  headers,
2880
2882
  credentials: copilotApiConfig.credentials,
2881
2883
  showDevConsole: shouldShowDevConsole(props.showDevConsole),
@@ -3118,12 +3120,15 @@ function formatFeatureName(featureName) {
3118
3120
  }
3119
3121
  function validateProps(props) {
3120
3122
  const cloudFeatures = Object.keys(props).filter((key) => key.endsWith("_c"));
3121
- if (!props.runtimeUrl && !props.publicApiKey) {
3122
- throw new import_shared12.ConfigurationError("Missing required prop: 'runtimeUrl' or 'publicApiKey'");
3123
+ const hasApiKey = props.publicApiKey || props.publicLicenseKey;
3124
+ if (!props.runtimeUrl && !hasApiKey) {
3125
+ throw new import_shared12.ConfigurationError(
3126
+ "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
3127
+ );
3123
3128
  }
3124
- if (cloudFeatures.length > 0 && !props.publicApiKey) {
3129
+ if (cloudFeatures.length > 0 && !hasApiKey) {
3125
3130
  throw new import_shared12.MissingPublicApiKeyError(
3126
- `Missing required prop: 'publicApiKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
3131
+ `Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${cloudFeatures.map(formatFeatureName).join(", ")}`
3127
3132
  );
3128
3133
  }
3129
3134
  }
@@ -4227,7 +4232,7 @@ function useCopilotChatHeadless_c(options = {}) {
4227
4232
  new import_shared15.CopilotKitError({
4228
4233
  message: (
4229
4234
  // add link to documentation here
4230
- "You're using useCopilotChatHeadless_c, a subscription-only feature, which offers extensive headless chat capabilities. To continue, you'll need to provide a free subscription key."
4235
+ "You're using useCopilotChatHeadless_c, a premium-only feature, which offers extensive headless chat capabilities. To continue, you'll need to provide a free public license key."
4231
4236
  ),
4232
4237
  code: import_shared15.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,
4233
4238
  severity: import_shared15.Severity.WARNING,