import { A as ReactActivityMessageRenderer, O as GenerativeUIChatSurfaceProps, t as GenerativeUIConfig } from "./runtime-context-B4fKyzo6.mjs"; import * as react from "react"; import React$1, { ComponentType, ReactNode } from "react"; import { A2UIMarkdownOperation, A2UI_FENCE_LANGUAGE, ActionConfig, ActionCreator, ActionFromCreator, ActionFromCreators, ActionGroupConfig, ActionGroupResult, AgentRegistry, AgentThreadLockedError, AnyAction, ChildIdsOf, ChildWalkOptions, ContextStore, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreAddAgentParams, CopilotKitCoreCatalogComponent, CopilotKitCoreConfig, CopilotKitCoreConfig as CopilotKitCoreConfig$1, CopilotKitCoreConnectAgentParams, CopilotKitCoreContinuationHandoff, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreFriendsAccess, CopilotKitCoreGetSuggestionsResult, CopilotKitCoreGetToolParams, CopilotKitCoreRegisterProxiedAgentParams, CopilotKitCoreRegisterProxiedAgentResult, CopilotKitCoreRunAgentParams, CopilotKitCoreRunToolParams, CopilotKitCoreRunToolResult, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitCoreStopAgentParams, CopilotKitCoreSubscriber, CopilotKitCoreSubscriber as CopilotKitCoreSubscriber$1, CopilotKitCoreSubscription, CopilotKitCoreSubscription as CopilotKitCoreSubscription$1, CopilotKitHeaderResolutionError, CopilotKitHeadersSource, CopilotKitHeadersSource as CopilotKitHeadersSource$1, CopilotKitMessageFilter, CopilotKitMessageFilter as CopilotKitMessageFilter$1, CopilotRuntimeTransport, DispatchingEffect, DispatchingEffectOptions, DynamicSuggestionsConfig, DynamicSuggestionsConfig as DynamicSuggestionsConfig$1, Effect, EmptyActionConfig, FrontendTool, FrontendTool as FrontendTool$1, FrontendToolHandlerContext, FrontendToolReconnectBehavior, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, InspectorActiveThreadPayload, InspectorMetadataV1, InspectorStopViewingPayload, InspectorViewThreadPayload, InspectorViewThreadResultPayload, IntelligenceAgent, IntelligenceAgentConfig, IntelligenceReplayFailedError, IntelligenceRuntimeInfo, JsonValue, LearningConfig, LearningConfig as LearningConfig$1, LegacyLearningConfig, MEMORY_ERROR_REGISTRY, MarkdownSegment, Memory, Memory as Memory$1, MemoryChanges, MemoryChanges as MemoryChanges$1, MemoryError, MemoryErrorCategory, MemoryErrorCode, MemoryErrorRegistryEntry, MemoryKind, MemoryRealtimeStatus, MemoryRealtimeStatus as MemoryRealtimeStatus$1, MemoryScope, NewMemory, NewMemory as NewMemory$1, NonDispatchingEffect, NonDispatchingEffectOptions, OpenThreadRegistration, PropsActionConfig, ProxiedCopilotRuntimeAgent as ProxiedCopilotRuntimeAgent$1, ProxiedCopilotRuntimeAgentConfig, Reducer, RunCompletionAware, RunErrorPhase, RunHandler, RuntimeLicenseStatus, RuntimeMode, ScopedContext, ScopedProperties, Selector, StartResult, StateManager, StaticSuggestionsConfig, StaticSuggestionsConfig as StaticSuggestionsConfig$1, Store, StoreLifecycleAction, SubscribeToAgentOptions, SubscribeToAgentSubscriber, Suggestion, Suggestion as Suggestion$1, SuggestionAvailability, SuggestionEngine, SuggestionsConfig, SurfaceSegment, ThreadEndpointRuntimeInfo, ThreadRunActivityNotification, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, TrajectoryStartOptions, WebMCPModelContext, WebMCPRegistry, WebMCPToolAnnotations, WebMCPToolConfig, WebMCPToolConfig as WebMCPToolConfig$1, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread as emitInspectorActiveThread$1, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult as emitInspectorViewThreadResult$1, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations, extractStringField, flattenInformationalCards, getMarkdownOperationSurfaceId, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled as isInspectorThreadBridgeEnabled$1, isRunCompletionAware as isRunCompletionAware$1, ofType, on, onInspectorActiveThread, onInspectorStopViewing as onInspectorStopViewing$1, onInspectorViewThread as onInspectorViewThread$1, onInspectorViewThreadResult, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown as splitA2UIMarkdown$1, ɵCOPILOTKIT_FEATURES, ɵCopilotKitFeature, ɵGenerativeUIDebugFunction, ɵGenerativeUIDebugPromptSection, ɵGenerativeUIDebugRun, ɵGenerativeUIDebugSnapshot, ɵGenerativeUIDebugSource, ɵGenerativeUIDebugSurface, ɵInterruptDecision, ɵInterruptEvent, ɵInterruptState as ɵInterruptState$1, ɵInterruptToolResult, ɵMAX_SOCKET_RETRIES, ɵMemoryEnvironment, ɵMemoryMetadataEvent, ɵMemoryRuntimeContext, ɵMemoryState, ɵMemoryStore, ɵPendingInterrupt, ɵPhoenixChannelLike, ɵPhoenixChannelOptions, ɵPhoenixChannelParams, ɵPhoenixChannelSession, ɵPhoenixJoinOutcome, ɵPhoenixPushLike, ɵPhoenixSocketLike, ɵPhoenixSocketOptions, ɵPhoenixSocketSession, ɵPhoenixSocketSignal, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵThread, ɵThreadEnvironment, ɵThreadMetadataEvent, ɵThreadRuntimeContext, ɵThreadSelectors, ɵThreadStore, ɵclearAgentInterruptState as ɵclearAgentInterruptState$1, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵgetAgentInterruptState as ɵgetAgentInterruptState$1, ɵisCopilotKitFeature, ɵisHttpAgent as ɵisHttpAgent$1, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError as ɵselectFetchMoreError$1, ɵselectHasNextPage as ɵselectHasNextPage$1, ɵselectIsFetchingNextPage as ɵselectIsFetchingNextPage$1, ɵselectIsMutating as ɵselectIsMutating$1, ɵselectMemories as ɵselectMemories$1, ɵselectMemoriesAvailable as ɵselectMemoriesAvailable$1, ɵselectMemoriesError as ɵselectMemoriesError$1, ɵselectMemoriesIsLoading as ɵselectMemoriesIsLoading$1, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus as ɵselectMemoriesRealtimeStatus$1, ɵselectThreads as ɵselectThreads$1, ɵselectThreadsError as ɵselectThreadsError$1, ɵselectThreadsIsLoading as ɵselectThreadsIsLoading$1, ɵthreadAdapterEvents, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core"; import { ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError as AGUIConnectNotImplementedError$1, AGUIEnforcementLimitError, AGUIError, AGUIEvent, AGUIEventByType, AGUIEventOf, AGUI_METADATA_KEY, AbstractAgent, AbstractAgent as AbstractAgent$1, ActivityDeltaEvent, ActivityDeltaEventProps, ActivityMessage as ActivityMessage$1, ActivitySnapshotEvent, ActivitySnapshotEventProps, AddOperation, AgentCapabilities as AgentCapabilities$1, AgentConfig, AgentDebugConfig, AgentStateMutation, AgentSubscriber, AgentSubscriberParams, ApplyEventsOptions, AssistantMessage as AssistantMessage$1, Attributable, AudioInputContent, AudioInputPart, AudioPart, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, BaseEvent, BaseEventFields, BaseEventProps, BaseMessage, CompatibilityBoundary, ContentPart, Context, CopyOperation, CustomEvent, CustomEventProps, DEFAULT_MAX_ENFORCED_ENTRIES, DataSource, DebugLogger, DebugLoggerInput, DeveloperMessage, DocumentInputContent, DocumentInputPart, DocumentPart, EnforcementOptions, Event, EventPayloadOf, EventType, ExecutionCapabilities, FileSource, FilterToolCallsMiddleware, FunctionCall, FunctionMiddleware, HttpAgent, HttpAgentConfig, HttpAgentFetchFn, HumanInTheLoopCapabilities, IdentityCapabilities, ImageInputContent, ImageInputPart, ImagePart, InputContent, InputContentDataSource, InputContentPart, InputContentSource as InputContentSource$1, InputContentUrlSource, Interrupt, JsonPatch, JsonPatchOperation, JsonPointer, Message as Message$3, MessagesSnapshotEvent, MessagesSnapshotEventProps, Metadata, Middleware, MiddlewareFunction, MoveOperation, MultiAgentCapabilities, MultimodalCapabilities, MultimodalInputCapabilities, MultimodalOutputCapabilities, OutputCapabilities, PROTOCOL_VERSION, PartSource, RawEvent, RawEventProps, ReasoningCapabilities, ReasoningEncryptedValueEvent, ReasoningEncryptedValueEventProps, ReasoningEncryptedValueSubtype, ReasoningEndEvent, ReasoningEndEventProps, ReasoningMessage as ReasoningMessage$1, ReasoningMessageChunkEvent, ReasoningMessageChunkEventProps, ReasoningMessageContentEvent, ReasoningMessageContentEventProps, ReasoningMessageEndEvent, ReasoningMessageEndEventProps, ReasoningMessageStartEvent, ReasoningMessageStartEventProps, ReasoningStartEvent, ReasoningStartEventProps, RemoveOperation, ReplaceOperation, ResolvedAgentDebugConfig, ResumeEntry, ResumeStatus, Role as Role$1, RunAgentInput, RunAgentParameters, RunAgentResult, RunAgentResult as RunAgentResult$1, RunErrorEvent, RunErrorEventProps, RunFinishedCancelledOutcome, RunFinishedEvent, RunFinishedEventProps, RunFinishedInterruptOutcome, RunFinishedOutcome, RunFinishedSuccessOutcome, RunStartedEvent, RunStartedEventProps, State, StateCapabilities, StateDeltaEvent, StateDeltaEventProps, StateSnapshotEvent, StateSnapshotEventProps, StepFinishedEvent, StepFinishedEventProps, StepStartedEvent, StepStartedEventProps, SubagentErrorEvent, SubagentErrorEventProps, SubagentFinishedEvent, SubagentFinishedEventProps, SubagentFinishedOutcome, SubagentFinishedSuccessOutcome, SubagentFinishedSuspendedOutcome, SubagentInfo, SubagentRunId, SubagentStartedEvent, SubagentStartedEventProps, SystemMessage, TestOperation, TextInputContent, TextMessageChunkEvent, TextMessageChunkEventProps, TextMessageContentEvent, TextMessageContentEventProps, TextMessageEndEvent, TextMessageEndEventProps, TextMessageRole, TextMessageStartEvent, TextMessageStartEventProps, TextPart, TokenUsage, Tool, ToolCall as ToolCall$1, ToolCallArgsEvent, ToolCallArgsEventProps, ToolCallChunkEvent, ToolCallChunkEventProps, ToolCallEndEvent, ToolCallEndEventProps, ToolCallResultEvent, ToolCallResultEventProps, ToolCallStartEvent, ToolCallStartEventProps, ToolMessage as ToolMessage$1, ToolsCapabilities, TransportCapabilities, UnrecognizedEvent, UrlSource, UserMessage as UserMessage$1, VideoInputContent, VideoInputPart, VideoPart, aggregateTokenUsage, authoritativeActivityTypes, buildResumeArray, compactEvents, contentHasMedia, contentToText as contentToText$1, convertToLegacyEvents, createDebugLogger, defaultApplyEvents, enforceEvents, enforceOutgoingInput, getRunOutcome, isInterruptExpired, isRecognizedEvent, mergeMetadata, omitOptionalNulls, parseProtoStream, parseSSEStream, randomUUID as randomUUID$2, resolveAgentDebugConfig, resolveDebugLogger, runHttpRequest, structuredClone_, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata, transformChunks, transformHttpEventStream, verifyEvents, withAuthoritativeActivityTypes } from "@ag-ui/client"; import { ActivityDeltaEventSchema, ActivityMessageSchema, ActivitySnapshotEventSchema, AddOperationSchema, AgentCapabilitiesSchema, AssistantMessageSchema, AttributableSchema, AudioInputContentSchema, AudioInputPartSchema, AudioPartSchema, BaseEventSchema, BaseMessageSchema, ContentPartSchema, ContextSchema, CopyOperationSchema, CustomEventSchema, DataSourceSchema, DeveloperMessageSchema, DocumentInputContentSchema, DocumentInputPartSchema, DocumentPartSchema, EventSchema, EventSchemas, EventTypeSchema, ExecutionCapabilitiesSchema, FileSourceSchema, FunctionCallSchema, HumanInTheLoopCapabilitiesSchema, IdentityCapabilitiesSchema, ImageInputContentSchema, ImageInputPartSchema, ImagePartSchema, InputContentDataSourceSchema, InputContentSchema, InputContentSourceSchema, InputContentUrlSourceSchema, InterruptSchema, JsonPatchOperationSchema, JsonPatchSchema, JsonPointerSchema, MessageSchema, MessagesSnapshotEventSchema, MetadataSchema, MoveOperationSchema, MultiAgentCapabilitiesSchema, MultimodalCapabilitiesSchema, MultimodalInputCapabilitiesSchema, MultimodalOutputCapabilitiesSchema, OptionalMetadataSchema, OutputCapabilitiesSchema, PartSourceSchema, RawEventSchema, ReasoningCapabilitiesSchema, ReasoningEncryptedValueEventSchema, ReasoningEncryptedValueSubtypeSchema, ReasoningEndEventSchema, ReasoningMessageChunkEventSchema, ReasoningMessageContentEventSchema, ReasoningMessageEndEventSchema, ReasoningMessageSchema, ReasoningMessageStartEventSchema, ReasoningStartEventSchema, RemoveOperationSchema, ReplaceOperationSchema, ResumeEntrySchema, RoleSchema, RunAgentInputSchema, RunErrorEventSchema, RunFinishedCancelledOutcomeSchema, RunFinishedEventSchema, RunFinishedInterruptOutcomeSchema, RunFinishedOutcomeSchema, RunFinishedSuccessOutcomeSchema, RunStartedEventSchema, StateCapabilitiesSchema, StateDeltaEventSchema, StateSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, SubagentErrorEventSchema, SubagentFinishedEventSchema, SubagentFinishedOutcomeSchema, SubagentFinishedSuccessOutcomeSchema, SubagentFinishedSuspendedOutcomeSchema, SubagentInfoSchema, SubagentRunIdSchema, SubagentStartedEventSchema, SystemMessageSchema, TestOperationSchema, TextInputContentSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageRoleSchema, TextMessageStartEventSchema, TextPartSchema, TokenUsageSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallSchema, ToolCallStartEventSchema, ToolMessageSchema, ToolSchema, ToolsCapabilitiesSchema, TransportCapabilitiesSchema, UrlSourceSchema, UserMessageSchema, VideoInputContentSchema, VideoInputPartSchema, VideoPartSchema } from "@ag-ui/core/schemas"; 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 * as react_jsx_runtime0 from "react/jsx-runtime"; import { Streamdown } from "streamdown"; import { ActivityMessage, AgentCapabilities, AssistantMessage, Message as Message$1, ReasoningMessage, ToolCall, ToolMessage, UserMessage } from "@ag-ui/core"; import { z } from "zod"; import { MCPAppsActivityContent, MCPAppsActivityContent as MCPAppsActivityContent$1, MCPAppsActivityContentSchema, MCPAppsActivityType, ɵMcpFollowUpHost, ɵrunMcpFollowUp } from "@copilotkit/mcp-apps-renderer/activity"; import { Theme } from "@copilotkit/a2ui-renderer"; import { ActionInputAvailability, Agent, ExtensionsInput, ForwardedParametersInput, LangGraphInterruptEvent } from "@copilotkit/runtime-client-gql"; import { Anchor as InspectorAnchor } from "@copilotkit/web-inspector"; import { CopilotKitContextValue, useCopilotKit, useLicenseContext } from "@copilotkit/react-core/v2/context"; //#region src/v1-deprecated/types/frontend-action.d.ts interface InProgressState { status: "inProgress"; args: Partial>; result: undefined; } interface ExecutingState { status: "executing"; args: MappedParameterTypes; result: undefined; } interface CompleteState { status: "complete"; args: MappedParameterTypes; result: any; } interface InProgressStateNoArgs { status: "inProgress"; args: Partial>; result: undefined; } interface ExecutingStateNoArgs { status: "executing"; args: MappedParameterTypes; result: undefined; } interface CompleteStateNoArgs { status: "complete"; args: MappedParameterTypes; result: any; } interface InProgressStateWait { status: "inProgress"; args: Partial>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: undefined; } interface ExecutingStateWait { status: "executing"; args: MappedParameterTypes; /** @deprecated use respond instead */ handler: (result: any) => void; respond: (result: any) => void; result: undefined; } interface CompleteStateWait { status: "complete"; args: MappedParameterTypes; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: any; } interface InProgressStateNoArgsWait { status: "inProgress"; args: Partial>; /** @deprecated use respond instead */ handler: undefined; respond: undefined; result: undefined; } interface ExecutingStateNoArgsWait { status: "executing"; args: MappedParameterTypes; /** @deprecated use respond instead */ handler: (result: any) => void; respond: (result: any) => void; result: undefined; } interface CompleteStateNoArgsWait { status: "complete"; args: MappedParameterTypes; /** @deprecated use respond instead */ handler: undefined; respond: undefined; } type ActionRenderProps = CompleteState | ExecutingState | InProgressState; type ActionRenderPropsNoArgs = CompleteStateNoArgs | ExecutingStateNoArgs | InProgressStateNoArgs; type ActionRenderPropsWait = CompleteStateWait | ExecutingStateWait | InProgressStateWait; type ActionRenderPropsNoArgsWait = CompleteStateNoArgsWait | ExecutingStateNoArgsWait | InProgressStateNoArgsWait; type CatchAllActionRenderProps = (CompleteState & { name: string; }) | (ExecutingState & { name: string; }) | (InProgressState & { name: string; }); /** * Render props for a catch-all action that waits for a response. Same as * {@link ActionRenderPropsWait} — including `respond` while executing — plus * the `name` of the tool call being handled, since one catch-all render serves * every tool. */ type CatchAllActionRenderPropsWait = (CompleteStateWait & { name: string; }) | (ExecutingStateWait & { name: string; }) | (InProgressStateWait & { name: string; }); type FrontendActionAvailability = "disabled" | "enabled" | "remote" | "frontend"; type FrontendAction = Action & { name: Exclude; /** * @deprecated Use `available` instead. */ disabled?: boolean; available?: FrontendActionAvailability; pairedAction?: string; followUp?: boolean; /** * Also expose this action to browser agents through the WebMCP API * (`document.modelContext`). `true` uses default annotations; * `{ annotations }` provides WebMCP annotations. */ webmcp?: boolean | WebMCPToolConfig; } & ({ render?: string | (T extends [] ? (props: ActionRenderPropsNoArgs) => string | React$1.ReactElement : (props: ActionRenderProps) => string | React$1.ReactElement); /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: never; renderAndWaitForResponse?: never; } | { render?: never; /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: T extends [] ? (props: ActionRenderPropsNoArgsWait) => React$1.ReactElement : (props: ActionRenderPropsWait) => React$1.ReactElement; renderAndWaitForResponse?: T extends [] ? (props: ActionRenderPropsNoArgsWait) => React$1.ReactElement : (props: ActionRenderPropsWait) => React$1.ReactElement; handler?: never; }); type CatchAllFrontendAction = { name: "*"; } & ({ render: (props: CatchAllActionRenderProps) => React$1.ReactElement; /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: never; renderAndWaitForResponse?: never; } | { render?: never; /** @deprecated use renderAndWaitForResponse instead */ renderAndWait?: (props: CatchAllActionRenderPropsWait) => React$1.ReactElement; /** * Handle every tool call that has no dedicated action with one * human-in-the-loop render: the call stays pending until `respond` is * called. Use `name` to tell the calls apart. */ renderAndWaitForResponse?: (props: CatchAllActionRenderPropsWait) => React$1.ReactElement; }); type RenderFunctionStatus = ActionRenderProps["status"]; //#endregion //#region src/v1-deprecated/hooks/use-tree.d.ts type TreeNodeId = string; interface TreeNode { id: TreeNodeId; value: string; children: TreeNode[]; parentId?: TreeNodeId; categories: Set; } type Tree = TreeNode[]; //#endregion //#region src/v1-deprecated/types/document-pointer.d.ts interface DocumentPointer { id: string; name: string; sourceApplication: string; iconImageUri: string; getContents: () => string; } //#endregion //#region src/v1-deprecated/types/system-message.d.ts type SystemMessageFunction = (contextString: string, additionalInstructions?: string) => string; //#endregion //#region src/v1-deprecated/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/v1-deprecated/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; } /** * 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/v1-deprecated/types/interrupt-action.d.ts interface LangGraphInterruptRenderHandlerProps { event: LangGraphInterruptEvent; resolve: (resolution: string) => void; } interface LangGraphInterruptRenderProps { result: unknown; event: LangGraphInterruptEvent; resolve: (resolution: string) => void; } interface LangGraphInterruptRender { id: string; /** * The handler function to handle the event. */ handler?: (props: LangGraphInterruptRenderHandlerProps) => any | Promise; /** * The render function to handle the event. */ render?: (props: LangGraphInterruptRenderProps) => 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 | null; type LangGraphInterruptActionSetter = (action: LangGraphInterruptActionSetterArgs) => void; interface QueuedInterruptEvent { eventId: string; threadId: string; event: LangGraphInterruptEvent; } //#endregion //#region src/v1-deprecated/types/coagent-action.d.ts type CoAgentStateRenderProps = { state: T; nodeName: string; status: "inProgress" | "complete"; }; type CoAgentStateRenderHandlerArguments = { nodeName: string; state: T; }; interface CoAgentStateRender { /** * 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) => void | Promise; /** * The render function to handle the state of the agent. */ render?: ((props: CoAgentStateRenderProps) => string | React.ReactElement | undefined | null) | string; } //#endregion //#region src/v1-deprecated/types/coagent-state.d.ts interface CoagentState { name: string; state: any; running: boolean; active: boolean; threadId?: string; config?: { configurable?: Record; [key: string]: any; }; nodeName?: string; runId?: string; } //#endregion //#region src/v1-deprecated/context/copilot-context.d.ts /** * Interface for the configuration of the Copilot API. */ interface CopilotApiConfig { /** * Your CopilotKit public license key (legacy `publicApiKey` alias of `publicLicenseKey`). */ publicApiKey?: string; /** * The configuration for the CopilotKit hosted runtime. */ 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; /** * Custom properties to be sent with the request * @default {} * @example * ``` * { * 'user_id': 'user_id' * } * ``` */ properties?: Record; /** * 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 | CatchAllActionRenderProps> = (props: TProps) => string | React$1.JSX.Element; type CoagentInChatRenderFunction = (props: CoAgentStateRenderProps) => string | React$1.JSX.Element | undefined | null; interface ChatComponentsCache { actions: Record; coAgentStateRenders: Record; } interface AgentSession { agentName: string; threadId?: string; nodeName?: string; } interface AuthState { status: "authenticated" | "unauthenticated"; authHeaders: Record; userId?: string; metadata?: Record; } type ActionName = string; interface CopilotContextParams { actions: Record>; setAction: (id: string, action: FrontendAction) => void; removeAction: (id: string) => void; setRegisteredActions: (actionConfig: any) => string; removeRegisteredAction: (actionKey: string) => void; chatComponentsCache: React$1.RefObject; getFunctionCallHandler: (customEntryPoints?: Record>) => 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>; chatSuggestionConfiguration: { [key: string]: CopilotChatSuggestionConfiguration; }; addChatSuggestionConfiguration: (id: string, suggestion: CopilotChatSuggestionConfiguration) => void; removeChatSuggestionConfiguration: (id: string) => void; chatInstructions: string; setChatInstructions: React$1.Dispatch>; additionalInstructions?: string[]; setAdditionalInstructions: React$1.Dispatch>; copilotApiConfig: CopilotApiConfig; showDevConsole: boolean; coagentStates: Record; setCoagentStates: React$1.Dispatch>>; coagentStatesRef: React$1.RefObject>; setCoagentStatesWithRef: (value: Record | ((prev: Record) => Record)) => void; agentSession: AgentSession | null; setAgentSession: React$1.Dispatch>; agentLock: string | null; threadId: string; setThreadId: React$1.Dispatch>; runId: string | null; setRunId: React$1.Dispatch>; chatAbortControllerRef: React$1.MutableRefObject; /** * The forwarded parameters to use for the task. */ forwardedParameters?: Partial>; availableAgents: Agent[]; /** * The auth states for the CopilotKit. */ authStates_c?: Record; setAuthStates_c?: React$1.Dispatch>>; /** * The auth config for the CopilotKit. */ authConfig_c?: { SignInComponent: React$1.ComponentType<{ onSignInComplete: (authState: AuthState) => void; }>; }; extensions: ExtensionsInput; setExtensions: React$1.Dispatch>; interruptActions: Record; setInterruptAction: LangGraphInterruptActionSetter; removeInterruptAction: (actionId: string) => void; interruptEventQueue: Record; 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>; internalErrorHandlers: Record; setInternalErrorHandler: (handler: Record) => void; removeInternalErrorHandler: (id: string) => void; } declare const CopilotContext: React$1.Context; 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; stop: () => Promise; dispose: () => void; } declare const CopilotChatAudioRecorder: react.ForwardRefExoticComponent & react.RefAttributes>; //#endregion //#region src/v2/providers/CopilotChatConfigurationProvider.d.ts declare const CopilotChatDefaultLabels: { chatInputPlaceholder: string; chatInputToolbarStartTranscribeButtonLabel: string; chatInputToolbarCancelTranscribeButtonLabel: string; chatInputToolbarFinishTranscribeButtonLabel: string; chatInputToolbarAddButtonLabel: string; chatInputToolbarToolsButtonLabel: string; chatInputToolbarSendButtonLabel: string; chatInputToolbarStopButtonLabel: string; assistantMessageToolbarCopyCodeLabel: string; assistantMessageToolbarCopyCodeCopiedLabel: string; assistantMessageToolbarCopyMessageLabel: string; assistantMessageToolbarInspectorLabel: string; assistantMessageToolbarInspectorDescription: string; assistantMessageToolbarInspectorLocalOnlyLabel: string; assistantMessageToolbarInspectorLocalOnlyDescription: string; assistantMessageToolbarInspectorTitle: string; assistantMessageToolbarInspectorHideLabel: string; assistantMessageToolbarInspectorHideDescription: string; assistantMessageToolbarThumbsUpLabel: string; assistantMessageToolbarThumbsDownLabel: string; assistantMessageFeedbackCommentPlaceholder: string; assistantMessageFeedbackCommentSubmitLabel: string; assistantMessageToolbarReadAloudLabel: string; assistantMessageToolbarRegenerateLabel: string; userMessageToolbarCopyMessageLabel: string; userMessageToolbarEditMessageLabel: string; userMessageToolbarPreviousBranchLabel: string; userMessageToolbarNextBranchLabel: string; chatDisclaimerText: string; chatToggleOpenLabel: string; chatToggleCloseLabel: string; chatScrollToBottomLabel: string; chatConnectingLabel: string; modalHeaderTitle: string; welcomeMessageText: string; reasoningMessageThinkingLabel: string; chatInputSlashMenuLabel: string; chatInputSlashMenuEmptyText: string; attachmentRemoveButtonLabel: string; attachmentPlayVideoButtonLabel: string; attachmentPreviewCloseButtonLabel: string; modalHeaderCloseButtonLabel: string; modalHeaderThreadsButtonLabel: string; sidebarLabel: string; }; type CopilotChatLabels = typeof CopilotChatDefaultLabels; interface CopilotChatConfigurationValue { labels: CopilotChatLabels; agentId: string; threadId: string; isModalOpen: boolean; setModalOpen: (open: boolean) => void; /** * Whether the thread-list drawer is open. A sibling boolean to `isModalOpen` * (deliberately NOT folded into a tri-state enum): on desktop the chat modal * and the drawer coexist, so two independent booleans are required. */ drawerOpen: boolean; /** * Toggles the drawer open state. On mobile viewports (`<768px`) opening the * drawer closes the chat modal (mutual exclusion); on desktop there is no * constraint. */ setDrawerOpen: (open: boolean) => void; /** * True once a `` wrapper has registered itself with this chat * configuration. The header thread-list launcher renders ONLY when this is * set, so chats with no drawer stay byte-for-byte unchanged. */ drawerRegistered: boolean; /** * Called by the drawer wrapper on mount to announce its presence (and flip * `drawerRegistered`). Returns a cleanup function that de-registers the * drawer on unmount. * * @returns A cleanup callback that reverses the registration. */ registerDrawer: () => () => void; /** * Internal: registers the modal-close setter of the provider that actually * owns the rendered modal (a descendant that supplied `isModalDefaultOpen`), * so the drawer's mobile mutual-exclusion — owned by the top-most provider — * closes the modal that is genuinely on screen rather than the top-most * provider's own (possibly unrendered) modal state. * * @param closeModal - A setter the drawer may call to close the rendered modal. * @returns A cleanup callback that de-registers the closer. */ ɵregisterModalCloser: (closeModal: (open: boolean) => void) => () => void; hasExplicitThreadId: boolean; /** * Imperatively sets the active thread for this chat configuration. * * Use this to drive the rendered thread without a host callback — e.g. a * `` selecting a thread row sets it explicitly so the chat * connects to that backend thread. * * Guarded like the top-level `` provider's `setThreadId`: when * the consumer controls the threadId via the `threadId` prop on this * provider, this is a no-op (a warning is logged) so a prop-controlled * threadId is never silently overridden. * * @param threadId - The thread id to make active. * @param options.explicit - Whether the thread is a caller choice. Defaults * to `true` (a picked thread). Pass `false` to set a non-explicit thread * so the welcome screen shows (see {@link startNewThread}). */ setActiveThreadId: (threadId: string, options?: { explicit?: boolean; }) => void; /** * Resets the active thread to a fresh, non-explicit client-side thread: a * newly minted UUID with `hasExplicitThreadId=false`, so the welcome screen * shows. Pairs with the core `startNewThread()` to clear the conversation * with no host wiring. * * Guarded identically to {@link setActiveThreadId}: a no-op when the * threadId is prop-controlled. */ startNewThread: () => void; } interface CopilotChatConfigurationProviderProps { children: ReactNode; labels?: Partial; agentId?: string; threadId?: string; hasExplicitThreadId?: boolean; isModalDefaultOpen?: boolean; } declare const CopilotChatConfigurationProvider: React$1.FC; declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue | null; //#endregion //#region src/v2/lib/slots.d.ts /** Existing union (unchanged) */ type SlotValue> = C | string | Partial>; /** Utility: concrete React elements for every slot */ type SlotElements = { [K in keyof S]: React$1.ReactElement }; type WithSlots>, Rest = {}> = { [K in keyof S]?: SlotValue } & { children?: (props: SlotElements & Rest) => React$1.ReactNode; } & Omit; //#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; 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; /** 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, "onChange">; type CopilotChatInputBaseProps = WithSlots; type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends { children?: infer C; } ? C extends ((props: infer P) => React$1.ReactNode) ? P : never : never; type CopilotChatInputProps = Omit & { children?: (props: CopilotChatInputChildrenArgs) => React$1.ReactNode; }; /** * The chat composer: a text area with the add-menu, voice and send/stop * buttons, and a slash-command menu that lists `toolsMenu` items once the text * starts with "/". */ 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 { /** * The icon-only send button. Its accessible name is * `labels.chatInputToolbarSendButtonLabel` unless an `aria-label` is passed; * the input passes `labels.chatInputToolbarStopButtonLabel` while the button * stops a run. */ const SendButton: React$1.FC>; /** * An icon-only toolbar button. `labels[labelKey]` is both its accessible * name and its tooltip text. */ const ToolbarButton: React$1.FC & { icon: React$1.ReactNode; labelKey: keyof CopilotChatLabels; defaultClassName?: string; }>; const StartTranscribeButton: React$1.FC>; const CancelTranscribeButton: React$1.FC>; const FinishTranscribeButton: React$1.FC>; /** * The "+" button that opens the attachment and tools menu. Its accessible * name and tooltip come from `labels.chatInputToolbarAddButtonLabel`. */ const AddMenuButton: React$1.FC & { toolsMenu?: (ToolsMenuItem | "-")[]; onAddFile?: () => void; }>; type TextAreaProps = React$1.TextareaHTMLAttributes; const TextArea: React$1.ForwardRefExoticComponent>; const AudioRecorder: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; const Disclaimer: React$1.FC>; } //#endregion //#region src/v2/components/chat/tool-call-layout.d.ts /** * How the chat shows tool calls. * * - `"grouped"` (default): calls made in a row share one card, collapsed to a * summary ("Used 3 tools") that opens to a row per call. * - `"line"`: the same grouping as a quiet line of text, like the reasoning * message's "Thought for 4 seconds". * - `"stacked"`: the latest call on top of a stack of the earlier ones; click * to fan the stack out into its cards. * - `"turn"`: the agent works in the open (narration, then a row per call), * and when the reply is done everything before it folds into "Worked for 9s". * - `"separate"`: every call gets its own card, as before grouping existed. * * Only calls drawn by a renderer that opts into grouping (`group: true`) are * grouped; CopilotKit's built-in card from `useDefaultRenderTool()` does. Any * other call always shows on its own and splits the group around it. */ type CopilotChatToolCallDisplay = "grouped" | "line" | "stacked" | "turn" | "separate"; /** One tool call and, once it has finished, the message carrying its result. */ interface ToolCallEntry { toolCall: ToolCall; toolMessage?: ToolMessage; } //#endregion //#region src/v2/components/chat/CopilotChatToolCallGroup.d.ts type CopilotChatToolCallGroupAppearance = "card" | "line" | "stack"; interface CopilotChatToolCallGroupProps extends Omit, "children"> { /** The calls in the group, in order. */ calls: ToolCallEntry[]; /** Renders one call through the registered renderers. */ renderCall: (call: ToolCallEntry) => React$1.ReactNode; /** * - `"card"` (default): one card with a summary header and a row per call. * - `"line"`: a quiet line of text that opens to a list of rows. * - `"stack"`: the latest call on a stack of the earlier ones. */ appearance?: CopilotChatToolCallGroupAppearance; /** The agent is running and nothing follows the group, so more calls may join it. */ isActive?: boolean; } /** * Tool calls made in a row, collapsed into one summary. While a call runs the * summary names it ("Running read_file src/app.ts"); once they're all done it * reads "Used 3 tools" and opens to the calls. * * Each call is drawn by its registered renderer. CopilotKit's built-in card * (`useDefaultRenderTool`) draws a compact row inside the card and line * appearances and an open stack; a custom wildcard renderer draws whatever it * draws. */ declare function CopilotChatToolCallGroup({ calls, renderCall, appearance, isActive, className, ...props }: CopilotChatToolCallGroupProps): react_jsx_runtime0.JSX.Element | null; //#endregion //#region src/v2/components/chat/CopilotChatToolCallsView.d.ts type CopilotChatToolCallsViewProps = { message: AssistantMessage; messages?: Message$1[]; /** * How to show the calls (see `CopilotChatToolCallDisplay`). Inside a message * view it follows the view's `toolCallDisplay`; on its own it defaults to * `"grouped"`. */ display?: CopilotChatToolCallDisplay; /** * Draws a group of calls made in a row: a component, a class name for the * default group, or props for it (e.g. `{ appearance: "line" }`). */ group?: SlotValue; }; declare function CopilotChatToolCallsView({ message, messages, display: displayProp, group }: CopilotChatToolCallsViewProps): react_jsx_runtime0.JSX.Element | null; //#endregion //#region src/v2/components/chat/CopilotChatAssistantMessage.d.ts type CopilotChatFeedbackMessage = AssistantMessage & { rawEvent?: unknown; }; type CopilotChatAssistantMessageProps = WithSlots<{ markdownRenderer: typeof CopilotChatAssistantMessage.MarkdownRenderer; toolbar: typeof CopilotChatAssistantMessage.Toolbar; copyButton: typeof CopilotChatAssistantMessage.CopyButton; inspectorButton: typeof CopilotChatAssistantMessage.InspectorButton; thumbsUpButton: typeof CopilotChatAssistantMessage.ThumbsUpButton; thumbsDownButton: typeof CopilotChatAssistantMessage.ThumbsDownButton; readAloudButton: typeof CopilotChatAssistantMessage.ReadAloudButton; regenerateButton: typeof CopilotChatAssistantMessage.RegenerateButton; toolCallsView: typeof CopilotChatToolCallsView; }, { onThumbsUp?: (message: CopilotChatFeedbackMessage) => void; onThumbsDown?: (message: CopilotChatFeedbackMessage) => void; onReadAloud?: (message: AssistantMessage) => void; onRegenerate?: (message: AssistantMessage) => void; message: AssistantMessage; messages?: Message$1[]; isRunning?: boolean; /** * Whether this is the last message the chat renders. The message view * passes it, because the rendered list can differ from `messages` when * `transformMessages` drops, replaces or reorders messages. Defaults to * comparing against the last entry of `messages`. */ isLatest?: boolean; additionalToolbarItems?: React.ReactNode; toolbarVisible?: boolean; /** * The comment field of a reply rating, inside the popover next to the * chosen thumb. Shown only while Automatic Learning records ratings; it * renders after `children`, so a `children` layout does not place it. */ feedbackComment?: SlotValue; } & React.HTMLAttributes>; declare function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible, markdownRenderer, toolbar, copyButton, inspectorButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, feedbackComment: feedbackCommentSlot, toolCallsView, children, className, ...props }: CopilotChatAssistantMessageProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatAssistantMessage { const MarkdownRenderer: React.FC, "children"> & { content: string; /** Id of the rendered message. The markdown transport finds its fences by it. */ messageId?: string; }>; const Toolbar: React.FC>; const ToolbarButton: React.FC & { title: string; tooltip?: React.ReactNode; tooltipClassName?: string; children: React.ReactNode; }>; const CopyButton: React.FC>; const InspectorButton: React.FC>; const ThumbsUpButton: React.FC>; const ThumbsDownButton: React.FC>; /** * The comment field of a rating, shown in a popover next to the chosen * thumb. Enter saves; Send appears once the text differs from the saved * comment. The popover marks itself `data-copilotkit-ignore`, so Learning * records the saved comment but not the typing; outside it, mark the * field yourself. */ const FeedbackComment: React.FC<{ value: string; /** The comment already saved. */ savedComment: string; inputRef?: React.Ref; onChange: (value: string) => void; onSubmit: () => void; onEditingChange?: (editing: boolean) => void; /** * Focus left the form for `next`, or for no focusable element when null. * Not called when the window loses focus. */ onLeave?: (next: Element | null) => void; className?: string; }>; const ReadAloudButton: React.FC>; const RegenerateButton: React.FC>; } //#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>; 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>>; const MessageRenderer: React.FC<{ content: string; className?: string; }>; const Toolbar: React.FC>; const ToolbarButton: React.FC & { title: string; children: React.ReactNode; }>; const CopyButton: React.FC & { copied?: boolean; }>; const EditButton: React.FC>; /** * Previous/next buttons and an "n/m" counter for switching between branches * of a user message. Renders only with more than one branch and an * `onSwitchToBranch` handler. The buttons are named by * `labels.userMessageToolbarPreviousBranchLabel` and * `labels.userMessageToolbarNextBranchLabel`. */ const BranchNavigation: React.FC & { 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$1[]; isRunning?: boolean; /** * Whether this is the last message the chat renders. The message view * passes it, because the rendered list can differ from `messages` when * `transformMessages` drops, replaces or reorders messages. Defaults to * comparing against the last entry of `messages`. */ isLatest?: boolean; } & React.HTMLAttributes>; /** * A reasoning message as a collapsible block. While the model reasons it is * open and the header shows `labels.reasoningMessageThinkingLabel`; when * streaming ends it collapses and the header reads "Thought for …". The * `header` slot also receives `elapsedSeconds`. */ declare function CopilotChatReasoningMessage({ message, messages, isRunning, isLatest: isLatestProp, header, contentView, toggle, children, className, ...props }: CopilotChatReasoningMessageProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatReasoningMessage { const Header: React.FC & { isOpen?: boolean; label?: string; hasContent?: boolean; isStreaming?: boolean; /** * Seconds spent reasoning so far, updated every second while streaming. * The default label formats it in English ("Thought for 12 seconds"); * a custom header can use it to build a localized label. */ elapsedSeconds?: number; }>; const Content: React.FC & { isStreaming?: boolean; hasContent?: boolean; }>; const Toggle: React.FC & { isOpen?: boolean; }>; } //#endregion //#region src/v2/components/chat/CopilotChatSuggestionPill.d.ts interface CopilotChatSuggestionPillProps extends React$1.ButtonHTMLAttributes { /** 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>; //#endregion //#region src/v2/components/chat/CopilotChatSuggestionView.d.ts declare const DefaultContainer: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; type CopilotChatSuggestionViewProps = WithSlots<{ container: typeof DefaultContainer; suggestion: typeof CopilotChatSuggestionPill; }, { suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray; } & React$1.HTMLAttributes>; declare const CopilotChatSuggestionView: React$1.ForwardRefExoticComponent<{ container?: SlotValue & React$1.RefAttributes>> | undefined; suggestion?: SlotValue>> | undefined; } & { children?: ((props: { container: React$1.ReactElement>; suggestion: React$1.ReactElement>; } & { suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray; } & React$1.HTMLAttributes) => React$1.ReactNode) | undefined; } & Omit<{ suggestions: Suggestion[]; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; loadingIndexes?: ReadonlyArray; } & React$1.HTMLAttributes, "children"> & React$1.RefAttributes>; //#endregion //#region src/v2/components/chat/CopilotChatWorkSummary.d.ts interface CopilotChatWorkSummaryProps extends React$1.ButtonHTMLAttributes { /** The agent is still working on this reply. */ isWorking: boolean; /** Whether the work (narration and tool calls) is showing. */ isOpen: boolean; /** The tool calls the reply made. */ calls: ToolCallEntry[]; /** * How long the agent has worked on the reply, in ms, summed over its runs * so time spent waiting between them doesn't count. Only known for replies * this client watched start; without it the summary shows the tool count. */ elapsedMs?: number; /** When the current run started (epoch ms), while the agent is working. */ workingSince?: number; } /** * The line at the top of a reply in the `"turn"` tool-call display. While the * agent works it reads "Working 4s"; once the reply is done it reads "Worked * for 9s · 7 tools" and toggles the work it folded away. */ declare function CopilotChatWorkSummary({ isWorking, isOpen, calls, elapsedMs, workingSince, className, ...props }: CopilotChatWorkSummaryProps): react_jsx_runtime0.JSX.Element; //#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 { /** The assistant message this indicator is attached to. */ message: Message$1; /** * 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. * * Layout: a glassmorphism pill (the `__chrome` layer) wrapping an icon * and a label. The icon is two overlaid SVG paths — a spinner arc and a * checkmark — whose geometry lives in each path's `d` ATTRIBUTE so it * renders in every browser (the CSS `d:` property is Chrome-only). * * Two states, driven by the `data-status` attribute (see globals.css * for the exact timing): * 1. **In-progress.** The arc spins (CSS rotation) inside the pill and * the checkmark is hidden. Label + icon are a saturated purple. * 2. **Finished.** The arc fades out mid-spin while the checkmark draws * itself in upright (animated `stroke-dashoffset`); the pill chrome * fades away; and the label + icon settle from purple to a neutral * gray, with the label slanting slightly (a `transform: skewX` * faux-italic, so it interpolates with the color instead of snapping * and never reflows). The result reads as quiet "history metadata" * rather than an active spinner. The label text itself never changes * — the static check plus the color/slant shift carry the "done" * meaning, so no wording change is needed. * * All motion is gated behind `prefers-reduced-motion` (globals.css): * when reduced motion is requested the arc does not spin and the two * states swap instantly, without transitions. * * 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$1; /** * 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; } /** * 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`. * * 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. * * `visibleMessages` is what actually renders, when that differs from * `messages` (the chat's `transformMessages`). Turns are still read from the * full list, so hiding a user message does not merge its turn into the one * before it, and anchors are only chosen among visible messages. A message the * transform built itself joins the turn of the visible message before it. */ declare function getIntelligenceTurnAnchors(messages: readonly Message$1[], visibleMessages?: readonly Message$1[]): Map; /** * 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 /** What the view passes the wrapper of a message group. */ interface MessageGroupWrapperProps { /** The group's key, as returned by `groupMessages`. */ groupKey: string; /** The messages in the group, in order. */ messages: Message$1[]; /** The default rendering of the group's messages. */ children: React$1.ReactNode; /** * State the view keeps for this group, keyed by `groupKey`. It survives the * row leaving the window and the wrapper remounting, is dropped once the key * no longer appears, and is cleared when the thread changes. `undefined` * until first set. */ state: S | undefined; setState: (next: S) => void; } /** Several messages rendered as one row, inside an app-provided wrapper. */ interface MessageGroup { type: "group"; /** * Identifies the group across renders: its React key and the key its state * is held under. Keep it stable while the thread streams, e.g. the id of the * group's first message. */ key: string; messages: Message$1[]; /** * Define it once at module level. A component created inside * `groupMessages` is a new type on every call and remounts each time. */ wrapper: React$1.ComponentType>; } /** One row of the message list: a single message, or a group of them. */ type MessageRow = { type: "message"; message: Message$1; } | MessageGroup; /** A row holding a single message, rendered as it would be ungrouped. */ declare function messageRow(message: Message$1): MessageRow; /** A row holding a group of messages, rendered inside `wrapper`. */ declare function messageGroup(group: Omit, "type">): MessageRow; type CopilotChatMessageViewProps = Omit Message$1[]; /** * Splits the message list into rows. Return `messageRow(message)` for a * message that renders on its own, and `messageGroup({ key, messages, * wrapper })` for messages that render together inside `wrapper` — a * collapsible block of tool calls, say. Receives the list after * `transformMessages`. Each row is one virtualized row. * * Return each message in at most one row. Tool-call cards still find * their results in the full list. * * Memoized on its input and this function — pass a stable function. */ groupMessages?: (messages: Message$1[]) => MessageRow[]; /** * Whether reply thumbs record ratings for Automatic Learning once a * Trajectory has started. Defaults to `true`; set `false` to keep the * thumbs to your own `onThumbsUp` / `onThumbsDown` handlers and slots. */ messageFeedback?: boolean; /** * How tool calls show. Defaults to `"grouped"`: calls made in a row * share one card that opens to a row per call. `"line"` and `"stacked"` * group them too; `"turn"` folds a reply's whole working phase into * "Worked for 9s" once it's done; `"separate"` gives every call its own * card. Calls with a renderer of their own always show on their own. */ toolCallDisplay?: CopilotChatToolCallDisplay; } & React$1.HTMLAttributes>, "children"> & { children?: (props: { isRunning: boolean; messages: Message$1[]; messageElements: React$1.ReactElement[]; interruptElement: React$1.ReactElement | null; }) => React$1.ReactElement; }; declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, reasoningMessage, cursor, intelligenceIndicator, workSummary, isRunning, transformMessages, groupMessages, messageFeedback, toolCallDisplay, children, className, ...props }: CopilotChatMessageViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatMessageView { var Cursor: ({ className, ...props }: React$1.HTMLAttributes) => 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>; }, { input: React$1.ReactElement; suggestionView: React$1.ReactElement; } & React$1.HTMLAttributes>; type CopilotChatViewProps = WithSlots<{ messageView: typeof CopilotChatMessageView; scrollView: typeof CopilotChatView.ScrollView; input: React$1.ComponentType; suggestionView: typeof CopilotChatSuggestionView; }, { messages?: Message$1[]; autoScroll?: AutoScrollMode | boolean; isRunning?: boolean; suggestions?: Suggestion[]; suggestionLoadingIndexes?: ReadonlyArray; onSelectSuggestion?: (suggestion: Suggestion, index: number) => void; welcomeScreen?: SlotValue> | 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; 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; /** * Indicator shown while `isConnecting` is `true` and no messages have * arrived yet, so restoring a thread's history doesn't render as an * empty panel. Pass `false` to disable it, or a component, className, or * props object to customize it. */ connectingIndicator?: SlotValue>> | 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 * * ``` */ disclaimer?: SlotValue>>; /** * 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; } & Omit, "inputMode">>; 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, connectingIndicator, hasExplicitThreadId, disclaimer, intelligenceIndicator, children, className, ...props }: CopilotChatViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotChatView { const ScrollView: React$1.FC & { autoScroll?: AutoScrollMode | boolean; scrollThreadId?: string; scrollToBottomButton?: SlotValue>>; feather?: SlotValue>>; inputContainerHeight?: number; isResizing?: boolean; }>; /** * Scrolls the message list to the latest message. Shown while the user is * scrolled up; its accessible name is `labels.chatScrollToBottomLabel`. */ const ScrollToBottomButton: React$1.FC>; const Feather: React$1.FC>; /** * Default indicator shown while a thread's history is being restored. * Renders a spinner plus visually hidden `labels.chatConnectingLabel` text * inside a `role="status"` region. Replace it via the `connectingIndicator` * slot. */ const ConnectingIndicator: React$1.FC>; const WelcomeMessage: React$1.FC>; const WelcomeScreen: React$1.FC; } //#endregion //#region src/v2/components/chat/CopilotChat.d.ts type CopilotChatProps = Omit & { /** * @deprecated Has no effect. `CopilotChat` sets the input mode from its own * transcription state. To set it yourself, render `CopilotChatView` and pass * `inputMode` there. */ inputMode?: CopilotChatViewProps["inputMode"]; agentId?: string; threadId?: string; labels?: Partial; /** * Enable Inspector message shortcuts for this chat (enabled by default). * An explicit CopilotKit provider enableInspector value takes priority. * Shortcuts only appear in local development while Inspector is visible. */ inspectorTools?: boolean; /** Accepts a className, partial props, or any component with CopilotChatView props — static namespace members are not required. */ chatView?: SlotValue>; 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; }) => void | Promise; /** * 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; /** * Experimental. Wrapper for generative UI surfaces rendered in this chat. * Receives `{ surfaceId, isStreaming, error, children }`. */ generativeUISurface?: React$1.ComponentType; }; declare function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isModalDefaultOpen, attachments: attachmentsConfig, onError, throttleMs, generativeUISurface, ...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>; declare const DefaultCloseIcon: React$1.FC>; interface CopilotChatToggleButtonProps extends Omit, "children"> { /** Optional slot override for the chat (closed) icon. */ openIcon?: SlotValue; /** Optional slot override for the close icon. */ closeIcon?: SlotValue; } declare const CopilotChatToggleButton: React$1.ForwardRefExoticComponent>; //#endregion //#region src/v2/components/chat/CopilotModalHeader.d.ts type HeaderSlots = { titleContent: typeof CopilotModalHeader.Title; closeButton: typeof CopilotModalHeader.CloseButton; drawerLauncher: typeof CopilotModalHeader.DrawerLauncher; }; type HeaderRestProps = { title?: string; } & Omit, "children">; /** * Payload handed to the optional `children` render function. `drawerLauncher` * is nullable because the launcher is rendered only when a drawer has * registered — when none is present, custom layouts receive `null` and can omit * the launcher slot entirely. */ type HeaderChildrenPayload = { titleContent: React$1.ReactElement; closeButton: React$1.ReactElement; drawerLauncher: React$1.ReactElement | null; title?: string; } & Omit; type CopilotModalHeaderProps = Omit, "children"> & { children?: (props: HeaderChildrenPayload) => React$1.ReactNode; }; declare function CopilotModalHeader({ title, titleContent, closeButton, drawerLauncher, children, className, ...rest }: CopilotModalHeaderProps): string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined; declare namespace CopilotModalHeader { var displayName: string; } declare namespace CopilotModalHeader { const Title: React$1.FC>; /** * Closes the popup or sidebar. Its accessible name is * `labels.modalHeaderCloseButtonLabel`. */ const CloseButton: React$1.FC>; /** * The thread-list launcher button. Rendered in the header ONLY when a * `` wrapper has registered with the chat configuration; it * toggles the drawer open state. The stable `data-testid` is the focus-return * target for the drawer wrapper on cancel/back/backdrop/Escape. */ const DrawerLauncher: React$1.FC>; } //#endregion //#region src/v2/components/chat/CopilotSidebarView.d.ts type CopilotSidebarViewProps = CopilotChatViewProps & { /** Accepts a className, partial props, or any component with CopilotModalHeader props — static namespace members are not required. */header?: SlotValue>; toggleButton?: SlotValue; width?: number | string; defaultOpen?: boolean; position?: "left" | "right"; }; /** * The chat in a side panel: a `complementary` region named by * `labels.sidebarLabel`, with a header, the chat view and a toggle button. */ 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; } //#endregion //#region src/v2/components/chat/CopilotPopupView.d.ts type CopilotPopupViewProps = CopilotChatViewProps & { /** Accepts a className, partial props, or any component with CopilotModalHeader props — static namespace members are not required. */header?: SlotValue>; toggleButton?: SlotValue; width?: number | string; height?: number | string; clickOutsideToClose?: boolean; defaultOpen?: boolean; }; declare function CopilotPopupView({ header, toggleButton, width, height, clickOutsideToClose, defaultOpen, className, ...restProps }: CopilotPopupViewProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotPopupView { var displayName: string; } declare namespace CopilotPopupView { /** * Popup-specific welcome screen layout: * - Welcome message centered vertically * - Suggestions just above input * - Input fixed at the bottom */ const WelcomeScreen: React$1.FC; } //#endregion //#region src/v2/components/chat/CopilotSidebar.d.ts type CopilotSidebarProps = Omit & { header?: CopilotSidebarViewProps["header"]; toggleButton?: CopilotSidebarViewProps["toggleButton"]; defaultOpen?: boolean; /** * Controlled open state. When supplied, the host owns whether the sidebar is * open: the sidebar renders this value and never changes it on its own. * Pair it with `onOpenChange` to react to the toggle button. Omit it (and use * `defaultOpen`) to let the sidebar manage its own state. */ open?: boolean; /** * Called with the requested state whenever the sidebar asks to open or close * (the toggle button, or the thread drawer on mobile). In controlled mode * nothing moves until the host updates `open`. */ onOpenChange?: (open: boolean) => void; width?: number | string; position?: CopilotSidebarViewProps["position"]; }; declare function CopilotSidebar({ header, toggleButton, defaultOpen, open, onOpenChange, width, position, ...chatProps }: CopilotSidebarProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotSidebar { var displayName: string; } //#endregion //#region src/v2/components/chat/CopilotPopup.d.ts type CopilotPopupProps = Omit & { header?: CopilotPopupViewProps["header"]; toggleButton?: CopilotPopupViewProps["toggleButton"]; defaultOpen?: boolean; /** * Controlled open state. When supplied, the host owns whether the popup is * open: the popup renders this value and never changes it on its own. Pair it * with `onOpenChange` to react to the toggle button and to click-outside. * Omit it (and use `defaultOpen`) to let the popup manage its own state. */ open?: boolean; /** * Called with the requested state whenever the popup asks to open or close * (the toggle button, click-outside, or the thread drawer on mobile). In * controlled mode nothing moves until the host updates `open`. */ onOpenChange?: (open: boolean) => void; width?: CopilotPopupViewProps["width"]; height?: CopilotPopupViewProps["height"]; clickOutsideToClose?: CopilotPopupViewProps["clickOutsideToClose"]; }; declare function CopilotPopup({ header, toggleButton, defaultOpen, open, onOpenChange, width, height, clickOutsideToClose, ...chatProps }: CopilotPopupProps): react_jsx_runtime0.JSX.Element; declare namespace CopilotPopup { var displayName: string; } //#endregion //#region src/v2/hooks/use-threads.d.ts /** * A conversation thread managed by CopilotKit Intelligence. * * Each thread has a unique `id`, an optional human-readable `name`, and * timestamp fields tracking creation and update times. */ interface Thread { id: string; agentId: string; name: string | null; archived: boolean; createdAt: string; updatedAt: string; /** * ISO-8601 timestamp of the most recent agent run on this thread. Absent * when the thread has never been run. Prefer this over `updatedAt` for * user-facing "last activity" displays — it is not bumped by metadata-only * actions like rename or archive. */ lastRunAt?: string; } /** * Configuration for the {@link useThreads} hook. * * Thread operations are scoped to the runtime-authenticated user and the * provided agent on CopilotKit Intelligence. */ interface UseThreadsInput { /** The ID of the agent whose threads to list and manage. */ agentId: string; /** When `true`, archived threads are included in the list. Defaults to `false`. */ includeArchived?: boolean; /** Maximum number of threads to fetch per page. When set, enables cursor-based pagination. */ limit?: number; /** * When `false`, the hook stays inert: no runtime context is dispatched, so * NO thread-list fetch or realtime subscription is issued. Used by gated * surfaces (e.g. an unlicensed ``) that must not touch the * network until the gate opens. Defaults to `true`. * * Flipping `enabled` back to `true` resumes normal fetching on the next * effect run; mutations are likewise short-circuited while disabled. */ enabled?: boolean; } /** * Return value of the {@link useThreads} hook. * * The `threads` array is kept in sync with the platform via a realtime * WebSocket subscription (when available) and is sorted most-recently-updated * first. Mutations reject with an `Error` if the platform request fails. */ interface UseThreadsResult { /** * Threads for the current user/agent pair, sorted by most recently * updated first. Updated in realtime when the platform pushes metadata * events. Includes archived threads only when `includeArchived` is set. */ threads: Thread[]; /** * `true` while the initial thread list is being fetched from the platform. * Subsequent realtime updates do not re-enter the loading state. */ isLoading: boolean; /** * The most recent error from fetching threads or executing a mutation, * or `null` when there is no error. Reset to `null` on the next * successful fetch. * * This channel folds together developer/config errors (missing runtime URL, * runtime without thread endpoints) and genuine list-load/mutation failures. * End-user surfaces that must not leak config errors should prefer * {@link listError}, which excludes the config/runtime-setup errors. */ error: Error | null; /** * The most recent genuine list-load or mutation error from the platform, or * `null`. Unlike {@link error}, this EXCLUDES developer/config errors (a * missing runtime URL, or a runtime that does not advertise thread * endpoints), so an end-user surface can render it directly without leaking * a developer-facing configuration message into the UI. */ listError: Error | null; /** * The error from the most recent FAILED next-page (fetch-more) load, or * `null`. Tracked separately from {@link listError} so a paginated-load * failure surfaces an inline "couldn't load more" affordance while the * already-loaded list stays visible. Cleared when a fetch-more is retried or * succeeds. */ fetchMoreError: Error | null; /** * `true` when there are more threads available to fetch via * {@link fetchMoreThreads}. Only meaningful when `limit` is set. */ hasMoreThreads: boolean; /** * `true` while a subsequent page of threads is being fetched. */ isFetchingMoreThreads: boolean; /** * `true` while at least one thread mutation (rename, archive, unarchive, * delete) is awaiting a server response. Mutations apply optimistically, so * this is primarily useful for disabling controls or showing a subtle * in-flight indicator. */ isMutating: boolean; /** * Fetch the next page of threads. No-op when {@link hasMoreThreads} is * `false` or a fetch is already in progress. */ fetchMoreThreads: () => void; /** * Re-fetch the thread list from the platform without clearing the current * list. Backs the drawer's error-state Retry and the Active/All filter * refetch. No-op until the runtime is connected. */ refetchThreads: () => void; /** * Reset to a fresh, non-explicit client-side thread so the welcome screen * shows. Lazy creation: no row appears in {@link threads} until the new * thread's first run persists server-side. */ startNewThread: () => void; /** * Rename a thread on the platform. * Resolves when the server confirms the update; rejects on failure. */ renameThread: (threadId: string, name: string) => Promise; /** * Archive a thread on the platform. * Archived threads are excluded from subsequent list results. * Resolves when the server confirms the update; rejects on failure. */ archiveThread: (threadId: string) => Promise; /** * Restore a previously archived thread on the platform. * The thread re-appears in default (non-archived) list results. * Resolves when the server confirms the update; rejects on failure. */ unarchiveThread: (threadId: string) => Promise; /** * Permanently delete a thread from the platform. * This is irreversible. Resolves when the server confirms deletion; * rejects on failure. */ deleteThread: (threadId: string) => Promise; } /** * React hook for listing and managing CopilotKit Intelligence threads. * * On mount the hook fetches the thread list for the runtime-authenticated user * and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket * URL, it also opens a realtime subscription so the `threads` array stays * current without polling — thread creates, renames, archives, and deletes * from any client are reflected immediately. * * Mutation methods (`renameThread`, `archiveThread`, `unarchiveThread`, * `deleteThread`) return promises that resolve once the platform confirms the * operation and reject with an `Error` on failure. * * @param input - Agent identifier and optional list controls. * @returns Thread list state and stable mutation callbacks. * * @example * ```tsx * import { useThreads } from "@copilotkit/react-core"; * * function ThreadList() { * const { threads, isLoading, renameThread, deleteThread } = useThreads({ * agentId: "agent-1", * }); * * if (isLoading) return

Loading…

; * * return ( *
    * {threads.map((t) => ( *
  • * {t.name ?? "Untitled"} * * *
  • * ))} *
* ); * } * ``` */ declare function useThreads({ agentId, includeArchived, limit, enabled }: UseThreadsInput): UseThreadsResult; //#endregion //#region src/v2/components/chat/CopilotThreadsDrawer.d.ts /** * Per-row content render function. Receives a thread and returns the React * node to project into the element's `slot="row:{id}"`. Returning `null` * (or omitting the prop) falls back to the element's built-in row name. */ type CopilotThreadsDrawerRowRenderer = (thread: Thread) => React$1.ReactNode; /** * Props for {@link CopilotThreadsDrawer}. * * The drawer is a thin controller around the framework-agnostic * `` custom element. It feeds the element domain data * (threads/loading/error from {@link useThreads}, the active thread from the * chat configuration) and routes the element's outbound DOM events back into * core thread operations and chat-configuration changes. */ interface CopilotThreadsDrawerProps { /** * The agent whose threads to list and manage. Defaults to the agent of the * surrounding chat configuration, or the platform default when none is set. */ agentId?: string; /** * Optional escape-hatch called when the user picks a thread row. The wrapper * additionally focuses the chat input. When omitted, the wrapper drives the * surrounding chat configuration directly (`setActiveThreadId`), so a bare * `` switches the rendered thread with no host wiring. Provide * this only to take control of the active thread yourself (e.g. a v1 * `setThreadId`); when provided it is preferred over the provider. */ onThreadSelect?: (threadId: string) => void; /** * Optional escape-hatch called when the user starts a new thread (the * element's "+ New" button). The wrapper always resets the core thread store * to a fresh, non-explicit client-side thread (`startNewThread`). When this * is omitted, the wrapper also resets the surrounding chat configuration to a * fresh non-explicit thread (`startNewThread`) so the welcome screen shows * with no host wiring. Provide this only to clear your own active thread; * when provided it is preferred over the provider. */ onNewThread?: () => void; /** Called when the Upgrade CTA is clicked. */ onLicensed?: () => void; /** * Destination the locked view's Upgrade CTA opens in a new tab. Defaults to * the element's built-in CopilotKit Intelligence docs URL when omitted. Set * to an empty string to suppress the default navigation and handle the click * yourself via `onLicensed`. */ licenseUrl?: string; /** * Optional per-row content. Rendered as light-DOM children with * `slot="row:{id}"` so the element projects them in place of the default * row name. Return `null` for a given row to keep the element's default. */ renderRow?: CopilotThreadsDrawerRowRenderer; /** * Accessible + default-header label for the drawer region. Sets the custom * element's `aria-label` and the default header text (shown when no * `slot="header"` content is projected). Defaults to the element's built-in * `"Threads"` when omitted. */ label?: string; /** * Heading for the "Recent Conversations" section above the thread list. Sets * the custom element's `recent-label` attribute. Defaults to the element's * built-in `"Recent Conversations"` when omitted. */ recentLabel?: string; /** * Whether the drawer offers a collapse toggle. Sets the custom element's * `collapsible` PROPERTY. When `false`, the drawer has no collapse toggle and * is always expanded. Defaults to the element's built-in `true` when omitted. */ collapsible?: boolean; /** * Called when the drawer's collapsed state changes (via the element's collapse * toggle), with the new collapsed state. Mirrors the element's * `collapse-change` event. */ onCollapseChange?: (collapsed: boolean) => void; /** * Page size for thread pagination. When set, threads are fetched in pages of * this size and the drawer shows a "Load more" control while more remain. * When omitted, the full list loads at once and no pagination control shows. */ limit?: number; /** * `data-testid` set on the underlying custom element (handy in tests and for * targeting from a host page). Defaults to `"copilot-threads-drawer"`. */ "data-testid"?: string; } /** * React wrapper for the shadow-DOM `` threads drawer. * * Responsibilities: * - Registers the custom element on the client (SSR-safe; nothing renders * during prerender to avoid hydration mismatch). * - Feeds the element domain data: `threads`, `loading`, `error`, * `activeThreadId`, `licensed`, fetch-more state. * - Routes the element's outbound events to core thread operations * ({@link useThreads}) and chat-configuration changes. * - Registers with the surrounding chat configuration so the header * thread-list launcher appears, and binds the element `open` state to the * configuration's `drawerOpen`. * * Intelligence gating is two-pronged: the locked view shows when the runtime * reports no active entitlement OR the `threads` feature is unavailable. While * unavailable, the thread fetch is skipped entirely so the drawer issues no * network requests. * * Thread switching needs no host wiring: when `onThreadSelect`/`onNewThread` * are omitted, the wrapper drives the surrounding chat configuration directly * ({@link CopilotChatConfigurationValue.setActiveThreadId} / * {@link CopilotChatConfigurationValue.startNewThread}), so a bare drawer * connects to the picked thread and shows the welcome screen on "+ New". Pass * the callbacks only to take control yourself. * * @example * ```tsx * // Callback-free: the drawer drives the chat configuration itself. * * * * * ``` */ declare function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed, licenseUrl, renderRow, label, recentLabel, collapsible, onCollapseChange, limit, "data-testid": dataTestId }: CopilotThreadsDrawerProps): React$1.ReactElement | null; declare namespace CopilotThreadsDrawer { var displayName: string; } //#endregion //#region src/v2/components/chat/CopilotChatAttachmentQueue.d.ts interface CopilotChatAttachmentQueueProps { attachments: Attachment[]; onRemoveAttachment: (id: string) => void; className?: string; } /** * The attachments queued in the composer, each with a preview and a remove * button named by `labels.attachmentRemoveButtonLabel`. */ declare const CopilotChatAttachmentQueue: React$1.FC; //#endregion //#region src/v2/components/chat/CopilotChatAttachmentRenderer.d.ts interface CopilotChatAttachmentRendererProps { type: "image" | "audio" | "video" | "document"; source: InputContentSource; filename?: string; className?: string; } declare const CopilotChatAttachmentRenderer: React$1.FC; //#endregion //#region src/v2/components/WildcardToolCallRender.d.ts /** * Catch-all (`"*"`) tool-call renderer that shows CopilotKit's default * tool-call card for any tool without a dedicated renderer. */ declare const WildcardToolCallRender: ReactToolCallRenderer; //#endregion //#region src/v2/components/CopilotKitInspectorContext.d.ts type CopilotKitInspectorOpenRequest = { messageId: string; threadId?: string; agentId?: string; }; //#endregion //#region src/v2/components/CopilotKitInspector.d.ts interface CopilotKitInspectorProps { core?: CopilotKitCore | null; onVisibilityChange?: (visible: boolean) => void; openRequest?: CopilotKitInspectorOpenRequest | null; } declare const CopilotKitInspector: react.FC; //#endregion //#region src/v2/components/MCPAppsActivityRenderer.d.ts /** * Props for the activity renderer component */ interface MCPAppsActivityRendererProps { activityType: string; content: MCPAppsActivityContent; message: unknown; agent: AbstractAgent | undefined; /** * Restore `allow-same-origin` on the sandbox. Unsafe: the widget runs with * the host page's origin. Set via `mcpApps.allowSameOriginFallback` on * `CopilotKitProvider`. */ allowSameOriginFallback?: boolean; /** * Accept `ui/update-model-context`. Set via `mcpApps.modelContext` on * `CopilotKitProvider`. */ modelContext?: boolean; } /** * MCP Apps Extension Activity Renderer * * Renders MCP Apps UI in a sandboxed iframe with full protocol support. * Fetches resource content on-demand via proxied MCP requests. The React shell * owns the iframe; `bindMcpApp` owns the protocol. */ declare const MCPAppsActivityRenderer: React$1.FC; //#endregion //#region src/v2/components/OpenGenerativeUIRenderer.d.ts declare const OpenGenerativeUIActivityType = "open-generative-ui"; declare const OpenGenerativeUIContentSchema: z.ZodObject<{ initialHeight: z.ZodOptional; generating: z.ZodOptional; css: z.ZodOptional; cssComplete: z.ZodOptional; html: z.ZodOptional>; htmlComplete: z.ZodOptional; jsFunctions: z.ZodOptional; jsFunctionsComplete: z.ZodOptional; jsExpressions: z.ZodOptional>; jsExpressionsComplete: z.ZodOptional; }, "strip", z.ZodTypeAny, { html?: string[] | undefined; initialHeight?: number | undefined; generating?: boolean | undefined; css?: string | undefined; cssComplete?: boolean | undefined; htmlComplete?: boolean | undefined; jsFunctions?: string | undefined; jsFunctionsComplete?: boolean | undefined; jsExpressions?: string[] | undefined; jsExpressionsComplete?: boolean | undefined; }, { html?: string[] | undefined; initialHeight?: number | undefined; generating?: boolean | undefined; css?: string | undefined; cssComplete?: boolean | undefined; htmlComplete?: boolean | undefined; jsFunctions?: string | undefined; jsFunctionsComplete?: boolean | undefined; jsExpressions?: string[] | undefined; jsExpressionsComplete?: boolean | undefined; }>; type OpenGenerativeUIContent = z.infer; /** * Schema for the generateSandboxedUi tool call arguments. * Used by the frontend tool renderer to display placeholder messages. */ declare const GenerateSandboxedUiArgsSchema: z.ZodObject<{ initialHeight: z.ZodOptional; placeholderMessages: z.ZodOptional>; css: z.ZodOptional; html: z.ZodOptional; jsFunctions: z.ZodOptional; jsExpressions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { html?: string | undefined; initialHeight?: number | undefined; css?: string | undefined; jsFunctions?: string | undefined; jsExpressions?: string[] | undefined; placeholderMessages?: string[] | undefined; }, { html?: string | undefined; initialHeight?: number | undefined; css?: string | undefined; jsFunctions?: string | undefined; jsExpressions?: string[] | undefined; placeholderMessages?: string[] | undefined; }>; type GenerateSandboxedUiArgs = z.infer; interface OpenGenerativeUIActivityRendererProps { activityType: string; content: OpenGenerativeUIContent; message: unknown; agent: unknown; } /** * Outer wrapper — absorbs every parent re-render but only forwards * throttled content snapshots to the memoized inner component. */ declare const OpenGenerativeUIActivityRenderer: React$1.FC; /** * Frontend tool renderer for generateSandboxedUi. * Displays placeholder messages while the UI is being generated. */ declare const OpenGenerativeUIToolRenderer: React$1.FC<{ name: string; args: Partial; status: ToolCallStatus.InProgress; result: undefined; } | { name: string; args: GenerateSandboxedUiArgs; status: ToolCallStatus.Executing; result: undefined; } | { name: string; args: GenerateSandboxedUiArgs; status: ToolCallStatus.Complete; result: string; }>; //#endregion //#region src/v2/types/react-tool-call-renderer.d.ts interface ReactToolCallRenderer { name: string; /** * Schema describing the tool arguments. Optional — renderers registered for * tools without parameters (e.g. HITL confirm dialogs) have no schema. */ args?: StandardSchemaV1; /** * Optional agent ID to constrain this tool renderer to a specific agent. * If specified, this renderer will only be used for the specified agent. */ agentId?: string; /** * Whether calls this renderer draws join the chat's tool-call groups (see * `toolCallDisplay` on `CopilotChatMessageView`). CopilotKit's built-in card * sets it; a renderer that leaves it unset always shows its calls on their * own, since the chat can't tell what it draws (it may even draw nothing). */ group?: boolean; render: React.ComponentType<{ name: string; toolCallId: string; args: Partial; status: ToolCallStatus.InProgress; result: undefined; } | { name: string; toolCallId: string; args: T; status: ToolCallStatus.Executing; result: undefined; } | { name: string; toolCallId: string; args: T; status: ToolCallStatus.Complete; result: string; }>; } //#endregion //#region src/v2/hooks/use-render-tool-call.d.ts interface UseRenderToolCallProps { toolCall: ToolCall; toolMessage?: ToolMessage; } /** * Hook that returns a function to render tool calls based on the render functions * defined in CopilotKitProvider. * * @returns A function that takes a tool call and optional tool message and returns the rendered component */ declare function useRenderToolCall(): ({ toolCall, toolMessage }: UseRenderToolCallProps) => React$1.ReactElement | null; //#endregion //#region src/v2/types/react-custom-message-renderer.d.ts type ReactCustomMessageRendererPosition = "before" | "after"; interface ReactCustomMessageRenderer { agentId?: string; render: React.ComponentType<{ message: Message$1; position: ReactCustomMessageRendererPosition; runId: string; messageIndex: number; messageIndexInRun: number; numberOfMessagesInRun: number; agentId: string; stateSnapshot: any; }> | null; } //#endregion //#region src/v2/hooks/use-render-custom-messages.d.ts interface UseRenderCustomMessagesParams { message: Message$1; position: ReactCustomMessageRendererPosition; } declare function useRenderCustomMessages(): ((params: UseRenderCustomMessagesParams) => react_jsx_runtime0.JSX.Element | null) | null; //#endregion //#region src/v2/types/frontend-tool.d.ts type ReactFrontendTool = Record> = FrontendTool & { render?: ReactToolCallRenderer["render"]; }; //#endregion //#region src/v2/types/human-in-the-loop.d.ts type ReactHumanInTheLoop = Record> = Omit, "handler"> & { /** * Render the human-in-the-loop UI for this tool call. * * Beyond the tool call's `args`/`status`/`result`, the render props carry * attribution: * - `toolCallId` — the AG-UI tool call id, unique per interrupt. It is the * stable key for correlating this interrupt with runtime (sub)agent * attribution — e.g. the `agentId` reported by `onToolExecutionStart`, or * per-run attribution stamped on the event stream — so the UI can label * the interrupt with the agent that actually raised it. * - `agentId` — the agent this tool was *registered* to (the tool's own * `agentId`), or `undefined` for an unscoped tool. This is the static * registration scope; it is NOT necessarily the runtime (sub)agent that * raised the interrupt. For runtime attribution, correlate `toolCallId` * with the event-stream/`onToolExecutionStart` agent id. */ render: React$1.ComponentType<{ name: string; description: string; toolCallId: string; agentId?: string; args: Partial; status: ToolCallStatus.InProgress; result: undefined; respond: undefined; } | { name: string; description: string; toolCallId: string; agentId?: string; args: T; status: ToolCallStatus.Executing; result: undefined; respond: (result: unknown) => Promise; } | { name: string; description: string; toolCallId: string; agentId?: string; args: T; status: ToolCallStatus.Complete; result: string; respond: undefined; }>; }; //#endregion //#region src/v2/types/defineToolCallRenderer.d.ts /** * Helper to define a type-safe tool call renderer entry. * - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }. * - Derives `args` type from the provided schema (any Standard Schema V1 compatible library). * - Ensures the render function param type exactly matches ReactToolCallRenderer["render"]'s param. * - For wildcard tools (name: "*"), args is optional and defaults to z.any() */ type RenderProps = { name: string; toolCallId: string; args: Partial; status: ToolCallStatus.InProgress; result: undefined; } | { name: string; toolCallId: string; args: T; status: ToolCallStatus.Executing; result: undefined; } | { name: string; toolCallId: string; args: T; status: ToolCallStatus.Complete; result: string; }; declare function defineToolCallRenderer(def: { name: "*"; render: (props: RenderProps) => React$1.ReactElement | null; agentId?: string; group?: boolean; }): ReactToolCallRenderer; declare function defineToolCallRenderer(def: { name: string; args: S; render: (props: RenderProps>) => React$1.ReactElement | null; agentId?: string; group?: boolean; }): ReactToolCallRenderer>; //#endregion //#region src/v2/types/interrupt.d.ts /** Name of the legacy custom event agents emit to signal an interrupt. */ declare const INTERRUPT_EVENT_NAME = "on_interrupt"; /** Legacy custom-event interrupt payload (agent emits a custom `on_interrupt` event). */ interface InterruptEvent { name: string; value: TValue; } /** * Resolve the agent with user input for an interrupt. * * - Standard interrupts: records `{ status: "resolved", payload }` for the target * interrupt (defaults to the primary one). Resumes once every open interrupt is * addressed; returns the resume run result, or `void` while still awaiting others. * - Legacy interrupts: resumes immediately via `command.resume = payload`. */ type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise; /** * Cancel an interrupt. * * - Standard interrupts: records `{ status: "cancelled" }` for the target interrupt * (defaults to the primary one), then resumes once all are addressed. * - Legacy interrupts: dismisses the pending interrupt without resuming. */ type InterruptCancelFn = (interruptId?: string) => Promise; interface InterruptHandlerProps { /** * Legacy event shape (`{ name, value }`). Always present for back-compat: for * standard interrupts, `value` is the primary `Interrupt` and `name` is `"on_interrupt"`. * Prefer `interrupt` / `interrupts` for standard interrupts. */ event: InterruptEvent; /** Primary standard interrupt (`interrupts[0]`), or `null` for legacy interrupts. */ interrupt: Interrupt | null; /** All open standard interrupts (empty array for legacy interrupts). */ interrupts: Interrupt[]; resolve: InterruptResolveFn; cancel: InterruptCancelFn; } interface InterruptRenderProps { event: InterruptEvent; interrupt: Interrupt | null; interrupts: Interrupt[]; result: TResult; resolve: InterruptResolveFn; cancel: InterruptCancelFn; } //#endregion //#region src/v2/types/sandbox-function.d.ts type SandboxFunction = { name: string; description: string; parameters: TParams; handler: (args: any) => Promise; }; //#endregion //#region src/v2/hooks/use-render-activity-message.d.ts declare function useRenderActivityMessage(): { renderActivityMessage: (message: ActivityMessage) => React.ReactElement | null; findRenderer: (activityType: string) => ReactActivityMessageRenderer | null; }; //#endregion //#region src/v2/hooks/use-frontend-tool.d.ts declare function useFrontendTool = Record>(tool: ReactFrontendTool, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-frontend-tools.d.ts /** * Register a list of frontend tools whose length can change between renders. * * `useFrontendTool` registers exactly one tool per call, so it cannot be called * in a loop over a runtime-length list without breaking the rules of hooks. * This hook runs a single effect over the whole array instead, which makes it * safe to build the list from state, props, or a server response. * * Tools are keyed by `name` plus `agentId`, the same as `useFrontendTool`. A * tool that disappears from the array is unregistered on the next render, and * every tool is unregistered on unmount. Renderers stay registered after * unmount so past tool calls still render in the chat history. * * @param tools - The tools to register. May be empty and may change length. * @param deps - Extra dependencies that force re-registration, compared by * identity like the second argument of `useEffect`. Use this when a handler * closes over a value that is not part of the tool definition. Keep the array * a constant length across renders. * * @example * Register one tool per item in application state: * ```tsx * const [reports, setReports] = useState([]); * * useFrontendTools( * reports.map((report) => ({ * name: `open_${report.id}`, * description: `Open the ${report.title} report`, * handler: async () => navigate(`/reports/${report.id}`), * })), * [navigate], * ); * ``` * * @example * Register tools described by the backend: * ```tsx * const { data } = useQuery(fetchToolDescriptors); * * useFrontendTools( * (data ?? []).map((descriptor) => ({ * name: descriptor.name, * description: descriptor.description, * parameters: z.object({ query: z.string() }), * handler: async ({ query }) => runDescriptor(descriptor.id, query), * })), * ); * ``` */ declare function useFrontendTools(tools: ReadonlyArray> | undefined, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-component.d.ts type InferRenderProps = T extends StandardSchemaV1 ? InferSchemaOutput : any; /** * Registers a React component as a frontend tool renderer in chat. * * This hook is a convenience wrapper around `useFrontendTool` that: * - builds a model-facing tool description, * - forwards optional schema parameters (any Standard Schema V1 compatible library), * - renders your component with tool call parameters. * * Use this when you want to display a typed visual component for a tool call * without manually wiring a full frontend tool object. * * When `parameters` is provided, render props are inferred from the schema. * When omitted, the render component may accept any props. * * @typeParam TSchema - Schema describing tool parameters, or `undefined` when no schema is given. * @param config - Tool registration config. * @param deps - Optional dependencies to refresh registration (same semantics as `useEffect`). * * @example * ```tsx * // Without parameters — render accepts any props * useComponent({ * name: "showGreeting", * render: ({ message }: { message: string }) =>
{message}
, * }); * ``` * * @example * ```tsx * // With parameters — render props inferred from schema * useComponent({ * name: "showWeatherCard", * parameters: z.object({ city: z.string() }), * render: ({ city }) =>
{city}
, * }); * ``` * * @example * ```tsx * useComponent( * { * name: "renderProfile", * parameters: z.object({ userId: z.string() }), * render: ProfileCard, * agentId: "support-agent", * }, * [selectedAgentId], * ); * ``` */ declare function useComponent> | undefined = undefined>(config: { name: string; description?: string; parameters?: TSchema; render: ComponentType>>; agentId?: string; followUp?: boolean; }, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-render-tool.d.ts interface RenderToolInProgressProps { name: string; toolCallId: string; parameters: Partial>; status: "inProgress"; result: undefined; } interface RenderToolExecutingProps { name: string; toolCallId: string; parameters: InferSchemaOutput; status: "executing"; result: undefined; } interface RenderToolCompleteProps { name: string; toolCallId: string; parameters: InferSchemaOutput; status: "complete"; result: string; } type RenderToolProps = RenderToolInProgressProps | RenderToolExecutingProps | RenderToolCompleteProps; /** * Registers a wildcard (`"*"`) renderer for tool calls. * * The wildcard renderer is used as a fallback when no exact name-matched * renderer is registered for a tool call. * * @param config - Wildcard renderer configuration. * @param deps - Optional dependencies to refresh registration. * * @example * ```tsx * useRenderTool( * { * name: "*", * render: ({ name, status }) => ( *
* {status === "complete" ? "✓" : "⏳"} {name} *
* ), * }, * [], * ); * ``` */ declare function useRenderTool(config: { name: "*"; render: (props: any) => React.ReactElement | null; agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */ group?: boolean; }, deps?: ReadonlyArray): void; /** * Registers a name-scoped renderer for tool calls. * * The provided `parameters` schema defines the typed shape of `props.parameters` * in `render` for `executing` and `complete` states. Accepts any Standard Schema V1 * compatible library (Zod, Valibot, ArkType, etc.). * * @typeParam S - Schema type describing tool call parameters. * @param config - Named renderer configuration. * @param deps - Optional dependencies to refresh registration. * * @example * ```tsx * useRenderTool( * { * name: "searchDocs", * parameters: z.object({ query: z.string() }), * render: ({ status, parameters, result }) => { * if (status === "inProgress") return
Preparing...
; * if (status === "executing") return
Searching {parameters.query}
; * return
{result}
; * }, * }, * [], * ); * ``` */ declare function useRenderTool(config: { name: string; parameters: S; render: (props: RenderToolProps) => React.ReactElement | null; agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */ group?: boolean; }, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-default-render-tool.d.ts type DefaultRenderProps = { /** The name of the tool being called. */name: string; /** The id of the tool call being rendered. */ toolCallId: string; /** The parsed parameters passed to the tool call. */ parameters: unknown; /** Current execution status of the tool call. */ status: "inProgress" | "executing" | "complete"; /** The tool call result string, available only when `status` is `"complete"`. */ result: string | undefined; }; /** * Registers a wildcard (`"*"`) tool-call renderer via `useRenderTool`. * * - Call with no config to use CopilotKit's built-in default tool-call card. * - Pass `config.render` to replace the default UI with your own fallback renderer. * * This is useful when you want a generic renderer for tools that do not have a * dedicated `useRenderTool({ name: "..." })` registration. * * @param config - Optional custom wildcard render function. * @param deps - Optional dependencies to refresh registration. * * @example * ```tsx * useDefaultRenderTool(); * ``` * * @example * ```tsx * useDefaultRenderTool({ * render: ({ name, status }) =>
{name}: {status}
, * }); * ``` * * @example * ```tsx * useDefaultRenderTool( * { * render: ({ name, result }) => ( * * ), * }, * [compactMode], * ); * ``` */ declare function useDefaultRenderTool(config?: { render?: (props: DefaultRenderProps) => React$1.ReactElement | null; /** * Let the chat group calls your `render` draws, like it groups the * built-in card's (see `toolCallDisplay` on `CopilotChatMessageView`). * Off by default for a custom `render`, since it may draw nothing. */ group?: boolean; }, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-human-in-the-loop.d.ts declare function useHumanInTheLoop = Record>(tool: ReactHumanInTheLoop, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-agent.d.ts declare enum UseAgentUpdate { OnMessagesChanged = "OnMessagesChanged", OnStateChanged = "OnStateChanged", OnRunStatusChanged = "OnRunStatusChanged" } interface UseAgentPropsBase { updates?: UseAgentUpdate[]; /** * Throttle interval (in milliseconds) for re-renders triggered by * `onMessagesChanged` and `onStateChanged` notifications. Useful to reduce * re-render frequency during high-frequency streaming updates. * * Uses a leading+trailing pattern with a shared window — first update * fires immediately, subsequent updates within the window are coalesced, * and a trailing timer ensures the most recent update fires after the * window expires. See `CopilotKitCore.subscribeToAgentWithOptions` in `@copilotkit/core` * for details. * * Resolved as: `throttleMs ?? provider defaultThrottleMs ?? 0`. * Passing `throttleMs={0}` explicitly disables throttling even when the * provider specifies a non-zero `defaultThrottleMs`. * * Run lifecycle callbacks (`onRunInitialized`, `onRunFinalized`, * `onRunFailed`, `onRunErrorEvent`) always fire immediately. * * @default undefined * When unset, inherits from the provider's `defaultThrottleMs`; * if that is also unset, the effective value is `0` (no throttle). */ throttleMs?: number; } /** * Thread-scoped variant. `agentId`, `runtimeAgentId`, and `threadId` are a * matched set: together they give this hook a *private* agent — registered * under the local `agentId`, routing outbound to `runtimeAgentId` — that is * safe to pin a thread onto. None of the three is meaningful without the other * two, so all are required here. */ interface UseAgentThreadScopedProps { /** * The name to register this hook's proxied agent under. * * Required, and must not already be taken. The usual fallbacks (the chat * configuration's agentId, then `DEFAULT_AGENT_ID`) name agents that already * exist, and registering over one either throws `already registered` or * silently shadows it, depending on whether runtime discovery has landed — so * the caller has to name it. */ agentId: string; /** * Thread to scope the agent's run to. Written onto the underlying agent, so * `/agent/run`, `/agent/connect`, and `/agent/stop` address this thread. * * REQUIRES `runtimeAgentId`. A runtime agent registered under a given id is a * singleton, so writing a per-hook threadId directly onto it would let two * `useAgent` calls that share an `agentId` clobber each other's thread. * Passing a distinct local `agentId` plus the `runtimeAgentId` it routes to * gives this hook a private proxied agent to pin the thread onto instead of a * shared one. */ threadId: string; /** * The id of the runtime agent to route outbound requests to, while this hook * exposes a distinct local `agentId`. Registers a proxied agent via * `CopilotKitCore.registerProxiedAgent`, letting several frontend agents * (e.g. one per open thread) mount against a single runtime agent without a * shared-singleton collision. * * When set, `agentId` is the *local* registry id (must not collide with an * existing local or runtime-discovered agent) and `runtimeAgentId` is the * runtime agent the proxy addresses on `/agent/run` etc. * * REQUIRES `threadId`. Registering a private agent is only worth doing to * scope a thread to it; without a `threadId` the private agent would take its * thread from the chat configuration, which is what binding to the shared * agent via `agentId` alone already does — just with an extra registration * and a local id to keep unique. */ runtimeAgentId: string; } /** * Default variant: neither `threadId` nor `runtimeAgentId`. The hook binds to * the shared agent registered under `agentId` and leaves its threadId to the * chat configuration (or to the agent's own auto-minted UUID). * * Both props are typed `undefined` here rather than omitted so that supplying * either one on its own fails to match *both* branches — that is the * type-level enforcement of the all-or-nothing rule. */ interface UseAgentUnscopedProps { /** * Agent to bind to. Resolution precedence: this property, then the surrounding * chat configuration's agentId, then the global default. */ agentId?: string; /** Requires `runtimeAgentId`. See {@link UseAgentThreadScopedProps.threadId}. */ threadId?: undefined; /** Requires `threadId`. See {@link UseAgentThreadScopedProps.runtimeAgentId}. */ runtimeAgentId?: undefined; } /** * Props for {@link useAgent}. * * There are exactly two valid shapes, and the type admits nothing in between: * * - **Bind to an agent** — `useAgent()`, `useAgent({ agentId })`. The shared * instance from the registry; the thread comes from the chat configuration. * - **Bind a private agent to a thread** — * `useAgent({ agentId, runtimeAgentId, threadId })`. All three required. * * So `useAgent({ agentId, threadId })`, `useAgent({ agentId, runtimeAgentId })`, * and `useAgent({ runtimeAgentId, threadId })` are all compile errors. Each * partial combination is either unsafe (a thread scoped onto a shared singleton) * or pointless (a private agent with no thread, or one registered over an id * that already belongs to a real agent). */ type UseAgentProps = UseAgentPropsBase & (UseAgentThreadScopedProps | UseAgentUnscopedProps); /** * Returns the selected agent and its readiness, subscribing to agent updates. * Uses a shared agent by default, or a private proxy when `agentId`, * `runtimeAgentId`, and `threadId` are supplied together. */ declare function useAgent({ agentId, threadId, runtimeAgentId, updates, throttleMs }?: UseAgentProps): { agent: AbstractAgent; /** * Whether `agent` is the real, runtime-synced (or locally-registered) agent * rather than a provisional stand-in returned while the runtime is still * connecting (or in an error state). * * `agent` is always a fully-constructed `AbstractAgent`, so calling * `agent.subscribe(...)`, `agent.setState(...)`, etc. is always safe. But * while `isReady` is `false` the instance is a placeholder that will be * swapped for the real agent once the runtime `/info` sync resolves, at * which point `agent` changes reference and dependent effects re-run. * Guard on `isReady` when you only want to act against the real agent — * e.g. subscribing to run-lifecycle events you don't want to miss during * the provisional window (#5000). */ isReady: boolean; }; //#endregion //#region src/v2/hooks/use-capabilities.d.ts /** * Returns the capabilities declared by the given agent (or the agent resolved * from the surrounding chat configuration, falling back to the default agent). * Capabilities are populated from the runtime `/info` response at connection * time. The hook reads them synchronously from the agent instance — there is * no separate loading state, but the value will be `undefined` until the * runtime handshake completes. * * @param agentId - Optional agent ID. If omitted, inherits the surrounding * chat configuration's agent, falling back to the default agent. * @returns The agent's capabilities, or `undefined` if the agent doesn't * declare capabilities. */ declare function useCapabilities(agentId?: string): AgentCapabilities | undefined; //#endregion //#region src/v2/hooks/use-agent-context.d.ts /** * Represents any value that can be serialized to JSON. */ type JsonSerializable = string | number | boolean | null | JsonSerializable[] | { [key: string]: JsonSerializable; }; /** * Context configuration for useAgentContext. * Accepts any JSON-serializable value which will be converted to a string. */ interface AgentContextInput { /** A human-readable description of what this context represents */ description: string; /** The context value - will be converted to a JSON string if not already a string */ value: JsonSerializable; } declare function useAgentContext(context: AgentContextInput): void; //#endregion //#region src/v2/hooks/use-suggestions.d.ts interface UseSuggestionsOptions { agentId?: string; } interface UseSuggestionsResult { suggestions: Suggestion[]; reloadSuggestions: () => void; clearSuggestions: () => void; isLoading: boolean; } declare function useSuggestions({ agentId }?: UseSuggestionsOptions): UseSuggestionsResult; //#endregion //#region src/v2/hooks/use-configure-suggestions.d.ts type StaticSuggestionInput = Omit & Partial>; type StaticSuggestionsConfigInput = Omit & { suggestions: StaticSuggestionInput[]; }; type SuggestionsConfigInput = DynamicSuggestionsConfig | StaticSuggestionsConfigInput; declare function useConfigureSuggestions(config: SuggestionsConfigInput | null | undefined, deps?: ReadonlyArray): void; //#endregion //#region src/v2/hooks/use-interrupt.d.ts type InterruptHandlerFn = (props: InterruptHandlerProps) => TResult | PromiseLike; type InterruptResultFromHandler = THandler extends ((...args: never[]) => infer TResult) ? TResult extends PromiseLike ? TResolved | null : TResult | null : null; type InterruptResult = InterruptResultFromHandler>; type InterruptRenderInChat = boolean | undefined; type UseInterruptReturn = TRenderInChat extends false ? React$1.ReactElement | null : TRenderInChat extends true | undefined ? void : React$1.ReactElement | null | void; /** Recognize thenables returned by interrupt preprocessing handlers. */ /** * Configuration options for `useInterrupt`. */ interface UseInterruptConfigBase { /** * Render function for the interrupt UI. * * Receives both the standard `interrupt`/`interrupts` and the legacy `event`. * Call `resolve(payload)` to resume with user input, or `cancel()` to cancel. */ render: (props: InterruptRenderProps>) => React$1.ReactElement; /** * Optional pre-render handler invoked when an interrupt is received. * Return a sync or async value to expose as `result` in `render`. * Rejecting/throwing falls back to `result = null`. */ handler?: InterruptHandlerFn; /** * Optional predicate to filter which interrupts this hook handles. * Receives the legacy-compatible event (for standard interrupts, `value` is * the primary `Interrupt`). Return `false` to ignore. */ enabled?: (event: InterruptEvent) => boolean; /** Optional agent id. Defaults to the current configured chat agent. */ agentId?: string; } type UseInterruptConfig = UseInterruptConfigBase & { /** When true (default), the interrupt UI renders inside `` automatically. */renderInChat?: TRenderInChat; }; /** * Handles agent interrupts with optional filtering, preprocessing, and resume behavior. * * Supports both the AG-UI standard interrupt flow (`RUN_FINISHED` with * `outcome.type === "interrupt"`) and the legacy custom-event flow * (`on_interrupt`). For standard interrupts, `render` receives `interrupt` * (the primary one) and `interrupts` (the full open set); call `resolve(payload)` * to resume or `cancel()` to cancel. Resuming addresses the targeted interrupt * and, once every open interrupt is addressed, submits a single spec `resume` * array via `copilotkit.runAgent`. * * - `renderInChat: true` (default): the element is published into ``; returns `void`. * - `renderInChat: false`: the hook returns the interrupt element for manual placement. * * @example * ```tsx * useInterrupt({ * render: ({ interrupt, resolve, cancel }) => ( *
*

{interrupt?.message}

* * *
* ), * }); * ``` */ declare function useInterrupt(config: UseInterruptConfig): UseInterruptReturn; //#endregion //#region src/v2/hooks/use-memories.d.ts /** * Return value of the {@link useMemories} hook. * * The `memories` array is the server-authoritative list for the current user. * It is hydrated from a REST snapshot and kept current by realtime * `memory_metadata` deltas from the store's own channel. Mutations resolve * once the platform confirms the operation and reject with an `Error` on * failure. */ interface UseMemoriesResult { /** * Memories for the current user, newest first. Updated in realtime when * the platform pushes `memory_metadata` events. */ memories: Memory[]; /** * `true` while the initial memory snapshot is being fetched. Subsequent * realtime updates do not re-enter the loading state. */ isLoading: boolean; /** * The most recent error from fetching memories or executing a mutation, or * `null` when there is no error. Cleared on the next fetch attempt, on a * successful fetch, when the runtime context changes, and on a successful * mutation (a failed mutation replaces it with that mutation's error). */ error: Error | null; /** * `true` when the platform memory routes are available. Set to `false` * after a 404 or 501, indicating memory is not supported by the current * runtime configuration. */ isAvailable: boolean; /** * Health of the realtime connection that streams live `memory_metadata` * deltas. Distinct from `isAvailable`/`error` (which describe the REST list * route): `"connecting"` while the socket opens/joins, `"connected"` once * live deltas are flowing, and `"unavailable"` once the socket permanently * gives up — at which point the list is a frozen snapshot. Lets the UI drop a * "live" indicator instead of showing it over stale data. */ realtimeStatus: MemoryRealtimeStatus; /** * Re-fetch the memory snapshot from the platform. Resolves once the re-pull * settles; rejects if it fails or the store is torn down mid-flight. */ refresh: () => Promise; /** * Create a memory. Resolves to the stored memory (server-authoritative); * rejects on failure. */ addMemory: (input: NewMemory) => Promise; /** * Supersede a memory: the old memory is retired and a new one is created. * Resolves to the new memory (its `id` differs from `id`); rejects on * failure. * * Supersede is a FULL replacement, not a partial patch: `changes` is the * complete definition of the new memory. You must re-supply `content` and * `kind`, and an omitted `sourceThreadIds` resets the new memory's source * threads to empty — it does not preserve the prior memory's value. */ updateMemory: (id: string, changes: MemoryChanges) => Promise; /** * Retire a memory (non-lossy delete). Resolves when the server confirms; * rejects on failure. */ removeMemory: (id: string) => Promise; } /** * React hook for listing and managing platform memories. * * Reads the memory store owned and wired by `CopilotKitCore`. On mount the * hook exposes the live list plus stable `addMemory` / `updateMemory` / * `removeMemory` / `refresh` callbacks. Mutations are server-authoritative: * each resolves once the platform confirms the operation and rejects with an * `Error` on failure. * * Realtime updates are automatic: the core's memory store opens its own * `user_meta:memories:` channel and applies `memory_metadata` deltas * to the list. You can still call `refresh()` to re-pull the REST snapshot on * demand. * * @returns Memory list state and stable mutation callbacks. * * @example * ```tsx * import { useMemories } from "@copilotkit/react-core"; * * function MemoryList() { * const { memories, isLoading, isAvailable, addMemory, removeMemory } = * useMemories(); * * if (!isAvailable) return null; * if (isLoading) return

Loading…

; * * return ( *
    * {memories.map((m) => ( *
  • * {m.content} * *
  • * ))} *
* ); * } * ``` */ declare function useMemories(): UseMemoriesResult; //#endregion //#region src/v2/hooks/use-learn-from-user-action.d.ts /** * Input to {@link UseLearnFromUserActionRecorder}, the function returned * by {@link useLearnFromUserAction}. Captures a single UI interaction that * CopilotKit Intelligence's auto-curated knowledge base loop will distill * into the team's `/project` notes. */ interface LearnFromUserActionInput { /** Thread the action is associated with. May be unknown to the platform. */ threadId: string; /** Short, agent-readable summary of what the user did. Optional. */ title?: string | null; /** Optional longer explanation. */ description?: string | null; /** Free-form, JSON-serializable snapshot describing the action. Optional. */ data?: unknown; /** ISO-8601 client-asserted timestamp. Defaults to server NOW() when absent. */ occurredAt?: string; /** * Caller-supplied idempotency key. When omitted, `recordAnnotation` generates a * fresh UUID per call so retries collapse to the original row at the * platform. Supply your own to keep a single semantic event idempotent * across calls (e.g. a React re-render or a manual retry button). */ clientEventId?: string; } /** Outcome returned by the recorder function. */ interface LearnFromUserActionResult { /** Platform-assigned id of the user-action row. */ id: string; /** True when the platform recognized this `clientEventId` as a retry. */ duplicate: boolean; } /** Recorder function returned by {@link useLearnFromUserAction}. */ type UseLearnFromUserActionRecorder = (input: LearnFromUserActionInput) => Promise; /** * Record a user UI interaction in CopilotKit Intelligence's user-actions * stream. The platform's auto-curated knowledge base agent reads these * (alongside finished agent runs) and writes free-form Obsidian-flavored * markdown to `/project`, where any agent in the same project can later * read it via the `copilotkit_knowledge_base_shell` MCP tool. * * The hook returns a stable function. Calling it issues a request to the * customer's CopilotKit runtime (`POST ${runtimeUrl}/annotate`), which * resolves the Intel user from the BFF's auth and forwards to the * platform — the Intel API key never reaches the browser. * * If `clientEventId` is omitted `recordAnnotation` generates a UUID per call, * so a naive double-call (e.g. React 18 strict-mode double-mount, or a retry * after a network blip on a fresh Promise) is naturally safe. Supply your * own key when a single semantic event must remain idempotent across * multiple `learnFromUserAction(...)` calls. * * @example * ```tsx * import { useLearnFromUserAction } from "@copilotkit/react-core"; * * function SettingsPage({ threadId }) { * const learnFromUserAction = useLearnFromUserAction(); * * const onRename = (oldName: string, newName: string) => { * void learnFromUserAction({ * threadId, * title: "Renamed project", * data: { previous: { name: oldName }, next: { name: newName } }, * }); * }; * } * ``` */ declare function useLearnFromUserAction(): UseLearnFromUserActionRecorder; //#endregion //#region src/v2/hooks/use-learn-from-user-action-in-current-thread.d.ts /** * Input to {@link UseLearnFromUserActionInCurrentThreadRecorder} — same as * {@link LearnFromUserActionInput} minus `threadId`, which is sourced from * the surrounding `` at call time. */ type LearnFromUserActionInCurrentThreadInput = Omit; /** Recorder function returned by {@link useLearnFromUserActionInCurrentThread}. */ type UseLearnFromUserActionInCurrentThreadRecorder = (input: LearnFromUserActionInCurrentThreadInput) => Promise; /** * Record a user UI interaction against the **current chat's** thread. The * `threadId` is sourced from the surrounding * `` (the same provider ``, * ``, and friends set up), so callers in a chat-aware * subtree don't need to thread an id through manually. * * Throws on **call** (not on mount) when there is no chat-config provider * in scope — matches the "throw on call when runtimeUrl is missing" * behavior of {@link useLearnFromUserAction}. Mounting the hook in a branch * that never fires is harmless. * * The recorder does NOT accept a `threadId` override. If you need to * record against an explicit thread, use {@link useLearnFromUserAction} * directly — two hooks, two crisp contracts, no mode confusion. * * This hook always uses `config.threadId`, regardless of whether the * surrounding chat config minted it internally or received one from * the caller. Auto-minted threads simply mean the action lands under * a thread the platform never saw — the writer agent still distills * user-action-only threads (it does not require the thread to exist * in `cpki.threads`), so the loop keeps learning. * * @example * ```tsx * import { useLearnFromUserActionInCurrentThread } from "@copilotkit/react-core"; * * function SettingsPanel() { * const learnFromUserAction = useLearnFromUserActionInCurrentThread(); * * const onRename = (oldName: string, newName: string) => { * void learnFromUserAction({ * title: "Renamed project", * data: { previous: { name: oldName }, next: { name: newName } }, * }); * }; * * // ... * } * ``` */ declare function useLearnFromUserActionInCurrentThread(): UseLearnFromUserActionInCurrentThreadRecorder; //#endregion //#region src/v2/hooks/use-attachments.d.ts interface UseAttachmentsProps { config?: AttachmentsConfig; } interface UseAttachmentsReturn { /** Currently selected attachments (uploading + ready). */ attachments: Attachment[]; /** Whether attachments are enabled. */ enabled: boolean; /** Whether the user is dragging a file over the drop zone. */ dragOver: boolean; /** Ref for the hidden file input element. */ fileInputRef: React$1.RefObject; /** Ref for the container element (used for scoped paste handling). */ containerRef: React$1.RefObject; /** Process an array of files (validate, upload, add to state). */ processFiles: (files: File[]) => Promise; /** Handler for ``. */ handleFileUpload: (e: React$1.ChangeEvent) => Promise; /** Handler for `onDragOver` on the drop zone. */ handleDragOver: (e: React$1.DragEvent) => void; /** Handler for `onDragLeave` on the drop zone. */ handleDragLeave: (e: React$1.DragEvent) => void; /** Handler for `onDrop` on the drop zone. */ handleDrop: (e: React$1.DragEvent) => Promise; /** Remove an attachment by ID. */ removeAttachment: (id: string) => void; /** * Consume ready attachments and clear the queue. * Returns the attachments that were ready; resets the file input. * No-ops if the queue is already empty (no state update triggered). */ consumeAttachments: () => Attachment[]; } /** * Hook that manages file attachment state — uploads, drag-and-drop, paste, * and lifecycle. All returned callbacks are referentially stable across * renders (via useCallback) to avoid destabilizing downstream memoization. */ declare function useAttachments({ config }: UseAttachmentsProps): UseAttachmentsReturn; //#endregion //#region src/v2/hooks/use-learning-containers.d.ts /** * Arguments for {@link useLearningContainers}. * * @deprecated This interface supports only the legacy plural-container * annotation. Configure `getLearningContainerId` on `CopilotKitIntelligence` * for new Intelligence runtimes. */ interface UseLearningContainersArgs { /** Thread to apply the learning-container selection to. */ threadId: string; /** * The ordered list of learning container identifiers to activate for this * thread. Defaults to `["project"]` on the backend when absent. */ learningContainers: readonly string[]; } /** * Legacy compatibility hook that keeps a thread's plural learning-container * annotation in sync by emitting * `set_learning_containers` annotations via the CopilotKit runtime annotate * endpoint (`POST ${runtimeUrl}/annotate`). * * **Emit rules:** * - On mount with `["project"]` (the backend default) → does NOT emit. * Absence of an annotation equals the default, so the round-trip is skipped. * - On mount with any other value → emits immediately. * - On any subsequent content change (including a switch back to * `["project"]`) → emits (a deliberate switch is always recorded). * - On unmount or threadId change → emits a reset to `["project"]` * so the backend is left in a clean state for the next consumer. * Changing `learningContainers` within the same thread does NOT reset the * thread; only the new value is emitted. * * Content-equality is evaluated via `JSON.stringify` so a fresh array literal * with the same items does NOT trigger a redundant emit. * * If `runtimeUrl` is absent, all emits are silently skipped. * * @example * ```tsx * function ThreadPane({ threadId, userScope }: Props) { * useLearningContainers({ * threadId, * learningContainers: [userScope], * }); * // ... * } * ``` * * @deprecated This hook supports only the legacy plural-container annotation. * Configure `getLearningContainerId` on `CopilotKitIntelligence` for new * Intelligence runtimes. */ declare function useLearningContainers({ threadId, learningContainers }: UseLearningContainersArgs): void; //#endregion //#region src/v2/hooks/use-learning-containers-in-current-thread.d.ts /** * Arguments for {@link useLearningContainersInCurrentThread}. * Same as {@link UseLearningContainersArgs} minus `threadId`, which is * sourced from the surrounding `` at * render time. * * @deprecated This type supports only the legacy plural-container annotation. * Configure `getLearningContainerId` on `CopilotKitIntelligence` for new * Intelligence runtimes. */ type UseLearningContainersInCurrentThreadArgs = Omit; /** * Legacy compatibility hook that keeps the **current chat thread's** plural * learning-container annotation in sync. The `threadId` is sourced from the surrounding * `` (the same provider ``, * ``, and friends set up), so callers in a chat-aware * subtree don't need to thread an id through manually. * * **Throws on render** when there is no chat-config provider in scope or * when the provider does not yet have an active `threadId`. Mount the hook * inside a subtree that is guaranteed to have a thread context. * * If you need to manage an explicit thread, use {@link useLearningContainers} * directly — two hooks, two crisp contracts, no mode confusion. * * @throws When no `CopilotChatConfigurationProvider` is in scope or when the * active `threadId` is absent/empty. * * @example * ```tsx * function ThreadPanel({ scope }: Props) { * useLearningContainersInCurrentThread({ * learningContainers: [scope], * }); * // ... * } * ``` * * @deprecated This hook supports only the legacy plural-container annotation. * Configure `getLearningContainerId` on `CopilotKitIntelligence` for new * Intelligence runtimes. */ declare function useLearningContainersInCurrentThread({ learningContainers }: UseLearningContainersInCurrentThreadArgs): void; //#endregion //#region src/v2/a2ui/A2UIRecoveryStates.d.ts /** * Shared pre-paint lifecycle states for the A2UI surface renderer (OSS-162). * * The A2UI middleware drives the WHOLE generative-UI lifecycle on a single * `a2ui-surface` activity (one stable messageId, `replace: true`), so the states * below swap IN PLACE and the painted surface ultimately replaces them: * * building → animated skeleton + "Building interface" (+ optional ~N tokens) * retrying → same skeleton; once perceptible, the sub-label becomes * "Retrying generation… (N/M attempts)" (threshold-gated so a fast * transient retry never flashes), with debug detail per debugExposure * failed → a clean hard-failure card (replacing the skeleton), developer * detail tucked into an expander gated by debugExposure * painted → the surface renderer owns the UI (these states render nothing) * * Timing (`showAfterMs` / `showAfterAttempts`) and how much debug detail to surface * (`debugExposure`) are client concerns; the server can override `debugExposure` * by stamping it onto the activity content (it wins over the client option). */ type A2UIRecoveryRendererOptions = { /** Delay (ms) before the "Retrying…" sub-label becomes visible. Default 2000. */showAfterMs?: number; /** Show the "Retrying…" sub-label immediately once `attempt` reaches this. Default 2. */ showAfterAttempts?: number; /** How much retry/debug detail to surface. Default "collapsed". */ debugExposure?: "hidden" | "collapsed" | "verbose"; }; //#endregion //#region src/v2/providers/CopilotKitProvider.d.ts interface CopilotKitProviderProps { children: ReactNode; runtimeUrl?: string; /** * Headers sent with every request. A record, or a sync or async builder * that runs when each request is sent. An inline arrow is fine. The builder * should be cheap; cache tokens in it (Clerk's `getToken()` already does). */ headers?: CopilotKitHeadersSource; /** * Credentials mode for fetch requests (e.g., "include" for HTTP-only cookies in cross-origin requests). */ credentials?: RequestCredentials; /** * Rewrites the message list sent to runtime agents on every run. * * CopilotKit sends the whole thread each time. When your agent already * stores the conversation, most of that payload is waste, and an agent that * merges the inbound list with its own store can show the model every turn * twice. Return the messages to send: * * ```tsx * messages.slice(-1)} * /> * ``` * * The filter changes the request body only. The transcript the UI renders is * untouched. Broken tool-call pairs are repaired before the request is sent, * so a filter this blunt cannot strand a tool result mid-HITL. * * Agents reached through your CopilotRuntime honor this. An agent your app * passes in directly does not, and neither Intelligence runs nor suggestion * runs are ever filtered. * * Prefer a stable reference (`useCallback`). An inline arrow re-registers the * filter on every render, which is harmless but needless. */ messageFilter?: CopilotKitMessageFilter; /** Your CopilotKit public license key. */ publicApiKey?: string; /** Your public license key for accessing CopilotKit Intelligence features. */ publicLicenseKey?: string; /** * Signed license token for offline verification of CopilotKit Intelligence features. * Obtain from https://dashboard.operations.copilotkit.ai. */ licenseToken?: string; properties?: Record; /** * The id of the agent every `` under this provider talks to, * unless a chat names its own with the `agentId` prop. * * This is the v2 replacement for the v1 `` prop. Set * it here and you never need the v1 compatibility provider just to name an * agent. Defaults to `"default"`. */ agentId?: string; useSingleEndpoint?: boolean; agents__unsafe_dev_only?: Record; selfManagedAgents?: Record; renderToolCalls?: ReactToolCallRenderer[]; renderActivityMessages?: ReactActivityMessageRenderer[]; renderCustomMessages?: ReactCustomMessageRenderer[]; frontendTools?: ReactFrontendTool[]; humanInTheLoop?: ReactHumanInTheLoop[]; /** * Configuration for OpenGenerativeUI — sandboxed UI generated by the LLM. * * @example * ```tsx * * ``` */ openGenerativeUI?: { /** * Functions made available inside sandboxed iframes. * Each function is described to the LLM via agent context and exposed * via websandbox's `localApi`. * * Inside the iframe, call them with: * ```js * await Websandbox.connection.remote.(args) * ``` */ sandboxFunctions?: SandboxFunction[]; /** * Design guidelines injected as agent context for the `generateSandboxedUi` tool. * Override this to control the visual style of generated UIs. * * A sensible default is provided if omitted. */ designSkill?: string; }; /** * @deprecated This prop no longer controls the Inspector. Use * `enableInspector` instead. */ showDevConsole?: boolean | "auto"; /** * Disable the CopilotKit Inspector in development. * The Inspector is enabled by default in development browser builds on * localhost/loopback. It is always disabled on remote hosts, in production, * and during server rendering. Temporary Inspector hides also hide its * message shortcuts. * An explicit value takes priority over CopilotChat's inspectorTools prop. */ enableInspector?: boolean; /** * Whether to automatically mount the Intelligence indicator in chat. * * @default true */ showIntelligenceIndicator?: boolean; /** * Error handler called when CopilotKit encounters an error. * Fires for all error types (runtime connection failures, agent errors, tool errors). */ onError?: (event: { error: Error; code: CopilotKitCoreErrorCode; context: Record; }) => void | Promise; /** * Configuration for the A2UI (Agent-to-UI) renderer. * The built-in A2UI renderer is activated automatically when the runtime reports * that `a2ui` is configured in `CopilotRuntime`. This prop is optional and only * needed if you want to override the default theme. * * @example * ```tsx * * {children} * * ``` */ a2ui?: { /** * Override the default A2UI viewer theme. * When omitted, the built-in `viewerTheme` from `@copilotkit/a2ui-renderer` is used. */ theme?: Theme; /** * Optional component catalog to pass to the A2UI renderer. * When omitted, the default basicCatalog is used. */ catalog?: any; /** * Optional custom loading component shown while an A2UI surface is generating. * When omitted, a default animated skeleton is shown. */ loadingComponent?: React$1.ComponentType; /** * When true (the default), the full component schemas from the catalog are * sent as agent context so the agent knows what components and props are * available. The A2UI middleware can overwrite this with a server-side * schema if configured. * * When false, the agent context still describes the catalog, but only by its * catalog ID and the names of its custom components, without their JSON * schemas. The component schema entry and the A2UI generation and design * guidelines are not sent. With the CopilotKit LangGraph middleware's * injected A2UI tool, the A2UI subagent then gets the component names only; * a host can still give it a composition guide through the middleware's * guidelines (`a2uiParams.guidelines.compositionGuide` in TypeScript, * `a2ui_params["guidelines"]["composition_guide"]` in Python). */ includeSchema?: boolean; /** * Options for the A2UI error-recovery status UI (OSS-162): how long before * the transient "Retrying…" hint appears, after how many attempts, and how * much retry/debug detail to surface. When omitted, sane defaults apply. */ recovery?: A2UIRecoveryRendererOptions; }; /** * Experimental. Native generative UI: `generativeUI={{ ui }}`, where `ui` * comes from `createGenerativeUI`. The agent renders your React components * into chat or into `` mounts. Props that match * the declared state and events that match the declared functions are * bound by the library, and the model does not see them. */ generativeUI?: GenerativeUIConfig; /** * Configuration for the built-in MCP Apps renderer. * * @example * ```tsx * * {children} * * ``` */ mcpApps?: { /** * Restore `allow-same-origin` on the MCP App sandbox. Default `false`. * * **Unsafe.** The widget then runs with your page's origin: it can read * your cookies, storage and DOM, and call your APIs as the signed-in user. * Only set it for widgets you wrote and trust that need `localStorage`, * `IndexedDB` or cookies. By default widgets get an opaque origin. */ allowSameOriginFallback?: boolean; /** * Let MCP Apps report their state to the model through * `ui/update-model-context`. Default `false`. * * **Security.** The reported state goes with every later run of the * conversation, and the built-in agent puts it in the system prompt. The * user does not see it. With this on, the widget of any MCP server your * agent uses can write there. Only enable it for MCP servers you trust. */ modelContext?: boolean; }; /** * Default throttle interval (in milliseconds) for `useAgent` re-renders * triggered by `OnMessagesChanged` notifications. This value is used as * a fallback when neither the `useAgent()` hook nor `` / * `` / `` specify an explicit `throttleMs`. * * @default undefined (components/hooks without an explicit throttleMs will be unthrottled) */ defaultThrottleMs?: number; /** * Enable debug logging for the client-side event pipeline. */ debug?: DebugConfig; /** * Turns on interaction capture (`@copilotkit/learning`). `learning` (short * for `learning={true}`) records with the default options; pass an object * for options. `false` or omitting the prop turns capture off and cancels * startup. Without a sink, Core authenticates with the runtime and sends * browser events to Intelligence; a custom sink keeps the standalone * collector behavior. Updated settings apply to the next Trajectory. * * Capture starts after mount. Set `trajectoryId` to use your own ID; * otherwise the provider generates one. The generated ID stays the same * across rerenders, reconnects and option changes; turning capture off, * setting `autoStart: false` or supplying a `trajectoryId` ends it, and the * next generated Trajectory gets a new ID. Read the active ID from * `copilotkit.trajectoryId`. * * Set `autoStart: false` to start capture yourself with `startTrajectory()`. * Capture stops on unmount, including manually started Trajectories. * * @example * */ learning?: boolean | LearningProp; } type LearningProp = LearningConfig & { /** * Starts a Trajectory after mount. Defaults to `true`; set `false` to call * `startTrajectory()` yourself. */ autoStart?: boolean; trajectoryId?: string; /** * Used only by explicit custom sinks. Authenticated capture warns and ignores * this option; assign Learning Spaces on the server with * `getTrajectoryLearningContainerIds` on `CopilotKitIntelligence`. */ learningContainerIds?: string[]; }; /** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */ declare const CopilotKitProvider: React$1.FC; //#endregion //#region src/v2/providers/SandboxFunctionsContext.d.ts declare const SandboxFunctionsContext: react.Context; declare function useSandboxFunctions(): readonly SandboxFunction[]; //#endregion //#region src/v2/lib/react-core.d.ts interface CopilotKitCoreReactConfig extends CopilotKitCoreConfig { renderToolCalls?: ReactToolCallRenderer[]; renderActivityMessages?: ReactActivityMessageRenderer[]; renderCustomMessages?: ReactCustomMessageRenderer[]; } interface CopilotKitCoreReactSubscriber extends CopilotKitCoreSubscriber { onRenderToolCallsChanged?: (event: { copilotkit: CopilotKitCore; renderToolCalls: ReactToolCallRenderer[]; }) => void | Promise; onInterruptElementChanged?: (event: { copilotkit: CopilotKitCore; interruptElement: React$1.ReactElement | null; }) => void | Promise; } declare class CopilotKitCoreReact$1 extends CopilotKitCore { private _renderToolCalls; private _hookRenderToolCalls; private _cachedMergedRenderToolCalls; private _renderCustomMessages; private _renderActivityMessages; private _interruptElement; constructor(config: CopilotKitCoreReactConfig); get renderCustomMessages(): Readonly; get renderActivityMessages(): Readonly>[]; get renderToolCalls(): Readonly>[]; setRenderActivityMessages(renderers: ReactActivityMessageRenderer[]): void; setRenderCustomMessages(renderers: ReactCustomMessageRenderer[]): void; setRenderToolCalls(renderToolCalls: ReactToolCallRenderer[]): void; addHookRenderToolCall(entry: ReactToolCallRenderer): void; removeHookRenderToolCall(name: string, agentId?: string): void; private _notifyRenderToolCallsChanged; get interruptElement(): React$1.ReactElement | null; setInterruptElement(element: React$1.ReactElement | null): void; subscribe(subscriber: CopilotKitCoreReactSubscriber): CopilotKitCoreSubscription; /** * Wait for pending React state updates before the follow-up agent run. * * When a frontend tool handler calls setState(), React 18 batches the update * and schedules a commit via its internal scheduler (MessageChannel). The * useAgentContext hook registers context via useLayoutEffect, which runs * synchronously after React commits that batch. * * Awaiting a zero-delay timeout yields to the macrotask queue. React's * MessageChannel task runs first, committing the pending state and running * useLayoutEffect (which updates the context store). The follow-up runAgent * call then reads fresh context. */ waitForPendingFrameworkUpdates(): Promise; } //#endregion //#region src/v2/a2ui/A2UIMessageRenderer.d.ts /** * User action with dataContextPath, as dispatched by A2UI components. */ type A2UIUserAction = { name: string; sourceComponentId: string; surfaceId: string; timestamp: string; context?: Record; dataContextPath?: string; /** Optional native action details retained when forwarding to the agent. */ catalogId?: string; userMessage?: string; metadata?: { extensions?: Record; }; }; /** * Intercept an A2UI user action before it reaches the agent. * * Called with the dispatched action and a `forward` helper that runs the agent * with the (optionally modified) action. The return value drives the default * forwarding: * - return `null` → the app handled it client-side (e.g. a `navigate` event); * the action is NOT forwarded to the agent. * - return an `A2UIUserAction` → that (possibly modified) action is forwarded. * - return `undefined` / `void` → the original action is forwarded unchanged. * * `forward` is provided for advanced cases where you want to do async work and * forward manually; if you call it yourself, return `null` to suppress the * default forward and avoid running the agent twice. */ type A2UIActionInterceptor = (action: A2UIUserAction, forward: (action?: A2UIUserAction) => Promise) => void | A2UIUserAction | null | Promise; type A2UIMessageRendererOptions = { theme: Theme; /** Optional component catalog to pass to A2UIProvider */ catalog?: any; /** Optional custom loading component shown while the A2UI surface is building. */ loadingComponent?: React.ComponentType; /** * Pre-paint recovery/loading UX options (OSS-162): timing before the * "Retrying…" sub-label appears + how much retry/debug detail to surface. */ recovery?: A2UIRecoveryRendererOptions; /** * Intercept actions before they reach the agent. Lets an app handle an action * client-side (e.g. `navigate`) instead of forwarding every action. See * {@link A2UIActionInterceptor}. */ onAction?: A2UIActionInterceptor; }; declare function createA2UIMessageRenderer(options: A2UIMessageRendererOptions): ReactActivityMessageRenderer; //#endregion //#region src/v1-deprecated/components/copilot-provider/copilotkit-props.d.ts /** * Props for CopilotKit. */ /** * We shouldn't need this `Omit` here, but using it because `CopilotKitProps` * and `CopilotKitProviderProps` have non-identical `children` types * * TODO: Remove this `Omit` once this is resolved. */ interface CopilotKitProps extends Omit { /** Your CopilotKit public license key. */ publicApiKey?: string; /** Your public license key for accessing CopilotKit Intelligence features. */ publicLicenseKey?: string; /** * Restrict input to a specific topic. * @deprecated Use `guardrails_c` instead to control input restrictions */ cloudRestrictToTopic?: { validTopics?: string[]; invalidTopics?: string[]; }; /** @internal Defunct — retained for backward compatibility. */ guardrails_c?: { validTopics?: string[]; invalidTopics?: string[]; }; /** * The endpoint for the Copilot Runtime instance. [Click here for more information](/backend/copilot-runtime). */ runtimeUrl?: 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. * Can be a static object, a synchronous builder, or an async builder * (useful for refreshing auth tokens). Whichever form you use, it is * evaluated when each request is sent, not when this component renders. * * For example: * ```tsx * // Static headers * headers={{ "Authorization": "Bearer X" }} * * // Synchronous builder, evaluated at send time * headers={() => ({ "Authorization": `Bearer ${getToken()}` })} * * // Async builder, evaluated (and awaited) at send time * headers={async () => ({ "Authorization": `Bearer ${await getToken()}` })} * ``` * * An async builder is only awaited on the request paths served by * ``'s v2 provider (agent runs, threads, the inspector, and * so on). The legacy v1 `CopilotTask` / GraphQL path (and anything else * that reads the internal `copilotApiConfig.headers` snapshot) never * awaits it: an async builder is called once, its result (and any * rejection) is discarded, and every read there gets an empty object * instead, with one console warning per provider instance in development. * * Cache inside the builder. Clerk's and Auth0's `getToken()` already * cache. A builder that calls the network every time adds one call per * request. * * If the builder throws or rejects, that request is not sent and * `onError` gets `header_resolution_failed`. * * Passing the same builder again, or a new builder function, does not * reload anything, because the provider keeps one stable wrapper. On a * user switch, remount the provider (for example `key={userId}`) so * thread lists and Inspector metadata reload for the new user. * * Core headers are also sent to any self-managed agent registered * directly with CopilotKit, including ones on other origins. Don't put a * bearer token in core headers if those agents point at a third party. */ headers?: CopilotKitHeadersSource; /** * The children to be rendered within the CopilotKit. */ children: ReactNode; /** * Custom properties to be sent with the request. * Can include threadMetadata for thread creation and authorization for LangGraph Platform authentication. * For example: * ```js * { * 'user_id': 'users_id', * 'authorization': 'your-auth-token', // For LangGraph Platform authentication * threadMetadata: { * 'account_id': '123', * 'user_type': 'premium' * } * } * ``` * * **Note**: The `authorization` property is automatically forwarded to LangGraph agents. See the [LangGraph Agent Authentication Guide](/auth) for details. */ properties?: Record; /** * Indicates whether the user agent should send or receive cookies from the other domain * in the case of cross-origin requests. * * To enable HTTP-only cookie authentication, set `credentials="include"` and configure * CORS on your runtime endpoint: * * ```tsx * // Frontend (https://myapp.com) * * {children} * * * // Backend (https://api.myapp.com) * copilotRuntimeNextJSAppRouterEndpoint({ * runtime, * endpoint: "/copilotkit", * cors: { * origin: "https://myapp.com", * credentials: true, * }, * }); * ``` */ credentials?: RequestCredentials; /** * Whether to show the dev console (error banners and toasts). * * @deprecated Use `enableInspector` to control the AG-UI inspector, * which is what most users want. `showDevConsole` only controls * error toasts/banners, not the inspector button. * Defaults to `false` for production safety. */ showDevConsole?: boolean; /** * The name of the agent to use. */ agent?: string; /** * The forwarded parameters to use for the task. */ forwardedParameters?: Pick; /** @internal Defunct — retained for backward compatibility. */ authConfig_c?: { SignInComponent: React.ComponentType<{ onSignInComplete: (authState: AuthState) => void; }>; }; /** * The thread id to use for the CopilotKit. */ threadId?: string; /** * Optional error handler for comprehensive debugging and observability. * * @param errorEvent - Structured error event with rich debugging context * * @example * ```typescript * { * debugDashboard.capture(errorEvent); * }} * > * ``` */ onError?: CopilotErrorHandler; /** * Enable or disable the CopilotKit Inspector, letting you inspect AG-UI events, * view agent messages, check agent state, and visualize agent context. The * Inspector is enabled by default in development browser builds and is always * disabled in production and during server rendering. */ enableInspector?: boolean; /** * Enable debug logging. On the server (`CopilotRuntime`), this enables * structured Pino logging of the AG-UI event pipeline. On the client, * this configuration is forwarded to the AG-UI transport layer * (`transformChunks`) for transport-level debug output. * * Pass `true` for full output, or an object for granular control: * * ```tsx * * {children} * * ``` */ debug?: DebugConfig; } //#endregion //#region src/v1-deprecated/components/copilot-provider/copilotkit.d.ts declare function CopilotKit({ children, ...props }: CopilotKitProps): react_jsx_runtime0.JSX.Element; declare const defaultCopilotContextCategories: string[]; //#endregion export { useRenderTool as $, InspectorViewThreadResultPayload as $a, SubscribeToAgentOptions as $c, ɵPhoenixJoinOutcome as $d, CoAgentStateRender as $f, DocumentInputContent as $i, ToolSchema as $l, CopilotChatConfigurationValue as $n, RawEventProps as $o, BackwardCompatibility_0_0_39 as $r, RunFinishedInterruptOutcomeSchema as $s, CopilotPopupView as $t, isInspectorThreadBridgeEnabled$1 as $u, UseAttachmentsReturn as A, HumanInTheLoopCapabilitiesSchema as Aa, StepStartedEventProps as Ac, ɵCOPILOTKIT_FEATURES as Ad, ɵobservePhoenixSocketSignals$ as Af, CopilotKitCoreRunToolResult as Ai, TokenUsage as Al, CopilotChatSuggestionView as An, MoveOperation as Ao, AddOperation as Ar, RemoveOperationSchema as As, MCPAppsActivityRenderer as At, createDebugLogger as Au, useMemories as B, InputContent as Ba, SubagentFinishedOutcome as Bc, ɵInterruptState$1 as Bd, ɵselectMemoriesIsLoading$1 as Bf, CopyOperationSchema as Bi, ToolCallEndEvent as Bl, CopilotChatFeedbackMessage as Bn, NonDispatchingEffect as Bo, AgentThreadLockedError as Br, RunAgentParameters as Bs, CopilotChatAttachmentRenderer as Bt, emitInspectorViewThreadResult$1 as Bu, MemoryScope as C, FunctionCall as Ca, StateSnapshotEventProps as Cc, structuredClone_ as Cd, ɵmemoryAdapterEvents as Cf, CopilotKitCoreFriendsAccess as Ci, TextMessageStartEvent as Cl, IntelligenceIndicatorProps as Cn, MessagesSnapshotEvent as Co, CatchAllActionRenderPropsWait as Cp, ActivityDeltaEventProps as Cr, ReasoningMessageStartEventProps as Cs, OpenGenerativeUIActivityRenderer as Ct, classifySurfaceCards as Cu, UseLearningContainersArgs as D, HttpAgentConfig as Da, StepFinishedEventProps as Dc, transformHttpEventStream as Dd, ɵobservePhoenixEvent$ as Df, CopilotKitCoreRegisterProxiedAgentResult as Di, TextPartSchema as Dl, IntelligenceIndicatorViewProps as Dn, MetadataSchema as Do, RenderFunctionStatus as Dp, ActivitySnapshotEvent as Dr, ReasoningStartEventSchema as Ds, OpenGenerativeUIToolRenderer as Dt, contentToText$1 as Du, useLearningContainersInCurrentThread as E, HttpAgent as Ea, StepFinishedEvent as Ec, transformChunks as Ed, ɵmemoryRestEvents as Ef, CopilotKitCoreRegisterProxiedAgentParams as Ei, TextPart as El, IntelligenceIndicatorView as En, Metadata as Eo, FrontendActionAvailability as Ep, ActivityMessageSchema as Er, ReasoningStartEventProps as Es, OpenGenerativeUIContentSchema as Et, contentHasMedia as Eu, LearnFromUserActionInput as F, ImageInputContentSchema as Fa, SubagentErrorEventProps as Fc, ɵGenerativeUIDebugSnapshot as Fd, ɵselectIsFetchingNextPage$1 as Ff, CopilotKitHeaderResolutionError as Fi, ToolCallArgsEventProps as Fl, CopilotChatReasoningMessageProps as Fn, MultimodalCapabilitiesSchema as Fo, AgentDebugConfig as Fr, ResumeStatus as Fs, CopilotKitInspectorProps as Ft, createStore as Fu, AgentContextInput as G, InputContentSource$1 as Ga, SubagentFinishedSuspendedOutcomeSchema as Gc, ɵMemoryRuntimeContext as Gd, ɵselectThreadsIsLoading$1 as Gf, DataSource as Gi, ToolCallResultEventSchema as Gl, CopilotChatToolCallGroupProps as Gn, OutputCapabilitiesSchema as Go, Attributable as Gr, RunErrorEventSchema as Gs, Thread as Gt, extractCompleteArrayItems as Gu, useInterrupt as H, InputContentDataSourceSchema as Ha, SubagentFinishedSuccessOutcome as Hc, ɵMAX_SOCKET_RETRIES as Hd, ɵselectMemoriesRealtimeStatus$1 as Hf, CustomEventProps as Hi, ToolCallEndEventSchema as Hl, CopilotChatToolCallsViewProps as Hn, OpenThreadRegistration as Ho, ApplyEventsOptions as Hr, RunCompletionAware as Hs, CopilotThreadsDrawer as Ht, enforceEvents as Hu, LearnFromUserActionResult as I, ImageInputPart as Ia, SubagentErrorEventSchema as Ic, ɵGenerativeUIDebugSource as Id, ɵselectIsMutating$1 as If, CopilotKitHeadersSource$1 as Ii, ToolCallArgsEventSchema as Il, CopilotChatUserMessage as In, MultimodalInputCapabilities as Io, AgentRegistry as Ir, Role$1 as Is, WildcardToolCallRender as It, defaultApplyEvents as Iu, useCapabilities as J, InputContentUrlSourceSchema as Ja, SubagentRunId as Jc, ɵPendingInterrupt as Jd, CoagentInChatRenderFunction as Jf, DebugLoggerInput as Ji, ToolCallStartEventProps as Jl, CopilotChatInput as Jn, PartSourceSchema as Jo, AudioInputContentSchema as Jr, RunFinishedCancelledOutcomeSchema as Js, useThreads as Jt, flattenInformationalCards as Ju, JsonSerializable as K, InputContentSourceSchema as Ka, SubagentInfo as Kc, ɵMemoryState as Kd, ɵthreadAdapterEvents as Kf, DataSourceSchema as Ki, ToolCallSchema as Kl, CopilotChatToolCallDisplay as Kn, PROTOCOL_VERSION as Ko, AttributableSchema as Kr, RunErrorPhase as Ks, UseThreadsInput as Kt, extractFenceOperations as Ku, UseLearnFromUserActionRecorder as L, ImageInputPartSchema as La, SubagentFinishedEvent as Lc, ɵGenerativeUIDebugSurface as Ld, ɵselectMemories$1 as Lf, CopilotKitMessageFilter$1 as Li, ToolCallChunkEvent as Ll, CopilotChatUserMessageProps as Ln, MultimodalInputCapabilitiesSchema as Lo, AgentStateMutation as Lr, RoleSchema as Ls, Attachment$1 as Lt, emitInspectorActiveThread$1 as Lu, LearnFromUserActionInCurrentThreadInput as M, IdentityCapabilities as Ma, Store as Mc, ɵGenerativeUIDebugFunction as Md, ɵphoenixSocket$ as Mf, CopilotKitCoreStopAgentParams as Mi, Tool as Ml, CopilotChatSuggestionPill as Mn, MultiAgentCapabilities as Mo, AgentCapabilities$1 as Mr, ReplaceOperationSchema as Ms, ɵMcpFollowUpHost as Mt, createInspectorThreadRequestId as Mu, UseLearnFromUserActionInCurrentThreadRecorder as N, IdentityCapabilitiesSchema as Na, StoreLifecycleAction as Nc, ɵGenerativeUIDebugPromptSection as Nd, ɵselectFetchMoreError$1 as Nf, CopilotKitCoreSubscriber$1 as Ni, ToolCall$1 as Nl, CopilotChatSuggestionPillProps as Nn, MultiAgentCapabilitiesSchema as No, AgentCapabilitiesSchema as Nr, ResolvedAgentDebugConfig as Ns, ɵrunMcpFollowUp as Nt, createReducer as Nu, useLearningContainers as O, HttpAgentFetchFn as Oa, StepFinishedEventSchema as Oc, verifyEvents as Od, ɵobservePhoenixJoinOutcome$ as Of, CopilotKitCoreRunAgentParams as Oi, ThreadEndpointRuntimeInfo as Ol, CopilotChatWorkSummary as On, Middleware as Oo, ActivitySnapshotEventProps as Or, Reducer as Os, MCPAppsActivityContent$1 as Ot, convertToLegacyEvents as Ou, useLearnFromUserActionInCurrentThread as P, ImageInputContent as Pa, SubagentErrorEvent as Pc, ɵGenerativeUIDebugRun as Pd, ɵselectHasNextPage$1 as Pf, CopilotKitCoreSubscription$1 as Pi, ToolCallArgsEvent as Pl, CopilotChatReasoningMessage as Pn, MultimodalCapabilities as Po, AgentConfig as Pr, ResumeEntrySchema as Ps, CopilotKitInspector as Pt, createSelector as Pu, useDefaultRenderTool as Q, InspectorViewThreadPayload as Qa, SubagentStartedEventSchema as Qc, ɵPhoenixChannelSession as Qd, useCopilotContext as Qf, DispatchingEffectOptions as Qi, ToolMessageSchema as Ql, CopilotChatConfigurationProviderProps as Qn, RawEvent as Qo, AudioPartSchema as Qr, RunFinishedInterruptOutcome as Qs, CopilotSidebarProps as Qt, isAbortError as Qu, useLearnFromUserAction as R, ImagePart as Ra, SubagentFinishedEventProps as Rc, ɵInterruptDecision as Rd, ɵselectMemoriesAvailable$1 as Rf, CopilotRuntimeTransport as Ri, ToolCallChunkEventProps as Rl, CopilotChatAssistantMessage as Rn, MultimodalOutputCapabilities as Ro, AgentSubscriber as Rr, RunAgentInput as Rs, AttachmentModality as Rt, emitInspectorStopViewing as Ru, MemoryKind as S, FrontendToolReconnectBehavior as Sa, StateSnapshotEvent as Sc, splitA2UIMarkdown$1 as Sd, ɵmapMemoryMetadataEvent as Sf, CopilotKitCoreErrorCode$1 as Si, TextMessageRoleSchema as Sl, IntelligenceIndicator as Sn, MessageSchema as So, CatchAllActionRenderProps as Sp, ActivityDeltaEvent as Sr, ReasoningMessageStartEvent as Ss, GenerateSandboxedUiArgsSchema as St, buildResumeArray as Su, UseLearningContainersInCurrentThreadArgs as T, FunctionMiddleware as Ta, StaticSuggestionsConfig$1 as Tc, tokenUsageFromLangChainMetadata as Td, ɵmemoryReducer as Tf, CopilotKitCoreGetToolParams as Ti, TextMessageStartEventSchema as Tl, IntelligenceIndicatorStatus as Tn, MessagesSnapshotEventSchema as To, FrontendAction as Tp, ActivityMessage$1 as Tr, ReasoningStartEvent as Ts, OpenGenerativeUIContent as Tt, completePartialMarkdown as Tu, useConfigureSuggestions as U, InputContentPart as Ua, SubagentFinishedSuccessOutcomeSchema as Uc, ɵMemoryEnvironment as Ud, ɵselectThreads$1 as Uf, CustomEventSchema as Ui, ToolCallResultEvent as Ul, CopilotChatToolCallGroup as Un, OptionalMetadataSchema as Uo, AssistantMessage$1 as Ur, RunErrorEvent as Us, CopilotThreadsDrawerProps as Ut, enforceOutgoingInput as Uu, UseInterruptConfig as V, InputContentDataSource as Va, SubagentFinishedOutcomeSchema as Vc, ɵInterruptToolResult as Vd, ɵselectMemoriesIsMutating as Vf, CustomEvent as Vi, ToolCallEndEventProps as Vl, CopilotChatToolCallsView as Vn, NonDispatchingEffectOptions as Vo, AnyAction as Vr, RunAgentResult$1 as Vs, CopilotChatAttachmentQueue as Vt, empty as Vu, useSuggestions as W, InputContentSchema as Wa, SubagentFinishedSuspendedOutcome as Wc, ɵMemoryMetadataEvent as Wd, ɵselectThreadsError$1 as Wf, DEFAULT_MAX_ENFORCED_ENTRIES as Wi, ToolCallResultEventProps as Wl, CopilotChatToolCallGroupAppearance as Wn, OutputCapabilities as Wo, AssistantMessageSchema as Wr, RunErrorEventProps as Ws, CopilotThreadsDrawerRowRenderer as Wt, ensureObjectArgs as Wu, useAgent as X, InspectorMetadataV1 as Xa, SubagentStartedEvent as Xc, ɵPhoenixChannelOptions as Xd, CopilotContext as Xf, DeveloperMessageSchema as Xi, ToolCallStatus$1 as Xl, ToolsMenuItem as Xn, ProxiedCopilotRuntimeAgent$1 as Xo, AudioInputPartSchema as Xr, RunFinishedEventProps as Xs, CopilotPopupProps as Xt, getRunOutcome as Xu, UseAgentUpdate as Y, InspectorActiveThreadPayload as Ya, SubagentRunIdSchema as Yc, ɵPhoenixChannelLike as Yd, CopilotApiConfig as Yf, DeveloperMessage as Yi, ToolCallStartEventSchema as Yl, CopilotChatInputProps as Yn, PropsActionConfig as Yo, AudioInputPart as Yr, RunFinishedEvent as Ys, CopilotPopup as Yt, getMarkdownOperationSurfaceId as Yu, useHumanInTheLoop as Z, InspectorStopViewingPayload as Za, SubagentStartedEventProps as Zc, ɵPhoenixChannelParams as Zd, CopilotContextParams as Zf, DispatchingEffect as Zi, ToolMessage$1 as Zl, CopilotChatConfigurationProvider as Zn, ProxiedCopilotRuntimeAgentConfig as Zo, AudioPart as Zr, RunFinishedEventSchema as Zs, CopilotSidebar as Zt, getWebMCPModelContext as Zu, useCopilotKit as _, FileSource as _a, StateDeltaEvent as _c, resolveAgentDebugConfig as _d, ɵgetAgentInterruptState$1 as _f, CopilotKitCoreAddAgentParams as _i, TextMessageContentEventSchema as _l, MessageGroupWrapperProps as _n, MemoryErrorCategory as _o, TreeNode as _p, ActionCreator as _r, ReasoningMessageContentEventSchema as _s, ReactCustomMessageRenderer as _t, WebMCPRegistry as _u, A2UIMessageRendererOptions as a, DynamicSuggestionsConfig$1 as aa, RunStartedEvent as ac, omitOptionalNulls as ad, ɵRUNTIME_PROBE_TIMEOUT_MS as af, BaseEventSchema as ai, SurfaceSegment as al, CopilotChatToggleButton as an, JsonPatch as ao, LangGraphInterruptRenderProps as ap, A2UIMarkdownOperation as ar, ReasoningEncryptedValueEventSchema as as, INTERRUPT_EVENT_NAME as at, UnrecognizedEvent as au, Memory$1 as b, FrontendTool$1 as ba, StateManager as bc, segmentSurfaceProse as bd, ɵisRetryableMemoryStatus as bf, CopilotKitCoreConnectAgentParams as bi, TextMessageEndEventSchema as bl, messageRow as bn, MemoryRealtimeStatus$1 as bo, ActionRenderPropsNoArgsWait as bp, ActionGroupConfig as br, ReasoningMessageEndEventSchema as bs, ReactToolCallRenderer as bt, aggregateTokenUsage as bu, CopilotKitCoreReact$1 as c, EnforcementOptions as ca, RuntimeLicenseStatus as cc, onInspectorStopViewing$1 as cd, ɵThreadEnvironment as cf, ChildIdsOf as ci, TestOperation as cl, DefaultOpenIcon as cn, JsonPatchSchema as co, CrewsResponse as cp, AGUIConnectNotImplementedError$1 as cr, ReasoningEndEvent as cs, InterruptEvent as ct, UserMessage$1 as cu, InspectorAnchor as d, EventSchema as da, ScopedProperties as dc, parseProtoStream as dd, ɵThreadSelectors as df, ContentPart as di, TextInputContentSchema as dl, CopilotChatView as dn, JsonValue as do, CrewsTaskStateItem as dp, AGUIEvent as dr, ReasoningMessage$1 as ds, InterruptResolveFn as dt, VideoInputContentSchema as du, DocumentInputContentSchema as ea, RunFinishedOutcome as ec, isInterruptExpired as ed, ɵPhoenixPushLike as ef, BackwardCompatibility_0_0_45 as ei, SubscribeToAgentSubscriber as el, CopilotPopupViewProps as en, IntelligenceAgent as eo, LangGraphInterruptAction as ep, CopilotChatLabels as er, RawEventSchema as es, useComponent as et, ToolsCapabilities as eu, SandboxFunctionsContext as f, EventSchemas as fa, Selector as fc, parseSSEStream as fd, ɵThreadStore as ff, ContentPartSchema as fi, TextMessageChunkEvent as fl, CopilotChatViewProps as fn, LearningConfig$1 as fo, CrewsToolStateItem as fp, AGUIEventByType as fr, ReasoningMessageChunkEvent as fs, ResumeEntry as ft, VideoInputPart as fu, CopilotKitProviderProps as g, ExecutionCapabilitiesSchema as ga, StateCapabilitiesSchema as gc, randomUUID$2 as gd, ɵcreateThreadStore$1 as gf, CopilotKitCore$1 as gi, TextMessageContentEventProps as gl, MessageGroup as gn, MemoryError as go, Tree as gp, ActionConfig as gr, ReasoningMessageContentEventProps as gs, useRenderCustomMessages as gt, WebMCPModelContext as gu, CopilotKitProvider as h, ExecutionCapabilities as ha, StateCapabilities as hc, props as hd, ɵcreateThreadSelectors as hf, ContextStore as hi, TextMessageContentEvent as hl, CopilotChatMessageViewProps as hn, MarkdownSegment as ho, DocumentPointer as hp, AbstractAgent$1 as hr, ReasoningMessageContentEvent as hs, ReactFrontendTool as ht, VideoPartSchema as hu, A2UIActionInterceptor as i, DocumentPartSchema as ia, RunHandler as ic, ofType as id, ɵPhoenixSocketSignal as if, BaseEventProps as ii, SuggestionsConfig as il, CopilotModalHeaderProps as in, InterruptSchema as io, LangGraphInterruptRenderHandlerProps as ip, CopilotChatAudioRecorder as ir, ReasoningEncryptedValueEventProps as is, SandboxFunction as it, TransportCapabilitiesSchema as iu, useAttachments as j, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as ja, StepStartedEventSchema as jc, ɵCopilotKitFeature as jd, ɵphoenixChannel$ as jf, CopilotKitCoreRuntimeConnectionStatus$1 as ji, TokenUsageSchema as jl, CopilotChatSuggestionViewProps as jn, MoveOperationSchema as jo, AddOperationSchema as jr, ReplaceOperation as js, MCPAppsActivityType as jt, createEffect as ju, UseAttachmentsProps as k, HumanInTheLoopCapabilities as ka, StepStartedEvent as kc, withAuthoritativeActivityTypes as kd, ɵobservePhoenixSocketHealth$ as kf, CopilotKitCoreRunToolParams as ki, ThreadRunActivityNotification as kl, CopilotChatWorkSummaryProps as kn, MiddlewareFunction as ko, ActivitySnapshotEventSchema as kr, RemoveOperation as ks, MCPAppsActivityContentSchema as kt, createActionGroup as ku, CopilotKitCoreReactConfig as l, Event as la, RuntimeMode as lc, onInspectorViewThread$1 as ld, ɵThreadMetadataEvent as lf, ChildWalkOptions as li, TestOperationSchema as ll, CopilotChat as ln, JsonPointer as lo, CrewsResponseStatus as lp, AGUIEnforcementLimitError as lr, ReasoningEndEventProps as ls, InterruptHandlerProps as lt, UserMessageSchema as lu, CopilotKitContextValue as m, EventTypeSchema as ma, State as mc, prepareSurfaceOperations as md, ɵcreateMemoryStore as mf, ContextSchema as mi, TextMessageChunkEventSchema as ml, CopilotChatMessageView as mn, MEMORY_ERROR_REGISTRY as mo, SystemMessageFunction as mp, AGUI_METADATA_KEY as mr, ReasoningMessageChunkEventSchema as ms, ReactHumanInTheLoop as mt, VideoPart as mu, defaultCopilotContextCategories as n, DocumentInputPartSchema as na, RunFinishedSuccessOutcome as nc, isRunCompletionAware$1 as nd, ɵPhoenixSocketOptions as nf, BaseEvent as ni, SuggestionAvailability as nl, CopilotSidebarViewProps as nn, IntelligenceReplayFailedError as no, LangGraphInterruptActionSetterArgs as np, AudioRecorderError as nr, ReasoningCapabilitiesSchema as ns, useFrontendTool as nt, TrajectoryStartOptions as nu, A2UIUserAction as o, Effect as oa, RunStartedEventProps as oc, on as od, ɵTHREAD_REQUEST_TIMEOUT_MS as of, BaseMessage as oi, SystemMessage as ol, CopilotChatToggleButtonProps as on, JsonPatchOperation as oo, QueuedInterruptEvent as op, A2UI_FENCE_LANGUAGE as or, ReasoningEncryptedValueSubtype as os, Interrupt as ot, UrlSource as ou, useSandboxFunctions as p, EventType as pa, StartResult as pc, parseToolArguments as pd, ɵclearAgentInterruptState$1 as pf, Context as pi, TextMessageChunkEventProps as pl, AutoScrollMode as pn, LegacyLearningConfig as po, CopilotChatSuggestionConfiguration as pp, AGUIEventOf as pr, ReasoningMessageChunkEventProps as ps, defineToolCallRenderer as pt, VideoInputPartSchema as pu, useAgentContext as q, InputContentUrlSource as qa, SubagentInfoSchema as qc, ɵMemoryStore as qd, ɵwithHeaderDefaults$1 as qf, DebugLogger as qi, ToolCallStartEvent as ql, ToolCallEntry as qn, PartSource as qo, AudioInputContent as qr, RunFinishedCancelledOutcome as qs, UseThreadsResult as qt, extractStringField as qu, CopilotKitProps as r, DocumentPart as ra, RunFinishedSuccessOutcomeSchema as rc, mergeMetadata as rd, ɵPhoenixSocketSession as rf, BaseEventFields as ri, SuggestionEngine as rl, CopilotModalHeader as rn, IntelligenceRuntimeInfo as ro, LangGraphInterruptRender as rp, AudioRecorderState as rr, ReasoningEncryptedValueEvent as rs, useRenderActivityMessage as rt, TransportCapabilities as ru, createA2UIMessageRenderer as s, EmptyActionConfig as sa, RunStartedEventSchema as sc, onInspectorActiveThread as sd, ɵThread as sf, BaseMessageSchema as si, SystemMessageSchema as sl, DefaultCloseIcon as sn, JsonPatchOperationSchema as so, CrewsAgentState as sp, ACTIVITY_HISTORY_METADATA as sr, ReasoningEncryptedValueSubtypeSchema as ss, InterruptCancelFn as st, UrlSourceSchema as su, CopilotKit as t, DocumentInputPart as ta, RunFinishedOutcomeSchema as tc, isRecognizedEvent as td, ɵPhoenixSocketLike as tf, BackwardCompatibility_0_0_57 as ti, Suggestion$1 as tl, CopilotSidebarView as tn, IntelligenceAgentConfig as to, LangGraphInterruptActionSetter as tp, useCopilotChatConfiguration as tr, ReasoningCapabilities as ts, useFrontendTools as tt, ToolsCapabilitiesSchema as tu, CopilotKitCoreReactSubscriber as u, EventPayloadOf as ua, ScopedContext as uc, onInspectorViewThreadResult as ud, ɵThreadRuntimeContext as uf, CompatibilityBoundary as ui, TextInputContent as ul, CopilotChatProps as un, JsonPointerSchema as uo, CrewsStateItem as up, AGUIError as ur, ReasoningEndEventSchema as us, InterruptRenderProps as ut, VideoInputContent as uu, useLicenseContext as v, FileSourceSchema as va, StateDeltaEventProps as vc, resolveDebugLogger as vd, ɵisCopilotKitFeature as vf, CopilotKitCoreCatalogComponent as vi, TextMessageEndEvent as vl, MessageRow as vn, MemoryErrorCode as vo, ActionRenderProps as vp, ActionFromCreator as vr, ReasoningMessageEndEvent as vs, ReactCustomMessageRendererPosition as vt, WebMCPToolAnnotations as vu, NewMemory$1 as w, FunctionCallSchema as wa, StateSnapshotEventSchema as wc, tokenUsageFromAiSdkUsage as wd, ɵmemoryDomainEvents as wf, CopilotKitCoreGetSuggestionsResult as wi, TextMessageStartEventProps as wl, getIntelligenceTurnAnchors as wn, MessagesSnapshotEventProps as wo, CatchAllFrontendAction as wp, ActivityDeltaEventSchema as wr, ReasoningMessageStartEventSchema as ws, OpenGenerativeUIActivityType as wt, compactEvents as wu, MemoryChanges$1 as x, FrontendToolHandlerContext as xa, StateSchema as xc, select as xd, ɵjoinPhoenixChannel$ as xf, CopilotKitCoreContinuationHandoff as xi, TextMessageRole as xl, INTELLIGENCE_TURN_HEAD as xn, Message$3 as xo, ActionRenderPropsWait as xp, ActionGroupResult as xr, ReasoningMessageSchema as xs, GenerateSandboxedUiArgs as xt, authoritativeActivityTypes as xu, A2UIRecoveryRendererOptions as y, FilterToolCallsMiddleware as ya, StateDeltaEventSchema as yc, runHttpRequest as yd, ɵisHttpAgent$1 as yf, CopilotKitCoreConfig$1 as yi, TextMessageEndEventProps as yl, messageGroup as yn, MemoryErrorRegistryEntry as yo, ActionRenderPropsNoArgs as yp, ActionFromCreators as yr, ReasoningMessageEndEventProps as ys, useRenderToolCall as yt, WebMCPToolConfig$1 as yu, UseMemoriesResult as z, ImagePartSchema as za, SubagentFinishedEventSchema as zc, ɵInterruptEvent as zd, ɵselectMemoriesError$1 as zf, CopyOperation as zi, ToolCallChunkEventSchema as zl, CopilotChatAssistantMessageProps as zn, MultimodalOutputCapabilitiesSchema as zo, AgentSubscriberParams as zr, RunAgentInputSchema as zs, AttachmentsConfig$1 as zt, emitInspectorViewThread as zu }; //# sourceMappingURL=copilotkit-CfnudBCL.d.mts.map