@copilotkit/react-ui 1.4.8-no-pino-redact.1 → 1.5.0-coagents-v0-3.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 (75) hide show
  1. package/CHANGELOG.md +37 -4
  2. package/dist/{chunk-FUDBUYBG.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-T35X2SFE.mjs → chunk-DCNCY2PL.mjs} +113 -10
  8. package/dist/chunk-DCNCY2PL.mjs.map +1 -0
  9. package/dist/{chunk-TTYR7XPN.mjs → chunk-F2W5FD7L.mjs} +3 -3
  10. package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
  11. package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
  12. package/dist/{chunk-ICGZEGHQ.mjs → chunk-TI7SY2RI.mjs} +13 -4
  13. package/dist/chunk-TI7SY2RI.mjs.map +1 -0
  14. package/dist/{chunk-E5SSVET3.mjs → chunk-UWVGLGFQ.mjs} +7 -3
  15. package/dist/chunk-UWVGLGFQ.mjs.map +1 -0
  16. package/dist/{chunk-ZQFKJLQ6.mjs → chunk-WSMMTZCM.mjs} +2 -2
  17. package/dist/components/chat/Chat.d.ts +50 -5
  18. package/dist/components/chat/Chat.js +127 -38
  19. package/dist/components/chat/Chat.js.map +1 -1
  20. package/dist/components/chat/Chat.mjs +6 -6
  21. package/dist/components/chat/Messages.d.ts +3 -3
  22. package/dist/components/chat/Messages.js.map +1 -1
  23. package/dist/components/chat/Messages.mjs +1 -1
  24. package/dist/components/chat/Modal.d.ts +1 -1
  25. package/dist/components/chat/Modal.js +131 -38
  26. package/dist/components/chat/Modal.js.map +1 -1
  27. package/dist/components/chat/Modal.mjs +7 -7
  28. package/dist/components/chat/Popup.js +131 -38
  29. package/dist/components/chat/Popup.js.map +1 -1
  30. package/dist/components/chat/Popup.mjs +8 -8
  31. package/dist/components/chat/Sidebar.js +131 -38
  32. package/dist/components/chat/Sidebar.js.map +1 -1
  33. package/dist/components/chat/Sidebar.mjs +8 -8
  34. package/dist/components/chat/index.js +131 -38
  35. package/dist/components/chat/index.js.map +1 -1
  36. package/dist/components/chat/index.mjs +9 -9
  37. package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -3
  38. package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
  39. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
  40. package/dist/components/dev-console/console.js +13 -27
  41. package/dist/components/dev-console/console.js.map +1 -1
  42. package/dist/components/dev-console/console.mjs +3 -3
  43. package/dist/components/dev-console/index.js +13 -27
  44. package/dist/components/dev-console/index.js.map +1 -1
  45. package/dist/components/dev-console/index.mjs +3 -3
  46. package/dist/components/dev-console/utils.js +1 -1
  47. package/dist/components/dev-console/utils.js.map +1 -1
  48. package/dist/components/dev-console/utils.mjs +1 -1
  49. package/dist/components/help-modal/index.js +12 -26
  50. package/dist/components/help-modal/index.js.map +1 -1
  51. package/dist/components/help-modal/index.mjs +1 -1
  52. package/dist/components/help-modal/modal.js +12 -26
  53. package/dist/components/help-modal/modal.js.map +1 -1
  54. package/dist/components/help-modal/modal.mjs +1 -1
  55. package/dist/components/index.js +131 -38
  56. package/dist/components/index.js.map +1 -1
  57. package/dist/components/index.mjs +9 -9
  58. package/dist/index.js +133 -40
  59. package/dist/index.js.map +1 -1
  60. package/dist/index.mjs +9 -9
  61. package/package.json +4 -4
  62. package/src/components/chat/Chat.tsx +173 -7
  63. package/src/components/chat/Messages.tsx +2 -9
  64. package/src/components/chat/Modal.tsx +4 -0
  65. package/src/components/chat/messages/RenderActionExecutionMessage.tsx +10 -3
  66. package/src/components/dev-console/utils.ts +1 -1
  67. package/src/components/help-modal/modal.tsx +12 -2
  68. package/dist/chunk-E5SSVET3.mjs.map +0 -1
  69. package/dist/chunk-ICGZEGHQ.mjs.map +0 -1
  70. package/dist/chunk-OMTPWC7T.mjs.map +0 -1
  71. package/dist/chunk-RKPANT3F.mjs.map +0 -1
  72. package/dist/chunk-T35X2SFE.mjs.map +0 -1
  73. /package/dist/{chunk-FUDBUYBG.mjs.map → chunk-375NVWZM.mjs.map} +0 -0
  74. /package/dist/{chunk-TTYR7XPN.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
  75. /package/dist/{chunk-ZQFKJLQ6.mjs.map → chunk-WSMMTZCM.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/help-modal/index.tsx","../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["export { CopilotKitHelpModal } from \"./modal\";\n","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 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\"\n aria-label=\"Open Help\"\n >\n <LifeBuoyIcon />\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://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","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n 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\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;;;ACerC;AAbG,IAAM,eAAe,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,8CAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,SAAQ,WAAU,gDAA+C,+BAEhF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,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,6CAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,6CAAC,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,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
1
+ {"version":3,"sources":["../../../src/components/help-modal/index.tsx","../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.tsx"],"sourcesContent":["export { CopilotKitHelpModal } from \"./modal\";\n","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","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n 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\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;;;ACerC;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;AAGK,IAAM,qBAAqB,CAAC,EAAE,QAAQ,mBAAmB,MAC9D;AAAA,EAAC;AAAA;AAAA,IACC,OAAO;AAAA,MACL,WAAW;AAAA,MACX;AAAA,IACF;AAAA,IACA,OAAM;AAAA,IACN,QAAO;AAAA,IACP,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IAER;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,EAAE,SAAS,KAAK;AAAA,UACvB,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACb;AAAA,MACD;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,EAAE,SAAS,KAAK;AAAA,UACvB,MAAK;AAAA,UACL,GAAE;AAAA;AAAA,MACH;AAAA;AAAA;AACH;;;ADpBE,IAAAA,sBAAA;AA3C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;AAAA,kBACnD,OAAO;AAAA,kBACP,UAAQ;AAAA;AAAA,cACT;AAAA,eACH;AAAA,YACA,8CAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,SAAQ,WAAU,gDAA+C,+BAEhF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,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,6CAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,6CAAC,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,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-KXE2JCUH.mjs";
2
2
  import {
3
3
  CopilotKitHelpModal
4
- } from "../../chunk-ICGZEGHQ.mjs";
4
+ } from "../../chunk-TI7SY2RI.mjs";
5
5
  import "../../chunk-BH6PCAAL.mjs";
6
6
  import "../../chunk-MRXNTQOX.mjs";
7
7
  export {
@@ -47,30 +47,6 @@ var import_react = require("react");
47
47
 
48
48
  // src/components/help-modal/icons.tsx
49
49
  var import_jsx_runtime = require("react/jsx-runtime");
50
- var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
- "svg",
52
- {
53
- xmlns: "http://www.w3.org/2000/svg",
54
- width: "24",
55
- height: "24",
56
- viewBox: "0 0 24 24",
57
- fill: "none",
58
- stroke: "currentColor",
59
- strokeWidth: "2",
60
- strokeLinecap: "round",
61
- strokeLinejoin: "round",
62
- className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
63
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { transform: "translate(0, -1)", children: [
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
66
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
67
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 15l3.35 3.35" }),
68
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 15l-3.35 3.35" }),
69
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
70
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
71
- ] })
72
- }
73
- );
74
50
  var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
51
  "svg",
76
52
  {
@@ -161,9 +137,10 @@ function CopilotKitHelpModal() {
161
137
  "button",
162
138
  {
163
139
  onClick: () => setShowHelpModal(true),
164
- 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",
140
+ style: { width: "50px", height: "30px", marginRight: "0.25rem" },
141
+ className: "text-sm p-0 bg-transparent rounded border border-blue-500",
165
142
  "aria-label": "Open Help",
166
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LifeBuoyIcon, {})
143
+ children: "Help"
167
144
  }
168
145
  );
169
146
  const submitButtonDisabled = (0, import_react.useMemo)(
@@ -190,6 +167,15 @@ function CopilotKitHelpModal() {
190
167
  ),
191
168
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
192
169
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "space-y-4 mb-4", children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(
171
+ "a",
172
+ {
173
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
174
+ target: "_blank",
175
+ rel: "noopener noreferrer",
176
+ children: "Visit the Troubleshooting and FAQ section in the docs"
177
+ }
178
+ ) }),
193
179
  /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(
194
180
  "a",
195
181
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.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 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\"\n aria-label=\"Open Help\"\n >\n <LifeBuoyIcon />\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://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","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.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,WAAM,SAAQ,YAAW,WAAU,gDAA+C,6CAEnF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,MAAM;AAAA,kBACN,WAAU;AAAA,kBACV,aAAY;AAAA,kBACZ,UAAU,CAAC,MAAM,oBAAoB,EAAE,OAAO,KAAK;AAAA,kBACnD,OAAO;AAAA,kBACP,UAAQ;AAAA;AAAA,cACT;AAAA,eACH;AAAA,YACA,8CAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,SAAQ,WAAU,gDAA+C,+BAEhF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,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,6CAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,6CAAC,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,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
1
+ {"version":3,"sources":["../../../src/components/help-modal/modal.tsx","../../../src/components/help-modal/icons.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","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({ color = \"rgb(107 114 128)\" }: { color?: string }) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n 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\"\n ></path>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyC;;;ACerC;AAYG,IAAM,YAAY,MACvB;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,aAAY;AAAA,IACZ,QAAO;AAAA,IACP,OAAM;AAAA,IACN,QAAO;AAAA,IAEP,sDAAC,UAAK,eAAc,SAAQ,gBAAe,SAAQ,GAAE,wBAAuB;AAAA;AAC9E;AAGK,IAAM,qBAAqB,CAAC,EAAE,QAAQ,mBAAmB,MAC9D;AAAA,EAAC;AAAA;AAAA,IACC,OAAO;AAAA,MACL,WAAW;AAAA,MACX;AAAA,IACF;AAAA,IACA,OAAM;AAAA,IACN,QAAO;AAAA,IACP,OAAM;AAAA,IACN,MAAK;AAAA,IACL,SAAQ;AAAA,IAER;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,EAAE,SAAS,KAAK;AAAA,UACvB,IAAG;AAAA,UACH,IAAG;AAA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DAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,YAAW,WAAU,gDAA+C,6CAEnF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,IAAG;AAAA,kBACH,MAAM;AAAA,kBACN,WAAU;AAAA,kBACV,aAAY;AAAA,kBACZ,UAAU,CAAC,MAAM,oBAAoB,EAAE,OAAO,KAAK;AAAA,kBACnD,OAAO;AAAA,kBACP,UAAQ;AAAA;AAAA,cACT;AAAA,eACH;AAAA,YACA,8CAAC,SACC;AAAA,2DAAC,WAAM,SAAQ,SAAQ,WAAU,gDAA+C,+BAEhF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,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,6CAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,6CAAC,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,6CAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["import_jsx_runtime","email"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotKitHelpModal
3
- } from "../../chunk-ICGZEGHQ.mjs";
3
+ } from "../../chunk-TI7SY2RI.mjs";
4
4
  import "../../chunk-BH6PCAAL.mjs";
5
5
  import "../../chunk-MRXNTQOX.mjs";
6
6
  export {
@@ -948,9 +948,9 @@ var import_react7 = require("react");
948
948
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
949
949
 
950
950
  // src/hooks/use-copy-to-clipboard.tsx
951
- var React6 = __toESM(require("react"));
951
+ var React5 = __toESM(require("react"));
952
952
  function useCopyToClipboard({ timeout = 2e3 }) {
953
- const [isCopied, setIsCopied] = React6.useState(false);
953
+ const [isCopied, setIsCopied] = React5.useState(false);
954
954
  const copyToClipboard = (value) => {
955
955
  var _a;
956
956
  if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
@@ -1446,8 +1446,8 @@ function RenderActionExecutionMessage(props) {
1446
1446
  const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
1447
1447
  const { icons } = useChatContext();
1448
1448
  if (message.isActionExecutionMessage()) {
1449
- if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
1450
- const render = chatComponentsCache.current.actions[message.name];
1449
+ if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
1450
+ const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
1451
1451
  if (typeof render === "string") {
1452
1452
  if (isCurrentMessage && inProgress) {
1453
1453
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
@@ -1470,7 +1470,8 @@ function RenderActionExecutionMessage(props) {
1470
1470
  const toRender = render({
1471
1471
  status,
1472
1472
  args,
1473
- result: actionResult
1473
+ result: actionResult,
1474
+ name: message.name
1474
1475
  });
1475
1476
  if (!toRender && status === "complete") {
1476
1477
  return null;
@@ -1784,7 +1785,7 @@ function logMessages(context) {
1784
1785
  type: "ActionExecutionMessage",
1785
1786
  role: void 0,
1786
1787
  name: message.name,
1787
- scope: message.scope,
1788
+ scope: message.parentMessageId,
1788
1789
  content: message.arguments
1789
1790
  };
1790
1791
  } else if (message.isResultMessage()) {
@@ -1907,30 +1908,6 @@ var import_react9 = require("react");
1907
1908
 
1908
1909
  // src/components/help-modal/icons.tsx
1909
1910
  var import_jsx_runtime18 = require("react/jsx-runtime");
1910
- var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1911
- "svg",
1912
- {
1913
- xmlns: "http://www.w3.org/2000/svg",
1914
- width: "24",
1915
- height: "24",
1916
- viewBox: "0 0 24 24",
1917
- fill: "none",
1918
- stroke: "currentColor",
1919
- strokeWidth: "2",
1920
- strokeLinecap: "round",
1921
- strokeLinejoin: "round",
1922
- className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
1923
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { transform: "translate(0, -1)", children: [
1924
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
1925
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
1926
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
1927
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M15 15l3.35 3.35" }),
1928
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 15l-3.35 3.35" }),
1929
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
1930
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
1931
- ] })
1932
- }
1933
- );
1934
1911
  var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1935
1912
  "svg",
1936
1913
  {
@@ -2021,9 +1998,10 @@ function CopilotKitHelpModal() {
2021
1998
  "button",
2022
1999
  {
2023
2000
  onClick: () => setShowHelpModal(true),
2024
- 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",
2001
+ style: { width: "50px", height: "30px", marginRight: "0.25rem" },
2002
+ className: "text-sm p-0 bg-transparent rounded border border-blue-500",
2025
2003
  "aria-label": "Open Help",
2026
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LifeBuoyIcon, {})
2004
+ children: "Help"
2027
2005
  }
2028
2006
  );
2029
2007
  const submitButtonDisabled = (0, import_react9.useMemo)(
@@ -2050,6 +2028,15 @@ function CopilotKitHelpModal() {
2050
2028
  ),
2051
2029
  /* @__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" }) }),
2052
2030
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
2031
+ /* @__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)(
2032
+ "a",
2033
+ {
2034
+ href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
2035
+ target: "_blank",
2036
+ rel: "noopener noreferrer",
2037
+ children: "Visit the Troubleshooting and FAQ section in the docs"
2038
+ }
2039
+ ) }),
2053
2040
  /* @__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)(
2054
2041
  "a",
2055
2042
  {
@@ -2324,6 +2311,7 @@ function DebugMenuButton({
2324
2311
  }
2325
2312
 
2326
2313
  // src/components/chat/Chat.tsx
2314
+ var import_react_core9 = require("@copilotkit/react-core");
2327
2315
  var import_jsx_runtime21 = require("react/jsx-runtime");
2328
2316
  function CopilotChat({
2329
2317
  instructions,
@@ -2331,6 +2319,8 @@ function CopilotChat({
2331
2319
  makeSystemMessage,
2332
2320
  showResponseButton = true,
2333
2321
  onInProgress,
2322
+ onStopGeneration,
2323
+ onReloadMessages,
2334
2324
  Messages: Messages2 = Messages,
2335
2325
  RenderTextMessage: RenderTextMessage2 = RenderTextMessage,
2336
2326
  RenderActionExecutionMessage: RenderActionExecutionMessage2 = RenderActionExecutionMessage,
@@ -2353,7 +2343,13 @@ function CopilotChat({
2353
2343
  sendMessage,
2354
2344
  stopGeneration,
2355
2345
  reloadMessages
2356
- } = useCopilotChatLogic(makeSystemMessage, onInProgress, onSubmitMessage);
2346
+ } = useCopilotChatLogic(
2347
+ makeSystemMessage,
2348
+ onInProgress,
2349
+ onSubmitMessage,
2350
+ onStopGeneration,
2351
+ onReloadMessages
2352
+ );
2357
2353
  const chatContext = import_react12.default.useContext(ChatContext);
2358
2354
  const isVisible = chatContext ? chatContext.open : true;
2359
2355
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
@@ -2409,8 +2405,16 @@ function WrappedCopilotChat({
2409
2405
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
2410
2406
  }
2411
2407
  var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
2412
- var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) => {
2413
- const { visibleMessages, appendMessage, reloadMessages, stopGeneration, isLoading } = (0, import_react_core8.useCopilotChat)({
2408
+ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
2409
+ var _a;
2410
+ const {
2411
+ visibleMessages,
2412
+ appendMessage,
2413
+ reloadMessages: defaultReloadMessages,
2414
+ stopGeneration: defaultStopGeneration,
2415
+ runChatCompletion,
2416
+ isLoading
2417
+ } = (0, import_react_core8.useCopilotChat)({
2414
2418
  id: (0, import_shared3.randomId)(),
2415
2419
  makeSystemMessage
2416
2420
  });
@@ -2418,8 +2422,8 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2418
2422
  const suggestionsAbortControllerRef = (0, import_react12.useRef)(null);
2419
2423
  const debounceTimerRef = (0, import_react12.useRef)();
2420
2424
  const abortSuggestions = () => {
2421
- var _a;
2422
- (_a = suggestionsAbortControllerRef.current) == null ? void 0 : _a.abort();
2425
+ var _a2;
2426
+ (_a2 = suggestionsAbortControllerRef.current) == null ? void 0 : _a2.abort();
2423
2427
  suggestionsAbortControllerRef.current = null;
2424
2428
  };
2425
2429
  const generalContext = (0, import_react_core8.useCopilotContext)();
@@ -2445,7 +2449,13 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2445
2449
  return () => {
2446
2450
  clearTimeout(debounceTimerRef.current);
2447
2451
  };
2448
- }, [isLoading, context.chatSuggestionConfiguration]);
2452
+ }, [
2453
+ isLoading,
2454
+ context.chatSuggestionConfiguration,
2455
+ // hackish way to trigger suggestions reload on reset, but better than moving suggestions to the
2456
+ // global context
2457
+ visibleMessages.length == 0
2458
+ ]);
2449
2459
  const sendMessage = (messageContent) => __async(void 0, null, function* () {
2450
2460
  abortSuggestions();
2451
2461
  setCurrentSuggestions([]);
@@ -2463,6 +2473,85 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
2463
2473
  appendMessage(message);
2464
2474
  return message;
2465
2475
  });
2476
+ const messages = visibleMessages;
2477
+ const { setMessages } = messagesContext;
2478
+ const currentAgentName = (_a = generalContext.agentSession) == null ? void 0 : _a.agentName;
2479
+ const restartCurrentAgent = (hint) => __async(void 0, null, function* () {
2480
+ if (generalContext.agentSession) {
2481
+ generalContext.setAgentSession(__spreadProps(__spreadValues({}, generalContext.agentSession), {
2482
+ nodeName: void 0,
2483
+ threadId: void 0
2484
+ }));
2485
+ generalContext.setCoagentStates((prevAgentStates) => {
2486
+ return __spreadProps(__spreadValues({}, prevAgentStates), {
2487
+ [generalContext.agentSession.agentName]: __spreadProps(__spreadValues({}, prevAgentStates[generalContext.agentSession.agentName]), {
2488
+ threadId: void 0,
2489
+ nodeName: void 0,
2490
+ runId: void 0
2491
+ })
2492
+ });
2493
+ });
2494
+ }
2495
+ });
2496
+ const runCurrentAgent = (hint) => __async(void 0, null, function* () {
2497
+ if (generalContext.agentSession) {
2498
+ yield (0, import_react_core9.runAgent)(
2499
+ generalContext.agentSession.agentName,
2500
+ context,
2501
+ appendMessage,
2502
+ runChatCompletion,
2503
+ hint
2504
+ );
2505
+ }
2506
+ });
2507
+ const stopCurrentAgent = () => {
2508
+ if (generalContext.agentSession) {
2509
+ (0, import_react_core9.stopAgent)(generalContext.agentSession.agentName, context);
2510
+ }
2511
+ };
2512
+ const setCurrentAgentState = (state) => {
2513
+ if (generalContext.agentSession) {
2514
+ generalContext.setCoagentStates((prevAgentStates) => {
2515
+ return __spreadProps(__spreadValues({}, prevAgentStates), {
2516
+ [generalContext.agentSession.agentName]: {
2517
+ state
2518
+ }
2519
+ });
2520
+ });
2521
+ }
2522
+ };
2523
+ function stopGeneration() {
2524
+ if (onStopGeneration) {
2525
+ onStopGeneration({
2526
+ messages,
2527
+ setMessages,
2528
+ stopGeneration: defaultStopGeneration,
2529
+ currentAgentName,
2530
+ restartCurrentAgent,
2531
+ stopCurrentAgent,
2532
+ runCurrentAgent,
2533
+ setCurrentAgentState
2534
+ });
2535
+ } else {
2536
+ defaultStopGeneration();
2537
+ }
2538
+ }
2539
+ function reloadMessages() {
2540
+ if (onReloadMessages) {
2541
+ onReloadMessages({
2542
+ messages,
2543
+ setMessages,
2544
+ stopGeneration: defaultStopGeneration,
2545
+ currentAgentName,
2546
+ restartCurrentAgent,
2547
+ stopCurrentAgent,
2548
+ runCurrentAgent,
2549
+ setCurrentAgentState
2550
+ });
2551
+ } else {
2552
+ defaultReloadMessages();
2553
+ }
2554
+ }
2466
2555
  return {
2467
2556
  visibleMessages,
2468
2557
  isLoading,
@@ -2482,6 +2571,8 @@ var CopilotModal = ({
2482
2571
  hitEscapeToClose = true,
2483
2572
  onSetOpen,
2484
2573
  onSubmitMessage,
2574
+ onStopGeneration,
2575
+ onReloadMessages,
2485
2576
  shortcut = "/",
2486
2577
  icons,
2487
2578
  labels,
@@ -2519,6 +2610,8 @@ var CopilotModal = ({
2519
2610
  {
2520
2611
  instructions,
2521
2612
  onSubmitMessage,
2613
+ onStopGeneration,
2614
+ onReloadMessages,
2522
2615
  makeSystemMessage,
2523
2616
  showResponseButton,
2524
2617
  onInProgress,