@copilotkit/react-core 1.83.0 → 1.84.1

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.
Files changed (46) hide show
  1. package/dist/{MarkdownSurfaces-DGpjmPaB.mjs → MarkdownSurfaces-DV9P0Gi9.mjs} +55 -13
  2. package/dist/MarkdownSurfaces-DV9P0Gi9.mjs.map +1 -0
  3. package/dist/{MarkdownSurfaces-FF5za2kU.cjs → MarkdownSurfaces-IUaWSJ0E.cjs} +54 -12
  4. package/dist/MarkdownSurfaces-IUaWSJ0E.cjs.map +1 -0
  5. package/dist/{copilotkit-DyxwF9wL.mjs → copilotkit-BezhVj0g.mjs} +300 -295
  6. package/dist/copilotkit-BezhVj0g.mjs.map +1 -0
  7. package/dist/{copilotkit-BuIuo-Z1.cjs → copilotkit-BvZwkY5s.cjs} +296 -291
  8. package/dist/copilotkit-BvZwkY5s.cjs.map +1 -0
  9. package/dist/{copilotkit-wqaNanhw.d.cts → copilotkit-Cs5MgT7x.d.cts} +30 -7
  10. package/dist/copilotkit-Cs5MgT7x.d.cts.map +1 -0
  11. package/dist/{copilotkit-C765tOUi.d.mts → copilotkit-D38FU7ED.d.mts} +30 -7
  12. package/dist/copilotkit-D38FU7ED.d.mts.map +1 -0
  13. package/dist/index.cjs +2 -2
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.mts +1 -1
  16. package/dist/index.mjs +2 -2
  17. package/dist/index.umd.js +199 -289
  18. package/dist/index.umd.js.map +1 -1
  19. package/dist/v2/generative-ui.cjs +33 -54
  20. package/dist/v2/generative-ui.cjs.map +1 -1
  21. package/dist/v2/generative-ui.d.cts +82 -82
  22. package/dist/v2/generative-ui.d.mts +82 -82
  23. package/dist/v2/generative-ui.mjs +33 -54
  24. package/dist/v2/generative-ui.mjs.map +1 -1
  25. package/dist/v2/headless.cjs +32 -16
  26. package/dist/v2/headless.cjs.map +1 -1
  27. package/dist/v2/headless.d.cts +2 -0
  28. package/dist/v2/headless.d.cts.map +1 -1
  29. package/dist/v2/headless.d.mts +2 -0
  30. package/dist/v2/headless.d.mts.map +1 -1
  31. package/dist/v2/headless.mjs +33 -17
  32. package/dist/v2/headless.mjs.map +1 -1
  33. package/dist/v2/index.cjs +14 -2
  34. package/dist/v2/index.css +1 -1
  35. package/dist/v2/index.d.cts +2 -2
  36. package/dist/v2/index.d.mts +2 -2
  37. package/dist/v2/index.mjs +3 -3
  38. package/dist/v2/index.umd.js +359 -300
  39. package/dist/v2/index.umd.js.map +1 -1
  40. package/package.json +8 -8
  41. package/dist/MarkdownSurfaces-DGpjmPaB.mjs.map +0 -1
  42. package/dist/MarkdownSurfaces-FF5za2kU.cjs.map +0 -1
  43. package/dist/copilotkit-BuIuo-Z1.cjs.map +0 -1
  44. package/dist/copilotkit-C765tOUi.d.mts.map +0 -1
  45. package/dist/copilotkit-DyxwF9wL.mjs.map +0 -1
  46. package/dist/copilotkit-wqaNanhw.d.cts.map +0 -1
@@ -1,12 +1,12 @@
1
- import { A as isRecord, B as useCopilotChatConfiguration, C as validateSchemaSync, D as BASIC_FUNCTIONS, E as getMarkdownSurfaceSource, F as defineToolCallRenderer, H as useShallowStableRef, I as useKatexStyles, L as ControlledModalOpenScope, M as componentCatalogIds, O as ExpressionError, P as toJsonSchema, R as CopilotChatConfigurationProvider, S as issueKey, T as containsDynamicValue, V as shallowEqual, _ as GenerativeUIRuntimeContext, a as createGenerativeUIActivityRenderer, b as formatIssues, i as GenerativeUIToolCallRenderer, j as catalogIdsOf, k as GenerativeUIError, o as createGenerativeUIFunctionCallActivityRenderer, r as GenerativeUIChatSlotContext, t as MarkdownSurfaces, v as useGenerativeUIRuntime, w as withoutRejectedNulls, x as isAsyncIssue, z as CopilotChatDefaultLabels } from "./MarkdownSurfaces-DGpjmPaB.mjs";
1
+ import { A as GenerativeUIError, B as useCopilotChatConfiguration, C as validateSchemaSync, E as getMarkdownSurfaceSource, F as defineToolCallRenderer, H as useShallowStableRef, I as useKatexStyles, L as ControlledModalOpenScope, M as componentCatalogIds, O as BASIC_FUNCTIONS, P as toJsonSchema, R as CopilotChatConfigurationProvider, S as issueKey, T as containsDynamicValue, V as shallowEqual, _ as GenerativeUIRuntimeContext, a as createGenerativeUIActivityRenderer, b as formatIssues, i as GenerativeUIToolCallRenderer, j as catalogIdsOf, k as ExpressionError, o as createGenerativeUIFunctionCallActivityRenderer, r as GenerativeUIChatSlotContext, t as MarkdownSurfaces, v as useGenerativeUIRuntime, w as withoutRejectedNulls, x as isAsyncIssue, z as CopilotChatDefaultLabels } from "./MarkdownSurfaces-DV9P0Gi9.mjs";
2
2
  import * as React$1 from "react";
3
3
  import React, { Fragment, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
4
- import { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitHeaderResolutionError, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgent as ProxiedCopilotRuntimeAgent$1, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, WebMCPRegistry, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorActiveThread as emitInspectorActiveThread$1, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, emitInspectorViewThreadResult as emitInspectorViewThreadResult$1, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations as extractFenceOperations$1, extractStringField, flattenInformationalCards as flattenInformationalCards$1, getMarkdownOperationSurfaceId as getMarkdownOperationSurfaceId$1, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isInspectorThreadBridgeEnabled as isInspectorThreadBridgeEnabled$1, isRunCompletionAware, isRunCompletionAware as isRunCompletionAware$1, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorStopViewing as onInspectorStopViewing$1, onInspectorViewThread, onInspectorViewThread as onInspectorViewThread$1, onInspectorViewThreadResult, parseToolArguments, prepareSurfaceOperations as prepareSurfaceOperations$1, props, segmentSurfaceProse as segmentSurfaceProse$1, select, splitA2UIMarkdown as splitA2UIMarkdown$1, ɵCOPILOTKIT_FEATURES, ɵInterruptState, ɵInterruptState as ɵInterruptState$1, ɵMAX_SOCKET_RETRIES, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisHttpAgent as ɵisHttpAgent$1, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectFetchMoreError as ɵselectFetchMoreError$1, ɵselectHasNextPage, ɵselectHasNextPage as ɵselectHasNextPage$1, ɵselectIsFetchingNextPage, ɵselectIsFetchingNextPage as ɵselectIsFetchingNextPage$1, ɵselectIsMutating, ɵselectIsMutating as ɵselectIsMutating$1, ɵselectMemories, ɵselectMemories as ɵselectMemories$1, ɵselectMemoriesAvailable, ɵselectMemoriesAvailable as ɵselectMemoriesAvailable$1, ɵselectMemoriesError, ɵselectMemoriesError as ɵselectMemoriesError$1, ɵselectMemoriesIsLoading, ɵselectMemoriesIsLoading as ɵselectMemoriesIsLoading$1, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectMemoriesRealtimeStatus as ɵselectMemoriesRealtimeStatus$1, ɵselectThreads, ɵselectThreads as ɵselectThreads$1, ɵselectThreadsError, ɵselectThreadsError as ɵselectThreadsError$1, ɵselectThreadsIsLoading, ɵselectThreadsIsLoading as ɵselectThreadsIsLoading$1, ɵthreadAdapterEvents, ɵwithHeaderDefaults, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core";
4
+ import { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitHeaderResolutionError, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, ProxiedCopilotRuntimeAgent, ProxiedCopilotRuntimeAgent as ProxiedCopilotRuntimeAgent$1, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, WebMCPRegistry, classifySurfaceCards, completePartialMarkdown, createActionGroup, createEffect, createInspectorThreadRequestId, createReducer, createSelector, createStore, emitInspectorActiveThread, emitInspectorActiveThread as emitInspectorActiveThread$1, emitInspectorStopViewing, emitInspectorViewThread, emitInspectorViewThreadResult, emitInspectorViewThreadResult as emitInspectorViewThreadResult$1, empty, ensureObjectArgs, extractCompleteArrayItems, extractFenceOperations as extractFenceOperations$1, extractStringField, flattenInformationalCards as flattenInformationalCards$1, getMarkdownOperationSurfaceId as getMarkdownOperationSurfaceId$1, getWebMCPModelContext, isAbortError, isInspectorThreadBridgeEnabled, isInspectorThreadBridgeEnabled as isInspectorThreadBridgeEnabled$1, isRunCompletionAware, isRunCompletionAware as isRunCompletionAware$1, ofType, on, onInspectorActiveThread, onInspectorStopViewing, onInspectorStopViewing as onInspectorStopViewing$1, onInspectorViewThread, onInspectorViewThread as onInspectorViewThread$1, onInspectorViewThreadResult, parseToolArguments, prepareSurfaceOperations as prepareSurfaceOperations$1, props, segmentSurfaceProse as segmentSurfaceProse$1, select, splitA2UIMarkdown as splitA2UIMarkdown$1, ɵCOPILOTKIT_FEATURES, ɵInterruptState, ɵInterruptState as ɵInterruptState$1, ɵMAX_SOCKET_RETRIES, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵclearAgentInterruptState, ɵclearAgentInterruptState as ɵclearAgentInterruptState$1, ɵcreateMemoryStore, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵgetAgentInterruptState, ɵgetAgentInterruptState as ɵgetAgentInterruptState$1, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisHttpAgent as ɵisHttpAgent$1, ɵisRetryableMemoryStatus, ɵjoinPhoenixChannel$, ɵmapMemoryMetadataEvent, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵphoenixChannel$, ɵphoenixSocket$, ɵselectFetchMoreError, ɵselectFetchMoreError as ɵselectFetchMoreError$1, ɵselectHasNextPage, ɵselectHasNextPage as ɵselectHasNextPage$1, ɵselectIsFetchingNextPage, ɵselectIsFetchingNextPage as ɵselectIsFetchingNextPage$1, ɵselectIsMutating, ɵselectIsMutating as ɵselectIsMutating$1, ɵselectMemories, ɵselectMemories as ɵselectMemories$1, ɵselectMemoriesAvailable, ɵselectMemoriesAvailable as ɵselectMemoriesAvailable$1, ɵselectMemoriesError, ɵselectMemoriesError as ɵselectMemoriesError$1, ɵselectMemoriesIsLoading, ɵselectMemoriesIsLoading as ɵselectMemoriesIsLoading$1, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectMemoriesRealtimeStatus as ɵselectMemoriesRealtimeStatus$1, ɵselectThreads, ɵselectThreads as ɵselectThreads$1, ɵselectThreadsError, ɵselectThreadsError as ɵselectThreadsError$1, ɵselectThreadsIsLoading, ɵselectThreadsIsLoading as ɵselectThreadsIsLoading$1, ɵthreadAdapterEvents, ɵwithHeaderDefaults, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core";
5
5
  import { ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError as AGUIConnectNotImplementedError$1, AGUIError, AGUI_METADATA_KEY, AbstractAgent as AbstractAgent$1, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, CompatibilityBoundary, DebugLogger, EventType, FilterToolCallsMiddleware, FunctionMiddleware, HttpAgent, Middleware, PROTOCOL_VERSION, aggregateTokenUsage, authoritativeActivityTypes, buildResumeArray, compactEvents, contentHasMedia, contentToText as contentToText$1, convertToLegacyEvents, createDebugLogger, defaultApplyEvents, enforceEvents, enforceOutgoingInput, getRunOutcome, isInterruptExpired, isRecognizedEvent, mergeMetadata, omitOptionalNulls, parseProtoStream, parseSSEStream, randomUUID, randomUUID as randomUUID$2, resolveAgentDebugConfig, resolveDebugLogger, runHttpRequest, structuredClone_, tokenUsageFromAiSdkUsage, tokenUsageFromLangChainMetadata, transformChunks, transformHttpEventStream, verifyEvents, withAuthoritativeActivityTypes } from "@ag-ui/client";
6
6
  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";
7
7
  import { extendTailwindMerge, twMerge } from "tailwind-merge";
8
8
  import { ArrowUp, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronRightIcon, Circle, Copy, Edit, EyeOff, Loader2, MessageCircle, Mic, PanelLeftOpen, Play, Plus, RefreshCw, Square, ThumbsDown, ThumbsUp, Upload, Volume2, Wrench, X } from "lucide-react";
9
- import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_VERSION, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitRemoteEndpointDiscoveryError, DEFAULT_AGENT_ID, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, MissingPublicApiKeyError, Severity, TranscriptionErrorCode, TranscriptionErrorCode as TranscriptionErrorCode$1, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childRefKind, commitRowKeyStore, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, dataToUUID, envelopeToManifest, exceedsMaxSize, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIGuideFeatures, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getSourceUrl, matchesAcceptFilter, parseJson, partialJSONParse, randomId, randomUUID as randomUUID$1, readFileAsBase64, resolveRowRenderKeysById, schemaToJsonSchema, shouldEnableInspector, toA2UIActionMessage, validateOperation } from "@copilotkit/shared";
9
+ import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_VERSION, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitRemoteEndpointDiscoveryError, DEFAULT_AGENT_ID, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, MissingPublicApiKeyError, Severity, TranscriptionErrorCode, TranscriptionErrorCode as TranscriptionErrorCode$1, applyDescriptionOverrides, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, commitRowKeyStore, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, dataToUUID, defaultGenerativeUIPromptSpec, envelopeToManifest, exceedsMaxSize, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIGuideFeatures, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getSourceUrl, matchesAcceptFilter, parseJson, partialJSONParse, randomId, randomUUID as randomUUID$1, readFileAsBase64, renderGenerativeUISchema, resolveRowRenderKeysById, schemaToJsonSchema, shouldEnableInspector, toA2UIActionMessage, validateOperation } from "@copilotkit/shared";
10
10
  import { CopilotKitAgentIdContext, CopilotKitContext, LicenseContext, useCopilotKit, useCopilotKit as useCopilotKit$1, useDefaultAgentId, useLicenseContext, useLicenseContext as useLicenseContext$1 } from "@copilotkit/react-core/v2/context";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { Slot } from "@radix-ui/react-slot";
@@ -23,7 +23,7 @@ import { zodToJsonSchema } from "zod-to-json-schema";
23
23
  import { Catalog as Catalog$1, ComponentModel, DataModel, SurfaceModel } from "@a2ui/web_core/v0_9";
24
24
  import * as PopoverPrimitive from "@radix-ui/react-popover";
25
25
  import { createPortal, flushSync } from "react-dom";
26
- import { useVirtualizer } from "@tanstack/react-virtual";
26
+ import { observeElementRect, useVirtualizer } from "@tanstack/react-virtual";
27
27
  import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
28
28
  import { COPILOTKIT_THREADS_DRAWER_TAG, defineCopilotKitThreadsDrawer } from "@copilotkit/web-components/threads-drawer";
29
29
  import ReactMarkdown from "react-markdown";
@@ -1322,7 +1322,7 @@ function useRenderToolCall() {
1322
1322
 
1323
1323
  //#endregion
1324
1324
  //#region package.json
1325
- var version = "1.83.0";
1325
+ var version = "1.84.1";
1326
1326
 
1327
1327
  //#endregion
1328
1328
  //#region src/v2/components/CopilotKitInspector.tsx
@@ -3071,6 +3071,35 @@ function builtInFunctionManifests() {
3071
3071
  }]));
