@copilotkit/react-ui 1.5.0-tyler-reset-chat.0 → 1.5.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.
- package/CHANGELOG.md +192 -5
- package/dist/{chunk-Z2RXDT7O.mjs → chunk-375NVWZM.mjs} +2 -2
- package/dist/{chunk-OMTPWC7T.mjs → chunk-3E7HY2UN.mjs} +5 -4
- package/dist/chunk-3E7HY2UN.mjs.map +1 -0
- package/dist/{chunk-RKPANT3F.mjs → chunk-7II4YL7R.mjs} +2 -6
- package/dist/chunk-7II4YL7R.mjs.map +1 -0
- package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/{chunk-OI5EKZPO.mjs → chunk-DCNCY2PL.mjs} +13 -6
- package/dist/{chunk-OI5EKZPO.mjs.map → chunk-DCNCY2PL.mjs.map} +1 -1
- package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/{chunk-2B57NCBA.mjs → chunk-F2W5FD7L.mjs} +3 -3
- package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
- package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
- package/dist/chunk-TI7SY2RI.mjs +164 -0
- package/dist/chunk-TI7SY2RI.mjs.map +1 -0
- package/dist/{chunk-B6A6OMIG.mjs → chunk-UWVGLGFQ.mjs} +4 -4
- package/dist/{chunk-RQRK6DEW.mjs → chunk-WSMMTZCM.mjs} +2 -2
- package/dist/components/chat/Chat.js +149 -36
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +8 -8
- package/dist/components/chat/Input.js +7 -2
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Messages.d.ts +3 -3
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +1 -1
- package/dist/components/chat/Modal.js +149 -36
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +9 -9
- package/dist/components/chat/Popup.js +149 -36
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +10 -10
- package/dist/components/chat/Sidebar.js +149 -36
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +10 -10
- package/dist/components/chat/index.js +149 -36
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +11 -11
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -3
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
- package/dist/components/dev-console/console.js +128 -28
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +4 -4
- package/dist/components/dev-console/index.js +128 -28
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +4 -4
- package/dist/components/dev-console/utils.js +1 -1
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +1 -1
- package/dist/components/help-modal/icons.d.ts +4 -1
- package/dist/components/help-modal/icons.js +39 -2
- package/dist/components/help-modal/icons.js.map +1 -1
- package/dist/components/help-modal/icons.mjs +5 -3
- package/dist/components/help-modal/index.js +147 -27
- package/dist/components/help-modal/index.js.map +1 -1
- package/dist/components/help-modal/index.mjs +2 -2
- package/dist/components/help-modal/modal.js +147 -27
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +2 -2
- package/dist/components/index.js +149 -36
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -11
- package/dist/index.js +149 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/package.json +7 -7
- package/src/components/chat/Chat.tsx +9 -2
- package/src/components/chat/Input.tsx +9 -2
- package/src/components/chat/Messages.tsx +2 -9
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +10 -3
- package/src/components/dev-console/utils.ts +1 -1
- package/src/components/help-modal/icons.tsx +28 -0
- package/src/components/help-modal/modal.tsx +102 -29
- package/dist/chunk-4LUMV4YO.mjs.map +0 -1
- package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
- package/dist/chunk-OMTPWC7T.mjs.map +0 -1
- package/dist/chunk-RKPANT3F.mjs.map +0 -1
- package/dist/chunk-WOUWNTAV.mjs +0 -72
- package/dist/chunk-WOUWNTAV.mjs.map +0 -1
- /package/dist/{chunk-Z2RXDT7O.mjs.map → chunk-375NVWZM.mjs.map} +0 -0
- /package/dist/{chunk-2B57NCBA.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
- /package/dist/{chunk-B6A6OMIG.mjs.map → chunk-UWVGLGFQ.mjs.map} +0 -0
- /package/dist/{chunk-RQRK6DEW.mjs.map → chunk-WSMMTZCM.mjs.map} +0 -0
|
@@ -2,38 +2,38 @@ import "../chunk-MMVDU6DF.mjs";
|
|
|
2
2
|
import "../chunk-MRFF7GSQ.mjs";
|
|
3
3
|
import {
|
|
4
4
|
CopilotSidebar
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-WSMMTZCM.mjs";
|
|
6
6
|
import "../chunk-WB3YULQ4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotPopup
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-375NVWZM.mjs";
|
|
10
|
+
import "../chunk-UWVGLGFQ.mjs";
|
|
11
11
|
import "../chunk-YAGE7RCE.mjs";
|
|
12
12
|
import "../chunk-VEC45H6Q.mjs";
|
|
13
13
|
import "../chunk-RQNJNK2W.mjs";
|
|
14
14
|
import {
|
|
15
15
|
CopilotChat
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-DCNCY2PL.mjs";
|
|
17
17
|
import "../chunk-6INMITFA.mjs";
|
|
18
18
|
import "../chunk-RU73BEZM.mjs";
|
|
19
19
|
import "../chunk-V7W6IM2V.mjs";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-3E7HY2UN.mjs";
|
|
21
21
|
import "../chunk-ZABXREBH.mjs";
|
|
22
22
|
import "../chunk-RJCZRKTV.mjs";
|
|
23
23
|
import {
|
|
24
24
|
CopilotDevConsole
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-F2W5FD7L.mjs";
|
|
26
26
|
import {
|
|
27
27
|
shouldShowDevConsole
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-PNQVKBPN.mjs";
|
|
29
29
|
import "../chunk-KXE2JCUH.mjs";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-TI7SY2RI.mjs";
|
|
31
|
+
import "../chunk-BH6PCAAL.mjs";
|
|
32
32
|
import "../chunk-OTPAZXVR.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-EMQEEXUB.mjs";
|
|
34
34
|
import "../chunk-YQFVRDNC.mjs";
|
|
35
35
|
import "../chunk-YQ3D5IQV.mjs";
|
|
36
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-7II4YL7R.mjs";
|
|
37
37
|
import "../chunk-3XAXY2Z3.mjs";
|
|
38
38
|
import {
|
|
39
39
|
useChatContext
|
package/dist/index.js
CHANGED
|
@@ -884,7 +884,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
884
884
|
});
|
|
885
885
|
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
886
886
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
887
|
-
const
|
|
887
|
+
const canSend = () => {
|
|
888
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
889
|
+
};
|
|
890
|
+
const sendDisabled = !canSend();
|
|
888
891
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
889
892
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
890
893
|
Textarea_default,
|
|
@@ -898,7 +901,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
898
901
|
onKeyDown: (event) => {
|
|
899
902
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
900
903
|
event.preventDefault();
|
|
901
|
-
|
|
904
|
+
if (canSend()) {
|
|
905
|
+
send();
|
|
906
|
+
}
|
|
902
907
|
}
|
|
903
908
|
}
|
|
904
909
|
}
|
|
@@ -945,9 +950,9 @@ var import_react7 = require("react");
|
|
|
945
950
|
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
946
951
|
|
|
947
952
|
// src/hooks/use-copy-to-clipboard.tsx
|
|
948
|
-
var
|
|
953
|
+
var React5 = __toESM(require("react"));
|
|
949
954
|
function useCopyToClipboard({ timeout = 2e3 }) {
|
|
950
|
-
const [isCopied, setIsCopied] =
|
|
955
|
+
const [isCopied, setIsCopied] = React5.useState(false);
|
|
951
956
|
const copyToClipboard = (value) => {
|
|
952
957
|
var _a;
|
|
953
958
|
if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
|
|
@@ -1443,8 +1448,8 @@ function RenderActionExecutionMessage(props) {
|
|
|
1443
1448
|
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1444
1449
|
const { icons } = useChatContext();
|
|
1445
1450
|
if (message.isActionExecutionMessage()) {
|
|
1446
|
-
if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
|
|
1447
|
-
const render = chatComponentsCache.current.actions[message.name];
|
|
1451
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1452
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1448
1453
|
if (typeof render === "string") {
|
|
1449
1454
|
if (isCurrentMessage && inProgress) {
|
|
1450
1455
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
@@ -1467,7 +1472,8 @@ function RenderActionExecutionMessage(props) {
|
|
|
1467
1472
|
const toRender = render({
|
|
1468
1473
|
status,
|
|
1469
1474
|
args,
|
|
1470
|
-
result: actionResult
|
|
1475
|
+
result: actionResult,
|
|
1476
|
+
name: message.name
|
|
1471
1477
|
});
|
|
1472
1478
|
if (!toRender && status === "complete") {
|
|
1473
1479
|
return null;
|
|
@@ -1781,7 +1787,7 @@ function logMessages(context) {
|
|
|
1781
1787
|
type: "ActionExecutionMessage",
|
|
1782
1788
|
role: void 0,
|
|
1783
1789
|
name: message.name,
|
|
1784
|
-
scope: message.
|
|
1790
|
+
scope: message.parentMessageId,
|
|
1785
1791
|
content: message.arguments
|
|
1786
1792
|
};
|
|
1787
1793
|
} else if (message.isResultMessage()) {
|
|
@@ -1904,41 +1910,52 @@ var import_react9 = require("react");
|
|
|
1904
1910
|
|
|
1905
1911
|
// src/components/help-modal/icons.tsx
|
|
1906
1912
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1907
|
-
var
|
|
1913
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1908
1914
|
"svg",
|
|
1909
1915
|
{
|
|
1910
1916
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1911
|
-
width: "24",
|
|
1912
|
-
height: "24",
|
|
1913
|
-
viewBox: "0 0 24 24",
|
|
1914
1917
|
fill: "none",
|
|
1918
|
+
viewBox: "0 0 24 24",
|
|
1919
|
+
strokeWidth: "1.5",
|
|
1915
1920
|
stroke: "currentColor",
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
strokeLinejoin: "round",
|
|
1919
|
-
className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
|
|
1920
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { transform: "translate(0, -1)", children: [
|
|
1921
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
1922
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
|
|
1923
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
|
|
1924
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M15 15l3.35 3.35" }),
|
|
1925
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 15l-3.35 3.35" }),
|
|
1926
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
|
|
1927
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
|
|
1928
|
-
] })
|
|
1921
|
+
width: "20",
|
|
1922
|
+
height: "20",
|
|
1923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1929
1924
|
}
|
|
1930
1925
|
);
|
|
1931
|
-
var
|
|
1926
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1932
1927
|
"svg",
|
|
1933
1928
|
{
|
|
1929
|
+
style: {
|
|
1930
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
1931
|
+
color
|
|
1932
|
+
},
|
|
1933
|
+
width: "24",
|
|
1934
|
+
height: "24",
|
|
1934
1935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1935
1936
|
fill: "none",
|
|
1936
1937
|
viewBox: "0 0 24 24",
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1938
|
+
children: [
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1940
|
+
"circle",
|
|
1941
|
+
{
|
|
1942
|
+
style: { opacity: 0.25 },
|
|
1943
|
+
cx: "12",
|
|
1944
|
+
cy: "12",
|
|
1945
|
+
r: "10",
|
|
1946
|
+
stroke: "currentColor",
|
|
1947
|
+
strokeWidth: "4"
|
|
1948
|
+
}
|
|
1949
|
+
),
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1951
|
+
"path",
|
|
1952
|
+
{
|
|
1953
|
+
style: { opacity: 0.75 },
|
|
1954
|
+
fill: "currentColor",
|
|
1955
|
+
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"
|
|
1956
|
+
}
|
|
1957
|
+
)
|
|
1958
|
+
]
|
|
1942
1959
|
}
|
|
1943
1960
|
);
|
|
1944
1961
|
|
|
@@ -1947,18 +1964,52 @@ var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
|
1947
1964
|
function CopilotKitHelpModal() {
|
|
1948
1965
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1949
1966
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1967
|
+
const [email, setEmail] = (0, import_react9.useState)("");
|
|
1968
|
+
const [emailError, setEmailError] = (0, import_react9.useState)("");
|
|
1969
|
+
const [submitting, setSubmitting] = (0, import_react9.useState)(false);
|
|
1970
|
+
const validateEmail = (email2) => {
|
|
1971
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1972
|
+
return re.test(email2);
|
|
1952
1973
|
};
|
|
1974
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
1975
|
+
e.preventDefault();
|
|
1976
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
1977
|
+
setEmailError("Please enter a valid email address");
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
setSubmitting(true);
|
|
1981
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
1982
|
+
method: "POST",
|
|
1983
|
+
headers: {
|
|
1984
|
+
"Content-Type": "application/json"
|
|
1985
|
+
},
|
|
1986
|
+
body: JSON.stringify({
|
|
1987
|
+
event: "oss.dev-console.help",
|
|
1988
|
+
anonymousId: window.crypto.randomUUID(),
|
|
1989
|
+
properties: { email, text: issueDescription },
|
|
1990
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
1991
|
+
})
|
|
1992
|
+
});
|
|
1993
|
+
setEmailError("");
|
|
1994
|
+
setEmail("");
|
|
1995
|
+
setIssueDescription("");
|
|
1996
|
+
setSubmitting(false);
|
|
1997
|
+
setShowHelpModal(false);
|
|
1998
|
+
});
|
|
1953
1999
|
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1954
2000
|
"button",
|
|
1955
2001
|
{
|
|
1956
2002
|
onClick: () => setShowHelpModal(true),
|
|
1957
|
-
|
|
2003
|
+
style: { width: "50px", height: "30px", marginRight: "0.25rem" },
|
|
2004
|
+
className: "text-sm p-0 bg-transparent rounded border border-blue-500",
|
|
1958
2005
|
"aria-label": "Open Help",
|
|
1959
|
-
children:
|
|
2006
|
+
children: "Help"
|
|
1960
2007
|
}
|
|
1961
2008
|
);
|
|
2009
|
+
const submitButtonDisabled = (0, import_react9.useMemo)(
|
|
2010
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2011
|
+
[submitting, emailError, issueDescription]
|
|
2012
|
+
);
|
|
1962
2013
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1963
2014
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HelpButton, {}),
|
|
1964
2015
|
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -1979,6 +2030,15 @@ function CopilotKitHelpModal() {
|
|
|
1979
2030
|
),
|
|
1980
2031
|
/* @__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" }) }),
|
|
1981
2032
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
2033
|
+
/* @__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)(
|
|
2034
|
+
"a",
|
|
2035
|
+
{
|
|
2036
|
+
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
2037
|
+
target: "_blank",
|
|
2038
|
+
rel: "noopener noreferrer",
|
|
2039
|
+
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
2040
|
+
}
|
|
2041
|
+
) }),
|
|
1982
2042
|
/* @__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)(
|
|
1983
2043
|
"a",
|
|
1984
2044
|
{
|
|
@@ -1997,6 +2057,52 @@ function CopilotKitHelpModal() {
|
|
|
1997
2057
|
children: "Apply for Priority Direct Slack Support"
|
|
1998
2058
|
}
|
|
1999
2059
|
) })
|
|
2060
|
+
] }),
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2063
|
+
/* @__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:" }),
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2065
|
+
"textarea",
|
|
2066
|
+
{
|
|
2067
|
+
id: "feedback",
|
|
2068
|
+
rows: 4,
|
|
2069
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
2070
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
2071
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
2072
|
+
value: issueDescription,
|
|
2073
|
+
required: true
|
|
2074
|
+
}
|
|
2075
|
+
)
|
|
2076
|
+
] }),
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2080
|
+
"input",
|
|
2081
|
+
{
|
|
2082
|
+
type: "email",
|
|
2083
|
+
id: "email",
|
|
2084
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
2085
|
+
placeholder: "Enter your email for follow-up",
|
|
2086
|
+
onChange: (e) => {
|
|
2087
|
+
setEmail(e.target.value);
|
|
2088
|
+
setEmailError("");
|
|
2089
|
+
},
|
|
2090
|
+
value: email
|
|
2091
|
+
}
|
|
2092
|
+
),
|
|
2093
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2094
|
+
] }),
|
|
2095
|
+
/* @__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)(
|
|
2096
|
+
"button",
|
|
2097
|
+
{
|
|
2098
|
+
type: "submit",
|
|
2099
|
+
onClick: handleSubmit,
|
|
2100
|
+
disabled: submitButtonDisabled,
|
|
2101
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2102
|
+
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",
|
|
2103
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2104
|
+
}
|
|
2105
|
+
) })
|
|
2000
2106
|
] })
|
|
2001
2107
|
] })
|
|
2002
2108
|
}
|
|
@@ -2308,6 +2414,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2308
2414
|
appendMessage,
|
|
2309
2415
|
reloadMessages: defaultReloadMessages,
|
|
2310
2416
|
stopGeneration: defaultStopGeneration,
|
|
2417
|
+
runChatCompletion,
|
|
2311
2418
|
isLoading
|
|
2312
2419
|
} = (0, import_react_core8.useCopilotChat)({
|
|
2313
2420
|
id: (0, import_shared3.randomId)(),
|
|
@@ -2390,7 +2497,13 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2390
2497
|
});
|
|
2391
2498
|
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2392
2499
|
if (generalContext.agentSession) {
|
|
2393
|
-
yield (0, import_react_core9.runAgent)(
|
|
2500
|
+
yield (0, import_react_core9.runAgent)(
|
|
2501
|
+
generalContext.agentSession.agentName,
|
|
2502
|
+
context,
|
|
2503
|
+
appendMessage,
|
|
2504
|
+
runChatCompletion,
|
|
2505
|
+
hint
|
|
2506
|
+
);
|
|
2394
2507
|
}
|
|
2395
2508
|
});
|
|
2396
2509
|
const stopCurrentAgent = () => {
|