@copilotkit/react-ui 1.5.0-tyler-reset-chat.0 → 1.5.1-custom-tag-pre.0

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 (86) hide show
  1. package/CHANGELOG.md +203 -5
  2. package/dist/{chunk-Z2RXDT7O.mjs → chunk-375NVWZM.mjs} +2 -2
  3. package/dist/{chunk-OMTPWC7T.mjs → chunk-3E7HY2UN.mjs} +5 -4
  4. package/dist/chunk-3E7HY2UN.mjs.map +1 -0
  5. package/dist/{chunk-RKPANT3F.mjs → chunk-7II4YL7R.mjs} +2 -6
  6. package/dist/chunk-7II4YL7R.mjs.map +1 -0
  7. package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
  8. package/dist/chunk-BH6PCAAL.mjs.map +1 -0
  9. package/dist/{chunk-OI5EKZPO.mjs → chunk-DCNCY2PL.mjs} +13 -6
  10. package/dist/{chunk-OI5EKZPO.mjs.map → chunk-DCNCY2PL.mjs.map} +1 -1
  11. package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
  12. package/dist/chunk-EMQEEXUB.mjs.map +1 -0
  13. package/dist/{chunk-2B57NCBA.mjs → chunk-F2W5FD7L.mjs} +3 -3
  14. package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
  15. package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
  16. package/dist/chunk-TI7SY2RI.mjs +164 -0
  17. package/dist/chunk-TI7SY2RI.mjs.map +1 -0
  18. package/dist/{chunk-B6A6OMIG.mjs → chunk-UWVGLGFQ.mjs} +4 -4
  19. package/dist/{chunk-RQRK6DEW.mjs → chunk-WSMMTZCM.mjs} +2 -2
  20. package/dist/components/chat/Chat.js +149 -36
  21. package/dist/components/chat/Chat.js.map +1 -1
  22. package/dist/components/chat/Chat.mjs +8 -8
  23. package/dist/components/chat/Input.js +7 -2
  24. package/dist/components/chat/Input.js.map +1 -1
  25. package/dist/components/chat/Input.mjs +1 -1
  26. package/dist/components/chat/Messages.d.ts +3 -3
  27. package/dist/components/chat/Messages.js.map +1 -1
  28. package/dist/components/chat/Messages.mjs +1 -1
  29. package/dist/components/chat/Modal.js +149 -36
  30. package/dist/components/chat/Modal.js.map +1 -1
  31. package/dist/components/chat/Modal.mjs +9 -9
  32. package/dist/components/chat/Popup.js +149 -36
  33. package/dist/components/chat/Popup.js.map +1 -1
  34. package/dist/components/chat/Popup.mjs +10 -10
  35. package/dist/components/chat/Sidebar.js +149 -36
  36. package/dist/components/chat/Sidebar.js.map +1 -1
  37. package/dist/components/chat/Sidebar.mjs +10 -10
  38. package/dist/components/chat/index.js +149 -36
  39. package/dist/components/chat/index.js.map +1 -1
  40. package/dist/components/chat/index.mjs +11 -11
  41. package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -3
  42. package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
  43. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
  44. package/dist/components/dev-console/console.js +128 -28
  45. package/dist/components/dev-console/console.js.map +1 -1
  46. package/dist/components/dev-console/console.mjs +4 -4
  47. package/dist/components/dev-console/index.js +128 -28
  48. package/dist/components/dev-console/index.js.map +1 -1
  49. package/dist/components/dev-console/index.mjs +4 -4
  50. package/dist/components/dev-console/utils.js +1 -1
  51. package/dist/components/dev-console/utils.js.map +1 -1
  52. package/dist/components/dev-console/utils.mjs +1 -1
  53. package/dist/components/help-modal/icons.d.ts +4 -1
  54. package/dist/components/help-modal/icons.js +39 -2
  55. package/dist/components/help-modal/icons.js.map +1 -1
  56. package/dist/components/help-modal/icons.mjs +5 -3
  57. package/dist/components/help-modal/index.js +147 -27
  58. package/dist/components/help-modal/index.js.map +1 -1
  59. package/dist/components/help-modal/index.mjs +2 -2
  60. package/dist/components/help-modal/modal.js +147 -27
  61. package/dist/components/help-modal/modal.js.map +1 -1
  62. package/dist/components/help-modal/modal.mjs +2 -2
  63. package/dist/components/index.js +149 -36
  64. package/dist/components/index.js.map +1 -1
  65. package/dist/components/index.mjs +11 -11
  66. package/dist/index.js +149 -36
  67. package/dist/index.js.map +1 -1
  68. package/dist/index.mjs +11 -11
  69. package/package.json +7 -7
  70. package/src/components/chat/Chat.tsx +9 -2
  71. package/src/components/chat/Input.tsx +9 -2
  72. package/src/components/chat/Messages.tsx +2 -9
  73. package/src/components/chat/messages/RenderActionExecutionMessage.tsx +10 -3
  74. package/src/components/dev-console/utils.ts +1 -1
  75. package/src/components/help-modal/icons.tsx +28 -0
  76. package/src/components/help-modal/modal.tsx +102 -29
  77. package/dist/chunk-4LUMV4YO.mjs.map +0 -1
  78. package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
  79. package/dist/chunk-OMTPWC7T.mjs.map +0 -1
  80. package/dist/chunk-RKPANT3F.mjs.map +0 -1
  81. package/dist/chunk-WOUWNTAV.mjs +0 -72
  82. package/dist/chunk-WOUWNTAV.mjs.map +0 -1
  83. /package/dist/{chunk-Z2RXDT7O.mjs.map → chunk-375NVWZM.mjs.map} +0 -0
  84. /package/dist/{chunk-2B57NCBA.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
  85. /package/dist/{chunk-B6A6OMIG.mjs.map → chunk-UWVGLGFQ.mjs.map} +0 -0
  86. /package/dist/{chunk-RQRK6DEW.mjs.map → chunk-WSMMTZCM.mjs.map} +0 -0
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  CopilotPopup
3
- } from "../../chunk-Z2RXDT7O.mjs";
4
- import "../../chunk-B6A6OMIG.mjs";
3
+ } from "../../chunk-375NVWZM.mjs";
4
+ import "../../chunk-UWVGLGFQ.mjs";
5
5
  import "../../chunk-YAGE7RCE.mjs";
