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