@copilotkit/react-ui 1.4.1-pre.5 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/dist/{chunk-RS6UPR5N.mjs → chunk-2B57NCBA.mjs} +5 -1
- package/dist/chunk-2B57NCBA.mjs.map +1 -0
- package/dist/chunk-4T3TMQNJ.mjs +45 -0
- package/dist/chunk-4T3TMQNJ.mjs.map +1 -0
- package/dist/{chunk-H5CXJBR5.mjs → chunk-63ZKP62F.mjs} +2 -2
- package/dist/{chunk-ORHE7FYT.mjs → chunk-DHGDU64D.mjs} +8 -8
- package/dist/chunk-KXE2JCUH.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/{chunk-ECPBML4L.mjs → chunk-TKFQ7VQR.mjs} +2 -2
- package/dist/{chunk-TSIFZ5N5.mjs → chunk-VYKDFXGS.mjs} +2 -2
- package/dist/chunk-WOUWNTAV.mjs +72 -0
- package/dist/chunk-WOUWNTAV.mjs.map +1 -0
- package/dist/components/chat/Chat.js +159 -51
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +7 -4
- package/dist/components/chat/Modal.js +168 -60
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +8 -5
- package/dist/components/chat/Popup.js +170 -62
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +9 -6
- package/dist/components/chat/Sidebar.js +172 -64
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +9 -6
- package/dist/components/chat/index.js +174 -66
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +10 -7
- package/dist/components/dev-console/console.js +138 -32
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +4 -1
- package/dist/components/dev-console/index.js +138 -32
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +4 -1
- package/dist/components/help-modal/icons.d.ts +6 -0
- package/dist/components/help-modal/icons.js +70 -0
- package/dist/components/help-modal/icons.js.map +1 -0
- package/dist/components/help-modal/icons.mjs +10 -0
- package/dist/components/help-modal/icons.mjs.map +1 -0
- package/dist/components/help-modal/index.d.ts +2 -0
- package/dist/components/help-modal/index.js +135 -0
- package/dist/components/help-modal/index.js.map +1 -0
- package/dist/components/help-modal/index.mjs +10 -0
- package/dist/components/help-modal/index.mjs.map +1 -0
- package/dist/components/help-modal/modal.d.ts +5 -0
- package/dist/components/help-modal/modal.js +133 -0
- package/dist/components/help-modal/modal.js.map +1 -0
- package/dist/components/help-modal/modal.mjs +9 -0
- package/dist/components/help-modal/modal.mjs.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +178 -66
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +18 -9
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +180 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/package.json +7 -7
- package/src/components/dev-console/console.tsx +4 -1
- package/src/components/help-modal/icons.tsx +40 -0
- package/src/components/help-modal/index.tsx +1 -0
- package/src/components/help-modal/modal.tsx +91 -0
- package/src/components/index.ts +1 -0
- package/src/css/markdown.css +5 -0
- package/dist/chunk-JD7BAH7U.mjs +0 -1
- package/dist/chunk-RS6UPR5N.mjs.map +0 -1
- /package/dist/{chunk-H5CXJBR5.mjs.map → chunk-63ZKP62F.mjs.map} +0 -0
- /package/dist/{chunk-ORHE7FYT.mjs.map → chunk-DHGDU64D.mjs.map} +0 -0
- /package/dist/{chunk-JD7BAH7U.mjs.map → chunk-KXE2JCUH.mjs.map} +0 -0
- /package/dist/{chunk-ECPBML4L.mjs.map → chunk-TKFQ7VQR.mjs.map} +0 -0
- /package/dist/{chunk-TSIFZ5N5.mjs.map → chunk-VYKDFXGS.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./chunk-EFZPSZWO.mjs";
|
|
3
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-MMVDU6DF.mjs";
|
|
4
4
|
import "./chunk-MRFF7GSQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CopilotSidebar
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TKFQ7VQR.mjs";
|
|
8
8
|
import "./chunk-WB3YULQ4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CopilotPopup
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-VYKDFXGS.mjs";
|
|
12
|
+
import "./chunk-63ZKP62F.mjs";
|
|
13
13
|
import "./chunk-YAGE7RCE.mjs";
|
|
14
14
|
import "./chunk-VEC45H6Q.mjs";
|
|
15
15
|
import "./chunk-RQNJNK2W.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotChat
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DHGDU64D.mjs";
|
|
19
|
+
import "./chunk-6INMITFA.mjs";
|
|
20
|
+
import "./chunk-RU73BEZM.mjs";
|
|
19
21
|
import "./chunk-V7W6IM2V.mjs";
|
|
20
22
|
import "./chunk-OMTPWC7T.mjs";
|
|
21
23
|
import "./chunk-ZABXREBH.mjs";
|
|
22
|
-
import "./chunk-6INMITFA.mjs";
|
|
23
|
-
import "./chunk-RU73BEZM.mjs";
|
|
24
24
|
import "./chunk-RJCZRKTV.mjs";
|
|
25
|
-
import
|
|
26
|
-
|
|
25
|
+
import {
|
|
26
|
+
CopilotDevConsole
|
|
27
|
+
} from "./chunk-2B57NCBA.mjs";
|
|
28
|
+
import {
|
|
29
|
+
shouldShowDevConsole
|
|
30
|
+
} from "./chunk-4FIGRRFS.mjs";
|
|
31
|
+
import "./chunk-KXE2JCUH.mjs";
|
|
32
|
+
import "./chunk-WOUWNTAV.mjs";
|
|
33
|
+
import "./chunk-4T3TMQNJ.mjs";
|
|
27
34
|
import "./chunk-OTPAZXVR.mjs";
|
|
28
35
|
import "./chunk-4LUMV4YO.mjs";
|
|
29
36
|
import "./chunk-YQFVRDNC.mjs";
|
|
@@ -45,8 +52,10 @@ import "./chunk-S5MBUNGN.mjs";
|
|
|
45
52
|
import "./chunk-MRXNTQOX.mjs";
|
|
46
53
|
export {
|
|
47
54
|
CopilotChat,
|
|
55
|
+
CopilotDevConsole,
|
|
48
56
|
CopilotPopup,
|
|
49
57
|
CopilotSidebar,
|
|
58
|
+
shouldShowDevConsole,
|
|
50
59
|
useChatContext,
|
|
51
60
|
useCopilotChatSuggestions
|
|
52
61
|
};
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.4.1
|
|
12
|
+
"version": "1.4.1",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"ts-jest": "^29.1.1",
|
|
41
41
|
"tsup": "^6.7.0",
|
|
42
42
|
"typescript": "^5.2.3",
|
|
43
|
-
"eslint-config-custom": "1.4.1
|
|
44
|
-
"tailwind-config": "1.4.1
|
|
45
|
-
"tsconfig": "1.4.1
|
|
43
|
+
"eslint-config-custom": "1.4.1",
|
|
44
|
+
"tailwind-config": "1.4.1",
|
|
45
|
+
"tsconfig": "1.4.1"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@headlessui/react": "^2.1.3",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/react-core": "1.4.1
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.4.1
|
|
55
|
-
"@copilotkit/shared": "1.4.1
|
|
53
|
+
"@copilotkit/react-core": "1.4.1",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.4.1",
|
|
55
|
+
"@copilotkit/shared": "1.4.1"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
logReadables,
|
|
9
9
|
shouldShowDevConsole,
|
|
10
10
|
} from "./utils";
|
|
11
|
-
import { useEffect, useRef, useState } from "react";
|
|
11
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
12
12
|
import {
|
|
13
13
|
CheckIcon,
|
|
14
14
|
ChevronDownIcon,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
|
|
20
20
|
import { COPILOTKIT_VERSION } from "@copilotkit/shared";
|
|
21
21
|
import { SmallSpinnerIcon } from "../chat/Icons";
|
|
22
|
+
import { CopilotKitHelpModal } from "../help-modal";
|
|
22
23
|
|
|
23
24
|
type VersionStatus = "unknown" | "checking" | "latest" | "update-available" | "outdated";
|
|
24
25
|
|
|
@@ -138,6 +139,8 @@ export function CopilotDevConsole() {
|
|
|
138
139
|
latestVersion={latestVersion}
|
|
139
140
|
/>
|
|
140
141
|
|
|
142
|
+
<CopilotKitHelpModal />
|
|
143
|
+
|
|
141
144
|
<DebugMenuButton
|
|
142
145
|
setShowDevConsole={setShowDevConsole}
|
|
143
146
|
checkForUpdates={checkForUpdates}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const LifeBuoyIcon = () => (
|
|
4
|
+
<svg
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
stroke="currentColor"
|
|
11
|
+
strokeWidth="2"
|
|
12
|
+
strokeLinecap="round"
|
|
13
|
+
strokeLinejoin="round"
|
|
14
|
+
className="icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy"
|
|
15
|
+
>
|
|
16
|
+
<g transform="translate(0, -1)">
|
|
17
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
18
|
+
<path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" />
|
|
19
|
+
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
|
|
20
|
+
<path d="M15 15l3.35 3.35" />
|
|
21
|
+
<path d="M9 15l-3.35 3.35" />
|
|
22
|
+
<path d="M5.65 5.65l3.35 3.35" />
|
|
23
|
+
<path d="M18.35 5.65l-3.35 3.35" />
|
|
24
|
+
</g>
|
|
25
|
+
</svg>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const CloseIcon = () => (
|
|
29
|
+
<svg
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
fill="none"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
strokeWidth="1.5"
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
width="20"
|
|
36
|
+
height="20"
|
|
37
|
+
>
|
|
38
|
+
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CopilotKitHelpModal } from "./modal";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CloseIcon, LifeBuoyIcon } from "./icons";
|
|
3
|
+
|
|
4
|
+
export function CopilotKitHelpModal() {
|
|
5
|
+
const [showHelpModal, setShowHelpModal] = useState(false);
|
|
6
|
+
const [issueDescription, setIssueDescription] = useState("");
|
|
7
|
+
|
|
8
|
+
const handleSubmit = () => {
|
|
9
|
+
// submit issueDescription
|
|
10
|
+
setShowHelpModal(false);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const HelpButton = () => (
|
|
14
|
+
<button
|
|
15
|
+
onClick={() => setShowHelpModal(true)}
|
|
16
|
+
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"
|
|
17
|
+
aria-label="Open Help"
|
|
18
|
+
>
|
|
19
|
+
<LifeBuoyIcon />
|
|
20
|
+
</button>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<HelpButton />
|
|
26
|
+
{showHelpModal && (
|
|
27
|
+
<div
|
|
28
|
+
className="fixed inset-0 flex items-center justify-center p-4"
|
|
29
|
+
style={{ backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 }}
|
|
30
|
+
>
|
|
31
|
+
<div className="bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative">
|
|
32
|
+
<button
|
|
33
|
+
className="absolute text-gray-400 hover:text-gray-600 focus:outline-none"
|
|
34
|
+
style={{ top: "10px", right: "10px" }}
|
|
35
|
+
onClick={() => setShowHelpModal(false)}
|
|
36
|
+
aria-label="Close"
|
|
37
|
+
>
|
|
38
|
+
<CloseIcon />
|
|
39
|
+
</button>
|
|
40
|
+
<div className="w-full flex mb-6 justify-center">
|
|
41
|
+
<h2 className="text-2xl font-bold">Help Options</h2>
|
|
42
|
+
</div>
|
|
43
|
+
<div className="space-y-4 mb-4">
|
|
44
|
+
<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">
|
|
45
|
+
<a
|
|
46
|
+
href="https://go.copilotkit.ai/dev-console-support-discord"
|
|
47
|
+
target="_blank"
|
|
48
|
+
rel="noopener noreferrer"
|
|
49
|
+
>
|
|
50
|
+
Go to Discord Support Channel (Community Support)
|
|
51
|
+
</a>
|
|
52
|
+
</div>
|
|
53
|
+
<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">
|
|
54
|
+
<a
|
|
55
|
+
href="https://go.copilotkit.ai/dev-console-support-slack"
|
|
56
|
+
target="_blank"
|
|
57
|
+
rel="noopener noreferrer"
|
|
58
|
+
>
|
|
59
|
+
Apply for Priority Direct Slack Support
|
|
60
|
+
</a>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
{/*<form onSubmit={handleSubmit} className="flex flex-col space-y-4">*/}
|
|
64
|
+
{/* <div>*/}
|
|
65
|
+
{/* <label htmlFor="feedback" className="block text-sm font-medium text-gray-700 mb-1">*/}
|
|
66
|
+
{/* Let us know what your issue is:*/}
|
|
67
|
+
{/* </label>*/}
|
|
68
|
+
{/* <textarea*/}
|
|
69
|
+
{/* id="feedback"*/}
|
|
70
|
+
{/* rows={4}*/}
|
|
71
|
+
{/* className="w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500"*/}
|
|
72
|
+
{/* placeholder="A Loom link / screen recording is always great!"*/}
|
|
73
|
+
{/* onChange={e => setIssueDescription(e.target.value)}*/}
|
|
74
|
+
{/* value={issueDescription}*/}
|
|
75
|
+
{/* ></textarea>*/}
|
|
76
|
+
{/* </div>*/}
|
|
77
|
+
{/* <div className="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg">*/}
|
|
78
|
+
{/* <button*/}
|
|
79
|
+
{/* type="submit"*/}
|
|
80
|
+
{/* 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"*/}
|
|
81
|
+
{/* >*/}
|
|
82
|
+
{/* Submit*/}
|
|
83
|
+
{/* </button>*/}
|
|
84
|
+
{/* </div>*/}
|
|
85
|
+
{/*</form>*/}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
}
|
package/src/components/index.ts
CHANGED
package/src/css/markdown.css
CHANGED
package/dist/chunk-JD7BAH7U.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-JD7BAH7U.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/dev-console/console.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCopilotContext, useCopilotMessagesContext } from \"@copilotkit/react-core\";\nimport {\n getPublishedCopilotKitVersion,\n logActions,\n logMessages,\n logReadables,\n shouldShowDevConsole,\n} from \"./utils\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n CopilotKitIcon,\n ExclamationMarkIcon,\n ExclamationMarkTriangleIcon,\n} from \"./icons\";\nimport { Menu, MenuButton, MenuItem, MenuItems } from \"@headlessui/react\";\nimport { COPILOTKIT_VERSION } from \"@copilotkit/shared\";\nimport { SmallSpinnerIcon } from \"../chat/Icons\";\n\ntype VersionStatus = \"unknown\" | \"checking\" | \"latest\" | \"update-available\" | \"outdated\";\n\nexport function CopilotDevConsole() {\n const currentVersion = COPILOTKIT_VERSION;\n const context = useCopilotContext();\n\n // to prevent hydration errors, ensure that the component renders the same content\n // server-side as it does during the initial client-side render to prevent a hydration\n // mismatch\n // see: https://nextjs.org/docs/messages/react-hydration-error#solution-1-using-useeffect-to-run-on-the-client-only\n\n const [showDevConsole, setShowDevConsole] = useState(false);\n\n useEffect(() => {\n setShowDevConsole(shouldShowDevConsole(context.showDevConsole));\n }, [context.showDevConsole]);\n\n const dontRunTwiceInDevMode = useRef(false);\n const [versionStatus, setVersionStatus] = useState<VersionStatus>(\"unknown\");\n const [latestVersion, setLatestVersion] = useState<string>(\"\");\n const consoleRef = useRef<HTMLDivElement>(null);\n const [debugButtonMode, setDebugButtonMode] = useState<\"full\" | \"compact\">(\"full\");\n\n const checkForUpdates = (force: boolean = false) => {\n setVersionStatus(\"checking\");\n\n getPublishedCopilotKitVersion(currentVersion, force)\n .then((v) => {\n setLatestVersion(v.latest);\n let versionOk = false;\n\n // match exact version or a version with a letter (e.g. 1.0.0-alpha.1)\n if (v.current === v.latest) {\n versionOk = true;\n } else if (/[a-zA-Z]/.test(v.current)) {\n versionOk = true;\n }\n\n if (versionOk) {\n setVersionStatus(\"latest\");\n } else if (v.severity !== \"low\") {\n setVersionStatus(\"outdated\");\n } else {\n setVersionStatus(\"update-available\");\n }\n })\n .catch((e) => {\n console.error(e);\n setVersionStatus(\"unknown\");\n });\n };\n\n useEffect(() => {\n if (dontRunTwiceInDevMode.current === true) {\n return;\n }\n dontRunTwiceInDevMode.current = true;\n\n checkForUpdates();\n }, []);\n\n useEffect(() => {\n const handleResize = (entries: ResizeObserverEntry[]) => {\n for (let entry of entries) {\n if (entry.target === consoleRef.current) {\n const width = entry.contentRect.width;\n if (width < 400) {\n setDebugButtonMode(\"compact\");\n } else {\n setDebugButtonMode(\"full\");\n }\n }\n }\n };\n\n const observer = new ResizeObserver(handleResize);\n if (consoleRef.current) {\n observer.observe(consoleRef.current);\n\n const initialWidth = consoleRef.current.getBoundingClientRect().width;\n if (initialWidth < 400) {\n setDebugButtonMode(\"compact\");\n } else {\n setDebugButtonMode(\"full\");\n }\n }\n\n return () => {\n if (consoleRef.current) {\n observer.unobserve(consoleRef.current);\n }\n };\n }, [consoleRef.current]);\n\n if (!showDevConsole) {\n return null;\n }\n return (\n <div\n ref={consoleRef}\n className={\n \"copilotKitDevConsole \" +\n (versionStatus === \"update-available\" ? \"copilotKitDevConsoleUpgrade\" : \"\") +\n (versionStatus === \"outdated\" ? \"copilotKitDevConsoleWarnOutdated\" : \"\")\n }\n >\n <div className=\"copilotKitDevConsoleLogo\">\n <a href=\"https://copilotkit.ai\" target=\"_blank\">\n {CopilotKitIcon}\n </a>\n </div>\n <VersionInfo\n showDevConsole={context.showDevConsole}\n versionStatus={versionStatus}\n currentVersion={currentVersion}\n latestVersion={latestVersion}\n />\n\n <DebugMenuButton\n setShowDevConsole={setShowDevConsole}\n checkForUpdates={checkForUpdates}\n mode={debugButtonMode}\n />\n </div>\n );\n}\n\nfunction VersionInfo({\n showDevConsole,\n versionStatus,\n currentVersion,\n latestVersion,\n}: {\n showDevConsole: boolean | \"auto\";\n versionStatus: VersionStatus;\n currentVersion: string;\n latestVersion: string;\n}) {\n const [copyStatus, setCopyStatus] = useState<string>(\"\");\n\n let versionLabel = \"\";\n let versionIcon: any = \"\";\n let currentVersionLabel = currentVersion;\n\n if (versionStatus === \"latest\") {\n versionLabel = \"latest\";\n versionIcon = CheckIcon;\n } else if (versionStatus === \"checking\") {\n versionLabel = \"checking\";\n versionIcon = SmallSpinnerIcon;\n } else if (versionStatus === \"update-available\") {\n versionLabel = \"update available\";\n versionIcon = ExclamationMarkIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n } else if (versionStatus === \"outdated\") {\n versionLabel = \"outdated\";\n versionIcon = ExclamationMarkTriangleIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n }\n\n let asideLabel = \"\";\n if (showDevConsole === \"auto\") {\n asideLabel = \"(localhost only)\";\n } else if (showDevConsole === true) {\n asideLabel = \"(always on)\";\n }\n\n const installCommand = [\n `npm install`,\n `@copilotkit/react-core@${latestVersion}`,\n `@copilotkit/react-ui@${latestVersion}`,\n `@copilotkit/react-textarea@${latestVersion}`,\n ].join(\" \");\n\n const handleCopyClick = () => {\n navigator.clipboard.writeText(installCommand.trim()).then(() => {\n setCopyStatus(\"Command copied to clipboard!\");\n setTimeout(() => setCopyStatus(\"\"), 1000);\n });\n };\n\n return (\n <div className=\"copilotKitVersionInfo\">\n <header>\n COPILOTKIT DEV CONSOLE{showDevConsole === \"auto\" && <aside>{asideLabel}</aside>}\n </header>\n <section>\n Version: {versionLabel} ({currentVersionLabel}) {versionIcon}\n </section>\n {(versionStatus === \"update-available\" || versionStatus === \"outdated\") && (\n <footer>\n <button onClick={handleCopyClick}>{copyStatus || installCommand}</button>\n </footer>\n )}\n </div>\n );\n}\nexport default function DebugMenuButton({\n setShowDevConsole,\n checkForUpdates,\n mode,\n}: {\n setShowDevConsole: (show: boolean) => void;\n checkForUpdates: (force: boolean) => void;\n mode: \"full\" | \"compact\";\n}) {\n const context = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n\n return (\n <div className=\"bg-black top-24 w-52 text-right\">\n <Menu>\n <MenuButton className={`copilotKitDebugMenuButton ${mode === \"compact\" ? \"compact\" : \"\"}`}>\n {mode == \"compact\" ? \"Debug\" : <>Debug {ChevronDownIcon}</>}\n </MenuButton>\n\n <MenuItems\n transition\n anchor=\"bottom end\"\n className=\"copilotKitDebugMenu\"\n style={{ zIndex: 40 }}\n >\n <MenuItem>\n <button className=\"copilotKitDebugMenuItem\" onClick={() => logReadables(context)}>\n Log Readables\n </button>\n </MenuItem>\n <MenuItem>\n <button className=\"copilotKitDebugMenuItem\" onClick={() => logActions(context)}>\n Log Actions\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logMessages(messagesContext)}\n >\n Log Messages\n </button>\n </MenuItem>\n <MenuItem>\n <button className=\"copilotKitDebugMenuItem\" onClick={() => checkForUpdates(true)}>\n Check for Updates\n </button>\n </MenuItem>\n <hr />\n <MenuItem>\n <button className=\"copilotKitDebugMenuItem\" onClick={() => setShowDevConsole(false)}>\n Hide Dev Console\n </button>\n </MenuItem>\n </MenuItems>\n </Menu>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,SAAS,mBAAmB,iCAAiC;AAQ7D,SAAS,WAAW,QAAQ,gBAAgB;AAQ5C,SAAS,MAAM,YAAY,UAAU,iBAAiB;AACtD,SAAS,0BAA0B;AAqG/B,SAmHqC,UA1GjC,KATJ;AAhGG,SAAS,oBAAoB;AAClC,QAAM,iBA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AY,YAAY,MAClF,kBAAQ,YAAY,UAAU,iCAAE;AAAA;AAAA,MAAO;AAAA,OAAgB,GAC1D;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,YAAU;AAAA,QACV,QAAO;AAAA,QACP,WAAU;AAAA,QACV,OAAO,EAAE,QAAQ,GAAG;AAAA,QAEpB;AAAA,8BAAC,YACC,8BAAC,YAAO,WAAU,2BAA0B,SAAS,MAAM,aAAa,OAAO,GAAG,2BAElF,GACF;AAAA,UACA,oBAAC,YACC,8BAAC,YAAO,WAAU,2BAA0B,SAAS,MAAM,WAAW,OAAO,GAAG,yBAEhF,GACF;AAAA,UACA,oBAAC,YACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAS,MAAM,YAAY,eAAe;AAAA,cAC3C;AAAA;AAAA,UAED,GACF;AAAA,UACA,oBAAC,YACC,8BAAC,YAAO,WAAU,2BAA0B,SAAS,MAAM,gBAAgB,IAAI,GAAG,+BAElF,GACF;AAAA,UACA,oBAAC,QAAG;AAAA,UACJ,oBAAC,YACC,8BAAC,YAAO,WAAU,2BAA0B,SAAS,MAAM,kBAAkB,KAAK,GAAG,8BAErF,GACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|