@copilotkit/react-ui 1.4.6 → 1.4.8-coagents-v0-3.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 +95 -8
- package/dist/{chunk-2B57NCBA.mjs → chunk-6GBOJUX4.mjs} +3 -3
- package/dist/{chunk-4T3TMQNJ.mjs → chunk-BH6PCAAL.mjs} +38 -2
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/{chunk-4LUMV4YO.mjs → chunk-EMQEEXUB.mjs} +8 -3
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/{chunk-63ZKP62F.mjs → chunk-H7UVF2NY.mjs} +3 -3
- package/dist/chunk-ICGZEGHQ.mjs +155 -0
- package/dist/chunk-ICGZEGHQ.mjs.map +1 -0
- package/dist/{chunk-DHGDU64D.mjs → chunk-M7MHMZ5O.mjs} +3 -3
- package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
- package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
- package/dist/{chunk-TKFQ7VQR.mjs → chunk-ROVHRIKR.mjs} +2 -2
- package/dist/{chunk-VYKDFXGS.mjs → chunk-VUK75M5B.mjs} +2 -2
- package/dist/components/chat/Chat.js +124 -5
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +6 -6
- package/dist/components/chat/Input.js +7 -2
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +1 -1
- package/dist/components/chat/Modal.js +124 -5
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +7 -7
- package/dist/components/chat/Popup.js +124 -5
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +8 -8
- package/dist/components/chat/Sidebar.js +124 -5
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +8 -8
- package/dist/components/chat/index.js +124 -5
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +9 -9
- package/dist/components/dev-console/console.js +117 -3
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +4 -4
- package/dist/components/dev-console/index.js +117 -3
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +4 -4
- package/dist/components/dev-console/utils.js +1 -1
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +1 -1
- package/dist/components/help-modal/icons.d.ts +4 -1
- package/dist/components/help-modal/icons.js +39 -2
- package/dist/components/help-modal/icons.js.map +1 -1
- package/dist/components/help-modal/icons.mjs +5 -3
- package/dist/components/help-modal/index.js +136 -2
- package/dist/components/help-modal/index.js.map +1 -1
- package/dist/components/help-modal/index.mjs +2 -2
- package/dist/components/help-modal/modal.js +136 -2
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +2 -2
- package/dist/components/index.js +124 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -9
- package/dist/index.js +124 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/package.json +4 -4
- package/src/components/chat/Input.tsx +9 -2
- package/src/components/dev-console/utils.ts +1 -1
- package/src/components/help-modal/icons.tsx +28 -0
- package/src/components/help-modal/modal.tsx +90 -27
- package/dist/chunk-4LUMV4YO.mjs.map +0 -1
- package/dist/chunk-4T3TMQNJ.mjs.map +0 -1
- package/dist/chunk-WOUWNTAV.mjs +0 -72
- package/dist/chunk-WOUWNTAV.mjs.map +0 -1
- /package/dist/{chunk-2B57NCBA.mjs.map → chunk-6GBOJUX4.mjs.map} +0 -0
- /package/dist/{chunk-63ZKP62F.mjs.map → chunk-H7UVF2NY.mjs.map} +0 -0
- /package/dist/{chunk-DHGDU64D.mjs.map → chunk-M7MHMZ5O.mjs.map} +0 -0
- /package/dist/{chunk-TKFQ7VQR.mjs.map → chunk-ROVHRIKR.mjs.map} +0 -0
- /package/dist/{chunk-VYKDFXGS.mjs.map → chunk-VUK75M5B.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,35 +1,122 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 1.4.8-coagents-v0-3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- CoAgents v0.3 prerelease
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @copilotkit/runtime-client-gql@1.4.8-coagents-v0-3.1
|
|
10
|
+
- @copilotkit/react-core@1.4.8-coagents-v0-3.1
|
|
11
|
+
- @copilotkit/shared@1.4.8-coagents-v0-3.1
|
|
12
|
+
|
|
13
|
+
## 1.4.8-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- ea0c5d5: - fix: prevent sending empty messages via Enter key
|
|
18
|
+
|
|
19
|
+
When the input field was empty, pressing Enter would still trigger the
|
|
20
|
+
send() function despite the send button being correctly disabled. Added
|
|
21
|
+
the sendDisabled check to the onKeyDown handler to ensure consistent
|
|
22
|
+
validation between button and keyboard triggers.
|
|
23
|
+
|
|
24
|
+
- Added validation check to Enter key handler
|
|
25
|
+
- Ensures empty messages can't be sent via keyboard shortcut
|
|
26
|
+
- Makes behavior consistent with disabled send button state
|
|
27
|
+
|
|
28
|
+
Resolves #1129
|
|
29
|
+
|
|
30
|
+
- @copilotkit/react-core@1.4.8-next.0
|
|
31
|
+
- @copilotkit/runtime-client-gql@1.4.8-next.0
|
|
32
|
+
- @copilotkit/shared@1.4.8-next.0
|
|
33
|
+
|
|
34
|
+
## 1.4.7
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Fix broken build script before release
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @copilotkit/react-core@1.4.7
|
|
41
|
+
- @copilotkit/runtime-client-gql@1.4.7
|
|
42
|
+
- @copilotkit/shared@1.4.7
|
|
43
|
+
|
|
3
44
|
## 1.4.6
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
|
6
47
|
|
|
7
48
|
- .
|
|
8
|
-
- Updated dependencies
|
|
9
|
-
- @copilotkit/runtime-client-gql@1.4.6
|
|
10
|
-
- @copilotkit/react-core@1.4.6
|
|
11
|
-
- @copilotkit/shared@1.4.6
|
|
12
49
|
|
|
13
50
|
## 1.4.5
|
|
14
51
|
|
|
15
52
|
### Patch Changes
|
|
16
53
|
|
|
17
|
-
-
|
|
54
|
+
- testing release workflow
|
|
18
55
|
- Updated dependencies
|
|
19
|
-
- @copilotkit/runtime-client-gql@1.4.5
|
|
20
56
|
- @copilotkit/react-core@1.4.5
|
|
57
|
+
- @copilotkit/runtime-client-gql@1.4.5
|
|
21
58
|
- @copilotkit/shared@1.4.5
|
|
22
59
|
|
|
23
|
-
## 1.4.
|
|
60
|
+
## 1.4.5-next.0
|
|
24
61
|
|
|
25
62
|
### Patch Changes
|
|
26
63
|
|
|
27
|
-
-
|
|
64
|
+
- testing release workflow
|
|
28
65
|
- Updated dependencies
|
|
66
|
+
- @copilotkit/react-core@1.4.5-next.0
|
|
67
|
+
- @copilotkit/runtime-client-gql@1.4.5-next.0
|
|
68
|
+
- @copilotkit/shared@1.4.5-next.0
|
|
69
|
+
|
|
70
|
+
## 1.4.4
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [e35e6ad]
|
|
29
75
|
- @copilotkit/react-core@1.4.4
|
|
30
76
|
- @copilotkit/runtime-client-gql@1.4.4
|
|
31
77
|
- @copilotkit/shared@1.4.4
|
|
32
78
|
|
|
79
|
+
## 1.4.4-next.4
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- @copilotkit/runtime-client-gql@1.4.4-next.4
|
|
84
|
+
- @copilotkit/react-core@1.4.4-next.4
|
|
85
|
+
- @copilotkit/shared@1.4.4-next.4
|
|
86
|
+
|
|
87
|
+
## 1.4.4-next.3
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- @copilotkit/runtime-client-gql@1.4.4-next.3
|
|
92
|
+
- @copilotkit/react-core@1.4.4-next.3
|
|
93
|
+
- @copilotkit/shared@1.4.4-next.3
|
|
94
|
+
|
|
95
|
+
## 1.4.4-next.2
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- @copilotkit/runtime-client-gql@1.4.4-next.2
|
|
100
|
+
- @copilotkit/react-core@1.4.4-next.2
|
|
101
|
+
- @copilotkit/shared@1.4.4-next.2
|
|
102
|
+
|
|
103
|
+
## 1.4.4-next.1
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- @copilotkit/runtime-client-gql@1.4.4-next.1
|
|
108
|
+
- @copilotkit/react-core@1.4.4-next.1
|
|
109
|
+
- @copilotkit/shared@1.4.4-next.1
|
|
110
|
+
|
|
111
|
+
## 1.4.4-next.0
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies [e35e6ad]
|
|
116
|
+
- @copilotkit/react-core@1.4.4-next.0
|
|
117
|
+
- @copilotkit/runtime-client-gql@1.4.4-next.0
|
|
118
|
+
- @copilotkit/shared@1.4.4-next.0
|
|
119
|
+
|
|
33
120
|
## 1.4.3
|
|
34
121
|
|
|
35
122
|
### Patch Changes
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
logMessages,
|
|
5
5
|
logReadables,
|
|
6
6
|
shouldShowDevConsole
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PNQVKBPN.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CopilotKitHelpModal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ICGZEGHQ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
CheckIcon,
|
|
13
13
|
ChevronDownIcon,
|
|
@@ -229,4 +229,4 @@ export {
|
|
|
229
229
|
CopilotDevConsole,
|
|
230
230
|
DebugMenuButton
|
|
231
231
|
};
|
|
232
|
-
//# sourceMappingURL=chunk-
|
|
232
|
+
//# sourceMappingURL=chunk-6GBOJUX4.mjs.map
|
|
@@ -37,9 +37,45 @@ var CloseIcon = () => /* @__PURE__ */ jsx(
|
|
|
37
37
|
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ jsxs(
|
|
41
|
+
"svg",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
45
|
+
color
|
|
46
|
+
},
|
|
47
|
+
width: "24",
|
|
48
|
+
height: "24",
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
50
|
+
fill: "none",
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"circle",
|
|
55
|
+
{
|
|
56
|
+
style: { opacity: 0.25 },
|
|
57
|
+
cx: "12",
|
|
58
|
+
cy: "12",
|
|
59
|
+
r: "10",
|
|
60
|
+
stroke: "currentColor",
|
|
61
|
+
strokeWidth: "4"
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
"path",
|
|
66
|
+
{
|
|
67
|
+
style: { opacity: 0.75 },
|
|
68
|
+
fill: "currentColor",
|
|
69
|
+
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"
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
40
75
|
|
|
41
76
|
export {
|
|
42
77
|
LifeBuoyIcon,
|
|
43
|
-
CloseIcon
|
|
78
|
+
CloseIcon,
|
|
79
|
+
LoadingSpinnerIcon
|
|
44
80
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-BH6PCAAL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/help-modal/icons.tsx"],"sourcesContent":["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":";AAeI,SACE,KADF;AAbG,IAAM,eAAe,MAC1B;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,WAAU;AAAA,IAEV,+BAAC,OAAE,WAAU,oBACX;AAAA,0BAAC,UAAK,QAAO,QAAO,GAAE,iBAAgB,MAAK,QAAO;AAAA,MAClD,oBAAC,UAAK,GAAE,4CAA2C;AAAA,MACnD,oBAAC,UAAK,GAAE,8CAA6C;AAAA,MACrD,oBAAC,UAAK,GAAE,oBAAmB;AAAA,MAC3B,oBAAC,UAAK,GAAE,oBAAmB;AAAA,MAC3B,oBAAC,UAAK,GAAE,wBAAuB;AAAA,MAC/B,oBAAC,UAAK,GAAE,0BAAyB;AAAA,OACnC;AAAA;AACF;AAGK,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,8BAAC,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;","names":[]}
|
|
@@ -44,7 +44,10 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
44
44
|
});
|
|
45
45
|
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
46
46
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
47
|
-
const
|
|
47
|
+
const canSend = () => {
|
|
48
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
49
|
+
};
|
|
50
|
+
const sendDisabled = !canSend();
|
|
48
51
|
return /* @__PURE__ */ jsxs("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
49
52
|
/* @__PURE__ */ jsx(
|
|
50
53
|
Textarea_default,
|
|
@@ -58,7 +61,9 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
58
61
|
onKeyDown: (event) => {
|
|
59
62
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
60
63
|
event.preventDefault();
|
|
61
|
-
|
|
64
|
+
if (canSend()) {
|
|
65
|
+
send();
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
69
|
}
|
|
@@ -89,4 +94,4 @@ var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
|
89
94
|
export {
|
|
90
95
|
Input
|
|
91
96
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-EMQEEXUB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Input.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { InputProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport AutoResizingTextarea from \"./Textarea\";\nimport { usePushToTalk } from \"../../hooks/use-push-to-talk\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\n\nexport const Input = ({ inProgress, onSend, isVisible = false }: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const handleDivClick = (event: React.MouseEvent<HTMLDivElement>) => {\n // Check if the clicked element is not the textarea itself\n if (event.target !== event.currentTarget) return;\n\n textareaRef.current?.focus();\n };\n\n const [text, setText] = useState(\"\");\n const send = () => {\n if (inProgress) return;\n onSend(text);\n setText(\"\");\n\n textareaRef.current?.focus();\n };\n\n useEffect(() => {\n if (isVisible) {\n textareaRef.current?.focus();\n }\n }, [isVisible]);\n\n const { pushToTalkState, setPushToTalkState } = usePushToTalk({\n sendFunction: onSend,\n inProgress,\n });\n\n const sendIcon =\n inProgress || pushToTalkState === \"transcribing\"\n ? context.icons.activityIcon\n : context.icons.sendIcon;\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const canSend = () => {\n return !inProgress && text.trim().length > 0 && pushToTalkState === \"idle\";\n };\n\n const sendDisabled = !canSend();\n\n return (\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={true}\n maxRows={5}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n if (canSend()) {\n send();\n }\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={pushToTalkState === \"recording\" ? \"copilotKitPushToTalkRecording\" : \"\"}\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={send}\n data-copilotkit-in-progress={!!inProgress}\n data-testid={inProgress ? \"copilot-chat-request-in-progress\" : undefined}\n >\n {sendIcon}\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAKnD,SAAS,yBAAyB;AAwD5B,cAgBA,YAhBA;AAtDC,IAAM,QAAQ,CAAC,EAAE,YAAY,QAAQ,YAAY,MAAM,MAAkB;AAC9E,QAAM,UAAU,eAAe;AAC/B,QAAM,iBAAiB,kBAAkB;AAEzC,QAAM,uBACJ,eAAe,iBAAiB,oBAAoB,UACpD,eAAe,iBAAiB,uBAAuB;AAEzD,QAAM,cAAc,OAA4B,IAAI;AAEpD,QAAM,iBAAiB,CAAC,UAA4C;AAjBtE;AAmBI,QAAI,MAAM,WAAW,MAAM;AAAe;AAE1C,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,OAAO,MAAM;AAzBrB;AA0BI,QAAI;AAAY;AAChB,WAAO,IAAI;AACX,YAAQ,EAAE;AAEV,sBAAY,YAAZ,mBAAqB;AAAA,EACvB;AAEA,YAAU,MAAM;AAjClB;AAkCI,QAAI,WAAW;AACb,wBAAY,Y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EJ;","names":[]}
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-RQNJNK2W.mjs";
|
|
10
10
|
import {
|
|
11
11
|
CopilotChat
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M7MHMZ5O.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Input
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EMQEEXUB.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Messages
|
|
18
18
|
} from "./chunk-RKPANT3F.mjs";
|
|
@@ -88,4 +88,4 @@ var CopilotModal = ({
|
|
|
88
88
|
export {
|
|
89
89
|
CopilotModal
|
|
90
90
|
};
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-H7UVF2NY.mjs.map
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CloseIcon,
|
|
3
|
+
LifeBuoyIcon,
|
|
4
|
+
LoadingSpinnerIcon
|
|
5
|
+
} from "./chunk-BH6PCAAL.mjs";
|
|
6
|
+
import {
|
|
7
|
+
__async
|
|
8
|
+
} from "./chunk-MRXNTQOX.mjs";
|
|
9
|
+
|
|
10
|
+
// src/components/help-modal/modal.tsx
|
|
11
|
+
import { useMemo, useState } from "react";
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function CopilotKitHelpModal() {
|
|
14
|
+
const [showHelpModal, setShowHelpModal] = useState(false);
|
|
15
|
+
const [issueDescription, setIssueDescription] = useState("");
|
|
16
|
+
const [email, setEmail] = useState("");
|
|
17
|
+
const [emailError, setEmailError] = useState("");
|
|
18
|
+
const [submitting, setSubmitting] = useState(false);
|
|
19
|
+
const validateEmail = (email2) => {
|
|
20
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
21
|
+
return re.test(email2);
|
|
22
|
+
};
|
|
23
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
26
|
+
setEmailError("Please enter a valid email address");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
setSubmitting(true);
|
|
30
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
31
|
+
method: "POST",
|
|
32
|
+
headers: {
|
|
33
|
+
"Content-Type": "application/json"
|
|
34
|
+
},
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
event: "oss.dev-console.help",
|
|
37
|
+
anonymousId: window.crypto.randomUUID(),
|
|
38
|
+
properties: { email, text: issueDescription },
|
|
39
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
setEmailError("");
|
|
43
|
+
setEmail("");
|
|
44
|
+
setIssueDescription("");
|
|
45
|
+
setSubmitting(false);
|
|
46
|
+
setShowHelpModal(false);
|
|
47
|
+
});
|
|
48
|
+
const HelpButton = () => /* @__PURE__ */ jsx(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
onClick: () => setShowHelpModal(true),
|
|
52
|
+
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",
|
|
53
|
+
"aria-label": "Open Help",
|
|
54
|
+
children: /* @__PURE__ */ jsx(LifeBuoyIcon, {})
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
const submitButtonDisabled = useMemo(
|
|
58
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
59
|
+
[submitting, emailError, issueDescription]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(HelpButton, {}),
|
|
63
|
+
showHelpModal && /* @__PURE__ */ jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
67
|
+
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
68
|
+
children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
73
|
+
style: { top: "10px", right: "10px" },
|
|
74
|
+
onClick: () => setShowHelpModal(false),
|
|
75
|
+
"aria-label": "Close",
|
|
76
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsx("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4 mb-4", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ jsx(
|
|
82
|
+
"a",
|
|
83
|
+
{
|
|
84
|
+
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
85
|
+
target: "_blank",
|
|
86
|
+
rel: "noopener noreferrer",
|
|
87
|
+
children: "Go to Discord Support Channel (Community Support)"
|
|
88
|
+
}
|
|
89
|
+
) }),
|
|
90
|
+
/* @__PURE__ */ jsx("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ jsx(
|
|
91
|
+
"a",
|
|
92
|
+
{
|
|
93
|
+
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
94
|
+
target: "_blank",
|
|
95
|
+
rel: "noopener noreferrer",
|
|
96
|
+
children: "Apply for Priority Direct Slack Support"
|
|
97
|
+
}
|
|
98
|
+
) })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
102
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"textarea",
|
|
105
|
+
{
|
|
106
|
+
id: "feedback",
|
|
107
|
+
rows: 4,
|
|
108
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
109
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
110
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
111
|
+
value: issueDescription,
|
|
112
|
+
required: true
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
117
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
"input",
|
|
120
|
+
{
|
|
121
|
+
type: "email",
|
|
122
|
+
id: "email",
|
|
123
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
124
|
+
placeholder: "Enter your email for follow-up",
|
|
125
|
+
onChange: (e) => {
|
|
126
|
+
setEmail(e.target.value);
|
|
127
|
+
setEmailError("");
|
|
128
|
+
},
|
|
129
|
+
value: email
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
emailError && /* @__PURE__ */ jsx("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ jsx("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ jsx(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
type: "submit",
|
|
138
|
+
onClick: handleSubmit,
|
|
139
|
+
disabled: submitButtonDisabled,
|
|
140
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
141
|
+
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",
|
|
142
|
+
children: submitting ? /* @__PURE__ */ jsx(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
143
|
+
}
|
|
144
|
+
) })
|
|
145
|
+
] })
|
|
146
|
+
] })
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
CopilotKitHelpModal
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=chunk-ICGZEGHQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/help-modal/modal.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [emailError, setEmailError] = useState(\"\");\n const [submitting, setSubmitting] = useState(false);\n\n const validateEmail = (email: string) => {\n const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return re.test(email);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (email?.length > 0 && !validateEmail(email)) {\n setEmailError(\"Please enter a valid email address\");\n return;\n }\n setSubmitting(true);\n\n await fetch(\"https://api.segment.io/v1/track\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n event: \"oss.dev-console.help\",\n anonymousId: window.crypto.randomUUID(),\n properties: { email, text: issueDescription },\n writeKey: \"q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW\",\n }),\n });\n\n // Reset\n setEmailError(\"\");\n setEmail(\"\");\n setIssueDescription(\"\");\n setSubmitting(false);\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n 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 ? <LoadingSpinner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AQ;AAAA;AAAA,cACT;AAAA,eACH;AAAA,YACA,qBAAC,SACC;AAAA,kCAAC,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,oBAAC,OAAE,WAAU,6BAA6B,sBAAW;AAAA,eACtE;AAAA,YACA,oBAAC,SAAI,WAAU,yEACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,UAAU;AAAA,gBACV,OACE,uBACI,EAAE,iBAAiB,sBAAsB,OAAO,qBAAqB,IACrE;AAAA,gBAEN,WAAU;AAAA,gBAET,uBAAa,oBAAC,sBAAmB,OAAM,SAAQ,IAAK;AAAA;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["email"]}
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from "./chunk-RJCZRKTV.mjs";
|
|
17
17
|
import {
|
|
18
18
|
CopilotDevConsole
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6GBOJUX4.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Input
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EMQEEXUB.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Messages
|
|
25
25
|
} from "./chunk-RKPANT3F.mjs";
|
|
@@ -198,4 +198,4 @@ export {
|
|
|
198
198
|
WrappedCopilotChat,
|
|
199
199
|
useCopilotChatLogic
|
|
200
200
|
};
|
|
201
|
-
//# sourceMappingURL=chunk-
|
|
201
|
+
//# sourceMappingURL=chunk-M7MHMZ5O.mjs.map
|
|
@@ -110,7 +110,7 @@ function logMessages(context) {
|
|
|
110
110
|
type: "ActionExecutionMessage",
|
|
111
111
|
role: void 0,
|
|
112
112
|
name: message.name,
|
|
113
|
-
scope: message.
|
|
113
|
+
scope: message.parentMessageId,
|
|
114
114
|
content: message.arguments
|
|
115
115
|
};
|
|
116
116
|
} else if (message.isResultMessage()) {
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
logActions,
|
|
144
144
|
logMessages
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-PNQVKBPN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/dev-console/utils.ts"],"sourcesContent":["import {\n CopilotContextParams,\n CopilotMessagesContextParams,\n defaultCopilotContextCategories,\n} from \"@copilotkit/react-core\";\nimport { CopilotKitVersion } from \"./types\";\nimport { ActionExecutionMessage, ResultMessage, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { AgentStateMessage } from \"@copilotkit/runtime-client-gql\";\n\nexport function shouldShowDevConsole(showDevConsole: boolean | \"auto\"): boolean {\n if (typeof showDevConsole === \"boolean\") {\n return showDevConsole;\n }\n return (\n getHostname() === \"localhost\" ||\n getHostname() === \"127.0.0.1\" ||\n getHostname() === \"0.0.0.0\" ||\n getHostname() === \"::1\"\n );\n}\n\nfunction getHostname(): string {\n if (typeof window !== \"undefined\" && window.location) {\n return window.location.hostname;\n }\n return \"\";\n}\n\nexport async function getPublishedCopilotKitVersion(\n current: string,\n forceCheck: boolean = false,\n): Promise<CopilotKitVersion> {\n const LOCAL_STORAGE_KEY = \"__copilotkit_version_check__\";\n const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);\n if (serializedVersion && !forceCheck) {\n try {\n const parsedVersion: CopilotKitVersion = JSON.parse(serializedVersion);\n const oneHour = 60 * 60 * 1000;\n const now = new Date().getTime();\n\n if (\n parsedVersion.current === current &&\n now - new Date(parsedVersion.lastChecked).getTime() < oneHour\n ) {\n return parsedVersion;\n }\n } catch (error) {\n console.error(\"Failed to parse CopilotKitVersion from localStorage\", error);\n }\n }\n\n try {\n const response = await fetch(\"https://api.cloud.stagingcopilotkit.ai/check-for-updates\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n packages: [\n {\n packageName: \"@copilotkit/shared\",\n packageVersion: current,\n },\n ],\n }),\n });\n\n const data = await response.json();\n\n const version: CopilotKitVersion = {\n current,\n lastChecked: new Date().getTime(),\n latest: data.packages[0].latestVersion,\n severity: data.packages[0].severity,\n advisory: data.packages[0].advisory || null,\n };\n\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));\n return version;\n } catch (error) {\n console.error(\"Failed to check for updates\", error);\n throw error;\n }\n}\n\nexport function logReadables(context: CopilotContextParams) {\n console.log(\"%cCurrent Readables:\", \"font-size: 16px; font-weight: bold;\");\n\n const readables = context.getContextString([], defaultCopilotContextCategories).trim();\n if (readables.length === 0) {\n console.log(\"No readables found\");\n return;\n }\n console.log(readables);\n}\n\nexport function logActions(context: CopilotContextParams) {\n console.log(\"%cCurrent Actions:\", \"font-size: 16px; font-weight: bold;\");\n\n if (Object.values(context.actions).length === 0) {\n console.log(\"No actions found\");\n return;\n }\n for (const action of Object.values(context.actions)) {\n console.group(action.name);\n console.log(\"name\", action.name);\n console.log(\"description\", action.description);\n console.log(\"parameters\", action.parameters);\n\n console.groupEnd();\n }\n}\n\nexport function logMessages(context: CopilotMessagesContextParams) {\n console.log(\"%cCurrent Messages:\", \"font-size: 16px; font-weight: bold;\");\n\n if (context.messages.length === 0) {\n console.log(\"No messages found\");\n return;\n }\n\n const tableData = context.messages.map((message) => {\n if (message.isTextMessage()) {\n return {\n id: message.id,\n type: \"TextMessage\",\n role: message.role,\n name: undefined,\n scope: undefined,\n content: message.content,\n };\n } else if (message.isActionExecutionMessage()) {\n return {\n id: message.id,\n type: \"ActionExecutionMessage\",\n role: undefined,\n name: message.name,\n scope: message.
|
|
1
|
+
{"version":3,"sources":["../src/components/dev-console/utils.ts"],"sourcesContent":["import {\n CopilotContextParams,\n CopilotMessagesContextParams,\n defaultCopilotContextCategories,\n} from \"@copilotkit/react-core\";\nimport { CopilotKitVersion } from \"./types\";\nimport { ActionExecutionMessage, ResultMessage, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { AgentStateMessage } from \"@copilotkit/runtime-client-gql\";\n\nexport function shouldShowDevConsole(showDevConsole: boolean | \"auto\"): boolean {\n if (typeof showDevConsole === \"boolean\") {\n return showDevConsole;\n }\n return (\n getHostname() === \"localhost\" ||\n getHostname() === \"127.0.0.1\" ||\n getHostname() === \"0.0.0.0\" ||\n getHostname() === \"::1\"\n );\n}\n\nfunction getHostname(): string {\n if (typeof window !== \"undefined\" && window.location) {\n return window.location.hostname;\n }\n return \"\";\n}\n\nexport async function getPublishedCopilotKitVersion(\n current: string,\n forceCheck: boolean = false,\n): Promise<CopilotKitVersion> {\n const LOCAL_STORAGE_KEY = \"__copilotkit_version_check__\";\n const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);\n if (serializedVersion && !forceCheck) {\n try {\n const parsedVersion: CopilotKitVersion = JSON.parse(serializedVersion);\n const oneHour = 60 * 60 * 1000;\n const now = new Date().getTime();\n\n if (\n parsedVersion.current === current &&\n now - new Date(parsedVersion.lastChecked).getTime() < oneHour\n ) {\n return parsedVersion;\n }\n } catch (error) {\n console.error(\"Failed to parse CopilotKitVersion from localStorage\", error);\n }\n }\n\n try {\n const response = await fetch(\"https://api.cloud.stagingcopilotkit.ai/check-for-updates\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n packages: [\n {\n packageName: \"@copilotkit/shared\",\n packageVersion: current,\n },\n ],\n }),\n });\n\n const data = await response.json();\n\n const version: CopilotKitVersion = {\n current,\n lastChecked: new Date().getTime(),\n latest: data.packages[0].latestVersion,\n severity: data.packages[0].severity,\n advisory: data.packages[0].advisory || null,\n };\n\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));\n return version;\n } catch (error) {\n console.error(\"Failed to check for updates\", error);\n throw error;\n }\n}\n\nexport function logReadables(context: CopilotContextParams) {\n console.log(\"%cCurrent Readables:\", \"font-size: 16px; font-weight: bold;\");\n\n const readables = context.getContextString([], defaultCopilotContextCategories).trim();\n if (readables.length === 0) {\n console.log(\"No readables found\");\n return;\n }\n console.log(readables);\n}\n\nexport function logActions(context: CopilotContextParams) {\n console.log(\"%cCurrent Actions:\", \"font-size: 16px; font-weight: bold;\");\n\n if (Object.values(context.actions).length === 0) {\n console.log(\"No actions found\");\n return;\n }\n for (const action of Object.values(context.actions)) {\n console.group(action.name);\n console.log(\"name\", action.name);\n console.log(\"description\", action.description);\n console.log(\"parameters\", action.parameters);\n\n console.groupEnd();\n }\n}\n\nexport function logMessages(context: CopilotMessagesContextParams) {\n console.log(\"%cCurrent Messages:\", \"font-size: 16px; font-weight: bold;\");\n\n if (context.messages.length === 0) {\n console.log(\"No messages found\");\n return;\n }\n\n const tableData = context.messages.map((message) => {\n if (message.isTextMessage()) {\n return {\n id: message.id,\n type: \"TextMessage\",\n role: message.role,\n name: undefined,\n scope: undefined,\n content: message.content,\n };\n } else if (message.isActionExecutionMessage()) {\n return {\n id: message.id,\n type: \"ActionExecutionMessage\",\n role: undefined,\n name: message.name,\n scope: message.parentMessageId,\n content: message.arguments,\n };\n } else if (message.isResultMessage()) {\n return {\n id: message.id,\n type: \"ResultMessage\",\n role: undefined,\n name: message.actionName,\n scope: message.actionExecutionId,\n content: message.result,\n };\n } else if (message.isAgentStateMessage()) {\n return {\n id: message.id,\n type: `AgentStateMessage (running: ${message.running})`,\n role: message.role,\n name: undefined,\n scope: message.threadId,\n content: message.state,\n };\n }\n });\n console.table(tableData);\n}\n"],"mappings":";;;;;AAAA;AAAA,EAGE;AAAA,OACK;AAKA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AG;AAC7C,aAAO;AAAA,QACL,IAAI,QAAQ;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM,QAAQ;AAAA,QACd,OAAO,QAAQ;AAAA,QACf,SAAS,QAAQ;AAAA,MACnB;AAAA,IACF,WAAW,QAAQ,gBAAgB,GAAG;AACpC,aAAO;AAAA,QACL,IAAI,QAAQ;AAAA,QACZ,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM,QAAQ;AAAA,QACd,OAAO,QAAQ;AAAA,QACf,SAAS,QAAQ;AAAA,MACnB;AAAA,IACF,WAAW,QAAQ,oBAAoB,GAAG;AACxC,aAAO;AAAA,QACL,IAAI,QAAQ;AAAA,QACZ,MAAM,+BAA+B,QAAQ;AAAA,QAC7C,MAAM,QAAQ;AAAA,QACd,MAAM;AAAA,QACN,OAAO,QAAQ;AAAA,QACf,SAAS,QAAQ;AAAA,MACnB;AAAA,IACF;AAAA,EACF,CAAC;AACD,UAAQ,MAAM,SAAS;AACzB;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7UVF2NY.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-ROVHRIKR.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7UVF2NY.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-VUK75M5B.mjs.map
|