@copilotkit/react-core 1.62.1 → 1.62.2-canary.1783457132

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-CdpDZi3i.cjs');
4
+ const require_copilotkit = require('../copilotkit-Ces-OkSR.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-BnaWY11A.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-BpR0k6_Z.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-BtRkFsNR.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-BQT2ngSh.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 };
@@ -3635,12 +3635,13 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3635
3635
  }
3636
3636
  const copilotkit = copilotkitRef.current;
3637
3637
  (0, react.useEffect)(() => {
3638
- setRuntimeA2UIEnabled(copilotkit.a2uiEnabled);
3639
- const subscription = copilotkit.subscribe({ onRuntimeConnectionStatusChanged: () => {
3638
+ const syncRuntimeInfo = () => {
3640
3639
  setRuntimeA2UIEnabled(copilotkit.a2uiEnabled);
3641
3640
  setRuntimeOpenGenUIEnabled(copilotkit.openGenerativeUIEnabled);
3642
3641
  setRuntimeLicenseStatus(copilotkit.licenseStatus);
3643
- } });
3642
+ };
3643
+ const subscription = copilotkit.subscribe({ onRuntimeConnectionStatusChanged: syncRuntimeInfo });
3644
+ syncRuntimeInfo();
3644
3645
  return () => {
3645
3646
  subscription.unsubscribe();
3646
3647
  };
@@ -5178,6 +5179,70 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
5178
5179
  };
5179
5180
  }
5180
5181
 
5182
+ //#endregion
5183
+ //#region src/v2/hooks/use-memories.tsx
5184
+ function useMemoryStoreSelector(store, selector) {
5185
+ return (0, react.useSyncExternalStore)((0, react.useCallback)((onStoreChange) => {
5186
+ const subscription = store.select(selector).subscribe(onStoreChange);
5187
+ return () => subscription.unsubscribe();
5188
+ }, [store, selector]), () => selector(store.getState()), () => selector(store.getServerState()));
5189
+ }
5190
+ /**
5191
+ * React hook for listing and managing platform memories.
5192
+ *
5193
+ * Reads the memory store owned and wired by `CopilotKitCore`. On mount the
5194
+ * hook exposes the live list plus stable `addMemory` / `updateMemory` /
5195
+ * `removeMemory` / `refresh` callbacks. Mutations are server-authoritative:
5196
+ * each resolves once the platform confirms the operation and rejects with an
5197
+ * `Error` on failure.
5198
+ *
5199
+ * Realtime updates are automatic: the core's memory store opens its own
5200
+ * `user_meta:memories:<joinCode>` channel and applies `memory_metadata` deltas
5201
+ * to the list. You can still call `refresh()` to re-pull the REST snapshot on
5202
+ * demand.
5203
+ *
5204
+ * @returns Memory list state and stable mutation callbacks.
5205
+ *
5206
+ * @example
5207
+ * ```tsx
5208
+ * import { useMemories } from "@copilotkit/react-core";
5209
+ *
5210
+ * function MemoryList() {
5211
+ * const { memories, isLoading, isAvailable, addMemory, removeMemory } =
5212
+ * useMemories();
5213
+ *
5214
+ * if (!isAvailable) return null;
5215
+ * if (isLoading) return <p>Loading…</p>;
5216
+ *
5217
+ * return (
5218
+ * <ul>
5219
+ * {memories.map((m) => (
5220
+ * <li key={m.id}>
5221
+ * {m.content}
5222
+ * <button onClick={() => removeMemory(m.id)}>Delete</button>
5223
+ * </li>
5224
+ * ))}
5225
+ * </ul>
5226
+ * );
5227
+ * }
5228
+ * ```
5229
+ */
5230
+ function useMemories() {
5231
+ const { copilotkit } = useCopilotKit();
5232
+ const store = copilotkit.getMemoryStore();
5233
+ return {
5234
+ memories: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemories),
5235
+ isLoading: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesIsLoading),
5236
+ error: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesError),
5237
+ isAvailable: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesAvailable),
5238
+ realtimeStatus: useMemoryStoreSelector(store, _copilotkit_core.ɵselectMemoriesRealtimeStatus),
5239
+ refresh: (0, react.useCallback)(() => store.refresh(), [store]),
5240
+ addMemory: (0, react.useCallback)((input) => store.addMemory(input), [store]),
5241
+ updateMemory: (0, react.useCallback)((id, changes) => store.updateMemory(id, changes), [store]),
5242
+ removeMemory: (0, react.useCallback)((id) => store.removeMemory(id), [store])
5243
+ };
5244
+ }
5245
+
5181
5246
  //#endregion
