@copilotkit/react-ui 1.4.1-pre.5 → 1.4.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/CHANGELOG.md +65 -0
- package/dist/{chunk-RS6UPR5N.mjs → chunk-2B57NCBA.mjs} +5 -1
- package/dist/chunk-2B57NCBA.mjs.map +1 -0
- package/dist/chunk-4T3TMQNJ.mjs +45 -0
- package/dist/chunk-4T3TMQNJ.mjs.map +1 -0
- package/dist/{chunk-H5CXJBR5.mjs → chunk-63ZKP62F.mjs} +2 -2
- package/dist/{chunk-ORHE7FYT.mjs → chunk-DHGDU64D.mjs} +8 -8
- package/dist/chunk-KXE2JCUH.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/{chunk-ECPBML4L.mjs → chunk-TKFQ7VQR.mjs} +2 -2
- package/dist/{chunk-TSIFZ5N5.mjs → chunk-VYKDFXGS.mjs} +2 -2
- package/dist/chunk-WOUWNTAV.mjs +72 -0
- package/dist/chunk-WOUWNTAV.mjs.map +1 -0
- package/dist/components/chat/Chat.js +159 -51
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +7 -4
- package/dist/components/chat/Modal.js +168 -60
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +8 -5
- package/dist/components/chat/Popup.js +170 -62
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +9 -6
- package/dist/components/chat/Sidebar.js +172 -64
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +9 -6
- package/dist/components/chat/index.js +174 -66
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +10 -7
- package/dist/components/dev-console/console.js +138 -32
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +4 -1
- package/dist/components/dev-console/index.js +138 -32
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +4 -1
- package/dist/components/help-modal/icons.d.ts +6 -0
- package/dist/components/help-modal/icons.js +70 -0
- package/dist/components/help-modal/icons.js.map +1 -0
- package/dist/components/help-modal/icons.mjs +10 -0
- package/dist/components/help-modal/icons.mjs.map +1 -0
- package/dist/components/help-modal/index.d.ts +2 -0
- package/dist/components/help-modal/index.js +135 -0
- package/dist/components/help-modal/index.js.map +1 -0
- package/dist/components/help-modal/index.mjs +10 -0
- package/dist/components/help-modal/index.mjs.map +1 -0
- package/dist/components/help-modal/modal.d.ts +5 -0
- package/dist/components/help-modal/modal.js +133 -0
- package/dist/components/help-modal/modal.js.map +1 -0
- package/dist/components/help-modal/modal.mjs +9 -0
- package/dist/components/help-modal/modal.mjs.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +178 -66
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +18 -9
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +180 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/package.json +7 -7
- package/src/components/dev-console/console.tsx +4 -1
- package/src/components/help-modal/icons.tsx +40 -0
- package/src/components/help-modal/index.tsx +1 -0
- package/src/components/help-modal/modal.tsx +91 -0
- package/src/components/index.ts +1 -0
- package/src/css/markdown.css +5 -0
- package/dist/chunk-JD7BAH7U.mjs +0 -1
- package/dist/chunk-RS6UPR5N.mjs.map +0 -1
- /package/dist/{chunk-H5CXJBR5.mjs.map → chunk-63ZKP62F.mjs.map} +0 -0
- /package/dist/{chunk-ORHE7FYT.mjs.map → chunk-DHGDU64D.mjs.map} +0 -0
- /package/dist/{chunk-JD7BAH7U.mjs.map → chunk-KXE2JCUH.mjs.map} +0 -0
- /package/dist/{chunk-ECPBML4L.mjs.map → chunk-TKFQ7VQR.mjs.map} +0 -0
- /package/dist/{chunk-TSIFZ5N5.mjs.map → chunk-VYKDFXGS.mjs.map} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-63ZKP62F.mjs";
|
|
4
4
|
import "../../chunk-YAGE7RCE.mjs";
|
|
5
5
|
import "../../chunk-VEC45H6Q.mjs";
|
|
6
6
|
import "../../chunk-RQNJNK2W.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-DHGDU64D.mjs";
|
|
8
|
+
import "../../chunk-6INMITFA.mjs";
|
|
9
|
+
import "../../chunk-RU73BEZM.mjs";
|
|
8
10
|
import "../../chunk-V7W6IM2V.mjs";
|
|
9
11
|
import "../../chunk-OMTPWC7T.mjs";
|
|
10
12
|
import "../../chunk-ZABXREBH.mjs";
|
|
11
|
-
import "../../chunk-6INMITFA.mjs";
|
|
12
|
-
import "../../chunk-RU73BEZM.mjs";
|
|
13
13
|
import "../../chunk-RJCZRKTV.mjs";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-2B57NCBA.mjs";
|
|
15
15
|
import "../../chunk-4FIGRRFS.mjs";
|
|
16
|
+
import "../../chunk-KXE2JCUH.mjs";
|
|
17
|
+
import "../../chunk-WOUWNTAV.mjs";
|
|
18
|
+
import "../../chunk-4T3TMQNJ.mjs";
|
|
16
19
|
import "../../chunk-OTPAZXVR.mjs";
|
|
17
20
|
import "../../chunk-4LUMV4YO.mjs";
|
|
18
21
|
import "../../chunk-YQFVRDNC.mjs";
|
|
@@ -84,7 +84,7 @@ __export(Popup_exports, {
|
|
|
84
84
|
module.exports = __toCommonJS(Popup_exports);
|
|
85
85
|
|
|
86
86
|
// src/components/chat/Modal.tsx
|
|
87
|
-
var
|
|
87
|
+
var import_react13 = __toESM(require("react"));
|
|
88
88
|
|
|
89
89
|
// src/components/chat/ChatContext.tsx
|
|
90
90
|
var import_react = __toESM(require("react"));
|
|
@@ -1663,7 +1663,7 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
1663
1663
|
});
|
|
1664
1664
|
|
|
1665
1665
|
// src/components/chat/Chat.tsx
|
|
1666
|
-
var
|
|
1666
|
+
var import_react12 = __toESM(require("react"));
|
|
1667
1667
|
var import_react_core8 = require("@copilotkit/react-core");
|
|
1668
1668
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
1669
1669
|
var import_shared3 = require("@copilotkit/shared");
|
|
@@ -1802,7 +1802,7 @@ function logMessages(context) {
|
|
|
1802
1802
|
|
|
1803
1803
|
// src/components/dev-console/console.tsx
|
|
1804
1804
|
var import_react_core7 = require("@copilotkit/react-core");
|
|
1805
|
-
var
|
|
1805
|
+
var import_react10 = require("react");
|
|
1806
1806
|
|
|
1807
1807
|
// src/components/dev-console/icons.tsx
|
|
1808
1808
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -1889,21 +1889,128 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
|
1889
1889
|
);
|
|
1890
1890
|
|
|
1891
1891
|
// src/components/dev-console/console.tsx
|
|
1892
|
-
var
|
|
1892
|
+
var import_react11 = require("@headlessui/react");
|
|
1893
1893
|
var import_shared2 = require("@copilotkit/shared");
|
|
1894
|
+
|
|
1895
|
+
// src/components/help-modal/modal.tsx
|
|
1896
|
+
var import_react9 = require("react");
|
|
1897
|
+
|
|
1898
|
+
// src/components/help-modal/icons.tsx
|
|
1894
1899
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1900
|
+
var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1901
|
+
"svg",
|
|
1902
|
+
{
|
|
1903
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1904
|
+
width: "24",
|
|
1905
|
+
height: "24",
|
|
1906
|
+
viewBox: "0 0 24 24",
|
|
1907
|
+
fill: "none",
|
|
1908
|
+
stroke: "currentColor",
|
|
1909
|
+
strokeWidth: "2",
|
|
1910
|
+
strokeLinecap: "round",
|
|
1911
|
+
strokeLinejoin: "round",
|
|
1912
|
+
className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
|
|
1913
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { transform: "translate(0, -1)", children: [
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M15 15l3.35 3.35" }),
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 15l-3.35 3.35" }),
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
|
|
1921
|
+
] })
|
|
1922
|
+
}
|
|
1923
|
+
);
|
|
1924
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1925
|
+
"svg",
|
|
1926
|
+
{
|
|
1927
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1928
|
+
fill: "none",
|
|
1929
|
+
viewBox: "0 0 24 24",
|
|
1930
|
+
strokeWidth: "1.5",
|
|
1931
|
+
stroke: "currentColor",
|
|
1932
|
+
width: "20",
|
|
1933
|
+
height: "20",
|
|
1934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1935
|
+
}
|
|
1936
|
+
);
|
|
1937
|
+
|
|
1938
|
+
// src/components/help-modal/modal.tsx
|
|
1939
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1940
|
+
function CopilotKitHelpModal() {
|
|
1941
|
+
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1942
|
+
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
1943
|
+
const handleSubmit = () => {
|
|
1944
|
+
setShowHelpModal(false);
|
|
1945
|
+
};
|
|
1946
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1947
|
+
"button",
|
|
1948
|
+
{
|
|
1949
|
+
onClick: () => setShowHelpModal(true),
|
|
1950
|
+
className: "p-2 bg-transparent rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
1951
|
+
"aria-label": "Open Help",
|
|
1952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
|
|
1953
|
+
}
|
|
1954
|
+
);
|
|
1955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
|
|
1957
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1958
|
+
"div",
|
|
1959
|
+
{
|
|
1960
|
+
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
1961
|
+
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
1962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1964
|
+
"button",
|
|
1965
|
+
{
|
|
1966
|
+
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
1967
|
+
style: { top: "10px", right: "10px" },
|
|
1968
|
+
onClick: () => setShowHelpModal(false),
|
|
1969
|
+
"aria-label": "Close",
|
|
1970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon2, {})
|
|
1971
|
+
}
|
|
1972
|
+
),
|
|
1973
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
1974
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1976
|
+
"a",
|
|
1977
|
+
{
|
|
1978
|
+
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
1979
|
+
target: "_blank",
|
|
1980
|
+
rel: "noopener noreferrer",
|
|
1981
|
+
children: "Go to Discord Support Channel (Community Support)"
|
|
1982
|
+
}
|
|
1983
|
+
) }),
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1985
|
+
"a",
|
|
1986
|
+
{
|
|
1987
|
+
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
1988
|
+
target: "_blank",
|
|
1989
|
+
rel: "noopener noreferrer",
|
|
1990
|
+
children: "Apply for Priority Direct Slack Support"
|
|
1991
|
+
}
|
|
1992
|
+
) })
|
|
1993
|
+
] })
|
|
1994
|
+
] })
|
|
1995
|
+
}
|
|
1996
|
+
)
|
|
1997
|
+
] });
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
// src/components/dev-console/console.tsx
|
|
2001
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1895
2002
|
function CopilotDevConsole() {
|
|
1896
2003
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
1897
2004
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
1898
|
-
const [showDevConsole, setShowDevConsole] = (0,
|
|
1899
|
-
(0,
|
|
2005
|
+
const [showDevConsole, setShowDevConsole] = (0, import_react10.useState)(false);
|
|
2006
|
+
(0, import_react10.useEffect)(() => {
|
|
1900
2007
|
setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
|
|
1901
2008
|
}, [context.showDevConsole]);
|
|
1902
|
-
const dontRunTwiceInDevMode = (0,
|
|
1903
|
-
const [versionStatus, setVersionStatus] = (0,
|
|
1904
|
-
const [latestVersion, setLatestVersion] = (0,
|
|
1905
|
-
const consoleRef = (0,
|
|
1906
|
-
const [debugButtonMode, setDebugButtonMode] = (0,
|
|
2009
|
+
const dontRunTwiceInDevMode = (0, import_react10.useRef)(false);
|
|
2010
|
+
const [versionStatus, setVersionStatus] = (0, import_react10.useState)("unknown");
|
|
2011
|
+
const [latestVersion, setLatestVersion] = (0, import_react10.useState)("");
|
|
2012
|
+
const consoleRef = (0, import_react10.useRef)(null);
|
|
2013
|
+
const [debugButtonMode, setDebugButtonMode] = (0, import_react10.useState)("full");
|
|
1907
2014
|
const checkForUpdates = (force = false) => {
|
|
1908
2015
|
setVersionStatus("checking");
|
|
1909
2016
|
getPublishedCopilotKitVersion(currentVersion, force).then((v) => {
|
|
@@ -1926,14 +2033,14 @@ function CopilotDevConsole() {
|
|
|
1926
2033
|
setVersionStatus("unknown");
|
|
1927
2034
|
});
|
|
1928
2035
|
};
|
|
1929
|
-
(0,
|
|
2036
|
+
(0, import_react10.useEffect)(() => {
|
|
1930
2037
|
if (dontRunTwiceInDevMode.current === true) {
|
|
1931
2038
|
return;
|
|
1932
2039
|
}
|
|
1933
2040
|
dontRunTwiceInDevMode.current = true;
|
|
1934
2041
|
checkForUpdates();
|
|
1935
2042
|
}, []);
|
|
1936
|
-
(0,
|
|
2043
|
+
(0, import_react10.useEffect)(() => {
|
|
1937
2044
|
const handleResize = (entries) => {
|
|
1938
2045
|
for (let entry of entries) {
|
|
1939
2046
|
if (entry.target === consoleRef.current) {
|
|
@@ -1965,14 +2072,14 @@ function CopilotDevConsole() {
|
|
|
1965
2072
|
if (!showDevConsole) {
|
|
1966
2073
|
return null;
|
|
1967
2074
|
}
|
|
1968
|
-
return /* @__PURE__ */ (0,
|
|
2075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1969
2076
|
"div",
|
|
1970
2077
|
{
|
|
1971
2078
|
ref: consoleRef,
|
|
1972
2079
|
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
1973
2080
|
children: [
|
|
1974
|
-
/* @__PURE__ */ (0,
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "copilotKitDevConsoleLogo", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("a", { href: "https://copilotkit.ai", target: "_blank", children: CopilotKitIcon }) }),
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1976
2083
|
VersionInfo,
|
|
1977
2084
|
{
|
|
1978
2085
|
showDevConsole: context.showDevConsole,
|
|
@@ -1981,7 +2088,8 @@ function CopilotDevConsole() {
|
|
|
1981
2088
|
latestVersion
|
|
1982
2089
|
}
|
|
1983
2090
|
),
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
2091
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CopilotKitHelpModal, {}),
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1985
2093
|
DebugMenuButton,
|
|
1986
2094
|
{
|
|
1987
2095
|
setShowDevConsole,
|
|
@@ -1999,7 +2107,7 @@ function VersionInfo({
|
|
|
1999
2107
|
currentVersion,
|
|
2000
2108
|
latestVersion
|
|
2001
2109
|
}) {
|
|
2002
|
-
const [copyStatus, setCopyStatus] = (0,
|
|
2110
|
+
const [copyStatus, setCopyStatus] = (0, import_react10.useState)("");
|
|
2003
2111
|
let versionLabel = "";
|
|
2004
2112
|
let versionIcon = "";
|
|
2005
2113
|
let currentVersionLabel = currentVersion;
|
|
@@ -2036,12 +2144,12 @@ function VersionInfo({
|
|
|
2036
2144
|
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2037
2145
|
});
|
|
2038
2146
|
};
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
2041
2149
|
"COPILOTKIT DEV CONSOLE",
|
|
2042
|
-
showDevConsole === "auto" && /* @__PURE__ */ (0,
|
|
2150
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("aside", { children: asideLabel })
|
|
2043
2151
|
] }),
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { children: [
|
|
2045
2153
|
"Version: ",
|
|
2046
2154
|
versionLabel,
|
|
2047
2155
|
" (",
|
|
@@ -2049,7 +2157,7 @@ function VersionInfo({
|
|
|
2049
2157
|
") ",
|
|
2050
2158
|
versionIcon
|
|
2051
2159
|
] }),
|
|
2052
|
-
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0,
|
|
2160
|
+
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand }) })
|
|
2053
2161
|
] });
|
|
2054
2162
|
}
|
|
2055
2163
|
function DebugMenuButton({
|
|
@@ -2059,22 +2167,22 @@ function DebugMenuButton({
|
|
|
2059
2167
|
}) {
|
|
2060
2168
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
2061
2169
|
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2062
|
-
return /* @__PURE__ */ (0,
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "bg-black top-24 w-52 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react11.Menu, { children: [
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuButton, { className: `copilotKitDebugMenuButton ${mode === "compact" ? "compact" : ""}`, children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2064
2172
|
"Debug ",
|
|
2065
2173
|
ChevronDownIcon
|
|
2066
2174
|
] }) }),
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2068
|
-
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2176
|
+
import_react11.MenuItems,
|
|
2069
2177
|
{
|
|
2070
2178
|
transition: true,
|
|
2071
2179
|
anchor: "bottom end",
|
|
2072
2180
|
className: "copilotKitDebugMenu",
|
|
2073
2181
|
style: { zIndex: 40 },
|
|
2074
2182
|
children: [
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logReadables(context), children: "Log Readables" }) }),
|
|
2184
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logActions(context), children: "Log Actions" }) }),
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2078
2186
|
"button",
|
|
2079
2187
|
{
|
|
2080
2188
|
className: "copilotKitDebugMenuItem",
|
|
@@ -2082,9 +2190,9 @@ function DebugMenuButton({
|
|
|
2082
2190
|
children: "Log Messages"
|
|
2083
2191
|
}
|
|
2084
2192
|
) }),
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => checkForUpdates(true), children: "Check for Updates" }) }),
|
|
2194
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("hr", {}),
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => setShowDevConsole(false), children: "Hide Dev Console" }) })
|
|
2088
2196
|
]
|
|
2089
2197
|
}
|
|
2090
2198
|
)
|
|
@@ -2092,7 +2200,7 @@ function DebugMenuButton({
|
|
|
2092
2200
|
}
|
|
2093
2201
|
|
|
2094
2202
|
// src/components/chat/Chat.tsx
|
|
2095
|
-
var
|
|
2203
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2096
2204
|
function CopilotChat({
|
|
2097
2205
|
instructions,
|
|
2098
2206
|
onSubmitMessage,
|
|
@@ -2111,7 +2219,7 @@ function CopilotChat({
|
|
|
2111
2219
|
labels
|
|
2112
2220
|
}) {
|
|
2113
2221
|
const context = (0, import_react_core8.useCopilotContext)();
|
|
2114
|
-
(0,
|
|
2222
|
+
(0, import_react12.useEffect)(() => {
|
|
2115
2223
|
context.setChatInstructions(instructions || "");
|
|
2116
2224
|
}, [instructions]);
|
|
2117
2225
|
const {
|
|
@@ -2122,11 +2230,11 @@ function CopilotChat({
|
|
|
2122
2230
|
stopGeneration,
|
|
2123
2231
|
reloadMessages
|
|
2124
2232
|
} = useCopilotChatLogic(makeSystemMessage, onInProgress, onSubmitMessage);
|
|
2125
|
-
const chatContext =
|
|
2233
|
+
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2126
2234
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2127
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CopilotDevConsole, {}),
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2130
2238
|
Messages2,
|
|
2131
2239
|
{
|
|
2132
2240
|
RenderTextMessage: RenderTextMessage2,
|
|
@@ -2136,9 +2244,9 @@ function CopilotChat({
|
|
|
2136
2244
|
messages: visibleMessages,
|
|
2137
2245
|
inProgress: isLoading,
|
|
2138
2246
|
children: [
|
|
2139
|
-
currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2247
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h6", { children: "Suggested:" }),
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2142
2250
|
Suggestion,
|
|
2143
2251
|
{
|
|
2144
2252
|
title: suggestion.title,
|
|
@@ -2150,7 +2258,7 @@ function CopilotChat({
|
|
|
2150
2258
|
index
|
|
2151
2259
|
)) })
|
|
2152
2260
|
] }),
|
|
2153
|
-
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0,
|
|
2261
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2154
2262
|
ResponseButton2,
|
|
2155
2263
|
{
|
|
2156
2264
|
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
@@ -2160,7 +2268,7 @@ function CopilotChat({
|
|
|
2160
2268
|
]
|
|
2161
2269
|
}
|
|
2162
2270
|
),
|
|
2163
|
-
/* @__PURE__ */ (0,
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2164
2272
|
] });
|
|
2165
2273
|
}
|
|
2166
2274
|
function WrappedCopilotChat({
|
|
@@ -2169,12 +2277,12 @@ function WrappedCopilotChat({
|
|
|
2169
2277
|
labels,
|
|
2170
2278
|
className
|
|
2171
2279
|
}) {
|
|
2172
|
-
const chatContext =
|
|
2280
|
+
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2173
2281
|
if (!chatContext) {
|
|
2174
|
-
return /* @__PURE__ */ (0,
|
|
2175
|
-
}, children: /* @__PURE__ */ (0,
|
|
2282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2283
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2176
2284
|
}
|
|
2177
|
-
return /* @__PURE__ */ (0,
|
|
2285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
|
|
2178
2286
|
}
|
|
2179
2287
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2180
2288
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) => {
|
|
@@ -2182,9 +2290,9 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2182
2290
|
id: (0, import_shared3.randomId)(),
|
|
2183
2291
|
makeSystemMessage
|
|
2184
2292
|
});
|
|
2185
|
-
const [currentSuggestions, setCurrentSuggestions] = (0,
|
|
2186
|
-
const suggestionsAbortControllerRef = (0,
|
|
2187
|
-
const debounceTimerRef = (0,
|
|
2293
|
+
const [currentSuggestions, setCurrentSuggestions] = (0, import_react12.useState)([]);
|
|
2294
|
+
const suggestionsAbortControllerRef = (0, import_react12.useRef)(null);
|
|
2295
|
+
const debounceTimerRef = (0, import_react12.useRef)();
|
|
2188
2296
|
const abortSuggestions = () => {
|
|
2189
2297
|
var _a;
|
|
2190
2298
|
(_a = suggestionsAbortControllerRef.current) == null ? void 0 : _a.abort();
|
|
@@ -2193,7 +2301,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2193
2301
|
const generalContext = (0, import_react_core8.useCopilotContext)();
|
|
2194
2302
|
const messagesContext = (0, import_react_core8.useCopilotMessagesContext)();
|
|
2195
2303
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
2196
|
-
(0,
|
|
2304
|
+
(0, import_react12.useEffect)(() => {
|
|
2197
2305
|
onInProgress == null ? void 0 : onInProgress(isLoading);
|
|
2198
2306
|
abortSuggestions();
|
|
2199
2307
|
debounceTimerRef.current = setTimeout(
|
|
@@ -2242,7 +2350,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2242
2350
|
};
|
|
2243
2351
|
|
|
2244
2352
|
// src/components/chat/Modal.tsx
|
|
2245
|
-
var
|
|
2353
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2246
2354
|
var CopilotModal = ({
|
|
2247
2355
|
instructions,
|
|
2248
2356
|
defaultOpen = false,
|
|
@@ -2265,24 +2373,24 @@ var CopilotModal = ({
|
|
|
2265
2373
|
className,
|
|
2266
2374
|
children
|
|
2267
2375
|
}) => {
|
|
2268
|
-
const [openState, setOpenState] =
|
|
2376
|
+
const [openState, setOpenState] = import_react13.default.useState(defaultOpen);
|
|
2269
2377
|
const setOpen = (open) => {
|
|
2270
2378
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
2271
2379
|
setOpenState(open);
|
|
2272
2380
|
};
|
|
2273
|
-
return /* @__PURE__ */ (0,
|
|
2381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
2274
2382
|
children,
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className, children: [
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button2, {}),
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2278
2386
|
Window2,
|
|
2279
2387
|
{
|
|
2280
2388
|
clickOutsideToClose,
|
|
2281
2389
|
shortcut,
|
|
2282
2390
|
hitEscapeToClose,
|
|
2283
2391
|
children: [
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2285
|
-
/* @__PURE__ */ (0,
|
|
2392
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Header2, {}),
|
|
2393
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2286
2394
|
CopilotChat,
|
|
2287
2395
|
{
|
|
2288
2396
|
instructions,
|
|
@@ -2303,12 +2411,12 @@ var CopilotModal = ({
|
|
|
2303
2411
|
};
|
|
2304
2412
|
|
|
2305
2413
|
// src/components/chat/Popup.tsx
|
|
2306
|
-
var
|
|
2414
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2307
2415
|
function CopilotPopup(props) {
|
|
2308
2416
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2309
2417
|
className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup"
|
|
2310
2418
|
});
|
|
2311
|
-
return /* @__PURE__ */ (0,
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopilotModal, __spreadProps(__spreadValues({}, props), { children: props.children }));
|
|
2312
2420
|
}
|
|
2313
2421
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2314
2422
|
0 && (module.exports = {
|