@copilotkit/react-ui 1.8.5-next.1 → 1.8.5-next.2
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 +9 -0
- package/dist/{chunk-4TWPMWD4.mjs → chunk-GOAED4H6.mjs} +3 -3
- package/dist/{chunk-P7S3E5UW.mjs → chunk-HIORSNVD.mjs} +35 -7
- package/dist/chunk-HIORSNVD.mjs.map +1 -0
- package/dist/chunk-JGMFJZMG.mjs +11 -0
- package/dist/chunk-JGMFJZMG.mjs.map +1 -0
- package/dist/{chunk-6QV7AIIG.mjs → chunk-SMJ3QQCE.mjs} +2 -2
- package/dist/{chunk-U6ISBBRF.mjs → chunk-X6EFGEBJ.mjs} +2 -2
- package/dist/{chunk-MYUOPOIL.mjs → chunk-ZLRUNNS7.mjs} +4 -4
- package/dist/components/chat/Chat.mjs +3 -3
- package/dist/components/chat/Modal.js +66 -32
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +6 -5
- package/dist/components/chat/Popup.js +66 -32
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +7 -6
- package/dist/components/chat/Sidebar.js +66 -32
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +7 -6
- package/dist/components/chat/Window.js +39 -5
- package/dist/components/chat/Window.js.map +1 -1
- package/dist/components/chat/Window.mjs +2 -1
- package/dist/components/chat/index.js +66 -32
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +10 -9
- package/dist/components/chat/messages/AssistantMessage.mjs +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +1 -1
- package/dist/components/chat/messages/RenderResultMessage.mjs +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +1 -1
- package/dist/components/index.js +66 -32
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -9
- package/dist/hooks/use-dark-mode.d.ts +3 -0
- package/dist/hooks/use-dark-mode.js +35 -0
- package/dist/hooks/use-dark-mode.js.map +1 -0
- package/dist/hooks/use-dark-mode.mjs +8 -0
- package/dist/hooks/use-dark-mode.mjs.map +1 -0
- package/dist/index.css +25 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +68 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/package.json +4 -4
- package/src/components/chat/Window.tsx +26 -1
- package/src/css/input.css +1 -1
- package/src/css/window.css +27 -0
- package/src/hooks/use-dark-mode.ts +10 -0
- package/dist/chunk-P7S3E5UW.mjs.map +0 -1
- /package/dist/{chunk-4TWPMWD4.mjs.map → chunk-GOAED4H6.mjs.map} +0 -0
- /package/dist/{chunk-6QV7AIIG.mjs.map → chunk-SMJ3QQCE.mjs.map} +0 -0
- /package/dist/{chunk-U6ISBBRF.mjs.map → chunk-X6EFGEBJ.mjs.map} +0 -0
- /package/dist/{chunk-MYUOPOIL.mjs.map → chunk-ZLRUNNS7.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.8.5-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4b5452d: - feat: add powered-by-copilotkit watermark
|
|
8
|
+
- @copilotkit/react-core@1.8.5-next.2
|
|
9
|
+
- @copilotkit/runtime-client-gql@1.8.5-next.2
|
|
10
|
+
- @copilotkit/shared@1.8.5-next.2
|
|
11
|
+
|
|
3
12
|
## 1.8.5-next.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Window
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HIORSNVD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Header
|
|
6
6
|
} from "./chunk-2OTVZXDX.mjs";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-YOEL33HG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
CopilotChat
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZLRUNNS7.mjs";
|
|
13
13
|
import {
|
|
14
14
|
UserMessage
|
|
15
15
|
} from "./chunk-HEIDCT7I.mjs";
|
|
@@ -103,4 +103,4 @@ var CopilotModal = ({
|
|
|
103
103
|
export {
|
|
104
104
|
CopilotModal
|
|
105
105
|
};
|
|
106
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-GOAED4H6.mjs.map
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChatContext
|
|
3
3
|
} from "./chunk-UN2E3HCK.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useDarkMode
|
|
6
|
+
} from "./chunk-JGMFJZMG.mjs";
|
|
4
7
|
|
|
5
8
|
// src/components/chat/Window.tsx
|
|
6
9
|
import React, { useCallback, useEffect } from "react";
|
|
7
|
-
import {
|
|
10
|
+
import { useCopilotContext } from "@copilotkit/react-core";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
12
|
var Window = ({
|
|
9
13
|
children,
|
|
10
14
|
clickOutsideToClose,
|
|
11
15
|
shortcut,
|
|
12
16
|
hitEscapeToClose
|
|
13
17
|
}) => {
|
|
18
|
+
var _a;
|
|
14
19
|
const windowRef = React.useRef(null);
|
|
20
|
+
const context = useCopilotContext();
|
|
15
21
|
const { open, setOpen } = useChatContext();
|
|
16
22
|
const handleClickOutside = useCallback(
|
|
17
23
|
(event) => {
|
|
18
|
-
var
|
|
24
|
+
var _a2;
|
|
19
25
|
if (!clickOutsideToClose) {
|
|
20
26
|
return;
|
|
21
27
|
}
|
|
22
|
-
const parentElement = (
|
|
28
|
+
const parentElement = (_a2 = windowRef.current) == null ? void 0 : _a2.parentElement;
|
|
23
29
|
let className = "";
|
|
24
30
|
if (event.target instanceof HTMLElement) {
|
|
25
31
|
className = event.target.className;
|
|
@@ -33,10 +39,10 @@ var Window = ({
|
|
|
33
39
|
);
|
|
34
40
|
const handleKeyDown = useCallback(
|
|
35
41
|
(event) => {
|
|
36
|
-
var
|
|
42
|
+
var _a2;
|
|
37
43
|
const target = event.target;
|
|
38
44
|
const isInput = target.tagName === "INPUT" || target.tagName === "SELECT" || target.tagName === "TEXTAREA" || target.isContentEditable;
|
|
39
|
-
const isDescendantOfWrapper = (
|
|
45
|
+
const isDescendantOfWrapper = (_a2 = windowRef.current) == null ? void 0 : _a2.contains(target);
|
|
40
46
|
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
41
47
|
setOpen(false);
|
|
42
48
|
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
@@ -91,7 +97,29 @@ var Window = ({
|
|
|
91
97
|
}
|
|
92
98
|
};
|
|
93
99
|
}, [adjustForMobile, handleClickOutside, handleKeyDown]);
|
|
94
|
-
|
|
100
|
+
const isDark = useDarkMode();
|
|
101
|
+
const showPoweredBy = !((_a = context.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
102
|
+
const poweredByStyle = {
|
|
103
|
+
visibility: "visible",
|
|
104
|
+
display: "block",
|
|
105
|
+
position: "static",
|
|
106
|
+
textAlign: "center",
|
|
107
|
+
fontSize: "12px",
|
|
108
|
+
padding: "3px 0",
|
|
109
|
+
color: isDark ? "rgb(69, 69, 69)" : "rgb(214, 214, 214)"
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsxs(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: `copilotKitWindow ${showPoweredBy ? " poweredByContainer" : ""} ${open ? " open" : ""}`,
|
|
115
|
+
ref: windowRef,
|
|
116
|
+
children: [
|
|
117
|
+
children,
|
|
118
|
+
showPoweredBy && // @ts-expect-error -- expecting position not to be a string, but it can be.
|
|
119
|
+
/* @__PURE__ */ jsx("p", { className: "poweredBy", style: poweredByStyle, children: "Powered by CopilotKit" })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
95
123
|
};
|
|
96
124
|
var preventScroll = (event) => {
|
|
97
125
|
let targetElement = event.target;
|
|
@@ -115,4 +143,4 @@ function isMacOS() {
|
|
|
115
143
|
export {
|
|
116
144
|
Window
|
|
117
145
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-HIORSNVD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Window.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from \"react\";\nimport { WindowProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { useDarkMode } from \"../../hooks/use-dark-mode\";\n\nexport const Window = ({\n children,\n clickOutsideToClose,\n shortcut,\n hitEscapeToClose,\n}: WindowProps) => {\n const windowRef = React.useRef<HTMLDivElement>(null);\n const context = useCopilotContext();\n\n const { open, setOpen } = useChatContext();\n\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!clickOutsideToClose) {\n return;\n }\n\n const parentElement = windowRef.current?.parentElement;\n\n let className = \"\";\n if (event.target instanceof HTMLElement) {\n className = event.target.className;\n }\n\n if (\n open &&\n parentElement &&\n !parentElement.contains(event.target as any) &&\n // prevent closing the window when clicking on the debug menu\n !className.includes(\"copilotKitDebugMenu\")\n ) {\n setOpen(false);\n }\n },\n [clickOutsideToClose, open, setOpen],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isInput =\n target.tagName === \"INPUT\" ||\n target.tagName === \"SELECT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable;\n\n const isDescendantOfWrapper = windowRef.current?.contains(target);\n\n if (\n open &&\n event.key === \"Escape\" &&\n (!isInput || isDescendantOfWrapper) &&\n hitEscapeToClose\n ) {\n setOpen(false);\n } else if (\n event.key === shortcut &&\n ((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&\n (!isInput || isDescendantOfWrapper)\n ) {\n setOpen(!open);\n }\n },\n [hitEscapeToClose, shortcut, open, setOpen],\n );\n\n const adjustForMobile = useCallback(() => {\n const copilotKitWindow = windowRef.current;\n const vv = window.visualViewport;\n if (!copilotKitWindow || !vv) {\n return;\n }\n\n if (window.innerWidth < 640 && open) {\n copilotKitWindow.style.height = `${vv.height}px`;\n copilotKitWindow.style.left = `${vv.offsetLeft}px`;\n copilotKitWindow.style.top = `${vv.offsetTop}px`;\n\n document.body.style.position = \"fixed\";\n document.body.style.width = \"100%\";\n document.body.style.height = `${window.innerHeight}px`;\n document.body.style.overflow = \"hidden\";\n document.body.style.touchAction = \"none\";\n\n // Prevent scrolling on iOS\n document.body.addEventListener(\"touchmove\", preventScroll, {\n passive: false,\n });\n } else {\n copilotKitWindow.style.height = \"\";\n copilotKitWindow.style.left = \"\";\n copilotKitWindow.style.top = \"\";\n document.body.style.position = \"\";\n document.body.style.height = \"\";\n document.body.style.width = \"\";\n document.body.style.overflow = \"\";\n document.body.style.top = \"\";\n document.body.style.touchAction = \"\";\n\n document.body.removeEventListener(\"touchmove\", preventScroll);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.addEventListener(\"resize\", adjustForMobile);\n adjustForMobile();\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.removeEventListener(\"resize\", adjustForMobile);\n }\n };\n }, [adjustForMobile, handleClickOutside, handleKeyDown]);\n\n const isDark = useDarkMode();\n\n const showPoweredBy = !context.copilotApiConfig?.publicApiKey;\n const poweredByStyle = {\n visibility: \"visible\",\n display: \"block\",\n position: \"static\",\n textAlign: \"center\",\n fontSize: \"12px\",\n padding: \"3px 0\",\n color: isDark ? \"rgb(69, 69, 69)\" : \"rgb(214, 214, 214)\",\n };\n\n return (\n <div\n className={`copilotKitWindow ${showPoweredBy ? \" poweredByContainer\" : \"\"} ${open ? \" open\" : \"\"}`}\n ref={windowRef}\n >\n {children}\n {showPoweredBy && (\n // @ts-expect-error -- expecting position not to be a string, but it can be.\n <p className=\"poweredBy\" style={poweredByStyle}>\n Powered by CopilotKit\n </p>\n )}\n </div>\n );\n};\n\nconst preventScroll = (event: TouchEvent): void => {\n let targetElement = event.target as Element;\n\n // Function to check if the target has the parent with a given class\n const hasParentWithClass = (element: Element, className: string): boolean => {\n while (element && element !== document.body) {\n if (element.classList.contains(className)) {\n return true;\n }\n element = element.parentElement!;\n }\n return false;\n };\n\n // Check if the target of the touch event is inside an element with the 'copilotKitMessages' class\n if (!hasParentWithClass(targetElement, \"copilotKitMessages\")) {\n event.preventDefault();\n }\n};\n\nfunction isMacOS() {\n return /Mac|iMac|Macintosh/i.test(navigator.userAgent);\n}\n"],"mappings":"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","names":["_a"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/hooks/use-dark-mode.ts
|
|
2
|
+
var useDarkMode = () => {
|
|
3
|
+
if (typeof window === "undefined")
|
|
4
|
+
return false;
|
|
5
|
+
return document.documentElement.classList.contains("dark") || document.body.classList.contains("dark") || document.documentElement.getAttribute("data-theme") === "dark" || document.body.getAttribute("data-theme") === "dark" || window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
useDarkMode
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-JGMFJZMG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-dark-mode.ts"],"sourcesContent":["export const useDarkMode = () => {\n if (typeof window === \"undefined\") return false;\n return (\n document.documentElement.classList.contains(\"dark\") ||\n document.body.classList.contains(\"dark\") ||\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ||\n document.body.getAttribute(\"data-theme\") === \"dark\" ||\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n );\n};\n"],"mappings":";AAAO,IAAM,cAAc,MAAM;AAC/B,MAAI,OAAO,WAAW;AAAa,WAAO;AAC1C,SACE,SAAS,gBAAgB,UAAU,SAAS,MAAM,KAClD,SAAS,KAAK,UAAU,SAAS,MAAM,KACvC,SAAS,gBAAgB,aAAa,YAAY,MAAM,UACxD,SAAS,KAAK,aAAa,YAAY,MAAM,UAC7C,OAAO,WAAW,8BAA8B,EAAE;AAEtD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GOAED4H6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -18,4 +18,4 @@ function CopilotPopup(props) {
|
|
|
18
18
|
export {
|
|
19
19
|
CopilotPopup
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-SMJ3QQCE.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GOAED4H6.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-
|
|
30
|
+
//# sourceMappingURL=chunk-X6EFGEBJ.mjs.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RenderAgentStateMessage
|
|
3
|
+
} from "./chunk-Q2YY2NX3.mjs";
|
|
1
4
|
import {
|
|
2
5
|
RenderResultMessage
|
|
3
6
|
} from "./chunk-WNC6OCIB.mjs";
|
|
@@ -10,9 +13,6 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
RenderActionExecutionMessage
|
|
12
15
|
} from "./chunk-NMNC4ROZ.mjs";
|
|
13
|
-
import {
|
|
14
|
-
RenderAgentStateMessage
|
|
15
|
-
} from "./chunk-Q2YY2NX3.mjs";
|
|
16
16
|
import {
|
|
17
17
|
AssistantMessage
|
|
18
18
|
} from "./chunk-5M7ODWKH.mjs";
|
|
@@ -328,4 +328,4 @@ export {
|
|
|
328
328
|
WrappedCopilotChat,
|
|
329
329
|
useCopilotChatLogic
|
|
330
330
|
};
|
|
331
|
-
//# sourceMappingURL=chunk-
|
|
331
|
+
//# sourceMappingURL=chunk-ZLRUNNS7.mjs.map
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
CopilotChat,
|
|
3
3
|
WrappedCopilotChat,
|
|
4
4
|
useCopilotChatLogic
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-ZLRUNNS7.mjs";
|
|
6
|
+
import "../../chunk-Q2YY2NX3.mjs";
|
|
6
7
|
import "../../chunk-WNC6OCIB.mjs";
|
|
7
8
|
import "../../chunk-62QMTKMJ.mjs";
|
|
8
9
|
import "../../chunk-HEIDCT7I.mjs";
|
|
9
10
|
import "../../chunk-NMNC4ROZ.mjs";
|
|
10
|
-
import "../../chunk-Q2YY2NX3.mjs";
|
|
11
11
|
import "../../chunk-5M7ODWKH.mjs";
|
|
12
12
|
import "../../chunk-TOQ7P4DO.mjs";
|
|
13
13
|
import "../../chunk-QJKMOGWN.mjs";
|
|
14
14
|
import "../../chunk-YQFVRDNC.mjs";
|
|
15
15
|
import "../../chunk-XNQO5AZZ.mjs";
|
|
16
|
+
import "../../chunk-PCTCOQK2.mjs";
|
|
16
17
|
import "../../chunk-ZY25LVYR.mjs";
|
|
17
18
|
import "../../chunk-UN2E3HCK.mjs";
|
|
18
|
-
import "../../chunk-PCTCOQK2.mjs";
|
|
19
19
|
import "../../chunk-ORSMX3SE.mjs";
|
|
20
20
|
import "../../chunk-54JAUBUJ.mjs";
|
|
21
21
|
import "../../chunk-S5MBUNGN.mjs";
|
|
@@ -381,6 +381,16 @@ var ChatContextProvider = ({
|
|
|
381
381
|
|
|
382
382
|
// src/components/chat/Window.tsx
|
|
383
383
|
var import_react2 = __toESM(require("react"));
|
|
384
|
+
var import_react_core = require("@copilotkit/react-core");
|
|
385
|
+
|
|
386
|
+
// src/hooks/use-dark-mode.ts
|
|
387
|
+
var useDarkMode = () => {
|
|
388
|
+
if (typeof window === "undefined")
|
|
389
|
+
return false;
|
|
390
|
+
return document.documentElement.classList.contains("dark") || document.body.classList.contains("dark") || document.documentElement.getAttribute("data-theme") === "dark" || document.body.getAttribute("data-theme") === "dark" || window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// src/components/chat/Window.tsx
|
|
384
394
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
385
395
|
var Window = ({
|
|
386
396
|
children,
|
|
@@ -388,15 +398,17 @@ var Window = ({
|
|
|
388
398
|
shortcut,
|
|
389
399
|
hitEscapeToClose
|
|
390
400
|
}) => {
|
|
401
|
+
var _a;
|
|
391
402
|
const windowRef = import_react2.default.useRef(null);
|
|
403
|
+
const context = (0, import_react_core.useCopilotContext)();
|
|
392
404
|
const { open, setOpen } = useChatContext();
|
|
393
405
|
const handleClickOutside = (0, import_react2.useCallback)(
|
|
394
406
|
(event) => {
|
|
395
|
-
var
|
|
407
|
+
var _a2;
|
|
396
408
|
if (!clickOutsideToClose) {
|
|
397
409
|
return;
|
|
398
410
|
}
|
|
399
|
-
const parentElement = (
|
|
411
|
+
const parentElement = (_a2 = windowRef.current) == null ? void 0 : _a2.parentElement;
|
|
400
412
|
let className = "";
|
|
401
413
|
if (event.target instanceof HTMLElement) {
|
|
402
414
|
className = event.target.className;
|
|
@@ -410,10 +422,10 @@ var Window = ({
|
|
|
410
422
|
);
|
|
411
423
|
const handleKeyDown = (0, import_react2.useCallback)(
|
|
412
424
|
(event) => {
|
|
413
|
-
var
|
|
425
|
+
var _a2;
|
|
414
426
|
const target = event.target;
|
|
415
427
|
const isInput = target.tagName === "INPUT" || target.tagName === "SELECT" || target.tagName === "TEXTAREA" || target.isContentEditable;
|
|
416
|
-
const isDescendantOfWrapper = (
|
|
428
|
+
const isDescendantOfWrapper = (_a2 = windowRef.current) == null ? void 0 : _a2.contains(target);
|
|
417
429
|
if (open && event.key === "Escape" && (!isInput || isDescendantOfWrapper) && hitEscapeToClose) {
|
|
418
430
|
setOpen(false);
|
|
419
431
|
} else if (event.key === shortcut && (isMacOS() && event.metaKey || !isMacOS() && event.ctrlKey) && (!isInput || isDescendantOfWrapper)) {
|
|
@@ -468,7 +480,29 @@ var Window = ({
|
|
|
468
480
|
}
|
|
469
481
|
};
|
|
470
482
|
}, [adjustForMobile, handleClickOutside, handleKeyDown]);
|
|
471
|
-
|
|
483
|
+
const isDark = useDarkMode();
|
|
484
|
+
const showPoweredBy = !((_a = context.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
485
|
+
const poweredByStyle = {
|
|
486
|
+
visibility: "visible",
|
|
487
|
+
display: "block",
|
|
488
|
+
position: "static",
|
|
489
|
+
textAlign: "center",
|
|
490
|
+
fontSize: "12px",
|
|
491
|
+
padding: "3px 0",
|
|
492
|
+
color: isDark ? "rgb(69, 69, 69)" : "rgb(214, 214, 214)"
|
|
493
|
+
};
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
495
|
+
"div",
|
|
496
|
+
{
|
|
497
|
+
className: `copilotKitWindow ${showPoweredBy ? " poweredByContainer" : ""} ${open ? " open" : ""}`,
|
|
498
|
+
ref: windowRef,
|
|
499
|
+
children: [
|
|
500
|
+
children,
|
|
501
|
+
showPoweredBy && // @ts-expect-error -- expecting position not to be a string, but it can be.
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "poweredBy", style: poweredByStyle, children: "Powered by CopilotKit" })
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
);
|
|
472
506
|
};
|
|
473
507
|
var preventScroll = (event) => {
|
|
474
508
|
let targetElement = event.target;
|
|
@@ -507,7 +541,7 @@ var Button = ({}) => {
|
|
|
507
541
|
};
|
|
508
542
|
|
|
509
543
|
// src/components/dev-console/utils.ts
|
|
510
|
-
var
|
|
544
|
+
var import_react_core2 = require("@copilotkit/react-core");
|
|
511
545
|
function shouldShowDevConsole(showDevConsole) {
|
|
512
546
|
if (typeof showDevConsole === "boolean") {
|
|
513
547
|
return showDevConsole;
|
|
@@ -569,7 +603,7 @@ function getPublishedCopilotKitVersion(current, forceCheck = false) {
|
|
|
569
603
|
}
|
|
570
604
|
function logReadables(context) {
|
|
571
605
|
console.log("%cCurrent Readables:", "font-size: 16px; font-weight: bold;");
|
|
572
|
-
const readables = context.getContextString([],
|
|
606
|
+
const readables = context.getContextString([], import_react_core2.defaultCopilotContextCategories).trim();
|
|
573
607
|
if (readables.length === 0) {
|
|
574
608
|
console.log("No readables found");
|
|
575
609
|
return;
|
|
@@ -639,7 +673,7 @@ function logMessages(context) {
|
|
|
639
673
|
}
|
|
640
674
|
|
|
641
675
|
// src/components/dev-console/console.tsx
|
|
642
|
-
var
|
|
676
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
643
677
|
var import_react4 = require("react");
|
|
644
678
|
|
|
645
679
|
// src/components/dev-console/icons.tsx
|
|
@@ -829,7 +863,7 @@ function CopilotKitHelpModal() {
|
|
|
829
863
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
830
864
|
function CopilotDevConsole() {
|
|
831
865
|
const currentVersion = import_shared.COPILOTKIT_VERSION;
|
|
832
|
-
const context = (0,
|
|
866
|
+
const context = (0, import_react_core3.useCopilotContext)();
|
|
833
867
|
const [showDevConsole, setShowDevConsole] = (0, import_react4.useState)(false);
|
|
834
868
|
(0, import_react4.useEffect)(() => {
|
|
835
869
|
setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
|
|
@@ -960,8 +994,8 @@ function DebugMenuButton({
|
|
|
960
994
|
checkForUpdates,
|
|
961
995
|
mode
|
|
962
996
|
}) {
|
|
963
|
-
const context = (0,
|
|
964
|
-
const messagesContext = (0,
|
|
997
|
+
const context = (0, import_react_core3.useCopilotContext)();
|
|
998
|
+
const messagesContext = (0, import_react_core3.useCopilotMessagesContext)();
|
|
965
999
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react5.Menu, { children: [
|
|
966
1000
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
967
1001
|
import_react5.MenuButton,
|
|
@@ -1024,7 +1058,7 @@ var Header = ({}) => {
|
|
|
1024
1058
|
// src/components/chat/Messages.tsx
|
|
1025
1059
|
var import_react6 = require("react");
|
|
1026
1060
|
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
1027
|
-
var
|
|
1061
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
1028
1062
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1029
1063
|
var Messages = ({
|
|
1030
1064
|
messages,
|
|
@@ -1060,7 +1094,7 @@ var Messages = ({
|
|
|
1060
1094
|
}
|
|
1061
1095
|
}
|
|
1062
1096
|
const { messagesEndRef, messagesContainerRef } = useScrollToBottom(messages);
|
|
1063
|
-
const interrupt = (0,
|
|
1097
|
+
const interrupt = (0, import_react_core4.useLangGraphInterruptRender)();
|
|
1064
1098
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "copilotKitMessages", ref: messagesContainerRef, children: [
|
|
1065
1099
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "copilotKitMessagesContainer", children: [
|
|
1066
1100
|
messages.map((message, index) => {
|
|
@@ -1258,7 +1292,7 @@ var AutoResizingTextarea = (0, import_react7.forwardRef)(
|
|
|
1258
1292
|
var Textarea_default = AutoResizingTextarea;
|
|
1259
1293
|
|
|
1260
1294
|
// src/hooks/use-push-to-talk.tsx
|
|
1261
|
-
var
|
|
1295
|
+
var import_react_core5 = require("@copilotkit/react-core");
|
|
1262
1296
|
var import_react8 = require("react");
|
|
1263
1297
|
var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
|
|
1264
1298
|
if (!mediaStreamRef.current || !audioContextRef.current) {
|
|
@@ -1313,8 +1347,8 @@ var usePushToTalk = ({
|
|
|
1313
1347
|
const audioContextRef = (0, import_react8.useRef)(null);
|
|
1314
1348
|
const mediaRecorderRef = (0, import_react8.useRef)(null);
|
|
1315
1349
|
const recordedChunks = (0, import_react8.useRef)([]);
|
|
1316
|
-
const generalContext = (0,
|
|
1317
|
-
const messagesContext = (0,
|
|
1350
|
+
const generalContext = (0, import_react_core5.useCopilotContext)();
|
|
1351
|
+
const messagesContext = (0, import_react_core5.useCopilotMessagesContext)();
|
|
1318
1352
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
1319
1353
|
const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react8.useState)(null);
|
|
1320
1354
|
(0, import_react8.useEffect)(() => {
|
|
@@ -1362,11 +1396,11 @@ var usePushToTalk = ({
|
|
|
1362
1396
|
};
|
|
1363
1397
|
|
|
1364
1398
|
// src/components/chat/Input.tsx
|
|
1365
|
-
var
|
|
1399
|
+
var import_react_core6 = require("@copilotkit/react-core");
|
|
1366
1400
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1367
1401
|
var Input = ({ inProgress, onSend, isVisible = false, onStop }) => {
|
|
1368
1402
|
const context = useChatContext();
|
|
1369
|
-
const copilotContext = (0,
|
|
1403
|
+
const copilotContext = (0, import_react_core6.useCopilotContext)();
|
|
1370
1404
|
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
1371
1405
|
const textareaRef = (0, import_react9.useRef)(null);
|
|
1372
1406
|
const handleDivClick = (event) => {
|
|
@@ -2072,7 +2106,7 @@ function RenderTextMessage(_a) {
|
|
|
2072
2106
|
|
|
2073
2107
|
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
2074
2108
|
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
2075
|
-
var
|
|
2109
|
+
var import_react_core7 = require("@copilotkit/react-core");
|
|
2076
2110
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2077
2111
|
function RenderActionExecutionMessage(_a) {
|
|
2078
2112
|
var _b = _a, {
|
|
@@ -2080,7 +2114,7 @@ function RenderActionExecutionMessage(_a) {
|
|
|
2080
2114
|
} = _b, props = __objRest(_b, [
|
|
2081
2115
|
"AssistantMessage"
|
|
2082
2116
|
]);
|
|
2083
|
-
const { chatComponentsCache } = (0,
|
|
2117
|
+
const { chatComponentsCache } = (0, import_react_core7.useCopilotContext)();
|
|
2084
2118
|
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
2085
2119
|
if (message.isActionExecutionMessage()) {
|
|
2086
2120
|
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
@@ -2209,7 +2243,7 @@ function RenderResultMessage(_a) {
|
|
|
2209
2243
|
}
|
|
2210
2244
|
|
|
2211
2245
|
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
2212
|
-
var
|
|
2246
|
+
var import_react_core8 = require("@copilotkit/react-core");
|
|
2213
2247
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2214
2248
|
function RenderAgentStateMessage(_a) {
|
|
2215
2249
|
var _b = _a, {
|
|
@@ -2217,7 +2251,7 @@ function RenderAgentStateMessage(_a) {
|
|
|
2217
2251
|
} = _b, props = __objRest(_b, [
|
|
2218
2252
|
"AssistantMessage"
|
|
2219
2253
|
]);
|
|
2220
|
-
const { chatComponentsCache } = (0,
|
|
2254
|
+
const { chatComponentsCache } = (0, import_react_core8.useCopilotContext)();
|
|
2221
2255
|
const { message, inProgress, index, isCurrentMessage } = props;
|
|
2222
2256
|
if (message.isAgentStateMessage()) {
|
|
2223
2257
|
let render;
|
|
@@ -2310,7 +2344,7 @@ function RenderAgentStateMessage(_a) {
|
|
|
2310
2344
|
}
|
|
2311
2345
|
|
|
2312
2346
|
// src/components/chat/Suggestion.tsx
|
|
2313
|
-
var
|
|
2347
|
+
var import_react_core9 = require("@copilotkit/react-core");
|
|
2314
2348
|
var import_shared2 = require("@copilotkit/shared");
|
|
2315
2349
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
2316
2350
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
@@ -2342,7 +2376,7 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
2342
2376
|
for (const config of Object.values(chatSuggestionConfiguration)) {
|
|
2343
2377
|
try {
|
|
2344
2378
|
const numOfSuggestionsInstructions = config.minSuggestions === 0 ? `Produce up to ${config.maxSuggestions} suggestions. If there are no highly relevant suggestions you can think of, provide an empty array.` : `Produce between ${config.minSuggestions} and ${config.maxSuggestions} suggestions.`;
|
|
2345
|
-
const result = yield (0,
|
|
2379
|
+
const result = yield (0, import_react_core9.extract)({
|
|
2346
2380
|
context,
|
|
2347
2381
|
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls. ",
|
|
2348
2382
|
data: config.instructions + "\n\n" + numOfSuggestionsInstructions + "\n\nAvailable tools: " + tools + "\n\n",
|
|
@@ -2401,10 +2435,10 @@ var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggest
|
|
|
2401
2435
|
|
|
2402
2436
|
// src/components/chat/Chat.tsx
|
|
2403
2437
|
var import_react13 = __toESM(require("react"));
|
|
2404
|
-
var
|
|
2438
|
+
var import_react_core10 = require("@copilotkit/react-core");
|
|
2405
2439
|
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
2406
2440
|
var import_shared3 = require("@copilotkit/shared");
|
|
2407
|
-
var
|
|
2441
|
+
var import_react_core11 = require("@copilotkit/react-core");
|
|
2408
2442
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2409
2443
|
function CopilotChat({
|
|
2410
2444
|
instructions,
|
|
@@ -2429,7 +2463,7 @@ function CopilotChat({
|
|
|
2429
2463
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2430
2464
|
UserMessage: UserMessage2 = UserMessage
|
|
2431
2465
|
}) {
|
|
2432
|
-
const { additionalInstructions, setChatInstructions } = (0,
|
|
2466
|
+
const { additionalInstructions, setChatInstructions } = (0, import_react_core10.useCopilotContext)();
|
|
2433
2467
|
(0, import_react13.useEffect)(() => {
|
|
2434
2468
|
if (!(additionalInstructions == null ? void 0 : additionalInstructions.length)) {
|
|
2435
2469
|
setChatInstructions(instructions || "");
|
|
@@ -2533,7 +2567,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2533
2567
|
stopGeneration: defaultStopGeneration,
|
|
2534
2568
|
runChatCompletion,
|
|
2535
2569
|
isLoading
|
|
2536
|
-
} = (0,
|
|
2570
|
+
} = (0, import_react_core10.useCopilotChat)({
|
|
2537
2571
|
id: (0, import_shared3.randomId)(),
|
|
2538
2572
|
makeSystemMessage
|
|
2539
2573
|
});
|
|
@@ -2545,8 +2579,8 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2545
2579
|
(_a2 = suggestionsAbortControllerRef.current) == null ? void 0 : _a2.abort();
|
|
2546
2580
|
suggestionsAbortControllerRef.current = null;
|
|
2547
2581
|
};
|
|
2548
|
-
const generalContext = (0,
|
|
2549
|
-
const messagesContext = (0,
|
|
2582
|
+
const generalContext = (0, import_react_core10.useCopilotContext)();
|
|
2583
|
+
const messagesContext = (0, import_react_core10.useCopilotMessagesContext)();
|
|
2550
2584
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
2551
2585
|
(0, import_react13.useEffect)(() => {
|
|
2552
2586
|
onInProgress == null ? void 0 : onInProgress(isLoading);
|
|
@@ -2614,7 +2648,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2614
2648
|
});
|
|
2615
2649
|
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2616
2650
|
if (generalContext.agentSession) {
|
|
2617
|
-
yield (0,
|
|
2651
|
+
yield (0, import_react_core11.runAgent)(
|
|
2618
2652
|
generalContext.agentSession.agentName,
|
|
2619
2653
|
context,
|
|
2620
2654
|
appendMessage,
|
|
@@ -2625,7 +2659,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2625
2659
|
});
|
|
2626
2660
|
const stopCurrentAgent = () => {
|
|
2627
2661
|
if (generalContext.agentSession) {
|
|
2628
|
-
(0,
|
|
2662
|
+
(0, import_react_core11.stopAgent)(generalContext.agentSession.agentName, context);
|
|
2629
2663
|
}
|
|
2630
2664
|
};
|
|
2631
2665
|
const setCurrentAgentState = (state) => {
|