@copilotkit/react-core 2.0.0-rc.26 → 2.0.0-rc.28
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/{MarkdownSurfaces-v9AplTEj.cjs → MarkdownSurfaces-BbrHcSHN.cjs} +2 -3
- package/dist/{MarkdownSurfaces-v9AplTEj.cjs.map → MarkdownSurfaces-BbrHcSHN.cjs.map} +1 -1
- package/dist/{MarkdownSurfaces-CD0FAiZq.mjs → MarkdownSurfaces-DQbRS91-.mjs} +2 -3
- package/dist/{MarkdownSurfaces-CD0FAiZq.mjs.map → MarkdownSurfaces-DQbRS91-.mjs.map} +1 -1
- package/dist/context.cjs +14 -1
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +12 -1
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.mts +12 -1
- package/dist/context.d.mts.map +1 -1
- package/dist/context.mjs +14 -1
- package/dist/context.mjs.map +1 -1
- package/dist/generative-ui.cjs +1 -1
- package/dist/generative-ui.mjs +1 -1
- package/dist/headless.cjs +11 -41
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.d.cts +18 -18
- package/dist/headless.d.cts.map +1 -1
- package/dist/headless.d.mts +6 -17
- package/dist/headless.d.mts.map +1 -1
- package/dist/headless.mjs +13 -43
- package/dist/headless.mjs.map +1 -1
- package/dist/index.cjs +513 -564
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -26
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +276 -567
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +514 -566
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { A as ExpressionError, B as renderSlot, C as issueKey, D as getMarkdownSurfaceSource, E as containsDynamicValue, F as toJsonSchema, G as CopilotIcon, H as CopilotChatConfigurationProvider, I as defineToolCallRenderer, J as StreamingMarkdownDefaultRenderer, L as MarkdownRendererProvider, M as catalogIdsOf, N as componentCatalogIds, R as useMarkdownRenderer, S as isAsyncIssue, T as withoutRejectedNulls, U as useCopilotChatConfiguration, V as ControlledModalOpenScope, W as useShallowStableRef, a as GenerativeUIToolCallRenderer, i as GenerativeUIChatSlotContext, j as GenerativeUIError, k as BASIC_FUNCTIONS, o as createGenerativeUIActivityRenderer, q as cn, s as createGenerativeUIFunctionCallActivityRenderer, t as MarkdownSurfaces, v as GenerativeUIRuntimeContext, w as validateSchemaSync, x as formatIssues, y as useGenerativeUIRuntime, z as isReactComponentType } from "./MarkdownSurfaces-
|
|
4
|
-
import { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotChatDefaultLabels, CopilotChatDefaultLabels as CopilotChatDefaultLabels$1, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreErrorCode as CopilotKitCoreErrorCode$1, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitHeaderResolutionError, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_TOOL_NAME, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTERRUPT_EVENT_NAME, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OPEN_GENERATIVE_UI_ACTIVITY_TYPE as OPEN_GENERATIVE_UI_ACTIVITY_TYPE$1, ProxiedCopilotRuntimeAgent, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, TranscriptionError, TranscriptionErrorCode, WebMCPRegistry, 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, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown, ɵA2UIActivityController, ɵA2UIActivityController as ɵA2UIActivityController$1, ɵA2UI_DEFAULT_SURFACE_ID, ɵA2UI_LIFECYCLE_TEXT, ɵA2UI_LIFECYCLE_TEXT as ɵA2UI_LIFECYCLE_TEXT$1, ɵA2UI_OPERATIONS_KEY, ɵA2UI_PAINT_FALLBACK_MS, ɵA2UI_RECOVERY_DEFAULTS, ɵA2UI_ROOT_COMPONENT_ID, ɵA2UI_SKELETON_ROWS, ɵA2UI_SKELETON_ROWS as ɵA2UI_SKELETON_ROWS$1, ɵA2UI_SURFACE_ACTIVITY_TYPE, ɵA2UI_SURFACE_ACTIVITY_TYPE as ɵA2UI_SURFACE_ACTIVITY_TYPE$1, ɵA2UI_SURFACE_CONTENT_SCHEMA, ɵA2UI_SURFACE_CONTENT_SCHEMA as ɵA2UI_SURFACE_CONTENT_SCHEMA$1, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAttachmentQueue as ɵAttachmentQueue$1, ɵAudioRecorder, ɵAudioRecorder as ɵAudioRecorder$1, ɵAudioRecorderError, ɵAudioRecorderError as AudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatSubmitter, ɵComposerAutosize, ɵCopyFeedback, ɵCopyFeedback as ɵCopyFeedback$1, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵFeedbackCommentController as ɵFeedbackCommentController$1, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA as ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA$1, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHoverMenuController as ɵHoverMenuController$1, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵINLINE_FEATURE_WARNING_STYLE as ɵINLINE_FEATURE_WARNING_STYLE$1, ɵInspectorThreadOverride, ɵInspectorThreadOverride as ɵInspectorThreadOverride$1, ɵInterruptController, ɵInterruptController as ɵInterruptController$1, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLICENSE_BANNER_STYLE as ɵLICENSE_BANNER_STYLE$1, ɵLearningAutoStarter, ɵLearningAutoStarter as ɵLearningAutoStarter$1, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH as ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH$1, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA as ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA$1, ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, ɵOpenGenerativeUIController, ɵOpenGenerativeUIController as ɵOpenGenerativeUIController$1, ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPOPUP_ANIMATION_MS as ɵPOPUP_ANIMATION_MS$1, ɵPlaceholderCycler, ɵPlaceholderCycler as ɵPlaceholderCycler$1, ɵRENDER_A2UI_TOOL_NAME, ɵRENDER_A2UI_TOOL_NAME as ɵRENDER_A2UI_TOOL_NAME$1, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵRendererRegistry, ɵRendererRegistry as ɵRendererRegistry$1, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSTABLE_ARRAY_WARNINGS, ɵSTABLE_ARRAY_WARNINGS as ɵSTABLE_ARRAY_WARNINGS$1, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵTOOL_CALL_STATUS_ICONS, ɵTOOL_CALL_STATUS_ICONS as ɵTOOL_CALL_STATUS_ICONS$1, ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTOOL_CALL_STATUS_LABEL_KEYS as ɵTOOL_CALL_STATUS_LABEL_KEYS$1, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadSwitchCoordinator as ɵThreadSwitchCoordinator$1, ɵThreadsController, ɵThreadsController as ɵThreadsController$1, ɵagentUpdateHandlers, ɵappendTranscript, ɵbindDialogFocus, ɵbindDialogFocus as ɵbindDialogFocus$1, ɵbindPopupDismiss, ɵbindPopupDismiss as ɵbindPopupDismiss$1, ɵbindSuggestionsConfig, ɵbindSuggestionsConfig as ɵbindSuggestionsConfig$1, ɵbuildHumanInTheLoopTool, ɵbuildHumanInTheLoopTool as ɵbuildHumanInTheLoopTool$1, ɵbuildLearnFromUserActionPayload, ɵbuildLearnFromUserActionPayload as ɵbuildLearnFromUserActionPayload$1, ɵbuildOpenGenerativeUIContexts, ɵbuildOpenGenerativeUIContexts as ɵbuildOpenGenerativeUIContexts$1, ɵbuildToolCallRenderProps, ɵbuildToolCallRenderProps as ɵbuildToolCallRenderProps$1, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵcanPreviewDocument as ɵcanPreviewDocument$1, ɵclampSlashIndex, ɵclampSlashIndex as ɵclampSlashIndex$1, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, ɵcn, ɵcomponentToolDescription, ɵcomponentToolDescription as ɵcomponentToolDescription$1, ɵcomposerButtonState, ɵcomposerButtonState as ɵcomposerButtonState$1, ɵcopilotIconSvgAttributes, ɵcopilotIcons, ɵcountFailedToolCalls, ɵcountFailedToolCalls as ɵcountFailedToolCalls$1, ɵcreateChatSubmitter, ɵcreateChatSubmitter as ɵcreateChatSubmitter$1, ɵcreateComposerAutosize, ɵcreateComposerAutosize as ɵcreateComposerAutosize$1, ɵcreateDockedSidebar, ɵcreateDockedSidebar as ɵcreateDockedSidebar$1, ɵcreateLastUserMessageTracker, ɵcreateLastUserMessageTracker as ɵcreateLastUserMessageTracker$1, ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateMessageViewModel as ɵcreateMessageViewModel$1, ɵcreateObjectUrlFromSource, ɵcreateObjectUrlFromSource as ɵcreateObjectUrlFromSource$1, ɵcreateOpenGenerativeUITool, ɵcreateOpenGenerativeUITool as ɵcreateOpenGenerativeUITool$1, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵcreateThreadsDrawerActions, ɵcreateThreadsDrawerActions as ɵcreateThreadsDrawerActions$1, ɵcreateWaveformRenderer, ɵcreateWaveformRenderer as ɵcreateWaveformRenderer$1, ɵdecodeTextSource, ɵdecodeTextSource as ɵdecodeTextSource$1, ɵdeduplicateMessages, ɵdeduplicateMessages as ɵdeduplicateMessages$1, ɵdescribeActivityRendererFailure, ɵdescribeActivityRendererFailure as ɵdescribeActivityRendererFailure$1, ɵdescribeUnrenderedToolCalls, ɵdescribeUnrenderedToolCalls as ɵdescribeUnrenderedToolCalls$1, ɵdiagnoseMissingSurface, ɵdiagnoseUnpaintedSurface, ɵdiagnoseUnresolvedRoot, ɵdimensionToCss, ɵdimensionToCss as ɵdimensionToCss$1, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, ɵduplicateMessagesWarning as ɵduplicateMessagesWarning$1, ɵextractCompleteStyles, ɵfilterCommands, ɵfilterCommands as ɵfilterCommands$1, ɵfindActivityRenderer, ɵfindActivityRenderer as ɵfindActivityRenderer$1, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenCommandItems as ɵflattenCommandItems$1, ɵflattenUserMessageContent, ɵflattenUserMessageContent as ɵflattenUserMessageContent$1, ɵformatA2UIDebugPayload, ɵformatA2UIRetryLabel, ɵformatCountLabel, ɵformatCountLabel as ɵformatCountLabel$1, ɵformatLabel, ɵformatLabel as ɵformatLabel$1, ɵformatReasoningDuration, ɵformatReasoningDurationLabel, ɵformatReasoningDurationLabel as ɵformatReasoningDurationLabel$1, ɵformatToolNames, ɵformatToolNames as ɵformatToolNames$1, ɵformatWorkDuration, ɵgetA2UIOperationSurfaceId, ɵgetA2UIOperations, ɵgetA2UIProgressPhase, ɵgetAgentCapabilities, ɵgetAgentCapabilities as ɵgetAgentCapabilities$1, ɵgetAgentInterruptState, ɵgetAgentResolver, ɵgetAgentResolver as ɵgetAgentResolver$1, ɵgetArgumentPreview, ɵgetArgumentPreview as ɵgetArgumentPreview$1, ɵgetBranchNavState, ɵgetBranchNavState as ɵgetBranchNavState$1, ɵgetChatViewState, ɵgetChatViewState as ɵgetChatViewState$1, ɵgetCustomMessageRenderProps, ɵgetCustomMessageRenderProps as ɵgetCustomMessageRenderProps$1, ɵgetInlineFeatureWarningSpec, ɵgetInlineFeatureWarningSpec as ɵgetInlineFeatureWarningSpec$1, ɵgetLastUserMessageId, ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetLicenseBannerSpec as ɵgetLicenseBannerSpec$1, ɵgetMessageFeedback, ɵgetMessageFeedback as ɵgetMessageFeedback$1, ɵgetMessageFeedbackControls, ɵgetMessageFeedbackControls as ɵgetMessageFeedbackControls$1, ɵgetThreadsDrawerElementProps, ɵgetThreadsDrawerElementProps as ɵgetThreadsDrawerElementProps$1, ɵgetToolCallBadge, ɵgetToolCallBadge as ɵgetToolCallBadge$1, ɵgetToolCallGroupState, ɵgetToolCallGroupState as ɵgetToolCallGroupState$1, ɵgetToolCallLayouts, ɵgetToolCallLayouts as ɵgetToolCallLayouts$1, ɵgetToolCallPreview, ɵgetToolCallRendererNames, ɵgetToolCallRendererNames as ɵgetToolCallRendererNames$1, ɵgetToolCallRowStatus, ɵgetToolCallStatus, ɵgetToolResults, ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaFilename as ɵgetUserMessageMediaFilename$1, ɵgetUserMessageMediaParts, ɵgetUserMessageMediaParts as ɵgetUserMessageMediaParts$1, ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵgetWorkSummaryText as ɵgetWorkSummaryText$1, ɵgroupA2UIOperationsBySurface, ɵgroupA2UIOperationsBySurface as ɵgroupA2UIOperationsBySurface$1, ɵhasAssistantMessageText, ɵhasAssistantMessageText as ɵhasAssistantMessageText$1, ɵhitlRenderProps, ɵhitlRenderProps as ɵhitlRenderProps$1, ɵinitialKeyboardState, ɵinitialKeyboardState as ɵinitialKeyboardState$1, ɵinspectorKiteFill, ɵinspectorKiteFill as ɵinspectorKiteFill$1, ɵinspectorKiteIcon, ɵinspectorKiteIcon as ɵinspectorKiteIcon$1, ɵinspectorShortcuts, ɵinspectorShortcuts as ɵinspectorShortcuts$1, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisHttpAgent as ɵisHttpAgent$1, ɵisLearningFeedbackEnabled, ɵisLearningFeedbackEnabled as ɵisLearningFeedbackEnabled$1, ɵisMobileViewport, ɵisOpenGenerativeUIActive, ɵisOpenGenerativeUIActive as ɵisOpenGenerativeUIActive$1, ɵisRetryableMemoryStatus, ɵisScrolledToBottom, ɵisTurnWorkOpen, ɵisTurnWorking, ɵjoinPhoenixChannel$, ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmatchActivityRenderer as ɵmatchActivityRenderer$1, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmessagesFingerprint as ɵmessagesFingerprint$1, ɵmorphViewTransition, ɵmorphViewTransition as ɵmorphViewTransition$1, ɵnextSlashIndex, ɵnormalizeAutoScroll, ɵnormalizeAutoScroll as ɵnormalizeAutoScroll$1, ɵnormalizeToolCallStatus, ɵnormalizeToolCallStatus as ɵnormalizeToolCallStatus$1, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseSlashQuery as ɵparseSlashQuery$1, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, ɵpinMessageToTop as ɵpinMessageToTop$1, ɵpluralize, ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, ɵpublicKeyHeaderDefaults as ɵpublicKeyHeaderDefaults$1, ɵreadA2UILifecycle, ɵreadKeyboardState, ɵrecordAnnotation, ɵrecordAnnotation as ɵrecordAnnotation$1, ɵrecordWorkTime, ɵreportProviderConfigDiagnostics, ɵreportProviderConfigDiagnostics as ɵreportProviderConfigDiagnostics$1, ɵreserveLicenseBannerOffset, ɵreserveLicenseBannerOffset as ɵreserveLicenseBannerOffset$1, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveA2UIDebugExposure, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentId as ɵresolveAgentId$1, ɵresolveAgentThreadId, ɵresolveAgentThreadId as ɵresolveAgentThreadId$1, ɵresolveChatNotice, ɵresolveChatNotice as ɵresolveChatNotice$1, ɵresolveComposerKey, ɵresolveComposerKey as ɵresolveComposerKey$1, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderContext as ɵresolveCustomMessageRenderContext$1, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveLicenseState as ɵresolveLicenseState$1, ɵresolveProviderConfig, ɵresolveProviderConfig as ɵresolveProviderConfig$1, ɵresolveSlashKey, ɵresolveSlashKey as ɵresolveSlashKey$1, ɵresolveThreadsLicense, ɵresolveThreadsLicense as ɵresolveThreadsLicense$1, ɵresolveToolCallAgentId, ɵresolveToolCallAgentId as ɵresolveToolCallAgentId$1, ɵresolveToolCallRenderer, ɵresolveToolCallRenderer as ɵresolveToolCallRenderer$1, ɵrmsAmplitude, ɵrunA2UIAction, ɵrunA2UIAction as ɵrunA2UIAction$1, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵ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, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵserializeContextValue as ɵserializeContextValue$1, ɵsetMessageFeedback, ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowAssistantToolbar as ɵshouldShowAssistantToolbar$1, ɵshouldShowMessageCursor, ɵsnapshotAgentState, ɵstopAgentWithFallback, ɵstringifyToolCallAttr, ɵstringifyToolCallAttr as ɵstringifyToolCallAttr$1, ɵstringifyToolCallPayload, ɵstringifyToolCallPayload as ɵstringifyToolCallPayload$1, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentSuggestions as ɵsubscribeToAgentSuggestions$1, ɵsubscribeToAgentUpdates, ɵsubscribeToAgentUpdates as ɵsubscribeToAgentUpdates$1, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToLearningFeedbackEnabled as ɵsubscribeToLearningFeedbackEnabled$1, ɵsubscribeToMessageFeedback, ɵsubscribeToMessageFeedback as ɵsubscribeToMessageFeedback$1, ɵsurfaceHasRenderableContent, ɵthreadAdapterEvents, ɵtoA2UIClientEvent, ɵtoA2UIClientEvent as ɵtoA2UIClientEvent$1, ɵtoDrawerThread, ɵtoDrawerThread as ɵtoDrawerThread$1, ɵtoLearningConfig, ɵtoLearningConfig as ɵtoLearningConfig$1, ɵtoolCallAppearance, ɵtoolCallAppearance as ɵtoolCallAppearance$1, ɵtoolRendererShapeChanged, ɵtoolRendererShapeChanged as ɵtoolRendererShapeChanged$1, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵvalidateAgentBinding as ɵvalidateAgentBinding$1, ɵwaitForActiveRun, ɵwatchKeyboardState, ɵwatchKeyboardState as ɵwatchKeyboardState$1, ɵwatchMobileViewport, ɵwatchMobileViewport as ɵwatchMobileViewport$1, ɵwithHeaderDefaults, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core";
|
|
3
|
+
import { A as ExpressionError, B as renderSlot, C as issueKey, D as getMarkdownSurfaceSource, E as containsDynamicValue, F as toJsonSchema, G as CopilotIcon, H as CopilotChatConfigurationProvider, I as defineToolCallRenderer, J as StreamingMarkdownDefaultRenderer, L as MarkdownRendererProvider, M as catalogIdsOf, N as componentCatalogIds, R as useMarkdownRenderer, S as isAsyncIssue, T as withoutRejectedNulls, U as useCopilotChatConfiguration, V as ControlledModalOpenScope, W as useShallowStableRef, a as GenerativeUIToolCallRenderer, i as GenerativeUIChatSlotContext, j as GenerativeUIError, k as BASIC_FUNCTIONS, o as createGenerativeUIActivityRenderer, q as cn, s as createGenerativeUIFunctionCallActivityRenderer, t as MarkdownSurfaces, v as GenerativeUIRuntimeContext, w as validateSchemaSync, x as formatIssues, y as useGenerativeUIRuntime, z as isReactComponentType } from "./MarkdownSurfaces-DQbRS91-.mjs";
|
|
4
|
+
import { A2UI_FENCE_LANGUAGE, AgentRegistry, AgentThreadLockedError, ContextStore, CopilotChatDefaultLabels, CopilotChatDefaultLabels as CopilotChatDefaultLabels$1, CopilotKitCore, CopilotKitCore as CopilotKitCore$1, CopilotKitCoreErrorCode, CopilotKitCoreRuntimeConnectionStatus, CopilotKitCoreRuntimeConnectionStatus as CopilotKitCoreRuntimeConnectionStatus$1, CopilotKitHeaderResolutionError, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, GENERATE_SANDBOXED_UI_TOOL_NAME, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTERRUPT_EVENT_NAME, IntelligenceAgent, MEMORY_ERROR_REGISTRY, MemoryError, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OPEN_GENERATIVE_UI_ACTIVITY_TYPE as OPEN_GENERATIVE_UI_ACTIVITY_TYPE$1, ProxiedCopilotRuntimeAgent, RunHandler, StateManager, SuggestionEngine, ToolCallStatus, ToolCallStatus as ToolCallStatus$1, TranscriptionError, TranscriptionErrorCode, WebMCPRegistry, 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, parseToolArguments, prepareSurfaceOperations, props, segmentSurfaceProse, select, splitA2UIMarkdown, ɵA2UIActivityController, ɵA2UIActivityController as ɵA2UIActivityController$1, ɵA2UI_DEFAULT_SURFACE_ID, ɵA2UI_LIFECYCLE_TEXT, ɵA2UI_LIFECYCLE_TEXT as ɵA2UI_LIFECYCLE_TEXT$1, ɵA2UI_OPERATIONS_KEY, ɵA2UI_PAINT_FALLBACK_MS, ɵA2UI_RECOVERY_DEFAULTS, ɵA2UI_ROOT_COMPONENT_ID, ɵA2UI_SKELETON_ROWS, ɵA2UI_SKELETON_ROWS as ɵA2UI_SKELETON_ROWS$1, ɵA2UI_SURFACE_ACTIVITY_TYPE, ɵA2UI_SURFACE_ACTIVITY_TYPE as ɵA2UI_SURFACE_ACTIVITY_TYPE$1, ɵA2UI_SURFACE_CONTENT_SCHEMA, ɵA2UI_SURFACE_CONTENT_SCHEMA as ɵA2UI_SURFACE_CONTENT_SCHEMA$1, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAttachmentQueue as ɵAttachmentQueue$1, ɵAudioRecorder, ɵAudioRecorder as ɵAudioRecorder$1, ɵAudioRecorderError, ɵAudioRecorderError as AudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatConnection, ɵChatConnection as ɵChatConnection$1, ɵChatSubmitter, ɵComposerAutosize, ɵComposerController, ɵComposerController as ɵComposerController$1, ɵCopyFeedback, ɵCopyFeedback as ɵCopyFeedback$1, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵExitPresence, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵFeedbackCommentController as ɵFeedbackCommentController$1, ɵFreshThreadId, ɵFreshThreadId as ɵFreshThreadId$1, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA as ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA$1, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHoverMenuController as ɵHoverMenuController$1, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵINLINE_FEATURE_WARNING_STYLE as ɵINLINE_FEATURE_WARNING_STYLE$1, ɵInspectorThreadOverride, ɵInspectorThreadOverride as ɵInspectorThreadOverride$1, ɵInterruptController, ɵInterruptController as ɵInterruptController$1, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLICENSE_BANNER_STYLE as ɵLICENSE_BANNER_STYLE$1, ɵLearningAutoStarter, ɵLearningAutoStarter as ɵLearningAutoStarter$1, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH as ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH$1, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA as ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA$1, ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, ɵOpenGenerativeUIController, ɵOpenGenerativeUIController as ɵOpenGenerativeUIController$1, ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPOPUP_DEFAULT_HEIGHT, ɵPOPUP_DEFAULT_HEIGHT as ɵPOPUP_DEFAULT_HEIGHT$1, ɵPOPUP_DEFAULT_WIDTH, ɵPOPUP_DEFAULT_WIDTH as ɵPOPUP_DEFAULT_WIDTH$1, ɵPlaceholderCycler, ɵPlaceholderCycler as ɵPlaceholderCycler$1, ɵRENDER_A2UI_TOOL_NAME, ɵRENDER_A2UI_TOOL_NAME as ɵRENDER_A2UI_TOOL_NAME$1, ɵRESIZE_SETTLE_MS, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵReasoningDisclosure, ɵReasoningDisclosure as ɵReasoningDisclosure$1, ɵRendererRegistry, ɵRendererRegistry as ɵRendererRegistry$1, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSIDEBAR_DEFAULT_WIDTH, ɵSIDEBAR_DEFAULT_WIDTH as ɵSIDEBAR_DEFAULT_WIDTH$1, ɵSIDEBAR_TRANSITION_MS, ɵSIDEBAR_TRANSITION_MS as ɵSIDEBAR_TRANSITION_MS$1, ɵSTABLE_ARRAY_WARNINGS, ɵStickToBottom, ɵTAB_STOP_SELECTOR, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵTOOL_CALL_STATUS_ICONS, ɵTOOL_CALL_STATUS_ICONS as ɵTOOL_CALL_STATUS_ICONS$1, ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTOOL_CALL_STATUS_LABEL_KEYS as ɵTOOL_CALL_STATUS_LABEL_KEYS$1, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadsController, ɵThreadsController as ɵThreadsController$1, ɵadaptDefaultToolCallRenderProps, ɵadaptDefaultToolCallRenderProps as ɵadaptDefaultToolCallRenderProps$1, ɵaddOpenGenerativeUIContexts, ɵaddOpenGenerativeUIContexts as ɵaddOpenGenerativeUIContexts$1, ɵagentUpdateHandlers, ɵappendTranscript, ɵassembleActivityRenderers, ɵassembleActivityRenderers as ɵassembleActivityRenderers$1, ɵassembleHumanInTheLoop, ɵassembleHumanInTheLoop as ɵassembleHumanInTheLoop$1, ɵassembleProviderRegistry, ɵassembleProviderToolRenderers, ɵassembleProviderToolRenderers as ɵassembleProviderToolRenderers$1, ɵassembleProviderTools, ɵassembleProviderTools as ɵassembleProviderTools$1, ɵbindDialogFocus, ɵbindDialogFocus as ɵbindDialogFocus$1, ɵbindPopupDismiss, ɵbindPopupDismiss as ɵbindPopupDismiss$1, ɵbindSuggestionsConfig, ɵbindSuggestionsConfig as ɵbindSuggestionsConfig$1, ɵbuildHumanInTheLoopTool, ɵbuildHumanInTheLoopTool as ɵbuildHumanInTheLoopTool$1, ɵbuildLearnFromUserActionPayload, ɵbuildLearnFromUserActionPayload as ɵbuildLearnFromUserActionPayload$1, ɵbuildOpenGenerativeUIContexts, ɵbuildToolCallRenderProps, ɵbuildToolCallRenderProps as ɵbuildToolCallRenderProps$1, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵcanPreviewDocument as ɵcanPreviewDocument$1, ɵclampSlashIndex, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, ɵcn, ɵcomponentToolDescription, ɵcomponentToolDescription as ɵcomponentToolDescription$1, ɵcomposerButtonState, ɵcomposerButtonState as ɵcomposerButtonState$1, ɵcopilotIconSvgAttributes, ɵcopilotIcons, ɵcountFailedToolCalls, ɵcountFailedToolCalls as ɵcountFailedToolCalls$1, ɵcreateChatSubmitter, ɵcreateChatSubmitter as ɵcreateChatSubmitter$1, ɵcreateComposerAutosize, ɵcreateComposerAutosize as ɵcreateComposerAutosize$1, ɵcreateDockedSidebar, ɵcreateDockedSidebar as ɵcreateDockedSidebar$1, ɵcreateExitPresence, ɵcreateExitPresence as ɵcreateExitPresence$1, ɵcreateLastUserMessageTracker, ɵcreateLastUserMessageTracker as ɵcreateLastUserMessageTracker$1, ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateMessageViewModel as ɵcreateMessageViewModel$1, ɵcreateObjectUrlFromSource, ɵcreateObjectUrlFromSource as ɵcreateObjectUrlFromSource$1, ɵcreateOpenGenerativeUITool, ɵcreateOpenGenerativeUITool as ɵcreateOpenGenerativeUITool$1, ɵcreateStickToBottom, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadStore as ɵcreateThreadStore$1, ɵcreateThreadsDrawerActions, ɵcreateThreadsDrawerActions as ɵcreateThreadsDrawerActions$1, ɵcreateWaveformRenderer, ɵcreateWaveformRenderer as ɵcreateWaveformRenderer$1, ɵdecodeTextSource, ɵdecodeTextSource as ɵdecodeTextSource$1, ɵdeduplicateMessages, ɵdeduplicateMessages as ɵdeduplicateMessages$1, ɵdescribeActivityRendererFailure, ɵdescribeActivityRendererFailure as ɵdescribeActivityRendererFailure$1, ɵdescribeUnrenderedToolCalls, ɵdescribeUnrenderedToolCalls as ɵdescribeUnrenderedToolCalls$1, ɵdiagnoseMissingSurface, ɵdiagnoseUnpaintedSurface, ɵdiagnoseUnresolvedRoot, ɵdimensionToCss, ɵdimensionToCss as ɵdimensionToCss$1, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, ɵduplicateMessagesWarning as ɵduplicateMessagesWarning$1, ɵextractCompleteStyles, ɵfilterCommands, ɵfindActivityRenderer, ɵfindActivityRenderer as ɵfindActivityRenderer$1, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenToolsMenuForDisplay, ɵflattenUserMessageContent, ɵflattenUserMessageContent as ɵflattenUserMessageContent$1, ɵformatA2UIDebugPayload, ɵformatA2UIRetryLabel, ɵformatCountLabel, ɵformatCountLabel as ɵformatCountLabel$1, ɵformatLabel, ɵformatLabel as ɵformatLabel$1, ɵformatReasoningDuration, ɵformatReasoningDurationLabel, ɵformatToolNames, ɵformatToolNames as ɵformatToolNames$1, ɵformatWorkDuration, ɵgetA2UIOperationSurfaceId, ɵgetA2UIOperations, ɵgetA2UIProgressPhase, ɵgetAgentCapabilities, ɵgetAgentCapabilities as ɵgetAgentCapabilities$1, ɵgetAgentInterruptState, ɵgetAgentResolver, ɵgetAgentResolver as ɵgetAgentResolver$1, ɵgetArgumentPreview, ɵgetArgumentPreview as ɵgetArgumentPreview$1, ɵgetBranchNavState, ɵgetBranchNavState as ɵgetBranchNavState$1, ɵgetChatViewState, ɵgetChatViewState as ɵgetChatViewState$1, ɵgetCustomMessageRenderProps, ɵgetCustomMessageRenderProps as ɵgetCustomMessageRenderProps$1, ɵgetInlineFeatureWarningSpec, ɵgetInlineFeatureWarningSpec as ɵgetInlineFeatureWarningSpec$1, ɵgetLastUserMessageId, ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetLicenseBannerSpec as ɵgetLicenseBannerSpec$1, ɵgetMessageFeedback, ɵgetMessageFeedback as ɵgetMessageFeedback$1, ɵgetMessageFeedbackControls, ɵgetMessageFeedbackControls as ɵgetMessageFeedbackControls$1, ɵgetMessageRunStateSnapshot, ɵgetMessageRunStateSnapshot as ɵgetMessageRunStateSnapshot$1, ɵgetReasoningHeaderLabel, ɵgetReasoningHeaderLabel as ɵgetReasoningHeaderLabel$1, ɵgetThreadsDrawerElementProps, ɵgetThreadsDrawerElementProps as ɵgetThreadsDrawerElementProps$1, ɵgetToolCallBadge, ɵgetToolCallBadge as ɵgetToolCallBadge$1, ɵgetToolCallGroupState, ɵgetToolCallGroupState as ɵgetToolCallGroupState$1, ɵgetToolCallLayouts, ɵgetToolCallLayouts as ɵgetToolCallLayouts$1, ɵgetToolCallPreview, ɵgetToolCallRendererNames, ɵgetToolCallRendererNames as ɵgetToolCallRendererNames$1, ɵgetToolCallRowStatus, ɵgetToolCallStatus, ɵgetToolResults, ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaFilename as ɵgetUserMessageMediaFilename$1, ɵgetUserMessageMediaParts, ɵgetUserMessageMediaParts as ɵgetUserMessageMediaParts$1, ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵgetWorkSummaryText as ɵgetWorkSummaryText$1, ɵgroupA2UIOperationsBySurface, ɵgroupA2UIOperationsBySurface as ɵgroupA2UIOperationsBySurface$1, ɵhasAssistantMessageText, ɵhasAssistantMessageText as ɵhasAssistantMessageText$1, ɵhitlRenderProps, ɵhitlRenderProps as ɵhitlRenderProps$1, ɵimplementsConnect, ɵinitialKeyboardState, ɵinitialKeyboardState as ɵinitialKeyboardState$1, ɵinspectorKiteFill, ɵinspectorKiteFill as ɵinspectorKiteFill$1, ɵinspectorKiteIcon, ɵinspectorKiteIcon as ɵinspectorKiteIcon$1, ɵinspectorShortcuts, ɵinspectorShortcuts as ɵinspectorShortcuts$1, ɵisContentPart, ɵisContentScrolledToBottom, ɵisContentScrolledToBottom as ɵisContentScrolledToBottom$1, ɵisCopilotKitFeature, ɵisFocusVisible, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisLearningFeedbackEnabled as ɵisLearningFeedbackEnabled$1, ɵisMobileViewport, ɵisOpenGenerativeUIActive, ɵisOpenGenerativeUIActive as ɵisOpenGenerativeUIActive$1, ɵisOwnFeedbackThumb, ɵisOwnFeedbackThumb as ɵisOwnFeedbackThumb$1, ɵisRetryableMemoryStatus, ɵisScrolledToBottom, ɵisScrolledToBottom as ɵisScrolledToBottom$1, ɵisTurnWorkOpen, ɵisTurnWorking, ɵjoinPhoenixChannel$, ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmatchActivityRenderer as ɵmatchActivityRenderer$1, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmessagesFingerprint as ɵmessagesFingerprint$1, ɵmorphViewTransition, ɵmorphViewTransition as ɵmorphViewTransition$1, ɵnextSlashIndex, ɵnextTabStop, ɵnormalizeAutoScroll, ɵnormalizeAutoScroll as ɵnormalizeAutoScroll$1, ɵnormalizeToolCallStatus, ɵnormalizeToolCallStatus as ɵnormalizeToolCallStatus$1, ɵnormalizeToolsMenu, ɵnormalizeToolsMenu as ɵnormalizeToolsMenu$1, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, ɵpinMessageToTop as ɵpinMessageToTop$1, ɵpluralize, ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, ɵpublicKeyHeaderDefaults as ɵpublicKeyHeaderDefaults$1, ɵreadA2UILifecycle, ɵreadKeyboardState, ɵrecordAnnotation, ɵrecordAnnotation as ɵrecordAnnotation$1, ɵrecordWorkTime, ɵregisterFrontendTools, ɵregisterFrontendTools as ɵregisterFrontendTools$1, ɵreportProviderConfigDiagnostics, ɵreportProviderConfigDiagnostics as ɵreportProviderConfigDiagnostics$1, ɵreserveLicenseBannerOffset, ɵreserveLicenseBannerOffset as ɵreserveLicenseBannerOffset$1, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveA2UIActivation, ɵresolveA2UIActivation as ɵresolveA2UIActivation$1, ɵresolveA2UIDebugExposure, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentId as ɵresolveAgentId$1, ɵresolveAgentThreadId, ɵresolveAgentThreadId as ɵresolveAgentThreadId$1, ɵresolveChatNotice, ɵresolveChatNotice as ɵresolveChatNotice$1, ɵresolveComposerKey, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderContext as ɵresolveCustomMessageRenderContext$1, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveLicenseState as ɵresolveLicenseState$1, ɵresolveProviderConfig, ɵresolveProviderConfig as ɵresolveProviderConfig$1, ɵresolveSlashKey, ɵresolveThreadsLicense, ɵresolveThreadsLicense as ɵresolveThreadsLicense$1, ɵresolveToolCallAgentId, ɵresolveToolCallAgentId as ɵresolveToolCallAgentId$1, ɵresolveToolCallRenderer, ɵresolveToolCallRenderer as ɵresolveToolCallRenderer$1, ɵrmsAmplitude, ɵrunA2UIAction, ɵrunA2UIAction as ɵrunA2UIAction$1, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵ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, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵserializeContextValue as ɵserializeContextValue$1, ɵsetMessageFeedback, ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowAssistantToolbar as ɵshouldShowAssistantToolbar$1, ɵshouldShowMessageCursor, ɵshowsComposerDisclaimer, ɵshowsComposerDisclaimer as ɵshowsComposerDisclaimer$1, ɵsnapshotAgentState, ɵstableArrayPropWarning, ɵstableArrayPropWarning as ɵstableArrayPropWarning$1, ɵstopAgentWithFallback, ɵstringifyToolCallAttr, ɵstringifyToolCallAttr as ɵstringifyToolCallAttr$1, ɵstringifyToolCallPayload, ɵstringifyToolCallPayload as ɵstringifyToolCallPayload$1, ɵsubscribeToAgentErrors, ɵsubscribeToAgentErrors as ɵsubscribeToAgentErrors$1, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentSuggestions as ɵsubscribeToAgentSuggestions$1, ɵsubscribeToAgentUpdates, ɵsubscribeToAgentUpdates as ɵsubscribeToAgentUpdates$1, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToLearningFeedbackEnabled as ɵsubscribeToLearningFeedbackEnabled$1, ɵsubscribeToMessageFeedback, ɵsubscribeToMessageFeedback as ɵsubscribeToMessageFeedback$1, ɵsurfaceHasRenderableContent, ɵsyncRecorderToMode, ɵsyncRecorderToMode as ɵsyncRecorderToMode$1, ɵthreadAdapterEvents, ɵtoA2UIClientEvent, ɵtoA2UIClientEvent as ɵtoA2UIClientEvent$1, ɵtoDefaultToolCallStatus, ɵtoDrawerThread, ɵtoDrawerThread as ɵtoDrawerThread$1, ɵtoLearningConfig, ɵtoLearningConfig as ɵtoLearningConfig$1, ɵtoolCallAppearance, ɵtoolCallAppearance as ɵtoolCallAppearance$1, ɵtoolRendererShapeChanged, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵvalidateAgentBinding as ɵvalidateAgentBinding$1, ɵwaitForActiveRun, ɵwatchElementHeight, ɵwatchElementHeight as ɵwatchElementHeight$1, ɵwatchElementWidth, ɵwatchElementWidth as ɵwatchElementWidth$1, ɵwatchKeyboardState, ɵwatchKeyboardState as ɵwatchKeyboardState$1, ɵwatchMobileViewport, ɵwatchMobileViewport as ɵwatchMobileViewport$1, ɵwithHeaderDefaults, ɵwithHeaderDefaults as ɵwithHeaderDefaults$1 } from "@copilotkit/core";
|
|
5
5
|
import { ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError, AGUIError, AGUI_METADATA_KEY, AbstractAgent, 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, 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";
|
|
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 * as React$1 from "react";
|
|
@@ -10,7 +10,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
import { CopilotKitAgentIdContext, CopilotKitContext, LicenseContext, useCopilotKit, useCopilotKit as useCopilotKit$1, useDefaultAgentId, useLicenseContext, useLicenseContext as useLicenseContext$1 } from "@copilotkit/react-core/context";
|
|
11
11
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
12
12
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
13
|
-
import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, DEFAULT_AGENT_ID, 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, applyDescriptionOverrides, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, commitRowKeyStore, copyToClipboard, createRowKeyStore, defaultGenerativeUIPromptSpec, envelopeToManifest, formatFileSize, functionCallers, generativeUIGuideFeatures, getDocumentIcon, getOperationKind, getOperationSurfaceId, getSourceUrl, randomUUID as randomUUID$1, renderGenerativeUISchema, resolveRowRenderKeysById, shouldEnableInspector, toA2UIActionMessage, validateOperation
|
|
13
|
+
import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, DEFAULT_AGENT_ID, 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, applyDescriptionOverrides, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, commitRowKeyStore, copyToClipboard, createRowKeyStore, defaultGenerativeUIPromptSpec, envelopeToManifest, formatFileSize, functionCallers, generativeUIGuideFeatures, getDocumentIcon, getOperationKind, getOperationSurfaceId, getSourceUrl, randomUUID as randomUUID$1, renderGenerativeUISchema, resolveRowRenderKeysById, shouldEnableInspector, toA2UIActionMessage, validateOperation } from "@copilotkit/shared";
|
|
14
14
|
import { ɵmountInspector } from "@copilotkit/web-inspector/mount";
|
|
15
15
|
import { MCPAppsActivityContentSchema, MCPAppsActivityType, ɵMcpAppHost, ɵrunMcpFollowUp } from "@copilotkit/mcp-apps-renderer/activity";
|
|
16
16
|
import { A2UIProvider, A2UIRenderer, Catalog, basicCatalog, defaultTheme as a2uiDefaultTheme, filterCatalog, initializeDefaultCatalog, injectStyles, useA2UIActions, useA2UIError, viewerTheme } from "@copilotkit/a2ui-renderer";
|
|
@@ -25,6 +25,22 @@ import { observeElementRect, useVirtualizer } from "@tanstack/react-virtual";
|
|
|
25
25
|
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
26
26
|
import { COPILOTKIT_THREADS_DRAWER_TAG, defineCopilotKitThreadsDrawer } from "@copilotkit/web-components/threads-drawer";
|
|
27
27
|
|
|
28
|
+
//#region src/lib/use-latest-ref.ts
|
|
29
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
30
|
+
/**
|
|
31
|
+
* A ref that holds the latest `value`, for callbacks that run after render
|
|
32
|
+
* (event handlers, controller callbacks). The ref changes in a layout effect,
|
|
33
|
+
* not during render, so a render that React throws away leaves it alone.
|
|
34
|
+
*/
|
|
35
|
+
function useLatestRef(value) {
|
|
36
|
+
const ref = useRef(value);
|
|
37
|
+
useIsomorphicLayoutEffect(() => {
|
|
38
|
+
ref.current = value;
|
|
39
|
+
});
|
|
40
|
+
return ref;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
28
44
|
//#region src/components/ui/button.tsx
|
|
29
45
|
const variantClasses = {
|
|
30
46
|
default: "cpk-button-default",
|
|
@@ -219,14 +235,6 @@ const SLASH_MENU_ITEM_HEIGHT_PX = 40;
|
|
|
219
235
|
* starts with "/".
|
|
220
236
|
*/
|
|
221
237
|
function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning = false, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onFinishTranscribeWithAudio, onAddFile, onChange, value, toolsMenu, autoFocus = false, positioning = "static", keyboardHeight = 0, containerRef, showDisclaimer, bottomAnchored = false, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addMenuButton, audioRecorder, disclaimer, children, className, ...props }) {
|
|
222
|
-
const isControlled = value !== void 0;
|
|
223
|
-
const [internalValue, setInternalValue] = useState(() => value ?? "");
|
|
224
|
-
useEffect(() => {
|
|
225
|
-
if (!isControlled && value !== void 0) setInternalValue(value);
|
|
226
|
-
}, [isControlled, value]);
|
|
227
|
-
const resolvedValue = isControlled ? value ?? "" : internalValue;
|
|
228
|
-
const [commandQuery, setCommandQuery] = useState(null);
|
|
229
|
-
const [slashHighlightIndex, setSlashHighlightIndex] = useState(0);
|
|
230
238
|
const inputRef = useRef(null);
|
|
231
239
|
const gridRef = useRef(null);
|
|
232
240
|
const addButtonContainerRef = useRef(null);
|
|
@@ -244,18 +252,33 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
244
252
|
const layout = useSyncExternalStore(autosize.subscribe, autosize.getSnapshot, autosize.getSnapshot);
|
|
245
253
|
const isExpanded = mode === "input" && layout === "expanded";
|
|
246
254
|
const previousModalStateRef = useRef(void 0);
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
const onChangeRef = useLatestRef(onChange);
|
|
256
|
+
const [composer] = useState(() => new ɵComposerController$1({
|
|
257
|
+
initialValue: value ?? "",
|
|
258
|
+
onChange: (next) => onChangeRef.current?.(next)
|
|
259
|
+
}));
|
|
260
|
+
const { value: composerValue, slashQuery: commandQuery, slashCommands: filteredCommands, slashHighlightIndex } = useSyncExternalStore(composer.subscribe, composer.getSnapshot, composer.getSnapshot);
|
|
261
|
+
const resolvedValue = value ?? composerValue;
|
|
262
|
+
const menu = useMemo(() => ɵnormalizeToolsMenu$1(toolsMenu, onAddFile ? {
|
|
263
|
+
label: labels.chatInputToolbarAddButtonLabel,
|
|
264
|
+
action: onAddFile
|
|
265
|
+
} : void 0), [
|
|
254
266
|
labels.chatInputToolbarAddButtonLabel,
|
|
255
267
|
onAddFile,
|
|
256
268
|
toolsMenu
|
|
257
269
|
]);
|
|
258
|
-
|
|
270
|
+
useLayoutEffect(() => {
|
|
271
|
+
composer.setInputs({
|
|
272
|
+
value,
|
|
273
|
+
mode,
|
|
274
|
+
menu
|
|
275
|
+
});
|
|
276
|
+
}, [
|
|
277
|
+
composer,
|
|
278
|
+
value,
|
|
279
|
+
mode,
|
|
280
|
+
menu
|
|
281
|
+
]);
|
|
259
282
|
useEffect(() => {
|
|
260
283
|
if (!autoFocus) {
|
|
261
284
|
previousModalStateRef.current = config?.isModalOpen;
|
|
@@ -264,48 +287,18 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
264
287
|
if (config?.isModalOpen && !previousModalStateRef.current) inputRef.current?.focus({ preventScroll: true });
|
|
265
288
|
previousModalStateRef.current = config?.isModalOpen;
|
|
266
289
|
}, [config?.isModalOpen, autoFocus]);
|
|
267
|
-
const previousCommandQueryRef = useRef(null);
|
|
268
290
|
useEffect(() => {
|
|
269
|
-
|
|
270
|
-
previousCommandQueryRef.current = commandQuery;
|
|
271
|
-
}, [commandQuery, filteredCommands.length]);
|
|
272
|
-
useEffect(() => {
|
|
273
|
-
setSlashHighlightIndex((index) => commandQuery === null ? 0 : ɵclampSlashIndex$1(index, filteredCommands.length));
|
|
274
|
-
}, [commandQuery, filteredCommands]);
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
const recorder = audioRecorderRef.current;
|
|
277
|
-
if (!recorder) return;
|
|
278
|
-
if (mode === "transcribe") recorder.start().catch(console.error);
|
|
279
|
-
else if (recorder.state === "recording") recorder.stop().catch(console.error);
|
|
291
|
+
ɵsyncRecorderToMode$1(audioRecorderRef.current, mode);
|
|
280
292
|
}, [mode]);
|
|
281
|
-
useEffect(() => {
|
|
282
|
-
if (mode !== "input") setCommandQuery(null);
|
|
283
|
-
}, [mode]);
|
|
284
|
-
const updateSlashState = useCallback((value) => {
|
|
285
|
-
setCommandQuery(ɵparseSlashQuery$1(value, commandItems.length > 0));
|
|
286
|
-
}, [commandItems.length]);
|
|
287
|
-
useEffect(() => {
|
|
288
|
-
updateSlashState(resolvedValue);
|
|
289
|
-
}, [resolvedValue, updateSlashState]);
|
|
290
293
|
const handleChange = (e) => {
|
|
291
|
-
|
|
292
|
-
if (!isControlled) setInternalValue(nextValue);
|
|
293
|
-
onChange?.(nextValue);
|
|
294
|
-
updateSlashState(nextValue);
|
|
294
|
+
composer.setValue(e.target.value);
|
|
295
295
|
};
|
|
296
|
-
const clearInputValue = useCallback(() => {
|
|
297
|
-
if (!isControlled) setInternalValue("");
|
|
298
|
-
if (onChange) onChange("");
|
|
299
|
-
}, [isControlled, onChange]);
|
|
300
296
|
const runCommand = useCallback((item) => {
|
|
301
|
-
|
|
302
|
-
item.action?.();
|
|
303
|
-
setCommandQuery(null);
|
|
304
|
-
setSlashHighlightIndex(0);
|
|
297
|
+
composer.runCommand(item);
|
|
305
298
|
requestAnimationFrame(() => {
|
|
306
299
|
inputRef.current?.focus();
|
|
307
300
|
});
|
|
308
|
-
}, [
|
|
301
|
+
}, [composer]);
|
|
309
302
|
const composerInput = {
|
|
310
303
|
mode,
|
|
311
304
|
isRunning,
|
|
@@ -315,43 +308,22 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
315
308
|
};
|
|
316
309
|
const { isProcessing, action: buttonAction, disabled: buttonDisabled } = ɵcomposerButtonState$1(composerInput);
|
|
317
310
|
const handleKeyDown = (e) => {
|
|
318
|
-
|
|
319
|
-
const slash = ɵresolveSlashKey$1(e, {
|
|
320
|
-
query: mode === "input" ? commandQuery : null,
|
|
321
|
-
commands: filteredCommands,
|
|
322
|
-
highlightIndex: slashHighlightIndex
|
|
323
|
-
});
|
|
324
|
-
if (slash.type !== "none") e.preventDefault();
|
|
325
|
-
switch (slash.type) {
|
|
326
|
-
case "highlight":
|
|
327
|
-
setSlashHighlightIndex(slash.index);
|
|
328
|
-
return;
|
|
329
|
-
case "run":
|
|
330
|
-
runCommand(slash.command);
|
|
331
|
-
return;
|
|
332
|
-
case "close":
|
|
333
|
-
setCommandQuery(null);
|
|
334
|
-
return;
|
|
335
|
-
case "none": break;
|
|
336
|
-
}
|
|
337
|
-
if (e.key === "Enter" && !e.shiftKey) e.preventDefault();
|
|
338
|
-
const action = ɵresolveComposerKey$1({
|
|
311
|
+
const { preventDefault, action } = composer.keyDown({
|
|
339
312
|
key: e.key,
|
|
340
313
|
shiftKey: e.shiftKey,
|
|
341
314
|
isComposing: e.nativeEvent.isComposing,
|
|
342
315
|
keyCode: e.keyCode
|
|
343
316
|
}, composerInput);
|
|
344
|
-
if (
|
|
317
|
+
if (preventDefault) e.preventDefault();
|
|
318
|
+
if (action === "command") requestAnimationFrame(() => {
|
|
319
|
+
inputRef.current?.focus();
|
|
320
|
+
});
|
|
321
|
+
else if (action === "stop") onStop?.();
|
|
345
322
|
else if (action === "send") send();
|
|
346
323
|
};
|
|
347
324
|
const send = () => {
|
|
348
325
|
if (!onSubmitMessage) return;
|
|
349
|
-
|
|
350
|
-
if (!trimmed) return;
|
|
351
|
-
onSubmitMessage(trimmed);
|
|
352
|
-
if (!isControlled) setInternalValue("");
|
|
353
|
-
onChange?.("");
|
|
354
|
-
if (inputRef.current) inputRef.current.focus();
|
|
326
|
+
if (composer.submit(onSubmitMessage, { value: resolvedValue })) inputRef.current?.focus();
|
|
355
327
|
};
|
|
356
328
|
const BoundTextArea = renderSlot(textArea, CopilotChatInput.TextArea, {
|
|
357
329
|
ref: inputRef,
|
|
@@ -398,7 +370,10 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
398
370
|
toolsMenu
|
|
399
371
|
});
|
|
400
372
|
const BoundDisclaimer = renderSlot(disclaimer, CopilotChatInput.Disclaimer, {});
|
|
401
|
-
const shouldShowDisclaimer =
|
|
373
|
+
const shouldShowDisclaimer = ɵshowsComposerDisclaimer$1({
|
|
374
|
+
showDisclaimer,
|
|
375
|
+
positioning
|
|
376
|
+
});
|
|
402
377
|
const handleContainerClick = (e) => {
|
|
403
378
|
const target = e.target;
|
|
404
379
|
if (target.tagName !== "BUTTON" && !target.closest("button") && inputRef.current && mode === "input") inputRef.current.focus();
|
|
@@ -411,7 +386,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
411
386
|
mode
|
|
412
387
|
]);
|
|
413
388
|
useEffect(() => () => autosize.dispose(), [autosize]);
|
|
414
|
-
const slashMenuVisible = commandQuery !== null
|
|
389
|
+
const slashMenuVisible = commandQuery !== null;
|
|
415
390
|
useEffect(() => {
|
|
416
391
|
if (!slashMenuVisible || slashHighlightIndex < 0) return;
|
|
417
392
|
(slashMenuRef.current?.querySelector(`[data-slash-index="${slashHighlightIndex}"]`))?.scrollIntoView({ block: "nearest" });
|
|
@@ -435,7 +410,7 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
435
410
|
"data-active": isActive ? "true" : void 0,
|
|
436
411
|
"data-slash-index": index,
|
|
437
412
|
className: "cpk-chat-input-slash-menu-item",
|
|
438
|
-
onMouseEnter: () =>
|
|
413
|
+
onMouseEnter: () => composer.highlight(index),
|
|
439
414
|
onMouseDown: (event) => {
|
|
440
415
|
event.preventDefault();
|
|
441
416
|
runCommand(item);
|
|
@@ -596,22 +571,10 @@ function CopilotChatInput({ mode = "input", onSubmitMessage, onStop, isRunning =
|
|
|
596
571
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels$1;
|
|
597
572
|
const [mounted, setMounted] = useState(false);
|
|
598
573
|
useEffect(() => setMounted(true), []);
|
|
599
|
-
const menuItems = useMemo(() => {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
action: onAddFile
|
|
604
|
-
});
|
|
605
|
-
if (toolsMenu && toolsMenu.length > 0) {
|
|
606
|
-
if (items.length > 0) items.push("-");
|
|
607
|
-
for (const item of toolsMenu) if (item === "-") {
|
|
608
|
-
if (items.length === 0 || items[items.length - 1] === "-") continue;
|
|
609
|
-
items.push(item);
|
|
610
|
-
} else items.push(item);
|
|
611
|
-
while (items.length > 0 && items[items.length - 1] === "-") items.pop();
|
|
612
|
-
}
|
|
613
|
-
return items;
|
|
614
|
-
}, [
|
|
574
|
+
const menuItems = useMemo(() => ɵnormalizeToolsMenu$1(toolsMenu, onAddFile ? {
|
|
575
|
+
label: labels.chatInputToolbarAddButtonLabel,
|
|
576
|
+
action: onAddFile
|
|
577
|
+
} : void 0), [
|
|
615
578
|
onAddFile,
|
|
616
579
|
toolsMenu,
|
|
617
580
|
labels.chatInputToolbarAddButtonLabel
|
|
@@ -855,7 +818,7 @@ function ɵuseOwnedCore(ref, create) {
|
|
|
855
818
|
|
|
856
819
|
//#endregion
|
|
857
820
|
//#region package.json
|
|
858
|
-
var version$1 = "2.0.0-rc.
|
|
821
|
+
var version$1 = "2.0.0-rc.28";
|
|
859
822
|
|
|
860
823
|
//#endregion
|
|
861
824
|
//#region src/components/CopilotKitInspector.tsx
|
|
@@ -1485,8 +1448,9 @@ function SurfaceMessageProcessor({ operations, onRendered }) {
|
|
|
1485
1448
|
* duplicate skeleton on retries / multi-call generations and a skeleton that
|
|
1486
1449
|
* lingered after the surface painted — both fixed by retiring it here.
|
|
1487
1450
|
*
|
|
1488
|
-
*
|
|
1489
|
-
* (
|
|
1451
|
+
* It is a built-in renderer, so a `renderToolCalls` entry or a
|
|
1452
|
+
* `useRenderTool({ name: "render_a2ui" })` hook replaces it, and it never
|
|
1453
|
+
* removes the app's renderers. It is removed when A2UI turns off.
|
|
1490
1454
|
*/
|
|
1491
1455
|
function A2UIBuiltInToolCallRenderer() {
|
|
1492
1456
|
const { copilotkit } = useCopilotKit();
|
|
@@ -1496,8 +1460,7 @@ function A2UIBuiltInToolCallRenderer() {
|
|
|
1496
1460
|
args: z.any(),
|
|
1497
1461
|
render: () => /* @__PURE__ */ jsx(Fragment$1, {})
|
|
1498
1462
|
});
|
|
1499
|
-
|
|
1500
|
-
copilotkit.setRenderToolCalls([...existing.filter((rc) => rc.name !== ɵRENDER_A2UI_TOOL_NAME$1), renderer]);
|
|
1463
|
+
return copilotkit.ɵaddBuiltInRenderToolCall(renderer);
|
|
1501
1464
|
}, [copilotkit]);
|
|
1502
1465
|
return null;
|
|
1503
1466
|
}
|
|
@@ -3238,7 +3201,10 @@ var CopilotKitCoreReact = class extends CopilotKitCore$1 {
|
|
|
3238
3201
|
get renderActivityMessages() {
|
|
3239
3202
|
return this._renderers.activity;
|
|
3240
3203
|
}
|
|
3241
|
-
/**
|
|
3204
|
+
/**
|
|
3205
|
+
* Prop, hook and built-in renderers merged. For one name and agentId, a
|
|
3206
|
+
* hook renderer wins over a prop one, and both win over a built-in one.
|
|
3207
|
+
*/
|
|
3242
3208
|
get renderToolCalls() {
|
|
3243
3209
|
return this._renderers.toolCalls;
|
|
3244
3210
|
}
|
|
@@ -3257,6 +3223,16 @@ var CopilotKitCoreReact = class extends CopilotKitCore$1 {
|
|
|
3257
3223
|
removeHookRenderToolCall(name, agentId) {
|
|
3258
3224
|
this._renderers.removeHookToolCall(name, agentId);
|
|
3259
3225
|
}
|
|
3226
|
+
/**
|
|
3227
|
+
* @internal Add a renderer for a tool a built-in feature owns (A2UI,
|
|
3228
|
+
* generative UI). Prop and hook renderers with the same name and agent win
|
|
3229
|
+
* over it, and `setRenderToolCalls` never removes it.
|
|
3230
|
+
*
|
|
3231
|
+
* @returns A function that removes the renderer.
|
|
3232
|
+
*/
|
|
3233
|
+
ɵaddBuiltInRenderToolCall(entry) {
|
|
3234
|
+
return this._renderers.addBuiltInToolCall(entry);
|
|
3235
|
+
}
|
|
3260
3236
|
notifyRenderersChanged(kind) {
|
|
3261
3237
|
this.notifySubscribers((subscriber) => {
|
|
3262
3238
|
const reactSubscriber = subscriber;
|
|
@@ -3334,13 +3310,14 @@ const SameOriginMCPAppsActivityRenderer = (props) => /* @__PURE__ */ jsx(MCPApps
|
|
|
3334
3310
|
...props,
|
|
3335
3311
|
allowSameOriginFallback: true
|
|
3336
3312
|
});
|
|
3337
|
-
function useStableArrayProp(prop,
|
|
3313
|
+
function useStableArrayProp(prop, name) {
|
|
3338
3314
|
const empty = useMemo(() => [], []);
|
|
3339
3315
|
const value = prop ?? empty;
|
|
3340
3316
|
const initial = useRef(value);
|
|
3341
3317
|
useEffect(() => {
|
|
3342
|
-
|
|
3343
|
-
|
|
3318
|
+
const warning = ɵstableArrayPropWarning$1(name, initial.current, value);
|
|
3319
|
+
if (warning) console.error(warning);
|
|
3320
|
+
}, [value, name]);
|
|
3344
3321
|
return value;
|
|
3345
3322
|
}
|
|
3346
3323
|
/** Provide a shared core instance and synchronize runtime, tool, and UI configuration. */
|
|
@@ -3365,8 +3342,10 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3365
3342
|
runtimeEnabled: runtimeOpenGenUIEnabled,
|
|
3366
3343
|
configured: !!openGenerativeUI
|
|
3367
3344
|
});
|
|
3368
|
-
const
|
|
3369
|
-
|
|
3345
|
+
const a2uiActive = ɵresolveA2UIActivation$1({
|
|
3346
|
+
runtimeEnabled: runtimeA2UIEnabled,
|
|
3347
|
+
hasCatalog: !!a2ui?.catalog
|
|
3348
|
+
}).active;
|
|
3370
3349
|
const generativeUIActive = !!generativeUI?.ui;
|
|
3371
3350
|
const runtimeLicenseStatus = runtimeInfo?.licenseStatus;
|
|
3372
3351
|
const runtimeEntitlements = runtimeInfo?.runtimeEntitlements;
|
|
@@ -3384,9 +3363,9 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3384
3363
|
inspectorVisible,
|
|
3385
3364
|
requestInspectorOpen
|
|
3386
3365
|
]);
|
|
3387
|
-
const renderToolCallsList = useStableArrayProp(renderToolCalls,
|
|
3388
|
-
const renderCustomMessagesList = useStableArrayProp(renderCustomMessages,
|
|
3389
|
-
const renderActivityMessagesList = useStableArrayProp(renderActivityMessages,
|
|
3366
|
+
const renderToolCallsList = useStableArrayProp(renderToolCalls, "renderToolCalls");
|
|
3367
|
+
const renderCustomMessagesList = useStableArrayProp(renderCustomMessages, "renderCustomMessages");
|
|
3368
|
+
const renderActivityMessagesList = useStableArrayProp(renderActivityMessages, "renderActivityMessages");
|
|
3390
3369
|
const copilotkitRef = useRef(null);
|
|
3391
3370
|
const rawCatalog = a2ui?.catalog;
|
|
3392
3371
|
const filteredCatalog = useMemo(() => {
|
|
@@ -3396,27 +3375,31 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3396
3375
|
return filterCatalog(rawCatalog, (name) => core ? core.isCatalogComponentEnabled(name) : true);
|
|
3397
3376
|
}, [rawCatalog, catalogToggleVersion]);
|
|
3398
3377
|
const mcpAppsAllowSameOrigin = mcpApps?.allowSameOriginFallback === true;
|
|
3399
|
-
const
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
content: MCPAppsActivityContentSchema,
|
|
3403
|
-
render: mcpAppsAllowSameOrigin ? SameOriginMCPAppsActivityRenderer : MCPAppsActivityRenderer
|
|
3404
|
-
}];
|
|
3405
|
-
if (openGenUIActive) renderers.push({
|
|
3406
|
-
activityType: OpenGenerativeUIActivityType,
|
|
3407
|
-
content: OpenGenerativeUIContentSchema,
|
|
3408
|
-
render: OpenGenerativeUIActivityRenderer
|
|
3409
|
-
});
|
|
3410
|
-
if (a2uiActive) renderers.unshift(createA2UIMessageRenderer({
|
|
3378
|
+
const allActivityRenderers = useMemo(() => ɵassembleActivityRenderers$1({
|
|
3379
|
+
app: renderActivityMessagesList,
|
|
3380
|
+
a2ui: a2uiActive ? createA2UIMessageRenderer({
|
|
3411
3381
|
theme: a2ui?.theme ?? viewerTheme,
|
|
3412
3382
|
catalog: filteredCatalog,
|
|
3413
3383
|
loadingComponent: a2ui?.loadingComponent,
|
|
3414
3384
|
recovery: a2ui?.recovery,
|
|
3415
3385
|
onAction: a2ui?.onAction
|
|
3416
|
-
})
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3386
|
+
}) : void 0,
|
|
3387
|
+
builtIns: [
|
|
3388
|
+
{
|
|
3389
|
+
activityType: MCPAppsActivityType,
|
|
3390
|
+
content: MCPAppsActivityContentSchema,
|
|
3391
|
+
render: mcpAppsAllowSameOrigin ? SameOriginMCPAppsActivityRenderer : MCPAppsActivityRenderer
|
|
3392
|
+
},
|
|
3393
|
+
openGenUIActive && {
|
|
3394
|
+
activityType: OpenGenerativeUIActivityType,
|
|
3395
|
+
content: OpenGenerativeUIContentSchema,
|
|
3396
|
+
render: OpenGenerativeUIActivityRenderer
|
|
3397
|
+
},
|
|
3398
|
+
generativeUIActive && createGenerativeUIActivityRenderer(),
|
|
3399
|
+
generativeUIActive && createGenerativeUIFunctionCallActivityRenderer()
|
|
3400
|
+
]
|
|
3401
|
+
}), [
|
|
3402
|
+
renderActivityMessagesList,
|
|
3420
3403
|
a2uiActive,
|
|
3421
3404
|
openGenUIActive,
|
|
3422
3405
|
generativeUIActive,
|
|
@@ -3424,9 +3407,6 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3424
3407
|
filteredCatalog,
|
|
3425
3408
|
mcpAppsAllowSameOrigin
|
|
3426
3409
|
]);
|
|
3427
|
-
const allActivityRenderers = useMemo(() => {
|
|
3428
|
-
return [...renderActivityMessagesList, ...builtInActivityRenderers];
|
|
3429
|
-
}, [renderActivityMessagesList, builtInActivityRenderers]);
|
|
3430
3410
|
const resolvedConfig = useMemo(() => ɵresolveProviderConfig$1({
|
|
3431
3411
|
runtimeUrl,
|
|
3432
3412
|
publicApiKey,
|
|
@@ -3461,31 +3441,9 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3461
3441
|
}, []);
|
|
3462
3442
|
const headersInput = isHeadersBuilder ? stableHeadersBuilder : headersProp;
|
|
3463
3443
|
const headersSource = useMemo(() => ɵwithHeaderDefaults$1(headersInput, ɵpublicKeyHeaderDefaults$1(resolvedPublicKey)), [headersInput, resolvedPublicKey]);
|
|
3464
|
-
const frontendToolsList = useStableArrayProp(frontendTools,
|
|
3465
|
-
const humanInTheLoopList = useStableArrayProp(humanInTheLoop,
|
|
3466
|
-
const sandboxFunctionsList = useStableArrayProp(openGenerativeUI?.sandboxFunctions,
|
|
3467
|
-
const processedHumanInTheLoopTools = useMemo(() => {
|
|
3468
|
-
const processedTools = [];
|
|
3469
|
-
const processedRenderToolCalls = [];
|
|
3470
|
-
const registry = () => copilotkitRef.current.ɵhumanInTheLoop;
|
|
3471
|
-
humanInTheLoopList.forEach((tool) => {
|
|
3472
|
-
const { render, ...config } = tool;
|
|
3473
|
-
processedTools.push(ɵbuildHumanInTheLoopTool$1(config, registry));
|
|
3474
|
-
if (render) {
|
|
3475
|
-
const RenderComponent = (props) => createElement(render, ɵhitlRenderProps$1(props, tool, registry()));
|
|
3476
|
-
processedRenderToolCalls.push({
|
|
3477
|
-
name: tool.name,
|
|
3478
|
-
args: tool.parameters,
|
|
3479
|
-
render: RenderComponent,
|
|
3480
|
-
...tool.agentId && { agentId: tool.agentId }
|
|
3481
|
-
});
|
|
3482
|
-
}
|
|
3483
|
-
});
|
|
3484
|
-
return {
|
|
3485
|
-
tools: processedTools,
|
|
3486
|
-
renderToolCalls: processedRenderToolCalls
|
|
3487
|
-
};
|
|
3488
|
-
}, [humanInTheLoopList]);
|
|
3444
|
+
const frontendToolsList = useStableArrayProp(frontendTools, "frontendTools");
|
|
3445
|
+
const humanInTheLoopList = useStableArrayProp(humanInTheLoop, "humanInTheLoop");
|
|
3446
|
+
const sandboxFunctionsList = useStableArrayProp(openGenerativeUI?.sandboxFunctions, "sandboxFunctions");
|
|
3489
3447
|
const builtInFrontendTools = useMemo(() => {
|
|
3490
3448
|
if (!openGenUIActive) return [];
|
|
3491
3449
|
return [{
|
|
@@ -3493,36 +3451,30 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3493
3451
|
render: OpenGenerativeUIToolRenderer
|
|
3494
3452
|
}];
|
|
3495
3453
|
}, [openGenUIActive]);
|
|
3496
|
-
const
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3454
|
+
const humanInTheLoopAssembly = useMemo(() => ɵassembleHumanInTheLoop$1({
|
|
3455
|
+
humanInTheLoop: humanInTheLoopList,
|
|
3456
|
+
humanInTheLoopRegistry: () => copilotkitRef.current.ɵhumanInTheLoop,
|
|
3457
|
+
wrapHumanInTheLoopRender: (render, tool, registry) => (props) => createElement(render, ɵhitlRenderProps$1(props, tool, registry()))
|
|
3458
|
+
}), [humanInTheLoopList]);
|
|
3459
|
+
const allTools = useMemo(() => ɵassembleProviderTools$1({
|
|
3460
|
+
frontendTools: frontendToolsList,
|
|
3461
|
+
builtInFrontendTools,
|
|
3462
|
+
humanInTheLoop: humanInTheLoopAssembly
|
|
3463
|
+
}), [
|
|
3503
3464
|
frontendToolsList,
|
|
3504
3465
|
builtInFrontendTools,
|
|
3505
|
-
|
|
3466
|
+
humanInTheLoopAssembly
|
|
3506
3467
|
]);
|
|
3507
|
-
const allRenderToolCalls = useMemo(() => {
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
name: tool.name,
|
|
3514
|
-
args,
|
|
3515
|
-
render: tool.render
|
|
3516
|
-
});
|
|
3517
|
-
}
|
|
3518
|
-
});
|
|
3519
|
-
combined.push(...processedHumanInTheLoopTools.renderToolCalls);
|
|
3520
|
-
return combined;
|
|
3521
|
-
}, [
|
|
3468
|
+
const allRenderToolCalls = useMemo(() => ɵassembleProviderToolRenderers$1({
|
|
3469
|
+
renderToolCalls: renderToolCallsList,
|
|
3470
|
+
frontendTools: frontendToolsList,
|
|
3471
|
+
builtInFrontendTools,
|
|
3472
|
+
humanInTheLoop: humanInTheLoopAssembly
|
|
3473
|
+
}), [
|
|
3522
3474
|
renderToolCallsList,
|
|
3523
3475
|
frontendToolsList,
|
|
3524
3476
|
builtInFrontendTools,
|
|
3525
|
-
|
|
3477
|
+
humanInTheLoopAssembly
|
|
3526
3478
|
]);
|
|
3527
3479
|
const copilotkit = ɵuseOwnedCore(copilotkitRef, () => new CopilotKitCoreReact({
|
|
3528
3480
|
runtimeUrl: resolvedConfig.runtimeUrl,
|
|
@@ -3637,13 +3589,10 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
|
|
|
3637
3589
|
const designSkill = openGenerativeUI?.designSkill;
|
|
3638
3590
|
useLayoutEffect(() => {
|
|
3639
3591
|
if (!copilotkit || !openGenUIActive) return;
|
|
3640
|
-
|
|
3592
|
+
return ɵaddOpenGenerativeUIContexts$1(copilotkit, {
|
|
3641
3593
|
designSkill,
|
|
3642
3594
|
sandboxFunctions: sandboxFunctionsList
|
|
3643
|
-
})
|
|
3644
|
-
return () => {
|
|
3645
|
-
for (const id of ids) copilotkit.removeContext(id);
|
|
3646
|
-
};
|
|
3595
|
+
});
|
|
3647
3596
|
}, [
|
|
3648
3597
|
copilotkit,
|
|
3649
3598
|
designSkill,
|
|
@@ -3744,7 +3693,10 @@ function useRenderCustomMessages() {
|
|
|
3744
3693
|
//#region src/hooks/use-render-activity-message.tsx
|
|
3745
3694
|
function useRenderActivityMessage() {
|
|
3746
3695
|
const { copilotkit } = useCopilotKit();
|
|
3747
|
-
const agentId =
|
|
3696
|
+
const agentId = ɵresolveAgentId$1({
|
|
3697
|
+
chatAgentId: useCopilotChatConfiguration()?.agentId,
|
|
3698
|
+
providerAgentId: useDefaultAgentId()
|
|
3699
|
+
});
|
|
3748
3700
|
const renderers = copilotkit.renderActivityMessages;
|
|
3749
3701
|
const findRenderer = useCallback((activityType) => ɵfindActivityRenderer$1(renderers, {
|
|
3750
3702
|
activityType,
|
|
@@ -3885,21 +3837,7 @@ function useFrontendTool(tool, deps) {
|
|
|
3885
3837
|
const { copilotkit } = useCopilotKit$1();
|
|
3886
3838
|
const depsVersion = useDepsVersion(deps);
|
|
3887
3839
|
useLayoutEffect(() => {
|
|
3888
|
-
|
|
3889
|
-
if (copilotkit.getTool({
|
|
3890
|
-
toolName: name,
|
|
3891
|
-
agentId: tool.agentId
|
|
3892
|
-
})) console.warn(`Tool '${name}' already exists for agent '${tool.agentId || "global"}'. Overriding with latest registration.`);
|
|
3893
|
-
const unregister = copilotkit.addTool(tool);
|
|
3894
|
-
if (tool.render) copilotkit.addHookRenderToolCall({
|
|
3895
|
-
name,
|
|
3896
|
-
args: tool.parameters,
|
|
3897
|
-
agentId: tool.agentId,
|
|
3898
|
-
render: tool.render
|
|
3899
|
-
});
|
|
3900
|
-
return () => {
|
|
3901
|
-
unregister();
|
|
3902
|
-
};
|
|
3840
|
+
return ɵregisterFrontendTools$1(copilotkit, [tool], (renderer) => copilotkit.addHookRenderToolCall(renderer));
|
|
3903
3841
|
}, [
|
|
3904
3842
|
tool.name,
|
|
3905
3843
|
tool.available,
|
|
@@ -3969,30 +3907,7 @@ function useFrontendTools(tools, deps) {
|
|
|
3969
3907
|
const toolList = tools ?? EMPTY_TOOLS;
|
|
3970
3908
|
const extraDeps = deps ?? EMPTY_DEPS;
|
|
3971
3909
|
useLayoutEffect(() => {
|
|
3972
|
-
|
|
3973
|
-
for (const tool of toolList) {
|
|
3974
|
-
const key = `${tool.agentId ?? ""}:${tool.name}`;
|
|
3975
|
-
if (deduped.has(key)) console.warn(`Tool '${tool.name}' is listed more than once for agent '${tool.agentId || "global"}' in the same useFrontendTools call. Using the last entry.`);
|
|
3976
|
-
deduped.set(key, tool);
|
|
3977
|
-
}
|
|
3978
|
-
const registered = [...deduped.values()];
|
|
3979
|
-
const unregisters = [];
|
|
3980
|
-
for (const tool of registered) {
|
|
3981
|
-
if (copilotkit.getTool({
|
|
3982
|
-
toolName: tool.name,
|
|
3983
|
-
agentId: tool.agentId
|
|
3984
|
-
})) console.warn(`Tool '${tool.name}' already exists for agent '${tool.agentId || "global"}'. Overriding with latest registration.`);
|
|
3985
|
-
unregisters.push(copilotkit.addTool(tool));
|
|
3986
|
-
if (tool.render) copilotkit.addHookRenderToolCall({
|
|
3987
|
-
name: tool.name,
|
|
3988
|
-
args: tool.parameters,
|
|
3989
|
-
agentId: tool.agentId,
|
|
3990
|
-
render: tool.render
|
|
3991
|
-
});
|
|
3992
|
-
}
|
|
3993
|
-
return () => {
|
|
3994
|
-
for (const unregister of unregisters) unregister();
|
|
3995
|
-
};
|
|
3910
|
+
return ɵregisterFrontendTools$1(copilotkit, toolList, (renderer) => copilotkit.addHookRenderToolCall(renderer));
|
|
3996
3911
|
}, [
|
|
3997
3912
|
JSON.stringify(toolList.map((tool) => [
|
|
3998
3913
|
tool.name,
|
|
@@ -4516,41 +4431,11 @@ function CopilotChatToolCallGroup({ calls, renderCall, appearance = "card", isAc
|
|
|
4516
4431
|
//#endregion
|
|
4517
4432
|
//#region src/hooks/use-default-render-tool.tsx
|
|
4518
4433
|
/**
|
|
4519
|
-
* Module-level dedup set so an unknown status value only emits a console
|
|
4520
|
-
* warning the FIRST time we encounter it. Otherwise a stuck/unmapped status
|
|
4521
|
-
* would log on every re-render (potentially many per second).
|
|
4522
|
-
*/
|
|
4523
|
-
const warnedUnknownStatuses = /* @__PURE__ */ new Set();
|
|
4524
|
-
/**
|
|
4525
|
-
* Map a {@link ToolCallStatus} enum value to the documented string-union
|
|
4526
|
-
* status the {@link DefaultRenderProps} contract exposes. Unknown / future
|
|
4527
|
-
* enum members log a warning (once per distinct value) and fall back to
|
|
4528
|
-
* `"inProgress"`.
|
|
4529
|
-
*/
|
|
4530
|
-
function mapToolCallStatus(status) {
|
|
4531
|
-
const normalized = ɵnormalizeToolCallStatus$1(status);
|
|
4532
|
-
if (normalized !== "unknown") return normalized;
|
|
4533
|
-
const key = String(status);
|
|
4534
|
-
if (!warnedUnknownStatuses.has(key)) {
|
|
4535
|
-
warnedUnknownStatuses.add(key);
|
|
4536
|
-
console.warn(`[CopilotKit] Unknown ToolCallStatus "${key}" in default tool-call renderer; falling back to "inProgress".`);
|
|
4537
|
-
}
|
|
4538
|
-
return "inProgress";
|
|
4539
|
-
}
|
|
4540
|
-
/**
|
|
4541
4434
|
* Convert the framework-internal renderer props (`args`, enum status) into
|
|
4542
4435
|
* the documented {@link DefaultRenderProps} shape (`parameters`, string-union
|
|
4543
4436
|
* status) so a user `config.render` always sees the documented contract.
|
|
4544
4437
|
*/
|
|
4545
|
-
|
|
4546
|
-
return {
|
|
4547
|
-
name: props.name,
|
|
4548
|
-
toolCallId: props.toolCallId,
|
|
4549
|
-
parameters: props.args,
|
|
4550
|
-
status: mapToolCallStatus(props.status),
|
|
4551
|
-
result: props.result
|
|
4552
|
-
};
|
|
4553
|
-
}
|
|
4438
|
+
const adaptRendererProps = ɵadaptDefaultToolCallRenderProps$1;
|
|
4554
4439
|
/**
|
|
4555
4440
|
* Registers a wildcard (`"*"`) tool-call renderer via `useRenderTool`.
|
|
4556
4441
|
*
|
|
@@ -4847,7 +4732,11 @@ function useSuggestions({ agentId } = {}) {
|
|
|
4847
4732
|
const { copilotkit } = useCopilotKit$1();
|
|
4848
4733
|
const config = useCopilotChatConfiguration();
|
|
4849
4734
|
const providerAgentId = useDefaultAgentId();
|
|
4850
|
-
const resolvedAgentId = useMemo(() =>
|
|
4735
|
+
const resolvedAgentId = useMemo(() => ɵresolveAgentId$1({
|
|
4736
|
+
agentId,
|
|
4737
|
+
chatAgentId: config?.agentId,
|
|
4738
|
+
providerAgentId
|
|
4739
|
+
}), [
|
|
4851
4740
|
agentId,
|
|
4852
4741
|
config?.agentId,
|
|
4853
4742
|
providerAgentId
|
|
@@ -4890,7 +4779,10 @@ function useConfigureSuggestions(config, deps) {
|
|
|
4890
4779
|
const { copilotkit } = useCopilotKit$1();
|
|
4891
4780
|
const chatConfig = useCopilotChatConfiguration();
|
|
4892
4781
|
const providerAgentId = useDefaultAgentId();
|
|
4893
|
-
const chatAgentId =
|
|
4782
|
+
const chatAgentId = ɵresolveAgentId$1({
|
|
4783
|
+
chatAgentId: chatConfig?.agentId,
|
|
4784
|
+
providerAgentId
|
|
4785
|
+
});
|
|
4894
4786
|
const extraDeps = deps ?? [];
|
|
4895
4787
|
const bindingRef = useRef(null);
|
|
4896
4788
|
const latestRef = useRef({
|
|
@@ -5671,8 +5563,11 @@ function useMessageFeedback(message) {
|
|
|
5671
5563
|
function useFeedbackComment(controls) {
|
|
5672
5564
|
const latestControls = useRef(controls);
|
|
5673
5565
|
latestControls.current = controls;
|
|
5674
|
-
const [controller] = useState(() => new ɵFeedbackCommentController$1({ getControls: () => latestControls.current }));
|
|
5675
5566
|
const inputRef = useRef(null);
|
|
5567
|
+
const [controller] = useState(() => new ɵFeedbackCommentController$1({
|
|
5568
|
+
getControls: () => latestControls.current,
|
|
5569
|
+
getInput: () => inputRef.current
|
|
5570
|
+
}));
|
|
5676
5571
|
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
5677
5572
|
useEffect(() => controller.dispose, [controller]);
|
|
5678
5573
|
return {
|
|
@@ -5685,7 +5580,16 @@ function useFeedbackComment(controls) {
|
|
|
5685
5580
|
leave: controller.leave,
|
|
5686
5581
|
setEditing: controller.setEditing,
|
|
5687
5582
|
close: controller.close,
|
|
5688
|
-
returnFocus: controller.returnFocus
|
|
5583
|
+
returnFocus: controller.returnFocus,
|
|
5584
|
+
rate: controller.rate,
|
|
5585
|
+
thumb: controller.thumb,
|
|
5586
|
+
findAnchor: controller.findAnchor,
|
|
5587
|
+
sync: controller.sync,
|
|
5588
|
+
focusField: controller.focusField,
|
|
5589
|
+
submit: controller.submit,
|
|
5590
|
+
popoverEscape: controller.popoverEscape,
|
|
5591
|
+
popoverKeyDown: controller.popoverKeyDown,
|
|
5592
|
+
popoverFocusLeave: controller.popoverFocusLeave
|
|
5689
5593
|
};
|
|
5690
5594
|
}
|
|
5691
5595
|
|
|
@@ -5758,32 +5662,6 @@ function BoundInspectorButton({ inspectorButton, messageId, openInspector, ...pr
|
|
|
5758
5662
|
})
|
|
5759
5663
|
});
|
|
5760
5664
|
}
|
|
5761
|
-
/** Whether focus came from the keyboard; a pointer click also focuses buttons. */
|
|
5762
|
-
function isFocusVisible(element) {
|
|
5763
|
-
try {
|
|
5764
|
-
return element.matches(":focus-visible");
|
|
5765
|
-
} catch {
|
|
5766
|
-
return false;
|
|
5767
|
-
}
|
|
5768
|
-
}
|
|
5769
|
-
const HIDDEN_TOO = {
|
|
5770
|
-
checkVisibilityCSS: true,
|
|
5771
|
-
visibilityProperty: true
|
|
5772
|
-
};
|
|
5773
|
-
const FOCUSABLE = [
|
|
5774
|
-
"a[href]",
|
|
5775
|
-
"button:not([disabled])",
|
|
5776
|
-
"input:not([disabled])",
|
|
5777
|
-
"select:not([disabled])",
|
|
5778
|
-
"textarea:not([disabled])",
|
|
5779
|
-
"[tabindex]"
|
|
5780
|
-
].map((selector) => `${selector}:not([tabindex="-1"]):not([data-radix-focus-guard])`).join(", ");
|
|
5781
|
-
/** Approximately the element Tab reaches after `element`, outside `skip`. */
|
|
5782
|
-
function nextFocusable(element, skip) {
|
|
5783
|
-
const all = Array.from(element.ownerDocument.querySelectorAll(FOCUSABLE)).filter((candidate) => candidate === element || !skip?.contains(candidate) && !candidate.closest("[hidden], [inert]"));
|
|
5784
|
-
const index = all.indexOf(element);
|
|
5785
|
-
return index === -1 ? null : all[index + 1] ?? null;
|
|
5786
|
-
}
|
|
5787
5665
|
/**
|
|
5788
5666
|
* The comment popover of a rated message, pointing at the chosen thumb. Kept
|
|
5789
5667
|
* apart so only it, not the whole message, follows chat configuration.
|
|
@@ -5792,19 +5670,12 @@ function nextFocusable(element, skip) {
|
|
|
5792
5670
|
* from its start returns to the thumb, Tab from its end moves on to the
|
|
5793
5671
|
* control after the thumb, and Enter or Escape inside it returns to the thumb.
|
|
5794
5672
|
*/
|
|
5795
|
-
function FeedbackCommentPopover({ feedbackComment, comment, savedComment, rating,
|
|
5673
|
+
function FeedbackCommentPopover({ feedbackComment, comment, savedComment, rating, messageId }) {
|
|
5796
5674
|
const labels = useCopilotChatConfiguration()?.labels ?? CopilotChatDefaultLabels$1;
|
|
5797
5675
|
const contentRef = useRef(null);
|
|
5798
|
-
const
|
|
5799
|
-
const { focusRequest,
|
|
5800
|
-
const focusField = useCallback(() => {
|
|
5801
|
-
if (inputRef.current && takeFocusRequest()) inputRef.current.focus();
|
|
5802
|
-
}, [inputRef, takeFocusRequest]);
|
|
5676
|
+
const anchor = useMemo(() => ({ current: comment.anchor }), [comment.anchor]);
|
|
5677
|
+
const { focusRequest, focusField } = comment;
|
|
5803
5678
|
useEffect(() => focusField(), [focusRequest, focusField]);
|
|
5804
|
-
/** Whether `target` is a thumb of this message, whose click decides itself. */
|
|
5805
|
-
const isOwnThumb = (target) => {
|
|
5806
|
-
return (target instanceof Element ? target.closest("[data-copilotkit-rating]") : null)?.closest("[data-message-id]")?.getAttribute("data-message-id") === messageId;
|
|
5807
|
-
};
|
|
5808
5679
|
return /* @__PURE__ */ jsxs(Popover, {
|
|
5809
5680
|
open: comment.open,
|
|
5810
5681
|
onOpenChange: (open) => {
|
|
@@ -5823,24 +5694,12 @@ function FeedbackCommentPopover({ feedbackComment, comment, savedComment, rating
|
|
|
5823
5694
|
},
|
|
5824
5695
|
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
5825
5696
|
onInteractOutside: (event) => {
|
|
5826
|
-
if (
|
|
5697
|
+
if (ɵisOwnFeedbackThumb$1(event.target, messageId)) event.preventDefault();
|
|
5827
5698
|
},
|
|
5828
5699
|
onEscapeKeyDown: (event) => {
|
|
5829
|
-
|
|
5830
|
-
if (returnFocus) event.stopPropagation();
|
|
5831
|
-
comment.close({ save: false });
|
|
5832
|
-
if (returnFocus) comment.returnFocus(anchor.current);
|
|
5833
|
-
},
|
|
5834
|
-
onKeyDown: (event) => {
|
|
5835
|
-
if (event.key !== "Tab") return;
|
|
5836
|
-
const focusables = Array.from(contentRef.current?.querySelectorAll(FOCUSABLE) ?? []);
|
|
5837
|
-
if (!(event.shiftKey ? document.activeElement === focusables[0] : document.activeElement === focusables[focusables.length - 1]) || !anchor.current?.isConnected) return;
|
|
5838
|
-
event.preventDefault();
|
|
5839
|
-
const target = event.shiftKey ? anchor.current : nextFocusable(anchor.current, contentRef.current) ?? anchor.current;
|
|
5840
|
-
comment.close();
|
|
5841
|
-
if (target === anchor.current) comment.returnFocus(target);
|
|
5842
|
-
else target.focus();
|
|
5700
|
+
if (comment.popoverEscape(contentRef.current)) event.stopPropagation();
|
|
5843
5701
|
},
|
|
5702
|
+
onKeyDown: (event) => comment.popoverKeyDown(event, contentRef.current),
|
|
5844
5703
|
onPointerEnter: () => comment.enter("pointer"),
|
|
5845
5704
|
onPointerLeave: () => comment.leave("pointer"),
|
|
5846
5705
|
className: "cpk-assistant-message-feedback-popover",
|
|
@@ -5849,15 +5708,9 @@ function FeedbackCommentPopover({ feedbackComment, comment, savedComment, rating
|
|
|
5849
5708
|
savedComment,
|
|
5850
5709
|
inputRef: comment.inputRef,
|
|
5851
5710
|
onChange: comment.setDraft,
|
|
5852
|
-
onSubmit:
|
|
5853
|
-
comment.close();
|
|
5854
|
-
comment.returnFocus(anchor.current);
|
|
5855
|
-
},
|
|
5711
|
+
onSubmit: comment.submit,
|
|
5856
5712
|
onEditingChange: comment.setEditing,
|
|
5857
|
-
onLeave: (next) =>
|
|
5858
|
-
if (next && (contentRef.current?.contains(next) || isOwnThumb(next))) return;
|
|
5859
|
-
comment.leave();
|
|
5860
|
-
}
|
|
5713
|
+
onLeave: (next) => comment.popoverFocusLeave(next, contentRef.current, messageId)
|
|
5861
5714
|
}) }, rating)
|
|
5862
5715
|
})]
|
|
5863
5716
|
});
|
|
@@ -5872,73 +5725,29 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
|
|
|
5872
5725
|
const showInspectorShortcut = isInspectorEnabled && !shortcutsHidden;
|
|
5873
5726
|
const feedback = useMessageFeedback(message);
|
|
5874
5727
|
const comment = useFeedbackComment(feedback);
|
|
5875
|
-
const rating = feedback?.feedback?.rating;
|
|
5876
5728
|
const root = useRef(null);
|
|
5877
|
-
|
|
5878
|
-
const commentRating = useRef(rating);
|
|
5879
|
-
useLayoutEffect(() => {
|
|
5880
|
-
if (comment.open && !commentAnchor.current?.isConnected && rating) commentAnchor.current = root.current?.querySelector(`[data-copilotkit-rating="${rating}"]`) ?? root.current?.querySelector("button[aria-pressed=\"true\"]") ?? null;
|
|
5881
|
-
});
|
|
5729
|
+
useLayoutEffect(() => comment.findAnchor(root.current));
|
|
5882
5730
|
/**
|
|
5883
|
-
*
|
|
5884
|
-
*
|
|
5885
|
-
* (`detail` 0) moves focus into the comment, as there is no pointer.
|
|
5886
|
-
* Custom thumb slots may call `onClick` without an event.
|
|
5887
|
-
*
|
|
5888
|
-
* @returns Whether the app's handler should run: true for a new rating and
|
|
5889
|
-
* whenever this chat does not record ratings, false when one is removed.
|
|
5731
|
+
* A thumb click. A keyboard click (`detail` 0) moves focus into the
|
|
5732
|
+
* comment; custom thumb slots may call `onClick` without an event.
|
|
5890
5733
|
*/
|
|
5891
|
-
const rate = (value, event) => {
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
feedback.clear();
|
|
5896
|
-
return false;
|
|
5897
|
-
}
|
|
5898
|
-
feedback.rate(value);
|
|
5899
|
-
commentRating.current = value;
|
|
5900
|
-
commentAnchor.current = event?.currentTarget ?? null;
|
|
5901
|
-
comment.show({
|
|
5902
|
-
comment: "",
|
|
5903
|
-
focus: event?.detail === 0
|
|
5904
|
-
});
|
|
5905
|
-
return true;
|
|
5906
|
-
};
|
|
5734
|
+
const rate = (value, event) => comment.rate(value, {
|
|
5735
|
+
target: event?.currentTarget ?? null,
|
|
5736
|
+
keyboard: event?.detail === 0
|
|
5737
|
+
});
|
|
5907
5738
|
/** Props that let the chosen thumb open and point at its comment. */
|
|
5908
5739
|
const thumbFeedbackProps = (value) => {
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
"aria-pressed": false
|
|
5914
|
-
};
|
|
5915
|
-
const enter = (target, via) => {
|
|
5916
|
-
if (!comment.open) commentRating.current = value;
|
|
5917
|
-
commentAnchor.current = target;
|
|
5918
|
-
comment.enter(via);
|
|
5919
|
-
};
|
|
5740
|
+
const thumb = comment.thumb(value);
|
|
5741
|
+
if (!thumb) return {};
|
|
5742
|
+
const { handlers } = thumb;
|
|
5743
|
+
if (!handlers) return thumb.attributes;
|
|
5920
5744
|
return {
|
|
5921
|
-
...thumb,
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
},
|
|
5928
|
-
onPointerLeave: (event) => {
|
|
5929
|
-
if (event.pointerType !== "touch") comment.leave("pointer");
|
|
5930
|
-
},
|
|
5931
|
-
onFocus: (event) => {
|
|
5932
|
-
if (isFocusVisible(event.currentTarget)) enter(event.currentTarget, "focus");
|
|
5933
|
-
},
|
|
5934
|
-
onBlur: () => comment.leave(),
|
|
5935
|
-
onKeyDown: (event) => {
|
|
5936
|
-
const input = comment.inputRef.current;
|
|
5937
|
-
if (event.key === "Tab" && !event.shiftKey && comment.open && input && input.checkVisibility?.(HIDDEN_TOO) !== false) {
|
|
5938
|
-
event.preventDefault();
|
|
5939
|
-
input.focus();
|
|
5940
|
-
}
|
|
5941
|
-
}
|
|
5745
|
+
...thumb.attributes,
|
|
5746
|
+
onPointerEnter: handlers.pointerEnter,
|
|
5747
|
+
onPointerLeave: handlers.pointerLeave,
|
|
5748
|
+
onFocus: handlers.focus,
|
|
5749
|
+
onBlur: handlers.blur,
|
|
5750
|
+
onKeyDown: handlers.keyDown
|
|
5942
5751
|
};
|
|
5943
5752
|
};
|
|
5944
5753
|
const boundMarkdownRenderer = renderSlot(markdownRenderer, DefaultMarkdownRenderer, {
|
|
@@ -5992,23 +5801,21 @@ function CopilotChatAssistantMessage({ message, messages, isRunning, isLatest, o
|
|
|
5992
5801
|
isRunning: !!isRunning,
|
|
5993
5802
|
isLatest: isLatestAssistantMessage
|
|
5994
5803
|
});
|
|
5995
|
-
const
|
|
5804
|
+
const rating = feedback?.feedback?.rating;
|
|
5805
|
+
const { open: commentOpen, sync: syncComment } = comment;
|
|
5996
5806
|
useEffect(() => {
|
|
5997
|
-
|
|
5998
|
-
if (rating !== commentRating.current) closeComment({ save: false });
|
|
5999
|
-
else if (!shouldShowToolbar) closeComment();
|
|
5807
|
+
syncComment({ showsToolbar: shouldShowToolbar });
|
|
6000
5808
|
}, [
|
|
6001
5809
|
commentOpen,
|
|
6002
5810
|
shouldShowToolbar,
|
|
6003
5811
|
rating,
|
|
6004
|
-
|
|
5812
|
+
syncComment
|
|
6005
5813
|
]);
|
|
6006
5814
|
const feedbackComment = feedback?.feedback && shouldShowToolbar && /* @__PURE__ */ jsx(FeedbackCommentPopover, {
|
|
6007
5815
|
feedbackComment: feedbackCommentSlot,
|
|
6008
5816
|
comment,
|
|
6009
5817
|
savedComment: feedback.feedback.comment ?? "",
|
|
6010
5818
|
rating: feedback.feedback.rating,
|
|
6011
|
-
anchor: commentAnchor,
|
|
6012
5819
|
messageId: message.id
|
|
6013
5820
|
});
|
|
6014
5821
|
if (children) return /* @__PURE__ */ jsxs("div", {
|
|
@@ -6614,33 +6421,17 @@ function CopilotChatReasoningMessage({ message, messages, isRunning, isLatest: i
|
|
|
6614
6421
|
const isLatest = isLatestProp ?? messages?.[messages.length - 1]?.id === message.id;
|
|
6615
6422
|
const isStreaming = !!(isRunning && isLatest);
|
|
6616
6423
|
const hasContent = !!(message.content && message.content.length > 0);
|
|
6617
|
-
const
|
|
6618
|
-
const
|
|
6619
|
-
useEffect(() => {
|
|
6620
|
-
if (isStreaming && startTimeRef.current === null) startTimeRef.current = Date.now();
|
|
6621
|
-
if (!isStreaming && startTimeRef.current !== null) {
|
|
6622
|
-
setElapsed((Date.now() - startTimeRef.current) / 1e3);
|
|
6623
|
-
return;
|
|
6624
|
-
}
|
|
6625
|
-
if (!isStreaming) return;
|
|
6626
|
-
const timer = setInterval(() => {
|
|
6627
|
-
if (startTimeRef.current !== null) setElapsed((Date.now() - startTimeRef.current) / 1e3);
|
|
6628
|
-
}, 1e3);
|
|
6629
|
-
return () => clearInterval(timer);
|
|
6630
|
-
}, [isStreaming]);
|
|
6631
|
-
const [isOpen, setIsOpen] = useState(isStreaming);
|
|
6632
|
-
const userToggledRef = useRef(false);
|
|
6424
|
+
const [disclosure] = useState(() => new ɵReasoningDisclosure$1({ isStreaming }));
|
|
6425
|
+
const { isOpen, elapsedSeconds: elapsed } = useSyncExternalStore(disclosure.subscribe, disclosure.getSnapshot, disclosure.getSnapshot);
|
|
6633
6426
|
useEffect(() => {
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
} : void 0;
|
|
6643
|
-
const label = isStreaming ? labels.reasoningMessageThinkingLabel : ɵformatLabel$1(labels.reasoningMessageThoughtForLabel, { duration: ɵformatReasoningDurationLabel$1(elapsed, labels) });
|
|
6427
|
+
disclosure.setStreaming(isStreaming);
|
|
6428
|
+
}, [disclosure, isStreaming]);
|
|
6429
|
+
useEffect(() => disclosure.dispose, [disclosure]);
|
|
6430
|
+
const handleToggle = hasContent ? disclosure.toggle : void 0;
|
|
6431
|
+
const label = ɵgetReasoningHeaderLabel$1({
|
|
6432
|
+
isStreaming,
|
|
6433
|
+
elapsedSeconds: elapsed
|
|
6434
|
+
}, labels);
|
|
6644
6435
|
const boundHeader = renderSlot(header, CopilotChatReasoningMessage.Header, {
|
|
6645
6436
|
isOpen,
|
|
6646
6437
|
label,
|
|
@@ -7357,6 +7148,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
|
|
|
7357
7148
|
const { renderActivityMessage } = useRenderActivityMessage();
|
|
7358
7149
|
const { copilotkit, showIntelligenceIndicator = true } = useCopilotKit();
|
|
7359
7150
|
const config = useCopilotChatConfiguration();
|
|
7151
|
+
const providerAgentId = useDefaultAgentId();
|
|
7360
7152
|
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
7361
7153
|
useEffect(() => {
|
|
7362
7154
|
if (!config?.agentId) return;
|
|
@@ -7377,12 +7169,11 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
|
|
|
7377
7169
|
} });
|
|
7378
7170
|
return () => subscription.unsubscribe();
|
|
7379
7171
|
}, [copilotkit]);
|
|
7380
|
-
const getStateSnapshotForMessage = (messageId) => {
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
};
|
|
7172
|
+
const getStateSnapshotForMessage = (messageId) => config ? ɵgetMessageRunStateSnapshot$1(copilotkit, {
|
|
7173
|
+
agentId: config.agentId,
|
|
7174
|
+
threadId: config.threadId,
|
|
7175
|
+
messageId
|
|
7176
|
+
}) : void 0;
|
|
7386
7177
|
const deduplicatedMessages = useMemo(() => ɵdeduplicateMessages$1(messages), [messages]);
|
|
7387
7178
|
const transformedMessages = useMemo(() => transformMessages ? transformMessages(deduplicatedMessages) : deduplicatedMessages, [deduplicatedMessages, transformMessages]);
|
|
7388
7179
|
const rows = useMemo(() => groupMessages ? groupMessages(transformedMessages) : transformedMessages.map(messageRow), [transformedMessages, groupMessages]);
|
|
@@ -7636,7 +7427,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
|
|
|
7636
7427
|
const nextRect = pendingRect;
|
|
7637
7428
|
pendingRect = void 0;
|
|
7638
7429
|
if (!instance.scrollElement?.clientHeight) return;
|
|
7639
|
-
measuredWidthRef.current = instance.scrollElement
|
|
7430
|
+
measuredWidthRef.current = instance.scrollElement.clientWidth;
|
|
7640
7431
|
if (resizeAnchorRef.current) resizeAnchorRef.current.ready = true;
|
|
7641
7432
|
instance.getTotalSize();
|
|
7642
7433
|
measuredRef.current = {
|
|
@@ -7753,7 +7544,10 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
|
|
|
7753
7544
|
const intelligenceTurnId = showIntelligenceIndicator ? intelligenceTurnAnchors.get(message.id) : void 0;
|
|
7754
7545
|
if (intelligenceTurnId !== void 0) elements.push(/* @__PURE__ */ jsx(IntelligenceIndicator, {
|
|
7755
7546
|
message,
|
|
7756
|
-
agentId:
|
|
7547
|
+
agentId: ɵresolveAgentId$1({
|
|
7548
|
+
chatAgentId: config?.agentId,
|
|
7549
|
+
providerAgentId
|
|
7550
|
+
}),
|
|
7757
7551
|
intelligenceIndicator
|
|
7758
7552
|
}, `intelligence-${intelligenceTurnId}`));
|
|
7759
7553
|
return elements.filter(Boolean);
|
|
@@ -8274,36 +8068,18 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
|
|
|
8274
8068
|
const [inputContainerEl, setInputContainerEl] = useState(null);
|
|
8275
8069
|
const [inputContainerHeight, setInputContainerHeight] = useState(0);
|
|
8276
8070
|
const [isResizing, setIsResizing] = useState(false);
|
|
8277
|
-
const resizeTimeoutRef = useRef(null);
|
|
8278
8071
|
const { isKeyboardOpen, keyboardHeight } = useKeyboardHeight();
|
|
8279
8072
|
useEffect(() => {
|
|
8280
8073
|
const element = inputContainerEl;
|
|
8281
8074
|
if (!element) {
|
|
8282
8075
|
setInputContainerHeight(0);
|
|
8076
|
+
setIsResizing(false);
|
|
8283
8077
|
return;
|
|
8284
8078
|
}
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
setInputContainerHeight((prevHeight) => {
|
|
8289
|
-
if (newHeight !== prevHeight) {
|
|
8290
|
-
setIsResizing(true);
|
|
8291
|
-
if (resizeTimeoutRef.current) clearTimeout(resizeTimeoutRef.current);
|
|
8292
|
-
resizeTimeoutRef.current = setTimeout(() => {
|
|
8293
|
-
setIsResizing(false);
|
|
8294
|
-
}, 250);
|
|
8295
|
-
return newHeight;
|
|
8296
|
-
}
|
|
8297
|
-
return prevHeight;
|
|
8298
|
-
});
|
|
8299
|
-
}
|
|
8079
|
+
return ɵwatchElementHeight$1(element, (state) => {
|
|
8080
|
+
setInputContainerHeight(state.height);
|
|
8081
|
+
setIsResizing(state.isResizing);
|
|
8300
8082
|
});
|
|
8301
|
-
resizeObserver.observe(element);
|
|
8302
|
-
setInputContainerHeight(element.offsetHeight);
|
|
8303
|
-
return () => {
|
|
8304
|
-
resizeObserver.disconnect();
|
|
8305
|
-
if (resizeTimeoutRef.current) clearTimeout(resizeTimeoutRef.current);
|
|
8306
|
-
};
|
|
8307
8083
|
}, [inputContainerEl]);
|
|
8308
8084
|
const BoundMessageView = renderSlot(messageView, CopilotChatMessageView, {
|
|
8309
8085
|
messages,
|
|
@@ -8640,7 +8416,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
|
|
|
8640
8416
|
if (!scrollElement) return;
|
|
8641
8417
|
const contentElement = contentRef.current;
|
|
8642
8418
|
const checkScroll = () => {
|
|
8643
|
-
setShowScrollButton((contentElement ?
|
|
8419
|
+
setShowScrollButton(!(contentElement ? ɵisContentScrolledToBottom$1(scrollElement, contentElement) : ɵisScrolledToBottom$1(scrollElement)));
|
|
8644
8420
|
};
|
|
8645
8421
|
checkScroll();
|
|
8646
8422
|
scrollElement.addEventListener("scroll", checkScroll);
|
|
@@ -8833,9 +8609,14 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
|
|
|
8833
8609
|
isInspectorEnabled: inspector.isInspectorEnabled && (inspector.providerEnableInspector ?? inspectorTools ?? true)
|
|
8834
8610
|
}), [inspector, inspectorTools]);
|
|
8835
8611
|
const providerAgentId = useDefaultAgentId();
|
|
8836
|
-
const resolvedAgentId =
|
|
8612
|
+
const resolvedAgentId = ɵresolveAgentId$1({
|
|
8613
|
+
agentId,
|
|
8614
|
+
chatAgentId: existingConfig?.agentId,
|
|
8615
|
+
providerAgentId
|
|
8616
|
+
});
|
|
8837
8617
|
const providedThreadId = threadId ?? existingConfig?.threadId;
|
|
8838
|
-
const
|
|
8618
|
+
const [freshThreadId] = useState(() => new ɵFreshThreadId$1());
|
|
8619
|
+
const baseThreadId = useMemo(() => freshThreadId.resolve(providedThreadId), [freshThreadId, providedThreadId]);
|
|
8839
8620
|
const baseHasExplicitThreadId = !!threadId || !!existingConfig?.hasExplicitThreadId;
|
|
8840
8621
|
const { inspectorThreadId, inspectorRequestId, failInspectorOverride } = useInspectorThreadOverride({
|
|
8841
8622
|
agentId: resolvedAgentId,
|
|
@@ -8860,35 +8641,16 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
|
|
|
8860
8641
|
}, [onError]);
|
|
8861
8642
|
useEffect(() => {
|
|
8862
8643
|
if (!onErrorRef.current) return;
|
|
8863
|
-
|
|
8864
|
-
if (event.context?.agentId === resolvedAgentId || !event.context?.agentId) onErrorRef.current?.({
|
|
8865
|
-
error: event.error,
|
|
8866
|
-
code: event.code,
|
|
8867
|
-
context: event.context
|
|
8868
|
-
});
|
|
8869
|
-
} });
|
|
8870
|
-
return () => {
|
|
8871
|
-
subscription.unsubscribe();
|
|
8872
|
-
};
|
|
8644
|
+
return ɵsubscribeToAgentErrors$1(copilotkit, resolvedAgentId, (event) => onErrorRef.current?.(event));
|
|
8873
8645
|
}, [copilotkit, resolvedAgentId]);
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
failInspectorOverride(requestId);
|
|
8883
|
-
} });
|
|
8884
|
-
return () => subscription.unsubscribe();
|
|
8885
|
-
}, [
|
|
8886
|
-
copilotkit,
|
|
8887
|
-
failInspectorOverride,
|
|
8888
|
-
inspectorRequestId,
|
|
8889
|
-
resolvedAgentId,
|
|
8890
|
-
resolvedThreadId
|
|
8891
|
-
]);
|
|
8646
|
+
const failInspectorOverrideRef = useRef(failInspectorOverride);
|
|
8647
|
+
failInspectorOverrideRef.current = failInspectorOverride;
|
|
8648
|
+
const [connection] = useState(() => new ɵChatConnection$1({
|
|
8649
|
+
core: copilotkit,
|
|
8650
|
+
onInspectorOverrideFailed: (requestId) => failInspectorOverrideRef.current(requestId)
|
|
8651
|
+
}));
|
|
8652
|
+
const { threads } = connection;
|
|
8653
|
+
useSyncExternalStore(useCallback((onChange) => connection.subscribe(onChange), [connection]), () => connection.getSnapshot(), () => connection.getSnapshot());
|
|
8892
8654
|
const [transcribeMode, setTranscribeMode] = useState("input");
|
|
8893
8655
|
const [inputValue, setInputValue] = useState("");
|
|
8894
8656
|
const inputValueRef = useRef(inputValue);
|
|
@@ -8901,20 +8663,14 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
|
|
|
8901
8663
|
const isTranscriptionEnabled = copilotkit.audioFileTranscriptionEnabled;
|
|
8902
8664
|
const isMediaRecorderSupported = typeof window !== "undefined" && typeof MediaRecorder !== "undefined";
|
|
8903
8665
|
const { messageView: providedMessageView, suggestionView: providedSuggestionView, onStop: providedStopHandler, ...restProps } = props;
|
|
8904
|
-
const
|
|
8905
|
-
|
|
8666
|
+
const isConnecting = connection.isConnecting({
|
|
8667
|
+
threadId: resolvedThreadId,
|
|
8668
|
+
explicit: hasExplicitThreadId
|
|
8669
|
+
});
|
|
8906
8670
|
const activeConnectCountRef = useRef(0);
|
|
8907
|
-
const [threads] = useState(() => new ɵThreadSwitchCoordinator$1(copilotkit));
|
|
8908
8671
|
const trackConnection = useCallback((connect) => {
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
threads.trackConnection(selection, connect);
|
|
8912
|
-
return;
|
|
8913
|
-
}
|
|
8914
|
-
connect().catch((error) => {
|
|
8915
|
-
console.error("CopilotChat: connection failed", error);
|
|
8916
|
-
});
|
|
8917
|
-
}, [threads]);
|
|
8672
|
+
connection.track(connect);
|
|
8673
|
+
}, [connection]);
|
|
8918
8674
|
const pendingRunActivityReconnectRef = useRef(false);
|
|
8919
8675
|
const runActivityReconnectGenerationRef = useRef(0);
|
|
8920
8676
|
const activeLocalRunIdsRef = useRef(/* @__PURE__ */ new Set());
|
|
@@ -8927,8 +8683,6 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
|
|
|
8927
8683
|
const runtimeStatus = copilotkit.runtimeConnectionStatus === CopilotKitCoreRuntimeConnectionStatus$1.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
|
|
8928
8684
|
const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
|
|
8929
8685
|
const [standaloneRunActivityStore] = useState(() => ɵcreateThreadStore$1({ fetch: copilotkit.ɵruntimeFetch }));
|
|
8930
|
-
const hasExplicitThreadIdRef = useRef(hasExplicitThreadId);
|
|
8931
|
-
hasExplicitThreadIdRef.current = hasExplicitThreadId;
|
|
8932
8686
|
const rememberRecentlyLocalRunId = useCallback((runId) => {
|
|
8933
8687
|
const existingTimeout = recentlyLocalRunIdsRef.current.get(runId);
|
|
8934
8688
|
if (existingTimeout) clearTimeout(existingTimeout);
|
|
@@ -8966,57 +8720,33 @@ function CopilotChat({ agentId, threadId, labels, inspectorTools, chatView, isMo
|
|
|
8966
8720
|
};
|
|
8967
8721
|
}, []);
|
|
8968
8722
|
useEffect(() => {
|
|
8969
|
-
const
|
|
8723
|
+
const handle = connection.open({
|
|
8970
8724
|
agent,
|
|
8971
8725
|
threadId: resolvedThreadId,
|
|
8972
8726
|
explicit: hasExplicitThreadId,
|
|
8973
8727
|
inspectorRequestId
|
|
8974
|
-
}
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
activeConnectCountRef.current += 1;
|
|
8980
|
-
try {
|
|
8981
|
-
await threads.whenTornDown();
|
|
8982
|
-
if (detached) return;
|
|
8983
|
-
if (ɵisHttpAgent$1(agentToConnect)) agentToConnect.abortController = connectAbortController;
|
|
8984
|
-
await copilotkit.connectAgent({ agent: agentToConnect });
|
|
8985
|
-
} catch (error) {
|
|
8986
|
-
if (detached) return;
|
|
8987
|
-
if (inspectorRequestId) failInspectorOverride(inspectorRequestId);
|
|
8988
|
-
throw error;
|
|
8989
|
-
} finally {
|
|
8990
|
-
if (!detached) (typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 16))(() => {
|
|
8991
|
-
if (!detached) setLastConnectedThreadId(resolvedThreadId);
|
|
8992
|
-
});
|
|
8993
|
-
else if (!hasExplicitThreadIdRef.current) selection.clearDiscardedBaseline();
|
|
8728
|
+
}, {
|
|
8729
|
+
onStart: () => {
|
|
8730
|
+
activeConnectCountRef.current += 1;
|
|
8731
|
+
},
|
|
8732
|
+
onSettled: (current) => {
|
|
8994
8733
|
activeConnectCountRef.current = Math.max(0, activeConnectCountRef.current - 1);
|
|
8995
|
-
if (!
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
}
|
|
8734
|
+
if (!current || activeConnectCountRef.current !== 0) return;
|
|
8735
|
+
const startReconnect = startRunActivityReconnectRef.current;
|
|
8736
|
+
if (pendingRunActivityReconnectRef.current && startReconnect) {
|
|
8737
|
+
pendingRunActivityReconnectRef.current = false;
|
|
8738
|
+
startReconnect(runActivityReconnectGenerationRef.current);
|
|
9001
8739
|
}
|
|
9002
8740
|
}
|
|
9003
|
-
};
|
|
9004
|
-
|
|
9005
|
-
return () => {
|
|
9006
|
-
selection.release();
|
|
9007
|
-
detached = true;
|
|
9008
|
-
connectAbortController.abort();
|
|
9009
|
-
threads.detach(agent);
|
|
9010
|
-
};
|
|
8741
|
+
});
|
|
8742
|
+
return () => handle.release();
|
|
9011
8743
|
}, [
|
|
8744
|
+
connection,
|
|
9012
8745
|
resolvedThreadId,
|
|
9013
8746
|
agent,
|
|
9014
8747
|
resolvedAgentId,
|
|
9015
8748
|
hasExplicitThreadId,
|
|
9016
|
-
inspectorRequestId
|
|
9017
|
-
failInspectorOverride,
|
|
9018
|
-
threads,
|
|
9019
|
-
trackConnection
|
|
8749
|
+
inspectorRequestId
|
|
9020
8750
|
]);
|
|
9021
8751
|
useEffect(() => {
|
|
9022
8752
|
if (!hasNativeIntelligenceRunActivity) return;
|
|
@@ -9535,8 +9265,6 @@ CopilotModalHeader.DrawerLauncher.displayName = "CopilotModalHeader.DrawerLaunch
|
|
|
9535
9265
|
|
|
9536
9266
|
//#endregion
|
|
9537
9267
|
//#region src/components/chat/CopilotSidebarView.tsx
|
|
9538
|
-
const DEFAULT_SIDEBAR_WIDTH = 480;
|
|
9539
|
-
const SIDEBAR_TRANSITION_MS = 260;
|
|
9540
9268
|
/**
|
|
9541
9269
|
* The chat in a side panel: a `complementary` region named by
|
|
9542
9270
|
* `labels.sidebarLabel`, with a header, the chat view and a toggle button.
|
|
@@ -9564,29 +9292,18 @@ function CopilotSidebarViewInternal({ header, toggleButton, width, position = "r
|
|
|
9564
9292
|
const configuration = useCopilotChatConfiguration();
|
|
9565
9293
|
const isSidebarOpen = configuration?.isModalOpen ?? false;
|
|
9566
9294
|
const sidebarRef = useRef(null);
|
|
9567
|
-
const [
|
|
9295
|
+
const [measuredWidth, setMeasuredWidth] = useState(width ?? ɵSIDEBAR_DEFAULT_WIDTH$1);
|
|
9296
|
+
const sidebarWidth = width ?? measuredWidth;
|
|
9568
9297
|
useEffect(() => {
|
|
9569
9298
|
if (width !== void 0) return;
|
|
9570
|
-
if (typeof window === "undefined") return;
|
|
9571
9299
|
const element = sidebarRef.current;
|
|
9572
9300
|
if (!element) return;
|
|
9573
|
-
|
|
9574
|
-
const rect = element.getBoundingClientRect();
|
|
9575
|
-
if (rect.width > 0) setSidebarWidth(rect.width);
|
|
9576
|
-
};
|
|
9577
|
-
updateWidth();
|
|
9578
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
9579
|
-
const observer = new ResizeObserver(() => updateWidth());
|
|
9580
|
-
observer.observe(element);
|
|
9581
|
-
return () => observer.disconnect();
|
|
9582
|
-
}
|
|
9583
|
-
window.addEventListener("resize", updateWidth);
|
|
9584
|
-
return () => window.removeEventListener("resize", updateWidth);
|
|
9301
|
+
return ɵwatchElementWidth$1(element, setMeasuredWidth);
|
|
9585
9302
|
}, [width]);
|
|
9586
|
-
const widthCss = ɵdimensionToCss$1(sidebarWidth,
|
|
9303
|
+
const widthCss = ɵdimensionToCss$1(sidebarWidth, ɵSIDEBAR_DEFAULT_WIDTH$1);
|
|
9587
9304
|
const dockRef = useRef(null);
|
|
9588
9305
|
useLayoutEffect(() => {
|
|
9589
|
-
const dock = ɵcreateDockedSidebar$1(document, { transitionMs: SIDEBAR_TRANSITION_MS });
|
|
9306
|
+
const dock = ɵcreateDockedSidebar$1(document, { transitionMs: ɵSIDEBAR_TRANSITION_MS$1 });
|
|
9590
9307
|
dockRef.current = dock;
|
|
9591
9308
|
return () => {
|
|
9592
9309
|
dock.dispose();
|
|
@@ -9667,8 +9384,6 @@ CopilotSidebarView.displayName = "CopilotSidebarView";
|
|
|
9667
9384
|
|
|
9668
9385
|
//#endregion
|
|
9669
9386
|
//#region src/components/chat/CopilotPopupView.tsx
|
|
9670
|
-
const DEFAULT_POPUP_WIDTH = 420;
|
|
9671
|
-
const DEFAULT_POPUP_HEIGHT = 560;
|
|
9672
9387
|
function CopilotPopupView({ header, toggleButton, width, height, clickOutsideToClose, defaultOpen = true, className, ...restProps }) {
|
|
9673
9388
|
const { open, onOpenChange } = useModalOpenControl();
|
|
9674
9389
|
const hasOpenControl = open !== void 0 || onOpenChange !== void 0;
|
|
@@ -9696,22 +9411,12 @@ function CopilotPopupViewInternal({ header, toggleButton, width, height, clickOu
|
|
|
9696
9411
|
const setModalOpen = configuration?.setModalOpen;
|
|
9697
9412
|
const labels = configuration?.labels ?? CopilotChatDefaultLabels$1;
|
|
9698
9413
|
const containerRef = useRef(null);
|
|
9699
|
-
const [
|
|
9700
|
-
const
|
|
9414
|
+
const [presence] = useState(() => ɵcreateExitPresence$1(isPopupOpen));
|
|
9415
|
+
const { isRendered, isClosing: isAnimatingOut } = useSyncExternalStore(presence.subscribe, presence.getState, presence.getState);
|
|
9701
9416
|
useEffect(() => {
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
return;
|
|
9706
|
-
}
|
|
9707
|
-
if (!isRendered) return;
|
|
9708
|
-
setIsAnimatingOut(true);
|
|
9709
|
-
const timeout = setTimeout(() => {
|
|
9710
|
-
setIsRendered(false);
|
|
9711
|
-
setIsAnimatingOut(false);
|
|
9712
|
-
}, ɵPOPUP_ANIMATION_MS$1);
|
|
9713
|
-
return () => clearTimeout(timeout);
|
|
9714
|
-
}, [isPopupOpen, isRendered]);
|
|
9417
|
+
presence.setOpen(isPopupOpen);
|
|
9418
|
+
}, [presence, isPopupOpen]);
|
|
9419
|
+
useEffect(() => () => presence.dispose(), [presence]);
|
|
9715
9420
|
useEffect(() => {
|
|
9716
9421
|
if (!isPopupOpen) return;
|
|
9717
9422
|
return ɵbindPopupDismiss$1({
|
|
@@ -9726,8 +9431,8 @@ function CopilotPopupViewInternal({ header, toggleButton, width, height, clickOu
|
|
|
9726
9431
|
]);
|
|
9727
9432
|
const headerElement = useMemo(() => renderSlot(header, CopilotModalHeader, {}), [header]);
|
|
9728
9433
|
const toggleButtonElement = useMemo(() => renderSlot(toggleButton, CopilotChatToggleButton, {}), [toggleButton]);
|
|
9729
|
-
const resolvedWidth = ɵdimensionToCss$1(width,
|
|
9730
|
-
const resolvedHeight = ɵdimensionToCss$1(height,
|
|
9434
|
+
const resolvedWidth = ɵdimensionToCss$1(width, ɵPOPUP_DEFAULT_WIDTH$1);
|
|
9435
|
+
const resolvedHeight = ɵdimensionToCss$1(height, ɵPOPUP_DEFAULT_HEIGHT$1);
|
|
9731
9436
|
const popupStyle = useMemo(() => ({
|
|
9732
9437
|
"--copilot-popup-width": resolvedWidth,
|
|
9733
9438
|
"--copilot-popup-height": resolvedHeight,
|
|
@@ -9927,7 +9632,11 @@ function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed
|
|
|
9927
9632
|
const configuration = useCopilotChatConfiguration();
|
|
9928
9633
|
const { licensed, licensePending } = ɵresolveThreadsLicense$1(useLicenseContext());
|
|
9929
9634
|
const providerAgentId = useDefaultAgentId();
|
|
9930
|
-
const resolvedAgentId =
|
|
9635
|
+
const resolvedAgentId = ɵresolveAgentId$1({
|
|
9636
|
+
agentId,
|
|
9637
|
+
chatAgentId: configuration?.agentId,
|
|
9638
|
+
providerAgentId
|
|
9639
|
+
});
|
|
9931
9640
|
const activeThreadId = configuration?.threadId ?? null;
|
|
9932
9641
|
const { threads, isLoading, listError, fetchMoreError, hasMoreThreads, isFetchingMoreThreads, archiveThread, unarchiveThread, deleteThread, fetchMoreThreads, refetchThreads, startNewThread } = useThreads({
|
|
9933
9642
|
agentId: resolvedAgentId,
|
|
@@ -10181,5 +9890,5 @@ const WildcardToolCallRender = defineToolCallRenderer({
|
|
|
10181
9890
|
});
|
|
10182
9891
|
|
|
10183
9892
|
//#endregion
|
|
10184
|
-
export { A2UI_FENCE_LANGUAGE, ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError, AGUIError, AGUI_METADATA_KEY, AbstractAgent, ActivityDeltaEventSchema, ActivityMessageSchema, ActivitySnapshotEventSchema, AddOperationSchema, AgentCapabilitiesSchema, AgentRegistry, AgentThreadLockedError, AssistantMessageSchema, AttributableSchema, AudioInputContentSchema, AudioInputPartSchema, AudioPartSchema, AudioRecorderError, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, BaseEventSchema, BaseMessageSchema, CompatibilityBoundary, ContentPartSchema, ContextSchema, ContextStore, CopilotChat, CopilotChatAssistantMessage_default as CopilotChatAssistantMessage, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatDefaultLabels, CopilotChatInput_default as CopilotChatInput, CopilotChatMessageView, CopilotChatReasoningMessage_default as CopilotChatReasoningMessage, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToolCallGroup, CopilotChatToolCallsView, CopilotChatUserMessage_default as CopilotChatUserMessage, CopilotChatView_default as CopilotChatView, CopilotChatWorkSummary, CopilotKitCore, CopilotKitCoreErrorCode, CopilotKitCoreReact, CopilotKitCoreRuntimeConnectionStatus, CopilotKitHeaderResolutionError, CopilotKitInspector, CopilotKitProvider, CopilotKitStyles, CopilotModalHeader, CopilotPopup, CopilotPopupView, CopilotSidebar, CopilotSidebarView, CopilotThreadsDrawer, CopyOperationSchema, CustomEventSchema, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, DataSourceSchema, DebugLogger, DeveloperMessageSchema, DocumentInputContentSchema, DocumentInputPartSchema, DocumentPartSchema, EventSchema, EventSchemas, EventType, EventTypeSchema, ExecutionCapabilitiesSchema, FileSourceSchema, FilterToolCallsMiddleware, FunctionCallSchema, FunctionMiddleware, GENERATE_SANDBOXED_UI_TOOL_NAME, GenerateSandboxedUiArgsSchema, HttpAgent, HumanInTheLoopCapabilitiesSchema, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, IdentityCapabilitiesSchema, ImageInputContentSchema, ImageInputPartSchema, ImagePartSchema, InputContentDataSourceSchema, InputContentSchema, InputContentSourceSchema, InputContentUrlSourceSchema, IntelligenceAgent, IntelligenceIndicator, IntelligenceIndicatorView, InterruptSchema, JsonPatchOperationSchema, JsonPatchSchema, JsonPointerSchema, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, MEMORY_ERROR_REGISTRY, MarkdownRendererProvider, MemoryError, MessageSchema, MessagesSnapshotEventSchema, MetadataSchema, Middleware, MoveOperationSchema, MultiAgentCapabilitiesSchema, MultimodalCapabilitiesSchema, MultimodalInputCapabilitiesSchema, MultimodalOutputCapabilitiesSchema, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, OptionalMetadataSchema, OutputCapabilitiesSchema, PROTOCOL_VERSION, PartSourceSchema, ProxiedCopilotRuntimeAgent, RawEventSchema, ReasoningCapabilitiesSchema, ReasoningEncryptedValueEventSchema, ReasoningEncryptedValueSubtypeSchema, ReasoningEndEventSchema, ReasoningMessageChunkEventSchema, ReasoningMessageContentEventSchema, ReasoningMessageEndEventSchema, ReasoningMessageSchema, ReasoningMessageStartEventSchema, ReasoningStartEventSchema, RemoveOperationSchema, ReplaceOperationSchema, ResumeEntrySchema, RoleSchema, RunAgentInputSchema, RunErrorEventSchema, RunFinishedCancelledOutcomeSchema, RunFinishedEventSchema, RunFinishedInterruptOutcomeSchema, RunFinishedOutcomeSchema, RunFinishedSuccessOutcomeSchema, RunHandler, RunStartedEventSchema, SandboxFunctionsContext, StateCapabilitiesSchema, StateDeltaEventSchema, StateManager, StateSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, StreamingMarkdownDefaultRenderer, SubagentErrorEventSchema, SubagentFinishedEventSchema, SubagentFinishedOutcomeSchema, SubagentFinishedSuccessOutcomeSchema, SubagentFinishedSuspendedOutcomeSchema, SubagentInfoSchema, SubagentRunIdSchema, SubagentStartedEventSchema, SuggestionEngine, SystemMessageSchema, TestOperationSchema, TextInputContentSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageRoleSchema, TextMessageStartEventSchema, TextPartSchema, TokenUsageSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallSchema, ToolCallStartEventSchema, ToolCallStatus, ToolMessageSchema, ToolSchema, ToolsCapabilitiesSchema, TranscriptionError, TranscriptionErrorCode, TransportCapabilitiesSchema, UrlSourceSchema, UseAgentUpdate, UserMessageSchema, VideoInputContentSchema, VideoInputPartSchema, VideoPartSchema, WebMCPRegistry, 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, 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, useLicenseContext, useMarkdownRenderer, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, verifyEvents, withAuthoritativeActivityTypes, ɵA2UIActivityController, ɵA2UI_DEFAULT_SURFACE_ID, ɵA2UI_LIFECYCLE_TEXT, ɵA2UI_OPERATIONS_KEY, ɵA2UI_PAINT_FALLBACK_MS, ɵA2UI_RECOVERY_DEFAULTS, ɵA2UI_ROOT_COMPONENT_ID, ɵA2UI_SKELETON_ROWS, ɵA2UI_SURFACE_ACTIVITY_TYPE, ɵA2UI_SURFACE_CONTENT_SCHEMA, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAudioRecorder, ɵAudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatSubmitter, ɵComposerAutosize, ɵCopyFeedback, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵInspectorThreadOverride, ɵInterruptController, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLearningAutoStarter, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, ɵOpenGenerativeUIController, ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPlaceholderCycler, ɵRENDER_A2UI_TOOL_NAME, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵRendererRegistry, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSTABLE_ARRAY_WARNINGS, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵTOOL_CALL_STATUS_ICONS, ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadsController, ɵagentUpdateHandlers, ɵappendTranscript, ɵbindDialogFocus, ɵbindPopupDismiss, ɵbindSuggestionsConfig, ɵbuildHumanInTheLoopTool, ɵbuildLearnFromUserActionPayload, ɵbuildOpenGenerativeUIContexts, ɵbuildToolCallRenderProps, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵclampSlashIndex, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, ɵcn, ɵcomponentToolDescription, ɵcomposerButtonState, ɵcopilotIconSvgAttributes, ɵcopilotIcons, ɵcountFailedToolCalls, ɵcreateChatSubmitter, ɵcreateComposerAutosize, ɵcreateDockedSidebar, ɵcreateLastUserMessageTracker, ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateObjectUrlFromSource, ɵcreateOpenGenerativeUITool, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadsDrawerActions, ɵcreateWaveformRenderer, ɵdecodeTextSource, ɵdeduplicateMessages, ɵdescribeActivityRendererFailure, ɵdescribeUnrenderedToolCalls, ɵdiagnoseMissingSurface, ɵdiagnoseUnpaintedSurface, ɵdiagnoseUnresolvedRoot, ɵdimensionToCss, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, ɵextractCompleteStyles, ɵfilterCommands, ɵfindActivityRenderer, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenUserMessageContent, ɵformatA2UIDebugPayload, ɵformatA2UIRetryLabel, ɵformatCountLabel, ɵformatLabel, ɵformatReasoningDuration, ɵformatReasoningDurationLabel, ɵformatToolNames, ɵformatWorkDuration, ɵgetA2UIOperationSurfaceId, ɵgetA2UIOperations, ɵgetA2UIProgressPhase, ɵgetAgentCapabilities, ɵgetAgentInterruptState, ɵgetAgentResolver, ɵgetArgumentPreview, ɵgetBranchNavState, ɵgetChatViewState, ɵgetCustomMessageRenderProps, ɵgetInlineFeatureWarningSpec, ɵgetLastUserMessageId, ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetMessageFeedback, ɵgetMessageFeedbackControls, ɵgetThreadsDrawerElementProps, ɵgetToolCallBadge, ɵgetToolCallGroupState, ɵgetToolCallLayouts, ɵgetToolCallPreview, ɵgetToolCallRendererNames, ɵgetToolCallRowStatus, ɵgetToolCallStatus, ɵgetToolResults, ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaParts, ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵgroupA2UIOperationsBySurface, ɵhasAssistantMessageText, ɵhitlRenderProps, ɵinitialKeyboardState, ɵinspectorKiteFill, ɵinspectorKiteIcon, ɵinspectorShortcuts, ɵisCopilotKitFeature, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisMobileViewport, ɵisOpenGenerativeUIActive, ɵisRetryableMemoryStatus, ɵisScrolledToBottom, ɵisTurnWorkOpen, ɵisTurnWorking, ɵjoinPhoenixChannel$, ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmorphViewTransition, ɵnextSlashIndex, ɵnormalizeAutoScroll, ɵnormalizeToolCallStatus, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, ɵpluralize, ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, ɵreadA2UILifecycle, ɵreadKeyboardState, ɵrecordAnnotation, ɵrecordWorkTime, ɵreportProviderConfigDiagnostics, ɵreserveLicenseBannerOffset, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveA2UIDebugExposure, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentThreadId, ɵresolveChatNotice, ɵresolveComposerKey, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveProviderConfig, ɵresolveSlashKey, ɵresolveThreadsLicense, ɵresolveToolCallAgentId, ɵresolveToolCallRenderer, ɵrmsAmplitude, ɵrunA2UIAction, ɵrunMcpFollowUp, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵsetMessageFeedback, ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowMessageCursor, ɵsnapshotAgentState, ɵstopAgentWithFallback, ɵstringifyToolCallAttr, ɵstringifyToolCallPayload, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentUpdates, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToMessageFeedback, ɵsurfaceHasRenderableContent, ɵthreadAdapterEvents, ɵtoA2UIClientEvent, ɵtoDrawerThread, ɵtoLearningConfig, ɵtoolCallAppearance, ɵtoolRendererShapeChanged, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵwaitForActiveRun, ɵwatchKeyboardState, ɵwatchMobileViewport, ɵwithHeaderDefaults };
|
|
9893
|
+
export { A2UI_FENCE_LANGUAGE, ACTIVITY_HISTORY_METADATA, AGUIConnectNotImplementedError, AGUIError, AGUI_METADATA_KEY, AbstractAgent, ActivityDeltaEventSchema, ActivityMessageSchema, ActivitySnapshotEventSchema, AddOperationSchema, AgentCapabilitiesSchema, AgentRegistry, AgentThreadLockedError, AssistantMessageSchema, AttributableSchema, AudioInputContentSchema, AudioInputPartSchema, AudioPartSchema, AudioRecorderError, BackwardCompatibility_0_0_39, BackwardCompatibility_0_0_45, BackwardCompatibility_0_0_57, BaseEventSchema, BaseMessageSchema, CompatibilityBoundary, ContentPartSchema, ContextSchema, ContextStore, CopilotChat, CopilotChatAssistantMessage_default as CopilotChatAssistantMessage, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatDefaultLabels, CopilotChatInput_default as CopilotChatInput, CopilotChatMessageView, CopilotChatReasoningMessage_default as CopilotChatReasoningMessage, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToolCallGroup, CopilotChatToolCallsView, CopilotChatUserMessage_default as CopilotChatUserMessage, CopilotChatView_default as CopilotChatView, CopilotChatWorkSummary, CopilotKitCore, CopilotKitCoreErrorCode, CopilotKitCoreReact, CopilotKitCoreRuntimeConnectionStatus, CopilotKitHeaderResolutionError, CopilotKitInspector, CopilotKitProvider, CopilotKitStyles, CopilotModalHeader, CopilotPopup, CopilotPopupView, CopilotSidebar, CopilotSidebarView, CopilotThreadsDrawer, CopyOperationSchema, CustomEventSchema, DEFAULT_OPEN_GENERATIVE_UI_DESIGN_SKILL, DataSourceSchema, DebugLogger, DeveloperMessageSchema, DocumentInputContentSchema, DocumentInputPartSchema, DocumentPartSchema, EventSchema, EventSchemas, EventType, EventTypeSchema, ExecutionCapabilitiesSchema, FileSourceSchema, FilterToolCallsMiddleware, FunctionCallSchema, FunctionMiddleware, GENERATE_SANDBOXED_UI_TOOL_NAME, GenerateSandboxedUiArgsSchema, HttpAgent, HumanInTheLoopCapabilitiesSchema, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, IdentityCapabilitiesSchema, ImageInputContentSchema, ImageInputPartSchema, ImagePartSchema, InputContentDataSourceSchema, InputContentSchema, InputContentSourceSchema, InputContentUrlSourceSchema, IntelligenceAgent, IntelligenceIndicator, IntelligenceIndicatorView, InterruptSchema, JsonPatchOperationSchema, JsonPatchSchema, JsonPointerSchema, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, MEMORY_ERROR_REGISTRY, MarkdownRendererProvider, MemoryError, MessageSchema, MessagesSnapshotEventSchema, MetadataSchema, Middleware, MoveOperationSchema, MultiAgentCapabilitiesSchema, MultimodalCapabilitiesSchema, MultimodalInputCapabilitiesSchema, MultimodalOutputCapabilitiesSchema, OPEN_GENERATIVE_UI_ACTIVITY_TYPE, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, OptionalMetadataSchema, OutputCapabilitiesSchema, PROTOCOL_VERSION, PartSourceSchema, ProxiedCopilotRuntimeAgent, RawEventSchema, ReasoningCapabilitiesSchema, ReasoningEncryptedValueEventSchema, ReasoningEncryptedValueSubtypeSchema, ReasoningEndEventSchema, ReasoningMessageChunkEventSchema, ReasoningMessageContentEventSchema, ReasoningMessageEndEventSchema, ReasoningMessageSchema, ReasoningMessageStartEventSchema, ReasoningStartEventSchema, RemoveOperationSchema, ReplaceOperationSchema, ResumeEntrySchema, RoleSchema, RunAgentInputSchema, RunErrorEventSchema, RunFinishedCancelledOutcomeSchema, RunFinishedEventSchema, RunFinishedInterruptOutcomeSchema, RunFinishedOutcomeSchema, RunFinishedSuccessOutcomeSchema, RunHandler, RunStartedEventSchema, SandboxFunctionsContext, StateCapabilitiesSchema, StateDeltaEventSchema, StateManager, StateSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, StreamingMarkdownDefaultRenderer, SubagentErrorEventSchema, SubagentFinishedEventSchema, SubagentFinishedOutcomeSchema, SubagentFinishedSuccessOutcomeSchema, SubagentFinishedSuspendedOutcomeSchema, SubagentInfoSchema, SubagentRunIdSchema, SubagentStartedEventSchema, SuggestionEngine, SystemMessageSchema, TestOperationSchema, TextInputContentSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageRoleSchema, TextMessageStartEventSchema, TextPartSchema, TokenUsageSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallSchema, ToolCallStartEventSchema, ToolCallStatus, ToolMessageSchema, ToolSchema, ToolsCapabilitiesSchema, TranscriptionError, TranscriptionErrorCode, TransportCapabilitiesSchema, UrlSourceSchema, UseAgentUpdate, UserMessageSchema, VideoInputContentSchema, VideoInputPartSchema, VideoPartSchema, WebMCPRegistry, 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, 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, useLicenseContext, useMarkdownRenderer, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, verifyEvents, withAuthoritativeActivityTypes, ɵA2UIActivityController, ɵA2UI_DEFAULT_SURFACE_ID, ɵA2UI_LIFECYCLE_TEXT, ɵA2UI_OPERATIONS_KEY, ɵA2UI_PAINT_FALLBACK_MS, ɵA2UI_RECOVERY_DEFAULTS, ɵA2UI_ROOT_COMPONENT_ID, ɵA2UI_SKELETON_ROWS, ɵA2UI_SURFACE_ACTIVITY_TYPE, ɵA2UI_SURFACE_CONTENT_SCHEMA, ɵALL_AGENT_UPDATES, ɵAgentResolver, ɵAttachmentQueue, ɵAudioRecorder, ɵAudioRecorderError, ɵCOMPOSER_DEFAULT_MAX_ROWS, ɵCOPILOTKIT_FEATURES, ɵCOPILOT_CLOUD_PUBLIC_API_KEY_HEADER, ɵCOPILOT_CLOUD_RUNTIME_URL, ɵCOPY_FEEDBACK_RESET_MS, ɵChatConfigurationStore, ɵChatConnection, ɵChatSubmitter, ɵComposerAutosize, ɵComposerController, ɵCopyFeedback, ɵDockedSidebar, ɵDockedSidebarRegistry, ɵExitPresence, ɵFEEDBACK_COMMENT_CLOSE_DELAY_MS, ɵFeedbackCommentController, ɵFreshThreadId, ɵGENERATE_SANDBOXED_UI_ARGS_SCHEMA, ɵHITL_ABORTED_MESSAGE, ɵHOVER_MENU_CLOSE_DELAY_MS, ɵHoverMenuController, ɵHumanInTheLoopRegistry, ɵINLINE_FEATURE_WARNING_STYLE, ɵInspectorThreadOverride, ɵInterruptController, ɵInterruptExpiredError, ɵInterruptState, ɵKEYBOARD_OPEN_THRESHOLD_PX, ɵLICENSE_BANNER_OFFSET, ɵLICENSE_BANNER_STYLE, ɵLearningAutoStarter, ɵMAX_SOCKET_RETRIES, ɵMESSAGE_FEEDBACK_EVENT_NAME, ɵMESSAGE_FEEDBACK_MAX_COMMENT_LENGTH, ɵMOBILE_MAX_WIDTH_QUERY, ɵMessageViewModel, ɵOPEN_GENERATIVE_UI_CONTENT_SCHEMA, ɵOPEN_GENERATIVE_UI_DESIGN_CONTEXT_DESCRIPTION, ɵOPEN_GENERATIVE_UI_SANDBOX_FUNCTIONS_CONTEXT_DESCRIPTION, ɵOpenGenerativeUIController, ɵPLACEHOLDER_CYCLE_MS, ɵPOPUP_ANIMATION_MS, ɵPOPUP_DEFAULT_HEIGHT, ɵPOPUP_DEFAULT_WIDTH, ɵPlaceholderCycler, ɵRENDER_A2UI_TOOL_NAME, ɵRESIZE_SETTLE_MS, ɵRUNTIME_PROBE_TIMEOUT_MS, ɵReasoningDisclosure, ɵRendererRegistry, ɵRuntimeInfoStore, ɵSCROLL_BOTTOM_THRESHOLD_PX, ɵSIDEBAR_DEFAULT_WIDTH, ɵSIDEBAR_TRANSITION_MS, ɵSTABLE_ARRAY_WARNINGS, ɵStickToBottom, ɵTAB_STOP_SELECTOR, ɵTHREAD_REQUEST_TIMEOUT_MS, ɵTOOL_CALL_STATUS_ICONS, ɵTOOL_CALL_STATUS_LABEL_KEYS, ɵTRANSCRIPTION_ERROR_TIMEOUT_MS, ɵThreadSelection, ɵThreadSwitchCoordinator, ɵThreadsController, ɵadaptDefaultToolCallRenderProps, ɵaddOpenGenerativeUIContexts, ɵagentUpdateHandlers, ɵappendTranscript, ɵassembleActivityRenderers, ɵassembleHumanInTheLoop, ɵassembleProviderRegistry, ɵassembleProviderToolRenderers, ɵassembleProviderTools, ɵbindDialogFocus, ɵbindPopupDismiss, ɵbindSuggestionsConfig, ɵbuildHumanInTheLoopTool, ɵbuildLearnFromUserActionPayload, ɵbuildOpenGenerativeUIContexts, ɵbuildToolCallRenderProps, ɵbuildUserMessage, ɵbuildUserMessageContent, ɵcanPreviewDocument, ɵclampSlashIndex, ɵclearAgentInterruptState, ɵclearAgentThreadCursors, ɵcn, ɵcomponentToolDescription, ɵcomposerButtonState, ɵcopilotIconSvgAttributes, ɵcopilotIcons, ɵcountFailedToolCalls, ɵcreateChatSubmitter, ɵcreateComposerAutosize, ɵcreateDockedSidebar, ɵcreateExitPresence, ɵcreateLastUserMessageTracker, ɵcreateMemoryStore, ɵcreateMessageViewModel, ɵcreateObjectUrlFromSource, ɵcreateOpenGenerativeUITool, ɵcreateStickToBottom, ɵcreateThreadSelectors, ɵcreateThreadStore, ɵcreateThreadsDrawerActions, ɵcreateWaveformRenderer, ɵdecodeTextSource, ɵdeduplicateMessages, ɵdescribeActivityRendererFailure, ɵdescribeUnrenderedToolCalls, ɵdiagnoseMissingSurface, ɵdiagnoseUnpaintedSurface, ɵdiagnoseUnresolvedRoot, ɵdimensionToCss, ɵdockedSidebarRegistryFor, ɵduplicateMessagesWarning, ɵextractCompleteStyles, ɵfilterCommands, ɵfindActivityRenderer, ɵfindChatInput, ɵfindToolMessage, ɵfitTextareaHeight, ɵflattenCommandItems, ɵflattenToolsMenuForDisplay, ɵflattenUserMessageContent, ɵformatA2UIDebugPayload, ɵformatA2UIRetryLabel, ɵformatCountLabel, ɵformatLabel, ɵformatReasoningDuration, ɵformatReasoningDurationLabel, ɵformatToolNames, ɵformatWorkDuration, ɵgetA2UIOperationSurfaceId, ɵgetA2UIOperations, ɵgetA2UIProgressPhase, ɵgetAgentCapabilities, ɵgetAgentInterruptState, ɵgetAgentResolver, ɵgetArgumentPreview, ɵgetBranchNavState, ɵgetChatViewState, ɵgetCustomMessageRenderProps, ɵgetInlineFeatureWarningSpec, ɵgetLastUserMessageId, ɵgetLatestTurnKey, ɵgetLicenseBannerSpec, ɵgetMessageFeedback, ɵgetMessageFeedbackControls, ɵgetMessageRunStateSnapshot, ɵgetReasoningHeaderLabel, ɵgetThreadsDrawerElementProps, ɵgetToolCallBadge, ɵgetToolCallGroupState, ɵgetToolCallLayouts, ɵgetToolCallPreview, ɵgetToolCallRendererNames, ɵgetToolCallRowStatus, ɵgetToolCallStatus, ɵgetToolResults, ɵgetTurnWork, ɵgetUserMessageMediaFilename, ɵgetUserMessageMediaParts, ɵgetWorkOpenState, ɵgetWorkSummaryText, ɵgroupA2UIOperationsBySurface, ɵhasAssistantMessageText, ɵhitlRenderProps, ɵimplementsConnect, ɵinitialKeyboardState, ɵinspectorKiteFill, ɵinspectorKiteIcon, ɵinspectorShortcuts, ɵisContentPart, ɵisContentScrolledToBottom, ɵisCopilotKitFeature, ɵisFocusVisible, ɵisHttpAgent, ɵisLearningFeedbackEnabled, ɵisMobileViewport, ɵisOpenGenerativeUIActive, ɵisOwnFeedbackThumb, ɵisRetryableMemoryStatus, ɵisScrolledToBottom, ɵisTurnWorkOpen, ɵisTurnWorking, ɵjoinPhoenixChannel$, ɵloadWebsandbox, ɵmapMemoryMetadataEvent, ɵmatchActivityRenderer, ɵmeasureTextarea, ɵmemoryAdapterEvents, ɵmemoryDomainEvents, ɵmemoryReducer, ɵmemoryRestEvents, ɵmessagesFingerprint, ɵmorphViewTransition, ɵnextSlashIndex, ɵnextTabStop, ɵnormalizeAutoScroll, ɵnormalizeToolCallStatus, ɵnormalizeToolsMenu, ɵobservePhoenixEvent$, ɵobservePhoenixJoinOutcome$, ɵobservePhoenixSocketHealth$, ɵobservePhoenixSocketSignals$, ɵparseSlashQuery, ɵparseToolCallArguments, ɵphoenixChannel$, ɵphoenixSocket$, ɵpinMessageToTop, ɵpluralize, ɵprocessPartialHtml, ɵprojectThread, ɵpublicKeyHeaderDefaults, ɵreadA2UILifecycle, ɵreadKeyboardState, ɵrecordAnnotation, ɵrecordWorkTime, ɵregisterFrontendTools, ɵreportProviderConfigDiagnostics, ɵreserveLicenseBannerOffset, ɵresetAgentThreadBaseline, ɵresetMessageFeedbackCache, ɵresolveA2UIActivation, ɵresolveA2UIDebugExposure, ɵresolveActivityRenderer, ɵresolveAgentId, ɵresolveAgentThreadId, ɵresolveChatNotice, ɵresolveComposerKey, ɵresolveCustomMessageRenderContext, ɵresolveCustomMessageRenderers, ɵresolveLicenseState, ɵresolveProviderConfig, ɵresolveSlashKey, ɵresolveThreadsLicense, ɵresolveToolCallAgentId, ɵresolveToolCallRenderer, ɵrmsAmplitude, ɵrunA2UIAction, ɵrunMcpFollowUp, ɵselectFetchMoreError, ɵselectHasNextPage, ɵselectIsFetchingNextPage, ɵselectIsMutating, ɵselectMemories, ɵselectMemoriesAvailable, ɵselectMemoriesError, ɵselectMemoriesIsLoading, ɵselectMemoriesIsMutating, ɵselectMemoriesRealtimeStatus, ɵselectThreads, ɵselectThreadsError, ɵselectThreadsIsLoading, ɵserializeContextValue, ɵsetMessageFeedback, ɵshallowEqualRecord, ɵshouldShowAssistantToolbar, ɵshouldShowMessageCursor, ɵshowsComposerDisclaimer, ɵsnapshotAgentState, ɵstableArrayPropWarning, ɵstopAgentWithFallback, ɵstringifyToolCallAttr, ɵstringifyToolCallPayload, ɵsubscribeToAgentErrors, ɵsubscribeToAgentSuggestions, ɵsubscribeToAgentUpdates, ɵsubscribeToLearningFeedbackEnabled, ɵsubscribeToMessageFeedback, ɵsurfaceHasRenderableContent, ɵsyncRecorderToMode, ɵthreadAdapterEvents, ɵtoA2UIClientEvent, ɵtoDefaultToolCallStatus, ɵtoDrawerThread, ɵtoLearningConfig, ɵtoolCallAppearance, ɵtoolRendererShapeChanged, ɵtranscribeAudio, ɵtranscriptionErrorMessageKey, ɵtranscriptionErrorNotice, ɵvalidateAgentBinding, ɵwaitForActiveRun, ɵwatchElementHeight, ɵwatchElementWidth, ɵwatchKeyboardState, ɵwatchMobileViewport, ɵwithHeaderDefaults };
|
|
10185
9894
|
//# sourceMappingURL=index.mjs.map
|