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