@copilotkit/react-core 1.68.1 → 1.68.2
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-BrfN8YeF.d.mts → copilotkit-BUIK5yln.d.mts} +15 -1
- package/dist/copilotkit-BUIK5yln.d.mts.map +1 -0
- package/dist/{copilotkit-8KSSmCH_.cjs → copilotkit-Bocmlr37.cjs} +193 -18
- package/dist/copilotkit-Bocmlr37.cjs.map +1 -0
- package/dist/{copilotkit-Ck0RL8hh.mjs → copilotkit-C4RqjAba.mjs} +193 -18
- package/dist/copilotkit-C4RqjAba.mjs.map +1 -0
- package/dist/{copilotkit-BICg0AyJ.d.cts → copilotkit-DSvKW3SS.d.cts} +15 -1
- package/dist/copilotkit-DSvKW3SS.d.cts.map +1 -0
- package/dist/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +62 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +2 -0
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +2 -0
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +2 -0
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +2 -0
- package/dist/v2/headless.mjs.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 +192 -17
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +7 -7
- package/skills/react-core/SKILL.md +1 -1
- package/dist/copilotkit-8KSSmCH_.cjs.map +0 -1
- package/dist/copilotkit-BICg0AyJ.d.cts.map +0 -1
- package/dist/copilotkit-BrfN8YeF.d.mts.map +0 -1
- package/dist/copilotkit-Ck0RL8hh.mjs.map +0 -1
package/dist/v2/index.umd.js
CHANGED
|
@@ -90,6 +90,8 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
90
90
|
assistantMessageToolbarCopyCodeLabel: "Copy",
|
|
91
91
|
assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
|
|
92
92
|
assistantMessageToolbarCopyMessageLabel: "Copy",
|
|
93
|
+
assistantMessageToolbarInspectorLabel: "View in Inspector",
|
|
94
|
+
assistantMessageToolbarInspectorLocalOnlyLabel: "Local Only",
|
|
93
95
|
assistantMessageToolbarThumbsUpLabel: "Good response",
|
|
94
96
|
assistantMessageToolbarThumbsDownLabel: "Bad response",
|
|
95
97
|
assistantMessageToolbarReadAloudLabel: "Read aloud",
|
|
@@ -1634,8 +1636,9 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1634
1636
|
|
|
1635
1637
|
//#endregion
|
|
1636
1638
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
1637
|
-
const CopilotKitInspector = ({ core, ...rest }) => {
|
|
1639
|
+
const CopilotKitInspector = ({ core, openRequest, ...rest }) => {
|
|
1638
1640
|
const [InspectorComponent, setInspectorComponent] = react.useState(null);
|
|
1641
|
+
const inspectorRef = react.useRef(null);
|
|
1639
1642
|
react.useEffect(() => {
|
|
1640
1643
|
let mounted = true;
|
|
1641
1644
|
import("@copilotkit/web-inspector").then((mod) => {
|
|
@@ -1651,14 +1654,29 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1651
1654
|
mounted = false;
|
|
1652
1655
|
};
|
|
1653
1656
|
}, []);
|
|
1657
|
+
react.useEffect(() => {
|
|
1658
|
+
if (openRequest) inspectorRef.current?.openInspector("message_toolbar", openRequest);
|
|
1659
|
+
}, [InspectorComponent, openRequest]);
|
|
1654
1660
|
if (!InspectorComponent) return null;
|
|
1655
1661
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InspectorComponent, {
|
|
1662
|
+
ref: inspectorRef,
|
|
1656
1663
|
...rest,
|
|
1657
1664
|
core: core ?? null
|
|
1658
1665
|
});
|
|
1659
1666
|
};
|
|
1660
1667
|
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
1661
1668
|
|
|
1669
|
+
//#endregion
|
|
1670
|
+
//#region src/v2/components/CopilotKitInspectorContext.tsx
|
|
1671
|
+
const CopilotKitInspectorContext = react.createContext({
|
|
1672
|
+
isLocalInspectorEnabled: false,
|
|
1673
|
+
openInspector: () => void 0
|
|
1674
|
+
});
|
|
1675
|
+
const CopilotKitInspectorContextProvider = CopilotKitInspectorContext.Provider;
|
|
1676
|
+
function useCopilotKitInspector() {
|
|
1677
|
+
return react.useContext(CopilotKitInspectorContext);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1662
1680
|
//#endregion
|
|
1663
1681
|
//#region src/v2/components/license-warning-banner.tsx
|
|
1664
1682
|
const LICENSE_BANNER_OFFSET_PX = 52;
|
|
@@ -3507,6 +3525,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3507
3525
|
}
|
|
3508
3526
|
const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, showDevConsole = false, useSingleEndpoint, onError, a2ui, defaultThrottleMs, inspectorDefaultAnchor, debug }) => {
|
|
3509
3527
|
const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
|
|
3528
|
+
const [isLocalInspectorEnabled, setIsLocalInspectorEnabled] = (0, react.useState)(false);
|
|
3529
|
+
const [inspectorOpenRequest, setInspectorOpenRequest] = (0, react.useState)(null);
|
|
3510
3530
|
const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
|
|
3511
3531
|
const [runtimeOpenGenUIEnabled, setRuntimeOpenGenUIEnabled] = (0, react.useState)(false);
|
|
3512
3532
|
const [catalogToggleVersion, setCatalogToggleVersion] = (0, react.useState)(0);
|
|
@@ -3516,11 +3536,30 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3516
3536
|
const [runtimeLicenseStatus, setRuntimeLicenseStatus] = (0, react.useState)(void 0);
|
|
3517
3537
|
(0, react.useEffect)(() => {
|
|
3518
3538
|
if (typeof window === "undefined") return;
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3539
|
+
const isLocalhost = new Set(["localhost", "127.0.0.1"]).has(window.location?.hostname ?? "");
|
|
3540
|
+
const canShowLocalInspectorAction = process.env.NODE_ENV === "development" && isLocalhost;
|
|
3541
|
+
if (showDevConsole === true) {
|
|
3542
|
+
setShouldRenderInspector(true);
|
|
3543
|
+
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3544
|
+
} else if (showDevConsole === "auto") if (isLocalhost) {
|
|
3545
|
+
setShouldRenderInspector(true);
|
|
3546
|
+
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3547
|
+
} else {
|
|
3548
|
+
setShouldRenderInspector(false);
|
|
3549
|
+
setIsLocalInspectorEnabled(false);
|
|
3550
|
+
}
|
|
3551
|
+
else {
|
|
3552
|
+
setShouldRenderInspector(false);
|
|
3553
|
+
setIsLocalInspectorEnabled(false);
|
|
3554
|
+
}
|
|
3523
3555
|
}, [showDevConsole]);
|
|
3556
|
+
const requestInspectorOpen = (0, react.useCallback)((request) => {
|
|
3557
|
+
setInspectorOpenRequest({ ...request });
|
|
3558
|
+
}, []);
|
|
3559
|
+
const inspectorContextValue = (0, react.useMemo)(() => ({
|
|
3560
|
+
isLocalInspectorEnabled,
|
|
3561
|
+
openInspector: requestInspectorOpen
|
|
3562
|
+
}), [isLocalInspectorEnabled, requestInspectorOpen]);
|
|
3524
3563
|
const renderToolCallsList = useStableArrayProp(renderToolCalls, "renderToolCalls must be a stable array. If you want to dynamically add or remove tools, use `useFrontendTool` instead.", (initial, next) => {
|
|
3525
3564
|
const key = (rc) => `${rc?.agentId ?? ""}:${rc?.name ?? ""}`;
|
|
3526
3565
|
const setFrom = (arr) => new Set(arr.map(key));
|
|
@@ -3857,11 +3896,14 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3857
3896
|
catalog: filteredCatalog,
|
|
3858
3897
|
includeSchema: a2ui?.includeSchema
|
|
3859
3898
|
}),
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3899
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CopilotKitInspectorContextProvider, {
|
|
3900
|
+
value: inspectorContextValue,
|
|
3901
|
+
children: [children, shouldRenderInspector ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitInspector, {
|
|
3902
|
+
core: copilotkit,
|
|
3903
|
+
defaultAnchor: inspectorDefaultAnchor,
|
|
3904
|
+
openRequest: inspectorOpenRequest
|
|
3905
|
+
}) : null]
|
|
3906
|
+
}),
|
|
3865
3907
|
runtimeLicenseStatus === "none" && !resolvedPublicKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "no_license" }),
|
|
3866
3908
|
runtimeLicenseStatus === "expired" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expired" }),
|
|
3867
3909
|
runtimeLicenseStatus === "invalid" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "invalid" }),
|
|
@@ -5910,14 +5952,21 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5910
5952
|
|
|
5911
5953
|
//#endregion
|
|
5912
5954
|
//#region src/v2/components/chat/CopilotChatAssistantMessage.tsx
|
|
5913
|
-
function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible = true, markdownRenderer, toolbar, copyButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }) {
|
|
5955
|
+
function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible = true, markdownRenderer, toolbar, copyButton, inspectorButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }) {
|
|
5914
5956
|
useKatexStyles();
|
|
5957
|
+
const { isLocalInspectorEnabled, openInspector } = useCopilotKitInspector();
|
|
5958
|
+
const chatConfiguration = useCopilotChatConfiguration();
|
|
5915
5959
|
const boundMarkdownRenderer = renderSlot(markdownRenderer, CopilotChatAssistantMessage.MarkdownRenderer, { content: message.content || "" });
|
|
5916
5960
|
const boundCopyButton = renderSlot(copyButton, CopilotChatAssistantMessage.CopyButton, { onClick: async () => {
|
|
5917
5961
|
if (message.content) return await (0, _copilotkit_shared.copyToClipboard)(message.content);
|
|
5918
5962
|
return false;
|
|
5919
5963
|
} });
|
|
5920
5964
|
const boundThumbsUpButton = renderSlot(thumbsUpButton, CopilotChatAssistantMessage.ThumbsUpButton, { onClick: onThumbsUp ? () => onThumbsUp(message) : void 0 });
|
|
5965
|
+
const boundInspectorButton = renderSlot(inspectorButton, CopilotChatAssistantMessage.InspectorButton, { onClick: () => openInspector({
|
|
5966
|
+
messageId: message.id,
|
|
5967
|
+
threadId: chatConfiguration?.threadId,
|
|
5968
|
+
agentId: chatConfiguration?.agentId
|
|
5969
|
+
}) });
|
|
5921
5970
|
const boundThumbsDownButton = renderSlot(thumbsDownButton, CopilotChatAssistantMessage.ThumbsDownButton, { onClick: onThumbsDown ? () => onThumbsDown(message) : void 0 });
|
|
5922
5971
|
const boundReadAloudButton = renderSlot(readAloudButton, CopilotChatAssistantMessage.ReadAloudButton, { onClick: onReadAloud ? () => onReadAloud(message) : void 0 });
|
|
5923
5972
|
const boundRegenerateButton = renderSlot(regenerateButton, CopilotChatAssistantMessage.RegenerateButton, { onClick: onRegenerate ? () => onRegenerate(message) : void 0 });
|
|
@@ -5925,6 +5974,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5925
5974
|
className: "cpk:flex cpk:items-center cpk:gap-1",
|
|
5926
5975
|
children: [
|
|
5927
5976
|
boundCopyButton,
|
|
5977
|
+
isLocalInspectorEnabled && boundInspectorButton,
|
|
5928
5978
|
(onThumbsUp || thumbsUpButton) && boundThumbsUpButton,
|
|
5929
5979
|
(onThumbsDown || thumbsDownButton) && boundThumbsDownButton,
|
|
5930
5980
|
(onReadAloud || readAloudButton) && boundReadAloudButton,
|
|
@@ -5947,6 +5997,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5947
5997
|
toolbar: boundToolbar,
|
|
5948
5998
|
toolCallsView: boundToolCallsView,
|
|
5949
5999
|
copyButton: boundCopyButton,
|
|
6000
|
+
inspectorButton: boundInspectorButton,
|
|
5950
6001
|
thumbsUpButton: boundThumbsUpButton,
|
|
5951
6002
|
thumbsDownButton: boundThumbsDownButton,
|
|
5952
6003
|
readAloudButton: boundReadAloudButton,
|
|
@@ -5978,6 +6029,110 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5978
6029
|
]
|
|
5979
6030
|
});
|
|
5980
6031
|
}
|
|
6032
|
+
function CopilotKitColoredIcon() {
|
|
6033
|
+
const gradientId = (0, react.useId)().replace(/:/g, "");
|
|
6034
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
6035
|
+
"aria-hidden": "true",
|
|
6036
|
+
className: "cpk:size-5",
|
|
6037
|
+
"data-testid": "copilot-inspector-icon",
|
|
6038
|
+
viewBox: "0 0 24 24",
|
|
6039
|
+
children: [
|
|
6040
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6041
|
+
d: "M8.162 7.758c2.093-2.738 3.831-5.445 4.498-7.63a.093.093 0 01.14-.051c2.324 1.539 6.558 2.552 10.301 2.576a.09.09 0 01.085.124c-1.243 3.158-2.765 8.817-2.823 15.28-.001.095-.135.13-.183.046-2.131-3.729-8.955-8.968-11.982-10.205a.09.09 0 01-.036-.14z",
|
|
6042
|
+
fill: `url(#${gradientId}-purple)`
|
|
6043
|
+
}),
|
|
6044
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6045
|
+
d: "M15.223 6.083A61.492 61.492 0 018.25 7.827c-.045.008-.055.071-.012.089 3.05 1.267 9.84 6.492 11.952 10.206a.017.017 0 00.022.007.018.018 0 00.01-.024l-4.999-12.02z",
|
|
6046
|
+
fill: `url(#${gradientId}-blue)`
|
|
6047
|
+
}),
|
|
6048
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6049
|
+
d: "M12.81.07c2.8 1.528 6.037 2.214 10.33 2.575.028.002.036.039.012.051-.55.282-3.695 1.883-6.03 2.74-.626.23-1.256.443-1.876.64a.028.028 0 01-.033-.016L12.746.128c-.017-.04.027-.078.065-.058z",
|
|
6050
|
+
fill: `url(#${gradientId}-light-blue)`
|
|
6051
|
+
}),
|
|
6052
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6053
|
+
className: "cpk:fill-[#513C9F] cpk:dark:fill-[#B99AE8]",
|
|
6054
|
+
d: "M12.725.075c.046-.019.1.003.119.05l7.514 17.923a.091.091 0 01-.148.1l-.02-.03L12.675.195a.091.091 0 01.049-.12z"
|
|
6055
|
+
}),
|
|
6056
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6057
|
+
className: "cpk:fill-[#513C9F] cpk:dark:fill-[#B99AE8]",
|
|
6058
|
+
d: "M23.06 2.66c.044-.025.1-.01.125.034.025.044.009.1-.035.124v.001l-.008.004-.025.015-.1.054a41.384 41.384 0 01-1.811.92A47.05 47.05 0 0116.33 5.82c-1.954.674-3.97 1.197-5.497 1.552a66.27 66.27 0 01-2.38.507l-.138.026-.036.007h-.01l-.002.002a.091.091 0 11-.033-.18l.016.09-.015-.09h.002l.01-.002.035-.007.137-.025a66.16 66.16 0 002.373-.506c1.524-.354 3.533-.876 5.479-1.547a46.857 46.857 0 006.276-2.709c.166-.087.295-.156.381-.204l.099-.054.024-.014.008-.004z"
|
|
6059
|
+
}),
|
|
6060
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6061
|
+
className: "cpk:fill-[#ABABAB] cpk:dark:fill-[#D4D4D4]",
|
|
6062
|
+
d: "M13.838 2.272a.16.16 0 01.107.2l-2.72 9.055h6.4l.061.013a.16.16 0 010 .295l-.061.013h-6.541L.679 24.099l-.05.04a.16.16 0 01-.194-.245l10.43-12.285 2.773-9.23a.16.16 0 01.2-.107z"
|
|
6063
|
+
}),
|
|
6064
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6065
|
+
d: "M7.809 21.461l-1.232.173c.638 1.69 1.949 2.427 3.514 2.427 3.831 0 2.661-4.334 4.883-4.334 1.61 0 .956 3.513 4.423 3.513 2.116 0 2.326-2.131 1.966-3.048l-.008-.016-.567-.868c-.037-.058-.127-.036-.133.032l-.106 1.053a1.01 1.01 0 00.003.219c.088.727.144 2.491-1.155 2.491-1.37 0-1.7-3.467-4.423-3.467-3.196 0-2.785 4.289-4.747 4.289-1.294 0-2.28-1.46-2.418-2.464z",
|
|
6066
|
+
fill: `url(#${gradientId}-tail)`
|
|
6067
|
+
}),
|
|
6068
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("defs", { children: [
|
|
6069
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("linearGradient", {
|
|
6070
|
+
gradientUnits: "userSpaceOnUse",
|
|
6071
|
+
id: `${gradientId}-purple`,
|
|
6072
|
+
x1: "17.852",
|
|
6073
|
+
x2: "14.202",
|
|
6074
|
+
y1: "1.467",
|
|
6075
|
+
y2: "11.504",
|
|
6076
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", { className: "cpk:[stop-color:#6430AB] cpk:dark:[stop-color:#B792F0]" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6077
|
+
className: "cpk:[stop-color:#AA89D8] cpk:dark:[stop-color:#D3BDF7]",
|
|
6078
|
+
offset: "1"
|
|
6079
|
+
})]
|
|
6080
|
+
}),
|
|
6081
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("linearGradient", {
|
|
6082
|
+
gradientUnits: "userSpaceOnUse",
|
|
6083
|
+
id: `${gradientId}-blue`,
|
|
6084
|
+
x1: "15.024",
|
|
6085
|
+
x2: "10.324",
|
|
6086
|
+
y1: "7.125",
|
|
6087
|
+
y2: "16.204",
|
|
6088
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", { className: "cpk:[stop-color:#005DBB] cpk:dark:[stop-color:#4D9FEF]" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6089
|
+
className: "cpk:[stop-color:#3D92E8] cpk:dark:[stop-color:#84C0FA]",
|
|
6090
|
+
offset: "1"
|
|
6091
|
+
})]
|
|
6092
|
+
}),
|
|
6093
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("linearGradient", {
|
|
6094
|
+
gradientUnits: "userSpaceOnUse",
|
|
6095
|
+
id: `${gradientId}-light-blue`,
|
|
6096
|
+
x1: "17.122",
|
|
6097
|
+
x2: "15.707",
|
|
6098
|
+
y1: "1.467",
|
|
6099
|
+
y2: "5.892",
|
|
6100
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", { className: "cpk:[stop-color:#1B70C4] cpk:dark:[stop-color:#61ACF2]" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6101
|
+
className: "cpk:[stop-color:#54A4F2] cpk:dark:[stop-color:#9ACDFF]",
|
|
6102
|
+
offset: "1"
|
|
6103
|
+
})]
|
|
6104
|
+
}),
|
|
6105
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("linearGradient", {
|
|
6106
|
+
gradientUnits: "userSpaceOnUse",
|
|
6107
|
+
id: `${gradientId}-tail`,
|
|
6108
|
+
x1: "6.577",
|
|
6109
|
+
x2: "21.506",
|
|
6110
|
+
y1: "21.758",
|
|
6111
|
+
y2: "21.758",
|
|
6112
|
+
children: [
|
|
6113
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", { className: "cpk:[stop-color:#4497EA] cpk:dark:[stop-color:#79BCF5]" }),
|
|
6114
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6115
|
+
className: "cpk:[stop-color:#1463B2] cpk:dark:[stop-color:#4594D8]",
|
|
6116
|
+
offset: ".255"
|
|
6117
|
+
}),
|
|
6118
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6119
|
+
className: "cpk:[stop-color:#0A437D] cpk:dark:[stop-color:#347CB7]",
|
|
6120
|
+
offset: ".499"
|
|
6121
|
+
}),
|
|
6122
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6123
|
+
className: "cpk:[stop-color:#2476C8] cpk:dark:[stop-color:#58A4E5]",
|
|
6124
|
+
offset: ".667"
|
|
6125
|
+
}),
|
|
6126
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("stop", {
|
|
6127
|
+
className: "cpk:[stop-color:#0C549A] cpk:dark:[stop-color:#3C87C7]",
|
|
6128
|
+
offset: ".973"
|
|
6129
|
+
})
|
|
6130
|
+
]
|
|
6131
|
+
})
|
|
6132
|
+
] })
|
|
6133
|
+
]
|
|
6134
|
+
});
|
|
6135
|
+
}
|
|
5981
6136
|
(function(_CopilotChatAssistantMessage) {
|
|
5982
6137
|
_CopilotChatAssistantMessage.MarkdownRenderer = ({ content, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.Streamdown, {
|
|
5983
6138
|
className,
|
|
@@ -5989,7 +6144,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5989
6144
|
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
|
|
5990
6145
|
...props
|
|
5991
6146
|
});
|
|
5992
|
-
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, children, ...props }) => {
|
|
6147
|
+
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, children, ...props }) => {
|
|
5993
6148
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipTrigger, {
|
|
5994
6149
|
asChild: true,
|
|
5995
6150
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -6001,7 +6156,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6001
6156
|
})
|
|
6002
6157
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
|
|
6003
6158
|
side: "bottom",
|
|
6004
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: title })
|
|
6159
|
+
children: tooltip ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: title })
|
|
6005
6160
|
})] });
|
|
6006
6161
|
};
|
|
6007
6162
|
_CopilotChatAssistantMessage.CopyButton = ({ className, title, onClick, ...props }) => {
|
|
@@ -6034,6 +6189,25 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6034
6189
|
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
|
|
6035
6190
|
});
|
|
6036
6191
|
};
|
|
6192
|
+
_CopilotChatAssistantMessage.InspectorButton = ({ title, ...props }) => {
|
|
6193
|
+
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
6194
|
+
const primaryLabel = title || labels.assistantMessageToolbarInspectorLabel;
|
|
6195
|
+
const localOnlyLabel = labels.assistantMessageToolbarInspectorLocalOnlyLabel;
|
|
6196
|
+
const accessibleLabel = `${primaryLabel} (${localOnlyLabel})`;
|
|
6197
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
6198
|
+
"data-testid": "copilot-inspector-button",
|
|
6199
|
+
title: accessibleLabel,
|
|
6200
|
+
tooltip: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6201
|
+
className: "cpk:flex cpk:flex-col cpk:gap-0.5",
|
|
6202
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: primaryLabel }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6203
|
+
className: "cpk:text-[10px] cpk:opacity-65",
|
|
6204
|
+
children: localOnlyLabel
|
|
6205
|
+
})]
|
|
6206
|
+
}),
|
|
6207
|
+
...props,
|
|
6208
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitColoredIcon, {})
|
|
6209
|
+
});
|
|
6210
|
+
};
|
|
6037
6211
|
_CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
|
|
6038
6212
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
6039
6213
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
@@ -6074,6 +6248,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
6074
6248
|
CopilotChatAssistantMessage.MarkdownRenderer.displayName = "CopilotChatAssistantMessage.MarkdownRenderer";
|
|
6075
6249
|
CopilotChatAssistantMessage.Toolbar.displayName = "CopilotChatAssistantMessage.Toolbar";
|
|
6076
6250
|
CopilotChatAssistantMessage.CopyButton.displayName = "CopilotChatAssistantMessage.CopyButton";
|
|
6251
|
+
CopilotChatAssistantMessage.InspectorButton.displayName = "CopilotChatAssistantMessage.InspectorButton";
|
|
6077
6252
|
CopilotChatAssistantMessage.ThumbsUpButton.displayName = "CopilotChatAssistantMessage.ThumbsUpButton";
|
|
6078
6253
|
CopilotChatAssistantMessage.ThumbsDownButton.displayName = "CopilotChatAssistantMessage.ThumbsDownButton";
|
|
6079
6254
|
CopilotChatAssistantMessage.ReadAloudButton.displayName = "CopilotChatAssistantMessage.ReadAloudButton";
|
|
@@ -8175,7 +8350,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8175
8350
|
const providedThreadId = threadId ?? existingConfig?.threadId;
|
|
8176
8351
|
const resolvedThreadId = (0, react.useMemo)(() => providedThreadId ?? (0, _copilotkit_shared.randomUUID)(), [providedThreadId]);
|
|
8177
8352
|
const hasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
|
|
8178
|
-
const { agent } = useAgent({
|
|
8353
|
+
const { agent, isReady } = useAgent({
|
|
8179
8354
|
agentId: resolvedAgentId,
|
|
8180
8355
|
throttleMs
|
|
8181
8356
|
});
|
|
@@ -8621,8 +8796,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8621
8796
|
}, []);
|
|
8622
8797
|
const mergedProps = {
|
|
8623
8798
|
isRunning: agent.isRunning,
|
|
8624
|
-
suggestions: autoSuggestions,
|
|
8625
|
-
onSelectSuggestion: handleSelectSuggestion,
|
|
8799
|
+
suggestions: isReady ? autoSuggestions : [],
|
|
8800
|
+
onSelectSuggestion: isReady ? handleSelectSuggestion : void 0,
|
|
8626
8801
|
suggestionView: stableSuggestionView,
|
|
8627
8802
|
...restProps
|
|
8628
8803
|
};
|
|
@@ -8655,7 +8830,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8655
8830
|
const RenderedChatView = renderSlot(chatView, CopilotChatView, {
|
|
8656
8831
|
...mergedProps,
|
|
8657
8832
|
messages,
|
|
8658
|
-
onSubmitMessage: onSubmitInput,
|
|
8833
|
+
onSubmitMessage: isReady ? onSubmitInput : void 0,
|
|
8659
8834
|
onStop: effectiveStopHandler,
|
|
8660
8835
|
inputMode: effectiveMode,
|
|
8661
8836
|
inputValue,
|