@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
@@ -0,0 +1,164 @@
1
+ import {
2
+ CloseIcon,
3
+ LoadingSpinnerIcon
4
+ } from "./chunk-BH6PCAAL.mjs";
5
+ import {
6
+ __async
7
+ } from "./chunk-MRXNTQOX.mjs";
8
+
9
+ // src/components/help-modal/modal.tsx
10
+ import { useMemo, useState } from "react";
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ function CopilotKitHelpModal() {
13
+ const [showHelpModal, setShowHelpModal] = useState(false);
14
+ const [issueDescription, setIssueDescription] = useState("");
15
+ const [email, setEmail] = useState("");
16
+ const [emailError, setEmailError] = useState("");
17
+ const [submitting, setSubmitting] = useState(false);
18
+ const validateEmail = (email2) => {
19
+ const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
20
+ return re.test(email2);
21
+ };
22
+ const handleSubmit = (e) => __async(this, null, function* () {
23
+ e.preventDefault();
24
+ if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
25
+ setEmailError("Please enter a valid email address");
26
+ return;
27
+ }
28
+ setSubmitting(true);
29
+ yield fetch("https://api.segment.io/v1/track", {
30
+ method: "POST",
31
+ headers: {
32
+ "Content-Type": "application/json"
33
+ },
34
+ body: JSON.stringify({
35
+ event: "oss.dev-console.help",
36
+ anonymousId: window.crypto.randomUUID(),
37
+ properties: { email, text: issueDescription },
38
+ writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
39
+ })
40
+ });
41
+ setEmailError("");
42
+ setEmail("");
43
+ setIssueDescription("");
44
+ setSubmitting(false);
45
+ setShowHelpModal(false);
46
+ });
47
+ const HelpButton = () => /* @__PURE__ */ jsx(
48
+ "button",
49
+ {
50
+ onClick: () => setShowHelpModal(true),
51
+ style: { width: "50px", height: "30px", marginRight: "0.25rem" },
52
+ className: "text-sm p-0 bg-transparent rounded border border-blue-500",
53
+ "aria-label": "Open Help",
54
+ children: "Help"
55
+ }
56
+ );
57
+ const submitButtonDisabled = useMemo(
58
+ () => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
59
+ [submitting, emailError, issueDescription]
60
+ );
61
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
62
+ /* @__PURE__ */ jsx(HelpButton, {}),
63
+ showHelpModal && /* @__PURE__ */ jsx(
64
+ "div",
65
+ {
66
+ className: "fixed inset-0 flex items-center justify-center p-4",
67
+ style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
68
+ children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
69
+ /* @__PURE__ */ jsx(
70
+ "button",
71
+ {
72
+ className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
73
+ style: { top: "10px", right: "10px" },
74
+ onClick: () => setShowHelpModal(false),
75
+ "aria-label": "Close",
76
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
80
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-4", children: [
81
+ /* @__PURE__ */ 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__ */ jsx(
82
+ "a",
83
+ {
84
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
85
+ target: "_blank",
86
+ rel: "noopener noreferrer",
87
+ children: "Visit the Troubleshooting and FAQ section in the docs"
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ 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__ */ jsx(
91
+ "a",
92
+ {
93
+ href: "https://go.copilotkit.ai/dev-console-support-discord",
94
+ target: "_blank",
95
+ rel: "noopener noreferrer",
96
+ children: "Go to Discord Support Channel (Community Support)"
97
+ }
98
+ ) }),
99
+ /* @__PURE__ */ 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__ */ jsx(
100
+ "a",
101
+ {
102
+ href: "https://go.copilotkit.ai/dev-console-support-slack",
103
+ target: "_blank",
104
+ rel: "noopener noreferrer",
105
+ children: "Apply for Priority Direct Slack Support"
106
+ }
107
+ ) })
108
+ ] }),
109
+ /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
110
+ /* @__PURE__ */ jsxs("div", { children: [
111
+ /* @__PURE__ */ jsx("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
112
+ /* @__PURE__ */ jsx(
113
+ "textarea",
114
+ {
115
+ id: "feedback",
116
+ rows: 4,
117
+ className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
118
+ placeholder: "A Loom link / screen recording is always great!",
119
+ onChange: (e) => setIssueDescription(e.target.value),
120
+ value: issueDescription,
121
+ required: true
122
+ }
123
+ )
124
+ ] }),
125
+ /* @__PURE__ */ jsxs("div", { children: [
126
+ /* @__PURE__ */ jsx("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
127
+ /* @__PURE__ */ jsx(
128
+ "input",
129
+ {
130
+ type: "email",
131
+ id: "email",
132
+ className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
133
+ placeholder: "Enter your email for follow-up",
134
+ onChange: (e) => {
135
+ setEmail(e.target.value);
136
+ setEmailError("");
137
+ },
138
+ value: email
139
+ }
140
+ ),
141
+ emailError && /* @__PURE__ */ jsx("p", { className: "text-red-500 text-sm mt-1", children: emailError })
142
+ ] }),
143
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ jsx(
144
+ "button",
145
+ {
146
+ type: "submit",
147
+ onClick: handleSubmit,
148
+ disabled: submitButtonDisabled,
149
+ style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
150
+ 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",
151
+ children: submitting ? /* @__PURE__ */ jsx(LoadingSpinnerIcon, { color: "white" }) : "Submit"
152
+ }
153
+ ) })
154
+ ] })
155
+ ] })
156
+ }
157
+ )
158
+ ] });
159
+ }
160
+
161
+ export {
162
+ CopilotKitHelpModal
163
+ };
164
+ //# sourceMappingURL=chunk-TI7SY2RI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/help-modal/modal.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [emailError, setEmailError] = useState(\"\");\n const [submitting, setSubmitting] = useState(false);\n\n const validateEmail = (email: string) => {\n const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return re.test(email);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (email?.length > 0 && !validateEmail(email)) {\n setEmailError(\"Please enter a valid email address\");\n return;\n }\n setSubmitting(true);\n\n await fetch(\"https://api.segment.io/v1/track\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n event: \"oss.dev-console.help\",\n anonymousId: window.crypto.randomUUID(),\n properties: { email, text: issueDescription },\n writeKey: \"q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW\",\n }),\n });\n\n // Reset\n setEmailError(\"\");\n setEmail(\"\");\n setIssueDescription(\"\");\n setSubmitting(false);\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n style={{ width: \"50px\", height: \"30px\", marginRight: \"0.25rem\" }}\n className=\"text-sm p-0 bg-transparent rounded border border-blue-500\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n const submitButtonDisabled = useMemo(\n () => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,\n [submitting, emailError, issueDescription],\n );\n\n return (\n <>\n <HelpButton />\n {showHelpModal && (\n <div\n className=\"fixed inset-0 flex items-center justify-center p-4\"\n style={{ backgroundColor: \"rgba(11, 15, 26, 0.5)\", zIndex: 99 }}\n >\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <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\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <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\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <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\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n <form onSubmit={handleSubmit} className=\"flex flex-col space-y-2\">\n <div>\n <label htmlFor=\"feedback\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Let us know what your issue is:\n </label>\n <textarea\n id=\"feedback\"\n rows={4}\n className=\"w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500\"\n placeholder=\"A Loom link / screen recording is always great!\"\n onChange={(e) => setIssueDescription(e.target.value)}\n value={issueDescription}\n required\n ></textarea>\n </div>\n <div>\n <label htmlFor=\"email\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Email (optional):\n </label>\n <input\n type=\"email\"\n id=\"email\"\n className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? \"border-red-500\" : \"\"}`}\n placeholder=\"Enter your email for follow-up\"\n onChange={(e) => {\n setEmail(e.target.value);\n setEmailError(\"\");\n }}\n value={email}\n />\n {emailError && <p className=\"text-red-500 text-sm mt-1\">{emailError}</p>}\n </div>\n <div className=\"bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg\">\n <button\n type=\"submit\"\n onClick={handleSubmit}\n disabled={submitButtonDisabled}\n style={\n submitButtonDisabled\n ? { backgroundColor: \"rgb(216, 216, 216)\", color: \"rgb(129, 129, 129)\" }\n : undefined\n }\n 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\"\n >\n {submitting ? <LoadingSpinnerIcon color=\"white\" /> : \"Submit\"}\n </button>\n </div>\n </form>\n </div>\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAgB,SAAS,gBAAgB;AA8CrC,SAgBA,UAhBA,KAmCQ,YAnCR;AA3CG,SAAS,sBAAsB;AACpC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,EAAE;AAC3D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,Y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AAA,kBACL,IAAG;AAAA,kBACH,WAAW,6FAA6F,aAAa,mBAAmB;AAAA,kBACxI,aAAY;AAAA,kBACZ,UAAU,CAAC,MAAM;AACf,6BAAS,EAAE,OAAO,KAAK;AACvB,kCAAc,EAAE;AAAA,kBAClB;AAAA,kBACA,OAAO;AAAA;AAAA,cACT;AAAA,cACC,cAAc,oBAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,oBAAC,SAAI,WAAU,yEACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,OACE,uBACI,EAAE,iBAAiB,sBAAsB,OAAO,qBAAqB,IACrE;AAAA,gBAEN,WAAU;AAAA,gBAET,uBAAa,oBAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["email"]}
@@ -9,13 +9,13 @@ import {
9
9
  } from "./chunk-RQNJNK2W.mjs";
