@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
package/dist/index.mjs
CHANGED
|
@@ -4,38 +4,38 @@ import "./chunk-MMVDU6DF.mjs";
|
|
|
4
4
|
import "./chunk-MRFF7GSQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
CopilotSidebar
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WSMMTZCM.mjs";
|
|
8
8
|
import "./chunk-WB3YULQ4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
CopilotPopup
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-375NVWZM.mjs";
|
|
12
|
+
import "./chunk-UWVGLGFQ.mjs";
|
|
13
13
|
import "./chunk-YAGE7RCE.mjs";
|
|
14
14
|
import "./chunk-VEC45H6Q.mjs";
|
|
15
15
|
import "./chunk-RQNJNK2W.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotChat
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DCNCY2PL.mjs";
|
|
19
19
|
import "./chunk-6INMITFA.mjs";
|
|
20
20
|
import "./chunk-RU73BEZM.mjs";
|
|
21
21
|
import "./chunk-V7W6IM2V.mjs";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-3E7HY2UN.mjs";
|
|
23
23
|
import "./chunk-ZABXREBH.mjs";
|
|
24
24
|
import "./chunk-RJCZRKTV.mjs";
|
|
25
25
|
import {
|
|
26
26
|
CopilotDevConsole
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-F2W5FD7L.mjs";
|
|
28
28
|
import {
|
|
29
29
|
shouldShowDevConsole
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-PNQVKBPN.mjs";
|
|
31
31
|
import "./chunk-KXE2JCUH.mjs";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-TI7SY2RI.mjs";
|
|
33
33
|
import "./chunk-BH6PCAAL.mjs";
|
|
34
34
|
import "./chunk-OTPAZXVR.mjs";
|
|
35
35
|
import "./chunk-EMQEEXUB.mjs";
|
|
36
36
|
import "./chunk-YQFVRDNC.mjs";
|
|
37
37
|
import "./chunk-YQ3D5IQV.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-7II4YL7R.mjs";
|
|
39
39
|
import "./chunk-3XAXY2Z3.mjs";
|
|
40
40
|
import {
|
|
41
41
|
useChatContext
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.
|
|
12
|
+
"version": "1.5.0-coagents-v0-3.0",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.
|
|
55
|
-
"@copilotkit/
|
|
53
|
+
"@copilotkit/react-core": "1.5.0-coagents-v0-3.0",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.5.0-coagents-v0-3.0",
|
|
55
|
+
"@copilotkit/shared": "1.5.0-coagents-v0-3.0"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -73,6 +73,7 @@ import { InputProps, MessagesProps, RenderMessageProps, ResponseButtonProps } fr
|
|
|
73
73
|
import { randomId } from "@copilotkit/shared";
|
|
74
74
|
|
|
75
75
|
import { CopilotDevConsole } from "../dev-console";
|
|
76
|
+
import { HintFunction, runAgent, stopAgent } from "@copilotkit/react-core";
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
79
|
* Props for CopilotChat component.
|
|
@@ -98,6 +99,16 @@ export interface CopilotChatProps {
|
|
|
98
99
|
*/
|
|
99
100
|
onSubmitMessage?: (message: string) => void | Promise<void>;
|
|
100
101
|
|
|
102
|
+
/**
|
|
103
|
+
* A custom stop generation function.
|
|
104
|
+
*/
|
|
105
|
+
onStopGeneration?: OnStopGeneration;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A custom reload messages function.
|
|
109
|
+
*/
|
|
110
|
+
onReloadMessages?: OnReloadMessages;
|
|
111
|
+
|
|
101
112
|
/**
|
|
102
113
|
* Icons can be used to set custom icons for the chat window.
|
|
103
114
|
*/
|
|
@@ -168,12 +179,62 @@ export interface CopilotChatProps {
|
|
|
168
179
|
children?: React.ReactNode;
|
|
169
180
|
}
|
|
170
181
|
|
|
182
|
+
interface OnStopGenerationArguments {
|
|
183
|
+
/**
|
|
184
|
+
* The name of the currently executing agent.
|
|
185
|
+
*/
|
|
186
|
+
currentAgentName: string | undefined;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The messages in the chat.
|
|
190
|
+
*/
|
|
191
|
+
messages: Message[];
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Set the messages in the chat.
|
|
195
|
+
*/
|
|
196
|
+
setMessages: (messages: Message[]) => void;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Stop chat generation.
|
|
200
|
+
*/
|
|
201
|
+
stopGeneration: () => void;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Restart the currently executing agent.
|
|
205
|
+
*/
|
|
206
|
+
restartCurrentAgent: () => void;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Stop the currently executing agent.
|
|
210
|
+
*/
|
|
211
|
+
stopCurrentAgent: () => void;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Run the currently executing agent.
|
|
215
|
+
*/
|
|
216
|
+
runCurrentAgent: (hint?: HintFunction) => Promise<void>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Set the state of the currently executing agent.
|
|
220
|
+
*/
|
|
221
|
+
setCurrentAgentState: (state: any) => void;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export type OnReloadMessagesArguments = OnStopGenerationArguments;
|
|
225
|
+
|
|
226
|
+
export type OnStopGeneration = (args: OnStopGenerationArguments) => void;
|
|
227
|
+
|
|
228
|
+
export type OnReloadMessages = (args: OnReloadMessagesArguments) => void;
|
|
229
|
+
|
|
171
230
|
export function CopilotChat({
|
|
172
231
|
instructions,
|
|
173
232
|
onSubmitMessage,
|
|
174
233
|
makeSystemMessage,
|
|
175
234
|
showResponseButton = true,
|
|
176
235
|
onInProgress,
|
|
236
|
+
onStopGeneration,
|
|
237
|
+
onReloadMessages,
|
|
177
238
|
Messages = DefaultMessages,
|
|
178
239
|
RenderTextMessage = DefaultRenderTextMessage,
|
|
179
240
|
RenderActionExecutionMessage = DefaultRenderActionExecutionMessage,
|
|
@@ -198,7 +259,13 @@ export function CopilotChat({
|
|
|
198
259
|
sendMessage,
|
|
199
260
|
stopGeneration,
|
|
200
261
|
reloadMessages,
|
|
201
|
-
} = useCopilotChatLogic(
|
|
262
|
+
} = useCopilotChatLogic(
|
|
263
|
+
makeSystemMessage,
|
|
264
|
+
onInProgress,
|
|
265
|
+
onSubmitMessage,
|
|
266
|
+
onStopGeneration,
|
|
267
|
+
onReloadMessages,
|
|
268
|
+
);
|
|
202
269
|
|
|
203
270
|
const chatContext = React.useContext(ChatContext);
|
|
204
271
|
const isVisible = chatContext ? chatContext.open : true;
|
|
@@ -271,12 +338,20 @@ export const useCopilotChatLogic = (
|
|
|
271
338
|
makeSystemMessage?: SystemMessageFunction,
|
|
272
339
|
onInProgress?: (isLoading: boolean) => void,
|
|
273
340
|
onSubmitMessage?: (messageContent: string) => Promise<void> | void,
|
|
341
|
+
onStopGeneration?: OnStopGeneration,
|
|
342
|
+
onReloadMessages?: OnReloadMessages,
|
|
274
343
|
) => {
|
|
275
|
-
const {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
344
|
+
const {
|
|
345
|
+
visibleMessages,
|
|
346
|
+
appendMessage,
|
|
347
|
+
reloadMessages: defaultReloadMessages,
|
|
348
|
+
stopGeneration: defaultStopGeneration,
|
|
349
|
+
runChatCompletion,
|
|
350
|
+
isLoading,
|
|
351
|
+
} = useCopilotChat({
|
|
352
|
+
id: randomId(),
|
|
353
|
+
makeSystemMessage,
|
|
354
|
+
});
|
|
280
355
|
|
|
281
356
|
const [currentSuggestions, setCurrentSuggestions] = useState<CopilotChatSuggestion[]>([]);
|
|
282
357
|
const suggestionsAbortControllerRef = useRef<AbortController | null>(null);
|
|
@@ -314,7 +389,13 @@ export const useCopilotChatLogic = (
|
|
|
314
389
|
return () => {
|
|
315
390
|
clearTimeout(debounceTimerRef.current);
|
|
316
391
|
};
|
|
317
|
-
}, [
|
|
392
|
+
}, [
|
|
393
|
+
isLoading,
|
|
394
|
+
context.chatSuggestionConfiguration,
|
|
395
|
+
// hackish way to trigger suggestions reload on reset, but better than moving suggestions to the
|
|
396
|
+
// global context
|
|
397
|
+
visibleMessages.length == 0,
|
|
398
|
+
]);
|
|
318
399
|
|
|
319
400
|
const sendMessage = async (messageContent: string) => {
|
|
320
401
|
abortSuggestions();
|
|
@@ -340,6 +421,91 @@ export const useCopilotChatLogic = (
|
|
|
340
421
|
return message;
|
|
341
422
|
};
|
|
342
423
|
|
|
424
|
+
const messages = visibleMessages;
|
|
425
|
+
const { setMessages } = messagesContext;
|
|
426
|
+
const currentAgentName = generalContext.agentSession?.agentName;
|
|
427
|
+
const restartCurrentAgent = async (hint?: HintFunction) => {
|
|
428
|
+
if (generalContext.agentSession) {
|
|
429
|
+
generalContext.setAgentSession({
|
|
430
|
+
...generalContext.agentSession,
|
|
431
|
+
nodeName: undefined,
|
|
432
|
+
threadId: undefined,
|
|
433
|
+
});
|
|
434
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
435
|
+
return {
|
|
436
|
+
...prevAgentStates,
|
|
437
|
+
[generalContext.agentSession!.agentName]: {
|
|
438
|
+
...prevAgentStates[generalContext.agentSession!.agentName],
|
|
439
|
+
threadId: undefined,
|
|
440
|
+
nodeName: undefined,
|
|
441
|
+
runId: undefined,
|
|
442
|
+
},
|
|
443
|
+
};
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
const runCurrentAgent = async (hint?: HintFunction) => {
|
|
448
|
+
if (generalContext.agentSession) {
|
|
449
|
+
await runAgent(
|
|
450
|
+
generalContext.agentSession.agentName,
|
|
451
|
+
context,
|
|
452
|
+
appendMessage,
|
|
453
|
+
runChatCompletion,
|
|
454
|
+
hint,
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
const stopCurrentAgent = () => {
|
|
459
|
+
if (generalContext.agentSession) {
|
|
460
|
+
stopAgent(generalContext.agentSession.agentName, context);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
const setCurrentAgentState = (state: any) => {
|
|
464
|
+
if (generalContext.agentSession) {
|
|
465
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
466
|
+
return {
|
|
467
|
+
...prevAgentStates,
|
|
468
|
+
[generalContext.agentSession!.agentName]: {
|
|
469
|
+
state,
|
|
470
|
+
},
|
|
471
|
+
} as any;
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
function stopGeneration() {
|
|
477
|
+
if (onStopGeneration) {
|
|
478
|
+
onStopGeneration({
|
|
479
|
+
messages,
|
|
480
|
+
setMessages,
|
|
481
|
+
stopGeneration: defaultStopGeneration,
|
|
482
|
+
currentAgentName,
|
|
483
|
+
restartCurrentAgent,
|
|
484
|
+
stopCurrentAgent,
|
|
485
|
+
runCurrentAgent,
|
|
486
|
+
setCurrentAgentState,
|
|
487
|
+
});
|
|
488
|
+
} else {
|
|
489
|
+
defaultStopGeneration();
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function reloadMessages() {
|
|
493
|
+
if (onReloadMessages) {
|
|
494
|
+
onReloadMessages({
|
|
495
|
+
messages,
|
|
496
|
+
setMessages,
|
|
497
|
+
stopGeneration: defaultStopGeneration,
|
|
498
|
+
currentAgentName,
|
|
499
|
+
restartCurrentAgent,
|
|
500
|
+
stopCurrentAgent,
|
|
501
|
+
runCurrentAgent,
|
|
502
|
+
setCurrentAgentState,
|
|
503
|
+
});
|
|
504
|
+
} else {
|
|
505
|
+
defaultReloadMessages();
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
343
509
|
return {
|
|
344
510
|
visibleMessages,
|
|
345
511
|
isLoading,
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
2
2
|
import { MessagesProps } from "./props";
|
|
3
3
|
import { useChatContext } from "./ChatContext";
|
|
4
|
-
import {
|
|
5
|
-
ActionExecutionMessage,
|
|
6
|
-
Message,
|
|
7
|
-
ResultMessage,
|
|
8
|
-
TextMessage,
|
|
9
|
-
Role,
|
|
10
|
-
AgentStateMessage,
|
|
11
|
-
} from "@copilotkit/runtime-client-gql";
|
|
4
|
+
import { Message, ResultMessage, TextMessage, Role } from "@copilotkit/runtime-client-gql";
|
|
12
5
|
|
|
13
6
|
export const Messages = ({
|
|
14
7
|
messages,
|
|
@@ -63,6 +63,8 @@ export const CopilotModal = ({
|
|
|
63
63
|
hitEscapeToClose = true,
|
|
64
64
|
onSetOpen,
|
|
65
65
|
onSubmitMessage,
|
|
66
|
+
onStopGeneration,
|
|
67
|
+
onReloadMessages,
|
|
66
68
|
shortcut = "/",
|
|
67
69
|
icons,
|
|
68
70
|
labels,
|
|
@@ -99,6 +101,8 @@ export const CopilotModal = ({
|
|
|
99
101
|
<CopilotChat
|
|
100
102
|
instructions={instructions}
|
|
101
103
|
onSubmitMessage={onSubmitMessage}
|
|
104
|
+
onStopGeneration={onStopGeneration}
|
|
105
|
+
onReloadMessages={onReloadMessages}
|
|
102
106
|
makeSystemMessage={makeSystemMessage}
|
|
103
107
|
showResponseButton={showResponseButton}
|
|
104
108
|
onInProgress={onInProgress}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageStatusCode } from "@copilotkit/runtime-client-gql";
|
|
2
2
|
import { RenderMessageProps } from "../props";
|
|
3
3
|
import { useChatContext } from "../ChatContext";
|
|
4
4
|
import { RenderFunctionStatus, useCopilotContext } from "@copilotkit/react-core";
|
|
@@ -9,8 +9,14 @@ export function RenderActionExecutionMessage(props: RenderMessageProps) {
|
|
|
9
9
|
const { icons } = useChatContext();
|
|
10
10
|
|
|
11
11
|
if (message.isActionExecutionMessage()) {
|
|
12
|
-
if (
|
|
13
|
-
|
|
12
|
+
if (
|
|
13
|
+
chatComponentsCache.current !== null &&
|
|
14
|
+
(chatComponentsCache.current.actions[message.name] ||
|
|
15
|
+
chatComponentsCache.current.actions["*"])
|
|
16
|
+
) {
|
|
17
|
+
const render =
|
|
18
|
+
chatComponentsCache.current.actions[message.name] ||
|
|
19
|
+
chatComponentsCache.current.actions["*"];
|
|
14
20
|
// render a static string
|
|
15
21
|
if (typeof render === "string") {
|
|
16
22
|
// when render is static, we show it only when in progress
|
|
@@ -43,6 +49,7 @@ export function RenderActionExecutionMessage(props: RenderMessageProps) {
|
|
|
43
49
|
status: status as any,
|
|
44
50
|
args,
|
|
45
51
|
result: actionResult,
|
|
52
|
+
name: message.name,
|
|
46
53
|
});
|
|
47
54
|
// No result and complete: stay silent
|
|
48
55
|
if (!toRender && status === "complete") {
|
|
@@ -135,7 +135,7 @@ export function logMessages(context: CopilotMessagesContextParams) {
|
|
|
135
135
|
type: "ActionExecutionMessage",
|
|
136
136
|
role: undefined,
|
|
137
137
|
name: message.name,
|
|
138
|
-
scope: message.
|
|
138
|
+
scope: message.parentMessageId,
|
|
139
139
|
content: message.arguments,
|
|
140
140
|
};
|
|
141
141
|
} else if (message.isResultMessage()) {
|
|
@@ -46,10 +46,11 @@ export function CopilotKitHelpModal() {
|
|
|
46
46
|
const HelpButton = () => (
|
|
47
47
|
<button
|
|
48
48
|
onClick={() => setShowHelpModal(true)}
|
|
49
|
-
|
|
49
|
+
style={{ width: "50px", height: "30px", marginRight: "0.25rem" }}
|
|
50
|
+
className="text-sm p-0 bg-transparent rounded border border-blue-500"
|
|
50
51
|
aria-label="Open Help"
|
|
51
52
|
>
|
|
52
|
-
|
|
53
|
+
Help
|
|
53
54
|
</button>
|
|
54
55
|
);
|
|
55
56
|
|
|
@@ -79,6 +80,15 @@ export function CopilotKitHelpModal() {
|
|
|
79
80
|
<h2 className="text-2xl font-bold">Help Options</h2>
|
|
80
81
|
</div>
|
|
81
82
|
<div className="space-y-4 mb-4">
|
|
83
|
+
<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">
|
|
84
|
+
<a
|
|
85
|
+
href="https://docs.copilotkit.ai/coagents/troubleshooting/common-issues"
|
|
86
|
+
target="_blank"
|
|
87
|
+
rel="noopener noreferrer"
|
|
88
|
+
>
|
|
89
|
+
Visit the Troubleshooting and FAQ section in the docs
|
|
90
|
+
</a>
|
|
91
|
+
</div>
|
|
82
92
|
<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">
|
|
83
93
|
<a
|
|
84
94
|
href="https://go.copilotkit.ai/dev-console-support-discord"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Modal.tsx"],"sourcesContent":["import React from \"react\";\nimport { ChatContextProvider } from \"./ChatContext\";\nimport { ButtonProps, HeaderProps, WindowProps } from \"./props\";\nimport { Window as DefaultWindow } from \"./Window\";\nimport { Button as DefaultButton } from \"./Button\";\nimport { Header as DefaultHeader } from \"./Header\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { ResponseButton as DefaultResponseButton } from \"./Response\";\nimport { CopilotChat, CopilotChatProps } from \"./Chat\";\n\nexport interface CopilotModalProps extends CopilotChatProps {\n /**\n * Whether the chat window should be open by default.\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * If the chat window should close when the user clicks outside of it.\n * @default true\n */\n clickOutsideToClose?: boolean;\n\n /**\n * If the chat window should close when the user hits the Escape key.\n * @default true\n */\n hitEscapeToClose?: boolean;\n\n /**\n * The shortcut key to open the chat window.\n * Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.\n * @default '/'\n */\n shortcut?: string;\n\n /**\n * A callback that gets called when the chat window opens or closes.\n */\n onSetOpen?: (open: boolean) => void;\n\n /**\n * A custom Window component to use instead of the default.\n */\n Window?: React.ComponentType<WindowProps>;\n\n /**\n * A custom Button component to use instead of the default.\n */\n Button?: React.ComponentType<ButtonProps>;\n\n /**\n * A custom Header component to use instead of the default.\n */\n Header?: React.ComponentType<HeaderProps>;\n}\n\nexport const CopilotModal = ({\n instructions,\n defaultOpen = false,\n clickOutsideToClose = true,\n hitEscapeToClose = true,\n onSetOpen,\n onSubmitMessage,\n shortcut = \"/\",\n icons,\n labels,\n makeSystemMessage,\n showResponseButton = true,\n onInProgress,\n Window = DefaultWindow,\n Button = DefaultButton,\n Header = DefaultHeader,\n Messages = DefaultMessages,\n Input = DefaultInput,\n ResponseButton = DefaultResponseButton,\n className,\n children,\n}: CopilotModalProps) => {\n const [openState, setOpenState] = React.useState(defaultOpen);\n\n const setOpen = (open: boolean) => {\n onSetOpen?.(open);\n setOpenState(open);\n };\n\n return (\n <ChatContextProvider icons={icons} labels={labels} open={openState} setOpen={setOpen}>\n {children}\n <div className={className}>\n <Button></Button>\n <Window\n clickOutsideToClose={clickOutsideToClose}\n shortcut={shortcut}\n hitEscapeToClose={hitEscapeToClose}\n >\n <Header />\n <CopilotChat\n instructions={instructions}\n onSubmitMessage={onSubmitMessage}\n makeSystemMessage={makeSystemMessage}\n showResponseButton={showResponseButton}\n onInProgress={onInProgress}\n Messages={Messages}\n Input={Input}\n ResponseButton={ResponseButton}\n />\n </Window>\n </div>\n </ChatContextProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AA2FV,cACA,YADA;AAjCD,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB;AAAA,EACA,QAAAA,UAAS;AAAA,EACT,QAAAC,UAAS;AAAA,EACT,QAAAC,UAAS;AAAA,EACT,UAAAC,YAAW;AAAA,EACX,OAAAC,SAAQ;AAAA,EACR,gBAAAC,kBAAiB;AAAA,EACjB;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,WAAW;AAE5D,QAAM,UAAU,CAAC,SAAkB;AACjC,2CAAY;AACZ,iBAAa,IAAI;AAAA,EACnB;AAEA,SACE,qBAAC,uBAAoB,OAAc,QAAgB,MAAM,WAAW,SACjE;AAAA;AAAA,IACD,qBAAC,SAAI,WACH;AAAA,0BAACJ,SAAA,EAAO;AAAA,MACR;AAAA,QAACD;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UAEA;AAAA,gCAACE,SAAA,EAAO;AAAA,YACR;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,UAAUC;AAAA,gBACV,OAAOC;AAAA,gBACP,gBAAgBC;AAAA;AAAA,YAClB;AAAA;AAAA;AAAA,MACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Window","Button","Header","Messages","Input","ResponseButton"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/help-modal/modal.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { CloseIcon, LifeBuoyIcon, LoadingSpinnerIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const [issueDescription, setIssueDescription] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [emailError, setEmailError] = useState(\"\");\n const [submitting, setSubmitting] = useState(false);\n\n const validateEmail = (email: string) => {\n const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return re.test(email);\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (email?.length > 0 && !validateEmail(email)) {\n setEmailError(\"Please enter a valid email address\");\n return;\n }\n setSubmitting(true);\n\n await fetch(\"https://api.segment.io/v1/track\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n event: \"oss.dev-console.help\",\n anonymousId: window.crypto.randomUUID(),\n properties: { email, text: issueDescription },\n writeKey: \"q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW\",\n }),\n });\n\n // Reset\n setEmailError(\"\");\n setEmail(\"\");\n setIssueDescription(\"\");\n setSubmitting(false);\n setShowHelpModal(false);\n };\n\n const HelpButton = () => (\n <button\n onClick={() => setShowHelpModal(true)}\n className=\"p-2 bg-transparent rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500\"\n aria-label=\"Open Help\"\n >\n <LifeBuoyIcon />\n </button>\n );\n\n const submitButtonDisabled = useMemo(\n () => submitting || !!emailError || issueDescription == null || issueDescription?.length == 0,\n [submitting, emailError, issueDescription],\n );\n\n return (\n <>\n <HelpButton />\n {showHelpModal && (\n <div\n className=\"fixed inset-0 flex items-center justify-center p-4\"\n style={{ backgroundColor: \"rgba(11, 15, 26, 0.5)\", zIndex: 99 }}\n >\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative\">\n <button\n className=\"absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <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\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <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\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n <form onSubmit={handleSubmit} className=\"flex flex-col space-y-2\">\n <div>\n <label htmlFor=\"feedback\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Let us know what your issue is:\n </label>\n <textarea\n id=\"feedback\"\n rows={4}\n className=\"w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500\"\n placeholder=\"A Loom link / screen recording is always great!\"\n onChange={(e) => setIssueDescription(e.target.value)}\n value={issueDescription}\n required\n ></textarea>\n </div>\n <div>\n <label htmlFor=\"email\" className=\"block text-sm font-medium text-gray-700 mb-1\">\n Email (optional):\n </label>\n <input\n type=\"email\"\n id=\"email\"\n className={`w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? \"border-red-500\" : \"\"}`}\n placeholder=\"Enter your email for follow-up\"\n onChange={(e) => {\n setEmail(e.target.value);\n setEmailError(\"\");\n }}\n value={email}\n />\n {emailError && <p className=\"text-red-500 text-sm mt-1\">{emailError}</p>}\n </div>\n <div className=\"bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg\">\n <button\n type=\"submit\"\n onClick={handleSubmit}\n disabled={submitButtonDisabled}\n style={\n submitButtonDisabled\n ? { backgroundColor: \"rgb(216, 216, 216)\", color: \"rgb(129, 129, 129)\" }\n : undefined\n }\n 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\"\n >\n {submitting ? <LoadingSpinnerIcon color=\"white\" /> : \"Submit\"}\n </button>\n </div>\n </form>\n </div>\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAgB,SAAS,gBAAgB;AAmDnC,SAUF,UAVE,KA6BM,YA7BN;AAhDC,SAAS,sBAAsB;AACpC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,EAAE;AAC3D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,EAAE;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,gBAAgB,CAACA,WAAkB;AACvC,UAAM,KAAK;AACX,WAAO,GAAG,KAAKA,MAAK;AAAA,EACtB;AAEA,QAAM,eAAe,CAAO,MAAuB;AACjD,MAAE,eAAe;AAEjB,SAAI,+BAAO,UAAS,KAAK,CAAC,cAAc,KAAK,GAAG;AAC9C,oBAAc,oCAAoC;AAClD;AAAA,IACF;AACA,kBAAc,I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;AAAA,YACvD,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["email"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/messages/RenderActionExecutionMessage.tsx"],"sourcesContent":["import { ActionExecutionMessage, MessageStatusCode } from \"@copilotkit/runtime-client-gql\";\nimport { RenderMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { RenderFunctionStatus, useCopilotContext } from \"@copilotkit/react-core\";\n\nexport function RenderActionExecutionMessage(props: RenderMessageProps) {\n const { message, inProgress, index, isCurrentMessage, actionResult } = props;\n const { chatComponentsCache } = useCopilotContext();\n const { icons } = useChatContext();\n\n if (message.isActionExecutionMessage()) {\n if (chatComponentsCache.current !== null && chatComponentsCache.current.actions[message.name]) {\n const render = chatComponentsCache.current.actions[message.name];\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon} <span className=\"inProgressLabel\">{render}</span>\n </div>\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const args = message.arguments;\n\n let status: RenderFunctionStatus = \"inProgress\";\n\n if (actionResult !== undefined) {\n status = \"complete\";\n } else if (message.status.code !== MessageStatusCode.Pending) {\n status = \"executing\";\n }\n\n try {\n const toRender = render({\n status: status as any,\n args,\n result: actionResult,\n });\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n if (typeof toRender === \"string\") {\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && icons.spinnerIcon} {toRender}\n </div>\n );\n } else {\n return (\n <div\n key={index}\n data-message-type=\"action-render\"\n className=\"copilotKitCustomAssistantMessage\"\n >\n {toRender}\n </div>\n );\n }\n } catch (e) {\n console.error(`Error executing render function for action ${message.name}: ${e}`);\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {isCurrentMessage && inProgress && icons.spinnerIcon}\n <b>❌ Error executing render: {message.name}</b>\n <br />\n {e instanceof Error ? e.message : String(e)}\n </div>\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <div key={index} className={`copilotKitMessage copilotKitAssistantMessage`}>\n {icons.spinnerIcon}\n </div>\n );\n }\n }\n}\n"],"mappings":";;;;;AAAA,SAAiC,yBAAyB;AAG1D,SAA+B,yBAAyB;AAe5C,SACsB,KADtB;AAbL,SAAS,6BAA6B,OAA2B;AACtE,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,aAAa,IAAI;AACvE,QAAM,EAAE,oBAAoB,IAAI,kBAAkB;AAClD,QAAM,EAAE,MAAM,IAAI,eAAe;AAEjC,MAAI,QAAQ,yBAAyB,GAAG;AACtC,QAAI,oBAAoB,YAAY,QAAQ,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI,GAAG;AAC7F,YAAM,SAAS,oBAAoB,QAAQ,QAAQ,QAAQ,IAAI;AAE/D,UAAI,OAAO,WAAW,UAAU;AAE9B,YAAI,oBAAoB,YAAY;AAClC,iBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,kBAAM;AAAA,YAAY;AAAA,YAAC,oBAAC,UAAK,WAAU,mBAAmB,kBAAO;AAAA,eADtD,KAEV;AAAA,QAEJ,OAEK;AACH,iBAAO;AAAA,QACT;AAAA,MACF,OAEK;AACH,cAAM,OAAO,QAAQ;AAErB,YAAI,SAA+B;AAEnC,YAAI,iBAAiB,QAAW;AAC9B,mBAAS;AAAA,QACX,WAAW,QAAQ,OAAO,SAAS,kBAAkB,SAAS;AAC5D,mBAAS;AAAA,QACX;AAEA,YAAI;AACF,gBAAM,WAAW,OAAO;AAAA,YACtB;AAAA,YACA;AAAA,YACA,QAAQ;AAAA,UACV,CAAC;AAED,cAAI,CAAC,YAAY,WAAW,YAAY;AACtC,mBAAO;AAAA,UACT;AACA,cAAI,OAAO,aAAa,UAAU;AAChC,mBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,kCAAoB,cAAc,MAAM;AAAA,cAAY;AAAA,cAAE;AAAA,iBAD/C,KAEV;AAAA,UAEJ,OAAO;AACL,mBACE;AAAA,cAAC;AAAA;AAAA,gBAEC,qBAAkB;AAAA,gBAClB,WAAU;AAAA,gBAET;AAAA;AAAA,cAJI;AAAA,YAKP;AAAA,UAEJ;AAAA,QACF,SAAS,GAAP;AACA,kBAAQ,MAAM,8CAA8C,QAAQ,SAAS,GAAG;AAChF,iBACE,qBAAC,SAAgB,WAAW,gDACzB;AAAA,gCAAoB,cAAc,MAAM;AAAA,YACzC,qBAAC,OAAE;AAAA;AAAA,cAA2B,QAAQ;AAAA,eAAK;AAAA,YAC3C,oBAAC,QAAG;AAAA,YACH,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAAA,eAJlC,KAKV;AAAA,QAEJ;AAAA,MACF;AAAA,IACF,WAES,CAAC,cAAc,CAAC,kBAAkB;AAEzC,aAAO;AAAA,IACT,OAAO;AAEL,aACE,oBAAC,SAAgB,WAAW,gDACzB,gBAAM,eADC,KAEV;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Messages.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef } from \"react\";\nimport { MessagesProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport {\n ActionExecutionMessage,\n Message,\n ResultMessage,\n TextMessage,\n Role,\n AgentStateMessage,\n} from \"@copilotkit/runtime-client-gql\";\n\nexport const Messages = ({\n messages,\n inProgress,\n children,\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n}: MessagesProps) => {\n const context = useChatContext();\n const initialMessages = useMemo(\n () => makeInitialMessages(context.labels.initial),\n [context.labels.initial],\n );\n messages = [...initialMessages, ...messages];\n\n const actionResults: Record<string, string> = {};\n\n for (let i = 0; i < messages.length; i++) {\n if (messages[i].isActionExecutionMessage()) {\n const id = messages[i].id;\n const resultMessage: ResultMessage | undefined = messages.find(\n (message) => message.isResultMessage() && message.actionExecutionId === id,\n ) as ResultMessage | undefined;\n\n if (resultMessage) {\n actionResults[id] = ResultMessage.decodeResult(resultMessage.result || \"\");\n }\n }\n }\n\n const { messagesEndRef, messagesContainerRef } = useScrollToBottom(messages);\n\n return (\n <div className=\"copilotKitMessages\" ref={messagesContainerRef}>\n {messages.map((message, index) => {\n const isCurrentMessage = index === messages.length - 1;\n\n if (message.isTextMessage()) {\n return (\n <RenderTextMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n } else if (message.isActionExecutionMessage()) {\n return (\n <RenderActionExecutionMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n actionResult={actionResults[message.id]}\n />\n );\n } else if (message.isAgentStateMessage()) {\n return (\n <RenderAgentStateMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n } else if (message.isResultMessage()) {\n return (\n <RenderResultMessage\n key={index}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n />\n );\n }\n })}\n <footer ref={messagesEndRef}>{children}</footer>\n </div>\n );\n};\n\nfunction makeInitialMessages(initial?: string | string[]): Message[] {\n let initialArray: string[] = [];\n if (initial) {\n if (Array.isArray(initial)) {\n initialArray.push(...initial);\n } else {\n initialArray.push(initial);\n }\n }\n\n return initialArray.map(\n (message) =>\n new TextMessage({\n role: Role.Assistant,\n content: message,\n }),\n );\n}\nexport function useScrollToBottom(messages: any[]) {\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const messagesContainerRef = useRef<HTMLDivElement | null>(null);\n const isProgrammaticScrollRef = useRef(false);\n const isUserScrollUpRef = useRef(false);\n\n const scrollToBottom = () => {\n if (messagesEndRef.current) {\n isProgrammaticScrollRef.current = true;\n messagesEndRef.current.scrollIntoView({\n behavior: \"auto\",\n });\n }\n };\n\n const handleScroll = () => {\n if (isProgrammaticScrollRef.current) {\n isProgrammaticScrollRef.current = false;\n return;\n }\n\n if (messagesContainerRef.current) {\n const { scrollTop, scrollHeight, clientHeight } = messagesContainerRef.current;\n isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;\n }\n };\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (container) {\n container.addEventListener(\"scroll\", handleScroll);\n }\n return () => {\n if (container) {\n container.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (!container) {\n return;\n }\n\n const mutationObserver = new MutationObserver(() => {\n if (!isUserScrollUpRef.current) {\n scrollToBottom();\n }\n });\n\n mutationObserver.observe(container, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, []);\n\n useEffect(() => {\n isUserScrollUpRef.current = false;\n scrollToBottom();\n }, [messages.filter((m) => m.isTextMessage() && m.role === Role.User).length]);\n\n return { messagesEndRef, messagesContainerRef };\n}\n"],"mappings":";;;;;AAAA,SAAgB,WAAW,SAAS,cAAc;AAGlD;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAoCH,SAMQ,KANR;AAlCG,IAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAqB;AACnB,QAAM,UAAU,eAAe;AAC/B,QAAM,kBAAkB;AAAA,IACtB,MAAM,oBAAoB,QAAQ,OAAO,OAAO;AAAA,IAChD,CAAC,QAAQ,OAAO,OAAO;AAAA,EACzB;AACA,aAAW,CAAC,GAAG,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AM,mBAAmB,IAAI,iBAAiB,MAAM;AAClD,UAAI,CAAC,kBAAkB,SAAS;AAC9B,uBAAe;AAAA,MACjB;AAAA,IACF,CAAC;AAED,qBAAiB,QAAQ,WAAW;AAAA,MAClC,WAAW;AAAA,MACX,SAAS;AAAA,MACT,eAAe;AAAA,IACjB,CAAC;AAED,WAAO,MAAM;AACX,uBAAiB,WAAW;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,sBAAkB,UAAU;AAC5B,mBAAe;AAAA,EACjB,GAAG,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,cAAc,KAAK,EAAE,SAAS,KAAK,IAAI,EAAE,MAAM,CAAC;AAE7E,SAAO,EAAE,gBAAgB,qBAAqB;AAChD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Chat.tsx"],"sourcesContent":["/**\n * <br/>\n * <img src=\"/images/CopilotChat.gif\" width=\"500\" />\n *\n * A chatbot panel component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ## Usage\n *\n * ```tsx\n * import { CopilotChat } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotChat\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\n\nimport {\n ChatContext,\n ChatContextProvider,\n CopilotChatIcons,\n CopilotChatLabels,\n} from \"./ChatContext\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { ResponseButton as DefaultResponseButton } from \"./Response\";\nimport { RenderTextMessage as DefaultRenderTextMessage } from \"./messages/RenderTextMessage\";\nimport { RenderActionExecutionMessage as DefaultRenderActionExecutionMessage } from \"./messages/RenderActionExecutionMessage\";\nimport { RenderResultMessage as DefaultRenderResultMessage } from \"./messages/RenderResultMessage\";\nimport { RenderAgentStateMessage as DefaultRenderAgentStateMessage } from \"./messages/RenderAgentStateMessage\";\nimport { Suggestion } from \"./Suggestion\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport {\n SystemMessageFunction,\n useCopilotChat,\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"@copilotkit/react-core\";\nimport { reloadSuggestions } from \"./Suggestion\";\nimport { CopilotChatSuggestion } from \"../../types/suggestions\";\nimport { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { InputProps, MessagesProps, RenderMessageProps, ResponseButtonProps } from \"./props\";\nimport { randomId } from \"@copilotkit/shared\";\n\nimport { CopilotDevConsole } from \"../dev-console\";\n\n/**\n * Props for CopilotChat component.\n */\nexport interface CopilotChatProps {\n /**\n * Custom instructions to be added to the system message. Use this property to\n * provide additional context or guidance to the language model, influencing\n * its responses. These instructions can include specific directions,\n * preferences, or criteria that the model should consider when generating\n * its output, thereby tailoring the conversation more precisely to the\n * user's needs or the application's requirements.\n */\n instructions?: string;\n\n /**\n * A callback that gets called when the in progress state changes.\n */\n onInProgress?: (inProgress: boolean) => void;\n\n /**\n * A callback that gets called when a new message it submitted.\n */\n onSubmitMessage?: (message: string) => void | Promise<void>;\n\n /**\n * Icons can be used to set custom icons for the chat window.\n */\n icons?: CopilotChatIcons;\n\n /**\n * Labels can be used to set custom labels for the chat window.\n */\n labels?: CopilotChatLabels;\n\n /**\n * A function that takes in context string and instructions and returns\n * the system message to include in the chat request.\n * Use this to completely override the system message, when providing\n * instructions is not enough.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * Whether to show the response button.\n * @default true\n */\n showResponseButton?: boolean;\n\n /**\n * A custom Messages component to use instead of the default.\n */\n Messages?: React.ComponentType<MessagesProps>;\n\n /**\n * A custom RenderTextMessage component to use instead of the default.\n */\n RenderTextMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom RenderActionExecutionMessage component to use instead of the default.\n */\n RenderActionExecutionMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom RenderAgentStateMessage component to use instead of the default.\n */\n RenderAgentStateMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom RenderResultMessage component to use instead of the default.\n */\n RenderResultMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom Input component to use instead of the default.\n */\n Input?: React.ComponentType<InputProps>;\n\n /**\n * A custom ResponseButton component to use instead of the default.\n */\n ResponseButton?: React.ComponentType<ResponseButtonProps>;\n\n /**\n * A class name to apply to the root element.\n */\n className?: string;\n\n /**\n * Children to render.\n */\n children?: React.ReactNode;\n}\n\nexport function CopilotChat({\n instructions,\n onSubmitMessage,\n makeSystemMessage,\n showResponseButton = true,\n onInProgress,\n Messages = DefaultMessages,\n RenderTextMessage = DefaultRenderTextMessage,\n RenderActionExecutionMessage = DefaultRenderActionExecutionMessage,\n RenderAgentStateMessage = DefaultRenderAgentStateMessage,\n RenderResultMessage = DefaultRenderResultMessage,\n Input = DefaultInput,\n ResponseButton = DefaultResponseButton,\n className,\n icons,\n labels,\n}: CopilotChatProps) {\n const context = useCopilotContext();\n\n useEffect(() => {\n context.setChatInstructions(instructions || \"\");\n }, [instructions]);\n\n const {\n visibleMessages,\n isLoading,\n currentSuggestions,\n sendMessage,\n stopGeneration,\n reloadMessages,\n } = useCopilotChatLogic(makeSystemMessage, onInProgress, onSubmitMessage);\n\n const chatContext = React.useContext(ChatContext);\n const isVisible = chatContext ? chatContext.open : true;\n\n return (\n <WrappedCopilotChat icons={icons} labels={labels} className={className}>\n <CopilotDevConsole />\n <Messages\n RenderTextMessage={RenderTextMessage}\n RenderActionExecutionMessage={RenderActionExecutionMessage}\n RenderAgentStateMessage={RenderAgentStateMessage}\n RenderResultMessage={RenderResultMessage}\n messages={visibleMessages}\n inProgress={isLoading}\n >\n {currentSuggestions.length > 0 && (\n <div>\n <h6>Suggested:</h6>\n <div className=\"suggestions\">\n {currentSuggestions.map((suggestion, index) => (\n <Suggestion\n key={index}\n title={suggestion.title}\n message={suggestion.message}\n partial={suggestion.partial}\n className={suggestion.className}\n onClick={(message) => sendMessage(message)}\n />\n ))}\n </div>\n </div>\n )}\n {showResponseButton && visibleMessages.length > 0 && (\n <ResponseButton\n onClick={isLoading ? stopGeneration : reloadMessages}\n inProgress={isLoading}\n />\n )}\n </Messages>\n <Input inProgress={isLoading} onSend={sendMessage} isVisible={isVisible} />\n </WrappedCopilotChat>\n );\n}\n\nexport function WrappedCopilotChat({\n children,\n icons,\n labels,\n className,\n}: {\n children: React.ReactNode;\n icons?: CopilotChatIcons;\n labels?: CopilotChatLabels;\n className?: string;\n}) {\n const chatContext = React.useContext(ChatContext);\n if (!chatContext) {\n return (\n <ChatContextProvider icons={icons} labels={labels} open={true} setOpen={() => {}}>\n <div className={`copilotKitChat ${className}`}>{children}</div>\n </ChatContextProvider>\n );\n }\n return <>{children}</>;\n}\n\nconst SUGGESTIONS_DEBOUNCE_TIMEOUT = 1000;\n\nexport const useCopilotChatLogic = (\n makeSystemMessage?: SystemMessageFunction,\n onInProgress?: (isLoading: boolean) => void,\n onSubmitMessage?: (messageContent: string) => Promise<void> | void,\n) => {\n const { visibleMessages, appendMessage, reloadMessages, stopGeneration, isLoading } =\n useCopilotChat({\n id: randomId(),\n makeSystemMessage,\n });\n\n const [currentSuggestions, setCurrentSuggestions] = useState<CopilotChatSuggestion[]>([]);\n const suggestionsAbortControllerRef = useRef<AbortController | null>(null);\n const debounceTimerRef = useRef<any>();\n\n const abortSuggestions = () => {\n suggestionsAbortControllerRef.current?.abort();\n suggestionsAbortControllerRef.current = null;\n };\n\n const generalContext = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n const context = { ...generalContext, ...messagesContext };\n\n useEffect(() => {\n onInProgress?.(isLoading);\n\n abortSuggestions();\n\n debounceTimerRef.current = setTimeout(\n () => {\n if (!isLoading && Object.keys(context.chatSuggestionConfiguration).length !== 0) {\n suggestionsAbortControllerRef.current = new AbortController();\n reloadSuggestions(\n context,\n context.chatSuggestionConfiguration,\n setCurrentSuggestions,\n suggestionsAbortControllerRef,\n );\n }\n },\n currentSuggestions.length == 0 ? 0 : SUGGESTIONS_DEBOUNCE_TIMEOUT,\n );\n\n return () => {\n clearTimeout(debounceTimerRef.current);\n };\n }, [isLoading, context.chatSuggestionConfiguration]);\n\n const sendMessage = async (messageContent: string) => {\n abortSuggestions();\n setCurrentSuggestions([]);\n\n const message: Message = new TextMessage({\n content: messageContent,\n role: Role.User,\n });\n\n if (onSubmitMessage) {\n try {\n await onSubmitMessage(messageContent);\n } catch (error) {\n console.error(\"Error in onSubmitMessage:\", error);\n }\n }\n // this needs to happen after onSubmitMessage, because it will trigger submission\n // of the message to the endpoint. Some users depend on performing some actions\n // before the message is submitted.\n appendMessage(message);\n\n return message;\n };\n\n return {\n visibleMessages,\n isLoading,\n currentSuggestions,\n sendMessage,\n stopGeneration,\n reloadMessages,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AACnD;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAkB,MAAM,mBAAmB;AAE3C,SAAS,gBAAgB;AAuInB,SAyDG,UAzDH,KAUI,YAVJ;AArCC,SAAS,YAAY;A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QAAQ;AAAA,YACR;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MACA,mBAAmB,UAAU,IAAI,IAAI;AAAA,IACvC;AAEA,WAAO,MAAM;AACX,mBAAa,iBAAiB,OAAO;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,WAAW,QAAQ,2BAA2B,CAAC;AAEnD,QAAM,cAAc,CAAO,mBAA2B;AACpD,qBAAiB;AACjB,0BAAsB,CAAC,CAAC;AAExB,UAAM,UAAmB,IAAI,YAAY;AAAA,MACvC,SAAS;AAAA,MACT,MAAM,KAAK;AAAA,IACb,CAAC;AAED,QAAI,iBAAiB;AACnB,UAAI;AACF,cAAM,gBAAgB,cAAc;AAAA,MACtC,SAAS,OAAP;AACA,gBAAQ,MAAM,6BAA6B,KAAK;AAAA,MAClD;AAAA,IACF;AAIA,kBAAc,OAAO;AAErB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["Messages","RenderTextMessage","RenderActionExecutionMessage","RenderAgentStateMessage","RenderResultMessage","Input","ResponseButton"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|