3072
3072
  }
3073
3073
  /**
3074
+ * The manifest of a catalog, with no React runtime: the components of `ui`,
3075
+ * the built-in functions (minus the names the app declares) and
3076
+ * `options.functions`, the chat target and `options.targets`, and
3077
+ * `options.surfaces`. `buildGenerativeUIManifest` builds the per-run
3078
+ * manifest with it; tools that run outside React use it directly.
3079
+ *
3080
+ * @example
3081
+ * ```ts
3082
+ * const manifest = buildCatalogManifest(standardUI);
3083
+ * manifest.targets; // [{ id: "chat", kind: "chat" }]
3084
+ * ```
3085
+ */
3086
+ function buildCatalogManifest(ui, options = {}) {
3087
+ return {
3088
+ catalogId: ui.id,
3089
+ catalogIds: catalogIdsOf(ui),
3090
+ components: applyDescriptionOverrides({ components: ui.manifestComponents }, defaultGenerativeUIPromptSpec().descriptions).manifest.components,
3091
+ functions: {
3092
+ ...Object.fromEntries(Object.entries(builtInFunctionManifests()).filter(([name]) => !ui.functions.has(name))),
3093
+ ...options.functions
3094
+ },
3095
+ targets: [{
3096
+ id: GENERATIVE_UI_CHAT_TARGET,
3097
+ kind: "chat"
3098
+ }, ...options.targets ?? []],
3099
+ surfaces: options.surfaces ?? {}
3100
+ };
3101
+ }
3102
+ /**
3074
3103
  * Builds the per-run manifest. Never contains handlers or renderers.
3075
3104
  *
3076
3105
  * - `functions`: the built-in functions, then the declared functions with
@@ -3085,20 +3114,11 @@ function buildGenerativeUIManifest(runtime, threadId) {
3085
3114
  kind: "inline",
3086
3115
  ...rest
3087
3116
  }));
3088
- return {
3089
- catalogId: ui.id,
3090
- catalogIds: catalogIdsOf(ui),
3091
- components: ui.manifestComponents,
3092
- functions: {
3093
- ...Object.fromEntries(Object.entries(builtInFunctionManifests()).filter(([name]) => !ui.functions.has(name))),
3094
- ...dispatcher.listExposed()
3095
- },
3096
- targets: [{
3097
- id: GENERATIVE_UI_CHAT_TARGET,
3098
- kind: "chat"
3099
- }, ...inlineTargets],
3117
+ return buildCatalogManifest(ui, {
3118
+ functions: dispatcher.listExposed(),
3119
+ targets: inlineTargets,
3100
3120
  surfaces: threadId ? manager.describeSurfaces(threadId) : {}
3101
- };
3121
+ });
3102
3122
  }
3103
3123
  /**
3104
3124
  * Builds the envelope that a run sends as `forwardedProps.copilotkit.ui`,
@@ -3121,7 +3141,7 @@ function buildGenerativeUIManifest(runtime, threadId) {
3121
3141
  * includeCatalog: true,
3122
3142
  * contextSent: false,
3123
3143
  * });
3124
- * envelope["v1.0"].supportedCatalogIds; // [runtime.ui.id]
3144
+ * envelope["1.0"].supportedCatalogIds; // [runtime.ui.id]
3125
3145
  * ```
3126
3146
  */
