@copilotkit/react-ui 1.10.4-next.2 → 1.10.4
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 +23 -0
- package/dist/{chunk-KCRWXHWT.mjs → chunk-DII7M2HW.mjs} +2 -2
- package/dist/{chunk-FJFWH5AF.mjs → chunk-GKIR7J5D.mjs} +7 -7
- package/dist/{chunk-PHH6DYUW.mjs → chunk-NGA4T3VT.mjs} +3 -3
- package/dist/chunk-NGA4T3VT.mjs.map +1 -0
- package/dist/{chunk-Z66Y3KRE.mjs → chunk-NJY6RHHQ.mjs} +8 -11
- package/dist/chunk-NJY6RHHQ.mjs.map +1 -0
- package/dist/{chunk-YO63WHVQ.mjs → chunk-SP2PFXCH.mjs} +2 -2
- package/dist/{chunk-QQDCZRPA.mjs → chunk-TNN2ZGO6.mjs} +2 -2
- package/dist/{chunk-GDSZGYCE.mjs → chunk-V6DDX4LH.mjs} +2 -2
- package/dist/{chunk-FFJHOZX6.mjs → chunk-WBPBTTQD.mjs} +4 -4
- package/dist/{chunk-LJAYSRCB.mjs → chunk-WRQST6DJ.mjs} +4 -4
- package/dist/components/chat/Chat.js +47 -99
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +5 -6
- package/dist/components/chat/Header.mjs +4 -4
- package/dist/components/chat/Messages.js +1 -1
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +4 -4
- package/dist/components/chat/Modal.js +61 -113
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +10 -11
- package/dist/components/chat/Popup.js +63 -115
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +11 -12
- package/dist/components/chat/Sidebar.js +65 -117
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +11 -12
- package/dist/components/chat/index.js +67 -119
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +14 -15
- package/dist/components/chat/messages/ErrorMessage.mjs +57 -4
- package/dist/components/chat/messages/ErrorMessage.mjs.map +1 -1
- package/dist/components/chat/messages/LegacyRenderMessage.mjs +3 -3
- package/dist/components/chat/messages/RenderMessage.mjs +2 -2
- package/dist/components/chat/props.d.ts +1 -1
- package/dist/components/chat/props.js.map +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.mjs +4 -4
- package/dist/components/index.js +67 -119
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +15 -16
- package/dist/index.js +69 -121
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -16
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +1 -2
- package/src/components/chat/Messages.tsx +1 -1
- package/src/components/chat/props.ts +1 -1
- package/dist/chunk-PHH6DYUW.mjs.map +0 -1
- package/dist/chunk-SRY5COHG.mjs +0 -63
- package/dist/chunk-SRY5COHG.mjs.map +0 -1
- package/dist/chunk-Z66Y3KRE.mjs.map +0 -1
- /package/dist/{chunk-KCRWXHWT.mjs.map → chunk-DII7M2HW.mjs.map} +0 -0
- /package/dist/{chunk-FJFWH5AF.mjs.map → chunk-GKIR7J5D.mjs.map} +0 -0
- /package/dist/{chunk-YO63WHVQ.mjs.map → chunk-SP2PFXCH.mjs.map} +0 -0
- /package/dist/{chunk-QQDCZRPA.mjs.map → chunk-TNN2ZGO6.mjs.map} +0 -0
- /package/dist/{chunk-GDSZGYCE.mjs.map → chunk-V6DDX4LH.mjs.map} +0 -0
- /package/dist/{chunk-FFJHOZX6.mjs.map → chunk-WBPBTTQD.mjs.map} +0 -0
- /package/dist/{chunk-LJAYSRCB.mjs.map → chunk-WRQST6DJ.mjs.map} +0 -0
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import "../../chunk-SC6JRFAJ.mjs";
|
|
2
2
|
import {
|
|
3
3
|
CopilotSidebar
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-DII7M2HW.mjs";
|
|
5
5
|
import "../../chunk-WB3YULQ4.mjs";
|
|
6
6
|
import {
|
|
7
7
|
CopilotPopup
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-TNN2ZGO6.mjs";
|
|
9
|
+
import "../../chunk-GKIR7J5D.mjs";
|
|
10
10
|
import "../../chunk-C3GSYRC3.mjs";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-V6DDX4LH.mjs";
|
|
12
12
|
import "../../chunk-V7W6IM2V.mjs";
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-Q5V6S67N.mjs";
|
|
15
|
-
import "../../chunk-JY2CSDKN.mjs";
|
|
13
|
+
import "../../chunk-WBPBTTQD.mjs";
|
|
16
14
|
import "../../chunk-KXE2JCUH.mjs";
|
|
17
15
|
import "../../chunk-NRA3CFEE.mjs";
|
|
18
16
|
import "../../chunk-BH6PCAAL.mjs";
|
|
17
|
+
import "../../chunk-Q5V6S67N.mjs";
|
|
18
|
+
import "../../chunk-JY2CSDKN.mjs";
|
|
19
19
|
import "../../chunk-UFN2VWSR.mjs";
|
|
20
20
|
import {
|
|
21
21
|
CopilotChat
|
|
22
|
-
} from "../../chunk-
|
|
23
|
-
import "../../chunk-SRY5COHG.mjs";
|
|
22
|
+
} from "../../chunk-NJY6RHHQ.mjs";
|
|
24
23
|
import {
|
|
25
24
|
Suggestions
|
|
26
25
|
} from "../../chunk-226ZMOE3.mjs";
|
|
@@ -31,18 +30,18 @@ import "../../chunk-PLHTVHUW.mjs";
|
|
|
31
30
|
import "../../chunk-DTRPPNSA.mjs";
|
|
32
31
|
import "../../chunk-CGEAG65D.mjs";
|
|
33
32
|
import "../../chunk-QIOJXTIQ.mjs";
|
|
34
|
-
import "../../chunk-
|
|
35
|
-
import "../../chunk-
|
|
36
|
-
import "../../chunk-
|
|
33
|
+
import "../../chunk-NGA4T3VT.mjs";
|
|
34
|
+
import "../../chunk-SP2PFXCH.mjs";
|
|
35
|
+
import "../../chunk-WRQST6DJ.mjs";
|
|
36
|
+
import {
|
|
37
|
+
UserMessage
|
|
38
|
+
} from "../../chunk-VVL6JFCJ.mjs";
|
|
37
39
|
import {
|
|
38
40
|
AssistantMessage
|
|
39
41
|
} from "../../chunk-X477GDGZ.mjs";
|
|
40
42
|
import {
|
|
41
43
|
ImageRenderer
|
|
42
44
|
} from "../../chunk-DBKRAOH7.mjs";
|
|
43
|
-
import {
|
|
44
|
-
UserMessage
|
|
45
|
-
} from "../../chunk-VVL6JFCJ.mjs";
|
|
46
45
|
import {
|
|
47
46
|
Markdown
|
|
48
47
|
} from "../../chunk-SNFHUE5S.mjs";
|
|
@@ -1,12 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
Markdown
|
|
3
|
+
} from "../../../chunk-SNFHUE5S.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useChatContext
|
|
6
|
+
} from "../../../chunk-IEMQ2SQW.mjs";
|
|
6
7
|
import "../../../chunk-B5IFB5YJ.mjs";
|
|
7
8
|
import "../../../chunk-XWG3L6QC.mjs";
|
|
8
9
|
import "../../../chunk-54JAUBUJ.mjs";
|
|
9
10
|
import "../../../chunk-MRXNTQOX.mjs";
|
|
11
|
+
|
|
12
|
+
// src/components/chat/messages/ErrorMessage.tsx
|
|
13
|
+
import { useState } from "react";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var ErrorMessage = (props) => {
|
|
16
|
+
const { icons, labels } = useChatContext();
|
|
17
|
+
const { error, onRegenerate, onCopy, isCurrentMessage } = props;
|
|
18
|
+
const [copied, setCopied] = useState(false);
|
|
19
|
+
const handleCopy = () => {
|
|
20
|
+
const content = error.message;
|
|
21
|
+
if (content && onCopy) {
|
|
22
|
+
navigator.clipboard.writeText(content);
|
|
23
|
+
setCopied(true);
|
|
24
|
+
onCopy(content);
|
|
25
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
26
|
+
} else if (content) {
|
|
27
|
+
navigator.clipboard.writeText(content);
|
|
28
|
+
setCopied(true);
|
|
29
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const handleRegenerate = () => {
|
|
33
|
+
if (onRegenerate)
|
|
34
|
+
onRegenerate();
|
|
35
|
+
};
|
|
36
|
+
console.log(error);
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: "copilotKitMessage copilotKitAssistantMessage", children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Markdown, { content: error.message }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: `copilotKitMessageControls ${isCurrentMessage ? "currentMessage" : ""}`, children: [
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
className: "copilotKitMessageControlButton",
|
|
44
|
+
onClick: handleRegenerate,
|
|
45
|
+
"aria-label": labels.regenerateResponse,
|
|
46
|
+
title: labels.regenerateResponse,
|
|
47
|
+
children: icons.regenerateIcon
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
className: "copilotKitMessageControlButton",
|
|
54
|
+
onClick: handleCopy,
|
|
55
|
+
"aria-label": labels.copyToClipboard,
|
|
56
|
+
title: labels.copyToClipboard,
|
|
57
|
+
children: copied ? /* @__PURE__ */ jsx("span", { style: { fontSize: "10px", fontWeight: "bold" }, children: "\u2713" }) : icons.copyIcon
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] })
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
10
63
|
export {
|
|
11
64
|
ErrorMessage
|
|
12
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/chat/messages/ErrorMessage.tsx"],"sourcesContent":["import { ErrorMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { Markdown } from \"../Markdown\";\nimport { useState } from \"react\";\n\nexport const ErrorMessage = (props: ErrorMessageProps) => {\n const { icons, labels } = useChatContext();\n const { error, onRegenerate, onCopy, isCurrentMessage } = props;\n const [copied, setCopied] = useState(false);\n\n const handleCopy = () => {\n const content = error.message;\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 console.log(error);\n\n return (\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n <Markdown content={error.message} />\n\n <div className={`copilotKitMessageControls ${isCurrentMessage ? \"currentMessage\" : \"\"}`}>\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 </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,gBAAgB;AA6BnB,cAEA,YAFA;AA3BC,IAAM,eAAe,CAAC,UAA6B;AACxD,QAAM,EAAE,OAAO,OAAO,IAAI,eAAe;AACzC,QAAM,EAAE,OAAO,cAAc,QAAQ,iBAAiB,IAAI;AAC1D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,aAAa,MAAM;AACvB,UAAM,UAAU,MAAM;AACtB,QAAI,WAAW,QAAQ;AACrB,gBAAU,UAAU,UAAU,OAAO;AACrC,gBAAU,IAAI;AACd,aAAO,OAAO;AACd,iBAAW,MAAM,UAAU,KAAK,GAAG,GAAI;AAAA,IACzC,WAAW,SAAS;AAClB,gBAAU,UAAU,UAAU,OAAO;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,UAAQ,IAAI,KAAK;AAEjB,SACE,qBAAC,SAAI,WAAU,gDACb;AAAA,wBAAC,YAAS,SAAS,MAAM,SAAS;AAAA,IAElC,qBAAC,SAAI,WAAW,6BAA6B,mBAAmB,mBAAmB,MACjF;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAS;AAAA,UACT,cAAY,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UAEb,gBAAM;AAAA;AAAA,MACT;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAS;AAAA,UACT,cAAY,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UAEb,mBACC,oBAAC,UAAK,OAAO,EAAE,UAAU,QAAQ,YAAY,OAAO,GAAG,oBAAC,IAExD,MAAM;AAAA;AAAA,MAEV;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LegacyRenderMessage
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
3
|
+
} from "../../../chunk-SP2PFXCH.mjs";
|
|
4
|
+
import "../../../chunk-WRQST6DJ.mjs";
|
|
5
|
+
import "../../../chunk-VVL6JFCJ.mjs";
|
|
5
6
|
import "../../../chunk-X477GDGZ.mjs";
|
|
6
7
|
import "../../../chunk-DBKRAOH7.mjs";
|
|
7
|
-
import "../../../chunk-VVL6JFCJ.mjs";
|
|
8
8
|
import "../../../chunk-SNFHUE5S.mjs";
|
|
9
9
|
import "../../../chunk-IEMQ2SQW.mjs";
|
|
10
10
|
import "../../../chunk-B5IFB5YJ.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RenderMessage
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-WRQST6DJ.mjs";
|
|
4
|
+
import "../../../chunk-VVL6JFCJ.mjs";
|
|
4
5
|
import "../../../chunk-X477GDGZ.mjs";
|
|
5
6
|
import "../../../chunk-DBKRAOH7.mjs";
|
|
6
|
-
import "../../../chunk-VVL6JFCJ.mjs";
|
|
7
7
|
import "../../../chunk-SNFHUE5S.mjs";
|
|
8
8
|
import "../../../chunk-IEMQ2SQW.mjs";
|
|
9
9
|
import "../../../chunk-B5IFB5YJ.mjs";
|
|
@@ -74,7 +74,7 @@ interface MessagesProps {
|
|
|
74
74
|
chatError?: ChatError | null;
|
|
75
75
|
AssistantMessage: React.ComponentType<AssistantMessageProps>;
|
|
76
76
|
UserMessage: React.ComponentType<UserMessageProps>;
|
|
77
|
-
ErrorMessage
|
|
77
|
+
ErrorMessage?: React.ComponentType<ErrorMessageProps>;
|
|
78
78
|
RenderMessage: React.ComponentType<RenderMessageProps>;
|
|
79
79
|
ImageRenderer: React.ComponentType<ImageRendererProps>;
|
|
80
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/chat/props.ts"],"sourcesContent":["import { AIMessage, Message, UserMessage, CopilotErrorEvent } from \"@copilotkit/shared\";\nimport { CopilotChatSuggestion } from \"../../types/suggestions\";\nimport { ReactNode } from \"react\";\nimport { ImageData } from \"@copilotkit/shared\";\n\n/**\n * Event hooks for CopilotKit chat events.\n * These hooks only work when publicApiKey is provided.\n */\nexport interface CopilotObservabilityHooks {\n /**\n * Called when a message is sent by the user\n */\n onMessageSent?: (message: string) => void;\n\n /**\n * Called when the chat is minimized/closed\n */\n onChatMinimized?: () => void;\n\n /**\n * Called when the chat is expanded/opened\n */\n onChatExpanded?: () => void;\n\n /**\n * Called when a message is regenerated\n */\n onMessageRegenerated?: (messageId: string) => void;\n\n /**\n * Called when a message is copied\n */\n onMessageCopied?: (content: string) => void;\n\n /**\n * Called when feedback is given (thumbs up/down)\n */\n onFeedbackGiven?: (messageId: string, type: \"thumbsUp\" | \"thumbsDown\") => void;\n\n /**\n * Called when chat generation starts\n */\n onChatStarted?: () => void;\n\n /**\n * Called when chat generation stops\n */\n onChatStopped?: () => void;\n\n /**\n * Called when an error occurs in the chat\n * This enables chat-specific error handling UX while preserving system-wide error monitoring\n */\n onError?: (errorEvent: CopilotErrorEvent) => void;\n}\n\nexport interface ButtonProps {}\n\nexport interface WindowProps {\n clickOutsideToClose: boolean;\n hitEscapeToClose: boolean;\n shortcut: string;\n children?: React.ReactNode;\n}\n\nexport interface HeaderProps {}\n\nexport interface SuggestionsProps {\n title: string;\n message: string;\n partial?: boolean;\n className?: string;\n onClick: (message: string) => void;\n}\n\nexport type ComponentsMap<T extends Record<string, object> = Record<string, object>> = {\n [K in keyof T]: React.FC<{ children?: ReactNode } & T[K]>;\n};\n\nexport interface MessagesProps {\n messages: Message[];\n inProgress: boolean;\n children?: React.ReactNode;\n chatError?: ChatError | null;\n AssistantMessage: React.ComponentType<AssistantMessageProps>;\n UserMessage: React.ComponentType<UserMessageProps>;\n ErrorMessage
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat/props.ts"],"sourcesContent":["import { AIMessage, Message, UserMessage, CopilotErrorEvent } from \"@copilotkit/shared\";\nimport { CopilotChatSuggestion } from \"../../types/suggestions\";\nimport { ReactNode } from \"react\";\nimport { ImageData } from \"@copilotkit/shared\";\n\n/**\n * Event hooks for CopilotKit chat events.\n * These hooks only work when publicApiKey is provided.\n */\nexport interface CopilotObservabilityHooks {\n /**\n * Called when a message is sent by the user\n */\n onMessageSent?: (message: string) => void;\n\n /**\n * Called when the chat is minimized/closed\n */\n onChatMinimized?: () => void;\n\n /**\n * Called when the chat is expanded/opened\n */\n onChatExpanded?: () => void;\n\n /**\n * Called when a message is regenerated\n */\n onMessageRegenerated?: (messageId: string) => void;\n\n /**\n * Called when a message is copied\n */\n onMessageCopied?: (content: string) => void;\n\n /**\n * Called when feedback is given (thumbs up/down)\n */\n onFeedbackGiven?: (messageId: string, type: \"thumbsUp\" | \"thumbsDown\") => void;\n\n /**\n * Called when chat generation starts\n */\n onChatStarted?: () => void;\n\n /**\n * Called when chat generation stops\n */\n onChatStopped?: () => void;\n\n /**\n * Called when an error occurs in the chat\n * This enables chat-specific error handling UX while preserving system-wide error monitoring\n */\n onError?: (errorEvent: CopilotErrorEvent) => void;\n}\n\nexport interface ButtonProps {}\n\nexport interface WindowProps {\n clickOutsideToClose: boolean;\n hitEscapeToClose: boolean;\n shortcut: string;\n children?: React.ReactNode;\n}\n\nexport interface HeaderProps {}\n\nexport interface SuggestionsProps {\n title: string;\n message: string;\n partial?: boolean;\n className?: string;\n onClick: (message: string) => void;\n}\n\nexport type ComponentsMap<T extends Record<string, object> = Record<string, object>> = {\n [K in keyof T]: React.FC<{ children?: ReactNode } & T[K]>;\n};\n\nexport interface MessagesProps {\n messages: Message[];\n inProgress: boolean;\n children?: React.ReactNode;\n chatError?: ChatError | null;\n AssistantMessage: React.ComponentType<AssistantMessageProps>;\n UserMessage: React.ComponentType<UserMessageProps>;\n ErrorMessage?: React.ComponentType<ErrorMessageProps>;\n RenderMessage: React.ComponentType<RenderMessageProps>;\n ImageRenderer: React.ComponentType<ImageRendererProps>;\n\n /**\n * Callback function to regenerate the assistant's response\n */\n onRegenerate?: (messageId: string) => void;\n\n /**\n * Callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n\n /**\n * Callback function for thumbs up feedback\n */\n onThumbsUp?: (message: Message) => void;\n\n /**\n * Callback function for thumbs down feedback\n */\n onThumbsDown?: (message: Message) => void;\n\n /**\n * A list of markdown components to render in assistant message.\n * Useful when you want to render custom elements in the message (e.g a reference tag element)\n */\n markdownTagRenderers?: ComponentsMap;\n\n /**\n * @deprecated Use RenderMessage instead\n */\n RenderTextMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * @deprecated Use RenderMessage instead\n */\n RenderActionExecutionMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * @deprecated Use RenderMessage instead\n */\n RenderAgentStateMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * @deprecated Use RenderMessage instead\n */\n RenderResultMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * @deprecated Use RenderMessage instead\n */\n RenderImageMessage?: React.ComponentType<RenderMessageProps>;\n}\n\nexport interface Renderer {\n content: string;\n}\n\nexport interface UserMessageProps {\n message?: UserMessage;\n ImageRenderer: React.ComponentType<ImageRendererProps>;\n\n /**\n * @deprecated use message instead\n *\n * The raw data from the assistant's response\n */\n rawData: any;\n}\n\nexport interface AssistantMessageProps {\n /**\n * The message content from the assistant\n */\n\n message?: AIMessage;\n\n /**\n * Indicates if this is the last message\n */\n isCurrentMessage?: boolean;\n\n /**\n * Whether a response is loading, this is when the LLM is thinking of a response but hasn't finished yet.\n */\n isLoading: boolean;\n\n /**\n * Whether a response is generating, this is when the LLM is actively generating and streaming content.\n */\n isGenerating: boolean;\n\n /**\n * Callback function to regenerate the assistant's response\n */\n onRegenerate?: () => void;\n\n /**\n * Callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n\n /**\n * Callback function for thumbs up feedback\n */\n onThumbsUp?: (message: Message) => void;\n\n /**\n * Callback function for thumbs down feedback\n */\n onThumbsDown?: (message: Message) => void;\n\n /**\n * A list of markdown components to render in assistant message.\n * Useful when you want to render custom elements in the message (e.g a reference tag element)\n */\n markdownTagRenderers?: ComponentsMap;\n\n /**\n * A custom image rendering component to use instead of the default.\n */\n ImageRenderer?: React.ComponentType<ImageRendererProps>;\n\n /**\n * @deprecated use message instead\n *\n * The raw data from the assistant's response\n */\n rawData: any;\n\n /**\n *\n * @deprecated\n *\n * use `message.generativeUI()` instead.\n *\n * For example:\n *\n * ```tsx\n * const CustomAssistantMessage = ({ message }: AssistantMessageProps) => {\n * const subComponent = message?.generativeUI?.();\n * return <div>{subComponent}</div>;\n * };\n *\n * ```\n */\n subComponent?: React.JSX.Element;\n}\n\nexport interface ErrorMessageProps {\n /**\n * The message content from the assistant\n */\n\n error: ChatError;\n\n /**\n * Indicates if this is the last message\n */\n isCurrentMessage?: boolean;\n\n /**\n * Callback function to regenerate the assistant's response\n */\n onRegenerate?: () => void;\n\n /**\n * Callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n}\n\nexport interface RenderMessageProps {\n message: Message;\n inProgress: boolean;\n index: number;\n isCurrentMessage: boolean;\n actionResult?: string;\n AssistantMessage?: React.ComponentType<AssistantMessageProps>;\n UserMessage?: React.ComponentType<UserMessageProps>;\n ImageRenderer?: React.ComponentType<ImageRendererProps>;\n\n /**\n * Callback function to regenerate the assistant's response\n */\n onRegenerate?: (messageId: string) => void;\n\n /**\n * Callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n\n /**\n * Callback function for thumbs up feedback\n */\n onThumbsUp?: (message: Message) => void;\n\n /**\n * Callback function for thumbs down feedback\n */\n onThumbsDown?: (message: Message) => void;\n\n /**\n * A list of markdown components to render in assistant message.\n * Useful when you want to render custom elements in the message (e.g a reference tag element)\n */\n markdownTagRenderers?: ComponentsMap;\n}\n\nexport interface InputProps {\n inProgress: boolean;\n onSend: (text: string) => Promise<Message>;\n isVisible?: boolean;\n onStop?: () => void;\n onUpload?: () => void;\n hideStopButton?: boolean;\n}\n\nexport interface RenderSuggestionsListProps {\n suggestions: CopilotChatSuggestion[];\n onSuggestionClick: (message: string) => void;\n}\n\nexport interface ImageRendererProps {\n /**\n * The image data containing format and bytes\n */\n image: ImageData;\n\n /**\n * Optional content to display alongside the image\n */\n content?: string;\n\n /**\n * Additional CSS class name for styling\n */\n className?: string;\n}\n\nexport interface ChatError {\n message: string;\n operation?: string;\n timestamp: number;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CopilotDevConsole,
|
|
4
4
|
DebugMenuButton
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-Q5V6S67N.mjs";
|
|
7
|
-
import "../../chunk-JY2CSDKN.mjs";
|
|
5
|
+
} from "../../chunk-WBPBTTQD.mjs";
|
|
8
6
|
import "../../chunk-KXE2JCUH.mjs";
|
|
9
7
|
import "../../chunk-NRA3CFEE.mjs";
|
|
10
8
|
import "../../chunk-BH6PCAAL.mjs";
|
|
9
|
+
import "../../chunk-Q5V6S67N.mjs";
|
|
10
|
+
import "../../chunk-JY2CSDKN.mjs";
|
|
11
11
|
import "../../chunk-XWG3L6QC.mjs";
|
|
12
12
|
import "../../chunk-MRXNTQOX.mjs";
|
|
13
13
|
export {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "../../chunk-V7W6IM2V.mjs";
|
|
2
2
|
import {
|
|
3
3
|
CopilotDevConsole
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-WBPBTTQD.mjs";
|
|
5
|
+
import "../../chunk-KXE2JCUH.mjs";
|
|
6
|
+
import "../../chunk-NRA3CFEE.mjs";
|
|
7
|
+
import "../../chunk-BH6PCAAL.mjs";
|
|
5
8
|
import "../../chunk-Q5V6S67N.mjs";
|
|
6
9
|
import {
|
|
7
10
|
shouldShowDevConsole
|
|
8
11
|
} from "../../chunk-JY2CSDKN.mjs";
|
|
9
|
-
import "../../chunk-KXE2JCUH.mjs";
|
|
10
|
-
import "../../chunk-NRA3CFEE.mjs";
|
|
11
|
-
import "../../chunk-BH6PCAAL.mjs";
|
|
12
12
|
import "../../chunk-XWG3L6QC.mjs";
|
|
13
13
|
import "../../chunk-MRXNTQOX.mjs";
|
|
14
14
|
export {
|