6
6
  import "../../chunk-VEC45H6Q.mjs";
7
7
  import "../../chunk-RQNJNK2W.mjs";
8
- import "../../chunk-OI5EKZPO.mjs";
8
+ import "../../chunk-DCNCY2PL.mjs";
9
9
  import "../../chunk-6INMITFA.mjs";
10
10
  import "../../chunk-RU73BEZM.mjs";
11
11
  import "../../chunk-V7W6IM2V.mjs";
12
- import "../../chunk-OMTPWC7T.mjs";
12
+ import "../../chunk-3E7HY2UN.mjs";
13
13
  import "../../chunk-ZABXREBH.mjs";
14
14
  import "../../chunk-RJCZRKTV.mjs";
15
- import "../../chunk-2B57NCBA.mjs";
16
- import "../../chunk-4FIGRRFS.mjs";
15
+ import "../../chunk-F2W5FD7L.mjs";
16
+ import "../../chunk-PNQVKBPN.mjs";
17
17
  import "../../chunk-KXE2JCUH.mjs";
18
- import "../../chunk-WOUWNTAV.mjs";
19
- import "../../chunk-4T3TMQNJ.mjs";
18
+ import "../../chunk-TI7SY2RI.mjs";
19
+ import "../../chunk-BH6PCAAL.mjs";
20
20
  import "../../chunk-OTPAZXVR.mjs";
21
- import "../../chunk-4LUMV4YO.mjs";
21
+ import "../../chunk-EMQEEXUB.mjs";
22
22
  import "../../chunk-YQFVRDNC.mjs";
23
23
  import "../../chunk-YQ3D5IQV.mjs";
24
- import "../../chunk-RKPANT3F.mjs";
24
+ import "../../chunk-7II4YL7R.mjs";
25
25
  import "../../chunk-3XAXY2Z3.mjs";
26
26
  import "../../chunk-CBBFRI3Q.mjs";
27
27
  import "../../chunk-UPTB2MVO.mjs";
@@ -878,7 +878,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
878
878
  });
879
879
  const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
880
880
  const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
881
- const sendDisabled = inProgress || text.length === 0 || pushToTalkState !== "idle";
881
+ const canSend = () => {
882
+ return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
883
+ };
884
+ const sendDisabled = !canSend();
882
885
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
883
886
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
884
887
  Textarea_default,
@@ -892,7 +895,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
892
895
  onKeyDown: (event) => {
893
896
  if (event.key === "Enter" && !event.shiftKey) {
894
897
  event.preventDefault();
895
- send();
898
+ if (canSend()) {
899
+ send();
900
+ }
896
901
  }
897
902
  }