5182
5247
  //#region src/v2/lib/record-annotation.ts
5183
5248
  /**
@@ -7940,9 +8005,57 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7940
8005
  const { messageView: providedMessageView, suggestionView: providedSuggestionView, onStop: providedStopHandler, ...restProps } = props;
7941
8006
  const [lastConnectedThreadId, setLastConnectedThreadId] = (0, react.useState)(null);
7942
8007
  const isConnecting = hasExplicitThreadId && lastConnectedThreadId !== resolvedThreadId;
8008
+ const activeConnectCountRef = (0, react.useRef)(0);
8009
+ const pendingRunActivityReconnectRef = (0, react.useRef)(false);
8010
+ const runActivityReconnectGenerationRef = (0, react.useRef)(0);
8011
+ const activeLocalRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Set());
8012
+ const recentlyLocalRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
8013
+ const activeWakeRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Set());
8014
+ const recentlyWakeRunIdsRef = (0, react.useRef)(/* @__PURE__ */ new Map());
8015
+ const pendingWakeRunIdRef = (0, react.useRef)(void 0);
8016
+ const startRunActivityReconnectRef = (0, react.useRef)(null);
8017
+ const runtimeStatus = copilotkit.runtimeConnectionStatus === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
8018
+ const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
8019
+ const [standaloneRunActivityStore] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: globalThis.fetch }));
7943
8020
  const previousThreadIdRef = (0, react.useRef)(null);
7944
8021
  const hasExplicitThreadIdRef = (0, react.useRef)(hasExplicitThreadId);
7945
8022
  hasExplicitThreadIdRef.current = hasExplicitThreadId;
8023
+ const rememberRecentlyLocalRunId = (0, react.useCallback)((runId) => {
8024
+ const existingTimeout = recentlyLocalRunIdsRef.current.get(runId);
8025
+ if (existingTimeout) clearTimeout(existingTimeout);
8026
+ const timeout = setTimeout(() => {
8027
+ recentlyLocalRunIdsRef.current.delete(runId);
8028
+ }, 3e4);
8029
+ recentlyLocalRunIdsRef.current.set(runId, timeout);
8030
+ }, []);
8031
+ const rememberRecentlyWakeRunId = (0, react.useCallback)((runId) => {
8032
+ const existingTimeout = recentlyWakeRunIdsRef.current.get(runId);
8033
+ if (existingTimeout) clearTimeout(existingTimeout);
8034
+ const timeout = setTimeout(() => {
8035
+ recentlyWakeRunIdsRef.current.delete(runId);
8036
+ }, 3e4);
8037
+ recentlyWakeRunIdsRef.current.set(runId, timeout);
8038
+ }, []);
8039
+ const isLocalActiveRunActivity = (0, react.useCallback)((notification) => {
8040
+ if (notification.agentId && notification.agentId !== resolvedAgentId) return false;
8041
+ if (!notification.runId || !activeLocalRunIdsRef.current.has(notification.runId) && !recentlyLocalRunIdsRef.current.has(notification.runId)) return false;
8042
+ const eventType = notification.eventType.toUpperCase();
8043
+ return eventType === "RUN_STARTED" || eventType === "RUN_FINISHED" || eventType === "RUN_ERROR";
8044
+ }, [resolvedAgentId]);
8045
+ (0, react.useEffect)(() => {
8046
+ const recentlyLocalRunIds = recentlyLocalRunIdsRef.current;
8047
+ const recentlyWakeRunIds = recentlyWakeRunIdsRef.current;
8048
+ return () => {
8049
+ recentlyLocalRunIds.forEach((timeout) => {
8050
+ clearTimeout(timeout);
8051
+ });
8052
+ recentlyLocalRunIds.clear();
8053
+ recentlyWakeRunIds.forEach((timeout) => {
8054
+ clearTimeout(timeout);
8055
+ });
8056
+ recentlyWakeRunIds.clear();
8057
+ };
8058
+ }, []);
7946
8059
  (0, react.useEffect)(() => {
7947
8060
  const threadChanged = previousThreadIdRef.current !== resolvedThreadId;
7948
8061
  previousThreadIdRef.current = resolvedThreadId;
@@ -7955,6 +8068,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7955
8068
  const connectAbortController = new AbortController();
7956
8069
  if (agent instanceof _ag_ui_client.HttpAgent) agent.abortController = connectAbortController;
7957
8070
  const connect = async (agentToConnect) => {
8071
+ activeConnectCountRef.current += 1;
7958
8072
  try {
7959
8073
  await copilotkit.connectAgent({ agent: agentToConnect });
7960
8074
  } catch (error) {
@@ -7965,6 +8079,14 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7965
8079
  if (!detached) setLastConnectedThreadId(resolvedThreadId);
7966
8080
  });
7967
8081
  else if (!hasExplicitThreadIdRef.current) agentToConnect.setMessages([]);
8082
+ activeConnectCountRef.current = Math.max(0, activeConnectCountRef.current - 1);
8083
+ if (!detached && activeConnectCountRef.current === 0) {
8084
+ const startReconnect = startRunActivityReconnectRef.current;
8085
+ if (pendingRunActivityReconnectRef.current && startReconnect) {
8086
+ pendingRunActivityReconnectRef.current = false;
8087
+ startReconnect(runActivityReconnectGenerationRef.current);
8088
+ }
8089
+ }
7968
8090
  }
7969
8091
  };
