@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
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
CopilotKit,
|
|
3
3
|
CopilotKitInternal,
|
|
4
4
|
defaultCopilotContextCategories
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
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-
|
|
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/
|
|
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
|
-
|
|
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 (
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
2707
|
-
|
|
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 && !
|
|
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
|
}
|