@copilotkit/react-core 1.63.2 → 1.63.3-canary.rc-1
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-BE1n5tSI.d.mts.map +1 -1
- package/dist/copilotkit-CXvuYw_F.d.cts.map +1 -1
- package/dist/{copilotkit-CN2JVeH3.mjs → copilotkit-DL0LvmwQ.mjs} +69 -65
- package/dist/copilotkit-DL0LvmwQ.mjs.map +1 -0
- package/dist/{copilotkit-DDVfoiRM.cjs → copilotkit-rYTwMndy.cjs} +71 -67
- package/dist/copilotkit-rYTwMndy.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +5 -48
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +79 -45
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +30 -2
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +19 -3
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +83 -57
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +70 -66
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/dist/copilotkit-CN2JVeH3.mjs.map +0 -1
- package/dist/copilotkit-DDVfoiRM.cjs.map +0 -1
package/dist/v2/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_copilotkit = require('../copilotkit-
|
|
4
|
+
const require_copilotkit = require('../copilotkit-rYTwMndy.cjs');
|
|
5
5
|
require("./index.css");
|
|
6
6
|
let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
|
|
7
7
|
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { $ as useCapabilities, A as CopilotChatMessageView, At as CopilotChatConfigurationProvider, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotKitInspector, D as CopilotChat, Dt as CopilotChatInput_default, E as DefaultOpenIcon, Et as CopilotKitCoreReact, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useThreads, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, Ot as AudioRecorderError, P as IntelligenceIndicatorView, Q as useAgentContext, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as ɵrunMcpFollowUp, T as DefaultCloseIcon, Tt as useCopilotKit, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as SandboxFunctionsContext, at as useComponent, b as CopilotSidebar, bt as MCPAppsActivityRenderer, ct as useRenderCustomMessages, dt as createA2UIMessageRenderer, et as UseAgentUpdate, ft as GenerateSandboxedUiArgsSchema, gt as OpenGenerativeUIToolRenderer, ht as OpenGenerativeUIContentSchema, it as useRenderTool, j as INTELLIGENCE_TURN_HEAD, jt as useCopilotChatConfiguration, k as CopilotChatAttachmentQueue, kt as CopilotChatAudioRecorder, lt as CopilotKitProvider, mt as OpenGenerativeUIActivityType, nt as useHumanInTheLoop, ot as useFrontendTool, pt as OpenGenerativeUIActivityRenderer, q as useMemories, rt as useDefaultRenderTool, st as useRenderActivityMessage, t as CopilotKit, tt as useAgent, ut as defineToolCallRenderer, v as CopilotThreadsDrawer, vt as useSandboxFunctions, w as CopilotChatToggleButton, wt as useRenderToolCall, x as CopilotPopupView, xt as MCPAppsActivityType, y as CopilotPopup, yt as MCPAppsActivityContentSchema, z as CopilotChatAttachmentRenderer } from "../copilotkit-
|
|
3
|
+
import { $ as useCapabilities, A as CopilotChatMessageView, At as CopilotChatConfigurationProvider, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotKitInspector, D as CopilotChat, Dt as CopilotChatInput_default, E as DefaultOpenIcon, Et as CopilotKitCoreReact, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useThreads, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, Ot as AudioRecorderError, P as IntelligenceIndicatorView, Q as useAgentContext, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as ɵrunMcpFollowUp, T as DefaultCloseIcon, Tt as useCopilotKit, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as SandboxFunctionsContext, at as useComponent, b as CopilotSidebar, bt as MCPAppsActivityRenderer, ct as useRenderCustomMessages, dt as createA2UIMessageRenderer, et as UseAgentUpdate, ft as GenerateSandboxedUiArgsSchema, gt as OpenGenerativeUIToolRenderer, ht as OpenGenerativeUIContentSchema, it as useRenderTool, j as INTELLIGENCE_TURN_HEAD, jt as useCopilotChatConfiguration, k as CopilotChatAttachmentQueue, kt as CopilotChatAudioRecorder, lt as CopilotKitProvider, mt as OpenGenerativeUIActivityType, nt as useHumanInTheLoop, ot as useFrontendTool, pt as OpenGenerativeUIActivityRenderer, q as useMemories, rt as useDefaultRenderTool, st as useRenderActivityMessage, t as CopilotKit, tt as useAgent, ut as defineToolCallRenderer, v as CopilotThreadsDrawer, vt as useSandboxFunctions, w as CopilotChatToggleButton, wt as useRenderToolCall, x as CopilotPopupView, xt as MCPAppsActivityType, y as CopilotPopup, yt as MCPAppsActivityContentSchema, z as CopilotChatAttachmentRenderer } from "../copilotkit-DL0LvmwQ.mjs";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
|
|
6
6
|
|
package/dist/v2/index.umd.js
CHANGED
|
@@ -37,7 +37,7 @@ react = __toESM(react);
|
|
|
37
37
|
_radix_ui_react_tooltip = __toESM(_radix_ui_react_tooltip);
|
|
38
38
|
_radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
39
39
|
|
|
40
|
-
//#region src/v2/lib/
|
|
40
|
+
//#region src/v2/lib/shallow-stable-ref.ts
|
|
41
41
|
/**
|
|
42
42
|
* Shallow equality comparison for objects.
|
|
43
43
|
*/
|
|
@@ -77,64 +77,6 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
77
77
|
ref.current = value;
|
|
78
78
|
return ref.current;
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Check if a value is a React component type (function, class, forwardRef, memo, etc.)
|
|
82
|
-
*/
|
|
83
|
-
function isReactComponentType(value) {
|
|
84
|
-
if (typeof value === "function") return true;
|
|
85
|
-
if (value && typeof value === "object" && "$$typeof" in value && !react.default.isValidElement(value)) return true;
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Internal function to render a slot value as a React element (non-memoized).
|
|
90
|
-
*/
|
|
91
|
-
function renderSlotElement(slot, DefaultComponent, props) {
|
|
92
|
-
if (typeof slot === "string") {
|
|
93
|
-
const existingClassName = props.className;
|
|
94
|
-
return react.default.createElement(DefaultComponent, {
|
|
95
|
-
...props,
|
|
96
|
-
className: (0, tailwind_merge.twMerge)(existingClassName, slot)
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
if (isReactComponentType(slot)) return react.default.createElement(slot, props);
|
|
100
|
-
if (slot && typeof slot === "object" && !react.default.isValidElement(slot)) return react.default.createElement(DefaultComponent, {
|
|
101
|
-
...props,
|
|
102
|
-
...slot
|
|
103
|
-
});
|
|
104
|
-
return react.default.createElement(DefaultComponent, props);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Internal memoized wrapper component for renderSlot.
|
|
108
|
-
* Uses forwardRef to support ref forwarding.
|
|
109
|
-
*/
|
|
110
|
-
const MemoizedSlotWrapper = react.default.memo(react.default.forwardRef(function MemoizedSlotWrapper(props, ref) {
|
|
111
|
-
const { $slot, $component, ...rest } = props;
|
|
112
|
-
return renderSlotElement($slot, $component, ref !== null ? {
|
|
113
|
-
...rest,
|
|
114
|
-
ref
|
|
115
|
-
} : rest);
|
|
116
|
-
}), (prev, next) => {
|
|
117
|
-
if (prev.$slot !== next.$slot) return false;
|
|
118
|
-
if (prev.$component !== next.$component) return false;
|
|
119
|
-
const { $slot: _ps, $component: _pc, ...prevRest } = prev;
|
|
120
|
-
const { $slot: _ns, $component: _nc, ...nextRest } = next;
|
|
121
|
-
return shallowEqual(prevRest, nextRest);
|
|
122
|
-
});
|
|
123
|
-
/**
|
|
124
|
-
* Renders a slot value as a memoized React element.
|
|
125
|
-
* Automatically prevents unnecessary re-renders using shallow prop comparison.
|
|
126
|
-
* Supports ref forwarding.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* renderSlot(customInput, CopilotChatInput, { onSubmit: handleSubmit })
|
|
130
|
-
*/
|
|
131
|
-
function renderSlot(slot, DefaultComponent, props) {
|
|
132
|
-
return react.default.createElement(MemoizedSlotWrapper, {
|
|
133
|
-
...props,
|
|
134
|
-
$slot: slot,
|
|
135
|
-
$component: DefaultComponent
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
80
|
|
|
139
81
|
//#endregion
|
|
140
82
|
//#region src/v2/providers/CopilotChatConfigurationProvider.tsx
|
|
@@ -342,9 +284,9 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
342
284
|
|
|
343
285
|
//#endregion
|
|
344
286
|
//#region src/v2/lib/utils.ts
|
|
345
|
-
const twMerge$
|
|
287
|
+
const twMerge$9 = (0, tailwind_merge.extendTailwindMerge)({ prefix: "cpk" });
|
|
346
288
|
function cn(...inputs) {
|
|
347
|
-
return twMerge$
|
|
289
|
+
return twMerge$9((0, clsx.clsx)(inputs));
|
|
348
290
|
}
|
|
349
291
|
|
|
350
292
|
//#endregion
|
|
@@ -438,12 +380,13 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
438
380
|
...props
|
|
439
381
|
}) });
|
|
440
382
|
}
|
|
441
|
-
function TooltipTrigger({ ...props }) {
|
|
383
|
+
const TooltipTrigger = react.forwardRef(function TooltipTrigger({ ...props }, ref) {
|
|
442
384
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Trigger, {
|
|
385
|
+
ref,
|
|
443
386
|
"data-slot": "tooltip-trigger",
|
|
444
387
|
...props
|
|
445
388
|
});
|
|
446
|
-
}
|
|
389
|
+
});
|
|
447
390
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
448
391
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_tooltip.Content, {
|
|
449
392
|
"data-copilotkit": true,
|
|
@@ -463,12 +406,13 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
463
406
|
...props
|
|
464
407
|
});
|
|
465
408
|
}
|
|
466
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
409
|
+
const DropdownMenuTrigger = react.forwardRef(function DropdownMenuTrigger({ ...props }, ref) {
|
|
467
410
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Trigger, {
|
|
411
|
+
ref,
|
|
468
412
|
"data-slot": "dropdown-menu-trigger",
|
|
469
413
|
...props
|
|
470
414
|
});
|
|
471
|
-
}
|
|
415
|
+
});
|
|
472
416
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
473
417
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
474
418
|
"data-copilotkit": true,
|
|
@@ -717,6 +661,67 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
717
661
|
});
|
|
718
662
|
CopilotChatAudioRecorder.displayName = "CopilotChatAudioRecorder";
|
|
719
663
|
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region src/v2/lib/slots.tsx
|
|
666
|
+
/**
|
|
667
|
+
* Check if a value is a React component type (function, class, forwardRef, memo, etc.)
|
|
668
|
+
*/
|
|
669
|
+
function isReactComponentType(value) {
|
|
670
|
+
if (typeof value === "function") return true;
|
|
671
|
+
if (value && typeof value === "object" && "$$typeof" in value && !react.default.isValidElement(value)) return true;
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Internal function to render a slot value as a React element (non-memoized).
|
|
676
|
+
*/
|
|
677
|
+
function renderSlotElement(slot, DefaultComponent, props) {
|
|
678
|
+
if (typeof slot === "string") {
|
|
679
|
+
const existingClassName = props.className;
|
|
680
|
+
return react.default.createElement(DefaultComponent, {
|
|
681
|
+
...props,
|
|
682
|
+
className: (0, tailwind_merge.twMerge)(existingClassName, slot)
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
if (isReactComponentType(slot)) return react.default.createElement(slot, props);
|
|
686
|
+
if (slot && typeof slot === "object" && !react.default.isValidElement(slot)) return react.default.createElement(DefaultComponent, {
|
|
687
|
+
...props,
|
|
688
|
+
...slot
|
|
689
|
+
});
|
|
690
|
+
return react.default.createElement(DefaultComponent, props);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Internal memoized wrapper component for renderSlot.
|
|
694
|
+
* Uses forwardRef to support ref forwarding.
|
|
695
|
+
*/
|
|
696
|
+
const MemoizedSlotWrapper = react.default.memo(react.default.forwardRef(function MemoizedSlotWrapper(props, ref) {
|
|
697
|
+
const { $slot, $component, ...rest } = props;
|
|
698
|
+
return renderSlotElement($slot, $component, ref !== null ? {
|
|
699
|
+
...rest,
|
|
700
|
+
ref
|
|
701
|
+
} : rest);
|
|
702
|
+
}), (prev, next) => {
|
|
703
|
+
if (prev.$slot !== next.$slot) return false;
|
|
704
|
+
if (prev.$component !== next.$component) return false;
|
|
705
|
+
const { $slot: _ps, $component: _pc, ...prevRest } = prev;
|
|
706
|
+
const { $slot: _ns, $component: _nc, ...nextRest } = next;
|
|
707
|
+
return shallowEqual(prevRest, nextRest);
|
|
708
|
+
});
|
|
709
|
+
/**
|
|
710
|
+
* Renders a slot value as a memoized React element.
|
|
711
|
+
* Automatically prevents unnecessary re-renders using shallow prop comparison.
|
|
712
|
+
* Supports ref forwarding.
|
|
713
|
+
*
|
|
714
|
+
* @example
|
|
715
|
+
* renderSlot(customInput, CopilotChatInput, { onSubmit: handleSubmit })
|
|
716
|
+
*/
|
|
717
|
+
function renderSlot(slot, DefaultComponent, props) {
|
|
718
|
+
return react.default.createElement(MemoizedSlotWrapper, {
|
|
719
|
+
...props,
|
|
720
|
+
$slot: slot,
|
|
721
|
+
$component: DefaultComponent
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
|
|
720
725
|
//#endregion
|
|
721
726
|
//#region src/v2/components/chat/CopilotChatInput.tsx
|
|
722
727
|
const SLASH_MENU_MAX_VISIBLE_ITEMS = 5;
|
|
@@ -1070,7 +1075,6 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1070
1075
|
}
|
|
1071
1076
|
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
1072
1077
|
if (window.matchMedia("(max-width: 767px)").matches) {
|
|
1073
|
-
ensureMeasurements();
|
|
1074
1078
|
adjustTextareaHeight();
|
|
1075
1079
|
updateLayout("expanded");
|
|
1076
1080
|
return;
|