7970
8092
  connect(agent);
@@ -7979,6 +8101,119 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
7979
8101
  resolvedAgentId,
7980
8102
  hasExplicitThreadId
7981
8103
  ]);
8104
+ (0, react.useEffect)(() => {
8105
+ if (!hasNativeIntelligenceRunActivity) return;
8106
+ const registeredThreadStore = copilotkit.getThreadStore(resolvedAgentId);
8107
+ const threadStore = registeredThreadStore ?? standaloneRunActivityStore;
8108
+ if (!threadStore?.subscribeToRunActivity) return;
8109
+ const ownsStandaloneStore = registeredThreadStore === void 0;
8110
+ if (ownsStandaloneStore) {
8111
+ threadStore.start();
8112
+ const context = copilotkit.runtimeUrl ? {
8113
+ runtimeUrl: copilotkit.runtimeUrl,
8114
+ headers: { ...copilotkit.headers },
8115
+ wsUrl: copilotkit.intelligence?.wsUrl,
8116
+ agentId: resolvedAgentId
8117
+ } : null;
8118
+ threadStore.setContext(context);
8119
+ }
8120
+ const generation = runActivityReconnectGenerationRef.current + 1;
8121
+ runActivityReconnectGenerationRef.current = generation;
8122
+ let detached = false;
8123
+ let wakeReconnectActive = false;
8124
+ let pendingAgentIdleDrain = null;
8125
+ const hasActiveAgentRun = () => activeLocalRunIdsRef.current.size > 0 || agent.isRunning;
8126
+ const scheduleAgentIdleDrain = () => {
8127
+ if (pendingAgentIdleDrain !== null) return;
8128
+ pendingAgentIdleDrain = setTimeout(() => {
8129
+ pendingAgentIdleDrain = null;
8130
+ if (detached || runActivityReconnectGenerationRef.current !== generation || !pendingRunActivityReconnectRef.current) return;
8131
+ if (hasActiveAgentRun()) {
8132
+ scheduleAgentIdleDrain();
8133
+ return;
8134
+ }
8135
+ startRunActivityReconnectRef.current?.(generation);
8136
+ }, 10);
8137
+ };
8138
+ const connect = async () => {
8139
+ activeConnectCountRef.current += 1;
8140
+ wakeReconnectActive = true;
8141
+ const wakeRunId = pendingWakeRunIdRef.current;
8142
+ pendingWakeRunIdRef.current = void 0;
8143
+ if (wakeRunId) activeWakeRunIdsRef.current.add(wakeRunId);
8144
+ let didConnect = false;
8145
+ try {
8146
+ await copilotkit.connectAgent({ agent });
8147
+ didConnect = true;
8148
+ } catch (error) {
8149
+ if (!detached) console.error("CopilotChat: run activity reconnect failed", error);
8150
+ } finally {
8151
+ if (wakeRunId) {
8152
+ activeWakeRunIdsRef.current.delete(wakeRunId);
8153
+ if (didConnect) rememberRecentlyWakeRunId(wakeRunId);
8154
+ }
8155
+ activeConnectCountRef.current = Math.max(0, activeConnectCountRef.current - 1);
8156
+ wakeReconnectActive = false;
8157
+ if (!detached && runActivityReconnectGenerationRef.current === generation && activeConnectCountRef.current === 0 && pendingRunActivityReconnectRef.current) {
8158
+ pendingRunActivityReconnectRef.current = false;
8159
+ connect();
8160
+ }
8161
+ }
8162
+ };
8163
+ startRunActivityReconnectRef.current = (requestedGeneration) => {
8164
+ if (detached || requestedGeneration !== generation || runActivityReconnectGenerationRef.current !== generation) return;
8165
+ if (hasActiveAgentRun()) {
8166
+ pendingRunActivityReconnectRef.current = true;
8167
+ scheduleAgentIdleDrain();
8168
+ return;
8169
+ }
8170
+ if (activeConnectCountRef.current > 0) {
8171
+ if (!wakeReconnectActive) pendingRunActivityReconnectRef.current = true;
8172
+ return;
8173
+ }
8174
+ pendingRunActivityReconnectRef.current = false;
8175
+ connect();
8176
+ };
8177
+ const subscription = threadStore.subscribeToRunActivity((notification) => {
8178
+ if (notification.threadId !== resolvedThreadId) return;
8179
+ if (notification.agentId && notification.agentId !== resolvedAgentId) return;
8180
+ if (isLocalActiveRunActivity(notification)) return;
8181
+ if (notification.runId && (activeWakeRunIdsRef.current.has(notification.runId) || recentlyWakeRunIdsRef.current.has(notification.runId))) return;
8182
+ pendingWakeRunIdRef.current = notification.runId;
8183
+ startRunActivityReconnectRef.current?.(generation);
8184
+ });
8185
+ return () => {
8186
+ detached = true;
8187
+ pendingRunActivityReconnectRef.current = false;
8188
+ pendingWakeRunIdRef.current = void 0;
8189
+ if (pendingAgentIdleDrain !== null) {
8190
+ clearTimeout(pendingAgentIdleDrain);
8191
+ pendingAgentIdleDrain = null;
8192
+ }
8193
+ if (startRunActivityReconnectRef.current) startRunActivityReconnectRef.current = null;
8194
+ if (wakeReconnectActive) agent.detachActiveRun().catch(() => {});
8195
+ activeWakeRunIdsRef.current.clear();
8196
+ subscription.unsubscribe();
8197
+ if (ownsStandaloneStore) {
8198
+ threadStore.setContext(null);
8199
+ threadStore.stop();
8200
+ }
8201
+ };
8202
+ }, [
8203
+ agent,
8204
+ resolvedAgentId,
8205
+ resolvedThreadId,
8206
+ hasExplicitThreadId,
8207
+ hasNativeIntelligenceRunActivity,
8208
+ copilotkit.runtimeConnectionStatus,
8209
+ copilotkit.runtimeUrl,
8210
+ copilotkit.headers,
8211
+ copilotkit.intelligence?.wsUrl,
8212
+ copilotkit.threadEndpoints?.realtimeMetadata,
8213
+ standaloneRunActivityStore,
8214
+ isLocalActiveRunActivity,
8215
+ rememberRecentlyWakeRunId
8216
+ ]);
7982
8217
  const waitForActiveRunToSettle = (0, react.useCallback)(async () => {
7983
8218
  const maybeAware = agent;
7984
8219
  const activeRunCompletionPromise = (0, _copilotkit_core.isRunCompletionAware)(maybeAware) ? maybeAware.activeRunCompletionPromise : void 0;
@@ -8027,15 +8262,34 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
8027
8262
  role: "user",
8028
8263
  content: value
8029
8264
  });
