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