898
903
  }
@@ -939,9 +944,9 @@ var import_react7 = require("react");
939
944
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
940
945
 
941
946
  // src/hooks/use-copy-to-clipboard.tsx
942
- var React6 = __toESM(require("react"));
947
+ var React5 = __toESM(require("react"));
943
948
  function useCopyToClipboard({ timeout = 2e3 }) {
944
- const [isCopied, setIsCopied] = React6.useState(false);
949
+ const [isCopied, setIsCopied] = React5.useState(false);
945
950
  const copyToClipboard = (value) => {
946
951
  var _a;
947
952
  if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
@@ -1437,8 +1442,8 @@ function RenderActionExecutionMessage(props) {
1437
1442
  const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
1438
1443
  const { icons } = useChatContext();
1439
1444
  if (message.isActionExecutionMessage()) {
1440
- if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
1441
- const render = chatComponentsCache.current.actions[message.name];
1445
+ if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
1446
+ const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
1442
1447
  if (typeof render === "string") {
1443
1448
  if (isCurrentMessage && inProgress) {
1444
1449
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
@@ -1461,7 +1466,8 @@ function RenderActionExecutionMessage(props) {
1461
1466
  const toRender = render({
1462
1467
  status,
1463
1468
  args,
1464
- result: actionResult
1469
+ result: actionResult,
1470
+ name: message.name
1465
1471
  });
1466
1472
  if (!toRender && status === "complete") {
1467
1473
  return null;
@@ -1775,7 +1781,7 @@ function logMessages(context) {
1775
1781
  type: "ActionExecutionMessage",
1776
1782
  role: void 0,
1777
1783
  name: message.name,
1778
- scope: message.scope,
1784
+ scope: message.parentMessageId,
1779
1785
  content: message.arguments
1780
1786
  };
1781
1787
  } else if (message.isResultMessage()) {
@@ -1898,41 +1904,52 @@ var import_react9 = require("react");
1898
1904
 
1899
1905
  // src/components/help-modal/icons.tsx
1900
1906
  var import_jsx_runtime18 = require("react/jsx-runtime");
1901
- var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1907
+ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1902
1908
  "svg",
1903
1909
  {
1904
1910
  xmlns: "http://www.w3.org/2000/svg",
1905
- width: "24",
1906
- height: "24",
1907
- viewBox: "0 0 24 24",
1908
1911
  fill: "none",
1912
+ viewBox: "0 0 24 24",
1913
+ strokeWidth: "1.5",
1909
1914
  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
- ] })
1915
+ width: "20",
1916
+ height: "20",
1917
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1923
1918
  }
1924
1919
  );
1925
- var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1920
+ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1926
1921
  "svg",
1927
1922
  {
1923
+ style: {
1924
+ animation: "copilotKitSpinAnimation 1s linear infinite",
1925
+ color
1926
+ },
1927
+ width: "24",
1928
+ height: "24",
1928
1929
  xmlns: "http://www.w3.org/2000/svg",
1929
1930
  fill: "none",
1930
1931
  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" })
1932
+ children: [
1933
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1934
+ "circle",
1935
+ {
1936
+ style: { opacity: 0.25 },
1937
+ cx: "12",
1938
+ cy: "12",
1939
+ r: "10",
1940
+ stroke: "currentColor",
1941
+ strokeWidth: "4"
1942
+ }
1943
+ ),
1944
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1945
+ "path",
1946
+ {
1947
+ style: { opacity: 0.75 },
1948
+ fill: "currentColor",
1949
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
1950
+ }
1951
+ )
1952
+ ]
1936
1953
  }
1937
1954
  );
1938
1955
 
@@ -1941,18 +1958,52 @@ var import_jsx_runtime19 = require("react/jsx-runtime");
1941
1958
  function CopilotKitHelpModal() {
1942
1959
  const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
1943
1960
  const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
1944
- const handleSubmit = () => {
1945
- setShowHelpModal(false);
1961
+ const [email, setEmail] = (0, import_react9.useState)("");
1962
+ const [emailError, setEmailError] = (0, import_react9.useState)("");
1963
+ const [submitting, setSubmitting] = (0, import_react9.useState)(false);
1964
+ const validateEmail = (email2) => {
1965
+ const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
1966
+ return re.test(email2);
1946
1967
  };
1968
+ const handleSubmit = (e) => __async(this, null, function* () {
1969
+ e.preventDefault();
1970
+ if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
1971
+ setEmailError("Please enter a valid email address");
1972
+ return;
1973
+ }
1974
+ setSubmitting(true);
1975
+ yield fetch("https://api.segment.io/v1/track", {
1976
+ method: "POST",
1977
+ headers: {
1978
+ "Content-Type": "application/json"
1979
+ },
1980
+ body: JSON.stringify({
1981
+ event: "oss.dev-console.help",
1982
+ anonymousId: window.crypto.randomUUID(),
1983
+ properties: { email, text: issueDescription },
1984
+ writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
1985
+ })
1986
+ });
1987
+ setEmailError("");
1988
+ setEmail("");
1989
+ setIssueDescription("");
1990
+ setSubmitting(false);
1991
+ setShowHelpModal(false);
1992
+ });
1947
1993
  const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1948
1994
  "button",
1949
1995
  {
1950
1996
  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",
1997
+ style: { width: "50px", height: "30px", marginRight: "0.25rem" },
1998
+ className: "text-sm p-0 bg-transparent rounded border border-blue-500",
1952
1999
  "aria-label": "Open Help",
1953
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
2000
+ children: "Help"
1954
2001
  }
1955
2002
  );
2003
+ const submitButtonDisabled = (0, import_react9.useMemo)(
2004
+ () => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
2005
+ [submitting, emailError, issueDescription]
2006
+ );
1956
2007
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
1957
2008
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
1958
2009
  showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -1973,6 +2024,15 @@ function CopilotKitHelpModal() {
1973
2024
  ),
1974
2025
  /* @__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
2026
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
2027
+ /* @__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)(
2028
+ "a",
2029
+ {
2030
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
2031
+ target: "_blank",
2032
+ rel: "noopener noreferrer",
2033
+ children: "Visit the Troubleshooting and FAQ section in the docs"
2034
+ }
2035
+ ) }),
1976
2036
  /* @__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
2037
  "a",
1978
2038
  {
@@ -1991,6 +2051,52 @@ function CopilotKitHelpModal() {
1991
2051
  children: "Apply for Priority Direct Slack Support"
1992
2052
  }
1993
2053
  ) })
2054
+ ] }),
2055
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
2056
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
2057
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
2058
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2059
+ "textarea",
2060
+ {
2061
+ id: "feedback",
2062
+ rows: 4,
2063
+ className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
2064
+ placeholder: "A Loom link / screen recording is always great!",
2065
+ onChange: (e) => setIssueDescription(e.target.value),
2066
+ value: issueDescription,
2067
+ required: true
2068
+ }
2069
+ )
2070
+ ] }),
2071
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
2072
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
2073
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2074
+ "input",
2075
+ {
2076
+ type: "email",
2077
+ id: "email",
2078
+ className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
2079
+ placeholder: "Enter your email for follow-up",
2080
+ onChange: (e) => {
2081
+ setEmail(e.target.value);
2082
+ setEmailError("");
2083
+ },
2084
+ value: email
2085
+ }
2086
+ ),
2087
+ emailError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
2088
+ ] }),
2089
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2090
+ "button",
2091
+ {
2092
+ type: "submit",
2093
+ onClick: handleSubmit,
2094
+ disabled: submitButtonDisabled,
2095
+ style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
2096
+ className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none",
2097
+ children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
2098
+ }
2099
+ ) })
1994
2100
  ] })
1995
2101
  ] })
1996
2102
  }
@@ -2302,6 +2408,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
2302
2408
  appendMessage,
2303
2409
  reloadMessages: defaultReloadMessages,
2304
2410
  stopGeneration: defaultStopGeneration,
2411
+ runChatCompletion,
2305
2412
  isLoading
2306
2413
  } = (0, import_react_core8.useCopilotChat)({
2307
2414
  id: (0, import_shared3.randomId)(),
@@ -2384,7 +2491,13 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
2384
2491
  });
2385
2492
  const runCurrentAgent = (hint) => __async(void 0, null, function* () {
2386
2493
  if (generalContext.agentSession) {
2387
- yield (0, import_react_core9.runAgent)(generalContext.agentSession.agentName, context, appendMessage, hint);
2494
+ yield (0, import_react_core9.runAgent)(
2495
+ generalContext.agentSession.agentName,
2496
+ context,
2497
+ appendMessage,
2498
+ runChatCompletion,
2499
+ hint
2500
+ );
2388
2501
  }
2389
2502
  });
2390
2503
  const stopCurrentAgent = () => {