@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
|
@@ -398,7 +398,9 @@ var Messages = ({
|
|
|
398
398
|
RenderTextMessage: RenderTextMessage2,
|
|
399
399
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
400
400
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
401
|
-
RenderResultMessage: RenderResultMessage2
|
|
401
|
+
RenderResultMessage: RenderResultMessage2,
|
|
402
|
+
AssistantMessage: AssistantMessage2,
|
|
403
|
+
UserMessage: UserMessage2
|
|
402
404
|
}) => {
|
|
403
405
|
const context = useChatContext();
|
|
404
406
|
const initialMessages = (0, import_react2.useMemo)(
|
|
@@ -429,7 +431,9 @@ var Messages = ({
|
|
|
429
431
|
message,
|
|
430
432
|
inProgress,
|
|
431
433
|
index,
|
|
432
|
-
isCurrentMessage
|
|
434
|
+
isCurrentMessage,
|
|
435
|
+
AssistantMessage: AssistantMessage2,
|
|
436
|
+
UserMessage: UserMessage2
|
|
433
437
|
},
|
|
434
438
|
index
|
|
435
439
|
);
|
|
@@ -441,7 +445,9 @@ var Messages = ({
|
|
|
441
445
|
inProgress,
|
|
442
446
|
index,
|
|
443
447
|
isCurrentMessage,
|
|
444
|
-
actionResult: actionResults[message.id]
|
|
448
|
+
actionResult: actionResults[message.id],
|
|
449
|
+
AssistantMessage: AssistantMessage2,
|
|
450
|
+
UserMessage: UserMessage2
|
|
445
451
|
},
|
|
446
452
|
index
|
|
447
453
|
);
|
|
@@ -452,7 +458,9 @@ var Messages = ({
|
|
|
452
458
|
message,
|
|
453
459
|
inProgress,
|
|
454
460
|
index,
|
|
455
|
-
isCurrentMessage
|
|
461
|
+
isCurrentMessage,
|
|
462
|
+
AssistantMessage: AssistantMessage2,
|
|
463
|
+
UserMessage: UserMessage2
|
|
456
464
|
},
|
|
457
465
|
index
|
|
458
466
|
);
|
|
@@ -463,7 +471,9 @@ var Messages = ({
|
|
|
463
471
|
message,
|
|
464
472
|
inProgress,
|
|
465
473
|
index,
|
|
466
|
-
isCurrentMessage
|
|
474
|
+
isCurrentMessage,
|
|
475
|
+
AssistantMessage: AssistantMessage2,
|
|
476
|
+
UserMessage: UserMessage2
|
|
467
477
|
},
|
|
468
478
|
index
|
|
469
479
|
);
|
|
@@ -796,6 +806,259 @@ var ResponseButton = ({ onClick, inProgress }) => {
|
|
|
796
806
|
] });
|
|
797
807
|
};
|
|
798
808
|
|
|
809
|
+
// src/components/chat/messages/RenderTextMessage.tsx
|
|
810
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
811
|
+
function RenderTextMessage(props) {
|
|
812
|
+
const { message, inProgress, index, isCurrentMessage, UserMessage: UserMessage2, AssistantMessage: AssistantMessage2 } = props;
|
|
813
|
+
if (message.isTextMessage()) {
|
|
814
|
+
if (message.role === "user") {
|
|
815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
816
|
+
UserMessage2,
|
|
817
|
+
{
|
|
818
|
+
"data-message-role": "user",
|
|
819
|
+
message: message.content,
|
|
820
|
+
rawData: message
|
|
821
|
+
},
|
|
822
|
+
index
|
|
823
|
+
);
|
|
824
|
+
} else if (message.role == "assistant") {
|
|
825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
826
|
+
AssistantMessage2,
|
|
827
|
+
{
|
|
828
|
+
"data-message-role": "assistant",
|
|
829
|
+
message: message.content,
|
|
830
|
+
rawData: message,
|
|
831
|
+
isLoading: inProgress && isCurrentMessage && !message.content,
|
|
832
|
+
isGenerating: inProgress && isCurrentMessage && !!message.content
|
|
833
|
+
},
|
|
834
|
+
index
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
841
|
+
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
842
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
843
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
844
|
+
function RenderActionExecutionMessage(props) {
|
|
845
|
+
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
846
|
+
const { message, inProgress, index, isCurrentMessage, actionResult, AssistantMessage: AssistantMessage2 } = props;
|
|
847
|
+
if (message.isActionExecutionMessage()) {
|
|
848
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
849
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
850
|
+
if (typeof render === "string") {
|
|
851
|
+
if (isCurrentMessage && inProgress) {
|
|
852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
853
|
+
AssistantMessage2,
|
|
854
|
+
{
|
|
855
|
+
rawData: message,
|
|
856
|
+
"data-message-role": "assistant",
|
|
857
|
+
isLoading: false,
|
|
858
|
+
isGenerating: true,
|
|
859
|
+
message: render
|
|
860
|
+
},
|
|
861
|
+
index
|
|
862
|
+
);
|
|
863
|
+
} else {
|
|
864
|
+
return null;
|
|
865
|
+
}
|
|
866
|
+
} else {
|
|
867
|
+
const args = message.arguments;
|
|
868
|
+
let status = "inProgress";
|
|
869
|
+
if (actionResult !== void 0) {
|
|
870
|
+
status = "complete";
|
|
871
|
+
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
872
|
+
status = "executing";
|
|
873
|
+
}
|
|
874
|
+
try {
|
|
875
|
+
const toRender = render({
|
|
876
|
+
status,
|
|
877
|
+
args,
|
|
878
|
+
result: actionResult,
|
|
879
|
+
name: message.name
|
|
880
|
+
});
|
|
881
|
+
if (!toRender && status === "complete") {
|
|
882
|
+
return null;
|
|
883
|
+
}
|
|
884
|
+
if (typeof toRender === "string") {
|
|
885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
886
|
+
AssistantMessage2,
|
|
887
|
+
{
|
|
888
|
+
rawData: message,
|
|
889
|
+
"data-message-role": "assistant",
|
|
890
|
+
isLoading: false,
|
|
891
|
+
isGenerating: false,
|
|
892
|
+
message: toRender
|
|
893
|
+
},
|
|
894
|
+
index
|
|
895
|
+
);
|
|
896
|
+
} else {
|
|
897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
898
|
+
AssistantMessage2,
|
|
899
|
+
{
|
|
900
|
+
rawData: message,
|
|
901
|
+
"data-message-role": "action-render",
|
|
902
|
+
isLoading: false,
|
|
903
|
+
isGenerating: false,
|
|
904
|
+
subComponent: toRender
|
|
905
|
+
},
|
|
906
|
+
index
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
} catch (e) {
|
|
910
|
+
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
912
|
+
AssistantMessage2,
|
|
913
|
+
{
|
|
914
|
+
rawData: message,
|
|
915
|
+
"data-message-role": "assistant",
|
|
916
|
+
isLoading: false,
|
|
917
|
+
isGenerating: false,
|
|
918
|
+
subComponent: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { children: [
|
|
920
|
+
"\u274C Error executing render: ",
|
|
921
|
+
message.name
|
|
922
|
+
] }),
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("br", {}),
|
|
924
|
+
e instanceof Error ? e.message : String(e)
|
|
925
|
+
] })
|
|
926
|
+
},
|
|
927
|
+
index
|
|
928
|
+
);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
932
|
+
return null;
|
|
933
|
+
} else {
|
|
934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
935
|
+
AssistantMessage2,
|
|
936
|
+
{
|
|
937
|
+
rawData: message,
|
|
938
|
+
"data-message-role": "assistant",
|
|
939
|
+
isLoading: true,
|
|
940
|
+
isGenerating: true
|
|
941
|
+
},
|
|
942
|
+
index
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// src/components/chat/messages/RenderResultMessage.tsx
|
|
949
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
950
|
+
function RenderResultMessage(props) {
|
|
951
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
952
|
+
if (message.isResultMessage() && inProgress && isCurrentMessage) {
|
|
953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
954
|
+
AssistantMessage2,
|
|
955
|
+
{
|
|
956
|
+
"data-message-role": "assistant",
|
|
957
|
+
rawData: message,
|
|
958
|
+
isLoading: true,
|
|
959
|
+
isGenerating: true
|
|
960
|
+
},
|
|
961
|
+
index
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
967
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
968
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
969
|
+
function RenderAgentStateMessage(props) {
|
|
970
|
+
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
971
|
+
const { message, inProgress, index, isCurrentMessage, AssistantMessage: AssistantMessage2 } = props;
|
|
972
|
+
if (message.isAgentStateMessage()) {
|
|
973
|
+
let render;
|
|
974
|
+
if (chatComponentsCache.current !== null) {
|
|
975
|
+
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
976
|
+
}
|
|
977
|
+
if (render) {
|
|
978
|
+
if (typeof render === "string") {
|
|
979
|
+
if (isCurrentMessage && inProgress) {
|
|
980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
981
|
+
AssistantMessage2,
|
|
982
|
+
{
|
|
983
|
+
rawData: message,
|
|
984
|
+
message: render,
|
|
985
|
+
"data-message-role": "assistant",
|
|
986
|
+
isLoading: true,
|
|
987
|
+
isGenerating: true
|
|
988
|
+
},
|
|
989
|
+
index
|
|
990
|
+
);
|
|
991
|
+
} else {
|
|
992
|
+
return null;
|
|
993
|
+
}
|
|
994
|
+
} else {
|
|
995
|
+
const state = message.state;
|
|
996
|
+
let status = message.active ? "inProgress" : "complete";
|
|
997
|
+
const toRender = render({
|
|
998
|
+
status,
|
|
999
|
+
state,
|
|
1000
|
+
nodeName: message.nodeName
|
|
1001
|
+
});
|
|
1002
|
+
if (!toRender && status === "complete") {
|
|
1003
|
+
return null;
|
|
1004
|
+
}
|
|
1005
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
1006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1007
|
+
AssistantMessage2,
|
|
1008
|
+
{
|
|
1009
|
+
"data-message-role": "assistant",
|
|
1010
|
+
rawData: message,
|
|
1011
|
+
isLoading: true,
|
|
1012
|
+
isGenerating: true
|
|
1013
|
+
},
|
|
1014
|
+
index
|
|
1015
|
+
);
|
|
1016
|
+
} else if (!toRender) {
|
|
1017
|
+
return null;
|
|
1018
|
+
}
|
|
1019
|
+
if (typeof toRender === "string") {
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1021
|
+
AssistantMessage2,
|
|
1022
|
+
{
|
|
1023
|
+
rawData: message,
|
|
1024
|
+
message: toRender,
|
|
1025
|
+
isLoading: true,
|
|
1026
|
+
isGenerating: true,
|
|
1027
|
+
"data-message-role": "assistant"
|
|
1028
|
+
},
|
|
1029
|
+
index
|
|
1030
|
+
);
|
|
1031
|
+
} else {
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1033
|
+
AssistantMessage2,
|
|
1034
|
+
{
|
|
1035
|
+
rawData: message,
|
|
1036
|
+
"data-message-role": "agent-state-render",
|
|
1037
|
+
isLoading: false,
|
|
1038
|
+
isGenerating: false,
|
|
1039
|
+
subComponent: toRender
|
|
1040
|
+
},
|
|
1041
|
+
index
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1046
|
+
return null;
|
|
1047
|
+
} else {
|
|
1048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1049
|
+
AssistantMessage2,
|
|
1050
|
+
{
|
|
1051
|
+
rawData: message,
|
|
1052
|
+
isLoading: true,
|
|
1053
|
+
isGenerating: true,
|
|
1054
|
+
"data-message-role": "assistant"
|
|
1055
|
+
},
|
|
1056
|
+
index
|
|
1057
|
+
);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
799
1062
|
// src/components/chat/Markdown.tsx
|
|
800
1063
|
var import_react7 = require("react");
|
|
801
1064
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
@@ -827,7 +1090,7 @@ function useCopyToClipboard({ timeout = 2e3 }) {
|
|
|
827
1090
|
}
|
|
828
1091
|
|
|
829
1092
|
// src/components/chat/CodeBlock.tsx
|
|
830
|
-
var
|
|
1093
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
831
1094
|
var programmingLanguages = {
|
|
832
1095
|
javascript: ".js",
|
|
833
1096
|
python: ".py",
|
|
@@ -890,21 +1153,21 @@ var CodeBlock = (0, import_react6.memo)(({ language, value }) => {
|
|
|
890
1153
|
return;
|
|
891
1154
|
copyToClipboard(value);
|
|
892
1155
|
};
|
|
893
|
-
return /* @__PURE__ */ (0,
|
|
894
|
-
/* @__PURE__ */ (0,
|
|
895
|
-
/* @__PURE__ */ (0,
|
|
896
|
-
/* @__PURE__ */ (0,
|
|
897
|
-
/* @__PURE__ */ (0,
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
899
|
-
/* @__PURE__ */ (0,
|
|
1156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "copilotKitCodeBlock", children: [
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
|
|
1160
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
|
|
1161
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DownloadIcon, {}),
|
|
1162
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Download" })
|
|
900
1163
|
] }),
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
902
|
-
isCopied ? /* @__PURE__ */ (0,
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
|
|
1165
|
+
isCopied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyIcon, {}),
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Copy code" })
|
|
904
1167
|
] })
|
|
905
1168
|
] })
|
|
906
1169
|
] }),
|
|
907
|
-
/* @__PURE__ */ (0,
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
908
1171
|
import_react_syntax_highlighter.Prism,
|
|
909
1172
|
{
|
|
910
1173
|
language,
|
|
@@ -1207,21 +1470,21 @@ var highlightStyle = {
|
|
|
1207
1470
|
// src/components/chat/Markdown.tsx
|
|
1208
1471
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
1209
1472
|
var import_remark_math = __toESM(require("remark-math"));
|
|
1210
|
-
var
|
|
1473
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1211
1474
|
var MemoizedReactMarkdown = (0, import_react7.memo)(
|
|
1212
1475
|
import_react_markdown.default,
|
|
1213
1476
|
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
|
|
1214
1477
|
);
|
|
1215
1478
|
var Markdown = ({ content }) => {
|
|
1216
|
-
return /* @__PURE__ */ (0,
|
|
1479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "copilotKitMarkdown", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MemoizedReactMarkdown, { components, remarkPlugins: [import_remark_gfm.default, import_remark_math.default], children: content }) });
|
|
1217
1480
|
};
|
|
1218
1481
|
var components = {
|
|
1219
1482
|
p({ children }) {
|
|
1220
|
-
return /* @__PURE__ */ (0,
|
|
1483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children });
|
|
1221
1484
|
},
|
|
1222
1485
|
a(_a) {
|
|
1223
1486
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1225
1488
|
"a",
|
|
1226
1489
|
__spreadProps(__spreadValues({
|
|
1227
1490
|
style: { color: "blue", textDecoration: "underline" }
|
|
@@ -1236,7 +1499,7 @@ var components = {
|
|
|
1236
1499
|
var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
|
|
1237
1500
|
if (children.length) {
|
|
1238
1501
|
if (children[0] == "\u258D") {
|
|
1239
|
-
return /* @__PURE__ */ (0,
|
|
1502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1240
1503
|
"span",
|
|
1241
1504
|
{
|
|
1242
1505
|
style: {
|
|
@@ -1251,9 +1514,9 @@ var components = {
|
|
|
1251
1514
|
}
|
|
1252
1515
|
const match = /language-(\w+)/.exec(className || "");
|
|
1253
1516
|
if (inline) {
|
|
1254
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
|
|
1255
1518
|
}
|
|
1256
|
-
return /* @__PURE__ */ (0,
|
|
1519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1257
1520
|
CodeBlock,
|
|
1258
1521
|
__spreadValues({
|
|
1259
1522
|
language: match && match[1] || "",
|
|
@@ -1264,187 +1527,33 @@ var components = {
|
|
|
1264
1527
|
}
|
|
1265
1528
|
};
|
|
1266
1529
|
|
|
1267
|
-
// src/components/chat/messages/
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1270
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1271
|
-
const { icons } = useChatContext();
|
|
1272
|
-
if (message.isTextMessage()) {
|
|
1273
|
-
if (message.role === "user") {
|
|
1274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1275
|
-
"div",
|
|
1276
|
-
{
|
|
1277
|
-
"data-message-role": "user",
|
|
1278
|
-
className: "copilotKitMessage copilotKitUserMessage",
|
|
1279
|
-
children: message.content
|
|
1280
|
-
},
|
|
1281
|
-
index
|
|
1282
|
-
);
|
|
1283
|
-
} else if (message.role == "assistant") {
|
|
1284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1285
|
-
"div",
|
|
1286
|
-
{
|
|
1287
|
-
"data-message-role": "assistant",
|
|
1288
|
-
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1289
|
-
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Markdown, { content: message.content })
|
|
1290
|
-
},
|
|
1291
|
-
index
|
|
1292
|
-
);
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
1298
|
-
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
1299
|
-
var import_react_core3 = require("@copilotkit/react-core");
|
|
1300
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1301
|
-
function RenderActionExecutionMessage(props) {
|
|
1302
|
-
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
1303
|
-
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1304
|
-
const { icons } = useChatContext();
|
|
1305
|
-
if (message.isActionExecutionMessage()) {
|
|
1306
|
-
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1307
|
-
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1308
|
-
if (typeof render === "string") {
|
|
1309
|
-
if (isCurrentMessage && inProgress) {
|
|
1310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1311
|
-
icons.spinnerIcon,
|
|
1312
|
-
" ",
|
|
1313
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1314
|
-
] }, index);
|
|
1315
|
-
} else {
|
|
1316
|
-
return null;
|
|
1317
|
-
}
|
|
1318
|
-
} else {
|
|
1319
|
-
const args = message.arguments;
|
|
1320
|
-
let status = "inProgress";
|
|
1321
|
-
if (actionResult !== void 0) {
|
|
1322
|
-
status = "complete";
|
|
1323
|
-
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1324
|
-
status = "executing";
|
|
1325
|
-
}
|
|
1326
|
-
try {
|
|
1327
|
-
const toRender = render({
|
|
1328
|
-
status,
|
|
1329
|
-
args,
|
|
1330
|
-
result: actionResult,
|
|
1331
|
-
name: message.name
|
|
1332
|
-
});
|
|
1333
|
-
if (!toRender && status === "complete") {
|
|
1334
|
-
return null;
|
|
1335
|
-
}
|
|
1336
|
-
if (typeof toRender === "string") {
|
|
1337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1338
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1339
|
-
" ",
|
|
1340
|
-
toRender
|
|
1341
|
-
] }, index);
|
|
1342
|
-
} else {
|
|
1343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1344
|
-
"div",
|
|
1345
|
-
{
|
|
1346
|
-
"data-message-type": "action-render",
|
|
1347
|
-
className: "copilotKitCustomAssistantMessage",
|
|
1348
|
-
children: toRender
|
|
1349
|
-
},
|
|
1350
|
-
index
|
|
1351
|
-
);
|
|
1352
|
-
}
|
|
1353
|
-
} catch (e) {
|
|
1354
|
-
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1355
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1356
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1357
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("b", { children: [
|
|
1358
|
-
"\u274C Error executing render: ",
|
|
1359
|
-
message.name
|
|
1360
|
-
] }),
|
|
1361
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("br", {}),
|
|
1362
|
-
e instanceof Error ? e.message : String(e)
|
|
1363
|
-
] }, index);
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1367
|
-
return null;
|
|
1368
|
-
} else {
|
|
1369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1375
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1376
|
-
function RenderResultMessage(props) {
|
|
1377
|
-
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1530
|
+
// src/components/chat/messages/AssistantMessage.tsx
|
|
1531
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1532
|
+
var AssistantMessage = (props) => {
|
|
1378
1533
|
const { icons } = useChatContext();
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
}
|
|
1534
|
+
const { message, isLoading, subComponent } = props;
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1536
|
+
(message || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "copilotKitMessage copilotKitAssistantMessage", children: [
|
|
1537
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Markdown, { content: message || "" }),
|
|
1538
|
+
isLoading && icons.spinnerIcon
|
|
1539
|
+
] }),
|
|
1540
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: "0.5rem" }, children: subComponent })
|
|
1541
|
+
] });
|
|
1542
|
+
};
|
|
1383
1543
|
|
|
1384
|
-
// src/components/chat/messages/
|
|
1385
|
-
var
|
|
1386
|
-
var
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1390
|
-
const { icons } = useChatContext();
|
|
1391
|
-
if (message.isAgentStateMessage()) {
|
|
1392
|
-
let render;
|
|
1393
|
-
if (chatComponentsCache.current !== null) {
|
|
1394
|
-
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1395
|
-
}
|
|
1396
|
-
if (render) {
|
|
1397
|
-
if (typeof render === "string") {
|
|
1398
|
-
if (isCurrentMessage && inProgress) {
|
|
1399
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1400
|
-
icons.spinnerIcon,
|
|
1401
|
-
" ",
|
|
1402
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1403
|
-
] }, index);
|
|
1404
|
-
} else {
|
|
1405
|
-
return null;
|
|
1406
|
-
}
|
|
1407
|
-
} else {
|
|
1408
|
-
const state = message.state;
|
|
1409
|
-
let status = message.active ? "inProgress" : "complete";
|
|
1410
|
-
const toRender = render({
|
|
1411
|
-
status,
|
|
1412
|
-
state,
|
|
1413
|
-
nodeName: message.nodeName
|
|
1414
|
-
});
|
|
1415
|
-
if (!toRender && status === "complete") {
|
|
1416
|
-
return null;
|
|
1417
|
-
}
|
|
1418
|
-
if (!toRender && isCurrentMessage && inProgress) {
|
|
1419
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1420
|
-
} else if (!toRender) {
|
|
1421
|
-
return null;
|
|
1422
|
-
}
|
|
1423
|
-
if (typeof toRender === "string") {
|
|
1424
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1425
|
-
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1426
|
-
" ",
|
|
1427
|
-
toRender
|
|
1428
|
-
] }, index);
|
|
1429
|
-
} else {
|
|
1430
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
} else if (!inProgress || !isCurrentMessage) {
|
|
1434
|
-
return null;
|
|
1435
|
-
} else {
|
|
1436
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1544
|
+
// src/components/chat/messages/UserMessage.tsx
|
|
1545
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1546
|
+
var UserMessage = (props) => {
|
|
1547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "copilotKitMessage copilotKitUserMessage", children: props.message });
|
|
1548
|
+
};
|
|
1440
1549
|
|
|
1441
1550
|
// src/components/chat/Suggestion.tsx
|
|
1442
1551
|
var import_react_core5 = require("@copilotkit/react-core");
|
|
1443
1552
|
var import_shared = require("@copilotkit/shared");
|
|
1444
1553
|
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1445
|
-
var
|
|
1554
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1446
1555
|
function Suggestion({ title, message, onClick, partial, className }) {
|
|
1447
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1448
1557
|
"button",
|
|
1449
1558
|
{
|
|
1450
1559
|
disabled: partial,
|
|
@@ -1455,7 +1564,7 @@ function Suggestion({ title, message, onClick, partial, className }) {
|
|
|
1455
1564
|
className: className || "suggestion",
|
|
1456
1565
|
children: [
|
|
1457
1566
|
partial && SmallSpinnerIcon,
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1567
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: title })
|
|
1459
1568
|
]
|
|
1460
1569
|
}
|
|
1461
1570
|
);
|
|
@@ -1673,8 +1782,8 @@ var import_react_core7 = require("@copilotkit/react-core");
|
|
|
1673
1782
|
var import_react9 = require("react");
|
|
1674
1783
|
|
|
1675
1784
|
// src/components/dev-console/icons.tsx
|
|
1676
|
-
var
|
|
1677
|
-
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0,
|
|
1785
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1786
|
+
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1678
1787
|
"svg",
|
|
1679
1788
|
{
|
|
1680
1789
|
width: "13.3967723px",
|
|
@@ -1682,7 +1791,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1682
1791
|
viewBox: "0 0 13.3967723 12",
|
|
1683
1792
|
version: "1.1",
|
|
1684
1793
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1685
|
-
children: /* @__PURE__ */ (0,
|
|
1794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1686
1795
|
"path",
|
|
1687
1796
|
{
|
|
1688
1797
|
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",
|
|
@@ -1691,7 +1800,7 @@ var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1691
1800
|
) }) })
|
|
1692
1801
|
}
|
|
1693
1802
|
);
|
|
1694
|
-
var ExclamationMarkIcon = /* @__PURE__ */ (0,
|
|
1803
|
+
var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1695
1804
|
"svg",
|
|
1696
1805
|
{
|
|
1697
1806
|
width: "14px",
|
|
@@ -1699,7 +1808,7 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1699
1808
|
viewBox: "0 0 14 14",
|
|
1700
1809
|
version: "1.1",
|
|
1701
1810
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1702
|
-
children: /* @__PURE__ */ (0,
|
|
1811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "exclamation-circle", fill: "#EC662C", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1703
1812
|
"path",
|
|
1704
1813
|
{
|
|
1705
1814
|
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",
|
|
@@ -1708,14 +1817,14 @@ var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1708
1817
|
) }) })
|
|
1709
1818
|
}
|
|
1710
1819
|
);
|
|
1711
|
-
var ChevronDownIcon = /* @__PURE__ */ (0,
|
|
1820
|
+
var ChevronDownIcon = /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Group", fill: "#000000", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1712
1821
|
"path",
|
|
1713
1822
|
{
|
|
1714
1823
|
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",
|
|
1715
1824
|
id: "Path"
|
|
1716
1825
|
}
|
|
1717
1826
|
) }) }) });
|
|
1718
|
-
var CheckIcon2 = /* @__PURE__ */ (0,
|
|
1827
|
+
var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1719
1828
|
"svg",
|
|
1720
1829
|
{
|
|
1721
1830
|
width: "14px",
|
|
@@ -1723,7 +1832,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1723
1832
|
viewBox: "0 0 14 14",
|
|
1724
1833
|
version: "1.1",
|
|
1725
1834
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1726
|
-
children: /* @__PURE__ */ (0,
|
|
1835
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1727
1836
|
"path",
|
|
1728
1837
|
{
|
|
1729
1838
|
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",
|
|
@@ -1732,7 +1841,7 @@ var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
1732
1841
|
) }) }) })
|
|
1733
1842
|
}
|
|
1734
1843
|
);
|
|
1735
|
-
var CopilotKitIcon = /* @__PURE__ */ (0,
|
|
1844
|
+
var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1736
1845
|
"svg",
|
|
1737
1846
|
{
|
|
1738
1847
|
width: "33px",
|
|
@@ -1741,8 +1850,8 @@ var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
|
1741
1850
|
version: "1.1",
|
|
1742
1851
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1743
1852
|
children: [
|
|
1744
|
-
/* @__PURE__ */ (0,
|
|
1745
|
-
/* @__PURE__ */ (0,
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1746
1855
|
"image",
|
|
1747
1856
|
{
|
|
1748
1857
|
x: "0",
|
|
@@ -1764,8 +1873,8 @@ var import_shared2 = require("@copilotkit/shared");
|
|
|
1764
1873
|
var import_react8 = require("react");
|
|
1765
1874
|
|
|
1766
1875
|
// src/components/help-modal/icons.tsx
|
|
1767
|
-
var
|
|
1768
|
-
var CloseIcon2 = () => /* @__PURE__ */ (0,
|
|
1876
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1877
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1769
1878
|
"svg",
|
|
1770
1879
|
{
|
|
1771
1880
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1775,10 +1884,10 @@ var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
|
1775
1884
|
stroke: "currentColor",
|
|
1776
1885
|
width: "20",
|
|
1777
1886
|
height: "20",
|
|
1778
|
-
children: /* @__PURE__ */ (0,
|
|
1887
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1779
1888
|
}
|
|
1780
1889
|
);
|
|
1781
|
-
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
1890
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1782
1891
|
"svg",
|
|
1783
1892
|
{
|
|
1784
1893
|
style: {
|
|
@@ -1791,7 +1900,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1791
1900
|
fill: "none",
|
|
1792
1901
|
viewBox: "0 0 24 24",
|
|
1793
1902
|
children: [
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1795
1904
|
"circle",
|
|
1796
1905
|
{
|
|
1797
1906
|
style: { opacity: 0.25 },
|
|
@@ -1802,7 +1911,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1802
1911
|
strokeWidth: "4"
|
|
1803
1912
|
}
|
|
1804
1913
|
),
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1806
1915
|
"path",
|
|
1807
1916
|
{
|
|
1808
1917
|
style: { opacity: 0.75 },
|
|
@@ -1815,7 +1924,7 @@ var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0,
|
|
|
1815
1924
|
);
|
|
1816
1925
|
|
|
1817
1926
|
// src/components/help-modal/modal.tsx
|
|
1818
|
-
var
|
|
1927
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1819
1928
|
function CopilotKitHelpModal() {
|
|
1820
1929
|
const [showHelpModal, setShowHelpModal] = (0, import_react8.useState)(false);
|
|
1821
1930
|
const [issueDescription, setIssueDescription] = (0, import_react8.useState)("");
|
|
@@ -1851,7 +1960,7 @@ function CopilotKitHelpModal() {
|
|
|
1851
1960
|
setSubmitting(false);
|
|
1852
1961
|
setShowHelpModal(false);
|
|
1853
1962
|
});
|
|
1854
|
-
const HelpButton = () => /* @__PURE__ */ (0,
|
|
1963
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1855
1964
|
"button",
|
|
1856
1965
|
{
|
|
1857
1966
|
onClick: () => setShowHelpModal(true),
|
|
@@ -1865,27 +1974,27 @@ function CopilotKitHelpModal() {
|
|
|
1865
1974
|
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
1866
1975
|
[submitting, emailError, issueDescription]
|
|
1867
1976
|
);
|
|
1868
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1870
|
-
showHelpModal && /* @__PURE__ */ (0,
|
|
1977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HelpButton, {}),
|
|
1979
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1871
1980
|
"div",
|
|
1872
1981
|
{
|
|
1873
1982
|
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
1874
1983
|
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
1875
|
-
children: /* @__PURE__ */ (0,
|
|
1876
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1877
1986
|
"button",
|
|
1878
1987
|
{
|
|
1879
1988
|
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
1880
1989
|
style: { top: "10px", right: "10px" },
|
|
1881
1990
|
onClick: () => setShowHelpModal(false),
|
|
1882
1991
|
"aria-label": "Close",
|
|
1883
|
-
children: /* @__PURE__ */ (0,
|
|
1992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon2, {})
|
|
1884
1993
|
}
|
|
1885
1994
|
),
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)(
|
|
1889
1998
|
"a",
|
|
1890
1999
|
{
|
|
1891
2000
|
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
@@ -1894,7 +2003,7 @@ function CopilotKitHelpModal() {
|
|
|
1894
2003
|
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
1895
2004
|
}
|
|
1896
2005
|
) }),
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)(
|
|
1898
2007
|
"a",
|
|
1899
2008
|
{
|
|
1900
2009
|
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
@@ -1903,7 +2012,7 @@ function CopilotKitHelpModal() {
|
|
|
1903
2012
|
children: "Go to Discord Support Channel (Community Support)"
|
|
1904
2013
|
}
|
|
1905
2014
|
) }),
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
2015
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)(
|
|
1907
2016
|
"a",
|
|
1908
2017
|
{
|
|
1909
2018
|
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
@@ -1913,10 +2022,10 @@ function CopilotKitHelpModal() {
|
|
|
1913
2022
|
}
|
|
1914
2023
|
) })
|
|
1915
2024
|
] }),
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1918
|
-
/* @__PURE__ */ (0,
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
2025
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
2027
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
2028
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1920
2029
|
"textarea",
|
|
1921
2030
|
{
|
|
1922
2031
|
id: "feedback",
|
|
@@ -1929,9 +2038,9 @@ function CopilotKitHelpModal() {
|
|
|
1929
2038
|
}
|
|
1930
2039
|
)
|
|
1931
2040
|
] }),
|
|
1932
|
-
/* @__PURE__ */ (0,
|
|
1933
|
-
/* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1935
2044
|
"input",
|
|
1936
2045
|
{
|
|
1937
2046
|
type: "email",
|
|
@@ -1945,9 +2054,9 @@ function CopilotKitHelpModal() {
|
|
|
1945
2054
|
value: email
|
|
1946
2055
|
}
|
|
1947
2056
|
),
|
|
1948
|
-
emailError && /* @__PURE__ */ (0,
|
|
2057
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
1949
2058
|
] }),
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)(
|
|
1951
2060
|
"button",
|
|
1952
2061
|
{
|
|
1953
2062
|
type: "submit",
|
|
@@ -1955,7 +2064,7 @@ function CopilotKitHelpModal() {
|
|
|
1955
2064
|
disabled: submitButtonDisabled,
|
|
1956
2065
|
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
1957
2066
|
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",
|
|
1958
|
-
children: submitting ? /* @__PURE__ */ (0,
|
|
2067
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
1959
2068
|
}
|
|
1960
2069
|
) })
|
|
1961
2070
|
] })
|
|
@@ -1966,7 +2075,7 @@ function CopilotKitHelpModal() {
|
|
|
1966
2075
|
}
|
|
1967
2076
|
|
|
1968
2077
|
// src/components/dev-console/console.tsx
|
|
1969
|
-
var
|
|
2078
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1970
2079
|
function CopilotDevConsole() {
|
|
1971
2080
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
1972
2081
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
@@ -2040,14 +2149,14 @@ function CopilotDevConsole() {
|
|
|
2040
2149
|
if (!showDevConsole) {
|
|
2041
2150
|
return null;
|
|
2042
2151
|
}
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2044
2153
|
"div",
|
|
2045
2154
|
{
|
|
2046
2155
|
ref: consoleRef,
|
|
2047
2156
|
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
2048
2157
|
children: [
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "copilotKitDevConsoleLogo", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: "https://copilotkit.ai", target: "_blank", children: CopilotKitIcon }) }),
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2051
2160
|
VersionInfo,
|
|
2052
2161
|
{
|
|
2053
2162
|
showDevConsole: context.showDevConsole,
|
|
@@ -2056,8 +2165,8 @@ function CopilotDevConsole() {
|
|
|
2056
2165
|
latestVersion
|
|
2057
2166
|
}
|
|
2058
2167
|
),
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CopilotKitHelpModal, {}),
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2061
2170
|
DebugMenuButton,
|
|
2062
2171
|
{
|
|
2063
2172
|
setShowDevConsole,
|
|
@@ -2112,12 +2221,12 @@ function VersionInfo({
|
|
|
2112
2221
|
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2113
2222
|
});
|
|
2114
2223
|
};
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
|
|
2117
2226
|
"COPILOTKIT DEV CONSOLE",
|
|
2118
|
-
showDevConsole === "auto" && /* @__PURE__ */ (0,
|
|
2227
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("aside", { children: asideLabel })
|
|
2119
2228
|
] }),
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { children: [
|
|
2121
2230
|
"Version: ",
|
|
2122
2231
|
versionLabel,
|
|
2123
2232
|
" (",
|
|
@@ -2125,7 +2234,7 @@ function VersionInfo({
|
|
|
2125
2234
|
") ",
|
|
2126
2235
|
versionIcon
|
|
2127
2236
|
] }),
|
|
2128
|
-
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0,
|
|
2237
|
+
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand }) })
|
|
2129
2238
|
] });
|
|
2130
2239
|
}
|
|
2131
2240
|
function DebugMenuButton({
|
|
@@ -2135,12 +2244,12 @@ function DebugMenuButton({
|
|
|
2135
2244
|
}) {
|
|
2136
2245
|
const context = (0, import_react_core7.useCopilotContext)();
|
|
2137
2246
|
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2138
|
-
return /* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "bg-black top-24 w-52 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react10.Menu, { children: [
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuButton, { className: `copilotKitDebugMenuButton ${mode === "compact" ? "compact" : ""}`, children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2140
2249
|
"Debug ",
|
|
2141
2250
|
ChevronDownIcon
|
|
2142
2251
|
] }) }),
|
|
2143
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2144
2253
|
import_react10.MenuItems,
|
|
2145
2254
|
{
|
|
2146
2255
|
transition: true,
|
|
@@ -2148,9 +2257,9 @@ function DebugMenuButton({
|
|
|
2148
2257
|
className: "copilotKitDebugMenu",
|
|
2149
2258
|
style: { zIndex: 40 },
|
|
2150
2259
|
children: [
|
|
2151
|
-
/* @__PURE__ */ (0,
|
|
2152
|
-
/* @__PURE__ */ (0,
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logReadables(context), children: "Log Readables" }) }),
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logActions(context), children: "Log Actions" }) }),
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2154
2263
|
"button",
|
|
2155
2264
|
{
|
|
2156
2265
|
className: "copilotKitDebugMenuItem",
|
|
@@ -2158,9 +2267,9 @@ function DebugMenuButton({
|
|
|
2158
2267
|
children: "Log Messages"
|
|
2159
2268
|
}
|
|
2160
2269
|
) }),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2163
|
-
/* @__PURE__ */ (0,
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => checkForUpdates(true), children: "Check for Updates" }) }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", {}),
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => setShowDevConsole(false), children: "Hide Dev Console" }) })
|
|
2164
2273
|
]
|
|
2165
2274
|
}
|
|
2166
2275
|
)
|
|
@@ -2169,7 +2278,7 @@ function DebugMenuButton({
|
|
|
2169
2278
|
|
|
2170
2279
|
// src/components/chat/Chat.tsx
|
|
2171
2280
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2172
|
-
var
|
|
2281
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2173
2282
|
function CopilotChat({
|
|
2174
2283
|
instructions,
|
|
2175
2284
|
onSubmitMessage,
|
|
@@ -2187,7 +2296,9 @@ function CopilotChat({
|
|
|
2187
2296
|
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2188
2297
|
className,
|
|
2189
2298
|
icons,
|
|
2190
|
-
labels
|
|
2299
|
+
labels,
|
|
2300
|
+
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2301
|
+
UserMessage: UserMessage2 = UserMessage
|
|
2191
2302
|
}) {
|
|
2192
2303
|
const context = (0, import_react_core8.useCopilotContext)();
|
|
2193
2304
|
(0, import_react11.useEffect)(() => {
|
|
@@ -2209,11 +2320,13 @@ function CopilotChat({
|
|
|
2209
2320
|
);
|
|
2210
2321
|
const chatContext = import_react11.default.useContext(ChatContext);
|
|
2211
2322
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2212
|
-
return /* @__PURE__ */ (0,
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CopilotDevConsole, {}),
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2215
2326
|
Messages2,
|
|
2216
2327
|
{
|
|
2328
|
+
AssistantMessage: AssistantMessage2,
|
|
2329
|
+
UserMessage: UserMessage2,
|
|
2217
2330
|
RenderTextMessage: RenderTextMessage2,
|
|
2218
2331
|
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2219
2332
|
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
@@ -2221,9 +2334,9 @@ function CopilotChat({
|
|
|
2221
2334
|
messages: visibleMessages,
|
|
2222
2335
|
inProgress: isLoading,
|
|
2223
2336
|
children: [
|
|
2224
|
-
currentSuggestions.length > 0 && /* @__PURE__ */ (0,
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2337
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
2338
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h6", { children: "Suggested:" }),
|
|
2339
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2227
2340
|
Suggestion,
|
|
2228
2341
|
{
|
|
2229
2342
|
title: suggestion.title,
|
|
@@ -2235,7 +2348,7 @@ function CopilotChat({
|
|
|
2235
2348
|
index
|
|
2236
2349
|
)) })
|
|
2237
2350
|
] }),
|
|
2238
|
-
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0,
|
|
2351
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2239
2352
|
ResponseButton2,
|
|
2240
2353
|
{
|
|
2241
2354
|
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
@@ -2245,7 +2358,7 @@ function CopilotChat({
|
|
|
2245
2358
|
]
|
|
2246
2359
|
}
|
|
2247
2360
|
),
|
|
2248
|
-
/* @__PURE__ */ (0,
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2249
2362
|
] });
|
|
2250
2363
|
}
|
|
2251
2364
|
function WrappedCopilotChat({
|
|
@@ -2256,10 +2369,10 @@ function WrappedCopilotChat({
|
|
|
2256
2369
|
}) {
|
|
2257
2370
|
const chatContext = import_react11.default.useContext(ChatContext);
|
|
2258
2371
|
if (!chatContext) {
|
|
2259
|
-
return /* @__PURE__ */ (0,
|
|
2260
|
-
}, children: /* @__PURE__ */ (0,
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2373
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2261
2374
|
}
|
|
2262
|
-
return /* @__PURE__ */ (0,
|
|
2375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children });
|
|
2263
2376
|
}
|
|
2264
2377
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2265
2378
|
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|