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