UNPKG

@copilotkit/react-core

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

1,309 lines (1,308 loc) 113 kB
import * as react_jsx_runtime0 from "react/jsx-runtime"; import { Agent, ExtensionsInput, ForwardedParametersInput, LangGraphInterruptEvent } from "@copilotkit/runtime-client-gql"; import * as react from "react"; import React$1, { ComponentType, ReactNode } from "react"; import { Action, Attachment, Attachment as Attachment$1, AttachmentModality, AttachmentsConfig, AttachmentsConfig as AttachmentsConfig$1, CopilotCloudConfig, CopilotErrorHandler, CopilotKitError, DebugConfig, FunctionCallHandler, InferSchemaOutput, InputContentSource, MappedParameterTypes, Parameter, StandardSchemaV1 } from "@copilotkit/shared"; import { CopilotKitCore, CopilotKitCoreConfig, CopilotKitCoreErrorCode, CopilotKitCoreSubscriber, CopilotKitCoreSubscription, DynamicSuggestionsConfig, FrontendTool, StaticSuggestionsConfig, Suggestion, ToolCallStatus } from "@copilotkit/core"; import { AbstractAgent } from "@ag-ui/client"; import { ActivityMessage, AgentCapabilities, AssistantMessage, Message as Message$2, ReasoningMessage, ToolCall, ToolMessage, UserMessage } from "@ag-ui/core"; import { Streamdown } from "streamdown"; import { Anchor, Anchor as InspectorAnchor } from "@copilotkit/web-inspector"; import { z } from "zod"; import { Theme } from "@copilotkit/a2ui-renderer"; //#region src/types/frontend-action.d.ts interface InProgressState<T extends Parameter[] | [] = []> { status: "inProgress"; args: Partial<MappedParameterTypes<T>>; result: undefined; } interface ExecutingState<T extends Parameter[] | [] = []> { status: "executing"; args: MappedParameterTypes<T>; result: undefined; } interface CompleteState<T extends Parameter[] | [] = []> { status: "complete"; args: MappedParameterTypes<T>; result: any; } interface InProgressStateNoArgs<T extends Parameter[] | [] = []> { status: "inProgress"; args: Partial<MappedParameterTypes<T>>; result: undefined; } interface ExecutingStateNoArgs<T extends Parameter[] | [] = []> { status: "executing"; args: MappedParameterTypes<T>; result: undefined; } interface CompleteStateNoArgs<T extends Parameter[] | [] = []> { status: "complete"; args: MappedParameterTypes<T>; result: any; } interface InProgressStateWait<T extends Parameter[] | [] = []> { status: "inProgress"; args: Partial<MappedParameterTypes<T>>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: undefined; } interface ExecutingStateWait<T extends Parameter[] | [] = []> { status: "executing"; args: MappedParameterTypes<T>; /** @deprecated use respond instead */ handler: (result: any) => void; respond: (result: any) => void; result: undefined; } interface CompleteStateWait<T extends Parameter[] | [] = []> { status: "complete"; args: MappedParameterTypes<T>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: any; } interface InProgressStateNoArgsWait<T extends Parameter[] | [] = []> { status: "inProgress"; args: Partial<MappedParameterTypes<T>>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: undefined; } interface ExecutingStateNoArgsWait<T extends Parameter[] | [] = []> { status: "executing"; args: MappedParameterTypes<T>; /** @deprecated use respond instead */ handler: (result: any) => void; respond: (result: any) => void; result: undefined; } interface CompleteStateNoArgsWait<T extends Parameter[] | [] = []> { status: "complete"; args: MappedParameterTypes<T>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; } type ActionRenderProps<T extends Parameter[] | [] = []> = CompleteState<T> | ExecutingState<T> | InProgressState<T>; type ActionRenderPropsNoArgs<T extends Parameter[] | [] = []> = CompleteStateNoArgs<T> | ExecutingStateNoArgs<T> | InProgressStateNoArgs<T>; type ActionRenderPropsWait<T extends Parameter[] | [] = []> = CompleteStateWait<T> | ExecutingStateWait<T> | InProgressStateWait<T>; type ActionRenderPropsNoArgsWait<T extends Parameter[] | [] = []> = CompleteStateNoArgsWait<T> | ExecutingStateNoArgsWait<T> | InProgressStateNoArgsWait<T>; type CatchAllActionRenderProps<T extends Parameter[] | [] = []> = (CompleteState<T> & { name: string; }) | (ExecutingState<T> & { name: string; }) | (InProgressState<T> & { name: string; }); type FrontendActionAvailability = "disabled" | "enabled" | "remote" | "frontend"; type FrontendAction<T extends Parameter[] | [] = [], N extends string = string> = Action<T> & { name: Exclude<N, "*">; /** * @deprecated Use `available` instead. */ disabled?: boolean; available?: FrontendActionAvailability; pairedAction?: string; followUp?: boolean; } & ({ render?: string | (T extends [] ? (props: ActionRenderPropsNoArgs<T>) => string | React$1.ReactElement : (props: ActionRenderProps<T>) => string | React$1.ReactElement); /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: never; renderAndWaitForResponse?: never; } | { render?: never; /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: T extends [] ? (props: ActionRenderPropsNoArgsWait<T>) => React$1.ReactElement : (props: ActionRenderPropsWait<T>) => React$1.ReactElement; renderAndWaitForResponse?: T extends [] ? (props: ActionRenderPropsNoArgsWait<T>) => React$1.ReactElement : (props: ActionRenderPropsWait<T>) => React$1.ReactElement; handler?: never; }); type CatchAllFrontendAction = { name: "*"; render: (props: CatchAllActionRenderProps<any>) => React$1.ReactElement; }; type RenderFunctionStatus = ActionRenderProps<any>["status"]; //#endregion //#region src/hooks/use-tree.d.ts type TreeNodeId = string; interface TreeNode { id: TreeNodeId; value: string; children: TreeNode[]; parentId?: TreeNodeId; categories: Set<string>; } type Tree = TreeNode[]; //#endregion //#region src/types/document-pointer.d.ts interface DocumentPointer { id: string; name: string; sourceApplication: string; iconImageUri: string; getContents: () => string; } //#endregion //#region src/types/system-message.d.ts type SystemMessageFunction = (contextString: string, additionalInstructions?: string) => string; //#endregion //#region src/types/chat-suggestion-configuration.d.ts interface CopilotChatSuggestionConfiguration { /** * A prompt or instructions for the GPT to generate suggestions. */ instructions: string; /** * The minimum number of suggestions to generate. Defaults to `1`. * @default 1 */ minSuggestions?: number; /** * The maximum number of suggestions to generate. Defaults to `3`. * @default 1 */ maxSuggestions?: number; /** * An optional class name to apply to the suggestions. */ className?: string; } //#endregion //#region src/types/crew.d.ts /** * Status of a response or action that requires user input */ type CrewsResponseStatus = "inProgress" | "complete" | "executing"; /** * Response data structure for the ResponseRenderer */ interface CrewsResponse { /** * Unique identifier for the response */ id: string; /** * The content of the response to display */ content: string; /** * Optional metadata for the response */ metadata?: Record<string, any>; } /** * Base state item interface for agent state items */ interface CrewsStateItem { /** * Unique identifier for the item */ id: string; /** * Timestamp when the item was created */ timestamp: string; } /** * Tool execution state item */ interface CrewsToolStateItem extends CrewsStateItem { /** * Name of the tool that was executed */ tool: string; /** * Optional thought process for the tool execution */ thought?: string; /** * Result of the tool execution */ result?: any; } /** * Task state item */ interface CrewsTaskStateItem extends CrewsStateItem { /** * Name of the task */ name: string; /** * Description of the task */ description?: string; } /** * AgentState containing information about steps and tasks */ interface CrewsAgentState { /** * Array of tool execution steps */ steps?: CrewsToolStateItem[]; /** * Array of tasks */ tasks?: CrewsTaskStateItem[]; } //#endregion //#region src/types/interrupt-action.d.ts interface LangGraphInterruptRenderHandlerProps<TEventValue = any> { event: LangGraphInterruptEvent<TEventValue>; resolve: (resolution: string) => void; } interface LangGraphInterruptRenderProps<TEventValue = any> { result: unknown; event: LangGraphInterruptEvent<TEventValue>; resolve: (resolution: string) => void; } interface LangGraphInterruptRender<TEventValue = any> { id: string; /** * The handler function to handle the event. */ handler?: (props: LangGraphInterruptRenderHandlerProps<TEventValue>) => any | Promise<any>; /** * The render function to handle the event. */ render?: (props: LangGraphInterruptRenderProps<TEventValue>) => string | React.ReactElement; /** * Method that returns a boolean, indicating if the interrupt action should run * Useful when using multiple interrupts */ enabled?: (args: { eventValue: TEventValue; agentMetadata: AgentSession; }) => boolean; /** * Optional agent ID to scope this interrupt to a specific agent. * Defaults to the agent configured in the CopilotKit chat configuration. */ agentId?: string; } type LangGraphInterruptAction = LangGraphInterruptRender & { event?: LangGraphInterruptEvent; }; type LangGraphInterruptActionSetterArgs = Partial<LangGraphInterruptRender> | null; type LangGraphInterruptActionSetter = (action: LangGraphInterruptActionSetterArgs) => void; interface QueuedInterruptEvent { eventId: string; threadId: string; event: LangGraphInterruptEvent; } //#endregion //#region src/types/coagent-action.d.ts type CoAgentStateRenderProps<T> = { state: T; nodeName: string; status: "inProgress" | "complete"; }; type CoAgentStateRenderHandlerArguments<T> = { nodeName: string; state: T; }; interface CoAgentStateRender<T = any> { /** * The name of the coagent. */ name: string; /** * The node name of the coagent. */ nodeName?: string; /** * The handler function to handle the state of the agent. */ handler?: (props: CoAgentStateRenderHandlerArguments<T>) => void | Promise<void>; /** * The render function to handle the state of the agent. */ render?: ((props: CoAgentStateRenderProps<T>) => string | React.ReactElement | undefined | null) | string; } //#endregion //#region src/types/coagent-state.d.ts interface CoagentState { name: string; state: any; running: boolean; active: boolean; threadId?: string; config?: { configurable?: Record<string, any>; [key: string]: any; }; nodeName?: string; runId?: string; } //#endregion //#region src/context/copilot-context.d.ts /** * Interface for the configuration of the Copilot API. */ interface CopilotApiConfig { /** * The public API key for Copilot Cloud. */ publicApiKey?: string; /** * The configuration for Copilot Cloud. */ cloud?: CopilotCloudConfig; /** * The endpoint for the chat API. */ chatApiEndpoint: string; /** * The endpoint for the Copilot transcribe audio service. */ transcribeAudioUrl?: string; /** * The endpoint for the Copilot text to speech service. */ textToSpeechUrl?: string; /** * additional headers to be sent with the request * @default {} * @example * ``` * { * 'Authorization': 'Bearer your_token_here' * } * ``` */ headers: Record<string, string>; /** * Custom properties to be sent with the request * @default {} * @example * ``` * { * 'user_id': 'user_id' * } * ``` */ properties?: Record<string, any>; /** * Indicates whether the user agent should send or receive cookies from the other domain * in the case of cross-origin requests. */ credentials?: RequestCredentials; /** * Optional configuration for connecting to Model Context Protocol (MCP) servers. * This is typically derived from the CopilotKitProps and used internally. * @experimental */ mcpServers?: Array<{ endpoint: string; apiKey?: string; }>; } type InChatRenderFunction<TProps = ActionRenderProps<any> | CatchAllActionRenderProps<any>> = (props: TProps) => string | React$1.JSX.Element; type CoagentInChatRenderFunction = (props: CoAgentStateRenderProps<any>) => string | React$1.JSX.Element | undefined | null; interface ChatComponentsCache { actions: Record<string, InChatRenderFunction | string>; coAgentStateRenders: Record<string, CoagentInChatRenderFunction | string>; } interface AgentSession { agentName: string; threadId?: string; nodeName?: string; } interface AuthState { status: "authenticated" | "unauthenticated"; authHeaders: Record<string, string>; userId?: string; metadata?: Record<string, any>; } type ActionName = string; interface CopilotContextParams { actions: Record<string, FrontendAction<any>>; setAction: (id: string, action: FrontendAction<any>) => void; removeAction: (id: string) => void; setRegisteredActions: (actionConfig: any) => string; removeRegisteredAction: (actionKey: string) => void; chatComponentsCache: React$1.RefObject<ChatComponentsCache>; getFunctionCallHandler: (customEntryPoints?: Record<string, FrontendAction<any>>) => FunctionCallHandler; addContext: (context: string, parentId?: string, categories?: string[]) => TreeNodeId; removeContext: (id: TreeNodeId) => void; getAllContext: () => Tree; getContextString: (documents: DocumentPointer[], categories: string[]) => string; addDocumentContext: (documentPointer: DocumentPointer, categories?: string[]) => TreeNodeId; removeDocumentContext: (documentId: string) => void; getDocumentsContext: (categories: string[]) => DocumentPointer[]; isLoading: boolean; setIsLoading: React$1.Dispatch<React$1.SetStateAction<boolean>>; chatSuggestionConfiguration: { [key: string]: CopilotChatSuggestionConfiguration; }; addChatSuggestionConfiguration: (id: string, suggestion: CopilotChatSuggestionConfiguration) => void; removeChatSuggestionConfiguration: (id: string) => void; chatInstructions: string; setChatInstructions: React$1.Dispatch<React$1.SetStateAction<string>>; additionalInstructions?: string[]; setAdditionalInstructions: React$1.Dispatch<React$1.SetStateAction<string[]>>; copilotApiConfig: CopilotApiConfig; showDevConsole: boolean; coagentStates: Record<string, CoagentState>; setCoagentStates: React$1.Dispatch<React$1.SetStateAction<Record<string, CoagentState>>>; coagentStatesRef: React$1.RefObject<Record<string, CoagentState>>; setCoagentStatesWithRef: (value: Record<string, CoagentState> | ((prev: Record<string, CoagentState>) => Record<string, CoagentState>)) => void; agentSession: AgentSession | null; setAgentSession: React$1.Dispatch<React$1.SetStateAction<AgentSession | null>>; agentLock: string | null; threadId: string; setThreadId: React$1.Dispatch<React$1.SetStateAction<string>>; runId: string | null; setRunId: React$1.Dispatch<React$1.SetStateAction<string | null>>; chatAbortControllerRef: React$1.MutableRefObject<AbortController | null>; /** * The forwarded parameters to use for the task. */ forwardedParameters?: Partial<Pick<ForwardedParametersInput, "temperature">>; availableAgents: Agent[]; /** * The auth states for the CopilotKit. */ authStates_c?: Record<ActionName, AuthState>; setAuthStates_c?: React$1.Dispatch<React$1.SetStateAction<Record<ActionName, AuthState>>>; /** * The auth config for the CopilotKit. */ authConfig_c?: { SignInComponent: React$1.ComponentType<{ onSignInComplete: (authState: AuthState) => void; }>; }; extensions: ExtensionsInput; setExtensions: React$1.Dispatch<React$1.SetStateAction<ExtensionsInput>>; interruptActions: Record<string, LangGraphInterruptRender>; setInterruptAction: LangGraphInterruptActionSetter; removeInterruptAction: (actionId: string) => void; interruptEventQueue: Record<string, QueuedInterruptEvent[]>; addInterruptEvent: (queuedEvent: QueuedInterruptEvent) => void; resolveInterruptEvent: (threadId: string, eventId: string, response: string) => void; /** * Optional trace handler for comprehensive debugging and observability. */ onError: CopilotErrorHandler; bannerError: CopilotKitError | null; setBannerError: React$1.Dispatch<React$1.SetStateAction<CopilotKitError | null>>; internalErrorHandlers: Record<string, CopilotErrorHandler>; setInternalErrorHandler: (handler: Record<string, CopilotErrorHandler>) => void; removeInternalErrorHandler: (id: string) => void; } declare const CopilotContext: React$1.Context<CopilotContextParams>; declare function useCopilotContext(): CopilotContextParams; //#endregion //#region src/v2/components/chat/CopilotChatAudioRecorder.d.ts /** Finite-state machine for every recorder implementation */ type AudioRecorderState = "idle" | "recording" | "processing"; /** Error subclass so callers can `instanceof`-guard recorder failures */ declare class AudioRecorderError extends Error { constructor(message: string); } interface AudioRecorderRef { state: AudioRecorderState; start: () => Promise<void>; stop: () => Promise<Blob>; dispose: () => void; } declare const CopilotChatAudioRecorder: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<AudioRecorderRef>>; //#endregion //#region src/v2/providers/CopilotChatConfigurationProvider.d.ts declare const CopilotChatDefaultLabels: { chatInputPlaceholder: string; chatInputToolbarStartTranscribeButtonLabel: string; chatInputToolbarCancelTranscribeButtonLabel: string; chatInputToolbarFinishTranscribeButtonLabel: string; chatInputToolbarAddButtonLabel: string; chatInputToolbarToolsButtonLabel: string; assistantMessageToolbarCopyCodeLabel: string; assistantMessageToolbarCopyCodeCopiedLabel: string; assistantMessageToolbarCopyMessageLabel: string; assistantMessageToolbarThumbsUpLabel: string; assistantMessageToolbarThumbsDownLabel: string; assistantMessageToolbarReadAloudLabel: string; assistantMessageToolbarRegenerateLabel: string; userMessageToolbarCopyMessageLabel: string; userMessageToolbarEditMessageLabel: string; chatDisclaimerText: string; chatToggleOpenLabel: string; chatToggleCloseLabel: string; modalHeaderTitle: string; welcomeMessageText: string; }; type CopilotChatLabels = typeof CopilotChatDefaultLabels; interface CopilotChatConfigurationValue { labels: CopilotChatLabels; agentId: string; threadId: string; isModalOpen: boolean; setModalOpen: (open: boolean) => void; hasExplicitThreadId: boolean; } interface CopilotChatConfigurationProviderProps { children: ReactNode; labels?: Partial<CopilotChatLabels>; agentId?: string; threadId?: string; hasExplicitThreadId?: boolean; isModalDefaultOpen?: boolean; } declare const CopilotChatConfigurationProvider: React$1.FC<CopilotChatConfigurationProviderProps>; declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue | null; //#endregion //#region src/v2/lib/slots.d.ts /** Existing union (unchanged) */ type SlotValue<C extends React$1.ComponentType<any>> = C | string | Partial<React$1.ComponentProps<C>>; /** Utility: concrete React elements for every slot */ type SlotElements<S> = { [K in keyof S]: React$1.ReactElement }; type WithSlots<S extends Record<string, React$1.ComponentType<any>>, Rest = {}> = { [K in keyof S]?: SlotValue<S[K]> } & { children?: (props: SlotElements<S> & Rest) => React$1.ReactNode; } & Omit<Rest, "children">; //#endregion //#region src/v2/components/chat/CopilotChatInput.d.ts type CopilotChatInputMode = "input" | "transcribe" | "processing"; type ToolsMenuItem = { label: string; } & ({ action: () => void; items?: never; } | { action?: never; items: (ToolsMenuItem | "-")[]; }); type CopilotChatInputSlots = { textArea: typeof CopilotChatInput.TextArea; sendButton: typeof CopilotChatInput.SendButton; startTranscribeButton: typeof CopilotChatInput.StartTranscribeButton; cancelTranscribeButton: typeof CopilotChatInput.CancelTranscribeButton; finishTranscribeButton: typeof CopilotChatInput.FinishTranscribeButton; addMenuButton: typeof CopilotChatInput.AddMenuButton; audioRecorder: typeof CopilotChatAudioRecorder; disclaimer: typeof CopilotChatInput.Disclaimer; }; type CopilotChatInputRestProps = { mode?: CopilotChatInputMode; toolsMenu?: (ToolsMenuItem | "-")[]; autoFocus?: boolean; onSubmitMessage?: (value: string) => void; onStop?: () => void; isRunning?: boolean; onStartTranscribe?: () => void; onCancelTranscribe?: () => void; onFinishTranscribe?: () => void; onFinishTranscribeWithAudio?: (audioBlob: Blob) => Promise<void>; onAddFile?: () => void; value?: string; onChange?: (value: string) => void; /** Positioning mode for the input container. Default: 'static' */ positioning?: "static" | "absolute"; /** Keyboard height in pixels for mobile keyboard handling */ keyboardHeight?: number; /** Ref for the outer positioning container */ containerRef?: React$1.Ref<HTMLDivElement>; /** Whether to show the disclaimer. Default: true for absolute positioning, false for static */ showDisclaimer?: boolean; /** * Set to `true` when the input sits at the bottom of its container as a * flex-last-child (visible position is driven by layout, not CSS * positioning). Triggers reservation of bottom space for the fixed * CopilotKit license banner via the * `--copilotkit-license-banner-offset` CSS var so the two don't overlap. * * Not needed when `positioning === "absolute"`; that mode already pins the * input to the bottom and picks up the same reservation automatically. * Leave unset (default `false`) for inputs rendered mid-layout such as the * welcome screen, where the banner offset would push the input off-center. */ bottomAnchored?: boolean; } & Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange">; type CopilotChatInputBaseProps = WithSlots<CopilotChatInputSlots, CopilotChatInputRestProps>; type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends { children?: infer C; } ? C extends ((props: infer P) => React$1.ReactNode) ? P : never : never; type CopilotChatInputProps = Omit<CopilotChatInputBaseProps, "children"> & { children?: (props: CopilotChatInputChildrenArgs) => React$1.ReactNode; }; declare function CopilotChatInput({ mode, onSubmitMessage, onStop, isRunning, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, onAddFile, onChange, value, toolsMenu, autoFocus, positioning, keyboardHeight, containerRef, showDisclaimer, bottomAnchored, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addMenuButton, audioRecorder, disclaimer, children, className, ...props }: CopilotChatInputProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatInput { const SendButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; const ToolbarButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & { icon: React$1.ReactNode; labelKey: keyof CopilotChatLabels; defaultClassName?: string; }>; const StartTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; const CancelTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; const FinishTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; const AddMenuButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & { toolsMenu?: (ToolsMenuItem | "-")[]; onAddFile?: () => void; }>; type TextAreaProps = React$1.TextareaHTMLAttributes<HTMLTextAreaElement>; const TextArea: React$1.ForwardRefExoticComponent<TextAreaProps & React$1.RefAttributes<HTMLTextAreaElement>>; const AudioRecorder: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<AudioRecorderRef>>; const Disclaimer: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>; } //#endregion //#region src/v2/components/chat/CopilotChatToolCallsView.d.ts type CopilotChatToolCallsViewProps = { message: AssistantMessage; messages?: Message$2[]; }; declare function CopilotChatToolCallsView({ message, messages }: CopilotChatToolCallsViewProps): react_jsx_runtime0.JSX.Element | null; //#endregion //#region src/v2/components/chat/CopilotChatAssistantMessage.d.ts type CopilotChatAssistantMessageProps = WithSlots<{ markdownRenderer: typeof CopilotChatAssistantMessage.MarkdownRenderer; toolbar: typeof CopilotChatAssistantMessage.Toolbar; copyButton: typeof CopilotChatAssistantMessage.CopyButton; thumbsUpButton: typeof CopilotChatAssistantMessage.ThumbsUpButton; thumbsDownButton: typeof CopilotChatAssistantMessage.ThumbsDownButton; readAloudButton: typeof CopilotChatAssistantMessage.ReadAloudButton; regenerateButton: typeof CopilotChatAssistantMessage.RegenerateButton; toolCallsView: typeof CopilotChatToolCallsView; }, { onThumbsUp?: (message: AssistantMessage) => void; onThumbsDown?: (message: AssistantMessage) => void; onReadAloud?: (message: AssistantMessage) => void; onRegenerate?: (message: AssistantMessage) => void; message: AssistantMessage; messages?: Message$2[]; isRunning?: boolean; additionalToolbarItems?: React.ReactNode; toolbarVisible?: boolean; } & React.HTMLAttributes<HTMLDivElement>>; declare function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible, markdownRenderer, toolbar, copyButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }: CopilotChatAssistantMessageProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatAssistantMessage { const MarkdownRenderer: React.FC<Omit<React.ComponentProps<typeof Streamdown>, "children"> & { content: string; }>; const Toolbar: React.FC<React.HTMLAttributes<HTMLDivElement>>; const ToolbarButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { title: string; children: React.ReactNode; }>; const CopyButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; const ThumbsUpButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; const ThumbsDownButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; const ReadAloudButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; const RegenerateButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; } //#endregion //#region src/v2/components/chat/CopilotChatUserMessage.d.ts interface CopilotChatUserMessageOnEditMessageProps { message: UserMessage; } interface CopilotChatUserMessageOnSwitchToBranchProps { message: UserMessage; branchIndex: number; numberOfBranches: number; } type CopilotChatUserMessageProps = WithSlots<{ messageRenderer: typeof CopilotChatUserMessage.MessageRenderer; toolbar: typeof CopilotChatUserMessage.Toolbar; copyButton: typeof CopilotChatUserMessage.CopyButton; editButton: typeof CopilotChatUserMessage.EditButton; branchNavigation: typeof CopilotChatUserMessage.BranchNavigation; }, { onEditMessage?: (props: CopilotChatUserMessageOnEditMessageProps) => void; onSwitchToBranch?: (props: CopilotChatUserMessageOnSwitchToBranchProps) => void; message: UserMessage; branchIndex?: number; numberOfBranches?: number; additionalToolbarItems?: React.ReactNode; } & React.HTMLAttributes<HTMLDivElement>>; declare function CopilotChatUserMessage({ message, onEditMessage, branchIndex, numberOfBranches, onSwitchToBranch, additionalToolbarItems, messageRenderer, toolbar, copyButton, editButton, branchNavigation, children, className, ...props }: CopilotChatUserMessageProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatUserMessage { const Container: React.FC<React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>>; const MessageRenderer: React.FC<{ content: string; className?: string; }>; const Toolbar: React.FC<React.HTMLAttributes<HTMLDivElement>>; const ToolbarButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { title: string; children: React.ReactNode; }>; const CopyButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { copied?: boolean; }>; const EditButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>; const BranchNavigation: React.FC<React.HTMLAttributes<HTMLDivElement> & { currentBranch?: number; numberOfBranches?: number; onSwitchToBranch?: (props: CopilotChatUserMessageOnSwitchToBranchProps) => void; message: UserMessage; }>; } //#endregion //#region src/v2/components/chat/CopilotChatReasoningMessage.d.ts type CopilotChatReasoningMessageProps = WithSlots<{ header: typeof CopilotChatReasoningMessage.Header; contentView: typeof CopilotChatReasoningMessage.Content; toggle: typeof CopilotChatReasoningMessage.Toggle; }, { message: ReasoningMessage; messages?: Message$2[]; isRunning?: boolean; } & React.HTMLAttributes<HTMLDivElement>>; declare function CopilotChatReasoningMessage({ message, messages, isRunning, header, contentView, toggle, children, className, ...props }: CopilotChatReasoningMessageProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatReasoningMessage { const Header: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { isOpen?: boolean; label?: string; hasContent?: boolean; isStreaming?: boolean; }>; const Content: React.FC<React.HTMLAttributes<HTMLDivElement> & { isStreaming?: boolean; hasContent?: boolean; }>; const Toggle: React.FC<React.HTMLAttributes<HTMLDivElement> & { isOpen?: boolean; }>; } //#endregion //#region src/v2/components/chat/CopilotChatSuggestionPill.d.ts interface CopilotChatSuggestionPillProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> { /** Optional icon to render on the left side when not loading. */ icon?: React$1.ReactNode; /** Whether the pill should display a loading spinner. */ isLoading?: boolean; } declare const CopilotChatSuggestionPill: React$1.ForwardRefExoticComponent<CopilotChatSuggestionPillProps & React$1.RefAttributes<HTMLButtonElement>>; //#endregion //#region src/v2/components/chat/CopilotChatSuggestionView.d.ts declare const DefaultContainer: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>; type CopilotChatSuggestionViewProps = WithSlots<{ container: typeof DefaultContainer; suggestion: typeof CopilotChatSuggestionPill; }, { suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray<number>; } & React$1.HTMLAttributes<HTMLDivElement>>; declare const CopilotChatSuggestionView: React$1.ForwardRefExoticComponent<{ container?: SlotValue<React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>> | undefined; suggestion?: SlotValue<React$1.ForwardRefExoticComponent<CopilotChatSuggestionPillProps & React$1.RefAttributes<HTMLButtonElement>>> | undefined; } & { children?: ((props: { container: React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>; suggestion: React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>; } & { suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray<number>; } & React$1.HTMLAttributes<HTMLDivElement>) => React$1.ReactNode) | undefined; } & Omit<{ suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray<number>; } & React$1.HTMLAttributes<HTMLDivElement>, "children"> & React$1.RefAttributes<HTMLDivElement>>; //#endregion //#region src/v2/components/intelligence-indicator/IntelligenceIndicatorView.d.ts /** Lifecycle state the brain hands the face. */ type IntelligenceIndicatorStatus = "in-progress" | "finished"; interface IntelligenceIndicatorViewProps extends React$1.HTMLAttributes<HTMLSpanElement> { /** The assistant message this indicator is attached to. */ message: Message$2; /** * Whether the intelligence work is still running (`in-progress`) or * has settled (`finished`). Drives the icon morph and chrome * fade-out via the `data-status` attribute on the wrapper. */ status: IntelligenceIndicatorStatus; /** The visible label, e.g. "Using CopilotKit Intelligence". */ label: string; } /** * The presentational "CopilotKit Intelligence" face — the default * rendered by the {@link IntelligenceIndicator} brain and the default * value for the `intelligenceIndicator` slot. * * Single-element three-stage design: * 1. **In-progress.** Glassmorphism pill chrome around a 270° arc icon * and the label. The arc has a single continuous visible stroke * (one `stroke-dasharray` dash + one gap, summing to the path * length) and the whole SVG rotates — so the viewer sees one * C-shaped arc spinning around the visual center. * 2. **Icon morph (~250 ms).** On status flip the single icon path * interpolates from the arc to a checkmark via CSS `d:` while the * dashed stroke transitions to solid (filling in the gap that was * the spinner's open portion). The SVG rotation animation is * removed; the snap back to identity is masked by the simultaneous * shape change. Chrome and text stay at full opacity throughout. * 3. **Settle (~400 ms, starts at +250 ms).** Chrome (background, * border, shadow, backdrop-blur) fades to zero opacity. The label * and icon stroke color transitions from saturated purple to a * true-neutral gray at 0.8 alpha — no hue cast, reads as "settled * history metadata." The label simultaneously skews to ~10° (a * transform-based italic feel that interpolates smoothly with the * color, rather than the discrete `font-style: italic` snap that * would cause a layout pop). The label text stays put — only its * color and slant change — so there is no "bump" where the brand * text disappears and reappears. * * Hard sequence: stage 3 has a 250 ms transition-delay so it waits * for stage 2 to finish. Total settle time ~650 ms in production. * * Both shapes are 3-segment cubic Bézier paths with matched command * structure (one `M` plus three `C`s), which is what makes the d * morph interpolate as a continuous shape change rather than snapping. * * The label is identical in both states (default "CopilotKit * Intelligence"). The static check icon carries the "done" semantic; * the color + slant transition does the "settle" work without needing * any wording change. * * Customize via the `intelligenceIndicator` slot on `CopilotChat`: * a className string restyles the wrapper, a props object tweaks * the default (`{ label }`), and a component replaces it entirely * with full control over visuals and timing. */ declare function IntelligenceIndicatorView({ message, status, label, className, ...rest }: IntelligenceIndicatorViewProps): React$1.ReactElement; //#endregion //#region src/v2/components/intelligence-indicator/IntelligenceIndicator.d.ts interface IntelligenceIndicatorProps { /** The message this indicator is attached to. */ message: Message$2; /** * Agent id whose run state the indicator tracks. Pass through from * the surrounding chat configuration; mounting from * `CopilotChatMessageView` resolves this automatically. */ agentId: string; /** * Optional override for the visible label. Defaults to * "CopilotKit Intelligence". */ label?: string; /** * Slot override for the presentational face. A className string, a * props object, or a full replacement component — see * {@link IntelligenceIndicatorView}. Forwarded from the * `intelligenceIndicator` slot on `CopilotChat`. */ intelligenceIndicator?: SlotValue<typeof IntelligenceIndicatorView>; } /** * Stable turn id for the messages that precede the first user message (a turn * with no opening user message of its own). Used as the React key so the * indicator for that turn never collides with a real user-message id. */ declare const INTELLIGENCE_TURN_HEAD = "__cpk_turn_head__"; /** * Map each Intelligence-using turn to its anchor message — the FIRST bash-using * assistant message of the turn — and a stable turn id (the id of the user * message that opened the turn, or {@link INTELLIGENCE_TURN_HEAD} for the * pre-first-user turn). Returns `Map<anchorMessageId, turnId>`. * * Anchoring to the FIRST (not last) bash-using message keeps the indicator * fixed in place for the whole turn: later bash steps don't reposition it, so * the spinner never abruptly jumps mid-turn (bug 1). `CopilotChatMessageView` * emits exactly one `IntelligenceIndicator` per entry, keyed by the turn id and * positioned at the anchor; the per-turn key also lets every past turn keep its * own indicator in scroll-back. */ declare function getIntelligenceTurnAnchors(messages: readonly Message$2[]): Map<string, string>; /** * The "Using CopilotKit Intelligence" indicator brain. Auto-mounted by * `CopilotChatMessageView` — once per Intelligence-using turn, at that * turn's anchor message and keyed by the turn id (see * {@link getIntelligenceTurnAnchors}). Callers do not register this * themselves. It owns the run subscription and the phase machine and * renders its swappable face via the `intelligenceIndicator` slot. * * Placement (which message anchors the turn) is decided by the view, so * this component does not self-gate its own placement; it only derives * in-progress/finished for the turn it was mounted on. * * Render gates (all must hold): * 1. `copilotkit.intelligence !== undefined` * 2. The (anchor) message is an assistant message with at least one * tool call whose name matches {@link DEFAULT_TOOL_PATTERNS}. * 3. The phase machine is past `hidden`. * * Because the view keys each indicator by its turn id, the instance moves * with the anchor across a hand-off (no remount, no spinner restart), and * every prior Intelligence-using turn keeps its own persistent indicator * in chat history. * * Phase machine (per-instance, all timers local): * - Starts in `hidden`, unless the message mounts onto an * already-completed turn (no pending work, agent stopped or a * real follow-up already present), in which case the lazy * `useState` initializer starts directly in `finished`. This is * what avoids a "hidden flash" on history replay. * - `hidden → spinner` once a matching tool call has been pending * (no `tool`-role result with a matching `toolCallId`) for * {@link PENDING_THRESHOLD_MS}. Replay flashes (tool call + result * in the same tick) never cross this threshold. * - `hidden → finished` if after the grace window the turn is * already complete (no pending work AND * `sawRealFollowup || !agent.isRunning`). Handles very fast tools * whose result lands within the grace window. * - `spinner → finished` as soon as EITHER `agent.isRunning` flips * false OR a non-tool-call-like message appears later in * `agent.messages` (i.e. the agent produced a "real" follow-up — * prose answer or a new user turn). * - `finished` is terminal: the indicator settles into its * persistent tag form and stays mounted. */ declare function IntelligenceIndicator(props: IntelligenceIndicatorProps): React$1.ReactElement | null; //#endregion //#region src/v2/components/chat/CopilotChatMessageView.d.ts type CopilotChatMessageViewProps = Omit<WithSlots<{ assistantMessage: typeof CopilotChatAssistantMessage; userMessage: typeof CopilotChatUserMessage; reasoningMessage: typeof CopilotChatReasoningMessage; cursor: typeof CopilotChatMessageView.Cursor; intelligenceIndicator: typeof IntelligenceIndicatorView; }, { isRunning?: boolean; messages?: Message$2[]; } & React$1.HTMLAttributes<HTMLDivElement>>, "children"> & { children?: (props: { isRunning: boolean; messages: Message$2[]; messageElements: React$1.ReactElement[]; interruptElement: React$1.ReactElement | null; }) => React$1.ReactElement; }; declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, reasoningMessage, cursor, intelligenceIndicator, isRunning, children, className, ...props }: CopilotChatMessageViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatMessageView { var Cursor: ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime0.JSX.Element; } //#endregion //#region src/v2/components/chat/normalize-auto-scroll.d.ts type AutoScrollMode = "pin-to-bottom" | "pin-to-send" | "none"; //#endregion //#region src/v2/components/chat/CopilotChatView.d.ts type WelcomeScreenProps = WithSlots<{ welcomeMessage: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>; }, { input: React$1.ReactElement; suggestionView: React$1.ReactElement; } & React$1.HTMLAttributes<HTMLDivElement>>; type CopilotChatViewProps = WithSlots<{ messageView: typeof CopilotChatMessageView; scrollView: typeof CopilotChatView.ScrollView; input: typeof CopilotChatInput; suggestionView: typeof CopilotChatSuggestionView; }, { messages?: Message$2[]; autoScroll?: AutoScrollMode | boolean; isRunning?: boolean; suggestions?: Suggestion[]; suggestionLoadingIndexes?: ReadonlyArray<number>; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; welcomeScreen?: SlotValue<React$1.FC<WelcomeScreenProps>> | boolean; onSubmitMessage?: (value: string) => void; onStop?: () => void; inputMode?: CopilotChatInputMode; inputValue?: string; onInputChange?: (value: string) => void; onStartTranscribe?: () => void; onCancelTranscribe?: () => void; onFinishTranscribe?: () => void; onFinishTranscribeWithAudio?: (audioBlob: Blob) => Promise<void>; attachments?: Attachment[]; onRemoveAttachment?: (id: string) => void; onAddFile?: () => void; dragOver?: boolean; onDragOver?: (e: React$1.DragEvent) => void; onDragLeave?: (e: React$1.DragEvent) => void; onDrop?: (e: React$1.DragEvent) => void; /** * When `true`, suppresses the welcome screen while a thread's initial * connect is in flight. Prevents the "How can I help you today?" flash * that would otherwise appear between mounting an empty agent instance * and the bootstrap messages arriving from /connect. */ isConnecting?: boolean; /** * When `true`, the caller has explicitly picked a thread (via `threadId` * prop or `CopilotChatConfigurationProvider`). Suppresses the welcome * screen unconditionally — a caller-managed thread targets a specific * conversation and should render its messages (or an empty panel during * connect) rather than a generic "start a new chat" greeting. */ hasExplicitThreadId?: boolean; /** * @deprecated Use the `input` slot's `disclaimer` prop instead: * ```tsx * <CopilotChat input={{ disclaimer: MyDisclaimer }} /> * ``` */ disclaimer?: SlotValue<React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>>; /** * Slot for the "Using CopilotKit Intelligence" indicator. Pass-through * to `CopilotChatMessageView`'s `intelligenceIndicator` slot — accepts a * className string, a props object, or a replacement component. */ intelligenceIndicator?: SlotValue<typeof IntelligenceIndicatorView>; } & React$1.HTMLAttributes<HTMLDivElement>>; declare function CopilotChatView({ messageView, input, scrollView, suggestionView, welcomeScreen, messages, autoScroll, isRunning, suggestions, suggestionLoadingIndexes, onSelectSuggestion, onSubmitMessage, onStop, inputMode, inputValue, onInputChange, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, attachments, onRemoveAttachment, onAddFile, dragOver, onDragOver, onDragLeave, onDrop, isConnecting, hasExplicitThreadId, disclaimer, intelligenceIndicator, children, className, ...props }: CopilotChatViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatView { const ScrollView: React$1.FC<React$1.HTMLAttributes<HTMLDivElement> & { autoScroll?: AutoScrollMode | boolean; scrollToBottomButton?: SlotValue<React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>>; feather?: SlotValue<React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>>; inputContainerHeight?: number; isResizing?: boolean; }>; const ScrollToBottomButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; const Feather: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>; const WelcomeMessage: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>; const WelcomeScreen: React$1.FC<WelcomeScreenProps>; } //#endregion //#region src/v2/components/chat/CopilotChat.d.ts type CopilotChatProps = Omit<CopilotChatViewProps, "messages" | "isRunning" | "suggestions" | "suggestionLoadingIndexes" | "onSelectSuggestion" | "attachments" | "onRemoveAttachment" | "onAddFile" | "dragOver" | "onDragOver" | "onDragLeave" | "onDrop"> & { agentId?: string; threadId?: string; labels?: Partial<CopilotChatLabels>; chatView?: SlotValue<typeof CopilotChatView>; isModalDefaultOpen?: boolean; /** Enable multimodal file attachments (images, audio, video, documents). */ attachments?: AttachmentsConfig; /** * Error handler scoped to this chat's agent. Fires in addition to the * provider-level onError (does not suppress it). Receives only errors * whose context.agentId matches this chat's agent. */ onError?: (event: { error: Error; code: CopilotKitCoreErrorCode; context: Record<string, any>; }) => void | Promise<void>; /** * Throttle interval (in milliseconds) for re-renders triggered by message * change notifications. Overrides the provider-level `defaultThrottleMs` * for this chat instance. Forwarded to the internal `useAgent()` hook, * which resolves the effective throttle value. * * @default undefined — inherits from provider `defaultThrottleMs`; * if that is also unset, re-renders are unthrottled. Note: passing * `throttleMs={0}` explicitly disables throttling for this instance * even when the provider specifies a non-zero `defaultThrottleMs`. */ throttleMs?: number; }; declare function CopilotChat({ agentId, threadId, labels, chatView, isModalDefaultOpen, attachments: attachmentsConfig, onError, throttleMs, ...props }: CopilotChatProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChat { const View: typeof CopilotChatView; } //#endregion //#region src/v2/components/chat/CopilotChatToggleButton.d.ts declare const DefaultOpenIcon: React$1.FC<React$1.SVGProps<SVGSVGElement>>; declare const DefaultCloseIcon: React$1.FC<React$1.SVGProps<SVGSVGElement>>; interface CopilotChatToggleButtonProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "children"> { /** Optional slot override for the chat (closed) icon. */ openIcon?: SlotValue<typeof DefaultOpenIcon>; /** Optional slot override for the close icon. */ closeIcon?: SlotValue<typeof DefaultCloseIcon>; } declare const CopilotChatToggleButton: React$1.ForwardRefExoticComponent<CopilotChatToggleButtonProps & React$1.RefAttributes<HTMLButtonElement>>; //#endregion //#region src/v2/components/chat/CopilotModalHeader.d.ts type HeaderSlots = { titleContent: typeof CopilotModalHeader.Title; closeButton: typeof CopilotModalHeader.CloseButton; }; type HeaderRestProps = { title?: string; } & Omit<React$1.HTMLAttributes<HTMLDivElement>, "children">; type CopilotModalHeaderProps = WithSlots<HeaderSlots, HeaderRestProps>; declare function CopilotModalHeader({ title, titleContent, closeButton, children, className, ...rest }: CopilotModalHeaderProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined; declare namespace CopilotModalHeader { var displayName: string; } declare namespace CopilotModalHeader { const Title: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>; const CloseButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>; } //#endregion //#region src/v2/components/chat/CopilotSidebarView.d.ts type CopilotSidebarViewProps = CopilotChatViewProps & { header?: SlotValue<typeof CopilotModalHeader>; toggleButton?: SlotValue<typeof CopilotChatToggleButton>; width?: number | string; defaultOpen?: boolean; position?: "left" | "right"; }; declare function CopilotSidebarView({ header, toggleButton, width, defaultOpen, position, ...props }: CopilotSidebarViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotSidebarView { var displayName: string; } declare namespace CopilotSidebarView { /** * Sidebar-specific welcome screen layout: * - Suggestions at the top * - Welcome message in the middle * - Input fixed at the bottom (like normal chat) */ const WelcomeScreen: React$1.FC<WelcomeScreenProps>; } //#endregion //#region src/v2/components/chat/CopilotPopupView.d.ts type CopilotPopupViewProps = CopilotChatViewProps & { header