@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.
- package/CHANGELOG.md +7 -0
- package/dist/{chunk-Q573EMPD.mjs → chunk-2GRWTU7W.mjs} +2 -2
- package/dist/{chunk-2PL3WCKM.mjs → chunk-5P46WS5M.mjs} +17 -12
- package/dist/chunk-5P46WS5M.mjs.map +1 -0
- package/dist/{chunk-OKRZF3DD.mjs → chunk-6ZLPNY7X.mjs} +2 -2
- package/dist/{chunk-OKRZF3DD.mjs.map → chunk-6ZLPNY7X.mjs.map} +1 -1
- package/dist/{chunk-OGXCE54J.mjs → chunk-BEFEBKKI.mjs} +2 -2
- package/dist/{chunk-MO2BUFJD.mjs → chunk-F26O2HTO.mjs} +3 -3
- package/dist/chunk-F26O2HTO.mjs.map +1 -0
- package/dist/{chunk-7TFJCTYY.mjs → chunk-JY3STRON.mjs} +2 -2
- package/dist/{chunk-IKWGQG5V.mjs → chunk-N4VN2B5S.mjs} +2 -2
- package/dist/{chunk-BVRWKRDI.mjs → chunk-NTH42BY5.mjs} +2 -2
- package/dist/{chunk-PYPPRFZ6.mjs → chunk-YIBUNEBN.mjs} +2 -2
- package/dist/chunk-YIBUNEBN.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit-props.d.ts +9 -1
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +15 -10
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +3 -3
- package/dist/components/copilot-provider/index.js +15 -10
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +3 -3
- package/dist/components/error-boundary/error-boundary.js +1 -1
- package/dist/components/error-boundary/error-boundary.js.map +1 -1
- package/dist/components/error-boundary/error-boundary.mjs +2 -2
- package/dist/components/index.js +15 -10
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -3
- package/dist/components/usage-banner.js +1 -1
- package/dist/components/usage-banner.js.map +1 -1
- package/dist/components/usage-banner.mjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -8
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +5 -5
- package/dist/hooks/use-copilot-chat-headless_c.js +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
- package/dist/hooks/use-copilot-chat-headless_c.mjs +5 -5
- package/dist/hooks/use-copilot-chat.d.ts +42 -3
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +5 -5
- package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
- package/dist/hooks/use-copilot-chat_internal.mjs +4 -4
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +5 -5
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +4 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/suggestions.js.map +1 -1
- package/dist/utils/suggestions.mjs +3 -3
- package/package.json +3 -3
- package/src/components/copilot-provider/copilotkit-props.tsx +10 -1
- package/src/components/copilot-provider/copilotkit.tsx +20 -10
- package/src/components/usage-banner.tsx +1 -1
- package/src/hooks/use-copilot-chat-headless_c.ts +79 -9
- package/src/hooks/use-copilot-chat.ts +42 -3
- package/dist/chunk-2PL3WCKM.mjs.map +0 -1
- package/dist/chunk-MO2BUFJD.mjs.map +0 -1
- package/dist/chunk-PYPPRFZ6.mjs.map +0 -1
- /package/dist/{chunk-Q573EMPD.mjs.map → chunk-2GRWTU7W.mjs.map} +0 -0
- /package/dist/{chunk-OGXCE54J.mjs.map → chunk-BEFEBKKI.mjs.map} +0 -0
- /package/dist/{chunk-7TFJCTYY.mjs.map → chunk-JY3STRON.mjs.map} +0 -0
- /package/dist/{chunk-IKWGQG5V.mjs.map → chunk-N4VN2B5S.mjs.map} +0 -0
- /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-
|
|
4
|
-
import "../chunk-
|
|
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-
|
|
9
|
-
import "../chunk-
|
|
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-
|
|
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/
|
|
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
|
-
|
|
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 (
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
3122
|
-
|
|
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 && !
|
|
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
|
|
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,
|