@copilotkit/react-ui 1.4.8-no-pino-redact.1 → 1.5.0-coagents-v0-3.0
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 +37 -4
- package/dist/{chunk-FUDBUYBG.mjs → chunk-375NVWZM.mjs} +2 -2
- package/dist/{chunk-OMTPWC7T.mjs → chunk-3E7HY2UN.mjs} +5 -4
- package/dist/chunk-3E7HY2UN.mjs.map +1 -0
- package/dist/{chunk-RKPANT3F.mjs → chunk-7II4YL7R.mjs} +2 -6
- package/dist/chunk-7II4YL7R.mjs.map +1 -0
- package/dist/{chunk-T35X2SFE.mjs → chunk-DCNCY2PL.mjs} +113 -10
- package/dist/chunk-DCNCY2PL.mjs.map +1 -0
- package/dist/{chunk-TTYR7XPN.mjs → chunk-F2W5FD7L.mjs} +3 -3
- package/dist/{chunk-4FIGRRFS.mjs → chunk-PNQVKBPN.mjs} +2 -2
- package/dist/{chunk-4FIGRRFS.mjs.map → chunk-PNQVKBPN.mjs.map} +1 -1
- package/dist/{chunk-ICGZEGHQ.mjs → chunk-TI7SY2RI.mjs} +13 -4
- package/dist/chunk-TI7SY2RI.mjs.map +1 -0
- package/dist/{chunk-E5SSVET3.mjs → chunk-UWVGLGFQ.mjs} +7 -3
- package/dist/chunk-UWVGLGFQ.mjs.map +1 -0
- package/dist/{chunk-ZQFKJLQ6.mjs → chunk-WSMMTZCM.mjs} +2 -2
- package/dist/components/chat/Chat.d.ts +50 -5
- package/dist/components/chat/Chat.js +127 -38
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +6 -6
- package/dist/components/chat/Messages.d.ts +3 -3
- 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 +131 -38
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +7 -7
- package/dist/components/chat/Popup.js +131 -38
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +8 -8
- package/dist/components/chat/Sidebar.js +131 -38
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +8 -8
- package/dist/components/chat/index.js +131 -38
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +9 -9
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -3
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
- package/dist/components/dev-console/console.js +13 -27
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.js +13 -27
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +3 -3
- package/dist/components/dev-console/utils.js +1 -1
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +1 -1
- package/dist/components/help-modal/index.js +12 -26
- package/dist/components/help-modal/index.js.map +1 -1
- package/dist/components/help-modal/index.mjs +1 -1
- package/dist/components/help-modal/modal.js +12 -26
- package/dist/components/help-modal/modal.js.map +1 -1
- package/dist/components/help-modal/modal.mjs +1 -1
- package/dist/components/index.js +131 -38
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -9
- package/dist/index.js +133 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +173 -7
- package/src/components/chat/Messages.tsx +2 -9
- package/src/components/chat/Modal.tsx +4 -0
- package/src/components/chat/messages/RenderActionExecutionMessage.tsx +10 -3
- package/src/components/dev-console/utils.ts +1 -1
- package/src/components/help-modal/modal.tsx +12 -2
- package/dist/chunk-E5SSVET3.mjs.map +0 -1
- package/dist/chunk-ICGZEGHQ.mjs.map +0 -1
- package/dist/chunk-OMTPWC7T.mjs.map +0 -1
- package/dist/chunk-RKPANT3F.mjs.map +0 -1
- package/dist/chunk-T35X2SFE.mjs.map +0 -1
- /package/dist/{chunk-FUDBUYBG.mjs.map → chunk-375NVWZM.mjs.map} +0 -0
- /package/dist/{chunk-TTYR7XPN.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
- /package/dist/{chunk-ZQFKJLQ6.mjs.map → chunk-WSMMTZCM.mjs.map} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-UWVGLGFQ.mjs";
|
|
4
4
|
import "../../chunk-YAGE7RCE.mjs";
|
|
5
5
|
import "../../chunk-VEC45H6Q.mjs";
|
|
6
6
|
import "../../chunk-RQNJNK2W.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-DCNCY2PL.mjs";
|
|
8
8
|
import "../../chunk-6INMITFA.mjs";
|
|
9
9
|
import "../../chunk-RU73BEZM.mjs";
|
|
10
10
|
import "../../chunk-V7W6IM2V.mjs";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-3E7HY2UN.mjs";
|
|
12
12
|
import "../../chunk-ZABXREBH.mjs";
|
|
13
13
|
import "../../chunk-RJCZRKTV.mjs";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-F2W5FD7L.mjs";
|
|
15
|
+
import "../../chunk-PNQVKBPN.mjs";
|
|
16
16
|
import "../../chunk-KXE2JCUH.mjs";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-TI7SY2RI.mjs";
|
|
18
18
|
import "../../chunk-BH6PCAAL.mjs";
|
|
19
19
|
import "../../chunk-OTPAZXVR.mjs";
|
|
20
20
|
import "../../chunk-EMQEEXUB.mjs";
|
|
21
21
|
import "../../chunk-YQFVRDNC.mjs";
|
|
22
22
|
import "../../chunk-YQ3D5IQV.mjs";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-7II4YL7R.mjs";
|
|
24
24
|
import "../../chunk-3XAXY2Z3.mjs";
|
|
25
25
|
import "../../chunk-CBBFRI3Q.mjs";
|
|
26
26
|
import "../../chunk-UPTB2MVO.mjs";
|
|
@@ -943,9 +943,9 @@ var import_react7 = require("react");
|
|
|
943
943
|
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
944
944
|
|
|
945
945
|
// src/hooks/use-copy-to-clipboard.tsx
|
|
946
|
-
var
|
|
946
|
+
var React5 = __toESM(require("react"));
|
|
947
947
|
function useCopyToClipboard({ timeout = 2e3 }) {
|
|
948
|
-
const [isCopied, setIsCopied] =
|
|
948
|
+
const [isCopied, setIsCopied] = React5.useState(false);
|
|
949
949
|
const copyToClipboard = (value) => {
|
|
950
950
|
var _a;
|
|
951
951
|
if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
|
|
@@ -1441,8 +1441,8 @@ function RenderActionExecutionMessage(props) {
|
|
|
1441
1441
|
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1442
1442
|
const { icons } = useChatContext();
|
|
1443
1443
|
if (message.isActionExecutionMessage()) {
|
|
1444
|
-
if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {
|
|
1445
|
-
const render = chatComponentsCache.current.actions[message.name];
|
|
1444
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1445
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1446
1446
|
if (typeof render === "string") {
|
|
1447
1447
|
if (isCurrentMessage && inProgress) {
|
|
1448
1448
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
@@ -1465,7 +1465,8 @@ function RenderActionExecutionMessage(props) {
|
|
|
1465
1465
|
const toRender = render({
|
|
1466
1466
|
status,
|
|
1467
1467
|
args,
|
|
1468
|
-
result: actionResult
|
|
1468
|
+
result: actionResult,
|
|
1469
|
+
name: message.name
|
|
1469
1470
|
});
|
|
1470
1471
|
if (!toRender && status === "complete") {
|
|
1471
1472
|
return null;
|
|
@@ -1779,7 +1780,7 @@ function logMessages(context) {
|
|
|
1779
1780
|
type: "ActionExecutionMessage",
|
|
1780
1781
|
role: void 0,
|
|
1781
1782
|
name: message.name,
|
|
1782
|
-
scope: message.
|
|
1783
|
+
scope: message.parentMessageId,
|
|
1783
1784
|
content: message.arguments
|
|
1784
1785
|
};
|
|
1785
1786
|
} else if (message.isResultMessage()) {
|
|
@@ -1902,30 +1903,6 @@ var import_react9 = require("react");
|
|
|
1902
1903
|
|
|
1903
1904
|
// src/components/help-modal/icons.tsx
|
|
1904
1905
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1905
|
-
var LifeBuoyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1906
|
-
"svg",
|
|
1907
|
-
{
|
|
1908
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1909
|
-
width: "24",
|
|
1910
|
-
height: "24",
|
|
1911
|
-
viewBox: "0 0 24 24",
|
|
1912
|
-
fill: "none",
|
|
1913
|
-
stroke: "currentColor",
|
|
1914
|
-
strokeWidth: "2",
|
|
1915
|
-
strokeLinecap: "round",
|
|
1916
|
-
strokeLinejoin: "round",
|
|
1917
|
-
className: "icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy",
|
|
1918
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { transform: "translate(0, -1)", children: [
|
|
1919
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
1920
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" }),
|
|
1921
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
|
|
1922
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M15 15l3.35 3.35" }),
|
|
1923
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M9 15l-3.35 3.35" }),
|
|
1924
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M5.65 5.65l3.35 3.35" }),
|
|
1925
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18.35 5.65l-3.35 3.35" })
|
|
1926
|
-
] })
|
|
1927
|
-
}
|
|
1928
|
-
);
|
|
1929
1906
|
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1930
1907
|
"svg",
|
|
1931
1908
|
{
|
|
@@ -2016,9 +1993,10 @@ function CopilotKitHelpModal() {
|
|
|
2016
1993
|
"button",
|
|
2017
1994
|
{
|
|
2018
1995
|
onClick: () => setShowHelpModal(true),
|
|
2019
|
-
|
|
1996
|
+
style: { width: "50px", height: "30px", marginRight: "0.25rem" },
|
|
1997
|
+
className: "text-sm p-0 bg-transparent rounded border border-blue-500",
|
|
2020
1998
|
"aria-label": "Open Help",
|
|
2021
|
-
children:
|
|
1999
|
+
children: "Help"
|
|
2022
2000
|
}
|
|
2023
2001
|
);
|
|
2024
2002
|
const submitButtonDisabled = (0, import_react9.useMemo)(
|
|
@@ -2045,6 +2023,15 @@ function CopilotKitHelpModal() {
|
|
|
2045
2023
|
),
|
|
2046
2024
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
2047
2025
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)(
|
|
2027
|
+
"a",
|
|
2028
|
+
{
|
|
2029
|
+
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
2030
|
+
target: "_blank",
|
|
2031
|
+
rel: "noopener noreferrer",
|
|
2032
|
+
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
2033
|
+
}
|
|
2034
|
+
) }),
|
|
2048
2035
|
/* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)(
|
|
2049
2036
|
"a",
|
|
2050
2037
|
{
|
|
@@ -2319,6 +2306,7 @@ function DebugMenuButton({
|
|
|
2319
2306
|
}
|
|
2320
2307
|
|
|
2321
2308
|
// src/components/chat/Chat.tsx
|
|
2309
|
+
var import_react_core9 = require("@copilotkit/react-core");
|
|
2322
2310
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2323
2311
|
function CopilotChat({
|
|
2324
2312
|
instructions,
|
|
@@ -2326,6 +2314,8 @@ function CopilotChat({
|
|
|
2326
2314
|
makeSystemMessage,
|
|
2327
2315
|
showResponseButton = true,
|
|
2328
2316
|
onInProgress,
|
|
2317
|
+
onStopGeneration,
|
|
2318
|
+
onReloadMessages,
|
|
2329
2319
|
Messages: Messages2 = Messages,
|
|
2330
2320
|
RenderTextMessage: RenderTextMessage2 = RenderTextMessage,
|
|
2331
2321
|
RenderActionExecutionMessage: RenderActionExecutionMessage2 = RenderActionExecutionMessage,
|
|
@@ -2348,7 +2338,13 @@ function CopilotChat({
|
|
|
2348
2338
|
sendMessage,
|
|
2349
2339
|
stopGeneration,
|
|
2350
2340
|
reloadMessages
|
|
2351
|
-
} = useCopilotChatLogic(
|
|
2341
|
+
} = useCopilotChatLogic(
|
|
2342
|
+
makeSystemMessage,
|
|
2343
|
+
onInProgress,
|
|
2344
|
+
onSubmitMessage,
|
|
2345
|
+
onStopGeneration,
|
|
2346
|
+
onReloadMessages
|
|
2347
|
+
);
|
|
2352
2348
|
const chatContext = import_react12.default.useContext(ChatContext);
|
|
2353
2349
|
const isVisible = chatContext ? chatContext.open : true;
|
|
2354
2350
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
@@ -2404,8 +2400,16 @@ function WrappedCopilotChat({
|
|
|
2404
2400
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
|
|
2405
2401
|
}
|
|
2406
2402
|
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2407
|
-
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) => {
|
|
2408
|
-
|
|
2403
|
+
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
2404
|
+
var _a;
|
|
2405
|
+
const {
|
|
2406
|
+
visibleMessages,
|
|
2407
|
+
appendMessage,
|
|
2408
|
+
reloadMessages: defaultReloadMessages,
|
|
2409
|
+
stopGeneration: defaultStopGeneration,
|
|
2410
|
+
runChatCompletion,
|
|
2411
|
+
isLoading
|
|
2412
|
+
} = (0, import_react_core8.useCopilotChat)({
|
|
2409
2413
|
id: (0, import_shared3.randomId)(),
|
|
2410
2414
|
makeSystemMessage
|
|
2411
2415
|
});
|
|
@@ -2413,8 +2417,8 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2413
2417
|
const suggestionsAbortControllerRef = (0, import_react12.useRef)(null);
|
|
2414
2418
|
const debounceTimerRef = (0, import_react12.useRef)();
|
|
2415
2419
|
const abortSuggestions = () => {
|
|
2416
|
-
var
|
|
2417
|
-
(
|
|
2420
|
+
var _a2;
|
|
2421
|
+
(_a2 = suggestionsAbortControllerRef.current) == null ? void 0 : _a2.abort();
|
|
2418
2422
|
suggestionsAbortControllerRef.current = null;
|
|
2419
2423
|
};
|
|
2420
2424
|
const generalContext = (0, import_react_core8.useCopilotContext)();
|
|
@@ -2440,7 +2444,13 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2440
2444
|
return () => {
|
|
2441
2445
|
clearTimeout(debounceTimerRef.current);
|
|
2442
2446
|
};
|
|
2443
|
-
}, [
|
|
2447
|
+
}, [
|
|
2448
|
+
isLoading,
|
|
2449
|
+
context.chatSuggestionConfiguration,
|
|
2450
|
+
// hackish way to trigger suggestions reload on reset, but better than moving suggestions to the
|
|
2451
|
+
// global context
|
|
2452
|
+
visibleMessages.length == 0
|
|
2453
|
+
]);
|
|
2444
2454
|
const sendMessage = (messageContent) => __async(void 0, null, function* () {
|
|
2445
2455
|
abortSuggestions();
|
|
2446
2456
|
setCurrentSuggestions([]);
|
|
@@ -2458,6 +2468,85 @@ var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage) =>
|
|
|
2458
2468
|
appendMessage(message);
|
|
2459
2469
|
return message;
|
|
2460
2470
|
});
|
|
2471
|
+
const messages = visibleMessages;
|
|
2472
|
+
const { setMessages } = messagesContext;
|
|
2473
|
+
const currentAgentName = (_a = generalContext.agentSession) == null ? void 0 : _a.agentName;
|
|
2474
|
+
const restartCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2475
|
+
if (generalContext.agentSession) {
|
|
2476
|
+
generalContext.setAgentSession(__spreadProps(__spreadValues({}, generalContext.agentSession), {
|
|
2477
|
+
nodeName: void 0,
|
|
2478
|
+
threadId: void 0
|
|
2479
|
+
}));
|
|
2480
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
2481
|
+
return __spreadProps(__spreadValues({}, prevAgentStates), {
|
|
2482
|
+
[generalContext.agentSession.agentName]: __spreadProps(__spreadValues({}, prevAgentStates[generalContext.agentSession.agentName]), {
|
|
2483
|
+
threadId: void 0,
|
|
2484
|
+
nodeName: void 0,
|
|
2485
|
+
runId: void 0
|
|
2486
|
+
})
|
|
2487
|
+
});
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
});
|
|
2491
|
+
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2492
|
+
if (generalContext.agentSession) {
|
|
2493
|
+
yield (0, import_react_core9.runAgent)(
|
|
2494
|
+
generalContext.agentSession.agentName,
|
|
2495
|
+
context,
|
|
2496
|
+
appendMessage,
|
|
2497
|
+
runChatCompletion,
|
|
2498
|
+
hint
|
|
2499
|
+
);
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
const stopCurrentAgent = () => {
|
|
2503
|
+
if (generalContext.agentSession) {
|
|
2504
|
+
(0, import_react_core9.stopAgent)(generalContext.agentSession.agentName, context);
|
|
2505
|
+
}
|
|
2506
|
+
};
|
|
2507
|
+
const setCurrentAgentState = (state) => {
|
|
2508
|
+
if (generalContext.agentSession) {
|
|
2509
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
2510
|
+
return __spreadProps(__spreadValues({}, prevAgentStates), {
|
|
2511
|
+
[generalContext.agentSession.agentName]: {
|
|
2512
|
+
state
|
|
2513
|
+
}
|
|
2514
|
+
});
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
function stopGeneration() {
|
|
2519
|
+
if (onStopGeneration) {
|
|
2520
|
+
onStopGeneration({
|
|
2521
|
+
messages,
|
|
2522
|
+
setMessages,
|
|
2523
|
+
stopGeneration: defaultStopGeneration,
|
|
2524
|
+
currentAgentName,
|
|
2525
|
+
restartCurrentAgent,
|
|
2526
|
+
stopCurrentAgent,
|
|
2527
|
+
runCurrentAgent,
|
|
2528
|
+
setCurrentAgentState
|
|
2529
|
+
});
|
|
2530
|
+
} else {
|
|
2531
|
+
defaultStopGeneration();
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
function reloadMessages() {
|
|
2535
|
+
if (onReloadMessages) {
|
|
2536
|
+
onReloadMessages({
|
|
2537
|
+
messages,
|
|
2538
|
+
setMessages,
|
|
2539
|
+
stopGeneration: defaultStopGeneration,
|
|
2540
|
+
currentAgentName,
|
|
2541
|
+
restartCurrentAgent,
|
|
2542
|
+
stopCurrentAgent,
|
|
2543
|
+
runCurrentAgent,
|
|
2544
|
+
setCurrentAgentState
|
|
2545
|
+
});
|
|
2546
|
+
} else {
|
|
2547
|
+
defaultReloadMessages();
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2461
2550
|
return {
|
|
2462
2551
|
visibleMessages,
|
|
2463
2552
|
isLoading,
|
|
@@ -2477,6 +2566,8 @@ var CopilotModal = ({
|
|
|
2477
2566
|
hitEscapeToClose = true,
|
|
2478
2567
|
onSetOpen,
|
|
2479
2568
|
onSubmitMessage,
|
|
2569
|
+
onStopGeneration,
|
|
2570
|
+
onReloadMessages,
|
|
2480
2571
|
shortcut = "/",
|
|
2481
2572
|
icons,
|
|
2482
2573
|
labels,
|
|
@@ -2514,6 +2605,8 @@ var CopilotModal = ({
|
|
|
2514
2605
|
{
|
|
2515
2606
|
instructions,
|
|
2516
2607
|
onSubmitMessage,
|
|
2608
|
+
onStopGeneration,
|
|
2609
|
+
onReloadMessages,
|
|
2517
2610
|
makeSystemMessage,
|
|
2518
2611
|
showResponseButton,
|
|
2519
2612
|
onInProgress,
|