@copilotkit/react-core 1.62.2 → 1.62.3

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/v2/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_copilotkit = require('../copilotkit-lHheGQWt.cjs');
4
+ const require_copilotkit = require('../copilotkit-5MptLWNR.cjs');
5
5
  require("./index.css");
6
6
  let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
7
7
 
@@ -87,6 +87,7 @@ exports.useLearnFromUserAction = require_copilotkit.useLearnFromUserAction;
87
87
  exports.useLearnFromUserActionInCurrentThread = require_copilotkit.useLearnFromUserActionInCurrentThread;
88
88
  exports.useLearningContainers = require_copilotkit.useLearningContainers;
89
89
  exports.useLearningContainersInCurrentThread = require_copilotkit.useLearningContainersInCurrentThread;
90
+ exports.useMemories = require_copilotkit.useMemories;
90
91
  exports.useRenderActivityMessage = require_copilotkit.useRenderActivityMessage;
91
92
  exports.useRenderCustomMessages = require_copilotkit.useRenderCustomMessages;
92
93
  exports.useRenderTool = require_copilotkit.useRenderTool;
@@ -1,6 +1,6 @@
1
- import { $ as InterruptHandlerProps, $t as IntelligenceIndicator, A as LearnFromUserActionResult, At as useThreads, B as useCapabilities, Bt as CopilotModalHeaderProps, C as UseAttachmentsProps, Cn as CopilotChatLabels, Ct as CopilotChatAttachmentQueue, D as UseLearnFromUserActionInCurrentThreadRecorder, Dn as CopilotChatAudioRecorder, Dt as Thread, E as LearnFromUserActionInCurrentThreadInput, En as AudioRecorderState, Et as CopilotThreadsDrawerRowRenderer, F as useConfigureSuggestions, Ft as CopilotPopupView, G as useRenderTool, Gt as CopilotChat, H as useAgent, Ht as CopilotChatToggleButtonProps, I as useSuggestions, It as CopilotPopupViewProps, J as useRenderActivityMessage, Jt as CopilotChatViewProps, K as useComponent, Kt as CopilotChatProps, L as AgentContextInput, Lt as CopilotSidebarView, M as useLearnFromUserAction, Mt as CopilotPopupProps, N as UseInterruptConfig, Nt as CopilotSidebar, O as useLearnFromUserActionInCurrentThread, Ot as UseThreadsInput, P as useInterrupt, Pt as CopilotSidebarProps, Q as InterruptEvent, Qt as INTELLIGENCE_TURN_HEAD, R as JsonSerializable, Rt as CopilotSidebarViewProps, S as useLearningContainers, Sn as CopilotChatConfigurationValue, St as CopilotChatAttachmentRenderer, T as useAttachments, Tn as AudioRecorderError, Tt as CopilotThreadsDrawerProps, U as useHumanInTheLoop, Ut as DefaultCloseIcon, V as UseAgentUpdate, Vt as CopilotChatToggleButton, W as useDefaultRenderTool, Wt as DefaultOpenIcon, X as Interrupt, Xt as CopilotChatMessageView, Y as SandboxFunction, Yt as AutoScrollMode, Z as InterruptCancelFn, Zt as CopilotChatMessageViewProps, _ as CopilotKitCoreReactConfig, _n as CopilotChatInput, _t as CopilotKitInspectorProps, a as A2UIMessageRendererOptions, an as CopilotChatSuggestionView, at as ReactFrontendTool, b as useLearningContainersInCurrentThread, bn as CopilotChatConfigurationProvider, bt as AttachmentModality, c as InspectorAnchor, cn as CopilotChatSuggestionPillProps, ct as useRenderCustomMessages, d as CopilotKitProvider, dn as CopilotChatUserMessage, dt as useRenderToolCall, en as IntelligenceIndicatorProps, et as InterruptRenderProps, f as CopilotKitProviderProps, fn as CopilotChatUserMessageProps, ft as MCPAppsActivityContent, g as CopilotKitCoreReact, gn as CopilotChatToolCallsViewProps, gt as CopilotKitInspector, h as useCopilotKit, hn as CopilotChatToolCallsView, ht as MCPAppsActivityType, i as A2UIActionInterceptor, in as IntelligenceIndicatorViewProps, it as ReactHumanInTheLoop, j as UseLearnFromUserActionRecorder, jt as CopilotPopup, k as LearnFromUserActionInput, kt as UseThreadsResult, l as SandboxFunctionsContext, ln as CopilotChatReasoningMessage, lt as ReactCustomMessageRenderer, m as CopilotKitContextValue, mn as CopilotChatAssistantMessageProps, mt as MCPAppsActivityRenderer, nn as IntelligenceIndicatorStatus, nt as ResumeEntry, o as A2UIUserAction, on as CopilotChatSuggestionViewProps, ot as ReactActivityMessageRenderer, p as A2UIRecoveryRendererOptions, pn as CopilotChatAssistantMessage, pt as MCPAppsActivityContentSchema, q as useFrontendTool, qt as CopilotChatView, r as CopilotKitProps, rn as IntelligenceIndicatorView, rt as defineToolCallRenderer, s as createA2UIMessageRenderer, sn as CopilotChatSuggestionPill, st as ReactToolCallRenderer, t as CopilotKit, tn as getIntelligenceTurnAnchors, tt as InterruptResolveFn, u as useSandboxFunctions, un as CopilotChatReasoningMessageProps, ut as ReactCustomMessageRendererPosition, v as CopilotKitCoreReactSubscriber, vn as CopilotChatInputProps, vt as WildcardToolCallRender, w as UseAttachmentsReturn, wn as useCopilotChatConfiguration, wt as CopilotThreadsDrawer, x as UseLearningContainersArgs, xn as CopilotChatConfigurationProviderProps, xt as AttachmentsConfig, y as UseLearningContainersInCurrentThreadArgs, yn as ToolsMenuItem, yt as Attachment, z as useAgentContext, zt as CopilotModalHeader } from "../copilotkit-Cga6AHO0.cjs";
1
+ import { $ as useComponent, $t as CopilotChatProps, A as useAttachments, An as CopilotChatLabels, At as CopilotChatAttachmentQueue, B as UseInterruptConfig, Bt as CopilotSidebar, C as NewMemory, Cn as CopilotChatToolCallsViewProps, Ct as CopilotKitInspector, D as useLearningContainers, Dn as CopilotChatConfigurationProvider, Dt as AttachmentModality, E as UseLearningContainersArgs, En as ToolsMenuItem, Et as Attachment, F as LearnFromUserActionResult, Ft as UseThreadsInput, G as JsonSerializable, Gt as CopilotSidebarViewProps, H as useConfigureSuggestions, Ht as CopilotPopupView, I as UseLearnFromUserActionRecorder, It as UseThreadsResult, J as UseAgentUpdate, Jt as CopilotChatToggleButton, K as useAgentContext, Kt as CopilotModalHeader, L as useLearnFromUserAction, Lt as useThreads, M as UseLearnFromUserActionInCurrentThreadRecorder, Mn as AudioRecorderError, Mt as CopilotThreadsDrawerProps, N as useLearnFromUserActionInCurrentThread, Nn as AudioRecorderState, Nt as CopilotThreadsDrawerRowRenderer, O as UseAttachmentsProps, On as CopilotChatConfigurationProviderProps, Ot as AttachmentsConfig, P as LearnFromUserActionInput, Pn as CopilotChatAudioRecorder, Pt as Thread, Q as useRenderTool, Qt as CopilotChat, R as UseMemoriesResult, Rt as CopilotPopup, S as MemoryScope, Sn as CopilotChatToolCallsView, St as MCPAppsActivityType, T as useLearningContainersInCurrentThread, Tn as CopilotChatInputProps, Tt as WildcardToolCallRender, U as useSuggestions, Ut as CopilotPopupViewProps, V as useInterrupt, Vt as CopilotSidebarProps, W as AgentContextInput, Wt as CopilotSidebarView, X as useHumanInTheLoop, Xt as DefaultCloseIcon, Y as useAgent, Yt as CopilotChatToggleButtonProps, Z as useDefaultRenderTool, Zt as DefaultOpenIcon, _ as CopilotKitCoreReactConfig, _n as CopilotChatReasoningMessageProps, _t as ReactCustomMessageRendererPosition, a as A2UIMessageRendererOptions, an as INTELLIGENCE_TURN_HEAD, at as InterruptEvent, b as MemoryChanges, bn as CopilotChatAssistantMessage, bt as MCPAppsActivityContentSchema, c as InspectorAnchor, cn as getIntelligenceTurnAnchors, ct as InterruptResolveFn, d as CopilotKitProvider, dn as IntelligenceIndicatorViewProps, dt as ReactHumanInTheLoop, en as CopilotChatView, et as useFrontendTool, f as CopilotKitProviderProps, fn as CopilotChatSuggestionView, ft as ReactFrontendTool, g as CopilotKitCoreReact, gn as CopilotChatReasoningMessage, gt as ReactCustomMessageRenderer, h as useCopilotKit, hn as CopilotChatSuggestionPillProps, ht as useRenderCustomMessages, i as A2UIActionInterceptor, in as CopilotChatMessageViewProps, it as InterruptCancelFn, j as LearnFromUserActionInCurrentThreadInput, jn as useCopilotChatConfiguration, jt as CopilotThreadsDrawer, k as UseAttachmentsReturn, kn as CopilotChatConfigurationValue, kt as CopilotChatAttachmentRenderer, l as SandboxFunctionsContext, ln as IntelligenceIndicatorStatus, lt as ResumeEntry, m as CopilotKitContextValue, mn as CopilotChatSuggestionPill, mt as ReactToolCallRenderer, nn as AutoScrollMode, nt as SandboxFunction, o as A2UIUserAction, on as IntelligenceIndicator, ot as InterruptHandlerProps, p as A2UIRecoveryRendererOptions, pn as CopilotChatSuggestionViewProps, pt as ReactActivityMessageRenderer, q as useCapabilities, qt as CopilotModalHeaderProps, r as CopilotKitProps, rn as CopilotChatMessageView, rt as Interrupt, s as createA2UIMessageRenderer, sn as IntelligenceIndicatorProps, st as InterruptRenderProps, t as CopilotKit, tn as CopilotChatViewProps, tt as useRenderActivityMessage, u as useSandboxFunctions, un as IntelligenceIndicatorView, ut as defineToolCallRenderer, v as CopilotKitCoreReactSubscriber, vn as CopilotChatUserMessage, vt as useRenderToolCall, w as UseLearningContainersInCurrentThreadArgs, wn as CopilotChatInput, wt as CopilotKitInspectorProps, x as MemoryKind, xn as CopilotChatAssistantMessageProps, xt as MCPAppsActivityRenderer, y as Memory, yn as CopilotChatUserMessageProps, yt as MCPAppsActivityContent, z as useMemories, zt as CopilotPopupProps } from "../copilotkit-BfFY1fzd.cjs";
2
2
  import "./index.css";