10
10
  import {
11
11
  CopilotChat
12
- } from "./chunk-OI5EKZPO.mjs";
12
+ } from "./chunk-DCNCY2PL.mjs";
13
13
  import {
14
14
  Input
15
- } from "./chunk-4LUMV4YO.mjs";
15
+ } from "./chunk-EMQEEXUB.mjs";
16
16
  import {
17
17
  Messages
18
- } from "./chunk-RKPANT3F.mjs";
18
+ } from "./chunk-7II4YL7R.mjs";
19
19
  import {
20
20
  ResponseButton
21
21
  } from "./chunk-3XAXY2Z3.mjs";
@@ -92,4 +92,4 @@ var CopilotModal = ({
92
92
  export {
93
93
  CopilotModal
94
94
  };
95
- //# sourceMappingURL=chunk-B6A6OMIG.mjs.map
95
+ //# sourceMappingURL=chunk-UWVGLGFQ.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "./chunk-B6A6OMIG.mjs";
3
+ } from "./chunk-UWVGLGFQ.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -27,4 +27,4 @@ function CopilotSidebar(props) {
27
27
  export {
28
28
  CopilotSidebar
29
29
  };
30
- //# sourceMappingURL=chunk-RQRK6DEW.mjs.map
30
+ //# sourceMappingURL=chunk-WSMMTZCM.mjs.map
@@ -739,7 +739,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
739
739
  });
