@copilotkit/react-ui 1.51.5-next.0 → 1.51.5-next.2
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/.attw.json +3 -0
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs +2737 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +258 -70
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +781 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +781 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2685 -81
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +2750 -25
- package/dist/index.umd.js.map +1 -1
- package/package.json +19 -18
- package/src/components/chat/Popup.tsx +1 -1
- package/src/components/chat/Sidebar.tsx +1 -1
- package/tsdown.config.ts +58 -0
- package/vitest.config.mjs +11 -0
- package/dist/chunk-2QEDCM6H.mjs +0 -150
- package/dist/chunk-2QEDCM6H.mjs.map +0 -1
- package/dist/chunk-6SMTHXVA.mjs +0 -28
- package/dist/chunk-6SMTHXVA.mjs.map +0 -1
- package/dist/chunk-6TLDRWAD.mjs +0 -95
- package/dist/chunk-6TLDRWAD.mjs.map +0 -1
- package/dist/chunk-72FQQMQ2.mjs +0 -25
- package/dist/chunk-72FQQMQ2.mjs.map +0 -1
- package/dist/chunk-AOUHT4JR.mjs +0 -34
- package/dist/chunk-AOUHT4JR.mjs.map +0 -1
- package/dist/chunk-BNJX66OH.mjs +0 -118
- package/dist/chunk-BNJX66OH.mjs.map +0 -1
- package/dist/chunk-C27LZFA5.mjs +0 -97
- package/dist/chunk-C27LZFA5.mjs.map +0 -1
- package/dist/chunk-C7WM7GM3.mjs +0 -235
- package/dist/chunk-C7WM7GM3.mjs.map +0 -1
- package/dist/chunk-CNIC5HO5.mjs +0 -36
- package/dist/chunk-CNIC5HO5.mjs.map +0 -1
- package/dist/chunk-CQCXH5LY.mjs +0 -143
- package/dist/chunk-CQCXH5LY.mjs.map +0 -1
- package/dist/chunk-DM2V5WTG.mjs +0 -34
- package/dist/chunk-DM2V5WTG.mjs.map +0 -1
- package/dist/chunk-DSHTRV2R.mjs +0 -140
- package/dist/chunk-DSHTRV2R.mjs.map +0 -1
- package/dist/chunk-EACIYBQH.mjs +0 -32
- package/dist/chunk-EACIYBQH.mjs.map +0 -1
- package/dist/chunk-EFZPSZWO.mjs +0 -1
- package/dist/chunk-EFZPSZWO.mjs.map +0 -1
- package/dist/chunk-GBAPANZE.mjs +0 -323
- package/dist/chunk-GBAPANZE.mjs.map +0 -1
- package/dist/chunk-GFE5ZSPV.mjs +0 -112
- package/dist/chunk-GFE5ZSPV.mjs.map +0 -1
- package/dist/chunk-HHLX4MQN.mjs +0 -31
- package/dist/chunk-HHLX4MQN.mjs.map +0 -1
- package/dist/chunk-ICA2EXIX.mjs +0 -187
- package/dist/chunk-ICA2EXIX.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -1
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-IWOCQACI.mjs +0 -73
- package/dist/chunk-IWOCQACI.mjs.map +0 -1
- package/dist/chunk-JGMFJZMG.mjs +0 -11
- package/dist/chunk-JGMFJZMG.mjs.map +0 -1
- package/dist/chunk-JYHRHKV5.mjs +0 -90
- package/dist/chunk-JYHRHKV5.mjs.map +0 -1
- package/dist/chunk-KXE2JCUH.mjs +0 -1
- package/dist/chunk-KXE2JCUH.mjs.map +0 -1
- package/dist/chunk-LIXN3OVQ.mjs +0 -405
- package/dist/chunk-LIXN3OVQ.mjs.map +0 -1
- package/dist/chunk-MC6PY7XH.mjs +0 -456
- package/dist/chunk-MC6PY7XH.mjs.map +0 -1
- package/dist/chunk-MMVDU6DF.mjs +0 -1
- package/dist/chunk-MMVDU6DF.mjs.map +0 -1
- package/dist/chunk-MRXNTQOX.mjs +0 -59
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-OQWEOBRX.mjs +0 -120
- package/dist/chunk-OQWEOBRX.mjs.map +0 -1
- package/dist/chunk-P34CL4LC.mjs +0 -82
- package/dist/chunk-P34CL4LC.mjs.map +0 -1
- package/dist/chunk-PF3QBO7V.mjs +0 -133
- package/dist/chunk-PF3QBO7V.mjs.map +0 -1
- package/dist/chunk-PLHTVHUW.mjs +0 -82
- package/dist/chunk-PLHTVHUW.mjs.map +0 -1
- package/dist/chunk-PP2A5RP6.mjs +0 -21
- package/dist/chunk-PP2A5RP6.mjs.map +0 -1
- package/dist/chunk-Q64GLWPQ.mjs +0 -30
- package/dist/chunk-Q64GLWPQ.mjs.map +0 -1
- package/dist/chunk-SC6JRFAJ.mjs +0 -1
- package/dist/chunk-SC6JRFAJ.mjs.map +0 -1
- package/dist/chunk-T26KLXLH.mjs +0 -1
- package/dist/chunk-T26KLXLH.mjs.map +0 -1
- package/dist/chunk-T4NNQG6T.mjs +0 -231
- package/dist/chunk-T4NNQG6T.mjs.map +0 -1
- package/dist/chunk-TGM5PKBF.mjs +0 -44
- package/dist/chunk-TGM5PKBF.mjs.map +0 -1
- package/dist/chunk-V7W6IM2V.mjs +0 -1
- package/dist/chunk-V7W6IM2V.mjs.map +0 -1
- package/dist/chunk-WB3YULQ4.mjs +0 -1
- package/dist/chunk-WB3YULQ4.mjs.map +0 -1
- package/dist/chunk-Y4FKRAKJ.mjs +0 -12
- package/dist/chunk-Y4FKRAKJ.mjs.map +0 -1
- package/dist/chunk-YDJ4YUUF.mjs +0 -141
- package/dist/chunk-YDJ4YUUF.mjs.map +0 -1
- package/dist/components/chat/Button.d.ts +0 -9
- package/dist/components/chat/Button.js +0 -73
- package/dist/components/chat/Button.js.map +0 -1
- package/dist/components/chat/Button.mjs +0 -10
- package/dist/components/chat/Button.mjs.map +0 -1
- package/dist/components/chat/Chat.d.ts +0 -204
- package/dist/components/chat/Chat.js +0 -2428
- package/dist/components/chat/Chat.js.map +0 -1
- package/dist/components/chat/Chat.mjs +0 -29
- package/dist/components/chat/Chat.mjs.map +0 -1
- package/dist/components/chat/ChatContext.d.ts +0 -145
- package/dist/components/chat/ChatContext.js +0 -383
- package/dist/components/chat/ChatContext.js.map +0 -1
- package/dist/components/chat/ChatContext.mjs +0 -13
- package/dist/components/chat/ChatContext.mjs.map +0 -1
- package/dist/components/chat/CodeBlock.d.ts +0 -14
- package/dist/components/chat/CodeBlock.js +0 -524
- package/dist/components/chat/CodeBlock.js.map +0 -1
- package/dist/components/chat/CodeBlock.mjs +0 -14
- package/dist/components/chat/CodeBlock.mjs.map +0 -1
- package/dist/components/chat/Header.d.ts +0 -9
- package/dist/components/chat/Header.js +0 -642
- package/dist/components/chat/Header.js.map +0 -1
- package/dist/components/chat/Header.mjs +0 -17
- package/dist/components/chat/Header.mjs.map +0 -1
- package/dist/components/chat/Icons.d.ts +0 -20
- package/dist/components/chat/Icons.js +0 -362
- package/dist/components/chat/Icons.js.map +0 -1
- package/dist/components/chat/Icons.mjs +0 -38
- package/dist/components/chat/Icons.mjs.map +0 -1
- package/dist/components/chat/ImageUploadQueue.d.ts +0 -13
- package/dist/components/chat/ImageUploadQueue.js +0 -106
- package/dist/components/chat/ImageUploadQueue.js.map +0 -1
- package/dist/components/chat/ImageUploadQueue.mjs +0 -8
- package/dist/components/chat/ImageUploadQueue.mjs.map +0 -1
- package/dist/components/chat/Input.d.ts +0 -9
- package/dist/components/chat/Input.js +0 -424
- package/dist/components/chat/Input.js.map +0 -1
- package/dist/components/chat/Input.mjs +0 -14
- package/dist/components/chat/Input.mjs.map +0 -1
- package/dist/components/chat/Markdown.d.ts +0 -10
- package/dist/components/chat/Markdown.js +0 -678
- package/dist/components/chat/Markdown.js.map +0 -1
- package/dist/components/chat/Markdown.mjs +0 -11
- package/dist/components/chat/Markdown.mjs.map +0 -1
- package/dist/components/chat/Messages.d.ts +0 -13
- package/dist/components/chat/Messages.js +0 -1242
- package/dist/components/chat/Messages.js.map +0 -1
- package/dist/components/chat/Messages.mjs +0 -20
- package/dist/components/chat/Messages.mjs.map +0 -1
- package/dist/components/chat/Modal.d.ts +0 -51
- package/dist/components/chat/Modal.js +0 -3294
- package/dist/components/chat/Modal.js.map +0 -1
- package/dist/components/chat/Modal.mjs +0 -38
- package/dist/components/chat/Modal.mjs.map +0 -1
- package/dist/components/chat/Popup.d.ts +0 -13
- package/dist/components/chat/Popup.js +0 -3305
- package/dist/components/chat/Popup.js.map +0 -1
- package/dist/components/chat/Popup.mjs +0 -39
- package/dist/components/chat/Popup.mjs.map +0 -1
- package/dist/components/chat/PoweredByTag.d.ts +0 -7
- package/dist/components/chat/PoweredByTag.js +0 -63
- package/dist/components/chat/PoweredByTag.js.map +0 -1
- package/dist/components/chat/PoweredByTag.mjs +0 -9
- package/dist/components/chat/PoweredByTag.mjs.map +0 -1
- package/dist/components/chat/Sidebar.d.ts +0 -13
- package/dist/components/chat/Sidebar.js +0 -3314
- package/dist/components/chat/Sidebar.js.map +0 -1
- package/dist/components/chat/Sidebar.mjs +0 -39
- package/dist/components/chat/Sidebar.mjs.map +0 -1
- package/dist/components/chat/Suggestion.d.ts +0 -12
- package/dist/components/chat/Suggestion.js +0 -68
- package/dist/components/chat/Suggestion.js.map +0 -1
- package/dist/components/chat/Suggestion.mjs +0 -9
- package/dist/components/chat/Suggestion.mjs.map +0 -1
- package/dist/components/chat/Suggestions.d.ts +0 -9
- package/dist/components/chat/Suggestions.js +0 -93
- package/dist/components/chat/Suggestions.js.map +0 -1
- package/dist/components/chat/Suggestions.mjs +0 -10
- package/dist/components/chat/Suggestions.mjs.map +0 -1
- package/dist/components/chat/Textarea.d.ts +0 -15
- package/dist/components/chat/Textarea.js +0 -87
- package/dist/components/chat/Textarea.js.map +0 -1
- package/dist/components/chat/Textarea.mjs +0 -8
- package/dist/components/chat/Textarea.mjs.map +0 -1
- package/dist/components/chat/Window.d.ts +0 -9
- package/dist/components/chat/Window.js +0 -166
- package/dist/components/chat/Window.js.map +0 -1
- package/dist/components/chat/Window.mjs +0 -10
- package/dist/components/chat/Window.mjs.map +0 -1
- package/dist/components/chat/index.d.ts +0 -18
- package/dist/components/chat/index.js +0 -3341
- package/dist/components/chat/index.js.map +0 -1
- package/dist/components/chat/index.mjs +0 -69
- package/dist/components/chat/index.mjs.map +0 -1
- package/dist/components/chat/messages/AssistantMessage.d.ts +0 -9
- package/dist/components/chat/messages/AssistantMessage.js +0 -807
- package/dist/components/chat/messages/AssistantMessage.js.map +0 -1
- package/dist/components/chat/messages/AssistantMessage.mjs +0 -13
- package/dist/components/chat/messages/AssistantMessage.mjs.map +0 -1
- package/dist/components/chat/messages/ErrorMessage.d.ts +0 -9
- package/dist/components/chat/messages/ErrorMessage.js +0 -756
- package/dist/components/chat/messages/ErrorMessage.js.map +0 -1
- package/dist/components/chat/messages/ErrorMessage.mjs +0 -72
- package/dist/components/chat/messages/ErrorMessage.mjs.map +0 -1
- package/dist/components/chat/messages/ImageRenderer.d.ts +0 -12
- package/dist/components/chat/messages/ImageRenderer.js +0 -68
- package/dist/components/chat/messages/ImageRenderer.js.map +0 -1
- package/dist/components/chat/messages/ImageRenderer.mjs +0 -8
- package/dist/components/chat/messages/ImageRenderer.mjs.map +0 -1
- package/dist/components/chat/messages/LegacyRenderMessage.d.ts +0 -28
- package/dist/components/chat/messages/LegacyRenderMessage.js +0 -1067
- package/dist/components/chat/messages/LegacyRenderMessage.js.map +0 -1
- package/dist/components/chat/messages/LegacyRenderMessage.mjs +0 -17
- package/dist/components/chat/messages/LegacyRenderMessage.mjs.map +0 -1
- package/dist/components/chat/messages/RenderMessage.d.ts +0 -9
- package/dist/components/chat/messages/RenderMessage.js +0 -942
- package/dist/components/chat/messages/RenderMessage.js.map +0 -1
- package/dist/components/chat/messages/RenderMessage.mjs +0 -16
- package/dist/components/chat/messages/RenderMessage.mjs.map +0 -1
- package/dist/components/chat/messages/UserMessage.d.ts +0 -9
- package/dist/components/chat/messages/UserMessage.js +0 -58
- package/dist/components/chat/messages/UserMessage.js.map +0 -1
- package/dist/components/chat/messages/UserMessage.mjs +0 -8
- package/dist/components/chat/messages/UserMessage.mjs.map +0 -1
- package/dist/components/chat/props.d.ts +0 -298
- package/dist/components/chat/props.js +0 -19
- package/dist/components/chat/props.js.map +0 -1
- package/dist/components/chat/props.mjs +0 -2
- package/dist/components/chat/props.mjs.map +0 -1
- package/dist/components/dev-console/console.d.ts +0 -11
- package/dist/components/dev-console/console.js +0 -595
- package/dist/components/dev-console/console.js.map +0 -1
- package/dist/components/dev-console/console.mjs +0 -17
- package/dist/components/dev-console/console.mjs.map +0 -1
- package/dist/components/dev-console/icons.d.ts +0 -9
- package/dist/components/dev-console/icons.js +0 -140
- package/dist/components/dev-console/icons.js.map +0 -1
- package/dist/components/dev-console/icons.mjs +0 -16
- package/dist/components/dev-console/icons.mjs.map +0 -1
- package/dist/components/dev-console/index.d.ts +0 -3
- package/dist/components/dev-console/index.js +0 -595
- package/dist/components/dev-console/index.js.map +0 -1
- package/dist/components/dev-console/index.mjs +0 -18
- package/dist/components/dev-console/index.mjs.map +0 -1
- package/dist/components/dev-console/types.d.ts +0 -9
- package/dist/components/dev-console/types.js +0 -19
- package/dist/components/dev-console/types.js.map +0 -1
- package/dist/components/dev-console/types.mjs +0 -1
- package/dist/components/dev-console/types.mjs.map +0 -1
- package/dist/components/dev-console/utils.d.ts +0 -10
- package/dist/components/dev-console/utils.js +0 -183
- package/dist/components/dev-console/utils.js.map +0 -1
- package/dist/components/dev-console/utils.mjs +0 -16
- package/dist/components/dev-console/utils.mjs.map +0 -1
- package/dist/components/help-modal/icons.d.ts +0 -9
- package/dist/components/help-modal/icons.js +0 -116
- package/dist/components/help-modal/icons.js.map +0 -1
- package/dist/components/help-modal/icons.mjs +0 -12
- package/dist/components/help-modal/icons.mjs.map +0 -1
- package/dist/components/help-modal/index.d.ts +0 -2
- package/dist/components/help-modal/index.js +0 -144
- package/dist/components/help-modal/index.js.map +0 -1
- package/dist/components/help-modal/index.mjs +0 -10
- package/dist/components/help-modal/index.mjs.map +0 -1
- package/dist/components/help-modal/modal.d.ts +0 -5
- package/dist/components/help-modal/modal.js +0 -142
- package/dist/components/help-modal/modal.js.map +0 -1
- package/dist/components/help-modal/modal.mjs +0 -9
- package/dist/components/help-modal/modal.mjs.map +0 -1
- package/dist/components/index.d.ts +0 -19
- package/dist/components/index.js +0 -3345
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -76
- package/dist/components/index.mjs.map +0 -1
- package/dist/context/index.d.ts +0 -2
- package/dist/context/index.js +0 -19
- package/dist/context/index.js.map +0 -1
- package/dist/context/index.mjs +0 -2
- package/dist/context/index.mjs.map +0 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.js +0 -36
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -9
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +0 -66
- package/dist/hooks/use-copilot-chat-suggestions.js +0 -34
- package/dist/hooks/use-copilot-chat-suggestions.js.map +0 -1
- package/dist/hooks/use-copilot-chat-suggestions.mjs +0 -8
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +0 -9
- package/dist/hooks/use-copy-to-clipboard.js +0 -62
- package/dist/hooks/use-copy-to-clipboard.js.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -8
- package/dist/hooks/use-copy-to-clipboard.mjs.map +0 -1
- package/dist/hooks/use-dark-mode.d.ts +0 -3
- package/dist/hooks/use-dark-mode.js +0 -35
- package/dist/hooks/use-dark-mode.js.map +0 -1
- package/dist/hooks/use-dark-mode.mjs +0 -8
- package/dist/hooks/use-dark-mode.mjs.map +0 -1
- package/dist/hooks/use-push-to-talk.d.ts +0 -19
- package/dist/hooks/use-push-to-talk.js +0 -202
- package/dist/hooks/use-push-to-talk.js.map +0 -1
- package/dist/hooks/use-push-to-talk.mjs +0 -12
- package/dist/hooks/use-push-to-talk.mjs.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.js +0 -3354
- package/dist/index.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -4
- package/dist/lib/utils.js +0 -76
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs +0 -34
- package/dist/lib/utils.mjs.map +0 -1
- package/dist/types/css.d.ts +0 -22
- package/dist/types/css.js +0 -19
- package/dist/types/css.js.map +0 -1
- package/dist/types/css.mjs +0 -1
- package/dist/types/css.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -2
- package/dist/types/index.mjs.map +0 -1
- package/dist/types/suggestions.d.ts +0 -9
- package/dist/types/suggestions.js +0 -19
- package/dist/types/suggestions.js.map +0 -1
- package/dist/types/suggestions.mjs +0 -1
- package/dist/types/suggestions.mjs.map +0 -1
- package/dist/v2/index.css +0 -4
- package/dist/v2/index.css.map +0 -1
- package/dist/v2/index.d.ts +0 -2
- package/dist/v2/index.js +0 -2
- package/dist/v2/index.js.map +0 -1
- package/dist/v2/index.mjs +0 -2
- package/dist/v2/index.mjs.map +0 -1
- package/jest.config.js +0 -5
- package/rollup.config.mjs +0 -64
- package/tsup.config.ts +0 -15
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import { AIMessage, CopilotErrorEvent, CopilotErrorHandler, ImageData, Message, UserMessage as UserMessage$2 } from "@copilotkit/shared";
|
|
2
|
+
import React$1, { CSSProperties, ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { ChatSuggestions, OnReloadMessages, OnStopGeneration, SystemMessageFunction, UseCopilotChatSuggestionsConfiguration, shouldShowDevConsole } from "@copilotkit/react-core";
|
|
5
|
+
import { Components } from "react-markdown";
|
|
6
|
+
|
|
7
|
+
//#region src/types/suggestions.d.ts
|
|
8
|
+
interface CopilotChatSuggestion {
|
|
9
|
+
title: string;
|
|
10
|
+
message: string;
|
|
11
|
+
partial?: boolean;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/chat/props.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Event hooks for CopilotKit chat events.
|
|
19
|
+
* These hooks only work when publicApiKey is provided.
|
|
20
|
+
*/
|
|
21
|
+
interface CopilotObservabilityHooks {
|
|
22
|
+
/**
|
|
23
|
+
* Called when a message is sent by the user
|
|
24
|
+
*/
|
|
25
|
+
onMessageSent?: (message: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called when the chat is minimized/closed
|
|
28
|
+
*/
|
|
29
|
+
onChatMinimized?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Called when the chat is expanded/opened
|
|
32
|
+
*/
|
|
33
|
+
onChatExpanded?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Called when a message is regenerated
|
|
36
|
+
*/
|
|
37
|
+
onMessageRegenerated?: (messageId: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called when a message is copied
|
|
40
|
+
*/
|
|
41
|
+
onMessageCopied?: (content: string) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Called when feedback is given (thumbs up/down)
|
|
44
|
+
*/
|
|
45
|
+
onFeedbackGiven?: (messageId: string, type: "thumbsUp" | "thumbsDown") => void;
|
|
46
|
+
/**
|
|
47
|
+
* Called when chat generation starts
|
|
48
|
+
*/
|
|
49
|
+
onChatStarted?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when chat generation stops
|
|
52
|
+
*/
|
|
53
|
+
onChatStopped?: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Called when an error occurs in the chat
|
|
56
|
+
* This enables chat-specific error handling UX while preserving system-wide error monitoring
|
|
57
|
+
*/
|
|
58
|
+
onError?: (errorEvent: CopilotErrorEvent) => void;
|
|
59
|
+
}
|
|
60
|
+
interface ButtonProps {}
|
|
61
|
+
interface WindowProps {
|
|
62
|
+
clickOutsideToClose: boolean;
|
|
63
|
+
hitEscapeToClose: boolean;
|
|
64
|
+
shortcut: string;
|
|
65
|
+
children?: React.ReactNode;
|
|
66
|
+
}
|
|
67
|
+
interface HeaderProps {}
|
|
68
|
+
interface SuggestionsProps {
|
|
69
|
+
title: string;
|
|
70
|
+
message: string;
|
|
71
|
+
partial?: boolean;
|
|
72
|
+
className?: string;
|
|
73
|
+
onClick: (message: string) => void;
|
|
74
|
+
}
|
|
75
|
+
type ComponentsMap<T extends Record<string, object> = Record<string, object>> = { [K in keyof T]: React.FC<{
|
|
76
|
+
children?: ReactNode;
|
|
77
|
+
} & T[K]> };
|
|
78
|
+
interface MessagesProps {
|
|
79
|
+
messages: Message[];
|
|
80
|
+
inProgress: boolean;
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
chatError?: ChatError | null;
|
|
83
|
+
AssistantMessage: React.ComponentType<AssistantMessageProps>;
|
|
84
|
+
UserMessage: React.ComponentType<UserMessageProps>;
|
|
85
|
+
ErrorMessage?: React.ComponentType<ErrorMessageProps>;
|
|
86
|
+
RenderMessage: React.ComponentType<RenderMessageProps>;
|
|
87
|
+
ImageRenderer: React.ComponentType<ImageRendererProps>;
|
|
88
|
+
/**
|
|
89
|
+
* Callback function to regenerate the assistant's response
|
|
90
|
+
*/
|
|
91
|
+
onRegenerate?: (messageId: string) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Callback function when the message is copied
|
|
94
|
+
*/
|
|
95
|
+
onCopy?: (message: string) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Callback function for thumbs up feedback
|
|
98
|
+
*/
|
|
99
|
+
onThumbsUp?: (message: Message) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Callback function for thumbs down feedback
|
|
102
|
+
*/
|
|
103
|
+
onThumbsDown?: (message: Message) => void;
|
|
104
|
+
/**
|
|
105
|
+
* Map of message IDs to their feedback state
|
|
106
|
+
*/
|
|
107
|
+
messageFeedback?: Record<string, "thumbsUp" | "thumbsDown">;
|
|
108
|
+
/**
|
|
109
|
+
* A list of markdown components to render in assistant message.
|
|
110
|
+
* Useful when you want to render custom elements in the message (e.g a reference tag element)
|
|
111
|
+
*/
|
|
112
|
+
markdownTagRenderers?: ComponentsMap;
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated Use RenderMessage instead
|
|
115
|
+
*/
|
|
116
|
+
RenderTextMessage?: React.ComponentType<RenderMessageProps>;
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Use RenderMessage instead
|
|
119
|
+
*/
|
|
120
|
+
RenderActionExecutionMessage?: React.ComponentType<RenderMessageProps>;
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated Use RenderMessage instead
|
|
123
|
+
*/
|
|
124
|
+
RenderAgentStateMessage?: React.ComponentType<RenderMessageProps>;
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated Use RenderMessage instead
|
|
127
|
+
*/
|
|
128
|
+
RenderResultMessage?: React.ComponentType<RenderMessageProps>;
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated Use RenderMessage instead
|
|
131
|
+
*/
|
|
132
|
+
RenderImageMessage?: React.ComponentType<RenderMessageProps>;
|
|
133
|
+
}
|
|
134
|
+
interface Renderer {
|
|
135
|
+
content: string;
|
|
136
|
+
}
|
|
137
|
+
interface UserMessageProps {
|
|
138
|
+
message?: UserMessage$2;
|
|
139
|
+
ImageRenderer: React.ComponentType<ImageRendererProps>;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated use message instead
|
|
142
|
+
*
|
|
143
|
+
* The raw data from the assistant's response
|
|
144
|
+
*/
|
|
145
|
+
rawData: any;
|
|
146
|
+
}
|
|
147
|
+
interface AssistantMessageProps {
|
|
148
|
+
/**
|
|
149
|
+
* The message content from the assistant
|
|
150
|
+
*/
|
|
151
|
+
message?: AIMessage;
|
|
152
|
+
messages?: Message[];
|
|
153
|
+
/**
|
|
154
|
+
* Indicates if this is the last message
|
|
155
|
+
*/
|
|
156
|
+
isCurrentMessage?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Whether a response is loading, this is when the LLM is thinking of a response but hasn't finished yet.
|
|
159
|
+
*/
|
|
160
|
+
isLoading: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Whether a response is generating, this is when the LLM is actively generating and streaming content.
|
|
163
|
+
*/
|
|
164
|
+
isGenerating: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Callback function to regenerate the assistant's response
|
|
167
|
+
*/
|
|
168
|
+
onRegenerate?: () => void;
|
|
169
|
+
/**
|
|
170
|
+
* Callback function when the message is copied
|
|
171
|
+
*/
|
|
172
|
+
onCopy?: (message: string) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Callback function for thumbs up feedback
|
|
175
|
+
*/
|
|
176
|
+
onThumbsUp?: (message: Message) => void;
|
|
177
|
+
/**
|
|
178
|
+
* Callback function for thumbs down feedback
|
|
179
|
+
*/
|
|
180
|
+
onThumbsDown?: (message: Message) => void;
|
|
181
|
+
/**
|
|
182
|
+
* The feedback state for this message ("thumbsUp" or "thumbsDown")
|
|
183
|
+
*/
|
|
184
|
+
feedback?: "thumbsUp" | "thumbsDown" | null;
|
|
185
|
+
/**
|
|
186
|
+
* A list of markdown components to render in assistant message.
|
|
187
|
+
* Useful when you want to render custom elements in the message (e.g a reference tag element)
|
|
188
|
+
*/
|
|
189
|
+
markdownTagRenderers?: ComponentsMap;
|
|
190
|
+
/**
|
|
191
|
+
* A custom image rendering component to use instead of the default.
|
|
192
|
+
*/
|
|
193
|
+
ImageRenderer?: React.ComponentType<ImageRendererProps>;
|
|
194
|
+
/**
|
|
195
|
+
* @deprecated use message instead
|
|
196
|
+
*
|
|
197
|
+
* The raw data from the assistant's response
|
|
198
|
+
*/
|
|
199
|
+
rawData: any;
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @deprecated
|
|
203
|
+
*
|
|
204
|
+
* use `message.generativeUI()` instead.
|
|
205
|
+
*
|
|
206
|
+
* For example:
|
|
207
|
+
*
|
|
208
|
+
* ```tsx
|
|
209
|
+
* const CustomAssistantMessage = ({ message }: AssistantMessageProps) => {
|
|
210
|
+
* const subComponent = message?.generativeUI?.();
|
|
211
|
+
* return <div>{subComponent}</div>;
|
|
212
|
+
* };
|
|
213
|
+
*
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
subComponent?: React.JSX.Element;
|
|
217
|
+
}
|
|
218
|
+
interface ErrorMessageProps {
|
|
219
|
+
/**
|
|
220
|
+
* The message content from the assistant
|
|
221
|
+
*/
|
|
222
|
+
error: ChatError;
|
|
223
|
+
/**
|
|
224
|
+
* Indicates if this is the last message
|
|
225
|
+
*/
|
|
226
|
+
isCurrentMessage?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Callback function to regenerate the assistant's response
|
|
229
|
+
*/
|
|
230
|
+
onRegenerate?: () => void;
|
|
231
|
+
/**
|
|
232
|
+
* Callback function when the message is copied
|
|
233
|
+
*/
|
|
234
|
+
onCopy?: (message: string) => void;
|
|
235
|
+
}
|
|
236
|
+
interface RenderMessageProps {
|
|
237
|
+
message: Message;
|
|
238
|
+
messages: Message[];
|
|
239
|
+
inProgress: boolean;
|
|
240
|
+
index: number;
|
|
241
|
+
isCurrentMessage: boolean;
|
|
242
|
+
actionResult?: string;
|
|
243
|
+
AssistantMessage?: React.ComponentType<AssistantMessageProps>;
|
|
244
|
+
UserMessage?: React.ComponentType<UserMessageProps>;
|
|
245
|
+
ImageRenderer?: React.ComponentType<ImageRendererProps>;
|
|
246
|
+
/**
|
|
247
|
+
* Callback function to regenerate the assistant's response
|
|
248
|
+
*/
|
|
249
|
+
onRegenerate?: (messageId: string) => void;
|
|
250
|
+
/**
|
|
251
|
+
* Callback function when the message is copied
|
|
252
|
+
*/
|
|
253
|
+
onCopy?: (message: string) => void;
|
|
254
|
+
/**
|
|
255
|
+
* Callback function for thumbs up feedback
|
|
256
|
+
*/
|
|
257
|
+
onThumbsUp?: (message: Message) => void;
|
|
258
|
+
/**
|
|
259
|
+
* Callback function for thumbs down feedback
|
|
260
|
+
*/
|
|
261
|
+
onThumbsDown?: (message: Message) => void;
|
|
262
|
+
/**
|
|
263
|
+
* Map of message IDs to their feedback state
|
|
264
|
+
*/
|
|
265
|
+
messageFeedback?: Record<string, "thumbsUp" | "thumbsDown">;
|
|
266
|
+
/**
|
|
267
|
+
* A list of markdown components to render in assistant message.
|
|
268
|
+
* Useful when you want to render custom elements in the message (e.g a reference tag element)
|
|
269
|
+
*/
|
|
270
|
+
markdownTagRenderers?: ComponentsMap;
|
|
271
|
+
}
|
|
272
|
+
interface InputProps {
|
|
273
|
+
inProgress: boolean;
|
|
274
|
+
onSend: (text: string) => Promise<Message>;
|
|
275
|
+
isVisible?: boolean;
|
|
276
|
+
onStop?: () => void;
|
|
277
|
+
onUpload?: () => void;
|
|
278
|
+
hideStopButton?: boolean;
|
|
279
|
+
chatReady?: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface RenderSuggestionsListProps {
|
|
282
|
+
suggestions: CopilotChatSuggestion[];
|
|
283
|
+
onSuggestionClick: (message: string) => void;
|
|
284
|
+
isLoading: boolean;
|
|
285
|
+
}
|
|
286
|
+
interface ImageRendererProps {
|
|
287
|
+
/**
|
|
288
|
+
* The image data containing format and bytes
|
|
289
|
+
*/
|
|
290
|
+
image: ImageData;
|
|
291
|
+
/**
|
|
292
|
+
* Optional content to display alongside the image
|
|
293
|
+
*/
|
|
294
|
+
content?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Additional CSS class name for styling
|
|
297
|
+
*/
|
|
298
|
+
className?: string;
|
|
299
|
+
}
|
|
300
|
+
interface ChatError {
|
|
301
|
+
message: string;
|
|
302
|
+
operation?: string;
|
|
303
|
+
timestamp: number;
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/components/chat/ChatContext.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* Icons for CopilotChat component.
|
|
309
|
+
*/
|
|
310
|
+
interface CopilotChatIcons {
|
|
311
|
+
/**
|
|
312
|
+
* The icon to use for the open chat button.
|
|
313
|
+
* @default <OpenIcon />
|
|
314
|
+
*/
|
|
315
|
+
openIcon?: React$1.ReactNode;
|
|
316
|
+
/**
|
|
317
|
+
* The icon to use for the close chat button.
|
|
318
|
+
* @default <CloseIcon />
|
|
319
|
+
*/
|
|
320
|
+
closeIcon?: React$1.ReactNode;
|
|
321
|
+
/**
|
|
322
|
+
* The icon to use for the close chat button in the header.
|
|
323
|
+
* @default <HeaderCloseIcon />
|
|
324
|
+
*/
|
|
325
|
+
headerCloseIcon?: React$1.ReactNode;
|
|
326
|
+
/**
|
|
327
|
+
* The icon to use for the send button.
|
|
328
|
+
* @default <SendIcon />
|
|
329
|
+
*/
|
|
330
|
+
sendIcon?: React$1.ReactNode;
|
|
331
|
+
/**
|
|
332
|
+
* The icon to use for the activity indicator.
|
|
333
|
+
* @default <ActivityIcon />
|
|
334
|
+
*/
|
|
335
|
+
activityIcon?: React$1.ReactNode;
|
|
336
|
+
/**
|
|
337
|
+
* The icon to use for the spinner.
|
|
338
|
+
* @default <SpinnerIcon />
|
|
339
|
+
*/
|
|
340
|
+
spinnerIcon?: React$1.ReactNode;
|
|
341
|
+
/**
|
|
342
|
+
* The icon to use for the stop button.
|
|
343
|
+
* @default <StopIcon />
|
|
344
|
+
*/
|
|
345
|
+
stopIcon?: React$1.ReactNode;
|
|
346
|
+
/**
|
|
347
|
+
* The icon to use for the regenerate button.
|
|
348
|
+
* @default <RegenerateIcon />
|
|
349
|
+
*/
|
|
350
|
+
regenerateIcon?: React$1.ReactNode;
|
|
351
|
+
/**
|
|
352
|
+
* The icons to use for push to talk.
|
|
353
|
+
* @default <PushToTalkIcon />
|
|
354
|
+
*/
|
|
355
|
+
pushToTalkIcon?: React$1.ReactNode;
|
|
356
|
+
/**
|
|
357
|
+
* The icons to use for copy assistant response
|
|
358
|
+
* @default <CopyIcon />
|
|
359
|
+
*/
|
|
360
|
+
copyIcon?: React$1.ReactNode;
|
|
361
|
+
/**
|
|
362
|
+
* The icon to use for thumbs up/response approval.
|
|
363
|
+
* @default <ThumbsUpIcon />
|
|
364
|
+
*/
|
|
365
|
+
thumbsUpIcon?: React$1.ReactNode;
|
|
366
|
+
/**
|
|
367
|
+
* The icon to use for thumbs down/response rejection.
|
|
368
|
+
* @default <ThumbsDownIcon />
|
|
369
|
+
*/
|
|
370
|
+
thumbsDownIcon?: React$1.ReactNode;
|
|
371
|
+
/**
|
|
372
|
+
* The icon to use for the upload button.
|
|
373
|
+
* @default <UploadIcon />
|
|
374
|
+
*/
|
|
375
|
+
uploadIcon?: React$1.ReactNode;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Labels for CopilotChat component.
|
|
379
|
+
*/
|
|
380
|
+
interface CopilotChatLabels {
|
|
381
|
+
/**
|
|
382
|
+
* The initial message(s) to display in the chat window.
|
|
383
|
+
*/
|
|
384
|
+
initial?: string | string[];
|
|
385
|
+
/**
|
|
386
|
+
* The title to display in the header.
|
|
387
|
+
* @default "CopilotKit"
|
|
388
|
+
*/
|
|
389
|
+
title?: string;
|
|
390
|
+
/**
|
|
391
|
+
* The placeholder to display in the input.
|
|
392
|
+
* @default "Type a message..."
|
|
393
|
+
*/
|
|
394
|
+
placeholder?: string;
|
|
395
|
+
/**
|
|
396
|
+
* The message to display when an error occurs.
|
|
397
|
+
* @default "❌ An error occurred. Please try again."
|
|
398
|
+
*/
|
|
399
|
+
error?: string;
|
|
400
|
+
/**
|
|
401
|
+
* The label to display on the stop button.
|
|
402
|
+
* @default "Stop generating"
|
|
403
|
+
*/
|
|
404
|
+
stopGenerating?: string;
|
|
405
|
+
/**
|
|
406
|
+
* The label to display on the regenerate button.
|
|
407
|
+
* @default "Regenerate response"
|
|
408
|
+
*/
|
|
409
|
+
regenerateResponse?: string;
|
|
410
|
+
/**
|
|
411
|
+
* The label for the copy button.
|
|
412
|
+
* @default "Copy to clipboard"
|
|
413
|
+
*/
|
|
414
|
+
copyToClipboard?: string;
|
|
415
|
+
/**
|
|
416
|
+
* The label for the thumbs up button.
|
|
417
|
+
* @default "Thumbs up"
|
|
418
|
+
*/
|
|
419
|
+
thumbsUp?: string;
|
|
420
|
+
/**
|
|
421
|
+
* The label for the thumbs down button.
|
|
422
|
+
* @default "Thumbs down"
|
|
423
|
+
*/
|
|
424
|
+
thumbsDown?: string;
|
|
425
|
+
/**
|
|
426
|
+
* The text to display when content is copied.
|
|
427
|
+
* @default "Copied!"
|
|
428
|
+
*/
|
|
429
|
+
copied?: string;
|
|
430
|
+
}
|
|
431
|
+
interface ChatContext {
|
|
432
|
+
labels: Required<CopilotChatLabels>;
|
|
433
|
+
icons: Required<CopilotChatIcons>;
|
|
434
|
+
open: boolean;
|
|
435
|
+
setOpen: (open: boolean) => void;
|
|
436
|
+
}
|
|
437
|
+
declare const ChatContext: React$1.Context<ChatContext | undefined>;
|
|
438
|
+
declare function useChatContext(): ChatContext;
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/components/chat/Chat.d.ts
|
|
441
|
+
/**
|
|
442
|
+
* Props for CopilotChat component.
|
|
443
|
+
*/
|
|
444
|
+
interface CopilotChatProps {
|
|
445
|
+
/**
|
|
446
|
+
* Custom instructions to be added to the system message. Use this property to
|
|
447
|
+
* provide additional context or guidance to the language model, influencing
|
|
448
|
+
* its responses. These instructions can include specific directions,
|
|
449
|
+
* preferences, or criteria that the model should consider when generating
|
|
450
|
+
* its output, thereby tailoring the conversation more precisely to the
|
|
451
|
+
* user's needs or the application's requirements.
|
|
452
|
+
*/
|
|
453
|
+
instructions?: string;
|
|
454
|
+
/**
|
|
455
|
+
* Controls the behavior of suggestions in the chat interface.
|
|
456
|
+
*
|
|
457
|
+
* `auto` (default) - Suggestions are generated automatically:
|
|
458
|
+
* - When the chat is first opened (empty state)
|
|
459
|
+
* - After each message exchange completes
|
|
460
|
+
* - Uses configuration from `useCopilotChatSuggestions` hooks
|
|
461
|
+
*
|
|
462
|
+
* `manual` - Suggestions are controlled programmatically:
|
|
463
|
+
* - Use `setSuggestions()` to set custom suggestions
|
|
464
|
+
* - Use `generateSuggestions()` to trigger AI generation
|
|
465
|
+
* - Access via `useCopilotChat` hook
|
|
466
|
+
*
|
|
467
|
+
* `SuggestionItem[]` - Static suggestions array:
|
|
468
|
+
* - Always shows the same suggestions
|
|
469
|
+
* - No AI generation involved
|
|
470
|
+
*/
|
|
471
|
+
suggestions?: ChatSuggestions;
|
|
472
|
+
/**
|
|
473
|
+
* A callback that gets called when the in progress state changes.
|
|
474
|
+
*/
|
|
475
|
+
onInProgress?: (inProgress: boolean) => void;
|
|
476
|
+
/**
|
|
477
|
+
* A callback that gets called when a new message it submitted.
|
|
478
|
+
*/
|
|
479
|
+
onSubmitMessage?: (message: string) => void | Promise<void>;
|
|
480
|
+
/**
|
|
481
|
+
* A custom stop generation function.
|
|
482
|
+
*/
|
|
483
|
+
onStopGeneration?: OnStopGeneration;
|
|
484
|
+
/**
|
|
485
|
+
* A custom reload messages function.
|
|
486
|
+
*/
|
|
487
|
+
onReloadMessages?: OnReloadMessages;
|
|
488
|
+
/**
|
|
489
|
+
* A callback function to regenerate the assistant's response
|
|
490
|
+
*/
|
|
491
|
+
onRegenerate?: (messageId: string) => void;
|
|
492
|
+
/**
|
|
493
|
+
* A callback function when the message is copied
|
|
494
|
+
*/
|
|
495
|
+
onCopy?: (message: string) => void;
|
|
496
|
+
/**
|
|
497
|
+
* A callback function for thumbs up feedback
|
|
498
|
+
*/
|
|
499
|
+
onThumbsUp?: (message: Message) => void;
|
|
500
|
+
/**
|
|
501
|
+
* A callback function for thumbs down feedback
|
|
502
|
+
*/
|
|
503
|
+
onThumbsDown?: (message: Message) => void;
|
|
504
|
+
/**
|
|
505
|
+
* A list of markdown components to render in assistant message.
|
|
506
|
+
* Useful when you want to render custom elements in the message (e.g a reference tag element)
|
|
507
|
+
*/
|
|
508
|
+
markdownTagRenderers?: ComponentsMap;
|
|
509
|
+
/**
|
|
510
|
+
* Icons can be used to set custom icons for the chat window.
|
|
511
|
+
*/
|
|
512
|
+
icons?: CopilotChatIcons;
|
|
513
|
+
/**
|
|
514
|
+
* Labels can be used to set custom labels for the chat window.
|
|
515
|
+
*/
|
|
516
|
+
labels?: CopilotChatLabels;
|
|
517
|
+
/**
|
|
518
|
+
* Enable image upload button (image inputs only supported on some models)
|
|
519
|
+
*/
|
|
520
|
+
imageUploadsEnabled?: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* The 'accept' attribute for the file input used for image uploads.
|
|
523
|
+
* Defaults to "image/*".
|
|
524
|
+
*/
|
|
525
|
+
inputFileAccept?: string;
|
|
526
|
+
/**
|
|
527
|
+
* A function that takes in context string and instructions and returns
|
|
528
|
+
* the system message to include in the chat request.
|
|
529
|
+
* Use this to completely override the system message, when providing
|
|
530
|
+
* instructions is not enough.
|
|
531
|
+
*/
|
|
532
|
+
makeSystemMessage?: SystemMessageFunction;
|
|
533
|
+
/**
|
|
534
|
+
* Disables inclusion of CopilotKit’s default system message. When true, no system message is sent (this also suppresses any custom message from <code>makeSystemMessage</code>).
|
|
535
|
+
*/
|
|
536
|
+
disableSystemMessage?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* A custom assistant message component to use instead of the default.
|
|
539
|
+
*/
|
|
540
|
+
AssistantMessage?: React$1.ComponentType<AssistantMessageProps>;
|
|
541
|
+
/**
|
|
542
|
+
* A custom user message component to use instead of the default.
|
|
543
|
+
*/
|
|
544
|
+
UserMessage?: React$1.ComponentType<UserMessageProps>;
|
|
545
|
+
/**
|
|
546
|
+
* A custom error message component to use instead of the default.
|
|
547
|
+
*/
|
|
548
|
+
ErrorMessage?: React$1.ComponentType<ErrorMessageProps>;
|
|
549
|
+
/**
|
|
550
|
+
* A custom Messages component to use instead of the default.
|
|
551
|
+
*/
|
|
552
|
+
Messages?: React$1.ComponentType<MessagesProps>;
|
|
553
|
+
/**
|
|
554
|
+
* @deprecated - use RenderMessage instead
|
|
555
|
+
*/
|
|
556
|
+
RenderTextMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
557
|
+
/**
|
|
558
|
+
* @deprecated - use RenderMessage instead
|
|
559
|
+
*/
|
|
560
|
+
RenderActionExecutionMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
561
|
+
/**
|
|
562
|
+
* @deprecated - use RenderMessage instead
|
|
563
|
+
*/
|
|
564
|
+
RenderAgentStateMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
565
|
+
/**
|
|
566
|
+
* @deprecated - use RenderMessage instead
|
|
567
|
+
*/
|
|
568
|
+
RenderResultMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
569
|
+
/**
|
|
570
|
+
* @deprecated - use RenderMessage instead
|
|
571
|
+
*/
|
|
572
|
+
RenderImageMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
573
|
+
/**
|
|
574
|
+
* A custom RenderMessage component to use instead of the default.
|
|
575
|
+
*
|
|
576
|
+
* **Warning**: This is a break-glass solution to allow for custom
|
|
577
|
+
* rendering of messages. You are most likely looking to swap out
|
|
578
|
+
* the AssistantMessage and UserMessage components instead which
|
|
579
|
+
* are also props.
|
|
580
|
+
*/
|
|
581
|
+
RenderMessage?: React$1.ComponentType<RenderMessageProps>;
|
|
582
|
+
/**
|
|
583
|
+
* A custom suggestions list component to use instead of the default.
|
|
584
|
+
*/
|
|
585
|
+
RenderSuggestionsList?: React$1.ComponentType<RenderSuggestionsListProps>;
|
|
586
|
+
/**
|
|
587
|
+
* A custom Input component to use instead of the default.
|
|
588
|
+
*/
|
|
589
|
+
Input?: React$1.ComponentType<InputProps>;
|
|
590
|
+
/**
|
|
591
|
+
* A custom image rendering component to use instead of the default.
|
|
592
|
+
*/
|
|
593
|
+
ImageRenderer?: React$1.ComponentType<ImageRendererProps>;
|
|
594
|
+
/**
|
|
595
|
+
* A class name to apply to the root element.
|
|
596
|
+
*/
|
|
597
|
+
className?: string;
|
|
598
|
+
/**
|
|
599
|
+
* Children to render.
|
|
600
|
+
*/
|
|
601
|
+
children?: React$1.ReactNode;
|
|
602
|
+
hideStopButton?: boolean;
|
|
603
|
+
/**
|
|
604
|
+
* Event hooks for CopilotKit chat events.
|
|
605
|
+
* These hooks only work when publicApiKey is provided.
|
|
606
|
+
*/
|
|
607
|
+
observabilityHooks?: CopilotObservabilityHooks;
|
|
608
|
+
/**
|
|
609
|
+
* Custom error renderer for chat-specific errors.
|
|
610
|
+
* When provided, errors will be displayed inline within the chat interface.
|
|
611
|
+
*/
|
|
612
|
+
renderError?: (error: {
|
|
613
|
+
message: string;
|
|
614
|
+
operation?: string;
|
|
615
|
+
timestamp: number;
|
|
616
|
+
onDismiss: () => void;
|
|
617
|
+
onRetry?: () => void;
|
|
618
|
+
}) => React$1.ReactNode;
|
|
619
|
+
/**
|
|
620
|
+
* Optional handler for comprehensive debugging and observability.
|
|
621
|
+
*/
|
|
622
|
+
onError?: CopilotErrorHandler;
|
|
623
|
+
}
|
|
624
|
+
declare function CopilotChat({
|
|
625
|
+
instructions,
|
|
626
|
+
suggestions,
|
|
627
|
+
onSubmitMessage,
|
|
628
|
+
makeSystemMessage,
|
|
629
|
+
disableSystemMessage,
|
|
630
|
+
onInProgress,
|
|
631
|
+
onStopGeneration,
|
|
632
|
+
onReloadMessages,
|
|
633
|
+
onRegenerate,
|
|
634
|
+
onCopy,
|
|
635
|
+
onThumbsUp,
|
|
636
|
+
onThumbsDown,
|
|
637
|
+
markdownTagRenderers,
|
|
638
|
+
Messages,
|
|
639
|
+
RenderMessage,
|
|
640
|
+
RenderSuggestionsList,
|
|
641
|
+
Input,
|
|
642
|
+
className,
|
|
643
|
+
icons,
|
|
644
|
+
labels,
|
|
645
|
+
AssistantMessage,
|
|
646
|
+
UserMessage,
|
|
647
|
+
ImageRenderer,
|
|
648
|
+
ErrorMessage,
|
|
649
|
+
imageUploadsEnabled,
|
|
650
|
+
inputFileAccept,
|
|
651
|
+
hideStopButton,
|
|
652
|
+
observabilityHooks,
|
|
653
|
+
renderError,
|
|
654
|
+
onError,
|
|
655
|
+
RenderTextMessage,
|
|
656
|
+
RenderActionExecutionMessage,
|
|
657
|
+
RenderAgentStateMessage,
|
|
658
|
+
RenderResultMessage,
|
|
659
|
+
RenderImageMessage
|
|
660
|
+
}: CopilotChatProps): react_jsx_runtime0.JSX.Element;
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/components/chat/Modal.d.ts
|
|
663
|
+
interface CopilotModalProps extends CopilotChatProps {
|
|
664
|
+
/**
|
|
665
|
+
* Whether the chat window should be open by default.
|
|
666
|
+
* @default false
|
|
667
|
+
*/
|
|
668
|
+
defaultOpen?: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* If the chat window should close when the user clicks outside of it.
|
|
671
|
+
* @default true
|
|
672
|
+
*/
|
|
673
|
+
clickOutsideToClose?: boolean;
|
|
674
|
+
/**
|
|
675
|
+
* If the chat window should close when the user hits the Escape key.
|
|
676
|
+
* @default true
|
|
677
|
+
*/
|
|
678
|
+
hitEscapeToClose?: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* The shortcut key to open the chat window.
|
|
681
|
+
* Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.
|
|
682
|
+
* @default '/'
|
|
683
|
+
*/
|
|
684
|
+
shortcut?: string;
|
|
685
|
+
/**
|
|
686
|
+
* A callback that gets called when the chat window opens or closes.
|
|
687
|
+
*/
|
|
688
|
+
onSetOpen?: (open: boolean) => void;
|
|
689
|
+
/**
|
|
690
|
+
* A custom Window component to use instead of the default.
|
|
691
|
+
*/
|
|
692
|
+
Window?: React$1.ComponentType<WindowProps>;
|
|
693
|
+
/**
|
|
694
|
+
* A custom Button component to use instead of the default.
|
|
695
|
+
*/
|
|
696
|
+
Button?: React$1.ComponentType<ButtonProps>;
|
|
697
|
+
/**
|
|
698
|
+
* A custom Header component to use instead of the default.
|
|
699
|
+
*/
|
|
700
|
+
Header?: React$1.ComponentType<HeaderProps>;
|
|
701
|
+
}
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/components/chat/Popup.d.ts
|
|
704
|
+
declare function CopilotPopup(props: CopilotModalProps): react_jsx_runtime0.JSX.Element;
|
|
705
|
+
//#endregion
|
|
706
|
+
//#region src/components/chat/Sidebar.d.ts
|
|
707
|
+
declare function CopilotSidebar(props: CopilotModalProps): react_jsx_runtime0.JSX.Element;
|
|
708
|
+
//#endregion
|
|
709
|
+
//#region src/components/chat/Markdown.d.ts
|
|
710
|
+
type MarkdownProps = {
|
|
711
|
+
content: string;
|
|
712
|
+
components?: Components;
|
|
713
|
+
};
|
|
714
|
+
declare const Markdown: ({
|
|
715
|
+
content,
|
|
716
|
+
components
|
|
717
|
+
}: MarkdownProps) => react_jsx_runtime0.JSX.Element;
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region src/components/chat/messages/AssistantMessage.d.ts
|
|
720
|
+
declare const AssistantMessage$1: (props: AssistantMessageProps) => react_jsx_runtime0.JSX.Element;
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region src/components/chat/messages/UserMessage.d.ts
|
|
723
|
+
declare const UserMessage$1: (props: UserMessageProps) => react_jsx_runtime0.JSX.Element;
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/components/chat/messages/ImageRenderer.d.ts
|
|
726
|
+
/**
|
|
727
|
+
* Default image rendering component that can be customized by users.
|
|
728
|
+
* Uses CSS classes for styling so users can override styles.
|
|
729
|
+
*/
|
|
730
|
+
declare const ImageRenderer$1: React$1.FC<ImageRendererProps>;
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/components/chat/Suggestions.d.ts
|
|
733
|
+
declare function Suggestions({
|
|
734
|
+
suggestions,
|
|
735
|
+
onSuggestionClick,
|
|
736
|
+
isLoading
|
|
737
|
+
}: RenderSuggestionsListProps): react_jsx_runtime0.JSX.Element;
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region src/components/chat/Suggestion.d.ts
|
|
740
|
+
interface SuggestionsProps$1 {
|
|
741
|
+
title: string;
|
|
742
|
+
message: string;
|
|
743
|
+
partial?: boolean;
|
|
744
|
+
className?: string;
|
|
745
|
+
onClick: () => void;
|
|
746
|
+
}
|
|
747
|
+
declare function Suggestion({
|
|
748
|
+
title,
|
|
749
|
+
onClick,
|
|
750
|
+
partial,
|
|
751
|
+
className
|
|
752
|
+
}: SuggestionsProps$1): react_jsx_runtime0.JSX.Element | null;
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/components/dev-console/console.d.ts
|
|
755
|
+
declare function CopilotDevConsole(): react_jsx_runtime0.JSX.Element | null;
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/hooks/use-copilot-chat-suggestions.d.ts
|
|
758
|
+
declare function useCopilotChatSuggestions(config: UseCopilotChatSuggestionsConfiguration, dependencies?: any[]): void;
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/types/css.d.ts
|
|
761
|
+
interface CopilotKitCSSProperties extends CSSProperties {
|
|
762
|
+
"--copilot-kit-primary-color"?: string;
|
|
763
|
+
"--copilot-kit-contrast-color"?: string;
|
|
764
|
+
"--copilot-kit-background-color"?: string;
|
|
765
|
+
"--copilot-kit-input-background-color"?: string;
|
|
766
|
+
"--copilot-kit-secondary-color"?: string;
|
|
767
|
+
"--copilot-kit-secondary-contrast-color"?: string;
|
|
768
|
+
"--copilot-kit-separator-color"?: string;
|
|
769
|
+
"--copilot-kit-muted-color"?: string;
|
|
770
|
+
"--copilot-kit-error-background"?: string;
|
|
771
|
+
"--copilot-kit-error-border"?: string;
|
|
772
|
+
"--copilot-kit-error-text"?: string;
|
|
773
|
+
"--copilot-kit-shadow-sm"?: string;
|
|
774
|
+
"--copilot-kit-shadow-md"?: string;
|
|
775
|
+
"--copilot-kit-shadow-lg"?: string;
|
|
776
|
+
"--copilot-kit-dev-console-bg"?: string;
|
|
777
|
+
"--copilot-kit-dev-console-text"?: string;
|
|
778
|
+
}
|
|
779
|
+
//#endregion
|
|
780
|
+
export { AssistantMessage$1 as AssistantMessage, AssistantMessageProps, ButtonProps, ChatError, ComponentsMap, CopilotChat, type CopilotChatSuggestion, CopilotDevConsole, type CopilotKitCSSProperties, CopilotObservabilityHooks, CopilotPopup, CopilotSidebar, ErrorMessageProps, HeaderProps, ImageRenderer$1 as ImageRenderer, ImageRendererProps, InputProps, Markdown, MessagesProps, RenderMessageProps, Suggestion as RenderSuggestion, Suggestions as RenderSuggestionsList, RenderSuggestionsListProps, Renderer, SuggestionsProps, UserMessage$1 as UserMessage, UserMessageProps, WindowProps, shouldShowDevConsole, useChatContext, useCopilotChatSuggestions };
|
|
781
|
+
//# sourceMappingURL=index.d.cts.map
|