3
3
  import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
4
4
  export * from "@copilotkit/core";
5
5
  export * from "@ag-ui/client";
6
- export { type A2UIActionInterceptor, type A2UIMessageRendererOptions, type A2UIRecoveryRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, AutoScrollMode, CopilotChat, CopilotChatAssistantMessage, CopilotChatAssistantMessageProps, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatConfigurationProviderProps, CopilotChatConfigurationValue, CopilotChatInput, CopilotChatInputProps, CopilotChatLabels, CopilotChatMessageView, CopilotChatMessageViewProps, CopilotChatProps, CopilotChatReasoningMessage, CopilotChatReasoningMessageProps, CopilotChatSuggestionPill, CopilotChatSuggestionPillProps, CopilotChatSuggestionView, CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToggleButtonProps, CopilotChatToolCallsView, CopilotChatToolCallsViewProps, CopilotChatUserMessage, CopilotChatUserMessageProps, CopilotChatView, CopilotChatViewProps, CopilotKit, CopilotKitContextValue, CopilotKitCoreReact, CopilotKitCoreReactConfig, CopilotKitCoreReactSubscriber, CopilotKitInspector, CopilotKitInspectorProps, type CopilotKitProps, CopilotKitProvider, CopilotKitProviderProps, CopilotModalHeader, CopilotModalHeaderProps, CopilotPopup, CopilotPopupProps, CopilotPopupView, CopilotPopupViewProps, CopilotSidebar, CopilotSidebarProps, CopilotSidebarView, CopilotSidebarViewProps, CopilotThreadsDrawer, CopilotThreadsDrawerProps, CopilotThreadsDrawerRowRenderer, INTELLIGENCE_TURN_HEAD, InspectorAnchor, IntelligenceIndicator, IntelligenceIndicatorProps, IntelligenceIndicatorStatus, IntelligenceIndicatorView, IntelligenceIndicatorViewProps, Interrupt, InterruptCancelFn, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, InterruptResolveFn, JsonSerializable, LearnFromUserActionInCurrentThreadInput, LearnFromUserActionInput, LearnFromUserActionResult, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, ResumeEntry, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
6
+ export { type A2UIActionInterceptor, type A2UIMessageRendererOptions, type A2UIRecoveryRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, AutoScrollMode, CopilotChat, CopilotChatAssistantMessage, CopilotChatAssistantMessageProps, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatConfigurationProviderProps, CopilotChatConfigurationValue, CopilotChatInput, CopilotChatInputProps, CopilotChatLabels, CopilotChatMessageView, CopilotChatMessageViewProps, CopilotChatProps, CopilotChatReasoningMessage, CopilotChatReasoningMessageProps, CopilotChatSuggestionPill, CopilotChatSuggestionPillProps, CopilotChatSuggestionView, CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToggleButtonProps, CopilotChatToolCallsView, CopilotChatToolCallsViewProps, CopilotChatUserMessage, CopilotChatUserMessageProps, CopilotChatView, CopilotChatViewProps, CopilotKit, CopilotKitContextValue, CopilotKitCoreReact, CopilotKitCoreReactConfig, CopilotKitCoreReactSubscriber, CopilotKitInspector, CopilotKitInspectorProps, type CopilotKitProps, CopilotKitProvider, CopilotKitProviderProps, CopilotModalHeader, CopilotModalHeaderProps, CopilotPopup, CopilotPopupProps, CopilotPopupView, CopilotPopupViewProps, CopilotSidebar, CopilotSidebarProps, CopilotSidebarView, CopilotSidebarViewProps, CopilotThreadsDrawer, CopilotThreadsDrawerProps, CopilotThreadsDrawerRowRenderer, INTELLIGENCE_TURN_HEAD, InspectorAnchor, IntelligenceIndicator, IntelligenceIndicatorProps, IntelligenceIndicatorStatus, IntelligenceIndicatorView, IntelligenceIndicatorViewProps, Interrupt, InterruptCancelFn, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, InterruptResolveFn, JsonSerializable, LearnFromUserActionInCurrentThreadInput, LearnFromUserActionInput, LearnFromUserActionResult, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, Memory, MemoryChanges, MemoryKind, MemoryScope, NewMemory, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, ResumeEntry, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseMemoriesResult, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
@@ -1,6 +1,6 @@
1
- import { $ as InterruptHandlerProps, $t as IntelligenceIndicator, A as LearnFromUserActionResult, At as useThreads, B as useCapabilities, Bt as CopilotModalHeaderProps, C as UseAttachmentsProps, Cn as CopilotChatLabels, Ct as CopilotChatAttachmentQueue, D as UseLearnFromUserActionInCurrentThreadRecorder, Dn as CopilotChatAudioRecorder, Dt as Thread, E as LearnFromUserActionInCurrentThreadInput, En as AudioRecorderState, Et as CopilotThreadsDrawerRowRenderer, F as useConfigureSuggestions, Ft as CopilotPopupView, G as useRenderTool, Gt as CopilotChat, H as useAgent, Ht as CopilotChatToggleButtonProps, I as useSuggestions, It as CopilotPopupViewProps, J as useRenderActivityMessage, Jt as CopilotChatViewProps, K as useComponent, Kt as CopilotChatProps, L as AgentContextInput, Lt as CopilotSidebarView, M as useLearnFromUserAction, Mt as CopilotPopupProps, N as UseInterruptConfig, Nt as CopilotSidebar, O as useLearnFromUserActionInCurrentThread, Ot as UseThreadsInput, P as useInterrupt, Pt as CopilotSidebarProps, Q as InterruptEvent, Qt as INTELLIGENCE_TURN_HEAD, R as JsonSerializable, Rt as CopilotSidebarViewProps, S as useLearningContainers, Sn as CopilotChatConfigurationValue, St as CopilotChatAttachmentRenderer, T as useAttachments, Tn as AudioRecorderError, Tt as CopilotThreadsDrawerProps, U as useHumanInTheLoop, Ut as DefaultCloseIcon, V as UseAgentUpdate, Vt as CopilotChatToggleButton, W as useDefaultRenderTool, Wt as DefaultOpenIcon, X as Interrupt, Xt as CopilotChatMessageView, Y as SandboxFunction, Yt as AutoScrollMode, Z as InterruptCancelFn, Zt as CopilotChatMessageViewProps, _ as CopilotKitCoreReactConfig, _n as CopilotChatInput, _t as CopilotKitInspectorProps, a as A2UIMessageRendererOptions, an as CopilotChatSuggestionView, at as ReactFrontendTool, b as useLearningContainersInCurrentThread, bn as CopilotChatConfigurationProvider, bt as AttachmentModality, c as InspectorAnchor, cn as CopilotChatSuggestionPillProps, ct as useRenderCustomMessages, d as CopilotKitProvider, dn as CopilotChatUserMessage, dt as useRenderToolCall, en as IntelligenceIndicatorProps, et as InterruptRenderProps, f as CopilotKitProviderProps, fn as CopilotChatUserMessageProps, ft as MCPAppsActivityContent, g as CopilotKitCoreReact, gn as CopilotChatToolCallsViewProps, gt as CopilotKitInspector, h as useCopilotKit, hn as CopilotChatToolCallsView, ht as MCPAppsActivityType, i as A2UIActionInterceptor, in as IntelligenceIndicatorViewProps, it as ReactHumanInTheLoop, j as UseLearnFromUserActionRecorder, jt as CopilotPopup, k as LearnFromUserActionInput, kt as UseThreadsResult, l as SandboxFunctionsContext, ln as CopilotChatReasoningMessage, lt as ReactCustomMessageRenderer, m as CopilotKitContextValue, mn as CopilotChatAssistantMessageProps, mt as MCPAppsActivityRenderer, nn as IntelligenceIndicatorStatus, nt as ResumeEntry, o as A2UIUserAction, on as CopilotChatSuggestionViewProps, ot as ReactActivityMessageRenderer, p as A2UIRecoveryRendererOptions, pn as CopilotChatAssistantMessage, pt as MCPAppsActivityContentSchema, q as useFrontendTool, qt as CopilotChatView, r as CopilotKitProps, rn as IntelligenceIndicatorView, rt as defineToolCallRenderer, s as createA2UIMessageRenderer, sn as CopilotChatSuggestionPill, st as ReactToolCallRenderer, t as CopilotKit, tn as getIntelligenceTurnAnchors, tt as InterruptResolveFn, u as useSandboxFunctions, un as CopilotChatReasoningMessageProps, ut as ReactCustomMessageRendererPosition, v as CopilotKitCoreReactSubscriber, vn as CopilotChatInputProps, vt as WildcardToolCallRender, w as UseAttachmentsReturn, wn as useCopilotChatConfiguration, wt as CopilotThreadsDrawer, x as UseLearningContainersArgs, xn as CopilotChatConfigurationProviderProps, xt as AttachmentsConfig, y as UseLearningContainersInCurrentThreadArgs, yn as ToolsMenuItem, yt as Attachment, z as useAgentContext, zt as CopilotModalHeader } from "../copilotkit-DnLpJ2Cl.mjs";
1
+ import { $ as useComponent, $t as CopilotChatProps, A as useAttachments, An as CopilotChatLabels, At as CopilotChatAttachmentQueue, B as UseInterruptConfig, Bt as CopilotSidebar, C as NewMemory, Cn as CopilotChatToolCallsViewProps, Ct as CopilotKitInspector, D as useLearningContainers, Dn as CopilotChatConfigurationProvider, Dt as AttachmentModality, E as UseLearningContainersArgs, En as ToolsMenuItem, Et as Attachment, F as LearnFromUserActionResult, Ft as UseThreadsInput, G as JsonSerializable, Gt as CopilotSidebarViewProps, H as useConfigureSuggestions, Ht as CopilotPopupView, I as UseLearnFromUserActionRecorder, It as UseThreadsResult, J as UseAgentUpdate, Jt as CopilotChatToggleButton, K as useAgentContext, Kt as CopilotModalHeader, L as useLearnFromUserAction, Lt as useThreads, M as UseLearnFromUserActionInCurrentThreadRecorder, Mn as AudioRecorderError, Mt as CopilotThreadsDrawerProps, N as useLearnFromUserActionInCurrentThread, Nn as AudioRecorderState, Nt as CopilotThreadsDrawerRowRenderer, O as UseAttachmentsProps, On as CopilotChatConfigurationProviderProps, Ot as AttachmentsConfig, P as LearnFromUserActionInput, Pn as CopilotChatAudioRecorder, Pt as Thread, Q as useRenderTool, Qt as CopilotChat, R as UseMemoriesResult, Rt as CopilotPopup, S as MemoryScope, Sn as CopilotChatToolCallsView, St as MCPAppsActivityType, T as useLearningContainersInCurrentThread, Tn as CopilotChatInputProps, Tt as WildcardToolCallRender, U as useSuggestions, Ut as CopilotPopupViewProps, V as useInterrupt, Vt as CopilotSidebarProps, W as AgentContextInput, Wt as CopilotSidebarView, X as useHumanInTheLoop, Xt as DefaultCloseIcon, Y as useAgent, Yt as CopilotChatToggleButtonProps, Z as useDefaultRenderTool, Zt as DefaultOpenIcon, _ as CopilotKitCoreReactConfig, _n as CopilotChatReasoningMessageProps, _t as ReactCustomMessageRendererPosition, a as A2UIMessageRendererOptions, an as INTELLIGENCE_TURN_HEAD, at as InterruptEvent, b as MemoryChanges, bn as CopilotChatAssistantMessage, bt as MCPAppsActivityContentSchema, c as InspectorAnchor, cn as getIntelligenceTurnAnchors, ct as InterruptResolveFn, d as CopilotKitProvider, dn as IntelligenceIndicatorViewProps, dt as ReactHumanInTheLoop, en as CopilotChatView, et as useFrontendTool, f as CopilotKitProviderProps, fn as CopilotChatSuggestionView, ft as ReactFrontendTool, g as CopilotKitCoreReact, gn as CopilotChatReasoningMessage, gt as ReactCustomMessageRenderer, h as useCopilotKit, hn as CopilotChatSuggestionPillProps, ht as useRenderCustomMessages, i as A2UIActionInterceptor, in as CopilotChatMessageViewProps, it as InterruptCancelFn, j as LearnFromUserActionInCurrentThreadInput, jn as useCopilotChatConfiguration, jt as CopilotThreadsDrawer, k as UseAttachmentsReturn, kn as CopilotChatConfigurationValue, kt as CopilotChatAttachmentRenderer, l as SandboxFunctionsContext, ln as IntelligenceIndicatorStatus, lt as ResumeEntry, m as CopilotKitContextValue, mn as CopilotChatSuggestionPill, mt as ReactToolCallRenderer, nn as AutoScrollMode, nt as SandboxFunction, o as A2UIUserAction, on as IntelligenceIndicator, ot as InterruptHandlerProps, p as A2UIRecoveryRendererOptions, pn as CopilotChatSuggestionViewProps, pt as ReactActivityMessageRenderer, q as useCapabilities, qt as CopilotModalHeaderProps, r as CopilotKitProps, rn as CopilotChatMessageView, rt as Interrupt, s as createA2UIMessageRenderer, sn as IntelligenceIndicatorProps, st as InterruptRenderProps, t as CopilotKit, tn as CopilotChatViewProps, tt as useRenderActivityMessage, u as useSandboxFunctions, un as IntelligenceIndicatorView, ut as defineToolCallRenderer, v as CopilotKitCoreReactSubscriber, vn as CopilotChatUserMessage, vt as useRenderToolCall, w as UseLearningContainersInCurrentThreadArgs, wn as CopilotChatInput, wt as CopilotKitInspectorProps, x as MemoryKind, xn as CopilotChatAssistantMessageProps, xt as MCPAppsActivityRenderer, y as Memory, yn as CopilotChatUserMessageProps, yt as MCPAppsActivityContent, z as useMemories, zt as CopilotPopupProps } from "../copilotkit-Bp6BD8xe.mjs";
2
2
  import "./index.css";
3
3
  import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
4
4
  export * from "@copilotkit/core";
5
5
  export * from "@ag-ui/client";
6
- export { type A2UIActionInterceptor, type A2UIMessageRendererOptions, type A2UIRecoveryRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, AutoScrollMode, CopilotChat, CopilotChatAssistantMessage, CopilotChatAssistantMessageProps, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatConfigurationProviderProps, CopilotChatConfigurationValue, CopilotChatInput, CopilotChatInputProps, CopilotChatLabels, CopilotChatMessageView, CopilotChatMessageViewProps, CopilotChatProps, CopilotChatReasoningMessage, CopilotChatReasoningMessageProps, CopilotChatSuggestionPill, CopilotChatSuggestionPillProps, CopilotChatSuggestionView, CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToggleButtonProps, CopilotChatToolCallsView, CopilotChatToolCallsViewProps, CopilotChatUserMessage, CopilotChatUserMessageProps, CopilotChatView, CopilotChatViewProps, CopilotKit, CopilotKitContextValue, CopilotKitCoreReact, CopilotKitCoreReactConfig, CopilotKitCoreReactSubscriber, CopilotKitInspector, CopilotKitInspectorProps, type CopilotKitProps, CopilotKitProvider, CopilotKitProviderProps, CopilotModalHeader, CopilotModalHeaderProps, CopilotPopup, CopilotPopupProps, CopilotPopupView, CopilotPopupViewProps, CopilotSidebar, CopilotSidebarProps, CopilotSidebarView, CopilotSidebarViewProps, CopilotThreadsDrawer, CopilotThreadsDrawerProps, CopilotThreadsDrawerRowRenderer, INTELLIGENCE_TURN_HEAD, InspectorAnchor, IntelligenceIndicator, IntelligenceIndicatorProps, IntelligenceIndicatorStatus, IntelligenceIndicatorView, IntelligenceIndicatorViewProps, Interrupt, InterruptCancelFn, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, InterruptResolveFn, JsonSerializable, LearnFromUserActionInCurrentThreadInput, LearnFromUserActionInput, LearnFromUserActionResult, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, ResumeEntry, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
6
+ export { type A2UIActionInterceptor, type A2UIMessageRendererOptions, type A2UIRecoveryRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, AutoScrollMode, CopilotChat, CopilotChatAssistantMessage, CopilotChatAssistantMessageProps, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatConfigurationProviderProps, CopilotChatConfigurationValue, CopilotChatInput, CopilotChatInputProps, CopilotChatLabels, CopilotChatMessageView, CopilotChatMessageViewProps, CopilotChatProps, CopilotChatReasoningMessage, CopilotChatReasoningMessageProps, CopilotChatSuggestionPill, CopilotChatSuggestionPillProps, CopilotChatSuggestionView, CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToggleButtonProps, CopilotChatToolCallsView, CopilotChatToolCallsViewProps, CopilotChatUserMessage, CopilotChatUserMessageProps, CopilotChatView, CopilotChatViewProps, CopilotKit, CopilotKitContextValue, CopilotKitCoreReact, CopilotKitCoreReactConfig, CopilotKitCoreReactSubscriber, CopilotKitInspector, CopilotKitInspectorProps, type CopilotKitProps, CopilotKitProvider, CopilotKitProviderProps, CopilotModalHeader, CopilotModalHeaderProps, CopilotPopup, CopilotPopupProps, CopilotPopupView, CopilotPopupViewProps, CopilotSidebar, CopilotSidebarProps, CopilotSidebarView, CopilotSidebarViewProps, CopilotThreadsDrawer, CopilotThreadsDrawerProps, CopilotThreadsDrawerRowRenderer, INTELLIGENCE_TURN_HEAD, InspectorAnchor, IntelligenceIndicator, IntelligenceIndicatorProps, IntelligenceIndicatorStatus, IntelligenceIndicatorView, IntelligenceIndicatorViewProps, Interrupt, InterruptCancelFn, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, InterruptResolveFn, JsonSerializable, LearnFromUserActionInCurrentThreadInput, LearnFromUserActionInput, LearnFromUserActionResult, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, Memory, MemoryChanges, MemoryKind, MemoryScope, NewMemory, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, ResumeEntry, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseMemoriesResult, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
package/dist/v2/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { $ as UseAgentUpdate, A as CopilotChatMessageView, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotChatConfigurationProvider, D as CopilotChat, E as DefaultOpenIcon, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useInterrupt, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, P as IntelligenceIndicatorView, Q as useCapabilities, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as CopilotChatAudioRecorder, T as DefaultCloseIcon, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useSuggestions, Y as useConfigureSuggestions, Z as useAgentContext, _ as WildcardToolCallRender, _t as useRenderToolCall, at as useFrontendTool, b as CopilotSidebar, bt as CopilotChatInput_default, ct as CopilotKitProvider, dt as SandboxFunctionsContext, et as useAgent, ft as useSandboxFunctions, gt as CopilotKitInspector, ht as MCPAppsActivityType, it as useComponent, j as INTELLIGENCE_TURN_HEAD, k as CopilotChatAttachmentQueue, lt as defineToolCallRenderer, mt as MCPAppsActivityRenderer, nt as useDefaultRenderTool, ot as useRenderActivityMessage, pt as MCPAppsActivityContentSchema, q as useThreads, rt as useRenderTool, st as useRenderCustomMessages, t as CopilotKit, tt as useHumanInTheLoop, ut as createA2UIMessageRenderer, v as CopilotThreadsDrawer, vt as useCopilotKit, w as CopilotChatToggleButton, wt as useCopilotChatConfiguration, x as CopilotPopupView, xt as AudioRecorderError, y as CopilotPopup, yt as CopilotKitCoreReact, z as CopilotChatAttachmentRenderer } from "../copilotkit-CmcMFc8o.mjs";
3
+ import { $ as useCapabilities, A as CopilotChatMessageView, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as CopilotChatAudioRecorder, D as CopilotChat, E as DefaultOpenIcon, F as CopilotChatSuggestionView, G as useLearnFromUserActionInCurrentThread, H as useLearningContainersInCurrentThread, I as CopilotChatSuggestionPill, J as useThreads, K as useLearnFromUserAction, L as CopilotChatReasoningMessage_default, M as IntelligenceIndicator, N as getIntelligenceTurnAnchors, O as CopilotChatView_default, P as IntelligenceIndicatorView, Q as useAgentContext, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as AudioRecorderError, T as DefaultCloseIcon, Tt as useCopilotChatConfiguration, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as CopilotKitInspector, at as useComponent, b as CopilotSidebar, bt as CopilotKitCoreReact, ct as useRenderCustomMessages, dt as createA2UIMessageRenderer, et as UseAgentUpdate, ft as SandboxFunctionsContext, gt as MCPAppsActivityType, ht as MCPAppsActivityRenderer, it as useRenderTool, j as INTELLIGENCE_TURN_HEAD, k as CopilotChatAttachmentQueue, lt as CopilotKitProvider, mt as MCPAppsActivityContentSchema, nt as useHumanInTheLoop, ot as useFrontendTool, pt as useSandboxFunctions, q as useMemories, rt as useDefaultRenderTool, st as useRenderActivityMessage, t as CopilotKit, tt as useAgent, ut as defineToolCallRenderer, v as CopilotThreadsDrawer, vt as useRenderToolCall, w as CopilotChatToggleButton, wt as CopilotChatConfigurationProvider, x as CopilotPopupView, xt as CopilotChatInput_default, y as CopilotPopup, yt as useCopilotKit, z as CopilotChatAttachmentRenderer } from "../copilotkit-ympAovXs.mjs";
4
4
  import "./index.css";
5
5
  import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
6
6
 
@@ -8,4 +8,4 @@ export * from "@copilotkit/core"
8
8
 
9
9
  export * from "@ag-ui/client"
10
10
 
11
- export { AudioRecorderError, CopilotChat, CopilotChatAssistantMessage_default as CopilotChatAssistantMessage, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatInput_default as CopilotChatInput, CopilotChatMessageView, CopilotChatReasoningMessage_default as CopilotChatReasoningMessage, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToolCallsView, CopilotChatUserMessage_default as CopilotChatUserMessage, CopilotChatView_default as CopilotChatView, CopilotKit, CopilotKitCoreReact, CopilotKitInspector, CopilotKitProvider, CopilotModalHeader, CopilotPopup, CopilotPopupView, CopilotSidebar, CopilotSidebarView, CopilotThreadsDrawer, INTELLIGENCE_TURN_HEAD, IntelligenceIndicator, IntelligenceIndicatorView, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
11
+ export { AudioRecorderError, CopilotChat, CopilotChatAssistantMessage_default as CopilotChatAssistantMessage, CopilotChatAttachmentQueue, CopilotChatAttachmentRenderer, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, CopilotChatInput_default as CopilotChatInput, CopilotChatMessageView, CopilotChatReasoningMessage_default as CopilotChatReasoningMessage, CopilotChatSuggestionPill, CopilotChatSuggestionView, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, CopilotChatToolCallsView, CopilotChatUserMessage_default as CopilotChatUserMessage, CopilotChatView_default as CopilotChatView, CopilotKit, CopilotKitCoreReact, CopilotKitInspector, CopilotKitProvider, CopilotModalHeader, CopilotPopup, CopilotPopupView, CopilotSidebar, CopilotSidebarView, CopilotThreadsDrawer, INTELLIGENCE_TURN_HEAD, IntelligenceIndicator, IntelligenceIndicatorView, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
@@ -4367,57 +4367,58 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4367
4367
  UseAgentUpdate.OnRunStatusChanged
4368
4368
  ];
4369
4369
  function useAgent({ agentId, updates, throttleMs } = {}) {
4370
- agentId ?? (agentId = _copilotkit_shared.DEFAULT_AGENT_ID);
4370
+ const chatConfig = useCopilotChatConfiguration();
4371
+ const resolvedAgentId = agentId ?? chatConfig?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
4371
4372
  const { copilotkit } = useCopilotKit();
4372
4373
  const providerThrottleMs = copilotkit.defaultThrottleMs;
4373
4374
  const [, forceUpdate] = (0, react.useReducer)((x) => x + 1, 0);
4374
4375
  const updateFlags = (0, react.useMemo)(() => updates ?? ALL_UPDATES, [JSON.stringify(updates)]);
4375
4376
  const provisionalAgentCache = (0, react.useRef)(/* @__PURE__ */ new Map());
4376
4377
  const agent = (0, react.useMemo)(() => {
4377
- const existing = copilotkit.getAgent(agentId);
4378
+ const existing = copilotkit.getAgent(resolvedAgentId);
4378
4379
  if (existing) {
4379
- provisionalAgentCache.current.delete(agentId);
4380
+ provisionalAgentCache.current.delete(resolvedAgentId);
4380
4381
  return existing;
4381
4382
  }
4382
4383
  const isRuntimeConfigured = copilotkit.runtimeUrl !== void 0;
4383
4384
  const status = copilotkit.runtimeConnectionStatus;
4384
4385
  if (isRuntimeConfigured && (status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Disconnected || status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connecting)) {
4385
- const cached = provisionalAgentCache.current.get(agentId);
4386
+ const cached = provisionalAgentCache.current.get(resolvedAgentId);
4386
4387
  if (cached) {
4387
4388
  copilotkit.applyHeadersToAgent(cached);
4388
4389
  return cached;
4389
4390
  }
4390
4391
  const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
4391
4392
  runtimeUrl: copilotkit.runtimeUrl,
4392
- agentId,
4393
+ agentId: resolvedAgentId,
4393
4394
  transport: copilotkit.runtimeTransport,
4394
4395
  runtimeMode: "pending"
4395
4396
  });
4396
4397
  copilotkit.applyHeadersToAgent(provisional);
4397
- provisionalAgentCache.current.set(agentId, provisional);
4398
+ provisionalAgentCache.current.set(resolvedAgentId, provisional);
4398
4399
  return provisional;
4399
4400
  }
4400
4401
  if (isRuntimeConfigured && status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Error) {
4401
- const cached = provisionalAgentCache.current.get(agentId);
4402
+ const cached = provisionalAgentCache.current.get(resolvedAgentId);
4402
4403
  if (cached) {
4403
4404
  copilotkit.applyHeadersToAgent(cached);
4404
4405
  return cached;
4405
4406
  }
4406
4407
  const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
4407
4408
  runtimeUrl: copilotkit.runtimeUrl,
4408
- agentId,
4409
+ agentId: resolvedAgentId,
4409
4410
  transport: copilotkit.runtimeTransport,
4410
4411
  runtimeMode: "pending"
4411
4412
  });
4412
4413
  copilotkit.applyHeadersToAgent(provisional);
4413
- provisionalAgentCache.current.set(agentId, provisional);
4414
+ provisionalAgentCache.current.set(resolvedAgentId, provisional);
4414
4415
  return provisional;
4415
4416
  }
4416
4417
  const knownAgents = Object.keys(copilotkit.agents ?? {});
4417
4418
  const runtimePart = isRuntimeConfigured ? `runtimeUrl=${copilotkit.runtimeUrl}` : "no runtimeUrl";
4418
- throw new Error(`useAgent: Agent '${agentId}' not found after runtime sync (${runtimePart}). ` + (knownAgents.length ? `Known agents: [${knownAgents.join(", ")}]` : "No agents registered.") + " Verify your runtime /info and/or agents__unsafe_dev_only.");
4419
+ throw new Error(`useAgent: Agent '${resolvedAgentId}' not found after runtime sync (${runtimePart}). ` + (knownAgents.length ? `Known agents: [${knownAgents.join(", ")}]` : "No agents registered.") + " Verify your runtime /info and/or agents__unsafe_dev_only.");
4419
4420
  }, [
4420
- agentId,
4421
+ resolvedAgentId,
4421
4422
  copilotkit.agents,
4422
4423
  copilotkit.runtimeConnectionStatus,
4423
4424
  copilotkit.runtimeUrl,
@@ -4462,7 +4463,6 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4462
4463
  (0, react.useEffect)(() => {
4463
4464
  if (agent instanceof _ag_ui_client.HttpAgent) copilotkit.applyHeadersToAgent(agent);
4464
4465
  }, [agent, JSON.stringify(copilotkit.headers)]);
4465
- const chatConfig = useCopilotChatConfiguration();
4466
4466
  const configThreadId = chatConfig?.threadId;
4467
4467
  const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
4468
4468
  (0, react.useEffect)(() => {
@@ -4479,13 +4479,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4479
4479
  //#endregion
4480
4480
  //#region src/v2/hooks/use-capabilities.tsx
4481
4481
  /**
4482
- * Returns the capabilities declared by the given agent (or the default agent).
4482
+ * Returns the capabilities declared by the given agent (or the agent resolved
4483
+ * from the surrounding chat configuration, falling back to the default agent).
4483
4484
  * Capabilities are populated from the runtime `/info` response at connection
4484
4485
  * time. The hook reads them synchronously from the agent instance — there is
4485
4486
  * no separate loading state, but the value will be `undefined` until the
4486
4487
  * runtime handshake completes.
4487
4488
  *
4488
- * @param agentId - Optional agent ID. If omitted, uses the default agent.
4489
+ * @param agentId - Optional agent ID. If omitted, inherits the surrounding
4490
+ * chat configuration's agent, falling back to the default agent.
4489
4491
  * @returns The agent's capabilities, or `undefined` if the agent doesn't
4490
4492
  * declare capabilities.
4491
4493
  */
@@ -5058,6 +5060,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5058
5060
  })), [coreThreads]);
5059
5061
  const storeIsLoading = useThreadStoreSelector(store, _copilotkit_core.ɵselectThreadsIsLoading);
5060
5062
  const storeError = useThreadStoreSelector(store, _copilotkit_core.ɵselectThreadsError);
5063
+ const fetchMoreError = useThreadStoreSelector(store, _copilotkit_core.ɵselectFetchMoreError);
5061
5064
  const hasMoreThreads = useThreadStoreSelector(store, _copilotkit_core.ɵselectHasNextPage);
5062
5065
  const isFetchingMoreThreads = useThreadStoreSelector(store, _copilotkit_core.ɵselectIsFetchingNextPage);
5063
5066
  const isMutating = useThreadStoreSelector(store, _copilotkit_core.ɵselectIsMutating);
@@ -5163,6 +5166,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5163
5166
  isLoading,
5164
5167
  error,
5165
5168
  listError,
5169
+ fetchMoreError,
5166
5170
  hasMoreThreads,
5167
5171
  isFetchingMoreThreads,
5168
5172
  isMutating,
@@ -5179,6 +5183,70 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5179
5183
  };
5180
5184
  }
