@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
  CopilotSidebar
3
- } from "../../chunk-ECPBML4L.mjs";
4
- import "../../chunk-H5CXJBR5.mjs";
3
+ } from "../../chunk-TKFQ7VQR.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";
@@ -87,7 +87,7 @@ __export(chat_exports, {
87
87
  module.exports = __toCommonJS(chat_exports);
88
88
 
89
89
  // src/components/chat/Modal.tsx
90
- var import_react12 = __toESM(require("react"));
90
+ var import_react13 = __toESM(require("react"));
91
91
 
92
92
  // src/components/chat/ChatContext.tsx
93
93
  var import_react = __toESM(require("react"));
@@ -1666,7 +1666,7 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
1666
1666
  });
1667
1667
 
1668
1668
  // src/components/chat/Chat.tsx
1669
- var import_react11 = __toESM(require("react"));
1669
+ var import_react12 = __toESM(require("react"));
1670
1670
  var import_react_core8 = require("@copilotkit/react-core");
1671
1671
  var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
1672
1672
  var import_shared3 = require("@copilotkit/shared");
@@ -1805,7 +1805,7 @@ function logMessages(context) {
1805
1805
 
1806
1806
  // src/components/dev-console/console.tsx
1807
1807
  var import_react_core7 = require("@copilotkit/react-core");
1808
- var import_react9 = require("react");
1808
+ var import_react10 = require("react");
1809
1809
 
1810
1810
  // src/components/dev-console/icons.tsx
1811
1811
  var import_jsx_runtime17 = require("react/jsx-runtime");
@@ -1892,21 +1892,128 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1892
1892
  );
1893
1893
 
1894
1894
  // src/components/dev-console/console.tsx
1895
- var import_react10 = require("@headlessui/react");
1895
+ var import_react11 = require("@headlessui/react");
1896
1896
  var import_shared2 = require("@copilotkit/shared");
1897
+
1898
+ // src/components/help-modal/modal.tsx
1899
+ var import_react9 = require("react");
1900
+
1901
+ // src/components/help-modal/icons.tsx
1897
1902
  var import_jsx_runtime18 = require("react/jsx-runtime");
