@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
|
@@ -537,7 +537,9 @@ var Messages = ({
|
|
|
537
537
|
RenderTextMessage: RenderTextMessage2,
|
|
538
538
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
539
539
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
540
|
-
RenderResultMessage: RenderResultMessage2
|
|
540
|
+
RenderResultMessage: RenderResultMessage2,
|
|
541
|
+
AssistantMessage: AssistantMessage2,
|
|
542
|
+
UserMessage: UserMessage2
|
|
541
543
|
}) => {
|
|
542
544
|
const context = useChatContext();
|
|
543
545
|
const initialMessages = (0, import_react3.useMemo)(
|
|
@@ -568,7 +570,9 @@ var Messages = ({
|
|
|
568
570
|
message,
|
|
569
571
|
inProgress,
|
|
570
572
|
index,
|
|
571
|
-
isCurrentMessage
|
|
573
|
+
isCurrentMessage,
|
|
574
|
+
AssistantMessage: AssistantMessage2,
|
|
575
|
+
UserMessage: UserMessage2
|
|
572
576
|
},
|
|
573
577
|
index
|
|
574
578
|
);
|
|
@@ -580,7 +584,9 @@ var Messages = ({
|
|
|
580
584
|
inProgress,
|
|
581
585
|
index,
|
|
582
586
|
isCurrentMessage,
|
|
583
|
-
actionResult: actionResults[message.id]
|
|
587
|
+
actionResult: actionResults[message.id],
|
|
588
|
+
AssistantMessage: AssistantMessage2,
|
|
589
|
+
UserMessage: UserMessage2
|
|
584
590
|
},
|
|
585
591
|
index
|
|
586
592
|
);
|
|
@@ -591,7 +597,9 @@ var Messages = ({
|
|
|
591
597
|
message,
|
|
592
598
|
inProgress,
|
|
593
599
|
index,
|
|
594
|
-
isCurrentMessage
|
|
600
|
+
isCurrentMessage,
|
|
601
|
+
AssistantMessage: AssistantMessage2,
|
|
602
|
+
UserMessage: UserMessage2
|
|
595
603
|
},
|
|
596
604
|
index
|
|
597
605
|
);
|
|
@@ -602,7 +610,9 @@ var Messages = ({
|
|
|
602
610
|
message,
|
|
603
611
|
inProgress,
|
|
604
612
|
index,
|
|
605
|
-
isCurrentMessage
|
|
613
|
+
isCurrentMessage,
|
|
614
|
+
AssistantMessage: AssistantMessage2,
|
|
615
|
+
UserMessage: UserMessage2
|
|
606
616
|
},
|
|
607
617
|
index
|
|
608
618
|
);
|
|
@@ -935,6 +945,259 @@ var ResponseButton = ({ onClick, inProgress }) => {
|
|
|
935
945
|
] });
|
|
936
946
|
};
|
|
937
947
|
|
|
948
|
+
// src/components/chat/messages/RenderTextMessage.tsx
|
|
949
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
950
|
+
function RenderTextMessage(props) {
|
|
951
|
+
const { message, inProgress, index, isCurrentMessage, UserMessage: UserMessage2, AssistantMessage: AssistantMessage2 } = props;
|
|
952
|
+
if (message.isTextMessage()) {
|
|
953
|
+
if (message.role === "user") {
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
955
|
+
UserMessage2,
|
|
956
|
+
{
|
|
957
|
+
"data-message-role": "user",
|
|
958
|
+
message: message.content,
|
|
959
|
+
rawData: message
|
|
960
|
+
},
|
|
961
|
+
index
|
|
962
|
+
);
|
|
963
|
+
} else if (message.role == "assistant") {
|
|
964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
965
|
+
AssistantMessage2,
|
|
966
|
+
{
|
|
967
|
+
"data-message-role": "assistant",
|
|
968
|
+
message: message.content,
|
|
969
|
+
rawData: message,
|
|
970
|
+
isLoading: inProgress && isCurrentMessage && !message.content,
|
|
971
|
+
isGenerating: inProgress && isCurrentMessage && !!message.content
|
|
972
|
+
},
|
|
973
|
+
index
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
980
|
+
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
981
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
982
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
983
|
+
function RenderActionExecutionMessage(props) {
|
|
984
|
+
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
985
|
+
const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage: AssistantMessage2 } = props;
|
|
986
|
+
if (message.isActionExecutionMessage()) {
|
|
987
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
988
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
989
|
+
if (typeof render === "string") {
|
|
990
|
+
if (isCurrentMessage && inProgress) {
|
|
991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
992
|
+
AssistantMessage2,
|
|
993
|
+
{
|
|
994
|
+
rawData: message,
|
|
995
|
+
"data-message-role": "assistant",
|
|
996
|
+
isLoading: false,
|
|
997
|
+
isGenerating: true,
|
|
998
|
+
message: render
|
|
999
|
+
},
|
|
1000
|
+
index
|
|
1001
|
+
);
|
|
1002
|
+
} else {
|
|
1003
|
+
return null;
|
|
1004
|
+
}
|
|
1005
|
+
} else {
|
|
1006
|
+
const args = message.arguments;
|
|
1007
|
+
let status = "inProgress";
|
|
1008
|
+
if (actionResult !== void 0) {
|
|
1009
|
+
status = "complete";
|
|
1010
|
+
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1011
|
+
status = "executing";
|
|
1012
|
+
}
|
|
1013
|
+
try {
|
|
1014
|
+
const toRender = render({
|
|
1015
|
+
status,
|
|
1016
|
+
args,
|
|
1017
|
+
result: actionResult,
|
|
1018
|
+
name: message.name
|
|
1019
|
+
});
|
|
1020
|
+
if (!toRender && status === "complete") {
|
|
1021
|
+
return null;
|
|
1022
|
+
}
|
|
1023
|
+
if (typeof toRender === "string") {
|
|
1024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1025
|
+
AssistantMessage2,
|
|
1026
|
+
{
|
|
1027
|
+
rawData: message,
|
|
1028
|
+
"data-message-role": "assistant",
|
|
1029
|
+
isLoading: false,
|
|
1030
|
+
isGenerating: false,
|
|
1031
|
+
message: toRender
|
|
1032
|
+
},
|
|
1033
|
+
index
|
|
1034
|
+
);
|
|
1035
|
+
} else {
|
|
1036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1037
|
+
AssistantMessage2,
|
|
1038
|
+
{
|
|
1039
|
+
rawData: message,
|
|
1040
|
+
"data-message-role": "action-render",
|
|
1041
|
+
isLoading: false,
|
|
1042
|
+
isGenerating: false,
|
|
1043
|
+
subComponent: toRender
|
|
1044
|
+
},
|
|
1045
|
+
index
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1048
|
+
} catch (e) {
|
|
1049
|
+
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1051
|
+
AssistantMessage2,
|
|
1052
|
+
{
|
|
1053
|
+
rawData: message,
|
|
1054
|
+
"data-message-role": "assistant",
|
|
1055
|
+
isLoading: false,
|
|
1056
|
+
isGenerating: false,
|
|
1057
|
+
subComponent: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1058
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("b", { children: [
|
|
1059
|
+
"\u274C Error executing render: ",
|
|
1060
|
+
message.name
|
|
1061
|
+
] }),
|
|
1062
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
|
|
1063
|
+
e instanceof Error ? e.message : String(e)
|
|
1064
|
+
] })
|
|
1065
|
+
},
|
|
1066
|
+
index
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1071
|
+
return null;
|
|
1072
|
+
} else {
|
|
1073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1074
|
+
AssistantMessage2,
|
|
1075
|
+
{
|
|
1076
|
+
rawData: message,
|
|
1077
|
+
"data-message-role": "assistant",
|
|
1078
|
+
isLoading: true,
|
|
1079
|
+
isGenerating: true
|
|
1080
|
+
},
|
|
1081
|
+
index
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1088
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1089
|
+
function RenderResultMessage(props) {
|
|
1090
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1091
|
+
if (message.isResultMessage() && inProgress && isCurrentMessage) {
|
|
1092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1093
|
+
AssistantMessage2,
|
|
1094
|
+
{
|
|
1095
|
+
"data-message-role": "assistant",
|
|
1096
|
+
rawData: message,
|
|
1097
|
+
isLoading: true,
|
|
1098
|
+
isGenerating: true
|
|
1099
|
+
},
|
|
1100
|
+
index
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
1106
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
1107
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1108
|
+
function RenderAgentStateMessage(props) {
|
|
1109
|
+
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1110
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1111
|
+
if (message.isAgentStateMessage()) {
|
|
1112
|
+
let render;
|
|
1113
|
+
if (chatComponentsCache.current !== null) {
|
|
1114
|
+
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1115
|
+
}
|
|
1116
|
+
if (render) {
|
|
1117
|
+
if (typeof render === "string") {
|
|
1118
|
+
if (isCurrentMessage && inProgress) {
|
|
1119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1120
|
+
AssistantMessage2,
|
|
1121
|
+
{
|
|
1122
|
+
rawData: message,
|
|
1123
|
+
message: render,
|
|
1124
|
+
"data-message-role": "assistant",
|
|
1125
|
+
isLoading: true,
|
|
1126
|
+
isGenerating: true
|
|
1127
|
+
},
|
|
1128
|
+
index
|
|
1129
|
+
);
|
|
1130
|
+
} else {
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
} else {
|
|
1134
|
+
const state = message.state;
|
|
1135
|
+
let status = message.active ? "inProgress" : "complete";
|
|
1136
|
+
const toRender = render({
|
|
1137
|
+
status,
|
|
1138
|
+
state,
|
|
1139
|
+
nodeName: message.nodeName
|
|
1140
|
+
});
|
|
1141
|
+
if (!toRender && status === "complete") {
|
|
1142
|
+
return null;
|
|
1143
|
+
}
|
|
1144
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1146
|
+
AssistantMessage2,
|
|
1147
|
+
{
|
|
1148
|
+
"data-message-role": "assistant",
|
|
1149
|
+
rawData: message,
|
|
1150
|
+
isLoading: true,
|
|
1151
|
+
isGenerating: true
|
|
1152
|
+
},
|
|
1153
|
+
index
|
|
1154
|
+
);
|
|
1155
|
+
} else if (!toRender) {
|
|
1156
|
+
return null;
|
|
1157
|
+
}
|
|
1158
|
+
if (typeof toRender === "string") {
|
|
1159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1160
|
+
AssistantMessage2,
|
|
1161
|
+
{
|
|
1162
|
+
rawData: message,
|
|
1163
|
+
message: toRender,
|
|
1164
|
+
isLoading: true,
|
|
1165
|
+
isGenerating: true,
|
|
1166
|
+
"data-message-role": "assistant"
|
|
1167
|
+
},
|
|
1168
|
+
index
|
|
1169
|
+
);
|
|
1170
|
+
} else {
|
|
1171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1172
|
+
AssistantMessage2,
|
|
1173
|
+
{
|
|
1174
|
+
rawData: message,
|
|
1175
|
+
"data-message-role": "agent-state-render",
|
|
1176
|
+
isLoading: false,
|
|
1177
|
+
isGenerating: false,
|
|
1178
|
+
subComponent: toRender
|
|
1179
|
+
},
|
|
1180
|
+
index
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1185
|
+
return null;
|
|
1186
|
+
} else {
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1188
|
+
AssistantMessage2,
|
|
1189
|
+
{
|
|
1190
|
+
rawData: message,
|
|
1191
|
+
isLoading: true,
|
|
1192
|
+
isGenerating: true,
|
|
1193
|
+
"data-message-role": "assistant"
|
|
1194
|
+
},
|
|
1195
|
+
index
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
|
|
938
1201
|
// src/components/chat/Markdown.tsx
|
|
939
1202
|
var import_react8 = require("react");
|
|
940
1203
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
@@ -966,7 +1229,7 @@ function useCopyToClipboard({ timeout = 2e3 }) {
|
|
|
966
1229
|
}
|
|
967
1230
|
|
|
968
1231
|
// src/components/chat/CodeBlock.tsx
|
|
969
|
-
var
|
|
1232
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
970
1233
|
var programmingLanguages = {
|
|
971
1234
|
javascript: ".js",
|
|
972
1235
|
python: ".py",
|
|
@@ -1029,21 +1292,21 @@ var CodeBlock = (0, import_react7.memo)(({ language, value }) => {
|
|
|
1029
1292
|
return;
|
|
1030
1293
|
copyToClipboard(value);
|
|
1031
1294
|
};
|
|
1032
|
-
return /* @__PURE__ */ (0,
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlock", children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
|
|
1299
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DownloadIcon, {}),
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Download" })
|
|
1039
1302
|
] }),
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
1041
|
-
isCopied ? /* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
|
|
1304
|
+
isCopied ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CopyIcon, {}),
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Copy code" })
|
|
1043
1306
|
] })
|
|
1044
1307
|
] })
|
|
1045
1308
|
] }),
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1047
1310
|
import_react_syntax_highlighter.Prism,
|
|
1048
1311
|
{
|
|
1049
1312
|
language,
|
|
@@ -1346,21 +1609,21 @@ var highlightStyle = {
|
|
|
1346
1609
|
// src/components/chat/Markdown.tsx
|
|
1347
1610
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
1348
1611
|
var import_remark_math = __toESM(require("remark-math"));
|
|
1349
|
-
var
|
|
1612
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1350
1613
|
var MemoizedReactMarkdown = (0, import_react8.memo)(
|
|
1351
1614
|
import_react_markdown.default,
|
|
1352
1615
|
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
|
|
1353
1616
|
);
|
|
1354
1617
|
var Markdown = ({ content }) => {
|
|
1355
|
-
return /* @__PURE__ */ (0,
|
|
1618
|
+
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 }) });
|
|
1356
1619
|
};
|
|
1357
1620
|
var components = {
|
|
1358
1621
|
p({ children }) {
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children });
|
|
1360
1623
|
},
|
|
1361
1624
|
a(_a) {
|
|
1362
1625
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1363
|
-
return /* @__PURE__ */ (0,
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1364
1627
|
"a",
|
|
1365
1628
|
__spreadProps(__spreadValues({
|
|
1366
1629
|
style: { color: "blue", textDecoration: "underline" }
|
|
@@ -1375,7 +1638,7 @@ var components = {
|
|
|
1375
1638
|
var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
|
|
1376
1639
|
if (children.length) {
|
|
1377
1640
|
if (children[0] == "\u258D") {
|
|
1378
|
-
return /* @__PURE__ */ (0,
|
|
1641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1379
1642
|
"span",
|
|
1380
1643
|
{
|
|
1381
1644
|
style: {
|
|
@@ -1390,9 +1653,9 @@ var components = {
|
|
|
1390
1653
|
}
|
|
1391
1654
|
const match = /language-(\w+)/.exec(className || "");
|
|
1392
1655
|
if (inline) {
|
|
1393
|
-
return /* @__PURE__ */ (0,
|
|
1656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
|
|
1394
1657
|
}
|
|
1395
|
-
return /* @__PURE__ */ (0,
|
|
1658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1396
1659
|
CodeBlock,
|
|
1397
1660
|
__spreadValues({
|
|
1398
1661
|
language: match && match[1] || "",
|
|
@@ -1403,187 +1666,33 @@ var components = {
|
|
|
1403
1666
|
}
|
|
1404
1667
|
};
|
|
1405
1668
|
|
|
1406
|
-
// src/components/chat/messages/
|
|
1407
|
-
var
|
|
1408
|
-
|
|
1409
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1410
|
-
const { icons } = useChatContext();
|
|
1411
|
-
if (message.isTextMessage()) {
|
|
1412
|
-
if (message.role === "user") {
|
|
1413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1414
|
-
"div",
|
|
1415
|
-
{
|
|
1416
|
-
"data-message-role": "user",
|
|
1417
|
-
className: "copilotKitMessage copilotKitUserMessage",
|
|
1418
|
-
children: message.content
|
|
1419
|
-
},
|
|
1420
|
-
index
|
|
1421
|
-
);
|
|
1422
|
-
} else if (message.role == "assistant") {
|
|
1423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1424
|
-
"div",
|
|
1425
|
-
{
|
|
1426
|
-
"data-message-role": "assistant",
|
|
1427
|
-
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1428
|
-
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Markdown, { content: message.content })
|
|
1429
|
-
},
|
|
1430
|
-
index
|
|
1431
|
-
);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
1437
|
-
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
1438
|
-
var import_react_core3 = require("@copilotkit/react-core");
|
|
1439
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1440
|
-
function RenderActionExecutionMessage(props) {
|
|
1441
|
-
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
1442
|
-
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1443
|
-
const { icons } = useChatContext();
|
|
1444
|
-
if (message.isActionExecutionMessage()) {
|
|
1445
|
-
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1446
|
-
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1447
|
-
if (typeof render === "string") {
|
|
1448
|
-
if (isCurrentMessage && inProgress) {
|
|
1449
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1450
|
-
icons.spinnerIcon,
|
|
1451
|
-
" ",
|
|
1452
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1453
|
-
] }, index);
|
|
1454
|
-
} else {
|
|
1455
|
-
return null;
|
|
1456
|
-
}
|
|
1457
|
-
} else {
|
|
1458
|
-
const args = message.arguments;
|
|
1459
|
-
let status = "inProgress";
|
|
1460
|
-
if (actionResult !== void 0) {
|
|
1461
|
-
status = "complete";
|
|
1462
|
-
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1463
|
-
status = "executing";
|
|
1464
|
-
}
|
|
1465
|
-
try {
|
|
1466
|
-
const toRender = render({
|
|
1467
|
-
status,
|
|
1468
|
-
args,
|
|
1469
|
-
result: actionResult,
|
|
1470
|
-
name: message.name
|
|
1471
|
-
});
|
|
1472
|
-
if (!toRender && status === "complete") {
|
|
1473
|
-
return null;
|
|
1474
|
-
}
|
|
1475
|
-
if (typeof toRender === "string") {
|
|
1476
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1477
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1478
|
-
" ",
|
|
1479
|
-
toRender
|
|
1480
|
-
] }, index);
|
|
1481
|
-
} else {
|
|
1482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1483
|
-
"div",
|
|
1484
|
-
{
|
|
1485
|
-
"data-message-type": "action-render",
|
|
1486
|
-
className: "copilotKitCustomAssistantMessage",
|
|
1487
|
-
children: toRender
|
|
1488
|
-
},
|
|
1489
|
-
index
|
|
1490
|
-
);
|
|
1491
|
-
}
|
|
1492
|
-
} catch (e) {
|
|
1493
|
-
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1494
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1495
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1496
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
|
|
1497
|
-
"\u274C Error executing render: ",
|
|
1498
|
-
message.name
|
|
1499
|
-
] }),
|
|
1500
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("br", {}),
|
|
1501
|
-
e instanceof Error ? e.message : String(e)
|
|
1502
|
-
] }, index);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1506
|
-
return null;
|
|
1507
|
-
} else {
|
|
1508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1514
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1515
|
-
function RenderResultMessage(props) {
|
|
1516
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1669
|
+
// src/components/chat/messages/AssistantMessage.tsx
|
|
1670
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1671
|
+
var AssistantMessage = (props) => {
|
|
1517
1672
|
const { icons } = useChatContext();
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
}
|
|
1673
|
+
const { message, isLoading, subComponent } = props;
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1675
|
+
(message || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "copilotKitMessage copilotKitAssistantMessage", children: [
|
|
1676
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Markdown, { content: message || "" }),
|
|
1677
|
+
isLoading && icons.spinnerIcon
|
|
1678
|
+
] }),
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginBottom: "0.5rem" }, children: subComponent })
|
|
1680
|
+
] });
|
|
1681
|
+
};
|
|
1522
1682
|
|
|
1523
|
-
// src/components/chat/messages/
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1529
|
-
const { icons } = useChatContext();
|
|
1530
|
-
if (message.isAgentStateMessage()) {
|
|
1531
|
-
let render;
|
|
1532
|
-
if (chatComponentsCache.current !== null) {
|
|
1533
|
-
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1534
|
-
}
|
|
1535
|
-
if (render) {
|
|
1536
|
-
if (typeof render === "string") {
|
|
1537
|
-
if (isCurrentMessage && inProgress) {
|
|
1538
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1539
|
-
icons.spinnerIcon,
|
|
1540
|
-
" ",
|
|
1541
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1542
|
-
] }, index);
|
|
1543
|
-
} else {
|
|
1544
|
-
return null;
|
|
1545
|
-
}
|
|
1546
|
-
} else {
|
|
1547
|
-
const state = message.state;
|
|
1548
|
-
let status = message.active ? "inProgress" : "complete";
|
|
1549
|
-
const toRender = render({
|
|
1550
|
-
status,
|
|
1551
|
-
state,
|
|
1552
|
-
nodeName: message.nodeName
|
|
1553
|
-
});
|
|
1554
|
-
if (!toRender && status === "complete") {
|
|
1555
|
-
return null;
|
|
1556
|
-
}
|
|
1557
|
-
if (!toRender && isCurrentMessage && inProgress) {
|
|
1558
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1559
|
-
} else if (!toRender) {
|
|
1560
|
-
return null;
|
|
1561
|
-
}
|
|
1562
|
-
if (typeof toRender === "string") {
|
|
1563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1564
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1565
|
-
" ",
|
|
1566
|
-
toRender
|
|
1567
|
-
] }, index);
|
|
1568
|
-
} else {
|
|
1569
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1573
|
-
return null;
|
|
1574
|
-
} else {
|
|
1575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1683
|
+
// src/components/chat/messages/UserMessage.tsx
|
|
1684
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1685
|
+
var UserMessage = (props) => {
|
|
1686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.message });
|
|
1687
|
+
};
|
|
1579
1688
|
|
|
1580
1689
|
// src/components/chat/Suggestion.tsx
|
|
1581
1690
|
var import_react_core5 = require("@copilotkit/react-core");
|
|
1582
1691
|
var import_shared = require("@copilotkit/shared");
|
|
1583
1692
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1584
|
-
var
|
|
1693
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1585
1694
|
function Suggestion({ title, message, onClick, partial, className }) {
|
|
1586
|
-
return /* @__PURE__ */ (0,
|
|
1695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1587
1696
|
"button",
|
|
1588
1697
|
{
|
|
1589
1698
|
disabled: partial,
|
|
@@ -1594,7 +1703,7 @@ function Suggestion({ title, message, onClick, partial, className }) {
|
|
|
1594
1703
|
className: className || "suggestion",
|
|
1595
1704
|
children: [
|
|
1596
1705
|
partial && SmallSpinnerIcon,
|
|
1597
|
-
/* @__PURE__ */ (0,
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: title })
|
|
1598
1707
|
]
|
|
1599
1708
|
}
|
|
1600
1709
|
);
|
|
@@ -1812,8 +1921,8 @@ var import_react_core7 = require("@copilotkit/react-core");
|
|
|
1812
1921
|
var import_react10 = require("react");
|
|
1813
1922
|
|
|
1814
1923
|
// src/components/dev-console/icons.tsx
|
|
1815
|
-
var
|
|
1816
|
-
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0,
|
|
1924
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1925
|
+
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1817
1926
|
"svg",
|
|
1818
1927
|
{
|
|
1819
1928
|
width: "13.3967723px",
|
|
@@ -1821,7 +1930,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1821
1930
|
viewBox: "0 0 13.3967723 12",
|
|
1822
1931
|
version: "1.1",
|
|
1823
1932
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1824
|
-
children: /* @__PURE__ */ (0,
|
|
1933
|
+
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)(
|
|
1825
1934
|
"path",
|
|
1826
1935
|
{
|
|
1827
1936
|
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",
|
|
@@ -1830,7 +1939,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1830
1939
|
) }) })
|
|
1831
1940
|
}
|
|
1832
1941
|
);
|
|
1833
|
-
var ExclamationMarkIcon = /* @__PURE__ */ (0,
|
|
1942
|
+
var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1834
1943
|
"svg",
|
|
1835
1944
|
{
|
|
1836
1945
|
width: "14px",
|
|
@@ -1838,7 +1947,7 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1838
1947
|
viewBox: "0 0 14 14",
|
|
1839
1948
|
version: "1.1",
|
|
1840
1949
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1841
|
-
children: /* @__PURE__ */ (0,
|
|
1950
|
+
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)(
|
|
1842
1951
|
"path",
|
|
1843
1952
|
{
|
|
1844
1953
|
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",
|
|
@@ -1847,14 +1956,14 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1847
1956
|
) }) })
|
|
1848
1957
|
}
|
|
1849
1958
|
);
|
|
1850
|
-
var ChevronDownIcon = /* @__PURE__ */ (0,
|
|
1959
|
+
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)(
|
|
1851
1960
|
"path",
|
|
1852
1961
|
{
|
|
1853
1962
|
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",
|
|
1854
1963
|
id: "Path"
|
|
1855
1964
|
}
|
|
1856
1965
|
) }) }) });
|
|
1857
|
-
var CheckIcon2 = /* @__PURE__ */ (0,
|
|
1966
|
+
var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1858
1967
|
"svg",
|
|
1859
1968
|
{
|
|
1860
1969
|
width: "14px",
|
|
@@ -1862,7 +1971,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1862
1971
|
viewBox: "0 0 14 14",
|
|
1863
1972
|
version: "1.1",
|
|
1864
1973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1865
|
-
children: /* @__PURE__ */ (0,
|
|
1974
|
+
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)(
|
|
1866
1975
|
"path",
|
|
1867
1976
|
{
|
|
1868
1977
|
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",
|
|
@@ -1871,7 +1980,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1871
1980
|
) }) }) })
|
|
1872
1981
|
}
|
|
1873
1982
|
);
|
|
1874
|
-
var CopilotKitIcon = /* @__PURE__ */ (0,
|
|
1983
|
+
var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1875
1984
|
"svg",
|
|
1876
1985
|
{
|
|
1877
1986
|
width: "33px",
|
|
@@ -1880,8 +1989,8 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
|
1880
1989
|
version: "1.1",
|
|
1881
1990
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1882
1991
|
children: [
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
1884
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
1993
|
+
/* @__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)(
|
|
1885
1994
|
"image",
|
|
1886
1995
|
{
|
|
1887
1996
|
x: "0",
|
|
@@ -1903,8 +2012,8 @@ var import_shared2 = require("@copilotkit/shared");
|
|
|
1903
2012
|
var import_react9 = require("react");
|
|
1904
2013
|
|
|
1905
2014
|
// src/components/help-modal/icons.tsx
|
|
1906
|
-
var
|
|
1907
|
-
var CloseIcon2 = () => /* @__PURE__ */ (0,
|
|
2015
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2016
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1908
2017
|
"svg",
|
|
1909
2018
|
{
|
|
1910
2019
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1914,10 +2023,10 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
|
1914
2023
|
stroke: "currentColor",
|
|
1915
2024
|
width: "20",
|
|
1916
2025
|
height: "20",
|
|
1917
|
-
children: /* @__PURE__ */ (0,
|
|
2026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1918
2027
|
}
|
|
1919
2028
|
);
|
|
1920
|
-
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
2029
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1921
2030
|
"svg",
|
|
1922
2031
|
{
|
|
1923
2032
|
style: {
|
|
@@ -1930,7 +2039,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1930
2039
|
fill: "none",
|
|
1931
2040
|
viewBox: "0 0 24 24",
|
|
1932
2041
|
children: [
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1934
2043
|
"circle",
|
|
1935
2044
|
{
|
|
1936
2045
|
style: { opacity: 0.25 },
|
|
@@ -1941,7 +2050,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1941
2050
|
strokeWidth: "4"
|
|
1942
2051
|
}
|
|
1943
2052
|
),
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
2053
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1945
2054
|
"path",
|
|
1946
2055
|
{
|
|
1947
2056
|
style: { opacity: 0.75 },
|
|
@@ -1954,7 +2063,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1954
2063
|
);
|
|
1955
2064
|
|
|
1956
2065
|
// src/components/help-modal/modal.tsx
|
|
1957
|
-
var
|
|
2066
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1958
2067
|
function CopilotKitHelpModal() {
|
|
1959
2068
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1960
2069
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
@@ -1990,7 +2099,7 @@ function CopilotKitHelpModal() {
|
|
|
1990
2099
|
setSubmitting(false);
|
|
1991
2100
|
setShowHelpModal(false);
|
|
1992
2101
|
});
|
|
1993
|
-
const HelpButton = () => /* @__PURE__ */ (0,
|
|
2102
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1994
2103
|
"button",
|
|
1995
2104
|
{
|
|
1996
2105
|
onClick: () => setShowHelpModal(true),
|
|
@@ -2004,27 +2113,27 @@ function CopilotKitHelpModal() {
|
|
|
2004
2113
|
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2005
2114
|
[submitting, emailError, issueDescription]
|
|
2006
2115
|
);
|
|
2007
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
-
/* @__PURE__ */ (0,
|
|
2009
|
-
showHelpModal && /* @__PURE__ */ (0,
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(HelpButton, {}),
|
|
2118
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2010
2119
|
"div",
|
|
2011
2120
|
{
|
|
2012
2121
|
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
2013
2122
|
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
2014
|
-
children: /* @__PURE__ */ (0,
|
|
2015
|
-
/* @__PURE__ */ (0,
|
|
2123
|
+
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: [
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2016
2125
|
"button",
|
|
2017
2126
|
{
|
|
2018
2127
|
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
2019
2128
|
style: { top: "10px", right: "10px" },
|
|
2020
2129
|
onClick: () => setShowHelpModal(false),
|
|
2021
2130
|
"aria-label": "Close",
|
|
2022
|
-
children: /* @__PURE__ */ (0,
|
|
2131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CloseIcon2, {})
|
|
2023
2132
|
}
|
|
2024
2133
|
),
|
|
2025
|
-
/* @__PURE__ */ (0,
|
|
2026
|
-
/* @__PURE__ */ (0,
|
|
2027
|
-
/* @__PURE__ */ (0,
|
|
2134
|
+
/* @__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" }) }),
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
2136
|
+
/* @__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)(
|
|
2028
2137
|
"a",
|
|
2029
2138
|
{
|
|
2030
2139
|
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
@@ -2033,7 +2142,7 @@ function CopilotKitHelpModal() {
|
|
|
2033
2142
|
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
2034
2143
|
}
|
|
2035
2144
|
) }),
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
2037
2146
|
"a",
|
|
2038
2147
|
{
|
|
2039
2148
|
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
@@ -2042,7 +2151,7 @@ function CopilotKitHelpModal() {
|
|
|
2042
2151
|
children: "Go to Discord Support Channel (Community Support)"
|
|
2043
2152
|
}
|
|
2044
2153
|
) }),
|
|
2045
|
-
/* @__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)(
|
|
2046
2155
|
"a",
|
|
2047
2156
|
{
|
|
2048
2157
|
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
@@ -2052,10 +2161,10 @@ function CopilotKitHelpModal() {
|
|
|
2052
2161
|
}
|
|
2053
2162
|
) })
|
|
2054
2163
|
] }),
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2166
|
+
/* @__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:" }),
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2059
2168
|
"textarea",
|
|
2060
2169
|
{
|
|
2061
2170
|
id: "feedback",
|
|
@@ -2068,9 +2177,9 @@ function CopilotKitHelpModal() {
|
|
|
2068
2177
|
}
|
|
2069
2178
|
)
|
|
2070
2179
|
] }),
|
|
2071
|
-
/* @__PURE__ */ (0,
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2180
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2181
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2074
2183
|
"input",
|
|
2075
2184
|
{
|
|
2076
2185
|
type: "email",
|
|
@@ -2084,9 +2193,9 @@ function CopilotKitHelpModal() {
|
|
|
2084
2193
|
value: email
|
|
2085
2194
|
}
|
|
2086
2195
|
),
|
|
2087
|
-
emailError && /* @__PURE__ */ (0,
|
|
2196
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2088
2197
|
] }),
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2198
|
+
/* @__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)(
|
|
2090
2199
|
"button",
|
|
2091
2200
|
{
|
|
2092
2201
|
type: "submit",
|
|
@@ -2094,7 +2203,7 @@ function CopilotKitHelpModal() {
|
|
|
2094
2203
|
disabled: submitButtonDisabled,
|
|
2095
2204
|
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2096
2205
|
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",
|
|
2097
|
-
children: submitting ? /* @__PURE__ */ (0,
|
|
2206
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2098
2207
|
}
|
|
2099
2208
|
) })
|
|
2100
2209
|
] })
|
|
@@ -2105,7 +2214,7 @@ function CopilotKitHelpModal() {
|
|
|
2105
2214
|
}
|
|
2106
2215
|
|
|
2107
2216
|
// src/components/dev-console/console.tsx
|
|
2108
|
-
var
|
|
2217
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2109
2218
|
function CopilotDevConsole() {
|
|
2110
2219
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
2111
2220
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
@@ -2179,14 +2288,14 @@ function CopilotDevConsole() {
|
|
|
2179
2288
|
if (!showDevConsole) {
|
|
2180
2289
|
return null;
|
|
2181
2290
|
}
|
|
2182
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2183
2292
|
"div",
|
|
2184
2293
|
{
|
|
2185
2294
|
ref: consoleRef,
|
|
2186
2295
|
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
2187
2296
|
children: [
|
|
2188
|
-
/* @__PURE__ */ (0,
|
|
2189
|
-
/* @__PURE__ */ (0,
|
|
2297
|
+
/* @__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 }) }),
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2190
2299
|
VersionInfo,
|
|
2191
2300
|
{
|
|
2192
2301
|
showDevConsole: context.showDevConsole,
|
|
@@ -2195,8 +2304,8 @@ function CopilotDevConsole() {
|
|
|
2195
2304
|
latestVersion
|
|
2196
2305
|
}
|
|
2197
2306
|
),
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2199
|
-
/* @__PURE__ */ (0,
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CopilotKitHelpModal, {}),
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2200
2309
|
DebugMenuButton,
|
|
2201
2310
|
{
|
|
2202
2311
|
setShowDevConsole,
|
|
@@ -2251,12 +2360,12 @@ function VersionInfo({
|
|
|
2251
2360
|
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2252
2361
|
});
|
|
2253
2362
|
};
|
|
2254
|
-
return /* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { children: [
|
|
2256
2365
|
"COPILOTKIT DEV CONSOLE",
|
|
2257
|
-
showDevConsole === "auto" && /* @__PURE__ */ (0,
|
|
2366
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("aside", { children: asideLabel })
|
|
2258
2367
|
] }),
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { children: [
|
|
2260
2369
|
"Version: ",
|
|
2261
2370
|
versionLabel,
|
|
2262
2371
|
" (",
|
|
@@ -2264,7 +2373,7 @@ function VersionInfo({
|
|
|
2264
2373
|
") ",
|
|
2265
2374
|
versionIcon
|
|
2266
2375
|
] }),
|
|
2267
|
-
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0,
|
|
2376
|
+
(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 }) })
|
|
2268
2377
|
] });
|
|
2269
2378
|
}
|
|
2270
2379
|
function DebugMenuButton({
|
|
@@ -2274,12 +2383,12 @@ function DebugMenuButton({
|
|
|
2274
2383
|
}) {
|
|
2275
2384
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
2276
2385
|
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2277
|
-
return /* @__PURE__ */ (0,
|
|
2278
|
-
/* @__PURE__ */ (0,
|
|
2386
|
+
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: [
|
|
2387
|
+
/* @__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: [
|
|
2279
2388
|
"Debug ",
|
|
2280
2389
|
ChevronDownIcon
|
|
2281
2390
|
] }) }),
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2283
2392
|
import_react11.MenuItems,
|
|
2284
2393
|
{
|
|
2285
2394
|
transition: true,
|
|
@@ -2287,9 +2396,9 @@ function DebugMenuButton({
|
|
|
2287
2396
|
className: "copilotKitDebugMenu",
|
|
2288
2397
|
style: { zIndex: 40 },
|
|
2289
2398
|
children: [
|
|
2290
|
-
/* @__PURE__ */ (0,
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2292
|
-
/* @__PURE__ */ (0,
|
|
2399
|
+
/* @__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" }) }),
|
|
2400
|
+
/* @__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" }) }),
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2293
2402
|
"button",
|
|
2294
2403
|
{
|
|
2295
2404
|
className: "copilotKitDebugMenuItem",
|
|
@@ -2297,9 +2406,9 @@ function DebugMenuButton({
|
|
|
2297
2406
|
children: "Log Messages"
|
|
2298
2407
|
}
|
|
2299
2408
|
) }),
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2302
|
-
/* @__PURE__ */ (0,
|
|
2409
|
+
/* @__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" }) }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("hr", {}),
|
|
2411
|
+
/* @__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" }) })
|
|
2303
2412
|
]
|
|
2304
2413
|
}
|
|
2305
2414
|
)
|
|
@@ -2308,7 +2417,7 @@ function DebugMenuButton({
|
|
|
2308
2417
|
|
|
2309
2418
|
// src/components/chat/Chat.tsx
|
|
2310
2419
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2311
|
-
var
|
|
2420
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2312
2421
|
function CopilotChat({
|
|
2313
2422
|
instructions,
|
|
2314
2423
|
onSubmitMessage,
|
|
@@ -2326,7 +2435,9 @@ function CopilotChat({
|
|
|
2326
2435
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2327
2436
|
className,
|
|
2328
2437
|
icons,
|
|
2329
|
-
labels
|
|
2438
|
+
labels,
|
|
2439
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2440
|
+
UserMessage: UserMessage2 = UserMessage
|
|
2330
2441
|
}) {
|
|
2331
2442
|
const context = (0, import_react_core8.useCopilotContext)();
|
|
2332
2443
|
(0, import_react12.useEffect)(() => {
|
|
@@ -2348,11 +2459,13 @@ function CopilotChat({
|
|
|
2348
2459
|
);
|
|
2349
2460
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2350
2461
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2351
|
-
return /* @__PURE__ */ (0,
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2353
|
-
/* @__PURE__ */ (0,
|
|
2462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopilotDevConsole, {}),
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2354
2465
|
Messages2,
|
|
2355
2466
|
{
|
|
2467
|
+
AssistantMessage: AssistantMessage2,
|
|
2468
|
+
UserMessage: UserMessage2,
|
|
2356
2469
|
RenderTextMessage: RenderTextMessage2,
|
|
2357
2470
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2358
2471
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
@@ -2360,9 +2473,9 @@ function CopilotChat({
|
|
|
2360
2473
|
messages: visibleMessages,
|
|
2361
2474
|
inProgress: isLoading,
|
|
2362
2475
|
children: [
|
|
2363
|
-
currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2364
|
-
/* @__PURE__ */ (0,
|
|
2365
|
-
/* @__PURE__ */ (0,
|
|
2476
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h6", { children: "Suggested:" }),
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2366
2479
|
Suggestion,
|
|
2367
2480
|
{
|
|
2368
2481
|
title: suggestion.title,
|
|
@@ -2374,7 +2487,7 @@ function CopilotChat({
|
|
|
2374
2487
|
index
|
|
2375
2488
|
)) })
|
|
2376
2489
|
] }),
|
|
2377
|
-
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0,
|
|
2490
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2378
2491
|
ResponseButton2,
|
|
2379
2492
|
{
|
|
2380
2493
|
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
@@ -2384,7 +2497,7 @@ function CopilotChat({
|
|
|
2384
2497
|
]
|
|
2385
2498
|
}
|
|
2386
2499
|
),
|
|
2387
|
-
/* @__PURE__ */ (0,
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2388
2501
|
] });
|
|
2389
2502
|
}
|
|
2390
2503
|
function WrappedCopilotChat({
|
|
@@ -2395,10 +2508,10 @@ function WrappedCopilotChat({
|
|
|
2395
2508
|
}) {
|
|
2396
2509
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2397
2510
|
if (!chatContext) {
|
|
2398
|
-
return /* @__PURE__ */ (0,
|
|
2399
|
-
}, children: /* @__PURE__ */ (0,
|
|
2511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2512
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2400
2513
|
}
|
|
2401
|
-
return /* @__PURE__ */ (0,
|
|
2514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children });
|
|
2402
2515
|
}
|
|
2403
2516
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2404
2517
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
@@ -2559,7 +2672,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2559
2672
|
};
|
|
2560
2673
|
|
|
2561
2674
|
// src/components/chat/Modal.tsx
|
|
2562
|
-
var
|
|
2675
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2563
2676
|
var CopilotModal = ({
|
|
2564
2677
|
instructions,
|
|
2565
2678
|
defaultOpen = false,
|
|
@@ -2581,6 +2694,8 @@ var CopilotModal = ({
|
|
|
2581
2694
|
Messages: Messages2 = Messages,
|
|
2582
2695
|
Input: Input2 = Input,
|
|
2583
2696
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2697
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2698
|
+
UserMessage: UserMessage2 = UserMessage,
|
|
2584
2699
|
className,
|
|
2585
2700
|
children
|
|
2586
2701
|
}) => {
|
|
@@ -2589,19 +2704,19 @@ var CopilotModal = ({
|
|
|
2589
2704
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
2590
2705
|
setOpenState(open);
|
|
2591
2706
|
};
|
|
2592
|
-
return /* @__PURE__ */ (0,
|
|
2707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
2593
2708
|
children,
|
|
2594
|
-
/* @__PURE__ */ (0,
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className, children: [
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button2, {}),
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2597
2712
|
Window2,
|
|
2598
2713
|
{
|
|
2599
2714
|
clickOutsideToClose,
|
|
2600
2715
|
shortcut,
|
|
2601
2716
|
hitEscapeToClose,
|
|
2602
2717
|
children: [
|
|
2603
|
-
/* @__PURE__ */ (0,
|
|
2604
|
-
/* @__PURE__ */ (0,
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Header2, {}),
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2605
2720
|
CopilotChat,
|
|
2606
2721
|
{
|
|
2607
2722
|
instructions,
|
|
@@ -2613,7 +2728,9 @@ var CopilotModal = ({
|
|
|
2613
2728
|
onInProgress,
|
|
2614
2729
|
Messages: Messages2,
|
|
2615
2730
|
Input: Input2,
|
|
2616
|
-
ResponseButton: ResponseButton2
|
|
2731
|
+
ResponseButton: ResponseButton2,
|
|
2732
|
+
AssistantMessage: AssistantMessage2,
|
|
2733
|
+
UserMessage: UserMessage2
|
|
2617
2734
|
}
|
|
2618
2735
|
)
|
|
2619
2736
|
]
|
|
@@ -2624,7 +2741,7 @@ var CopilotModal = ({
|
|
|
2624
2741
|
};
|
|
2625
2742
|
|
|
2626
2743
|
// src/components/chat/Sidebar.tsx
|
|
2627
|
-
var
|
|
2744
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2628
2745
|
function CopilotSidebar(props) {
|
|
2629
2746
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2630
2747
|
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
|
|
@@ -2637,7 +2754,7 @@ function CopilotSidebar(props) {
|
|
|
2637
2754
|
(_a = props.onSetOpen) == null ? void 0 : _a.call(props, open);
|
|
2638
2755
|
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
2639
2756
|
};
|
|
2640
|
-
return /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
|
|
2641
2758
|
}
|
|
2642
2759
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2643
2760
|
0 && (module.exports = {
|