5181
5185
 
5186
+ //#endregion
5187
+ //#region src/v2/hooks/use-memories.tsx
5188
+ function useMemoryStoreSelector(store, selector) {
5189
+ return (0, react.useSyncExternalStore)((0, react.useCallback)((onStoreChange) => {
5190
+ const subscription = store.select(selector).subscribe(onStoreChange);
5191
+ return () => subscription.unsubscribe();
5192
+ }, [store, selector]), () => selector(store.getState()), () => selector(store.getServerState()));
5193
+ }
5194
+ /**
5195
+ * React hook for listing and managing platform memories.
5196
+ *
5197
+ * Reads the memory store owned and wired by `CopilotKitCore`. On mount the
5198
+ * hook exposes the live list plus stable `addMemory` / `updateMemory` /
5199
+ * `removeMemory` / `refresh` callbacks. Mutations are server-authoritative:
5200
+ * each resolves once the platform confirms the operation and rejects with an
5201
+ * `Error` on failure.
5202
+ *
5203
+ * Realtime updates are automatic: the core's memory store opens its own
5204
+ * `user_meta:memories:<joinCode>` channel and applies `memory_metadata` deltas
5205
+ * to the list. You can still call `refresh()` to re-pull the REST snapshot on
5206
+ * demand.
5207
+ *
5208
+ * @returns Memory list state and stable mutation callbacks.
5209
+ *
5210
+ * @example
5211
+ * ```tsx
5212
+ * import { useMemories } from "@copilotkit/react-core";
5213
+ *
5214
+ * function MemoryList() {
5215
+ * const { memories, isLoading, isAvailable, addMemory, removeMemory } =
5216
+ * useMemories();
5217
+ *
5218
+ * if (!isAvailable) return null;
5219
+ * if (isLoading) return <p>Loading…</p>;
5220
+ *
5221
+ * return (
5222
+ * <ul>
5223
+ * {memories.map((m) => (
5224
+ * <li key={m.id}>
5225
+ * {m.content}
5226
+ * <button onClick={() => removeMemory(m.id)}>Delete</button>
5227
+ * </li>
5228
+ * ))}
5229
+ * </ul>
5230
+ * );
5231
+ * }
5232
+ * ```
5233
+ */
5234
+ function useMemories() {
5235
+ const { copilotkit } = useCopilotKit();
5236
+ const store = copilotkit.getMemoryStore();
5237
+ return {
5238
+ memories: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemories),
5239
+ isLoading: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesIsLoading),
5240
+ error: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesError),
5241
+ isAvailable: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesAvailable),
5242
+ realtimeStatus: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesRealtimeStatus),
5243
+ refresh: (0, react.useCallback)(() => store.refresh(), [store]),
5244
+ addMemory: (0, react.useCallback)((input) => store.addMemory(input), [store]),
5245
+ updateMemory: (0, react.useCallback)((id, changes) => store.updateMemory(id, changes), [store]),
5246
+ removeMemory: (0, react.useCallback)((id) => store.removeMemory(id), [store])
5247
+ };
5248
+ }
5249
+
5182
5250
  //#endregion