740
740
  const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
741
741
  const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
742
- const sendDisabled = inProgress || text.length === 0 || pushToTalkState !== "idle";
742
+ const canSend = () => {
743
+ return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
744
+ };
745
+ const sendDisabled = !canSend();
743
746
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
744
747
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
745
748
  Textarea_default,
@@ -753,7 +756,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
753
756
  onKeyDown: (event) => {
754
757
  if (event.key === "Enter" && !event.shiftKey) {
755
758
  event.preventDefault();
756
- send();
759
+ if (canSend()) {
760
+ send();
761
+ }
757
762
  }
758
763
  }
759
764
  }
@@ -800,9 +805,9 @@ var import_react6 = require("react");
800
805
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
801
806
 
802
807
  // src/hooks/use-copy-to-clipboard.tsx
803
- var React5 = __toESM(require("react"));
808
+ var React4 = __toESM(require("react"));
804
809
  function useCopyToClipboard({ timeout = 2e3 }) {
805
- const [isCopied, setIsCopied] = React5.useState(false);
810
+ const [isCopied, setIsCopied] = React4.useState(false);
806
811
  const copyToClipboard = (value) => {
807
812
  var _a;
808
813
  if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
@@ -1298,8 +1303,8 @@ function RenderActionExecutionMessage(props) {
1298
1303
  const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
1299
1304
  const { icons } = useChatContext();
1300
1305
  if (message.isActionExecutionMessage()) {
1301
- if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
1302
- const render = chatComponentsCache.current.actions[message.name];
1306
+ if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
1307
+ const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
1303
1308
  if (typeof render === "string") {
1304
1309
  if (isCurrentMessage && inProgress) {
1305
1310
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
@@ -1322,7 +1327,8 @@ function RenderActionExecutionMessage(props) {
1322
1327
  const toRender = render({
1323
1328
  status,
1324
1329
  args,
1325
- result: actionResult
1330
+ result: actionResult,
1331
+ name: message.name
1326
1332
  });
1327
1333
  if (!toRender && status === "complete") {
1328
1334
  return null;
@@ -1636,7 +1642,7 @@ function logMessages(context) {
1636
1642
  type: "ActionExecutionMessage",
1637
1643
  role: void 0,
1638
1644
  name: message.name,
1639
- scope: message.scope,
1645
+ scope: message.parentMessageId,
1640
1646
  content: message.arguments
1641
1647
  };
1642
1648
  } else if (message.isResultMessage()) {
@@ -1759,41 +1765,52 @@ var import_react8 = require("react");
1759
1765
 
1760
1766
  // src/components/help-modal/icons.tsx
1761
1767
  var import_jsx_runtime15 = require("react/jsx-runtime");
1762
- var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1768
+ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1763
1769
  "svg",
1764
1770
  {
1765
1771
  xmlns: "http://www.w3.org/2000/svg",
1766
- width: "24",
1767
- height: "24",
1768
- viewBox: "0 0 24 24",
1769
1772
  fill: "none",
1773
+ viewBox: "0 0 24 24",
1774
+ strokeWidth: "1.5",
1770
1775
  stroke: "currentColor",
1771
- strokeWidth: "2",
1772
- strokeLinecap: "round",
1773
- strokeLinejoin: "round",
1774
- className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
1775
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("g", { transform: "translate(0, -1)", children: [
1776
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
1777
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
1778
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
1779
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M15 15l3.35 3.35" }),
1780
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M9 15l-3.35 3.35" }),
1781
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
1782
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
1783
- ] })
1776
+ width: "20",
1777
+ height: "20",
1778
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1784
1779
  }
1785
1780
  );
1786
- var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1781
+ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1787
1782
  "svg",
1788
1783
  {
1784
+ style: {
1785
+ animation: "copilotKitSpinAnimation 1s linear infinite",
1786
+ color
1787
+ },
1788
+ width: "24",
1789
+ height: "24",
1789
1790
  xmlns: "http://www.w3.org/2000/svg",
1790
1791
  fill: "none",
1791
1792
  viewBox: "0 0 24 24",
1792
- strokeWidth: "1.5",
1793
- stroke: "currentColor",
1794
- width: "20",
1795
- height: "20",
1796
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
1793
+ children: [
1794
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1795
+ "circle",
1796
+ {
1797
+ style: { opacity: 0.25 },
1798
+ cx: "12",
1799
+ cy: "12",
1800
+ r: "10",
1801
+ stroke: "currentColor",
1802
+ strokeWidth: "4"
1803
+ }
1804
+ ),
1805
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1806
+ "path",
1807
+ {
1808
+ style: { opacity: 0.75 },
1809
+ fill: "currentColor",
1810
+ 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"
1811
+ }
1812
+ )
1813
+ ]
1797
1814
  }
1798
1815
  );
1799
1816
 
@@ -1802,18 +1819,52 @@ var import_jsx_runtime16 = require("react/jsx-runtime");
1802
1819
  function CopilotKitHelpModal() {
1803
1820
  const [showHelpModal, setShowHelpModal] = (0, import_react8.useState)(false);
1804
1821
  const [issueDescription, setIssueDescription] = (0, import_react8.useState)("");
1805
- const handleSubmit = () => {
1806
- setShowHelpModal(false);
1822
+ const [email, setEmail] = (0, import_react8.useState)("");
1823
+ const [emailError, setEmailError] = (0, import_react8.useState)("");
1824
+ const [submitting, setSubmitting] = (0, import_react8.useState)(false);
1825
+ const validateEmail = (email2) => {
1826
+ const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
1827
+ return re.test(email2);
1807
1828
  };
1829
+ const handleSubmit = (e) => __async(this, null, function* () {
1830
+ e.preventDefault();
1831
+ if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
1832
+ setEmailError("Please enter a valid email address");
1833
+ return;
1834
+ }
1835
+ setSubmitting(true);
1836
+ yield fetch("https://api.segment.io/v1/track", {
1837
+ method: "POST",
1838
+ headers: {
1839
+ "Content-Type": "application/json"
1840
+ },
1841
+ body: JSON.stringify({
1842
+ event: "oss.dev-console.help",
1843
+ anonymousId: window.crypto.randomUUID(),
1844
+ properties: { email, text: issueDescription },
1845
+ writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
1846
+ })
1847
+ });
1848
+ setEmailError("");
1849
+ setEmail("");
1850
+ setIssueDescription("");
1851
+ setSubmitting(false);
1852
+ setShowHelpModal(false);
1853
+ });
1808
1854
  const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1809
1855
  "button",
1810
1856
  {
1811
1857
  onClick: () => setShowHelpModal(true),
1812
- 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",
1858
+ style: { width: "50px", height: "30px", marginRight: "0.25rem" },
1859
+ className: "text-sm p-0 bg-transparent rounded border border-blue-500",
1813
1860
  "aria-label": "Open Help",
1814
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LifeBuoyIcon, {})
1861
+ children: "Help"
1815
1862
  }
1816
1863
  );
1864
+ const submitButtonDisabled = (0, import_react8.useMemo)(
1865
+ () => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
1866
+ [submitting, emailError, issueDescription]
1867
+ );
1817
1868
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
1818
1869
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HelpButton, {}),
1819
1870
  showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -1834,6 +1885,15 @@ function CopilotKitHelpModal() {
1834
1885
  ),
1835
1886
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
1836
1887
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4 mb-4", children: [
1888
+ /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(
1889
+ "a",
1890
+ {
1891
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
1892
+ target: "_blank",
1893
+ rel: "noopener noreferrer",
1894
+ children: "Visit the Troubleshooting and FAQ section in the docs"
1895
+ }
1896
+ ) }),
1837
1897
  /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(
1838
1898
  "a",
1839
1899
  {
@@ -1852,6 +1912,52 @@ function CopilotKitHelpModal() {
1852
1912
  children: "Apply for Priority Direct Slack Support"
1853
1913
  }
1854
1914
  ) })
