@copilotkit/react-ui 1.5.11 → 1.5.12-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/{chunk-7II4YL7R.mjs → chunk-34FREWVK.mjs} +16 -6
- package/dist/chunk-34FREWVK.mjs.map +1 -0
- package/dist/chunk-3VNMQWGT.mjs +25 -0
- package/dist/chunk-3VNMQWGT.mjs.map +1 -0
- package/dist/{chunk-WSMMTZCM.mjs → chunk-B23XDGH4.mjs} +2 -2
- package/dist/chunk-F7VWGY77.mjs +22 -0
- package/dist/chunk-F7VWGY77.mjs.map +1 -0
- package/dist/chunk-HEIDCT7I.mjs +10 -0
- package/dist/chunk-HEIDCT7I.mjs.map +1 -0
- package/dist/{chunk-DCNCY2PL.mjs → chunk-I7MG52I5.mjs} +19 -9
- package/dist/chunk-I7MG52I5.mjs.map +1 -0
- package/dist/{chunk-375NVWZM.mjs → chunk-O6JFOQQA.mjs} +2 -2
- package/dist/chunk-OFYI4UU4.mjs +35 -0
- package/dist/chunk-OFYI4UU4.mjs.map +1 -0
- package/dist/{chunk-3E7HY2UN.mjs → chunk-P5A3A5FO.mjs} +58 -31
- package/dist/chunk-P5A3A5FO.mjs.map +1 -0
- package/dist/chunk-SQMEPWVT.mjs +1 -0
- package/dist/chunk-UWWMAJ7R.mjs +100 -0
- package/dist/chunk-UWWMAJ7R.mjs.map +1 -0
- package/dist/{chunk-UWVGLGFQ.mjs → chunk-VKVNMHM5.mjs} +14 -4
- package/dist/chunk-VKVNMHM5.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +10 -2
- package/dist/components/chat/Chat.js +384 -271
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +8 -6
- package/dist/components/chat/Messages.d.ts +1 -1
- package/dist/components/chat/Messages.js +15 -5
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +1 -1
- package/dist/components/chat/Modal.d.ts +1 -1
- package/dist/components/chat/Modal.js +396 -279
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +9 -7
- package/dist/components/chat/Popup.js +398 -281
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +10 -8
- package/dist/components/chat/Sidebar.js +398 -281
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +10 -8
- package/dist/components/chat/index.d.ts +4 -1
- package/dist/components/chat/index.js +406 -283
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +22 -11
- package/dist/components/chat/messages/AssistantMessage.d.ts +7 -0
- package/dist/components/chat/messages/AssistantMessage.js +615 -0
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -0
- package/dist/components/chat/messages/AssistantMessage.mjs +13 -0
- package/dist/components/chat/messages/AssistantMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +59 -54
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderAgentStateMessage.js +55 -42
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderResultMessage.js +11 -29
- package/dist/components/chat/messages/RenderResultMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderResultMessage.mjs +1 -3
- package/dist/components/chat/messages/RenderTextMessage.js +11 -581
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderTextMessage.mjs +1 -6
- package/dist/components/chat/messages/UserMessage.d.ts +7 -0
- package/dist/components/chat/messages/UserMessage.js +34 -0
- package/dist/components/chat/messages/UserMessage.js.map +1 -0
- package/dist/components/chat/messages/UserMessage.mjs +8 -0
- package/dist/components/chat/messages/UserMessage.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +36 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +406 -283
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +22 -11
- package/dist/index.d.ts +4 -1
- package/dist/index.js +406 -283
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -11
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +25 -1
- package/src/components/chat/Messages.tsx +10 -0
- package/src/components/chat/Modal.tsx +7 -0
- package/src/components/chat/index.tsx +3 -0
- package/src/components/chat/messages/AssistantMessage.tsx +20 -0
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +45 -24
- package/src/components/chat/messages/RenderAgentStateMessage.tsx +39 -19
- package/src/components/chat/messages/RenderResultMessage.tsx +9 -7
- package/src/components/chat/messages/RenderTextMessage.tsx +12 -19
- package/src/components/chat/messages/UserMessage.tsx +5 -0
- package/src/components/chat/props.ts +43 -0
- package/dist/chunk-3E7HY2UN.mjs.map +0 -1
- package/dist/chunk-6INMITFA.mjs +0 -18
- package/dist/chunk-6INMITFA.mjs.map +0 -1
- package/dist/chunk-7II4YL7R.mjs.map +0 -1
- package/dist/chunk-DCNCY2PL.mjs.map +0 -1
- package/dist/chunk-MRFF7GSQ.mjs +0 -1
- package/dist/chunk-RU73BEZM.mjs +0 -41
- package/dist/chunk-RU73BEZM.mjs.map +0 -1
- package/dist/chunk-UWVGLGFQ.mjs.map +0 -1
- package/dist/chunk-ZABXREBH.mjs +0 -65
- package/dist/chunk-ZABXREBH.mjs.map +0 -1
- /package/dist/{chunk-WSMMTZCM.mjs.map → chunk-B23XDGH4.mjs.map} +0 -0
- /package/dist/{chunk-375NVWZM.mjs.map → chunk-O6JFOQQA.mjs.map} +0 -0
- /package/dist/{chunk-MRFF7GSQ.mjs.map → chunk-SQMEPWVT.mjs.map} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -79,10 +79,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
79
79
|
// src/components/index.ts
|
|
80
80
|
var components_exports = {};
|
|
81
81
|
__export(components_exports, {
|
|
82
|
+
AssistantMessage: () => AssistantMessage,
|
|
82
83
|
CopilotChat: () => CopilotChat,
|
|
83
84
|
CopilotDevConsole: () => CopilotDevConsole,
|
|
84
85
|
CopilotPopup: () => CopilotPopup,
|
|
85
86
|
CopilotSidebar: () => CopilotSidebar,
|
|
87
|
+
Markdown: () => Markdown,
|
|
88
|
+
UserMessage: () => UserMessage,
|
|
86
89
|
shouldShowDevConsole: () => shouldShowDevConsole,
|
|
87
90
|
useChatContext: () => useChatContext
|
|
88
91
|
});
|
|
@@ -541,7 +544,9 @@ var Messages = ({
|
|
|
541
544
|
RenderTextMessage: RenderTextMessage2,
|
|
542
545
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
543
546
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
544
|
-
RenderResultMessage: RenderResultMessage2
|
|
547
|
+
RenderResultMessage: RenderResultMessage2,
|
|
548
|
+
AssistantMessage: AssistantMessage2,
|
|
549
|
+
UserMessage: UserMessage2
|
|
545
550
|
}) => {
|
|
546
551
|
const context = useChatContext();
|
|
547
552
|
const initialMessages = (0, import_react3.useMemo)(
|
|
@@ -572,7 +577,9 @@ var Messages = ({
|
|
|
572
577
|
message,
|
|
573
578
|
inProgress,
|
|
574
579
|
index,
|
|
575
|
-
isCurrentMessage
|
|
580
|
+
isCurrentMessage,
|
|
581
|
+
AssistantMessage: AssistantMessage2,
|
|
582
|
+
UserMessage: UserMessage2
|
|
576
583
|
},
|
|
577
584
|
index
|
|
578
585
|
);
|
|
@@ -584,7 +591,9 @@ var Messages = ({
|
|
|
584
591
|
inProgress,
|
|
585
592
|
index,
|
|
586
593
|
isCurrentMessage,
|
|
587
|
-
actionResult: actionResults[message.id]
|
|
594
|
+
actionResult: actionResults[message.id],
|
|
595
|
+
AssistantMessage: AssistantMessage2,
|
|
596
|
+
UserMessage: UserMessage2
|
|
588
597
|
},
|
|
589
598
|
index
|
|
590
599
|
);
|
|
@@ -595,7 +604,9 @@ var Messages = ({
|
|
|
595
604
|
message,
|
|
596
605
|
inProgress,
|
|
597
606
|
index,
|
|
598
|
-
isCurrentMessage
|
|
607
|
+
isCurrentMessage,
|
|
608
|
+
AssistantMessage: AssistantMessage2,
|
|
609
|
+
UserMessage: UserMessage2
|
|
599
610
|
},
|
|
600
611
|
index
|
|
601
612
|
);
|
|
@@ -606,7 +617,9 @@ var Messages = ({
|
|
|
606
617
|
message,
|
|
607
618
|
inProgress,
|
|
608
619
|
index,
|
|
609
|
-
isCurrentMessage
|
|
620
|
+
isCurrentMessage,
|
|
621
|
+
AssistantMessage: AssistantMessage2,
|
|
622
|
+
UserMessage: UserMessage2
|
|
610
623
|
},
|
|
611
624
|
index
|
|
612
625
|
);
|
|
@@ -939,6 +952,259 @@ var ResponseButton = ({ onClick, inProgress }) => {
|
|
|
939
952
|
] });
|
|
940
953
|
};
|
|
941
954
|
|
|
955
|
+
// src/components/chat/messages/RenderTextMessage.tsx
|
|
956
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
957
|
+
function RenderTextMessage(props) {
|
|
958
|
+
const { message, inProgress, index, isCurrentMessage, UserMessage: UserMessage2, AssistantMessage: AssistantMessage2 } = props;
|
|
959
|
+
if (message.isTextMessage()) {
|
|
960
|
+
if (message.role === "user") {
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
962
|
+
UserMessage2,
|
|
963
|
+
{
|
|
964
|
+
"data-message-role": "user",
|
|
965
|
+
message: message.content,
|
|
966
|
+
rawData: message
|
|
967
|
+
},
|
|
968
|
+
index
|
|
969
|
+
);
|
|
970
|
+
} else if (message.role == "assistant") {
|
|
971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
972
|
+
AssistantMessage2,
|
|
973
|
+
{
|
|
974
|
+
"data-message-role": "assistant",
|
|
975
|
+
message: message.content,
|
|
976
|
+
rawData: message,
|
|
977
|
+
isLoading: inProgress && isCurrentMessage && !message.content,
|
|
978
|
+
isGenerating: inProgress && isCurrentMessage && !!message.content
|
|
979
|
+
},
|
|
980
|
+
index
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
987
|
+
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
988
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
989
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
990
|
+
function RenderActionExecutionMessage(props) {
|
|
991
|
+
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
992
|
+
const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage: AssistantMessage2 } = props;
|
|
993
|
+
if (message.isActionExecutionMessage()) {
|
|
994
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
995
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
996
|
+
if (typeof render === "string") {
|
|
997
|
+
if (isCurrentMessage && inProgress) {
|
|
998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
999
|
+
AssistantMessage2,
|
|
1000
|
+
{
|
|
1001
|
+
rawData: message,
|
|
1002
|
+
"data-message-role": "assistant",
|
|
1003
|
+
isLoading: false,
|
|
1004
|
+
isGenerating: true,
|
|
1005
|
+
message: render
|
|
1006
|
+
},
|
|
1007
|
+
index
|
|
1008
|
+
);
|
|
1009
|
+
} else {
|
|
1010
|
+
return null;
|
|
1011
|
+
}
|
|
1012
|
+
} else {
|
|
1013
|
+
const args = message.arguments;
|
|
1014
|
+
let status = "inProgress";
|
|
1015
|
+
if (actionResult !== void 0) {
|
|
1016
|
+
status = "complete";
|
|
1017
|
+
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1018
|
+
status = "executing";
|
|
1019
|
+
}
|
|
1020
|
+
try {
|
|
1021
|
+
const toRender = render({
|
|
1022
|
+
status,
|
|
1023
|
+
args,
|
|
1024
|
+
result: actionResult,
|
|
1025
|
+
name: message.name
|
|
1026
|
+
});
|
|
1027
|
+
if (!toRender && status === "complete") {
|
|
1028
|
+
return null;
|
|
1029
|
+
}
|
|
1030
|
+
if (typeof toRender === "string") {
|
|
1031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1032
|
+
AssistantMessage2,
|
|
1033
|
+
{
|
|
1034
|
+
rawData: message,
|
|
1035
|
+
"data-message-role": "assistant",
|
|
1036
|
+
isLoading: false,
|
|
1037
|
+
isGenerating: false,
|
|
1038
|
+
message: toRender
|
|
1039
|
+
},
|
|
1040
|
+
index
|
|
1041
|
+
);
|
|
1042
|
+
} else {
|
|
1043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1044
|
+
AssistantMessage2,
|
|
1045
|
+
{
|
|
1046
|
+
rawData: message,
|
|
1047
|
+
"data-message-role": "action-render",
|
|
1048
|
+
isLoading: false,
|
|
1049
|
+
isGenerating: false,
|
|
1050
|
+
subComponent: toRender
|
|
1051
|
+
},
|
|
1052
|
+
index
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1055
|
+
} catch (e) {
|
|
1056
|
+
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1058
|
+
AssistantMessage2,
|
|
1059
|
+
{
|
|
1060
|
+
rawData: message,
|
|
1061
|
+
"data-message-role": "assistant",
|
|
1062
|
+
isLoading: false,
|
|
1063
|
+
isGenerating: false,
|
|
1064
|
+
subComponent: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("b", { children: [
|
|
1066
|
+
"\u274C Error executing render: ",
|
|
1067
|
+
message.name
|
|
1068
|
+
] }),
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
|
|
1070
|
+
e instanceof Error ? e.message : String(e)
|
|
1071
|
+
] })
|
|
1072
|
+
},
|
|
1073
|
+
index
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1078
|
+
return null;
|
|
1079
|
+
} else {
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1081
|
+
AssistantMessage2,
|
|
1082
|
+
{
|
|
1083
|
+
rawData: message,
|
|
1084
|
+
"data-message-role": "assistant",
|
|
1085
|
+
isLoading: true,
|
|
1086
|
+
isGenerating: true
|
|
1087
|
+
},
|
|
1088
|
+
index
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1095
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1096
|
+
function RenderResultMessage(props) {
|
|
1097
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1098
|
+
if (message.isResultMessage() && inProgress && isCurrentMessage) {
|
|
1099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1100
|
+
AssistantMessage2,
|
|
1101
|
+
{
|
|
1102
|
+
"data-message-role": "assistant",
|
|
1103
|
+
rawData: message,
|
|
1104
|
+
isLoading: true,
|
|
1105
|
+
isGenerating: true
|
|
1106
|
+
},
|
|
1107
|
+
index
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
1113
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
1114
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1115
|
+
function RenderAgentStateMessage(props) {
|
|
1116
|
+
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1117
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
1118
|
+
if (message.isAgentStateMessage()) {
|
|
1119
|
+
let render;
|
|
1120
|
+
if (chatComponentsCache.current !== null) {
|
|
1121
|
+
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1122
|
+
}
|
|
1123
|
+
if (render) {
|
|
1124
|
+
if (typeof render === "string") {
|
|
1125
|
+
if (isCurrentMessage && inProgress) {
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1127
|
+
AssistantMessage2,
|
|
1128
|
+
{
|
|
1129
|
+
rawData: message,
|
|
1130
|
+
message: render,
|
|
1131
|
+
"data-message-role": "assistant",
|
|
1132
|
+
isLoading: true,
|
|
1133
|
+
isGenerating: true
|
|
1134
|
+
},
|
|
1135
|
+
index
|
|
1136
|
+
);
|
|
1137
|
+
} else {
|
|
1138
|
+
return null;
|
|
1139
|
+
}
|
|
1140
|
+
} else {
|
|
1141
|
+
const state = message.state;
|
|
1142
|
+
let status = message.active ? "inProgress" : "complete";
|
|
1143
|
+
const toRender = render({
|
|
1144
|
+
status,
|
|
1145
|
+
state,
|
|
1146
|
+
nodeName: message.nodeName
|
|
1147
|
+
});
|
|
1148
|
+
if (!toRender && status === "complete") {
|
|
1149
|
+
return null;
|
|
1150
|
+
}
|
|
1151
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
1152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1153
|
+
AssistantMessage2,
|
|
1154
|
+
{
|
|
1155
|
+
"data-message-role": "assistant",
|
|
1156
|
+
rawData: message,
|
|
1157
|
+
isLoading: true,
|
|
1158
|
+
isGenerating: true
|
|
1159
|
+
},
|
|
1160
|
+
index
|
|
1161
|
+
);
|
|
1162
|
+
} else if (!toRender) {
|
|
1163
|
+
return null;
|
|
1164
|
+
}
|
|
1165
|
+
if (typeof toRender === "string") {
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1167
|
+
AssistantMessage2,
|
|
1168
|
+
{
|
|
1169
|
+
rawData: message,
|
|
1170
|
+
message: toRender,
|
|
1171
|
+
isLoading: true,
|
|
1172
|
+
isGenerating: true,
|
|
1173
|
+
"data-message-role": "assistant"
|
|
1174
|
+
},
|
|
1175
|
+
index
|
|
1176
|
+
);
|
|
1177
|
+
} else {
|
|
1178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1179
|
+
AssistantMessage2,
|
|
1180
|
+
{
|
|
1181
|
+
rawData: message,
|
|
1182
|
+
"data-message-role": "agent-state-render",
|
|
1183
|
+
isLoading: false,
|
|
1184
|
+
isGenerating: false,
|
|
1185
|
+
subComponent: toRender
|
|
1186
|
+
},
|
|
1187
|
+
index
|
|
1188
|
+
);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1192
|
+
return null;
|
|
1193
|
+
} else {
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1195
|
+
AssistantMessage2,
|
|
1196
|
+
{
|
|
1197
|
+
rawData: message,
|
|
1198
|
+
isLoading: true,
|
|
1199
|
+
isGenerating: true,
|
|
1200
|
+
"data-message-role": "assistant"
|
|
1201
|
+
},
|
|
1202
|
+
index
|
|
1203
|
+
);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
|
|
942
1208
|
// src/components/chat/Markdown.tsx
|
|
943
1209
|
var import_react8 = require("react");
|
|
944
1210
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
@@ -970,7 +1236,7 @@ function useCopyToClipboard({ timeout = 2e3 }) {
|
|
|
970
1236
|
}
|
|
971
1237
|
|
|
972
1238
|
// src/components/chat/CodeBlock.tsx
|
|
973
|
-
var
|
|
1239
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
974
1240
|
var programmingLanguages = {
|
|
975
1241
|
javascript: ".js",
|
|
976
1242
|
python: ".py",
|
|
@@ -1033,21 +1299,21 @@ var CodeBlock = (0, import_react7.memo)(({ language, value }) => {
|
|
|
1033
1299
|
return;
|
|
1034
1300
|
copyToClipboard(value);
|
|
1035
1301
|
};
|
|
1036
|
-
return /* @__PURE__ */ (0,
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1039
|
-
/* @__PURE__ */ (0,
|
|
1040
|
-
/* @__PURE__ */ (0,
|
|
1041
|
-
/* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlock", children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DownloadIcon, {}),
|
|
1308
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Download" })
|
|
1043
1309
|
] }),
|
|
1044
|
-
/* @__PURE__ */ (0,
|
|
1045
|
-
isCopied ? /* @__PURE__ */ (0,
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
|
|
1311
|
+
isCopied ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CopyIcon, {}),
|
|
1312
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Copy code" })
|
|
1047
1313
|
] })
|
|
1048
1314
|
] })
|
|
1049
1315
|
] }),
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1051
1317
|
import_react_syntax_highlighter.Prism,
|
|
1052
1318
|
{
|
|
1053
1319
|
language,
|
|
@@ -1350,21 +1616,21 @@ var highlightStyle = {
|
|
|
1350
1616
|
// src/components/chat/Markdown.tsx
|
|
1351
1617
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
1352
1618
|
var import_remark_math = __toESM(require("remark-math"));
|
|
1353
|
-
var
|
|
1619
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1354
1620
|
var MemoizedReactMarkdown = (0, import_react8.memo)(
|
|
1355
1621
|
import_react_markdown.default,
|
|
1356
1622
|
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
|
|
1357
1623
|
);
|
|
1358
1624
|
var Markdown = ({ content }) => {
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1625
|
+
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 }) });
|
|
1360
1626
|
};
|
|
1361
1627
|
var components = {
|
|
1362
1628
|
p({ children }) {
|
|
1363
|
-
return /* @__PURE__ */ (0,
|
|
1629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children });
|
|
1364
1630
|
},
|
|
1365
1631
|
a(_a) {
|
|
1366
1632
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1367
|
-
return /* @__PURE__ */ (0,
|
|
1633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1368
1634
|
"a",
|
|
1369
1635
|
__spreadProps(__spreadValues({
|
|
1370
1636
|
style: { color: "blue", textDecoration: "underline" }
|
|
@@ -1379,7 +1645,7 @@ var components = {
|
|
|
1379
1645
|
var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
|
|
1380
1646
|
if (children.length) {
|
|
1381
1647
|
if (children[0] == "\u258D") {
|
|
1382
|
-
return /* @__PURE__ */ (0,
|
|
1648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1383
1649
|
"span",
|
|
1384
1650
|
{
|
|
1385
1651
|
style: {
|
|
@@ -1394,9 +1660,9 @@ var components = {
|
|
|
1394
1660
|
}
|
|
1395
1661
|
const match = /language-(\w+)/.exec(className || "");
|
|
1396
1662
|
if (inline) {
|
|
1397
|
-
return /* @__PURE__ */ (0,
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
|
|
1398
1664
|
}
|
|
1399
|
-
return /* @__PURE__ */ (0,
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1400
1666
|
CodeBlock,
|
|
1401
1667
|
__spreadValues({
|
|
1402
1668
|
language: match && match[1] || "",
|
|
@@ -1407,187 +1673,33 @@ var components = {
|
|
|
1407
1673
|
}
|
|
1408
1674
|
};
|
|
1409
1675
|
|
|
1410
|
-
// src/components/chat/messages/
|
|
1411
|
-
var
|
|
1412
|
-
|
|
1413
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1414
|
-
const { icons } = useChatContext();
|
|
1415
|
-
if (message.isTextMessage()) {
|
|
1416
|
-
if (message.role === "user") {
|
|
1417
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1418
|
-
"div",
|
|
1419
|
-
{
|
|
1420
|
-
"data-message-role": "user",
|
|
1421
|
-
className: "copilotKitMessage copilotKitUserMessage",
|
|
1422
|
-
children: message.content
|
|
1423
|
-
},
|
|
1424
|
-
index
|
|
1425
|
-
);
|
|
1426
|
-
} else if (message.role == "assistant") {
|
|
1427
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1428
|
-
"div",
|
|
1429
|
-
{
|
|
1430
|
-
"data-message-role": "assistant",
|
|
1431
|
-
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1432
|
-
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Markdown, { content: message.content })
|
|
1433
|
-
},
|
|
1434
|
-
index
|
|
1435
|
-
);
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
1441
|
-
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
1442
|
-
var import_react_core3 = require("@copilotkit/react-core");
|
|
1443
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1444
|
-
function RenderActionExecutionMessage(props) {
|
|
1445
|
-
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
1446
|
-
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1447
|
-
const { icons } = useChatContext();
|
|
1448
|
-
if (message.isActionExecutionMessage()) {
|
|
1449
|
-
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1450
|
-
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1451
|
-
if (typeof render === "string") {
|
|
1452
|
-
if (isCurrentMessage && inProgress) {
|
|
1453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1454
|
-
icons.spinnerIcon,
|
|
1455
|
-
" ",
|
|
1456
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1457
|
-
] }, index);
|
|
1458
|
-
} else {
|
|
1459
|
-
return null;
|
|
1460
|
-
}
|
|
1461
|
-
} else {
|
|
1462
|
-
const args = message.arguments;
|
|
1463
|
-
let status = "inProgress";
|
|
1464
|
-
if (actionResult !== void 0) {
|
|
1465
|
-
status = "complete";
|
|
1466
|
-
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1467
|
-
status = "executing";
|
|
1468
|
-
}
|
|
1469
|
-
try {
|
|
1470
|
-
const toRender = render({
|
|
1471
|
-
status,
|
|
1472
|
-
args,
|
|
1473
|
-
result: actionResult,
|
|
1474
|
-
name: message.name
|
|
1475
|
-
});
|
|
1476
|
-
if (!toRender && status === "complete") {
|
|
1477
|
-
return null;
|
|
1478
|
-
}
|
|
1479
|
-
if (typeof toRender === "string") {
|
|
1480
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1481
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1482
|
-
" ",
|
|
1483
|
-
toRender
|
|
1484
|
-
] }, index);
|
|
1485
|
-
} else {
|
|
1486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1487
|
-
"div",
|
|
1488
|
-
{
|
|
1489
|
-
"data-message-type": "action-render",
|
|
1490
|
-
className: "copilotKitCustomAssistantMessage",
|
|
1491
|
-
children: toRender
|
|
1492
|
-
},
|
|
1493
|
-
index
|
|
1494
|
-
);
|
|
1495
|
-
}
|
|
1496
|
-
} catch (e) {
|
|
1497
|
-
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1498
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1499
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1500
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
|
|
1501
|
-
"\u274C Error executing render: ",
|
|
1502
|
-
message.name
|
|
1503
|
-
] }),
|
|
1504
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("br", {}),
|
|
1505
|
-
e instanceof Error ? e.message : String(e)
|
|
1506
|
-
] }, index);
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1510
|
-
return null;
|
|
1511
|
-
} else {
|
|
1512
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1518
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1519
|
-
function RenderResultMessage(props) {
|
|
1520
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1676
|
+
// src/components/chat/messages/AssistantMessage.tsx
|
|
1677
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1678
|
+
var AssistantMessage = (props) => {
|
|
1521
1679
|
const { icons } = useChatContext();
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
}
|
|
1680
|
+
const { message, isLoading, subComponent } = props;
|
|
1681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1682
|
+
(message || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "copilotKitMessage copilotKitAssistantMessage", children: [
|
|
1683
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Markdown, { content: message || "" }),
|
|
1684
|
+
isLoading && icons.spinnerIcon
|
|
1685
|
+
] }),
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginBottom: "0.5rem" }, children: subComponent })
|
|
1687
|
+
] });
|
|
1688
|
+
};
|
|
1526
1689
|
|
|
1527
|
-
// src/components/chat/messages/
|
|
1528
|
-
var
|
|
1529
|
-
var
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1533
|
-
const { icons } = useChatContext();
|
|
1534
|
-
if (message.isAgentStateMessage()) {
|
|
1535
|
-
let render;
|
|
1536
|
-
if (chatComponentsCache.current !== null) {
|
|
1537
|
-
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1538
|
-
}
|
|
1539
|
-
if (render) {
|
|
1540
|
-
if (typeof render === "string") {
|
|
1541
|
-
if (isCurrentMessage && inProgress) {
|
|
1542
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1543
|
-
icons.spinnerIcon,
|
|
1544
|
-
" ",
|
|
1545
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1546
|
-
] }, index);
|
|
1547
|
-
} else {
|
|
1548
|
-
return null;
|
|
1549
|
-
}
|
|
1550
|
-
} else {
|
|
1551
|
-
const state = message.state;
|
|
1552
|
-
let status = message.active ? "inProgress" : "complete";
|
|
1553
|
-
const toRender = render({
|
|
1554
|
-
status,
|
|
1555
|
-
state,
|
|
1556
|
-
nodeName: message.nodeName
|
|
1557
|
-
});
|
|
1558
|
-
if (!toRender && status === "complete") {
|
|
1559
|
-
return null;
|
|
1560
|
-
}
|
|
1561
|
-
if (!toRender && isCurrentMessage && inProgress) {
|
|
1562
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1563
|
-
} else if (!toRender) {
|
|
1564
|
-
return null;
|
|
1565
|
-
}
|
|
1566
|
-
if (typeof toRender === "string") {
|
|
1567
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1568
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1569
|
-
" ",
|
|
1570
|
-
toRender
|
|
1571
|
-
] }, index);
|
|
1572
|
-
} else {
|
|
1573
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1577
|
-
return null;
|
|
1578
|
-
} else {
|
|
1579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1690
|
+
// src/components/chat/messages/UserMessage.tsx
|
|
1691
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1692
|
+
var UserMessage = (props) => {
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.message });
|
|
1694
|
+
};
|
|
1583
1695
|
|
|
1584
1696
|
// src/components/chat/Suggestion.tsx
|
|
1585
1697
|
var import_react_core5 = require("@copilotkit/react-core");
|
|
1586
1698
|
var import_shared = require("@copilotkit/shared");
|
|
1587
1699
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1588
|
-
var
|
|
1700
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1589
1701
|
function Suggestion({ title, message, onClick, partial, className }) {
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1591
1703
|
"button",
|
|
1592
1704
|
{
|
|
1593
1705
|
disabled: partial,
|
|
@@ -1598,7 +1710,7 @@ function Suggestion({ title, message, onClick, partial, className }) {
|
|
|
1598
1710
|
className: className || "suggestion",
|
|
1599
1711
|
children: [
|
|
1600
1712
|
partial && SmallSpinnerIcon,
|
|
1601
|
-
/* @__PURE__ */ (0,
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: title })
|
|
1602
1714
|
]
|
|
1603
1715
|
}
|
|
1604
1716
|
);
|
|
@@ -1816,8 +1928,8 @@ var import_react_core7 = require("@copilotkit/react-core");
|
|
|
1816
1928
|
var import_react10 = require("react");
|
|
1817
1929
|
|
|
1818
1930
|
// src/components/dev-console/icons.tsx
|
|
1819
|
-
var
|
|
1820
|
-
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0,
|
|
1931
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1932
|
+
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1821
1933
|
"svg",
|
|
1822
1934
|
{
|
|
1823
1935
|
width: "13.3967723px",
|
|
@@ -1825,7 +1937,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1825
1937
|
viewBox: "0 0 13.3967723 12",
|
|
1826
1938
|
version: "1.1",
|
|
1827
1939
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1828
|
-
children: /* @__PURE__ */ (0,
|
|
1940
|
+
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)(
|
|
1829
1941
|
"path",
|
|
1830
1942
|
{
|
|
1831
1943
|
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",
|
|
@@ -1834,7 +1946,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1834
1946
|
) }) })
|
|
1835
1947
|
}
|
|
1836
1948
|
);
|
|
1837
|
-
var ExclamationMarkIcon = /* @__PURE__ */ (0,
|
|
1949
|
+
var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1838
1950
|
"svg",
|
|
1839
1951
|
{
|
|
1840
1952
|
width: "14px",
|
|
@@ -1842,7 +1954,7 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1842
1954
|
viewBox: "0 0 14 14",
|
|
1843
1955
|
version: "1.1",
|
|
1844
1956
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1845
|
-
children: /* @__PURE__ */ (0,
|
|
1957
|
+
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)(
|
|
1846
1958
|
"path",
|
|
1847
1959
|
{
|
|
1848
1960
|
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",
|
|
@@ -1851,14 +1963,14 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1851
1963
|
) }) })
|
|
1852
1964
|
}
|
|
1853
1965
|
);
|
|
1854
|
-
var ChevronDownIcon = /* @__PURE__ */ (0,
|
|
1966
|
+
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)(
|
|
1855
1967
|
"path",
|
|
1856
1968
|
{
|
|
1857
1969
|
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",
|
|
1858
1970
|
id: "Path"
|
|
1859
1971
|
}
|
|
1860
1972
|
) }) }) });
|
|
1861
|
-
var CheckIcon2 = /* @__PURE__ */ (0,
|
|
1973
|
+
var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1862
1974
|
"svg",
|
|
1863
1975
|
{
|
|
1864
1976
|
width: "14px",
|
|
@@ -1866,7 +1978,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1866
1978
|
viewBox: "0 0 14 14",
|
|
1867
1979
|
version: "1.1",
|
|
1868
1980
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1869
|
-
children: /* @__PURE__ */ (0,
|
|
1981
|
+
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)(
|
|
1870
1982
|
"path",
|
|
1871
1983
|
{
|
|
1872
1984
|
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",
|
|
@@ -1875,7 +1987,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
|
1875
1987
|
) }) }) })
|
|
1876
1988
|
}
|
|
1877
1989
|
);
|
|
1878
|
-
var CopilotKitIcon = /* @__PURE__ */ (0,
|
|
1990
|
+
var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1879
1991
|
"svg",
|
|
1880
1992
|
{
|
|
1881
1993
|
width: "33px",
|
|
@@ -1884,8 +1996,8 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
|
1884
1996
|
version: "1.1",
|
|
1885
1997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1886
1998
|
children: [
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
2000
|
+
/* @__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)(
|
|
1889
2001
|
"image",
|
|
1890
2002
|
{
|
|
1891
2003
|
x: "0",
|
|
@@ -1907,8 +2019,8 @@ var import_shared2 = require("@copilotkit/shared");
|
|
|
1907
2019
|
var import_react9 = require("react");
|
|
1908
2020
|
|
|
1909
2021
|
// src/components/help-modal/icons.tsx
|
|
1910
|
-
var
|
|
1911
|
-
var CloseIcon2 = () => /* @__PURE__ */ (0,
|
|
2022
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2023
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1912
2024
|
"svg",
|
|
1913
2025
|
{
|
|
1914
2026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1918,10 +2030,10 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
|
1918
2030
|
stroke: "currentColor",
|
|
1919
2031
|
width: "20",
|
|
1920
2032
|
height: "20",
|
|
1921
|
-
children: /* @__PURE__ */ (0,
|
|
2033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1922
2034
|
}
|
|
1923
2035
|
);
|
|
1924
|
-
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
2036
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1925
2037
|
"svg",
|
|
1926
2038
|
{
|
|
1927
2039
|
style: {
|
|
@@ -1934,7 +2046,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1934
2046
|
fill: "none",
|
|
1935
2047
|
viewBox: "0 0 24 24",
|
|
1936
2048
|
children: [
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1938
2050
|
"circle",
|
|
1939
2051
|
{
|
|
1940
2052
|
style: { opacity: 0.25 },
|
|
@@ -1945,7 +2057,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1945
2057
|
strokeWidth: "4"
|
|
1946
2058
|
}
|
|
1947
2059
|
),
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1949
2061
|
"path",
|
|
1950
2062
|
{
|
|
1951
2063
|
style: { opacity: 0.75 },
|
|
@@ -1958,7 +2070,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1958
2070
|
);
|
|
1959
2071
|
|
|
1960
2072
|
// src/components/help-modal/modal.tsx
|
|
1961
|
-
var
|
|
2073
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1962
2074
|
function CopilotKitHelpModal() {
|
|
1963
2075
|
const [showHelpModal, setShowHelpModal] = (0, import_react9.useState)(false);
|
|
1964
2076
|
const [issueDescription, setIssueDescription] = (0, import_react9.useState)("");
|
|
@@ -1994,7 +2106,7 @@ function CopilotKitHelpModal() {
|
|
|
1994
2106
|
setSubmitting(false);
|
|
1995
2107
|
setShowHelpModal(false);
|
|
1996
2108
|
});
|
|
1997
|
-
const HelpButton = () => /* @__PURE__ */ (0,
|
|
2109
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1998
2110
|
"button",
|
|
1999
2111
|
{
|
|
2000
2112
|
onClick: () => setShowHelpModal(true),
|
|
@@ -2008,27 +2120,27 @@ function CopilotKitHelpModal() {
|
|
|
2008
2120
|
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
2009
2121
|
[submitting, emailError, issueDescription]
|
|
2010
2122
|
);
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2013
|
-
showHelpModal && /* @__PURE__ */ (0,
|
|
2123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(HelpButton, {}),
|
|
2125
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2014
2126
|
"div",
|
|
2015
2127
|
{
|
|
2016
2128
|
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
2017
2129
|
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
2018
|
-
children: /* @__PURE__ */ (0,
|
|
2019
|
-
/* @__PURE__ */ (0,
|
|
2130
|
+
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: [
|
|
2131
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2020
2132
|
"button",
|
|
2021
2133
|
{
|
|
2022
2134
|
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
2023
2135
|
style: { top: "10px", right: "10px" },
|
|
2024
2136
|
onClick: () => setShowHelpModal(false),
|
|
2025
2137
|
"aria-label": "Close",
|
|
2026
|
-
children: /* @__PURE__ */ (0,
|
|
2138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CloseIcon2, {})
|
|
2027
2139
|
}
|
|
2028
2140
|
),
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2031
|
-
/* @__PURE__ */ (0,
|
|
2141
|
+
/* @__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" }) }),
|
|
2142
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
2143
|
+
/* @__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)(
|
|
2032
2144
|
"a",
|
|
2033
2145
|
{
|
|
2034
2146
|
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
@@ -2037,7 +2149,7 @@ function CopilotKitHelpModal() {
|
|
|
2037
2149
|
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
2038
2150
|
}
|
|
2039
2151
|
) }),
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2152
|
+
/* @__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)(
|
|
2041
2153
|
"a",
|
|
2042
2154
|
{
|
|
2043
2155
|
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
@@ -2046,7 +2158,7 @@ function CopilotKitHelpModal() {
|
|
|
2046
2158
|
children: "Go to Discord Support Channel (Community Support)"
|
|
2047
2159
|
}
|
|
2048
2160
|
) }),
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__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)(
|
|
2050
2162
|
"a",
|
|
2051
2163
|
{
|
|
2052
2164
|
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
@@ -2056,10 +2168,10 @@ function CopilotKitHelpModal() {
|
|
|
2056
2168
|
}
|
|
2057
2169
|
) })
|
|
2058
2170
|
] }),
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
2171
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2173
|
+
/* @__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:" }),
|
|
2174
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2063
2175
|
"textarea",
|
|
2064
2176
|
{
|
|
2065
2177
|
id: "feedback",
|
|
@@ -2072,9 +2184,9 @@ function CopilotKitHelpModal() {
|
|
|
2072
2184
|
}
|
|
2073
2185
|
)
|
|
2074
2186
|
] }),
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2077
|
-
/* @__PURE__ */ (0,
|
|
2187
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2078
2190
|
"input",
|
|
2079
2191
|
{
|
|
2080
2192
|
type: "email",
|
|
@@ -2088,9 +2200,9 @@ function CopilotKitHelpModal() {
|
|
|
2088
2200
|
value: email
|
|
2089
2201
|
}
|
|
2090
2202
|
),
|
|
2091
|
-
emailError && /* @__PURE__ */ (0,
|
|
2203
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
2092
2204
|
] }),
|
|
2093
|
-
/* @__PURE__ */ (0,
|
|
2205
|
+
/* @__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)(
|
|
2094
2206
|
"button",
|
|
2095
2207
|
{
|
|
2096
2208
|
type: "submit",
|
|
@@ -2098,7 +2210,7 @@ function CopilotKitHelpModal() {
|
|
|
2098
2210
|
disabled: submitButtonDisabled,
|
|
2099
2211
|
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
2100
2212
|
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",
|
|
2101
|
-
children: submitting ? /* @__PURE__ */ (0,
|
|
2213
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
2102
2214
|
}
|
|
2103
2215
|
) })
|
|
2104
2216
|
] })
|
|
@@ -2109,7 +2221,7 @@ function CopilotKitHelpModal() {
|
|
|
2109
2221
|
}
|
|
2110
2222
|
|
|
2111
2223
|
// src/components/dev-console/console.tsx
|
|
2112
|
-
var
|
|
2224
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2113
2225
|
function CopilotDevConsole() {
|
|
2114
2226
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
2115
2227
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
@@ -2183,14 +2295,14 @@ function CopilotDevConsole() {
|
|
|
2183
2295
|
if (!showDevConsole) {
|
|
2184
2296
|
return null;
|
|
2185
2297
|
}
|
|
2186
|
-
return /* @__PURE__ */ (0,
|
|
2298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2187
2299
|
"div",
|
|
2188
2300
|
{
|
|
2189
2301
|
ref: consoleRef,
|
|
2190
2302
|
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
2191
2303
|
children: [
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2304
|
+
/* @__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 }) }),
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2194
2306
|
VersionInfo,
|
|
2195
2307
|
{
|
|
2196
2308
|
showDevConsole: context.showDevConsole,
|
|
@@ -2199,8 +2311,8 @@ function CopilotDevConsole() {
|
|
|
2199
2311
|
latestVersion
|
|
2200
2312
|
}
|
|
2201
2313
|
),
|
|
2202
|
-
/* @__PURE__ */ (0,
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
2314
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CopilotKitHelpModal, {}),
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2204
2316
|
DebugMenuButton,
|
|
2205
2317
|
{
|
|
2206
2318
|
setShowDevConsole,
|
|
@@ -2255,12 +2367,12 @@ function VersionInfo({
|
|
|
2255
2367
|
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2256
2368
|
});
|
|
2257
2369
|
};
|
|
2258
|
-
return /* @__PURE__ */ (0,
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { children: [
|
|
2260
2372
|
"COPILOTKIT DEV CONSOLE",
|
|
2261
|
-
showDevConsole === "auto" && /* @__PURE__ */ (0,
|
|
2373
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("aside", { children: asideLabel })
|
|
2262
2374
|
] }),
|
|
2263
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { children: [
|
|
2264
2376
|
"Version: ",
|
|
2265
2377
|
versionLabel,
|
|
2266
2378
|
" (",
|
|
@@ -2268,7 +2380,7 @@ function VersionInfo({
|
|
|
2268
2380
|
") ",
|
|
2269
2381
|
versionIcon
|
|
2270
2382
|
] }),
|
|
2271
|
-
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0,
|
|
2383
|
+
(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 }) })
|
|
2272
2384
|
] });
|
|
2273
2385
|
}
|
|
2274
2386
|
function DebugMenuButton({
|
|
@@ -2278,12 +2390,12 @@ function DebugMenuButton({
|
|
|
2278
2390
|
}) {
|
|
2279
2391
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
2280
2392
|
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2281
|
-
return /* @__PURE__ */ (0,
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2393
|
+
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: [
|
|
2394
|
+
/* @__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: [
|
|
2283
2395
|
"Debug ",
|
|
2284
2396
|
ChevronDownIcon
|
|
2285
2397
|
] }) }),
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2287
2399
|
import_react11.MenuItems,
|
|
2288
2400
|
{
|
|
2289
2401
|
transition: true,
|
|
@@ -2291,9 +2403,9 @@ function DebugMenuButton({
|
|
|
2291
2403
|
className: "copilotKitDebugMenu",
|
|
2292
2404
|
style: { zIndex: 40 },
|
|
2293
2405
|
children: [
|
|
2294
|
-
/* @__PURE__ */ (0,
|
|
2295
|
-
/* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2406
|
+
/* @__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" }) }),
|
|
2407
|
+
/* @__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" }) }),
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react11.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2297
2409
|
"button",
|
|
2298
2410
|
{
|
|
2299
2411
|
className: "copilotKitDebugMenuItem",
|
|
@@ -2301,9 +2413,9 @@ function DebugMenuButton({
|
|
|
2301
2413
|
children: "Log Messages"
|
|
2302
2414
|
}
|
|
2303
2415
|
) }),
|
|
2304
|
-
/* @__PURE__ */ (0,
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2416
|
+
/* @__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" }) }),
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("hr", {}),
|
|
2418
|
+
/* @__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" }) })
|
|
2307
2419
|
]
|
|
2308
2420
|
}
|
|
2309
2421
|
)
|
|
@@ -2312,7 +2424,7 @@ function DebugMenuButton({
|
|
|
2312
2424
|
|
|
2313
2425
|
// src/components/chat/Chat.tsx
|
|
2314
2426
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2315
|
-
var
|
|
2427
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2316
2428
|
function CopilotChat({
|
|
2317
2429
|
instructions,
|
|
2318
2430
|
onSubmitMessage,
|
|
@@ -2330,7 +2442,9 @@ function CopilotChat({
|
|
|
2330
2442
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2331
2443
|
className,
|
|
2332
2444
|
icons,
|
|
2333
|
-
labels
|
|
2445
|
+
labels,
|
|
2446
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2447
|
+
UserMessage: UserMessage2 = UserMessage
|
|
2334
2448
|
}) {
|
|
2335
2449
|
const context = (0, import_react_core8.useCopilotContext)();
|
|
2336
2450
|
(0, import_react12.useEffect)(() => {
|
|
@@ -2352,11 +2466,13 @@ function CopilotChat({
|
|
|
2352
2466
|
);
|
|
2353
2467
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2354
2468
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2355
|
-
return /* @__PURE__ */ (0,
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2357
|
-
/* @__PURE__ */ (0,
|
|
2469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CopilotDevConsole, {}),
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2358
2472
|
Messages2,
|
|
2359
2473
|
{
|
|
2474
|
+
AssistantMessage: AssistantMessage2,
|
|
2475
|
+
UserMessage: UserMessage2,
|
|
2360
2476
|
RenderTextMessage: RenderTextMessage2,
|
|
2361
2477
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2362
2478
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
@@ -2364,9 +2480,9 @@ function CopilotChat({
|
|
|
2364
2480
|
messages: visibleMessages,
|
|
2365
2481
|
inProgress: isLoading,
|
|
2366
2482
|
children: [
|
|
2367
|
-
currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2368
|
-
/* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2483
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h6", { children: "Suggested:" }),
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2370
2486
|
Suggestion,
|
|
2371
2487
|
{
|
|
2372
2488
|
title: suggestion.title,
|
|
@@ -2378,7 +2494,7 @@ function CopilotChat({
|
|
|
2378
2494
|
index
|
|
2379
2495
|
)) })
|
|
2380
2496
|
] }),
|
|
2381
|
-
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0,
|
|
2497
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2382
2498
|
ResponseButton2,
|
|
2383
2499
|
{
|
|
2384
2500
|
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
@@ -2388,7 +2504,7 @@ function CopilotChat({
|
|
|
2388
2504
|
]
|
|
2389
2505
|
}
|
|
2390
2506
|
),
|
|
2391
|
-
/* @__PURE__ */ (0,
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2392
2508
|
] });
|
|
2393
2509
|
}
|
|
2394
2510
|
function WrappedCopilotChat({
|
|
@@ -2399,10 +2515,10 @@ function WrappedCopilotChat({
|
|
|
2399
2515
|
}) {
|
|
2400
2516
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2401
2517
|
if (!chatContext) {
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2403
|
-
}, children: /* @__PURE__ */ (0,
|
|
2518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2519
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2404
2520
|
}
|
|
2405
|
-
return /* @__PURE__ */ (0,
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children });
|
|
2406
2522
|
}
|
|
2407
2523
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2408
2524
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
@@ -2563,7 +2679,7 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onS
|
|
|
2563
2679
|
};
|
|
2564
2680
|
|
|
2565
2681
|
// src/components/chat/Modal.tsx
|
|
2566
|
-
var
|
|
2682
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2567
2683
|
var CopilotModal = ({
|
|
2568
2684
|
instructions,
|
|
2569
2685
|
defaultOpen = false,
|
|
@@ -2585,6 +2701,8 @@ var CopilotModal = ({
|
|
|
2585
2701
|
Messages: Messages2 = Messages,
|
|
2586
2702
|
Input: Input2 = Input,
|
|
2587
2703
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2704
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2705
|
+
UserMessage: UserMessage2 = UserMessage,
|
|
2588
2706
|
className,
|
|
2589
2707
|
children
|
|
2590
2708
|
}) => {
|
|
@@ -2593,19 +2711,19 @@ var CopilotModal = ({
|
|
|
2593
2711
|
onSetOpen == null ? void 0 : onSetOpen(open);
|
|
2594
2712
|
setOpenState(open);
|
|
2595
2713
|
};
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(ChatContextProvider, { icons, labels, open: openState, setOpen, children: [
|
|
2597
2715
|
children,
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className, children: [
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button2, {}),
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2601
2719
|
Window2,
|
|
2602
2720
|
{
|
|
2603
2721
|
clickOutsideToClose,
|
|
2604
2722
|
shortcut,
|
|
2605
2723
|
hitEscapeToClose,
|
|
2606
2724
|
children: [
|
|
2607
|
-
/* @__PURE__ */ (0,
|
|
2608
|
-
/* @__PURE__ */ (0,
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Header2, {}),
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2609
2727
|
CopilotChat,
|
|
2610
2728
|
{
|
|
2611
2729
|
instructions,
|
|
@@ -2617,7 +2735,9 @@ var CopilotModal = ({
|
|
|
2617
2735
|
onInProgress,
|
|
2618
2736
|
Messages: Messages2,
|
|
2619
2737
|
Input: Input2,
|
|
2620
|
-
ResponseButton: ResponseButton2
|
|
2738
|
+
ResponseButton: ResponseButton2,
|
|
2739
|
+
AssistantMessage: AssistantMessage2,
|
|
2740
|
+
UserMessage: UserMessage2
|
|
2621
2741
|
}
|
|
2622
2742
|
)
|
|
2623
2743
|
]
|
|
@@ -2628,17 +2748,17 @@ var CopilotModal = ({
|
|
|
2628
2748
|
};
|
|
2629
2749
|
|
|
2630
2750
|
// src/components/chat/Popup.tsx
|
|
2631
|
-
var
|
|
2751
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2632
2752
|
function CopilotPopup(props) {
|
|
2633
2753
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2634
2754
|
className: props.className ? props.className + " copilotKitPopup" : "copilotKitPopup"
|
|
2635
2755
|
});
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CopilotModal, __spreadProps(__spreadValues({}, props), { children: props.children }));
|
|
2637
2757
|
}
|
|
2638
2758
|
|
|
2639
2759
|
// src/components/chat/Sidebar.tsx
|
|
2640
2760
|
var import_react14 = require("react");
|
|
2641
|
-
var
|
|
2761
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2642
2762
|
function CopilotSidebar(props) {
|
|
2643
2763
|
props = __spreadProps(__spreadValues({}, props), {
|
|
2644
2764
|
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar"
|
|
@@ -2651,14 +2771,17 @@ function CopilotSidebar(props) {
|
|
|
2651
2771
|
(_a = props.onSetOpen) == null ? void 0 : _a.call(props, open);
|
|
2652
2772
|
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
2653
2773
|
};
|
|
2654
|
-
return /* @__PURE__ */ (0,
|
|
2774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `copilotKitSidebarContentWrapper ${expandedClassName}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CopilotModal, __spreadProps(__spreadValues(__spreadValues({}, props), { onSetOpen }), { children: props.children })) });
|
|
2655
2775
|
}
|
|
2656
2776
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2657
2777
|
0 && (module.exports = {
|
|
2778
|
+
AssistantMessage,
|
|
2658
2779
|
CopilotChat,
|
|
2659
2780
|
CopilotDevConsole,
|
|
2660
2781
|
CopilotPopup,
|
|
2661
2782
|
CopilotSidebar,
|
|
2783
|
+
Markdown,
|
|
2784
|
+
UserMessage,
|
|
2662
2785
|
shouldShowDevConsole,
|
|
2663
2786
|
useChatContext
|
|
2664
2787
|
});
|