@copilotkit/react-ui 1.56.0 → 1.56.2-canary.pin-to-send

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","names":["CloseIcon","CheckIcon","React","DefaultIcons.OpenIcon","DefaultIcons.CloseIcon","DefaultIcons.HeaderCloseIcon","DefaultIcons.SendIcon","DefaultIcons.ActivityIcon","DefaultIcons.SpinnerIcon","DefaultIcons.StopIcon","DefaultIcons.RegenerateIcon","DefaultIcons.MicrophoneIcon","DefaultIcons.CopyIcon","DefaultIcons.ThumbsUpIcon","DefaultIcons.ThumbsDownIcon","DefaultIcons.UploadIcon","React","defaultCopilotContextCategories","COPILOTKIT_VERSION","Menu","MenuButton","MenuItems","MenuItem","React","Light","Prism","CheckIcon","ReactMarkdown","remarkGfm","remarkMath","rehypeRaw","DefaultUserMessage","DefaultAssistantMessage","DefaultImageRenderer","UserMessage","ImageRenderer","AssistantMessage","DefaultRenderMessage","DefaultMessages","DefaultRenderMessage","DefaultRenderSuggestionsList","DefaultInput","DefaultAssistantMessage","DefaultUserMessage","DefaultImageRenderer","CopilotKitError","CopilotKitErrorCode","Severity","ErrorVisibility","React","Messages","AssistantMessage","UserMessage","RenderMessage","ImageRenderer","Input","CopilotKitError","CopilotKitErrorCode","Severity","ErrorVisibility","DefaultWindow","DefaultButton","DefaultHeader","DefaultMessages","DefaultInput","DefaultAssistantMessage","DefaultUserMessage","React","Window","Button","Header","Messages","Input","AssistantMessage","UserMessage"],"sources":["../src/components/chat/Icons.tsx","../src/components/chat/ChatContext.tsx","../src/components/chat/Window.tsx","../src/components/chat/Button.tsx","../src/components/dev-console/utils.ts","../src/components/dev-console/icons.tsx","../src/components/help-modal/icons.tsx","../src/components/help-modal/modal.tsx","../src/components/dev-console/console.tsx","../src/components/chat/Header.tsx","../src/components/chat/AttachmentRenderer.tsx","../src/components/chat/messages/UserMessage.tsx","../src/hooks/use-copy-to-clipboard.tsx","../src/components/chat/CodeBlock.tsx","../src/components/chat/Markdown.tsx","../src/components/chat/messages/AssistantMessage.tsx","../src/components/chat/messages/ImageRenderer.tsx","../src/components/chat/messages/RenderMessage.tsx","../src/components/chat/messages/LegacyRenderMessage.tsx","../src/components/chat/Messages.tsx","../src/components/chat/Textarea.tsx","../src/hooks/use-push-to-talk.tsx","../src/hooks/use-dark-mode.ts","../src/components/chat/PoweredByTag.tsx","../src/components/chat/Input.tsx","../src/components/chat/AttachmentQueue.tsx","../src/components/chat/attachment-utils.ts","../src/components/chat/Suggestion.tsx","../src/components/chat/Suggestions.tsx","../src/components/chat/Chat.tsx","../src/components/chat/Modal.tsx","../src/components/chat/Popup.tsx","../src/components/chat/Sidebar.tsx","../src/hooks/use-copilot-chat-suggestions.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const OpenIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <g transform=\"translate(24, 0) scale(-1, 1)\">\n <path\n fillRule=\"evenodd\"\n d=\"M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z\"\n clipRule=\"evenodd\"\n />\n </g>\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\n />\n </svg>\n);\n\nexport const HeaderCloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n);\n\nexport const SendIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 19V5m0 0l-7 7m7-7l7 7\"\n />\n </svg>\n);\n\nexport const MicrophoneIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z\"\n />\n </svg>\n);\n\nexport const StopIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z\"\n />\n </svg>\n);\n\nexport const RegenerateIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99\"\n />\n </svg>\n);\n\nexport const CopyIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75\"\n />\n </svg>\n);\n\nexport const SmallSpinnerIcon = (\n <span\n className=\"copilotKitSpinner\"\n style={{ width: \"13px\", height: \"13px\" }}\n ></span>\n);\n\nexport const SpinnerIcon = (\n <span\n className=\"copilotKitSpinner\"\n style={{ width: \"24px\", height: \"24px\" }}\n ></span>\n);\n\nexport const ActivityIcon = (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"4px\" }}>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0s\" }}\n ></span>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0.2s\" }}\n ></span>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0.4s\" }}\n ></span>\n </div>\n);\n\nexport const ThumbsUpIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z\"\n />\n </svg>\n);\n\nexport const ThumbsDownIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 00.303-.54m.023-8.25H16.48a4.5 4.5 0 01-1.423-.23l-3.114-1.04a4.5 4.5 0 00-1.423-.23H6.504c-.618 0-1.217.247-1.605.729A11.95 11.95 0 002.25 12c0 .434.023.863.068 1.285C2.427 14.306 3.346 15 4.372 15h3.126c.618 0 .991.724.725 1.282A7.471 7.471 0 007.5 19.5a2.25 2.25 0 002.25 2.25.75.75 0 00.75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 002.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384\"\n />\n </svg>\n);\n\nexport const DownloadIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\"\n />\n </svg>\n);\n\nexport const UploadIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </svg>\n);\n\nexport const CheckIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.5 12.75l6 6 9-13.5\"\n />\n </svg>\n);\n","import React, { useMemo, useState } from \"react\";\nimport * as DefaultIcons from \"./Icons\";\nimport { ThumbsDownIcon, ThumbsUpIcon } from \"./Icons\";\n\n/**\n * Icons for CopilotChat component.\n */\nexport interface CopilotChatIcons {\n /**\n * The icon to use for the open chat button.\n * @default <OpenIcon />\n */\n openIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button.\n * @default <CloseIcon />\n */\n closeIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button in the header.\n * @default <HeaderCloseIcon />\n */\n headerCloseIcon?: React.ReactNode;\n\n /**\n * The icon to use for the send button.\n * @default <SendIcon />\n */\n sendIcon?: React.ReactNode;\n\n /**\n * The icon to use for the activity indicator.\n * @default <ActivityIcon />\n */\n activityIcon?: React.ReactNode;\n\n /**\n * The icon to use for the spinner.\n * @default <SpinnerIcon />\n */\n spinnerIcon?: React.ReactNode;\n\n /**\n * The icon to use for the stop button.\n * @default <StopIcon />\n */\n stopIcon?: React.ReactNode;\n\n /**\n * The icon to use for the regenerate button.\n * @default <RegenerateIcon />\n */\n regenerateIcon?: React.ReactNode;\n\n /**\n * The icons to use for push to talk.\n * @default <PushToTalkIcon />\n */\n\n pushToTalkIcon?: React.ReactNode;\n\n /**\n * The icons to use for copy assistant response\n * @default <CopyIcon />\n */\n\n copyIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs up/response approval.\n * @default <ThumbsUpIcon />\n */\n\n thumbsUpIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs down/response rejection.\n * @default <ThumbsDownIcon />\n */\n\n thumbsDownIcon?: React.ReactNode;\n\n /**\n * The icon to use for the upload button.\n * @default <UploadIcon />\n */\n uploadIcon?: React.ReactNode;\n}\n\n/**\n * Labels for CopilotChat component.\n */\nexport interface CopilotChatLabels {\n /**\n * The initial message(s) to display in the chat window.\n */\n initial?: string | string[];\n\n /**\n * The title to display in the header.\n * @default \"CopilotKit\"\n */\n title?: string;\n\n /**\n * The placeholder to display in the input.\n * @default \"Type a message...\"\n */\n placeholder?: string;\n\n /**\n * The message to display when an error occurs.\n * @default \"❌ An error occurred. Please try again.\"\n */\n error?: string;\n\n /**\n * The label to display on the stop button.\n * @default \"Stop generating\"\n */\n stopGenerating?: string;\n\n /**\n * The label to display on the regenerate button.\n * @default \"Regenerate response\"\n */\n regenerateResponse?: string;\n\n /**\n * The label for the copy button.\n * @default \"Copy to clipboard\"\n */\n copyToClipboard?: string;\n\n /**\n * The label for the thumbs up button.\n * @default \"Thumbs up\"\n */\n thumbsUp?: string;\n\n /**\n * The label for the thumbs down button.\n * @default \"Thumbs down\"\n */\n thumbsDown?: string;\n\n /**\n * The text to display when content is copied.\n * @default \"Copied!\"\n */\n copied?: string;\n}\n\ninterface ChatContext {\n labels: Required<CopilotChatLabels>;\n icons: Required<CopilotChatIcons>;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContext = React.createContext<ChatContext | undefined>(\n undefined,\n);\n\nexport function useChatContext(): ChatContext {\n const context = React.useContext(ChatContext);\n if (context === undefined) {\n throw new Error(\n \"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?\",\n );\n }\n return context;\n}\n\ninterface ChatContextProps {\n // temperature?: number;\n // instructions?: string;\n // maxFeedback?: number;\n labels?: CopilotChatLabels;\n icons?: CopilotChatIcons;\n children?: React.ReactNode;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContextProvider = ({\n // temperature,\n // instructions,\n // maxFeedback,\n labels,\n icons,\n children,\n open,\n setOpen,\n}: ChatContextProps) => {\n const memoizedLabels = useMemo(\n () => ({\n initial: \"\",\n title: \"CopilotKit\",\n placeholder: \"Type a message...\",\n error: \"❌ An error occurred. Please try again.\",\n stopGenerating: \"Stop generating\",\n regenerateResponse: \"Regenerate response\",\n copyToClipboard: \"Copy to clipboard\",\n thumbsUp: \"Thumbs up\",\n thumbsDown: \"Thumbs down\",\n copied: \"Copied!\",\n ...labels,\n }),\n [labels],\n );\n\n const memoizedIcons = useMemo(\n () => ({\n openIcon: DefaultIcons.OpenIcon,\n closeIcon: DefaultIcons.CloseIcon,\n headerCloseIcon: DefaultIcons.HeaderCloseIcon,\n sendIcon: DefaultIcons.SendIcon,\n activityIcon: DefaultIcons.ActivityIcon,\n spinnerIcon: DefaultIcons.SpinnerIcon,\n stopIcon: DefaultIcons.StopIcon,\n regenerateIcon: DefaultIcons.RegenerateIcon,\n pushToTalkIcon: DefaultIcons.MicrophoneIcon,\n copyIcon: DefaultIcons.CopyIcon,\n thumbsUpIcon: DefaultIcons.ThumbsUpIcon,\n thumbsDownIcon: DefaultIcons.ThumbsDownIcon,\n uploadIcon: DefaultIcons.UploadIcon,\n ...icons,\n }),\n [icons],\n );\n\n const context = useMemo(\n () => ({\n labels: memoizedLabels,\n icons: memoizedIcons,\n open,\n setOpen,\n }),\n [memoizedLabels, memoizedIcons, open, setOpen],\n );\n\n return (\n <ChatContext.Provider value={context}>{children}</ChatContext.Provider>\n );\n};\n","import React, { useCallback, useEffect } from \"react\";\nimport { WindowProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { isMacOS } from \"@copilotkit/shared\";\n\nexport const Window = ({\n children,\n clickOutsideToClose,\n shortcut,\n hitEscapeToClose,\n}: WindowProps) => {\n const windowRef = React.useRef<HTMLDivElement>(null);\n const context = useCopilotContext();\n\n const { open, setOpen } = useChatContext();\n\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!clickOutsideToClose) {\n return;\n }\n\n const parentElement = windowRef.current?.parentElement;\n\n let className = \"\";\n if (event.target instanceof HTMLElement) {\n className = event.target.className;\n }\n\n if (\n open &&\n parentElement &&\n !parentElement.contains(event.target as any) &&\n // prevent closing the window when clicking on the debug menu\n !className.includes(\"copilotKitDebugMenu\")\n ) {\n setOpen(false);\n }\n },\n [clickOutsideToClose, open, setOpen],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isInput =\n target.tagName === \"INPUT\" ||\n target.tagName === \"SELECT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable;\n\n const isDescendantOfWrapper = windowRef.current?.contains(target);\n\n if (\n open &&\n event.key === \"Escape\" &&\n (!isInput || isDescendantOfWrapper) &&\n hitEscapeToClose\n ) {\n setOpen(false);\n } else if (\n event.key === shortcut &&\n ((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&\n (!isInput || isDescendantOfWrapper)\n ) {\n setOpen(!open);\n }\n },\n [hitEscapeToClose, shortcut, open, setOpen],\n );\n\n const adjustForMobile = useCallback(() => {\n const copilotKitWindow = windowRef.current;\n const vv = window.visualViewport;\n if (!copilotKitWindow || !vv) {\n return;\n }\n\n if (window.innerWidth < 640 && open) {\n copilotKitWindow.style.height = `${vv.height}px`;\n copilotKitWindow.style.left = `${vv.offsetLeft}px`;\n copilotKitWindow.style.top = `${vv.offsetTop}px`;\n\n document.body.style.position = \"fixed\";\n document.body.style.width = \"100%\";\n document.body.style.height = `${window.innerHeight}px`;\n document.body.style.overflow = \"hidden\";\n document.body.style.touchAction = \"none\";\n\n // Prevent scrolling on iOS\n document.body.addEventListener(\"touchmove\", preventScroll, {\n passive: false,\n });\n } else {\n copilotKitWindow.style.height = \"\";\n copilotKitWindow.style.left = \"\";\n copilotKitWindow.style.top = \"\";\n document.body.style.position = \"\";\n document.body.style.height = \"\";\n document.body.style.width = \"\";\n document.body.style.overflow = \"\";\n document.body.style.top = \"\";\n document.body.style.touchAction = \"\";\n\n document.body.removeEventListener(\"touchmove\", preventScroll);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.addEventListener(\"resize\", adjustForMobile);\n adjustForMobile();\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.removeEventListener(\"resize\", adjustForMobile);\n }\n };\n }, [adjustForMobile, handleClickOutside, handleKeyDown]);\n\n return (\n <div className={`copilotKitWindow ${open ? \" open\" : \"\"}`} ref={windowRef}>\n {children}\n </div>\n );\n};\n\nconst preventScroll = (event: TouchEvent): void => {\n let targetElement = event.target as Element;\n\n // Function to check if the target has the parent with a given class\n const hasParentWithClass = (element: Element, className: string): boolean => {\n while (element && element !== document.body) {\n if (element.classList.contains(className)) {\n return true;\n }\n element = element.parentElement!;\n }\n return false;\n };\n\n // Check if the target of the touch event is inside an element with the 'copilotKitMessages' class\n if (!hasParentWithClass(targetElement, \"copilotKitMessages\")) {\n event.preventDefault();\n }\n};\n","import { ButtonProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Button = ({}: ButtonProps) => {\n const { open, setOpen, icons } = useChatContext();\n\n return (\n <div onClick={() => setOpen(!open)}>\n <button\n className={`copilotKitButton ${open ? \"open\" : \"\"}`}\n aria-label={open ? \"Close Chat\" : \"Open Chat\"}\n >\n <div className=\"copilotKitButtonIcon copilotKitButtonIconOpen\">\n {icons.openIcon}\n </div>\n <div className=\"copilotKitButtonIcon copilotKitButtonIconClose\">\n {icons.closeIcon}\n </div>\n </button>\n </div>\n );\n};\n","import {\n CopilotContextParams,\n CopilotMessagesContextParams,\n defaultCopilotContextCategories,\n} from \"@copilotkit/react-core\";\nimport { CopilotKitVersion } from \"./types\";\nexport { shouldShowDevConsole } from \"@copilotkit/react-core\";\n\nexport async function getPublishedCopilotKitVersion(\n current: string,\n forceCheck: boolean = false,\n): Promise<CopilotKitVersion> {\n const LOCAL_STORAGE_KEY = \"__copilotkit_version_check__\";\n const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);\n if (serializedVersion && !forceCheck) {\n try {\n const parsedVersion: CopilotKitVersion = JSON.parse(serializedVersion);\n const oneHour = 60 * 60 * 1000;\n const now = new Date().getTime();\n\n if (\n parsedVersion.current === current &&\n now - new Date(parsedVersion.lastChecked).getTime() < oneHour\n ) {\n return parsedVersion;\n }\n } catch (error) {\n console.error(\n \"Failed to parse CopilotKitVersion from localStorage\",\n error,\n );\n }\n }\n\n try {\n const response = await fetch(\n \"https://api.cloud.copilotkit.ai/check-for-updates\",\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n packages: [\n {\n packageName: \"@copilotkit/shared\",\n packageVersion: current,\n },\n ],\n }),\n },\n );\n\n const data = await response.json();\n\n const version: CopilotKitVersion = {\n current,\n lastChecked: new Date().getTime(),\n latest: data.packages[0].latestVersion,\n severity: data.packages[0].severity,\n advisory: data.packages[0].advisory || null,\n };\n\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));\n return version;\n } catch (error) {\n console.error(\"Failed to check for updates\", error);\n throw error;\n }\n}\n\nexport function logReadables(context: CopilotContextParams) {\n console.log(\"%cCurrent Readables:\", \"font-size: 16px; font-weight: bold;\");\n\n const readables = context\n .getContextString([], defaultCopilotContextCategories)\n .trim();\n if (readables.length === 0) {\n console.log(\"No readables found\");\n return;\n }\n console.log(readables);\n}\n\nexport function logActions(context: CopilotContextParams) {\n console.log(\"%cCurrent Actions:\", \"font-size: 16px; font-weight: bold;\");\n\n if (Object.values(context.actions).length === 0) {\n console.log(\"No actions found\");\n return;\n }\n for (const action of Object.values(context.actions)) {\n console.group(action.name);\n console.log(\"name\", action.name);\n console.log(\"description\", action.description);\n console.log(\"parameters\", action.parameters);\n\n console.groupEnd();\n }\n}\n\nexport function logMessages(context: CopilotMessagesContextParams) {\n console.log(\"%cCurrent Messages:\", \"font-size: 16px; font-weight: bold;\");\n\n if (context.messages.length === 0) {\n console.log(\"No messages found\");\n return;\n }\n\n const tableData = context.messages.map((message) => {\n if (message.isTextMessage()) {\n return {\n id: message.id,\n type: \"TextMessage\",\n role: message.role,\n name: undefined,\n scope: undefined,\n content: message.content,\n };\n } else if (message.isActionExecutionMessage()) {\n return {\n id: message.id,\n type: \"ActionExecutionMessage\",\n role: undefined,\n name: message.name,\n scope: message.parentMessageId,\n content: message.arguments,\n };\n } else if (message.isResultMessage()) {\n return {\n id: message.id,\n type: \"ResultMessage\",\n role: undefined,\n name: message.actionName,\n scope: message.actionExecutionId,\n content: message.result,\n };\n } else if (message.isAgentStateMessage()) {\n return {\n id: message.id,\n type: `AgentStateMessage (running: ${message.running})`,\n role: message.role,\n name: undefined,\n scope: message.threadId,\n content: message.state,\n };\n }\n });\n console.table(tableData);\n}\n","export const ExclamationMarkTriangleIcon = (\n <svg\n width=\"13.3967723px\"\n height=\"12px\"\n viewBox=\"0 0 13.3967723 12\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"exclamation-triangle\" fill=\"#CD2121\">\n <path\n d=\"M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const ExclamationMarkIcon = (\n <svg\n width=\"14px\"\n height=\"14px\"\n viewBox=\"0 0 14 14\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"exclamation-circle\" fill=\"#EC662C\">\n <path\n d=\"M7,14 C10.866,14 14,10.866 14,7 C14,3.13401 10.866,0 7,0 C3.13401,0 0,3.13401 0,7 C0,10.866 3.13401,14 7,14 Z M7,3 C7.41421,3 7.75,3.33579 7.75,3.75 L7.75,6.75 C7.75,7.16421 7.41421,7.5 7,7.5 C6.58579,7.5 6.25,7.16421 6.25,6.75 L6.25,3.75 C6.25,3.33579 6.58579,3 7,3 Z M7,11 C7.55228,11 8,10.5523 8,10 C8,9.4477 7.55228,9 7,9 C6.44772,9 6,9.4477 6,10 C6,10.5523 6.44772,11 7,11 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const ChevronDownIcon = (\n <svg\n width=\"7px\"\n height=\"4px\"\n viewBox=\"0 0 7 4\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"Group\" fill=\"currentColor\" fillRule=\"nonzero\">\n <path\n d=\"M3.71690723,3.90271086 C3.59268176,4.03242971 3.39143629,4.03242971 3.26721082,3.90271086 L0.0853966595,0.57605615 C-0.0314221035,0.444981627 -0.0279751448,0.240725043 0.0931934622,0.114040675 C0.214362069,-0.0126436935 0.409725445,-0.0162475626 0.535093061,0.105888951 L3.49205902,3.19746006 L6.44902499,0.105888951 C6.52834574,0.0168884389 6.64780588,-0.0197473458 6.7605411,0.0103538404 C6.87327633,0.0404550266 6.96130636,0.132492308 6.99009696,0.250359396 C7.01888756,0.368226483 6.98384687,0.493124608 6.89872139,0.57605615 L3.71690723,3.90271086 Z\"\n id=\"Path\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const CheckIcon = (\n <svg\n width=\"14px\"\n height=\"14px\"\n viewBox=\"0 0 14 14\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g\n id=\"Group-2\"\n transform=\"translate(-118, 0)\"\n fill=\"#1BC030\"\n fillRule=\"nonzero\"\n >\n <g id=\"Group\" transform=\"translate(118, 0)\">\n <path\n d=\"M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </g>\n </svg>\n);\n\nexport const CopilotKitIcon = (\n <svg\n width=\"33px\"\n height=\"35px\"\n viewBox=\"0 0 33 35\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>bd5c9079-929b-4d55-bdc9-16d1c8181b71</title>\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <image\n x=\"0\"\n y=\"0\"\n width=\"33\"\n height=\"35\"\n xlinkHref=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAjaADAAQAAAABAAAAlwAAAACI8Oz3AABAAElEQVR4Ae2dCYAlVXnvv6q79d7TMz37sIMgKKBCkLhkSKK4xJUMQVzAqJBgNDGJa2LsvJfERI0aiEbwRXnoQ2VYRASiQUFRUGQm7DAwzDBbT+/rvbfvXu/3P1V1+84CzEw3MNPD6a579nOqzvev73znO0t59rzZbQu88sXndp2w4gVLp5oG+6+47ivDu010kAb6B+lzP+Vjr1zZk0xV/ddMVIufap/34g+e+s9rX9351U1dT5npIIpMHkTPusePmto+tKhctVWPDW1/c27hIVNbCsFbCpa7/aR/f/SWFV2ZX974zsNG97iwOZjwedDshqiZlL3AD9JH9Y8PpTYMPJEuLj7+pclE5vBquXZ6MV/56Zu/ueGnmWpqzer3HzKym+xzPsib80+4lw/Y09Pjr7lm9GO+eR+eKI4tXdeRsomXv8a6Dj3eqn6iRoPl5qW83o60vyaT9O5IWPX2llrH+hsuXJbfy6oO2OTPg2Yn0p1/6ueWFK1wWTKReo1XDZoeqw7YxhcfYfNf9NtWSHTYVLVqxSAIqoFlU76NzEt6mzqSCQBkt3up1NrlHUdsXX22V92p2DnlfR40O5Az8N57+pfPgcv8YzLZdHjKS3i9uS1254Kitf3271qq81ATGkq1wPJCDVexEtS8oFZKpBLZeWl/w7yE98uUZ3cnLPhNefSFmx7s8Uo7VDEHPM+DpoGI71v5xaODkn02kUi9Ne03Jz3Ps2Jh3O4ubbCB006yzqNPsYrfYhbUrBwEBnZstBLYBFIzSDIXQB5LeOY3JXoXJv3/afP9H9dqdtv8XHb9mp5T5kQX9rwg3ACaaiF4ZcL3T0x6K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MMM3/KnuveP3NFsXvIsVNt/AWc5CSaw49RGSGA0mN7lVit8ybqXj1jP4XCdPRg2inW/7fJOa2mSJvrz3Abdrti2jNb7Bg/TU33VxgevsJs/PDNOFhb6zPyKC6WGOmy82MX9L4GrMAXCbLXnw4+10L06yJqu7XbaSPbZmPB1oIm6pPl0Q1oUrp0EnAjpfxXAXApgJp6Zlmgotae3xUa2vQau8nc0AtsumIPZnfGC/7IqK+iK5TtQyo3YpS/TScsRW9opg5YYlO5fYKX0ByjzgwBEanUSOTEui2MDjf0vlrLr7VvvmRUBcac7mLNeBxqNlADJmTzlPwMYzXlcgv8yttBufdaeXBynhsIt8OEK3qupVyOcpnr9Dhruh1EOKnjztT2Ds1ja+q0yPm5fOp2uCwD1MKzesLnTyv6plHUuwDiH8FAu0CIoC6SFvZH837ar3ill4+5BV6/4ecfOLeBAw/HyryLiMwDmFdg3Min5aTS+Tz9zvXNps+H/s18fwQ7FcwDOayDosXAHWLIH54l0Nlrn4oRkLR1g9BX4t8I81iAbPW5VvgE5NbyMyf8zzKsySnL5NXMspd0w9v3cIvM+CMSr39s3G7d7MJbhwWUWIrt8hYeXAu9ndFGfZ2j9C8Lizv/Zb5ce5qEm7j2cibbT6cN/i+7qOMAxDzejA38hdiu6CKYDYBLVWolRQh9bMzZYOcdHtQqHErYEQHEmqgMWk3TeFgDzU5jKf9v3znv02X+guVVjEsFXH+A6kcdaD1Aub29v//VzChi1b49X4vdRhLr11vsHN1pz7Qj8bDKrLULpdyJzKocw1OwCKBm2zYKPCh1PiQ87sujILdnw1gKQrQiMDNmTj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+J7/zXkIt50IxO3oK1rgKgEaU5YYAJhaUOCLawjufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg==\"\n ></image>\n </g>\n </svg>\n);\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({\n color = \"rgb(107 114 128)\",\n}: {\n color?: string;\n}) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n","import React, { useMemo, useState, useRef, useEffect } from \"react\";\nimport { CloseIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n // Close popover when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node) &&\n buttonRef.current &&\n !buttonRef.current.contains(event.target as Node)\n ) {\n setShowHelpModal(false);\n }\n };\n\n if (showHelpModal) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [showHelpModal]);\n\n const HelpButton = () => (\n <button\n ref={buttonRef}\n onClick={() => setShowHelpModal(!showHelpModal)}\n className=\"copilotKitDebugMenuTriggerButton relative\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n return (\n <div className=\"relative\">\n <HelpButton />\n {showHelpModal && (\n <div\n ref={popoverRef}\n className=\"absolute mt-2 z-50\"\n style={{\n top: \"100%\",\n right: \"-120px\",\n width: \"380px\",\n }}\n >\n <div className=\"copilotKitHelpModal rounded-lg shadow-xl w-full p-4 flex-col relative\">\n <button\n className=\"copilotKitHelpModalCloseButton absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport {\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"@copilotkit/react-core\";\nimport {\n getPublishedCopilotKitVersion,\n logActions,\n logMessages,\n logReadables,\n shouldShowDevConsole,\n} from \"./utils\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n CopilotKitIcon,\n ExclamationMarkIcon,\n ExclamationMarkTriangleIcon,\n} from \"./icons\";\nimport { Menu, MenuButton, MenuItem, MenuItems } from \"@headlessui/react\";\nimport { COPILOTKIT_VERSION, copyToClipboard } from \"@copilotkit/shared\";\nimport { SmallSpinnerIcon } from \"../chat/Icons\";\nimport { CopilotKitHelpModal } from \"../help-modal\";\n\ntype VersionStatus =\n | \"unknown\"\n | \"checking\"\n | \"latest\"\n | \"update-available\"\n | \"outdated\";\n\nexport function CopilotDevConsole() {\n const currentVersion = COPILOTKIT_VERSION;\n const context = useCopilotContext();\n\n // to prevent hydration errors, ensure that the component renders the same content\n // server-side as it does during the initial client-side render to prevent a hydration\n // mismatch\n // see: https://nextjs.org/docs/messages/react-hydration-error#solution-1-using-useeffect-to-run-on-the-client-only\n\n const [showDevConsole, setShowDevConsole] = useState(false);\n\n useEffect(() => {\n setShowDevConsole(shouldShowDevConsole(context.showDevConsole));\n }, [context.showDevConsole]);\n\n const dontRunTwiceInDevMode = useRef(false);\n const [versionStatus, setVersionStatus] = useState<VersionStatus>(\"unknown\");\n const [latestVersion, setLatestVersion] = useState<string>(\"\");\n const consoleRef = useRef<HTMLDivElement>(null);\n const [debugButtonMode, setDebugButtonMode] = useState<\"full\" | \"compact\">(\n \"full\",\n );\n\n const checkForUpdates = (force: boolean = false) => {\n setVersionStatus(\"checking\");\n\n getPublishedCopilotKitVersion(currentVersion, force)\n .then((v) => {\n setLatestVersion(v.latest);\n let versionOk = false;\n\n // match exact version or a version with a letter (e.g. 1.0.0-alpha.1)\n if (v.current === v.latest) {\n versionOk = true;\n } else if (/[a-zA-Z]/.test(v.current)) {\n versionOk = true;\n }\n\n if (versionOk) {\n setVersionStatus(\"latest\");\n } else if (v.severity !== \"low\") {\n setVersionStatus(\"outdated\");\n } else {\n setVersionStatus(\"update-available\");\n }\n })\n .catch((e) => {\n console.error(e);\n setVersionStatus(\"unknown\");\n });\n };\n\n useEffect(() => {\n if (dontRunTwiceInDevMode.current === true) {\n return;\n }\n dontRunTwiceInDevMode.current = true;\n\n checkForUpdates();\n }, []);\n\n if (!showDevConsole) {\n return null;\n }\n return (\n <div\n ref={consoleRef}\n className={\n \"copilotKitDevConsole \" +\n (versionStatus === \"update-available\"\n ? \"copilotKitDevConsoleUpgrade\"\n : \"\") +\n (versionStatus === \"outdated\" ? \"copilotKitDevConsoleWarnOutdated\" : \"\")\n }\n >\n <VersionInfo\n showDevConsole={context.showDevConsole}\n versionStatus={versionStatus}\n currentVersion={currentVersion}\n latestVersion={latestVersion}\n />\n\n <CopilotKitHelpModal />\n\n <DebugMenuButton\n setShowDevConsole={setShowDevConsole}\n checkForUpdates={checkForUpdates}\n mode={debugButtonMode}\n />\n </div>\n );\n}\n\nfunction VersionInfo({\n showDevConsole,\n versionStatus,\n currentVersion,\n latestVersion,\n}: {\n showDevConsole: boolean;\n versionStatus: VersionStatus;\n currentVersion: string;\n latestVersion: string;\n}) {\n const [copyStatus, setCopyStatus] = useState<string>(\"\");\n\n let versionLabel = \"\";\n let versionIcon: any = \"\";\n let currentVersionLabel = currentVersion;\n\n if (versionStatus === \"latest\") {\n versionLabel = \"latest\";\n versionIcon = CheckIcon;\n } else if (versionStatus === \"checking\") {\n versionLabel = \"checking\";\n versionIcon = SmallSpinnerIcon;\n } else if (versionStatus === \"update-available\") {\n versionLabel = \"update available\";\n versionIcon = ExclamationMarkIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n } else if (versionStatus === \"outdated\") {\n versionLabel = \"outdated\";\n versionIcon = ExclamationMarkTriangleIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n }\n\n let asideLabel = \"\";\n if (showDevConsole === true) {\n asideLabel = \"(enabled)\";\n }\n\n const installCommand = [\n `npm install`,\n `@copilotkit/react-core@${latestVersion}`,\n `@copilotkit/react-ui@${latestVersion}`,\n `@copilotkit/react-textarea@${latestVersion}`,\n `&& npm install @copilotkit/runtime@${latestVersion}`,\n ].join(\" \");\n\n const handleCopyClick = async () => {\n const success = await copyToClipboard(installCommand.trim());\n if (success) {\n setCopyStatus(\"Command copied to clipboard!\");\n setTimeout(() => setCopyStatus(\"\"), 1000);\n }\n };\n\n if (versionStatus === \"update-available\" || versionStatus === \"outdated\") {\n return (\n <div className=\"copilotKitVersionInfo\">\n <p>\n {currentVersionLabel} {versionIcon}\n </p>\n <button onClick={handleCopyClick}>\n {copyStatus || installCommand}\n </button>\n </div>\n );\n }\n\n return null;\n}\n\nexport default function DebugMenuButton({\n setShowDevConsole,\n checkForUpdates,\n mode,\n}: {\n setShowDevConsole: (show: boolean) => void;\n checkForUpdates: (force: boolean) => void;\n mode: \"full\" | \"compact\";\n}) {\n const context = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n\n return (\n <>\n <Menu>\n <MenuButton\n className={`copilotKitDebugMenuTriggerButton ${mode === \"compact\" ? \"compact\" : \"\"}`}\n >\n {mode == \"compact\" ? \"Debug\" : <>Debug {ChevronDownIcon}</>}\n </MenuButton>\n\n <MenuItems\n transition\n anchor=\"bottom end\"\n className=\"copilotKitDebugMenu\"\n style={{ zIndex: 40 }}\n >\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logReadables(context)}\n >\n Log Readables\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logActions(context)}\n >\n Log Actions\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logMessages(messagesContext)}\n >\n Log Messages\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => checkForUpdates(true)}\n >\n Check for Updates\n </button>\n </MenuItem>\n <hr />\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => setShowDevConsole(false)}\n >\n Hide Dev Console\n </button>\n </MenuItem>\n </MenuItems>\n </Menu>\n </>\n );\n}\n","import { HeaderProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { CopilotDevConsole } from \"../dev-console\";\nimport React from \"react\";\n\nexport const Header = ({}: HeaderProps) => {\n const { setOpen, icons, labels } = useChatContext();\n\n return (\n <div className=\"copilotKitHeader\">\n <div>{labels.title}</div>\n <div className=\"copilotKitHeaderControls\">\n <CopilotDevConsole />\n <button\n onClick={() => setOpen(false)}\n aria-label=\"Close\"\n className=\"copilotKitHeaderCloseButton\"\n >\n {icons.headerCloseIcon}\n </button>\n </div>\n </div>\n );\n};\n","import React, { memo, useState } from \"react\";\nimport type { InputContentSource } from \"@copilotkit/shared\";\nimport { getSourceUrl, getDocumentIcon } from \"@copilotkit/shared\";\n\ninterface AttachmentRendererProps {\n type: \"image\" | \"audio\" | \"video\" | \"document\";\n source: InputContentSource;\n filename?: string;\n className?: string;\n}\n\nconst ImageAttachment = memo(function ImageAttachment({\n src,\n className,\n}: {\n src: string;\n className?: string;\n}) {\n const [error, setError] = useState(false);\n\n if (error) {\n return (\n <div\n className={`copilotKitImageRendering copilotKitImageRenderingError ${className ?? \"\"}`}\n >\n <div className=\"copilotKitImageRenderingErrorMessage\">\n Failed to load image\n </div>\n </div>\n );\n }\n\n return (\n <div className={`copilotKitImageRendering ${className ?? \"\"}`}>\n <img\n src={src}\n alt=\"Image attachment\"\n className=\"copilotKitImageRenderingImage\"\n onError={() => setError(true)}\n />\n </div>\n );\n});\n\nconst AudioAttachment = memo(function AudioAttachment({\n src,\n filename,\n className,\n}: {\n src: string;\n filename?: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentAudio ${className ?? \"\"}`}\n >\n <audio src={src} controls preload=\"metadata\" />\n {filename && (\n <span className=\"copilotKitAttachmentFilename\">{filename}</span>\n )}\n </div>\n );\n});\n\nconst VideoAttachment = memo(function VideoAttachment({\n src,\n className,\n}: {\n src: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentVideo ${className ?? \"\"}`}\n >\n <video src={src} controls preload=\"metadata\" />\n </div>\n );\n});\n\nconst DocumentAttachment = memo(function DocumentAttachment({\n source,\n filename,\n className,\n}: {\n source: InputContentSource;\n filename?: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentDocument ${className ?? \"\"}`}\n >\n <div className=\"copilotKitAttachmentDocIcon\">\n {getDocumentIcon(source.mimeType ?? \"\")}\n </div>\n <div className=\"copilotKitAttachmentDocInfo\">\n <span className=\"copilotKitAttachmentDocName\">\n {filename || source.mimeType || \"Unknown type\"}\n </span>\n </div>\n </div>\n );\n});\n\nexport const AttachmentRenderer: React.FC<AttachmentRendererProps> = ({\n type,\n source,\n filename,\n className,\n}) => {\n const src = getSourceUrl(source);\n\n switch (type) {\n case \"image\":\n return <ImageAttachment src={src} className={className} />;\n case \"audio\":\n return (\n <AudioAttachment src={src} filename={filename} className={className} />\n );\n case \"video\":\n return <VideoAttachment src={src} className={className} />;\n case \"document\":\n return (\n <DocumentAttachment\n source={source}\n filename={filename}\n className={className}\n />\n );\n }\n};\n","import { UserMessageProps } from \"../props\";\nimport { AttachmentRenderer } from \"../AttachmentRenderer\";\n\ntype UserMessageContent = NonNullable<UserMessageProps[\"message\"]>[\"content\"];\n\nconst getTextContent = (\n content: UserMessageContent | undefined,\n): string | undefined => {\n if (typeof content === \"undefined\") {\n return undefined;\n }\n\n if (typeof content === \"string\") {\n return content;\n }\n\n return (\n content\n .map((part) => {\n if (part.type === \"text\") {\n return part.text;\n }\n return undefined;\n })\n .filter(\n (value): value is string =>\n typeof value === \"string\" && value.length > 0,\n )\n .join(\" \")\n .trim() || undefined\n );\n};\n\nconst getMediaParts = (content: UserMessageContent | undefined) => {\n if (!content || typeof content === \"string\") return [];\n\n return content.filter(\n (part) =>\n part.type === \"image\" ||\n part.type === \"audio\" ||\n part.type === \"video\" ||\n part.type === \"document\",\n ) as Array<{\n type: \"image\" | \"audio\" | \"video\" | \"document\";\n source:\n | { type: \"data\"; value: string; mimeType: string }\n | { type: \"url\"; value: string; mimeType?: string };\n }>;\n};\n\nexport const UserMessage = (props: UserMessageProps) => {\n const { message, ImageRenderer } = props;\n const content = message?.content;\n\n // Legacy path: old-style image field on message\n const isLegacyImageMessage =\n message && \"image\" in message && Boolean((message as any).image);\n\n if (isLegacyImageMessage) {\n const legacyImage = (message as any).image;\n const textContent = getTextContent(content);\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n <ImageRenderer image={legacyImage} content={textContent} />\n </div>\n );\n }\n\n const textContent = getTextContent(content);\n const mediaParts = getMediaParts(content);\n\n if (mediaParts.length === 0) {\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n {textContent}\n </div>\n );\n }\n\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n {textContent && <div>{textContent}</div>}\n {mediaParts.map((part, index) => (\n <AttachmentRenderer key={index} type={part.type} source={part.source} />\n ))}\n </div>\n );\n};\n","import * as React from \"react\";\n\nexport interface useCopyToClipboardProps {\n timeout?: number;\n}\n\nexport function useCopyToClipboard({\n timeout = 2000,\n}: useCopyToClipboardProps) {\n const [isCopied, setIsCopied] = React.useState<boolean>(false);\n\n const copyToClipboard = (value: string) => {\n if (typeof window === \"undefined\" || !navigator.clipboard?.writeText) {\n return;\n }\n\n if (!value) {\n return;\n }\n\n navigator.clipboard.writeText(value).then(() => {\n setIsCopied(true);\n\n setTimeout(() => {\n setIsCopied(false);\n }, timeout);\n });\n };\n\n return { isCopied, copyToClipboard };\n}\n","import { FC, memo, useEffect, useState } from \"react\";\nimport { Prism, Light } from \"react-syntax-highlighter\";\nimport { useCopyToClipboard } from \"../../hooks/use-copy-to-clipboard\";\nimport { CheckIcon, CopyIcon, DownloadIcon } from \"./Icons\";\n\ninterface CodeActionButtonProps {\n onClick: () => void;\n children: React.ReactNode;\n}\n\ninterface Props {\n language: string;\n value: string;\n}\n\ninterface languageMap {\n [key: string]: string | undefined;\n}\n\nexport const programmingLanguages: languageMap = {\n javascript: \".js\",\n python: \".py\",\n java: \".java\",\n c: \".c\",\n cpp: \".cpp\",\n \"c++\": \".cpp\",\n \"c#\": \".cs\",\n ruby: \".rb\",\n php: \".php\",\n swift: \".swift\",\n \"objective-c\": \".m\",\n kotlin: \".kt\",\n typescript: \".ts\",\n go: \".go\",\n perl: \".pl\",\n rust: \".rs\",\n scala: \".scala\",\n haskell: \".hs\",\n lua: \".lua\",\n shell: \".sh\",\n sql: \".sql\",\n html: \".html\",\n css: \".css\",\n // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component\n};\n\nexport const generateRandomString = (length: number, lowercase = false) => {\n const chars = \"ABCDEFGHJKLMNPQRSTUVWXY3456789\"; // excluding similar looking characters like Z, 2, I, 1, O, 0\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return lowercase ? result.toLowerCase() : result;\n};\n\nconst CodeBlock: FC<Props> = memo(({ language, value }) => {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n const [SyntaxHighlighter, setSyntaxHighlighter] = useState<\n typeof Light | typeof Prism\n >(() => Light);\n\n useEffect(() => {\n try {\n new RegExp(\"(?<=#)\\\\w+\");\n setSyntaxHighlighter(() => Prism);\n } catch {\n setSyntaxHighlighter(() => Light);\n }\n }, []);\n\n const downloadAsFile = () => {\n if (typeof window === \"undefined\") {\n return;\n }\n const fileExtension = programmingLanguages[language] || \".file\";\n const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;\n const fileName = window.prompt(\"Enter file name\", suggestedFileName);\n\n if (!fileName) {\n // User pressed cancel on prompt.\n return;\n }\n\n const blob = new Blob([value], { type: \"text/plain\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.style.display = \"none\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n };\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(value);\n };\n\n return (\n <div className=\"copilotKitCodeBlock\">\n <div className=\"copilotKitCodeBlockToolbar\">\n <span className=\"copilotKitCodeBlockToolbarLanguage\">{language}</span>\n <div className=\"copilotKitCodeBlockToolbarButtons\">\n <button\n className=\"copilotKitCodeBlockToolbarButton\"\n onClick={downloadAsFile}\n >\n {DownloadIcon}\n </button>\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={onCopy}>\n {isCopied ? CheckIcon : CopyIcon}\n </button>\n </div>\n </div>\n <SyntaxHighlighter\n language={language}\n style={highlightStyle}\n PreTag=\"div\"\n customStyle={{\n margin: 0,\n borderBottomLeftRadius: \"0.375rem\",\n borderBottomRightRadius: \"0.375rem\",\n }}\n >\n {value}\n </SyntaxHighlighter>\n </div>\n );\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nexport { CodeBlock };\n\n// import { vscDarkPlus as highlightStyle } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n// As a workaround, we inline the vscDarkPlus from react-syntax-highlighter.\n// Importing it as recommended in the documentation leads to build errors in the non app router\n// (Next.js classic) setup.\nconst highlightStyle: any = {\n 'pre[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily:\n 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n padding: \"1em\",\n margin: \".5em 0\",\n overflow: \"auto\",\n background: \"#1e1e1e\",\n },\n 'code[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily:\n 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n },\n 'pre[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'pre[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n ':not(pre) > code[class*=\"language-\"]': {\n padding: \".1em .3em\",\n borderRadius: \".3em\",\n color: \"#db4c69\",\n background: \"#1e1e1e\",\n },\n \".namespace\": {\n Opacity: \".7\",\n },\n \"doctype.doctype-tag\": {\n color: \"#569CD6\",\n },\n \"doctype.name\": {\n color: \"#9cdcfe\",\n },\n comment: {\n color: \"#6a9955\",\n },\n prolog: {\n color: \"#6a9955\",\n },\n punctuation: {\n color: \"#d4d4d4\",\n },\n \".language-html .language-css .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n \".language-html .language-javascript .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n property: {\n color: \"#9cdcfe\",\n },\n tag: {\n color: \"#569cd6\",\n },\n boolean: {\n color: \"#569cd6\",\n },\n number: {\n color: \"#b5cea8\",\n },\n constant: {\n color: \"#9cdcfe\",\n },\n symbol: {\n color: \"#b5cea8\",\n },\n inserted: {\n color: \"#b5cea8\",\n },\n unit: {\n color: \"#b5cea8\",\n },\n selector: {\n color: \"#d7ba7d\",\n },\n \"attr-name\": {\n color: \"#9cdcfe\",\n },\n string: {\n color: \"#ce9178\",\n },\n char: {\n color: \"#ce9178\",\n },\n builtin: {\n color: \"#ce9178\",\n },\n deleted: {\n color: \"#ce9178\",\n },\n \".language-css .token.string.url\": {\n textDecoration: \"underline\",\n },\n operator: {\n color: \"#d4d4d4\",\n },\n entity: {\n color: \"#569cd6\",\n },\n \"operator.arrow\": {\n color: \"#569CD6\",\n },\n atrule: {\n color: \"#ce9178\",\n },\n \"atrule.rule\": {\n color: \"#c586c0\",\n },\n \"atrule.url\": {\n color: \"#9cdcfe\",\n },\n \"atrule.url.function\": {\n color: \"#dcdcaa\",\n },\n \"atrule.url.punctuation\": {\n color: \"#d4d4d4\",\n },\n keyword: {\n color: \"#569CD6\",\n },\n \"keyword.module\": {\n color: \"#c586c0\",\n },\n \"keyword.control-flow\": {\n color: \"#c586c0\",\n },\n function: {\n color: \"#dcdcaa\",\n },\n \"function.maybe-class-name\": {\n color: \"#dcdcaa\",\n },\n regex: {\n color: \"#d16969\",\n },\n important: {\n color: \"#569cd6\",\n },\n italic: {\n fontStyle: \"italic\",\n },\n \"class-name\": {\n color: \"#4ec9b0\",\n },\n \"maybe-class-name\": {\n color: \"#4ec9b0\",\n },\n console: {\n color: \"#9cdcfe\",\n },\n parameter: {\n color: \"#9cdcfe\",\n },\n interpolation: {\n color: \"#9cdcfe\",\n },\n \"punctuation.interpolation-punctuation\": {\n color: \"#569cd6\",\n },\n variable: {\n color: \"#9cdcfe\",\n },\n \"imports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n \"exports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n escape: {\n color: \"#d7ba7d\",\n },\n \"tag.punctuation\": {\n color: \"#808080\",\n },\n cdata: {\n color: \"#808080\",\n },\n \"attr-value\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation.attr-equals\": {\n color: \"#d4d4d4\",\n },\n namespace: {\n color: \"#4ec9b0\",\n },\n 'pre[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'code[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'pre[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n 'code[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n \".language-regex .token.anchor\": {\n color: \"#dcdcaa\",\n },\n \".language-html .token.punctuation\": {\n color: \"#808080\",\n },\n 'pre[class*=\"language-\"] > code[class*=\"language-\"]': {\n position: \"relative\",\n zIndex: \"1\",\n },\n \".line-highlight.line-highlight\": {\n background: \"#f7ebc6\",\n boxShadow: \"inset 5px 0 0 #f7d87c\",\n zIndex: \"0\",\n },\n};\n","import { FC, memo, useMemo } from \"react\";\nimport ReactMarkdown, { Options, Components } from \"react-markdown\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport rehypeRaw from \"rehype-raw\";\n\nconst defaultComponents: Components = {\n a({ children, ...props }) {\n return (\n <a\n className=\"copilotKitMarkdownElement\"\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {children}\n </a>\n );\n },\n // @ts-expect-error -- inline\n code({ children, className, inline, ...props }) {\n if (Array.isArray(children) && children.length) {\n if (children[0] == \"▍\") {\n return (\n <span\n style={{\n animation: \"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite\",\n marginTop: \"0.25rem\",\n }}\n >\n ▍\n </span>\n );\n }\n\n children[0] = (children?.[0] as string).replace(\"`▍`\", \"▍\");\n }\n\n const match = /language-(\\w+)/.exec(className || \"\");\n\n // Detect inline code: if it has a language class or contains newlines, it's likely a code block\n // Otherwise, treat it as inline code\n const hasLanguage = match && match[1];\n const content = String(children);\n const hasNewlines = content.includes(\"\\n\");\n const isInline = !hasLanguage && !hasNewlines;\n\n if (isInline) {\n return (\n <code\n className={`copilotKitMarkdownElement copilotKitInlineCode ${className || \"\"}`}\n {...props}\n >\n {children}\n </code>\n );\n }\n\n return (\n <CodeBlock\n language={(match && match[1]) || \"\"}\n value={String(children).replace(/\\n$/, \"\")}\n {...props}\n />\n );\n },\n h1: ({ children, ...props }) => (\n <h1 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h1>\n ),\n h2: ({ children, ...props }) => (\n <h2 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h2>\n ),\n h3: ({ children, ...props }) => (\n <h3 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h3>\n ),\n h4: ({ children, ...props }) => (\n <h4 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h4>\n ),\n h5: ({ children, ...props }) => (\n <h5 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h5>\n ),\n h6: ({ children, ...props }) => (\n <h6 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h6>\n ),\n p: ({ children, ...props }) => (\n <div className=\"copilotKitMarkdownElement copilotKitParagraph\" {...props}>\n {children}\n </div>\n ),\n pre: ({ children, ...props }) => (\n <pre className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </pre>\n ),\n blockquote: ({ children, ...props }) => (\n <blockquote className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </blockquote>\n ),\n ul: ({ children, ...props }) => (\n <ul className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </ul>\n ),\n li: ({ children, ...props }) => (\n <li className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </li>\n ),\n};\n\nconst MemoizedReactMarkdown: FC<Options> = memo(\n ReactMarkdown,\n (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.components === nextProps.components,\n);\n\ntype MarkdownProps = {\n content: string;\n components?: Components;\n};\n\nexport const Markdown = ({ content, components }: MarkdownProps) => {\n const mergedComponents = useMemo(\n () => ({ ...defaultComponents, ...components }),\n [components],\n );\n return (\n <div className=\"copilotKitMarkdown\">\n <MemoizedReactMarkdown\n components={mergedComponents}\n remarkPlugins={[\n remarkGfm,\n [remarkMath, { singleDollarTextMath: false }],\n ]}\n rehypePlugins={[rehypeRaw]}\n >\n {content}\n </MemoizedReactMarkdown>\n </div>\n );\n};\n","import { AssistantMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { Markdown } from \"../Markdown\";\nimport { useState } from \"react\";\nimport React from \"react\";\nimport { copyToClipboard } from \"@copilotkit/shared\";\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 = async () => {\n const content = message?.content || \"\";\n if (!content) return;\n\n const success = await copyToClipboard(content);\n if (success) {\n setCopied(true);\n if (onCopy) onCopy(content);\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?.() ?? props.subComponent;\n const subComponentPosition = message?.generativeUIPosition ?? \"after\";\n const renderBefore = subComponent && subComponentPosition === \"before\";\n const renderAfter = subComponent && subComponentPosition !== \"before\";\n\n return (\n <>\n {renderBefore ? (\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n ) : null}\n {content && (\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n {content && (\n <Markdown content={content} components={markdownTagRenderers} />\n )}\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\" }}>\n ✓\n </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 {renderAfter ? (\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n ) : null}\n {isLoading && <LoadingIcon />}\n </>\n );\n};\n","import React, { useState } from \"react\";\nimport { ImageRendererProps } from \"../props\";\n\n/**\n * @deprecated Use `CopilotChatAttachmentRenderer` from `@copilotkit/react-core/v2` instead.\n * `ImageRenderer` only handles images. The v2 attachment renderer supports images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport const ImageRenderer: React.FC<ImageRendererProps> = ({\n image,\n source,\n content,\n className = \"\",\n}) => {\n const [imageError, setImageError] = useState(false);\n\n // Determine image src from either legacy ImageData or new InputContentSource\n let imageSrc: string;\n if (source) {\n imageSrc =\n source.type === \"url\"\n ? source.value\n : `data:${source.mimeType};base64,${source.value}`;\n } else if (image) {\n imageSrc = `data:image/${image.format};base64,${image.bytes}`;\n } else {\n return null;\n }\n\n const altText = content || \"User uploaded image\";\n\n if (imageError) {\n return (\n <div\n className={`copilotKitImageRendering copilotKitImageRenderingError ${className}`}\n >\n <div className=\"copilotKitImageRenderingErrorMessage\">\n Failed to load image\n </div>\n {content && (\n <div className=\"copilotKitImageRenderingContent\">{content}</div>\n )}\n </div>\n );\n }\n\n return (\n <div className={`copilotKitImageRendering ${className}`}>\n <img\n src={imageSrc}\n alt={altText}\n className=\"copilotKitImageRenderingImage\"\n onError={() => setImageError(true)}\n />\n {content && (\n <div className=\"copilotKitImageRenderingContent\">{content}</div>\n )}\n </div>\n );\n};\n","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 default:\n return null;\n }\n}\n","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 (\n deprecatedMessage.isActionExecutionMessage() &&\n RenderActionExecutionMessage\n ) {\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","import React, { useEffect, useMemo, useRef } from \"react\";\nimport { MessagesProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { Message } from \"@copilotkit/shared\";\nimport { useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport {\n LegacyRenderMessage,\n LegacyRenderProps,\n} from \"./messages/LegacyRenderMessage\";\n\nexport const Messages = ({\n inProgress,\n children,\n RenderMessage,\n AssistantMessage,\n UserMessage,\n ErrorMessage,\n ImageRenderer,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n messageFeedback,\n markdownTagRenderers,\n chatError,\n\n // Legacy props\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n}: MessagesProps) => {\n const { labels, icons } = useChatContext();\n const { messages: visibleMessages, interrupt } = useCopilotChatInternal();\n const initialMessages = useMemo(\n () => makeInitialMessages(labels.initial),\n [labels.initial],\n );\n const messages = [...initialMessages, ...visibleMessages];\n const { messagesContainerRef, messagesEndRef } = useScrollToBottom(messages);\n\n // Check if any legacy props are provided\n const hasLegacyProps = !!(\n RenderTextMessage ||\n RenderActionExecutionMessage ||\n RenderAgentStateMessage ||\n RenderResultMessage ||\n RenderImageMessage\n );\n\n // Show deprecation warning if legacy props are used\n useEffect(() => {\n if (hasLegacyProps) {\n console.warn(\n \"[CopilotKit] Legacy message render props (RenderTextMessage, RenderActionExecutionMessage, etc.) are deprecated. \" +\n \"Please use the unified 'RenderMessage' prop instead. \" +\n \"See migration guide: https://docs.copilotkit.ai/migration/render-message\",\n );\n }\n }, [hasLegacyProps]);\n\n // Create legacy props object for the adapter\n const legacyProps: LegacyRenderProps = useMemo(\n () => ({\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n }),\n [\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n ],\n );\n\n // Determine which render component to use\n const MessageRenderer = hasLegacyProps\n ? (props: any) => (\n <LegacyRenderMessage {...props} legacyProps={legacyProps} />\n )\n : RenderMessage;\n\n const LoadingIcon = () => <span>{icons.activityIcon}</span>;\n\n return (\n <div className=\"copilotKitMessages\" ref={messagesContainerRef}>\n <div className=\"copilotKitMessagesContainer\">\n {messages.map((message, index) => {\n const isCurrentMessage = index === messages.length - 1;\n return (\n <MessageRenderer\n key={index}\n message={message}\n messages={messages}\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 messageFeedback={messageFeedback}\n markdownTagRenderers={markdownTagRenderers}\n />\n );\n })}\n {messages[messages.length - 1]?.role === \"user\" && inProgress && (\n <LoadingIcon />\n )}\n {interrupt}\n {chatError && ErrorMessage && (\n <ErrorMessage error={chatError} isCurrentMessage />\n )}\n </div>\n <footer className=\"copilotKitMessagesFooter\" ref={messagesEndRef}>\n {children}\n </footer>\n </div>\n );\n};\n\nfunction makeInitialMessages(\n initial: string | string[] | undefined,\n): Message[] {\n if (!initial) return [];\n\n if (Array.isArray(initial)) {\n return initial.map((message) => {\n return {\n id: message,\n role: \"assistant\",\n content: message,\n };\n });\n }\n\n return [\n {\n id: initial,\n role: \"assistant\",\n content: initial,\n },\n ];\n}\n\nexport function useScrollToBottom(messages: Message[]) {\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const messagesContainerRef = useRef<HTMLDivElement | null>(null);\n const isProgrammaticScrollRef = useRef(false);\n const isUserScrollUpRef = useRef(false);\n\n const scrollToBottom = () => {\n if (messagesContainerRef.current && messagesEndRef.current) {\n isProgrammaticScrollRef.current = true;\n messagesContainerRef.current.scrollTop =\n messagesContainerRef.current.scrollHeight;\n }\n };\n\n const handleScroll = () => {\n if (isProgrammaticScrollRef.current) {\n isProgrammaticScrollRef.current = false;\n return;\n }\n\n if (messagesContainerRef.current) {\n const { scrollTop, scrollHeight, clientHeight } =\n messagesContainerRef.current;\n isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;\n }\n };\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (container) {\n container.addEventListener(\"scroll\", handleScroll);\n }\n return () => {\n if (container) {\n container.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (!container) {\n return;\n }\n\n const mutationObserver = new MutationObserver(() => {\n if (!isUserScrollUpRef.current) {\n scrollToBottom();\n }\n });\n\n mutationObserver.observe(container, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, []);\n\n useEffect(() => {\n isUserScrollUpRef.current = false;\n scrollToBottom();\n }, [messages.filter((m) => m.role === \"user\").length]);\n\n return { messagesEndRef, messagesContainerRef };\n}\n","import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n} from \"react\";\n\ninterface AutoResizingTextareaProps {\n maxRows?: number;\n placeholder?: string;\n value: string;\n onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;\n onCompositionStart?: () => void;\n onCompositionEnd?: () => void;\n autoFocus?: boolean;\n}\n\nconst AutoResizingTextarea = forwardRef<\n HTMLTextAreaElement,\n AutoResizingTextareaProps\n>(\n (\n {\n maxRows = 1,\n placeholder,\n value,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n autoFocus,\n },\n ref,\n ) => {\n const internalTextareaRef = useRef<HTMLTextAreaElement>(null);\n const [maxHeight, setMaxHeight] = useState<number>(0);\n\n useImperativeHandle(\n ref,\n () => internalTextareaRef.current as HTMLTextAreaElement,\n );\n\n useEffect(() => {\n const calculateMaxHeight = () => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n const singleRowHeight = textarea.scrollHeight;\n setMaxHeight(singleRowHeight * maxRows);\n if (autoFocus) {\n textarea.focus();\n }\n }\n };\n\n calculateMaxHeight();\n }, [maxRows]);\n\n useEffect(() => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;\n }\n }, [value, maxHeight]);\n\n return (\n <textarea\n ref={internalTextareaRef}\n value={value}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onCompositionStart={onCompositionStart}\n onCompositionEnd={onCompositionEnd}\n placeholder={placeholder}\n style={{\n overflow: \"auto\",\n resize: \"none\",\n maxHeight: `${maxHeight}px`,\n }}\n rows={1}\n />\n );\n },\n);\n\nexport default AutoResizingTextarea;\n","import {\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"@copilotkit/react-core\";\nimport { gqlToAGUI } from \"@copilotkit/runtime-client-gql\";\nimport { Message } from \"@copilotkit/shared\";\nimport { MutableRefObject, useEffect, useRef, useState } from \"react\";\n\nexport const checkMicrophonePermission = async () => {\n try {\n const permissionStatus = await navigator.permissions.query({\n name: \"microphone\" as PermissionName,\n });\n if (permissionStatus.state === \"granted\") {\n return true;\n } else {\n return false;\n }\n } catch (err) {\n console.error(\"Error checking microphone permission\", err);\n }\n};\n\nexport const requestMicAndPlaybackPermission = async () => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n const audioContext = new window.AudioContext();\n await audioContext.resume();\n return { stream, audioContext };\n } catch (err) {\n console.error(\"Error requesting microphone and playback permissions\", err);\n return null;\n }\n};\n\nconst startRecording = async (\n mediaStreamRef: MutableRefObject<MediaStream | null>,\n mediaRecorderRef: MutableRefObject<MediaRecorder | null>,\n audioContextRef: MutableRefObject<AudioContext | null>,\n recordedChunks: Blob[],\n onStop: () => void,\n) => {\n if (!mediaStreamRef.current || !audioContextRef.current) {\n mediaStreamRef.current = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n audioContextRef.current = new window.AudioContext();\n await audioContextRef.current.resume();\n }\n\n mediaRecorderRef.current = new MediaRecorder(mediaStreamRef.current!);\n mediaRecorderRef.current.start(1000);\n mediaRecorderRef.current.ondataavailable = (event) => {\n recordedChunks.push(event.data);\n };\n mediaRecorderRef.current.onstop = onStop;\n};\n\nconst stopRecording = (\n mediaRecorderRef: MutableRefObject<MediaRecorder | null>,\n) => {\n if (\n mediaRecorderRef.current &&\n mediaRecorderRef.current.state !== \"inactive\"\n ) {\n mediaRecorderRef.current.stop();\n }\n};\n\nconst transcribeAudio = async (\n recordedChunks: Blob[],\n transcribeAudioUrl: string,\n) => {\n const completeBlob = new Blob(recordedChunks, { type: \"audio/mp4\" });\n const formData = new FormData();\n formData.append(\"file\", completeBlob, \"recording.mp4\");\n\n const response = await fetch(transcribeAudioUrl, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n\n const transcription = await response.json();\n return transcription.text;\n};\n\nconst playAudioResponse = (\n text: string,\n textToSpeechUrl: string,\n audioContext: AudioContext,\n) => {\n const encodedText = encodeURIComponent(text);\n const url = `${textToSpeechUrl}?text=${encodedText}`;\n\n fetch(url)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer))\n .then((audioBuffer) => {\n const source = audioContext.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioContext.destination);\n source.start(0);\n })\n .catch((error) => {\n console.error(\"Error with decoding audio data\", error);\n });\n};\n\nexport type PushToTalkState = \"idle\" | \"recording\" | \"transcribing\";\n\nexport type SendFunction = (text: string) => Promise<Message>;\n\nexport const usePushToTalk = ({\n sendFunction,\n inProgress,\n}: {\n sendFunction: SendFunction;\n inProgress: boolean;\n}) => {\n const [pushToTalkState, setPushToTalkState] =\n useState<PushToTalkState>(\"idle\");\n const mediaStreamRef = useRef<MediaStream | null>(null);\n const audioContextRef = useRef<AudioContext | null>(null);\n const mediaRecorderRef = useRef<MediaRecorder | null>(null);\n const recordedChunks = useRef<Blob[]>([]);\n const generalContext = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n const context = { ...generalContext, ...messagesContext };\n const [startReadingFromMessageId, setStartReadingFromMessageId] = useState<\n string | null\n >(null);\n\n useEffect(() => {\n if (pushToTalkState === \"recording\") {\n startRecording(\n mediaStreamRef,\n mediaRecorderRef,\n audioContextRef,\n recordedChunks.current,\n () => {\n setPushToTalkState(\"transcribing\");\n },\n );\n } else {\n stopRecording(mediaRecorderRef);\n if (pushToTalkState === \"transcribing\") {\n transcribeAudio(\n recordedChunks.current,\n context.copilotApiConfig.transcribeAudioUrl!,\n ).then(async (transcription) => {\n recordedChunks.current = [];\n setPushToTalkState(\"idle\");\n const message = await sendFunction(transcription);\n setStartReadingFromMessageId(message.id);\n });\n }\n }\n\n return () => {\n stopRecording(mediaRecorderRef);\n };\n }, [pushToTalkState]);\n\n useEffect(() => {\n if (inProgress === false && startReadingFromMessageId) {\n const lastMessageIndex = context.messages.findIndex(\n (message) => message.id === startReadingFromMessageId,\n );\n\n const aguiMessages = gqlToAGUI(context.messages);\n\n const messagesAfterLast = aguiMessages\n .slice(lastMessageIndex + 1)\n .filter((message) => message.role === \"assistant\");\n\n const text = messagesAfterLast\n .map((message) => message.content)\n .join(\"\\n\");\n playAudioResponse(\n text,\n context.copilotApiConfig.textToSpeechUrl!,\n audioContextRef.current!,\n );\n\n setStartReadingFromMessageId(null);\n }\n }, [startReadingFromMessageId, inProgress]);\n\n return { pushToTalkState, setPushToTalkState };\n};\n","export const useDarkMode = () => {\n if (typeof window === \"undefined\") return false;\n return (\n document.documentElement.classList.contains(\"dark\") ||\n document.body.classList.contains(\"dark\") ||\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ||\n document.body.getAttribute(\"data-theme\") === \"dark\" ||\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n );\n};\n","import React, { useState, useEffect } from \"react\";\nimport { useDarkMode } from \"../../hooks/use-dark-mode\";\n\nexport function PoweredByTag({\n showPoweredBy = true,\n removeBranding = false,\n}: {\n showPoweredBy?: boolean;\n removeBranding?: boolean;\n}) {\n const [mounted, setMounted] = useState(false);\n const isDark = useDarkMode();\n\n /*\n note(tylerslaton):\n\n Ensure we only use the isDark computed value after client-side mount.\n This prevents hydration mismatches by using a default color on the\n server and initial client render, then updating to the correct\n dark mode color after hydration is complete.\n */\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!showPoweredBy || removeBranding) {\n return null;\n }\n\n const poweredByStyle = {\n visibility: \"visible\",\n display: \"block\",\n position: \"static\",\n textAlign: \"center\",\n fontSize: \"12px\",\n padding: \"3px 0\",\n color: mounted && isDark ? \"rgb(69, 69, 69)\" : \"rgb(214, 214, 214)\",\n };\n\n return (\n <div>\n {/*@ts-expect-error -- expecting position not to be a string, but it can be.*/}\n <p className=\"poweredBy\" style={poweredByStyle}>\n Powered by CopilotKit\n </p>\n </div>\n );\n}\n","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 {\n useCopilotContext,\n useCopilotChatInternal,\n} from \"@copilotkit/react-core\";\nimport { PoweredByTag } from \"./PoweredByTag\";\n\nconst MAX_NEWLINES = 6;\n\nexport const Input = ({\n inProgress,\n onSend,\n chatReady = false,\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)\n return { buttonIcon: context.icons.spinnerIcon, buttonAlt: \"Loading\" };\n return isInProgress && !hideStopButton && chatReady\n ? { buttonIcon: context.icons.stopIcon, buttonAlt: \"Stop\" }\n : { buttonIcon: context.icons.sendIcon, buttonAlt: \"Send\" };\n }, [\n isInProgress,\n chatReady,\n hideStopButton,\n context.icons.stopIcon,\n context.icons.sendIcon,\n ]);\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const { interrupt } = useCopilotChatInternal();\n\n const canSend = useMemo(() => {\n return (\n !isInProgress &&\n text.trim().length > 0 &&\n pushToTalkState === \"idle\" &&\n !interrupt\n );\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\n className={`copilotKitInputContainer ${showPoweredBy ? \"poweredByContainer\" : \"\"}`}\n >\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(\n pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\",\n )\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={\n inProgress\n ? \"copilot-chat-request-in-progress\"\n : \"copilot-chat-ready\"\n }\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","import React from \"react\";\nimport type { Attachment } from \"./props\";\nimport {\n formatFileSize,\n getSourceUrl,\n getDocumentIcon,\n} from \"@copilotkit/shared\";\n\ninterface AttachmentQueueProps {\n attachments: Attachment[];\n onRemoveAttachment: (id: string) => void;\n className?: string;\n}\n\nexport const AttachmentQueue: React.FC<AttachmentQueueProps> = ({\n attachments,\n onRemoveAttachment,\n className = \"\",\n}) => {\n if (attachments.length === 0) return null;\n\n return (\n <div className={`copilotKitAttachmentQueue ${className}`}>\n {attachments.map((attachment) => (\n <div\n key={attachment.id}\n className={`copilotKitAttachmentQueueItem copilotKitAttachmentQueueItem--${attachment.type}`}\n >\n {attachment.status === \"uploading\" && (\n <div className=\"copilotKitAttachmentQueueOverlay\">\n <div className=\"copilotKitAttachmentQueueSpinner\" />\n </div>\n )}\n <AttachmentPreview attachment={attachment} />\n <button\n onClick={() => onRemoveAttachment(attachment.id)}\n className=\"copilotKitAttachmentQueueRemoveButton\"\n aria-label=\"Remove attachment\"\n >\n ✕\n </button>\n </div>\n ))}\n </div>\n );\n};\n\nfunction AttachmentPreview({ attachment }: { attachment: Attachment }) {\n if (attachment.status === \"uploading\") {\n return <div className=\"copilotKitAttachmentQueuePreviewPlaceholder\" />;\n }\n\n const src = getSourceUrl(attachment.source);\n\n switch (attachment.type) {\n case \"image\":\n return (\n <img\n src={src}\n alt={attachment.filename || \"Image attachment\"}\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n );\n\n case \"audio\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewAudio\">\n <audio src={src} controls preload=\"metadata\" />\n {attachment.filename && (\n <span className=\"copilotKitAttachmentQueueFilename\">\n {attachment.filename}\n </span>\n )}\n </div>\n );\n\n case \"video\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewVideo\">\n {attachment.thumbnail ? (\n <img\n src={attachment.thumbnail}\n alt={attachment.filename || \"Video thumbnail\"}\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n ) : (\n <video\n src={src}\n preload=\"metadata\"\n muted\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n )}\n </div>\n );\n\n case \"document\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewDocument\">\n <div className=\"copilotKitAttachmentQueueDocIcon\">\n {getDocumentIcon(attachment.source.mimeType ?? \"\")}\n </div>\n <div className=\"copilotKitAttachmentQueueDocInfo\">\n <span className=\"copilotKitAttachmentQueueFilename\">\n {attachment.filename || \"Document\"}\n </span>\n {attachment.size != null && (\n <span className=\"copilotKitAttachmentQueueFileSize\">\n {formatFileSize(attachment.size)}\n </span>\n )}\n </div>\n </div>\n );\n }\n}\n\n/**\n * @deprecated Use `AttachmentQueue` from `@copilotkit/react-ui` instead.\n * `ImageUploadQueue` only displayed image previews. `AttachmentQueue` supports\n * images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport { AttachmentQueue as ImageUploadQueue };\n","// Re-export utilities from shared\nexport {\n getModalityFromMimeType,\n formatFileSize,\n exceedsMaxSize,\n readFileAsBase64,\n generateVideoThumbnail,\n matchesAcceptFilter,\n} from \"@copilotkit/shared\";\n\n// Deprecation warning helpers — react-ui specific\nconst suppressedWarnings = new Set<string>();\nlet globalSuppress = false;\n\n/**\n * Issue a deprecation warning once per key per session.\n * Suppressed entirely if the user calls suppressDeprecationWarnings().\n */\nexport function deprecationWarning(key: string, message: string) {\n if (globalSuppress || suppressedWarnings.has(key)) return;\n if (typeof process !== \"undefined\" && process.env?.NODE_ENV === \"production\")\n return;\n suppressedWarnings.add(key);\n console.warn(`[CopilotKit] Deprecation: ${message}`);\n}\n\n/**\n * Suppress all CopilotKit deprecation warnings.\n */\nexport function suppressDeprecationWarnings() {\n globalSuppress = true;\n}\n","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({\n title,\n onClick,\n partial,\n className,\n}: SuggestionsProps) {\n const { isLoading } = useCopilotChatInternal();\n if (!title) return null;\n\n return (\n <button\n disabled={partial || isLoading}\n onClick={(e) => {\n e.preventDefault();\n onClick();\n }}\n className={`suggestion ${className ?? \"\"} ${partial ? \"loading\" : \"\"}`}\n data-test-id=\"suggestion\"\n type=\"button\"\n >\n {partial ? SmallSpinnerIcon : <span>{title}</span>}\n </button>\n );\n}\n","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","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotChat.gif\" width=\"500\" />\n *\n * A chatbot panel component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ## Usage\n *\n * ```tsx\n * import { CopilotChat } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotChat\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotChat\n * observabilityHooks={{\n * onMessageSent: (message) => {\n * console.log(\"Message sent:\", message);\n * },\n * }}\n * />\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\n\nimport {\n ChatContext,\n ChatContextProvider,\n CopilotChatIcons,\n CopilotChatLabels,\n} from \"./ChatContext\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { RenderMessage as DefaultRenderMessage } from \"./messages/RenderMessage\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./messages/AssistantMessage\";\nimport { UserMessage as DefaultUserMessage } from \"./messages/UserMessage\";\nimport { ImageRenderer as DefaultImageRenderer } from \"./messages/ImageRenderer\";\nimport React, { useEffect, useRef, useState, useCallback } from \"react\";\nimport {\n SystemMessageFunction,\n useCopilotContext,\n useCopilotChatInternal,\n type OnStopGeneration,\n type OnReloadMessages,\n type ChatSuggestions,\n} from \"@copilotkit/react-core\";\nimport {\n CopilotKitError,\n CopilotKitErrorCode,\n CopilotErrorEvent,\n Message,\n Severity,\n ErrorVisibility,\n styledConsole,\n CopilotErrorHandler,\n randomUUID,\n} from \"@copilotkit/shared\";\nimport {\n AssistantMessageProps,\n ChatError,\n ComponentsMap,\n CopilotObservabilityHooks,\n ErrorMessageProps,\n ImageRendererProps,\n InputProps,\n MessagesProps,\n RenderMessageProps,\n RenderSuggestionsListProps,\n UserMessageProps,\n} from \"./props\";\n\nimport { AttachmentQueue } from \"./AttachmentQueue\";\nimport type { Attachment, AttachmentsConfig } from \"./props\";\nimport {\n getModalityFromMimeType,\n exceedsMaxSize,\n readFileAsBase64,\n generateVideoThumbnail,\n matchesAcceptFilter,\n formatFileSize,\n deprecationWarning,\n} from \"./attachment-utils\";\nimport type { InputContent } from \"@copilotkit/shared\";\nimport { Suggestions as DefaultRenderSuggestionsList } from \"./Suggestions\";\n\n/**\n * Props for CopilotChat component.\n */\nexport interface CopilotChatProps {\n /**\n * Custom instructions to be added to the system message. Use this property to\n * provide additional context or guidance to the language model, influencing\n * its responses. These instructions can include specific directions,\n * preferences, or criteria that the model should consider when generating\n * its output, thereby tailoring the conversation more precisely to the\n * user's needs or the application's requirements.\n */\n instructions?: string;\n\n /**\n * Controls the behavior of suggestions in the chat interface.\n *\n * `auto` (default) - Suggestions are generated automatically:\n * - When the chat is first opened (empty state)\n * - After each message exchange completes\n * - Uses configuration from `useCopilotChatSuggestions` hooks\n *\n * `manual` - Suggestions are controlled programmatically:\n * - Use `setSuggestions()` to set custom suggestions\n * - Use `generateSuggestions()` to trigger AI generation\n * - Access via `useCopilotChat` hook\n *\n * `SuggestionItem[]` - Static suggestions array:\n * - Always shows the same suggestions\n * - No AI generation involved\n */\n suggestions?: ChatSuggestions;\n\n /**\n * A callback that gets called when the in progress state changes.\n */\n onInProgress?: (inProgress: boolean) => void;\n\n /**\n * A callback that gets called when a new message it submitted.\n */\n onSubmitMessage?: (message: string) => void | Promise<void>;\n\n /**\n * A custom stop generation function.\n */\n onStopGeneration?: OnStopGeneration;\n\n /**\n * A custom reload messages function.\n */\n onReloadMessages?: OnReloadMessages;\n\n /**\n * A callback function to regenerate the assistant's response\n */\n onRegenerate?: (messageId: string) => void;\n\n /**\n * A callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n\n /**\n * A callback function for thumbs up feedback\n */\n onThumbsUp?: (message: Message) => void;\n\n /**\n * A 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 * Icons can be used to set custom icons for the chat window.\n */\n icons?: CopilotChatIcons;\n\n /**\n * Labels can be used to set custom labels for the chat window.\n */\n labels?: CopilotChatLabels;\n\n /**\n * @deprecated Use `attachments={{ enabled: true }}` instead.\n * `imageUploadsEnabled` only supports images. The new `attachments` prop supports\n * images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n *\n * Enable image upload button (image inputs only supported on some models)\n */\n imageUploadsEnabled?: boolean;\n\n /**\n * @deprecated Use `attachments={{ enabled: true, accept: \"...\" }}` instead.\n * The `accept` field on the `attachments` prop replaces `inputFileAccept`.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n *\n * The 'accept' attribute for the file input used for image uploads.\n * Defaults to \"image/*\".\n */\n inputFileAccept?: string;\n\n /**\n * Configuration for file attachments in the chat input.\n * Enables users to attach images, audio, video, and documents.\n *\n * @example\n * ```tsx\n * <CopilotChat\n * attachments={{\n * enabled: true,\n * accept: \"image/*,application/pdf\",\n * maxSize: 10 * 1024 * 1024, // 10MB\n * onUpload: async (file) => {\n * const url = await uploadToS3(file);\n * return { url, mimeType: file.type };\n * },\n * }}\n * />\n * ```\n */\n attachments?: AttachmentsConfig;\n\n /**\n * A function that takes in context string and instructions and returns\n * the system message to include in the chat request.\n * Use this to completely override the system message, when providing\n * instructions is not enough.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * 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>).\n */\n disableSystemMessage?: boolean;\n\n /**\n * A custom assistant message component to use instead of the default.\n */\n AssistantMessage?: React.ComponentType<AssistantMessageProps>;\n\n /**\n * A custom user message component to use instead of the default.\n */\n UserMessage?: React.ComponentType<UserMessageProps>;\n\n /**\n * A custom error message component to use instead of the default.\n */\n ErrorMessage?: React.ComponentType<ErrorMessageProps>;\n\n /**\n * A custom Messages component to use instead of the default.\n */\n Messages?: React.ComponentType<MessagesProps>;\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 /**\n * A custom RenderMessage component to use instead of the default.\n *\n * **Warning**: This is a break-glass solution to allow for custom\n * rendering of messages. You are most likely looking to swap out\n * the AssistantMessage and UserMessage components instead which\n * are also props.\n */\n RenderMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom suggestions list component to use instead of the default.\n */\n RenderSuggestionsList?: React.ComponentType<RenderSuggestionsListProps>;\n\n /**\n * A custom Input component to use instead of the default.\n */\n Input?: React.ComponentType<InputProps>;\n\n /**\n * @deprecated Use the v2 `CopilotChat` attachment system instead.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n *\n * A custom image rendering component to use instead of the default.\n */\n ImageRenderer?: React.ComponentType<ImageRendererProps>;\n\n /**\n * A class name to apply to the root element.\n */\n className?: string;\n\n /**\n * Children to render.\n */\n children?: React.ReactNode;\n\n hideStopButton?: boolean;\n\n /**\n * Event hooks for CopilotKit chat events.\n * These hooks only work when publicApiKey is provided.\n */\n observabilityHooks?: CopilotObservabilityHooks;\n\n /**\n * Custom error renderer for chat-specific errors.\n * When provided, errors will be displayed inline within the chat interface.\n */\n renderError?: (error: {\n message: string;\n operation?: string;\n timestamp: number;\n onDismiss: () => void;\n onRetry?: () => void;\n }) => React.ReactNode;\n\n /**\n * Optional handler for comprehensive debugging and observability.\n */\n onError?: CopilotErrorHandler;\n}\n\n/**\n * @deprecated Use the `Attachment` type from `@copilotkit/react-ui` instead.\n * `ImageUpload` only described image payloads. `Attachment` supports images,\n * audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport type ImageUpload = {\n contentType: string;\n bytes: string;\n};\n\nexport function CopilotChat({\n instructions,\n suggestions = \"auto\",\n onSubmitMessage,\n makeSystemMessage,\n disableSystemMessage,\n onInProgress,\n onStopGeneration,\n onReloadMessages,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n markdownTagRenderers,\n Messages = DefaultMessages,\n RenderMessage = DefaultRenderMessage,\n RenderSuggestionsList = DefaultRenderSuggestionsList,\n Input = DefaultInput,\n className,\n icons,\n labels,\n AssistantMessage = DefaultAssistantMessage,\n UserMessage = DefaultUserMessage,\n ImageRenderer = DefaultImageRenderer,\n ErrorMessage,\n imageUploadsEnabled,\n inputFileAccept = \"image/*\",\n attachments,\n hideStopButton,\n observabilityHooks,\n renderError,\n onError,\n // Legacy props - deprecated\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n}: CopilotChatProps) {\n const {\n additionalInstructions,\n setChatInstructions,\n copilotApiConfig,\n setBannerError,\n setInternalErrorHandler,\n removeInternalErrorHandler,\n } = useCopilotContext();\n\n // Destructure stable values to avoid object reference changes\n const { publicApiKey, chatApiEndpoint } = copilotApiConfig;\n\n // Resolve attachments config with deprecation bridge\n const resolvedAttachments: AttachmentsConfig | undefined = (() => {\n if (attachments) return attachments;\n if (imageUploadsEnabled) {\n deprecationWarning(\n \"imageUploadsEnabled\",\n \"imageUploadsEnabled is deprecated. Use attachments={{ enabled: true }} instead. \" +\n \"See https://docs.copilotkit.ai/migration-guides/migrate-attachments\",\n );\n return { enabled: true, accept: inputFileAccept || \"image/*\" };\n }\n return undefined;\n })();\n\n const attachmentsEnabled = resolvedAttachments?.enabled ?? false;\n const attachmentsAccept = resolvedAttachments?.accept ?? \"*/*\";\n const attachmentsMaxSize = resolvedAttachments?.maxSize ?? 20 * 1024 * 1024;\n\n const [selectedAttachments, setSelectedAttachments] = useState<Attachment[]>(\n [],\n );\n const [dragOver, setDragOver] = useState(false);\n const processFilesRef = useRef<(files: File[]) => Promise<void>>(\n async () => {},\n );\n\n const [chatError, setChatError] = useState<ChatError | null>(null);\n const [messageFeedback, setMessageFeedback] = useState<\n Record<string, \"thumbsUp\" | \"thumbsDown\">\n >({});\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n // Helper function to trigger event hooks only if publicApiKey is provided\n const triggerObservabilityHook = useCallback(\n (hookName: keyof CopilotObservabilityHooks, ...args: any[]) => {\n if (publicApiKey && observabilityHooks?.[hookName]) {\n (observabilityHooks[hookName] as any)(...args);\n }\n if (observabilityHooks?.[hookName] && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message: \"observabilityHooks requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks\");\n }\n },\n [publicApiKey, observabilityHooks, setBannerError],\n );\n\n // Helper function to trigger chat error and render error UI\n const triggerChatError = useCallback(\n (error: any, operation: string, originalError?: any) => {\n const errorMessage =\n error?.message || error?.toString() || \"An error occurred\";\n\n console.error(\n `[CopilotKit] ${operation} error:`,\n errorMessage,\n originalError ?? error,\n );\n\n // Set chat error state for rendering\n setChatError({\n message: errorMessage,\n operation,\n timestamp: Date.now(),\n });\n\n const errorEvent: CopilotErrorEvent = {\n type: \"error\",\n timestamp: Date.now(),\n context: {\n source: \"ui\",\n request: {\n operation,\n url: chatApiEndpoint,\n startTime: Date.now(),\n },\n technical: {\n environment: \"browser\",\n userAgent:\n typeof navigator !== \"undefined\"\n ? navigator.userAgent\n : undefined,\n stackTrace:\n originalError instanceof Error ? originalError.stack : undefined,\n },\n },\n error,\n };\n\n if (onError) {\n onError(errorEvent);\n }\n\n // Also trigger observability hook if available\n if (publicApiKey && observabilityHooks?.onError) {\n observabilityHooks.onError(errorEvent);\n }\n\n // Show banner error if onError hook is used without publicApiKey\n if (observabilityHooks?.onError && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message:\n \"observabilityHooks.onError requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks.onError\");\n }\n },\n [publicApiKey, chatApiEndpoint, observabilityHooks, setBannerError],\n );\n\n useEffect(() => {\n const id = \"chat-component\";\n setInternalErrorHandler({\n [id]: (error: CopilotErrorEvent) => {\n if (!error) return;\n triggerChatError(error.error, \"sendMessage\");\n },\n });\n return () => {\n // unregister when this instance unmounts\n removeInternalErrorHandler?.(id);\n };\n }, [triggerChatError, setInternalErrorHandler, removeInternalErrorHandler]);\n\n // Clipboard paste handler\n useEffect(() => {\n if (!attachmentsEnabled) return;\n\n const handlePaste = async (e: ClipboardEvent) => {\n const target = e.target as HTMLElement;\n if (!target.parentElement?.classList.contains(\"copilotKitInput\")) return;\n\n const items = Array.from(e.clipboardData?.items || []);\n const fileItems = items.filter(\n (item) =>\n item.kind === \"file\" &&\n item.getAsFile() !== null &&\n matchesAcceptFilter(item.getAsFile()!, attachmentsAccept),\n );\n\n if (fileItems.length === 0) return;\n e.preventDefault();\n\n const files = fileItems\n .map((item) => item.getAsFile())\n .filter((f): f is File => f !== null);\n\n try {\n await processFilesRef.current(files);\n } catch (error) {\n triggerChatError(error, \"pasteUpload\", error);\n }\n };\n\n document.addEventListener(\"paste\", handlePaste);\n return () => document.removeEventListener(\"paste\", handlePaste);\n }, [\n attachmentsEnabled,\n attachmentsAccept,\n attachmentsMaxSize,\n triggerChatError,\n ]);\n\n useEffect(() => {\n if (!additionalInstructions?.length) {\n setChatInstructions(instructions || \"\");\n return;\n }\n\n /*\n Will result in a prompt like:\n\n You are a helpful assistant. \n Additionally, follow these instructions:\n - Do not answer questions about the weather.\n - Do not answer questions about the stock market.\"\n */\n const combinedAdditionalInstructions = [\n instructions,\n \"Additionally, follow these instructions:\",\n ...additionalInstructions.map((instruction) => `- ${instruction}`),\n ];\n\n setChatInstructions(combinedAdditionalInstructions.join(\"\\n\") || \"\");\n }, [instructions, additionalInstructions]);\n\n const {\n messages,\n isLoading,\n sendMessage,\n stopGeneration,\n reloadMessages,\n suggestions: currentSuggestions,\n isLoadingSuggestions,\n agent,\n } = useCopilotChatInternal({\n suggestions,\n onInProgress,\n onSubmitMessage,\n onStopGeneration,\n onReloadMessages,\n });\n // makeSystemMessage,\n // disableSystemMessage,\n\n // Track loading state changes for chat start/stop events\n const prevIsLoading = useRef(isLoading);\n useEffect(() => {\n if (prevIsLoading.current !== isLoading) {\n if (isLoading) {\n triggerObservabilityHook(\"onChatStarted\");\n } else {\n triggerObservabilityHook(\"onChatStopped\");\n }\n prevIsLoading.current = isLoading;\n }\n }, [isLoading, triggerObservabilityHook]);\n\n // Wrapper for sendMessage to clear selected attachments and build multimodal content\n const handleSendMessage = (text: string) => {\n const hasUploading = selectedAttachments.some(\n (a) => a.status === \"uploading\",\n );\n if (hasUploading) {\n triggerChatError(\n new Error(\"Attachment(s) still uploading. Please wait.\"),\n \"sendMessage\",\n );\n // Return a promise that resolves to a dummy message to satisfy the return type\n return Promise.resolve({\n id: randomUUID(),\n content: text,\n role: \"user\" as const,\n } as Message);\n }\n\n const currentAttachments = selectedAttachments.filter(\n (a) => a.status === \"ready\",\n );\n setSelectedAttachments([]);\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n\n // Trigger message sent event\n triggerObservabilityHook(\"onMessageSent\", text);\n\n // Build content: if we have attachments, use InputContent[]\n if (currentAttachments.length > 0) {\n const contentParts: InputContent[] = [];\n\n if (text.trim()) {\n contentParts.push({ type: \"text\", text });\n }\n\n for (const attachment of currentAttachments) {\n contentParts.push({\n type: attachment.type,\n source: attachment.source,\n metadata: {\n ...(attachment.filename ? { filename: attachment.filename } : {}),\n ...attachment.metadata,\n },\n } as InputContent);\n }\n\n return sendMessage({\n id: randomUUID(),\n content: contentParts,\n role: \"user\",\n });\n }\n\n // Plain text message\n return sendMessage({\n id: randomUUID(),\n content: text,\n role: \"user\",\n });\n };\n\n const chatContext = React.useContext(ChatContext);\n const isVisible = chatContext ? chatContext.open : true;\n\n const handleRegenerate = (messageId: string) => {\n if (onRegenerate) {\n onRegenerate(messageId);\n }\n\n // Trigger message regenerated event\n triggerObservabilityHook(\"onMessageRegenerated\", messageId);\n\n reloadMessages(messageId);\n };\n\n const handleCopy = (message: string) => {\n if (onCopy) {\n onCopy(message);\n }\n\n // Trigger message copied event\n triggerObservabilityHook(\"onMessageCopied\", message);\n };\n\n const processFiles = async (files: File[]) => {\n const validFiles = files.filter((file) =>\n matchesAcceptFilter(file, attachmentsAccept),\n );\n const rejectedFiles = files.filter(\n (file) => !matchesAcceptFilter(file, attachmentsAccept),\n );\n for (const file of rejectedFiles) {\n const message = `File \"${file.name}\" is not accepted. Supported types: ${attachmentsAccept}`;\n triggerChatError(new Error(message), \"fileUpload\");\n resolvedAttachments?.onUploadFailed?.({\n reason: \"invalid-type\",\n file,\n message,\n });\n }\n\n for (const file of validFiles) {\n if (exceedsMaxSize(file, attachmentsMaxSize)) {\n const message = `File \"${file.name}\" exceeds the maximum size of ${formatFileSize(attachmentsMaxSize)}`;\n triggerChatError(new Error(message), \"fileUpload\");\n resolvedAttachments?.onUploadFailed?.({\n reason: \"file-too-large\",\n file,\n message,\n });\n continue;\n }\n\n const modality = getModalityFromMimeType(file.type);\n\n // Use a unique ID to track this placeholder across concurrent uploads\n const placeholderId = randomUUID();\n const placeholder: Attachment = {\n id: placeholderId,\n type: modality,\n source: { type: \"data\", value: \"\", mimeType: file.type },\n filename: file.name,\n size: file.size,\n status: \"uploading\",\n };\n\n setSelectedAttachments((prev) => [...prev, placeholder]);\n\n try {\n let source: Attachment[\"source\"];\n let uploadMetadata: Record<string, unknown> | undefined;\n\n if (resolvedAttachments?.onUpload) {\n const { metadata: meta, ...uploadSource } =\n await resolvedAttachments.onUpload(file);\n source = uploadSource;\n uploadMetadata = meta;\n } else {\n const base64 = await readFileAsBase64(file);\n source = { type: \"data\", value: base64, mimeType: file.type };\n }\n\n // Generate video thumbnail if applicable\n let thumbnail: string | undefined;\n if (modality === \"video\") {\n thumbnail = await generateVideoThumbnail(file);\n }\n\n setSelectedAttachments((prev) =>\n prev.map((att) =>\n att.id === placeholderId\n ? {\n ...att,\n source,\n status: \"ready\" as const,\n thumbnail,\n metadata: uploadMetadata,\n }\n : att,\n ),\n );\n } catch (error) {\n // Remove the failed placeholder\n setSelectedAttachments((prev) =>\n prev.filter((att) => att.id !== placeholderId),\n );\n const message = error instanceof Error ? error.message : String(error);\n triggerChatError(\n new Error(`Failed to upload \"${file.name}\": ${message}`),\n \"fileUpload\",\n error,\n );\n resolvedAttachments?.onUploadFailed?.({\n reason: \"upload-failed\",\n file,\n message: `Failed to upload \"${file.name}\": ${message}`,\n });\n }\n }\n };\n processFilesRef.current = processFiles;\n\n const handleFileUpload = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (!event.target.files || event.target.files.length === 0) return;\n try {\n await processFiles(Array.from(event.target.files));\n } catch (error) {\n triggerChatError(error, \"fileUpload\", error);\n }\n };\n\n // Drag-and-drop handlers\n const handleDragOver = (e: React.DragEvent) => {\n if (!attachmentsEnabled) return;\n e.preventDefault();\n e.stopPropagation();\n setDragOver(true);\n };\n\n const handleDragLeave = (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n };\n\n const handleDrop = async (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n if (!attachmentsEnabled) return;\n\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n try {\n await processFiles(files);\n } catch (error) {\n triggerChatError(error, \"dropUpload\", error);\n }\n }\n };\n\n const handleThumbsUp = (message: Message) => {\n if (onThumbsUp) {\n onThumbsUp(message);\n }\n\n // Update feedback state\n setMessageFeedback((prev) => ({\n ...prev,\n [message.id]: \"thumbsUp\",\n }));\n\n // Trigger feedback given event\n triggerObservabilityHook(\"onFeedbackGiven\", message.id, \"thumbsUp\");\n };\n\n const handleThumbsDown = (message: Message) => {\n if (onThumbsDown) {\n onThumbsDown(message);\n }\n\n // Update feedback state\n setMessageFeedback((prev) => ({\n ...prev,\n [message.id]: \"thumbsDown\",\n }));\n\n // Trigger feedback given event\n triggerObservabilityHook(\"onFeedbackGiven\", message.id, \"thumbsDown\");\n };\n\n return (\n <WrappedCopilotChat icons={icons} labels={labels} className={className}>\n <div\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n className={`copilotKitChatBody${dragOver ? \" copilotKitDragOver\" : \"\"}`}\n >\n {/* Render error above messages if present */}\n {chatError &&\n renderError &&\n renderError({\n ...chatError,\n onDismiss: () => setChatError(null),\n onRetry: () => {\n // Clear error and potentially retry based on operation\n setChatError(null);\n // TODO: Implement specific retry logic based on operation type\n },\n })}\n\n <Messages\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n RenderMessage={RenderMessage}\n messages={messages}\n inProgress={isLoading}\n onRegenerate={handleRegenerate}\n onCopy={handleCopy}\n onThumbsUp={handleThumbsUp}\n onThumbsDown={handleThumbsDown}\n messageFeedback={messageFeedback}\n markdownTagRenderers={markdownTagRenderers}\n ImageRenderer={ImageRenderer}\n ErrorMessage={ErrorMessage}\n chatError={chatError}\n // Legacy props - passed through to Messages component\n RenderTextMessage={RenderTextMessage}\n RenderActionExecutionMessage={RenderActionExecutionMessage}\n RenderAgentStateMessage={RenderAgentStateMessage}\n RenderResultMessage={RenderResultMessage}\n RenderImageMessage={RenderImageMessage}\n >\n {currentSuggestions.length > 0 && (\n <RenderSuggestionsList\n onSuggestionClick={handleSendMessage}\n suggestions={currentSuggestions}\n isLoading={isLoadingSuggestions}\n />\n )}\n </Messages>\n\n {attachmentsEnabled && (\n <>\n <AttachmentQueue\n attachments={selectedAttachments}\n onRemoveAttachment={(id) =>\n setSelectedAttachments((prev) =>\n prev.filter((att) => att.id !== id),\n )\n }\n />\n <input\n type=\"file\"\n multiple\n ref={fileInputRef}\n onChange={handleFileUpload}\n accept={attachmentsAccept}\n style={{ display: \"none\" }}\n />\n </>\n )}\n <Input\n inProgress={isLoading}\n chatReady={Boolean(agent)}\n // @ts-ignore\n onSend={handleSendMessage}\n isVisible={isVisible}\n onStop={stopGeneration}\n onUpload={\n attachmentsEnabled ? () => fileInputRef.current?.click() : undefined\n }\n hideStopButton={hideStopButton}\n />\n </div>\n </WrappedCopilotChat>\n );\n}\n\nexport function WrappedCopilotChat({\n children,\n icons,\n labels,\n className,\n}: {\n children: React.ReactNode;\n icons?: CopilotChatIcons;\n labels?: CopilotChatLabels;\n className?: string;\n}) {\n const chatContext = React.useContext(ChatContext);\n if (!chatContext) {\n return (\n <ChatContextProvider\n icons={icons}\n labels={labels}\n open={true}\n setOpen={() => {}}\n >\n <div className={`copilotKitChat ${className ?? \"\"}`}>{children}</div>\n </ChatContextProvider>\n );\n }\n return <>{children}</>;\n}\n","import React, { useMemo, useCallback, useEffect, useRef } from \"react\";\nimport { ChatContextProvider, useChatContext } from \"./ChatContext\";\nimport {\n ButtonProps,\n HeaderProps,\n WindowProps,\n CopilotObservabilityHooks,\n} from \"./props\";\nimport { Window as DefaultWindow } from \"./Window\";\nimport { Button as DefaultButton } from \"./Button\";\nimport { Header as DefaultHeader } from \"./Header\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { CopilotChat, CopilotChatProps } from \"./Chat\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./messages/AssistantMessage\";\nimport { UserMessage as DefaultUserMessage } from \"./messages/UserMessage\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport {\n CopilotKitError,\n CopilotKitErrorCode,\n Severity,\n ErrorVisibility,\n styledConsole,\n} from \"@copilotkit/shared\";\n\nexport interface CopilotModalProps extends CopilotChatProps {\n /**\n * Whether the chat window should be open by default.\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * If the chat window should close when the user clicks outside of it.\n * @default true\n */\n clickOutsideToClose?: boolean;\n\n /**\n * If the chat window should close when the user hits the Escape key.\n * @default true\n */\n hitEscapeToClose?: boolean;\n\n /**\n * The shortcut key to open the chat window.\n * Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.\n * @default '/'\n */\n shortcut?: string;\n\n /**\n * A callback that gets called when the chat window opens or closes.\n */\n onSetOpen?: (open: boolean) => void;\n\n /**\n * A custom Window component to use instead of the default.\n */\n Window?: React.ComponentType<WindowProps>;\n\n /**\n * A custom Button component to use instead of the default.\n */\n Button?: React.ComponentType<ButtonProps>;\n\n /**\n * A custom Header component to use instead of the default.\n */\n Header?: React.ComponentType<HeaderProps>;\n}\n\n// Inner component that has access to the Copilot context\nconst CopilotModalInner = ({\n observabilityHooks,\n onSetOpen,\n clickOutsideToClose,\n hitEscapeToClose,\n shortcut,\n className,\n children,\n Window,\n Button,\n Header,\n ...chatProps\n}: Omit<CopilotModalProps, \"icons\" | \"labels\" | \"defaultOpen\"> & {\n Window: React.ComponentType<WindowProps>;\n Button: React.ComponentType<ButtonProps>;\n Header: React.ComponentType<HeaderProps>;\n clickOutsideToClose: boolean;\n hitEscapeToClose: boolean;\n shortcut: string;\n}) => {\n const { copilotApiConfig, setBannerError } = useCopilotContext();\n\n // Destructure stable values to avoid object reference changes\n const { publicApiKey } = copilotApiConfig;\n\n // Helper function to trigger event hooks only if publicApiKey is provided\n const triggerObservabilityHook = useCallback(\n (hookName: keyof CopilotObservabilityHooks, ...args: any[]) => {\n if (publicApiKey && observabilityHooks?.[hookName]) {\n (observabilityHooks[hookName] as any)(...args);\n }\n if (observabilityHooks?.[hookName] && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message: \"observabilityHooks requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks\");\n }\n },\n [publicApiKey, observabilityHooks, setBannerError],\n );\n\n const { open } = useChatContext();\n const prevOpen = useRef(open);\n\n // Monitor open state changes and trigger event hooks\n useEffect(() => {\n if (prevOpen.current !== open) {\n onSetOpen?.(open);\n\n // Trigger chat minimize/expand events\n if (open) {\n triggerObservabilityHook(\"onChatExpanded\");\n } else {\n triggerObservabilityHook(\"onChatMinimized\");\n }\n prevOpen.current = open;\n }\n }, [open, onSetOpen, triggerObservabilityHook]);\n\n const memoizedHeader = useMemo(() => <Header />, [Header]);\n const memoizedChildren = useMemo(() => children, [children]);\n\n return (\n <>\n <div className=\"copilotKitModalChildrenWrapper\">{memoizedChildren}</div>\n <div className={className}>\n <Button></Button>\n <Window\n clickOutsideToClose={clickOutsideToClose}\n shortcut={shortcut}\n hitEscapeToClose={hitEscapeToClose}\n >\n {memoizedHeader}\n <CopilotChat {...chatProps} observabilityHooks={observabilityHooks} />\n </Window>\n </div>\n </>\n );\n};\n\nexport const CopilotModal = ({\n instructions,\n defaultOpen = false,\n clickOutsideToClose = true,\n hitEscapeToClose = true,\n onSetOpen,\n onSubmitMessage,\n onStopGeneration,\n onReloadMessages,\n shortcut = \"/\",\n icons,\n labels,\n makeSystemMessage,\n onInProgress,\n Window = DefaultWindow,\n Button = DefaultButton,\n Header = DefaultHeader,\n Messages = DefaultMessages,\n Input = DefaultInput,\n AssistantMessage = DefaultAssistantMessage,\n UserMessage = DefaultUserMessage,\n onThumbsUp,\n onThumbsDown,\n onCopy,\n onRegenerate,\n markdownTagRenderers,\n className,\n children,\n observabilityHooks,\n ...props\n}: CopilotModalProps) => {\n const [openState, setOpenState] = React.useState(defaultOpen);\n\n return (\n <ChatContextProvider\n icons={icons}\n labels={labels}\n open={openState}\n setOpen={setOpenState}\n >\n <CopilotModalInner\n observabilityHooks={observabilityHooks}\n onSetOpen={onSetOpen}\n clickOutsideToClose={clickOutsideToClose ?? true}\n hitEscapeToClose={hitEscapeToClose ?? true}\n shortcut={shortcut ?? \"/\"}\n className={className}\n Window={Window}\n Button={Button}\n Header={Header}\n instructions={instructions}\n onSubmitMessage={onSubmitMessage}\n onStopGeneration={onStopGeneration}\n onReloadMessages={onReloadMessages}\n makeSystemMessage={makeSystemMessage}\n onInProgress={onInProgress}\n Messages={Messages}\n Input={Input}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n onCopy={onCopy}\n onRegenerate={onRegenerate}\n markdownTagRenderers={markdownTagRenderers}\n {...props}\n >\n {children}\n </CopilotModalInner>\n </ChatContextProvider>\n );\n};\n","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotPopup.gif\" width=\"500\" />\n *\n * A chatbot popup component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * See [CopilotSidebar](/reference/v1/components/chat/CopilotSidebar) for a sidebar version of this component.\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 * ## Usage\n *\n * ```tsx\n * import { CopilotPopup } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotPopup\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotPopup\n * observabilityHooks={{\n * onChatExpanded: () => {\n * console.log(\"Popup opened\");\n * },\n * onChatMinimized: () => {\n * console.log(\"Popup closed\");\n * },\n * }}\n * />\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\n\nimport { CopilotModal, CopilotModalProps } from \"./Modal\";\n\nexport function CopilotPopup(props: CopilotModalProps) {\n props = {\n ...props,\n className: props.className\n ? props.className + \" copilotKitPopup\"\n : \"copilotKitPopup\",\n };\n return <CopilotModal {...props}>{props.children}</CopilotModal>;\n}\n","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotSidebar.gif\" width=\"500\" />\n *\n * A chatbot sidebar component for the CopilotKit framework. Highly customizable through various props and custom CSS.\n *\n * See [CopilotPopup](/reference/v1/components/chat/CopilotPopup) for a popup version of this component.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ## Usage\n *\n * ```tsx\n * import { CopilotSidebar } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotSidebar\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * >\n * <YourApp/>\n * </CopilotSidebar>\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotSidebar\n * observabilityHooks={{\n * onChatExpanded: () => {\n * console.log(\"Sidebar opened\");\n * },\n * onChatMinimized: () => {\n * console.log(\"Sidebar closed\");\n * },\n * }}\n * >\n * <YourApp/>\n * </CopilotSidebar>\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\nimport React, { useState } from \"react\";\nimport { CopilotModal, CopilotModalProps } from \"./Modal\";\n\nexport function CopilotSidebar(props: CopilotModalProps) {\n props = {\n ...props,\n className: props.className\n ? props.className + \" copilotKitSidebar\"\n : \"copilotKitSidebar\",\n };\n const [expandedClassName, setExpandedClassName] = useState(\n props.defaultOpen ? \"sidebarExpanded\" : \"\",\n );\n\n const onSetOpen = (open: boolean) => {\n props.onSetOpen?.(open);\n setExpandedClassName(open ? \"sidebarExpanded\" : \"\");\n };\n\n return (\n <div className={`copilotKitSidebarContentWrapper ${expandedClassName}`}>\n <CopilotModal {...props} {...{ onSetOpen }}>\n {props.children}\n </CopilotModal>\n </div>\n );\n}\n","/**\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 useCopilotChatSuggestions as useCoreCopilotChatSuggestions,\n type UseCopilotChatSuggestionsConfiguration,\n} from \"@copilotkit/react-core\";\n\nexport function useCopilotChatSuggestions(\n config: UseCopilotChatSuggestionsConfiguration,\n dependencies: any[] = [],\n) {\n useCoreCopilotChatSuggestions(config, dependencies);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAAa,WACX,2CAAC;EACC,OAAM;EACN,SAAQ;EACR,MAAK;EACL,OAAM;EACN,QAAO;YAEP,2CAAC;GAAE,WAAU;aACX,2CAAC;IACC,UAAS;IACT,GAAE;IACF,UAAS;KACT;IACA;GACA;CAGR,MAAaA,cACX,2CAAC;EACC,OAAM;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AY;GACb;EACD,0CAAwC;GACtC,YAAY;GACZ,YAAY;GACb;EACD,2CAAyC;GACvC,YAAY;GACZ,YAAY;GACb;EACD,0CAAwC;GACtC,SAAS;GACT,cAAc;GACd,OAAO;GACP,YAAY;GACb;EACD,cAAc,EACZ,SAAS,MACV;EACD,uBAAuB,EACrB,OAAO,WACR;EACD,gBAAgB,EACd,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,aAAa,EACX,OAAO,WACR;EACD,mDAAmD,EACjD,OAAO,WACR;EACD,0DAA0D,EACxD,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,KAAK,EACH,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,MAAM,EACJ,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,aAAa,EACX,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,MAAM,EACJ,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,mCAAmC,EACjC,gBAAgB,aACjB;EACD,UAAU,EACR,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,kBAAkB,EAChB,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,eAAe,EACb,OAAO,WACR;EACD,cAAc,EACZ,OAAO,WACR;EACD,uBAAuB,EACrB,OAAO,WACR;EACD,0BAA0B,EACxB,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,kBAAkB,EAChB,OAAO,WACR;EACD,wBAAwB,EACtB,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,6BAA6B,EAC3B,OAAO,WACR;EACD,OAAO,EACL,OAAO,WACR;EACD,WAAW,EACT,OAAO,WACR;EACD,QAAQ,EACN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AAM,YACb,MAAM,YAAY,qBAClB;GACL;AACD,SAAO,2CAAC;GAAa,GAAI;aAAQ,MAAM;IAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCHjE,SAAgB,eAAe,OAA0B;AACvD,UAAQ;GACN,GAAG;GACH,WAAW,MAAM,YACb,MAAM,YAAY,uBAClB;GACL;EACD,MAAM,CAAC,mBAAmB,4CACxB,MAAM,cAAc,oBAAoB,GACzC;EAED,MAAM,aAAa,SAAkB;;AACnC,6BAAM,mFAAY,KAAK;AACvB,wBAAqB,OAAO,oBAAoB,GAAG;;AAGrD,SACE,2CAAC;GAAI,WAAW,mCAAmC;aACjD,2CAAC;IAAa,GAAI;IAAa;cAC5B,MAAM;KACM;IACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CC9BV,SAAgB,0BACd,QACA,eAAsB,EAAE,EACxB;AACA,wDAA8B,QAAQ,aAAa"}
1
+ {"version":3,"file":"index.umd.js","names":["CloseIcon","CheckIcon","React","DefaultIcons.OpenIcon","DefaultIcons.CloseIcon","DefaultIcons.HeaderCloseIcon","DefaultIcons.SendIcon","DefaultIcons.ActivityIcon","DefaultIcons.SpinnerIcon","DefaultIcons.StopIcon","DefaultIcons.RegenerateIcon","DefaultIcons.MicrophoneIcon","DefaultIcons.CopyIcon","DefaultIcons.ThumbsUpIcon","DefaultIcons.ThumbsDownIcon","DefaultIcons.UploadIcon","React","defaultCopilotContextCategories","COPILOTKIT_VERSION","Menu","MenuButton","MenuItems","MenuItem","React","Light","Prism","CheckIcon","ReactMarkdown","remarkGfm","remarkMath","rehypeRaw","DefaultUserMessage","DefaultAssistantMessage","DefaultImageRenderer","UserMessage","ImageRenderer","AssistantMessage","DefaultRenderMessage","DefaultMessages","DefaultRenderMessage","DefaultRenderSuggestionsList","DefaultInput","DefaultAssistantMessage","DefaultUserMessage","DefaultImageRenderer","CopilotKitError","CopilotKitErrorCode","Severity","ErrorVisibility","React","Messages","AssistantMessage","UserMessage","RenderMessage","ImageRenderer","Input","CopilotKitError","CopilotKitErrorCode","Severity","ErrorVisibility","DefaultWindow","DefaultButton","DefaultHeader","DefaultMessages","DefaultInput","DefaultAssistantMessage","DefaultUserMessage","React","Window","Button","Header","Messages","Input","AssistantMessage","UserMessage"],"sources":["../src/components/chat/Icons.tsx","../src/components/chat/ChatContext.tsx","../src/components/chat/Window.tsx","../src/components/chat/Button.tsx","../src/components/dev-console/utils.ts","../src/components/dev-console/icons.tsx","../src/components/help-modal/icons.tsx","../src/components/help-modal/modal.tsx","../src/components/dev-console/console.tsx","../src/components/chat/Header.tsx","../src/components/chat/AttachmentRenderer.tsx","../src/components/chat/messages/UserMessage.tsx","../src/hooks/use-copy-to-clipboard.tsx","../src/components/chat/CodeBlock.tsx","../src/components/chat/Markdown.tsx","../src/components/chat/messages/AssistantMessage.tsx","../src/components/chat/messages/ImageRenderer.tsx","../src/components/chat/messages/RenderMessage.tsx","../src/components/chat/messages/LegacyRenderMessage.tsx","../src/components/chat/Messages.tsx","../src/components/chat/Textarea.tsx","../src/hooks/use-push-to-talk.tsx","../src/hooks/use-dark-mode.ts","../src/components/chat/PoweredByTag.tsx","../src/components/chat/Input.tsx","../src/components/chat/AttachmentQueue.tsx","../src/components/chat/attachment-utils.ts","../src/components/chat/Suggestion.tsx","../src/components/chat/Suggestions.tsx","../src/components/chat/Chat.tsx","../src/components/chat/Modal.tsx","../src/components/chat/Popup.tsx","../src/components/chat/Sidebar.tsx","../src/hooks/use-copilot-chat-suggestions.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const OpenIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <g transform=\"translate(24, 0) scale(-1, 1)\">\n <path\n fillRule=\"evenodd\"\n d=\"M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z\"\n clipRule=\"evenodd\"\n />\n </g>\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M19.5 8.25l-7.5 7.5-7.5-7.5\"\n />\n </svg>\n);\n\nexport const HeaderCloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n);\n\nexport const SendIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 19V5m0 0l-7 7m7-7l7 7\"\n />\n </svg>\n);\n\nexport const MicrophoneIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z\"\n />\n </svg>\n);\n\nexport const StopIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z\"\n />\n </svg>\n);\n\nexport const RegenerateIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99\"\n />\n </svg>\n);\n\nexport const CopyIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75\"\n />\n </svg>\n);\n\nexport const SmallSpinnerIcon = (\n <span\n className=\"copilotKitSpinner\"\n style={{ width: \"13px\", height: \"13px\" }}\n ></span>\n);\n\nexport const SpinnerIcon = (\n <span\n className=\"copilotKitSpinner\"\n style={{ width: \"24px\", height: \"24px\" }}\n ></span>\n);\n\nexport const ActivityIcon = (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: \"4px\" }}>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0s\" }}\n ></span>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0.2s\" }}\n ></span>\n <span\n className=\"copilotKitActivityDot\"\n style={{ animationDelay: \"0.4s\" }}\n ></span>\n </div>\n);\n\nexport const ThumbsUpIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z\"\n />\n </svg>\n);\n\nexport const ThumbsDownIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 00.303-.54m.023-8.25H16.48a4.5 4.5 0 01-1.423-.23l-3.114-1.04a4.5 4.5 0 00-1.423-.23H6.504c-.618 0-1.217.247-1.605.729A11.95 11.95 0 002.25 12c0 .434.023.863.068 1.285C2.427 14.306 3.346 15 4.372 15h3.126c.618 0 .991.724.725 1.282A7.471 7.471 0 007.5 19.5a2.25 2.25 0 002.25 2.25.75.75 0 00.75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 002.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384\"\n />\n </svg>\n);\n\nexport const DownloadIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3\"\n />\n </svg>\n);\n\nexport const UploadIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"24\"\n height=\"24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </svg>\n);\n\nexport const CheckIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n width=\"16\"\n height=\"16\"\n style={{ minWidth: \"16px\", minHeight: \"16px\" }}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.5 12.75l6 6 9-13.5\"\n />\n </svg>\n);\n","import React, { useMemo, useState } from \"react\";\nimport * as DefaultIcons from \"./Icons\";\nimport { ThumbsDownIcon, ThumbsUpIcon } from \"./Icons\";\n\n/**\n * Icons for CopilotChat component.\n */\nexport interface CopilotChatIcons {\n /**\n * The icon to use for the open chat button.\n * @default <OpenIcon />\n */\n openIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button.\n * @default <CloseIcon />\n */\n closeIcon?: React.ReactNode;\n\n /**\n * The icon to use for the close chat button in the header.\n * @default <HeaderCloseIcon />\n */\n headerCloseIcon?: React.ReactNode;\n\n /**\n * The icon to use for the send button.\n * @default <SendIcon />\n */\n sendIcon?: React.ReactNode;\n\n /**\n * The icon to use for the activity indicator.\n * @default <ActivityIcon />\n */\n activityIcon?: React.ReactNode;\n\n /**\n * The icon to use for the spinner.\n * @default <SpinnerIcon />\n */\n spinnerIcon?: React.ReactNode;\n\n /**\n * The icon to use for the stop button.\n * @default <StopIcon />\n */\n stopIcon?: React.ReactNode;\n\n /**\n * The icon to use for the regenerate button.\n * @default <RegenerateIcon />\n */\n regenerateIcon?: React.ReactNode;\n\n /**\n * The icons to use for push to talk.\n * @default <PushToTalkIcon />\n */\n\n pushToTalkIcon?: React.ReactNode;\n\n /**\n * The icons to use for copy assistant response\n * @default <CopyIcon />\n */\n\n copyIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs up/response approval.\n * @default <ThumbsUpIcon />\n */\n\n thumbsUpIcon?: React.ReactNode;\n\n /**\n * The icon to use for thumbs down/response rejection.\n * @default <ThumbsDownIcon />\n */\n\n thumbsDownIcon?: React.ReactNode;\n\n /**\n * The icon to use for the upload button.\n * @default <UploadIcon />\n */\n uploadIcon?: React.ReactNode;\n}\n\n/**\n * Labels for CopilotChat component.\n */\nexport interface CopilotChatLabels {\n /**\n * The initial message(s) to display in the chat window.\n */\n initial?: string | string[];\n\n /**\n * The title to display in the header.\n * @default \"CopilotKit\"\n */\n title?: string;\n\n /**\n * The placeholder to display in the input.\n * @default \"Type a message...\"\n */\n placeholder?: string;\n\n /**\n * The message to display when an error occurs.\n * @default \"❌ An error occurred. Please try again.\"\n */\n error?: string;\n\n /**\n * The label to display on the stop button.\n * @default \"Stop generating\"\n */\n stopGenerating?: string;\n\n /**\n * The label to display on the regenerate button.\n * @default \"Regenerate response\"\n */\n regenerateResponse?: string;\n\n /**\n * The label for the copy button.\n * @default \"Copy to clipboard\"\n */\n copyToClipboard?: string;\n\n /**\n * The label for the thumbs up button.\n * @default \"Thumbs up\"\n */\n thumbsUp?: string;\n\n /**\n * The label for the thumbs down button.\n * @default \"Thumbs down\"\n */\n thumbsDown?: string;\n\n /**\n * The text to display when content is copied.\n * @default \"Copied!\"\n */\n copied?: string;\n}\n\ninterface ChatContext {\n labels: Required<CopilotChatLabels>;\n icons: Required<CopilotChatIcons>;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContext = React.createContext<ChatContext | undefined>(\n undefined,\n);\n\nexport function useChatContext(): ChatContext {\n const context = React.useContext(ChatContext);\n if (context === undefined) {\n throw new Error(\n \"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?\",\n );\n }\n return context;\n}\n\ninterface ChatContextProps {\n // temperature?: number;\n // instructions?: string;\n // maxFeedback?: number;\n labels?: CopilotChatLabels;\n icons?: CopilotChatIcons;\n children?: React.ReactNode;\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const ChatContextProvider = ({\n // temperature,\n // instructions,\n // maxFeedback,\n labels,\n icons,\n children,\n open,\n setOpen,\n}: ChatContextProps) => {\n const memoizedLabels = useMemo(\n () => ({\n initial: \"\",\n title: \"CopilotKit\",\n placeholder: \"Type a message...\",\n error: \"❌ An error occurred. Please try again.\",\n stopGenerating: \"Stop generating\",\n regenerateResponse: \"Regenerate response\",\n copyToClipboard: \"Copy to clipboard\",\n thumbsUp: \"Thumbs up\",\n thumbsDown: \"Thumbs down\",\n copied: \"Copied!\",\n ...labels,\n }),\n [labels],\n );\n\n const memoizedIcons = useMemo(\n () => ({\n openIcon: DefaultIcons.OpenIcon,\n closeIcon: DefaultIcons.CloseIcon,\n headerCloseIcon: DefaultIcons.HeaderCloseIcon,\n sendIcon: DefaultIcons.SendIcon,\n activityIcon: DefaultIcons.ActivityIcon,\n spinnerIcon: DefaultIcons.SpinnerIcon,\n stopIcon: DefaultIcons.StopIcon,\n regenerateIcon: DefaultIcons.RegenerateIcon,\n pushToTalkIcon: DefaultIcons.MicrophoneIcon,\n copyIcon: DefaultIcons.CopyIcon,\n thumbsUpIcon: DefaultIcons.ThumbsUpIcon,\n thumbsDownIcon: DefaultIcons.ThumbsDownIcon,\n uploadIcon: DefaultIcons.UploadIcon,\n ...icons,\n }),\n [icons],\n );\n\n const context = useMemo(\n () => ({\n labels: memoizedLabels,\n icons: memoizedIcons,\n open,\n setOpen,\n }),\n [memoizedLabels, memoizedIcons, open, setOpen],\n );\n\n return (\n <ChatContext.Provider value={context}>{children}</ChatContext.Provider>\n );\n};\n","import React, { useCallback, useEffect } from \"react\";\nimport { WindowProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { isMacOS } from \"@copilotkit/shared\";\n\nexport const Window = ({\n children,\n clickOutsideToClose,\n shortcut,\n hitEscapeToClose,\n}: WindowProps) => {\n const windowRef = React.useRef<HTMLDivElement>(null);\n const context = useCopilotContext();\n\n const { open, setOpen } = useChatContext();\n\n const handleClickOutside = useCallback(\n (event: MouseEvent) => {\n if (!clickOutsideToClose) {\n return;\n }\n\n const parentElement = windowRef.current?.parentElement;\n\n let className = \"\";\n if (event.target instanceof HTMLElement) {\n className = event.target.className;\n }\n\n if (\n open &&\n parentElement &&\n !parentElement.contains(event.target as any) &&\n // prevent closing the window when clicking on the debug menu\n !className.includes(\"copilotKitDebugMenu\")\n ) {\n setOpen(false);\n }\n },\n [clickOutsideToClose, open, setOpen],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isInput =\n target.tagName === \"INPUT\" ||\n target.tagName === \"SELECT\" ||\n target.tagName === \"TEXTAREA\" ||\n target.isContentEditable;\n\n const isDescendantOfWrapper = windowRef.current?.contains(target);\n\n if (\n open &&\n event.key === \"Escape\" &&\n (!isInput || isDescendantOfWrapper) &&\n hitEscapeToClose\n ) {\n setOpen(false);\n } else if (\n event.key === shortcut &&\n ((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&\n (!isInput || isDescendantOfWrapper)\n ) {\n setOpen(!open);\n }\n },\n [hitEscapeToClose, shortcut, open, setOpen],\n );\n\n const adjustForMobile = useCallback(() => {\n const copilotKitWindow = windowRef.current;\n const vv = window.visualViewport;\n if (!copilotKitWindow || !vv) {\n return;\n }\n\n if (window.innerWidth < 640 && open) {\n copilotKitWindow.style.height = `${vv.height}px`;\n copilotKitWindow.style.left = `${vv.offsetLeft}px`;\n copilotKitWindow.style.top = `${vv.offsetTop}px`;\n\n document.body.style.position = \"fixed\";\n document.body.style.width = \"100%\";\n document.body.style.height = `${window.innerHeight}px`;\n document.body.style.overflow = \"hidden\";\n document.body.style.touchAction = \"none\";\n\n // Prevent scrolling on iOS\n document.body.addEventListener(\"touchmove\", preventScroll, {\n passive: false,\n });\n } else {\n copilotKitWindow.style.height = \"\";\n copilotKitWindow.style.left = \"\";\n copilotKitWindow.style.top = \"\";\n document.body.style.position = \"\";\n document.body.style.height = \"\";\n document.body.style.width = \"\";\n document.body.style.overflow = \"\";\n document.body.style.top = \"\";\n document.body.style.touchAction = \"\";\n\n document.body.removeEventListener(\"touchmove\", preventScroll);\n }\n }, [open]);\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.addEventListener(\"resize\", adjustForMobile);\n adjustForMobile();\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (window.visualViewport) {\n window.visualViewport.removeEventListener(\"resize\", adjustForMobile);\n }\n };\n }, [adjustForMobile, handleClickOutside, handleKeyDown]);\n\n return (\n <div className={`copilotKitWindow ${open ? \" open\" : \"\"}`} ref={windowRef}>\n {children}\n </div>\n );\n};\n\nconst preventScroll = (event: TouchEvent): void => {\n let targetElement = event.target as Element;\n\n // Function to check if the target has the parent with a given class\n const hasParentWithClass = (element: Element, className: string): boolean => {\n while (element && element !== document.body) {\n if (element.classList.contains(className)) {\n return true;\n }\n element = element.parentElement!;\n }\n return false;\n };\n\n // Check if the target of the touch event is inside an element with the 'copilotKitMessages' class\n if (!hasParentWithClass(targetElement, \"copilotKitMessages\")) {\n event.preventDefault();\n }\n};\n","import { ButtonProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\n\nexport const Button = ({}: ButtonProps) => {\n const { open, setOpen, icons } = useChatContext();\n\n return (\n <div onClick={() => setOpen(!open)}>\n <button\n className={`copilotKitButton ${open ? \"open\" : \"\"}`}\n aria-label={open ? \"Close Chat\" : \"Open Chat\"}\n >\n <div className=\"copilotKitButtonIcon copilotKitButtonIconOpen\">\n {icons.openIcon}\n </div>\n <div className=\"copilotKitButtonIcon copilotKitButtonIconClose\">\n {icons.closeIcon}\n </div>\n </button>\n </div>\n );\n};\n","import {\n CopilotContextParams,\n CopilotMessagesContextParams,\n defaultCopilotContextCategories,\n} from \"@copilotkit/react-core\";\nimport { CopilotKitVersion } from \"./types\";\nexport { shouldShowDevConsole } from \"@copilotkit/react-core\";\n\nexport async function getPublishedCopilotKitVersion(\n current: string,\n forceCheck: boolean = false,\n): Promise<CopilotKitVersion> {\n const LOCAL_STORAGE_KEY = \"__copilotkit_version_check__\";\n const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);\n if (serializedVersion && !forceCheck) {\n try {\n const parsedVersion: CopilotKitVersion = JSON.parse(serializedVersion);\n const oneHour = 60 * 60 * 1000;\n const now = new Date().getTime();\n\n if (\n parsedVersion.current === current &&\n now - new Date(parsedVersion.lastChecked).getTime() < oneHour\n ) {\n return parsedVersion;\n }\n } catch (error) {\n console.error(\n \"Failed to parse CopilotKitVersion from localStorage\",\n error,\n );\n }\n }\n\n try {\n const response = await fetch(\n \"https://api.cloud.copilotkit.ai/check-for-updates\",\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n packages: [\n {\n packageName: \"@copilotkit/shared\",\n packageVersion: current,\n },\n ],\n }),\n },\n );\n\n const data = await response.json();\n\n const version: CopilotKitVersion = {\n current,\n lastChecked: new Date().getTime(),\n latest: data.packages[0].latestVersion,\n severity: data.packages[0].severity,\n advisory: data.packages[0].advisory || null,\n };\n\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));\n return version;\n } catch (error) {\n console.error(\"Failed to check for updates\", error);\n throw error;\n }\n}\n\nexport function logReadables(context: CopilotContextParams) {\n console.log(\"%cCurrent Readables:\", \"font-size: 16px; font-weight: bold;\");\n\n const readables = context\n .getContextString([], defaultCopilotContextCategories)\n .trim();\n if (readables.length === 0) {\n console.log(\"No readables found\");\n return;\n }\n console.log(readables);\n}\n\nexport function logActions(context: CopilotContextParams) {\n console.log(\"%cCurrent Actions:\", \"font-size: 16px; font-weight: bold;\");\n\n if (Object.values(context.actions).length === 0) {\n console.log(\"No actions found\");\n return;\n }\n for (const action of Object.values(context.actions)) {\n console.group(action.name);\n console.log(\"name\", action.name);\n console.log(\"description\", action.description);\n console.log(\"parameters\", action.parameters);\n\n console.groupEnd();\n }\n}\n\nexport function logMessages(context: CopilotMessagesContextParams) {\n console.log(\"%cCurrent Messages:\", \"font-size: 16px; font-weight: bold;\");\n\n if (context.messages.length === 0) {\n console.log(\"No messages found\");\n return;\n }\n\n const tableData = context.messages.map((message) => {\n if (message.isTextMessage()) {\n return {\n id: message.id,\n type: \"TextMessage\",\n role: message.role,\n name: undefined,\n scope: undefined,\n content: message.content,\n };\n } else if (message.isActionExecutionMessage()) {\n return {\n id: message.id,\n type: \"ActionExecutionMessage\",\n role: undefined,\n name: message.name,\n scope: message.parentMessageId,\n content: message.arguments,\n };\n } else if (message.isResultMessage()) {\n return {\n id: message.id,\n type: \"ResultMessage\",\n role: undefined,\n name: message.actionName,\n scope: message.actionExecutionId,\n content: message.result,\n };\n } else if (message.isAgentStateMessage()) {\n return {\n id: message.id,\n type: `AgentStateMessage (running: ${message.running})`,\n role: message.role,\n name: undefined,\n scope: message.threadId,\n content: message.state,\n };\n }\n });\n console.table(tableData);\n}\n","export const ExclamationMarkTriangleIcon = (\n <svg\n width=\"13.3967723px\"\n height=\"12px\"\n viewBox=\"0 0 13.3967723 12\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"exclamation-triangle\" fill=\"#CD2121\">\n <path\n d=\"M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const ExclamationMarkIcon = (\n <svg\n width=\"14px\"\n height=\"14px\"\n viewBox=\"0 0 14 14\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"exclamation-circle\" fill=\"#EC662C\">\n <path\n d=\"M7,14 C10.866,14 14,10.866 14,7 C14,3.13401 10.866,0 7,0 C3.13401,0 0,3.13401 0,7 C0,10.866 3.13401,14 7,14 Z M7,3 C7.41421,3 7.75,3.33579 7.75,3.75 L7.75,6.75 C7.75,7.16421 7.41421,7.5 7,7.5 C6.58579,7.5 6.25,7.16421 6.25,6.75 L6.25,3.75 C6.25,3.33579 6.58579,3 7,3 Z M7,11 C7.55228,11 8,10.5523 8,10 C8,9.4477 7.55228,9 7,9 C6.44772,9 6,9.4477 6,10 C6,10.5523 6.44772,11 7,11 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const ChevronDownIcon = (\n <svg\n width=\"7px\"\n height=\"4px\"\n viewBox=\"0 0 7 4\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"Group\" fill=\"currentColor\" fillRule=\"nonzero\">\n <path\n d=\"M3.71690723,3.90271086 C3.59268176,4.03242971 3.39143629,4.03242971 3.26721082,3.90271086 L0.0853966595,0.57605615 C-0.0314221035,0.444981627 -0.0279751448,0.240725043 0.0931934622,0.114040675 C0.214362069,-0.0126436935 0.409725445,-0.0162475626 0.535093061,0.105888951 L3.49205902,3.19746006 L6.44902499,0.105888951 C6.52834574,0.0168884389 6.64780588,-0.0197473458 6.7605411,0.0103538404 C6.87327633,0.0404550266 6.96130636,0.132492308 6.99009696,0.250359396 C7.01888756,0.368226483 6.98384687,0.493124608 6.89872139,0.57605615 L3.71690723,3.90271086 Z\"\n id=\"Path\"\n ></path>\n </g>\n </g>\n </svg>\n);\n\nexport const CheckIcon = (\n <svg\n width=\"14px\"\n height=\"14px\"\n viewBox=\"0 0 14 14\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g\n id=\"Group-2\"\n transform=\"translate(-118, 0)\"\n fill=\"#1BC030\"\n fillRule=\"nonzero\"\n >\n <g id=\"Group\" transform=\"translate(118, 0)\">\n <path\n d=\"M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z\"\n id=\"Shape\"\n ></path>\n </g>\n </g>\n </g>\n </svg>\n);\n\nexport const CopilotKitIcon = (\n <svg\n width=\"33px\"\n height=\"35px\"\n viewBox=\"0 0 33 35\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>bd5c9079-929b-4d55-bdc9-16d1c8181b71</title>\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <image\n x=\"0\"\n y=\"0\"\n width=\"33\"\n height=\"35\"\n xlinkHref=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAjaADAAQAAAABAAAAlwAAAACI8Oz3AABAAElEQVR4Ae2dCYAlVXnvv6q79d7TMz37sIMgKKBCkLhkSKK4xJUMQVzAqJBgNDGJa2LsvJfERI0aiEbwRXnoQ2VYRASiQUFRUGQm7DAwzDBbT+/rvbfvXu/3P1V1+84CzEw3MNPD6a579nOqzvev73znO0t59rzZbQu88sXndp2w4gVLp5oG+6+47ivDu010kAb6B+lzP+Vjr1zZk0xV/ddMVIufap/34g+e+s9rX9351U1dT5npIIpMHkTPusePmto+tKhctVWPDW1/c27hIVNbCsFbCpa7/aR/f/SWFV2ZX974zsNG97iwOZjwedDshqiZlL3AD9JH9Y8PpTYMPJEuLj7+pclE5vBquXZ6MV/56Zu/ueGnmWpqzer3Hz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u9ndFGfZ2j9C8Lizv/Zb5ce5qEm7j2cibbT6cN/i+7qOMAxDzejA38hdiu6CKYDYBLVWolRQh9bMzZYOcdHtQqHErYEQHEmqgMWk3TeFgDzU5jKf9v3znv02X+guVVjEsFXH+A6kcdaD1Aub29v//VzChi1b49X4vdRhLr11vsHN1pz7Qj8bDKrLULpdyJzKocw1OwCKBm2zYKPCh1PiQ87sujILdnw1gKQrQiMDNmTj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+J7/zXkIt50IxO3oK1rgKgEaU5YYAJhaUOCLawjufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg==\"\n ></image>\n </g>\n </svg>\n);\n","import React from \"react\";\n\nexport const LifeBuoyIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy\"\n >\n <g transform=\"translate(0, -1)\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\" />\n <path d=\"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\" />\n <path d=\"M15 15l3.35 3.35\" />\n <path d=\"M9 15l-3.35 3.35\" />\n <path d=\"M5.65 5.65l3.35 3.35\" />\n <path d=\"M18.35 5.65l-3.35 3.35\" />\n </g>\n </svg>\n);\n\nexport const CloseIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n width=\"20\"\n height=\"20\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n);\n\nexport const LoadingSpinnerIcon = ({\n color = \"rgb(107 114 128)\",\n}: {\n color?: string;\n}) => (\n <svg\n style={{\n animation: \"copilotKitSpinAnimation 1s linear infinite\",\n color,\n }}\n width=\"24\"\n height=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n style={{ opacity: 0.25 }}\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n style={{ opacity: 0.75 }}\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n);\n","import React, { useMemo, useState, useRef, useEffect } from \"react\";\nimport { CloseIcon } from \"./icons\";\n\nexport function CopilotKitHelpModal() {\n const [showHelpModal, setShowHelpModal] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n // Close popover when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node) &&\n buttonRef.current &&\n !buttonRef.current.contains(event.target as Node)\n ) {\n setShowHelpModal(false);\n }\n };\n\n if (showHelpModal) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [showHelpModal]);\n\n const HelpButton = () => (\n <button\n ref={buttonRef}\n onClick={() => setShowHelpModal(!showHelpModal)}\n className=\"copilotKitDebugMenuTriggerButton relative\"\n aria-label=\"Open Help\"\n >\n Help\n </button>\n );\n\n return (\n <div className=\"relative\">\n <HelpButton />\n {showHelpModal && (\n <div\n ref={popoverRef}\n className=\"absolute mt-2 z-50\"\n style={{\n top: \"100%\",\n right: \"-120px\",\n width: \"380px\",\n }}\n >\n <div className=\"copilotKitHelpModal rounded-lg shadow-xl w-full p-4 flex-col relative\">\n <button\n className=\"copilotKitHelpModalCloseButton absolute text-gray-400 hover:text-gray-600 focus:outline-none\"\n style={{ top: \"10px\", right: \"10px\" }}\n onClick={() => setShowHelpModal(false)}\n aria-label=\"Close\"\n >\n <CloseIcon />\n </button>\n <div className=\"w-full flex mb-6 justify-center\">\n <h2 className=\"text-2xl font-bold\">Help Options</h2>\n </div>\n <div className=\"space-y-4 mb-4\">\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://docs.copilotkit.ai/coagents/troubleshooting/common-issues\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Visit the Troubleshooting and FAQ section in the docs\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-discord\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Go to Discord Support Channel (Community Support)\n </a>\n </div>\n <div className=\"copilotKitHelpItemButton\">\n <a\n href=\"https://go.copilotkit.ai/dev-console-support-slack\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Apply for Priority Direct Slack Support\n </a>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport {\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"@copilotkit/react-core\";\nimport {\n getPublishedCopilotKitVersion,\n logActions,\n logMessages,\n logReadables,\n shouldShowDevConsole,\n} from \"./utils\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport {\n CheckIcon,\n ChevronDownIcon,\n CopilotKitIcon,\n ExclamationMarkIcon,\n ExclamationMarkTriangleIcon,\n} from \"./icons\";\nimport { Menu, MenuButton, MenuItem, MenuItems } from \"@headlessui/react\";\nimport { COPILOTKIT_VERSION, copyToClipboard } from \"@copilotkit/shared\";\nimport { SmallSpinnerIcon } from \"../chat/Icons\";\nimport { CopilotKitHelpModal } from \"../help-modal\";\n\ntype VersionStatus =\n | \"unknown\"\n | \"checking\"\n | \"latest\"\n | \"update-available\"\n | \"outdated\";\n\nexport function CopilotDevConsole() {\n const currentVersion = COPILOTKIT_VERSION;\n const context = useCopilotContext();\n\n // to prevent hydration errors, ensure that the component renders the same content\n // server-side as it does during the initial client-side render to prevent a hydration\n // mismatch\n // see: https://nextjs.org/docs/messages/react-hydration-error#solution-1-using-useeffect-to-run-on-the-client-only\n\n const [showDevConsole, setShowDevConsole] = useState(false);\n\n useEffect(() => {\n setShowDevConsole(shouldShowDevConsole(context.showDevConsole));\n }, [context.showDevConsole]);\n\n const dontRunTwiceInDevMode = useRef(false);\n const [versionStatus, setVersionStatus] = useState<VersionStatus>(\"unknown\");\n const [latestVersion, setLatestVersion] = useState<string>(\"\");\n const consoleRef = useRef<HTMLDivElement>(null);\n const [debugButtonMode, setDebugButtonMode] = useState<\"full\" | \"compact\">(\n \"full\",\n );\n\n const checkForUpdates = (force: boolean = false) => {\n setVersionStatus(\"checking\");\n\n getPublishedCopilotKitVersion(currentVersion, force)\n .then((v) => {\n setLatestVersion(v.latest);\n let versionOk = false;\n\n // match exact version or a version with a letter (e.g. 1.0.0-alpha.1)\n if (v.current === v.latest) {\n versionOk = true;\n } else if (/[a-zA-Z]/.test(v.current)) {\n versionOk = true;\n }\n\n if (versionOk) {\n setVersionStatus(\"latest\");\n } else if (v.severity !== \"low\") {\n setVersionStatus(\"outdated\");\n } else {\n setVersionStatus(\"update-available\");\n }\n })\n .catch((e) => {\n console.error(e);\n setVersionStatus(\"unknown\");\n });\n };\n\n useEffect(() => {\n if (!showDevConsole) {\n return;\n }\n if (dontRunTwiceInDevMode.current === true) {\n return;\n }\n dontRunTwiceInDevMode.current = true;\n\n checkForUpdates();\n }, [showDevConsole]);\n\n if (!showDevConsole) {\n return null;\n }\n return (\n <div\n ref={consoleRef}\n className={\n \"copilotKitDevConsole \" +\n (versionStatus === \"update-available\"\n ? \"copilotKitDevConsoleUpgrade\"\n : \"\") +\n (versionStatus === \"outdated\" ? \"copilotKitDevConsoleWarnOutdated\" : \"\")\n }\n >\n <VersionInfo\n showDevConsole={context.showDevConsole}\n versionStatus={versionStatus}\n currentVersion={currentVersion}\n latestVersion={latestVersion}\n />\n\n <CopilotKitHelpModal />\n\n <DebugMenuButton\n setShowDevConsole={setShowDevConsole}\n checkForUpdates={checkForUpdates}\n mode={debugButtonMode}\n />\n </div>\n );\n}\n\nfunction VersionInfo({\n showDevConsole,\n versionStatus,\n currentVersion,\n latestVersion,\n}: {\n showDevConsole: boolean;\n versionStatus: VersionStatus;\n currentVersion: string;\n latestVersion: string;\n}) {\n const [copyStatus, setCopyStatus] = useState<string>(\"\");\n\n let versionLabel = \"\";\n let versionIcon: any = \"\";\n let currentVersionLabel = currentVersion;\n\n if (versionStatus === \"latest\") {\n versionLabel = \"latest\";\n versionIcon = CheckIcon;\n } else if (versionStatus === \"checking\") {\n versionLabel = \"checking\";\n versionIcon = SmallSpinnerIcon;\n } else if (versionStatus === \"update-available\") {\n versionLabel = \"update available\";\n versionIcon = ExclamationMarkIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n } else if (versionStatus === \"outdated\") {\n versionLabel = \"outdated\";\n versionIcon = ExclamationMarkTriangleIcon;\n currentVersionLabel = `${currentVersion} → ${latestVersion}`;\n }\n\n let asideLabel = \"\";\n if (showDevConsole === true) {\n asideLabel = \"(enabled)\";\n }\n\n const installCommand = [\n `npm install`,\n `@copilotkit/react-core@${latestVersion}`,\n `@copilotkit/react-ui@${latestVersion}`,\n `@copilotkit/react-textarea@${latestVersion}`,\n `&& npm install @copilotkit/runtime@${latestVersion}`,\n ].join(\" \");\n\n const handleCopyClick = async () => {\n const success = await copyToClipboard(installCommand.trim());\n if (success) {\n setCopyStatus(\"Command copied to clipboard!\");\n setTimeout(() => setCopyStatus(\"\"), 1000);\n }\n };\n\n if (versionStatus === \"update-available\" || versionStatus === \"outdated\") {\n return (\n <div className=\"copilotKitVersionInfo\">\n <p>\n {currentVersionLabel} {versionIcon}\n </p>\n <button onClick={handleCopyClick}>\n {copyStatus || installCommand}\n </button>\n </div>\n );\n }\n\n return null;\n}\n\nexport default function DebugMenuButton({\n setShowDevConsole,\n checkForUpdates,\n mode,\n}: {\n setShowDevConsole: (show: boolean) => void;\n checkForUpdates: (force: boolean) => void;\n mode: \"full\" | \"compact\";\n}) {\n const context = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n\n return (\n <>\n <Menu>\n <MenuButton\n className={`copilotKitDebugMenuTriggerButton ${mode === \"compact\" ? \"compact\" : \"\"}`}\n >\n {mode == \"compact\" ? \"Debug\" : <>Debug {ChevronDownIcon}</>}\n </MenuButton>\n\n <MenuItems\n transition\n anchor=\"bottom end\"\n className=\"copilotKitDebugMenu\"\n style={{ zIndex: 40 }}\n >\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logReadables(context)}\n >\n Log Readables\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logActions(context)}\n >\n Log Actions\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => logMessages(messagesContext)}\n >\n Log Messages\n </button>\n </MenuItem>\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => checkForUpdates(true)}\n >\n Check for Updates\n </button>\n </MenuItem>\n <hr />\n <MenuItem>\n <button\n className=\"copilotKitDebugMenuItem\"\n onClick={() => setShowDevConsole(false)}\n >\n Hide Dev Console\n </button>\n </MenuItem>\n </MenuItems>\n </Menu>\n </>\n );\n}\n","import { HeaderProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { CopilotDevConsole } from \"../dev-console\";\nimport React from \"react\";\n\nexport const Header = ({}: HeaderProps) => {\n const { setOpen, icons, labels } = useChatContext();\n\n return (\n <div className=\"copilotKitHeader\">\n <div>{labels.title}</div>\n <div className=\"copilotKitHeaderControls\">\n <CopilotDevConsole />\n <button\n onClick={() => setOpen(false)}\n aria-label=\"Close\"\n className=\"copilotKitHeaderCloseButton\"\n >\n {icons.headerCloseIcon}\n </button>\n </div>\n </div>\n );\n};\n","import React, { memo, useState } from \"react\";\nimport type { InputContentSource } from \"@copilotkit/shared\";\nimport { getSourceUrl, getDocumentIcon } from \"@copilotkit/shared\";\n\ninterface AttachmentRendererProps {\n type: \"image\" | \"audio\" | \"video\" | \"document\";\n source: InputContentSource;\n filename?: string;\n className?: string;\n}\n\nconst ImageAttachment = memo(function ImageAttachment({\n src,\n className,\n}: {\n src: string;\n className?: string;\n}) {\n const [error, setError] = useState(false);\n\n if (error) {\n return (\n <div\n className={`copilotKitImageRendering copilotKitImageRenderingError ${className ?? \"\"}`}\n >\n <div className=\"copilotKitImageRenderingErrorMessage\">\n Failed to load image\n </div>\n </div>\n );\n }\n\n return (\n <div className={`copilotKitImageRendering ${className ?? \"\"}`}>\n <img\n src={src}\n alt=\"Image attachment\"\n className=\"copilotKitImageRenderingImage\"\n onError={() => setError(true)}\n />\n </div>\n );\n});\n\nconst AudioAttachment = memo(function AudioAttachment({\n src,\n filename,\n className,\n}: {\n src: string;\n filename?: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentAudio ${className ?? \"\"}`}\n >\n <audio src={src} controls preload=\"metadata\" />\n {filename && (\n <span className=\"copilotKitAttachmentFilename\">{filename}</span>\n )}\n </div>\n );\n});\n\nconst VideoAttachment = memo(function VideoAttachment({\n src,\n className,\n}: {\n src: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentVideo ${className ?? \"\"}`}\n >\n <video src={src} controls preload=\"metadata\" />\n </div>\n );\n});\n\nconst DocumentAttachment = memo(function DocumentAttachment({\n source,\n filename,\n className,\n}: {\n source: InputContentSource;\n filename?: string;\n className?: string;\n}) {\n return (\n <div\n className={`copilotKitAttachment copilotKitAttachmentDocument ${className ?? \"\"}`}\n >\n <div className=\"copilotKitAttachmentDocIcon\">\n {getDocumentIcon(source.mimeType ?? \"\")}\n </div>\n <div className=\"copilotKitAttachmentDocInfo\">\n <span className=\"copilotKitAttachmentDocName\">\n {filename || source.mimeType || \"Unknown type\"}\n </span>\n </div>\n </div>\n );\n});\n\nexport const AttachmentRenderer: React.FC<AttachmentRendererProps> = ({\n type,\n source,\n filename,\n className,\n}) => {\n const src = getSourceUrl(source);\n\n switch (type) {\n case \"image\":\n return <ImageAttachment src={src} className={className} />;\n case \"audio\":\n return (\n <AudioAttachment src={src} filename={filename} className={className} />\n );\n case \"video\":\n return <VideoAttachment src={src} className={className} />;\n case \"document\":\n return (\n <DocumentAttachment\n source={source}\n filename={filename}\n className={className}\n />\n );\n }\n};\n","import { UserMessageProps } from \"../props\";\nimport { AttachmentRenderer } from \"../AttachmentRenderer\";\n\ntype UserMessageContent = NonNullable<UserMessageProps[\"message\"]>[\"content\"];\n\nconst getTextContent = (\n content: UserMessageContent | undefined,\n): string | undefined => {\n if (typeof content === \"undefined\") {\n return undefined;\n }\n\n if (typeof content === \"string\") {\n return content;\n }\n\n return (\n content\n .map((part) => {\n if (part.type === \"text\") {\n return part.text;\n }\n return undefined;\n })\n .filter(\n (value): value is string =>\n typeof value === \"string\" && value.length > 0,\n )\n .join(\" \")\n .trim() || undefined\n );\n};\n\nconst getMediaParts = (content: UserMessageContent | undefined) => {\n if (!content || typeof content === \"string\") return [];\n\n return content.filter(\n (part) =>\n part.type === \"image\" ||\n part.type === \"audio\" ||\n part.type === \"video\" ||\n part.type === \"document\",\n ) as Array<{\n type: \"image\" | \"audio\" | \"video\" | \"document\";\n source:\n | { type: \"data\"; value: string; mimeType: string }\n | { type: \"url\"; value: string; mimeType?: string };\n }>;\n};\n\nexport const UserMessage = (props: UserMessageProps) => {\n const { message, ImageRenderer } = props;\n const content = message?.content;\n\n // Legacy path: old-style image field on message\n const isLegacyImageMessage =\n message && \"image\" in message && Boolean((message as any).image);\n\n if (isLegacyImageMessage) {\n const legacyImage = (message as any).image;\n const textContent = getTextContent(content);\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n <ImageRenderer image={legacyImage} content={textContent} />\n </div>\n );\n }\n\n const textContent = getTextContent(content);\n const mediaParts = getMediaParts(content);\n\n if (mediaParts.length === 0) {\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n {textContent}\n </div>\n );\n }\n\n return (\n <div className=\"copilotKitMessage copilotKitUserMessage\">\n {textContent && <div>{textContent}</div>}\n {mediaParts.map((part, index) => (\n <AttachmentRenderer key={index} type={part.type} source={part.source} />\n ))}\n </div>\n );\n};\n","import * as React from \"react\";\n\nexport interface useCopyToClipboardProps {\n timeout?: number;\n}\n\nexport function useCopyToClipboard({\n timeout = 2000,\n}: useCopyToClipboardProps) {\n const [isCopied, setIsCopied] = React.useState<boolean>(false);\n\n const copyToClipboard = (value: string) => {\n if (typeof window === \"undefined\" || !navigator.clipboard?.writeText) {\n return;\n }\n\n if (!value) {\n return;\n }\n\n navigator.clipboard.writeText(value).then(() => {\n setIsCopied(true);\n\n setTimeout(() => {\n setIsCopied(false);\n }, timeout);\n });\n };\n\n return { isCopied, copyToClipboard };\n}\n","import { FC, memo, useEffect, useState } from \"react\";\nimport { Prism, Light } from \"react-syntax-highlighter\";\nimport { useCopyToClipboard } from \"../../hooks/use-copy-to-clipboard\";\nimport { CheckIcon, CopyIcon, DownloadIcon } from \"./Icons\";\n\ninterface CodeActionButtonProps {\n onClick: () => void;\n children: React.ReactNode;\n}\n\ninterface Props {\n language: string;\n value: string;\n}\n\ninterface languageMap {\n [key: string]: string | undefined;\n}\n\nexport const programmingLanguages: languageMap = {\n javascript: \".js\",\n python: \".py\",\n java: \".java\",\n c: \".c\",\n cpp: \".cpp\",\n \"c++\": \".cpp\",\n \"c#\": \".cs\",\n ruby: \".rb\",\n php: \".php\",\n swift: \".swift\",\n \"objective-c\": \".m\",\n kotlin: \".kt\",\n typescript: \".ts\",\n go: \".go\",\n perl: \".pl\",\n rust: \".rs\",\n scala: \".scala\",\n haskell: \".hs\",\n lua: \".lua\",\n shell: \".sh\",\n sql: \".sql\",\n html: \".html\",\n css: \".css\",\n // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component\n};\n\nexport const generateRandomString = (length: number, lowercase = false) => {\n const chars = \"ABCDEFGHJKLMNPQRSTUVWXY3456789\"; // excluding similar looking characters like Z, 2, I, 1, O, 0\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return lowercase ? result.toLowerCase() : result;\n};\n\nconst CodeBlock: FC<Props> = memo(({ language, value }) => {\n const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });\n const [SyntaxHighlighter, setSyntaxHighlighter] = useState<\n typeof Light | typeof Prism\n >(() => Light);\n\n useEffect(() => {\n try {\n new RegExp(\"(?<=#)\\\\w+\");\n setSyntaxHighlighter(() => Prism);\n } catch {\n setSyntaxHighlighter(() => Light);\n }\n }, []);\n\n const downloadAsFile = () => {\n if (typeof window === \"undefined\") {\n return;\n }\n const fileExtension = programmingLanguages[language] || \".file\";\n const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;\n const fileName = window.prompt(\"Enter file name\", suggestedFileName);\n\n if (!fileName) {\n // User pressed cancel on prompt.\n return;\n }\n\n const blob = new Blob([value], { type: \"text/plain\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.download = fileName;\n link.href = url;\n link.style.display = \"none\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n };\n\n const onCopy = () => {\n if (isCopied) return;\n copyToClipboard(value);\n };\n\n return (\n <div className=\"copilotKitCodeBlock\">\n <div className=\"copilotKitCodeBlockToolbar\">\n <span className=\"copilotKitCodeBlockToolbarLanguage\">{language}</span>\n <div className=\"copilotKitCodeBlockToolbarButtons\">\n <button\n className=\"copilotKitCodeBlockToolbarButton\"\n onClick={downloadAsFile}\n >\n {DownloadIcon}\n </button>\n <button className=\"copilotKitCodeBlockToolbarButton\" onClick={onCopy}>\n {isCopied ? CheckIcon : CopyIcon}\n </button>\n </div>\n </div>\n <SyntaxHighlighter\n language={language}\n style={highlightStyle}\n PreTag=\"div\"\n customStyle={{\n margin: 0,\n borderBottomLeftRadius: \"0.375rem\",\n borderBottomRightRadius: \"0.375rem\",\n }}\n >\n {value}\n </SyntaxHighlighter>\n </div>\n );\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nexport { CodeBlock };\n\n// import { vscDarkPlus as highlightStyle } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n// As a workaround, we inline the vscDarkPlus from react-syntax-highlighter.\n// Importing it as recommended in the documentation leads to build errors in the non app router\n// (Next.js classic) setup.\nconst highlightStyle: any = {\n 'pre[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily:\n 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n padding: \"1em\",\n margin: \".5em 0\",\n overflow: \"auto\",\n background: \"#1e1e1e\",\n },\n 'code[class*=\"language-\"]': {\n color: \"#d4d4d4\",\n fontSize: \"13px\",\n textShadow: \"none\",\n fontFamily:\n 'Menlo, Monaco, Consolas, \"Andale Mono\", \"Ubuntu Mono\", \"Courier New\", monospace',\n direction: \"ltr\",\n textAlign: \"left\",\n whiteSpace: \"pre\",\n wordSpacing: \"normal\",\n wordBreak: \"normal\",\n lineHeight: \"1.5\",\n MozTabSize: \"4\",\n OTabSize: \"4\",\n tabSize: \"4\",\n WebkitHyphens: \"none\",\n MozHyphens: \"none\",\n msHyphens: \"none\",\n hyphens: \"none\",\n },\n 'pre[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"]::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'pre[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n 'code[class*=\"language-\"] *::selection': {\n textShadow: \"none\",\n background: \"#264F78\",\n },\n ':not(pre) > code[class*=\"language-\"]': {\n padding: \".1em .3em\",\n borderRadius: \".3em\",\n color: \"#db4c69\",\n background: \"#1e1e1e\",\n },\n \".namespace\": {\n Opacity: \".7\",\n },\n \"doctype.doctype-tag\": {\n color: \"#569CD6\",\n },\n \"doctype.name\": {\n color: \"#9cdcfe\",\n },\n comment: {\n color: \"#6a9955\",\n },\n prolog: {\n color: \"#6a9955\",\n },\n punctuation: {\n color: \"#d4d4d4\",\n },\n \".language-html .language-css .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n \".language-html .language-javascript .token.punctuation\": {\n color: \"#d4d4d4\",\n },\n property: {\n color: \"#9cdcfe\",\n },\n tag: {\n color: \"#569cd6\",\n },\n boolean: {\n color: \"#569cd6\",\n },\n number: {\n color: \"#b5cea8\",\n },\n constant: {\n color: \"#9cdcfe\",\n },\n symbol: {\n color: \"#b5cea8\",\n },\n inserted: {\n color: \"#b5cea8\",\n },\n unit: {\n color: \"#b5cea8\",\n },\n selector: {\n color: \"#d7ba7d\",\n },\n \"attr-name\": {\n color: \"#9cdcfe\",\n },\n string: {\n color: \"#ce9178\",\n },\n char: {\n color: \"#ce9178\",\n },\n builtin: {\n color: \"#ce9178\",\n },\n deleted: {\n color: \"#ce9178\",\n },\n \".language-css .token.string.url\": {\n textDecoration: \"underline\",\n },\n operator: {\n color: \"#d4d4d4\",\n },\n entity: {\n color: \"#569cd6\",\n },\n \"operator.arrow\": {\n color: \"#569CD6\",\n },\n atrule: {\n color: \"#ce9178\",\n },\n \"atrule.rule\": {\n color: \"#c586c0\",\n },\n \"atrule.url\": {\n color: \"#9cdcfe\",\n },\n \"atrule.url.function\": {\n color: \"#dcdcaa\",\n },\n \"atrule.url.punctuation\": {\n color: \"#d4d4d4\",\n },\n keyword: {\n color: \"#569CD6\",\n },\n \"keyword.module\": {\n color: \"#c586c0\",\n },\n \"keyword.control-flow\": {\n color: \"#c586c0\",\n },\n function: {\n color: \"#dcdcaa\",\n },\n \"function.maybe-class-name\": {\n color: \"#dcdcaa\",\n },\n regex: {\n color: \"#d16969\",\n },\n important: {\n color: \"#569cd6\",\n },\n italic: {\n fontStyle: \"italic\",\n },\n \"class-name\": {\n color: \"#4ec9b0\",\n },\n \"maybe-class-name\": {\n color: \"#4ec9b0\",\n },\n console: {\n color: \"#9cdcfe\",\n },\n parameter: {\n color: \"#9cdcfe\",\n },\n interpolation: {\n color: \"#9cdcfe\",\n },\n \"punctuation.interpolation-punctuation\": {\n color: \"#569cd6\",\n },\n variable: {\n color: \"#9cdcfe\",\n },\n \"imports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n \"exports.maybe-class-name\": {\n color: \"#9cdcfe\",\n },\n escape: {\n color: \"#d7ba7d\",\n },\n \"tag.punctuation\": {\n color: \"#808080\",\n },\n cdata: {\n color: \"#808080\",\n },\n \"attr-value\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation\": {\n color: \"#ce9178\",\n },\n \"attr-value.punctuation.attr-equals\": {\n color: \"#d4d4d4\",\n },\n namespace: {\n color: \"#4ec9b0\",\n },\n 'pre[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-javascript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-jsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-typescript\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'code[class*=\"language-tsx\"]': {\n color: \"#9cdcfe\",\n },\n 'pre[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'code[class*=\"language-css\"]': {\n color: \"#ce9178\",\n },\n 'pre[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n 'code[class*=\"language-html\"]': {\n color: \"#d4d4d4\",\n },\n \".language-regex .token.anchor\": {\n color: \"#dcdcaa\",\n },\n \".language-html .token.punctuation\": {\n color: \"#808080\",\n },\n 'pre[class*=\"language-\"] > code[class*=\"language-\"]': {\n position: \"relative\",\n zIndex: \"1\",\n },\n \".line-highlight.line-highlight\": {\n background: \"#f7ebc6\",\n boxShadow: \"inset 5px 0 0 #f7d87c\",\n zIndex: \"0\",\n },\n};\n","import { FC, memo, useMemo } from \"react\";\nimport ReactMarkdown, { Options, Components } from \"react-markdown\";\nimport { CodeBlock } from \"./CodeBlock\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport rehypeRaw from \"rehype-raw\";\n\nconst defaultComponents: Components = {\n a({ children, ...props }) {\n return (\n <a\n className=\"copilotKitMarkdownElement\"\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {children}\n </a>\n );\n },\n // @ts-expect-error -- inline\n code({ children, className, inline, ...props }) {\n if (Array.isArray(children) && children.length) {\n if (children[0] == \"▍\") {\n return (\n <span\n style={{\n animation: \"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite\",\n marginTop: \"0.25rem\",\n }}\n >\n ▍\n </span>\n );\n }\n\n children[0] = (children?.[0] as string).replace(\"`▍`\", \"▍\");\n }\n\n const match = /language-(\\w+)/.exec(className || \"\");\n\n // Detect inline code: if it has a language class or contains newlines, it's likely a code block\n // Otherwise, treat it as inline code\n const hasLanguage = match && match[1];\n const content = String(children);\n const hasNewlines = content.includes(\"\\n\");\n const isInline = !hasLanguage && !hasNewlines;\n\n if (isInline) {\n return (\n <code\n className={`copilotKitMarkdownElement copilotKitInlineCode ${className || \"\"}`}\n {...props}\n >\n {children}\n </code>\n );\n }\n\n return (\n <CodeBlock\n language={(match && match[1]) || \"\"}\n value={String(children).replace(/\\n$/, \"\")}\n {...props}\n />\n );\n },\n h1: ({ children, ...props }) => (\n <h1 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h1>\n ),\n h2: ({ children, ...props }) => (\n <h2 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h2>\n ),\n h3: ({ children, ...props }) => (\n <h3 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h3>\n ),\n h4: ({ children, ...props }) => (\n <h4 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h4>\n ),\n h5: ({ children, ...props }) => (\n <h5 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h5>\n ),\n h6: ({ children, ...props }) => (\n <h6 className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </h6>\n ),\n p: ({ children, ...props }) => (\n <div className=\"copilotKitMarkdownElement copilotKitParagraph\" {...props}>\n {children}\n </div>\n ),\n pre: ({ children, ...props }) => (\n <pre className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </pre>\n ),\n blockquote: ({ children, ...props }) => (\n <blockquote className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </blockquote>\n ),\n ul: ({ children, ...props }) => (\n <ul className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </ul>\n ),\n li: ({ children, ...props }) => (\n <li className=\"copilotKitMarkdownElement\" {...props}>\n {children}\n </li>\n ),\n};\n\nconst MemoizedReactMarkdown: FC<Options> = memo(ReactMarkdown);\n\ntype MarkdownProps = Omit<Options, \"children\"> & {\n content: string;\n};\n\nexport const Markdown = ({\n content,\n components,\n remarkPlugins,\n rehypePlugins,\n ...rest\n}: MarkdownProps) => {\n const mergedComponents = useMemo(\n () => ({ ...defaultComponents, ...components }),\n [components],\n );\n const mergedRemarkPlugins = useMemo<Options[\"remarkPlugins\"]>(\n () => [\n remarkGfm,\n [remarkMath, { singleDollarTextMath: false }],\n ...(remarkPlugins ?? []),\n ],\n [remarkPlugins],\n );\n const mergedRehypePlugins = useMemo<Options[\"rehypePlugins\"]>(\n () => [rehypeRaw, ...(rehypePlugins ?? [])],\n [rehypePlugins],\n );\n return (\n <div className=\"copilotKitMarkdown\">\n <MemoizedReactMarkdown\n {...rest}\n components={mergedComponents}\n remarkPlugins={mergedRemarkPlugins}\n rehypePlugins={mergedRehypePlugins}\n >\n {content}\n </MemoizedReactMarkdown>\n </div>\n );\n};\n","import { AssistantMessageProps } from \"../props\";\nimport { useChatContext } from \"../ChatContext\";\nimport { Markdown } from \"../Markdown\";\nimport { useState } from \"react\";\nimport React from \"react\";\nimport { copyToClipboard } from \"@copilotkit/shared\";\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 = async () => {\n const content = message?.content || \"\";\n if (!content) return;\n\n const success = await copyToClipboard(content);\n if (success) {\n setCopied(true);\n if (onCopy) onCopy(content);\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?.() ?? props.subComponent;\n const subComponentPosition = message?.generativeUIPosition ?? \"after\";\n const renderBefore = subComponent && subComponentPosition === \"before\";\n const renderAfter = subComponent && subComponentPosition !== \"before\";\n\n return (\n <>\n {renderBefore ? (\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n ) : null}\n {content && (\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n {content && (\n <Markdown content={content} components={markdownTagRenderers} />\n )}\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\" }}>\n ✓\n </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 {renderAfter ? (\n <div style={{ marginBottom: \"0.5rem\" }}>{subComponent}</div>\n ) : null}\n {isLoading && <LoadingIcon />}\n </>\n );\n};\n","import React, { useState } from \"react\";\nimport { ImageRendererProps } from \"../props\";\n\n/**\n * @deprecated Use `CopilotChatAttachmentRenderer` from `@copilotkit/react-core/v2` instead.\n * `ImageRenderer` only handles images. The v2 attachment renderer supports images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport const ImageRenderer: React.FC<ImageRendererProps> = ({\n image,\n source,\n content,\n className = \"\",\n}) => {\n const [imageError, setImageError] = useState(false);\n\n // Determine image src from either legacy ImageData or new InputContentSource\n let imageSrc: string;\n if (source) {\n imageSrc =\n source.type === \"url\"\n ? source.value\n : `data:${source.mimeType};base64,${source.value}`;\n } else if (image) {\n imageSrc = `data:image/${image.format};base64,${image.bytes}`;\n } else {\n return null;\n }\n\n const altText = content || \"User uploaded image\";\n\n if (imageError) {\n return (\n <div\n className={`copilotKitImageRendering copilotKitImageRenderingError ${className}`}\n >\n <div className=\"copilotKitImageRenderingErrorMessage\">\n Failed to load image\n </div>\n {content && (\n <div className=\"copilotKitImageRenderingContent\">{content}</div>\n )}\n </div>\n );\n }\n\n return (\n <div className={`copilotKitImageRendering ${className}`}>\n <img\n src={imageSrc}\n alt={altText}\n className=\"copilotKitImageRenderingImage\"\n onError={() => setImageError(true)}\n />\n {content && (\n <div className=\"copilotKitImageRenderingContent\">{content}</div>\n )}\n </div>\n );\n};\n","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 default:\n return null;\n }\n}\n","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 (\n deprecatedMessage.isActionExecutionMessage() &&\n RenderActionExecutionMessage\n ) {\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","import React, { useEffect, useMemo, useRef } from \"react\";\nimport { MessagesProps } from \"./props\";\nimport { useChatContext } from \"./ChatContext\";\nimport { Message } from \"@copilotkit/shared\";\nimport { useCopilotChatInternal } from \"@copilotkit/react-core\";\nimport {\n LegacyRenderMessage,\n LegacyRenderProps,\n} from \"./messages/LegacyRenderMessage\";\n\nexport const Messages = ({\n inProgress,\n children,\n RenderMessage,\n AssistantMessage,\n UserMessage,\n ErrorMessage,\n ImageRenderer,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n messageFeedback,\n markdownTagRenderers,\n chatError,\n\n // Legacy props\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n}: MessagesProps) => {\n const { labels, icons } = useChatContext();\n const { messages: visibleMessages, interrupt } = useCopilotChatInternal();\n const initialMessages = useMemo(\n () => makeInitialMessages(labels.initial),\n [labels.initial],\n );\n const messages = [...initialMessages, ...visibleMessages];\n const { messagesContainerRef, messagesEndRef } = useScrollToBottom(messages);\n\n // Check if any legacy props are provided\n const hasLegacyProps = !!(\n RenderTextMessage ||\n RenderActionExecutionMessage ||\n RenderAgentStateMessage ||\n RenderResultMessage ||\n RenderImageMessage\n );\n\n // Show deprecation warning if legacy props are used\n useEffect(() => {\n if (hasLegacyProps) {\n console.warn(\n \"[CopilotKit] Legacy message render props (RenderTextMessage, RenderActionExecutionMessage, etc.) are deprecated. \" +\n \"Please use the unified 'RenderMessage' prop instead. \" +\n \"See migration guide: https://docs.copilotkit.ai/migration/render-message\",\n );\n }\n }, [hasLegacyProps]);\n\n // Create legacy props object for the adapter\n const legacyProps: LegacyRenderProps = useMemo(\n () => ({\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n }),\n [\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n ],\n );\n\n // Determine which render component to use\n const MessageRenderer = hasLegacyProps\n ? (props: any) => (\n <LegacyRenderMessage {...props} legacyProps={legacyProps} />\n )\n : RenderMessage;\n\n const LoadingIcon = () => <span>{icons.activityIcon}</span>;\n\n return (\n <div className=\"copilotKitMessages\" ref={messagesContainerRef}>\n <div className=\"copilotKitMessagesContainer\">\n {messages.map((message, index) => {\n const isCurrentMessage = index === messages.length - 1;\n return (\n <MessageRenderer\n key={index}\n message={message}\n messages={messages}\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 messageFeedback={messageFeedback}\n markdownTagRenderers={markdownTagRenderers}\n />\n );\n })}\n {inProgress &&\n (messages[messages.length - 1]?.role === \"user\" ||\n messages[messages.length - 1]?.role === \"tool\") && <LoadingIcon />}\n {interrupt}\n {chatError && ErrorMessage && (\n <ErrorMessage error={chatError} isCurrentMessage />\n )}\n </div>\n <footer className=\"copilotKitMessagesFooter\" ref={messagesEndRef}>\n {children}\n </footer>\n </div>\n );\n};\n\nfunction makeInitialMessages(\n initial: string | string[] | undefined,\n): Message[] {\n if (!initial) return [];\n\n if (Array.isArray(initial)) {\n return initial.map((message) => {\n return {\n id: message,\n role: \"assistant\",\n content: message,\n };\n });\n }\n\n return [\n {\n id: initial,\n role: \"assistant\",\n content: initial,\n },\n ];\n}\n\nexport function useScrollToBottom(messages: Message[]) {\n const messagesEndRef = useRef<HTMLDivElement>(null);\n const messagesContainerRef = useRef<HTMLDivElement | null>(null);\n const isProgrammaticScrollRef = useRef(false);\n const isUserScrollUpRef = useRef(false);\n\n const scrollToBottom = () => {\n if (messagesContainerRef.current && messagesEndRef.current) {\n isProgrammaticScrollRef.current = true;\n messagesContainerRef.current.scrollTop =\n messagesContainerRef.current.scrollHeight;\n }\n };\n\n const handleScroll = () => {\n if (isProgrammaticScrollRef.current) {\n isProgrammaticScrollRef.current = false;\n return;\n }\n\n if (messagesContainerRef.current) {\n const { scrollTop, scrollHeight, clientHeight } =\n messagesContainerRef.current;\n isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;\n }\n };\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (container) {\n container.addEventListener(\"scroll\", handleScroll);\n }\n return () => {\n if (container) {\n container.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, []);\n\n useEffect(() => {\n const container = messagesContainerRef.current;\n if (!container) {\n return;\n }\n\n const mutationObserver = new MutationObserver(() => {\n if (!isUserScrollUpRef.current) {\n scrollToBottom();\n }\n });\n\n mutationObserver.observe(container, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, []);\n\n useEffect(() => {\n isUserScrollUpRef.current = false;\n scrollToBottom();\n }, [messages.filter((m) => m.role === \"user\").length]);\n\n return { messagesEndRef, messagesContainerRef };\n}\n","import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n} from \"react\";\n\ninterface AutoResizingTextareaProps {\n maxRows?: number;\n placeholder?: string;\n value: string;\n onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;\n onCompositionStart?: () => void;\n onCompositionEnd?: () => void;\n autoFocus?: boolean;\n}\n\nconst AutoResizingTextarea = forwardRef<\n HTMLTextAreaElement,\n AutoResizingTextareaProps\n>(\n (\n {\n maxRows = 1,\n placeholder,\n value,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n autoFocus,\n },\n ref,\n ) => {\n const internalTextareaRef = useRef<HTMLTextAreaElement>(null);\n const [maxHeight, setMaxHeight] = useState<number>(0);\n\n useImperativeHandle(\n ref,\n () => internalTextareaRef.current as HTMLTextAreaElement,\n );\n\n useEffect(() => {\n const calculateMaxHeight = () => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n const singleRowHeight = textarea.scrollHeight;\n setMaxHeight(singleRowHeight * maxRows);\n if (autoFocus) {\n textarea.focus();\n }\n }\n };\n\n calculateMaxHeight();\n }, [maxRows]);\n\n useEffect(() => {\n const textarea = internalTextareaRef.current;\n if (textarea) {\n textarea.style.height = \"auto\";\n textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;\n }\n }, [value, maxHeight]);\n\n return (\n <textarea\n ref={internalTextareaRef}\n value={value}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onCompositionStart={onCompositionStart}\n onCompositionEnd={onCompositionEnd}\n placeholder={placeholder}\n style={{\n overflow: \"auto\",\n resize: \"none\",\n maxHeight: `${maxHeight}px`,\n }}\n rows={1}\n />\n );\n },\n);\n\nexport default AutoResizingTextarea;\n","import {\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"@copilotkit/react-core\";\nimport { gqlToAGUI } from \"@copilotkit/runtime-client-gql\";\nimport { Message } from \"@copilotkit/shared\";\nimport { MutableRefObject, useEffect, useRef, useState } from \"react\";\n\nexport const checkMicrophonePermission = async () => {\n try {\n const permissionStatus = await navigator.permissions.query({\n name: \"microphone\" as PermissionName,\n });\n if (permissionStatus.state === \"granted\") {\n return true;\n } else {\n return false;\n }\n } catch (err) {\n console.error(\"Error checking microphone permission\", err);\n }\n};\n\nexport const requestMicAndPlaybackPermission = async () => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n const audioContext = new window.AudioContext();\n await audioContext.resume();\n return { stream, audioContext };\n } catch (err) {\n console.error(\"Error requesting microphone and playback permissions\", err);\n return null;\n }\n};\n\nconst startRecording = async (\n mediaStreamRef: MutableRefObject<MediaStream | null>,\n mediaRecorderRef: MutableRefObject<MediaRecorder | null>,\n audioContextRef: MutableRefObject<AudioContext | null>,\n recordedChunks: Blob[],\n onStop: () => void,\n) => {\n if (!mediaStreamRef.current || !audioContextRef.current) {\n mediaStreamRef.current = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n audioContextRef.current = new window.AudioContext();\n await audioContextRef.current.resume();\n }\n\n mediaRecorderRef.current = new MediaRecorder(mediaStreamRef.current!);\n mediaRecorderRef.current.start(1000);\n mediaRecorderRef.current.ondataavailable = (event) => {\n recordedChunks.push(event.data);\n };\n mediaRecorderRef.current.onstop = onStop;\n};\n\nconst stopRecording = (\n mediaRecorderRef: MutableRefObject<MediaRecorder | null>,\n mediaStreamRef?: MutableRefObject<MediaStream | null>,\n) => {\n if (\n mediaRecorderRef.current &&\n mediaRecorderRef.current.state !== \"inactive\"\n ) {\n mediaRecorderRef.current.stop();\n }\n // Release microphone tracks to free the device\n if (mediaStreamRef?.current) {\n mediaStreamRef.current.getTracks().forEach((track) => track.stop());\n mediaStreamRef.current = null;\n }\n};\n\nconst transcribeAudio = async (\n recordedChunks: Blob[],\n transcribeAudioUrl: string,\n mediaType: string = \"audio/mp4\",\n) => {\n const extension = mediaType.split(\"/\")[1] || \"mp4\";\n const completeBlob = new Blob(recordedChunks, { type: mediaType });\n const formData = new FormData();\n formData.append(\"file\", completeBlob, `recording.${extension}`);\n\n const response = await fetch(transcribeAudioUrl, {\n method: \"POST\",\n body: formData,\n });\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n\n const transcription = await response.json();\n return transcription.text;\n};\n\nconst playAudioResponse = (\n text: string,\n textToSpeechUrl: string,\n audioContext: AudioContext,\n) => {\n const encodedText = encodeURIComponent(text);\n const url = `${textToSpeechUrl}?text=${encodedText}`;\n\n fetch(url)\n .then((response) => response.arrayBuffer())\n .then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer))\n .then((audioBuffer) => {\n const source = audioContext.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioContext.destination);\n source.start(0);\n })\n .catch((error) => {\n console.error(\"Error with decoding audio data\", error);\n });\n};\n\nexport type PushToTalkState = \"idle\" | \"recording\" | \"transcribing\";\n\nexport type SendFunction = (text: string) => Promise<Message | void>;\n\nexport const usePushToTalk = ({\n sendFunction,\n inProgress,\n mediaType = \"audio/mp4\",\n}: {\n sendFunction: SendFunction;\n inProgress: boolean;\n mediaType?: string;\n}) => {\n const [pushToTalkState, setPushToTalkState] =\n useState<PushToTalkState>(\"idle\");\n const mediaStreamRef = useRef<MediaStream | null>(null);\n const audioContextRef = useRef<AudioContext | null>(null);\n const mediaRecorderRef = useRef<MediaRecorder | null>(null);\n const recordedChunks = useRef<Blob[]>([]);\n const generalContext = useCopilotContext();\n const messagesContext = useCopilotMessagesContext();\n const context = { ...generalContext, ...messagesContext };\n const [startReadingFromMessageId, setStartReadingFromMessageId] = useState<\n string | null\n >(null);\n\n useEffect(() => {\n if (pushToTalkState === \"recording\") {\n startRecording(\n mediaStreamRef,\n mediaRecorderRef,\n audioContextRef,\n recordedChunks.current,\n () => {\n setPushToTalkState(\"transcribing\");\n },\n );\n } else {\n stopRecording(mediaRecorderRef, mediaStreamRef);\n if (pushToTalkState === \"transcribing\") {\n transcribeAudio(\n recordedChunks.current,\n context.copilotApiConfig.transcribeAudioUrl!,\n mediaType,\n ).then(async (transcription) => {\n recordedChunks.current = [];\n setPushToTalkState(\"idle\");\n const message = await sendFunction(transcription);\n if (message) {\n setStartReadingFromMessageId(message.id);\n }\n });\n }\n }\n\n return () => {\n stopRecording(mediaRecorderRef, mediaStreamRef);\n };\n }, [pushToTalkState]);\n\n useEffect(() => {\n if (inProgress === false && startReadingFromMessageId) {\n const lastMessageIndex = context.messages.findIndex(\n (message) => message.id === startReadingFromMessageId,\n );\n\n const aguiMessages = gqlToAGUI(context.messages);\n\n const messagesAfterLast = aguiMessages\n .slice(lastMessageIndex + 1)\n .filter((message) => message.role === \"assistant\");\n\n const text = messagesAfterLast\n .map((message) => message.content)\n .join(\"\\n\");\n playAudioResponse(\n text,\n context.copilotApiConfig.textToSpeechUrl!,\n audioContextRef.current!,\n );\n\n setStartReadingFromMessageId(null);\n }\n }, [startReadingFromMessageId, inProgress]);\n\n return { pushToTalkState, setPushToTalkState };\n};\n","export const useDarkMode = () => {\n if (typeof window === \"undefined\") return false;\n return (\n document.documentElement.classList.contains(\"dark\") ||\n document.body.classList.contains(\"dark\") ||\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ||\n document.body.getAttribute(\"data-theme\") === \"dark\" ||\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n );\n};\n","import React, { useState, useEffect } from \"react\";\nimport { useDarkMode } from \"../../hooks/use-dark-mode\";\n\nexport function PoweredByTag({\n showPoweredBy = true,\n removeBranding = false,\n}: {\n showPoweredBy?: boolean;\n removeBranding?: boolean;\n}) {\n const [mounted, setMounted] = useState(false);\n const isDark = useDarkMode();\n\n /*\n note(tylerslaton):\n\n Ensure we only use the isDark computed value after client-side mount.\n This prevents hydration mismatches by using a default color on the\n server and initial client render, then updating to the correct\n dark mode color after hydration is complete.\n */\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!showPoweredBy || removeBranding) {\n return null;\n }\n\n const poweredByStyle = {\n visibility: \"visible\",\n display: \"block\",\n position: \"static\",\n textAlign: \"center\",\n fontSize: \"12px\",\n padding: \"3px 0\",\n color: mounted && isDark ? \"rgb(69, 69, 69)\" : \"rgb(214, 214, 214)\",\n };\n\n return (\n <div>\n {/*@ts-expect-error -- expecting position not to be a string, but it can be.*/}\n <p className=\"poweredBy\" style={poweredByStyle}>\n Powered by CopilotKit\n </p>\n </div>\n );\n}\n","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 {\n useCopilotContext,\n useCopilotChatInternal,\n} from \"@copilotkit/react-core\";\nimport { PoweredByTag } from \"./PoweredByTag\";\n\nconst MAX_NEWLINES = 6;\n\nexport const Input = ({\n inProgress,\n onSend,\n chatReady = false,\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)\n return { buttonIcon: context.icons.spinnerIcon, buttonAlt: \"Loading\" };\n return isInProgress && !hideStopButton && chatReady\n ? { buttonIcon: context.icons.stopIcon, buttonAlt: \"Stop\" }\n : { buttonIcon: context.icons.sendIcon, buttonAlt: \"Send\" };\n }, [\n isInProgress,\n chatReady,\n hideStopButton,\n context.icons.stopIcon,\n context.icons.sendIcon,\n ]);\n const showPushToTalk =\n pushToTalkConfigured &&\n (pushToTalkState === \"idle\" || pushToTalkState === \"recording\") &&\n !inProgress;\n\n const { interrupt } = useCopilotChatInternal();\n\n const canSend = useMemo(() => {\n return (\n !isInProgress &&\n text.trim().length > 0 &&\n pushToTalkState === \"idle\" &&\n !interrupt\n );\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\n className={`copilotKitInputContainer ${showPoweredBy ? \"poweredByContainer\" : \"\"}`}\n >\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(\n pushToTalkState === \"idle\" ? \"recording\" : \"transcribing\",\n )\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={\n inProgress\n ? \"copilot-chat-request-in-progress\"\n : \"copilot-chat-ready\"\n }\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","import React from \"react\";\nimport type { Attachment } from \"./props\";\nimport {\n formatFileSize,\n getSourceUrl,\n getDocumentIcon,\n} from \"@copilotkit/shared\";\n\ninterface AttachmentQueueProps {\n attachments: Attachment[];\n onRemoveAttachment: (id: string) => void;\n className?: string;\n}\n\nexport const AttachmentQueue: React.FC<AttachmentQueueProps> = ({\n attachments,\n onRemoveAttachment,\n className = \"\",\n}) => {\n if (attachments.length === 0) return null;\n\n return (\n <div className={`copilotKitAttachmentQueue ${className}`}>\n {attachments.map((attachment) => (\n <div\n key={attachment.id}\n className={`copilotKitAttachmentQueueItem copilotKitAttachmentQueueItem--${attachment.type}`}\n >\n {attachment.status === \"uploading\" && (\n <div className=\"copilotKitAttachmentQueueOverlay\">\n <div className=\"copilotKitAttachmentQueueSpinner\" />\n </div>\n )}\n <AttachmentPreview attachment={attachment} />\n <button\n onClick={() => onRemoveAttachment(attachment.id)}\n className=\"copilotKitAttachmentQueueRemoveButton\"\n aria-label=\"Remove attachment\"\n >\n ✕\n </button>\n </div>\n ))}\n </div>\n );\n};\n\nfunction AttachmentPreview({ attachment }: { attachment: Attachment }) {\n if (attachment.status === \"uploading\") {\n return <div className=\"copilotKitAttachmentQueuePreviewPlaceholder\" />;\n }\n\n const src = getSourceUrl(attachment.source);\n\n switch (attachment.type) {\n case \"image\":\n return (\n <img\n src={src}\n alt={attachment.filename || \"Image attachment\"}\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n );\n\n case \"audio\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewAudio\">\n <audio src={src} controls preload=\"metadata\" />\n {attachment.filename && (\n <span className=\"copilotKitAttachmentQueueFilename\">\n {attachment.filename}\n </span>\n )}\n </div>\n );\n\n case \"video\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewVideo\">\n {attachment.thumbnail ? (\n <img\n src={attachment.thumbnail}\n alt={attachment.filename || \"Video thumbnail\"}\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n ) : (\n <video\n src={src}\n preload=\"metadata\"\n muted\n className=\"copilotKitAttachmentQueuePreviewImage\"\n />\n )}\n </div>\n );\n\n case \"document\":\n return (\n <div className=\"copilotKitAttachmentQueuePreviewDocument\">\n <div className=\"copilotKitAttachmentQueueDocIcon\">\n {getDocumentIcon(attachment.source.mimeType ?? \"\")}\n </div>\n <div className=\"copilotKitAttachmentQueueDocInfo\">\n <span className=\"copilotKitAttachmentQueueFilename\">\n {attachment.filename || \"Document\"}\n </span>\n {attachment.size != null && (\n <span className=\"copilotKitAttachmentQueueFileSize\">\n {formatFileSize(attachment.size)}\n </span>\n )}\n </div>\n </div>\n );\n }\n}\n\n/**\n * @deprecated Use `AttachmentQueue` from `@copilotkit/react-ui` instead.\n * `ImageUploadQueue` only displayed image previews. `AttachmentQueue` supports\n * images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport { AttachmentQueue as ImageUploadQueue };\n","// Re-export utilities from shared\nexport {\n getModalityFromMimeType,\n formatFileSize,\n exceedsMaxSize,\n readFileAsBase64,\n generateVideoThumbnail,\n matchesAcceptFilter,\n} from \"@copilotkit/shared\";\n\n// Deprecation warning helpers — react-ui specific\nconst suppressedWarnings = new Set<string>();\nlet globalSuppress = false;\n\n/**\n * Issue a deprecation warning once per key per session.\n * Suppressed entirely if the user calls suppressDeprecationWarnings().\n */\nexport function deprecationWarning(key: string, message: string) {\n if (globalSuppress || suppressedWarnings.has(key)) return;\n if (typeof process !== \"undefined\" && process.env?.NODE_ENV === \"production\")\n return;\n suppressedWarnings.add(key);\n console.warn(`[CopilotKit] Deprecation: ${message}`);\n}\n\n/**\n * Suppress all CopilotKit deprecation warnings.\n */\nexport function suppressDeprecationWarnings() {\n globalSuppress = true;\n}\n","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({\n title,\n onClick,\n partial,\n className,\n}: SuggestionsProps) {\n const { isLoading } = useCopilotChatInternal();\n if (!title) return null;\n\n return (\n <button\n disabled={partial || isLoading}\n onClick={(e) => {\n e.preventDefault();\n onClick();\n }}\n className={`suggestion ${className ?? \"\"} ${partial ? \"loading\" : \"\"}`}\n data-test-id=\"suggestion\"\n type=\"button\"\n >\n {partial ? SmallSpinnerIcon : <span>{title}</span>}\n </button>\n );\n}\n","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","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotChat.gif\" width=\"500\" />\n *\n * A chatbot panel component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ## Usage\n *\n * ```tsx\n * import { CopilotChat } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotChat\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotChat\n * observabilityHooks={{\n * onMessageSent: (message) => {\n * console.log(\"Message sent:\", message);\n * },\n * }}\n * />\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\n\nimport {\n ChatContext,\n ChatContextProvider,\n CopilotChatIcons,\n CopilotChatLabels,\n} from \"./ChatContext\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { RenderMessage as DefaultRenderMessage } from \"./messages/RenderMessage\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./messages/AssistantMessage\";\nimport { UserMessage as DefaultUserMessage } from \"./messages/UserMessage\";\nimport { ImageRenderer as DefaultImageRenderer } from \"./messages/ImageRenderer\";\nimport React, { useEffect, useRef, useState, useCallback } from \"react\";\nimport {\n SystemMessageFunction,\n useCopilotContext,\n useCopilotChatInternal,\n type OnStopGeneration,\n type OnReloadMessages,\n type ChatSuggestions,\n} from \"@copilotkit/react-core\";\nimport {\n CopilotKitError,\n CopilotKitErrorCode,\n CopilotErrorEvent,\n Message,\n Severity,\n ErrorVisibility,\n styledConsole,\n CopilotErrorHandler,\n randomUUID,\n} from \"@copilotkit/shared\";\nimport {\n AssistantMessageProps,\n ChatError,\n ComponentsMap,\n CopilotObservabilityHooks,\n ErrorMessageProps,\n ImageRendererProps,\n InputProps,\n MessagesProps,\n RenderMessageProps,\n RenderSuggestionsListProps,\n UserMessageProps,\n} from \"./props\";\n\nimport { AttachmentQueue } from \"./AttachmentQueue\";\nimport type { Attachment, AttachmentsConfig } from \"./props\";\nimport {\n getModalityFromMimeType,\n exceedsMaxSize,\n readFileAsBase64,\n generateVideoThumbnail,\n matchesAcceptFilter,\n formatFileSize,\n deprecationWarning,\n} from \"./attachment-utils\";\nimport type { InputContent } from \"@copilotkit/shared\";\nimport { Suggestions as DefaultRenderSuggestionsList } from \"./Suggestions\";\n\n/**\n * Props for CopilotChat component.\n */\nexport interface CopilotChatProps {\n /**\n * Custom instructions to be added to the system message. Use this property to\n * provide additional context or guidance to the language model, influencing\n * its responses. These instructions can include specific directions,\n * preferences, or criteria that the model should consider when generating\n * its output, thereby tailoring the conversation more precisely to the\n * user's needs or the application's requirements.\n */\n instructions?: string;\n\n /**\n * Controls the behavior of suggestions in the chat interface.\n *\n * `auto` (default) - Suggestions are generated automatically:\n * - When the chat is first opened (empty state)\n * - After each message exchange completes\n * - Uses configuration from `useCopilotChatSuggestions` hooks\n *\n * `manual` - Suggestions are controlled programmatically:\n * - Use `setSuggestions()` to set custom suggestions\n * - Use `generateSuggestions()` to trigger AI generation\n * - Access via `useCopilotChat` hook\n *\n * `SuggestionItem[]` - Static suggestions array:\n * - Always shows the same suggestions\n * - No AI generation involved\n */\n suggestions?: ChatSuggestions;\n\n /**\n * A callback that gets called when the in progress state changes.\n */\n onInProgress?: (inProgress: boolean) => void;\n\n /**\n * A callback that gets called when a new message it submitted.\n */\n onSubmitMessage?: (message: string) => void | Promise<void>;\n\n /**\n * A custom stop generation function.\n */\n onStopGeneration?: OnStopGeneration;\n\n /**\n * A custom reload messages function.\n */\n onReloadMessages?: OnReloadMessages;\n\n /**\n * A callback function to regenerate the assistant's response\n */\n onRegenerate?: (messageId: string) => void;\n\n /**\n * A callback function when the message is copied\n */\n onCopy?: (message: string) => void;\n\n /**\n * A callback function for thumbs up feedback\n */\n onThumbsUp?: (message: Message) => void;\n\n /**\n * A 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 * Icons can be used to set custom icons for the chat window.\n */\n icons?: CopilotChatIcons;\n\n /**\n * Labels can be used to set custom labels for the chat window.\n */\n labels?: CopilotChatLabels;\n\n /**\n * @deprecated Use `attachments={{ enabled: true }}` instead.\n * `imageUploadsEnabled` only supports images. The new `attachments` prop supports\n * images, audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n *\n * Enable image upload button (image inputs only supported on some models)\n */\n imageUploadsEnabled?: boolean;\n\n /**\n * @deprecated Use `attachments={{ enabled: true, accept: \"...\" }}` instead.\n * The `accept` field on the `attachments` prop replaces `inputFileAccept`.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n *\n * The 'accept' attribute for the file input used for image uploads.\n * Defaults to \"image/*\".\n */\n inputFileAccept?: string;\n\n /**\n * Configuration for file attachments in the chat input.\n * Enables users to attach images, audio, video, and documents.\n *\n * @example\n * ```tsx\n * <CopilotChat\n * attachments={{\n * enabled: true,\n * accept: \"image/*,application/pdf\",\n * maxSize: 10 * 1024 * 1024, // 10MB\n * onUpload: async (file) => {\n * const url = await uploadToS3(file);\n * return { url, mimeType: file.type };\n * },\n * }}\n * />\n * ```\n */\n attachments?: AttachmentsConfig;\n\n /**\n * A function that takes in context string and instructions and returns\n * the system message to include in the chat request.\n * Use this to completely override the system message, when providing\n * instructions is not enough.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * 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>).\n */\n disableSystemMessage?: boolean;\n\n /**\n * A custom assistant message component to use instead of the default.\n */\n AssistantMessage?: React.ComponentType<AssistantMessageProps>;\n\n /**\n * A custom user message component to use instead of the default.\n */\n UserMessage?: React.ComponentType<UserMessageProps>;\n\n /**\n * A custom error message component to use instead of the default.\n */\n ErrorMessage?: React.ComponentType<ErrorMessageProps>;\n\n /**\n * A custom Messages component to use instead of the default.\n */\n Messages?: React.ComponentType<MessagesProps>;\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 /**\n * A custom RenderMessage component to use instead of the default.\n *\n * **Warning**: This is a break-glass solution to allow for custom\n * rendering of messages. You are most likely looking to swap out\n * the AssistantMessage and UserMessage components instead which\n * are also props.\n */\n RenderMessage?: React.ComponentType<RenderMessageProps>;\n\n /**\n * A custom suggestions list component to use instead of the default.\n */\n RenderSuggestionsList?: React.ComponentType<RenderSuggestionsListProps>;\n\n /**\n * A custom Input component to use instead of the default.\n */\n Input?: React.ComponentType<InputProps>;\n\n /**\n * @deprecated Use the v2 `CopilotChat` attachment system instead.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n *\n * A custom image rendering component to use instead of the default.\n */\n ImageRenderer?: React.ComponentType<ImageRendererProps>;\n\n /**\n * A class name to apply to the root element.\n */\n className?: string;\n\n /**\n * Children to render.\n */\n children?: React.ReactNode;\n\n hideStopButton?: boolean;\n\n /**\n * Event hooks for CopilotKit chat events.\n * These hooks only work when publicApiKey is provided.\n */\n observabilityHooks?: CopilotObservabilityHooks;\n\n /**\n * Custom error renderer for chat-specific errors.\n * When provided, errors will be displayed inline within the chat interface.\n */\n renderError?: (error: {\n message: string;\n operation?: string;\n timestamp: number;\n onDismiss: () => void;\n onRetry?: () => void;\n }) => React.ReactNode;\n\n /**\n * Optional handler for comprehensive debugging and observability.\n */\n onError?: CopilotErrorHandler;\n}\n\n/**\n * @deprecated Use the `Attachment` type from `@copilotkit/react-ui` instead.\n * `ImageUpload` only described image payloads. `Attachment` supports images,\n * audio, video, and documents.\n * See https://docs.copilotkit.ai/migration-guides/migrate-attachments\n * @since 1.56.0\n */\nexport type ImageUpload = {\n contentType: string;\n bytes: string;\n};\n\nexport function CopilotChat({\n instructions,\n suggestions = \"auto\",\n onSubmitMessage,\n makeSystemMessage,\n disableSystemMessage,\n onInProgress,\n onStopGeneration,\n onReloadMessages,\n onRegenerate,\n onCopy,\n onThumbsUp,\n onThumbsDown,\n markdownTagRenderers,\n Messages = DefaultMessages,\n RenderMessage = DefaultRenderMessage,\n RenderSuggestionsList = DefaultRenderSuggestionsList,\n Input = DefaultInput,\n className,\n icons,\n labels,\n AssistantMessage = DefaultAssistantMessage,\n UserMessage = DefaultUserMessage,\n ImageRenderer = DefaultImageRenderer,\n ErrorMessage,\n imageUploadsEnabled,\n inputFileAccept = \"image/*\",\n attachments,\n hideStopButton,\n observabilityHooks,\n renderError,\n onError,\n // Legacy props - deprecated\n RenderTextMessage,\n RenderActionExecutionMessage,\n RenderAgentStateMessage,\n RenderResultMessage,\n RenderImageMessage,\n}: CopilotChatProps) {\n const {\n additionalInstructions,\n setChatInstructions,\n copilotApiConfig,\n setBannerError,\n setInternalErrorHandler,\n removeInternalErrorHandler,\n } = useCopilotContext();\n\n // Destructure stable values to avoid object reference changes\n const { publicApiKey, chatApiEndpoint } = copilotApiConfig;\n\n // Resolve attachments config with deprecation bridge\n const resolvedAttachments: AttachmentsConfig | undefined = (() => {\n if (attachments) return attachments;\n if (imageUploadsEnabled) {\n deprecationWarning(\n \"imageUploadsEnabled\",\n \"imageUploadsEnabled is deprecated. Use attachments={{ enabled: true }} instead. \" +\n \"See https://docs.copilotkit.ai/migration-guides/migrate-attachments\",\n );\n return { enabled: true, accept: inputFileAccept || \"image/*\" };\n }\n return undefined;\n })();\n\n const attachmentsEnabled = resolvedAttachments?.enabled ?? false;\n const attachmentsAccept = resolvedAttachments?.accept ?? \"*/*\";\n const attachmentsMaxSize = resolvedAttachments?.maxSize ?? 20 * 1024 * 1024;\n\n const [selectedAttachments, setSelectedAttachments] = useState<Attachment[]>(\n [],\n );\n const [dragOver, setDragOver] = useState(false);\n const processFilesRef = useRef<(files: File[]) => Promise<void>>(\n async () => {},\n );\n\n const [chatError, setChatError] = useState<ChatError | null>(null);\n const [messageFeedback, setMessageFeedback] = useState<\n Record<string, \"thumbsUp\" | \"thumbsDown\">\n >({});\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n // Helper function to trigger event hooks only if publicApiKey is provided\n const triggerObservabilityHook = useCallback(\n (hookName: keyof CopilotObservabilityHooks, ...args: any[]) => {\n if (publicApiKey && observabilityHooks?.[hookName]) {\n (observabilityHooks[hookName] as any)(...args);\n }\n if (observabilityHooks?.[hookName] && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message: \"observabilityHooks requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks\");\n }\n },\n [publicApiKey, observabilityHooks, setBannerError],\n );\n\n // Helper function to trigger chat error and render error UI\n const triggerChatError = useCallback(\n (error: any, operation: string, originalError?: any) => {\n const errorMessage =\n error?.message || error?.toString() || \"An error occurred\";\n\n console.error(\n `[CopilotKit] ${operation} error:`,\n errorMessage,\n originalError ?? error,\n );\n\n // Set chat error state for rendering\n setChatError({\n message: errorMessage,\n operation,\n timestamp: Date.now(),\n });\n\n const errorEvent: CopilotErrorEvent = {\n type: \"error\",\n timestamp: Date.now(),\n context: {\n source: \"ui\",\n request: {\n operation,\n url: chatApiEndpoint,\n startTime: Date.now(),\n },\n technical: {\n environment: \"browser\",\n userAgent:\n typeof navigator !== \"undefined\"\n ? navigator.userAgent\n : undefined,\n stackTrace:\n originalError instanceof Error ? originalError.stack : undefined,\n },\n },\n error,\n };\n\n if (onError) {\n onError(errorEvent);\n }\n\n // Also trigger observability hook if available\n if (publicApiKey && observabilityHooks?.onError) {\n observabilityHooks.onError(errorEvent);\n }\n\n // Show banner error if onError hook is used without publicApiKey\n if (observabilityHooks?.onError && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message:\n \"observabilityHooks.onError requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks.onError\");\n }\n },\n [publicApiKey, chatApiEndpoint, observabilityHooks, setBannerError],\n );\n\n useEffect(() => {\n const id = \"chat-component\";\n setInternalErrorHandler({\n [id]: (error: CopilotErrorEvent) => {\n if (!error) return;\n triggerChatError(error.error, \"sendMessage\");\n },\n });\n return () => {\n // unregister when this instance unmounts\n removeInternalErrorHandler?.(id);\n };\n }, [triggerChatError, setInternalErrorHandler, removeInternalErrorHandler]);\n\n // Clipboard paste handler\n useEffect(() => {\n if (!attachmentsEnabled) return;\n\n const handlePaste = async (e: ClipboardEvent) => {\n const target = e.target as HTMLElement;\n if (!target.parentElement?.classList.contains(\"copilotKitInput\")) return;\n\n const items = Array.from(e.clipboardData?.items || []);\n const fileItems = items.filter(\n (item) =>\n item.kind === \"file\" &&\n item.getAsFile() !== null &&\n matchesAcceptFilter(item.getAsFile()!, attachmentsAccept),\n );\n\n if (fileItems.length === 0) return;\n e.preventDefault();\n\n const files = fileItems\n .map((item) => item.getAsFile())\n .filter((f): f is File => f !== null);\n\n try {\n await processFilesRef.current(files);\n } catch (error) {\n triggerChatError(error, \"pasteUpload\", error);\n }\n };\n\n document.addEventListener(\"paste\", handlePaste);\n return () => document.removeEventListener(\"paste\", handlePaste);\n }, [\n attachmentsEnabled,\n attachmentsAccept,\n attachmentsMaxSize,\n triggerChatError,\n ]);\n\n useEffect(() => {\n if (!additionalInstructions?.length) {\n setChatInstructions(instructions || \"\");\n return;\n }\n\n /*\n Will result in a prompt like:\n\n You are a helpful assistant. \n Additionally, follow these instructions:\n - Do not answer questions about the weather.\n - Do not answer questions about the stock market.\"\n */\n const combinedAdditionalInstructions = [\n instructions,\n \"Additionally, follow these instructions:\",\n ...additionalInstructions.map((instruction) => `- ${instruction}`),\n ];\n\n setChatInstructions(combinedAdditionalInstructions.join(\"\\n\") || \"\");\n }, [instructions, additionalInstructions]);\n\n const {\n messages,\n isLoading,\n sendMessage,\n stopGeneration,\n reloadMessages,\n suggestions: currentSuggestions,\n isLoadingSuggestions,\n agent,\n } = useCopilotChatInternal({\n suggestions,\n onInProgress,\n onSubmitMessage,\n onStopGeneration,\n onReloadMessages,\n });\n // makeSystemMessage,\n // disableSystemMessage,\n\n // Track loading state changes for chat start/stop events\n const prevIsLoading = useRef(isLoading);\n useEffect(() => {\n if (prevIsLoading.current !== isLoading) {\n if (isLoading) {\n triggerObservabilityHook(\"onChatStarted\");\n } else {\n triggerObservabilityHook(\"onChatStopped\");\n }\n prevIsLoading.current = isLoading;\n }\n }, [isLoading, triggerObservabilityHook]);\n\n // Wrapper for sendMessage to clear selected attachments and build multimodal content\n const handleSendMessage = (text: string) => {\n const hasUploading = selectedAttachments.some(\n (a) => a.status === \"uploading\",\n );\n if (hasUploading) {\n triggerChatError(\n new Error(\"Attachment(s) still uploading. Please wait.\"),\n \"sendMessage\",\n );\n // Return a promise that resolves to a dummy message to satisfy the return type\n return Promise.resolve({\n id: randomUUID(),\n content: text,\n role: \"user\" as const,\n } as Message);\n }\n\n const currentAttachments = selectedAttachments.filter(\n (a) => a.status === \"ready\",\n );\n setSelectedAttachments([]);\n if (fileInputRef.current) {\n fileInputRef.current.value = \"\";\n }\n\n // Trigger message sent event\n triggerObservabilityHook(\"onMessageSent\", text);\n\n // Build content: if we have attachments, use InputContent[]\n if (currentAttachments.length > 0) {\n const contentParts: InputContent[] = [];\n\n if (text.trim()) {\n contentParts.push({ type: \"text\", text });\n }\n\n for (const attachment of currentAttachments) {\n contentParts.push({\n type: attachment.type,\n source: attachment.source,\n metadata: {\n ...(attachment.filename ? { filename: attachment.filename } : {}),\n ...attachment.metadata,\n },\n } as InputContent);\n }\n\n return sendMessage({\n id: randomUUID(),\n content: contentParts,\n role: \"user\",\n });\n }\n\n // Plain text message\n return sendMessage({\n id: randomUUID(),\n content: text,\n role: \"user\",\n });\n };\n\n const chatContext = React.useContext(ChatContext);\n const isVisible = chatContext ? chatContext.open : true;\n\n const handleRegenerate = (messageId: string) => {\n if (onRegenerate) {\n onRegenerate(messageId);\n }\n\n // Trigger message regenerated event\n triggerObservabilityHook(\"onMessageRegenerated\", messageId);\n\n reloadMessages(messageId);\n };\n\n const handleCopy = (message: string) => {\n if (onCopy) {\n onCopy(message);\n }\n\n // Trigger message copied event\n triggerObservabilityHook(\"onMessageCopied\", message);\n };\n\n const processFiles = async (files: File[]) => {\n const validFiles = files.filter((file) =>\n matchesAcceptFilter(file, attachmentsAccept),\n );\n const rejectedFiles = files.filter(\n (file) => !matchesAcceptFilter(file, attachmentsAccept),\n );\n for (const file of rejectedFiles) {\n const message = `File \"${file.name}\" is not accepted. Supported types: ${attachmentsAccept}`;\n triggerChatError(new Error(message), \"fileUpload\");\n resolvedAttachments?.onUploadFailed?.({\n reason: \"invalid-type\",\n file,\n message,\n });\n }\n\n for (const file of validFiles) {\n if (exceedsMaxSize(file, attachmentsMaxSize)) {\n const message = `File \"${file.name}\" exceeds the maximum size of ${formatFileSize(attachmentsMaxSize)}`;\n triggerChatError(new Error(message), \"fileUpload\");\n resolvedAttachments?.onUploadFailed?.({\n reason: \"file-too-large\",\n file,\n message,\n });\n continue;\n }\n\n const modality = getModalityFromMimeType(file.type);\n\n // Use a unique ID to track this placeholder across concurrent uploads\n const placeholderId = randomUUID();\n const placeholder: Attachment = {\n id: placeholderId,\n type: modality,\n source: { type: \"data\", value: \"\", mimeType: file.type },\n filename: file.name,\n size: file.size,\n status: \"uploading\",\n };\n\n setSelectedAttachments((prev) => [...prev, placeholder]);\n\n try {\n let source: Attachment[\"source\"];\n let uploadMetadata: Record<string, unknown> | undefined;\n\n if (resolvedAttachments?.onUpload) {\n const { metadata: meta, ...uploadSource } =\n await resolvedAttachments.onUpload(file);\n source = uploadSource;\n uploadMetadata = meta;\n } else {\n const base64 = await readFileAsBase64(file);\n source = { type: \"data\", value: base64, mimeType: file.type };\n }\n\n // Generate video thumbnail if applicable\n let thumbnail: string | undefined;\n if (modality === \"video\") {\n thumbnail = await generateVideoThumbnail(file);\n }\n\n setSelectedAttachments((prev) =>\n prev.map((att) =>\n att.id === placeholderId\n ? {\n ...att,\n source,\n status: \"ready\" as const,\n thumbnail,\n metadata: uploadMetadata,\n }\n : att,\n ),\n );\n } catch (error) {\n // Remove the failed placeholder\n setSelectedAttachments((prev) =>\n prev.filter((att) => att.id !== placeholderId),\n );\n const message = error instanceof Error ? error.message : String(error);\n triggerChatError(\n new Error(`Failed to upload \"${file.name}\": ${message}`),\n \"fileUpload\",\n error,\n );\n resolvedAttachments?.onUploadFailed?.({\n reason: \"upload-failed\",\n file,\n message: `Failed to upload \"${file.name}\": ${message}`,\n });\n }\n }\n };\n processFilesRef.current = processFiles;\n\n const handleFileUpload = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (!event.target.files || event.target.files.length === 0) return;\n try {\n await processFiles(Array.from(event.target.files));\n } catch (error) {\n triggerChatError(error, \"fileUpload\", error);\n }\n };\n\n // Drag-and-drop handlers\n const handleDragOver = (e: React.DragEvent) => {\n if (!attachmentsEnabled) return;\n e.preventDefault();\n e.stopPropagation();\n setDragOver(true);\n };\n\n const handleDragLeave = (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n };\n\n const handleDrop = async (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n if (!attachmentsEnabled) return;\n\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n try {\n await processFiles(files);\n } catch (error) {\n triggerChatError(error, \"dropUpload\", error);\n }\n }\n };\n\n const handleThumbsUp = (message: Message) => {\n if (onThumbsUp) {\n onThumbsUp(message);\n }\n\n // Update feedback state\n setMessageFeedback((prev) => ({\n ...prev,\n [message.id]: \"thumbsUp\",\n }));\n\n // Trigger feedback given event\n triggerObservabilityHook(\"onFeedbackGiven\", message.id, \"thumbsUp\");\n };\n\n const handleThumbsDown = (message: Message) => {\n if (onThumbsDown) {\n onThumbsDown(message);\n }\n\n // Update feedback state\n setMessageFeedback((prev) => ({\n ...prev,\n [message.id]: \"thumbsDown\",\n }));\n\n // Trigger feedback given event\n triggerObservabilityHook(\"onFeedbackGiven\", message.id, \"thumbsDown\");\n };\n\n return (\n <WrappedCopilotChat icons={icons} labels={labels} className={className}>\n <div\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n className={`copilotKitChatBody${dragOver ? \" copilotKitDragOver\" : \"\"}`}\n >\n {/* Render error above messages if present */}\n {chatError &&\n renderError &&\n renderError({\n ...chatError,\n onDismiss: () => setChatError(null),\n onRetry: () => {\n // Clear error and potentially retry based on operation\n setChatError(null);\n // TODO: Implement specific retry logic based on operation type\n },\n })}\n\n <Messages\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n RenderMessage={RenderMessage}\n messages={messages}\n inProgress={isLoading}\n onRegenerate={handleRegenerate}\n onCopy={handleCopy}\n onThumbsUp={handleThumbsUp}\n onThumbsDown={handleThumbsDown}\n messageFeedback={messageFeedback}\n markdownTagRenderers={markdownTagRenderers}\n ImageRenderer={ImageRenderer}\n ErrorMessage={ErrorMessage}\n chatError={chatError}\n // Legacy props - passed through to Messages component\n RenderTextMessage={RenderTextMessage}\n RenderActionExecutionMessage={RenderActionExecutionMessage}\n RenderAgentStateMessage={RenderAgentStateMessage}\n RenderResultMessage={RenderResultMessage}\n RenderImageMessage={RenderImageMessage}\n >\n {currentSuggestions.length > 0 && (\n <RenderSuggestionsList\n onSuggestionClick={handleSendMessage}\n suggestions={currentSuggestions}\n isLoading={isLoadingSuggestions}\n />\n )}\n </Messages>\n\n {attachmentsEnabled && (\n <>\n <AttachmentQueue\n attachments={selectedAttachments}\n onRemoveAttachment={(id) =>\n setSelectedAttachments((prev) =>\n prev.filter((att) => att.id !== id),\n )\n }\n />\n <input\n type=\"file\"\n multiple\n ref={fileInputRef}\n onChange={handleFileUpload}\n accept={attachmentsAccept}\n style={{ display: \"none\" }}\n />\n </>\n )}\n <Input\n inProgress={isLoading}\n chatReady={Boolean(agent)}\n // @ts-ignore\n onSend={handleSendMessage}\n isVisible={isVisible}\n onStop={stopGeneration}\n onUpload={\n attachmentsEnabled ? () => fileInputRef.current?.click() : undefined\n }\n hideStopButton={hideStopButton}\n />\n </div>\n </WrappedCopilotChat>\n );\n}\n\nexport function WrappedCopilotChat({\n children,\n icons,\n labels,\n className,\n}: {\n children: React.ReactNode;\n icons?: CopilotChatIcons;\n labels?: CopilotChatLabels;\n className?: string;\n}) {\n const chatContext = React.useContext(ChatContext);\n if (!chatContext) {\n return (\n <ChatContextProvider\n icons={icons}\n labels={labels}\n open={true}\n setOpen={() => {}}\n >\n <div className={`copilotKitChat ${className ?? \"\"}`}>{children}</div>\n </ChatContextProvider>\n );\n }\n return <>{children}</>;\n}\n","import React, { useMemo, useCallback, useEffect, useRef } from \"react\";\nimport { ChatContextProvider, useChatContext } from \"./ChatContext\";\nimport {\n ButtonProps,\n HeaderProps,\n WindowProps,\n CopilotObservabilityHooks,\n} from \"./props\";\nimport { Window as DefaultWindow } from \"./Window\";\nimport { Button as DefaultButton } from \"./Button\";\nimport { Header as DefaultHeader } from \"./Header\";\nimport { Messages as DefaultMessages } from \"./Messages\";\nimport { Input as DefaultInput } from \"./Input\";\nimport { CopilotChat, CopilotChatProps } from \"./Chat\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./messages/AssistantMessage\";\nimport { UserMessage as DefaultUserMessage } from \"./messages/UserMessage\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport {\n CopilotKitError,\n CopilotKitErrorCode,\n Severity,\n ErrorVisibility,\n styledConsole,\n} from \"@copilotkit/shared\";\n\nexport interface CopilotModalProps extends CopilotChatProps {\n /**\n * Whether the chat window should be open by default.\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * If the chat window should close when the user clicks outside of it.\n * @default true\n */\n clickOutsideToClose?: boolean;\n\n /**\n * If the chat window should close when the user hits the Escape key.\n * @default true\n */\n hitEscapeToClose?: boolean;\n\n /**\n * The shortcut key to open the chat window.\n * Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.\n * @default '/'\n */\n shortcut?: string;\n\n /**\n * A callback that gets called when the chat window opens or closes.\n */\n onSetOpen?: (open: boolean) => void;\n\n /**\n * A custom Window component to use instead of the default.\n */\n Window?: React.ComponentType<WindowProps>;\n\n /**\n * A custom Button component to use instead of the default.\n */\n Button?: React.ComponentType<ButtonProps>;\n\n /**\n * A custom Header component to use instead of the default.\n */\n Header?: React.ComponentType<HeaderProps>;\n}\n\n// Inner component that has access to the Copilot context\nconst CopilotModalInner = ({\n observabilityHooks,\n onSetOpen,\n clickOutsideToClose,\n hitEscapeToClose,\n shortcut,\n className,\n children,\n Window,\n Button,\n Header,\n ...chatProps\n}: Omit<CopilotModalProps, \"icons\" | \"labels\" | \"defaultOpen\"> & {\n Window: React.ComponentType<WindowProps>;\n Button: React.ComponentType<ButtonProps>;\n Header: React.ComponentType<HeaderProps>;\n clickOutsideToClose: boolean;\n hitEscapeToClose: boolean;\n shortcut: string;\n}) => {\n const { copilotApiConfig, setBannerError } = useCopilotContext();\n\n // Destructure stable values to avoid object reference changes\n const { publicApiKey } = copilotApiConfig;\n\n // Helper function to trigger event hooks only if publicApiKey is provided\n const triggerObservabilityHook = useCallback(\n (hookName: keyof CopilotObservabilityHooks, ...args: any[]) => {\n if (publicApiKey && observabilityHooks?.[hookName]) {\n (observabilityHooks[hookName] as any)(...args);\n }\n if (observabilityHooks?.[hookName] && !publicApiKey) {\n setBannerError(\n new CopilotKitError({\n message: \"observabilityHooks requires a publicApiKey to function.\",\n code: CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR,\n severity: Severity.CRITICAL,\n visibility: ErrorVisibility.BANNER,\n }),\n );\n styledConsole.publicApiKeyRequired(\"observabilityHooks\");\n }\n },\n [publicApiKey, observabilityHooks, setBannerError],\n );\n\n const { open } = useChatContext();\n const prevOpen = useRef(open);\n\n // Monitor open state changes and trigger event hooks\n useEffect(() => {\n if (prevOpen.current !== open) {\n onSetOpen?.(open);\n\n // Trigger chat minimize/expand events\n if (open) {\n triggerObservabilityHook(\"onChatExpanded\");\n } else {\n triggerObservabilityHook(\"onChatMinimized\");\n }\n prevOpen.current = open;\n }\n }, [open, onSetOpen, triggerObservabilityHook]);\n\n const memoizedHeader = useMemo(() => <Header />, [Header]);\n const memoizedChildren = useMemo(() => children, [children]);\n\n return (\n <>\n <div className=\"copilotKitModalChildrenWrapper\">{memoizedChildren}</div>\n <div className={className}>\n <Button></Button>\n <Window\n clickOutsideToClose={clickOutsideToClose}\n shortcut={shortcut}\n hitEscapeToClose={hitEscapeToClose}\n >\n {memoizedHeader}\n <CopilotChat {...chatProps} observabilityHooks={observabilityHooks} />\n </Window>\n </div>\n </>\n );\n};\n\nexport const CopilotModal = ({\n instructions,\n defaultOpen = false,\n clickOutsideToClose = true,\n hitEscapeToClose = true,\n onSetOpen,\n onSubmitMessage,\n onStopGeneration,\n onReloadMessages,\n shortcut = \"/\",\n icons,\n labels,\n makeSystemMessage,\n onInProgress,\n Window = DefaultWindow,\n Button = DefaultButton,\n Header = DefaultHeader,\n Messages = DefaultMessages,\n Input = DefaultInput,\n AssistantMessage = DefaultAssistantMessage,\n UserMessage = DefaultUserMessage,\n onThumbsUp,\n onThumbsDown,\n onCopy,\n onRegenerate,\n markdownTagRenderers,\n className,\n children,\n observabilityHooks,\n ...props\n}: CopilotModalProps) => {\n const [openState, setOpenState] = React.useState(defaultOpen);\n\n return (\n <ChatContextProvider\n icons={icons}\n labels={labels}\n open={openState}\n setOpen={setOpenState}\n >\n <CopilotModalInner\n observabilityHooks={observabilityHooks}\n onSetOpen={onSetOpen}\n clickOutsideToClose={clickOutsideToClose ?? true}\n hitEscapeToClose={hitEscapeToClose ?? true}\n shortcut={shortcut ?? \"/\"}\n className={className}\n Window={Window}\n Button={Button}\n Header={Header}\n instructions={instructions}\n onSubmitMessage={onSubmitMessage}\n onStopGeneration={onStopGeneration}\n onReloadMessages={onReloadMessages}\n makeSystemMessage={makeSystemMessage}\n onInProgress={onInProgress}\n Messages={Messages}\n Input={Input}\n AssistantMessage={AssistantMessage}\n UserMessage={UserMessage}\n onThumbsUp={onThumbsUp}\n onThumbsDown={onThumbsDown}\n onCopy={onCopy}\n onRegenerate={onRegenerate}\n markdownTagRenderers={markdownTagRenderers}\n {...props}\n >\n {children}\n </CopilotModalInner>\n </ChatContextProvider>\n );\n};\n","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotPopup.gif\" width=\"500\" />\n *\n * A chatbot popup component for the CopilotKit framework. The component allows for a high degree\n * of customization through various props and custom CSS.\n *\n * See [CopilotSidebar](/reference/v1/components/chat/CopilotSidebar) for a sidebar version of this component.\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 * ## Usage\n *\n * ```tsx\n * import { CopilotPopup } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotPopup\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * />\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotPopup\n * observabilityHooks={{\n * onChatExpanded: () => {\n * console.log(\"Popup opened\");\n * },\n * onChatMinimized: () => {\n * console.log(\"Popup closed\");\n * },\n * }}\n * />\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\n\nimport { CopilotModal, CopilotModalProps } from \"./Modal\";\n\nexport function CopilotPopup(props: CopilotModalProps) {\n props = {\n ...props,\n className: props.className\n ? props.className + \" copilotKitPopup\"\n : \"copilotKitPopup\",\n };\n return <CopilotModal {...props}>{props.children}</CopilotModal>;\n}\n","/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotSidebar.gif\" width=\"500\" />\n *\n * A chatbot sidebar component for the CopilotKit framework. Highly customizable through various props and custom CSS.\n *\n * See [CopilotPopup](/reference/v1/components/chat/CopilotPopup) for a popup version of this component.\n *\n * ## Install Dependencies\n *\n * This component is part of the [@copilotkit/react-ui](https://npmjs.com/package/@copilotkit/react-ui) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-ui\"\\\n * npm install @copilotkit/react-core @copilotkit/react-ui\n * ```\n *\n * ## Usage\n *\n * ```tsx\n * import { CopilotSidebar } from \"@copilotkit/react-ui\";\n * import \"@copilotkit/react-ui/styles.css\";\n *\n * <CopilotSidebar\n * labels={{\n * title: \"Your Assistant\",\n * initial: \"Hi! 👋 How can I assist you today?\",\n * }}\n * >\n * <YourApp/>\n * </CopilotSidebar>\n * ```\n *\n * ### With Observability Hooks\n *\n * To monitor user interactions, provide the `observabilityHooks` prop.\n * **Note:** This requires a `publicApiKey` in the `<CopilotKit>` provider.\n *\n * ```tsx\n * <CopilotKit publicApiKey=\"YOUR_PUBLIC_API_KEY\">\n * <CopilotSidebar\n * observabilityHooks={{\n * onChatExpanded: () => {\n * console.log(\"Sidebar opened\");\n * },\n * onChatMinimized: () => {\n * console.log(\"Sidebar closed\");\n * },\n * }}\n * >\n * <YourApp/>\n * </CopilotSidebar>\n * </CopilotKit>\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-ui/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n */\nimport React, { useState } from \"react\";\nimport { CopilotModal, CopilotModalProps } from \"./Modal\";\n\nexport function CopilotSidebar(props: CopilotModalProps) {\n props = {\n ...props,\n className: props.className\n ? props.className + \" copilotKitSidebar\"\n : \"copilotKitSidebar\",\n };\n const [expandedClassName, setExpandedClassName] = useState(\n props.defaultOpen ? \"sidebarExpanded\" : \"\",\n );\n\n const onSetOpen = (open: boolean) => {\n props.onSetOpen?.(open);\n setExpandedClassName(open ? \"sidebarExpanded\" : \"\");\n };\n\n return (\n <div className={`copilotKitSidebarContentWrapper ${expandedClassName}`}>\n <CopilotModal {...props} {...{ onSetOpen }}>\n {props.children}\n </CopilotModal>\n </div>\n );\n}\n","/**\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 useCopilotChatSuggestions as useCoreCopilotChatSuggestions,\n type UseCopilotChatSuggestionsConfiguration,\n} from \"@copilotkit/react-core\";\n\nexport function useCopilotChatSuggestions(\n config: UseCopilotChatSuggestionsConfiguration,\n dependencies: any[] = [],\n) {\n useCoreCopilotChatSuggestions(config, dependencies);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAAa,WACX,2CAAC;EACC,OAAM;EACN,SAAQ;EACR,MAAK;EACL,OAAM;EACN,QAAO;YAEP,2CAAC;GAAE,WAAU;aACX,2CAAC;IACC,UAAS;IACT,GAAE;IACF,UAAS;KACT;IACA;GACA;CAGR,MAAaA,cACX,2CAAC;EACC,OAAM;EACN,MAAK;EACL,SAAQ;EACR,aAAY;EACZ,QAAO;EACP,OAAM;EACN,QAAO;YAEP,2CAAC;GACC,eAAc;GACd,gBAAe;GACf,GAAE;IACF;GACE;CAGR,MAAa,kBACX,2CAAC;EACC,OAAM;EACN,MAAK;EACL,SAAQ;EACR,aAAY;EACZ,QAA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AAS,MACV;EACD,uBAAuB,EACrB,OAAO,WACR;EACD,gBAAgB,EACd,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,aAAa,EACX,OAAO,WACR;EACD,mDAAmD,EACjD,OAAO,WACR;EACD,0DAA0D,EACxD,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,KAAK,EACH,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,MAAM,EACJ,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,aAAa,EACX,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,MAAM,EACJ,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,mCAAmC,EACjC,gBAAgB,aACjB;EACD,UAAU,EACR,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,kBAAkB,EAChB,OAAO,WACR;EACD,QAAQ,EACN,OAAO,WACR;EACD,eAAe,EACb,OAAO,WACR;EACD,cAAc,EACZ,OAAO,WACR;EACD,uBAAuB,EACrB,OAAO,WACR;EACD,0BAA0B,EACxB,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,kBAAkB,EAChB,OAAO,WACR;EACD,wBAAwB,EACtB,OAAO,WACR;EACD,UAAU,EACR,OAAO,WACR;EACD,6BAA6B,EAC3B,OAAO,WACR;EACD,OAAO,EACL,OAAO,WACR;EACD,WAAW,EACT,OAAO,WACR;EACD,QAAQ,EACN,WAAW,UACZ;EACD,cAAc,EACZ,OAAO,WACR;EACD,oBAAoB,EAClB,OAAO,WACR;EACD,SAAS,EACP,OAAO,WACR;EACD,WAAW,EACT,OAAO,WACR;EACD,eAAe,EACb,OAAO,WACR;EACD,yCAAyC,EACvC,OAA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