8265
+ const localRunId = hasNativeIntelligenceRunActivity ? (0, _copilotkit_shared.randomUUID)() : void 0;
8266
+ if (localRunId) activeLocalRunIdsRef.current.add(localRunId);
8030
8267
  try {
8031
- await copilotkit.runAgent({ agent });
8268
+ await copilotkit.runAgent({
8269
+ agent,
8270
+ ...localRunId !== void 0 ? { runId: localRunId } : {}
8271
+ });
8032
8272
  } catch (error) {
8033
8273
  console.error("CopilotChat: runAgent failed", error);
8274
+ } finally {
8275
+ if (localRunId) {
8276
+ activeLocalRunIdsRef.current.delete(localRunId);
8277
+ rememberRecentlyLocalRunId(localRunId);
8278
+ }
8279
+ if (pendingRunActivityReconnectRef.current && activeLocalRunIdsRef.current.size === 0 && activeConnectCountRef.current === 0) {
8280
+ const startReconnect = startRunActivityReconnectRef.current;
8281
+ if (startReconnect) {
8282
+ pendingRunActivityReconnectRef.current = false;
8283
+ startReconnect(runActivityReconnectGenerationRef.current);
8284
+ }
8285
+ }
8034
8286
  }
8035
8287
  }, [
8036
8288
  agent,
8037
8289
  consumeAttachments,
8038
- waitForActiveRunToSettle
8290
+ waitForActiveRunToSettle,
8291
+ hasNativeIntelligenceRunActivity,
8292
+ rememberRecentlyLocalRunId
8039
8293
  ]);