1915
+ ] }),
1916
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
1917
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
1918
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
1919
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1920
+ "textarea",
1921
+ {
1922
+ id: "feedback",
1923
+ rows: 4,
1924
+ className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
1925
+ placeholder: "A Loom link / screen recording is always great!",
1926
+ onChange: (e) => setIssueDescription(e.target.value),
1927
+ value: issueDescription,
1928
+ required: true
1929
+ }
1930
+ )
1931
+ ] }),
1932
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
1933
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
1934
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1935
+ "input",
1936
+ {
1937
+ type: "email",
1938
+ id: "email",
1939
+ className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
1940
+ placeholder: "Enter your email for follow-up",
1941
+ onChange: (e) => {
1942
+ setEmail(e.target.value);
1943
+ setEmailError("");
1944
+ },
1945
+ value: email
1946
+ }
1947
+ ),
1948
+ emailError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
1949
+ ] }),
1950
+ /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(
1951
+ "button",
1952
+ {
1953
+ type: "submit",
1954
+ onClick: handleSubmit,
1955
+ disabled: submitButtonDisabled,
1956
+ style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
1957
+ 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",
1958
+ children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
1959
+ }
1960
+ ) })
1855
1961
  ] })
1856
1962
  ] })
1857
1963
  }
@@ -2163,6 +2269,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
2163
2269
  appendMessage,
2164
2270
  reloadMessages: defaultReloadMessages,
2165
2271
  stopGeneration: defaultStopGeneration,
2272
+ runChatCompletion,
2166
2273
  isLoading
2167
2274
  } = (0, import_react_core8.useCopilotChat)({
2168
2275
  id: (0, import_shared3.randomId)(),
@@ -2245,7 +2352,13 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
2245
2352
  });
2246
2353
  const runCurrentAgent = (hint) => __async(void 0, null, function* () {
2247
2354
  if (generalContext.agentSession) {
2248
- yield (0, import_react_core9.runAgent)(generalContext.agentSession.agentName, context, appendMessage, hint);
2355
+ yield (0, import_react_core9.runAgent)(
2356
+ generalContext.agentSession.agentName,
2357
+ context,
2358
+ appendMessage,
2359
+ runChatCompletion,
2360
+ hint
2361
+ );
2249
2362
  }
2250
2363
  });
2251
2364
  const stopCurrentAgent = () => {