1903
+ var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1904
+ "svg",
1905
+ {
1906
+ xmlns: "http://www.w3.org/2000/svg",
1907
+ width: "24",
1908
+ height: "24",
1909
+ viewBox: "0 0 24 24",
1910
+ fill: "none",
1911
+ stroke: "currentColor",
1912
+ strokeWidth: "2",
1913
+ strokeLinecap: "round",
1914
+ strokeLinejoin: "round",
1915
+ className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
1916
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { transform: "translate(0, -1)", children: [
1917
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
1918
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
1919
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
1920
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M15 15l3.35 3.35" }),
1921
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 15l-3.35 3.35" }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
1923
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
1924
+ ] })
1925
+ }
1926
+ );
1927
+ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1928
+ "svg",
1929
+ {
1930
+ xmlns: "http://www.w3.org/2000/svg",
1931
+ fill: "none",
1932
+ viewBox: "0 0 24 24",
1933
+ strokeWidth: "1.5",
1934
+ stroke: "currentColor",
1935
+ width: "20",
1936
+ height: "20",
1937
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1938
+ }
1939
+ );
1940
+
1941
+ // src/components/help-modal/modal.tsx
1942
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1943
+ function CopilotKitHelpModal() {
1944
+ const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
1945
+ const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
1946
+ const handleSubmit = () => {
1947
+ setShowHelpModal(false);
1948
+ };
1949
+ const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1950
+ "button",
1951
+ {
1952
+ onClick: () => setShowHelpModal(true),
1953
+ 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",
1954
+ "aria-label": "Open Help",
1955
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
1956
+ }
1957
+ );
1958
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
1959
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
1960
+ showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1961
+ "div",
1962
+ {
1963
+ className: "fixed inset-0 flex items-center justify-center p-4",
1964
+ style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
1965
+ 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: [
1966
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1967
+ "button",
1968
+ {
1969
+ className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
1970
+ style: { top: "10px", right: "10px" },
1971
+ onClick: () => setShowHelpModal(false),
1972
+ "aria-label": "Close",
1973
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon2, {})
1974
+ }
1975
+ ),
1976
+ /* @__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" }) }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
1978
+ /* @__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)(
1979
+ "a",
1980
+ {
1981
+ href: "https://go.copilotkit.ai/dev-console-support-discord",
1982
+ target: "_blank",
1983
+ rel: "noopener noreferrer",
1984
+ children: "Go to Discord Support Channel (Community Support)"
1985
+ }
1986
+ ) }),
1987
+ /* @__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)(
1988
+ "a",
1989
+ {
1990
+ href: "https://go.copilotkit.ai/dev-console-support-slack",
1991
+ target: "_blank",
1992
+ rel: "noopener noreferrer",
1993
+ children: "Apply for Priority Direct Slack Support"
1994
+ }
1995
+ ) })
1996
+ ] })
1997
+ ] })
1998
+ }
1999
+ )
2000
+ ] });
2001
+ }
2002
+
2003
+ // src/components/dev-console/console.tsx
2004
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1898
2005
  function CopilotDevConsole() {
1899
2006
  const currentVersion = import_shared2.COPILOTKIT_VERSION;
1900
2007
  const context = (0, import_react_core7.useCopilotContext)();
1901
- const [showDevConsole, setShowDevConsole] = (0, import_react9.useState)(false);
1902
- (0, import_react9.useEffect)(() => {
2008
+ const [showDevConsole, setShowDevConsole] = (0, import_react10.useState)(false);
2009
+ (0, import_react10.useEffect)(() => {
1903
2010
  setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
1904
2011
  }, [context.showDevConsole]);
1905
- const dontRunTwiceInDevMode = (0, import_react9.useRef)(false);
1906
- const [versionStatus, setVersionStatus] = (0, import_react9.useState)("unknown");
1907
- const [latestVersion, setLatestVersion] = (0, import_react9.useState)("");
1908
- const consoleRef = (0, import_react9.useRef)(null);
1909
- const [debugButtonMode, setDebugButtonMode] = (0, import_react9.useState)("full");
2012
+ const dontRunTwiceInDevMode = (0, import_react10.useRef)(false);
2013
+ const [versionStatus, setVersionStatus] = (0, import_react10.useState)("unknown");
2014
+ const [latestVersion, setLatestVersion] = (0, import_react10.useState)("");
2015
+ const consoleRef = (0, import_react10.useRef)(null);
2016
+ const [debugButtonMode, setDebugButtonMode] = (0, import_react10.useState)("full");
1910
2017
  const checkForUpdates = (force = false) => {
1911
2018
  setVersionStatus("checking");
1912
2019
  getPublishedCopilotKitVersion(currentVersion, force).then((v) => {
@@ -1929,14 +2036,14 @@ function CopilotDevConsole() {
1929
2036
  setVersionStatus("unknown");
1930
2037
  });
1931
2038
  };
1932
- (0, import_react9.useEffect)(() => {
2039
+ (0, import_react10.useEffect)(() => {
1933
2040
  if (dontRunTwiceInDevMode.current === true) {
1934
2041
  return;
1935
2042
  }
1936
2043
  dontRunTwiceInDevMode.current = true;
1937
2044
  checkForUpdates();
1938
2045
  }, []);
1939
- (0, import_react9.useEffect)(() => {
2046
+ (0, import_react10.useEffect)(() => {
1940
2047
  const handleResize = (entries) => {
1941
2048
  for (let entry of entries) {
1942
2049
  if (entry.target === consoleRef.current) {
@@ -1968,14 +2075,14 @@ function CopilotDevConsole() {
1968
2075
  if (!showDevConsole) {
1969
2076
  return null;
1970
2077
  }
1971
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2078
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1972
2079
  "div",
1973
2080
  {
1974
2081
  ref: consoleRef,
1975
2082
  className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
1976
2083
  children: [
1977
- /* @__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 }) }),
1978
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2084
+ /* @__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 }) }),
2085
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1979
2086
  VersionInfo,
1980
2087
  {
1981
2088
  showDevConsole: context.showDevConsole,
@@ -1984,7 +2091,8 @@ function CopilotDevConsole() {
1984
2091
  latestVersion
1985
2092
  }
1986
2093
  ),
1987
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2094
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CopilotKitHelpModal, {}),
2095
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1988
2096
  DebugMenuButton,
1989
2097
  {
1990
2098
  setShowDevConsole,
@@ -2002,7 +2110,7 @@ function VersionInfo({
2002
2110
  currentVersion,
2003
2111
  latestVersion
2004
2112
  }) {
2005
- const [copyStatus, setCopyStatus] = (0, import_react9.useState)("");
2113
+ const [copyStatus, setCopyStatus] = (0, import_react10.useState)("");
2006
2114
  let versionLabel = "";
2007
2115
  let versionIcon = "";
2008
2116
  let currentVersionLabel = currentVersion;
@@ -2039,12 +2147,12 @@ function VersionInfo({
2039
2147
  setTimeout(() => setCopyStatus(""), 1e3);
2040
2148
  });
2041
2149
  };
2042
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "copilotKitVersionInfo", children: [
2043
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { children: [
2150
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copilotKitVersionInfo", children: [
2151
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
2044
2152
  "COPILOTKIT DEV CONSOLE",
2045
- showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("aside", { children: asideLabel })
2153
+ showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("aside", { children: asideLabel })
2046
2154
  ] }),
2047
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { children: [
2155
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { children: [
2048
2156
  "Version: ",
2049
2157
  versionLabel,
2050
2158
  " (",
@@ -2052,7 +2160,7 @@ function VersionInfo({
2052
2160
  ") ",
2053
2161
  versionIcon
2054
2162
  ] }),
2055
- (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 }) })
2163
+ (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 }) })
2056
2164
  ] });
2057
2165
  }
2058
2166
  function DebugMenuButton({
@@ -2062,22 +2170,22 @@ function DebugMenuButton({
2062
2170
  }) {
2063
2171
  const context = (0, import_react_core7.useCopilotContext)();
2064
2172
  const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
2065
- 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: [
2066
- /* @__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: [
2173
+ 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: [
2174
+ /* @__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: [
2067
2175
  "Debug ",
2068
2176
  ChevronDownIcon
2069
2177
  ] }) }),
2070
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2071
- import_react10.MenuItems,
2178
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2179
+ import_react11.MenuItems,
2072
2180
  {
2073
2181
  transition: true,
2074
2182
  anchor: "bottom end",
2075
2183
  className: "copilotKitDebugMenu",
2076
2184
  style: { zIndex: 40 },
2077
2185
  children: [
2078
- /* @__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" }) }),
2079
- /* @__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" }) }),
2080
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2186
+ /* @__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" }) }),
2187
+ /* @__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" }) }),
2188
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2081
2189
  "button",
2082
2190
  {
2083
2191
  className: "copilotKitDebugMenuItem",
@@ -2085,9 +2193,9 @@ function DebugMenuButton({
2085
2193
  children: "Log Messages"
2086
2194
  }
2087
2195
  ) }),
2088
- /* @__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" }) }),
2089
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
2090
- /* @__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" }) })
2196
+ /* @__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" }) }),
2197
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("hr", {}),
2198
+ /* @__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" }) })
2091
2199
  ]
2092
2200
  }
2093
2201
  )
@@ -2095,7 +2203,7 @@ function DebugMenuButton({
2095
2203
  }
2096
2204
 
2097
2205
  // src/components/chat/Chat.tsx
2098
- var import_jsx_runtime19 = require("react/jsx-runtime");
2206
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2099
2207
  function CopilotChat({
2100
2208
  instructions,
2101
2209
  onSubmitMessage,
@@ -2114,7 +2222,7 @@ function CopilotChat({
2114
2222
  labels
2115
2223
  }) {
2116
2224
  const context = (0, import_react_core8.useCopilotContext)();
2117
- (0, import_react11.useEffect)(() => {
2225
+ (0, import_react12.useEffect)(() => {
2118
2226
  context.setChatInstructions(instructions || "");
2119
2227
  }, [instructions]);
2120
2228
  const {
@@ -2125,11 +2233,11 @@ function CopilotChat({
2125
2233
  stopGeneration,
2126
2234
  reloadMessages
2127
2235
  } = useCopilotChatLogic(makeSystemMessage, onInProgress, onSubmitMessage);
2128
- const chatContext = import_react11.default.useContext(ChatContext);
2236
+ const chatContext = import_react12.default.useContext(ChatContext);
2129
2237
  const isVisible = chatContext ? chatContext.open : true;
2130
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
2131
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CopilotDevConsole, {}),
2132
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2238
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
2239
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CopilotDevConsole, {}),
2240
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2133
2241
  Messages2,
2134
2242
  {
2135
2243
  RenderTextMessage: RenderTextMessage2,
@@ -2139,9 +2247,9 @@ function CopilotChat({
2139
2247
  messages: visibleMessages,
2140
2248
  inProgress: isLoading,
2141
2249
  children: [
2142
- currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
2143
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h6", { children: "Suggested:" }),
2144
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2250
+ currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
2251
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h6", { children: "Suggested:" }),
2252
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2145
2253
  Suggestion,
2146
2254
  {
2147
2255
  title: suggestion.title,
@@ -2153,7 +2261,7 @@ function CopilotChat({
2153
2261
  index
2154
2262
  )) })
2155
2263
  ] }),
2156
- showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2264
+ showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2157
2265
  ResponseButton2,
2158
2266
  {
2159
2267
  onClick: isLoading ? stopGeneration : reloadMessages,
@@ -2163,7 +2271,7 @@ function CopilotChat({
2163
2271
  ]
2164
2272
  }
2165
2273
  ),
2166
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
2274
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
2167
2275
  ] });
2168
2276
  }
2169
2277
  function WrappedCopilotChat({
@@ -2172,12 +2280,12 @@ function WrappedCopilotChat({
2172
2280
  labels,
2173
2281
  className
2174
2282
  }) {
2175
- const chatContext = import_react11.default.useContext(ChatContext);
2283
+ const chatContext = import_react12.default.useContext(ChatContext);
2176
2284
  if (!chatContext) {
2177
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
2178
- }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
2285
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
2286
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
2179
2287
  }
2180
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children });
2288
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
2181
2289
  }
2182
2290
  var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
2183
2291
  var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) => {
@@ -2185,9 +2293,9 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2185
2293
  id: (0, import_shared3.randomId)(),
2186
2294
  makeSystemMessage
2187
2295
  });
2188
- const [currentSuggestions, setCurrentSuggestions] = (0, import_react11.useState)([]);
2189
- const suggestionsAbortControllerRef = (0, import_react11.useRef)(null);
2190
- const debounceTimerRef = (0, import_react11.useRef)();
2296
+ const [currentSuggestions, setCurrentSuggestions] = (0, import_react12.useState)([]);
2297
+ const suggestionsAbortControllerRef = (0, import_react12.useRef)(null);
2298
+ const debounceTimerRef = (0, import_react12.useRef)();
2191
2299
  const abortSuggestions = () => {
2192
2300
  var _a;
2193
2301
  (_a = suggestionsAbortControllerRef.current) == null ? void 0 : _a.abort();
@@ -2196,7 +2304,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2196
2304
  const generalContext = (0, import_react_core8.useCopilotContext)();
2197
2305
  const messagesContext = (0, import_react_core8.useCopilotMessagesContext)();
2198
2306
  const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
2199
- (0, import_react11.useEffect)(() => {
2307
+ (0, import_react12.useEffect)(() => {
2200
2308
  onInProgress == null ? void 0 : onInProgress(isLoading);
2201
2309
  abortSuggestions();
2202
2310
  debounceTimerRef.current = setTimeout(
@@ -2245,7 +2353,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2245
2353
  };
2246
2354
 
2247
2355
  // src/components/chat/Modal.tsx
2248
- var import_jsx_runtime20 = require("react/jsx-runtime");
2356
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2249
2357
  var CopilotModal = ({
2250
2358
  instructions,
2251
2359
  defaultOpen = false,
@@ -2268,24 +2376,24 @@ var CopilotModal = ({
2268
2376
  className,
2269
2377
  children
2270
2378
  }) => {
2271
- const [openState, setOpenState] = import_react12.default.useState(defaultOpen);
2379
+ const [openState, setOpenState] = import_react13.default.useState(defaultOpen);
2272
2380
  const setOpen = (open) => {
2273
2381
  onSetOpen == null ? void 0 : onSetOpen(open);
2274
2382
  setOpenState(open);
2275
2383
  };
2276
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
2384
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
2277
2385
  children,
2278
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className, children: [
2279
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button2, {}),
2280
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2386
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className, children: [
2387
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button2, {}),
2388
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2281
2389
  Window2,
2282
2390
  {
2283
2391
  clickOutsideToClose,
2284
2392
  shortcut,
2285
2393
  hitEscapeToClose,
2286
2394
  children: [
2287
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Header2, {}),
2288
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2395
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Header2, {}),
2396
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2289
2397
  CopilotChat,
2290
2398
  {
2291
2399
  instructions,
@@ -2306,22 +2414,22 @@ var CopilotModal = ({
2306
2414
  };
2307
2415
 
2308
2416
  // src/components/chat/Popup.tsx
2309
- var import_jsx_runtime21 = require("react/jsx-runtime");
2417
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2310
2418
  function CopilotPopup(props) {
2311
2419
  props = __spreadProps(__spreadValues({}, props), {
2312
2420
  className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup"
2313
2421
  });
2314
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CopilotModal, __spreadProps(__spreadValues({}, props), { children: props.children }));
2422
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopilotModal, __spreadProps(__spreadValues({}, props), { children: props.children }));
2315
2423
  }
2316
2424
 
2317
2425
  // src/components/chat/Sidebar.tsx
2318
- var import_react13 = require("react");
2319
- var import_jsx_runtime22 = require("react/jsx-runtime");
2426
+ var import_react14 = require("react");
2427
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2320
2428
  function CopilotSidebar(props) {
2321
2429
  props = __spreadProps(__spreadValues({}, props), {
2322
2430
  className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
2323
2431
  });
2324
- const [expandedClassName, setExpandedClassName] = (0, import_react13.useState)(
2432
+ const [expandedClassName, setExpandedClassName] = (0, import_react14.useState)(
2325
2433
  props.defaultOpen ? "sidebarExpanded" : ""
2326
2434
  );
2327
2435
  const onSetOpen = (open) => {
@@ -2329,7 +2437,7 @@ function CopilotSidebar(props) {
2329
2437
  (_a = props.onSetOpen) == null ? void 0 : _a.call(props, open);
2330
2438
  setExpandedClassName(open ? "sidebarExpanded" : "");
2331
2439
  };
2332
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
2440
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
2333
2441
  }
2334
2442
  // Annotate the CommonJS export names for ESM import in node:
2335
2443
  0 && (module.exports = {