3127
3147
  function buildGenerativeUIEnvelope(runtime, threadId, options) {
@@ -3130,7 +3150,7 @@ function buildGenerativeUIEnvelope(runtime, threadId, options) {
3130
3150
  const instructions = options.instructions ?? (transport === "markdown" ? buildGenerativeUIMarkdownGuidelines(generativeUIGuideFeatures(manifest)) : void 0);
3131
3151
  const omitComponents = transport === "markdown" && !includeCatalog;
3132
3152
  return {
3133
- "v1.0": {
3153
+ "1.0": {
3134
3154
  supportedCatalogIds: manifest.catalogIds ?? [manifest.catalogId],
3135
3155
  inlineCatalogs: [{
3136
3156
  catalogId: manifest.catalogId,
@@ -3151,251 +3171,6 @@ function buildGenerativeUIEnvelope(runtime, threadId, options) {
3151
3171
  };
3152
3172
  }
3153
3173
 
3154
- //#endregion
3155
- //#region src/v2/generative-ui/markdown/context.ts
3156
- /** Objects nested deeper than this show as `object`. */
3157
- const MAX_OBJECT_DEPTH = 2;
3158
- /** A prop must appear verbatim in at least this many components to be hoisted. */
3159
- const COMMON_PROP_MIN_COMPONENTS = 8;
3160
- /** A JSON Schema of a list of schemas (`anyOf`, `oneOf`), else an empty list. */
3161
- function schemaList(value) {
3162
- return Array.isArray(value) ? value.filter(isRecord) : [];
3163
- }
3164
- /**
3165
- * Puts a top-level union in parentheses, so that `[]` applies to all of
3166
- * it. A union inside braces needs none.
3167
- */
3168
- function asArrayItem(type) {
3169
- let outside = type;
3170
- for (let inner = outside.replace(/\{[^{}]*\}/g, ""); inner !== outside;) {
3171
- outside = inner;
3172
- inner = outside.replace(/\{[^{}]*\}/g, "");
3173
- }
3174
- return outside.includes(" | ") ? `(${type})[]` : `${type}[]`;
3175
- }
3176
- /**
3177
- * A JSON Schema as a short TypeScript-like type, for example
3178
- * `{ label: string; size?: "sm" | "md" }`.
3179
- */
3180
- function compactType(schema, depth) {
3181
- const ref = childRefKind(schema);
3182
- if (ref === "single") return "componentId";
3183
- if (ref === "multiple") return "componentId[] | { componentId: string; path: string }";
3184
- if ("const" in schema) return JSON.stringify(schema.const);
3185
- if (Array.isArray(schema.enum)) return schema.enum.map((value) => JSON.stringify(value)).join(" | ");
3186
- const variants = [...schemaList(schema.anyOf), ...schemaList(schema.oneOf)];
3187
- if (variants.length > 0) return variants.map((variant) => compactType(variant, depth)).join(" | ");
3188
- return (Array.isArray(schema.type) ? schema.type : [schema.type]).map((type) => {
3189
- switch (type) {
3190
- case "string":
3191
- case "boolean":
3192
- case "null": return type;
3193
- case "number":
3194
- case "integer": return "number";
3195
- case "array": return isRecord(schema.items) ? asArrayItem(compactType(schema.items, depth)) : "unknown[]";
3196
- case "object": return compactObject(schema, depth);
3197
- default: return "unknown";
3198
- }
3199
- }).join(" | ");
3200
- }
3201
- /** An object schema as `{ key: type; other?: type }`. */
3202
- function compactObject(schema, depth) {
3203
- const properties = isRecord(schema.properties) ? schema.properties : {};
3204
- const entries = Object.entries(properties);
3205
- if (entries.length === 0) return isRecord(schema.additionalProperties) ? `Record<string, ${compactType(schema.additionalProperties, depth + 1)}>` : "object";
3206
- if (depth >= MAX_OBJECT_DEPTH) return "object";
3207
- const required = Array.isArray(schema.required) ? schema.required : [];
3208
- return `{ ${entries.map(([key, value]) => {
3209
- const type = isRecord(value) ? compactType(value, depth + 1) : "unknown";
3210
- return `${key}${required.includes(key) ? "" : "?"}: ${type}`;
3211
- }).join("; ")} }`;
3212
- }
3213
- /** A schema as its type, with its description after `//`. */
3214
- function describedType(schema, depth) {
3215
- const type = compactType(schema, depth);
3216
- return typeof schema.description === "string" ? `${type} // ${schema.description}` : type;
3217
- }
3218
- /** The props of a component: `{ "label": "string", "size?": "..." }`. */
3219
- function compactProps(schema) {
3220
- const properties = isRecord(schema.properties) ? schema.properties : {};
3221
- const required = Array.isArray(schema.required) ? schema.required : [];
3222
- const props = {};
3223
- for (const [key, value] of Object.entries(properties)) {
3224
- if (!isRecord(value)) continue;
3225
- const name = required.includes(key) ? key : `${key}?`;
3226
- props[name] = describedType(value, 1);
3227
- }
3228
- return props;
3229
- }
3230
- /**
3231
- * The prop set worth listing once. Candidates are (key, type) pairs that at
3232
- * least {@link COMMON_PROP_MIN_COMPONENTS} components carry verbatim. The
3233
- * candidate subset of each component is a possible common set, scored by
3234
- * the characters it saves (set size times the components that contain all
3235
- * of it). `undefined` when no set is shared by enough components.
3236
- */
3237
- function findCommonProps(propsList) {
3238
- const pairKey = (key, type) => `${key}\u0000${type}`;
3239
- const counts = /* @__PURE__ */ new Map();
3240
- for (const props of propsList) for (const [key, type] of Object.entries(props)) {
3241
- const id = pairKey(key, type);
3242
- counts.set(id, (counts.get(id) ?? 0) + 1);
3243
- }
3244
- let best;
3245
- let bestScore = 0;
3246
- const seen = /* @__PURE__ */ new Set();
3247
- for (const props of propsList) {
3248
- const subset = Object.entries(props).filter(([key, type]) => (counts.get(pairKey(key, type)) ?? 0) >= COMMON_PROP_MIN_COMPONENTS);
3249
- if (subset.length < 2) continue;
3250
- const signature = subset.map(([key, type]) => pairKey(key, type)).join("\n");
3251
- if (seen.has(signature)) continue;
3252
- seen.add(signature);
3253
- const members = propsList.filter((other) => subset.every(([key, type]) => other[key] === type)).length;
3254
- if (members < COMMON_PROP_MIN_COMPONENTS) continue;
3255
- const score = subset.reduce((total, [key, type]) => total + key.length + type.length, 0) * (members - 1);
3256
- if (score > bestScore) {
3257
- bestScore = score;
3258
- best = Object.fromEntries(subset);
3259
- }
3260
- }
3261
- return best;
3262
- }
3263
- /**
3264
- * The component schema of the markdown transport, from the per-run
3265
- * manifest. It is smaller than the manifest: each prop is one short type,
3266
- * and the props that many components share verbatim (the layout props of
3267
- * the containers) are listed once in `commonProps`; a component that takes
3268
- * them is flagged `includesCommonProps`.
3269
- * It has the catalog id, the targets with their descriptions and their
3270
- * component lists, the functions with their parameters, the components
3271
- * with their props, events and slots, and the surfaces of the thread. A surface lists the
3272
- * values that the user set and the operations that the client dropped.
3273
- *
3274
- * @param manifest - The manifest from `buildGenerativeUIManifest`.
3275
- * @returns A JSON-ready object.
3276
- *
3277
- * @example
3278
- * ```ts
3279
- * const value = JSON.stringify(
3280
- * buildCompactGenerativeUISchema(buildGenerativeUIManifest(runtime, threadId)),
3281
- * );
3282
- * ```
3283
- */
3284
- function buildCompactGenerativeUISchema(manifest) {
3285
- const components = {};
3286
- for (const [name, component] of Object.entries(manifest.components)) {
3287
- const events = Object.entries(component.events ?? {}).map(([event, definition]) => [event, definition.description ?? compactType(definition.parameters, 0)]);
3288
- components[name] = {
3289
- ...component.description ? { description: component.description } : {},
3290
- props: compactProps(component.props),
3291
- ...events.length > 0 ? { events: Object.fromEntries(events) } : {},
3292
- ...component.slots ? { slots: component.slots } : {}
3293
- };
3294
- }
3295
- const common = findCommonProps(Object.values(components).map((component) => component.props));
3296
- if (common) {
3297
- const commonKeys = Object.keys(common);
3298
- for (const component of Object.values(components)) {
3299
- if (!commonKeys.every((key) => component.props[key] === common[key])) continue;
3300
- component.includesCommonProps = true;
3301
- component.props = Object.fromEntries(Object.entries(component.props).filter(([key]) => !(key in common)));
3302
- }
3303
- }
3304
- const functions = Object.fromEntries(Object.entries(manifest.functions).map(([name, fn]) => {
3305
- const signature = fn.parameters.description;
3306
- const hasSignature = typeof signature === "string" && signature.startsWith("{") && Object.keys(fn.parameters).length === 2;
3307
- const callers = functionCallers(fn);
3308
- return [name, {
3309
- ...fn.description ? { description: fn.description } : {},
3310
- parameters: hasSignature ? signature : compactType(fn.parameters, 0),
3311
- ...callers.agent && GENERATIVE_UI_AGENT_FUNCTION_CALLS ? { callers: callers.renderer ? "UI or agent" : "agent only" } : {}
3312
- }];
3313
- }));
3314
- return {
3315
- catalogId: manifest.catalogId,
3316
- targets: manifest.targets,
3317
- functions,
3318
- ...common ? { commonProps: common } : {},
3319
- components,
3320
- surfaces: manifest.surfaces
3321
- };
3322
- }
3323
- /**
3324
- * Registers the two context entries of the markdown transport: the compact
3325
- * component schema and the fence guideline. Both go only to `agentIds`.
3326
- *
3327
- * The schema is built again at each run start and when a
3328
- * `<GenerativeUISurface>` mounts, unmounts, or changes its description or
3329
- * its components, so its targets, functions, and surfaces stay current. The surfaces are those of the running thread.
3330
- *
3331
- * @param copilotkit - The CopilotKit core of the provider.
3332
- * @param runtime - The generative UI runtime parts, or null without one.
3333
- * @param options - `enabled` and `agentIds`.
3334
- *
3335
- * @example
3336
- * ```ts
3337
- * useGenerativeUIMarkdownContext(copilotkit, core, {
3338
- * enabled: config?.transport === "markdown" && config.sendContext !== false,
3339
- * agentIds: config?.agentIds,
3340
- * });
3341
- * ```
3342
- */
3343
- function useGenerativeUIMarkdownContext(copilotkit, runtime, options) {
3344
- const { enabled, agentIds } = options;
3345
- const agentIdsKey = agentIds === void 0 ? "" : JSON.stringify(agentIds);
3346
- useEffect(() => {
3347
- if (!runtime || !enabled) return;
3348
- const scopedAgentIds = agentIdsKey ? JSON.parse(agentIdsKey) : void 0;
3349
- const scope = scopedAgentIds ? { agentIds: scopedAgentIds } : {};
3350
- let guidelineId;
3351
- let guidelineValue;
3352
- let schemaId;
3353
- let schemaValue;
3354
- const refreshSchema = (threadId) => {
3355
- const manifest = buildGenerativeUIManifest(runtime, threadId);
3356
- const guideline = buildGenerativeUIMarkdownGuidelines(generativeUIGuideFeatures(manifest));
3357
- if (guideline !== guidelineValue) {
3358
- if (guidelineId !== void 0) copilotkit.removeContext(guidelineId);
3359
- guidelineValue = guideline;
3360
- guidelineId = copilotkit.addContext({
3361
- description: GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,
3362
- value: guideline,
3363
- ...scope
3364
- });
3365
- }
3366
- const value = JSON.stringify(buildCompactGenerativeUISchema(manifest));
3367
- if (value === schemaValue) return;
3368
- if (schemaId !== void 0) copilotkit.removeContext(schemaId);
3369
- schemaValue = value;
3370
- schemaId = copilotkit.addContext({
3371
- description: GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,
3372
- value,
3373
- ...scope
3374
- });
3375
- };
3376
- refreshSchema(runtime.manager.getActiveThread());
3377
- let targetsKey = JSON.stringify(runtime.manager.getMountedTargets());
3378
- const unsubscribeManager = runtime.manager.subscribe(() => {
3379
- const nextKey = JSON.stringify(runtime.manager.getMountedTargets());
3380
- if (nextKey === targetsKey) return;
3381
- targetsKey = nextKey;
3382
- refreshSchema(runtime.manager.getActiveThread());
3383
- });
3384
- const subscription = copilotkit.subscribe({ onAgentRunStarted: ({ agent }) => refreshSchema(agent.threadId) });
3385
- return () => {
3386
- subscription.unsubscribe();
3387
- unsubscribeManager();
3388
- if (guidelineId !== void 0) copilotkit.removeContext(guidelineId);
3389
- if (schemaId !== void 0) copilotkit.removeContext(schemaId);
3390
- };
3391
- }, [
3392
- copilotkit,
3393
- runtime,
3394
- enabled,
3395
- agentIdsKey
3396
- ]);
3397
- }
3398
-
3399
3174
  //#endregion
3400
3175
  //#region src/v2/generative-ui/debug-source.ts
3401
3176
  /**
@@ -3428,7 +3203,7 @@ function describeGenerativeUIRun(runtime, threadId, options) {
3428
3203
  }]
3429
3204
  };
3430
3205
  const guideline = buildGenerativeUIMarkdownGuidelines(generativeUIGuideFeatures(manifest));
3431
- const schema = JSON.stringify(buildCompactGenerativeUISchema(manifest));
3206
+ const schema = renderGenerativeUISchema(manifest, defaultGenerativeUIPromptSpec().schema.markdown);
3432
3207
  return {
3433
3208
  envelope,
3434
3209
  prompt: [{
@@ -3715,6 +3490,84 @@ function createGenerativeUIDispatcher(options) {
3715
3490
  };
3716
3491
  }
3717
3492
 
3493
+ //#endregion
3494
+ //#region src/v2/generative-ui/markdown/context.ts
3495
+ /**
3496
+ * Registers the two context entries of the markdown transport: the compact
3497
+ * component schema and the fence guideline. Both go only to `agentIds`.
3498
+ *
3499
+ * The schema is built again at each run start and when a
3500
+ * `<GenerativeUISurface>` mounts, unmounts, or changes its description or
3501
+ * its components, so its targets, functions, and surfaces stay current. The surfaces are those of the running thread.
3502
+ *
3503
+ * @param copilotkit - The CopilotKit core of the provider.
3504
+ * @param runtime - The generative UI runtime parts, or null without one.
3505
+ * @param options - `enabled` and `agentIds`.
3506
+ *
3507
+ * @example
3508
+ * ```ts
3509
+ * useGenerativeUIMarkdownContext(copilotkit, core, {
3510
+ * enabled: config?.transport === "markdown" && config.sendContext !== false,
3511
+ * agentIds: config?.agentIds,
3512
+ * });
3513
+ * ```
3514
+ */
3515
+ function useGenerativeUIMarkdownContext(copilotkit, runtime, options) {
3516
+ const { enabled, agentIds } = options;
3517
+ const agentIdsKey = agentIds === void 0 ? "" : JSON.stringify(agentIds);
3518
+ useEffect(() => {
3519
+ if (!runtime || !enabled) return;
3520
+ const scopedAgentIds = agentIdsKey ? JSON.parse(agentIdsKey) : void 0;
3521
+ const scope = scopedAgentIds ? { agentIds: scopedAgentIds } : {};
3522
+ let guidelineId;
3523
+ let guidelineValue;
3524
+ let schemaId;
3525
+ let schemaValue;
3526
+ const refreshSchema = (threadId) => {
3527
+ const manifest = buildGenerativeUIManifest(runtime, threadId);
3528
+ const guideline = buildGenerativeUIMarkdownGuidelines(generativeUIGuideFeatures(manifest));
3529
+ if (guideline !== guidelineValue) {
3530
+ if (guidelineId !== void 0) copilotkit.removeContext(guidelineId);
3531
+ guidelineValue = guideline;
3532
+ guidelineId = copilotkit.addContext({
3533
+ description: GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,
3534
+ value: guideline,
3535
+ ...scope
3536
+ });
3537
+ }
3538
+ const value = renderGenerativeUISchema(manifest, defaultGenerativeUIPromptSpec().schema.markdown);
3539
+ if (value === schemaValue) return;
3540
+ if (schemaId !== void 0) copilotkit.removeContext(schemaId);
3541
+ schemaValue = value;
3542
+ schemaId = copilotkit.addContext({
3543
+ description: GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,
3544
+ value,
3545
+ ...scope
3546
+ });
3547
+ };
3548
+ refreshSchema(runtime.manager.getActiveThread());
3549
+ let targetsKey = JSON.stringify(runtime.manager.getMountedTargets());
3550
+ const unsubscribeManager = runtime.manager.subscribe(() => {
3551
+ const nextKey = JSON.stringify(runtime.manager.getMountedTargets());
3552
+ if (nextKey === targetsKey) return;
3553
+ targetsKey = nextKey;
3554
+ refreshSchema(runtime.manager.getActiveThread());
3555
+ });
3556
+ const subscription = copilotkit.subscribe({ onAgentRunStarted: ({ agent }) => refreshSchema(agent.threadId) });
3557
+ return () => {
3558
+ subscription.unsubscribe();
3559
+ unsubscribeManager();
3560
+ if (guidelineId !== void 0) copilotkit.removeContext(guidelineId);
3561
+ if (schemaId !== void 0) copilotkit.removeContext(schemaId);
3562
+ };
3563
+ }, [
3564
+ copilotkit,
3565
+ runtime,
3566
+ enabled,
3567
+ agentIdsKey
3568
+ ]);
3569
+ }
3570
+
3718
3571
  //#endregion
3719
3572
  //#region src/v2/generative-ui/surface-manager.ts
3720
3573
  function surfaceKey(threadId, surfaceId) {
@@ -7020,6 +6873,7 @@ const INTERRUPT_EVENT_NAME = "on_interrupt";
7020
6873
 
7021
6874
  //#endregion
7022
6875
  //#region src/v2/hooks/use-interrupt.tsx
6876
+ /** Recognize thenables returned by interrupt preprocessing handlers. */
7023
6877
  function isPromiseLike(value) {
7024
6878
  return (typeof value === "object" || typeof value === "function") && value !== null && typeof Reflect.get(value, "then") === "function";
7025
6879
  }
@@ -7070,7 +6924,6 @@ function useInterrupt(config) {
7070
6924
  const [handlerResult, setHandlerResult] = useState(null);
7071
6925
  const interruptStateRef = useRef(new ɵInterruptState());
7072
6926
  useEffect(() => {
7073
- const interruptState = interruptStateRef.current;
7074
6927
  let localLegacy = null;
7075
6928
  let localStandard = null;
7076
6929
  const subscription = agent.subscribe({
@@ -7083,19 +6936,21 @@ function useInterrupt(config) {
7083
6936
  onRunFinishedEvent: (params) => {
7084
6937
  if (params.outcome === "interrupt") localStandard = params.interrupts;
7085
6938
  },
7086
- onRunStartedEvent: () => {
6939
+ onRunStartedEvent: (params) => {
6940
+ if (!agent.pendingInterrupts?.length || params?.input?.resume !== void 0) ɵclearAgentInterruptState(agent);
7087
6941
  localLegacy = null;
7088
6942
  localStandard = null;
7089
- interruptState.clear();
6943
+ interruptStateRef.current = new ɵInterruptState();
7090
6944
  setPending(null);
7091
6945
  },
7092
6946
  onRunFinalized: () => {
7093
6947
  if (localStandard && localStandard.length > 0) {
7094
- interruptState.setStandard(localStandard);
7095
- setPending(interruptState.pending);
6948
+ interruptStateRef.current = ɵgetAgentInterruptState(agent, localStandard);
6949
+ setPending(interruptStateRef.current.pending);
7096
6950
  } else if (localLegacy) {
7097
- interruptState.setLegacy(localLegacy);
7098
- setPending(interruptState.pending);
6951
+ interruptStateRef.current = new ɵInterruptState();
6952
+ interruptStateRef.current.setLegacy(localLegacy);
6953
+ setPending(interruptStateRef.current.pending);
7099
6954
  }
7100
6955
  localLegacy = null;
7101
6956
  localStandard = null;
@@ -7103,20 +6958,27 @@ function useInterrupt(config) {
7103
6958
  onRunFailed: () => {
7104
6959
  localLegacy = null;
7105
6960
  localStandard = null;
7106
- interruptState.clear();
6961
+ interruptStateRef.current = new ɵInterruptState();
7107
6962
  setPending(null);
7108
6963
  }
7109
6964
  });
6965
+ interruptStateRef.current = agent.pendingInterrupts?.length ? ɵgetAgentInterruptState(agent) : new ɵInterruptState();
6966
+ setPending(interruptStateRef.current.pending);
7110
6967
  return () => {
7111
6968
  subscription.unsubscribe();
7112
- interruptState.clear();
6969
+ interruptStateRef.current = new ɵInterruptState();
7113
6970
  };
7114
6971
  }, [agent]);
6972
+ /** Record an explicit answer and resume once the complete batch is addressed. */
7115
6973
  const resolve = useCallback(async (payload, interruptId) => {
7116
6974
  const current = pendingRef.current;
7117
6975
  if (!current) return;
7118
6976
  if (current.kind === "standard" && current.interrupts.length > 1 && interruptId === void 0) console.warn(`[CopilotKit] useInterrupt: resolve()/cancel() called without an interruptId while ${current.interrupts.length} interrupts are open; defaulting to the first. Pass an interruptId to address a specific interrupt.`);
7119
- const decision = interruptStateRef.current.resolve(payload, interruptId);
6977
+ if (interruptStateRef.current.isCompletedToolCall(interruptId, agent.messages)) {
6978
+ console.warn("[CopilotKit] useInterrupt: ignoring an answer for an already completed frontend tool call.");
6979
+ return;
6980
+ }
6981
+ const decision = interruptStateRef.current.resolve(payload, interruptId, agent.messages);
7120
6982
  if (decision.kind === "legacy-resume") try {
7121
6983
  return await copilotkit.runAgent({
7122
6984
  agent,
@@ -7132,7 +6994,7 @@ function useInterrupt(config) {
7132
6994
  }
7133
6995
  if (decision.kind === "expired") {
7134
6996
  console.error(`[CopilotKit] useInterrupt: interrupt ${decision.interrupt.id} expired at ${decision.interrupt.expiresAt}; not resuming.`);
7135
- interruptStateRef.current.clear();
6997
+ interruptStateRef.current = new ɵInterruptState();
7136
6998
  setPending(null);
7137
6999
  return;
7138
7000
  }
@@ -7150,25 +7012,30 @@ function useInterrupt(config) {
7150
7012
  });
7151
7013
  } catch (err) {
7152
7014
  console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
7153
- interruptStateRef.current.clear();
7015
+ interruptStateRef.current = new ɵInterruptState();
7154
7016
  setPending(null);
7155
7017
  throw err;
7156
7018
  }
7157
7019
  }, [agent, copilotkit]);
7020
+ /** Cancel a standard interrupt or dismiss a legacy interrupt locally. */
7158
7021
  const cancel = useCallback(async (interruptId) => {
7159
7022
  const current = pendingRef.current;
7160
7023
  if (!current) return;
7161
7024
  if (current.kind === "standard" && current.interrupts.length > 1 && interruptId === void 0) console.warn(`[CopilotKit] useInterrupt: resolve()/cancel() called without an interruptId while ${current.interrupts.length} interrupts are open; defaulting to the first. Pass an interruptId to address a specific interrupt.`);
7162
- const decision = interruptStateRef.current.cancel(interruptId);
7025
+ if (interruptStateRef.current.isCompletedToolCall(interruptId, agent.messages)) {
7026
+ console.warn("[CopilotKit] useInterrupt: ignoring an answer for an already completed frontend tool call.");
7027
+ return;
7028
+ }
7029
+ const decision = interruptStateRef.current.cancel(interruptId, agent.messages);
7163
7030
  if (decision.kind === "dismiss") {
7164
7031
  console.warn("[CopilotKit] useInterrupt: cancel() is not supported for legacy on_interrupt interrupts; dismissing.");
7165
- interruptStateRef.current.clear();
7032
+ interruptStateRef.current = new ɵInterruptState();
7166
7033
  setPending(null);
7167
7034
  return;
7168
7035
  }
7169
7036
  if (decision.kind === "expired") {
7170
7037
  console.error(`[CopilotKit] useInterrupt: interrupt ${decision.interrupt.id} expired at ${decision.interrupt.expiresAt}; not resuming.`);
7171
- interruptStateRef.current.clear();
7038
+ interruptStateRef.current = new ɵInterruptState();
7172
7039
  setPending(null);
7173
7040
  return;
7174
7041
  }
@@ -7186,7 +7053,7 @@ function useInterrupt(config) {
7186
7053
  });
7187
7054
  } catch (err) {
7188
7055
  console.error("[CopilotKit] useInterrupt resolve: runAgent rejected; clearing pending + rethrowing", err);
7189
- interruptStateRef.current.clear();
7056
+ interruptStateRef.current = new ɵInterruptState();
7190
7057
  setPending(null);
7191
7058
  throw err;
7192
7059
  }
@@ -7201,6 +7068,7 @@ function useInterrupt(config) {
7201
7068
  resolveRef.current = resolve;
7202
7069
  const cancelRef = useRef(cancel);
7203
7070
  cancelRef.current = cancel;
7071
+ /** Evaluate the consumer filter, logging failures and disabling their UI. */
7204
7072
  const isEnabled = (event) => {
7205
7073
  const predicate = enabledRef.current;
7206
7074
  if (!predicate) return true;
@@ -10798,10 +10666,13 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10798
10666
  total: 0,
10799
10667
  sizes: /* @__PURE__ */ new Map()
10800
10668
  });
10669
+ const resizeAnchorRef = React.useRef(null);
10670
+ const restoringVisibilityRef = React.useRef(false);
10801
10671
  const firstMessageId = deduplicatedMessages[0]?.id;
10802
10672
  const measuredThreadRef = React.useRef(firstMessageId);
10803
10673
  if (measuredThreadRef.current !== firstMessageId) {
10804
10674
  measuredThreadRef.current = firstMessageId;
10675
+ resizeAnchorRef.current = null;
10805
10676
  measuredRef.current = {
10806
10677
  total: 0,
10807
10678
  sizes: /* @__PURE__ */ new Map()
@@ -10811,7 +10682,28 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10811
10682
  const { total, sizes } = measuredRef.current;
10812
10683
  return sizes.size > 0 ? Math.max(1, Math.round(total / sizes.size)) : 100;
10813
10684
  }, []);
10814
- const measureRowElement = React.useCallback((el) => {
10685
+ const isPinnedToBottomRef = React.useRef(isPinnedToBottom);
10686
+ const measuredWidthRef = React.useRef(null);
10687
+ const captureResizeAnchor = React.useCallback((instance) => {
10688
+ const width = instance.scrollElement?.clientWidth;
10689
+ if (!width || instance.scrollElement?.clientHeight === 0 || restoringVisibilityRef.current || isPinnedToBottomRef.current || instance.options.count === 0 || measuredWidthRef.current === null || width === measuredWidthRef.current) return;
10690
+ if (resizeAnchorRef.current) {
10691
+ if (resizeAnchorRef.current.ready) resizeAnchorRef.current = {
10692
+ ...resizeAnchorRef.current,
10693
+ ready: false
10694
+ };
10695
+ return;
10696
+ }
10697
+ const offset = instance.scrollElement?.scrollTop ?? 0;
10698
+ const anchor = instance.getVirtualItemForOffset(offset);
10699
+ if (anchor) resizeAnchorRef.current = {
10700
+ index: anchor.index,
10701
+ offset: offset - anchor.start,
10702
+ ready: false
10703
+ };
10704
+ }, []);
10705
+ const measureRowElement = React.useCallback((el, _entry, instance) => {
10706
+ captureResizeAnchor(instance);
10815
10707
  const height = el?.getBoundingClientRect().height ?? 0;
10816
10708
  const index = Number(el?.dataset?.index);
10817
10709
  if (height > 0 && Number.isInteger(index)) {
@@ -10820,16 +10712,70 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10820
10712
  sizes.set(index, height);
10821
10713
  }
10822
10714
  return height > 0 ? height : measuredRef.current.sizes.get(index) ?? 100;
10823
- }, []);
10824
- const isPinnedToBottomRef = React.useRef(isPinnedToBottom);
10715
+ }, [captureResizeAnchor]);
10825
10716
  const shouldAdjustScrollOnResize = React.useCallback((item, _delta, instance) => {
10826
- if (isPinnedToBottomRef.current) return false;
10717
+ if (isPinnedToBottomRef.current || resizeAnchorRef.current || restoringVisibilityRef.current) return false;
10827
10718
  const scrollAdjustments = instance.scrollAdjustments ?? 0;
10828
10719
  return item.start < (instance.scrollOffset ?? 0) + scrollAdjustments;
10829
10720
  }, []);
10721
+ const observeScrollRect = React.useCallback((instance, notify) => {
10722
+ let frame;
10723
+ let pendingRect;
10724
+ const disconnect = observeElementRect(instance, (rect) => {
10725
+ if (instance.scrollElement?.clientHeight === 0) {
10726
+ restoringVisibilityRef.current = true;
10727
+ resizeAnchorRef.current = null;
10728
+ if (frame !== void 0) cancelAnimationFrame(frame);
10729
+ frame = void 0;
10730
+ pendingRect = void 0;
10731
+ notify(rect);
10732
+ return;
10733
+ }
10734
+ const width = instance.scrollElement?.clientWidth ?? rect.width;
10735
+ const previousWidth = measuredWidthRef.current;
10736
+ if (width > 0 && width !== previousWidth) {
10737
+ captureResizeAnchor(instance);
10738
+ if (previousWidth !== null) {
10739
+ pendingRect = rect;
10740
+ if (frame === void 0) frame = requestAnimationFrame(() => {
10741
+ frame = void 0;
10742
+ const nextRect = pendingRect;
10743
+ pendingRect = void 0;
10744
+ if (!instance.scrollElement?.clientHeight) return;
10745
+ measuredWidthRef.current = instance.scrollElement?.clientWidth ?? nextRect.width;
10746
+ if (resizeAnchorRef.current) resizeAnchorRef.current.ready = true;
10747
+ instance.getTotalSize();
10748
+ measuredRef.current = {
10749
+ total: 0,
10750
+ sizes: /* @__PURE__ */ new Map()
10751
+ };
10752
+ instance.elementsCache.forEach((element) => {
10753
+ measureRowElement(element, void 0, instance);
10754
+ });
10755
+ instance.measure();
10756
+ instance.getTotalSize();
10757
+ instance.elementsCache.forEach((element) => {
10758
+ instance.measureElement(element);
10759
+ });
10760
+ notify(nextRect);
10761
+ });
10762
+ return;
10763
+ }
10764
+ measuredWidthRef.current = width;
10765
+ }
10766
+ if (pendingRect) pendingRect = rect;
10767
+ else notify(rect);
10768
+ });
10769
+ return () => {
10770
+ disconnect?.();
10771
+ if (frame !== void 0) cancelAnimationFrame(frame);
10772
+ resizeAnchorRef.current = null;
10773
+ };
10774
+ }, [captureResizeAnchor, measureRowElement]);
10830
10775
  const virtualizer = useVirtualizer({
10831
10776
  count: shouldVirtualize ? rows.length : 0,
10832
10777
  getScrollElement: () => shouldVirtualize ? scrollElement : null,
10778
+ observeElementRect: observeScrollRect,
10833
10779
  estimateSize: estimateRowSize,
10834
10780
  overscan: 5,
10835
10781
  measureElement: measureRowElement,
@@ -10840,6 +10786,19 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10840
10786
  });
10841
10787
  isPinnedToBottomRef.current = isPinnedToBottom;
10842
10788
  virtualizer.shouldAdjustScrollPositionOnItemSizeChange = shouldAdjustScrollOnResize;
10789
+ useLayoutEffect(() => {
10790
+ const anchor = resizeAnchorRef.current;
10791
+ if (!anchor?.ready || restoringVisibilityRef.current) return;
10792
+ const position = virtualizer.getOffsetForIndex(anchor.index, "start");
10793
+ if (position && !isPinnedToBottomRef.current) {
10794
+ const target = position[0] + anchor.offset;
10795
+ if (Math.abs((scrollElement?.scrollTop ?? 0) - target) > .5) virtualizer.scrollToOffset(target);
10796
+ }
10797
+ const frame = requestAnimationFrame(() => {
10798
+ if (resizeAnchorRef.current === anchor) resizeAnchorRef.current = null;
10799
+ });
10800
+ return () => cancelAnimationFrame(frame);
10801
+ });
10843
10802
  const lastEndAlignedFirstMessageRef = React.useRef(void 0);
10844
10803
  useLayoutEffect(() => {
10845
10804
  if (!shouldVirtualize || !rows.length) return;
@@ -10948,22 +10907,33 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10948
10907
  const observer = new ResizeObserver(() => {
10949
10908
  if (element.clientHeight === 0) {
10950
10909
  suspended = true;
10910
+ restoringVisibilityRef.current = true;
10911
+ resizeAnchorRef.current = null;
10951
10912
  cancelAnimationFrame(frame);
10952
10913
  return;
10953
10914
  }
10954
10915
  if (!suspended || !anchor) {
10955
10916
  suspended = false;
10917
+ restoringVisibilityRef.current = false;
10956
10918
  remember();
10957
10919
  return;
10958
10920
  }
10921
+ cancelAnimationFrame(frame);
10959
10922
  let attempts = 0;
10960
10923
  let stableFrames = 0;
10961
10924
  const restore = () => {
10962
10925
  if (!anchor || element.clientHeight === 0) return;
10926
+ if (isPinnedToBottomRef.current) {
10927
+ anchor = null;
10928
+ suspended = false;
10929
+ restoringVisibilityRef.current = false;
10930
+ return;
10931
+ }
10963
10932
  const index = rowKeysRef.current.indexOf(anchor.key);
10964
10933
  if (index < 0) {
10965
10934
  anchor = null;
10966
10935
  suspended = false;
10936
+ restoringVisibilityRef.current = false;
10967
10937
  return;
10968
10938
  }
10969
10939
  const row = visibleRows().find((row) => row.dataset.scrollAnchor === anchor.key);
@@ -10979,6 +10949,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10979
10949
  if (++attempts < 60 && stableFrames < 3) frame = requestAnimationFrame(restore);
10980
10950
  else {
10981
10951
  suspended = false;
10952
+ restoringVisibilityRef.current = false;
10982
10953
  remember();
10983
10954
  }
10984
10955
  };
@@ -10988,6 +10959,8 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10988
10959
  cancelAnimationFrame(frame);
10989
10960
  anchor = null;
10990
10961
  suspended = false;
10962
+ restoringVisibilityRef.current = false;
10963
+ resizeAnchorRef.current = null;
10991
10964
  };
10992
10965
  element.addEventListener("scroll", remember, { passive: true });
10993
10966
  element.addEventListener("wheel", interrupt, { passive: true });
@@ -10998,6 +10971,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
10998
10971
  return () => {
10999
10972
  cancelAnimationFrame(frame);
11000
10973
  observer.disconnect();
10974
+ restoringVisibilityRef.current = false;
11001
10975
  element.removeEventListener("scroll", remember);
11002
10976
  element.removeEventListener("wheel", interrupt);
11003
10977
  element.removeEventListener("touchstart", interrupt);
@@ -11041,7 +11015,8 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
11041
11015
  shouldVirtualize ? /* @__PURE__ */ jsx("div", {
11042
11016
  style: {
11043
11017
  height: virtualizer.getTotalSize(),
11044
- position: "relative"
11018
+ position: "relative",
11019
+ overflowAnchor: "none"
11045
11020
  },
11046
11021
  children: virtualizer.getVirtualItems().map((virtualItem) => {
11047
11022
  const row = rows[virtualItem.index];
@@ -11400,6 +11375,7 @@ function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
11400
11375
  const lastNonceRef = useRef(-1);
11401
11376
  useEffect(() => {
11402
11377
  if (sendNonce === lastNonceRef.current) return;
11378
+ const previousNonce = lastNonceRef.current;
11403
11379
  lastNonceRef.current = sendNonce;
11404
11380
  if (!id) return;
11405
11381
  const scrollEl = scrollRef.current;
@@ -11415,7 +11391,9 @@ function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
11415
11391
  const bubbleHeight = Math.max(0, userMessageHeight - paddingTop);
11416
11392
  const spacerHeight = Math.max(0, viewportHeight - bubbleHeight - topOffset);
11417
11393
  spacerEl.style.height = `${spacerHeight}px`;
11394
+ let pinned = false;
11418
11395
  const raf = requestAnimationFrame(() => {
11396
+ pinned = true;
11419
11397
  const targetTop = computeOffsetTop(targetEl, scrollEl) + paddingTop - topOffset;
11420
11398
  scrollEl.scrollTo({
11421
11399
  top: Math.max(0, targetTop),
@@ -11432,6 +11410,7 @@ function usePinToSend({ scrollRef, contentRef, spacerRef, topOffset = 16 }) {
11432
11410
  return () => {
11433
11411
  cancelAnimationFrame(raf);
11434
11412
  ro.disconnect();
11413
+ if (!pinned) lastNonceRef.current = previousNonce;
11435
11414
  };
11436
11415
  }, [
11437
11416
  id,
@@ -11463,7 +11442,7 @@ function DropOverlay() {
11463
11442
  })
11464
11443
  });
11465
11444
  }
11466
- function CopilotChatView({ messageView, input, scrollView, suggestionView, welcomeScreen, messages = [], autoScroll = true, isRunning = false, suggestions, suggestionLoadingIndexes, onSelectSuggestion, onSubmitMessage, onStop, inputMode, inputValue, onInputChange, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, attachments, onRemoveAttachment, onAddFile, dragOver, onDragOver, onDragLeave, onDrop, isConnecting = false, hasExplicitThreadId = false, disclaimer, intelligenceIndicator, children, className, ...props }) {
11445
+ function CopilotChatView({ messageView, input, scrollView, suggestionView, welcomeScreen, messages = [], autoScroll = true, isRunning = false, suggestions, suggestionLoadingIndexes, onSelectSuggestion, onSubmitMessage, onStop, inputMode, inputValue, onInputChange, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, attachments, onRemoveAttachment, onAddFile, dragOver, onDragOver, onDragLeave, onDrop, isConnecting = false, connectingIndicator, hasExplicitThreadId = false, disclaimer, intelligenceIndicator, children, className, ...props }) {
11467
11446
  const configuredThreadId = useCopilotChatConfiguration()?.threadId;
11468
11447
  const [fallbackThreadId, setFallbackThreadId] = useState(messages[0]?.id);
11469
11448
  const previousMessageIds = useRef(/* @__PURE__ */ new Set());
@@ -11538,6 +11517,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11538
11517
  onSelectSuggestion,
11539
11518
  className: "cpk:mb-3 cpk:lg:ml-4 cpk:lg:mr-4 cpk:ml-0 cpk:mr-0"
11540
11519
  }) : null;
11520
+ const BoundConnectingIndicator = isConnecting && messages.length === 0 && connectingIndicator !== false ? renderSlot(connectingIndicator === true ? void 0 : connectingIndicator, CopilotChatView.ConnectingIndicator, {}) : null;
11541
11521
  const BoundScrollView = renderSlot(scrollView, CopilotChatView.ScrollView, {
11542
11522
  autoScroll,
11543
11523
  scrollThreadId,
@@ -11548,10 +11528,14 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11548
11528
  style: { paddingBottom: `${inputContainerHeight + (hasSuggestions ? 4 : 32)}px` },
11549
11529
  children: /* @__PURE__ */ jsxs("div", {
11550
11530
  className: "cpk:max-w-3xl cpk:mx-auto",
11551
- children: [BoundMessageView, hasSuggestions ? /* @__PURE__ */ jsx("div", {
11552
- className: "cpk:pl-0 cpk:pr-4 cpk:@3xl:px-0 cpk:mt-4",
11553
- children: BoundSuggestionView
11554
- }) : null]
11531
+ children: [
11532
+ BoundConnectingIndicator,
11533
+ BoundMessageView,
11534
+ hasSuggestions ? /* @__PURE__ */ jsx("div", {
11535
+ className: "cpk:pl-0 cpk:pr-4 cpk:@3xl:px-0 cpk:mt-4",
11536
+ children: BoundSuggestionView
11537
+ }) : null
11538
+ ]
11555
11539
  })
11556
11540
  })
11557
11541
  });
@@ -11589,6 +11573,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11589
11573
  "data-copilotkit": true,
11590
11574
  "data-testid": "copilot-chat",
11591
11575
  "data-copilot-running": isRunning ? "true" : "false",
11576
+ "data-copilot-connecting": isConnecting ? "true" : "false",
11592
11577
  onDragOver,
11593
11578
  onDragLeave,
11594
11579
  onDrop,
@@ -11599,6 +11584,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11599
11584
  }
11600
11585
  if (children) return /* @__PURE__ */ jsx("div", {
11601
11586
  "data-copilotkit": true,
11587
+ "data-copilot-connecting": isConnecting ? "true" : "false",
11602
11588
  style: { display: "contents" },
11603
11589
  children: children({
11604
11590
  messageView: BoundMessageView,
@@ -11611,6 +11597,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11611
11597
  "data-copilotkit": true,
11612
11598
  "data-testid": "copilot-chat",
11613
11599
  "data-copilot-running": isRunning ? "true" : "false",
11600
+ "data-copilot-connecting": isConnecting ? "true" : "false",
11614
11601
  onDragOver,
11615
11602
  onDragLeave,
11616
11603
  onDrop,
@@ -11826,13 +11813,15 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11826
11813
  if (mode === "pin-to-bottom") return;
11827
11814
  const scrollElement = nonAutoScrollEl;
11828
11815
  if (!scrollElement) return;
11816
+ const contentElement = contentRef.current;
11829
11817
  const checkScroll = () => {
11830
- setShowScrollButton(!(scrollElement.scrollHeight - scrollElement.scrollTop - scrollElement.clientHeight < 10));
11818
+ setShowScrollButton((contentElement ? contentElement.getBoundingClientRect().bottom - scrollElement.getBoundingClientRect().bottom : scrollElement.scrollHeight - scrollElement.scrollTop - scrollElement.clientHeight) >= 10);
11831
11819
  };
11832
11820
  checkScroll();
11833
11821
  scrollElement.addEventListener("scroll", checkScroll);
11834
11822
  const resizeObserver = new ResizeObserver(checkScroll);
11835
11823
  resizeObserver.observe(scrollElement);
11824
+ if (contentElement) resizeObserver.observe(contentElement);
11836
11825
  return () => {
11837
11826
  scrollElement.removeEventListener("scroll", checkScroll);
11838
11827
  resizeObserver.disconnect();
@@ -11915,6 +11904,22 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
11915
11904
  className,
11916
11905
  ...props
11917
11906
  });
11907
+ _CopilotChatView.ConnectingIndicator = ({ className, ...props }) => {
11908
+ const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
11909
+ return /* @__PURE__ */ jsxs("div", {
11910
+ "data-testid": "copilot-connecting-indicator",
11911
+ role: "status",
11912
+ className: cn("cpk:flex cpk:justify-center cpk:py-8", className),
11913
+ ...props,
11914
+ children: [/* @__PURE__ */ jsx(Loader2, {
11915
+ "aria-hidden": "true",
11916
+ className: "cpk:size-6 cpk:animate-spin cpk:text-muted-foreground"
11917
+ }), /* @__PURE__ */ jsx("span", {
11918
+ className: "cpk:sr-only",
11919
+ children: labels.chatConnectingLabel
11920
+ })]
11921
+ });
11922
+ };
11918
11923
  _CopilotChatView.WelcomeMessage = ({ className, ...props }) => {
11919
11924
  const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels;
11920
11925
  return /* @__PURE__ */ jsx("h1", {
@@ -16021,5 +16026,5 @@ function validateProps(props) {
16021
16026
  }
16022
16027
 
16023
16028
  //#endregion
16024
- export { INTERRUPT_EVENT_NAME as $, ɵphoenixSocket$ as $a, isAbortError as $i, MultiAgentCapabilitiesSchema as $n, TextMessageEndEventSchema as $r, AudioPartSchema as $t, CopilotChatMessageView as A, withAuthoritativeActivityTypes as Aa, createActionGroup as Ai, HttpAgent as An, RunHandler as Ar, ɵrunMcpFollowUp as At, CopilotChatReasoningMessage_default as B, ɵisHttpAgent$1 as Ba, emitInspectorViewThread as Bi, InputContentUrlSourceSchema as Bn, SubagentFinishedEventSchema as Br, AGUI_METADATA_KEY as Bt, CopilotModalHeader as C, splitA2UIMarkdown$1 as Ca, buildResumeArray as Ci, EventType as Cn, RunAgentInputSchema as Cr, OpenGenerativeUIContentSchema as Ct, CopilotChat as D, transformChunks as Da, contentHasMedia as Di, FilterToolCallsMiddleware as Dn, RunFinishedInterruptOutcomeSchema as Dr, MCPAppsActivityContentSchema as Dt, DefaultOpenIcon as E, tokenUsageFromLangChainMetadata as Ea, completePartialMarkdown as Ei, FileSourceSchema as En, RunFinishedEventSchema as Er, useSandboxFunctions as Et, getIntelligenceTurnAnchors as F, ɵTHREAD_REQUEST_TIMEOUT_MS as Fa, createSelector as Fi, ImageInputPartSchema as Fn, StateSchema as Fr, CopilotChatAudioRecorder as Ft, useLearningContainersInCurrentThread as G, ɵmemoryDomainEvents as Ga, ensureObjectArgs as Gi, JsonPointerSchema as Gn, SubagentRunIdSchema as Gr, AddOperationSchema as Gt, CopilotChatAttachmentRenderer as H, ɵjoinPhoenixChannel$ as Ha, empty as Hi, InterruptSchema as Hn, SubagentFinishedSuccessOutcomeSchema as Hr, ActivityDeltaEventSchema as Ht, IntelligenceIndicatorView as I, ɵcreateMemoryStore as Ia, createStore as Ii, ImagePartSchema as In, StateSnapshotEventSchema as Ir, A2UI_FENCE_LANGUAGE as It, useLearnFromUserActionInCurrentThread as J, ɵobservePhoenixEvent$ as Ja, extractStringField as Ji, MessageSchema as Jn, SystemMessageSchema as Jr, AgentThreadLockedError as Jt, useLearningContainers as K, ɵmemoryReducer as Ka, extractCompleteArrayItems as Ki, MEMORY_ERROR_REGISTRY as Kn, SubagentStartedEventSchema as Kr, AgentCapabilitiesSchema as Kt, CopilotChatWorkSummary as L, ɵcreateThreadSelectors as La, defaultApplyEvents as Li, InputContentDataSourceSchema as Ln, StepFinishedEventSchema as Lr, ACTIVITY_HISTORY_METADATA as Lt, messageRow as M, ɵInterruptState$1 as Ma, createEffect as Mi, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as Mn, StateCapabilitiesSchema as Mr, useRenderToolCall as Mt, INTELLIGENCE_TURN_HEAD as N, ɵMAX_SOCKET_RETRIES as Na, createInspectorThreadRequestId as Ni, IdentityCapabilitiesSchema as Nn, StateDeltaEventSchema as Nr, CopilotChatInput_default as Nt, CopilotChatView_default as O, transformHttpEventStream as Oa, contentToText$1 as Oi, FunctionCallSchema as On, RunFinishedOutcomeSchema as Or, MCPAppsActivityRenderer as Ot, IntelligenceIndicator as P, ɵRUNTIME_PROBE_TIMEOUT_MS as Pa, createReducer as Pi, ImageInputContentSchema as Pn, StateManager as Pr, AudioRecorderError as Pt, useInterrupt as Q, ɵphoenixChannel$ as Qa, getWebMCPModelContext as Qi, MoveOperationSchema as Qn, TextMessageContentEventSchema as Qr, AudioInputPartSchema as Qt, CopilotChatSuggestionView as R, ɵcreateThreadStore$1 as Ra, emitInspectorActiveThread$1 as Ri, InputContentSchema as Rn, StepStartedEventSchema as Rr, AGUIConnectNotImplementedError$1 as Rt, CopilotSidebarView as S, select as Sa, authoritativeActivityTypes as Si, EventSchemas as Sn, RoleSchema as Sr, OpenGenerativeUIActivityType as St, DefaultCloseIcon as T, tokenUsageFromAiSdkUsage as Ta, compactEvents as Ti, ExecutionCapabilitiesSchema as Tn, RunFinishedCancelledOutcomeSchema as Tr, SandboxFunctionsContext as Tt, CopilotChatAssistantMessage_default as U, ɵmapMemoryMetadataEvent as Ua, enforceEvents as Ui, JsonPatchOperationSchema as Un, SubagentFinishedSuspendedOutcomeSchema as Ur, ActivityMessageSchema as Ut, CopilotChatUserMessage_default as V, ɵisRetryableMemoryStatus as Va, emitInspectorViewThreadResult$1 as Vi, IntelligenceAgent as Vn, SubagentFinishedOutcomeSchema as Vr, AbstractAgent$1 as Vt, CopilotChatToolCallsView as W, ɵmemoryAdapterEvents as Wa, enforceOutgoingInput as Wi, JsonPatchSchema as Wn, SubagentInfoSchema as Wr, ActivitySnapshotEventSchema as Wt, useMemories as X, ɵobservePhoenixSocketHealth$ as Xa, getMarkdownOperationSurfaceId$1 as Xi, MetadataSchema as Xn, TextInputContentSchema as Xr, AttributableSchema as Xt, useLearnFromUserAction as Y, ɵobservePhoenixJoinOutcome$ as Ya, flattenInformationalCards$1 as Yi, MessagesSnapshotEventSchema as Yn, TestOperationSchema as Yr, AssistantMessageSchema as Yt, useThreads$1 as Z, ɵobservePhoenixSocketSignals$ as Za, getRunOutcome as Zi, Middleware as Zn, TextMessageChunkEventSchema as Zr, AudioInputContentSchema as Zt, WildcardToolCallRender as _, randomUUID$2 as _a, VideoInputContentSchema as _i, DeveloperMessageSchema as _n, ReasoningMessageStartEventSchema as _r, useLicenseContext$1 as _t, ThreadsProvider as a, ofType as aa, ToolCallChunkEventSchema as ai, CompatibilityBoundary as an, ɵselectMemoriesAvailable$1 as ao, PROTOCOL_VERSION as ar, useAgent as at, CopilotSidebar as b, runHttpRequest as ba, WebMCPRegistry as bi, DocumentPartSchema as bn, ReplaceOperationSchema as br, GenerateSandboxedUiArgsSchema as bt, CoAgentStateRendersProvider as c, onInspectorActiveThread as ca, ToolCallSchema as ci, ContextStore as cn, ɵselectMemoriesIsMutating as co, RawEventSchema as cr, CopilotChatToolCallGroup as ct, shouldShowDevConsole as d, onInspectorViewThreadResult as da, ToolMessageSchema as di, CopilotKitCoreRuntimeConnectionStatus$1 as dn, ɵselectThreadsError$1 as do, ReasoningEncryptedValueSubtypeSchema as dr, useFrontendTools as dt, isInspectorThreadBridgeEnabled$1 as ea, TextMessageRoleSchema as ei, BackwardCompatibility_0_0_39 as en, ɵselectFetchMoreError$1 as eo, MultimodalCapabilitiesSchema as er, useConfigureSuggestions as et, useToast as f, parseProtoStream as fa, ToolSchema as fi, CopilotKitHeaderResolutionError as fn, ɵselectThreadsIsLoading$1 as fo, ReasoningEndEventSchema as fr, useFrontendTool as ft, useCopilotContext as g, props as ga, UserMessageSchema as gi, DebugLogger as gn, ReasoningMessageSchema as gr, useCopilotKit$1 as gt, CopilotContext as h, prepareSurfaceOperations$1 as ha, UrlSourceSchema as hi, DataSourceSchema as hn, ReasoningMessageEndEventSchema as hr, CopilotKitProvider as ht, ThreadsContext as i, mergeMetadata as ia, ToolCallArgsEventSchema as ii, BaseMessageSchema as in, ɵselectMemories$1 as io, OutputCapabilitiesSchema as ir, UseAgentUpdate as it, messageGroup as j, ɵCOPILOTKIT_FEATURES as ja, createDebugLogger as ji, HumanInTheLoopCapabilitiesSchema as jn, RunStartedEventSchema as jr, CopilotKitInspector as jt, CopilotChatAttachmentQueue as k, verifyEvents as ka, convertToLegacyEvents as ki, FunctionMiddleware as kn, RunFinishedSuccessOutcomeSchema as kr, MCPAppsActivityType as kt, useCoAgentStateRenders as l, onInspectorStopViewing$1 as la, ToolCallStartEventSchema as li, CopilotKitCore$1 as ln, ɵselectMemoriesRealtimeStatus$1 as lo, ReasoningCapabilitiesSchema as lr, useRenderTool as lt, useCopilotMessagesContext as m, parseToolArguments as ma, TransportCapabilitiesSchema as mi, CustomEventSchema as mn, ɵwithHeaderDefaults$1 as mo, ReasoningMessageContentEventSchema as mr, useRenderCustomMessages as mt, defaultCopilotContextCategories as n, isRecognizedEvent as na, TextPartSchema as ni, BackwardCompatibility_0_0_57 as nn, ɵselectIsFetchingNextPage$1 as no, MultimodalOutputCapabilitiesSchema as nr, useAgentContext as nt, useThreads as o, omitOptionalNulls as oa, ToolCallEndEventSchema as oi, ContentPartSchema as on, ɵselectMemoriesError$1 as oo, PartSourceSchema as or, useHumanInTheLoop as ot, CopilotMessagesContext as p, parseSSEStream as pa, ToolsCapabilitiesSchema as pi, CopyOperationSchema as pn, ɵthreadAdapterEvents as po, ReasoningMessageChunkEventSchema as pr, useRenderActivityMessage as pt, useAttachments as q, ɵmemoryRestEvents as qa, extractFenceOperations$1 as qi, MemoryError as qn, SuggestionEngine as qr, AgentRegistry as qt, CoAgentStateRenderBridge as r, isRunCompletionAware$1 as ra, TokenUsageSchema as ri, BaseEventSchema as rn, ɵselectIsMutating$1 as ro, OptionalMetadataSchema as rr, useCapabilities as rt, CoAgentStateRendersContext as s, on as sa, ToolCallResultEventSchema as si, ContextSchema as sn, ɵselectMemoriesIsLoading$1 as so, ProxiedCopilotRuntimeAgent$1 as sr, useDefaultRenderTool as st, CopilotKit as t, isInterruptExpired as ta, TextMessageStartEventSchema as ti, BackwardCompatibility_0_0_45 as tn, ɵselectHasNextPage$1 as to, MultimodalInputCapabilitiesSchema as tr, useSuggestions as tt, useAsyncCallback as u, onInspectorViewThread$1 as ua, ToolCallStatus$1 as ui, CopilotKitCoreErrorCode$1 as un, ɵselectThreads$1 as uo, ReasoningEncryptedValueEventSchema as ur, useComponent as ut, CopilotThreadsDrawer as v, resolveAgentDebugConfig as va, VideoInputPartSchema as vi, DocumentInputContentSchema as vn, ReasoningStartEventSchema as vr, CopilotKitCoreReact as vt, CopilotChatToggleButton as w, structuredClone_ as wa, classifySurfaceCards as wi, EventTypeSchema as wn, RunErrorEventSchema as wr, OpenGenerativeUIToolRenderer as wt, CopilotPopupView as x, segmentSurfaceProse$1 as xa, aggregateTokenUsage as xi, EventSchema as xn, ResumeEntrySchema as xr, OpenGenerativeUIActivityRenderer as xt, CopilotPopup as y, resolveDebugLogger as ya, VideoPartSchema as yi, DocumentInputPartSchema as yn, RemoveOperationSchema as yr, createA2UIMessageRenderer as yt, CopilotChatSuggestionPill as z, ɵisCopilotKitFeature as za, emitInspectorStopViewing as zi, InputContentSourceSchema as zn, SubagentErrorEventSchema as zr, AGUIError as zt };
16025
- //# sourceMappingURL=copilotkit-DyxwF9wL.mjs.map
16029
+ export { INTERRUPT_EVENT_NAME as $, ɵobservePhoenixSocketSignals$ as $a, isAbortError as $i, MultiAgentCapabilitiesSchema as $n, TextMessageEndEventSchema as $r, AudioPartSchema as $t, CopilotChatMessageView as A, withAuthoritativeActivityTypes as Aa, createActionGroup as Ai, HttpAgent as An, RunHandler as Ar, ɵrunMcpFollowUp as At, CopilotChatReasoningMessage_default as B, ɵgetAgentInterruptState$1 as Ba, emitInspectorViewThread as Bi, InputContentUrlSourceSchema as Bn, SubagentFinishedEventSchema as Br, AGUI_METADATA_KEY as Bt, CopilotModalHeader as C, splitA2UIMarkdown$1 as Ca, buildResumeArray as Ci, EventType as Cn, RunAgentInputSchema as Cr, OpenGenerativeUIContentSchema as Ct, CopilotChat as D, transformChunks as Da, contentHasMedia as Di, FilterToolCallsMiddleware as Dn, RunFinishedInterruptOutcomeSchema as Dr, MCPAppsActivityContentSchema as Dt, DefaultOpenIcon as E, tokenUsageFromLangChainMetadata as Ea, completePartialMarkdown as Ei, FileSourceSchema as En, RunFinishedEventSchema as Er, useSandboxFunctions as Et, getIntelligenceTurnAnchors as F, ɵTHREAD_REQUEST_TIMEOUT_MS as Fa, createSelector as Fi, ImageInputPartSchema as Fn, StateSchema as Fr, CopilotChatAudioRecorder as Ft, useLearningContainersInCurrentThread as G, ɵmapMemoryMetadataEvent as Ga, ensureObjectArgs as Gi, JsonPointerSchema as Gn, SubagentRunIdSchema as Gr, AddOperationSchema as Gt, CopilotChatAttachmentRenderer as H, ɵisHttpAgent$1 as Ha, empty as Hi, InterruptSchema as Hn, SubagentFinishedSuccessOutcomeSchema as Hr, ActivityDeltaEventSchema as Ht, IntelligenceIndicatorView as I, ɵclearAgentInterruptState$1 as Ia, createStore as Ii, ImagePartSchema as In, StateSnapshotEventSchema as Ir, A2UI_FENCE_LANGUAGE as It, useLearnFromUserActionInCurrentThread as J, ɵmemoryReducer as Ja, extractStringField as Ji, MessageSchema as Jn, SystemMessageSchema as Jr, AgentThreadLockedError as Jt, useLearningContainers as K, ɵmemoryAdapterEvents as Ka, extractCompleteArrayItems as Ki, MEMORY_ERROR_REGISTRY as Kn, SubagentStartedEventSchema as Kr, AgentCapabilitiesSchema as Kt, CopilotChatWorkSummary as L, ɵcreateMemoryStore as La, defaultApplyEvents as Li, InputContentDataSourceSchema as Ln, StepFinishedEventSchema as Lr, ACTIVITY_HISTORY_METADATA as Lt, messageRow as M, ɵInterruptState$1 as Ma, createEffect as Mi, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as Mn, StateCapabilitiesSchema as Mr, useRenderToolCall as Mt, INTELLIGENCE_TURN_HEAD as N, ɵMAX_SOCKET_RETRIES as Na, createInspectorThreadRequestId as Ni, IdentityCapabilitiesSchema as Nn, StateDeltaEventSchema as Nr, CopilotChatInput_default as Nt, CopilotChatView_default as O, transformHttpEventStream as Oa, contentToText$1 as Oi, FunctionCallSchema as On, RunFinishedOutcomeSchema as Or, MCPAppsActivityRenderer as Ot, IntelligenceIndicator as P, ɵRUNTIME_PROBE_TIMEOUT_MS as Pa, createReducer as Pi, ImageInputContentSchema as Pn, StateManager as Pr, AudioRecorderError as Pt, useInterrupt as Q, ɵobservePhoenixSocketHealth$ as Qa, getWebMCPModelContext as Qi, MoveOperationSchema as Qn, TextMessageContentEventSchema as Qr, AudioInputPartSchema as Qt, CopilotChatSuggestionView as R, ɵcreateThreadSelectors as Ra, emitInspectorActiveThread$1 as Ri, InputContentSchema as Rn, StepStartedEventSchema as Rr, AGUIConnectNotImplementedError$1 as Rt, CopilotSidebarView as S, select as Sa, authoritativeActivityTypes as Si, EventSchemas as Sn, RoleSchema as Sr, OpenGenerativeUIActivityType as St, DefaultCloseIcon as T, tokenUsageFromAiSdkUsage as Ta, compactEvents as Ti, ExecutionCapabilitiesSchema as Tn, RunFinishedCancelledOutcomeSchema as Tr, SandboxFunctionsContext as Tt, CopilotChatAssistantMessage_default as U, ɵisRetryableMemoryStatus as Ua, enforceEvents as Ui, JsonPatchOperationSchema as Un, SubagentFinishedSuspendedOutcomeSchema as Ur, ActivityMessageSchema as Ut, CopilotChatUserMessage_default as V, ɵisCopilotKitFeature as Va, emitInspectorViewThreadResult$1 as Vi, IntelligenceAgent as Vn, SubagentFinishedOutcomeSchema as Vr, AbstractAgent$1 as Vt, CopilotChatToolCallsView as W, ɵjoinPhoenixChannel$ as Wa, enforceOutgoingInput as Wi, JsonPatchSchema as Wn, SubagentInfoSchema as Wr, ActivitySnapshotEventSchema as Wt, useMemories as X, ɵobservePhoenixEvent$ as Xa, getMarkdownOperationSurfaceId$1 as Xi, MetadataSchema as Xn, TextInputContentSchema as Xr, AttributableSchema as Xt, useLearnFromUserAction as Y, ɵmemoryRestEvents as Ya, flattenInformationalCards$1 as Yi, MessagesSnapshotEventSchema as Yn, TestOperationSchema as Yr, AssistantMessageSchema as Yt, useThreads$1 as Z, ɵobservePhoenixJoinOutcome$ as Za, getRunOutcome as Zi, Middleware as Zn, TextMessageChunkEventSchema as Zr, AudioInputContentSchema as Zt, WildcardToolCallRender as _, randomUUID$2 as _a, VideoInputContentSchema as _i, DeveloperMessageSchema as _n, ReasoningMessageStartEventSchema as _r, useLicenseContext$1 as _t, ThreadsProvider as a, ofType as aa, ToolCallChunkEventSchema as ai, CompatibilityBoundary as an, ɵselectIsMutating$1 as ao, PROTOCOL_VERSION as ar, useAgent as at, CopilotSidebar as b, runHttpRequest as ba, WebMCPRegistry as bi, DocumentPartSchema as bn, ReplaceOperationSchema as br, GenerateSandboxedUiArgsSchema as bt, CoAgentStateRendersProvider as c, onInspectorActiveThread as ca, ToolCallSchema as ci, ContextStore as cn, ɵselectMemoriesError$1 as co, RawEventSchema as cr, CopilotChatToolCallGroup as ct, shouldShowDevConsole as d, onInspectorViewThreadResult as da, ToolMessageSchema as di, CopilotKitCoreRuntimeConnectionStatus$1 as dn, ɵselectMemoriesRealtimeStatus$1 as do, ReasoningEncryptedValueSubtypeSchema as dr, useFrontendTools as dt, isInspectorThreadBridgeEnabled$1 as ea, TextMessageRoleSchema as ei, BackwardCompatibility_0_0_39 as en, ɵphoenixChannel$ as eo, MultimodalCapabilitiesSchema as er, useConfigureSuggestions as et, useToast as f, parseProtoStream as fa, ToolSchema as fi, CopilotKitHeaderResolutionError as fn, ɵselectThreads$1 as fo, ReasoningEndEventSchema as fr, useFrontendTool as ft, useCopilotContext as g, props as ga, UserMessageSchema as gi, DebugLogger as gn, ɵwithHeaderDefaults$1 as go, ReasoningMessageSchema as gr, useCopilotKit$1 as gt, CopilotContext as h, prepareSurfaceOperations$1 as ha, UrlSourceSchema as hi, DataSourceSchema as hn, ɵthreadAdapterEvents as ho, ReasoningMessageEndEventSchema as hr, CopilotKitProvider as ht, ThreadsContext as i, mergeMetadata as ia, ToolCallArgsEventSchema as ii, BaseMessageSchema as in, ɵselectIsFetchingNextPage$1 as io, OutputCapabilitiesSchema as ir, UseAgentUpdate as it, messageGroup as j, ɵCOPILOTKIT_FEATURES as ja, createDebugLogger as ji, HumanInTheLoopCapabilitiesSchema as jn, RunStartedEventSchema as jr, CopilotKitInspector as jt, CopilotChatAttachmentQueue as k, verifyEvents as ka, convertToLegacyEvents as ki, FunctionMiddleware as kn, RunFinishedSuccessOutcomeSchema as kr, MCPAppsActivityType as kt, useCoAgentStateRenders as l, onInspectorStopViewing$1 as la, ToolCallStartEventSchema as li, CopilotKitCore$1 as ln, ɵselectMemoriesIsLoading$1 as lo, ReasoningCapabilitiesSchema as lr, useRenderTool as lt, useCopilotMessagesContext as m, parseToolArguments as ma, TransportCapabilitiesSchema as mi, CustomEventSchema as mn, ɵselectThreadsIsLoading$1 as mo, ReasoningMessageContentEventSchema as mr, useRenderCustomMessages as mt, defaultCopilotContextCategories as n, isRecognizedEvent as na, TextPartSchema as ni, BackwardCompatibility_0_0_57 as nn, ɵselectFetchMoreError$1 as no, MultimodalOutputCapabilitiesSchema as nr, useAgentContext as nt, useThreads as o, omitOptionalNulls as oa, ToolCallEndEventSchema as oi, ContentPartSchema as on, ɵselectMemories$1 as oo, PartSourceSchema as or, useHumanInTheLoop as ot, CopilotMessagesContext as p, parseSSEStream as pa, ToolsCapabilitiesSchema as pi, CopyOperationSchema as pn, ɵselectThreadsError$1 as po, ReasoningMessageChunkEventSchema as pr, useRenderActivityMessage as pt, useAttachments as q, ɵmemoryDomainEvents as qa, extractFenceOperations$1 as qi, MemoryError as qn, SuggestionEngine as qr, AgentRegistry as qt, CoAgentStateRenderBridge as r, isRunCompletionAware$1 as ra, TokenUsageSchema as ri, BaseEventSchema as rn, ɵselectHasNextPage$1 as ro, OptionalMetadataSchema as rr, useCapabilities as rt, CoAgentStateRendersContext as s, on as sa, ToolCallResultEventSchema as si, ContextSchema as sn, ɵselectMemoriesAvailable$1 as so, ProxiedCopilotRuntimeAgent$1 as sr, useDefaultRenderTool as st, CopilotKit as t, isInterruptExpired as ta, TextMessageStartEventSchema as ti, BackwardCompatibility_0_0_45 as tn, ɵphoenixSocket$ as to, MultimodalInputCapabilitiesSchema as tr, useSuggestions as tt, useAsyncCallback as u, onInspectorViewThread$1 as ua, ToolCallStatus$1 as ui, CopilotKitCoreErrorCode$1 as un, ɵselectMemoriesIsMutating as uo, ReasoningEncryptedValueEventSchema as ur, useComponent as ut, CopilotThreadsDrawer as v, resolveAgentDebugConfig as va, VideoInputPartSchema as vi, DocumentInputContentSchema as vn, ReasoningStartEventSchema as vr, CopilotKitCoreReact as vt, CopilotChatToggleButton as w, structuredClone_ as wa, classifySurfaceCards as wi, EventTypeSchema as wn, RunErrorEventSchema as wr, OpenGenerativeUIToolRenderer as wt, CopilotPopupView as x, segmentSurfaceProse$1 as xa, aggregateTokenUsage as xi, EventSchema as xn, ResumeEntrySchema as xr, OpenGenerativeUIActivityRenderer as xt, CopilotPopup as y, resolveDebugLogger as ya, VideoPartSchema as yi, DocumentInputPartSchema as yn, RemoveOperationSchema as yr, createA2UIMessageRenderer as yt, CopilotChatSuggestionPill as z, ɵcreateThreadStore$1 as za, emitInspectorStopViewing as zi, InputContentSourceSchema as zn, SubagentErrorEventSchema as zr, AGUIError as zt };
16030
+ //# sourceMappingURL=copilotkit-BezhVj0g.mjs.map