8040
8294
  const handleSelectSuggestion = (0, react.useCallback)(async (suggestion) => {
8041
8295
  await waitForActiveRunToSettle();
@@ -8044,12 +8298,34 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
8044
8298
  role: "user",
8045
8299
  content: suggestion.message
8046
8300
  });
8301
+ const localRunId = hasNativeIntelligenceRunActivity ? (0, _copilotkit_shared.randomUUID)() : void 0;
8302
+ if (localRunId) activeLocalRunIdsRef.current.add(localRunId);
8047
8303
  try {
8048
- await copilotkit.runAgent({ agent });
8304
+ await copilotkit.runAgent({
8305
+ agent,
8306
+ ...localRunId !== void 0 ? { runId: localRunId } : {}
8307
+ });
8049
8308
  } catch (error) {
8050
8309
  console.error("CopilotChat: runAgent failed after selecting suggestion", error);
8310
+ } finally {
8311
+ if (localRunId) {
8312
+ activeLocalRunIdsRef.current.delete(localRunId);
8313
+ rememberRecentlyLocalRunId(localRunId);
8314
+ }
8315
+ if (pendingRunActivityReconnectRef.current && activeLocalRunIdsRef.current.size === 0 && activeConnectCountRef.current === 0) {
8316
+ const startReconnect = startRunActivityReconnectRef.current;
8317
+ if (startReconnect) {
8318
+ pendingRunActivityReconnectRef.current = false;
8319
+ startReconnect(runActivityReconnectGenerationRef.current);
8320
+ }
8321
+ }
8051
8322
  }
8052
- }, [agent, waitForActiveRunToSettle]);
8323
+ }, [
8324
+ agent,
8325
+ waitForActiveRunToSettle,
8326
+ hasNativeIntelligenceRunActivity,
8327
+ rememberRecentlyLocalRunId
8328
+ ]);
8053
8329
  const stopCurrentRun = (0, react.useCallback)(() => {
8054
8330
  try {
8055
8331
  copilotkit.stopAgent({ agent });
@@ -11239,6 +11515,7 @@ exports.useLearnFromUserAction = useLearnFromUserAction;
11239
11515
  exports.useLearnFromUserActionInCurrentThread = useLearnFromUserActionInCurrentThread;
11240
11516
  exports.useLearningContainers = useLearningContainers;
11241
11517
  exports.useLearningContainersInCurrentThread = useLearningContainersInCurrentThread;
11518
+ exports.useMemories = useMemories;
11242
11519
  exports.useRenderActivityMessage = useRenderActivityMessage;
11243
11520
  exports.useRenderCustomMessages = useRenderCustomMessages;
11244
11521
  exports.useRenderTool = useRenderTool;