@copilotkit/react-ui 1.5.11 → 1.5.12-next.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 +20 -0
- package/dist/{chunk-7II4YL7R.mjs → chunk-34FREWVK.mjs} +16 -6
- package/dist/chunk-34FREWVK.mjs.map +1 -0
- package/dist/chunk-3VNMQWGT.mjs +25 -0
- package/dist/chunk-3VNMQWGT.mjs.map +1 -0
- package/dist/{chunk-WSMMTZCM.mjs → chunk-B23XDGH4.mjs} +2 -2
- package/dist/chunk-F7VWGY77.mjs +22 -0
- package/dist/chunk-F7VWGY77.mjs.map +1 -0
- package/dist/chunk-HEIDCT7I.mjs +10 -0
- package/dist/chunk-HEIDCT7I.mjs.map +1 -0
- package/dist/{chunk-DCNCY2PL.mjs → chunk-I7MG52I5.mjs} +19 -9
- package/dist/chunk-I7MG52I5.mjs.map +1 -0
- package/dist/{chunk-375NVWZM.mjs → chunk-O6JFOQQA.mjs} +2 -2
- package/dist/chunk-OFYI4UU4.mjs +35 -0
- package/dist/chunk-OFYI4UU4.mjs.map +1 -0
- package/dist/{chunk-3E7HY2UN.mjs → chunk-P5A3A5FO.mjs} +58 -31
- package/dist/chunk-P5A3A5FO.mjs.map +1 -0
- package/dist/chunk-SQMEPWVT.mjs +1 -0
- package/dist/chunk-UWWMAJ7R.mjs +100 -0
- package/dist/chunk-UWWMAJ7R.mjs.map +1 -0
- package/dist/{chunk-UWVGLGFQ.mjs → chunk-VKVNMHM5.mjs} +14 -4
- package/dist/chunk-VKVNMHM5.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +10 -2
- package/dist/components/chat/Chat.js +384 -271
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +8 -6
- package/dist/components/chat/Messages.d.ts +1 -1
- package/dist/components/chat/Messages.js +15 -5
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +1 -1
- package/dist/components/chat/Modal.d.ts +1 -1
- package/dist/components/chat/Modal.js +396 -279
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +9 -7
- package/dist/components/chat/Popup.js +398 -281
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +10 -8
- package/dist/components/chat/Sidebar.js +398 -281
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +10 -8
- package/dist/components/chat/index.d.ts +4 -1
- package/dist/components/chat/index.js +406 -283
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +22 -11
- package/dist/components/chat/messages/AssistantMessage.d.ts +7 -0
- package/dist/components/chat/messages/AssistantMessage.js +615 -0
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
- package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +59 -54
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderAgentStateMessage.js +55 -42
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderResultMessage.js +11 -29
- package/dist/components/chat/messages/RenderResultMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderResultMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderTextMessage.js +11 -581
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +1 -6
- package/dist/components/chat/messages/UserMessage.d.ts +7 -0
- package/dist/components/chat/messages/UserMessage.js +34 -0
- package/dist/components/chat/messages/UserMessage.js.map +1 -0
- package/dist/components/chat/messages/UserMessage.mjs +8 -0
- package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +36 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +406 -283
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +22 -11
- package/dist/index.d.ts +4 -1
- package/dist/index.js +406 -283
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -11
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +25 -1
- package/src/components/chat/Messages.tsx +10 -0
- package/src/components/chat/Modal.tsx +7 -0
- package/src/components/chat/index.tsx +3 -0
- package/src/components/chat/messages/AssistantMessage.tsx +20 -0
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +45 -24
- package/src/components/chat/messages/RenderAgentStateMessage.tsx +39 -19
- package/src/components/chat/messages/RenderResultMessage.tsx +9 -7
- package/src/components/chat/messages/RenderTextMessage.tsx +12 -19
- package/src/components/chat/messages/UserMessage.tsx +5 -0
- package/src/components/chat/props.ts +43 -0
- package/dist/chunk-3E7HY2UN.mjs.map +0 -1
- package/dist/chunk-6INMITFA.mjs +0 -18
- package/dist/chunk-6INMITFA.mjs.map +0 -1
- package/dist/chunk-7II4YL7R.mjs.map +0 -1
- package/dist/chunk-DCNCY2PL.mjs.map +0 -1
- package/dist/chunk-MRFF7GSQ.mjs +0 -1
- package/dist/chunk-RU73BEZM.mjs +0 -41
- package/dist/chunk-RU73BEZM.mjs.map +0 -1
- package/dist/chunk-UWVGLGFQ.mjs.map +0 -1
- package/dist/chunk-ZABXREBH.mjs +0 -65
- package/dist/chunk-ZABXREBH.mjs.map +0 -1
- /package/dist/{chunk-WSMMTZCM.mjs.map → chunk-B23XDGH4.mjs.map} +0 -0
- /package/dist/{chunk-375NVWZM.mjs.map → chunk-O6JFOQQA.mjs.map} +0 -0
- /package/dist/{chunk-MRFF7GSQ.mjs.map → chunk-SQMEPWVT.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -80,10 +80,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
80
80
|
// src/index.tsx
|
|
81
81
|
var src_exports = {};
|
|
82
82
|
__export(src_exports, {
|
|
83
|
+
AssistantMessage: () => AssistantMessage,
|
|
83
84
|
CopilotChat: () => CopilotChat,
|
|
84
85
|
CopilotDevConsole: () => CopilotDevConsole,
|
|
85
86
|
CopilotPopup: () => CopilotPopup,
|
|
86
87
|
CopilotSidebar: () => CopilotSidebar,
|
|
88
|
+
Markdown: () => Markdown,
|
|
89
|
+
UserMessage: () => UserMessage,
|
|
87
90
|
shouldShowDevConsole: () => shouldShowDevConsole,
|
|
88
91
|
useChatContext: () => useChatContext,
|
|
89
92
|
useCopilotChatSuggestions: () => useCopilotChatSuggestions
|
|
@@ -543,7 +546,9 @@ var Messages = ({
|
|
|
543
546
|
RenderTextMessage: RenderTextMessage2,
|
|
544
547
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
545
548
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
546
|
-
RenderResultMessage: RenderResultMessage2
|
|
549
|
+
RenderResultMessage: RenderResultMessage2,
|
|
550
|
+
AssistantMessage: AssistantMessage2,
|
|
551
|
+
UserMessage: UserMessage2
|
|
547
552
|
}) => {
|
|
548
553
|
const context = useChatContext();
|
|
549
554
|
const initialMessages = (0, import_react3.useMemo)(
|
|
@@ -574,7 +579,9 @@ var Messages = ({
|
|
|
574
579
|
message,
|
|
575
580
|
inProgress,
|
|
576
581
|
index,
|
|
577
|
-
isCurrentMessage
|
|
582
|
+
isCurrentMessage,
|
|
583
|
+
AssistantMessage: AssistantMessage2,
|
|
584
|
+
UserMessage: UserMessage2
|
|
578
585
|
},
|
|
579
586
|
index
|
|
580
587
|
);
|
|
@@ -586,7 +593,9 @@ var Messages = ({
|
|
|
586
593
|
inProgress,
|
|
587
594
|
index,
|
|
588
595
|
isCurrentMessage,
|
|
589
|
-
actionResult: actionResults[message.id]
|
|
596
|
+
actionResult: actionResults[message.id],
|
|
597
|
+
AssistantMessage: AssistantMessage2,
|
|
598
|
+
UserMessage: UserMessage2
|
|
590
599
|
},
|
|
591
600
|
index
|
|
592
601
|
);
|
|
@@ -597,7 +606,9 @@ var Messages = ({
|
|
|
597
606
|
message,
|
|
598
607
|
inProgress,
|
|
599
608
|
index,
|
|
600
|
-
isCurrentMessage
|
|
609
|
+
isCurrentMessage,
|
|
610
|
+
AssistantMessage: AssistantMessage2,
|
|
611
|
+
UserMessage: UserMessage2
|
|
601
612
|
},
|
|
602
613
|
index
|
|
603
614
|
);
|
|
@@ -608,7 +619,9 @@ var Messages = ({
|
|
|
608
619
|
message,
|
|
609
620
|
inProgress,
|
|
610
621
|
index,
|
|
611
|
-
isCurrentMessage
|
|
622
|
+
isCurrentMessage,
|
|
623
|
+
AssistantMessage: AssistantMessage2,
|
|
624
|
+
UserMessage: UserMessage2
|
|
612
625
|
},
|
|
613
626
|
index
|
|
614
627
|
);
|
|
@@ -941,6 +954,259 @@ var ResponseButton = ({ onClick, inProgress }) => {
|
|
|
941
954
|
] });
|
|
942
955
|
};
|
|
943
956
|
|
|
957
|
+
// src/components/chat/messages/RenderTextMessage.tsx
|
|
958
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
959
|
+
function RenderTextMessage(props) {
|
|
960
|
+
const { message, inProgress, index, isCurrentMessage, UserMessage: UserMessage2, AssistantMessage: AssistantMessage2 } = props;
|
|
961
|
+
if (message.isTextMessage()) {
|
|
962
|
+
if (message.role === "user") {
|
|
963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
964
|
+
UserMessage2,
|
|
965
|
+
{
|
|
966
|
+
"data-message-role": "user",
|
|
967
|
+
message: message.content,
|
|
968
|
+
rawData: message
|
|
969
|
+
},
|
|
970
|
+
index
|
|
971
|
+
);
|
|
972
|
+
} else if (message.role == "assistant") {
|
|
973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
974
|
+
AssistantMessage2,
|
|
975
|
+
{
|
|
976
|
+
"data-message-role": "assistant",
|
|
977
|
+
message: message.content,
|
|
978
|
+
rawData: message,
|
|
979
|
+
isLoading: inProgress && isCurrentMessage && !message.content,
|
|
980
|
+
isGenerating: inProgress && isCurrentMessage && !!message.content
|
|
981
|
+
},
|
|
982
|
+
index
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
989
|
+
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
990
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
991
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
992
|
+
function RenderActionExecutionMessage(props) {
|
|
993
|
+
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
994
|
+
const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage: AssistantMessage2 } = props;
|
|
995
|
+
if (message.isActionExecutionMessage()) {
|
|
996
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
997
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
998
|
+
if (typeof render === "string") {
|
|
999
|
+
if (isCurrentMessage && inProgress) {
|
|
1000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1001
|
+
AssistantMessage2,
|
|
1002
|
+
{
|
|
1003
|
+
rawData: message,
|
|
1004
|
+
"data-message-role": "assistant",
|
|
1005
|
+
isLoading: false,
|
|
1006
|
+
isGenerating: true,
|
|
1007
|
+
message: render
|
|
1008
|
+
},
|
|
1009
|
+
index
|
|
1010
|
+
);
|
|
1011
|
+
} else {
|
|
1012
|
+
return null;
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
const args = message.arguments;
|
|
1016
|
+
let status = "inProgress";
|
|
1017
|
+
if (actionResult !== void 0) {
|
|
1018
|
+
status = "complete";
|
|
1019
|
+
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1020
|
+
status = "executing";
|
|
1021
|
+
}
|
|
1022
|
+
try {
|
|
1023
|
+
const toRender = render({
|
|
1024
|
+
status,
|
|
1025
|
+
args,
|
|
1026
|
+
result: actionResult,
|
|
1027
|
+
name: message.name
|
|
1028
|
+
});
|
|
1029
|
+
if (!toRender && status === "complete") {
|
|
1030
|
+
return null;
|
|
1031
|
+
}
|
|
1032
|
+
if (typeof toRender === "string") {
|
|
1033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1034
|
+
AssistantMessage2,
|
|
1035
|
+
{
|
|
1036
|
+
rawData: message,
|
|
1037
|
+
"data-message-role": "assistant",
|
|
1038
|
+
isLoading: false,
|
|
1039
|
+
isGenerating: false,
|
|
1040
|
+
message: toRender
|
|
1041
|
+
},
|
|
1042
|
+
index
|
|
1043
|
+
);
|
|
1044
|
+
} else {
|
|
1045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1046
|
+
AssistantMessage2,
|
|
1047
|
+
{
|
|
1048
|
+
rawData: message,
|
|
1049
|
+
"data-message-role": "action-render",
|
|
1050
|
+
isLoading: false,
|
|
1051
|
+
isGenerating: false,
|
|
1052
|
+
subComponent: toRender
|
|
1053
|
+
},
|
|
1054
|
+
index
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
} catch (e) {
|
|
1058
|
+
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1060
|
+
AssistantMessage2,
|
|
1061
|
+
{
|
|
1062
|
+
rawData: message,
|
|
1063
|
+
"data-message-role": "assistant",
|
|
1064
|
+
isLoading: false,
|
|
1065
|
+
isGenerating: false,
|
|
1066
|
+
subComponent: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1067
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("b", { children: [
|
|
1068
|
+
"\u274C Error executing render: ",
|
|
1069
|
+
message.name
|
|
1070
|
+
] }),
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
|
|
1072
|
+
e instanceof Error ? e.message : String(e)
|
|
1073
|
+
] })
|
|
1074
|
+
},
|
|
1075
|
+
index
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1080
|
+
return null;
|
|
1081
|
+
} else {
|
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1083
|
+
AssistantMessage2,
|
|
1084
|
+
{
|
|
1085
|
+
rawData: message,
|
|
1086
|
+
"data-message-role": "assistant",
|
|
1087
|
+
isLoading: true,
|
|
1088
|
+
isGenerating: true
|
|
1089
|
+
},
|
|
1090
|
+
index
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1097
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1098
|
+
function RenderResultMessage(props) {
|
|
1099
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1100
|
+
if (message.isResultMessage() && inProgress && isCurrentMessage) {
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1102
|
+
AssistantMessage2,
|
|
1103
|
+
{
|
|
1104
|
+
"data-message-role": "assistant",
|
|
1105
|
+
rawData: message,
|
|
1106
|
+
isLoading: true,
|
|
1107
|
+
isGenerating: true
|
|
1108
|
+
},
|
|
1109
|
+
index
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
1115
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
1116
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1117
|
+
function RenderAgentStateMessage(props) {
|
|
1118
|
+
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1119
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1120
|
+
if (message.isAgentStateMessage()) {
|
|
1121
|
+
let render;
|
|
1122
|
+
if (chatComponentsCache.current !== null) {
|
|
1123
|
+
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1124
|
+
}
|
|
1125
|
+
if (render) {
|
|
1126
|
+
if (typeof render === "string") {
|
|
1127
|
+
if (isCurrentMessage && inProgress) {
|
|
1128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1129
|
+
AssistantMessage2,
|
|
1130
|
+
{
|
|
1131
|
+
rawData: message,
|
|
1132
|
+
message: render,
|
|
1133
|
+
"data-message-role": "assistant",
|
|
1134
|
+
isLoading: true,
|
|
1135
|
+
isGenerating: true
|
|
1136
|
+
},
|
|
1137
|
+
index
|
|
1138
|
+
);
|
|
1139
|
+
} else {
|
|
1140
|
+
return null;
|
|
1141
|
+
}
|
|
1142
|
+
} else {
|
|
1143
|
+
const state = message.state;
|
|
1144
|
+
let status = message.active ? "inProgress" : "complete";
|
|
1145
|
+
const toRender = render({
|
|
1146
|
+
status,
|
|
1147
|
+
state,
|
|
1148
|
+
nodeName: message.nodeName
|
|
1149
|
+
});
|
|
1150
|
+
if (!toRender && status === "complete") {
|
|
1151
|
+
return null;
|
|
1152
|
+
}
|
|
1153
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
1154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1155
|
+
AssistantMessage2,
|
|
1156
|
+
{
|
|
1157
|
+
"data-message-role": "assistant",
|
|
1158
|
+
rawData: message,
|
|
1159
|
+
isLoading: true,
|
|
1160
|
+
isGenerating: true
|
|
1161
|
+
},
|
|
1162
|
+
index
|
|
1163
|
+
);
|
|
1164
|
+
} else if (!toRender) {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
if (typeof toRender === "string") {
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1169
|
+
AssistantMessage2,
|
|
1170
|
+
{
|
|
1171
|
+
rawData: message,
|
|
1172
|
+
message: toRender,
|
|
1173
|
+
isLoading: true,
|
|
1174
|
+
isGenerating: true,
|
|
1175
|
+
"data-message-role": "assistant"
|
|
1176
|
+
},
|
|
1177
|
+
index
|
|
1178
|
+
);
|
|
1179
|
+
} else {
|
|
1180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1181
|
+
AssistantMessage2,
|
|
1182
|
+
{
|
|
1183
|
+
rawData: message,
|
|
1184
|
+
"data-message-role": "agent-state-render",
|
|
1185
|
+
isLoading: false,
|
|
1186
|
+
isGenerating: false,
|
|
1187
|
+
subComponent: toRender
|
|
1188
|
+
},
|
|
1189
|
+
index
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1194
|
+
return null;
|
|
1195
|
+
} else {
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1197
|
+
AssistantMessage2,
|
|
1198
|
+
{
|
|
1199
|
+
rawData: message,
|
|
1200
|
+
isLoading: true,
|
|
1201
|
+
isGenerating: true,
|
|
1202
|
+
"data-message-role": "assistant"
|
|
1203
|
+
},
|
|
1204
|
+
index
|
|
1205
|
+
);
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
944
1210
|
// src/components/chat/Markdown.tsx
|
|
945
1211
|
var import_react8 = require("react");
|
|
946
1212
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
@@ -972,7 +1238,7 @@ function useCopyToClipboard({ timeout = 2e3 }) {
|
|
|
972
1238
|
}
|
|
973
1239
|
|
|
974
1240
|
// src/components/chat/CodeBlock.tsx
|
|
975
|
-
var
|
|
1241
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
976
1242
|
var programmingLanguages = {
|
|
977
1243
|
javascript: ".js",
|
|
978
1244
|
python: ".py",
|
|
@@ -1035,21 +1301,21 @@ var CodeBlock = (0, import_react7.memo)(({ language, value }) => {
|
|
|
1035
1301
|
return;
|
|
1036
1302
|
copyToClipboard(value);
|
|
1037
1303
|
};
|
|
1038
|
-
return /* @__PURE__ */ (0,
|
|
1039
|
-
/* @__PURE__ */ (0,
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
1041
|
-
/* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1044
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlock", children: [
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
|
|
1308
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DownloadIcon, {}),
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Download" })
|
|
1045
1311
|
] }),
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1047
|
-
isCopied ? /* @__PURE__ */ (0,
|
|
1048
|
-
/* @__PURE__ */ (0,
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
|
|
1313
|
+
isCopied ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CopyIcon, {}),
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Copy code" })
|
|
1049
1315
|
] })
|
|
1050
1316
|
] })
|
|
1051
1317
|
] }),
|
|
1052
|
-
/* @__PURE__ */ (0,
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1053
1319
|
import_react_syntax_highlighter.Prism,
|
|
1054
1320
|
{
|
|
1055
1321
|
language,
|
|
@@ -1352,21 +1618,21 @@ var highlightStyle = {
|
|
|
1352
1618
|
// src/components/chat/Markdown.tsx
|
|
1353
1619
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
1354
1620
|
var import_remark_math = __toESM(require("remark-math"));
|
|
1355
|
-
var
|
|
1621
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1356
1622
|
var MemoizedReactMarkdown = (0, import_react8.memo)(
|
|
1357
1623
|
import_react_markdown.default,
|
|
1358
1624
|
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
|
|
1359
1625
|
);
|
|
1360
1626
|
var Markdown = ({ content }) => {
|
|
1361
|
-
return /* @__PURE__ */ (0,
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "copilotKitMarkdown", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoizedReactMarkdown, { components, remarkPlugins: [import_remark_gfm.default, import_remark_math.default], children: content }) });
|
|
1362
1628
|
};
|
|
1363
1629
|
var components = {
|
|
1364
1630
|
p({ children }) {
|
|
1365
|
-
return /* @__PURE__ */ (0,
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children });
|
|
1366
1632
|
},
|
|
1367
1633
|
a(_a) {
|
|
1368
1634
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1369
|
-
return /* @__PURE__ */ (0,
|
|
1635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1370
1636
|
"a",
|
|
1371
1637
|
__spreadProps(__spreadValues({
|
|
1372
1638
|
style: { color: "blue", textDecoration: "underline" }
|
|
@@ -1381,7 +1647,7 @@ var components = {
|
|
|
1381
1647
|
var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
|
|
1382
1648
|
if (children.length) {
|
|
1383
1649
|
if (children[0] == "\u258D") {
|
|
1384
|
-
return /* @__PURE__ */ (0,
|
|
1650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1385
1651
|
"span",
|
|
1386
1652
|
{
|
|
1387
1653
|
style: {
|
|
@@ -1396,9 +1662,9 @@ var components = {
|
|
|
1396
1662
|
}
|
|
1397
1663
|
const match = /language-(\w+)/.exec(className || "");
|
|
1398
1664
|
if (inline) {
|
|
1399
|
-
return /* @__PURE__ */ (0,
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
|
|
1400
1666
|
}
|
|
1401
|
-
return /* @__PURE__ */ (0,
|
|
1667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1402
1668
|
CodeBlock,
|
|
1403
1669
|
__spreadValues({
|
|
1404
1670
|
language: match && match[1] || "",
|
|
@@ -1409,187 +1675,33 @@ var components = {
|
|
|
1409
1675
|
}
|
|
1410
1676
|
};
|
|
1411
1677
|
|
|
1412
|
-
// src/components/chat/messages/
|
|
1413
|
-
var
|
|
1414
|
-
|
|
1415
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1416
|
-
const { icons } = useChatContext();
|
|
1417
|
-
if (message.isTextMessage()) {
|
|
1418
|
-
if (message.role === "user") {
|
|
1419
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1420
|
-
"div",
|
|
1421
|
-
{
|
|
1422
|
-
"data-message-role": "user",
|
|
1423
|
-
className: "copilotKitMessage copilotKitUserMessage",
|
|
1424
|
-
children: message.content
|
|
1425
|
-
},
|
|
1426
|
-
index
|
|
1427
|
-
);
|
|
1428
|
-
} else if (message.role == "assistant") {
|
|
1429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1430
|
-
"div",
|
|
1431
|
-
{
|
|
1432
|
-
"data-message-role": "assistant",
|
|
1433
|
-
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1434
|
-
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Markdown, { content: message.content })
|
|
1435
|
-
},
|
|
1436
|
-
index
|
|
1437
|
-
);
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
1443
|
-
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
1444
|
-
var import_react_core3 = require("@copilotkit/react-core");
|
|
1445
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1446
|
-
function RenderActionExecutionMessage(props) {
|
|
1447
|
-
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
1448
|
-
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1449
|
-
const { icons } = useChatContext();
|
|
1450
|
-
if (message.isActionExecutionMessage()) {
|
|
1451
|
-
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1452
|
-
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1453
|
-
if (typeof render === "string") {
|
|
1454
|
-
if (isCurrentMessage && inProgress) {
|
|
1455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1456
|
-
icons.spinnerIcon,
|
|
1457
|
-
" ",
|
|
1458
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1459
|
-
] }, index);
|
|
1460
|
-
} else {
|
|
1461
|
-
return null;
|
|
1462
|
-
}
|
|
1463
|
-
} else {
|
|
1464
|
-
const args = message.arguments;
|
|
1465
|
-
let status = "inProgress";
|
|
1466
|
-
if (actionResult !== void 0) {
|
|
1467
|
-
status = "complete";
|
|
1468
|
-
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1469
|
-
status = "executing";
|
|
1470
|
-
}
|
|
1471
|
-
try {
|
|
1472
|
-
const toRender = render({
|
|
1473
|
-
status,
|
|
1474
|
-
args,
|
|
1475
|
-
result: actionResult,
|
|
1476
|
-
name: message.name
|
|
1477
|
-
});
|
|
1478
|
-
if (!toRender && status === "complete") {
|
|
1479
|
-
return null;
|
|
1480
|
-
}
|
|
1481
|
-
if (typeof toRender === "string") {
|
|
1482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1483
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1484
|
-
" ",
|
|
1485
|
-
toRender
|
|
1486
|
-
] }, index);
|
|
1487
|
-
} else {
|
|
1488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1489
|
-
"div",
|
|
1490
|
-
{
|
|
1491
|
-
"data-message-type": "action-render",
|
|
1492
|
-
className: "copilotKitCustomAssistantMessage",
|
|
1493
|
-
children: toRender
|
|
1494
|
-
},
|
|
1495
|
-
index
|
|
1496
|
-
);
|
|
1497
|
-
}
|
|
1498
|
-
} catch (e) {
|
|
1499
|
-
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1501
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1502
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
|
|
1503
|
-
"\u274C Error executing render: ",
|
|
1504
|
-
message.name
|
|
1505
|
-
] }),
|
|
1506
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("br", {}),
|
|
1507
|
-
e instanceof Error ? e.message : String(e)
|
|
1508
|
-
] }, index);
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1512
|
-
return null;
|
|
1513
|
-
} else {
|
|
1514
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1520
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1521
|
-
function RenderResultMessage(props) {
|
|
1522
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1678
|
+
// src/components/chat/messages/AssistantMessage.tsx
|
|
1679
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1680
|
+
var AssistantMessage = (props) => {
|
|
1523
1681
|
const { icons } = useChatContext();
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1682
|
+
const { message, isLoading, subComponent } = props;
|
|
1683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1684
|
+
(message || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "copilotKitMessage copilotKitAssistantMessage", children: [
|
|
1685
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Markdown, { content: message || "" }),
|
|
1686
|
+
isLoading && icons.spinnerIcon
|
|
1687
|
+
] }),
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginBottom: "0.5rem" }, children: subComponent })
|
|
1689
|
+
] });
|
|
1690
|
+
};
|
|
1528
1691
|
|
|
1529
|
-
// src/components/chat/messages/
|
|
1530
|
-
var
|
|
1531
|
-
var
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1535
|
-
const { icons } = useChatContext();
|
|
1536
|
-
if (message.isAgentStateMessage()) {
|
|
1537
|
-
let render;
|
|
1538
|
-
if (chatComponentsCache.current !== null) {
|
|
1539
|
-
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1540
|
-
}
|
|
1541
|
-
if (render) {
|
|
1542
|
-
if (typeof render === "string") {
|
|
1543
|
-
if (isCurrentMessage && inProgress) {
|
|
1544
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1545
|
-
icons.spinnerIcon,
|
|
1546
|
-
" ",
|
|
1547
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1548
|
-
] }, index);
|
|
1549
|
-
} else {
|
|
1550
|
-
return null;
|
|
1551
|
-
}
|
|
1552
|
-
} else {
|
|
1553
|
-
const state = message.state;
|
|
1554
|
-
let status = message.active ? "inProgress" : "complete";
|
|
1555
|
-
const toRender = render({
|
|
1556
|
-
status,
|
|
1557
|
-
state,
|
|
1558
|
-
nodeName: message.nodeName
|
|
1559
|
-
});
|
|
1560
|
-
if (!toRender && status === "complete") {
|
|
1561
|
-
return null;
|
|
1562
|
-
}
|
|
1563
|
-
if (!toRender && isCurrentMessage && inProgress) {
|
|
1564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1565
|
-
} else if (!toRender) {
|
|
1566
|
-
return null;
|
|
1567
|
-
}
|
|
1568
|
-
if (typeof toRender === "string") {
|
|
1569
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1570
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1571
|
-
" ",
|
|
1572
|
-
toRender
|
|
1573
|
-
] }, index);
|
|
1574
|
-
} else {
|
|
1575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1579
|
-
return null;
|
|
1580
|
-
} else {
|
|
1581
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1692
|
+
// src/components/chat/messages/UserMessage.tsx
|
|
1693
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1694
|
+
var UserMessage = (props) => {
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.message });
|
|
1696
|
+
};
|
|
1585
1697
|
|
|
1586
1698
|
// src/components/chat/Suggestion.tsx
|
|
1587
1699
|
var import_react_core5 = require("@copilotkit/react-core");
|
|
1588
1700
|
var import_shared = require("@copilotkit/shared");
|
|
1589
1701
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1590
|
-
var
|
|
1702
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1591
1703
|
function Suggestion({ title, message, onClick, partial, className }) {
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1593
1705
|
"button",
|
|
1594
1706
|
{
|
|
1595
1707
|
disabled: partial,
|
|
@@ -1600,7 +1712,7 @@ function Suggestion({ title, message, onClick, partial, className }) {
|
|
|
1600
1712
|
className: className || "suggestion",
|
|
1601
1713
|
children: [
|
|
1602
1714
|
partial && SmallSpinnerIcon,
|
|
1603
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: title })
|
|
1604
1716
|
]
|
|
1605
1717
|
}
|
|
1606
1718
|
);
|
|
@@ -1818,8 +1930,8 @@ var import_react_core7 = require("@copilotkit/react-core");
|
|
|
1818
1930
|
var import_react10 = require("react");
|
|
1819
1931
|
|
|
1820
1932
|
// src/components/dev-console/icons.tsx
|
|
1821
|
-
var
|
|
1822
|
-
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0,
|
|
1933
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1934
|
+
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1823
1935
|
"svg",
|
|
1824
1936
|
{
|
|
1825
1937
|
width: "13.3967723px",
|
|
@@ -1827,7 +1939,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1827
1939
|
viewBox: "0 0 13.3967723 12",
|
|
1828
1940
|
version: "1.1",
|
|
1829
1941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1830
|
-
children: /* @__PURE__ */ (0,
|
|
1942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1831
1943
|
"path",
|
|
1832
1944
|
{
|
|
1833
1945
|
d: "M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z",
|
|
@@ -1836,7 +1948,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1836
1948
|
) }) })
|
|
1837
1949
|
}
|
|
1838
1950
|
);
|
|
1839
|
-
var ExclamationMarkIcon = /* @__PURE__ */ (0,
|
|
1951
|
+
var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1840
1952
|
"svg",
|
|
1841
1953
|
{
|
|
1842
1954
|
width: "14px",
|
|
@@ -1844,7 +1956,7 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1844
1956
|
viewBox: "0 0 14 14",
|
|
1845
1957
|
version: "1.1",
|
|
1846
1958
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1847
|
-
children: /* @__PURE__ */ (0,
|
|
1959
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "exclamation-circle", fill: "#EC662C", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1848
1960
|
"path",
|
|
1849
1961
|
{
|
|
1850
1962
|
d: "M7,14 C10.866,14 14,10.866 14,7 C14,3.13401 10.866,0 7,0 C3.13401,0 0,3.13401 0,7 C0,10.866 3.13401,14 7,14 Z M7,3 C7.41421,3 7.75,3.33579 7.75,3.75 L7.75,6.75 C7.75,7.16421 7.41421,7.5 7,7.5 C6.58579,7.5 6.25,7.16421 6.25,6.75 L6.25,3.75 C6.25,3.33579 6.58579,3 7,3 Z M7,11 C7.55228,11 8,10.5523 8,10 C8,9.4477 7.55228,9 7,9 C6.44772,9 6,9.4477 6,10 C6,10.5523 6.44772,11 7,11 Z",
|
|
@@ -1853,14 +1965,14 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1853
1965
|
) }) })
|
|
1854
1966
|
}
|
|
1855
1967
|
);
|
|
1856
|
-
var ChevronDownIcon = /* @__PURE__ */ (0,
|
|
1968
|
+
var ChevronDownIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { width: "7px", height: "4px", viewBox: "0 0 7 4", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Group", fill: "#000000", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1857
1969
|
"path",
|
|
1858
1970
|
{
|
|
1859
1971
|
d: "M3.71690723,3.90271086 C3.59268176,4.03242971 3.39143629,4.03242971 3.26721082,3.90271086 L0.0853966595,0.57605615 C-0.0314221035,0.444981627 -0.0279751448,0.240725043 0.0931934622,0.114040675 C0.214362069,-0.0126436935 0.409725445,-0.0162475626 0.535093061,0.105888951 L3.49205902,3.19746006 L6.44902499,0.105888951 C6.52834574,0.0168884389 6.64780588,-0.0197473458 6.7605411,0.0103538404 C6.87327633,0.0404550266 6.96130636,0.132492308 6.99009696,0.250359396 C7.01888756,0.368226483 6.98384687,0.493124608 6.89872139,0.57605615 L3.71690723,3.90271086 Z",
|
|
1860
1972
|
id: "Path"
|
|
1861
1973
|
}
|
|
1862
1974
|
) }) }) });
|
|
1863
|
-
var CheckIcon2 = /* @__PURE__ */ (0,
|
|
1975
|
+
var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1864
1976
|
"svg",
|
|
1865
1977
|
{
|
|
1866
1978
|
width: "14px",
|
|
@@ -1868,7 +1980,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1868
1980
|
viewBox: "0 0 14 14",
|
|
1869
1981
|
version: "1.1",
|
|
1870
1982
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1871
|
-
children: /* @__PURE__ */ (0,
|
|
1983
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1872
1984
|
"path",
|
|
1873
1985
|
{
|
|
1874
1986
|
d: "M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z",
|
|
@@ -1877,7 +1989,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1877
1989
|
) }) }) })
|
|
1878
1990
|
}
|
|
1879
1991
|
);
|
|
1880
|
-
var CopilotKitIcon = /* @__PURE__ */ (0,
|
|
1992
|
+
var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1881
1993
|
"svg",
|
|
1882
1994
|
{
|
|
1883
1995
|
width: "33px",
|
|
@@ -1886,8 +1998,8 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
|
1886
1998
|
version: "1.1",
|
|
1887
1999
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1888
2000
|
children: [
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
2001
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1891
2003
|
"image",
|
|
1892
2004
|
{
|
|
1893
2005
|
x: "0",
|
|
@@ -1909,8 +2021,8 @@ var import_shared2 = require("@copilotkit/shared");
|
|
|
1909
2021
|
var import_react9 = require("react");
|
|
1910
2022
|
|
|
1911
2023
|
// src/components/help-modal/icons.tsx
|
|
1912
|
-
var
|
|
1913
|
-
var CloseIcon2 = () => /* @__PURE__ */ (0,
|
|
2024
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2025
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1914
2026
|
"svg",
|
|
1915
2027
|
{
|
|
1916
2028
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1920,10 +2032,10 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
|
1920
2032
|
stroke: "currentColor",
|
|
1921
2033
|
width: "20",
|
|
1922
2034
|
height: "20",
|
|
1923
|
-
children: /* @__PURE__ */ (0,
|
|
2035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1924
2036
|
}
|
|
1925
2037
|
);
|
|
1926
|
-
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
2038
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1927
2039
|
"svg",
|
|
1928
2040
|
{
|
|
1929
2041
|
style: {
|
|
@@ -1936,7 +2048,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1936
2048
|
fill: "none",
|
|
1937
2049
|
viewBox: "0 0 24 24",
|
|
1938
2050
|
children: [
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
2051
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1940
2052
|
"circle",
|
|
1941
2053
|
{
|
|
1942
2054
|
style: { opacity: 0.25 },
|
|
@@ -1947,7 +2059,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1947
2059
|
strokeWidth: "4"
|
|
1948
2060
|
}
|
|
1949
2061
|
),
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1951
2063
|
"path",
|
|
1952
2064
|
{
|
|
1953
2065
|
style: { opacity: 0.75 },
|
|
@@ -1960,7 +2072,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1960
2072
|
);
|
|
1961
2073
|
|
|
1962
2074
|
// src/components/help-modal/modal.tsx
|
|
1963
|
-
var
|
|
2075
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1964
2076
|
function CopilotKitHelpModal() {
|
|
1965
2077
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1966
2078
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
@@ -1996,7 +2108,7 @@ function CopilotKitHelpModal() {
|
|
|
1996
2108
|
setSubmitting(false);
|
|
1997
2109
|
setShowHelpModal(false);
|
|
1998
2110
|
});
|
|
1999
|
-
const HelpButton = () => /* @__PURE__ */ (0,
|
|
2111
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2000
2112
|
"button",
|
|
2001
2113
|
{
|
|
2002
2114
|
onClick: () => setShowHelpModal(true),
|
|
@@ -2010,27 +2122,27 @@ function CopilotKitHelpModal() {
|
|
|
2010
2122
|
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2011
2123
|
[submitting, emailError, issueDescription]
|
|
2012
2124
|
);
|
|
2013
|
-
return /* @__PURE__ */ (0,
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2015
|
-
showHelpModal && /* @__PURE__ */ (0,
|
|
2125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(HelpButton, {}),
|
|
2127
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2016
2128
|
"div",
|
|
2017
2129
|
{
|
|
2018
2130
|
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
2019
2131
|
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
2020
|
-
children: /* @__PURE__ */ (0,
|
|
2021
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2022
2134
|
"button",
|
|
2023
2135
|
{
|
|
2024
2136
|
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
2025
2137
|
style: { top: "10px", right: "10px" },
|
|
2026
2138
|
onClick: () => setShowHelpModal(false),
|
|
2027
2139
|
"aria-label": "Close",
|
|
2028
|
-
children: /* @__PURE__ */ (0,
|
|
2140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CloseIcon2, {})
|
|
2029
2141
|
}
|
|
2030
2142
|
),
|
|
2031
|
-
/* @__PURE__ */ (0,
|
|
2032
|
-
/* @__PURE__ */ (0,
|
|
2033
|
-
/* @__PURE__ */ (0,
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
2144
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
2145
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2034
2146
|
"a",
|
|
2035
2147
|
{
|
|
2036
2148
|
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
@@ -2039,7 +2151,7 @@ function CopilotKitHelpModal() {
|
|
|
2039
2151
|
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
2040
2152
|
}
|
|
2041
2153
|
) }),
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2043
2155
|
"a",
|
|
2044
2156
|
{
|
|
2045
2157
|
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
@@ -2048,7 +2160,7 @@ function CopilotKitHelpModal() {
|
|
|
2048
2160
|
children: "Go to Discord Support Channel (Community Support)"
|
|
2049
2161
|
}
|
|
2050
2162
|
) }),
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2052
2164
|
"a",
|
|
2053
2165
|
{
|
|
2054
2166
|
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
@@ -2058,10 +2170,10 @@ function CopilotKitHelpModal() {
|
|
|
2058
2170
|
}
|
|
2059
2171
|
) })
|
|
2060
2172
|
] }),
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2173
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2174
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
2176
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2065
2177
|
"textarea",
|
|
2066
2178
|
{
|
|
2067
2179
|
id: "feedback",
|
|
@@ -2074,9 +2186,9 @@ function CopilotKitHelpModal() {
|
|
|
2074
2186
|
}
|
|
2075
2187
|
)
|
|
2076
2188
|
] }),
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2191
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2080
2192
|
"input",
|
|
2081
2193
|
{
|
|
2082
2194
|
type: "email",
|
|
@@ -2090,9 +2202,9 @@ function CopilotKitHelpModal() {
|
|
|
2090
2202
|
value: email
|
|
2091
2203
|
}
|
|
2092
2204
|
),
|
|
2093
|
-
emailError && /* @__PURE__ */ (0,
|
|
2205
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2094
2206
|
] }),
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2096
2208
|
"button",
|
|
2097
2209
|
{
|
|
2098
2210
|
type: "submit",
|
|
@@ -2100,7 +2212,7 @@ function CopilotKitHelpModal() {
|
|
|
2100
2212
|
disabled: submitButtonDisabled,
|
|
2101
2213
|
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2102
2214
|
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",
|
|
2103
|
-
children: submitting ? /* @__PURE__ */ (0,
|
|
2215
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2104
2216
|
}
|
|
2105
2217
|
) })
|
|
2106
2218
|
] })
|
|
@@ -2111,7 +2223,7 @@ function CopilotKitHelpModal() {
|
|
|
2111
2223
|
}
|
|
2112
2224
|
|
|
2113
2225
|
// src/components/dev-console/console.tsx
|
|
2114
|
-
var
|
|
2226
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2115
2227
|
function CopilotDevConsole() {
|
|
2116
2228
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
2117
2229
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
@@ -2185,14 +2297,14 @@ function CopilotDevConsole() {
|
|
|
2185
2297
|
if (!showDevConsole) {
|
|
2186
2298
|
return null;
|
|
2187
2299
|
}
|
|
2188
|
-
return /* @__PURE__ */ (0,
|
|
2300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2189
2301
|
"div",
|
|
2190
2302
|
{
|
|
2191
2303
|
ref: consoleRef,
|
|
2192
2304
|
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
2193
2305
|
children: [
|
|
2194
|
-
/* @__PURE__ */ (0,
|
|
2195
|
-
/* @__PURE__ */ (0,
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "copilotKitDevConsoleLogo", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: "https://copilotkit.ai", target: "_blank", children: CopilotKitIcon }) }),
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2196
2308
|
VersionInfo,
|
|
2197
2309
|
{
|
|
2198
2310
|
showDevConsole: context.showDevConsole,
|
|
@@ -2201,8 +2313,8 @@ function CopilotDevConsole() {
|
|
|
2201
2313
|
latestVersion
|
|
2202
2314
|
}
|
|
2203
2315
|
),
|
|
2204
|
-
/* @__PURE__ */ (0,
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CopilotKitHelpModal, {}),
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2206
2318
|
DebugMenuButton,
|
|
2207
2319
|
{
|
|
2208
2320
|
setShowDevConsole,
|
|
@@ -2257,12 +2369,12 @@ function VersionInfo({
|
|
|
2257
2369
|
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2258
2370
|
});
|
|
2259
2371
|
};
|
|
2260
|
-
return /* @__PURE__ */ (0,
|
|
2261
|
-
/* @__PURE__ */ (0,
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { children: [
|
|
2262
2374
|
"COPILOTKIT DEV CONSOLE",
|
|
2263
|
-
showDevConsole === "auto" && /* @__PURE__ */ (0,
|
|
2375
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("aside", { children: asideLabel })
|
|
2264
2376
|
] }),
|
|
2265
|
-
/* @__PURE__ */ (0,
|
|
2377
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { children: [
|
|
2266
2378
|
"Version: ",
|
|
2267
2379
|
versionLabel,
|
|
2268
2380
|
" (",
|
|
@@ -2270,7 +2382,7 @@ function VersionInfo({
|
|
|
2270
2382
|
") ",
|
|
2271
2383
|
versionIcon
|
|
2272
2384
|
] }),
|
|
2273
|
-
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0,
|
|
2385
|
+
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand }) })
|
|
2274
2386
|
] });
|
|
2275
2387
|
}
|
|
2276
2388
|
function DebugMenuButton({
|
|
@@ -2280,12 +2392,12 @@ function DebugMenuButton({
|
|
|
2280
2392
|
}) {
|
|
2281
2393
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
2282
2394
|
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2283
|
-
return /* @__PURE__ */ (0,
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "bg-black top-24 w-52 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react11.Menu, { children: [
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuButton, { className: `copilotKitDebugMenuButton ${mode === "compact" ? "compact" : ""}`, children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2285
2397
|
"Debug ",
|
|
2286
2398
|
ChevronDownIcon
|
|
2287
2399
|
] }) }),
|
|
2288
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2289
2401
|
import_react11.MenuItems,
|
|
2290
2402
|
{
|
|
2291
2403
|
transition: true,
|
|
@@ -2293,9 +2405,9 @@ function DebugMenuButton({
|
|
|
2293
2405
|
className: "copilotKitDebugMenu",
|
|
2294
2406
|
style: { zIndex: 40 },
|
|
2295
2407
|
children: [
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logReadables(context), children: "Log Readables" }) }),
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logActions(context), children: "Log Actions" }) }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2299
2411
|
"button",
|
|
2300
2412
|
{
|
|
2301
2413
|
className: "copilotKitDebugMenuItem",
|
|
@@ -2303,9 +2415,9 @@ function DebugMenuButton({
|
|
|
2303
2415
|
children: "Log Messages"
|
|
2304
2416
|
}
|
|
2305
2417
|
) }),
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2308
|
-
/* @__PURE__ */ (0,
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => checkForUpdates(true), children: "Check for Updates" }) }),
|
|
2419
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("hr", {}),
|
|
2420
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => setShowDevConsole(false), children: "Hide Dev Console" }) })
|
|
2309
2421
|
]
|
|
2310
2422
|
}
|
|
2311
2423
|
)
|
|
@@ -2314,7 +2426,7 @@ function DebugMenuButton({
|
|
|
2314
2426
|
|
|
2315
2427
|
// src/components/chat/Chat.tsx
|
|
2316
2428
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2317
|
-
var
|
|
2429
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2318
2430
|
function CopilotChat({
|
|
2319
2431
|
instructions,
|
|
2320
2432
|
onSubmitMessage,
|
|
@@ -2332,7 +2444,9 @@ function CopilotChat({
|
|
|
2332
2444
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2333
2445
|
className,
|
|
2334
2446
|
icons,
|
|
2335
|
-
labels
|
|
2447
|
+
labels,
|
|
2448
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2449
|
+
UserMessage: UserMessage2 = UserMessage
|
|
2336
2450
|
}) {
|
|
2337
2451
|
const context = (0, import_react_core8.useCopilotContext)();
|
|
2338
2452
|
(0, import_react12.useEffect)(() => {
|
|
@@ -2354,11 +2468,13 @@ function CopilotChat({
|
|
|
2354
2468
|
);
|
|
2355
2469
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2356
2470
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2357
|
-
return /* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2359
|
-
/* @__PURE__ */ (0,
|
|
2471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopilotDevConsole, {}),
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2360
2474
|
Messages2,
|
|
2361
2475
|
{
|
|
2476
|
+
AssistantMessage: AssistantMessage2,
|
|
2477
|
+
UserMessage: UserMessage2,
|
|
2362
2478
|
RenderTextMessage: RenderTextMessage2,
|
|
2363
2479
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2364
2480
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
@@ -2366,9 +2482,9 @@ function CopilotChat({
|
|
|
2366
2482
|
messages: visibleMessages,
|
|
2367
2483
|
inProgress: isLoading,
|
|
2368
2484
|
children: [
|
|
2369
|
-
currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2371
|
-
/* @__PURE__ */ (0,
|
|
2485
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h6", { children: "Suggested:" }),
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2372
2488
|
Suggestion,
|
|
2373
2489
|
{
|
|
2374
2490
|
title: suggestion.title,
|
|
@@ -2380,7 +2496,7 @@ function CopilotChat({
|
|
|
2380
2496
|
index
|
|
2381
2497
|
)) })
|
|
2382
2498
|
] }),
|
|
2383
|
-
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0,
|
|
2499
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2384
2500
|
ResponseButton2,
|
|
2385
2501
|
{
|
|
2386
2502
|
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
@@ -2390,7 +2506,7 @@ function CopilotChat({
|
|
|
2390
2506
|
]
|
|
2391
2507
|
}
|
|
2392
2508
|
),
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2394
2510
|
] });
|
|
2395
2511
|
}
|
|
2396
2512
|
function WrappedCopilotChat({
|
|
@@ -2401,10 +2517,10 @@ function WrappedCopilotChat({
|
|
|
2401
2517
|
}) {
|
|
2402
2518
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2403
2519
|
if (!chatContext) {
|
|
2404
|
-
return /* @__PURE__ */ (0,
|
|
2405
|
-
}, children: /* @__PURE__ */ (0,
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2521
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2406
2522
|
}
|
|
2407
|
-
return /* @__PURE__ */ (0,
|
|
2523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children });
|
|
2408
2524
|
}
|
|
2409
2525
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2410
2526
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
@@ -2565,7 +2681,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2565
2681
|
};
|
|
2566
2682
|
|
|
2567
2683
|
// src/components/chat/Modal.tsx
|
|
2568
|
-
var
|
|
2684
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2569
2685
|
var CopilotModal = ({
|
|
2570
2686
|
instructions,
|
|
2571
2687
|
defaultOpen = false,
|
|
@@ -2587,6 +2703,8 @@ var CopilotModal = ({
|
|
|
2587
2703
|
Messages: Messages2 = Messages,
|
|
2588
2704
|
Input: Input2 = Input,
|
|
2589
2705
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2706
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2707
|
+
UserMessage: UserMessage2 = UserMessage,
|
|
2590
2708
|
className,
|
|
2591
2709
|
children
|
|
2592
2710
|
}) => {
|
|
@@ -2595,19 +2713,19 @@ var CopilotModal = ({
|
|
|
2595
2713
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
2596
2714
|
setOpenState(open);
|
|
2597
2715
|
};
|
|
2598
|
-
return /* @__PURE__ */ (0,
|
|
2716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
2599
2717
|
children,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className, children: [
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button2, {}),
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2603
2721
|
Window2,
|
|
2604
2722
|
{
|
|
2605
2723
|
clickOutsideToClose,
|
|
2606
2724
|
shortcut,
|
|
2607
2725
|
hitEscapeToClose,
|
|
2608
2726
|
children: [
|
|
2609
|
-
/* @__PURE__ */ (0,
|
|
2610
|
-
/* @__PURE__ */ (0,
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Header2, {}),
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2611
2729
|
CopilotChat,
|
|
2612
2730
|
{
|
|
2613
2731
|
instructions,
|
|
@@ -2619,7 +2737,9 @@ var CopilotModal = ({
|
|
|
2619
2737
|
onInProgress,
|
|
2620
2738
|
Messages: Messages2,
|
|
2621
2739
|
Input: Input2,
|
|
2622
|
-
ResponseButton: ResponseButton2
|
|
2740
|
+
ResponseButton: ResponseButton2,
|
|
2741
|
+
AssistantMessage: AssistantMessage2,
|
|
2742
|
+
UserMessage: UserMessage2
|
|
2623
2743
|
}
|
|
2624
2744
|
)
|
|
2625
2745
|
]
|
|
@@ -2630,17 +2750,17 @@ var CopilotModal = ({
|
|
|
2630
2750
|
};
|
|
2631
2751
|
|
|
2632
2752
|
// src/components/chat/Popup.tsx
|
|
2633
|
-
var
|
|
2753
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2634
2754
|
function CopilotPopup(props) {
|
|
2635
2755
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2636
2756
|
className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup"
|
|
2637
2757
|
});
|
|
2638
|
-
return /* @__PURE__ */ (0,
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CopilotModal, __spreadProps(__spreadValues({}, props), { children: props.children }));
|
|
2639
2759
|
}
|
|
2640
2760
|
|
|
2641
2761
|
// src/components/chat/Sidebar.tsx
|
|
2642
2762
|
var import_react14 = require("react");
|
|
2643
|
-
var
|
|
2763
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2644
2764
|
function CopilotSidebar(props) {
|
|
2645
2765
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2646
2766
|
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
|
|
@@ -2653,7 +2773,7 @@ function CopilotSidebar(props) {
|
|
|
2653
2773
|
(_a = props.onSetOpen) == null ? void 0 : _a.call(props, open);
|
|
2654
2774
|
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
2655
2775
|
};
|
|
2656
|
-
return /* @__PURE__ */ (0,
|
|
2776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
|
|
2657
2777
|
}
|
|
2658
2778
|
|
|
2659
2779
|
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
@@ -2682,10 +2802,13 @@ function useCopilotChatSuggestions({
|
|
|
2682
2802
|
}
|
|
2683
2803
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2684
2804
|
0 && (module.exports = {
|
|
2805
|
+
AssistantMessage,
|
|
2685
2806
|
CopilotChat,
|
|
2686
2807
|
CopilotDevConsole,
|
|
2687
2808
|
CopilotPopup,
|
|
2688
2809
|
CopilotSidebar,
|
|
2810
|
+
Markdown,
|
|
2811
|
+
UserMessage,
|
|
2689
2812
|
shouldShowDevConsole,
|
|
2690
2813
|
useChatContext,
|
|
2691
2814
|
useCopilotChatSuggestions
|