5183
5251
  //#region src/v2/lib/record-annotation.ts
5184
5252
  /**
@@ -9040,7 +9108,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9040
9108
  * during prerender to avoid hydration mismatch).
9041
9109
  * - Feeds the element domain data: `threads`, `loading`, `error`,
9042
9110
  * `activeThreadId`, `licensed`, fetch-more state.
9043
- * - Routes the element's nine outbound events to core thread operations
9111
+ * - Routes the element's outbound events to core thread operations
9044
9112
  * ({@link useThreads}) and chat-configuration changes.
9045
9113
  * - Registers with the surrounding chat configuration so the header
9046
9114
  * thread-list launcher appears, and binds the element `open` state to the
@@ -9067,16 +9135,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9067
9135
  * </CopilotKitProvider>
9068
9136
  * ```
9069
9137
  */
9070
- function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed, licenseUrl, renderRow, label, limit, "data-testid": dataTestId = "copilot-threads-drawer" }) {
9138
+ function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed, licenseUrl, renderRow, label, recentLabel, collapsible, onCollapseChange, limit, "data-testid": dataTestId = "copilot-threads-drawer" }) {
9071
9139
  const configuration = useCopilotChatConfiguration();
9072
9140
  const { status, checkFeature } = useLicenseContext();
9073
9141
  const licensePresent = status === "valid" || status === "expiring";
9074
9142
  const featureLicensed = checkFeature("threads");
9075
9143
  const licensed = licensePresent && featureLicensed;
9076
9144
  const licensePending = status === null;
9077
- const resolvedAgentId = agentId ?? configuration?.agentId ?? "default";
9145
+ const resolvedAgentId = agentId ?? configuration?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
9078
9146
  const activeThreadId = configuration?.threadId ?? null;
9079
- const { threads, isLoading, listError, hasMoreThreads, isFetchingMoreThreads, archiveThread, unarchiveThread, deleteThread, fetchMoreThreads, refetchThreads, startNewThread } = useThreads({
9147
+ const { threads, isLoading, listError, fetchMoreError, hasMoreThreads, isFetchingMoreThreads, archiveThread, unarchiveThread, deleteThread, fetchMoreThreads, refetchThreads, startNewThread } = useThreads({
9080
9148
  agentId: resolvedAgentId,
9081
9149
  includeArchived: true,
9082
9150
  enabled: licensed,
@@ -9157,6 +9225,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9157
9225
  const handleLoadMore = (0, react.useCallback)(() => {
9158
9226
  fetchMoreThreads();
9159
9227
  }, [fetchMoreThreads]);
9228
+ const handleCollapseChange = (0, react.useCallback)((collapsed) => {
9229
+ onCollapseChange?.(collapsed);
9230
+ }, [onCollapseChange]);
9160
9231
  const handlersRef = (0, react.useRef)({
9161
9232
  handleThreadSelected,
9162
9233
  handleNewThread,
@@ -9167,7 +9238,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9167
9238
  handleRetry,
9168
9239
  handleOpenChange,
9169
9240
  handleLicensed,
9170
- handleLoadMore
9241
+ handleLoadMore,
9242
+ handleCollapseChange
9171
9243
  });
9172
9244
  handlersRef.current = {
9173
9245
  handleThreadSelected,
@@ -9179,7 +9251,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9179
9251
  handleRetry,
9180
9252
  handleOpenChange,
9181
9253
  handleLicensed,
9182
- handleLoadMore
9254
+ handleLoadMore,
9255
+ handleCollapseChange
9183
9256
  };
9184
9257
  (0, react.useEffect)(() => {
9185
9258
  const el = elementRef.current;
@@ -9214,6 +9287,10 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9214
9287
  };
9215
9288
  const onLicensedEvent = () => handlersRef.current.handleLicensed();
9216
9289
  const onLoadMore = () => handlersRef.current.handleLoadMore();
9290
+ const onCollapseChangeEvent = (event) => {
9291
+ const detail = event.detail;
9292
+ handlersRef.current.handleCollapseChange(detail.collapsed);
9293
+ };
9217
9294
  el.addEventListener("thread-selected", onThreadSelected);
9218
9295
  el.addEventListener("new-thread", onNewThreadEvent);
9219
9296
  el.addEventListener("archive", onArchive);
@@ -9224,6 +9301,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9224
9301
  el.addEventListener("retry", onRetry);
9225
9302
  el.addEventListener("licensed", onLicensedEvent);
9226
9303
  el.addEventListener("load-more", onLoadMore);
9304
+ el.addEventListener("collapse-change", onCollapseChangeEvent);
9227
9305
  return () => {
9228
9306
  el.removeEventListener("thread-selected", onThreadSelected);
9229
9307
  el.removeEventListener("new-thread", onNewThreadEvent);
@@ -9235,6 +9313,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9235
9313
  el.removeEventListener("retry", onRetry);
9236
9314
  el.removeEventListener("licensed", onLicensedEvent);
9237
9315
  el.removeEventListener("load-more", onLoadMore);
9316
+ el.removeEventListener("collapse-change", onCollapseChangeEvent);
9238
9317
  };
9239
9318
  }, [mounted]);
9240
9319
  (0, react.useEffect)(() => {
@@ -9251,9 +9330,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9251
9330
  el.licensed = licensed || licensePending;
9252
9331
  el.hasMore = hasMoreThreads;
9253
9332
  el.fetchingMore = isFetchingMoreThreads;
9333
+ el.fetchMoreError = fetchMoreError ? fetchMoreError.message : null;
9254
9334
  }, [
9255
9335
  isLoading,
9256
9336
  listError,
9337
+ fetchMoreError,
9257
9338
  activeThreadId,
9258
9339
  licensed,
9259
9340
  licensePending,
@@ -9276,6 +9357,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9276
9357
  if (!el) return;
9277
9358
  if (licenseUrl !== void 0) el.licenseUrl = licenseUrl;
9278
9359
  }, [licenseUrl, mounted]);
9360
+ (0, react.useEffect)(() => {
9361
+ const el = elementRef.current;
9362
+ if (!el) return;
9363
+ if (collapsible !== void 0) el.collapsible = collapsible;
9364
+ }, [collapsible, mounted]);
9279
9365
  const rowChildren = (0, react.useMemo)(() => {
9280
9366
  if (!renderRow) return null;
9281
9367
  return drawerThreads.map((drawerThread) => {
@@ -9296,7 +9382,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9296
9382
  if (!mounted) return null;
9297
9383
  return react.default.createElement(_copilotkit_web_components_threads_drawer.COPILOTKIT_THREADS_DRAWER_TAG, {
9298
9384
  ref: elementRef,
9299
- "data-testid": dataTestId
9385
+ "data-testid": dataTestId,
9386
+ ...recentLabel !== void 0 ? { "recent-label": recentLabel } : {}
9300
9387
  }, rowChildren);
9301
9388
  }
9302
9389
  CopilotThreadsDrawer.displayName = "CopilotThreadsDrawer";
@@ -10835,8 +10922,18 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
10835
10922
  }, [agent, getSubscriber]);
10836
10923
  };
10837
10924
  function CopilotListenersAgentSubscription() {
10838
- const resolvedAgentId = useCopilotChatConfiguration()?.agentId;
10839
- const { agent } = useAgent({ agentId: resolvedAgentId });
10925
+ const { copilotkit } = useCopilotKit();
10926
+ const configAgentId = useCopilotChatConfiguration()?.agentId;
10927
+ const { agent } = useAgent({ agentId: (0, react.useMemo)(() => {
10928
+ const requested = configAgentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
10929
+ const registered = copilotkit.agents ?? {};
10930
+ if (registered[requested]) return requested;
10931
+ if (requested === _copilotkit_shared.DEFAULT_AGENT_ID) {
10932
+ const firstRegistered = Object.keys(registered)[0];
10933
+ if (firstRegistered) return firstRegistered;
10934
+ }
10935
+ return requested;
10936
+ }, [configAgentId, copilotkit.agents]) });
10840
10937
  usePredictStateSubscription(agent);
10841
10938
  return null;
10842
10939
  }
@@ -11451,6 +11548,7 @@ exports.useLearnFromUserAction = useLearnFromUserAction;
11451
11548
  exports.useLearnFromUserActionInCurrentThread = useLearnFromUserActionInCurrentThread;
11452
11549
  exports.useLearningContainers = useLearningContainers;
11453
11550
  exports.useLearningContainersInCurrentThread = useLearningContainersInCurrentThread;
11551
+ exports.useMemories = useMemories;
11454
11552
  exports.useRenderActivityMessage = useRenderActivityMessage;
11455
11553
  exports.useRenderCustomMessages = useRenderCustomMessages;
11456
11554
  exports.useRenderTool = useRenderTool;