@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
|
@@ -76,6 +76,8 @@ const CopilotChatDefaultLabels = {
|
|
|
76
76
|
assistantMessageToolbarCopyCodeLabel: "Copy",
|
|
77
77
|
assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
|
|
78
78
|
assistantMessageToolbarCopyMessageLabel: "Copy",
|
|
79
|
+
assistantMessageToolbarInspectorLabel: "View in Inspector",
|
|
80
|
+
assistantMessageToolbarInspectorLocalOnlyLabel: "Local Only",
|
|
79
81
|
assistantMessageToolbarThumbsUpLabel: "Good response",
|
|
80
82
|
assistantMessageToolbarThumbsDownLabel: "Bad response",
|
|
81
83
|
assistantMessageToolbarReadAloudLabel: "Read aloud",
|
|
@@ -1494,8 +1496,9 @@ function useRenderToolCall() {
|
|
|
1494
1496
|
|
|
1495
1497
|
//#endregion
|
|
1496
1498
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
1497
|
-
const CopilotKitInspector = ({ core, ...rest }) => {
|
|
1499
|
+
const CopilotKitInspector = ({ core, openRequest, ...rest }) => {
|
|
1498
1500
|
const [InspectorComponent, setInspectorComponent] = React$1.useState(null);
|
|
1501
|
+
const inspectorRef = React$1.useRef(null);
|
|
1499
1502
|
React$1.useEffect(() => {
|
|
1500
1503
|
let mounted = true;
|
|
1501
1504
|
import("@copilotkit/web-inspector").then((mod) => {
|
|
@@ -1511,14 +1514,29 @@ const CopilotKitInspector = ({ core, ...rest }) => {
|
|
|
1511
1514
|
mounted = false;
|
|
1512
1515
|
};
|
|
1513
1516
|
}, []);
|
|
1517
|
+
React$1.useEffect(() => {
|
|
1518
|
+
if (openRequest) inspectorRef.current?.openInspector("message_toolbar", openRequest);
|
|
1519
|
+
}, [InspectorComponent, openRequest]);
|
|
1514
1520
|
if (!InspectorComponent) return null;
|
|
1515
1521
|
return /* @__PURE__ */ jsx(InspectorComponent, {
|
|
1522
|
+
ref: inspectorRef,
|
|
1516
1523
|
...rest,
|
|
1517
1524
|
core: core ?? null
|
|
1518
1525
|
});
|
|
1519
1526
|
};
|
|
1520
1527
|
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
1521
1528
|
|
|
1529
|
+
//#endregion
|
|
1530
|
+
//#region src/v2/components/CopilotKitInspectorContext.tsx
|
|
1531
|
+
const CopilotKitInspectorContext = React$1.createContext({
|
|
1532
|
+
isLocalInspectorEnabled: false,
|
|
1533
|
+
openInspector: () => void 0
|
|
1534
|
+
});
|
|
1535
|
+
const CopilotKitInspectorContextProvider = CopilotKitInspectorContext.Provider;
|
|
1536
|
+
function useCopilotKitInspector() {
|
|
1537
|
+
return React$1.useContext(CopilotKitInspectorContext);
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1522
1540
|
//#endregion
|
|
1523
1541
|
//#region src/v2/components/license-warning-banner.tsx
|
|
1524
1542
|
const LICENSE_BANNER_OFFSET_PX = 52;
|
|
@@ -3463,6 +3481,8 @@ function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
|
|
|
3463
3481
|
}
|
|
3464
3482
|
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 }) => {
|
|
3465
3483
|
const [shouldRenderInspector, setShouldRenderInspector] = useState(false);
|
|
3484
|
+
const [isLocalInspectorEnabled, setIsLocalInspectorEnabled] = useState(false);
|
|
3485
|
+
const [inspectorOpenRequest, setInspectorOpenRequest] = useState(null);
|
|
3466
3486
|
const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = useState(false);
|
|
3467
3487
|
const [runtimeOpenGenUIEnabled, setRuntimeOpenGenUIEnabled] = useState(false);
|
|
3468
3488
|
const [catalogToggleVersion, setCatalogToggleVersion] = useState(0);
|
|
@@ -3472,11 +3492,30 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3472
3492
|
const [runtimeLicenseStatus, setRuntimeLicenseStatus] = useState(void 0);
|
|
3473
3493
|
useEffect(() => {
|
|
3474
3494
|
if (typeof window === "undefined") return;
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3495
|
+
const isLocalhost = new Set(["localhost", "127.0.0.1"]).has(window.location?.hostname ?? "");
|
|
3496
|
+
const canShowLocalInspectorAction = process.env.NODE_ENV === "development" && isLocalhost;
|
|
3497
|
+
if (showDevConsole === true) {
|
|
3498
|
+
setShouldRenderInspector(true);
|
|
3499
|
+
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3500
|
+
} else if (showDevConsole === "auto") if (isLocalhost) {
|
|
3501
|
+
setShouldRenderInspector(true);
|
|
3502
|
+
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3503
|
+
} else {
|
|
3504
|
+
setShouldRenderInspector(false);
|
|
3505
|
+
setIsLocalInspectorEnabled(false);
|
|
3506
|
+
}
|
|
3507
|
+
else {
|
|
3508
|
+
setShouldRenderInspector(false);
|
|
3509
|
+
setIsLocalInspectorEnabled(false);
|
|
3510
|
+
}
|
|
3479
3511
|
}, [showDevConsole]);
|
|
3512
|
+
const requestInspectorOpen = useCallback((request) => {
|
|
3513
|
+
setInspectorOpenRequest({ ...request });
|
|
3514
|
+
}, []);
|
|
3515
|
+
const inspectorContextValue = useMemo(() => ({
|
|
3516
|
+
isLocalInspectorEnabled,
|
|
3517
|
+
openInspector: requestInspectorOpen
|
|
3518
|
+
}), [isLocalInspectorEnabled, requestInspectorOpen]);
|
|
3480
3519
|
const renderToolCallsList = useStableArrayProp(renderToolCalls, "renderToolCalls must be a stable array. If you want to dynamically add or remove tools, use `useFrontendTool` instead.", (initial, next) => {
|
|
3481
3520
|
const key = (rc) => `${rc?.agentId ?? ""}:${rc?.name ?? ""}`;
|
|
3482
3521
|
const setFrom = (arr) => new Set(arr.map(key));
|
|
@@ -3813,11 +3852,14 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3813
3852
|
catalog: filteredCatalog,
|
|
3814
3853
|
includeSchema: a2ui?.includeSchema
|
|
3815
3854
|
}),
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3855
|
+
/* @__PURE__ */ jsxs(CopilotKitInspectorContextProvider, {
|
|
3856
|
+
value: inspectorContextValue,
|
|
3857
|
+
children: [children, shouldRenderInspector ? /* @__PURE__ */ jsx(CopilotKitInspector, {
|
|
3858
|
+
core: copilotkit,
|
|
3859
|
+
defaultAnchor: inspectorDefaultAnchor,
|
|
3860
|
+
openRequest: inspectorOpenRequest
|
|
3861
|
+
}) : null]
|
|
3862
|
+
}),
|
|
3821
3863
|
runtimeLicenseStatus === "none" && !resolvedPublicKey && /* @__PURE__ */ jsx(LicenseWarningBanner, { type: "no_license" }),
|
|
3822
3864
|
runtimeLicenseStatus === "expired" && /* @__PURE__ */ jsx(LicenseWarningBanner, { type: "expired" }),
|
|
3823
3865
|
runtimeLicenseStatus === "invalid" && /* @__PURE__ */ jsx(LicenseWarningBanner, { type: "invalid" }),
|
|
@@ -5866,14 +5908,21 @@ function CopilotChatToolCallsView({ message, messages = [] }) {
|
|
|
5866
5908
|
|
|
5867
5909
|
//#endregion
|
|
5868
5910
|
//#region src/v2/components/chat/CopilotChatAssistantMessage.tsx
|
|
5869
|
-
function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible = true, markdownRenderer, toolbar, copyButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }) {
|
|
5911
|
+
function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible = true, markdownRenderer, toolbar, copyButton, inspectorButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }) {
|
|
5870
5912
|
useKatexStyles();
|
|
5913
|
+
const { isLocalInspectorEnabled, openInspector } = useCopilotKitInspector();
|
|
5914
|
+
const chatConfiguration = useCopilotChatConfiguration();
|
|
5871
5915
|
const boundMarkdownRenderer = renderSlot(markdownRenderer, CopilotChatAssistantMessage.MarkdownRenderer, { content: message.content || "" });
|
|
5872
5916
|
const boundCopyButton = renderSlot(copyButton, CopilotChatAssistantMessage.CopyButton, { onClick: async () => {
|
|
5873
5917
|
if (message.content) return await copyToClipboard(message.content);
|
|
5874
5918
|
return false;
|
|
5875
5919
|
} });
|
|
5876
5920
|
const boundThumbsUpButton = renderSlot(thumbsUpButton, CopilotChatAssistantMessage.ThumbsUpButton, { onClick: onThumbsUp ? () => onThumbsUp(message) : void 0 });
|
|
5921
|
+
const boundInspectorButton = renderSlot(inspectorButton, CopilotChatAssistantMessage.InspectorButton, { onClick: () => openInspector({
|
|
5922
|
+
messageId: message.id,
|
|
5923
|
+
threadId: chatConfiguration?.threadId,
|
|
5924
|
+
agentId: chatConfiguration?.agentId
|
|
5925
|
+
}) });
|
|
5877
5926
|
const boundThumbsDownButton = renderSlot(thumbsDownButton, CopilotChatAssistantMessage.ThumbsDownButton, { onClick: onThumbsDown ? () => onThumbsDown(message) : void 0 });
|
|
5878
5927
|
const boundReadAloudButton = renderSlot(readAloudButton, CopilotChatAssistantMessage.ReadAloudButton, { onClick: onReadAloud ? () => onReadAloud(message) : void 0 });
|
|
5879
5928
|
const boundRegenerateButton = renderSlot(regenerateButton, CopilotChatAssistantMessage.RegenerateButton, { onClick: onRegenerate ? () => onRegenerate(message) : void 0 });
|
|
@@ -5881,6 +5930,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5881
5930
|
className: "cpk:flex cpk:items-center cpk:gap-1",
|
|
5882
5931
|
children: [
|
|
5883
5932
|
boundCopyButton,
|
|
5933
|
+
isLocalInspectorEnabled && boundInspectorButton,
|
|
5884
5934
|
(onThumbsUp || thumbsUpButton) && boundThumbsUpButton,
|
|
5885
5935
|
(onThumbsDown || thumbsDownButton) && boundThumbsDownButton,
|
|
5886
5936
|
(onReadAloud || readAloudButton) && boundReadAloudButton,
|
|
@@ -5903,6 +5953,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5903
5953
|
toolbar: boundToolbar,
|
|
5904
5954
|
toolCallsView: boundToolCallsView,
|
|
5905
5955
|
copyButton: boundCopyButton,
|
|
5956
|
+
inspectorButton: boundInspectorButton,
|
|
5906
5957
|
thumbsUpButton: boundThumbsUpButton,
|
|
5907
5958
|
thumbsDownButton: boundThumbsDownButton,
|
|
5908
5959
|
readAloudButton: boundReadAloudButton,
|
|
@@ -5934,6 +5985,110 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5934
5985
|
]
|
|
5935
5986
|
});
|
|
5936
5987
|
}
|
|
5988
|
+
function CopilotKitColoredIcon() {
|
|
5989
|
+
const gradientId = useId().replace(/:/g, "");
|
|
5990
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
5991
|
+
"aria-hidden": "true",
|
|
5992
|
+
className: "cpk:size-5",
|
|
5993
|
+
"data-testid": "copilot-inspector-icon",
|
|
5994
|
+
viewBox: "0 0 24 24",
|
|
5995
|
+
children: [
|
|
5996
|
+
/* @__PURE__ */ jsx("path", {
|
|
5997
|
+
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",
|
|
5998
|
+
fill: `url(#${gradientId}-purple)`
|
|
5999
|
+
}),
|
|
6000
|
+
/* @__PURE__ */ jsx("path", {
|
|
6001
|
+
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",
|
|
6002
|
+
fill: `url(#${gradientId}-blue)`
|
|
6003
|
+
}),
|
|
6004
|
+
/* @__PURE__ */ jsx("path", {
|
|
6005
|
+
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",
|
|
6006
|
+
fill: `url(#${gradientId}-light-blue)`
|
|
6007
|
+
}),
|
|
6008
|
+
/* @__PURE__ */ jsx("path", {
|
|
6009
|
+
className: "cpk:fill-[#513C9F] cpk:dark:fill-[#B99AE8]",
|
|
6010
|
+
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"
|
|
6011
|
+
}),
|
|
6012
|
+
/* @__PURE__ */ jsx("path", {
|
|
6013
|
+
className: "cpk:fill-[#513C9F] cpk:dark:fill-[#B99AE8]",
|
|
6014
|
+
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"
|
|
6015
|
+
}),
|
|
6016
|
+
/* @__PURE__ */ jsx("path", {
|
|
6017
|
+
className: "cpk:fill-[#ABABAB] cpk:dark:fill-[#D4D4D4]",
|
|
6018
|
+
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"
|
|
6019
|
+
}),
|
|
6020
|
+
/* @__PURE__ */ jsx("path", {
|
|
6021
|
+
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",
|
|
6022
|
+
fill: `url(#${gradientId}-tail)`
|
|
6023
|
+
}),
|
|
6024
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
6025
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
6026
|
+
gradientUnits: "userSpaceOnUse",
|
|
6027
|
+
id: `${gradientId}-purple`,
|
|
6028
|
+
x1: "17.852",
|
|
6029
|
+
x2: "14.202",
|
|
6030
|
+
y1: "1.467",
|
|
6031
|
+
y2: "11.504",
|
|
6032
|
+
children: [/* @__PURE__ */ jsx("stop", { className: "cpk:[stop-color:#6430AB] cpk:dark:[stop-color:#B792F0]" }), /* @__PURE__ */ jsx("stop", {
|
|
6033
|
+
className: "cpk:[stop-color:#AA89D8] cpk:dark:[stop-color:#D3BDF7]",
|
|
6034
|
+
offset: "1"
|
|
6035
|
+
})]
|
|
6036
|
+
}),
|
|
6037
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
6038
|
+
gradientUnits: "userSpaceOnUse",
|
|
6039
|
+
id: `${gradientId}-blue`,
|
|
6040
|
+
x1: "15.024",
|
|
6041
|
+
x2: "10.324",
|
|
6042
|
+
y1: "7.125",
|
|
6043
|
+
y2: "16.204",
|
|
6044
|
+
children: [/* @__PURE__ */ jsx("stop", { className: "cpk:[stop-color:#005DBB] cpk:dark:[stop-color:#4D9FEF]" }), /* @__PURE__ */ jsx("stop", {
|
|
6045
|
+
className: "cpk:[stop-color:#3D92E8] cpk:dark:[stop-color:#84C0FA]",
|
|
6046
|
+
offset: "1"
|
|
6047
|
+
})]
|
|
6048
|
+
}),
|
|
6049
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
6050
|
+
gradientUnits: "userSpaceOnUse",
|
|
6051
|
+
id: `${gradientId}-light-blue`,
|
|
6052
|
+
x1: "17.122",
|
|
6053
|
+
x2: "15.707",
|
|
6054
|
+
y1: "1.467",
|
|
6055
|
+
y2: "5.892",
|
|
6056
|
+
children: [/* @__PURE__ */ jsx("stop", { className: "cpk:[stop-color:#1B70C4] cpk:dark:[stop-color:#61ACF2]" }), /* @__PURE__ */ jsx("stop", {
|
|
6057
|
+
className: "cpk:[stop-color:#54A4F2] cpk:dark:[stop-color:#9ACDFF]",
|
|
6058
|
+
offset: "1"
|
|
6059
|
+
})]
|
|
6060
|
+
}),
|
|
6061
|
+
/* @__PURE__ */ jsxs("linearGradient", {
|
|
6062
|
+
gradientUnits: "userSpaceOnUse",
|
|
6063
|
+
id: `${gradientId}-tail`,
|
|
6064
|
+
x1: "6.577",
|
|
6065
|
+
x2: "21.506",
|
|
6066
|
+
y1: "21.758",
|
|
6067
|
+
y2: "21.758",
|
|
6068
|
+
children: [
|
|
6069
|
+
/* @__PURE__ */ jsx("stop", { className: "cpk:[stop-color:#4497EA] cpk:dark:[stop-color:#79BCF5]" }),
|
|
6070
|
+
/* @__PURE__ */ jsx("stop", {
|
|
6071
|
+
className: "cpk:[stop-color:#1463B2] cpk:dark:[stop-color:#4594D8]",
|
|
6072
|
+
offset: ".255"
|
|
6073
|
+
}),
|
|
6074
|
+
/* @__PURE__ */ jsx("stop", {
|
|
6075
|
+
className: "cpk:[stop-color:#0A437D] cpk:dark:[stop-color:#347CB7]",
|
|
6076
|
+
offset: ".499"
|
|
6077
|
+
}),
|
|
6078
|
+
/* @__PURE__ */ jsx("stop", {
|
|
6079
|
+
className: "cpk:[stop-color:#2476C8] cpk:dark:[stop-color:#58A4E5]",
|
|
6080
|
+
offset: ".667"
|
|
6081
|
+
}),
|
|
6082
|
+
/* @__PURE__ */ jsx("stop", {
|
|
6083
|
+
className: "cpk:[stop-color:#0C549A] cpk:dark:[stop-color:#3C87C7]",
|
|
6084
|
+
offset: ".973"
|
|
6085
|
+
})
|
|
6086
|
+
]
|
|
6087
|
+
})
|
|
6088
|
+
] })
|
|
6089
|
+
]
|
|
6090
|
+
});
|
|
6091
|
+
}
|
|
5937
6092
|
(function(_CopilotChatAssistantMessage) {
|
|
5938
6093
|
_CopilotChatAssistantMessage.MarkdownRenderer = ({ content, className, ...props }) => /* @__PURE__ */ jsx(Streamdown, {
|
|
5939
6094
|
className,
|
|
@@ -5945,7 +6100,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5945
6100
|
className: twMerge("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
|
|
5946
6101
|
...props
|
|
5947
6102
|
});
|
|
5948
|
-
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, children, ...props }) => {
|
|
6103
|
+
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, tooltip, children, ...props }) => {
|
|
5949
6104
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
5950
6105
|
asChild: true,
|
|
5951
6106
|
children: /* @__PURE__ */ jsx(Button, {
|
|
@@ -5957,7 +6112,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5957
6112
|
})
|
|
5958
6113
|
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
5959
6114
|
side: "bottom",
|
|
5960
|
-
children: /* @__PURE__ */ jsx("p", { children: title })
|
|
6115
|
+
children: tooltip ?? /* @__PURE__ */ jsx("p", { children: title })
|
|
5961
6116
|
})] });
|
|
5962
6117
|
};
|
|
5963
6118
|
_CopilotChatAssistantMessage.CopyButton = ({ className, title, onClick, ...props }) => {
|
|
@@ -5990,6 +6145,25 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
5990
6145
|
children: copied ? /* @__PURE__ */ jsx(Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ jsx(Copy, { className: "cpk:size-[18px]" })
|
|
5991
6146
|
});
|
|
5992
6147
|
};
|
|
6148
|
+
_CopilotChatAssistantMessage.InspectorButton = ({ title, ...props }) => {
|
|
6149
|
+
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
6150
|
+
const primaryLabel = title || labels.assistantMessageToolbarInspectorLabel;
|
|
6151
|
+
const localOnlyLabel = labels.assistantMessageToolbarInspectorLocalOnlyLabel;
|
|
6152
|
+
const accessibleLabel = `${primaryLabel} (${localOnlyLabel})`;
|
|
6153
|
+
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
6154
|
+
"data-testid": "copilot-inspector-button",
|
|
6155
|
+
title: accessibleLabel,
|
|
6156
|
+
tooltip: /* @__PURE__ */ jsxs("div", {
|
|
6157
|
+
className: "cpk:flex cpk:flex-col cpk:gap-0.5",
|
|
6158
|
+
children: [/* @__PURE__ */ jsx("span", { children: primaryLabel }), /* @__PURE__ */ jsx("span", {
|
|
6159
|
+
className: "cpk:text-[10px] cpk:opacity-65",
|
|
6160
|
+
children: localOnlyLabel
|
|
6161
|
+
})]
|
|
6162
|
+
}),
|
|
6163
|
+
...props,
|
|
6164
|
+
children: /* @__PURE__ */ jsx(CopilotKitColoredIcon, {})
|
|
6165
|
+
});
|
|
6166
|
+
};
|
|
5993
6167
|
_CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
|
|
5994
6168
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
|
|
5995
6169
|
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
@@ -6030,6 +6204,7 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp,
|
|
|
6030
6204
|
CopilotChatAssistantMessage.MarkdownRenderer.displayName = "CopilotChatAssistantMessage.MarkdownRenderer";
|
|
6031
6205
|
CopilotChatAssistantMessage.Toolbar.displayName = "CopilotChatAssistantMessage.Toolbar";
|
|
6032
6206
|
CopilotChatAssistantMessage.CopyButton.displayName = "CopilotChatAssistantMessage.CopyButton";
|
|
6207
|
+
CopilotChatAssistantMessage.InspectorButton.displayName = "CopilotChatAssistantMessage.InspectorButton";
|
|
6033
6208
|
CopilotChatAssistantMessage.ThumbsUpButton.displayName = "CopilotChatAssistantMessage.ThumbsUpButton";
|
|
6034
6209
|
CopilotChatAssistantMessage.ThumbsDownButton.displayName = "CopilotChatAssistantMessage.ThumbsDownButton";
|
|
6035
6210
|
CopilotChatAssistantMessage.ReadAloudButton.displayName = "CopilotChatAssistantMessage.ReadAloudButton";
|
|
@@ -8131,7 +8306,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8131
8306
|
const providedThreadId = threadId ?? existingConfig?.threadId;
|
|
8132
8307
|
const resolvedThreadId = useMemo(() => providedThreadId ?? randomUUID$1(), [providedThreadId]);
|
|
8133
8308
|
const hasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
|
|
8134
|
-
const { agent } = useAgent({
|
|
8309
|
+
const { agent, isReady } = useAgent({
|
|
8135
8310
|
agentId: resolvedAgentId,
|
|
8136
8311
|
throttleMs
|
|
8137
8312
|
});
|
|
@@ -8577,8 +8752,8 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8577
8752
|
}, []);
|
|
8578
8753
|
const mergedProps = {
|
|
8579
8754
|
isRunning: agent.isRunning,
|
|
8580
|
-
suggestions: autoSuggestions,
|
|
8581
|
-
onSelectSuggestion: handleSelectSuggestion,
|
|
8755
|
+
suggestions: isReady ? autoSuggestions : [],
|
|
8756
|
+
onSelectSuggestion: isReady ? handleSelectSuggestion : void 0,
|
|
8582
8757
|
suggestionView: stableSuggestionView,
|
|
8583
8758
|
...restProps
|
|
8584
8759
|
};
|
|
@@ -8611,7 +8786,7 @@ function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen,
|
|
|
8611
8786
|
const RenderedChatView = renderSlot(chatView, CopilotChatView, {
|
|
8612
8787
|
...mergedProps,
|
|
8613
8788
|
messages,
|
|
8614
|
-
onSubmitMessage: onSubmitInput,
|
|
8789
|
+
onSubmitMessage: isReady ? onSubmitInput : void 0,
|
|
8615
8790
|
onStop: effectiveStopHandler,
|
|
8616
8791
|
inputMode: effectiveMode,
|
|
8617
8792
|
inputValue,
|
|
@@ -11756,4 +11931,4 @@ function validateProps(props) {
|
|
|
11756
11931
|
|
|
11757
11932
|
//#endregion
|
|
11758
11933
|
export { useCapabilities as $, CopilotChatMessageView as A, CopilotChatAudioRecorder as At, CopilotChatAssistantMessage_default as B, CopilotModalHeader as C, MCPAppsActivityRenderer as Ct, CopilotChat as D, useRenderToolCall as Dt, DefaultOpenIcon as E, CopilotKitInspector as Et, CopilotChatSuggestionView as F, useLearnFromUserActionInCurrentThread as G, useLearningContainersInCurrentThread as H, CopilotChatSuggestionPill as I, useThreads$1 as J, useLearnFromUserAction as K, CopilotChatReasoningMessage_default as L, IntelligenceIndicator as M, useCopilotChatConfiguration as Mt, getIntelligenceTurnAnchors as N, CopilotChatView_default as O, CopilotChatInput_default as Ot, IntelligenceIndicatorView as P, useAgentContext as Q, CopilotChatUserMessage_default as R, CopilotSidebarView as S, MCPAppsActivityContentSchema as St, DefaultCloseIcon as T, ɵrunMcpFollowUp as Tt, useLearningContainers as U, CopilotChatToolCallsView as V, useAttachments as W, useConfigureSuggestions as X, useInterrupt as Y, useSuggestions as Z, WildcardToolCallRender as _, OpenGenerativeUIActivityType as _t, ThreadsProvider as a, useComponent as at, CopilotSidebar as b, SandboxFunctionsContext as bt, CoAgentStateRendersProvider as c, useRenderCustomMessages as ct, shouldShowDevConsole as d, useLicenseContext$1 as dt, UseAgentUpdate as et, useToast as f, CopilotKitCoreReact as ft, useCopilotContext as g, OpenGenerativeUIActivityRenderer as gt, CopilotContext as h, GenerateSandboxedUiArgsSchema as ht, ThreadsContext as i, useRenderTool as it, INTELLIGENCE_TURN_HEAD as j, CopilotChatConfigurationProvider as jt, CopilotChatAttachmentQueue as k, AudioRecorderError as kt, useCoAgentStateRenders as l, CopilotKitProvider as lt, useCopilotMessagesContext as m, createA2UIMessageRenderer as mt, defaultCopilotContextCategories as n, useHumanInTheLoop as nt, useThreads as o, useFrontendTool as ot, CopilotMessagesContext as p, defineToolCallRenderer as pt, useMemories as q, CoAgentStateRenderBridge as r, useDefaultRenderTool as rt, CoAgentStateRendersContext as s, useRenderActivityMessage as st, CopilotKit as t, useAgent as tt, useAsyncCallback as u, useCopilotKit$1 as ut, CopilotThreadsDrawer as v, OpenGenerativeUIContentSchema as vt, CopilotChatToggleButton as w, MCPAppsActivityType as wt, CopilotPopupView as x, useSandboxFunctions as xt, CopilotPopup as y, OpenGenerativeUIToolRenderer as yt, CopilotChatAttachmentRenderer as z };
|
|
11759
|
-
//# sourceMappingURL=copilotkit-
|
|
11934
|
+
//# sourceMappingURL=copilotkit-C4RqjAba.mjs.map
|