@copilotkit/react-core 1.59.5 → 1.60.0
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/dist/{copilotkit-CFfEVdV4.cjs → copilotkit-BTHcCAVQ.cjs} +93 -78
- package/dist/copilotkit-BTHcCAVQ.cjs.map +1 -0
- package/dist/{copilotkit-Ctvinul7.d.cts → copilotkit-C9ptuh-b.d.cts} +32 -70
- package/dist/copilotkit-C9ptuh-b.d.cts.map +1 -0
- package/dist/{copilotkit-DEGlMWM0.mjs → copilotkit-CV519nFv.mjs} +94 -79
- package/dist/copilotkit-CV519nFv.mjs.map +1 -0
- package/dist/{copilotkit-DqDT5RLa.d.mts → copilotkit-DvbI8G0d.d.mts} +32 -70
- package/dist/copilotkit-DvbI8G0d.d.mts.map +1 -0
- package/dist/index.cjs +11 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +11 -12
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +47 -54
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.css +1 -1
- package/dist/v2/index.d.cts +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +92 -77
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/skills/react-core/SKILL.md +5 -5
- package/skills/react-core/references/chat-components.md +2 -1
- package/skills/react-core/references/client-side-tools.md +1 -1
- package/skills/react-core/references/custom-message-renderers.md +8 -11
- package/skills/react-core/references/debug-mode.md +15 -15
- package/skills/react-core/references/provider-setup.md +45 -52
- package/skills/react-core/references/rendering-activity-messages.md +6 -12
- package/dist/copilotkit-CFfEVdV4.cjs.map +0 -1
- package/dist/copilotkit-Ctvinul7.d.cts.map +0 -1
- package/dist/copilotkit-DEGlMWM0.mjs.map +0 -1
- package/dist/copilotkit-DqDT5RLa.d.mts.map +0 -1
|
@@ -2025,7 +2025,7 @@ function LicenseWarningBanner({ type, featureName, expiryDate, graceRemaining, o
|
|
|
2025
2025
|
severity: "warning",
|
|
2026
2026
|
message: `Your CopilotKit license expires in ${graceRemaining} day${graceRemaining !== 1 ? "s" : ""}. Please renew.`,
|
|
2027
2027
|
actionLabel: "Renew",
|
|
2028
|
-
actionUrl: "https://
|
|
2028
|
+
actionUrl: "https://dashboard.operations.copilotkit.ai",
|
|
2029
2029
|
onDismiss
|
|
2030
2030
|
});
|
|
2031
2031
|
case "expired": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BannerShell, {
|
|
@@ -3593,67 +3593,61 @@ function A2UIBuiltInToolCallRenderer() {
|
|
|
3593
3593
|
return null;
|
|
3594
3594
|
}
|
|
3595
3595
|
|
|
3596
|
-
//#endregion
|
|
3597
|
-
//#region src/v2/hooks/use-agent-context.tsx
|
|
3598
|
-
function useAgentContext(context) {
|
|
3599
|
-
const { description, value } = context;
|
|
3600
|
-
const { copilotkit } = useCopilotKit();
|
|
3601
|
-
const stringValue = (0, react.useMemo)(() => {
|
|
3602
|
-
if (typeof value === "string") return value;
|
|
3603
|
-
return JSON.stringify(value);
|
|
3604
|
-
}, [value]);
|
|
3605
|
-
(0, react.useLayoutEffect)(() => {
|
|
3606
|
-
if (!copilotkit) return;
|
|
3607
|
-
const id = copilotkit.addContext({
|
|
3608
|
-
description,
|
|
3609
|
-
value: stringValue
|
|
3610
|
-
});
|
|
3611
|
-
return () => {
|
|
3612
|
-
copilotkit.removeContext(id);
|
|
3613
|
-
};
|
|
3614
|
-
}, [
|
|
3615
|
-
description,
|
|
3616
|
-
stringValue,
|
|
3617
|
-
copilotkit
|
|
3618
|
-
]);
|
|
3619
|
-
}
|
|
3620
|
-
|
|
3621
3596
|
//#endregion
|
|
3622
3597
|
//#region src/v2/a2ui/A2UICatalogContext.tsx
|
|
3623
3598
|
/**
|
|
3624
3599
|
* Renders agent context describing the available A2UI catalog and custom components.
|
|
3625
3600
|
* Only mount this component when A2UI is enabled.
|
|
3626
3601
|
*
|
|
3602
|
+
* The entries are scoped to the agents the runtime applies A2UI to
|
|
3603
|
+
* (`copilotkit.a2uiAgents`, #5369), so agents outside that list don't receive
|
|
3604
|
+
* the catalog/schema/guidelines payload on their runs.
|
|
3605
|
+
*
|
|
3627
3606
|
* When `includeSchema` is true, the full component schemas (JSON Schema) are also
|
|
3628
3607
|
* sent as context using the same description key as the A2UI middleware, so the
|
|
3629
3608
|
* middleware can optionally overwrite it with a server-side schema.
|
|
3630
3609
|
*/
|
|
3631
3610
|
function A2UICatalogContext({ catalog, includeSchema }) {
|
|
3632
|
-
useAgentContext({
|
|
3633
|
-
description: "A2UI catalog capabilities: available catalog IDs and custom component definitions the client can render.",
|
|
3634
|
-
value: (0, _copilotkit_a2ui_renderer.buildCatalogContextValue)(catalog)
|
|
3635
|
-
});
|
|
3636
3611
|
const { copilotkit } = useCopilotKit();
|
|
3612
|
+
const capabilitiesValue = (0, react.useMemo)(() => (0, _copilotkit_a2ui_renderer.buildCatalogContextValue)(catalog), [catalog]);
|
|
3637
3613
|
const schemaValue = (0, react.useMemo)(() => includeSchema !== false ? JSON.stringify((0, _copilotkit_a2ui_renderer.extractCatalogComponentSchemas)(catalog)) : null, [catalog, includeSchema]);
|
|
3614
|
+
const a2uiAgentsKey = copilotkit?.a2uiAgents?.join(",");
|
|
3638
3615
|
(0, react.useLayoutEffect)(() => {
|
|
3639
|
-
if (!copilotkit
|
|
3616
|
+
if (!copilotkit) return;
|
|
3617
|
+
const agentIds = copilotkit.a2uiAgents;
|
|
3618
|
+
const scope = agentIds ? { agentIds } : {};
|
|
3640
3619
|
const ids = [];
|
|
3641
3620
|
ids.push(copilotkit.addContext({
|
|
3642
|
-
description:
|
|
3643
|
-
value:
|
|
3644
|
-
|
|
3645
|
-
ids.push(copilotkit.addContext({
|
|
3646
|
-
description: "A2UI generation guidelines — protocol rules, tool arguments, path rules, data model format, and form/two-way-binding instructions.",
|
|
3647
|
-
value: _copilotkit_shared.A2UI_DEFAULT_GENERATION_GUIDELINES
|
|
3648
|
-
}));
|
|
3649
|
-
ids.push(copilotkit.addContext({
|
|
3650
|
-
description: "A2UI design guidelines — visual design rules, component hierarchy tips, and action handler patterns.",
|
|
3651
|
-
value: _copilotkit_shared.A2UI_DEFAULT_DESIGN_GUIDELINES
|
|
3621
|
+
description: "A2UI catalog capabilities: available catalog IDs and custom component definitions the client can render.",
|
|
3622
|
+
value: capabilitiesValue,
|
|
3623
|
+
...scope
|
|
3652
3624
|
}));
|
|
3625
|
+
if (schemaValue) {
|
|
3626
|
+
ids.push(copilotkit.addContext({
|
|
3627
|
+
description: _copilotkit_a2ui_renderer.A2UI_SCHEMA_CONTEXT_DESCRIPTION,
|
|
3628
|
+
value: schemaValue,
|
|
3629
|
+
...scope
|
|
3630
|
+
}));
|
|
3631
|
+
ids.push(copilotkit.addContext({
|
|
3632
|
+
description: "A2UI generation guidelines — protocol rules, tool arguments, path rules, data model format, and form/two-way-binding instructions.",
|
|
3633
|
+
value: _copilotkit_shared.A2UI_DEFAULT_GENERATION_GUIDELINES,
|
|
3634
|
+
...scope
|
|
3635
|
+
}));
|
|
3636
|
+
ids.push(copilotkit.addContext({
|
|
3637
|
+
description: "A2UI design guidelines — visual design rules, component hierarchy tips, and action handler patterns.",
|
|
3638
|
+
value: _copilotkit_shared.A2UI_DEFAULT_DESIGN_GUIDELINES,
|
|
3639
|
+
...scope
|
|
3640
|
+
}));
|
|
3641
|
+
}
|
|
3653
3642
|
return () => {
|
|
3654
3643
|
for (const id of ids) copilotkit.removeContext(id);
|
|
3655
3644
|
};
|
|
3656
|
-
}, [
|
|
3645
|
+
}, [
|
|
3646
|
+
copilotkit,
|
|
3647
|
+
capabilitiesValue,
|
|
3648
|
+
schemaValue,
|
|
3649
|
+
a2uiAgentsKey
|
|
3650
|
+
]);
|
|
3657
3651
|
return null;
|
|
3658
3652
|
}
|
|
3659
3653
|
|
|
@@ -4406,6 +4400,31 @@ function useCapabilities(agentId) {
|
|
|
4406
4400
|
if (agent && "capabilities" in agent) return agent.capabilities;
|
|
4407
4401
|
}
|
|
4408
4402
|
|
|
4403
|
+
//#endregion
|
|
4404
|
+
//#region src/v2/hooks/use-agent-context.tsx
|
|
4405
|
+
function useAgentContext(context) {
|
|
4406
|
+
const { description, value } = context;
|
|
4407
|
+
const { copilotkit } = useCopilotKit();
|
|
4408
|
+
const stringValue = (0, react.useMemo)(() => {
|
|
4409
|
+
if (typeof value === "string") return value;
|
|
4410
|
+
return JSON.stringify(value);
|
|
4411
|
+
}, [value]);
|
|
4412
|
+
(0, react.useLayoutEffect)(() => {
|
|
4413
|
+
if (!copilotkit) return;
|
|
4414
|
+
const id = copilotkit.addContext({
|
|
4415
|
+
description,
|
|
4416
|
+
value: stringValue
|
|
4417
|
+
});
|
|
4418
|
+
return () => {
|
|
4419
|
+
copilotkit.removeContext(id);
|
|
4420
|
+
};
|
|
4421
|
+
}, [
|
|
4422
|
+
description,
|
|
4423
|
+
stringValue,
|
|
4424
|
+
copilotkit
|
|
4425
|
+
]);
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4409
4428
|
//#endregion
|
|
4410
4429
|
//#region src/v2/hooks/use-suggestions.tsx
|
|
4411
4430
|
function useSuggestions({ agentId } = {}) {
|
|
@@ -6201,40 +6220,28 @@ const ScrollElementContext = react.default.createContext(null);
|
|
|
6201
6220
|
* rendered by the {@link IntelligenceIndicator} brain and the default
|
|
6202
6221
|
* value for the `intelligenceIndicator` slot.
|
|
6203
6222
|
*
|
|
6204
|
-
*
|
|
6205
|
-
*
|
|
6206
|
-
*
|
|
6207
|
-
*
|
|
6208
|
-
* length) and the whole SVG rotates — so the viewer sees one
|
|
6209
|
-
* C-shaped arc spinning around the visual center.
|
|
6210
|
-
* 2. **Icon morph (~250 ms).** On status flip the single icon path
|
|
6211
|
-
* interpolates from the arc to a checkmark via CSS `d:` while the
|
|
6212
|
-
* dashed stroke transitions to solid (filling in the gap that was
|
|
6213
|
-
* the spinner's open portion). The SVG rotation animation is
|
|
6214
|
-
* removed; the snap back to identity is masked by the simultaneous
|
|
6215
|
-
* shape change. Chrome and text stay at full opacity throughout.
|
|
6216
|
-
* 3. **Settle (~400 ms, starts at +250 ms).** Chrome (background,
|
|
6217
|
-
* border, shadow, backdrop-blur) fades to zero opacity. The label
|
|
6218
|
-
* and icon stroke color transitions from saturated purple to a
|
|
6219
|
-
* true-neutral gray at 0.8 alpha — no hue cast, reads as "settled
|
|
6220
|
-
* history metadata." The label simultaneously skews to ~10° (a
|
|
6221
|
-
* transform-based italic feel that interpolates smoothly with the
|
|
6222
|
-
* color, rather than the discrete `font-style: italic` snap that
|
|
6223
|
-
* would cause a layout pop). The label text stays put — only its
|
|
6224
|
-
* color and slant change — so there is no "bump" where the brand
|
|
6225
|
-
* text disappears and reappears.
|
|
6223
|
+
* Layout: a glassmorphism pill (the `__chrome` layer) wrapping an icon
|
|
6224
|
+
* and a label. The icon is two overlaid SVG paths — a spinner arc and a
|
|
6225
|
+
* checkmark — whose geometry lives in each path's `d` ATTRIBUTE so it
|
|
6226
|
+
* renders in every browser (the CSS `d:` property is Chrome-only).
|
|
6226
6227
|
*
|
|
6227
|
-
*
|
|
6228
|
-
* for
|
|
6228
|
+
* Two states, driven by the `data-status` attribute (see globals.css
|
|
6229
|
+
* for the exact timing):
|
|
6230
|
+
* 1. **In-progress.** The arc spins (CSS rotation) inside the pill and
|
|
6231
|
+
* the checkmark is hidden. Label + icon are a saturated purple.
|
|
6232
|
+
* 2. **Finished.** The arc fades out mid-spin while the checkmark draws
|
|
6233
|
+
* itself in upright (animated `stroke-dashoffset`); the pill chrome
|
|
6234
|
+
* fades away; and the label + icon settle from purple to a neutral
|
|
6235
|
+
* gray, with the label slanting slightly (a `transform: skewX`
|
|
6236
|
+
* faux-italic, so it interpolates with the color instead of snapping
|
|
6237
|
+
* and never reflows). The result reads as quiet "history metadata"
|
|
6238
|
+
* rather than an active spinner. The label text itself never changes
|
|
6239
|
+
* — the static check plus the color/slant shift carry the "done"
|
|
6240
|
+
* meaning, so no wording change is needed.
|
|
6229
6241
|
*
|
|
6230
|
-
*
|
|
6231
|
-
*
|
|
6232
|
-
*
|
|
6233
|
-
*
|
|
6234
|
-
* The label is identical in both states (default "CopilotKit
|
|
6235
|
-
* Intelligence"). The static check icon carries the "done" semantic;
|
|
6236
|
-
* the color + slant transition does the "settle" work without needing
|
|
6237
|
-
* any wording change.
|
|
6242
|
+
* All motion is gated behind `prefers-reduced-motion` (globals.css):
|
|
6243
|
+
* when reduced motion is requested the arc does not spin and the two
|
|
6244
|
+
* states swap instantly, without transitions.
|
|
6238
6245
|
*
|
|
6239
6246
|
* Customize via the `intelligenceIndicator` slot on `CopilotChat`:
|
|
6240
6247
|
* a className string restyles the wrapper, a props object tweaks
|
|
@@ -6255,13 +6262,21 @@ function IntelligenceIndicatorView({ message, status, label, className, ...rest
|
|
|
6255
6262
|
"aria-hidden": "true"
|
|
6256
6263
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6257
6264
|
className: "cpk-intelligence-indicator__content",
|
|
6258
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
6265
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
6259
6266
|
className: "cpk-intelligence-indicator__icon",
|
|
6260
6267
|
viewBox: "0 0 24 24",
|
|
6261
6268
|
width: "14",
|
|
6262
6269
|
height: "14",
|
|
6263
6270
|
"aria-hidden": "true",
|
|
6264
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6271
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6272
|
+
className: "cpk-intelligence-indicator__icon-arc",
|
|
6273
|
+
pathLength: 1,
|
|
6274
|
+
d: "M 12 3 C 17 3 21 7 21 12 C 21 17 17 21 12 21 C 7 21 3 17 3 12 C 3 7 7 3 12 3"
|
|
6275
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6276
|
+
className: "cpk-intelligence-indicator__icon-check",
|
|
6277
|
+
pathLength: 1,
|
|
6278
|
+
d: "M 5 12.5 L 9 16.5 L 19 6.5"
|
|
6279
|
+
})]
|
|
6265
6280
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6266
6281
|
className: "cpk-intelligence-indicator__label",
|
|
6267
6282
|
children: label
|
|
@@ -9486,7 +9501,7 @@ const getErrorActions = (error) => {
|
|
|
9486
9501
|
} };
|
|
9487
9502
|
case _copilotkit_shared.CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR: return { primary: {
|
|
9488
9503
|
label: "Upgrade",
|
|
9489
|
-
onClick: () => window.open("https://
|
|
9504
|
+
onClick: () => window.open("https://dashboard.operations.copilotkit.ai", "_blank", "noopener,noreferrer")
|
|
9490
9505
|
} };
|
|
9491
9506
|
default: return;
|
|
9492
9507
|
}
|
|
@@ -11161,4 +11176,4 @@ Object.defineProperty(exports, 'useToast', {
|
|
|
11161
11176
|
return useToast;
|
|
11162
11177
|
}
|
|
11163
11178
|
});
|
|
11164
|
-
//# sourceMappingURL=copilotkit-
|
|
11179
|
+
//# sourceMappingURL=copilotkit-BTHcCAVQ.cjs.map
|