@copilotkit/react-core 1.83.0 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{runtime-context-CrHq-iTf.d.mts → MarkdownRendererContext-B4Us6mwL.d.cts} +127 -97
- package/dist/MarkdownRendererContext-B4Us6mwL.d.cts.map +1 -0
- package/dist/{runtime-context-D3NcP9oE.d.cts → MarkdownRendererContext-CRKFzsEB.d.mts} +127 -97
- package/dist/MarkdownRendererContext-CRKFzsEB.d.mts.map +1 -0
- package/dist/{MarkdownSurfaces-FF5za2kU.cjs → MarkdownSurfaces-C2XZISKn.cjs} +203 -55
- package/dist/MarkdownSurfaces-C2XZISKn.cjs.map +1 -0
- package/dist/{MarkdownSurfaces-DGpjmPaB.mjs → MarkdownSurfaces-ChSlVYOk.mjs} +171 -47
- package/dist/MarkdownSurfaces-ChSlVYOk.mjs.map +1 -0
- package/dist/{v2/context.cjs → context.cjs} +2 -2
- package/dist/context.cjs.map +1 -0
- package/dist/{v2/context.d.cts → context.d.cts} +5 -5
- package/dist/context.d.cts.map +1 -0
- package/dist/{v2/context.d.mts → context.d.mts} +5 -5
- package/dist/context.d.mts.map +1 -0
- package/dist/{v2/context.mjs → context.mjs} +2 -2
- package/dist/context.mjs.map +1 -0
- package/dist/{v2/generative-ui.cjs → generative-ui.cjs} +40 -43
- package/dist/generative-ui.cjs.map +1 -0
- package/dist/{v2/generative-ui.d.cts → generative-ui.d.cts} +14 -12
- package/dist/generative-ui.d.cts.map +1 -0
- package/dist/{v2/generative-ui.d.mts → generative-ui.d.mts} +14 -12
- package/dist/generative-ui.d.mts.map +1 -0
- package/dist/{v2/generative-ui.mjs → generative-ui.mjs} +40 -43
- package/dist/generative-ui.mjs.map +1 -0
- package/dist/{v2/headless.cjs → headless.cjs} +68 -53
- package/dist/headless.cjs.map +1 -0
- package/dist/{v2/headless.d.cts → headless.d.cts} +24 -23
- package/dist/headless.d.cts.map +1 -0
- package/dist/{v2/headless.d.mts → headless.d.mts} +21 -20
- package/dist/headless.d.mts.map +1 -0
- package/dist/{v2/headless.mjs → headless.mjs} +51 -36
- package/dist/headless.mjs.map +1 -0
- package/dist/index.cjs +15391 -1862
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.d.cts +3252 -1370
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3234 -1369
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +13733 -1815
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +11944 -5481
- package/dist/index.umd.js.map +1 -1
- package/package.json +21 -30
- package/dist/MarkdownSurfaces-DGpjmPaB.mjs.map +0 -1
- package/dist/MarkdownSurfaces-FF5za2kU.cjs.map +0 -1
- package/dist/copilotkit-BuIuo-Z1.cjs +0 -16531
- package/dist/copilotkit-BuIuo-Z1.cjs.map +0 -1
- package/dist/copilotkit-C765tOUi.d.mts +0 -4112
- package/dist/copilotkit-C765tOUi.d.mts.map +0 -1
- package/dist/copilotkit-DyxwF9wL.mjs +0 -16025
- package/dist/copilotkit-DyxwF9wL.mjs.map +0 -1
- package/dist/copilotkit-wqaNanhw.d.cts +0 -4129
- package/dist/copilotkit-wqaNanhw.d.cts.map +0 -1
- package/dist/runtime-context-CrHq-iTf.d.mts.map +0 -1
- package/dist/runtime-context-D3NcP9oE.d.cts.map +0 -1
- package/dist/v2/context.cjs.map +0 -1
- package/dist/v2/context.d.cts.map +0 -1
- package/dist/v2/context.d.mts.map +0 -1
- package/dist/v2/context.mjs.map +0 -1
- package/dist/v2/generative-ui.cjs.map +0 -1
- package/dist/v2/generative-ui.d.cts.map +0 -1
- package/dist/v2/generative-ui.d.mts.map +0 -1
- package/dist/v2/generative-ui.mjs.map +0 -1
- package/dist/v2/headless.cjs.map +0 -1
- package/dist/v2/headless.d.cts.map +0 -1
- package/dist/v2/headless.d.mts.map +0 -1
- package/dist/v2/headless.mjs.map +0 -1
- package/dist/v2/index.cjs +0 -1635
- package/dist/v2/index.css +0 -2
- package/dist/v2/index.d.cts +0 -4
- package/dist/v2/index.d.mts +0 -4
- package/dist/v2/index.mjs +0 -8
- package/dist/v2/index.umd.js +0 -20695
- package/dist/v2/index.umd.js.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,1568 +1,3433 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { a as useMarkdownRenderer, c as ReactActivityMessageRenderer, i as MarkdownRendererProvider, l as GenerativeUIConfig, n as MarkdownRenderer, r as MarkdownRendererProps, s as GenerativeUIChatSurfaceProps, t as DefaultMarkdownRendererProps } from "./MarkdownRendererContext-CRKFzsEB.mjs";
|
|
2
|
+
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, 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, IntelligenceRuntimeInfo, JsonValue, LearningConfig, LearningConfig as LearningConfig$1, LegacyLearningConfig, MEMORY_ERROR_REGISTRY, MarkdownSegment, MarkdownToken, MarkdownTokenList, 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, ParseMarkdownOptions, PropsActionConfig, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgentConfig, Reducer, RunCompletionAware, 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, Tokens, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, TrajectoryStartOptions, WebMCPModelContext, WebMCPRegistry, WebMCPToolAnnotations, WebMCPToolConfig, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations, extractStringField, flattenInformationalCards, getMarkdownOperationSurfaceId, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isRunCompletionAware, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorViewThread, onInspectorViewThreadResult, parseMarkdown, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown, ɵCOPILOTKIT_FEATURES, ɵCopilotKitFeature, ɵGenerativeUIDebugFunction, ɵGenerativeUIDebugPromptSection, ɵGenerativeUIDebugRun, ɵGenerativeUIDebugSnapshot, ɵGenerativeUIDebugSource, ɵGenerativeUIDebugSurface, ɵInterruptDecision, ɵInterruptEvent, ɵInterruptState, ɵInterruptToolResult, ɵMAX_SOCKET_RETRIES, ɵMemoryEnvironment, ɵMemoryMetadataEvent, ɵMemoryRuntimeContext, ɵMemoryState, ɵMemoryStore, ɵPendingInterrupt, ɵPhoenixChannelLike, ɵPhoenixChannelOptions, ɵPhoenixChannelSession, ɵPhoenixJoinOutcome, ɵPhoenixPushLike, ɵPhoenixSocketLike, ɵPhoenixSocketOptions, ɵPhoenixSocketSession, ɵPhoenixSocketSignal, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵThread, ɵThreadEnvironment, ɵThreadMetadataEvent, ɵThreadRuntimeContext, ɵThreadSelectors, ɵThreadStore, ɵclearAgentInterruptState, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵgetAgentInterruptState, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵthreadAdapterEvents, ɵwithHeaderDefaults } from "@copilotkit/core";
|
|
3
|
+
import { ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError, AGUIError, AGUIEvent, AGUIEventByType, AGUIEventOf, AGUI_METADATA_KEY, AbstractAgent, AbstractAgent as AbstractAgent$1, ActivityDeltaEvent, ActivityDeltaEventProps, ActivityMessage, ActivitySnapshotEvent, ActivitySnapshotEventProps, AddOperation, AgentCapabilities, AgentConfig, AgentDebugConfig, AgentStateMutation, AgentSubscriber, AgentSubscriberParams, AssistantMessage, 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, DataSource, DebugLogger, DebugLoggerInput, DeveloperMessage, DocumentInputContent, DocumentInputPart, DocumentPart, Event, EventPayloadOf, EventType, ExecutionCapabilities, FileSource, FilterToolCallsMiddleware, FunctionCall, FunctionMiddleware, HttpAgent, HttpAgentConfig, HttpAgentFetchFn, HumanInTheLoopCapabilities, IdentityCapabilities, ImageInputContent, ImageInputPart, ImagePart, InputContent, InputContentDataSource, InputContentPart, InputContentSource, InputContentUrlSource, Interrupt, JsonPatch, JsonPatchOperation, JsonPointer, Message, MessagesSnapshotEvent, MessagesSnapshotEventProps, Metadata, Middleware, MiddlewareFunction, MoveOperation, MultiAgentCapabilities, MultimodalCapabilities, MultimodalInputCapabilities, MultimodalOutputCapabilities, OutputCapabilities, PROTOCOL_VERSION, PartSource, RawEvent, RawEventProps, ReasoningCapabilities, ReasoningEncryptedValueEvent, ReasoningEncryptedValueEventProps, ReasoningEncryptedValueSubtype, ReasoningEndEvent, ReasoningEndEventProps, ReasoningMessage, ReasoningMessageChunkEvent, ReasoningMessageChunkEventProps, ReasoningMessageContentEvent, ReasoningMessageContentEventProps, ReasoningMessageEndEvent, ReasoningMessageEndEventProps, ReasoningMessageStartEvent, ReasoningMessageStartEventProps, ReasoningStartEvent, ReasoningStartEventProps, RemoveOperation, ReplaceOperation, ResolvedAgentDebugConfig, ResumeEntry, ResumeStatus, Role, 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, ToolCallArgsEvent, ToolCallArgsEventProps, ToolCallChunkEvent, ToolCallChunkEventProps, ToolCallEndEvent, ToolCallEndEventProps, ToolCallResultEvent, ToolCallResultEventProps, ToolCallStartEvent, ToolCallStartEventProps, ToolMessage, ToolsCapabilities, TransportCapabilities, UnrecognizedEvent, UrlSource, UserMessage, VideoInputContent, VideoInputPart, VideoPart, aggregateTokenUsage, authoritativeActivityTypes, buildResumeArray, compactEvents, contentHasMedia, contentToText, convertToLegacyEvents, createDebugLogger, defaultApplyEvents, enforceEvents, enforceOutgoingInput, getRunOutcome, isInterruptExpired, isRecognizedEvent, mergeMetadata, omitOptionalNulls, parseProtoStream, parseSSEStream, randomUUID, resolveAgentDebugConfig, resolveDebugLogger, runHttpRequest, structuredClone_, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata, transformChunks, transformHttpEventStream, verifyEvents, withAuthoritativeActivityTypes } from "@ag-ui/client";
|
|
4
|
+
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";
|
|
5
|
+
import * as react from "react";
|
|
6
|
+
import React$1, { ComponentType, ReactNode } from "react";
|
|
7
7
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { Attachment, Attachment as Attachment$1, AttachmentModality, AttachmentsConfig, AttachmentsConfig as AttachmentsConfig$1, DebugConfig, InferSchemaOutput, InputContentSource as InputContentSource$1, StandardSchemaV1 } from "@copilotkit/shared";
|
|
9
|
+
import { ActivityMessage as ActivityMessage$1, AgentCapabilities as AgentCapabilities$1, AssistantMessage as AssistantMessage$1, Message as Message$1, ReasoningMessage as ReasoningMessage$1, ToolCall as ToolCall$1, ToolMessage as ToolMessage$1, UserMessage as UserMessage$1 } from "@ag-ui/core";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { MCPAppsActivityContent, MCPAppsActivityContent as MCPAppsActivityContent$1, MCPAppsActivityContentSchema, MCPAppsActivityType, ɵMcpFollowUpHost, ɵrunMcpFollowUp } from "@copilotkit/mcp-apps-renderer/activity";
|
|
12
|
+
import { Theme, Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
|
|
13
|
+
import { Anchor as InspectorAnchor } from "@copilotkit/web-inspector";
|
|
14
|
+
import { CopilotKitContextValue, useCopilotKit, useLicenseContext } from "@copilotkit/react-core/context";
|
|
9
15
|
|
|
10
|
-
//#region src/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
declare
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
//#region src/components/chat/BasicMarkdownRenderer.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Dependency-light built-in markdown renderer (basic GFM). Walks the
|
|
19
|
+
* framework-agnostic token tree from `@copilotkit/core` into React elements.
|
|
20
|
+
* No syntax highlighting, no math, no table/image action buttons — plug in a
|
|
21
|
+
* custom renderer via `CopilotKitProvider markdownRenderer={...}` for those.
|
|
22
|
+
*/
|
|
23
|
+
declare function BasicMarkdownRenderer({
|
|
24
|
+
content,
|
|
25
|
+
className
|
|
26
|
+
}: MarkdownRendererProps): react_jsx_runtime0.JSX.Element | null;
|
|
27
|
+
declare namespace BasicMarkdownRenderer {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/chat/StreamingMarkdownDefaultRenderer.d.ts
|
|
32
|
+
/**
|
|
33
|
+
* react-core's built-in default markdown renderer — a thin adapter over
|
|
34
|
+
* `@copilotkit/markdown-renderer`'s streaming renderer. Maps the pluggable
|
|
35
|
+
* renderer contract (`{ content, isStreaming, className }`) onto the streaming
|
|
36
|
+
* renderer for streaming-safe incremental rendering + per-token animation.
|
|
37
|
+
* Still overridable via the slot/provider pluggable interface.
|
|
38
|
+
*/
|
|
39
|
+
declare function StreamingMarkdownDefaultRenderer({
|
|
40
|
+
content,
|
|
41
|
+
isStreaming,
|
|
42
|
+
className,
|
|
43
|
+
nodeRenderers,
|
|
44
|
+
caret,
|
|
45
|
+
options,
|
|
46
|
+
onLinkClick,
|
|
47
|
+
onCitationClick
|
|
48
|
+
}: MarkdownRendererProps & DefaultMarkdownRendererProps): react_jsx_runtime0.JSX.Element | null;
|
|
49
|
+
declare namespace StreamingMarkdownDefaultRenderer {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/chat/CopilotChatAudioRecorder.d.ts
|
|
54
|
+
/** Finite-state machine for every recorder implementation */
|
|
55
|
+
type AudioRecorderState = "idle" | "recording" | "processing";
|
|
56
|
+
/** Error subclass so callers can `instanceof`-guard recorder failures */
|
|
57
|
+
declare class AudioRecorderError extends Error {
|
|
58
|
+
constructor(message: string);
|
|
59
|
+
}
|
|
60
|
+
interface AudioRecorderRef {
|
|
61
|
+
state: AudioRecorderState;
|
|
62
|
+
start: () => Promise<void>;
|
|
63
|
+
stop: () => Promise<Blob>;
|
|
64
|
+
dispose: () => void;
|
|
65
|
+
}
|
|
66
|
+
declare const CopilotChatAudioRecorder: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<AudioRecorderRef>>;
|
|
42
67
|
//#endregion
|
|
43
|
-
//#region src/
|
|
44
|
-
|
|
68
|
+
//#region src/providers/CopilotChatConfigurationProvider.d.ts
|
|
69
|
+
declare const CopilotChatDefaultLabels: {
|
|
70
|
+
chatInputPlaceholder: string;
|
|
71
|
+
chatInputToolbarStartTranscribeButtonLabel: string;
|
|
72
|
+
chatInputToolbarCancelTranscribeButtonLabel: string;
|
|
73
|
+
chatInputToolbarFinishTranscribeButtonLabel: string;
|
|
74
|
+
chatInputToolbarAddButtonLabel: string;
|
|
75
|
+
chatInputToolbarToolsButtonLabel: string;
|
|
76
|
+
chatInputToolbarSendButtonLabel: string;
|
|
77
|
+
chatInputToolbarStopButtonLabel: string;
|
|
78
|
+
assistantMessageToolbarCopyCodeLabel: string;
|
|
79
|
+
assistantMessageToolbarCopyCodeCopiedLabel: string;
|
|
80
|
+
assistantMessageToolbarCopyMessageLabel: string;
|
|
81
|
+
assistantMessageToolbarInspectorLabel: string;
|
|
82
|
+
assistantMessageToolbarInspectorDescription: string;
|
|
83
|
+
assistantMessageToolbarInspectorLocalOnlyLabel: string;
|
|
84
|
+
assistantMessageToolbarInspectorLocalOnlyDescription: string;
|
|
85
|
+
assistantMessageToolbarInspectorTitle: string;
|
|
86
|
+
assistantMessageToolbarInspectorHideLabel: string;
|
|
87
|
+
assistantMessageToolbarInspectorHideDescription: string;
|
|
88
|
+
assistantMessageToolbarThumbsUpLabel: string;
|
|
89
|
+
assistantMessageToolbarThumbsDownLabel: string;
|
|
90
|
+
assistantMessageFeedbackCommentPlaceholder: string;
|
|
91
|
+
assistantMessageFeedbackCommentSubmitLabel: string;
|
|
92
|
+
assistantMessageToolbarReadAloudLabel: string;
|
|
93
|
+
assistantMessageToolbarRegenerateLabel: string;
|
|
94
|
+
userMessageToolbarCopyMessageLabel: string;
|
|
95
|
+
userMessageToolbarEditMessageLabel: string;
|
|
96
|
+
userMessageToolbarPreviousBranchLabel: string;
|
|
97
|
+
userMessageToolbarNextBranchLabel: string;
|
|
98
|
+
chatDisclaimerText: string;
|
|
99
|
+
chatToggleOpenLabel: string;
|
|
100
|
+
chatToggleCloseLabel: string;
|
|
101
|
+
chatScrollToBottomLabel: string;
|
|
102
|
+
modalHeaderTitle: string;
|
|
103
|
+
welcomeMessageText: string;
|
|
104
|
+
reasoningMessageThinkingLabel: string;
|
|
105
|
+
chatInputSlashMenuLabel: string;
|
|
106
|
+
chatInputSlashMenuEmptyText: string;
|
|
107
|
+
attachmentRemoveButtonLabel: string;
|
|
108
|
+
attachmentPlayVideoButtonLabel: string;
|
|
109
|
+
attachmentPreviewCloseButtonLabel: string;
|
|
110
|
+
modalHeaderCloseButtonLabel: string;
|
|
111
|
+
modalHeaderThreadsButtonLabel: string;
|
|
112
|
+
sidebarLabel: string;
|
|
113
|
+
};
|
|
114
|
+
type CopilotChatLabels = typeof CopilotChatDefaultLabels;
|
|
115
|
+
interface CopilotChatConfigurationValue {
|
|
116
|
+
labels: CopilotChatLabels;
|
|
117
|
+
agentId: string;
|
|
45
118
|
threadId: string;
|
|
46
|
-
|
|
47
|
-
|
|
119
|
+
isModalOpen: boolean;
|
|
120
|
+
setModalOpen: (open: boolean) => void;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the thread-list drawer is open. A sibling boolean to `isModalOpen`
|
|
123
|
+
* (deliberately NOT folded into a tri-state enum): on desktop the chat modal
|
|
124
|
+
* and the drawer coexist, so two independent booleans are required.
|
|
125
|
+
*/
|
|
126
|
+
drawerOpen: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Toggles the drawer open state. On mobile viewports (`<768px`) opening the
|
|
129
|
+
* drawer closes the chat modal (mutual exclusion); on desktop there is no
|
|
130
|
+
* constraint.
|
|
131
|
+
*/
|
|
132
|
+
setDrawerOpen: (open: boolean) => void;
|
|
133
|
+
/**
|
|
134
|
+
* True once a `<CopilotThreadsDrawer>` wrapper has registered itself with this chat
|
|
135
|
+
* configuration. The header thread-list launcher renders ONLY when this is
|
|
136
|
+
* set, so chats with no drawer stay byte-for-byte unchanged.
|
|
137
|
+
*/
|
|
138
|
+
drawerRegistered: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Called by the drawer wrapper on mount to announce its presence (and flip
|
|
141
|
+
* `drawerRegistered`). Returns a cleanup function that de-registers the
|
|
142
|
+
* drawer on unmount.
|
|
143
|
+
*
|
|
144
|
+
* @returns A cleanup callback that reverses the registration.
|
|
145
|
+
*/
|
|
146
|
+
registerDrawer: () => () => void;
|
|
147
|
+
/**
|
|
148
|
+
* Internal: registers the modal-close setter of the provider that actually
|
|
149
|
+
* owns the rendered modal (a descendant that supplied `isModalDefaultOpen`),
|
|
150
|
+
* so the drawer's mobile mutual-exclusion — owned by the top-most provider —
|
|
151
|
+
* closes the modal that is genuinely on screen rather than the top-most
|
|
152
|
+
* provider's own (possibly unrendered) modal state.
|
|
153
|
+
*
|
|
154
|
+
* @param closeModal - A setter the drawer may call to close the rendered modal.
|
|
155
|
+
* @returns A cleanup callback that de-registers the closer.
|
|
156
|
+
*/
|
|
157
|
+
ɵregisterModalCloser: (closeModal: (open: boolean) => void) => () => void;
|
|
158
|
+
hasExplicitThreadId: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Imperatively sets the active thread for this chat configuration.
|
|
161
|
+
*
|
|
162
|
+
* Use this to drive the rendered thread without a host callback — e.g. a
|
|
163
|
+
* `<CopilotThreadsDrawer>` selecting a thread row sets it explicitly so the chat
|
|
164
|
+
* connects to that backend thread.
|
|
165
|
+
*
|
|
166
|
+
* Guarded like the top-level `<CopilotKit>` provider's `setThreadId`: when
|
|
167
|
+
* the consumer controls the threadId via the `threadId` prop on this
|
|
168
|
+
* provider, this is a no-op (a warning is logged) so a prop-controlled
|
|
169
|
+
* threadId is never silently overridden.
|
|
170
|
+
*
|
|
171
|
+
* @param threadId - The thread id to make active.
|
|
172
|
+
* @param options.explicit - Whether the thread is a caller choice. Defaults
|
|
173
|
+
* to `true` (a picked thread). Pass `false` to set a non-explicit thread
|
|
174
|
+
* so the welcome screen shows (see {@link startNewThread}).
|
|
175
|
+
*/
|
|
176
|
+
setActiveThreadId: (threadId: string, options?: {
|
|
177
|
+
explicit?: boolean;
|
|
178
|
+
}) => void;
|
|
179
|
+
/**
|
|
180
|
+
* Resets the active thread to a fresh, non-explicit client-side thread: a
|
|
181
|
+
* newly minted UUID with `hasExplicitThreadId=false`, so the welcome screen
|
|
182
|
+
* shows. Pairs with the core `startNewThread()` to clear the conversation
|
|
183
|
+
* with no host wiring.
|
|
184
|
+
*
|
|
185
|
+
* Guarded identically to {@link setActiveThreadId}: a no-op when the
|
|
186
|
+
* threadId is prop-controlled.
|
|
187
|
+
*/
|
|
188
|
+
startNewThread: () => void;
|
|
48
189
|
}
|
|
49
|
-
|
|
50
|
-
interface ThreadsProviderProps {
|
|
190
|
+
interface CopilotChatConfigurationProviderProps {
|
|
51
191
|
children: ReactNode;
|
|
192
|
+
labels?: Partial<CopilotChatLabels>;
|
|
193
|
+
agentId?: string;
|
|
52
194
|
threadId?: string;
|
|
195
|
+
hasExplicitThreadId?: boolean;
|
|
196
|
+
isModalDefaultOpen?: boolean;
|
|
53
197
|
}
|
|
54
|
-
declare
|
|
55
|
-
|
|
56
|
-
threadId: explicitThreadId
|
|
57
|
-
}: ThreadsProviderProps): react_jsx_runtime0.JSX.Element;
|
|
58
|
-
declare function useThreads(): ThreadsContextValue;
|
|
198
|
+
declare const CopilotChatConfigurationProvider: React$1.FC<CopilotChatConfigurationProviderProps>;
|
|
199
|
+
declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue | null;
|
|
59
200
|
//#endregion
|
|
60
|
-
//#region src/
|
|
201
|
+
//#region src/lib/slots.d.ts
|
|
202
|
+
/** Existing union (unchanged) */
|
|
203
|
+
type SlotValue<C extends React$1.ComponentType<any>> = C | string | Partial<React$1.ComponentProps<C>>;
|
|
204
|
+
/** Utility: concrete React elements for every slot */
|
|
205
|
+
type SlotElements<S> = { [K in keyof S]: React$1.ReactElement };
|
|
206
|
+
type WithSlots<S extends Record<string, React$1.ComponentType<any>>, Rest = {}> = { [K in keyof S]?: SlotValue<S[K]> } & {
|
|
207
|
+
children?: (props: SlotElements<S> & Rest) => React$1.ReactNode;
|
|
208
|
+
} & Omit<Rest, "children">;
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/components/chat/CopilotChatInput.d.ts
|
|
211
|
+
type CopilotChatInputMode = "input" | "transcribe" | "processing";
|
|
212
|
+
type ToolsMenuItem = {
|
|
213
|
+
label: string;
|
|
214
|
+
} & ({
|
|
215
|
+
action: () => void;
|
|
216
|
+
items?: never;
|
|
217
|
+
} | {
|
|
218
|
+
action?: never;
|
|
219
|
+
items: (ToolsMenuItem | "-")[];
|
|
220
|
+
});
|
|
221
|
+
type CopilotChatInputSlots = {
|
|
222
|
+
textArea: typeof CopilotChatInput.TextArea;
|
|
223
|
+
sendButton: typeof CopilotChatInput.SendButton;
|
|
224
|
+
startTranscribeButton: typeof CopilotChatInput.StartTranscribeButton;
|
|
225
|
+
cancelTranscribeButton: typeof CopilotChatInput.CancelTranscribeButton;
|
|
226
|
+
finishTranscribeButton: typeof CopilotChatInput.FinishTranscribeButton;
|
|
227
|
+
addMenuButton: typeof CopilotChatInput.AddMenuButton;
|
|
228
|
+
audioRecorder: typeof CopilotChatAudioRecorder;
|
|
229
|
+
disclaimer: typeof CopilotChatInput.Disclaimer;
|
|
230
|
+
};
|
|
231
|
+
type CopilotChatInputRestProps = {
|
|
232
|
+
mode?: CopilotChatInputMode;
|
|
233
|
+
toolsMenu?: (ToolsMenuItem | "-")[];
|
|
234
|
+
autoFocus?: boolean;
|
|
235
|
+
onSubmitMessage?: (value: string) => void;
|
|
236
|
+
onStop?: () => void;
|
|
237
|
+
isRunning?: boolean;
|
|
238
|
+
onStartTranscribe?: () => void;
|
|
239
|
+
onCancelTranscribe?: () => void;
|
|
240
|
+
onFinishTranscribe?: () => void;
|
|
241
|
+
onFinishTranscribeWithAudio?: (audioBlob: Blob) => Promise<void>;
|
|
242
|
+
onAddFile?: () => void;
|
|
243
|
+
value?: string;
|
|
244
|
+
onChange?: (value: string) => void; /** Positioning mode for the input container. Default: 'static' */
|
|
245
|
+
positioning?: "static" | "absolute"; /** Keyboard height in pixels for mobile keyboard handling */
|
|
246
|
+
keyboardHeight?: number; /** Ref for the outer positioning container */
|
|
247
|
+
containerRef?: React$1.Ref<HTMLDivElement>; /** Whether to show the disclaimer. Default: true for absolute positioning, false for static */
|
|
248
|
+
showDisclaimer?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Set to `true` when the input sits at the bottom of its container as a
|
|
251
|
+
* flex-last-child (visible position is driven by layout, not CSS
|
|
252
|
+
* positioning). Triggers reservation of bottom space for the fixed
|
|
253
|
+
* CopilotKit license banner via the
|
|
254
|
+
* `--copilotkit-license-banner-offset` CSS var so the two don't overlap.
|
|
255
|
+
*
|
|
256
|
+
* Not needed when `positioning === "absolute"`; that mode already pins the
|
|
257
|
+
* input to the bottom and picks up the same reservation automatically.
|
|
258
|
+
* Leave unset (default `false`) for inputs rendered mid-layout such as the
|
|
259
|
+
* welcome screen, where the banner offset would push the input off-center.
|
|
260
|
+
*/
|
|
261
|
+
bottomAnchored?: boolean;
|
|
262
|
+
} & Omit<React$1.HTMLAttributes<HTMLDivElement>, "onChange">;
|
|
263
|
+
type CopilotChatInputBaseProps = WithSlots<CopilotChatInputSlots, CopilotChatInputRestProps>;
|
|
264
|
+
type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends {
|
|
265
|
+
children?: infer C;
|
|
266
|
+
} ? C extends ((props: infer P) => React$1.ReactNode) ? P : never : never;
|
|
267
|
+
type CopilotChatInputProps = Omit<CopilotChatInputBaseProps, "children"> & {
|
|
268
|
+
children?: (props: CopilotChatInputChildrenArgs) => React$1.ReactNode;
|
|
269
|
+
};
|
|
61
270
|
/**
|
|
62
|
-
* The
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* `manual` - Suggestions are controlled programmatically.
|
|
66
|
-
* `SuggestionItem[]` - Static suggestions array.
|
|
271
|
+
* The chat composer: a text area with the add-menu, voice and send/stop
|
|
272
|
+
* buttons, and a slash-command menu that lists `toolsMenu` items once the text
|
|
273
|
+
* starts with "/".
|
|
67
274
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
275
|
+
declare function CopilotChatInput({
|
|
276
|
+
mode,
|
|
277
|
+
onSubmitMessage,
|
|
278
|
+
onStop,
|
|
279
|
+
isRunning,
|
|
280
|
+
onStartTranscribe,
|
|
281
|
+
onCancelTranscribe,
|
|
282
|
+
onFinishTranscribe,
|
|
283
|
+
onFinishTranscribeWithAudio,
|
|
284
|
+
onAddFile,
|
|
285
|
+
onChange,
|
|
286
|
+
value,
|
|
287
|
+
toolsMenu,
|
|
288
|
+
autoFocus,
|
|
289
|
+
positioning,
|
|
290
|
+
keyboardHeight,
|
|
291
|
+
containerRef,
|
|
292
|
+
showDisclaimer,
|
|
293
|
+
bottomAnchored,
|
|
294
|
+
textArea,
|
|
295
|
+
sendButton,
|
|
296
|
+
startTranscribeButton,
|
|
297
|
+
cancelTranscribeButton,
|
|
298
|
+
finishTranscribeButton,
|
|
299
|
+
addMenuButton,
|
|
300
|
+
audioRecorder,
|
|
301
|
+
disclaimer,
|
|
302
|
+
children,
|
|
303
|
+
className,
|
|
304
|
+
...props
|
|
305
|
+
}: CopilotChatInputProps): react_jsx_runtime0.JSX.Element;
|
|
306
|
+
declare namespace CopilotChatInput {
|
|
70
307
|
/**
|
|
71
|
-
*
|
|
308
|
+
* The icon-only send button. Its accessible name is
|
|
309
|
+
* `labels.chatInputToolbarSendButtonLabel` unless an `aria-label` is passed;
|
|
310
|
+
* the input passes `labels.chatInputToolbarStopButtonLabel` while the button
|
|
311
|
+
* stops a run.
|
|
72
312
|
*/
|
|
73
|
-
|
|
313
|
+
const SendButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
74
314
|
/**
|
|
75
|
-
*
|
|
315
|
+
* An icon-only toolbar button. `labels[labelKey]` is both its accessible
|
|
316
|
+
* name and its tooltip text.
|
|
76
317
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
318
|
+
const ToolbarButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
319
|
+
icon: React$1.ReactNode;
|
|
320
|
+
labelKey: keyof CopilotChatLabels;
|
|
321
|
+
defaultClassName?: string;
|
|
322
|
+
}>;
|
|
323
|
+
const StartTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
324
|
+
const CancelTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
325
|
+
const FinishTranscribeButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
80
326
|
/**
|
|
81
|
-
* The
|
|
327
|
+
* The "+" button that opens the attachment and tools menu. Its accessible
|
|
328
|
+
* name and tooltip come from `labels.chatInputToolbarAddButtonLabel`.
|
|
82
329
|
*/
|
|
83
|
-
|
|
330
|
+
const AddMenuButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
331
|
+
toolsMenu?: (ToolsMenuItem | "-")[];
|
|
332
|
+
onAddFile?: () => void;
|
|
333
|
+
}>;
|
|
334
|
+
type TextAreaProps = React$1.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
335
|
+
const TextArea: React$1.ForwardRefExoticComponent<TextAreaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
336
|
+
const AudioRecorder: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<AudioRecorderRef>>;
|
|
337
|
+
const Disclaimer: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region src/components/chat/tool-call-layout.d.ts
|
|
341
|
+
/**
|
|
342
|
+
* How the chat shows tool calls.
|
|
343
|
+
*
|
|
344
|
+
* - `"grouped"` (default): calls made in a row share one card, collapsed to a
|
|
345
|
+
* summary ("Used 3 tools") that opens to a row per call.
|
|
346
|
+
* - `"line"`: the same grouping as a quiet line of text, like the reasoning
|
|
347
|
+
* message's "Thought for 4 seconds".
|
|
348
|
+
* - `"stacked"`: the latest call on top of a stack of the earlier ones; click
|
|
349
|
+
* to fan the stack out into its cards.
|
|
350
|
+
* - `"turn"`: the agent works in the open (narration, then a row per call),
|
|
351
|
+
* and when the reply is done everything before it folds into "Worked for 9s".
|
|
352
|
+
* - `"separate"`: every call gets its own card, as before grouping existed.
|
|
353
|
+
*
|
|
354
|
+
* Only calls drawn by a renderer that opts into grouping (`group: true`) are
|
|
355
|
+
* grouped; CopilotKit's built-in card from `useDefaultRenderTool()` does. Any
|
|
356
|
+
* other call always shows on its own and splits the group around it.
|
|
357
|
+
*/
|
|
358
|
+
type CopilotChatToolCallDisplay = "grouped" | "line" | "stacked" | "turn" | "separate";
|
|
359
|
+
/** One tool call and, once it has finished, the message carrying its result. */
|
|
360
|
+
interface ToolCallEntry {
|
|
361
|
+
toolCall: ToolCall$1;
|
|
362
|
+
toolMessage?: ToolMessage$1;
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/components/chat/CopilotChatToolCallGroup.d.ts
|
|
366
|
+
type CopilotChatToolCallGroupAppearance = "card" | "line" | "stack";
|
|
367
|
+
interface CopilotChatToolCallGroupProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
368
|
+
/** The calls in the group, in order. */
|
|
369
|
+
calls: ToolCallEntry[];
|
|
370
|
+
/** Renders one call through the registered renderers. */
|
|
371
|
+
renderCall: (call: ToolCallEntry) => React$1.ReactNode;
|
|
84
372
|
/**
|
|
85
|
-
*
|
|
373
|
+
* - `"card"` (default): one card with a summary header and a row per call.
|
|
374
|
+
* - `"line"`: a quiet line of text that opens to a list of rows.
|
|
375
|
+
* - `"stack"`: the latest call on a stack of the earlier ones.
|
|
86
376
|
*/
|
|
87
|
-
|
|
377
|
+
appearance?: CopilotChatToolCallGroupAppearance;
|
|
378
|
+
/** The agent is running and nothing follows the group, so more calls may join it. */
|
|
379
|
+
isActive?: boolean;
|
|
88
380
|
}
|
|
89
|
-
|
|
381
|
+
/**
|
|
382
|
+
* Tool calls made in a row, collapsed into one summary. While a call runs the
|
|
383
|
+
* summary names it ("Running read_file src/app.ts"); once they're all done it
|
|
384
|
+
* reads "Used 3 tools" and opens to the calls.
|
|
385
|
+
*
|
|
386
|
+
* Each call is drawn by its registered renderer. CopilotKit's built-in card
|
|
387
|
+
* (`useDefaultRenderTool`) draws a compact row inside the card and line
|
|
388
|
+
* appearances and an open stack; a custom wildcard renderer draws whatever it
|
|
389
|
+
* draws.
|
|
390
|
+
*/
|
|
391
|
+
declare function CopilotChatToolCallGroup({
|
|
392
|
+
calls,
|
|
393
|
+
renderCall,
|
|
394
|
+
appearance,
|
|
395
|
+
isActive,
|
|
396
|
+
className,
|
|
397
|
+
...props
|
|
398
|
+
}: CopilotChatToolCallGroupProps): react_jsx_runtime0.JSX.Element | null;
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/components/chat/CopilotChatToolCallsView.d.ts
|
|
401
|
+
type CopilotChatToolCallsViewProps = {
|
|
402
|
+
message: AssistantMessage$1;
|
|
403
|
+
messages?: Message$1[];
|
|
90
404
|
/**
|
|
91
|
-
*
|
|
405
|
+
* How to show the calls (see `CopilotChatToolCallDisplay`). Inside a message
|
|
406
|
+
* view it follows the view's `toolCallDisplay`; on its own it defaults to
|
|
407
|
+
* `"grouped"`.
|
|
92
408
|
*/
|
|
93
|
-
|
|
409
|
+
display?: CopilotChatToolCallDisplay;
|
|
410
|
+
/**
|
|
411
|
+
* Draws a group of calls made in a row: a component, a class name for the
|
|
412
|
+
* default group, or props for it (e.g. `{ appearance: "line" }`).
|
|
413
|
+
*/
|
|
414
|
+
group?: SlotValue<typeof CopilotChatToolCallGroup>;
|
|
415
|
+
};
|
|
416
|
+
declare function CopilotChatToolCallsView({
|
|
417
|
+
message,
|
|
418
|
+
messages,
|
|
419
|
+
display: displayProp,
|
|
420
|
+
group
|
|
421
|
+
}: CopilotChatToolCallsViewProps): react_jsx_runtime0.JSX.Element | null;
|
|
422
|
+
//#endregion
|
|
423
|
+
//#region src/components/chat/CopilotChatAssistantMessage.d.ts
|
|
424
|
+
type CopilotChatFeedbackMessage = AssistantMessage$1 & {
|
|
425
|
+
rawEvent?: unknown;
|
|
94
426
|
};
|
|
95
|
-
type
|
|
96
|
-
|
|
97
|
-
|
|
427
|
+
type CopilotChatAssistantMessageProps = WithSlots<{
|
|
428
|
+
markdownRenderer: typeof CopilotChatAssistantMessage.MarkdownRenderer;
|
|
429
|
+
toolbar: typeof CopilotChatAssistantMessage.Toolbar;
|
|
430
|
+
copyButton: typeof CopilotChatAssistantMessage.CopyButton;
|
|
431
|
+
inspectorButton: typeof CopilotChatAssistantMessage.InspectorButton;
|
|
432
|
+
thumbsUpButton: typeof CopilotChatAssistantMessage.ThumbsUpButton;
|
|
433
|
+
thumbsDownButton: typeof CopilotChatAssistantMessage.ThumbsDownButton;
|
|
434
|
+
readAloudButton: typeof CopilotChatAssistantMessage.ReadAloudButton;
|
|
435
|
+
regenerateButton: typeof CopilotChatAssistantMessage.RegenerateButton;
|
|
436
|
+
toolCallsView: typeof CopilotChatToolCallsView;
|
|
437
|
+
}, {
|
|
438
|
+
onThumbsUp?: (message: CopilotChatFeedbackMessage) => void;
|
|
439
|
+
onThumbsDown?: (message: CopilotChatFeedbackMessage) => void;
|
|
440
|
+
onReadAloud?: (message: AssistantMessage$1) => void;
|
|
441
|
+
onRegenerate?: (message: AssistantMessage$1) => void;
|
|
442
|
+
message: AssistantMessage$1;
|
|
443
|
+
messages?: Message$1[];
|
|
444
|
+
isRunning?: boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Whether this is the last message the chat renders. The message view
|
|
447
|
+
* passes it, because the rendered list can differ from `messages` when
|
|
448
|
+
* `transformMessages` drops, replaces or reorders messages. Defaults to
|
|
449
|
+
* comparing against the last entry of `messages`.
|
|
450
|
+
*/
|
|
451
|
+
isLatest?: boolean;
|
|
452
|
+
additionalToolbarItems?: React$1.ReactNode;
|
|
453
|
+
toolbarVisible?: boolean;
|
|
98
454
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
455
|
+
* The comment field of a reply rating, inside the popover next to the
|
|
456
|
+
* chosen thumb. Shown only while Automatic Learning records ratings; it
|
|
457
|
+
* renders after `children`, so a `children` layout does not place it.
|
|
102
458
|
*/
|
|
103
|
-
|
|
459
|
+
feedbackComment?: SlotValue<typeof CopilotChatAssistantMessage.FeedbackComment>;
|
|
460
|
+
} & React$1.HTMLAttributes<HTMLDivElement>>;
|
|
461
|
+
declare function CopilotChatAssistantMessage({
|
|
462
|
+
message,
|
|
463
|
+
messages,
|
|
464
|
+
isRunning,
|
|
465
|
+
isLatest,
|
|
466
|
+
onThumbsUp,
|
|
467
|
+
onThumbsDown,
|
|
468
|
+
onReadAloud,
|
|
469
|
+
onRegenerate,
|
|
470
|
+
additionalToolbarItems,
|
|
471
|
+
toolbarVisible,
|
|
472
|
+
markdownRenderer,
|
|
473
|
+
toolbar,
|
|
474
|
+
copyButton,
|
|
475
|
+
inspectorButton,
|
|
476
|
+
thumbsUpButton,
|
|
477
|
+
thumbsDownButton,
|
|
478
|
+
readAloudButton,
|
|
479
|
+
regenerateButton,
|
|
480
|
+
feedbackComment: feedbackCommentSlot,
|
|
481
|
+
toolCallsView,
|
|
482
|
+
children,
|
|
483
|
+
className,
|
|
484
|
+
...props
|
|
485
|
+
}: CopilotChatAssistantMessageProps): react_jsx_runtime0.JSX.Element;
|
|
486
|
+
declare namespace CopilotChatAssistantMessage {
|
|
487
|
+
const MarkdownRenderer: React$1.FC<MarkdownRendererProps & DefaultMarkdownRendererProps & {
|
|
488
|
+
/** Id of the rendered message. The markdown transport finds its fences by it. */messageId?: string;
|
|
489
|
+
}>;
|
|
490
|
+
const Toolbar: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
491
|
+
const ToolbarButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
492
|
+
title: string;
|
|
493
|
+
tooltip?: React$1.ReactNode;
|
|
494
|
+
tooltipClassName?: string;
|
|
495
|
+
children: React$1.ReactNode;
|
|
496
|
+
}>;
|
|
497
|
+
const CopyButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
498
|
+
const InspectorButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
499
|
+
const ThumbsUpButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
500
|
+
const ThumbsDownButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
104
501
|
/**
|
|
105
|
-
*
|
|
502
|
+
* The comment field of a rating, shown in a popover next to the chosen
|
|
503
|
+
* thumb. Enter saves; Send appears once the text differs from the saved
|
|
504
|
+
* comment. The popover marks itself `data-copilotkit-ignore`, so Learning
|
|
505
|
+
* records the saved comment but not the typing; outside it, mark the
|
|
506
|
+
* field yourself.
|
|
106
507
|
*/
|
|
107
|
-
|
|
508
|
+
const FeedbackComment: React$1.FC<{
|
|
509
|
+
value: string; /** The comment already saved. */
|
|
510
|
+
savedComment: string;
|
|
511
|
+
inputRef?: React$1.Ref<HTMLInputElement>;
|
|
512
|
+
onChange: (value: string) => void;
|
|
513
|
+
onSubmit: () => void;
|
|
514
|
+
onEditingChange?: (editing: boolean) => void;
|
|
515
|
+
/**
|
|
516
|
+
* Focus left the form for `next`, or for no focusable element when null.
|
|
517
|
+
* Not called when the window loses focus.
|
|
518
|
+
*/
|
|
519
|
+
onLeave?: (next: Element | null) => void;
|
|
520
|
+
className?: string;
|
|
521
|
+
}>;
|
|
522
|
+
const ReadAloudButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
523
|
+
const RegenerateButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
524
|
+
}
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region src/components/chat/CopilotChatUserMessage.d.ts
|
|
527
|
+
interface CopilotChatUserMessageOnEditMessageProps {
|
|
528
|
+
message: UserMessage$1;
|
|
529
|
+
}
|
|
530
|
+
interface CopilotChatUserMessageOnSwitchToBranchProps {
|
|
531
|
+
message: UserMessage$1;
|
|
532
|
+
branchIndex: number;
|
|
533
|
+
numberOfBranches: number;
|
|
534
|
+
}
|
|
535
|
+
type CopilotChatUserMessageProps = WithSlots<{
|
|
536
|
+
messageRenderer: typeof CopilotChatUserMessage.MessageRenderer;
|
|
537
|
+
toolbar: typeof CopilotChatUserMessage.Toolbar;
|
|
538
|
+
copyButton: typeof CopilotChatUserMessage.CopyButton;
|
|
539
|
+
editButton: typeof CopilotChatUserMessage.EditButton;
|
|
540
|
+
branchNavigation: typeof CopilotChatUserMessage.BranchNavigation;
|
|
541
|
+
}, {
|
|
542
|
+
onEditMessage?: (props: CopilotChatUserMessageOnEditMessageProps) => void;
|
|
543
|
+
onSwitchToBranch?: (props: CopilotChatUserMessageOnSwitchToBranchProps) => void;
|
|
544
|
+
message: UserMessage$1;
|
|
545
|
+
branchIndex?: number;
|
|
546
|
+
numberOfBranches?: number;
|
|
547
|
+
additionalToolbarItems?: React.ReactNode;
|
|
548
|
+
} & React.HTMLAttributes<HTMLDivElement>>;
|
|
549
|
+
declare function CopilotChatUserMessage({
|
|
550
|
+
message,
|
|
551
|
+
onEditMessage,
|
|
552
|
+
branchIndex,
|
|
553
|
+
numberOfBranches,
|
|
554
|
+
onSwitchToBranch,
|
|
555
|
+
additionalToolbarItems,
|
|
556
|
+
messageRenderer,
|
|
557
|
+
toolbar,
|
|
558
|
+
copyButton,
|
|
559
|
+
editButton,
|
|
560
|
+
branchNavigation,
|
|
561
|
+
children,
|
|
562
|
+
className,
|
|
563
|
+
...props
|
|
564
|
+
}: CopilotChatUserMessageProps): react_jsx_runtime0.JSX.Element;
|
|
565
|
+
declare namespace CopilotChatUserMessage {
|
|
566
|
+
const Container: React.FC<React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>>;
|
|
567
|
+
const MessageRenderer: React.FC<{
|
|
568
|
+
content: string;
|
|
569
|
+
className?: string;
|
|
570
|
+
}>;
|
|
571
|
+
const Toolbar: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
572
|
+
const ToolbarButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
573
|
+
title: string;
|
|
574
|
+
children: React.ReactNode;
|
|
575
|
+
}>;
|
|
576
|
+
const CopyButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
577
|
+
copied?: boolean;
|
|
578
|
+
}>;
|
|
579
|
+
const EditButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
108
580
|
/**
|
|
109
|
-
*
|
|
581
|
+
* Previous/next buttons and an "n/m" counter for switching between branches
|
|
582
|
+
* of a user message. Renders only with more than one branch and an
|
|
583
|
+
* `onSwitchToBranch` handler. The buttons are named by
|
|
584
|
+
* `labels.userMessageToolbarPreviousBranchLabel` and
|
|
585
|
+
* `labels.userMessageToolbarNextBranchLabel`.
|
|
110
586
|
*/
|
|
111
|
-
|
|
587
|
+
const BranchNavigation: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
588
|
+
currentBranch?: number;
|
|
589
|
+
numberOfBranches?: number;
|
|
590
|
+
onSwitchToBranch?: (props: CopilotChatUserMessageOnSwitchToBranchProps) => void;
|
|
591
|
+
message: UserMessage$1;
|
|
592
|
+
}>;
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/components/chat/CopilotChatReasoningMessage.d.ts
|
|
596
|
+
type CopilotChatReasoningMessageProps = WithSlots<{
|
|
597
|
+
header: typeof CopilotChatReasoningMessage.Header;
|
|
598
|
+
contentView: typeof CopilotChatReasoningMessage.Content;
|
|
599
|
+
toggle: typeof CopilotChatReasoningMessage.Toggle;
|
|
600
|
+
}, {
|
|
601
|
+
message: ReasoningMessage$1;
|
|
602
|
+
messages?: Message$1[];
|
|
603
|
+
isRunning?: boolean;
|
|
112
604
|
/**
|
|
113
|
-
*
|
|
605
|
+
* Whether this is the last message the chat renders. The message view
|
|
606
|
+
* passes it, because the rendered list can differ from `messages` when
|
|
607
|
+
* `transformMessages` drops, replaces or reorders messages. Defaults to
|
|
608
|
+
* comparing against the last entry of `messages`.
|
|
114
609
|
*/
|
|
115
|
-
|
|
610
|
+
isLatest?: boolean;
|
|
611
|
+
} & React.HTMLAttributes<HTMLDivElement>>;
|
|
612
|
+
/**
|
|
613
|
+
* A reasoning message as a collapsible block. While the model reasons it is
|
|
614
|
+
* open and the header shows `labels.reasoningMessageThinkingLabel`; when
|
|
615
|
+
* streaming ends it collapses and the header reads "Thought for …". The
|
|
616
|
+
* `header` slot also receives `elapsedSeconds`.
|
|
617
|
+
*/
|
|
618
|
+
declare function CopilotChatReasoningMessage({
|
|
619
|
+
message,
|
|
620
|
+
messages,
|
|
621
|
+
isRunning,
|
|
622
|
+
isLatest: isLatestProp,
|
|
623
|
+
header,
|
|
624
|
+
contentView,
|
|
625
|
+
toggle,
|
|
626
|
+
children,
|
|
627
|
+
className,
|
|
628
|
+
...props
|
|
629
|
+
}: CopilotChatReasoningMessageProps): react_jsx_runtime0.JSX.Element;
|
|
630
|
+
declare namespace CopilotChatReasoningMessage {
|
|
631
|
+
const Header: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
632
|
+
isOpen?: boolean;
|
|
633
|
+
label?: string;
|
|
634
|
+
hasContent?: boolean;
|
|
635
|
+
isStreaming?: boolean;
|
|
636
|
+
/**
|
|
637
|
+
* Seconds spent reasoning so far, updated every second while streaming.
|
|
638
|
+
* The default label formats it in English ("Thought for 12 seconds");
|
|
639
|
+
* a custom header can use it to build a localized label.
|
|
640
|
+
*/
|
|
641
|
+
elapsedSeconds?: number;
|
|
642
|
+
}>;
|
|
643
|
+
const Content: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
644
|
+
isStreaming?: boolean;
|
|
645
|
+
hasContent?: boolean;
|
|
646
|
+
}>;
|
|
647
|
+
const Toggle: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
648
|
+
isOpen?: boolean;
|
|
649
|
+
}>;
|
|
650
|
+
}
|
|
651
|
+
//#endregion
|
|
652
|
+
//#region src/components/chat/CopilotChatSuggestionPill.d.ts
|
|
653
|
+
interface CopilotChatSuggestionPillProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
654
|
+
/** Optional icon to render on the left side when not loading. */
|
|
655
|
+
icon?: React$1.ReactNode;
|
|
656
|
+
/** Whether the pill should display a loading spinner. */
|
|
657
|
+
isLoading?: boolean;
|
|
658
|
+
}
|
|
659
|
+
declare const CopilotChatSuggestionPill: React$1.ForwardRefExoticComponent<CopilotChatSuggestionPillProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/components/chat/CopilotChatSuggestionView.d.ts
|
|
662
|
+
declare const DefaultContainer: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
663
|
+
type CopilotChatSuggestionViewProps = WithSlots<{
|
|
664
|
+
container: typeof DefaultContainer;
|
|
665
|
+
suggestion: typeof CopilotChatSuggestionPill;
|
|
666
|
+
}, {
|
|
667
|
+
suggestions: Suggestion$1[];
|
|
668
|
+
onSelectSuggestion?: (suggestion: Suggestion$1, index: number) => void;
|
|
669
|
+
loadingIndexes?: ReadonlyArray<number>;
|
|
670
|
+
} & React$1.HTMLAttributes<HTMLDivElement>>;
|
|
671
|
+
declare const CopilotChatSuggestionView: React$1.ForwardRefExoticComponent<{
|
|
672
|
+
container?: SlotValue<React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>> | undefined;
|
|
673
|
+
suggestion?: SlotValue<React$1.ForwardRefExoticComponent<CopilotChatSuggestionPillProps & React$1.RefAttributes<HTMLButtonElement>>> | undefined;
|
|
674
|
+
} & {
|
|
675
|
+
children?: ((props: {
|
|
676
|
+
container: React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
677
|
+
suggestion: React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
678
|
+
} & {
|
|
679
|
+
suggestions: Suggestion$1[];
|
|
680
|
+
onSelectSuggestion?: (suggestion: Suggestion$1, index: number) => void;
|
|
681
|
+
loadingIndexes?: ReadonlyArray<number>;
|
|
682
|
+
} & React$1.HTMLAttributes<HTMLDivElement>) => React$1.ReactNode) | undefined;
|
|
683
|
+
} & Omit<{
|
|
684
|
+
suggestions: Suggestion$1[];
|
|
685
|
+
onSelectSuggestion?: (suggestion: Suggestion$1, index: number) => void;
|
|
686
|
+
loadingIndexes?: ReadonlyArray<number>;
|
|
687
|
+
} & React$1.HTMLAttributes<HTMLDivElement>, "children"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region src/components/chat/CopilotChatWorkSummary.d.ts
|
|
690
|
+
interface CopilotChatWorkSummaryProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
691
|
+
/** The agent is still working on this reply. */
|
|
692
|
+
isWorking: boolean;
|
|
693
|
+
/** Whether the work (narration and tool calls) is showing. */
|
|
694
|
+
isOpen: boolean;
|
|
695
|
+
/** The tool calls the reply made. */
|
|
696
|
+
calls: ToolCallEntry[];
|
|
116
697
|
/**
|
|
117
|
-
*
|
|
698
|
+
* How long the agent has worked on the reply, in ms, summed over its runs
|
|
699
|
+
* so time spent waiting between them doesn't count. Only known for replies
|
|
700
|
+
* this client watched start; without it the summary shows the tool count.
|
|
118
701
|
*/
|
|
119
|
-
|
|
702
|
+
elapsedMs?: number;
|
|
703
|
+
/** When the current run started (epoch ms), while the agent is working. */
|
|
704
|
+
workingSince?: number;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* The line at the top of a reply in the `"turn"` tool-call display. While the
|
|
708
|
+
* agent works it reads "Working 4s"; once the reply is done it reads "Worked
|
|
709
|
+
* for 9s · 7 tools" and toggles the work it folded away.
|
|
710
|
+
*/
|
|
711
|
+
declare function CopilotChatWorkSummary({
|
|
712
|
+
isWorking,
|
|
713
|
+
isOpen,
|
|
714
|
+
calls,
|
|
715
|
+
elapsedMs,
|
|
716
|
+
workingSince,
|
|
717
|
+
className,
|
|
718
|
+
...props
|
|
719
|
+
}: CopilotChatWorkSummaryProps): react_jsx_runtime0.JSX.Element;
|
|
720
|
+
//#endregion
|
|
721
|
+
//#region src/components/intelligence-indicator/IntelligenceIndicatorView.d.ts
|
|
722
|
+
/** Lifecycle state the brain hands the face. */
|
|
723
|
+
type IntelligenceIndicatorStatus = "in-progress" | "finished";
|
|
724
|
+
interface IntelligenceIndicatorViewProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
725
|
+
/** The assistant message this indicator is attached to. */
|
|
726
|
+
message: Message$1;
|
|
120
727
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* - When the chat is first opened (empty state)
|
|
125
|
-
* - After each message exchange completes
|
|
126
|
-
* - Uses configuration from `useCopilotChatSuggestions` hooks
|
|
127
|
-
*
|
|
128
|
-
* `manual` - Suggestions are controlled programmatically:
|
|
129
|
-
* - Use `setSuggestions()` to set custom suggestions
|
|
130
|
-
* - Use `generateSuggestions()` to trigger AI generation
|
|
131
|
-
* - Access via `useCopilotChat` hook
|
|
132
|
-
*
|
|
133
|
-
* `SuggestionItem[]` - Static suggestions array:
|
|
134
|
-
* - Always shows the same suggestions
|
|
135
|
-
* - No AI generation involved
|
|
728
|
+
* Whether the intelligence work is still running (`in-progress`) or
|
|
729
|
+
* has settled (`finished`). Drives the icon morph and chrome
|
|
730
|
+
* fade-out via the `data-status` attribute on the wrapper.
|
|
136
731
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
onStopGeneration?: OnStopGeneration;
|
|
141
|
-
onReloadMessages?: OnReloadMessages;
|
|
732
|
+
status: IntelligenceIndicatorStatus;
|
|
733
|
+
/** The visible label, e.g. "Using CopilotKit Intelligence". */
|
|
734
|
+
label: string;
|
|
142
735
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
736
|
+
/**
|
|
737
|
+
* The presentational "CopilotKit Intelligence" face — the default
|
|
738
|
+
* rendered by the {@link IntelligenceIndicator} brain and the default
|
|
739
|
+
* value for the `intelligenceIndicator` slot.
|
|
740
|
+
*
|
|
741
|
+
* Layout: a glassmorphism pill (the `__chrome` layer) wrapping an icon
|
|
742
|
+
* and a label. The icon is two overlaid SVG paths — a spinner arc and a
|
|
743
|
+
* checkmark — whose geometry lives in each path's `d` ATTRIBUTE so it
|
|
744
|
+
* renders in every browser (the CSS `d:` property is Chrome-only).
|
|
745
|
+
*
|
|
746
|
+
* Two states, driven by the `data-status` attribute (see globals.css
|
|
747
|
+
* for the exact timing):
|
|
748
|
+
* 1. **In-progress.** The arc spins (CSS rotation) inside the pill and
|
|
749
|
+
* the checkmark is hidden. Label + icon are a saturated purple.
|
|
750
|
+
* 2. **Finished.** The arc fades out mid-spin while the checkmark draws
|
|
751
|
+
* itself in upright (animated `stroke-dashoffset`); the pill chrome
|
|
752
|
+
* fades away; and the label + icon settle from purple to a neutral
|
|
753
|
+
* gray, with the label slanting slightly (a `transform: skewX`
|
|
754
|
+
* faux-italic, so it interpolates with the color instead of snapping
|
|
755
|
+
* and never reflows). The result reads as quiet "history metadata"
|
|
756
|
+
* rather than an active spinner. The label text itself never changes
|
|
757
|
+
* — the static check plus the color/slant shift carry the "done"
|
|
758
|
+
* meaning, so no wording change is needed.
|
|
759
|
+
*
|
|
760
|
+
* All motion is gated behind `prefers-reduced-motion` (globals.css):
|
|
761
|
+
* when reduced motion is requested the arc does not spin and the two
|
|
762
|
+
* states swap instantly, without transitions.
|
|
763
|
+
*
|
|
764
|
+
* Customize via the `intelligenceIndicator` slot on `CopilotChat`:
|
|
765
|
+
* a className string restyles the wrapper, a props object tweaks
|
|
766
|
+
* the default (`{ label }`), and a component replaces it entirely
|
|
767
|
+
* with full control over visuals and timing.
|
|
768
|
+
*/
|
|
769
|
+
declare function IntelligenceIndicatorView({
|
|
770
|
+
message,
|
|
771
|
+
status,
|
|
772
|
+
label,
|
|
773
|
+
className,
|
|
774
|
+
...rest
|
|
775
|
+
}: IntelligenceIndicatorViewProps): React$1.ReactElement;
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/components/intelligence-indicator/IntelligenceIndicator.d.ts
|
|
778
|
+
interface IntelligenceIndicatorProps {
|
|
779
|
+
/** The message this indicator is attached to. */
|
|
780
|
+
message: Message$1;
|
|
781
|
+
/**
|
|
782
|
+
* Agent id whose run state the indicator tracks. Pass through from
|
|
783
|
+
* the surrounding chat configuration; mounting from
|
|
784
|
+
* `CopilotChatMessageView` resolves this automatically.
|
|
785
|
+
*/
|
|
786
|
+
agentId: string;
|
|
787
|
+
/**
|
|
788
|
+
* Optional override for the visible label. Defaults to
|
|
789
|
+
* "CopilotKit Intelligence".
|
|
790
|
+
*/
|
|
791
|
+
label?: string;
|
|
792
|
+
/**
|
|
793
|
+
* Slot override for the presentational face. A className string, a
|
|
794
|
+
* props object, or a full replacement component — see
|
|
795
|
+
* {@link IntelligenceIndicatorView}. Forwarded from the
|
|
796
|
+
* `intelligenceIndicator` slot on `CopilotChat`.
|
|
797
|
+
*/
|
|
798
|
+
intelligenceIndicator?: SlotValue<typeof IntelligenceIndicatorView>;
|
|
146
799
|
}
|
|
147
|
-
|
|
800
|
+
/**
|
|
801
|
+
* Stable turn id for the messages that precede the first user message (a turn
|
|
802
|
+
* with no opening user message of its own). Used as the React key so the
|
|
803
|
+
* indicator for that turn never collides with a real user-message id.
|
|
804
|
+
*/
|
|
805
|
+
declare const INTELLIGENCE_TURN_HEAD = "__cpk_turn_head__";
|
|
806
|
+
/**
|
|
807
|
+
* Map each Intelligence-using turn to its anchor message — the FIRST bash-using
|
|
808
|
+
* assistant message of the turn — and a stable turn id (the id of the user
|
|
809
|
+
* message that opened the turn, or {@link INTELLIGENCE_TURN_HEAD} for the
|
|
810
|
+
* pre-first-user turn). Returns `Map<anchorMessageId, turnId>`.
|
|
811
|
+
*
|
|
812
|
+
* Anchoring to the FIRST (not last) bash-using message keeps the indicator
|
|
813
|
+
* fixed in place for the whole turn: later bash steps don't reposition it, so
|
|
814
|
+
* the spinner never abruptly jumps mid-turn (bug 1). `CopilotChatMessageView`
|
|
815
|
+
* emits exactly one `IntelligenceIndicator` per entry, keyed by the turn id and
|
|
816
|
+
* positioned at the anchor; the per-turn key also lets every past turn keep its
|
|
817
|
+
* own indicator in scroll-back.
|
|
818
|
+
*
|
|
819
|
+
* `visibleMessages` is what actually renders, when that differs from
|
|
820
|
+
* `messages` (the chat's `transformMessages`). Turns are still read from the
|
|
821
|
+
* full list, so hiding a user message does not merge its turn into the one
|
|
822
|
+
* before it, and anchors are only chosen among visible messages. A message the
|
|
823
|
+
* transform built itself joins the turn of the visible message before it.
|
|
824
|
+
*/
|
|
825
|
+
declare function getIntelligenceTurnAnchors(messages: readonly Message$1[], visibleMessages?: readonly Message$1[]): Map<string, string>;
|
|
826
|
+
/**
|
|
827
|
+
* The "Using CopilotKit Intelligence" indicator brain. Auto-mounted by
|
|
828
|
+
* `CopilotChatMessageView` — once per Intelligence-using turn, at that
|
|
829
|
+
* turn's anchor message and keyed by the turn id (see
|
|
830
|
+
* {@link getIntelligenceTurnAnchors}). Callers do not register this
|
|
831
|
+
* themselves. It owns the run subscription and the phase machine and
|
|
832
|
+
* renders its swappable face via the `intelligenceIndicator` slot.
|
|
833
|
+
*
|
|
834
|
+
* Placement (which message anchors the turn) is decided by the view, so
|
|
835
|
+
* this component does not self-gate its own placement; it only derives
|
|
836
|
+
* in-progress/finished for the turn it was mounted on.
|
|
837
|
+
*
|
|
838
|
+
* Render gates (all must hold):
|
|
839
|
+
* 1. `copilotkit.intelligence !== undefined`
|
|
840
|
+
* 2. The (anchor) message is an assistant message with at least one
|
|
841
|
+
* tool call whose name matches {@link DEFAULT_TOOL_PATTERNS}.
|
|
842
|
+
* 3. The phase machine is past `hidden`.
|
|
843
|
+
*
|
|
844
|
+
* Because the view keys each indicator by its turn id, the instance moves
|
|
845
|
+
* with the anchor across a hand-off (no remount, no spinner restart), and
|
|
846
|
+
* every prior Intelligence-using turn keeps its own persistent indicator
|
|
847
|
+
* in chat history.
|
|
848
|
+
*
|
|
849
|
+
* Phase machine (per-instance, all timers local):
|
|
850
|
+
* - Starts in `hidden`, unless the message mounts onto an
|
|
851
|
+
* already-completed turn (no pending work, agent stopped or a
|
|
852
|
+
* real follow-up already present), in which case the lazy
|
|
853
|
+
* `useState` initializer starts directly in `finished`. This is
|
|
854
|
+
* what avoids a "hidden flash" on history replay.
|
|
855
|
+
* - `hidden → spinner` once a matching tool call has been pending
|
|
856
|
+
* (no `tool`-role result with a matching `toolCallId`) for
|
|
857
|
+
* {@link PENDING_THRESHOLD_MS}. Replay flashes (tool call + result
|
|
858
|
+
* in the same tick) never cross this threshold.
|
|
859
|
+
* - `hidden → finished` if after the grace window the turn is
|
|
860
|
+
* already complete (no pending work AND
|
|
861
|
+
* `sawRealFollowup || !agent.isRunning`). Handles very fast tools
|
|
862
|
+
* whose result lands within the grace window.
|
|
863
|
+
* - `spinner → finished` as soon as EITHER `agent.isRunning` flips
|
|
864
|
+
* false OR a non-tool-call-like message appears later in
|
|
865
|
+
* `agent.messages` (i.e. the agent produced a "real" follow-up —
|
|
866
|
+
* prose answer or a new user turn).
|
|
867
|
+
* - `finished` is terminal: the indicator settles into its
|
|
868
|
+
* persistent tag form and stays mounted.
|
|
869
|
+
*/
|
|
870
|
+
declare function IntelligenceIndicator(props: IntelligenceIndicatorProps): React$1.ReactElement | null;
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/components/chat/CopilotChatMessageView.d.ts
|
|
873
|
+
/** What the view passes the wrapper of a message group. */
|
|
874
|
+
interface MessageGroupWrapperProps<S = unknown> {
|
|
875
|
+
/** The group's key, as returned by `groupMessages`. */
|
|
876
|
+
groupKey: string;
|
|
877
|
+
/** The messages in the group, in order. */
|
|
878
|
+
messages: Message$1[];
|
|
879
|
+
/** The default rendering of the group's messages. */
|
|
880
|
+
children: React$1.ReactNode;
|
|
148
881
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
882
|
+
* State the view keeps for this group, keyed by `groupKey`. It survives the
|
|
883
|
+
* row leaving the window and the wrapper remounting, is dropped once the key
|
|
884
|
+
* no longer appears, and is cleared when the thread changes. `undefined`
|
|
885
|
+
* until first set.
|
|
153
886
|
*/
|
|
154
|
-
|
|
887
|
+
state: S | undefined;
|
|
888
|
+
setState: (next: S) => void;
|
|
889
|
+
}
|
|
890
|
+
/** Several messages rendered as one row, inside an app-provided wrapper. */
|
|
891
|
+
interface MessageGroup<S = unknown> {
|
|
892
|
+
type: "group";
|
|
155
893
|
/**
|
|
156
|
-
*
|
|
894
|
+
* Identifies the group across renders: its React key and the key its state
|
|
895
|
+
* is held under. Keep it stable while the thread streams, e.g. the id of the
|
|
896
|
+
* group's first message.
|
|
157
897
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
appendMessage: (message: Message$1, options?: AppendMessageOptions) => Promise<void>;
|
|
898
|
+
key: string;
|
|
899
|
+
messages: Message$1[];
|
|
161
900
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* ```tsx
|
|
165
|
-
* await sendMessage({
|
|
166
|
-
* id: "123",
|
|
167
|
-
* role: "user",
|
|
168
|
-
* content: "Hello, process this request",
|
|
169
|
-
* });
|
|
170
|
-
* ```
|
|
901
|
+
* Define it once at module level. A component created inside
|
|
902
|
+
* `groupMessages` is a new type on every call and remounts each time.
|
|
171
903
|
*/
|
|
172
|
-
|
|
904
|
+
wrapper: React$1.ComponentType<MessageGroupWrapperProps<S>>;
|
|
905
|
+
}
|
|
906
|
+
/** One row of the message list: a single message, or a group of them. */
|
|
907
|
+
type MessageRow = {
|
|
908
|
+
type: "message";
|
|
909
|
+
message: Message$1;
|
|
910
|
+
} | MessageGroup;
|
|
911
|
+
/** A row holding a single message, rendered as it would be ungrouped. */
|
|
912
|
+
declare function messageRow(message: Message$1): MessageRow;
|
|
913
|
+
/** A row holding a group of messages, rendered inside `wrapper`. */
|
|
914
|
+
declare function messageGroup<S>(group: Omit<MessageGroup<S>, "type">): MessageRow;
|
|
915
|
+
type CopilotChatMessageViewProps = Omit<WithSlots<{
|
|
916
|
+
assistantMessage: typeof CopilotChatAssistantMessage;
|
|
917
|
+
userMessage: typeof CopilotChatUserMessage;
|
|
918
|
+
reasoningMessage: typeof CopilotChatReasoningMessage;
|
|
919
|
+
cursor: typeof CopilotChatMessageView.Cursor;
|
|
920
|
+
intelligenceIndicator: typeof IntelligenceIndicatorView; /** The "Working… / Worked for 9s" line of the `"turn"` tool-call display. */
|
|
921
|
+
workSummary: typeof CopilotChatWorkSummary;
|
|
922
|
+
}, {
|
|
923
|
+
isRunning?: boolean;
|
|
924
|
+
messages?: Message$1[];
|
|
173
925
|
/**
|
|
174
|
-
*
|
|
926
|
+
* Reshapes the message list before it renders: drop, replace or reorder
|
|
927
|
+
* messages with the whole list in view. Receives the list after duplicate
|
|
928
|
+
* ids are merged. Row keys, virtualization and rendering all work off
|
|
929
|
+
* the returned list, so a dropped message takes no row.
|
|
175
930
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* { id: "123", role: "user", content: "Hello, process this request" },
|
|
179
|
-
* { id: "456", role: "assistant", content: "Hello, I'm the assistant" },
|
|
180
|
-
* ]);
|
|
181
|
-
* ```
|
|
931
|
+
* Tool-call cards still look up their results in the full list, so
|
|
932
|
+
* hiding tool-result messages here does not strip results from them.
|
|
182
933
|
*
|
|
183
|
-
*
|
|
934
|
+
* Memoized on the input list and this function — pass a stable function
|
|
935
|
+
* (e.g. `useCallback`) or it reruns on every render.
|
|
936
|
+
*/
|
|
937
|
+
transformMessages?: (messages: Message$1[]) => Message$1[];
|
|
938
|
+
/**
|
|
939
|
+
* Splits the message list into rows. Return `messageRow(message)` for a
|
|
940
|
+
* message that renders on its own, and `messageGroup({ key, messages,
|
|
941
|
+
* wrapper })` for messages that render together inside `wrapper` — a
|
|
942
|
+
* collapsible block of tool calls, say. Receives the list after
|
|
943
|
+
* `transformMessages`. Each row is one virtualized row.
|
|
184
944
|
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* new TextMessage({
|
|
188
|
-
* content: "Hello, process this request",
|
|
189
|
-
* role: gqlRole.User,
|
|
190
|
-
* }),
|
|
191
|
-
* new TextMessage({
|
|
192
|
-
* content: "Hello, I'm the assistant",
|
|
193
|
-
* role: gqlRole.Assistant,
|
|
194
|
-
* ]);
|
|
195
|
-
* ```
|
|
945
|
+
* Return each message in at most one row. Tool-call cards still find
|
|
946
|
+
* their results in the full list.
|
|
196
947
|
*
|
|
948
|
+
* Memoized on its input and this function — pass a stable function.
|
|
197
949
|
*/
|
|
198
|
-
|
|
950
|
+
groupMessages?: (messages: Message$1[]) => MessageRow[];
|
|
199
951
|
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* deleteMessage("123");
|
|
204
|
-
* ```
|
|
952
|
+
* Whether reply thumbs record ratings for Automatic Learning once a
|
|
953
|
+
* Trajectory has started. Defaults to `true`; set `false` to keep the
|
|
954
|
+
* thumbs to your own `onThumbsUp` / `onThumbsDown` handlers and slots.
|
|
205
955
|
*/
|
|
206
|
-
|
|
956
|
+
messageFeedback?: boolean;
|
|
207
957
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
958
|
+
* How tool calls show. Defaults to `"grouped"`: calls made in a row
|
|
959
|
+
* share one card that opens to a row per call. `"line"` and `"stacked"`
|
|
960
|
+
* group them too; `"turn"` folds a reply's whole working phase into
|
|
961
|
+
* "Worked for 9s" once it's done; `"separate"` gives every call its own
|
|
962
|
+
* card. Calls with a renderer of their own always show on their own.
|
|
963
|
+
*/
|
|
964
|
+
toolCallDisplay?: CopilotChatToolCallDisplay;
|
|
965
|
+
} & React$1.HTMLAttributes<HTMLDivElement>>, "children"> & {
|
|
966
|
+
children?: (props: {
|
|
967
|
+
isRunning: boolean;
|
|
968
|
+
messages: Message$1[];
|
|
969
|
+
messageElements: React$1.ReactElement[];
|
|
970
|
+
interruptElement: React$1.ReactElement | null;
|
|
971
|
+
}) => React$1.ReactElement;
|
|
972
|
+
};
|
|
973
|
+
declare function CopilotChatMessageView({
|
|
974
|
+
messages,
|
|
975
|
+
assistantMessage,
|
|
976
|
+
userMessage,
|
|
977
|
+
reasoningMessage,
|
|
978
|
+
cursor,
|
|
979
|
+
intelligenceIndicator,
|
|
980
|
+
workSummary,
|
|
981
|
+
isRunning,
|
|
982
|
+
transformMessages,
|
|
983
|
+
groupMessages,
|
|
984
|
+
messageFeedback,
|
|
985
|
+
toolCallDisplay,
|
|
986
|
+
children,
|
|
987
|
+
className,
|
|
988
|
+
...props
|
|
989
|
+
}: CopilotChatMessageViewProps): react_jsx_runtime0.JSX.Element;
|
|
990
|
+
declare namespace CopilotChatMessageView {
|
|
991
|
+
var Cursor: ({
|
|
992
|
+
className,
|
|
993
|
+
...props
|
|
994
|
+
}: React$1.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime0.JSX.Element;
|
|
995
|
+
}
|
|
996
|
+
//#endregion
|
|
997
|
+
//#region src/components/chat/normalize-auto-scroll.d.ts
|
|
998
|
+
type AutoScrollMode = "pin-to-bottom" | "pin-to-send" | "none";
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#region src/components/chat/CopilotChatView.d.ts
|
|
1001
|
+
type WelcomeScreenProps = WithSlots<{
|
|
1002
|
+
welcomeMessage: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
1003
|
+
}, {
|
|
1004
|
+
input: React$1.ReactElement;
|
|
1005
|
+
suggestionView: React$1.ReactElement;
|
|
1006
|
+
} & React$1.HTMLAttributes<HTMLDivElement>>;
|
|
1007
|
+
type CopilotChatViewProps = WithSlots<{
|
|
1008
|
+
messageView: typeof CopilotChatMessageView;
|
|
1009
|
+
scrollView: typeof CopilotChatView.ScrollView;
|
|
1010
|
+
input: React$1.ComponentType<CopilotChatInputProps>;
|
|
1011
|
+
suggestionView: typeof CopilotChatSuggestionView;
|
|
1012
|
+
}, {
|
|
1013
|
+
messages?: Message$1[];
|
|
1014
|
+
autoScroll?: AutoScrollMode | boolean;
|
|
1015
|
+
isRunning?: boolean;
|
|
1016
|
+
suggestions?: Suggestion$1[];
|
|
1017
|
+
suggestionLoadingIndexes?: ReadonlyArray<number>;
|
|
1018
|
+
onSelectSuggestion?: (suggestion: Suggestion$1, index: number) => void;
|
|
1019
|
+
welcomeScreen?: SlotValue<React$1.FC<WelcomeScreenProps>> | boolean;
|
|
1020
|
+
onSubmitMessage?: (value: string) => void;
|
|
1021
|
+
onStop?: () => void;
|
|
1022
|
+
inputMode?: CopilotChatInputMode;
|
|
1023
|
+
inputValue?: string;
|
|
1024
|
+
onInputChange?: (value: string) => void;
|
|
1025
|
+
onStartTranscribe?: () => void;
|
|
1026
|
+
onCancelTranscribe?: () => void;
|
|
1027
|
+
onFinishTranscribe?: () => void;
|
|
1028
|
+
onFinishTranscribeWithAudio?: (audioBlob: Blob) => Promise<void>;
|
|
1029
|
+
attachments?: Attachment$1[];
|
|
1030
|
+
onRemoveAttachment?: (id: string) => void;
|
|
1031
|
+
onAddFile?: () => void;
|
|
1032
|
+
dragOver?: boolean;
|
|
1033
|
+
onDragOver?: (e: React$1.DragEvent) => void;
|
|
1034
|
+
onDragLeave?: (e: React$1.DragEvent) => void;
|
|
1035
|
+
onDrop?: (e: React$1.DragEvent) => void;
|
|
1036
|
+
/**
|
|
1037
|
+
* When `true`, suppresses the welcome screen while a thread's initial
|
|
1038
|
+
* connect is in flight. Prevents the "How can I help you today?" flash
|
|
1039
|
+
* that would otherwise appear between mounting an empty agent instance
|
|
1040
|
+
* and the bootstrap messages arriving from /connect.
|
|
213
1041
|
*/
|
|
214
|
-
|
|
1042
|
+
isConnecting?: boolean;
|
|
215
1043
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* }
|
|
222
|
-
* ```
|
|
1044
|
+
* When `true`, the caller has explicitly picked a thread (via `threadId`
|
|
1045
|
+
* prop or `CopilotChatConfigurationProvider`). Suppresses the welcome
|
|
1046
|
+
* screen unconditionally — a caller-managed thread targets a specific
|
|
1047
|
+
* conversation and should render its messages (or an empty panel during
|
|
1048
|
+
* connect) rather than a generic "start a new chat" greeting.
|
|
223
1049
|
*/
|
|
224
|
-
|
|
1050
|
+
hasExplicitThreadId?: boolean;
|
|
225
1051
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
1052
|
+
* @deprecated Use the `input` slot's `disclaimer` prop instead:
|
|
228
1053
|
* ```tsx
|
|
229
|
-
*
|
|
230
|
-
* console.log(messages); // []
|
|
1054
|
+
* <CopilotChat input={{ disclaimer: MyDisclaimer }} />
|
|
231
1055
|
* ```
|
|
232
1056
|
*/
|
|
233
|
-
|
|
1057
|
+
disclaimer?: SlotValue<React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>>;
|
|
234
1058
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* if (isLoading) {
|
|
239
|
-
* console.log("Loading...");
|
|
240
|
-
* } else {
|
|
241
|
-
* console.log("Not loading");
|
|
242
|
-
* }
|
|
1059
|
+
* Slot for the "Using CopilotKit Intelligence" indicator. Pass-through
|
|
1060
|
+
* to `CopilotChatMessageView`'s `intelligenceIndicator` slot — accepts a
|
|
1061
|
+
* className string, a props object, or a replacement component.
|
|
243
1062
|
*/
|
|
244
|
-
|
|
1063
|
+
intelligenceIndicator?: SlotValue<typeof IntelligenceIndicatorView>;
|
|
1064
|
+
} & Omit<React$1.HTMLAttributes<HTMLDivElement>, "inputMode">>;
|
|
1065
|
+
declare function CopilotChatView({
|
|
1066
|
+
messageView,
|
|
1067
|
+
input,
|
|
1068
|
+
scrollView,
|
|
1069
|
+
suggestionView,
|
|
1070
|
+
welcomeScreen,
|
|
1071
|
+
messages,
|
|
1072
|
+
autoScroll,
|
|
1073
|
+
isRunning,
|
|
1074
|
+
suggestions,
|
|
1075
|
+
suggestionLoadingIndexes,
|
|
1076
|
+
onSelectSuggestion,
|
|
1077
|
+
onSubmitMessage,
|
|
1078
|
+
onStop,
|
|
1079
|
+
inputMode,
|
|
1080
|
+
inputValue,
|
|
1081
|
+
onInputChange,
|
|
1082
|
+
onStartTranscribe,
|
|
1083
|
+
onCancelTranscribe,
|
|
1084
|
+
onFinishTranscribe,
|
|
1085
|
+
onFinishTranscribeWithAudio,
|
|
1086
|
+
attachments,
|
|
1087
|
+
onRemoveAttachment,
|
|
1088
|
+
onAddFile,
|
|
1089
|
+
dragOver,
|
|
1090
|
+
onDragOver,
|
|
1091
|
+
onDragLeave,
|
|
1092
|
+
onDrop,
|
|
1093
|
+
isConnecting,
|
|
1094
|
+
hasExplicitThreadId,
|
|
1095
|
+
disclaimer,
|
|
1096
|
+
intelligenceIndicator,
|
|
1097
|
+
children,
|
|
1098
|
+
className,
|
|
1099
|
+
...props
|
|
1100
|
+
}: CopilotChatViewProps): react_jsx_runtime0.JSX.Element;
|
|
1101
|
+
declare namespace CopilotChatView {
|
|
1102
|
+
const ScrollView: React$1.FC<React$1.HTMLAttributes<HTMLDivElement> & {
|
|
1103
|
+
autoScroll?: AutoScrollMode | boolean;
|
|
1104
|
+
scrollThreadId?: string;
|
|
1105
|
+
scrollToBottomButton?: SlotValue<React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>>;
|
|
1106
|
+
feather?: SlotValue<React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>>;
|
|
1107
|
+
inputContainerHeight?: number;
|
|
1108
|
+
isResizing?: boolean;
|
|
1109
|
+
}>;
|
|
245
1110
|
/**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* ```tsx
|
|
249
|
-
* if (isAvailable) {
|
|
250
|
-
* console.log("Loading...");
|
|
251
|
-
* } else {
|
|
252
|
-
* console.log("Not loading");
|
|
253
|
-
* }
|
|
1111
|
+
* Scrolls the message list to the latest message. Shown while the user is
|
|
1112
|
+
* scrolled up; its accessible name is `labels.chatScrollToBottomLabel`.
|
|
254
1113
|
*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
1114
|
+
const ScrollToBottomButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
1115
|
+
const Feather: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
1116
|
+
const WelcomeMessage: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
1117
|
+
const WelcomeScreen: React$1.FC<WelcomeScreenProps>;
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/components/chat/CopilotChat.d.ts
|
|
1121
|
+
type CopilotChatProps = Omit<CopilotChatViewProps, "messages" | "isRunning" | "suggestions" | "suggestionLoadingIndexes" | "onSelectSuggestion" | "attachments" | "onRemoveAttachment" | "onAddFile" | "dragOver" | "onDragOver" | "onDragLeave" | "onDrop"> & {
|
|
1122
|
+
agentId?: string;
|
|
1123
|
+
threadId?: string;
|
|
1124
|
+
labels?: Partial<CopilotChatLabels>;
|
|
262
1125
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
1126
|
+
* Enable Inspector message shortcuts for this chat (enabled by default).
|
|
1127
|
+
* An explicit CopilotKit provider enableInspector value takes priority.
|
|
1128
|
+
* Shortcuts only appear in local development while Inspector is visible.
|
|
265
1129
|
*/
|
|
266
|
-
|
|
1130
|
+
inspectorTools?: boolean; /** Accepts a className, partial props, or any component with CopilotChatView props — static namespace members are not required. */
|
|
1131
|
+
chatView?: SlotValue<React$1.ComponentType<CopilotChatViewProps>>;
|
|
1132
|
+
isModalDefaultOpen?: boolean; /** Enable multimodal file attachments (images, audio, video, documents). */
|
|
1133
|
+
attachments?: AttachmentsConfig$1;
|
|
267
1134
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
1135
|
+
* Error handler scoped to this chat's agent. Fires in addition to the
|
|
1136
|
+
* provider-level onError (does not suppress it). Receives only errors
|
|
1137
|
+
* whose context.agentId matches this chat's agent.
|
|
270
1138
|
*/
|
|
271
|
-
|
|
1139
|
+
onError?: (event: {
|
|
1140
|
+
error: Error;
|
|
1141
|
+
code: CopilotKitCoreErrorCode$1;
|
|
1142
|
+
context: Record<string, any>;
|
|
1143
|
+
}) => void | Promise<void>;
|
|
272
1144
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
1145
|
+
* Throttle interval (in milliseconds) for re-renders triggered by message
|
|
1146
|
+
* change notifications. Overrides the provider-level `defaultThrottleMs`
|
|
1147
|
+
* for this chat instance. Forwarded to the internal `useAgent()` hook,
|
|
1148
|
+
* which resolves the effective throttle value.
|
|
276
1149
|
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
1150
|
+
* @default undefined — inherits from provider `defaultThrottleMs`;
|
|
1151
|
+
* if that is also unset, re-renders are unthrottled. Note: passing
|
|
1152
|
+
* `throttleMs={0}` explicitly disables throttling for this instance
|
|
1153
|
+
* even when the provider specifies a non-zero `defaultThrottleMs`.
|
|
281
1154
|
*/
|
|
282
|
-
|
|
1155
|
+
throttleMs?: number;
|
|
283
1156
|
/**
|
|
284
|
-
*
|
|
285
|
-
*
|
|
1157
|
+
* Experimental. Wrapper for generative UI surfaces rendered in this chat.
|
|
1158
|
+
* Receives `{ surfaceId, isStreaming, error, children }`.
|
|
286
1159
|
*/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
1160
|
+
generativeUISurface?: React$1.ComponentType<GenerativeUIChatSurfaceProps>;
|
|
1161
|
+
};
|
|
1162
|
+
declare function CopilotChat({
|
|
1163
|
+
agentId,
|
|
1164
|
+
threadId,
|
|
1165
|
+
labels,
|
|
1166
|
+
inspectorTools,
|
|
1167
|
+
chatView,
|
|
1168
|
+
isModalDefaultOpen,
|
|
1169
|
+
attachments: attachmentsConfig,
|
|
1170
|
+
onError,
|
|
1171
|
+
throttleMs,
|
|
1172
|
+
generativeUISurface,
|
|
1173
|
+
...props
|
|
1174
|
+
}: CopilotChatProps): react_jsx_runtime0.JSX.Element;
|
|
1175
|
+
declare namespace CopilotChat {
|
|
1176
|
+
const View: typeof CopilotChatView;
|
|
294
1177
|
}
|
|
295
|
-
declare function useCopilotChatInternal({
|
|
296
|
-
suggestions,
|
|
297
|
-
onInProgress,
|
|
298
|
-
onSubmitMessage,
|
|
299
|
-
onStopGeneration,
|
|
300
|
-
onReloadMessages
|
|
301
|
-
}?: UseCopilotChatOptions): UseCopilotChatReturn$1;
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region src/v1-deprecated/hooks/use-copilot-chat.d.ts
|
|
304
|
-
type UseCopilotChatReturn = Omit<UseCopilotChatReturn$1, "messages" | "sendMessage" | "suggestions" | "setSuggestions" | "generateSuggestions" | "isLoadingSuggestions" | "resetSuggestions" | "interrupt" | "setMessages" | "deleteMessage">;
|
|
305
|
-
/**
|
|
306
|
-
* A lightweight React hook for headless chat interactions.
|
|
307
|
-
* Perfect for programmatic messaging, background operations, and custom UI implementations.
|
|
308
|
-
*
|
|
309
|
-
* **Open Source Friendly** - Works without requiring a `publicApiKey`.
|
|
310
|
-
*/
|
|
311
|
-
declare function useCopilotChat(options?: UseCopilotChatOptions): UseCopilotChatReturn;
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region src/v1-deprecated/hooks/use-copilot-chat-headless_c.d.ts
|
|
314
|
-
/**
|
|
315
|
-
* CopilotKit Intelligence React hook that provides complete chat functionality for fully custom UI implementations.
|
|
316
|
-
* Includes all advanced features like direct message access, suggestions array, interrupt handling, and MCP support.
|
|
317
|
-
*
|
|
318
|
-
* @param options - Configuration options for the chat
|
|
319
|
-
* @returns Complete chat interface with all CopilotKit Intelligence features
|
|
320
|
-
*
|
|
321
|
-
* @example
|
|
322
|
-
* ```tsx
|
|
323
|
-
* const { messages, sendMessage, suggestions, interrupt } = useCopilotChatHeadless_c();
|
|
324
|
-
* ```
|
|
325
|
-
*/
|
|
326
|
-
declare function useCopilotChatHeadless_c(options?: UseCopilotChatOptions): UseCopilotChatReturn$1;
|
|
327
|
-
//#endregion
|
|
328
|
-
//#region src/v1-deprecated/hooks/use-copilot-action.d.ts
|
|
329
|
-
/**
|
|
330
|
-
* useCopilotAction is a legacy hook maintained for backwards compatibility.
|
|
331
|
-
*
|
|
332
|
-
* To avoid violating React's Rules of Hooks (which prohibit conditional hook calls),
|
|
333
|
-
* we use a registration pattern:
|
|
334
|
-
* 1. This hook registers the action configuration with the CopilotContext
|
|
335
|
-
* 2. A renderer component in CopilotKit actually renders the appropriate hook wrapper
|
|
336
|
-
* 3. React properly manages hook state since components are rendered, not conditionally called
|
|
337
|
-
*
|
|
338
|
-
* This allows action types to change between renders without corrupting React's hook state.
|
|
339
|
-
*/
|
|
340
|
-
declare function useCopilotAction<const T extends Parameter[] | [] = []>(action: FrontendAction<T> | CatchAllFrontendAction, dependencies?: any[]): void;
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region src/v1-deprecated/hooks/use-coagent-state-render.d.ts
|
|
343
|
-
/**
|
|
344
|
-
* This hook is used to render agent state with custom UI components or text. This is particularly
|
|
345
|
-
* useful for showing intermediate state or progress during Agentic Copilot operations.
|
|
346
|
-
* To get started using rendering intermediate state through this hook, checkout the documentation.
|
|
347
|
-
*
|
|
348
|
-
* https://docs.copilotkit.ai/langgraph-python/shared-state/predictive-state-updates
|
|
349
|
-
*/
|
|
350
|
-
declare function useCoAgentStateRender<T = any>(action: CoAgentStateRender<T>, dependencies?: any[]): void;
|
|
351
1178
|
//#endregion
|
|
352
|
-
//#region src/
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
1179
|
+
//#region src/components/chat/CopilotChatToggleButton.d.ts
|
|
1180
|
+
declare const DefaultOpenIcon: React$1.FC<React$1.SVGProps<SVGSVGElement>>;
|
|
1181
|
+
declare const DefaultCloseIcon: React$1.FC<React$1.SVGProps<SVGSVGElement>>;
|
|
1182
|
+
interface CopilotChatToggleButtonProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
1183
|
+
/** Optional slot override for the chat (closed) icon. */
|
|
1184
|
+
openIcon?: SlotValue<typeof DefaultOpenIcon>;
|
|
1185
|
+
/** Optional slot override for the close icon. */
|
|
1186
|
+
closeIcon?: SlotValue<typeof DefaultCloseIcon>;
|
|
1187
|
+
}
|
|
1188
|
+
declare const CopilotChatToggleButton: React$1.ForwardRefExoticComponent<CopilotChatToggleButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
361
1189
|
//#endregion
|
|
362
|
-
//#region src/
|
|
1190
|
+
//#region src/components/chat/CopilotModalHeader.d.ts
|
|
1191
|
+
type HeaderSlots = {
|
|
1192
|
+
titleContent: typeof CopilotModalHeader.Title;
|
|
1193
|
+
closeButton: typeof CopilotModalHeader.CloseButton;
|
|
1194
|
+
drawerLauncher: typeof CopilotModalHeader.DrawerLauncher;
|
|
1195
|
+
};
|
|
1196
|
+
type HeaderRestProps = {
|
|
1197
|
+
title?: string;
|
|
1198
|
+
} & Omit<React$1.HTMLAttributes<HTMLDivElement>, "children">;
|
|
363
1199
|
/**
|
|
364
|
-
*
|
|
365
|
-
|
|
366
|
-
|
|
1200
|
+
* Payload handed to the optional `children` render function. `drawerLauncher`
|
|
1201
|
+
* is nullable because the launcher is rendered only when a drawer has
|
|
1202
|
+
* registered — when none is present, custom layouts receive `null` and can omit
|
|
1203
|
+
* the launcher slot entirely.
|
|
1204
|
+
*/
|
|
1205
|
+
type HeaderChildrenPayload = {
|
|
1206
|
+
titleContent: React$1.ReactElement;
|
|
1207
|
+
closeButton: React$1.ReactElement;
|
|
1208
|
+
drawerLauncher: React$1.ReactElement | null;
|
|
1209
|
+
title?: string;
|
|
1210
|
+
} & Omit<HeaderRestProps, "title">;
|
|
1211
|
+
type CopilotModalHeaderProps = Omit<WithSlots<HeaderSlots, HeaderRestProps>, "children"> & {
|
|
1212
|
+
children?: (props: HeaderChildrenPayload) => React$1.ReactNode;
|
|
1213
|
+
};
|
|
1214
|
+
declare function CopilotModalHeader({
|
|
1215
|
+
title,
|
|
1216
|
+
titleContent,
|
|
1217
|
+
closeButton,
|
|
1218
|
+
drawerLauncher,
|
|
1219
|
+
children,
|
|
1220
|
+
className,
|
|
1221
|
+
...rest
|
|
1222
|
+
}: CopilotModalHeaderProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
1223
|
+
declare namespace CopilotModalHeader {
|
|
1224
|
+
var displayName: string;
|
|
1225
|
+
}
|
|
1226
|
+
declare namespace CopilotModalHeader {
|
|
1227
|
+
const Title: React$1.FC<React$1.HTMLAttributes<HTMLDivElement>>;
|
|
367
1228
|
/**
|
|
368
|
-
*
|
|
1229
|
+
* Closes the popup or sidebar. Its accessible name is
|
|
1230
|
+
* `labels.modalHeaderCloseButtonLabel`.
|
|
369
1231
|
*/
|
|
370
|
-
|
|
1232
|
+
const CloseButton: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
371
1233
|
/**
|
|
372
|
-
* The
|
|
1234
|
+
* The thread-list launcher button. Rendered in the header ONLY when a
|
|
1235
|
+
* `<CopilotThreadsDrawer>` wrapper has registered with the chat configuration; it
|
|
1236
|
+
* toggles the drawer open state. The stable `data-testid` is the focus-return
|
|
1237
|
+
* target for the drawer wrapper on cancel/back/backdrop/Escape.
|
|
373
1238
|
*/
|
|
374
|
-
|
|
1239
|
+
const DrawerLauncher: React$1.FC<React$1.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
1240
|
+
}
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region src/components/chat/CopilotSidebarView.d.ts
|
|
1243
|
+
type CopilotSidebarViewProps = CopilotChatViewProps & {
|
|
1244
|
+
/** Accepts a className, partial props, or any component with CopilotModalHeader props — static namespace members are not required. */header?: SlotValue<React$1.ComponentType<CopilotModalHeaderProps>>;
|
|
1245
|
+
toggleButton?: SlotValue<typeof CopilotChatToggleButton>;
|
|
1246
|
+
width?: number | string;
|
|
1247
|
+
defaultOpen?: boolean;
|
|
1248
|
+
position?: "left" | "right";
|
|
1249
|
+
};
|
|
1250
|
+
/**
|
|
1251
|
+
* The chat in a side panel: a `complementary` region named by
|
|
1252
|
+
* `labels.sidebarLabel`, with a header, the chat view and a toggle button.
|
|
1253
|
+
*/
|
|
1254
|
+
declare function CopilotSidebarView({
|
|
1255
|
+
header,
|
|
1256
|
+
toggleButton,
|
|
1257
|
+
width,
|
|
1258
|
+
defaultOpen,
|
|
1259
|
+
position,
|
|
1260
|
+
...props
|
|
1261
|
+
}: CopilotSidebarViewProps): react_jsx_runtime0.JSX.Element;
|
|
1262
|
+
declare namespace CopilotSidebarView {
|
|
1263
|
+
var displayName: string;
|
|
1264
|
+
}
|
|
1265
|
+
declare namespace CopilotSidebarView {
|
|
375
1266
|
/**
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* Accepted for source compatibility only.
|
|
1267
|
+
* Sidebar-specific welcome screen layout:
|
|
1268
|
+
* - Suggestions at the top
|
|
1269
|
+
* - Welcome message in the middle
|
|
1270
|
+
* - Input fixed at the bottom (like normal chat)
|
|
381
1271
|
*/
|
|
382
|
-
|
|
1272
|
+
const WelcomeScreen: React$1.FC<WelcomeScreenProps>;
|
|
1273
|
+
}
|
|
1274
|
+
//#endregion
|
|
1275
|
+
//#region src/components/chat/CopilotPopupView.d.ts
|
|
1276
|
+
type CopilotPopupViewProps = CopilotChatViewProps & {
|
|
1277
|
+
/** Accepts a className, partial props, or any component with CopilotModalHeader props — static namespace members are not required. */header?: SlotValue<React$1.ComponentType<CopilotModalHeaderProps>>;
|
|
1278
|
+
toggleButton?: SlotValue<typeof CopilotChatToggleButton>;
|
|
1279
|
+
width?: number | string;
|
|
1280
|
+
height?: number | string;
|
|
1281
|
+
clickOutsideToClose?: boolean;
|
|
1282
|
+
defaultOpen?: boolean;
|
|
1283
|
+
};
|
|
1284
|
+
declare function CopilotPopupView({
|
|
1285
|
+
header,
|
|
1286
|
+
toggleButton,
|
|
1287
|
+
width,
|
|
1288
|
+
height,
|
|
1289
|
+
clickOutsideToClose,
|
|
1290
|
+
defaultOpen,
|
|
1291
|
+
className,
|
|
1292
|
+
...restProps
|
|
1293
|
+
}: CopilotPopupViewProps): react_jsx_runtime0.JSX.Element;
|
|
1294
|
+
declare namespace CopilotPopupView {
|
|
1295
|
+
var displayName: string;
|
|
1296
|
+
}
|
|
1297
|
+
declare namespace CopilotPopupView {
|
|
383
1298
|
/**
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* hook does not filter by category. Accepted for source compatibility only.
|
|
1299
|
+
* Popup-specific welcome screen layout:
|
|
1300
|
+
* - Welcome message centered vertically
|
|
1301
|
+
* - Suggestions just above input
|
|
1302
|
+
* - Input fixed at the bottom
|
|
389
1303
|
*/
|
|
390
|
-
|
|
1304
|
+
const WelcomeScreen: React$1.FC<WelcomeScreenProps>;
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region src/components/chat/CopilotSidebar.d.ts
|
|
1308
|
+
type CopilotSidebarProps = Omit<CopilotChatProps, "chatView"> & {
|
|
1309
|
+
header?: CopilotSidebarViewProps["header"];
|
|
1310
|
+
toggleButton?: CopilotSidebarViewProps["toggleButton"];
|
|
1311
|
+
defaultOpen?: boolean;
|
|
391
1312
|
/**
|
|
392
|
-
*
|
|
1313
|
+
* Controlled open state. When supplied, the host owns whether the sidebar is
|
|
1314
|
+
* open: the sidebar renders this value and never changes it on its own.
|
|
1315
|
+
* Pair it with `onOpenChange` to react to the toggle button. Omit it (and use
|
|
1316
|
+
* `defaultOpen`) to let the sidebar manage its own state.
|
|
393
1317
|
*/
|
|
394
|
-
|
|
1318
|
+
open?: boolean;
|
|
395
1319
|
/**
|
|
396
|
-
*
|
|
397
|
-
*
|
|
1320
|
+
* Called with the requested state whenever the sidebar asks to open or close
|
|
1321
|
+
* (the toggle button, or the thread drawer on mobile). In controlled mode
|
|
1322
|
+
* nothing moves until the host updates `open`.
|
|
398
1323
|
*/
|
|
399
|
-
|
|
1324
|
+
onOpenChange?: (open: boolean) => void;
|
|
1325
|
+
width?: number | string;
|
|
1326
|
+
position?: CopilotSidebarViewProps["position"];
|
|
1327
|
+
};
|
|
1328
|
+
declare function CopilotSidebar({
|
|
1329
|
+
header,
|
|
1330
|
+
toggleButton,
|
|
1331
|
+
defaultOpen,
|
|
1332
|
+
open,
|
|
1333
|
+
onOpenChange,
|
|
1334
|
+
width,
|
|
1335
|
+
position,
|
|
1336
|
+
...chatProps
|
|
1337
|
+
}: CopilotSidebarProps): react_jsx_runtime0.JSX.Element;
|
|
1338
|
+
declare namespace CopilotSidebar {
|
|
1339
|
+
var displayName: string;
|
|
400
1340
|
}
|
|
401
|
-
/**
|
|
402
|
-
* Adds the given information to the Copilot context to make it readable by Copilot.
|
|
403
|
-
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
|
|
404
|
-
*
|
|
405
|
-
* ```tsx
|
|
406
|
-
* import { useAgentContext } from "@copilotkit/react-core/v2";
|
|
407
|
-
*
|
|
408
|
-
* function UserContext() {
|
|
409
|
-
* useAgentContext({
|
|
410
|
-
* description: "The current user",
|
|
411
|
-
* value: { name: "Ada" },
|
|
412
|
-
* });
|
|
413
|
-
* return null;
|
|
414
|
-
* }
|
|
415
|
-
* ```
|
|
416
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
|
|
417
|
-
*/
|
|
418
|
-
declare function useCopilotReadable({
|
|
419
|
-
description,
|
|
420
|
-
value,
|
|
421
|
-
convert,
|
|
422
|
-
available
|
|
423
|
-
}: UseCopilotReadableOptions, dependencies?: any[]): string | undefined;
|
|
424
1341
|
//#endregion
|
|
425
|
-
//#region src/
|
|
426
|
-
|
|
1342
|
+
//#region src/components/chat/CopilotPopup.d.ts
|
|
1343
|
+
type CopilotPopupProps = Omit<CopilotChatProps, "chatView"> & {
|
|
1344
|
+
header?: CopilotPopupViewProps["header"];
|
|
1345
|
+
toggleButton?: CopilotPopupViewProps["toggleButton"];
|
|
1346
|
+
defaultOpen?: boolean;
|
|
427
1347
|
/**
|
|
428
|
-
*
|
|
1348
|
+
* Controlled open state. When supplied, the host owns whether the popup is
|
|
1349
|
+
* open: the popup renders this value and never changes it on its own. Pair it
|
|
1350
|
+
* with `onOpenChange` to react to the toggle button and to click-outside.
|
|
1351
|
+
* Omit it (and use `defaultOpen`) to let the popup manage its own state.
|
|
429
1352
|
*/
|
|
430
|
-
|
|
1353
|
+
open?: boolean;
|
|
431
1354
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
1355
|
+
* Called with the requested state whenever the popup asks to open or close
|
|
1356
|
+
* (the toggle button, click-outside, or the thread drawer on mobile). In
|
|
1357
|
+
* controlled mode nothing moves until the host updates `open`.
|
|
434
1358
|
*/
|
|
435
|
-
|
|
1359
|
+
onOpenChange?: (open: boolean) => void;
|
|
1360
|
+
width?: CopilotPopupViewProps["width"];
|
|
1361
|
+
height?: CopilotPopupViewProps["height"];
|
|
1362
|
+
clickOutsideToClose?: CopilotPopupViewProps["clickOutsideToClose"];
|
|
1363
|
+
};
|
|
1364
|
+
declare function CopilotPopup({
|
|
1365
|
+
header,
|
|
1366
|
+
toggleButton,
|
|
1367
|
+
defaultOpen,
|
|
1368
|
+
open,
|
|
1369
|
+
onOpenChange,
|
|
1370
|
+
width,
|
|
1371
|
+
height,
|
|
1372
|
+
clickOutsideToClose,
|
|
1373
|
+
...chatProps
|
|
1374
|
+
}: CopilotPopupProps): react_jsx_runtime0.JSX.Element;
|
|
1375
|
+
declare namespace CopilotPopup {
|
|
1376
|
+
var displayName: string;
|
|
1377
|
+
}
|
|
1378
|
+
//#endregion
|
|
1379
|
+
//#region src/hooks/use-threads.d.ts
|
|
1380
|
+
/**
|
|
1381
|
+
* A conversation thread managed by CopilotKit Intelligence.
|
|
1382
|
+
*
|
|
1383
|
+
* Each thread has a unique `id`, an optional human-readable `name`, and
|
|
1384
|
+
* timestamp fields tracking creation and update times.
|
|
1385
|
+
*/
|
|
1386
|
+
interface Thread {
|
|
1387
|
+
id: string;
|
|
1388
|
+
agentId: string;
|
|
1389
|
+
name: string | null;
|
|
1390
|
+
archived: boolean;
|
|
1391
|
+
createdAt: string;
|
|
1392
|
+
updatedAt: string;
|
|
436
1393
|
/**
|
|
437
|
-
*
|
|
1394
|
+
* ISO-8601 timestamp of the most recent agent run on this thread. Absent
|
|
1395
|
+
* when the thread has never been run. Prefer this over `updatedAt` for
|
|
1396
|
+
* user-facing "last activity" displays — it is not bumped by metadata-only
|
|
1397
|
+
* actions like rename or archive.
|
|
438
1398
|
*/
|
|
439
|
-
|
|
440
|
-
configurable?: Record<string, any>;
|
|
441
|
-
[key: string]: any;
|
|
442
|
-
};
|
|
1399
|
+
lastRunAt?: string;
|
|
443
1400
|
}
|
|
444
|
-
|
|
1401
|
+
/**
|
|
1402
|
+
* Configuration for the {@link useThreads} hook.
|
|
1403
|
+
*
|
|
1404
|
+
* Thread operations are scoped to the runtime-authenticated user and the
|
|
1405
|
+
* provided agent on CopilotKit Intelligence.
|
|
1406
|
+
*/
|
|
1407
|
+
interface UseThreadsInput {
|
|
1408
|
+
/** The ID of the agent whose threads to list and manage. */
|
|
1409
|
+
agentId: string;
|
|
1410
|
+
/** When `true`, archived threads are included in the list. Defaults to `false`. */
|
|
1411
|
+
includeArchived?: boolean;
|
|
1412
|
+
/** Maximum number of threads to fetch per page. When set, enables cursor-based pagination. */
|
|
1413
|
+
limit?: number;
|
|
445
1414
|
/**
|
|
446
|
-
*
|
|
1415
|
+
* When `false`, the hook stays inert: no runtime context is dispatched, so
|
|
1416
|
+
* NO thread-list fetch or realtime subscription is issued. Used by gated
|
|
1417
|
+
* surfaces (e.g. an unlicensed `<CopilotThreadsDrawer>`) that must not touch the
|
|
1418
|
+
* network until the gate opens. Defaults to `true`.
|
|
1419
|
+
*
|
|
1420
|
+
* Flipping `enabled` back to `true` resumes normal fetching on the next
|
|
1421
|
+
* effect run; mutations are likewise short-circuited while disabled.
|
|
447
1422
|
*/
|
|
448
|
-
|
|
1423
|
+
enabled?: boolean;
|
|
449
1424
|
}
|
|
450
|
-
|
|
1425
|
+
/**
|
|
1426
|
+
* Return value of the {@link useThreads} hook.
|
|
1427
|
+
*
|
|
1428
|
+
* The `threads` array is kept in sync with the platform via a realtime
|
|
1429
|
+
* WebSocket subscription (when available) and is sorted most-recently-updated
|
|
1430
|
+
* first. Mutations reject with an `Error` if the platform request fails.
|
|
1431
|
+
*/
|
|
1432
|
+
interface UseThreadsResult {
|
|
451
1433
|
/**
|
|
452
|
-
*
|
|
1434
|
+
* Threads for the current user/agent pair, sorted by most recently
|
|
1435
|
+
* updated first. Updated in realtime when the platform pushes metadata
|
|
1436
|
+
* events. Includes archived threads only when `includeArchived` is set.
|
|
453
1437
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
1438
|
+
threads: Thread[];
|
|
1439
|
+
/**
|
|
1440
|
+
* `true` while the initial thread list is being fetched from the platform.
|
|
1441
|
+
* Subsequent realtime updates do not re-enter the loading state.
|
|
1442
|
+
*/
|
|
1443
|
+
isLoading: boolean;
|
|
457
1444
|
/**
|
|
458
|
-
* The
|
|
1445
|
+
* The most recent error from fetching threads or executing a mutation,
|
|
1446
|
+
* or `null` when there is no error. Reset to `null` on the next
|
|
1447
|
+
* successful fetch.
|
|
1448
|
+
*
|
|
1449
|
+
* This channel folds together developer/config errors (missing runtime URL,
|
|
1450
|
+
* runtime without thread endpoints) and genuine list-load/mutation failures.
|
|
1451
|
+
* End-user surfaces that must not leak config errors should prefer
|
|
1452
|
+
* {@link listError}, which excludes the config/runtime-setup errors.
|
|
459
1453
|
*/
|
|
460
|
-
|
|
1454
|
+
error: Error | null;
|
|
461
1455
|
/**
|
|
462
|
-
*
|
|
1456
|
+
* The most recent genuine list-load or mutation error from the platform, or
|
|
1457
|
+
* `null`. Unlike {@link error}, this EXCLUDES developer/config errors (a
|
|
1458
|
+
* missing runtime URL, or a runtime that does not advertise thread
|
|
1459
|
+
* endpoints), so an end-user surface can render it directly without leaking
|
|
1460
|
+
* a developer-facing configuration message into the UI.
|
|
463
1461
|
*/
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
type UseCoagentOptions<T> = WithInternalStateManagementAndInitial<T> | WithInternalStateManagement | WithExternalStateManagement<T>;
|
|
467
|
-
interface UseCoagentReturnType<T> {
|
|
1462
|
+
listError: Error | null;
|
|
468
1463
|
/**
|
|
469
|
-
* The
|
|
1464
|
+
* The error from the most recent FAILED next-page (fetch-more) load, or
|
|
1465
|
+
* `null`. Tracked separately from {@link listError} so a paginated-load
|
|
1466
|
+
* failure surfaces an inline "couldn't load more" affordance while the
|
|
1467
|
+
* already-loaded list stays visible. Cleared when a fetch-more is retried or
|
|
1468
|
+
* succeeds.
|
|
470
1469
|
*/
|
|
471
|
-
|
|
1470
|
+
fetchMoreError: Error | null;
|
|
472
1471
|
/**
|
|
473
|
-
*
|
|
1472
|
+
* `true` when there are more threads available to fetch via
|
|
1473
|
+
* {@link fetchMoreThreads}. Only meaningful when `limit` is set.
|
|
474
1474
|
*/
|
|
475
|
-
|
|
1475
|
+
hasMoreThreads: boolean;
|
|
476
1476
|
/**
|
|
477
|
-
*
|
|
1477
|
+
* `true` while a subsequent page of threads is being fetched.
|
|
478
1478
|
*/
|
|
479
|
-
|
|
1479
|
+
isFetchingMoreThreads: boolean;
|
|
480
1480
|
/**
|
|
481
|
-
*
|
|
1481
|
+
* `true` while at least one thread mutation (rename, archive, unarchive,
|
|
1482
|
+
* delete) is awaiting a server response. Mutations apply optimistically, so
|
|
1483
|
+
* this is primarily useful for disabling controls or showing a subtle
|
|
1484
|
+
* in-flight indicator.
|
|
482
1485
|
*/
|
|
483
|
-
|
|
1486
|
+
isMutating: boolean;
|
|
484
1487
|
/**
|
|
485
|
-
*
|
|
1488
|
+
* Fetch the next page of threads. No-op when {@link hasMoreThreads} is
|
|
1489
|
+
* `false` or a fetch is already in progress.
|
|
486
1490
|
*/
|
|
487
|
-
|
|
1491
|
+
fetchMoreThreads: () => void;
|
|
488
1492
|
/**
|
|
489
|
-
*
|
|
1493
|
+
* Re-fetch the thread list from the platform without clearing the current
|
|
1494
|
+
* list. Backs the drawer's error-state Retry and the Active/All filter
|
|
1495
|
+
* refetch. No-op until the runtime is connected.
|
|
490
1496
|
*/
|
|
491
|
-
|
|
1497
|
+
refetchThreads: () => void;
|
|
492
1498
|
/**
|
|
493
|
-
*
|
|
1499
|
+
* Reset to a fresh, non-explicit client-side thread so the welcome screen
|
|
1500
|
+
* shows. Lazy creation: no row appears in {@link threads} until the new
|
|
1501
|
+
* thread's first run persists server-side.
|
|
494
1502
|
*/
|
|
495
|
-
|
|
1503
|
+
startNewThread: () => void;
|
|
496
1504
|
/**
|
|
497
|
-
*
|
|
1505
|
+
* Rename a thread on the platform.
|
|
1506
|
+
* Resolves when the server confirms the update; rejects on failure.
|
|
498
1507
|
*/
|
|
499
|
-
|
|
1508
|
+
renameThread: (threadId: string, name: string) => Promise<void>;
|
|
500
1509
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
* `forwardedProps` and `runId` from its first argument; the core builds the
|
|
505
|
-
* tools and context itself. A failed run does not reject: the core reports
|
|
506
|
-
* the error to its error subscribers (code `AGENT_RUN_FAILED`) and resolves
|
|
507
|
-
* with an empty result.
|
|
1510
|
+
* Archive a thread on the platform.
|
|
1511
|
+
* Archived threads are excluded from subsequent list results.
|
|
1512
|
+
* Resolves when the server confirms the update; rejects on failure.
|
|
508
1513
|
*/
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
interface HintFunctionParams {
|
|
1514
|
+
archiveThread: (threadId: string) => Promise<void>;
|
|
512
1515
|
/**
|
|
513
|
-
*
|
|
1516
|
+
* Restore a previously archived thread on the platform.
|
|
1517
|
+
* The thread re-appears in default (non-archived) list results.
|
|
1518
|
+
* Resolves when the server confirms the update; rejects on failure.
|
|
514
1519
|
*/
|
|
515
|
-
|
|
1520
|
+
unarchiveThread: (threadId: string) => Promise<void>;
|
|
516
1521
|
/**
|
|
517
|
-
*
|
|
1522
|
+
* Permanently delete a thread from the platform.
|
|
1523
|
+
* This is irreversible. Resolves when the server confirms deletion;
|
|
1524
|
+
* rejects on failure.
|
|
518
1525
|
*/
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
type HintFunction = (params: HintFunctionParams) => Message | undefined;
|
|
522
|
-
/**
|
|
523
|
-
* This hook is used to integrate an agent into your application. With its use, you can
|
|
524
|
-
* render and update the state of the agent, allowing for a dynamic and interactive experience.
|
|
525
|
-
* We call these shared state experiences "agentic copilots". To get started using agentic copilots, which
|
|
526
|
-
* we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/langgraph-python/quickstart.
|
|
527
|
-
*/
|
|
528
|
-
declare function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T>;
|
|
529
|
-
//#endregion
|
|
530
|
-
//#region src/v1-deprecated/hooks/use-copilot-runtime-client.d.ts
|
|
531
|
-
interface CopilotRuntimeClientHookOptions extends CopilotRuntimeClientOptions {
|
|
532
|
-
showDevConsole?: boolean;
|
|
533
|
-
onError: CopilotErrorHandler;
|
|
1526
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
534
1527
|
}
|
|
535
|
-
declare const useCopilotRuntimeClient: (options: CopilotRuntimeClientHookOptions) => CopilotRuntimeClient;
|
|
536
|
-
//#endregion
|
|
537
|
-
//#region src/v1-deprecated/hooks/use-copilot-authenticated-action.d.ts
|
|
538
1528
|
/**
|
|
539
|
-
*
|
|
1529
|
+
* React hook for listing and managing CopilotKit Intelligence threads.
|
|
540
1530
|
*
|
|
541
|
-
*
|
|
1531
|
+
* On mount the hook fetches the thread list for the runtime-authenticated user
|
|
1532
|
+
* and the given `agentId`. When CopilotKit Intelligence exposes a WebSocket
|
|
1533
|
+
* URL, it also opens a realtime subscription so the `threads` array stays
|
|
1534
|
+
* current without polling — thread creates, renames, archives, and deletes
|
|
1535
|
+
* from any client are reflected immediately.
|
|
542
1536
|
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
|
|
546
|
-
declare function useCopilotAuthenticatedAction_c<T extends Parameter[]>(action: FrontendAction<T>, dependencies?: any[]): void;
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/v1-deprecated/hooks/use-langgraph-interrupt.d.ts
|
|
549
|
-
/**
|
|
550
|
-
* @deprecated The v1 SDK is deprecated. Use v2 instead. Use `useInterrupt` from `@copilotkit/react-core/v2` instead.
|
|
1537
|
+
* Mutation methods (`renameThread`, `archiveThread`, `unarchiveThread`,
|
|
1538
|
+
* `deleteThread`) return promises that resolve once the platform confirms the
|
|
1539
|
+
* operation and reject with an `Error` on failure.
|
|
551
1540
|
*
|
|
1541
|
+
* @param input - Agent identifier and optional list controls.
|
|
1542
|
+
* @returns Thread list state and stable mutation callbacks.
|
|
1543
|
+
*
|
|
1544
|
+
* @example
|
|
552
1545
|
* ```tsx
|
|
553
|
-
* import {
|
|
1546
|
+
* import { useThreads } from "@copilotkit/react-core";
|
|
554
1547
|
*
|
|
555
|
-
* function
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
* <button onClick={() => resolve({ approved: true })}>Approve</button>
|
|
559
|
-
* ),
|
|
1548
|
+
* function ThreadList() {
|
|
1549
|
+
* const { threads, isLoading, renameThread, deleteThread } = useThreads({
|
|
1550
|
+
* agentId: "agent-1",
|
|
560
1551
|
* });
|
|
561
|
-
*
|
|
1552
|
+
*
|
|
1553
|
+
* if (isLoading) return <p>Loading…</p>;
|
|
1554
|
+
*
|
|
1555
|
+
* return (
|
|
1556
|
+
* <ul>
|
|
1557
|
+
* {threads.map((t) => (
|
|
1558
|
+
* <li key={t.id}>
|
|
1559
|
+
* {t.name ?? "Untitled"}
|
|
1560
|
+
* <button onClick={() => renameThread(t.id, "New name")}>Rename</button>
|
|
1561
|
+
* <button onClick={() => deleteThread(t.id)}>Delete</button>
|
|
1562
|
+
* </li>
|
|
1563
|
+
* ))}
|
|
1564
|
+
* </ul>
|
|
1565
|
+
* );
|
|
562
1566
|
* }
|
|
563
1567
|
* ```
|
|
564
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useInterrupt
|
|
565
1568
|
*/
|
|
566
|
-
declare function
|
|
1569
|
+
declare function useThreads({
|
|
1570
|
+
agentId,
|
|
1571
|
+
includeArchived,
|
|
1572
|
+
limit,
|
|
1573
|
+
enabled
|
|
1574
|
+
}: UseThreadsInput): UseThreadsResult;
|
|
567
1575
|
//#endregion
|
|
568
|
-
//#region src/
|
|
1576
|
+
//#region src/components/chat/CopilotThreadsDrawer.d.ts
|
|
1577
|
+
/**
|
|
1578
|
+
* Per-row content render function. Receives a thread and returns the React
|
|
1579
|
+
* node to project into the element's `slot="row:{id}"`. Returning `null`
|
|
1580
|
+
* (or omitting the prop) falls back to the element's built-in row name.
|
|
1581
|
+
*/
|
|
1582
|
+
type CopilotThreadsDrawerRowRenderer = (thread: Thread) => React$1.ReactNode;
|
|
569
1583
|
/**
|
|
570
|
-
*
|
|
1584
|
+
* Props for {@link CopilotThreadsDrawer}.
|
|
1585
|
+
*
|
|
1586
|
+
* The drawer is a thin controller around the framework-agnostic
|
|
1587
|
+
* `<copilotkit-threads-drawer>` custom element. It feeds the element domain data
|
|
1588
|
+
* (threads/loading/error from {@link useThreads}, the active thread from the
|
|
1589
|
+
* chat configuration) and routes the element's outbound DOM events back into
|
|
1590
|
+
* core thread operations and chat-configuration changes.
|
|
571
1591
|
*/
|
|
572
|
-
interface
|
|
1592
|
+
interface CopilotThreadsDrawerProps {
|
|
573
1593
|
/**
|
|
574
|
-
* The
|
|
575
|
-
*
|
|
576
|
-
* ```txt
|
|
577
|
-
* You are a helpful assistant.
|
|
578
|
-
* Additionally, follow these instructions:
|
|
579
|
-
* - Do not answer questions about the weather.
|
|
580
|
-
* - Do not answer questions about the stock market.
|
|
581
|
-
* ```
|
|
1594
|
+
* The agent whose threads to list and manage. Defaults to the agent of the
|
|
1595
|
+
* surrounding chat configuration, or the platform default when none is set.
|
|
582
1596
|
*/
|
|
583
|
-
|
|
1597
|
+
agentId?: string;
|
|
584
1598
|
/**
|
|
585
|
-
*
|
|
1599
|
+
* Optional escape-hatch called when the user picks a thread row. The wrapper
|
|
1600
|
+
* additionally focuses the chat input. When omitted, the wrapper drives the
|
|
1601
|
+
* surrounding chat configuration directly (`setActiveThreadId`), so a bare
|
|
1602
|
+
* `<CopilotThreadsDrawer>` switches the rendered thread with no host wiring. Provide
|
|
1603
|
+
* this only to take control of the active thread yourself (e.g. a v1
|
|
1604
|
+
* `setThreadId`); when provided it is preferred over the provider.
|
|
586
1605
|
*/
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1606
|
+
onThreadSelect?: (threadId: string) => void;
|
|
1607
|
+
/**
|
|
1608
|
+
* Optional escape-hatch called when the user starts a new thread (the
|
|
1609
|
+
* element's "+ New" button). The wrapper always resets the core thread store
|
|
1610
|
+
* to a fresh, non-explicit client-side thread (`startNewThread`). When this
|
|
1611
|
+
* is omitted, the wrapper also resets the surrounding chat configuration to a
|
|
1612
|
+
* fresh non-explicit thread (`startNewThread`) so the welcome screen shows
|
|
1613
|
+
* with no host wiring. Provide this only to clear your own active thread;
|
|
1614
|
+
* when provided it is preferred over the provider.
|
|
1615
|
+
*/
|
|
1616
|
+
onNewThread?: () => void;
|
|
1617
|
+
/** Called when the Upgrade CTA is clicked. */
|
|
1618
|
+
onLicensed?: () => void;
|
|
1619
|
+
/**
|
|
1620
|
+
* Destination the locked view's Upgrade CTA opens in a new tab. Defaults to
|
|
1621
|
+
* the element's built-in CopilotKit Intelligence docs URL when omitted. Set
|
|
1622
|
+
* to an empty string to suppress the default navigation and handle the click
|
|
1623
|
+
* yourself via `onLicensed`.
|
|
1624
|
+
*/
|
|
1625
|
+
licenseUrl?: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* Optional per-row content. Rendered as light-DOM children with
|
|
1628
|
+
* `slot="row:{id}"` so the element projects them in place of the default
|
|
1629
|
+
* row name. Return `null` for a given row to keep the element's default.
|
|
1630
|
+
*/
|
|
1631
|
+
renderRow?: CopilotThreadsDrawerRowRenderer;
|
|
1632
|
+
/**
|
|
1633
|
+
* Accessible + default-header label for the drawer region. Sets the custom
|
|
1634
|
+
* element's `aria-label` and the default header text (shown when no
|
|
1635
|
+
* `slot="header"` content is projected). Defaults to the element's built-in
|
|
1636
|
+
* `"Threads"` when omitted.
|
|
1637
|
+
*/
|
|
1638
|
+
label?: string;
|
|
1639
|
+
/**
|
|
1640
|
+
* Heading for the "Recent Conversations" section above the thread list. Sets
|
|
1641
|
+
* the custom element's `recent-label` attribute. Defaults to the element's
|
|
1642
|
+
* built-in `"Recent Conversations"` when omitted.
|
|
1643
|
+
*/
|
|
1644
|
+
recentLabel?: string;
|
|
1645
|
+
/**
|
|
1646
|
+
* Whether the drawer offers a collapse toggle. Sets the custom element's
|
|
1647
|
+
* `collapsible` PROPERTY. When `false`, the drawer has no collapse toggle and
|
|
1648
|
+
* is always expanded. Defaults to the element's built-in `true` when omitted.
|
|
1649
|
+
*/
|
|
1650
|
+
collapsible?: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* Called when the drawer's collapsed state changes (via the element's collapse
|
|
1653
|
+
* toggle), with the new collapsed state. Mirrors the element's
|
|
1654
|
+
* `collapse-change` event.
|
|
1655
|
+
*/
|
|
1656
|
+
onCollapseChange?: (collapsed: boolean) => void;
|
|
1657
|
+
/**
|
|
1658
|
+
* Page size for thread pagination. When set, threads are fetched in pages of
|
|
1659
|
+
* this size and the drawer shows a "Load more" control while more remain.
|
|
1660
|
+
* When omitted, the full list loads at once and no pagination control shows.
|
|
1661
|
+
*/
|
|
1662
|
+
limit?: number;
|
|
1663
|
+
/**
|
|
1664
|
+
* `data-testid` set on the underlying custom element (handy in tests and for
|
|
1665
|
+
* targeting from a host page). Defaults to `"copilot-threads-drawer"`.
|
|
1666
|
+
*/
|
|
1667
|
+
"data-testid"?: string;
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* React wrapper for the shadow-DOM `<copilotkit-threads-drawer>` threads drawer.
|
|
1671
|
+
*
|
|
1672
|
+
* Responsibilities:
|
|
1673
|
+
* - Registers the custom element on the client (SSR-safe; nothing renders
|
|
1674
|
+
* during prerender to avoid hydration mismatch).
|
|
1675
|
+
* - Feeds the element domain data: `threads`, `loading`, `error`,
|
|
1676
|
+
* `activeThreadId`, `licensed`, fetch-more state.
|
|
1677
|
+
* - Routes the element's outbound events to core thread operations
|
|
1678
|
+
* ({@link useThreads}) and chat-configuration changes.
|
|
1679
|
+
* - Registers with the surrounding chat configuration so the header
|
|
1680
|
+
* thread-list launcher appears, and binds the element `open` state to the
|
|
1681
|
+
* configuration's `drawerOpen`.
|
|
1682
|
+
*
|
|
1683
|
+
* Intelligence gating is two-pronged: the locked view shows when the runtime
|
|
1684
|
+
* reports no active entitlement OR the `threads` feature is unavailable. While
|
|
1685
|
+
* unavailable, the thread fetch is skipped entirely so the drawer issues no
|
|
1686
|
+
* network requests.
|
|
1687
|
+
*
|
|
1688
|
+
* Thread switching needs no host wiring: when `onThreadSelect`/`onNewThread`
|
|
1689
|
+
* are omitted, the wrapper drives the surrounding chat configuration directly
|
|
1690
|
+
* ({@link CopilotChatConfigurationValue.setActiveThreadId} /
|
|
1691
|
+
* {@link CopilotChatConfigurationValue.startNewThread}), so a bare drawer
|
|
1692
|
+
* connects to the picked thread and shows the welcome screen on "+ New". Pass
|
|
1693
|
+
* the callbacks only to take control yourself.
|
|
1694
|
+
*
|
|
1695
|
+
* @example
|
|
1696
|
+
* ```tsx
|
|
1697
|
+
* // Callback-free: the drawer drives the chat configuration itself.
|
|
1698
|
+
* <CopilotKitProvider runtimeUrl="/api/copilotkit">
|
|
1699
|
+
* <CopilotChat />
|
|
1700
|
+
* <CopilotThreadsDrawer />
|
|
1701
|
+
* </CopilotKitProvider>
|
|
1702
|
+
* ```
|
|
1703
|
+
*/
|
|
1704
|
+
declare function CopilotThreadsDrawer({
|
|
1705
|
+
agentId,
|
|
1706
|
+
onThreadSelect,
|
|
1707
|
+
onNewThread,
|
|
1708
|
+
onLicensed,
|
|
1709
|
+
licenseUrl,
|
|
1710
|
+
renderRow,
|
|
1711
|
+
label,
|
|
1712
|
+
recentLabel,
|
|
1713
|
+
collapsible,
|
|
1714
|
+
onCollapseChange,
|
|
1715
|
+
limit,
|
|
1716
|
+
"data-testid": dataTestId
|
|
1717
|
+
}: CopilotThreadsDrawerProps): React$1.ReactElement | null;
|
|
1718
|
+
declare namespace CopilotThreadsDrawer {
|
|
1719
|
+
var displayName: string;
|
|
1720
|
+
}
|
|
1721
|
+
//#endregion
|
|
1722
|
+
//#region src/components/chat/CopilotChatAttachmentQueue.d.ts
|
|
1723
|
+
interface CopilotChatAttachmentQueueProps {
|
|
1724
|
+
attachments: Attachment$1[];
|
|
1725
|
+
onRemoveAttachment: (id: string) => void;
|
|
1726
|
+
className?: string;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* The attachments queued in the composer, each with a preview and a remove
|
|
1730
|
+
* button named by `labels.attachmentRemoveButtonLabel`.
|
|
1731
|
+
*/
|
|
1732
|
+
declare const CopilotChatAttachmentQueue: React$1.FC<CopilotChatAttachmentQueueProps>;
|
|
1733
|
+
//#endregion
|
|
1734
|
+
//#region src/components/chat/CopilotChatAttachmentRenderer.d.ts
|
|
1735
|
+
interface CopilotChatAttachmentRendererProps {
|
|
1736
|
+
type: "image" | "audio" | "video" | "document";
|
|
1737
|
+
source: InputContentSource$1;
|
|
1738
|
+
filename?: string;
|
|
1739
|
+
className?: string;
|
|
1740
|
+
}
|
|
1741
|
+
declare const CopilotChatAttachmentRenderer: React$1.FC<CopilotChatAttachmentRendererProps>;
|
|
1742
|
+
//#endregion
|
|
1743
|
+
//#region src/components/WildcardToolCallRender.d.ts
|
|
1744
|
+
/**
|
|
1745
|
+
* Catch-all (`"*"`) tool-call renderer that shows CopilotKit's default
|
|
1746
|
+
* tool-call card for any tool without a dedicated renderer.
|
|
1747
|
+
*/
|
|
1748
|
+
declare const WildcardToolCallRender: ReactToolCallRenderer<any>;
|
|
1749
|
+
//#endregion
|
|
1750
|
+
//#region src/components/CopilotKitInspectorContext.d.ts
|
|
1751
|
+
type CopilotKitInspectorOpenRequest = {
|
|
1752
|
+
messageId: string;
|
|
1753
|
+
threadId?: string;
|
|
1754
|
+
agentId?: string;
|
|
1755
|
+
};
|
|
1756
|
+
//#endregion
|
|
1757
|
+
//#region src/components/CopilotKitInspector.d.ts
|
|
1758
|
+
interface CopilotKitInspectorProps {
|
|
1759
|
+
core?: CopilotKitCore$1 | null;
|
|
1760
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
1761
|
+
openRequest?: CopilotKitInspectorOpenRequest | null;
|
|
1762
|
+
}
|
|
1763
|
+
declare const CopilotKitInspector: react.FC<CopilotKitInspectorProps>;
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region src/components/MCPAppsActivityRenderer.d.ts
|
|
1766
|
+
/**
|
|
1767
|
+
* Props for the activity renderer component
|
|
1768
|
+
*/
|
|
1769
|
+
interface MCPAppsActivityRendererProps {
|
|
1770
|
+
activityType: string;
|
|
1771
|
+
content: MCPAppsActivityContent$1;
|
|
1772
|
+
message: unknown;
|
|
1773
|
+
agent: AbstractAgent$1 | undefined;
|
|
1774
|
+
/**
|
|
1775
|
+
* Restore `allow-same-origin` on the sandbox. Unsafe: the widget runs with
|
|
1776
|
+
* the host page's origin. Set via `mcpApps.allowSameOriginFallback` on
|
|
1777
|
+
* `CopilotKitProvider`.
|
|
1778
|
+
*/
|
|
1779
|
+
allowSameOriginFallback?: boolean;
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* MCP Apps Extension Activity Renderer
|
|
1783
|
+
*
|
|
1784
|
+
* Renders MCP Apps UI in a sandboxed iframe with full protocol support.
|
|
1785
|
+
* Fetches resource content on-demand via proxied MCP requests. The React shell
|
|
1786
|
+
* owns the iframe; `bindMcpApp` owns the protocol.
|
|
1787
|
+
*/
|
|
1788
|
+
declare const MCPAppsActivityRenderer: React$1.FC<MCPAppsActivityRendererProps>;
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region src/components/OpenGenerativeUIRenderer.d.ts
|
|
1791
|
+
declare const OpenGenerativeUIActivityType = "open-generative-ui";
|
|
1792
|
+
declare const OpenGenerativeUIContentSchema: z.ZodObject<{
|
|
1793
|
+
initialHeight: z.ZodOptional<z.ZodNumber>;
|
|
1794
|
+
generating: z.ZodOptional<z.ZodBoolean>;
|
|
1795
|
+
css: z.ZodOptional<z.ZodString>;
|
|
1796
|
+
cssComplete: z.ZodOptional<z.ZodBoolean>;
|
|
1797
|
+
html: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1798
|
+
htmlComplete: z.ZodOptional<z.ZodBoolean>;
|
|
1799
|
+
jsFunctions: z.ZodOptional<z.ZodString>;
|
|
1800
|
+
jsFunctionsComplete: z.ZodOptional<z.ZodBoolean>;
|
|
1801
|
+
jsExpressions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1802
|
+
jsExpressionsComplete: z.ZodOptional<z.ZodBoolean>;
|
|
1803
|
+
}, "strip", z.ZodTypeAny, {
|
|
1804
|
+
html?: string[] | undefined;
|
|
1805
|
+
initialHeight?: number | undefined;
|
|
1806
|
+
generating?: boolean | undefined;
|
|
1807
|
+
css?: string | undefined;
|
|
1808
|
+
cssComplete?: boolean | undefined;
|
|
1809
|
+
htmlComplete?: boolean | undefined;
|
|
1810
|
+
jsFunctions?: string | undefined;
|
|
1811
|
+
jsFunctionsComplete?: boolean | undefined;
|
|
1812
|
+
jsExpressions?: string[] | undefined;
|
|
1813
|
+
jsExpressionsComplete?: boolean | undefined;
|
|
1814
|
+
}, {
|
|
1815
|
+
html?: string[] | undefined;
|
|
1816
|
+
initialHeight?: number | undefined;
|
|
1817
|
+
generating?: boolean | undefined;
|
|
1818
|
+
css?: string | undefined;
|
|
1819
|
+
cssComplete?: boolean | undefined;
|
|
1820
|
+
htmlComplete?: boolean | undefined;
|
|
1821
|
+
jsFunctions?: string | undefined;
|
|
1822
|
+
jsFunctionsComplete?: boolean | undefined;
|
|
1823
|
+
jsExpressions?: string[] | undefined;
|
|
1824
|
+
jsExpressionsComplete?: boolean | undefined;
|
|
1825
|
+
}>;
|
|
1826
|
+
type OpenGenerativeUIContent = z.infer<typeof OpenGenerativeUIContentSchema>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Schema for the generateSandboxedUi tool call arguments.
|
|
1829
|
+
* Used by the frontend tool renderer to display placeholder messages.
|
|
1830
|
+
*/
|
|
1831
|
+
declare const GenerateSandboxedUiArgsSchema: z.ZodObject<{
|
|
1832
|
+
initialHeight: z.ZodOptional<z.ZodNumber>;
|
|
1833
|
+
placeholderMessages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1834
|
+
css: z.ZodOptional<z.ZodString>;
|
|
1835
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1836
|
+
jsFunctions: z.ZodOptional<z.ZodString>;
|
|
1837
|
+
jsExpressions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1838
|
+
}, "strip", z.ZodTypeAny, {
|
|
1839
|
+
html?: string | undefined;
|
|
1840
|
+
initialHeight?: number | undefined;
|
|
1841
|
+
css?: string | undefined;
|
|
1842
|
+
jsFunctions?: string | undefined;
|
|
1843
|
+
jsExpressions?: string[] | undefined;
|
|
1844
|
+
placeholderMessages?: string[] | undefined;
|
|
1845
|
+
}, {
|
|
1846
|
+
html?: string | undefined;
|
|
1847
|
+
initialHeight?: number | undefined;
|
|
1848
|
+
css?: string | undefined;
|
|
1849
|
+
jsFunctions?: string | undefined;
|
|
1850
|
+
jsExpressions?: string[] | undefined;
|
|
1851
|
+
placeholderMessages?: string[] | undefined;
|
|
1852
|
+
}>;
|
|
1853
|
+
type GenerateSandboxedUiArgs = z.infer<typeof GenerateSandboxedUiArgsSchema>;
|
|
1854
|
+
interface OpenGenerativeUIActivityRendererProps {
|
|
1855
|
+
activityType: string;
|
|
1856
|
+
content: OpenGenerativeUIContent;
|
|
1857
|
+
message: unknown;
|
|
1858
|
+
agent: unknown;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Outer wrapper — absorbs every parent re-render but only forwards
|
|
1862
|
+
* throttled content snapshots to the memoized inner component.
|
|
1863
|
+
*/
|
|
1864
|
+
declare const OpenGenerativeUIActivityRenderer: React$1.FC<OpenGenerativeUIActivityRendererProps>;
|
|
1865
|
+
/**
|
|
1866
|
+
* Frontend tool renderer for generateSandboxedUi.
|
|
1867
|
+
* Displays placeholder messages while the UI is being generated.
|
|
1868
|
+
*/
|
|
1869
|
+
declare const OpenGenerativeUIToolRenderer: React$1.FC<{
|
|
1870
|
+
name: string;
|
|
1871
|
+
args: Partial<GenerateSandboxedUiArgs>;
|
|
1872
|
+
status: ToolCallStatus$1.InProgress;
|
|
1873
|
+
result: undefined;
|
|
1874
|
+
} | {
|
|
1875
|
+
name: string;
|
|
1876
|
+
args: GenerateSandboxedUiArgs;
|
|
1877
|
+
status: ToolCallStatus$1.Executing;
|
|
1878
|
+
result: undefined;
|
|
1879
|
+
} | {
|
|
1880
|
+
name: string;
|
|
1881
|
+
args: GenerateSandboxedUiArgs;
|
|
1882
|
+
status: ToolCallStatus$1.Complete;
|
|
1883
|
+
result: string;
|
|
1884
|
+
}>;
|
|
1885
|
+
//#endregion
|
|
1886
|
+
//#region src/types/react-tool-call-renderer.d.ts
|
|
1887
|
+
interface ReactToolCallRenderer<T = unknown> {
|
|
1888
|
+
name: string;
|
|
1889
|
+
/**
|
|
1890
|
+
* Schema describing the tool arguments. Optional — renderers registered for
|
|
1891
|
+
* tools without parameters (e.g. HITL confirm dialogs) have no schema.
|
|
1892
|
+
*/
|
|
1893
|
+
args?: StandardSchemaV1<any, T>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Optional agent ID to constrain this tool renderer to a specific agent.
|
|
1896
|
+
* If specified, this renderer will only be used for the specified agent.
|
|
1897
|
+
*/
|
|
1898
|
+
agentId?: string;
|
|
1899
|
+
/**
|
|
1900
|
+
* Whether calls this renderer draws join the chat's tool-call groups (see
|
|
1901
|
+
* `toolCallDisplay` on `CopilotChatMessageView`). CopilotKit's built-in card
|
|
1902
|
+
* sets it; a renderer that leaves it unset always shows its calls on their
|
|
1903
|
+
* own, since the chat can't tell what it draws (it may even draw nothing).
|
|
1904
|
+
*/
|
|
1905
|
+
group?: boolean;
|
|
1906
|
+
render: React.ComponentType<{
|
|
1907
|
+
name: string;
|
|
1908
|
+
toolCallId: string;
|
|
1909
|
+
args: Partial<T>;
|
|
1910
|
+
status: ToolCallStatus$1.InProgress;
|
|
1911
|
+
result: undefined;
|
|
1912
|
+
} | {
|
|
1913
|
+
name: string;
|
|
1914
|
+
toolCallId: string;
|
|
1915
|
+
args: T;
|
|
1916
|
+
status: ToolCallStatus$1.Executing;
|
|
1917
|
+
result: undefined;
|
|
1918
|
+
} | {
|
|
1919
|
+
name: string;
|
|
1920
|
+
toolCallId: string;
|
|
1921
|
+
args: T;
|
|
1922
|
+
status: ToolCallStatus$1.Complete;
|
|
1923
|
+
result: string;
|
|
1924
|
+
}>;
|
|
1925
|
+
}
|
|
1926
|
+
//#endregion
|
|
1927
|
+
//#region src/hooks/use-render-tool-call.d.ts
|
|
1928
|
+
interface UseRenderToolCallProps {
|
|
1929
|
+
toolCall: ToolCall$1;
|
|
1930
|
+
toolMessage?: ToolMessage$1;
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Hook that returns a function to render tool calls based on the render functions
|
|
1934
|
+
* defined in CopilotKitProvider.
|
|
1935
|
+
*
|
|
1936
|
+
* @returns A function that takes a tool call and optional tool message and returns the rendered component
|
|
1937
|
+
*/
|
|
1938
|
+
declare function useRenderToolCall(): ({
|
|
1939
|
+
toolCall,
|
|
1940
|
+
toolMessage
|
|
1941
|
+
}: UseRenderToolCallProps) => React$1.ReactElement | null;
|
|
1942
|
+
//#endregion
|
|
1943
|
+
//#region src/types/react-custom-message-renderer.d.ts
|
|
1944
|
+
type ReactCustomMessageRendererPosition = "before" | "after";
|
|
1945
|
+
interface ReactCustomMessageRenderer {
|
|
1946
|
+
agentId?: string;
|
|
1947
|
+
render: React.ComponentType<{
|
|
1948
|
+
message: Message$1;
|
|
1949
|
+
position: ReactCustomMessageRendererPosition;
|
|
1950
|
+
runId: string;
|
|
1951
|
+
messageIndex: number;
|
|
1952
|
+
messageIndexInRun: number;
|
|
1953
|
+
numberOfMessagesInRun: number;
|
|
1954
|
+
agentId: string;
|
|
1955
|
+
stateSnapshot: any;
|
|
1956
|
+
}> | null;
|
|
1957
|
+
}
|
|
1958
|
+
//#endregion
|
|
1959
|
+
//#region src/hooks/use-render-custom-messages.d.ts
|
|
1960
|
+
interface UseRenderCustomMessagesParams {
|
|
1961
|
+
message: Message$1;
|
|
1962
|
+
position: ReactCustomMessageRendererPosition;
|
|
1963
|
+
}
|
|
1964
|
+
declare function useRenderCustomMessages(): ((params: UseRenderCustomMessagesParams) => react_jsx_runtime0.JSX.Element | null) | null;
|
|
1965
|
+
//#endregion
|
|
1966
|
+
//#region src/types/frontend-tool.d.ts
|
|
1967
|
+
type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = FrontendTool$1<T> & {
|
|
1968
|
+
render?: ReactToolCallRenderer<T>["render"];
|
|
1969
|
+
};
|
|
1970
|
+
//#endregion
|
|
1971
|
+
//#region src/types/human-in-the-loop.d.ts
|
|
1972
|
+
type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>> = Omit<FrontendTool$1<T>, "handler"> & {
|
|
1973
|
+
/**
|
|
1974
|
+
* Render the human-in-the-loop UI for this tool call.
|
|
1975
|
+
*
|
|
1976
|
+
* Beyond the tool call's `args`/`status`/`result`, the render props carry
|
|
1977
|
+
* attribution:
|
|
1978
|
+
* - `toolCallId` — the AG-UI tool call id, unique per interrupt. It is the
|
|
1979
|
+
* stable key for correlating this interrupt with runtime (sub)agent
|
|
1980
|
+
* attribution — e.g. the `agentId` reported by `onToolExecutionStart`, or
|
|
1981
|
+
* per-run attribution stamped on the event stream — so the UI can label
|
|
1982
|
+
* the interrupt with the agent that actually raised it.
|
|
1983
|
+
* - `agentId` — the agent this tool was *registered* to (the tool's own
|
|
1984
|
+
* `agentId`), or `undefined` for an unscoped tool. This is the static
|
|
1985
|
+
* registration scope; it is NOT necessarily the runtime (sub)agent that
|
|
1986
|
+
* raised the interrupt. For runtime attribution, correlate `toolCallId`
|
|
1987
|
+
* with the event-stream/`onToolExecutionStart` agent id.
|
|
1988
|
+
*/
|
|
1989
|
+
render: React$1.ComponentType<{
|
|
1990
|
+
name: string;
|
|
1991
|
+
description: string;
|
|
1992
|
+
toolCallId: string;
|
|
1993
|
+
agentId?: string;
|
|
1994
|
+
args: Partial<T>;
|
|
1995
|
+
status: ToolCallStatus$1.InProgress;
|
|
1996
|
+
result: undefined;
|
|
1997
|
+
respond: undefined;
|
|
1998
|
+
} | {
|
|
1999
|
+
name: string;
|
|
2000
|
+
description: string;
|
|
2001
|
+
toolCallId: string;
|
|
2002
|
+
agentId?: string;
|
|
2003
|
+
args: T;
|
|
2004
|
+
status: ToolCallStatus$1.Executing;
|
|
2005
|
+
result: undefined;
|
|
2006
|
+
respond: (result: unknown) => Promise<void>;
|
|
2007
|
+
} | {
|
|
2008
|
+
name: string;
|
|
2009
|
+
description: string;
|
|
2010
|
+
toolCallId: string;
|
|
2011
|
+
agentId?: string;
|
|
2012
|
+
args: T;
|
|
2013
|
+
status: ToolCallStatus$1.Complete;
|
|
2014
|
+
result: string;
|
|
2015
|
+
respond: undefined;
|
|
2016
|
+
}>;
|
|
2017
|
+
};
|
|
2018
|
+
//#endregion
|
|
2019
|
+
//#region src/types/defineToolCallRenderer.d.ts
|
|
2020
|
+
/**
|
|
2021
|
+
* Helper to define a type-safe tool call renderer entry.
|
|
2022
|
+
* - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }.
|
|
2023
|
+
* - Derives `args` type from the provided schema (any Standard Schema V1 compatible library).
|
|
2024
|
+
* - Ensures the render function param type exactly matches ReactToolCallRenderer<T>["render"]'s param.
|
|
2025
|
+
* - For wildcard tools (name: "*"), args is optional and defaults to z.any()
|
|
2026
|
+
*/
|
|
2027
|
+
type RenderProps<T> = {
|
|
2028
|
+
name: string;
|
|
2029
|
+
toolCallId: string;
|
|
2030
|
+
args: Partial<T>;
|
|
2031
|
+
status: ToolCallStatus$1.InProgress;
|
|
2032
|
+
result: undefined;
|
|
2033
|
+
} | {
|
|
2034
|
+
name: string;
|
|
2035
|
+
toolCallId: string;
|
|
2036
|
+
args: T;
|
|
2037
|
+
status: ToolCallStatus$1.Executing;
|
|
2038
|
+
result: undefined;
|
|
2039
|
+
} | {
|
|
2040
|
+
name: string;
|
|
2041
|
+
toolCallId: string;
|
|
2042
|
+
args: T;
|
|
2043
|
+
status: ToolCallStatus$1.Complete;
|
|
2044
|
+
result: string;
|
|
2045
|
+
};
|
|
2046
|
+
declare function defineToolCallRenderer(def: {
|
|
2047
|
+
name: "*";
|
|
2048
|
+
render: (props: RenderProps<any>) => React$1.ReactElement | null;
|
|
2049
|
+
agentId?: string;
|
|
2050
|
+
group?: boolean;
|
|
2051
|
+
}): ReactToolCallRenderer<any>;
|
|
2052
|
+
declare function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
2053
|
+
name: string;
|
|
2054
|
+
args: S;
|
|
2055
|
+
render: (props: RenderProps<InferSchemaOutput<S>>) => React$1.ReactElement | null;
|
|
2056
|
+
agentId?: string;
|
|
2057
|
+
group?: boolean;
|
|
2058
|
+
}): ReactToolCallRenderer<InferSchemaOutput<S>>;
|
|
2059
|
+
//#endregion
|
|
2060
|
+
//#region src/types/interrupt.d.ts
|
|
2061
|
+
/** Name of the legacy custom event agents emit to signal an interrupt. */
|
|
2062
|
+
declare const INTERRUPT_EVENT_NAME = "on_interrupt";
|
|
2063
|
+
/** Legacy custom-event interrupt payload (agent emits a custom `on_interrupt` event). */
|
|
2064
|
+
interface InterruptEvent<TValue = unknown> {
|
|
2065
|
+
name: string;
|
|
2066
|
+
value: TValue;
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Resolve the agent with user input for an interrupt.
|
|
2070
|
+
*
|
|
2071
|
+
* - Standard interrupts: records `{ status: "resolved", payload }` for the target
|
|
2072
|
+
* interrupt (defaults to the primary one). Resumes once every open interrupt is
|
|
2073
|
+
* addressed; returns the resume run result, or `void` while still awaiting others.
|
|
2074
|
+
* - Legacy interrupts: resumes immediately via `command.resume = payload`.
|
|
2075
|
+
*/
|
|
2076
|
+
type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise<RunAgentResult$1 | void>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Cancel an interrupt.
|
|
2079
|
+
*
|
|
2080
|
+
* - Standard interrupts: records `{ status: "cancelled" }` for the target interrupt
|
|
2081
|
+
* (defaults to the primary one), then resumes once all are addressed.
|
|
2082
|
+
* - Legacy interrupts: dismisses the pending interrupt without resuming.
|
|
2083
|
+
*/
|
|
2084
|
+
type InterruptCancelFn = (interruptId?: string) => Promise<RunAgentResult$1 | void>;
|
|
2085
|
+
interface InterruptHandlerProps<TValue = unknown> {
|
|
2086
|
+
/**
|
|
2087
|
+
* Legacy event shape (`{ name, value }`). Always present for back-compat: for
|
|
2088
|
+
* standard interrupts, `value` is the primary `Interrupt` and `name` is `"on_interrupt"`.
|
|
2089
|
+
* Prefer `interrupt` / `interrupts` for standard interrupts.
|
|
2090
|
+
*/
|
|
2091
|
+
event: InterruptEvent<TValue>;
|
|
2092
|
+
/** Primary standard interrupt (`interrupts[0]`), or `null` for legacy interrupts. */
|
|
2093
|
+
interrupt: Interrupt | null;
|
|
2094
|
+
/** All open standard interrupts (empty array for legacy interrupts). */
|
|
2095
|
+
interrupts: Interrupt[];
|
|
2096
|
+
resolve: InterruptResolveFn;
|
|
2097
|
+
cancel: InterruptCancelFn;
|
|
2098
|
+
}
|
|
2099
|
+
interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
|
|
2100
|
+
event: InterruptEvent<TValue>;
|
|
2101
|
+
interrupt: Interrupt | null;
|
|
2102
|
+
interrupts: Interrupt[];
|
|
2103
|
+
result: TResult;
|
|
2104
|
+
resolve: InterruptResolveFn;
|
|
2105
|
+
cancel: InterruptCancelFn;
|
|
2106
|
+
}
|
|
2107
|
+
//#endregion
|
|
2108
|
+
//#region src/types/sandbox-function.d.ts
|
|
2109
|
+
type SandboxFunction<TParams extends StandardSchemaV1 = StandardSchemaV1> = {
|
|
2110
|
+
name: string;
|
|
2111
|
+
description: string;
|
|
2112
|
+
parameters: TParams;
|
|
2113
|
+
handler: (args: any) => Promise<unknown>;
|
|
2114
|
+
};
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/hooks/use-render-activity-message.d.ts
|
|
2117
|
+
declare function useRenderActivityMessage(): {
|
|
2118
|
+
renderActivityMessage: (message: ActivityMessage$1) => React.ReactElement | null;
|
|
2119
|
+
findRenderer: (activityType: string) => ReactActivityMessageRenderer<unknown> | null;
|
|
2120
|
+
};
|
|
2121
|
+
//#endregion
|
|
2122
|
+
//#region src/hooks/use-frontend-tool.d.ts
|
|
2123
|
+
declare function useFrontendTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactFrontendTool<T>, deps?: ReadonlyArray<unknown>): void;
|
|
2124
|
+
//#endregion
|
|
2125
|
+
//#region src/hooks/use-frontend-tools.d.ts
|
|
2126
|
+
/**
|
|
2127
|
+
* Register a list of frontend tools whose length can change between renders.
|
|
2128
|
+
*
|
|
2129
|
+
* `useFrontendTool` registers exactly one tool per call, so it cannot be called
|
|
2130
|
+
* in a loop over a runtime-length list without breaking the rules of hooks.
|
|
2131
|
+
* This hook runs a single effect over the whole array instead, which makes it
|
|
2132
|
+
* safe to build the list from state, props, or a server response.
|
|
2133
|
+
*
|
|
2134
|
+
* Tools are keyed by `name` plus `agentId`, the same as `useFrontendTool`. A
|
|
2135
|
+
* tool that disappears from the array is unregistered on the next render, and
|
|
2136
|
+
* every tool is unregistered on unmount. Renderers stay registered after
|
|
2137
|
+
* unmount so past tool calls still render in the chat history.
|
|
2138
|
+
*
|
|
2139
|
+
* @param tools - The tools to register. May be empty and may change length.
|
|
2140
|
+
* @param deps - Extra dependencies that force re-registration, compared by
|
|
2141
|
+
* identity like the second argument of `useEffect`. Use this when a handler
|
|
2142
|
+
* closes over a value that is not part of the tool definition. Keep the array
|
|
2143
|
+
* a constant length across renders.
|
|
2144
|
+
*
|
|
2145
|
+
* @example
|
|
2146
|
+
* Register one tool per item in application state:
|
|
2147
|
+
* ```tsx
|
|
2148
|
+
* const [reports, setReports] = useState<Report[]>([]);
|
|
2149
|
+
*
|
|
2150
|
+
* useFrontendTools(
|
|
2151
|
+
* reports.map((report) => ({
|
|
2152
|
+
* name: `open_${report.id}`,
|
|
2153
|
+
* description: `Open the ${report.title} report`,
|
|
2154
|
+
* handler: async () => navigate(`/reports/${report.id}`),
|
|
2155
|
+
* })),
|
|
2156
|
+
* [navigate],
|
|
2157
|
+
* );
|
|
2158
|
+
* ```
|
|
2159
|
+
*
|
|
2160
|
+
* @example
|
|
2161
|
+
* Register tools described by the backend:
|
|
2162
|
+
* ```tsx
|
|
2163
|
+
* const { data } = useQuery(fetchToolDescriptors);
|
|
2164
|
+
*
|
|
2165
|
+
* useFrontendTools(
|
|
2166
|
+
* (data ?? []).map((descriptor) => ({
|
|
2167
|
+
* name: descriptor.name,
|
|
2168
|
+
* description: descriptor.description,
|
|
2169
|
+
* parameters: z.object({ query: z.string() }),
|
|
2170
|
+
* handler: async ({ query }) => runDescriptor(descriptor.id, query),
|
|
2171
|
+
* })),
|
|
2172
|
+
* );
|
|
2173
|
+
* ```
|
|
2174
|
+
*/
|
|
2175
|
+
declare function useFrontendTools(tools: ReadonlyArray<ReactFrontendTool<any>> | undefined, deps?: ReadonlyArray<unknown>): void;
|
|
2176
|
+
//#endregion
|
|
2177
|
+
//#region src/hooks/use-component.d.ts
|
|
2178
|
+
type InferRenderProps<T> = T extends StandardSchemaV1 ? InferSchemaOutput<T> : any;
|
|
2179
|
+
/**
|
|
2180
|
+
* Registers a React component as a frontend tool renderer in chat.
|
|
2181
|
+
*
|
|
2182
|
+
* This hook is a convenience wrapper around `useFrontendTool` that:
|
|
2183
|
+
* - builds a model-facing tool description,
|
|
2184
|
+
* - forwards optional schema parameters (any Standard Schema V1 compatible library),
|
|
2185
|
+
* - renders your component with tool call parameters.
|
|
2186
|
+
*
|
|
2187
|
+
* Use this when you want to display a typed visual component for a tool call
|
|
2188
|
+
* without manually wiring a full frontend tool object.
|
|
2189
|
+
*
|
|
2190
|
+
* When `parameters` is provided, render props are inferred from the schema.
|
|
2191
|
+
* When omitted, the render component may accept any props.
|
|
2192
|
+
*
|
|
2193
|
+
* @typeParam TSchema - Schema describing tool parameters, or `undefined` when no schema is given.
|
|
2194
|
+
* @param config - Tool registration config.
|
|
2195
|
+
* @param deps - Optional dependencies to refresh registration (same semantics as `useEffect`).
|
|
2196
|
+
*
|
|
2197
|
+
* @example
|
|
2198
|
+
* ```tsx
|
|
2199
|
+
* // Without parameters — render accepts any props
|
|
2200
|
+
* useComponent({
|
|
2201
|
+
* name: "showGreeting",
|
|
2202
|
+
* render: ({ message }: { message: string }) => <div>{message}</div>,
|
|
2203
|
+
* });
|
|
2204
|
+
* ```
|
|
2205
|
+
*
|
|
2206
|
+
* @example
|
|
2207
|
+
* ```tsx
|
|
2208
|
+
* // With parameters — render props inferred from schema
|
|
2209
|
+
* useComponent({
|
|
2210
|
+
* name: "showWeatherCard",
|
|
2211
|
+
* parameters: z.object({ city: z.string() }),
|
|
2212
|
+
* render: ({ city }) => <div>{city}</div>,
|
|
2213
|
+
* });
|
|
2214
|
+
* ```
|
|
2215
|
+
*
|
|
2216
|
+
* @example
|
|
2217
|
+
* ```tsx
|
|
2218
|
+
* useComponent(
|
|
2219
|
+
* {
|
|
2220
|
+
* name: "renderProfile",
|
|
2221
|
+
* parameters: z.object({ userId: z.string() }),
|
|
2222
|
+
* render: ProfileCard,
|
|
2223
|
+
* agentId: "support-agent",
|
|
2224
|
+
* },
|
|
2225
|
+
* [selectedAgentId],
|
|
2226
|
+
* );
|
|
2227
|
+
* ```
|
|
2228
|
+
*/
|
|
2229
|
+
declare function useComponent<TSchema extends StandardSchemaV1<any, Record<string, unknown>> | undefined = undefined>(config: {
|
|
2230
|
+
name: string;
|
|
2231
|
+
description?: string;
|
|
2232
|
+
parameters?: TSchema;
|
|
2233
|
+
render: ComponentType<NoInfer<InferRenderProps<TSchema>>>;
|
|
2234
|
+
agentId?: string;
|
|
2235
|
+
followUp?: boolean;
|
|
2236
|
+
}, deps?: ReadonlyArray<unknown>): void;
|
|
2237
|
+
//#endregion
|
|
2238
|
+
//#region src/hooks/use-render-tool.d.ts
|
|
2239
|
+
interface RenderToolInProgressProps<S extends StandardSchemaV1> {
|
|
2240
|
+
name: string;
|
|
2241
|
+
toolCallId: string;
|
|
2242
|
+
parameters: Partial<InferSchemaOutput<S>>;
|
|
2243
|
+
status: "inProgress";
|
|
2244
|
+
result: undefined;
|
|
2245
|
+
}
|
|
2246
|
+
interface RenderToolExecutingProps<S extends StandardSchemaV1> {
|
|
2247
|
+
name: string;
|
|
2248
|
+
toolCallId: string;
|
|
2249
|
+
parameters: InferSchemaOutput<S>;
|
|
2250
|
+
status: "executing";
|
|
2251
|
+
result: undefined;
|
|
2252
|
+
}
|
|
2253
|
+
interface RenderToolCompleteProps<S extends StandardSchemaV1> {
|
|
2254
|
+
name: string;
|
|
2255
|
+
toolCallId: string;
|
|
2256
|
+
parameters: InferSchemaOutput<S>;
|
|
2257
|
+
status: "complete";
|
|
2258
|
+
result: string;
|
|
2259
|
+
}
|
|
2260
|
+
type RenderToolProps<S extends StandardSchemaV1> = RenderToolInProgressProps<S> | RenderToolExecutingProps<S> | RenderToolCompleteProps<S>;
|
|
2261
|
+
/**
|
|
2262
|
+
* Registers a wildcard (`"*"`) renderer for tool calls.
|
|
2263
|
+
*
|
|
2264
|
+
* The wildcard renderer is used as a fallback when no exact name-matched
|
|
2265
|
+
* renderer is registered for a tool call.
|
|
2266
|
+
*
|
|
2267
|
+
* @param config - Wildcard renderer configuration.
|
|
2268
|
+
* @param deps - Optional dependencies to refresh registration.
|
|
2269
|
+
*
|
|
2270
|
+
* @example
|
|
2271
|
+
* ```tsx
|
|
2272
|
+
* useRenderTool(
|
|
2273
|
+
* {
|
|
2274
|
+
* name: "*",
|
|
2275
|
+
* render: ({ name, status }) => (
|
|
2276
|
+
* <div>
|
|
2277
|
+
* {status === "complete" ? "✓" : "⏳"} {name}
|
|
2278
|
+
* </div>
|
|
2279
|
+
* ),
|
|
2280
|
+
* },
|
|
2281
|
+
* [],
|
|
2282
|
+
* );
|
|
2283
|
+
* ```
|
|
2284
|
+
*/
|
|
2285
|
+
declare function useRenderTool(config: {
|
|
2286
|
+
name: "*";
|
|
2287
|
+
render: (props: any) => React.ReactElement | null;
|
|
2288
|
+
agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
|
|
2289
|
+
group?: boolean;
|
|
2290
|
+
}, deps?: ReadonlyArray<unknown>): void;
|
|
2291
|
+
/**
|
|
2292
|
+
* Registers a name-scoped renderer for tool calls.
|
|
2293
|
+
*
|
|
2294
|
+
* The provided `parameters` schema defines the typed shape of `props.parameters`
|
|
2295
|
+
* in `render` for `executing` and `complete` states. Accepts any Standard Schema V1
|
|
2296
|
+
* compatible library (Zod, Valibot, ArkType, etc.).
|
|
2297
|
+
*
|
|
2298
|
+
* @typeParam S - Schema type describing tool call parameters.
|
|
2299
|
+
* @param config - Named renderer configuration.
|
|
2300
|
+
* @param deps - Optional dependencies to refresh registration.
|
|
2301
|
+
*
|
|
2302
|
+
* @example
|
|
2303
|
+
* ```tsx
|
|
2304
|
+
* useRenderTool(
|
|
2305
|
+
* {
|
|
2306
|
+
* name: "searchDocs",
|
|
2307
|
+
* parameters: z.object({ query: z.string() }),
|
|
2308
|
+
* render: ({ status, parameters, result }) => {
|
|
2309
|
+
* if (status === "inProgress") return <div>Preparing...</div>;
|
|
2310
|
+
* if (status === "executing") return <div>Searching {parameters.query}</div>;
|
|
2311
|
+
* return <div>{result}</div>;
|
|
2312
|
+
* },
|
|
2313
|
+
* },
|
|
2314
|
+
* [],
|
|
2315
|
+
* );
|
|
2316
|
+
* ```
|
|
2317
|
+
*/
|
|
2318
|
+
declare function useRenderTool<S extends StandardSchemaV1>(config: {
|
|
2319
|
+
name: string;
|
|
2320
|
+
parameters: S;
|
|
2321
|
+
render: (props: RenderToolProps<S>) => React.ReactElement | null;
|
|
2322
|
+
agentId?: string; /** Let the chat group the calls this renderer draws (see `toolCallDisplay`). */
|
|
2323
|
+
group?: boolean;
|
|
2324
|
+
}, deps?: ReadonlyArray<unknown>): void;
|
|
2325
|
+
//#endregion
|
|
2326
|
+
//#region src/hooks/use-default-render-tool.d.ts
|
|
2327
|
+
type DefaultRenderProps = {
|
|
2328
|
+
/** The name of the tool being called. */name: string; /** The id of the tool call being rendered. */
|
|
2329
|
+
toolCallId: string; /** The parsed parameters passed to the tool call. */
|
|
2330
|
+
parameters: unknown; /** Current execution status of the tool call. */
|
|
2331
|
+
status: "inProgress" | "executing" | "complete"; /** The tool call result string, available only when `status` is `"complete"`. */
|
|
2332
|
+
result: string | undefined;
|
|
2333
|
+
};
|
|
2334
|
+
/**
|
|
2335
|
+
* Registers a wildcard (`"*"`) tool-call renderer via `useRenderTool`.
|
|
2336
|
+
*
|
|
2337
|
+
* - Call with no config to use CopilotKit's built-in default tool-call card.
|
|
2338
|
+
* - Pass `config.render` to replace the default UI with your own fallback renderer.
|
|
2339
|
+
*
|
|
2340
|
+
* This is useful when you want a generic renderer for tools that do not have a
|
|
2341
|
+
* dedicated `useRenderTool({ name: "..." })` registration.
|
|
2342
|
+
*
|
|
2343
|
+
* @param config - Optional custom wildcard render function.
|
|
2344
|
+
* @param deps - Optional dependencies to refresh registration.
|
|
2345
|
+
*
|
|
2346
|
+
* @example
|
|
2347
|
+
* ```tsx
|
|
2348
|
+
* useDefaultRenderTool();
|
|
2349
|
+
* ```
|
|
2350
|
+
*
|
|
2351
|
+
* @example
|
|
2352
|
+
* ```tsx
|
|
2353
|
+
* useDefaultRenderTool({
|
|
2354
|
+
* render: ({ name, status }) => <div>{name}: {status}</div>,
|
|
2355
|
+
* });
|
|
2356
|
+
* ```
|
|
2357
|
+
*
|
|
2358
|
+
* @example
|
|
2359
|
+
* ```tsx
|
|
2360
|
+
* useDefaultRenderTool(
|
|
2361
|
+
* {
|
|
2362
|
+
* render: ({ name, result }) => (
|
|
2363
|
+
* <ToolEventRow title={name} payload={result} compact={compactMode} />
|
|
2364
|
+
* ),
|
|
2365
|
+
* },
|
|
2366
|
+
* [compactMode],
|
|
2367
|
+
* );
|
|
2368
|
+
* ```
|
|
2369
|
+
*/
|
|
2370
|
+
declare function useDefaultRenderTool(config?: {
|
|
2371
|
+
render?: (props: DefaultRenderProps) => React$1.ReactElement | null;
|
|
2372
|
+
/**
|
|
2373
|
+
* Let the chat group calls your `render` draws, like it groups the
|
|
2374
|
+
* built-in card's (see `toolCallDisplay` on `CopilotChatMessageView`).
|
|
2375
|
+
* Off by default for a custom `render`, since it may draw nothing.
|
|
2376
|
+
*/
|
|
2377
|
+
group?: boolean;
|
|
2378
|
+
}, deps?: ReadonlyArray<unknown>): void;
|
|
2379
|
+
//#endregion
|
|
2380
|
+
//#region src/hooks/use-human-in-the-loop.d.ts
|
|
2381
|
+
declare function useHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>, deps?: ReadonlyArray<unknown>): void;
|
|
2382
|
+
//#endregion
|
|
2383
|
+
//#region src/hooks/use-agent.d.ts
|
|
2384
|
+
declare enum UseAgentUpdate {
|
|
2385
|
+
OnMessagesChanged = "OnMessagesChanged",
|
|
2386
|
+
OnStateChanged = "OnStateChanged",
|
|
2387
|
+
OnRunStatusChanged = "OnRunStatusChanged"
|
|
2388
|
+
}
|
|
2389
|
+
interface UseAgentPropsBase {
|
|
2390
|
+
updates?: UseAgentUpdate[];
|
|
2391
|
+
/**
|
|
2392
|
+
* Throttle interval (in milliseconds) for re-renders triggered by
|
|
2393
|
+
* `onMessagesChanged` and `onStateChanged` notifications. Useful to reduce
|
|
2394
|
+
* re-render frequency during high-frequency streaming updates.
|
|
2395
|
+
*
|
|
2396
|
+
* Uses a leading+trailing pattern with a shared window — first update
|
|
2397
|
+
* fires immediately, subsequent updates within the window are coalesced,
|
|
2398
|
+
* and a trailing timer ensures the most recent update fires after the
|
|
2399
|
+
* window expires. See `CopilotKitCore.subscribeToAgentWithOptions` in `@copilotkit/core`
|
|
2400
|
+
* for details.
|
|
2401
|
+
*
|
|
2402
|
+
* Resolved as: `throttleMs ?? provider defaultThrottleMs ?? 0`.
|
|
2403
|
+
* Passing `throttleMs={0}` explicitly disables throttling even when the
|
|
2404
|
+
* provider specifies a non-zero `defaultThrottleMs`.
|
|
2405
|
+
*
|
|
2406
|
+
* Run lifecycle callbacks (`onRunInitialized`, `onRunFinalized`,
|
|
2407
|
+
* `onRunFailed`, `onRunErrorEvent`) always fire immediately.
|
|
2408
|
+
*
|
|
2409
|
+
* @default undefined
|
|
2410
|
+
* When unset, inherits from the provider's `defaultThrottleMs`;
|
|
2411
|
+
* if that is also unset, the effective value is `0` (no throttle).
|
|
2412
|
+
*/
|
|
2413
|
+
throttleMs?: number;
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* Thread-scoped variant. `agentId`, `runtimeAgentId`, and `threadId` are a
|
|
2417
|
+
* matched set: together they give this hook a *private* agent — registered
|
|
2418
|
+
* under the local `agentId`, routing outbound to `runtimeAgentId` — that is
|
|
2419
|
+
* safe to pin a thread onto. None of the three is meaningful without the other
|
|
2420
|
+
* two, so all are required here.
|
|
2421
|
+
*/
|
|
2422
|
+
interface UseAgentThreadScopedProps {
|
|
2423
|
+
/**
|
|
2424
|
+
* The name to register this hook's proxied agent under.
|
|
2425
|
+
*
|
|
2426
|
+
* Required, and must not already be taken. The usual fallbacks (the chat
|
|
2427
|
+
* configuration's agentId, then `DEFAULT_AGENT_ID`) name agents that already
|
|
2428
|
+
* exist, and registering over one either throws `already registered` or
|
|
2429
|
+
* silently shadows it, depending on whether runtime discovery has landed — so
|
|
2430
|
+
* the caller has to name it.
|
|
2431
|
+
*/
|
|
2432
|
+
agentId: string;
|
|
2433
|
+
/**
|
|
2434
|
+
* Thread to scope the agent's run to. Written onto the underlying agent, so
|
|
2435
|
+
* `/agent/run`, `/agent/connect`, and `/agent/stop` address this thread.
|
|
2436
|
+
*
|
|
2437
|
+
* REQUIRES `runtimeAgentId`. A runtime agent registered under a given id is a
|
|
2438
|
+
* singleton, so writing a per-hook threadId directly onto it would let two
|
|
2439
|
+
* `useAgent` calls that share an `agentId` clobber each other's thread.
|
|
2440
|
+
* Passing a distinct local `agentId` plus the `runtimeAgentId` it routes to
|
|
2441
|
+
* gives this hook a private proxied agent to pin the thread onto instead of a
|
|
2442
|
+
* shared one.
|
|
2443
|
+
*/
|
|
2444
|
+
threadId: string;
|
|
2445
|
+
/**
|
|
2446
|
+
* The id of the runtime agent to route outbound requests to, while this hook
|
|
2447
|
+
* exposes a distinct local `agentId`. Registers a proxied agent via
|
|
2448
|
+
* `CopilotKitCore.registerProxiedAgent`, letting several frontend agents
|
|
2449
|
+
* (e.g. one per open thread) mount against a single runtime agent without a
|
|
2450
|
+
* shared-singleton collision.
|
|
2451
|
+
*
|
|
2452
|
+
* When set, `agentId` is the *local* registry id (must not collide with an
|
|
2453
|
+
* existing local or runtime-discovered agent) and `runtimeAgentId` is the
|
|
2454
|
+
* runtime agent the proxy addresses on `/agent/run` etc.
|
|
2455
|
+
*
|
|
2456
|
+
* REQUIRES `threadId`. Registering a private agent is only worth doing to
|
|
2457
|
+
* scope a thread to it; without a `threadId` the private agent would take its
|
|
2458
|
+
* thread from the chat configuration, which is what binding to the shared
|
|
2459
|
+
* agent via `agentId` alone already does — just with an extra registration
|
|
2460
|
+
* and a local id to keep unique.
|
|
2461
|
+
*/
|
|
2462
|
+
runtimeAgentId: string;
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* Default variant: neither `threadId` nor `runtimeAgentId`. The hook binds to
|
|
2466
|
+
* the shared agent registered under `agentId` and leaves its threadId to the
|
|
2467
|
+
* chat configuration (or to the agent's own auto-minted UUID).
|
|
2468
|
+
*
|
|
2469
|
+
* Both props are typed `undefined` here rather than omitted so that supplying
|
|
2470
|
+
* either one on its own fails to match *both* branches — that is the
|
|
2471
|
+
* type-level enforcement of the all-or-nothing rule.
|
|
2472
|
+
*/
|
|
2473
|
+
interface UseAgentUnscopedProps {
|
|
2474
|
+
/**
|
|
2475
|
+
* Agent to bind to. Resolution precedence: this property, then the surrounding
|
|
2476
|
+
* chat configuration's agentId, then the global default.
|
|
2477
|
+
*/
|
|
2478
|
+
agentId?: string;
|
|
2479
|
+
/** Requires `runtimeAgentId`. See {@link UseAgentThreadScopedProps.threadId}. */
|
|
2480
|
+
threadId?: undefined;
|
|
2481
|
+
/** Requires `threadId`. See {@link UseAgentThreadScopedProps.runtimeAgentId}. */
|
|
2482
|
+
runtimeAgentId?: undefined;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Props for {@link useAgent}.
|
|
2486
|
+
*
|
|
2487
|
+
* There are exactly two valid shapes, and the type admits nothing in between:
|
|
2488
|
+
*
|
|
2489
|
+
* - **Bind to an agent** — `useAgent()`, `useAgent({ agentId })`. The shared
|
|
2490
|
+
* instance from the registry; the thread comes from the chat configuration.
|
|
2491
|
+
* - **Bind a private agent to a thread** —
|
|
2492
|
+
* `useAgent({ agentId, runtimeAgentId, threadId })`. All three required.
|
|
2493
|
+
*
|
|
2494
|
+
* So `useAgent({ agentId, threadId })`, `useAgent({ agentId, runtimeAgentId })`,
|
|
2495
|
+
* and `useAgent({ runtimeAgentId, threadId })` are all compile errors. Each
|
|
2496
|
+
* partial combination is either unsafe (a thread scoped onto a shared singleton)
|
|
2497
|
+
* or pointless (a private agent with no thread, or one registered over an id
|
|
2498
|
+
* that already belongs to a real agent).
|
|
2499
|
+
*/
|
|
2500
|
+
type UseAgentProps = UseAgentPropsBase & (UseAgentThreadScopedProps | UseAgentUnscopedProps);
|
|
2501
|
+
declare function useAgent({
|
|
2502
|
+
agentId,
|
|
2503
|
+
threadId,
|
|
2504
|
+
runtimeAgentId,
|
|
2505
|
+
updates,
|
|
2506
|
+
throttleMs
|
|
2507
|
+
}?: UseAgentProps): {
|
|
2508
|
+
agent: AbstractAgent$1;
|
|
2509
|
+
/**
|
|
2510
|
+
* Whether `agent` is the real, runtime-synced (or locally-registered) agent
|
|
2511
|
+
* rather than a provisional stand-in returned while the runtime is still
|
|
2512
|
+
* connecting (or in an error state).
|
|
2513
|
+
*
|
|
2514
|
+
* `agent` is always a fully-constructed `AbstractAgent`, so calling
|
|
2515
|
+
* `agent.subscribe(...)`, `agent.setState(...)`, etc. is always safe. But
|
|
2516
|
+
* while `isReady` is `false` the instance is a placeholder that will be
|
|
2517
|
+
* swapped for the real agent once the runtime `/info` sync resolves, at
|
|
2518
|
+
* which point `agent` changes reference and dependent effects re-run.
|
|
2519
|
+
* Guard on `isReady` when you only want to act against the real agent —
|
|
2520
|
+
* e.g. subscribing to run-lifecycle events you don't want to miss during
|
|
2521
|
+
* the provisional window (#5000).
|
|
2522
|
+
*/
|
|
2523
|
+
isReady: boolean;
|
|
2524
|
+
};
|
|
2525
|
+
//#endregion
|
|
2526
|
+
//#region src/hooks/use-capabilities.d.ts
|
|
2527
|
+
/**
|
|
2528
|
+
* Returns the capabilities declared by the given agent (or the agent resolved
|
|
2529
|
+
* from the surrounding chat configuration, falling back to the default agent).
|
|
2530
|
+
* Capabilities are populated from the runtime `/info` response at connection
|
|
2531
|
+
* time. The hook reads them synchronously from the agent instance — there is
|
|
2532
|
+
* no separate loading state, but the value will be `undefined` until the
|
|
2533
|
+
* runtime handshake completes.
|
|
2534
|
+
*
|
|
2535
|
+
* @param agentId - Optional agent ID. If omitted, inherits the surrounding
|
|
2536
|
+
* chat configuration's agent, falling back to the default agent.
|
|
2537
|
+
* @returns The agent's capabilities, or `undefined` if the agent doesn't
|
|
2538
|
+
* declare capabilities.
|
|
2539
|
+
*/
|
|
2540
|
+
declare function useCapabilities(agentId?: string): AgentCapabilities$1 | undefined;
|
|
2541
|
+
//#endregion
|
|
2542
|
+
//#region src/hooks/use-agent-context.d.ts
|
|
2543
|
+
/**
|
|
2544
|
+
* Represents any value that can be serialized to JSON.
|
|
2545
|
+
*/
|
|
2546
|
+
type JsonSerializable = string | number | boolean | null | JsonSerializable[] | {
|
|
2547
|
+
[key: string]: JsonSerializable;
|
|
2548
|
+
};
|
|
2549
|
+
/**
|
|
2550
|
+
* Context configuration for useAgentContext.
|
|
2551
|
+
* Accepts any JSON-serializable value which will be converted to a string.
|
|
2552
|
+
*/
|
|
2553
|
+
interface AgentContextInput {
|
|
2554
|
+
/** A human-readable description of what this context represents */
|
|
2555
|
+
description: string;
|
|
2556
|
+
/** The context value - will be converted to a JSON string if not already a string */
|
|
2557
|
+
value: JsonSerializable;
|
|
2558
|
+
}
|
|
2559
|
+
declare function useAgentContext(context: AgentContextInput): void;
|
|
2560
|
+
//#endregion
|
|
2561
|
+
//#region src/hooks/use-suggestions.d.ts
|
|
2562
|
+
interface UseSuggestionsOptions {
|
|
2563
|
+
agentId?: string;
|
|
2564
|
+
}
|
|
2565
|
+
interface UseSuggestionsResult {
|
|
2566
|
+
suggestions: Suggestion$1[];
|
|
2567
|
+
reloadSuggestions: () => void;
|
|
2568
|
+
clearSuggestions: () => void;
|
|
2569
|
+
isLoading: boolean;
|
|
2570
|
+
}
|
|
2571
|
+
declare function useSuggestions({
|
|
2572
|
+
agentId
|
|
2573
|
+
}?: UseSuggestionsOptions): UseSuggestionsResult;
|
|
2574
|
+
//#endregion
|
|
2575
|
+
//#region src/hooks/use-configure-suggestions.d.ts
|
|
2576
|
+
type StaticSuggestionInput = Omit<Suggestion$1, "isLoading"> & Partial<Pick<Suggestion$1, "isLoading">>;
|
|
2577
|
+
type StaticSuggestionsConfigInput = Omit<StaticSuggestionsConfig$1, "suggestions"> & {
|
|
2578
|
+
suggestions: StaticSuggestionInput[];
|
|
2579
|
+
};
|
|
2580
|
+
type SuggestionsConfigInput = DynamicSuggestionsConfig$1 | StaticSuggestionsConfigInput;
|
|
2581
|
+
declare function useConfigureSuggestions(config: SuggestionsConfigInput | null | undefined, deps?: ReadonlyArray<unknown>): void;
|
|
2582
|
+
//#endregion
|
|
2583
|
+
//#region src/hooks/use-interrupt.d.ts
|
|
2584
|
+
type InterruptHandlerFn<TValue, TResult> = (props: InterruptHandlerProps<TValue>) => TResult | PromiseLike<TResult>;
|
|
2585
|
+
type InterruptResultFromHandler<THandler> = THandler extends ((...args: never[]) => infer TResult) ? TResult extends PromiseLike<infer TResolved> ? TResolved | null : TResult | null : null;
|
|
2586
|
+
type InterruptResult<TValue, TResult> = InterruptResultFromHandler<InterruptHandlerFn<TValue, TResult>>;
|
|
2587
|
+
type InterruptRenderInChat = boolean | undefined;
|
|
2588
|
+
type UseInterruptReturn<TRenderInChat extends InterruptRenderInChat> = TRenderInChat extends false ? React$1.ReactElement | null : TRenderInChat extends true | undefined ? void : React$1.ReactElement | null | void;
|
|
2589
|
+
/** Recognize thenables returned by interrupt preprocessing handlers. */
|
|
2590
|
+
/**
|
|
2591
|
+
* Configuration options for `useInterrupt`.
|
|
2592
|
+
*/
|
|
2593
|
+
interface UseInterruptConfigBase<TValue = unknown, TResult = never> {
|
|
2594
|
+
/**
|
|
2595
|
+
* Render function for the interrupt UI.
|
|
2596
|
+
*
|
|
2597
|
+
* Receives both the standard `interrupt`/`interrupts` and the legacy `event`.
|
|
2598
|
+
* Call `resolve(payload)` to resume with user input, or `cancel()` to cancel.
|
|
2599
|
+
*/
|
|
2600
|
+
render: (props: InterruptRenderProps<TValue, InterruptResult<TValue, TResult>>) => React$1.ReactElement;
|
|
2601
|
+
/**
|
|
2602
|
+
* Optional pre-render handler invoked when an interrupt is received.
|
|
2603
|
+
* Return a sync or async value to expose as `result` in `render`.
|
|
2604
|
+
* Rejecting/throwing falls back to `result = null`.
|
|
2605
|
+
*/
|
|
2606
|
+
handler?: InterruptHandlerFn<TValue, TResult>;
|
|
2607
|
+
/**
|
|
2608
|
+
* Optional predicate to filter which interrupts this hook handles.
|
|
2609
|
+
* Receives the legacy-compatible event (for standard interrupts, `value` is
|
|
2610
|
+
* the primary `Interrupt`). Return `false` to ignore.
|
|
2611
|
+
*/
|
|
2612
|
+
enabled?: (event: InterruptEvent<TValue>) => boolean;
|
|
2613
|
+
/** Optional agent id. Defaults to the current configured chat agent. */
|
|
2614
|
+
agentId?: string;
|
|
2615
|
+
}
|
|
2616
|
+
type UseInterruptConfig<TValue = unknown, TResult = never, TRenderInChat extends InterruptRenderInChat = undefined> = UseInterruptConfigBase<TValue, TResult> & {
|
|
2617
|
+
/** When true (default), the interrupt UI renders inside `<CopilotChat>` automatically. */renderInChat?: TRenderInChat;
|
|
2618
|
+
};
|
|
2619
|
+
/**
|
|
2620
|
+
* Handles agent interrupts with optional filtering, preprocessing, and resume behavior.
|
|
2621
|
+
*
|
|
2622
|
+
* Supports both the AG-UI standard interrupt flow (`RUN_FINISHED` with
|
|
2623
|
+
* `outcome.type === "interrupt"`) and the legacy custom-event flow
|
|
2624
|
+
* (`on_interrupt`). For standard interrupts, `render` receives `interrupt`
|
|
2625
|
+
* (the primary one) and `interrupts` (the full open set); call `resolve(payload)`
|
|
2626
|
+
* to resume or `cancel()` to cancel. Resuming addresses the targeted interrupt
|
|
2627
|
+
* and, once every open interrupt is addressed, submits a single spec `resume`
|
|
2628
|
+
* array via `copilotkit.runAgent`.
|
|
2629
|
+
*
|
|
2630
|
+
* - `renderInChat: true` (default): the element is published into `<CopilotChat>`; returns `void`.
|
|
2631
|
+
* - `renderInChat: false`: the hook returns the interrupt element for manual placement.
|
|
2632
|
+
*
|
|
2633
|
+
* @example
|
|
2634
|
+
* ```tsx
|
|
2635
|
+
* useInterrupt({
|
|
2636
|
+
* render: ({ interrupt, resolve, cancel }) => (
|
|
2637
|
+
* <div>
|
|
2638
|
+
* <p>{interrupt?.message}</p>
|
|
2639
|
+
* <button onClick={() => resolve({ approved: true })}>Approve</button>
|
|
2640
|
+
* <button onClick={() => cancel()}>Cancel</button>
|
|
2641
|
+
* </div>
|
|
2642
|
+
* ),
|
|
2643
|
+
* });
|
|
2644
|
+
* ```
|
|
2645
|
+
*/
|
|
2646
|
+
declare function useInterrupt<TResult = never, TRenderInChat extends InterruptRenderInChat = undefined>(config: UseInterruptConfig<any, TResult, TRenderInChat>): UseInterruptReturn<TRenderInChat>;
|
|
2647
|
+
//#endregion
|
|
2648
|
+
//#region src/hooks/use-memories.d.ts
|
|
2649
|
+
/**
|
|
2650
|
+
* Return value of the {@link useMemories} hook.
|
|
2651
|
+
*
|
|
2652
|
+
* The `memories` array is the server-authoritative list for the current user.
|
|
2653
|
+
* It is hydrated from a REST snapshot and kept current by realtime
|
|
2654
|
+
* `memory_metadata` deltas from the store's own channel. Mutations resolve
|
|
2655
|
+
* once the platform confirms the operation and reject with an `Error` on
|
|
2656
|
+
* failure.
|
|
2657
|
+
*/
|
|
2658
|
+
interface UseMemoriesResult {
|
|
2659
|
+
/**
|
|
2660
|
+
* Memories for the current user, newest first. Updated in realtime when
|
|
2661
|
+
* the platform pushes `memory_metadata` events.
|
|
2662
|
+
*/
|
|
2663
|
+
memories: Memory$1[];
|
|
2664
|
+
/**
|
|
2665
|
+
* `true` while the initial memory snapshot is being fetched. Subsequent
|
|
2666
|
+
* realtime updates do not re-enter the loading state.
|
|
2667
|
+
*/
|
|
2668
|
+
isLoading: boolean;
|
|
2669
|
+
/**
|
|
2670
|
+
* The most recent error from fetching memories or executing a mutation, or
|
|
2671
|
+
* `null` when there is no error. Cleared on the next fetch attempt, on a
|
|
2672
|
+
* successful fetch, when the runtime context changes, and on a successful
|
|
2673
|
+
* mutation (a failed mutation replaces it with that mutation's error).
|
|
2674
|
+
*/
|
|
2675
|
+
error: Error | null;
|
|
2676
|
+
/**
|
|
2677
|
+
* `true` when the platform memory routes are available. Set to `false`
|
|
2678
|
+
* after a 404 or 501, indicating memory is not supported by the current
|
|
2679
|
+
* runtime configuration.
|
|
2680
|
+
*/
|
|
2681
|
+
isAvailable: boolean;
|
|
2682
|
+
/**
|
|
2683
|
+
* Health of the realtime connection that streams live `memory_metadata`
|
|
2684
|
+
* deltas. Distinct from `isAvailable`/`error` (which describe the REST list
|
|
2685
|
+
* route): `"connecting"` while the socket opens/joins, `"connected"` once
|
|
2686
|
+
* live deltas are flowing, and `"unavailable"` once the socket permanently
|
|
2687
|
+
* gives up — at which point the list is a frozen snapshot. Lets the UI drop a
|
|
2688
|
+
* "live" indicator instead of showing it over stale data.
|
|
2689
|
+
*/
|
|
2690
|
+
realtimeStatus: MemoryRealtimeStatus$1;
|
|
2691
|
+
/**
|
|
2692
|
+
* Re-fetch the memory snapshot from the platform. Resolves once the re-pull
|
|
2693
|
+
* settles; rejects if it fails or the store is torn down mid-flight.
|
|
2694
|
+
*/
|
|
2695
|
+
refresh: () => Promise<void>;
|
|
2696
|
+
/**
|
|
2697
|
+
* Create a memory. Resolves to the stored memory (server-authoritative);
|
|
2698
|
+
* rejects on failure.
|
|
2699
|
+
*/
|
|
2700
|
+
addMemory: (input: NewMemory$1) => Promise<Memory$1>;
|
|
2701
|
+
/**
|
|
2702
|
+
* Supersede a memory: the old memory is retired and a new one is created.
|
|
2703
|
+
* Resolves to the new memory (its `id` differs from `id`); rejects on
|
|
2704
|
+
* failure.
|
|
2705
|
+
*
|
|
2706
|
+
* Supersede is a FULL replacement, not a partial patch: `changes` is the
|
|
2707
|
+
* complete definition of the new memory. You must re-supply `content` and
|
|
2708
|
+
* `kind`, and an omitted `sourceThreadIds` resets the new memory's source
|
|
2709
|
+
* threads to empty — it does not preserve the prior memory's value.
|
|
2710
|
+
*/
|
|
2711
|
+
updateMemory: (id: string, changes: MemoryChanges$1) => Promise<Memory$1>;
|
|
2712
|
+
/**
|
|
2713
|
+
* Retire a memory (non-lossy delete). Resolves when the server confirms;
|
|
2714
|
+
* rejects on failure.
|
|
2715
|
+
*/
|
|
2716
|
+
removeMemory: (id: string) => Promise<void>;
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* React hook for listing and managing platform memories.
|
|
2720
|
+
*
|
|
2721
|
+
* Reads the memory store owned and wired by `CopilotKitCore`. On mount the
|
|
2722
|
+
* hook exposes the live list plus stable `addMemory` / `updateMemory` /
|
|
2723
|
+
* `removeMemory` / `refresh` callbacks. Mutations are server-authoritative:
|
|
2724
|
+
* each resolves once the platform confirms the operation and rejects with an
|
|
2725
|
+
* `Error` on failure.
|
|
2726
|
+
*
|
|
2727
|
+
* Realtime updates are automatic: the core's memory store opens its own
|
|
2728
|
+
* `user_meta:memories:<joinCode>` channel and applies `memory_metadata` deltas
|
|
2729
|
+
* to the list. You can still call `refresh()` to re-pull the REST snapshot on
|
|
2730
|
+
* demand.
|
|
2731
|
+
*
|
|
2732
|
+
* @returns Memory list state and stable mutation callbacks.
|
|
2733
|
+
*
|
|
2734
|
+
* @example
|
|
604
2735
|
* ```tsx
|
|
605
|
-
* import {
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
2736
|
+
* import { useMemories } from "@copilotkit/react-core";
|
|
2737
|
+
*
|
|
2738
|
+
* function MemoryList() {
|
|
2739
|
+
* const { memories, isLoading, isAvailable, addMemory, removeMemory } =
|
|
2740
|
+
* useMemories();
|
|
2741
|
+
*
|
|
2742
|
+
* if (!isAvailable) return null;
|
|
2743
|
+
* if (isLoading) return <p>Loading…</p>;
|
|
2744
|
+
*
|
|
2745
|
+
* return (
|
|
2746
|
+
* <ul>
|
|
2747
|
+
* {memories.map((m) => (
|
|
2748
|
+
* <li key={m.id}>
|
|
2749
|
+
* {m.content}
|
|
2750
|
+
* <button onClick={() => removeMemory(m.id)}>Delete</button>
|
|
2751
|
+
* </li>
|
|
2752
|
+
* ))}
|
|
2753
|
+
* </ul>
|
|
2754
|
+
* );
|
|
616
2755
|
* }
|
|
617
2756
|
* ```
|
|
618
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
|
|
619
2757
|
*/
|
|
620
|
-
declare function
|
|
621
|
-
//#endregion
|
|
622
|
-
//#region src/
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
2758
|
+
declare function useMemories(): UseMemoriesResult;
|
|
2759
|
+
//#endregion
|
|
2760
|
+
//#region src/hooks/use-learn-from-user-action.d.ts
|
|
2761
|
+
/**
|
|
2762
|
+
* Input to {@link UseLearnFromUserActionRecorder}, the function returned
|
|
2763
|
+
* by {@link useLearnFromUserAction}. Captures a single UI interaction that
|
|
2764
|
+
* CopilotKit Intelligence's auto-curated knowledge base loop will distill
|
|
2765
|
+
* into the team's `/project` notes.
|
|
2766
|
+
*/
|
|
2767
|
+
interface LearnFromUserActionInput {
|
|
2768
|
+
/** Thread the action is associated with. May be unknown to the platform. */
|
|
2769
|
+
threadId: string;
|
|
2770
|
+
/** Short, agent-readable summary of what the user did. Optional. */
|
|
2771
|
+
title?: string | null;
|
|
2772
|
+
/** Optional longer explanation. */
|
|
2773
|
+
description?: string | null;
|
|
2774
|
+
/** Free-form, JSON-serializable snapshot describing the action. Optional. */
|
|
2775
|
+
data?: unknown;
|
|
2776
|
+
/** ISO-8601 client-asserted timestamp. Defaults to server NOW() when absent. */
|
|
2777
|
+
occurredAt?: string;
|
|
2778
|
+
/**
|
|
2779
|
+
* Caller-supplied idempotency key. When omitted, `recordAnnotation` generates a
|
|
2780
|
+
* fresh UUID per call so retries collapse to the original row at the
|
|
2781
|
+
* platform. Supply your own to keep a single semantic event idempotent
|
|
2782
|
+
* across calls (e.g. a React re-render or a manual retry button).
|
|
2783
|
+
*/
|
|
2784
|
+
clientEventId?: string;
|
|
2785
|
+
}
|
|
2786
|
+
/** Outcome returned by the recorder function. */
|
|
2787
|
+
interface LearnFromUserActionResult {
|
|
2788
|
+
/** Platform-assigned id of the user-action row. */
|
|
2789
|
+
id: string;
|
|
2790
|
+
/** True when the platform recognized this `clientEventId` as a retry. */
|
|
2791
|
+
duplicate: boolean;
|
|
2792
|
+
}
|
|
2793
|
+
/** Recorder function returned by {@link useLearnFromUserAction}. */
|
|
2794
|
+
type UseLearnFromUserActionRecorder = (input: LearnFromUserActionInput) => Promise<LearnFromUserActionResult>;
|
|
628
2795
|
/**
|
|
629
|
-
*
|
|
2796
|
+
* Record a user UI interaction in CopilotKit Intelligence's user-actions
|
|
2797
|
+
* stream. The platform's auto-curated knowledge base agent reads these
|
|
2798
|
+
* (alongside finished agent runs) and writes free-form Obsidian-flavored
|
|
2799
|
+
* markdown to `/project`, where any agent in the same project can later
|
|
2800
|
+
* read it via the `copilotkit_knowledge_base_shell` MCP tool.
|
|
630
2801
|
*
|
|
2802
|
+
* The hook returns a stable function. Calling it issues a request to the
|
|
2803
|
+
* customer's CopilotKit runtime (`POST ${runtimeUrl}/annotate`), which
|
|
2804
|
+
* resolves the Intel user from the BFF's auth and forwards to the
|
|
2805
|
+
* platform — the Intel API key never reaches the browser.
|
|
2806
|
+
*
|
|
2807
|
+
* If `clientEventId` is omitted `recordAnnotation` generates a UUID per call,
|
|
2808
|
+
* so a naive double-call (e.g. React 18 strict-mode double-mount, or a retry
|
|
2809
|
+
* after a network blip on a fresh Promise) is naturally safe. Supply your
|
|
2810
|
+
* own key when a single semantic event must remain idempotent across
|
|
2811
|
+
* multiple `learnFromUserAction(...)` calls.
|
|
2812
|
+
*
|
|
2813
|
+
* @example
|
|
631
2814
|
* ```tsx
|
|
632
|
-
* import {
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
* )
|
|
643
|
-
* }
|
|
644
|
-
* return null;
|
|
2815
|
+
* import { useLearnFromUserAction } from "@copilotkit/react-core";
|
|
2816
|
+
*
|
|
2817
|
+
* function SettingsPage({ threadId }) {
|
|
2818
|
+
* const learnFromUserAction = useLearnFromUserAction();
|
|
2819
|
+
*
|
|
2820
|
+
* const onRename = (oldName: string, newName: string) => {
|
|
2821
|
+
* void learnFromUserAction({
|
|
2822
|
+
* threadId,
|
|
2823
|
+
* title: "Renamed project",
|
|
2824
|
+
* data: { previous: { name: oldName }, next: { name: newName } },
|
|
2825
|
+
* });
|
|
2826
|
+
* };
|
|
645
2827
|
* }
|
|
646
2828
|
* ```
|
|
647
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useHumanInTheLoop
|
|
648
2829
|
*/
|
|
649
|
-
declare function
|
|
2830
|
+
declare function useLearnFromUserAction(): UseLearnFromUserActionRecorder;
|
|
650
2831
|
//#endregion
|
|
651
|
-
//#region src/
|
|
652
|
-
type UseRenderToolCallArgs<T extends Parameter[] | [] = []> = Pick<FrontendAction<T>, "name" | "description" | "parameters"> & {
|
|
653
|
-
available?: "disabled" | "enabled";
|
|
654
|
-
render: T extends [] ? (props: ActionRenderPropsNoArgs<T>) => React.ReactElement : (props: ActionRenderProps<T>) => React.ReactElement;
|
|
655
|
-
};
|
|
2832
|
+
//#region src/hooks/use-learn-from-user-action-in-current-thread.d.ts
|
|
656
2833
|
/**
|
|
657
|
-
*
|
|
2834
|
+
* Input to {@link UseLearnFromUserActionInCurrentThreadRecorder} — same as
|
|
2835
|
+
* {@link LearnFromUserActionInput} minus `threadId`, which is sourced from
|
|
2836
|
+
* the surrounding `<CopilotChatConfigurationProvider>` at call time.
|
|
2837
|
+
*/
|
|
2838
|
+
type LearnFromUserActionInCurrentThreadInput = Omit<LearnFromUserActionInput, "threadId">;
|
|
2839
|
+
/** Recorder function returned by {@link useLearnFromUserActionInCurrentThread}. */
|
|
2840
|
+
type UseLearnFromUserActionInCurrentThreadRecorder = (input: LearnFromUserActionInCurrentThreadInput) => Promise<LearnFromUserActionResult>;
|
|
2841
|
+
/**
|
|
2842
|
+
* Record a user UI interaction against the **current chat's** thread. The
|
|
2843
|
+
* `threadId` is sourced from the surrounding
|
|
2844
|
+
* `<CopilotChatConfigurationProvider>` (the same provider `<CopilotChat>`,
|
|
2845
|
+
* `<CopilotSidebar>`, and friends set up), so callers in a chat-aware
|
|
2846
|
+
* subtree don't need to thread an id through manually.
|
|
2847
|
+
*
|
|
2848
|
+
* Throws on **call** (not on mount) when there is no chat-config provider
|
|
2849
|
+
* in scope — matches the "throw on call when runtimeUrl is missing"
|
|
2850
|
+
* behavior of {@link useLearnFromUserAction}. Mounting the hook in a branch
|
|
2851
|
+
* that never fires is harmless.
|
|
2852
|
+
*
|
|
2853
|
+
* The recorder does NOT accept a `threadId` override. If you need to
|
|
2854
|
+
* record against an explicit thread, use {@link useLearnFromUserAction}
|
|
2855
|
+
* directly — two hooks, two crisp contracts, no mode confusion.
|
|
658
2856
|
*
|
|
2857
|
+
* This hook always uses `config.threadId`, regardless of whether the
|
|
2858
|
+
* surrounding chat config minted it internally or received one from
|
|
2859
|
+
* the caller. Auto-minted threads simply mean the action lands under
|
|
2860
|
+
* a thread the platform never saw — the writer agent still distills
|
|
2861
|
+
* user-action-only threads (it does not require the thread to exist
|
|
2862
|
+
* in `cpki.threads`), so the loop keeps learning.
|
|
2863
|
+
*
|
|
2864
|
+
* @example
|
|
659
2865
|
* ```tsx
|
|
660
|
-
* import {
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
* )
|
|
670
|
-
* }
|
|
671
|
-
*
|
|
2866
|
+
* import { useLearnFromUserActionInCurrentThread } from "@copilotkit/react-core";
|
|
2867
|
+
*
|
|
2868
|
+
* function SettingsPanel() {
|
|
2869
|
+
* const learnFromUserAction = useLearnFromUserActionInCurrentThread();
|
|
2870
|
+
*
|
|
2871
|
+
* const onRename = (oldName: string, newName: string) => {
|
|
2872
|
+
* void learnFromUserAction({
|
|
2873
|
+
* title: "Renamed project",
|
|
2874
|
+
* data: { previous: { name: oldName }, next: { name: newName } },
|
|
2875
|
+
* });
|
|
2876
|
+
* };
|
|
2877
|
+
*
|
|
2878
|
+
* // ...
|
|
672
2879
|
* }
|
|
673
2880
|
* ```
|
|
674
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useRenderTool
|
|
675
2881
|
*/
|
|
676
|
-
declare function
|
|
2882
|
+
declare function useLearnFromUserActionInCurrentThread(): UseLearnFromUserActionInCurrentThreadRecorder;
|
|
677
2883
|
//#endregion
|
|
678
|
-
//#region src/
|
|
2884
|
+
//#region src/hooks/use-attachments.d.ts
|
|
2885
|
+
interface UseAttachmentsProps {
|
|
2886
|
+
config?: AttachmentsConfig$1;
|
|
2887
|
+
}
|
|
2888
|
+
interface UseAttachmentsReturn {
|
|
2889
|
+
/** Currently selected attachments (uploading + ready). */
|
|
2890
|
+
attachments: Attachment$1[];
|
|
2891
|
+
/** Whether attachments are enabled. */
|
|
2892
|
+
enabled: boolean;
|
|
2893
|
+
/** Whether the user is dragging a file over the drop zone. */
|
|
2894
|
+
dragOver: boolean;
|
|
2895
|
+
/** Ref for the hidden file input element. */
|
|
2896
|
+
fileInputRef: React$1.RefObject<HTMLInputElement | null>;
|
|
2897
|
+
/** Ref for the container element (used for scoped paste handling). */
|
|
2898
|
+
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
2899
|
+
/** Process an array of files (validate, upload, add to state). */
|
|
2900
|
+
processFiles: (files: File[]) => Promise<void>;
|
|
2901
|
+
/** Handler for `<input type="file" onChange>`. */
|
|
2902
|
+
handleFileUpload: (e: React$1.ChangeEvent<HTMLInputElement>) => Promise<void>;
|
|
2903
|
+
/** Handler for `onDragOver` on the drop zone. */
|
|
2904
|
+
handleDragOver: (e: React$1.DragEvent) => void;
|
|
2905
|
+
/** Handler for `onDragLeave` on the drop zone. */
|
|
2906
|
+
handleDragLeave: (e: React$1.DragEvent) => void;
|
|
2907
|
+
/** Handler for `onDrop` on the drop zone. */
|
|
2908
|
+
handleDrop: (e: React$1.DragEvent) => Promise<void>;
|
|
2909
|
+
/** Remove an attachment by ID. */
|
|
2910
|
+
removeAttachment: (id: string) => void;
|
|
2911
|
+
/**
|
|
2912
|
+
* Consume ready attachments and clear the queue.
|
|
2913
|
+
* Returns the attachments that were ready; resets the file input.
|
|
2914
|
+
* No-ops if the queue is already empty (no state update triggered).
|
|
2915
|
+
*/
|
|
2916
|
+
consumeAttachments: () => Attachment$1[];
|
|
2917
|
+
}
|
|
679
2918
|
/**
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
* {@link CatchAllFrontendAction}.
|
|
2919
|
+
* Hook that manages file attachment state — uploads, drag-and-drop, paste,
|
|
2920
|
+
* and lifecycle. All returned callbacks are referentially stable across
|
|
2921
|
+
* renders (via useCallback) to avoid destabilizing downstream memoization.
|
|
684
2922
|
*/
|
|
685
|
-
|
|
686
|
-
|
|
2923
|
+
declare function useAttachments({
|
|
2924
|
+
config
|
|
2925
|
+
}: UseAttachmentsProps): UseAttachmentsReturn;
|
|
687
2926
|
//#endregion
|
|
688
|
-
//#region src/
|
|
689
|
-
|
|
2927
|
+
//#region src/hooks/use-learning-containers.d.ts
|
|
2928
|
+
/**
|
|
2929
|
+
* Arguments for {@link useLearningContainers}.
|
|
2930
|
+
*
|
|
2931
|
+
* @deprecated This interface supports only the legacy plural-container
|
|
2932
|
+
* annotation. Configure `getLearningContainerId` on `CopilotKitIntelligence`
|
|
2933
|
+
* for new Intelligence runtimes.
|
|
2934
|
+
*/
|
|
2935
|
+
interface UseLearningContainersArgs {
|
|
2936
|
+
/** Thread to apply the learning-container selection to. */
|
|
2937
|
+
threadId: string;
|
|
2938
|
+
/**
|
|
2939
|
+
* The ordered list of learning container identifiers to activate for this
|
|
2940
|
+
* thread. Defaults to `["project"]` on the backend when absent.
|
|
2941
|
+
*/
|
|
2942
|
+
learningContainers: readonly string[];
|
|
2943
|
+
}
|
|
2944
|
+
/**
|
|
2945
|
+
* Legacy compatibility hook that keeps a thread's plural learning-container
|
|
2946
|
+
* annotation in sync by emitting
|
|
2947
|
+
* `set_learning_containers` annotations via the CopilotKit runtime annotate
|
|
2948
|
+
* endpoint (`POST ${runtimeUrl}/annotate`).
|
|
2949
|
+
*
|
|
2950
|
+
* **Emit rules:**
|
|
2951
|
+
* - On mount with `["project"]` (the backend default) → does NOT emit.
|
|
2952
|
+
* Absence of an annotation equals the default, so the round-trip is skipped.
|
|
2953
|
+
* - On mount with any other value → emits immediately.
|
|
2954
|
+
* - On any subsequent content change (including a switch back to
|
|
2955
|
+
* `["project"]`) → emits (a deliberate switch is always recorded).
|
|
2956
|
+
* - On unmount or threadId change → emits a reset to `["project"]`
|
|
2957
|
+
* so the backend is left in a clean state for the next consumer.
|
|
2958
|
+
* Changing `learningContainers` within the same thread does NOT reset the
|
|
2959
|
+
* thread; only the new value is emitted.
|
|
2960
|
+
*
|
|
2961
|
+
* Content-equality is evaluated via `JSON.stringify` so a fresh array literal
|
|
2962
|
+
* with the same items does NOT trigger a redundant emit.
|
|
2963
|
+
*
|
|
2964
|
+
* If `runtimeUrl` is absent, all emits are silently skipped.
|
|
2965
|
+
*
|
|
2966
|
+
* @example
|
|
2967
|
+
* ```tsx
|
|
2968
|
+
* function ThreadPane({ threadId, userScope }: Props) {
|
|
2969
|
+
* useLearningContainers({
|
|
2970
|
+
* threadId,
|
|
2971
|
+
* learningContainers: [userScope],
|
|
2972
|
+
* });
|
|
2973
|
+
* // ...
|
|
2974
|
+
* }
|
|
2975
|
+
* ```
|
|
2976
|
+
*
|
|
2977
|
+
* @deprecated This hook supports only the legacy plural-container annotation.
|
|
2978
|
+
* Configure `getLearningContainerId` on `CopilotKitIntelligence` for new
|
|
2979
|
+
* Intelligence runtimes.
|
|
2980
|
+
*/
|
|
2981
|
+
declare function useLearningContainers({
|
|
2982
|
+
threadId,
|
|
2983
|
+
learningContainers
|
|
2984
|
+
}: UseLearningContainersArgs): void;
|
|
690
2985
|
//#endregion
|
|
691
|
-
//#region src/
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
2986
|
+
//#region src/hooks/use-learning-containers-in-current-thread.d.ts
|
|
2987
|
+
/**
|
|
2988
|
+
* Arguments for {@link useLearningContainersInCurrentThread}.
|
|
2989
|
+
* Same as {@link UseLearningContainersArgs} minus `threadId`, which is
|
|
2990
|
+
* sourced from the surrounding `<CopilotChatConfigurationProvider>` at
|
|
2991
|
+
* render time.
|
|
2992
|
+
*
|
|
2993
|
+
* @deprecated This type supports only the legacy plural-container annotation.
|
|
2994
|
+
* Configure `getLearningContainerId` on `CopilotKitIntelligence` for new
|
|
2995
|
+
* Intelligence runtimes.
|
|
2996
|
+
*/
|
|
2997
|
+
type UseLearningContainersInCurrentThreadArgs = Omit<UseLearningContainersArgs, "threadId">;
|
|
2998
|
+
/**
|
|
2999
|
+
* Legacy compatibility hook that keeps the **current chat thread's** plural
|
|
3000
|
+
* learning-container annotation in sync. The `threadId` is sourced from the surrounding
|
|
3001
|
+
* `<CopilotChatConfigurationProvider>` (the same provider `<CopilotChat>`,
|
|
3002
|
+
* `<CopilotSidebar>`, and friends set up), so callers in a chat-aware
|
|
3003
|
+
* subtree don't need to thread an id through manually.
|
|
3004
|
+
*
|
|
3005
|
+
* **Throws on render** when there is no chat-config provider in scope or
|
|
3006
|
+
* when the provider does not yet have an active `threadId`. Mount the hook
|
|
3007
|
+
* inside a subtree that is guaranteed to have a thread context.
|
|
3008
|
+
*
|
|
3009
|
+
* If you need to manage an explicit thread, use {@link useLearningContainers}
|
|
3010
|
+
* directly — two hooks, two crisp contracts, no mode confusion.
|
|
3011
|
+
*
|
|
3012
|
+
* @throws When no `CopilotChatConfigurationProvider` is in scope or when the
|
|
3013
|
+
* active `threadId` is absent/empty.
|
|
3014
|
+
*
|
|
3015
|
+
* @example
|
|
3016
|
+
* ```tsx
|
|
3017
|
+
* function ThreadPanel({ scope }: Props) {
|
|
3018
|
+
* useLearningContainersInCurrentThread({
|
|
3019
|
+
* learningContainers: [scope],
|
|
3020
|
+
* });
|
|
3021
|
+
* // ...
|
|
3022
|
+
* }
|
|
3023
|
+
* ```
|
|
3024
|
+
*
|
|
3025
|
+
* @deprecated This hook supports only the legacy plural-container annotation.
|
|
3026
|
+
* Configure `getLearningContainerId` on `CopilotKitIntelligence` for new
|
|
3027
|
+
* Intelligence runtimes.
|
|
3028
|
+
*/
|
|
3029
|
+
declare function useLearningContainersInCurrentThread({
|
|
3030
|
+
learningContainers
|
|
3031
|
+
}: UseLearningContainersInCurrentThreadArgs): void;
|
|
3032
|
+
//#endregion
|
|
3033
|
+
//#region src/a2ui/A2UIRecoveryStates.d.ts
|
|
3034
|
+
/**
|
|
3035
|
+
* Shared pre-paint lifecycle states for the A2UI surface renderer (OSS-162).
|
|
3036
|
+
*
|
|
3037
|
+
* The A2UI middleware drives the WHOLE generative-UI lifecycle on a single
|
|
3038
|
+
* `a2ui-surface` activity (one stable messageId, `replace: true`), so the states
|
|
3039
|
+
* below swap IN PLACE and the painted surface ultimately replaces them:
|
|
3040
|
+
*
|
|
3041
|
+
* building → animated skeleton + "Building interface" (+ optional ~N tokens)
|
|
3042
|
+
* retrying → same skeleton; once perceptible, the sub-label becomes
|
|
3043
|
+
* "Retrying generation… (N/M attempts)" (threshold-gated so a fast
|
|
3044
|
+
* transient retry never flashes), with debug detail per debugExposure
|
|
3045
|
+
* failed → a clean hard-failure card (replacing the skeleton), developer
|
|
3046
|
+
* detail tucked into an expander gated by debugExposure
|
|
3047
|
+
* painted → the surface renderer owns the UI (these states render nothing)
|
|
3048
|
+
*
|
|
3049
|
+
* Timing (`showAfterMs` / `showAfterAttempts`) and how much debug detail to surface
|
|
3050
|
+
* (`debugExposure`) are client concerns; the server can override `debugExposure`
|
|
3051
|
+
* by stamping it onto the activity content (it wins over the client option).
|
|
3052
|
+
*/
|
|
3053
|
+
type A2UIRecoveryRendererOptions = {
|
|
3054
|
+
/** 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. */
|
|
3055
|
+
showAfterAttempts?: number; /** How much retry/debug detail to surface. Default "collapsed". */
|
|
3056
|
+
debugExposure?: "hidden" | "collapsed" | "verbose";
|
|
695
3057
|
};
|
|
696
|
-
|
|
3058
|
+
//#endregion
|
|
3059
|
+
//#region src/providers/CopilotKitProvider.d.ts
|
|
3060
|
+
interface CopilotKitProviderProps {
|
|
3061
|
+
children: ReactNode;
|
|
3062
|
+
runtimeUrl?: string;
|
|
697
3063
|
/**
|
|
698
|
-
* A
|
|
3064
|
+
* Headers sent with every request. A record, or a sync or async builder
|
|
3065
|
+
* that runs when each request is sent. An inline arrow is fine. The builder
|
|
3066
|
+
* should be cheap; cache tokens in it (Clerk's `getToken()` already does).
|
|
699
3067
|
*/
|
|
700
|
-
|
|
3068
|
+
headers?: CopilotKitHeadersSource$1;
|
|
701
3069
|
/**
|
|
702
|
-
*
|
|
703
|
-
* @default 1
|
|
3070
|
+
* Credentials mode for fetch requests (e.g., "include" for HTTP-only cookies in cross-origin requests).
|
|
704
3071
|
*/
|
|
705
|
-
|
|
3072
|
+
credentials?: RequestCredentials;
|
|
706
3073
|
/**
|
|
707
|
-
*
|
|
708
|
-
*
|
|
3074
|
+
* Rewrites the message list sent to runtime agents on every run.
|
|
3075
|
+
*
|
|
3076
|
+
* CopilotKit sends the whole thread each time. When your agent already
|
|
3077
|
+
* stores the conversation, most of that payload is waste, and an agent that
|
|
3078
|
+
* merges the inbound list with its own store can show the model every turn
|
|
3079
|
+
* twice. Return the messages to send:
|
|
3080
|
+
*
|
|
3081
|
+
* ```tsx
|
|
3082
|
+
* <CopilotKit
|
|
3083
|
+
* runtimeUrl="/api/copilotkit"
|
|
3084
|
+
* messageFilter={(messages) => messages.slice(-1)}
|
|
3085
|
+
* />
|
|
3086
|
+
* ```
|
|
3087
|
+
*
|
|
3088
|
+
* The filter changes the request body only. The transcript the UI renders is
|
|
3089
|
+
* untouched. Broken tool-call pairs are repaired before the request is sent,
|
|
3090
|
+
* so a filter this blunt cannot strand a tool result mid-HITL.
|
|
3091
|
+
*
|
|
3092
|
+
* Agents reached through your CopilotRuntime honor this. An agent your app
|
|
3093
|
+
* passes in directly does not, and neither Intelligence runs nor suggestion
|
|
3094
|
+
* runs are ever filtered.
|
|
3095
|
+
*
|
|
3096
|
+
* Prefer a stable reference (`useCallback`). An inline arrow re-registers the
|
|
3097
|
+
* filter on every render, which is harmless but needless.
|
|
3098
|
+
*/
|
|
3099
|
+
messageFilter?: CopilotKitMessageFilter$1;
|
|
3100
|
+
/** Your CopilotKit public license key. */
|
|
3101
|
+
publicApiKey?: string;
|
|
3102
|
+
/** Your public license key for accessing CopilotKit Intelligence features. */
|
|
3103
|
+
publicLicenseKey?: string;
|
|
3104
|
+
/**
|
|
3105
|
+
* Signed license token for offline verification of CopilotKit Intelligence features.
|
|
3106
|
+
* Obtain from https://dashboard.operations.copilotkit.ai.
|
|
709
3107
|
*/
|
|
710
|
-
|
|
3108
|
+
licenseToken?: string;
|
|
3109
|
+
properties?: Record<string, unknown>;
|
|
711
3110
|
/**
|
|
712
|
-
*
|
|
713
|
-
*
|
|
3111
|
+
* The id of the agent every `<CopilotChat>` under this provider talks to,
|
|
3112
|
+
* unless a chat names its own with the `agentId` prop.
|
|
3113
|
+
*
|
|
3114
|
+
* This is the v2 replacement for the v1 `<CopilotKit agent="...">` prop. Set
|
|
3115
|
+
* it here and you never need the v1 compatibility provider just to name an
|
|
3116
|
+
* agent. Defaults to `"default"`.
|
|
714
3117
|
*/
|
|
715
|
-
|
|
3118
|
+
agentId?: string;
|
|
3119
|
+
useSingleEndpoint?: boolean;
|
|
3120
|
+
agents__unsafe_dev_only?: Record<string, AbstractAgent$1>;
|
|
3121
|
+
selfManagedAgents?: Record<string, AbstractAgent$1>;
|
|
3122
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
3123
|
+
renderActivityMessages?: ReactActivityMessageRenderer<any>[];
|
|
3124
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
716
3125
|
/**
|
|
717
|
-
*
|
|
3126
|
+
* Global markdown renderer used by assistant/reasoning messages. Overrides the
|
|
3127
|
+
* built-in basic renderer. A per-message `markdownRenderer` slot still wins
|
|
3128
|
+
* over this. Plug in your own (e.g. a streamdown wrapper) to restore rich
|
|
3129
|
+
* rendering — CopilotKit ships only the basic renderer.
|
|
718
3130
|
*/
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
3131
|
+
markdownRenderer?: MarkdownRenderer;
|
|
3132
|
+
frontendTools?: ReactFrontendTool[];
|
|
3133
|
+
humanInTheLoop?: ReactHumanInTheLoop[];
|
|
3134
|
+
/**
|
|
3135
|
+
* Configuration for OpenGenerativeUI — sandboxed UI generated by the LLM.
|
|
3136
|
+
*
|
|
3137
|
+
* @example
|
|
3138
|
+
* ```tsx
|
|
3139
|
+
* <CopilotKit
|
|
3140
|
+
* runtimeUrl="/api/copilotkit"
|
|
3141
|
+
* openGenerativeUI={{
|
|
3142
|
+
* sandboxFunctions: [{ name: "addToCart", description: "…", parameters: schema, handler: fn }],
|
|
3143
|
+
* }}
|
|
3144
|
+
* >
|
|
3145
|
+
* ```
|
|
3146
|
+
*/
|
|
3147
|
+
openGenerativeUI?: {
|
|
3148
|
+
/**
|
|
3149
|
+
* Functions made available inside sandboxed iframes.
|
|
3150
|
+
* Each function is described to the LLM via agent context and exposed
|
|
3151
|
+
* via websandbox's `localApi`.
|
|
3152
|
+
*
|
|
3153
|
+
* Inside the iframe, call them with:
|
|
3154
|
+
* ```js
|
|
3155
|
+
* await Websandbox.connection.remote.<functionName>(args)
|
|
3156
|
+
* ```
|
|
3157
|
+
*/
|
|
3158
|
+
sandboxFunctions?: SandboxFunction[];
|
|
3159
|
+
/**
|
|
3160
|
+
* Design guidelines injected as agent context for the `generateSandboxedUi` tool.
|
|
3161
|
+
* Override this to control the visual style of generated UIs.
|
|
3162
|
+
*
|
|
3163
|
+
* A sensible default is provided if omitted.
|
|
3164
|
+
*/
|
|
3165
|
+
designSkill?: string;
|
|
3166
|
+
};
|
|
3167
|
+
/**
|
|
3168
|
+
* @deprecated This prop no longer controls the Inspector. Use
|
|
3169
|
+
* `enableInspector` instead.
|
|
3170
|
+
*/
|
|
3171
|
+
showDevConsole?: boolean | "auto";
|
|
3172
|
+
/**
|
|
3173
|
+
* Disable the CopilotKit Inspector in development.
|
|
3174
|
+
* The Inspector is enabled by default in development browser builds on
|
|
3175
|
+
* localhost/loopback. It is always disabled on remote hosts, in production,
|
|
3176
|
+
* and during server rendering. Temporary Inspector hides also hide its
|
|
3177
|
+
* message shortcuts.
|
|
3178
|
+
* An explicit value takes priority over CopilotChat's inspectorTools prop.
|
|
3179
|
+
*/
|
|
3180
|
+
enableInspector?: boolean;
|
|
3181
|
+
/**
|
|
3182
|
+
* Whether to automatically mount the Intelligence indicator in chat.
|
|
3183
|
+
*
|
|
3184
|
+
* @default true
|
|
3185
|
+
*/
|
|
3186
|
+
showIntelligenceIndicator?: boolean;
|
|
3187
|
+
/**
|
|
3188
|
+
* Error handler called when CopilotKit encounters an error.
|
|
3189
|
+
* Fires for all error types (runtime connection failures, agent errors, tool errors).
|
|
3190
|
+
*/
|
|
3191
|
+
onError?: (event: {
|
|
3192
|
+
error: Error;
|
|
3193
|
+
code: CopilotKitCoreErrorCode$1;
|
|
3194
|
+
context: Record<string, any>;
|
|
3195
|
+
}) => void | Promise<void>;
|
|
3196
|
+
/**
|
|
3197
|
+
* Configuration for the A2UI (Agent-to-UI) renderer.
|
|
3198
|
+
* The built-in A2UI renderer is activated automatically when the runtime reports
|
|
3199
|
+
* that `a2ui` is configured in `CopilotRuntime`. This prop is optional and only
|
|
3200
|
+
* needed if you want to override the default theme.
|
|
3201
|
+
*
|
|
3202
|
+
* @example
|
|
3203
|
+
* ```tsx
|
|
3204
|
+
* <CopilotKit runtimeUrl="/api/copilotkit" a2ui={{ theme: myCustomTheme }}>
|
|
3205
|
+
* {children}
|
|
3206
|
+
* </CopilotKit>
|
|
3207
|
+
* ```
|
|
3208
|
+
*/
|
|
3209
|
+
a2ui?: {
|
|
3210
|
+
/**
|
|
3211
|
+
* Override the default A2UI viewer theme.
|
|
3212
|
+
* When omitted, the built-in `viewerTheme` from `@copilotkit/a2ui-renderer` is used.
|
|
3213
|
+
*/
|
|
3214
|
+
theme?: Theme;
|
|
3215
|
+
/**
|
|
3216
|
+
* Optional component catalog to pass to the A2UI renderer.
|
|
3217
|
+
* When omitted, the default basicCatalog is used.
|
|
3218
|
+
*/
|
|
3219
|
+
catalog?: any;
|
|
3220
|
+
/**
|
|
3221
|
+
* Optional custom loading component shown while an A2UI surface is generating.
|
|
3222
|
+
* When omitted, a default animated skeleton is shown.
|
|
3223
|
+
*/
|
|
3224
|
+
loadingComponent?: React$1.ComponentType;
|
|
3225
|
+
/**
|
|
3226
|
+
* When true (the default), the full component schemas from the catalog are
|
|
3227
|
+
* sent as agent context so the agent knows what components and props are
|
|
3228
|
+
* available. The A2UI middleware can overwrite this with a server-side
|
|
3229
|
+
* schema if configured.
|
|
3230
|
+
*
|
|
3231
|
+
* When false, the agent context still describes the catalog, but only by its
|
|
3232
|
+
* catalog ID and the names of its custom components, without their JSON
|
|
3233
|
+
* schemas. The component schema entry and the A2UI generation and design
|
|
3234
|
+
* guidelines are not sent. With the CopilotKit LangGraph middleware's
|
|
3235
|
+
* injected A2UI tool, the A2UI subagent then gets the component names only;
|
|
3236
|
+
* a host can still give it a composition guide through the middleware's
|
|
3237
|
+
* guidelines (`a2uiParams.guidelines.compositionGuide` in TypeScript,
|
|
3238
|
+
* `a2ui_params["guidelines"]["composition_guide"]` in Python).
|
|
3239
|
+
*/
|
|
3240
|
+
includeSchema?: boolean;
|
|
3241
|
+
/**
|
|
3242
|
+
* Options for the A2UI error-recovery status UI (OSS-162): how long before
|
|
3243
|
+
* the transient "Retrying…" hint appears, after how many attempts, and how
|
|
3244
|
+
* much retry/debug detail to surface. When omitted, sane defaults apply.
|
|
3245
|
+
*/
|
|
3246
|
+
recovery?: A2UIRecoveryRendererOptions;
|
|
3247
|
+
};
|
|
3248
|
+
/**
|
|
3249
|
+
* Experimental. Native generative UI: `generativeUI={{ ui }}`, where `ui`
|
|
3250
|
+
* comes from `createGenerativeUI`. The agent renders your React components
|
|
3251
|
+
* into chat or into `<GenerativeUISurface id>` mounts. Props that match
|
|
3252
|
+
* the declared state and events that match the declared functions are
|
|
3253
|
+
* bound by the library, and the model does not see them.
|
|
3254
|
+
*/
|
|
3255
|
+
generativeUI?: GenerativeUIConfig;
|
|
3256
|
+
/**
|
|
3257
|
+
* Configuration for the built-in MCP Apps renderer.
|
|
3258
|
+
*
|
|
3259
|
+
* @example
|
|
3260
|
+
* ```tsx
|
|
3261
|
+
* <CopilotKit runtimeUrl="/api/copilotkit" mcpApps={{ allowSameOriginFallback: true }}>
|
|
3262
|
+
* {children}
|
|
3263
|
+
* </CopilotKit>
|
|
3264
|
+
* ```
|
|
3265
|
+
*/
|
|
3266
|
+
mcpApps?: {
|
|
3267
|
+
/**
|
|
3268
|
+
* Restore `allow-same-origin` on the MCP App sandbox. Default `false`.
|
|
3269
|
+
*
|
|
3270
|
+
* **Unsafe.** The widget then runs with your page's origin: it can read
|
|
3271
|
+
* your cookies, storage and DOM, and call your APIs as the signed-in user.
|
|
3272
|
+
* Only set it for widgets you wrote and trust that need `localStorage`,
|
|
3273
|
+
* `IndexedDB` or cookies. By default widgets get an opaque origin.
|
|
3274
|
+
*/
|
|
3275
|
+
allowSameOriginFallback?: boolean;
|
|
3276
|
+
};
|
|
726
3277
|
/**
|
|
727
|
-
*
|
|
3278
|
+
* Default throttle interval (in milliseconds) for `useAgent` re-renders
|
|
3279
|
+
* triggered by `OnMessagesChanged` notifications. This value is used as
|
|
3280
|
+
* a fallback when neither the `useAgent()` hook nor `<CopilotChat>` /
|
|
3281
|
+
* `<CopilotSidebar>` / `<CopilotPopup>` specify an explicit `throttleMs`.
|
|
3282
|
+
*
|
|
3283
|
+
* @default undefined (components/hooks without an explicit throttleMs will be unthrottled)
|
|
728
3284
|
*/
|
|
729
|
-
|
|
3285
|
+
defaultThrottleMs?: number;
|
|
730
3286
|
/**
|
|
731
|
-
*
|
|
3287
|
+
* Enable debug logging for the client-side event pipeline.
|
|
732
3288
|
*/
|
|
733
|
-
|
|
3289
|
+
debug?: DebugConfig;
|
|
734
3290
|
/**
|
|
735
|
-
*
|
|
3291
|
+
* Turns on interaction capture (`@copilotkit/learning`). `learning` (short
|
|
3292
|
+
* for `learning={true}`) records with the default options; pass an object
|
|
3293
|
+
* for options. `false` or omitting the prop turns capture off and cancels
|
|
3294
|
+
* startup. Without a sink, Core authenticates with the runtime and sends
|
|
3295
|
+
* browser events to Intelligence; a custom sink keeps the standalone
|
|
3296
|
+
* collector behavior. Updated settings apply to the next Trajectory.
|
|
3297
|
+
*
|
|
3298
|
+
* Capture starts after mount. Set `trajectoryId` to use your own ID;
|
|
3299
|
+
* otherwise the provider generates one. The generated ID stays the same
|
|
3300
|
+
* across rerenders, reconnects and option changes; turning capture off,
|
|
3301
|
+
* setting `autoStart: false` or supplying a `trajectoryId` ends it, and the
|
|
3302
|
+
* next generated Trajectory gets a new ID. Read the active ID from
|
|
3303
|
+
* `copilotkit.trajectoryId`.
|
|
3304
|
+
*
|
|
3305
|
+
* Set `autoStart: false` to start capture yourself with `startTrajectory()`.
|
|
3306
|
+
* Capture stops on unmount, including manually started Trajectories.
|
|
3307
|
+
*
|
|
3308
|
+
* @example
|
|
3309
|
+
* <CopilotKitProvider runtimeUrl="/api/copilotkit" learning>
|
|
736
3310
|
*/
|
|
737
|
-
|
|
3311
|
+
learning?: boolean | LearningProp;
|
|
3312
|
+
}
|
|
3313
|
+
type LearningProp = LearningConfig$1 & {
|
|
738
3314
|
/**
|
|
739
|
-
*
|
|
3315
|
+
* Starts a Trajectory after mount. Defaults to `true`; set `false` to call
|
|
3316
|
+
* `startTrajectory()` yourself.
|
|
740
3317
|
*/
|
|
741
|
-
|
|
3318
|
+
autoStart?: boolean;
|
|
3319
|
+
trajectoryId?: string;
|
|
742
3320
|
/**
|
|
743
|
-
*
|
|
3321
|
+
* Used only by explicit custom sinks. Authenticated capture warns and ignores
|
|
3322
|
+
* this option; assign Learning Spaces on the server with
|
|
3323
|
+
* `getTrajectoryLearningContainerIds` on `CopilotKitIntelligence`.
|
|
744
3324
|
*/
|
|
745
|
-
|
|
3325
|
+
learningContainerIds?: string[];
|
|
3326
|
+
};
|
|
3327
|
+
/** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */
|
|
3328
|
+
declare const CopilotKitProvider: React$1.FC<CopilotKitProviderProps>;
|
|
3329
|
+
//#endregion
|
|
3330
|
+
//#region src/providers/SandboxFunctionsContext.d.ts
|
|
3331
|
+
declare const SandboxFunctionsContext: react.Context<readonly SandboxFunction[]>;
|
|
3332
|
+
declare function useSandboxFunctions(): readonly SandboxFunction[];
|
|
3333
|
+
//#endregion
|
|
3334
|
+
//#region src/lib/react-core.d.ts
|
|
3335
|
+
interface CopilotKitCoreReactConfig extends CopilotKitCoreConfig$1 {
|
|
3336
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
3337
|
+
renderActivityMessages?: ReactActivityMessageRenderer<any>[];
|
|
3338
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
746
3339
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
3340
|
+
interface CopilotKitCoreReactSubscriber extends CopilotKitCoreSubscriber$1 {
|
|
3341
|
+
onRenderToolCallsChanged?: (event: {
|
|
3342
|
+
copilotkit: CopilotKitCore$1;
|
|
3343
|
+
renderToolCalls: ReactToolCallRenderer<any>[];
|
|
3344
|
+
}) => void | Promise<void>;
|
|
3345
|
+
onInterruptElementChanged?: (event: {
|
|
3346
|
+
copilotkit: CopilotKitCore$1;
|
|
3347
|
+
interruptElement: React$1.ReactElement | null;
|
|
3348
|
+
}) => void | Promise<void>;
|
|
3349
|
+
}
|
|
3350
|
+
declare class CopilotKitCoreReact extends CopilotKitCore$1 {
|
|
3351
|
+
private _renderToolCalls;
|
|
3352
|
+
private _hookRenderToolCalls;
|
|
3353
|
+
private _cachedMergedRenderToolCalls;
|
|
3354
|
+
private _renderCustomMessages;
|
|
3355
|
+
private _renderActivityMessages;
|
|
3356
|
+
private _interruptElement;
|
|
3357
|
+
constructor(config: CopilotKitCoreReactConfig);
|
|
3358
|
+
get renderCustomMessages(): Readonly<ReactCustomMessageRenderer[]>;
|
|
3359
|
+
get renderActivityMessages(): Readonly<ReactActivityMessageRenderer<any>>[];
|
|
3360
|
+
get renderToolCalls(): Readonly<ReactToolCallRenderer<any>>[];
|
|
3361
|
+
setRenderActivityMessages(renderers: ReactActivityMessageRenderer<any>[]): void;
|
|
3362
|
+
setRenderCustomMessages(renderers: ReactCustomMessageRenderer[]): void;
|
|
3363
|
+
setRenderToolCalls(renderToolCalls: ReactToolCallRenderer<any>[]): void;
|
|
3364
|
+
addHookRenderToolCall(entry: ReactToolCallRenderer<any>): void;
|
|
3365
|
+
removeHookRenderToolCall(name: string, agentId?: string): void;
|
|
3366
|
+
private _notifyRenderToolCallsChanged;
|
|
3367
|
+
get interruptElement(): React$1.ReactElement | null;
|
|
3368
|
+
setInterruptElement(element: React$1.ReactElement | null): void;
|
|
3369
|
+
subscribe(subscriber: CopilotKitCoreReactSubscriber): CopilotKitCoreSubscription$1;
|
|
754
3370
|
/**
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
3371
|
+
* Wait for pending React state updates before the follow-up agent run.
|
|
3372
|
+
*
|
|
3373
|
+
* When a frontend tool handler calls setState(), React 18 batches the update
|
|
3374
|
+
* and schedules a commit via its internal scheduler (MessageChannel). The
|
|
3375
|
+
* useAgentContext hook registers context via useLayoutEffect, which runs
|
|
3376
|
+
* synchronously after React commits that batch.
|
|
3377
|
+
*
|
|
3378
|
+
* Awaiting a zero-delay timeout yields to the macrotask queue. React's
|
|
3379
|
+
* MessageChannel task runs first, committing the pending state and running
|
|
3380
|
+
* useLayoutEffect (which updates the context store). The follow-up runAgent
|
|
3381
|
+
* call then reads fresh context.
|
|
758
3382
|
*/
|
|
759
|
-
|
|
3383
|
+
waitForPendingFrameworkUpdates(): Promise<void>;
|
|
760
3384
|
}
|
|
761
3385
|
//#endregion
|
|
762
|
-
//#region src/
|
|
3386
|
+
//#region src/a2ui/A2UIMessageRenderer.d.ts
|
|
763
3387
|
/**
|
|
764
|
-
*
|
|
3388
|
+
* User action with dataContextPath, as dispatched by A2UI components.
|
|
765
3389
|
*/
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
3390
|
+
type A2UIUserAction = {
|
|
3391
|
+
name: string;
|
|
3392
|
+
sourceComponentId: string;
|
|
3393
|
+
surfaceId: string;
|
|
3394
|
+
timestamp: string;
|
|
3395
|
+
context?: Record<string, unknown>;
|
|
3396
|
+
dataContextPath?: string;
|
|
3397
|
+
};
|
|
3398
|
+
/**
|
|
3399
|
+
* Intercept an A2UI user action before it reaches the agent.
|
|
3400
|
+
*
|
|
3401
|
+
* Called with the dispatched action and a `forward` helper that runs the agent
|
|
3402
|
+
* with the (optionally modified) action. The return value drives the default
|
|
3403
|
+
* forwarding:
|
|
3404
|
+
* - return `null` → the app handled it client-side (e.g. a `navigate` event);
|
|
3405
|
+
* the action is NOT forwarded to the agent.
|
|
3406
|
+
* - return an `A2UIUserAction` → that (possibly modified) action is forwarded.
|
|
3407
|
+
* - return `undefined` / `void` → the original action is forwarded unchanged.
|
|
3408
|
+
*
|
|
3409
|
+
* `forward` is provided for advanced cases where you want to do async work and
|
|
3410
|
+
* forward manually; if you call it yourself, return `null` to suppress the
|
|
3411
|
+
* default forward and avoid running the agent twice.
|
|
3412
|
+
*/
|
|
3413
|
+
type A2UIActionInterceptor = (action: A2UIUserAction, forward: (action?: A2UIUserAction) => Promise<void>) => void | A2UIUserAction | null | Promise<void | A2UIUserAction | null>;
|
|
3414
|
+
type A2UIMessageRendererOptions = {
|
|
3415
|
+
theme: Theme; /** Optional component catalog to pass to A2UIProvider */
|
|
3416
|
+
catalog?: any; /** Optional custom loading component shown while the A2UI surface is building. */
|
|
3417
|
+
loadingComponent?: React.ComponentType;
|
|
3418
|
+
/**
|
|
3419
|
+
* Pre-paint recovery/loading UX options (OSS-162): timing before the
|
|
3420
|
+
* "Retrying…" sub-label appears + how much retry/debug detail to surface.
|
|
3421
|
+
*/
|
|
3422
|
+
recovery?: A2UIRecoveryRendererOptions;
|
|
3423
|
+
/**
|
|
3424
|
+
* Intercept actions before they reach the agent. Lets an app handle an action
|
|
3425
|
+
* client-side (e.g. `navigate`) instead of forwarding every action. See
|
|
3426
|
+
* {@link A2UIActionInterceptor}.
|
|
3427
|
+
*/
|
|
3428
|
+
onAction?: A2UIActionInterceptor;
|
|
769
3429
|
};
|
|
3430
|
+
declare function createA2UIMessageRenderer(options: A2UIMessageRendererOptions): ReactActivityMessageRenderer<any>;
|
|
770
3431
|
//#endregion
|
|
771
|
-
//#region src/v1-deprecated/utils/dev-console.d.ts
|
|
772
|
-
declare function shouldShowDevConsole(showDevConsole?: boolean): boolean;
|
|
773
|
-
//#endregion
|
|
774
|
-
export { /**
|
|
775
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
776
|
-
* No 1:1 v2 replacement is available.
|
|
777
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
778
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
779
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
780
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
781
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
782
|
-
*/
|
|
783
|
-
type ActionRenderProps, /**
|
|
784
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
785
|
-
* No 1:1 v2 replacement is available.
|
|
786
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
787
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
788
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
789
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
790
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
791
|
-
*/
|
|
792
|
-
type ActionRenderPropsNoArgs, /**
|
|
793
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
794
|
-
* No 1:1 v2 replacement is available.
|
|
795
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
796
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
797
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
798
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
799
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
800
|
-
*/
|
|
801
|
-
type ActionRenderPropsNoArgsWait, /**
|
|
802
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
803
|
-
* No 1:1 v2 replacement is available.
|
|
804
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
805
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
806
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
807
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
808
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
809
|
-
*/
|
|
810
|
-
type ActionRenderPropsWait, /**
|
|
811
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
812
|
-
* No 1:1 v2 replacement is available.
|
|
813
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
814
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
815
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
816
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
817
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
818
|
-
*/
|
|
819
|
-
type CatchAllActionRenderProps, /**
|
|
820
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
821
|
-
* No 1:1 v2 replacement is available.
|
|
822
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
823
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
824
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
825
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
826
|
-
*/
|
|
827
|
-
type CatchAllActionRenderPropsWait, /**
|
|
828
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
829
|
-
* No 1:1 v2 replacement is available.
|
|
830
|
-
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
|
|
831
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
832
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
833
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
834
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
835
|
-
*/
|
|
836
|
-
type CatchAllFrontendAction, /**
|
|
837
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
838
|
-
* No 1:1 v2 replacement is available.
|
|
839
|
-
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
|
|
840
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
841
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
842
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
843
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
844
|
-
*/
|
|
845
|
-
type ChatSuggestions, /**
|
|
846
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
847
|
-
* No 1:1 v2 replacement is available.
|
|
848
|
-
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
849
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
850
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
851
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
852
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
853
|
-
*/
|
|
854
|
-
CoAgentStateRendersContext, /**
|
|
855
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
856
|
-
* No 1:1 v2 replacement is available.
|
|
857
|
-
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
858
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
859
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
860
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
861
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
862
|
-
*/
|
|
863
|
-
type CoAgentStateRendersContextValue, /**
|
|
864
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
865
|
-
* No 1:1 v2 replacement is available.
|
|
866
|
-
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
867
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
868
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
869
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
870
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
871
|
-
*/
|
|
872
|
-
CoAgentStateRendersProvider, /**
|
|
873
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
874
|
-
* No 1:1 v2 replacement is available.
|
|
875
|
-
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
876
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
877
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
878
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
879
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
880
|
-
*/
|
|
881
|
-
type CoagentInChatRenderFunction, /**
|
|
882
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
883
|
-
* No 1:1 v2 replacement is available.
|
|
884
|
-
* Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter
|
|
885
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
886
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
887
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
888
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
889
|
-
*/
|
|
890
|
-
type CopilotApiConfig, /**
|
|
891
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
892
|
-
* No 1:1 v2 replacement is available.
|
|
893
|
-
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
|
|
894
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
895
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
896
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
897
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
898
|
-
*/
|
|
899
|
-
type CopilotChatSuggestionConfiguration, /**
|
|
900
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
901
|
-
* No 1:1 v2 replacement is available.
|
|
902
|
-
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
|
|
903
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
904
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
905
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
906
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
907
|
-
*/
|
|
908
|
-
CopilotContext, /**
|
|
909
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
910
|
-
* No 1:1 v2 replacement is available.
|
|
911
|
-
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
|
|
912
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
913
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
914
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
915
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
916
|
-
*/
|
|
917
|
-
type CopilotContextParams, /**
|
|
918
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
919
|
-
* Use `CopilotKit` from `@copilotkit/react-core/v2` instead.
|
|
920
|
-
* Import and usage example:
|
|
921
|
-
* ```ts
|
|
922
|
-
* import { CopilotKit } from "@copilotkit/react-core/v2";
|
|
923
|
-
* <CopilotKit />;
|
|
924
|
-
* ```
|
|
925
|
-
* See https://docs.copilotkit.ai/reference/v2/components/CopilotKit
|
|
926
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
927
|
-
*/
|
|
928
|
-
CopilotKit, /**
|
|
929
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
930
|
-
* Use `CopilotKitProps` from `@copilotkit/react-core/v2` instead.
|
|
931
|
-
* Import and usage example:
|
|
932
|
-
* ```ts
|
|
933
|
-
* import type { CopilotKitProps } from "@copilotkit/react-core/v2";
|
|
934
|
-
* type V2CopilotKitProps = CopilotKitProps;
|
|
935
|
-
* ```
|
|
936
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
937
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
938
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
939
|
-
*/
|
|
940
|
-
type CopilotKitProps, /**
|
|
941
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
942
|
-
* No 1:1 v2 replacement is available.
|
|
943
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
944
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
945
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
946
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
947
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
948
|
-
*/
|
|
949
|
-
CopilotMessagesContext, /**
|
|
950
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
951
|
-
* No 1:1 v2 replacement is available.
|
|
952
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
953
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
954
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
955
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
956
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
957
|
-
*/
|
|
958
|
-
type CopilotMessagesContextParams, /**
|
|
959
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
960
|
-
* No 1:1 v2 replacement is available.
|
|
961
|
-
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
|
|
962
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
963
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
964
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
965
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
966
|
-
*/
|
|
967
|
-
CopilotTask, /**
|
|
968
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
969
|
-
* No 1:1 v2 replacement is available.
|
|
970
|
-
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
|
|
971
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
972
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
973
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
974
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
975
|
-
*/
|
|
976
|
-
type CopilotTaskConfig, /**
|
|
977
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
978
|
-
* No 1:1 v2 replacement is available.
|
|
979
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
980
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
981
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
982
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
983
|
-
*/
|
|
984
|
-
type CrewsAgentState, /**
|
|
985
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
986
|
-
* No 1:1 v2 replacement is available.
|
|
987
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
988
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
989
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
990
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
991
|
-
*/
|
|
992
|
-
type CrewsResponse, /**
|
|
993
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
994
|
-
* No 1:1 v2 replacement is available.
|
|
995
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
996
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
997
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
998
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
999
|
-
*/
|
|
1000
|
-
type CrewsResponseStatus, /**
|
|
1001
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1002
|
-
* No 1:1 v2 replacement is available.
|
|
1003
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1004
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1005
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1006
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1007
|
-
*/
|
|
1008
|
-
type CrewsStateItem, /**
|
|
1009
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1010
|
-
* No 1:1 v2 replacement is available.
|
|
1011
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1012
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1013
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1014
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1015
|
-
*/
|
|
1016
|
-
type CrewsTaskStateItem, /**
|
|
1017
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1018
|
-
* No 1:1 v2 replacement is available.
|
|
1019
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1020
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1021
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1022
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1023
|
-
*/
|
|
1024
|
-
type CrewsToolStateItem, /**
|
|
1025
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1026
|
-
* No 1:1 v2 replacement is available.
|
|
1027
|
-
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
|
|
1028
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1029
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1030
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1031
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1032
|
-
*/
|
|
1033
|
-
type DocumentPointer, /**
|
|
1034
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1035
|
-
* No 1:1 v2 replacement is available.
|
|
1036
|
-
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
|
|
1037
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1038
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1039
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1040
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1041
|
-
*/
|
|
1042
|
-
type FrontendAction, /**
|
|
1043
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1044
|
-
* No 1:1 v2 replacement is available.
|
|
1045
|
-
* Related v2 docs (Tool-based generative UI): https://docs.copilotkit.ai/generative-ui/tool-based
|
|
1046
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1047
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1048
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1049
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1050
|
-
*/
|
|
1051
|
-
type FrontendActionAvailability, /**
|
|
1052
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1053
|
-
* No 1:1 v2 replacement is available.
|
|
1054
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1055
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1056
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1057
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1058
|
-
*/
|
|
1059
|
-
type HintFunction, /**
|
|
1060
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1061
|
-
* No 1:1 v2 replacement is available.
|
|
1062
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1063
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1064
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1065
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1066
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1067
|
-
*/
|
|
1068
|
-
type LangGraphInterruptAction, /**
|
|
1069
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1070
|
-
* No 1:1 v2 replacement is available.
|
|
1071
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1072
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1073
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1074
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1075
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1076
|
-
*/
|
|
1077
|
-
type LangGraphInterruptActionSetter, /**
|
|
1078
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1079
|
-
* No 1:1 v2 replacement is available.
|
|
1080
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1081
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1082
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1083
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1084
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1085
|
-
*/
|
|
1086
|
-
type LangGraphInterruptActionSetterArgs, /**
|
|
1087
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1088
|
-
* No 1:1 v2 replacement is available.
|
|
1089
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1090
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1091
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1092
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1093
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1094
|
-
*/
|
|
1095
|
-
type LangGraphInterruptRender, /**
|
|
1096
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1097
|
-
* No 1:1 v2 replacement is available.
|
|
1098
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1099
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1100
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1101
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1102
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1103
|
-
*/
|
|
1104
|
-
type LangGraphInterruptRenderHandlerProps, /**
|
|
1105
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1106
|
-
* No 1:1 v2 replacement is available.
|
|
1107
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1108
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1109
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1110
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1111
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1112
|
-
*/
|
|
1113
|
-
type LangGraphInterruptRenderProps, /**
|
|
1114
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1115
|
-
* No 1:1 v2 replacement is available.
|
|
1116
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1117
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1118
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1119
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1120
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1121
|
-
*/
|
|
1122
|
-
type OnReloadMessages, /**
|
|
1123
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1124
|
-
* No 1:1 v2 replacement is available.
|
|
1125
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1126
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1127
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1128
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1129
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1130
|
-
*/
|
|
1131
|
-
type OnStopGeneration, /**
|
|
1132
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1133
|
-
* No 1:1 v2 replacement is available.
|
|
1134
|
-
* Related v2 docs (Human-in-the-loop): https://docs.copilotkit.ai/human-in-the-loop
|
|
1135
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1136
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1137
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1138
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1139
|
-
*/
|
|
1140
|
-
type QueuedInterruptEvent, /**
|
|
1141
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1142
|
-
* No 1:1 v2 replacement is available.
|
|
1143
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
1144
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1145
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1146
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1147
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1148
|
-
*/
|
|
1149
|
-
type RenderFunctionStatus, /**
|
|
1150
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1151
|
-
* No 1:1 v2 replacement is available.
|
|
1152
|
-
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
|
|
1153
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1154
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1155
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1156
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1157
|
-
*/
|
|
1158
|
-
SUGGESTION_RETRY_CONFIG, /**
|
|
1159
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1160
|
-
* No 1:1 v2 replacement is available.
|
|
1161
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1162
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1163
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1164
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1165
|
-
*/
|
|
1166
|
-
type SystemMessageFunction, /**
|
|
1167
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1168
|
-
* No 1:1 v2 replacement is available.
|
|
1169
|
-
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
|
|
1170
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1171
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1172
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1173
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1174
|
-
*/
|
|
1175
|
-
ThreadsContext, /**
|
|
1176
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1177
|
-
* No 1:1 v2 replacement is available.
|
|
1178
|
-
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
|
|
1179
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1180
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1181
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1182
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1183
|
-
*/
|
|
1184
|
-
type ThreadsContextValue, /**
|
|
1185
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1186
|
-
* No 1:1 v2 replacement is available.
|
|
1187
|
-
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
|
|
1188
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1189
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1190
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1191
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1192
|
-
*/
|
|
1193
|
-
ThreadsProvider, /**
|
|
1194
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1195
|
-
* No 1:1 v2 replacement is available.
|
|
1196
|
-
* Related v2 docs (Conversation threads): https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer
|
|
1197
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1198
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1199
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1200
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1201
|
-
*/
|
|
1202
|
-
type ThreadsProviderProps, /**
|
|
1203
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1204
|
-
* No 1:1 v2 replacement is available.
|
|
1205
|
-
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
|
|
1206
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1207
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1208
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1209
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1210
|
-
*/
|
|
1211
|
-
type Tree, /**
|
|
1212
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1213
|
-
* No 1:1 v2 replacement is available.
|
|
1214
|
-
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
|
|
1215
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1216
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1217
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1218
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1219
|
-
*/
|
|
1220
|
-
type TreeNode, /**
|
|
1221
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1222
|
-
* No 1:1 v2 replacement is available.
|
|
1223
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1224
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1225
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1226
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1227
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1228
|
-
*/
|
|
1229
|
-
type UseCopilotChatOptions, /**
|
|
1230
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1231
|
-
* No 1:1 v2 replacement is available.
|
|
1232
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1233
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1234
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1235
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1236
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1237
|
-
*/
|
|
1238
|
-
type UseCopilotChatOptions as UseCopilotChatOptions_c, /**
|
|
1239
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1240
|
-
* No 1:1 v2 replacement is available.
|
|
1241
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1242
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1243
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1244
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1245
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1246
|
-
*/
|
|
1247
|
-
type UseCopilotChatReturn, /**
|
|
1248
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1249
|
-
* No 1:1 v2 replacement is available.
|
|
1250
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1251
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1252
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1253
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1254
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1255
|
-
*/
|
|
1256
|
-
type UseCopilotChatReturn$1 as UseCopilotChatReturn_c, /**
|
|
1257
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1258
|
-
* No 1:1 v2 replacement is available.
|
|
1259
|
-
* Related v2 docs (Chat suggestions): https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
|
|
1260
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1261
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1262
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1263
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1264
|
-
*/
|
|
1265
|
-
type UseCopilotChatSuggestionsConfiguration, /**
|
|
1266
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1267
|
-
* No 1:1 v2 replacement is available.
|
|
1268
|
-
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
|
|
1269
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1270
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1271
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1272
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1273
|
-
*/
|
|
1274
|
-
defaultCopilotContextCategories, /**
|
|
1275
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1276
|
-
* No 1:1 v2 replacement is available.
|
|
1277
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1278
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1279
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1280
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1281
|
-
*/
|
|
1282
|
-
shouldShowDevConsole, /**
|
|
1283
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1284
|
-
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
|
|
1285
|
-
* Import and usage example:
|
|
1286
|
-
* ```ts
|
|
1287
|
-
* import { useAgent } from "@copilotkit/react-core/v2";
|
|
1288
|
-
* useAgent({});
|
|
1289
|
-
* ```
|
|
1290
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgent
|
|
1291
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1292
|
-
*/
|
|
1293
|
-
useCoAgent, /**
|
|
1294
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1295
|
-
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
|
|
1296
|
-
* Import and usage example:
|
|
1297
|
-
* ```ts
|
|
1298
|
-
* import { useAgent, UseAgentUpdate } from "@copilotkit/react-core/v2";
|
|
1299
|
-
* function AgentStateView() {
|
|
1300
|
-
* const { agent } = useAgent({
|
|
1301
|
-
* agentId: "basic_agent",
|
|
1302
|
-
* updates: [UseAgentUpdate.OnStateChanged, UseAgentUpdate.OnRunStatusChanged],
|
|
1303
|
-
* });
|
|
1304
|
-
* const state = agent.state;
|
|
1305
|
-
* return (
|
|
1306
|
-
* <YourComponent
|
|
1307
|
-
* agentStateProperty={state.agent_state_property}
|
|
1308
|
-
* isRunning={agent.isRunning}
|
|
1309
|
-
* />
|
|
1310
|
-
* );
|
|
1311
|
-
* }
|
|
1312
|
-
* ```
|
|
1313
|
-
* See https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
1314
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1315
|
-
*/
|
|
1316
|
-
useCoAgentStateRender, /**
|
|
1317
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1318
|
-
* No 1:1 v2 replacement is available.
|
|
1319
|
-
* Related v2 docs (State rendering): https://docs.copilotkit.ai/generative-ui/state-rendering
|
|
1320
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1321
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1322
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1323
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1324
|
-
*/
|
|
1325
|
-
useCoAgentStateRenders, /**
|
|
1326
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1327
|
-
* Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
|
|
1328
|
-
* Import and usage example:
|
|
1329
|
-
* ```ts
|
|
1330
|
-
* import { useFrontendTool } from "@copilotkit/react-core/v2";
|
|
1331
|
-
* useFrontendTool({});
|
|
1332
|
-
* ```
|
|
1333
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
|
|
1334
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1335
|
-
*/
|
|
1336
|
-
useCopilotAction, /**
|
|
1337
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1338
|
-
* Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
|
|
1339
|
-
* Import and usage example:
|
|
1340
|
-
* ```ts
|
|
1341
|
-
* import { useAgentContext } from "@copilotkit/react-core/v2";
|
|
1342
|
-
* useAgentContext({});
|
|
1343
|
-
* ```
|
|
1344
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
|
|
1345
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1346
|
-
*/
|
|
1347
|
-
useCopilotAdditionalInstructions, /**
|
|
1348
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1349
|
-
* No 1:1 v2 replacement is available.
|
|
1350
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1351
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1352
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1353
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1354
|
-
*/
|
|
1355
|
-
useCopilotAuthenticatedAction_c, /**
|
|
1356
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1357
|
-
* Use `useAgent` from `@copilotkit/react-core/v2` instead.
|
|
1358
|
-
* Import and usage example:
|
|
1359
|
-
* ```ts
|
|
1360
|
-
* import { useAgent } from "@copilotkit/react-core/v2";
|
|
1361
|
-
* useAgent({});
|
|
1362
|
-
* ```
|
|
1363
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgent
|
|
1364
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1365
|
-
*/
|
|
1366
|
-
useCopilotChat, /**
|
|
1367
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1368
|
-
* No 1:1 v2 replacement is available.
|
|
1369
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1370
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1371
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1372
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1373
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1374
|
-
*/
|
|
1375
|
-
useCopilotChatHeadless_c, /**
|
|
1376
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1377
|
-
* No 1:1 v2 replacement is available.
|
|
1378
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1379
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1380
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1381
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1382
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1383
|
-
*/
|
|
1384
|
-
useCopilotChatInternal, /**
|
|
1385
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1386
|
-
* Use `useConfigureSuggestions` from `@copilotkit/react-core/v2` instead.
|
|
1387
|
-
* Import and usage example:
|
|
1388
|
-
* ```ts
|
|
1389
|
-
* import { useConfigureSuggestions } from "@copilotkit/react-core/v2";
|
|
1390
|
-
* function Suggestions() {
|
|
1391
|
-
* useConfigureSuggestions({
|
|
1392
|
-
* suggestions: [
|
|
1393
|
-
* { title: "Help", message: "Help me get started" },
|
|
1394
|
-
* ],
|
|
1395
|
-
* });
|
|
1396
|
-
* return null;
|
|
1397
|
-
* }
|
|
1398
|
-
* ```
|
|
1399
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useConfigureSuggestions
|
|
1400
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1401
|
-
*/
|
|
1402
|
-
useCopilotChatSuggestions, /**
|
|
1403
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1404
|
-
* No 1:1 v2 replacement is available.
|
|
1405
|
-
* Related v2 docs (CopilotKit provider): https://docs.copilotkit.ai/reference/v2/components/CopilotKit
|
|
1406
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1407
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1408
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1409
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1410
|
-
*/
|
|
1411
|
-
useCopilotContext, /**
|
|
1412
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1413
|
-
* No 1:1 v2 replacement is available.
|
|
1414
|
-
* Related v2 docs (Chat UI): https://docs.copilotkit.ai/prebuilt-components/chat
|
|
1415
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1416
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1417
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1418
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1419
|
-
*/
|
|
1420
|
-
useCopilotMessagesContext, /**
|
|
1421
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1422
|
-
* Use `useAgentContext` from `@copilotkit/react-core/v2` instead.
|
|
1423
|
-
* Import and usage example:
|
|
1424
|
-
* ```ts
|
|
1425
|
-
* import { useAgentContext } from "@copilotkit/react-core/v2";
|
|
1426
|
-
* function UserContext() {
|
|
1427
|
-
* useAgentContext({
|
|
1428
|
-
* description: "The current user",
|
|
1429
|
-
* value: { name: "Ada" },
|
|
1430
|
-
* });
|
|
1431
|
-
* return null;
|
|
1432
|
-
* }
|
|
1433
|
-
* ```
|
|
1434
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useAgentContext
|
|
1435
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1436
|
-
*/
|
|
1437
|
-
useCopilotReadable, /**
|
|
1438
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1439
|
-
* No 1:1 v2 replacement is available.
|
|
1440
|
-
* Related v2 docs (Runtime server adapter): https://docs.copilotkit.ai/runtime-server-adapter
|
|
1441
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1442
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1443
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1444
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1445
|
-
*/
|
|
1446
|
-
useCopilotRuntimeClient, /**
|
|
1447
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1448
|
-
* Use `useDefaultRenderTool` from `@copilotkit/react-core/v2` instead.
|
|
1449
|
-
* Import and usage example:
|
|
1450
|
-
* ```ts
|
|
1451
|
-
* import { useDefaultRenderTool } from "@copilotkit/react-core/v2";
|
|
1452
|
-
* useDefaultRenderTool({});
|
|
1453
|
-
* ```
|
|
1454
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useDefaultRenderTool
|
|
1455
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1456
|
-
*/
|
|
1457
|
-
useDefaultTool, /**
|
|
1458
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1459
|
-
* Use `useFrontendTool` from `@copilotkit/react-core/v2` instead.
|
|
1460
|
-
* Import and usage example:
|
|
1461
|
-
* ```ts
|
|
1462
|
-
* import { useFrontendTool } from "@copilotkit/react-core/v2";
|
|
1463
|
-
* import { z } from "zod";
|
|
1464
|
-
* function MyComponent() {
|
|
1465
|
-
* useFrontendTool({
|
|
1466
|
-
* name: "myTool",
|
|
1467
|
-
* description: "Run my tool",
|
|
1468
|
-
* parameters: z.object({}),
|
|
1469
|
-
* handler: async () => "done",
|
|
1470
|
-
* });
|
|
1471
|
-
* return null;
|
|
1472
|
-
* }
|
|
1473
|
-
* ```
|
|
1474
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useFrontendTool
|
|
1475
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1476
|
-
*/
|
|
1477
|
-
useFrontendTool, /**
|
|
1478
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1479
|
-
* Use `useHumanInTheLoop` from `@copilotkit/react-core/v2` instead.
|
|
1480
|
-
* Import and usage example:
|
|
1481
|
-
* ```ts
|
|
1482
|
-
* import { useHumanInTheLoop } from "@copilotkit/react-core/v2";
|
|
1483
|
-
* import { z } from "zod";
|
|
1484
|
-
* function Confirmation() {
|
|
1485
|
-
* useHumanInTheLoop({
|
|
1486
|
-
* name: "confirmAction",
|
|
1487
|
-
* description: "Ask the user to confirm",
|
|
1488
|
-
* parameters: z.object({}),
|
|
1489
|
-
* render: ({ respond }) => (
|
|
1490
|
-
* <button onClick={() => respond?.(true)}>Confirm</button>
|
|
1491
|
-
* ),
|
|
1492
|
-
* });
|
|
1493
|
-
* return null;
|
|
1494
|
-
* }
|
|
1495
|
-
* ```
|
|
1496
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useHumanInTheLoop
|
|
1497
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1498
|
-
*/
|
|
1499
|
-
useHumanInTheLoop, /**
|
|
1500
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1501
|
-
* Use `useInterrupt` from `@copilotkit/react-core/v2` instead.
|
|
1502
|
-
* Import and usage example:
|
|
1503
|
-
* ```ts
|
|
1504
|
-
* import { useInterrupt } from "@copilotkit/react-core/v2";
|
|
1505
|
-
* function ApprovalInterrupt() {
|
|
1506
|
-
* useInterrupt({
|
|
1507
|
-
* render: ({ resolve }) => (
|
|
1508
|
-
* <button onClick={() => resolve({ approved: true })}>Approve</button>
|
|
1509
|
-
* ),
|
|
1510
|
-
* });
|
|
1511
|
-
* return null;
|
|
1512
|
-
* }
|
|
1513
|
-
* ```
|
|
1514
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useInterrupt
|
|
1515
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1516
|
-
*/
|
|
1517
|
-
useLangGraphInterrupt, /**
|
|
1518
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1519
|
-
* No 1:1 v2 replacement is available.
|
|
1520
|
-
* Related v2 docs (Tool rendering): https://docs.copilotkit.ai/generative-ui/tool-rendering
|
|
1521
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1522
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1523
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1524
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1525
|
-
*/
|
|
1526
|
-
useLazyToolRenderer, /**
|
|
1527
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1528
|
-
* No 1:1 v2 replacement is available.
|
|
1529
|
-
* Related v2 docs (Agent context): https://docs.copilotkit.ai/agent-app-context
|
|
1530
|
-
* Start with `@copilotkit/react-core/v2`.
|
|
1531
|
-
* V2 docs: https://docs.copilotkit.ai/
|
|
1532
|
-
* V2 reference docs: https://docs.copilotkit.ai/reference/v2
|
|
1533
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1534
|
-
*/
|
|
1535
|
-
useMakeCopilotDocumentReadable, /**
|
|
1536
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1537
|
-
* Use `useRenderTool` from `@copilotkit/react-core/v2` instead.
|
|
1538
|
-
* Import and usage example:
|
|
1539
|
-
* ```ts
|
|
1540
|
-
* import { useRenderTool } from "@copilotkit/react-core/v2";
|
|
1541
|
-
* import { z } from "zod";
|
|
1542
|
-
* function StatusTool() {
|
|
1543
|
-
* useRenderTool({
|
|
1544
|
-
* name: "showStatus",
|
|
1545
|
-
* parameters: z.object({}),
|
|
1546
|
-
* render: ({ status, result }) => (
|
|
1547
|
-
* <div>{status === "complete" ? result : "Running..."}</div>
|
|
1548
|
-
* ),
|
|
1549
|
-
* });
|
|
1550
|
-
* return null;
|
|
1551
|
-
* }
|
|
1552
|
-
* ```
|
|
1553
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useRenderTool
|
|
1554
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1555
|
-
*/
|
|
1556
|
-
useRenderToolCall, /**
|
|
1557
|
-
* @deprecated Since 1.68.2. The v1 SDK is deprecated. Use v2 instead.
|
|
1558
|
-
* Use `useThreads` from `@copilotkit/react-core/v2` instead.
|
|
1559
|
-
* Import and usage example:
|
|
1560
|
-
* ```ts
|
|
1561
|
-
* import { useThreads } from "@copilotkit/react-core/v2";
|
|
1562
|
-
* useThreads({});
|
|
1563
|
-
* ```
|
|
1564
|
-
* See https://docs.copilotkit.ai/reference/v2/hooks/useThreads
|
|
1565
|
-
* Migration guide: https://docs.copilotkit.ai/migrate/v2
|
|
1566
|
-
*/
|
|
1567
|
-
useThreads };
|
|
3432
|
+
export { type A2UIActionInterceptor, type A2UIMarkdownOperation, type A2UIMessageRendererOptions, type A2UIRecoveryRendererOptions, type A2UITheme, type A2UIUserAction, A2UI_FENCE_LANGUAGE, ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError, AGUIError, type AGUIEvent, type AGUIEventByType, type AGUIEventOf, AGUI_METADATA_KEY, AbstractAgent, type ActionConfig, type ActionCreator, type ActionFromCreator, type ActionFromCreators, type ActionGroupConfig, type ActionGroupResult, type ActivityDeltaEvent, type ActivityDeltaEventProps, ActivityDeltaEventSchema, type ActivityMessage, ActivityMessageSchema, type ActivitySnapshotEvent, type ActivitySnapshotEventProps, ActivitySnapshotEventSchema, type AddOperation, AddOperationSchema, type AgentCapabilities, AgentCapabilitiesSchema, type AgentConfig, type AgentContextInput, type AgentDebugConfig, AgentRegistry, type AgentStateMutation, type AgentSubscriber, type AgentSubscriberParams, AgentThreadLockedError, type AnyAction, type AssistantMessage, AssistantMessageSchema, type Attachment, type AttachmentModality, type AttachmentsConfig, type Attributable, AttributableSchema, type AudioInputContent, AudioInputContentSchema, type AudioInputPart, AudioInputPartSchema, type AudioPart, AudioPartSchema, AudioRecorderError, type AudioRecorderState, type AutoScrollMode, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, type BaseEvent, type BaseEventFields, type BaseEventProps, BaseEventSchema, type BaseMessage, BaseMessageSchema, BasicMarkdownRenderer, type ChildIdsOf, type ChildWalkOptions, CompatibilityBoundary, type ContentPart, ContentPartSchema, type Context, ContextSchema, ContextStore, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, type CopilotChatFeedbackMessage, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatReasoningMessage, type CopilotChatReasoningMessageProps, CopilotChatSuggestionPill, type CopilotChatSuggestionPillProps, CopilotChatSuggestionView, type CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, type CopilotChatToggleButtonProps, type CopilotChatToolCallDisplay, CopilotChatToolCallGroup, type CopilotChatToolCallGroupAppearance, type CopilotChatToolCallGroupProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, CopilotChatWorkSummary, type CopilotChatWorkSummaryProps, type CopilotKitContextValue, CopilotKitCore, type CopilotKitCoreAddAgentParams, type CopilotKitCoreCatalogComponent, type CopilotKitCoreConfig, type CopilotKitCoreConnectAgentParams, type CopilotKitCoreContinuationHandoff, CopilotKitCoreErrorCode, type CopilotKitCoreFriendsAccess, type CopilotKitCoreGetSuggestionsResult, type CopilotKitCoreGetToolParams, CopilotKitCoreReact, CopilotKitCoreReactConfig, CopilotKitCoreReactSubscriber, type CopilotKitCoreRegisterProxiedAgentParams, type CopilotKitCoreRegisterProxiedAgentResult, type CopilotKitCoreRunAgentParams, type CopilotKitCoreRunToolParams, type CopilotKitCoreRunToolResult, CopilotKitCoreRuntimeConnectionStatus, type CopilotKitCoreStopAgentParams, type CopilotKitCoreSubscriber, type CopilotKitCoreSubscription, CopilotKitHeaderResolutionError, type CopilotKitHeadersSource, CopilotKitInspector, CopilotKitInspectorProps, type CopilotKitMessageFilter, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotPopup, type CopilotPopupProps, CopilotPopupView, type CopilotPopupViewProps, type CopilotRuntimeTransport, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, CopilotThreadsDrawer, type CopilotThreadsDrawerProps, type CopilotThreadsDrawerRowRenderer, type CopyOperation, CopyOperationSchema, type CustomEvent, type CustomEventProps, CustomEventSchema, type DataSource, DataSourceSchema, DebugLogger, type DebugLoggerInput, DefaultMarkdownRendererProps, type DeveloperMessage, DeveloperMessageSchema, type DispatchingEffect, type DispatchingEffectOptions, type DocumentInputContent, DocumentInputContentSchema, type DocumentInputPart, DocumentInputPartSchema, type DocumentPart, DocumentPartSchema, type DynamicSuggestionsConfig, type Effect, type EmptyActionConfig, type Event, type EventPayloadOf, EventSchema, EventSchemas, EventType, EventTypeSchema, type ExecutionCapabilities, ExecutionCapabilitiesSchema, type FileSource, FileSourceSchema, FilterToolCallsMiddleware, type FrontendTool, type FrontendToolHandlerContext, type FrontendToolReconnectBehavior, type FunctionCall, FunctionCallSchema, FunctionMiddleware, GenerateSandboxedUiArgs, GenerateSandboxedUiArgsSchema, HttpAgent, type HttpAgentConfig, type HttpAgentFetchFn, type HumanInTheLoopCapabilities, HumanInTheLoopCapabilitiesSchema, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, type IdentityCapabilities, IdentityCapabilitiesSchema, type ImageInputContent, ImageInputContentSchema, type ImageInputPart, ImageInputPartSchema, type ImagePart, ImagePartSchema, type InputContent, type InputContentDataSource, InputContentDataSourceSchema, type InputContentPart, InputContentSchema, type InputContentSource, InputContentSourceSchema, type InputContentUrlSource, InputContentUrlSourceSchema, type InspectorActiveThreadPayload, type InspectorAnchor, type InspectorMetadataV1, type InspectorStopViewingPayload, type InspectorViewThreadPayload, type InspectorViewThreadResultPayload, IntelligenceAgent, type IntelligenceAgentConfig, IntelligenceIndicator, type IntelligenceIndicatorProps, type IntelligenceIndicatorStatus, IntelligenceIndicatorView, type IntelligenceIndicatorViewProps, type IntelligenceRuntimeInfo, type Interrupt, InterruptCancelFn, type InterruptEvent, type InterruptHandlerProps, type InterruptRenderProps, InterruptResolveFn, InterruptSchema, type JsonPatch, type JsonPatchOperation, JsonPatchOperationSchema, JsonPatchSchema, type JsonPointer, JsonPointerSchema, type JsonSerializable, type JsonValue, type LearnFromUserActionInCurrentThreadInput, type LearnFromUserActionInput, type LearnFromUserActionResult, type LearningConfig, type LegacyLearningConfig, type MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, MEMORY_ERROR_REGISTRY, MarkdownRenderer, MarkdownRendererProps, MarkdownRendererProvider, type MarkdownSegment, type MarkdownToken, type MarkdownTokenList, type Memory, type MemoryChanges, MemoryError, type MemoryErrorCategory, type MemoryErrorCode, type MemoryErrorRegistryEntry, type MemoryKind, type MemoryRealtimeStatus, type MemoryScope, type Message, type MessageGroup, type MessageGroupWrapperProps, type MessageRow, MessageSchema, type MessagesSnapshotEvent, type MessagesSnapshotEventProps, MessagesSnapshotEventSchema, type Metadata, MetadataSchema, Middleware, type MiddlewareFunction, type MoveOperation, MoveOperationSchema, type MultiAgentCapabilities, MultiAgentCapabilitiesSchema, type MultimodalCapabilities, MultimodalCapabilitiesSchema, type MultimodalInputCapabilities, MultimodalInputCapabilitiesSchema, type MultimodalOutputCapabilities, MultimodalOutputCapabilitiesSchema, type NewMemory, type NonDispatchingEffect, type NonDispatchingEffectOptions, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContent, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, type OpenThreadRegistration, OptionalMetadataSchema, type OutputCapabilities, OutputCapabilitiesSchema, PROTOCOL_VERSION, type ParseMarkdownOptions, type PartSource, PartSourceSchema, type PropsActionConfig, ProxiedCopilotRuntimeAgent, type ProxiedCopilotRuntimeAgentConfig, type RawEvent, type RawEventProps, RawEventSchema, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, type ReasoningCapabilities, ReasoningCapabilitiesSchema, type ReasoningEncryptedValueEvent, type ReasoningEncryptedValueEventProps, ReasoningEncryptedValueEventSchema, type ReasoningEncryptedValueSubtype, ReasoningEncryptedValueSubtypeSchema, type ReasoningEndEvent, type ReasoningEndEventProps, ReasoningEndEventSchema, type ReasoningMessage, type ReasoningMessageChunkEvent, type ReasoningMessageChunkEventProps, ReasoningMessageChunkEventSchema, type ReasoningMessageContentEvent, type ReasoningMessageContentEventProps, ReasoningMessageContentEventSchema, type ReasoningMessageEndEvent, type ReasoningMessageEndEventProps, ReasoningMessageEndEventSchema, ReasoningMessageSchema, type ReasoningMessageStartEvent, type ReasoningMessageStartEventProps, ReasoningMessageStartEventSchema, type ReasoningStartEvent, type ReasoningStartEventProps, ReasoningStartEventSchema, type Reducer, type RemoveOperation, RemoveOperationSchema, type ReplaceOperation, ReplaceOperationSchema, type ResolvedAgentDebugConfig, type ResumeEntry, ResumeEntrySchema, type ResumeStatus, type Role, RoleSchema, type RunAgentInput, RunAgentInputSchema, type RunAgentParameters, type RunAgentResult, type RunCompletionAware, type RunErrorEvent, type RunErrorEventProps, RunErrorEventSchema, type RunFinishedCancelledOutcome, RunFinishedCancelledOutcomeSchema, type RunFinishedEvent, type RunFinishedEventProps, RunFinishedEventSchema, type RunFinishedInterruptOutcome, RunFinishedInterruptOutcomeSchema, type RunFinishedOutcome, RunFinishedOutcomeSchema, type RunFinishedSuccessOutcome, RunFinishedSuccessOutcomeSchema, RunHandler, type RunStartedEvent, type RunStartedEventProps, RunStartedEventSchema, type RuntimeLicenseStatus, type RuntimeMode, SandboxFunction, SandboxFunctionsContext, type ScopedContext, type ScopedProperties, type Selector, type StartResult, type State, type StateCapabilities, StateCapabilitiesSchema, type StateDeltaEvent, type StateDeltaEventProps, StateDeltaEventSchema, StateManager, StateSchema, type StateSnapshotEvent, type StateSnapshotEventProps, StateSnapshotEventSchema, type StaticSuggestionsConfig, type StepFinishedEvent, type StepFinishedEventProps, StepFinishedEventSchema, type StepStartedEvent, type StepStartedEventProps, StepStartedEventSchema, type Store, type StoreLifecycleAction, StreamingMarkdownDefaultRenderer, type SubagentErrorEvent, type SubagentErrorEventProps, SubagentErrorEventSchema, type SubagentFinishedEvent, type SubagentFinishedEventProps, SubagentFinishedEventSchema, type SubagentFinishedOutcome, SubagentFinishedOutcomeSchema, type SubagentFinishedSuccessOutcome, SubagentFinishedSuccessOutcomeSchema, type SubagentFinishedSuspendedOutcome, SubagentFinishedSuspendedOutcomeSchema, type SubagentInfo, SubagentInfoSchema, type SubagentRunId, SubagentRunIdSchema, type SubagentStartedEvent, type SubagentStartedEventProps, SubagentStartedEventSchema, type SubscribeToAgentOptions, type SubscribeToAgentSubscriber, type Suggestion, type SuggestionAvailability, SuggestionEngine, type SuggestionsConfig, type SurfaceSegment, type SystemMessage, SystemMessageSchema, type TestOperation, TestOperationSchema, type TextInputContent, TextInputContentSchema, type TextMessageChunkEvent, type TextMessageChunkEventProps, TextMessageChunkEventSchema, type TextMessageContentEvent, type TextMessageContentEventProps, TextMessageContentEventSchema, type TextMessageEndEvent, type TextMessageEndEventProps, TextMessageEndEventSchema, type TextMessageRole, TextMessageRoleSchema, type TextMessageStartEvent, type TextMessageStartEventProps, TextMessageStartEventSchema, type TextPart, TextPartSchema, type Thread, type ThreadEndpointRuntimeInfo, type ThreadRunActivityNotification, type TokenUsage, TokenUsageSchema, type Tokens, type Tool, type ToolCall, type ToolCallArgsEvent, type ToolCallArgsEventProps, ToolCallArgsEventSchema, type ToolCallChunkEvent, type ToolCallChunkEventProps, ToolCallChunkEventSchema, type ToolCallEndEvent, type ToolCallEndEventProps, ToolCallEndEventSchema, type ToolCallEntry, type ToolCallResultEvent, type ToolCallResultEventProps, ToolCallResultEventSchema, ToolCallSchema, type ToolCallStartEvent, type ToolCallStartEventProps, ToolCallStartEventSchema, ToolCallStatus, type ToolMessage, ToolMessageSchema, ToolSchema, type ToolsCapabilities, ToolsCapabilitiesSchema, type ToolsMenuItem, type TrajectoryStartOptions, type TransportCapabilities, TransportCapabilitiesSchema, type UnrecognizedEvent, type UrlSource, UrlSourceSchema, UseAgentUpdate, type UseAttachmentsProps, type UseAttachmentsReturn, type UseInterruptConfig, type UseLearnFromUserActionInCurrentThreadRecorder, type UseLearnFromUserActionRecorder, type UseLearningContainersArgs, type UseLearningContainersInCurrentThreadArgs, type UseMemoriesResult, type UseThreadsInput, type UseThreadsResult, type UserMessage, UserMessageSchema, type VideoInputContent, VideoInputContentSchema, type VideoInputPart, VideoInputPartSchema, type VideoPart, VideoPartSchema, type WebMCPModelContext, WebMCPRegistry, type WebMCPToolAnnotations, type WebMCPToolConfig, WildcardToolCallRender, a2uiDefaultTheme, aggregateTokenUsage, authoritativeActivityTypes, buildResumeArray, classifySurfaceCards, compactEvents, completePartialMarkdown, contentHasMedia, contentToText, convertToLegacyEvents, createA2UIMessageRenderer, createActionGroup, createDebugLogger, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, defaultApplyEvents, defineToolCallRenderer, emitInspectorActiveThread, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, empty, enforceEvents, enforceOutgoingInput, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations, extractStringField, flattenInformationalCards, getIntelligenceTurnAnchors, getMarkdownOperationSurfaceId, getRunOutcome, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isInterruptExpired, isRecognizedEvent, isRunCompletionAware, mergeMetadata, messageGroup, messageRow, ofType, omitOptionalNulls, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorViewThread, onInspectorViewThreadResult, parseMarkdown, parseProtoStream, parseSSEStream, parseToolArguments, prepareSurfaceOperations, props, randomUUID, resolveAgentDebugConfig, resolveDebugLogger, runHttpRequest, segmentSurfaceProse, select, splitA2UIMarkdown, structuredClone_, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata, transformChunks, transformHttpEventStream, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useFrontendTools, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useLicenseContext, useMarkdownRenderer, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, verifyEvents, withAuthoritativeActivityTypes, ɵCOPILOTKIT_FEATURES, type ɵCopilotKitFeature, type ɵGenerativeUIDebugFunction, type ɵGenerativeUIDebugPromptSection, type ɵGenerativeUIDebugRun, type ɵGenerativeUIDebugSnapshot, type ɵGenerativeUIDebugSource, type ɵGenerativeUIDebugSurface, type ɵInterruptDecision, type ɵInterruptEvent, ɵInterruptState, type ɵInterruptToolResult, ɵMAX_SOCKET_RETRIES, type ɵMcpFollowUpHost, type ɵMemoryEnvironment, type ɵMemoryMetadataEvent, type ɵMemoryRuntimeContext, type ɵMemoryState, type ɵMemoryStore, type ɵPendingInterrupt, type ɵPhoenixChannelLike, type ɵPhoenixChannelOptions, type ɵPhoenixChannelSession, type ɵPhoenixJoinOutcome, type ɵPhoenixPushLike, type ɵPhoenixSocketLike, type ɵPhoenixSocketOptions, type ɵPhoenixSocketSession, type ɵPhoenixSocketSignal, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, type ɵThread, type ɵThreadEnvironment, type ɵThreadMetadataEvent, type ɵThreadRuntimeContext, type ɵThreadSelectors, type ɵThreadStore, ɵclearAgentInterruptState, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵgetAgentInterruptState, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵrunMcpFollowUp, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵthreadAdapterEvents, ɵwithHeaderDefaults };
|
|
1568
3433
|
//# sourceMappingURL=index.d.mts.map
|