@copilotkit/react-ui 1.10.6 → 1.50.0-beta.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/dist/{chunk-H5Y4W7DM.mjs → chunk-3JYVJHL5.mjs} +6 -6
- package/dist/chunk-3YWFGNSM.mjs +32 -0
- package/dist/chunk-3YWFGNSM.mjs.map +1 -0
- package/dist/{chunk-BAD2NFZ7.mjs → chunk-CQ2WALZ7.mjs} +2 -2
- package/dist/{chunk-W7ONZTSW.mjs → chunk-E6WVAOQA.mjs} +11 -5
- package/dist/chunk-E6WVAOQA.mjs.map +1 -0
- package/dist/{chunk-ME2WM7IP.mjs → chunk-G35HUUDA.mjs} +36 -260
- package/dist/chunk-G35HUUDA.mjs.map +1 -0
- package/dist/{chunk-EZQA3UPQ.mjs → chunk-HBZW7E5Z.mjs} +16 -13
- package/dist/chunk-HBZW7E5Z.mjs.map +1 -0
- package/dist/{chunk-3QYTKBWC.mjs → chunk-IHFR6PYG.mjs} +8 -5
- package/dist/chunk-IHFR6PYG.mjs.map +1 -0
- package/dist/{chunk-5XLGXUQI.mjs → chunk-MPF6BJUF.mjs} +7 -3
- package/dist/chunk-MPF6BJUF.mjs.map +1 -0
- package/dist/{chunk-W26XFBEG.mjs → chunk-NGJ32FAP.mjs} +3 -3
- package/dist/chunk-NGJ32FAP.mjs.map +1 -0
- package/dist/{chunk-2LIO4Z3E.mjs → chunk-ODEHR7KI.mjs} +9 -2
- package/dist/chunk-ODEHR7KI.mjs.map +1 -0
- package/dist/chunk-OYRZ4VLU.mjs +12 -0
- package/dist/chunk-OYRZ4VLU.mjs.map +1 -0
- package/dist/chunk-QB3GUN2N.mjs +31 -0
- package/dist/chunk-QB3GUN2N.mjs.map +1 -0
- package/dist/{chunk-7RDGZ5JL.mjs → chunk-SOB5EIL7.mjs} +2 -2
- package/dist/components/chat/Chat.d.ts +3 -98
- package/dist/components/chat/Chat.js +100 -279
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +12 -14
- package/dist/components/chat/Input.d.ts +1 -1
- package/dist/components/chat/Input.js +11 -8
- package/dist/components/chat/Input.js.map +1 -1
- package/dist/components/chat/Input.mjs +2 -2
- package/dist/components/chat/Messages.d.ts +4 -4
- package/dist/components/chat/Messages.js +44 -8
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +5 -5
- package/dist/components/chat/Modal.d.ts +1 -6
- package/dist/components/chat/Modal.js +106 -283
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +11 -11
- package/dist/components/chat/Popup.d.ts +1 -6
- package/dist/components/chat/Popup.js +106 -283
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +12 -12
- package/dist/components/chat/Sidebar.d.ts +1 -6
- package/dist/components/chat/Sidebar.js +106 -283
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +12 -12
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +1 -1
- package/dist/components/chat/Suggestions.d.ts +1 -1
- package/dist/components/chat/Suggestions.js +19 -12
- package/dist/components/chat/Suggestions.js.map +1 -1
- package/dist/components/chat/Suggestions.mjs +2 -2
- package/dist/components/chat/index.d.ts +0 -5
- package/dist/components/chat/index.js +106 -283
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +13 -13
- package/dist/components/chat/messages/AssistantMessage.js +7 -4
- package/dist/components/chat/messages/AssistantMessage.js.map +1 -1
- package/dist/components/chat/messages/AssistantMessage.mjs +1 -1
- package/dist/components/chat/messages/LegacyRenderMessage.js +37 -7
- package/dist/components/chat/messages/LegacyRenderMessage.js.map +1 -1
- package/dist/components/chat/messages/LegacyRenderMessage.mjs +4 -4
- package/dist/components/chat/messages/RenderMessage.js +30 -7
- package/dist/components/chat/messages/RenderMessage.js.map +1 -1
- package/dist/components/chat/messages/RenderMessage.mjs +3 -3
- package/dist/components/chat/messages/UserMessage.js +19 -3
- package/dist/components/chat/messages/UserMessage.js.map +1 -1
- package/dist/components/chat/messages/UserMessage.mjs +1 -1
- package/dist/components/chat/props.d.ts +16 -0
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +106 -283
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +13 -13
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -24
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +4 -26
- package/dist/hooks/use-copilot-chat-suggestions.js +2 -24
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -1
- package/dist/hooks/use-copilot-chat-suggestions.mjs +1 -1
- package/dist/index.css +8 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +109 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -14
- package/dist/types/suggestions.d.ts +1 -0
- package/dist/types/suggestions.js.map +1 -1
- package/package.json +23 -22
- package/src/components/chat/Chat.tsx +40 -325
- package/src/components/chat/Input.tsx +13 -12
- package/src/components/chat/Messages.tsx +10 -4
- package/src/components/chat/Suggestion.tsx +2 -2
- package/src/components/chat/Suggestions.tsx +6 -2
- package/src/components/chat/messages/AssistantMessage.tsx +14 -4
- package/src/components/chat/messages/LegacyRenderMessage.tsx +7 -0
- package/src/components/chat/messages/RenderMessage.tsx +4 -0
- package/src/components/chat/messages/UserMessage.tsx +30 -6
- package/src/components/chat/props.ts +19 -0
- package/src/css/messages.css +10 -1
- package/src/hooks/use-copilot-chat-suggestions.tsx +6 -57
- package/src/types/suggestions.ts +1 -0
- package/tsup.config.ts +1 -1
- package/dist/chunk-226ZMOE3.mjs +0 -24
- package/dist/chunk-226ZMOE3.mjs.map +0 -1
- package/dist/chunk-2LIO4Z3E.mjs.map +0 -1
- package/dist/chunk-3QYTKBWC.mjs.map +0 -1
- package/dist/chunk-5XLGXUQI.mjs.map +0 -1
- package/dist/chunk-EYRKZDP5.mjs +0 -32
- package/dist/chunk-EYRKZDP5.mjs.map +0 -1
- package/dist/chunk-EZQA3UPQ.mjs.map +0 -1
- package/dist/chunk-ME2WM7IP.mjs.map +0 -1
- package/dist/chunk-VVL6JFCJ.mjs +0 -16
- package/dist/chunk-VVL6JFCJ.mjs.map +0 -1
- package/dist/chunk-W26XFBEG.mjs.map +0 -1
- package/dist/chunk-W7ONZTSW.mjs.map +0 -1
- /package/dist/{chunk-H5Y4W7DM.mjs.map → chunk-3JYVJHL5.mjs.map} +0 -0
- /package/dist/{chunk-BAD2NFZ7.mjs.map → chunk-CQ2WALZ7.mjs.map} +0 -0
- /package/dist/{chunk-7RDGZ5JL.mjs.map → chunk-SOB5EIL7.mjs.map} +0 -0
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Textarea_default
|
|
6
6
|
} from "./chunk-QIOJXTIQ.mjs";
|
|
7
|
-
import {
|
|
8
|
-
usePushToTalk
|
|
9
|
-
} from "./chunk-O72ZB5V3.mjs";
|
|
10
7
|
import {
|
|
11
8
|
useChatContext
|
|
12
9
|
} from "./chunk-IEMQ2SQW.mjs";
|
|
10
|
+
import {
|
|
11
|
+
usePushToTalk
|
|
12
|
+
} from "./chunk-O72ZB5V3.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/chat/Input.tsx
|
|
15
15
|
import { useMemo, useRef, useState } from "react";
|
|
16
|
-
import { useCopilotContext } from "@copilotkit/react-core";
|
|
16
|
+
import { useCopilotContext, useCopilotChatInternal } from "@copilotkit/react-core";
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
var MAX_NEWLINES = 6;
|
|
19
19
|
var Input = ({
|
|
20
20
|
inProgress,
|
|
21
21
|
onSend,
|
|
22
|
-
|
|
22
|
+
chatReady = true,
|
|
23
23
|
onStop,
|
|
24
24
|
onUpload,
|
|
25
25
|
hideStopButton = false
|
|
26
26
|
}) => {
|
|
27
|
-
var _a
|
|
27
|
+
var _a;
|
|
28
28
|
const context = useChatContext();
|
|
29
29
|
const copilotContext = useCopilotContext();
|
|
30
30
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
@@ -54,14 +54,16 @@ var Input = ({
|
|
|
54
54
|
inProgress
|
|
55
55
|
});
|
|
56
56
|
const isInProgress = inProgress || pushToTalkState === "transcribing";
|
|
57
|
-
const buttonIcon
|
|
57
|
+
const { buttonIcon, buttonAlt } = useMemo(() => {
|
|
58
|
+
if (!chatReady)
|
|
59
|
+
return { buttonIcon: context.icons.spinnerIcon, buttonAlt: "Loading" };
|
|
60
|
+
return isInProgress && !hideStopButton ? { buttonIcon: context.icons.stopIcon, buttonAlt: "Stop" } : { buttonIcon: context.icons.sendIcon, buttonAlt: "Send" };
|
|
61
|
+
}, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);
|
|
58
62
|
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
63
|
+
const { interrupt } = useCopilotChatInternal();
|
|
59
64
|
const canSend = useMemo(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const interruptInProgress = (interruptEvent == null ? void 0 : interruptEvent.name) === "LangGraphInterruptEvent" && !(interruptEvent == null ? void 0 : interruptEvent.response);
|
|
63
|
-
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interruptInProgress;
|
|
64
|
-
}, [(_b = copilotContext.langGraphInterruptAction) == null ? void 0 : _b.event, isInProgress, text, pushToTalkState]);
|
|
65
|
+
return !isInProgress && text.trim().length > 0 && pushToTalkState === "idle" && !interrupt;
|
|
66
|
+
}, [interrupt, isInProgress, text, pushToTalkState]);
|
|
65
67
|
const canStop = useMemo(() => {
|
|
66
68
|
return isInProgress && !hideStopButton;
|
|
67
69
|
}, [isInProgress, hideStopButton]);
|
|
@@ -108,6 +110,7 @@ var Input = ({
|
|
|
108
110
|
"data-copilotkit-in-progress": inProgress,
|
|
109
111
|
"data-test-id": inProgress ? "copilot-chat-request-in-progress" : "copilot-chat-ready",
|
|
110
112
|
className: "copilotKitInputControlButton",
|
|
113
|
+
"aria-label": buttonAlt,
|
|
111
114
|
children: buttonIcon
|
|
112
115
|
}
|
|
113
116
|
)
|
|
@@ -120,4 +123,4 @@ var Input = ({
|
|
|
120
123
|
export {
|
|
121
124
|
Input
|
|
122
125
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-HBZW7E5Z.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Input.tsx"],"sourcesContent":["import React, { useMemo, useRef, useState } from \"react\";\nimport { InputProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport AutoResizingTextarea from \"./Textarea\";\nimport { usePushToTalk } from \"../../hooks/use-push-to-talk\";\nimport { useCopilotContext, useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport { PoweredByTag } from \"./PoweredByTag\";\n\nconst MAX_NEWLINES = 6;\n\nexport const Input = ({\n inProgress,\n onSend,\n chatReady = true,\n onStop,\n onUpload,\n hideStopButton = false,\n}: InputProps) => {\n const context = useChatContext();\n const copilotContext = useCopilotContext();\n\n const showPoweredBy = !copilotContext.copilotApiConfig?.publicApiKey;\n\n const pushToTalkConfigured =\n copilotContext.copilotApiConfig.textToSpeechUrl !== undefined &&\n copilotContext.copilotApiConfig.transcribeAudioUrl !== undefined;\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [isComposing, setIsComposing] = useState(false);\n\n const handleDivClick = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n // If the user clicked a button or inside a button, don't focus the textarea\n if (target.closest(\"button\")) return;\n\n // If the user clicked the textarea, do nothing (it's already focused)\n if (target.tagName === \"TEXTAREA\") return;\n\n // Otherwise, focus the textarea\n textareaRef.current?.focus();\n };\n\n const [text, setText] = useState(\"\");\n const send = () => {\n if (inProgress) return;\n onSend(text);\n setText(\"\");\n\n textareaRef.current?.focus();\n };\n\n // tylerslaton:\n //\n // This scrolls CopilotKit into view always. Reading the commit history, it was likely\n // added to fix a bug but it is causing issues now.\n //\n // For the future, if we want this behavior again, we will need to find a way to do it without\n // forcing CopilotKit to always be in view. This code causes this because focusing an element\n // in most browsers will scroll that element into view.\n //\n // useEffect(() => {\n // if (isVisible) {\n // textareaRef.current?.focus();\n // }\n // }, [isVisible]);\n\n const { pushToTalkState, setPushToTalkState } = usePushToTalk({\n sendFunction: onSend,\n inProgress,\n });\n\n const isInProgress = inProgress || pushToTalkState === \"transcribing\";\n const { buttonIcon, buttonAlt } = useMemo(() => {\n if (!chatReady) return { buttonIcon: context.icons.spinnerIcon, buttonAlt: \"Loading\" };\n return isInProgress && !hideStopButton\n ? { buttonIcon: context.icons.stopIcon, buttonAlt: \"Stop\" }\n : { buttonIcon: context.icons.sendIcon, buttonAlt: \"Send\" };\n }, [isInProgress, chatReady, hideStopButton, context.icons.stopIcon, context.icons.sendIcon]);\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const { interrupt } = useCopilotChatInternal();\n\n const canSend = useMemo(() => {\n return !isInProgress && text.trim().length > 0 && pushToTalkState === \"idle\" && !interrupt;\n }, [interrupt, isInProgress, text, pushToTalkState]);\n\n const canStop = useMemo(() => {\n return isInProgress && !hideStopButton;\n }, [isInProgress, hideStopButton]);\n\n const sendDisabled = !canSend && !canStop;\n\n return (\n <div className={`copilotKitInputContainer ${showPoweredBy ? \"poweredByContainer\" : \"\"}`}>\n <div className=\"copilotKitInput\" onClick={handleDivClick}>\n <AutoResizingTextarea\n ref={textareaRef}\n placeholder={context.labels.placeholder}\n autoFocus={false}\n maxRows={MAX_NEWLINES}\n value={text}\n onChange={(event) => setText(event.target.value)}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" && !event.shiftKey && !isComposing) {\n event.preventDefault();\n if (canSend) {\n send();\n }\n }\n }}\n />\n <div className=\"copilotKitInputControls\">\n {onUpload && (\n <button onClick={onUpload} className=\"copilotKitInputControlButton\">\n {context.icons.uploadIcon}\n </button>\n )}\n\n <div style={{ flexGrow: 1 }} />\n\n {showPushToTalk && (\n <button\n onClick={() =>\n setPushToTalkState(pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\")\n }\n className={\n pushToTalkState === \"recording\"\n ? \"copilotKitInputControlButton copilotKitPushToTalkRecording\"\n : \"copilotKitInputControlButton\"\n }\n >\n {context.icons.pushToTalkIcon}\n </button>\n )}\n <button\n disabled={sendDisabled}\n onClick={isInProgress && !hideStopButton ? onStop : send}\n data-copilotkit-in-progress={inProgress}\n data-test-id={inProgress ? \"copilot-chat-request-in-progress\" : \"copilot-chat-ready\"}\n className=\"copilotKitInputControlButton\"\n aria-label={buttonAlt}\n >\n {buttonIcon}\n </button>\n </div>\n </div>\n <PoweredByTag showPoweredBy={showPoweredBy} />\n </div>\n );\n};\n"],"mappings":"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","names":["_a"]}
|
|
@@ -19,6 +19,7 @@ var AssistantMessage = (props) => {
|
|
|
19
19
|
onThumbsUp,
|
|
20
20
|
onThumbsDown,
|
|
21
21
|
isCurrentMessage,
|
|
22
|
+
feedback,
|
|
22
23
|
markdownTagRenderers
|
|
23
24
|
} = props;
|
|
24
25
|
const [copied, setCopied] = useState(false);
|
|
@@ -40,12 +41,14 @@ var AssistantMessage = (props) => {
|
|
|
40
41
|
onRegenerate();
|
|
41
42
|
};
|
|
42
43
|
const handleThumbsUp = () => {
|
|
43
|
-
if (onThumbsUp && message)
|
|
44
|
+
if (onThumbsUp && message) {
|
|
44
45
|
onThumbsUp(message);
|
|
46
|
+
}
|
|
45
47
|
};
|
|
46
48
|
const handleThumbsDown = () => {
|
|
47
|
-
if (onThumbsDown && message)
|
|
49
|
+
if (onThumbsDown && message) {
|
|
48
50
|
onThumbsDown(message);
|
|
51
|
+
}
|
|
49
52
|
};
|
|
50
53
|
const LoadingIcon = () => /* @__PURE__ */ jsx("span", { children: icons.activityIcon });
|
|
51
54
|
const content = (message == null ? void 0 : message.content) || "";
|
|
@@ -81,7 +84,7 @@ var AssistantMessage = (props) => {
|
|
|
81
84
|
onThumbsUp && /* @__PURE__ */ jsx(
|
|
82
85
|
"button",
|
|
83
86
|
{
|
|
84
|
-
className:
|
|
87
|
+
className: `copilotKitMessageControlButton ${feedback === "thumbsUp" ? "active" : ""}`,
|
|
85
88
|
onClick: handleThumbsUp,
|
|
86
89
|
"aria-label": labels.thumbsUp,
|
|
87
90
|
title: labels.thumbsUp,
|
|
@@ -91,7 +94,7 @@ var AssistantMessage = (props) => {
|
|
|
91
94
|
onThumbsDown && /* @__PURE__ */ jsx(
|
|
92
95
|
"button",
|
|
93
96
|
{
|
|
94
|
-
className:
|
|
97
|
+
className: `copilotKitMessageControlButton ${feedback === "thumbsDown" ? "active" : ""}`,
|
|
95
98
|
onClick: handleThumbsDown,
|
|
96
99
|
"aria-label": labels.thumbsDown,
|
|
97
100
|
title: labels.thumbsDown,
|
|
@@ -110,4 +113,4 @@ var AssistantMessage = (props) => {
|
|
|
110
113
|
export {
|
|
111
114
|
AssistantMessage
|
|
112
115
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-IHFR6PYG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/messages/AssistantMessage.tsx"],"sourcesContent":["import { AssistantMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { Markdown } from \"../Markdown\";\nimport { useState } from \"react\";\nimport React from \"react\";\n\nexport const AssistantMessage = (props: AssistantMessageProps) => {\n const { icons, labels } = useChatContext();\n const {\n message,\n isLoading,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n isCurrentMessage,\n feedback,\n markdownTagRenderers,\n } = props;\n const [copied, setCopied] = useState(false);\n\n const handleCopy = () => {\n const content = message?.content || \"\";\n if (content && onCopy) {\n navigator.clipboard.writeText(content);\n setCopied(true);\n onCopy(content);\n setTimeout(() => setCopied(false), 2000);\n } else if (content) {\n navigator.clipboard.writeText(content);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n const handleRegenerate = () => {\n if (onRegenerate) onRegenerate();\n };\n\n const handleThumbsUp = () => {\n if (onThumbsUp && message) {\n onThumbsUp(message);\n }\n };\n\n const handleThumbsDown = () => {\n if (onThumbsDown && message) {\n onThumbsDown(message);\n }\n };\n\n const LoadingIcon = () => <span>{icons.activityIcon}</span>;\n const content = message?.content || \"\";\n const subComponent = message?.generativeUI?.();\n\n return (\n <>\n {content && (\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n {content && <Markdown content={content} components={markdownTagRenderers} />}\n\n {content && !isLoading && (\n <div\n className={`copilotKitMessageControls ${isCurrentMessage ? \"currentMessage\" : \"\"}`}\n >\n <button\n className=\"copilotKitMessageControlButton\"\n onClick={handleRegenerate}\n aria-label={labels.regenerateResponse}\n title={labels.regenerateResponse}\n >\n {icons.regenerateIcon}\n </button>\n <button\n className=\"copilotKitMessageControlButton\"\n onClick={handleCopy}\n aria-label={labels.copyToClipboard}\n title={labels.copyToClipboard}\n >\n {copied ? (\n <span style={{ fontSize: \"10px\", fontWeight: \"bold\" }}>✓</span>\n ) : (\n icons.copyIcon\n )}\n </button>\n {onThumbsUp && (\n <button\n className={`copilotKitMessageControlButton ${\n feedback === \"thumbsUp\" ? \"active\" : \"\"\n }`}\n onClick={handleThumbsUp}\n aria-label={labels.thumbsUp}\n title={labels.thumbsUp}\n >\n {icons.thumbsUpIcon}\n </button>\n )}\n {onThumbsDown && (\n <button\n className={`copilotKitMessageControlButton ${\n feedback === \"thumbsDown\" ? \"active\" : \"\"\n }`}\n onClick={handleThumbsDown}\n aria-label={labels.thumbsDown}\n title={labels.thumbsDown}\n >\n {icons.thumbsDownIcon}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n {isLoading && <LoadingIcon />}\n </>\n );\n};\n"],"mappings":";;;;;;;;AAGA,SAAS,gBAAgB;AAgDG,SAKxB,UALwB,KAWhB,YAXgB;AA7CrB,IAAM,mBAAmB,CAAC,UAAiC;AANlE;AAOE,QAAM,EAAE,OAAO,OAAO,IAAI,eAAe;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,aAAa,MAAM;AACvB,UAAMA,YAAU,mCAAS,YAAW;AACpC,QAAIA,YAAW,QAAQ;AACrB,gBAAU,UAAU,UAAUA,QAAO;AACrC,gBAAU,IAAI;AACd,aAAOA,QAAO;AACd,iBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,IACzC,WAAWA,UAAS;AAClB,gBAAU,UAAU,UAAUA,QAAO;AACrC,gBAAU,IAAI;AACd,iBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,IACzC;AAAA,EACF;AAEA,QAAM,mBAAmB,MAAM;AAC7B,QAAI;AAAc,mBAAa;AAAA,EACjC;AAEA,QAAM,iBAAiB,MAAM;AAC3B,QAAI,cAAc,SAAS;AACzB,iBAAW,OAAO;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,mBAAmB,MAAM;AAC7B,QAAI,gBAAgB,SAAS;AAC3B,mBAAa,OAAO;AAAA,IACtB;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,oBAAC,UAAM,gBAAM,cAAa;AACpD,QAAM,WAAU,mCAAS,YAAW;AACpC,QAAM,gBAAe,wCAAS,iBAAT;AAErB,SACE,iCACG;AAAA,eACC,qBAAC,SAAI,WAAU,gDACZ;AAAA,iBAAW,oBAAC,YAAS,SAAkB,YAAY,sBAAsB;AAAA,MAEzE,WAAW,CAAC,aACX;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,6BAA6B,mBAAmB,mBAAmB;AAAA,UAE9E;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,cAAY,OAAO;AAAA,gBACnB,OAAO,OAAO;AAAA,gBAEb,gBAAM;AAAA;AAAA,YACT;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,cAAY,OAAO;AAAA,gBACnB,OAAO,OAAO;AAAA,gBAEb,mBACC,oBAAC,UAAK,OAAO,EAAE,UAAU,QAAQ,YAAY,OAAO,GAAG,oBAAC,IAExD,MAAM;AAAA;AAAA,YAEV;AAAA,YACC,cACC;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,kCACT,aAAa,aAAa,WAAW;AAAA,gBAEvC,SAAS;AAAA,gBACT,cAAY,OAAO;AAAA,gBACnB,OAAO,OAAO;AAAA,gBAEb,gBAAM;AAAA;AAAA,YACT;AAAA,YAED,gBACC;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,kCACT,aAAa,eAAe,WAAW;AAAA,gBAEzC,SAAS;AAAA,gBACT,cAAY,OAAO;AAAA,gBACnB,OAAO,OAAO;AAAA,gBAEb,gBAAM;AAAA;AAAA,YACT;AAAA;AAAA;AAAA,MAEJ;AAAA,OAEJ;AAAA,IAEF,oBAAC,SAAI,OAAO,EAAE,cAAc,SAAS,GAAI,wBAAa;AAAA,IACrD,aAAa,oBAAC,eAAY;AAAA,KAC7B;AAEJ;","names":["content"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AssistantMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHFR6PYG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ImageRenderer
|
|
6
6
|
} from "./chunk-DBKRAOH7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
UserMessage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3YWFGNSM.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__objRest
|
|
12
12
|
} from "./chunk-MRXNTQOX.mjs";
|
|
@@ -26,6 +26,7 @@ function RenderMessage(_a) {
|
|
|
26
26
|
var _a2;
|
|
27
27
|
const {
|
|
28
28
|
message,
|
|
29
|
+
messages,
|
|
29
30
|
inProgress,
|
|
30
31
|
index,
|
|
31
32
|
isCurrentMessage,
|
|
@@ -33,6 +34,7 @@ function RenderMessage(_a) {
|
|
|
33
34
|
onCopy,
|
|
34
35
|
onThumbsUp,
|
|
35
36
|
onThumbsDown,
|
|
37
|
+
messageFeedback,
|
|
36
38
|
markdownTagRenderers
|
|
37
39
|
} = props;
|
|
38
40
|
switch (message.role) {
|
|
@@ -55,6 +57,7 @@ function RenderMessage(_a) {
|
|
|
55
57
|
subComponent: (_a2 = message.generativeUI) == null ? void 0 : _a2.call(message),
|
|
56
58
|
rawData: message,
|
|
57
59
|
message,
|
|
60
|
+
messages,
|
|
58
61
|
isLoading: inProgress && isCurrentMessage && !message.content,
|
|
59
62
|
isGenerating: inProgress && isCurrentMessage && !!message.content,
|
|
60
63
|
isCurrentMessage,
|
|
@@ -62,6 +65,7 @@ function RenderMessage(_a) {
|
|
|
62
65
|
onCopy,
|
|
63
66
|
onThumbsUp,
|
|
64
67
|
onThumbsDown,
|
|
68
|
+
feedback: (messageFeedback == null ? void 0 : messageFeedback[message.id]) || null,
|
|
65
69
|
markdownTagRenderers,
|
|
66
70
|
ImageRenderer: ImageRenderer2
|
|
67
71
|
},
|
|
@@ -73,4 +77,4 @@ function RenderMessage(_a) {
|
|
|
73
77
|
export {
|
|
74
78
|
RenderMessage
|
|
75
79
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-MPF6BJUF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/messages/RenderMessage.tsx"],"sourcesContent":["import { RenderMessageProps } from \"../props\";\nimport { UserMessage as DefaultUserMessage } from \"./UserMessage\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./AssistantMessage\";\nimport { ImageRenderer as DefaultImageRenderer } from \"./ImageRenderer\";\n\nexport function RenderMessage({\n UserMessage = DefaultUserMessage,\n AssistantMessage = DefaultAssistantMessage,\n ImageRenderer = DefaultImageRenderer,\n ...props\n}: RenderMessageProps) {\n const {\n message,\n messages,\n inProgress,\n index,\n isCurrentMessage,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n messageFeedback,\n markdownTagRenderers,\n } = props;\n\n switch (message.role) {\n case \"user\":\n return (\n <UserMessage\n key={index}\n rawData={message}\n data-message-role=\"user\"\n message={message}\n ImageRenderer={ImageRenderer}\n />\n );\n case \"assistant\":\n return (\n <AssistantMessage\n key={index}\n data-message-role=\"assistant\"\n subComponent={message.generativeUI?.()}\n rawData={message}\n message={message}\n messages={messages}\n isLoading={inProgress && isCurrentMessage && !message.content}\n isGenerating={inProgress && isCurrentMessage && !!message.content}\n isCurrentMessage={isCurrentMessage}\n onRegenerate={() => onRegenerate?.(message.id)}\n onCopy={onCopy}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n feedback={messageFeedback?.[message.id] || null}\n markdownTagRenderers={markdownTagRenderers}\n ImageRenderer={ImageRenderer}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA4BQ;AAvBD,SAAS,cAAc,IAKP;AALO,eAC5B;AAAA,iBAAAA,eAAc;AAAA,IACd,kBAAAC,oBAAmB;AAAA,IACnB,eAAAC,iBAAgB;AAAA,EARlB,IAK8B,IAIzB,kBAJyB,IAIzB;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AARF,MAAAC;AAWE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aACE;AAAA,QAACH;AAAA,QAAA;AAAA,UAEC,SAAS;AAAA,UACT,qBAAkB;AAAA,UAClB;AAAA,UACA,eAAeE;AAAA;AAAA,QAJV;AAAA,MAKP;AAAA,IAEJ,KAAK;AACH,aACE;AAAA,QAACD;AAAA,QAAA;AAAA,UAEC,qBAAkB;AAAA,UAClB,eAAcE,MAAA,QAAQ,iBAAR,gBAAAA,IAAA;AAAA,UACd,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,WAAW,cAAc,oBAAoB,CAAC,QAAQ;AAAA,UACtD,cAAc,cAAc,oBAAoB,CAAC,CAAC,QAAQ;AAAA,UAC1D;AAAA,UACA,cAAc,MAAM,6CAAe,QAAQ;AAAA,UAC3C;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAU,mDAAkB,QAAQ,QAAO;AAAA,UAC3C;AAAA,UACA,eAAeD;AAAA;AAAA,QAfV;AAAA,MAgBP;AAAA,EAEN;AACF;","names":["UserMessage","AssistantMessage","ImageRenderer","_a"]}
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-XWG3L6QC.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/chat/Suggestion.tsx
|
|
6
|
-
import { useCopilotChatInternal
|
|
6
|
+
import { useCopilotChatInternal } from "@copilotkit/react-core";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
function Suggestion({ title, onClick, partial, className }) {
|
|
9
9
|
if (!title)
|
|
10
10
|
return null;
|
|
11
|
-
const { isLoading } =
|
|
11
|
+
const { isLoading } = useCopilotChatInternal();
|
|
12
12
|
return /* @__PURE__ */ jsx(
|
|
13
13
|
"button",
|
|
14
14
|
{
|
|
@@ -27,4 +27,4 @@ function Suggestion({ title, onClick, partial, className }) {
|
|
|
27
27
|
export {
|
|
28
28
|
Suggestion
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-NGJ32FAP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Suggestion.tsx"],"sourcesContent":["import { useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport { SmallSpinnerIcon } from \"./Icons\";\n\ninterface SuggestionsProps {\n title: string;\n message: string;\n partial?: boolean;\n className?: string;\n onClick: () => void;\n}\n\nexport function Suggestion({ title, onClick, partial, className }: SuggestionsProps) {\n if (!title) return null;\n const { isLoading } = useCopilotChatInternal();\n\n return (\n <button\n disabled={partial || isLoading}\n onClick={(e) => {\n e.preventDefault();\n onClick();\n }}\n className={className || (partial ? \"suggestion loading\" : \"suggestion\")}\n data-test-id=\"suggestion\"\n >\n {partial ? SmallSpinnerIcon : <span>{title}</span>}\n </button>\n );\n}\n"],"mappings":";;;;;AAAA,SAAS,8BAA8B;AAyBH;AAd7B,SAAS,WAAW,EAAE,OAAO,SAAS,SAAS,UAAU,GAAqB;AACnF,MAAI,CAAC;AAAO,WAAO;AACnB,QAAM,EAAE,UAAU,IAAI,uBAAuB;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,WAAW;AAAA,MACrB,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,gBAAQ;AAAA,MACV;AAAA,MACA,WAAW,cAAc,UAAU,uBAAuB;AAAA,MAC1D,gBAAa;AAAA,MAEZ,oBAAU,mBAAmB,oBAAC,UAAM,iBAAM;AAAA;AAAA,EAC7C;AAEJ;","names":[]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RenderMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MPF6BJUF.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/chat/messages/LegacyRenderMessage.tsx
|
|
6
6
|
import { aguiToGQL } from "@copilotkit/runtime-client-gql";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
var LegacyRenderMessage = ({
|
|
9
9
|
message,
|
|
10
|
+
messages,
|
|
10
11
|
inProgress,
|
|
11
12
|
index,
|
|
12
13
|
isCurrentMessage,
|
|
@@ -35,6 +36,7 @@ var LegacyRenderMessage = ({
|
|
|
35
36
|
RenderTextMessage,
|
|
36
37
|
{
|
|
37
38
|
message,
|
|
39
|
+
messages,
|
|
38
40
|
inProgress,
|
|
39
41
|
index,
|
|
40
42
|
isCurrentMessage,
|
|
@@ -52,6 +54,7 @@ var LegacyRenderMessage = ({
|
|
|
52
54
|
return /* @__PURE__ */ jsx(
|
|
53
55
|
RenderActionExecutionMessage,
|
|
54
56
|
{
|
|
57
|
+
messages,
|
|
55
58
|
message,
|
|
56
59
|
inProgress,
|
|
57
60
|
index,
|
|
@@ -66,6 +69,7 @@ var LegacyRenderMessage = ({
|
|
|
66
69
|
return /* @__PURE__ */ jsx(
|
|
67
70
|
RenderAgentStateMessage,
|
|
68
71
|
{
|
|
72
|
+
messages,
|
|
69
73
|
message,
|
|
70
74
|
inProgress,
|
|
71
75
|
index,
|
|
@@ -79,6 +83,7 @@ var LegacyRenderMessage = ({
|
|
|
79
83
|
return /* @__PURE__ */ jsx(
|
|
80
84
|
RenderResultMessage,
|
|
81
85
|
{
|
|
86
|
+
messages,
|
|
82
87
|
message,
|
|
83
88
|
inProgress,
|
|
84
89
|
index,
|
|
@@ -92,6 +97,7 @@ var LegacyRenderMessage = ({
|
|
|
92
97
|
return /* @__PURE__ */ jsx(
|
|
93
98
|
RenderImageMessage,
|
|
94
99
|
{
|
|
100
|
+
messages,
|
|
95
101
|
message,
|
|
96
102
|
inProgress,
|
|
97
103
|
index,
|
|
@@ -104,6 +110,7 @@ var LegacyRenderMessage = ({
|
|
|
104
110
|
return /* @__PURE__ */ jsx(
|
|
105
111
|
RenderMessage,
|
|
106
112
|
{
|
|
113
|
+
messages,
|
|
107
114
|
message,
|
|
108
115
|
inProgress,
|
|
109
116
|
index,
|
|
@@ -123,4 +130,4 @@ var LegacyRenderMessage = ({
|
|
|
123
130
|
export {
|
|
124
131
|
LegacyRenderMessage
|
|
125
132
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-ODEHR7KI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/messages/LegacyRenderMessage.tsx"],"sourcesContent":["import React from \"react\";\nimport { RenderMessageProps } from \"../props\";\nimport { RenderMessage as DefaultRenderMessage } from \"./RenderMessage\";\nimport { aguiToGQL } from \"@copilotkit/runtime-client-gql\";\n\n/**\n * Legacy message render props interface for backwards compatibility\n */\nexport interface LegacyRenderProps {\n RenderTextMessage?: React.ComponentType<RenderMessageProps>;\n RenderActionExecutionMessage?: React.ComponentType<RenderMessageProps>;\n RenderAgentStateMessage?: React.ComponentType<RenderMessageProps>;\n RenderResultMessage?: React.ComponentType<RenderMessageProps>;\n RenderImageMessage?: React.ComponentType<RenderMessageProps>;\n}\n\n/**\n * Props for the LegacyRenderMessage component\n */\nexport interface LegacyRenderMessageProps extends RenderMessageProps {\n legacyProps: LegacyRenderProps;\n}\n\n/**\n * Legacy message adapter component that maps old render props to new message types.\n * This component provides backwards compatibility for the deprecated render props.\n */\nexport const LegacyRenderMessage: React.FC<LegacyRenderMessageProps> = ({\n message,\n messages,\n inProgress,\n index,\n isCurrentMessage,\n actionResult,\n AssistantMessage,\n UserMessage,\n ImageRenderer,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n markdownTagRenderers,\n legacyProps,\n}) => {\n const {\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n } = legacyProps;\n\n const deprecatedMessage = aguiToGQL(message)[0] ?? undefined;\n\n // Route to appropriate legacy renderer based on message type\n if (deprecatedMessage.isTextMessage() && RenderTextMessage) {\n return (\n <RenderTextMessage\n message={message}\n messages={messages}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n onRegenerate={onRegenerate}\n onCopy={onCopy}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n markdownTagRenderers={markdownTagRenderers}\n />\n );\n }\n\n if (deprecatedMessage.isActionExecutionMessage() && RenderActionExecutionMessage) {\n return (\n <RenderActionExecutionMessage\n messages={messages}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n actionResult={actionResult}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n />\n );\n }\n\n if (deprecatedMessage.isAgentStateMessage() && RenderAgentStateMessage) {\n return (\n <RenderAgentStateMessage\n messages={messages}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n />\n );\n }\n\n if (deprecatedMessage.isResultMessage() && RenderResultMessage) {\n return (\n <RenderResultMessage\n messages={messages}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n />\n );\n }\n\n if (deprecatedMessage.isImageMessage() && RenderImageMessage) {\n return (\n <RenderImageMessage\n messages={messages}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n />\n );\n }\n\n // Fallback to default RenderMessage for any unhandled cases\n return (\n <DefaultRenderMessage\n messages={messages}\n message={message}\n inProgress={inProgress}\n index={index}\n isCurrentMessage={isCurrentMessage}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n ImageRenderer={ImageRenderer}\n onRegenerate={onRegenerate}\n onCopy={onCopy}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n markdownTagRenderers={markdownTagRenderers}\n />\n );\n};\n"],"mappings":";;;;;AAGA,SAAS,iBAAiB;AAsDpB;AA9BC,IAAM,sBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AA3CN;AA4CE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,qBAAoB,eAAU,OAAO,EAAE,CAAC,MAApB,YAAyB;AAGnD,MAAI,kBAAkB,cAAc,KAAK,mBAAmB;AAC1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,MAAI,kBAAkB,yBAAyB,KAAK,8BAA8B;AAChF,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,MAAI,kBAAkB,oBAAoB,KAAK,yBAAyB;AACtE,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,MAAI,kBAAkB,gBAAgB,KAAK,qBAAqB;AAC9D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,MAAI,kBAAkB,eAAe,KAAK,oBAAoB;AAC5D,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAGA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/hooks/use-copilot-chat-suggestions.tsx
|
|
2
|
+
import {
|
|
3
|
+
useConfigureChatSuggestions
|
|
4
|
+
} from "@copilotkit/react-core";
|
|
5
|
+
function useCopilotChatSuggestions(config, dependencies = []) {
|
|
6
|
+
useConfigureChatSuggestions(config, dependencies);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
useCopilotChatSuggestions
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-OYRZ4VLU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-chat-suggestions.tsx"],"sourcesContent":["/**\n * <Callout type=\"warning\">\n * useCopilotChatSuggestions is experimental. The interface is not final and\n * can change without notice.\n * </Callout>\n *\n * `useCopilotReadable` is a React hook that provides app-state and other information\n * to the Copilot. Optionally, the hook can also handle hierarchical state within your\n * application, passing these parent-child relationships to the Copilot.\n *\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/use-copilot-chat-suggestions/use-copilot-chat-suggestions.gif\" width=\"500\" />\n *\n * ## Usage\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 * ### Simple Usage\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * const [employees, setEmployees] = useState([]);\n *\n * useCopilotChatSuggestions({\n * instructions: `The following employees are on duty: ${JSON.stringify(employees)}`,\n * });\n * }\n * ```\n *\n * ### Dependency Management\n *\n * ```tsx\n * import { useCopilotChatSuggestions } from \"@copilotkit/react-ui\";\n *\n * export function MyComponent() {\n * useCopilotChatSuggestions(\n * {\n * instructions: \"Suggest the most relevant next actions.\",\n * },\n * [appState],\n * );\n * }\n * ```\n *\n * In the example above, the suggestions are generated based on the given instructions.\n * The hook monitors `appState`, and updates suggestions accordingly whenever it changes.\n *\n * ### Behavior and Lifecycle\n *\n * The hook registers the configuration with the chat context upon component mount and\n * removes it on unmount, ensuring a clean and efficient lifecycle management.\n */\nimport {\n useConfigureChatSuggestions,\n type UseCopilotChatSuggestionsConfiguration,\n} from \"@copilotkit/react-core\";\n\nexport function useCopilotChatSuggestions(\n config: UseCopilotChatSuggestionsConfiguration,\n dependencies: any[] = [],\n) {\n useConfigureChatSuggestions(config, dependencies);\n}\n"],"mappings":";AA4DA;AAAA,EACE;AAAA,OAEK;AAEA,SAAS,0BACd,QACA,eAAsB,CAAC,GACvB;AACA,8BAA4B,QAAQ,YAAY;AAClD;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Suggestion
|
|
3
|
+
} from "./chunk-NGJ32FAP.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/chat/Suggestions.tsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function Suggestions({
|
|
8
|
+
suggestions,
|
|
9
|
+
onSuggestionClick,
|
|
10
|
+
isLoading
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: "suggestions", children: suggestions.map((suggestion, index) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Suggestion,
|
|
16
|
+
{
|
|
17
|
+
title: suggestion.title,
|
|
18
|
+
message: suggestion.message,
|
|
19
|
+
partial: (_b = (_a = suggestion.isLoading) != null ? _a : suggestion.partial) != null ? _b : isLoading,
|
|
20
|
+
className: suggestion.className,
|
|
21
|
+
onClick: () => onSuggestionClick(suggestion.message)
|
|
22
|
+
},
|
|
23
|
+
index
|
|
24
|
+
);
|
|
25
|
+
}) });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
Suggestions
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-QB3GUN2N.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chat/Suggestions.tsx"],"sourcesContent":["import { Suggestion } from \"./Suggestion\";\nimport { RenderSuggestionsListProps } from \"./props\";\n\nexport function Suggestions({\n suggestions,\n onSuggestionClick,\n isLoading,\n}: RenderSuggestionsListProps) {\n return (\n <div className=\"suggestions\">\n {suggestions.map((suggestion, index) => (\n <Suggestion\n key={index}\n title={suggestion.title}\n message={suggestion.message}\n partial={suggestion.isLoading ?? suggestion.partial ?? isLoading}\n className={suggestion.className}\n onClick={() => onSuggestionClick(suggestion.message)}\n />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAWQ;AARD,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAC7B,SACE,oBAAC,SAAI,WAAU,eACZ,sBAAY,IAAI,CAAC,YAAY,UAAO;AAV3C;AAWQ;AAAA,MAAC;AAAA;AAAA,QAEC,OAAO,WAAW;AAAA,QAClB,SAAS,WAAW;AAAA,QACpB,UAAS,sBAAW,cAAX,YAAwB,WAAW,YAAnC,YAA8C;AAAA,QACvD,WAAW,WAAW;AAAA,QACtB,SAAS,MAAM,kBAAkB,WAAW,OAAO;AAAA;AAAA,MAL9C;AAAA,IAMP;AAAA,GACD,GACH;AAEJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JYVJHL5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__spreadProps,
|
|
6
6
|
__spreadValues
|
|
@@ -27,4 +27,4 @@ function CopilotSidebar(props) {
|
|
|
27
27
|
export {
|
|
28
28
|
CopilotSidebar
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-SOB5EIL7.mjs.map
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
import * as _copilotkit_react_core_dist_types_coagent_state from '@copilotkit/react-core/dist/types/coagent-state';
|
|
2
|
-
import * as _copilotkit_react_core_dist_hooks_use_tree from '@copilotkit/react-core/dist/hooks/use-tree';
|
|
3
|
-
import * as _copilotkit_shared from '@copilotkit/shared';
|
|
4
|
-
import { Message, CopilotErrorHandler, CopilotKitError } from '@copilotkit/shared';
|
|
5
|
-
import * as _copilotkit_react_core_dist_copilot_context_cf9de848 from '@copilotkit/react-core/dist/copilot-context-cf9de848';
|
|
6
|
-
import * as _copilotkit_react_core_dist_types_coagent_action from '@copilotkit/react-core/dist/types/coagent-action';
|
|
7
|
-
import * as _copilotkit_react_core from '@copilotkit/react-core';
|
|
8
|
-
import { SuggestionItem, SystemMessageFunction, HintFunction } from '@copilotkit/react-core';
|
|
9
|
-
import * as _copilotkit_runtime_client_gql from '@copilotkit/runtime-client-gql';
|
|
10
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
2
|
import { CopilotChatIcons, CopilotChatLabels } from './ChatContext.js';
|
|
12
3
|
import React__default from 'react';
|
|
4
|
+
import { ChatSuggestions, SystemMessageFunction, HintFunction } from '@copilotkit/react-core';
|
|
5
|
+
import { Message, CopilotErrorHandler } from '@copilotkit/shared';
|
|
13
6
|
import { ComponentsMap, AssistantMessageProps, UserMessageProps, ErrorMessageProps, MessagesProps, RenderMessageProps, RenderSuggestionsListProps, InputProps, ImageRendererProps, CopilotObservabilityHooks } from './props.js';
|
|
14
7
|
import '../../types/suggestions.js';
|
|
15
8
|
|
|
16
|
-
/**
|
|
17
|
-
* The type of suggestions to use in the chat.
|
|
18
|
-
*
|
|
19
|
-
* `auto` - Suggestions are generated automatically.
|
|
20
|
-
* `manual` - Suggestions are controlled programmatically.
|
|
21
|
-
* `SuggestionItem[]` - Static suggestions array.
|
|
22
|
-
*/
|
|
23
|
-
type ChatSuggestions = "auto" | "manual" | SuggestionItem[];
|
|
24
9
|
/**
|
|
25
10
|
* Props for CopilotChat component.
|
|
26
11
|
*/
|
|
@@ -257,85 +242,5 @@ declare function WrappedCopilotChat({ children, icons, labels, className, }: {
|
|
|
257
242
|
labels?: CopilotChatLabels;
|
|
258
243
|
className?: string;
|
|
259
244
|
}): react_jsx_runtime.JSX.Element;
|
|
260
|
-
declare const useCopilotChatLogic: (chatSuggestions: ChatSuggestions, makeSystemMessage?: SystemMessageFunction, disableSystemMessage?: boolean, onInProgress?: (isLoading: boolean) => void, onSubmitMessage?: (messageContent: string) => Promise<void> | void, onStopGeneration?: OnStopGeneration, onReloadMessages?: OnReloadMessages) => {
|
|
261
|
-
messages: Message[];
|
|
262
|
-
isLoading: boolean;
|
|
263
|
-
suggestions: SuggestionItem[];
|
|
264
|
-
sendMessage: (messageContent: string, imagesToUse?: Array<{
|
|
265
|
-
contentType: string;
|
|
266
|
-
bytes: string;
|
|
267
|
-
}>) => Promise<Message>;
|
|
268
|
-
stopGeneration: () => void;
|
|
269
|
-
reloadMessages: (messageId: string) => void;
|
|
270
|
-
resetSuggestions: () => void;
|
|
271
|
-
context: {
|
|
272
|
-
messages: _copilotkit_runtime_client_gql.Message[];
|
|
273
|
-
setMessages: React__default.Dispatch<React__default.SetStateAction<_copilotkit_runtime_client_gql.Message[]>>;
|
|
274
|
-
suggestions: SuggestionItem[];
|
|
275
|
-
setSuggestions: React__default.Dispatch<React__default.SetStateAction<SuggestionItem[]>>;
|
|
276
|
-
actions: Record<string, _copilotkit_react_core.FrontendAction<any>>;
|
|
277
|
-
setAction: (id: string, action: _copilotkit_react_core.FrontendAction<any>) => void;
|
|
278
|
-
removeAction: (id: string) => void;
|
|
279
|
-
coAgentStateRenders: Record<string, _copilotkit_react_core_dist_types_coagent_action.CoAgentStateRender<any>>;
|
|
280
|
-
setCoAgentStateRender: (id: string, stateRender: _copilotkit_react_core_dist_types_coagent_action.CoAgentStateRender<any>) => void;
|
|
281
|
-
removeCoAgentStateRender: (id: string) => void;
|
|
282
|
-
chatComponentsCache: React__default.RefObject<_copilotkit_react_core_dist_copilot_context_cf9de848.j>;
|
|
283
|
-
getFunctionCallHandler: (customEntryPoints?: Record<string, _copilotkit_react_core.FrontendAction<any>>) => _copilotkit_shared.FunctionCallHandler;
|
|
284
|
-
addContext: (context: string, parentId?: string, categories?: string[]) => _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId;
|
|
285
|
-
removeContext: (id: _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId) => void;
|
|
286
|
-
getAllContext: () => _copilotkit_react_core.Tree;
|
|
287
|
-
getContextString: (documents: _copilotkit_react_core.DocumentPointer[], categories: string[]) => string;
|
|
288
|
-
addDocumentContext: (documentPointer: _copilotkit_react_core.DocumentPointer, categories?: string[]) => _copilotkit_react_core_dist_hooks_use_tree.TreeNodeId;
|
|
289
|
-
removeDocumentContext: (documentId: string) => void;
|
|
290
|
-
getDocumentsContext: (categories: string[]) => _copilotkit_react_core.DocumentPointer[];
|
|
291
|
-
isLoading: boolean;
|
|
292
|
-
setIsLoading: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
293
|
-
chatSuggestionConfiguration: {
|
|
294
|
-
[key: string]: _copilotkit_react_core.CopilotChatSuggestionConfiguration;
|
|
295
|
-
};
|
|
296
|
-
addChatSuggestionConfiguration: (id: string, suggestion: _copilotkit_react_core.CopilotChatSuggestionConfiguration) => void;
|
|
297
|
-
removeChatSuggestionConfiguration: (id: string) => void;
|
|
298
|
-
chatInstructions: string;
|
|
299
|
-
setChatInstructions: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
300
|
-
additionalInstructions?: string[];
|
|
301
|
-
setAdditionalInstructions: React__default.Dispatch<React__default.SetStateAction<string[]>>;
|
|
302
|
-
copilotApiConfig: _copilotkit_react_core.CopilotApiConfig;
|
|
303
|
-
showDevConsole: boolean;
|
|
304
|
-
coagentStates: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>;
|
|
305
|
-
setCoagentStates: React__default.Dispatch<React__default.SetStateAction<Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>>>;
|
|
306
|
-
coagentStatesRef: React__default.RefObject<Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>>;
|
|
307
|
-
setCoagentStatesWithRef: (value: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState> | ((prev: Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>) => Record<string, _copilotkit_react_core_dist_types_coagent_state.CoagentState>)) => void;
|
|
308
|
-
agentSession: _copilotkit_react_core_dist_copilot_context_cf9de848.A | null;
|
|
309
|
-
setAgentSession: React__default.Dispatch<React__default.SetStateAction<_copilotkit_react_core_dist_copilot_context_cf9de848.A | null>>;
|
|
310
|
-
agentLock: string | null;
|
|
311
|
-
threadId: string;
|
|
312
|
-
setThreadId: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
313
|
-
runId: string | null;
|
|
314
|
-
setRunId: React__default.Dispatch<React__default.SetStateAction<string | null>>;
|
|
315
|
-
chatAbortControllerRef: React__default.MutableRefObject<AbortController | null>;
|
|
316
|
-
runtimeClient: _copilotkit_runtime_client_gql.CopilotRuntimeClient;
|
|
317
|
-
forwardedParameters?: Partial<Pick<_copilotkit_runtime_client_gql.ForwardedParametersInput, "temperature">>;
|
|
318
|
-
availableAgents: _copilotkit_runtime_client_gql.Agent[];
|
|
319
|
-
authStates_c?: Record<_copilotkit_react_core_dist_copilot_context_cf9de848.k, _copilotkit_react_core_dist_copilot_context_cf9de848.f>;
|
|
320
|
-
setAuthStates_c?: React__default.Dispatch<React__default.SetStateAction<Record<_copilotkit_react_core_dist_copilot_context_cf9de848.k, _copilotkit_react_core_dist_copilot_context_cf9de848.f>>>;
|
|
321
|
-
authConfig_c?: {
|
|
322
|
-
SignInComponent: React__default.ComponentType<{
|
|
323
|
-
onSignInComplete: (authState: _copilotkit_react_core_dist_copilot_context_cf9de848.f) => void;
|
|
324
|
-
}>;
|
|
325
|
-
};
|
|
326
|
-
extensions: _copilotkit_runtime_client_gql.ExtensionsInput;
|
|
327
|
-
setExtensions: React__default.Dispatch<React__default.SetStateAction<_copilotkit_runtime_client_gql.ExtensionsInput>>;
|
|
328
|
-
langGraphInterruptAction: _copilotkit_react_core_dist_copilot_context_cf9de848.L | null;
|
|
329
|
-
setLangGraphInterruptAction: _copilotkit_react_core_dist_copilot_context_cf9de848.d;
|
|
330
|
-
removeLangGraphInterruptAction: (threadId: string) => void;
|
|
331
|
-
onError: CopilotErrorHandler;
|
|
332
|
-
bannerError: CopilotKitError | null;
|
|
333
|
-
setBannerError: React__default.Dispatch<React__default.SetStateAction<CopilotKitError | null>>;
|
|
334
|
-
internalErrorHandlers: Record<string, CopilotErrorHandler>;
|
|
335
|
-
setInternalErrorHandler: (handler: Record<string, CopilotErrorHandler>) => void;
|
|
336
|
-
removeInternalErrorHandler: (id: string) => void;
|
|
337
|
-
};
|
|
338
|
-
actions: Record<string, _copilotkit_react_core.FrontendAction<any>>;
|
|
339
|
-
};
|
|
340
245
|
|
|
341
|
-
export {
|
|
246
|
+
export { CopilotChat, CopilotChatProps, ImageUpload, OnReloadMessages, OnReloadMessagesArguments, OnStopGeneration, WrappedCopilotChat };
|