@copilotkit/react-core 1.55.2 → 1.55.3-canary.1776215089

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/{copilotkit-Dgdpbqjt.cjs → copilotkit-BZuXjQLc.cjs} +43 -7
  2. package/dist/copilotkit-BZuXjQLc.cjs.map +1 -0
  3. package/dist/{copilotkit-Cd-NrDyp.mjs → copilotkit-BzVUuD95.mjs} +38 -8
  4. package/dist/copilotkit-BzVUuD95.mjs.map +1 -0
  5. package/dist/{copilotkit-dwDWYpya.d.cts → copilotkit-EfopO2gn.d.cts} +27 -9
  6. package/dist/copilotkit-EfopO2gn.d.cts.map +1 -0
  7. package/dist/{copilotkit-BuhSUZHb.d.mts → copilotkit-opur-20s.d.mts} +27 -9
  8. package/dist/copilotkit-opur-20s.d.mts.map +1 -0
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.mts +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/index.umd.js +18 -6
  14. package/dist/index.umd.js.map +1 -1
  15. package/dist/v2/index.cjs +2 -1
  16. package/dist/v2/index.d.cts +2 -2
  17. package/dist/v2/index.d.mts +2 -2
  18. package/dist/v2/index.mjs +2 -2
  19. package/dist/v2/index.umd.js +37 -6
  20. package/dist/v2/index.umd.js.map +1 -1
  21. package/package.json +6 -6
  22. package/src/components/copilot-provider/copilotkit-props.tsx +9 -5
  23. package/src/components/copilot-provider/copilotkit.tsx +4 -1
  24. package/src/v2/hooks/__tests__/use-agent-throttle.test.tsx +10 -10
  25. package/src/v2/hooks/__tests__/use-capabilities.test.tsx +76 -0
  26. package/src/v2/hooks/index.ts +1 -0
  27. package/src/v2/hooks/use-agent.tsx +23 -4
  28. package/src/v2/hooks/use-capabilities.tsx +25 -0
  29. package/src/v2/providers/CopilotKitProvider.tsx +6 -2
  30. package/dist/copilotkit-BuhSUZHb.d.mts.map +0 -1
  31. package/dist/copilotkit-Cd-NrDyp.mjs.map +0 -1
  32. package/dist/copilotkit-Dgdpbqjt.cjs.map +0 -1
  33. package/dist/copilotkit-dwDWYpya.d.cts.map +0 -1
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-Dgdpbqjt.cjs');
4
+ const require_copilotkit = require('../copilotkit-BZuXjQLc.cjs');
5
5
  require("./index.css");
6
6
  let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
7
7
 
@@ -69,6 +69,7 @@ exports.defineToolCallRenderer = require_copilotkit.defineToolCallRenderer;
69
69
  exports.useAgent = require_copilotkit.useAgent;
70
70
  exports.useAgentContext = require_copilotkit.useAgentContext;
71
71
  exports.useAttachments = require_copilotkit.useAttachments;
72
+ exports.useCapabilities = require_copilotkit.useCapabilities;
72
73
  exports.useComponent = require_copilotkit.useComponent;
73
74
  exports.useConfigureSuggestions = require_copilotkit.useConfigureSuggestions;
74
75
  exports.useCopilotChatConfiguration = require_copilotkit.useCopilotChatConfiguration;
@@ -1,6 +1,6 @@
1
- import { $ as MCPAppsActivityContentSchema, A as useAgentContext, At as CopilotChatSuggestionView, B as InterruptEvent, Bt as CopilotChatToolCallsView, C as useThreads, Ct as DefaultOpenIcon, D as useSuggestions, Dt as CopilotChatViewProps, E as useConfigureSuggestions, Et as CopilotChatView, F as useRenderTool, Ft as CopilotChatReasoningMessageProps, G as ReactFrontendTool, Gt as CopilotChatConfigurationProvider, H as InterruptRenderProps, Ht as CopilotChatInput, I as useComponent, It as CopilotChatUserMessage, J as useRenderCustomMessages, Jt as CopilotChatLabels, K as ReactActivityMessageRenderer, Kt as CopilotChatConfigurationProviderProps, L as useFrontendTool, Lt as CopilotChatUserMessageProps, M as useAgent, Mt as CopilotChatSuggestionPill, N as useHumanInTheLoop, Nt as CopilotChatSuggestionPillProps, O as AgentContextInput, Ot as CopilotChatMessageView, P as useDefaultRenderTool, Pt as CopilotChatReasoningMessage, Q as MCPAppsActivityContent, Qt as CopilotChatAudioRecorder, R as useRenderActivityMessage, Rt as CopilotChatAssistantMessage, S as UseThreadsResult, St as DefaultCloseIcon, T as useInterrupt, Tt as CopilotChatProps, U as defineToolCallRenderer, Ut as CopilotChatInputProps, V as InterruptHandlerProps, Vt as CopilotChatToolCallsViewProps, W as ReactHumanInTheLoop, Wt as ToolsMenuItem, X as ReactCustomMessageRendererPosition, Xt as AudioRecorderError, Y as ReactCustomMessageRenderer, Yt as useCopilotChatConfiguration, Z as useRenderToolCall, Zt as AudioRecorderState, _ as UseAttachmentsProps, _t as CopilotSidebarViewProps, a as A2UIUserAction, at as Attachment, b as Thread, bt as CopilotChatToggleButton, c as SandboxFunctionsContext, ct as CopilotChatAttachmentRenderer, d as CopilotKitProvider, dt as CopilotPopupProps, et as MCPAppsActivityRenderer, f as CopilotKitProviderProps, ft as CopilotSidebar, g as CopilotKitCoreReactSubscriber, gt as CopilotSidebarView, h as CopilotKitCoreReactConfig, ht as CopilotPopupViewProps, i as A2UIMessageRendererOptions, it as WildcardToolCallRender, j as UseAgentUpdate, jt as CopilotChatSuggestionViewProps, k as JsonSerializable, kt as CopilotChatMessageViewProps, l as useSandboxFunctions, lt as CopilotChatAttachmentQueue, m as CopilotKitCoreReact, mt as CopilotPopupView, nt as CopilotKitInspector, o as createA2UIMessageRenderer, ot as AttachmentModality, p as useCopilotKit, pt as CopilotSidebarProps, q as ReactToolCallRenderer, qt as CopilotChatConfigurationValue, r as CopilotKitProps, rt as CopilotKitInspectorProps, s as InspectorAnchor, st as AttachmentsConfig, t as CopilotKit, tt as MCPAppsActivityType, u as CopilotKitContextValue, ut as CopilotPopup, v as UseAttachmentsReturn, vt as CopilotModalHeader, w as UseInterruptConfig, wt as CopilotChat, x as UseThreadsInput, xt as CopilotChatToggleButtonProps, y as useAttachments, yt as CopilotModalHeaderProps, z as SandboxFunction, zt as CopilotChatAssistantMessageProps } from "../copilotkit-dwDWYpya.cjs";
1
+ import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-EfopO2gn.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 A2UIMessageRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, 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, InspectorAnchor, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, JsonSerializable, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
6
+ export { type A2UIMessageRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, 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, InspectorAnchor, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, JsonSerializable, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
@@ -1,6 +1,6 @@
1
- import { $ as MCPAppsActivityContentSchema, A as useAgentContext, At as CopilotChatSuggestionView, B as InterruptEvent, Bt as CopilotChatToolCallsView, C as useThreads, Ct as DefaultOpenIcon, D as useSuggestions, Dt as CopilotChatViewProps, E as useConfigureSuggestions, Et as CopilotChatView, F as useRenderTool, Ft as CopilotChatReasoningMessageProps, G as ReactFrontendTool, Gt as CopilotChatConfigurationProvider, H as InterruptRenderProps, Ht as CopilotChatInput, I as useComponent, It as CopilotChatUserMessage, J as useRenderCustomMessages, Jt as CopilotChatLabels, K as ReactActivityMessageRenderer, Kt as CopilotChatConfigurationProviderProps, L as useFrontendTool, Lt as CopilotChatUserMessageProps, M as useAgent, Mt as CopilotChatSuggestionPill, N as useHumanInTheLoop, Nt as CopilotChatSuggestionPillProps, O as AgentContextInput, Ot as CopilotChatMessageView, P as useDefaultRenderTool, Pt as CopilotChatReasoningMessage, Q as MCPAppsActivityContent, Qt as CopilotChatAudioRecorder, R as useRenderActivityMessage, Rt as CopilotChatAssistantMessage, S as UseThreadsResult, St as DefaultCloseIcon, T as useInterrupt, Tt as CopilotChatProps, U as defineToolCallRenderer, Ut as CopilotChatInputProps, V as InterruptHandlerProps, Vt as CopilotChatToolCallsViewProps, W as ReactHumanInTheLoop, Wt as ToolsMenuItem, X as ReactCustomMessageRendererPosition, Xt as AudioRecorderError, Y as ReactCustomMessageRenderer, Yt as useCopilotChatConfiguration, Z as useRenderToolCall, Zt as AudioRecorderState, _ as UseAttachmentsProps, _t as CopilotSidebarViewProps, a as A2UIUserAction, at as Attachment, b as Thread, bt as CopilotChatToggleButton, c as SandboxFunctionsContext, ct as CopilotChatAttachmentRenderer, d as CopilotKitProvider, dt as CopilotPopupProps, et as MCPAppsActivityRenderer, f as CopilotKitProviderProps, ft as CopilotSidebar, g as CopilotKitCoreReactSubscriber, gt as CopilotSidebarView, h as CopilotKitCoreReactConfig, ht as CopilotPopupViewProps, i as A2UIMessageRendererOptions, it as WildcardToolCallRender, j as UseAgentUpdate, jt as CopilotChatSuggestionViewProps, k as JsonSerializable, kt as CopilotChatMessageViewProps, l as useSandboxFunctions, lt as CopilotChatAttachmentQueue, m as CopilotKitCoreReact, mt as CopilotPopupView, nt as CopilotKitInspector, o as createA2UIMessageRenderer, ot as AttachmentModality, p as useCopilotKit, pt as CopilotSidebarProps, q as ReactToolCallRenderer, qt as CopilotChatConfigurationValue, r as CopilotKitProps, rt as CopilotKitInspectorProps, s as InspectorAnchor, st as AttachmentsConfig, t as CopilotKit, tt as MCPAppsActivityType, u as CopilotKitContextValue, ut as CopilotPopup, v as UseAttachmentsReturn, vt as CopilotModalHeader, w as UseInterruptConfig, wt as CopilotChat, x as UseThreadsInput, xt as CopilotChatToggleButtonProps, y as useAttachments, yt as CopilotModalHeaderProps, z as SandboxFunction, zt as CopilotChatAssistantMessageProps } from "../copilotkit-BuhSUZHb.mjs";
1
+ import { $ as MCPAppsActivityContent, $t as CopilotChatAudioRecorder, A as useAgentContext, At as CopilotChatMessageViewProps, B as SandboxFunction, Bt as CopilotChatAssistantMessageProps, C as useThreads, Ct as DefaultCloseIcon, D as useSuggestions, Dt as CopilotChatView, E as useConfigureSuggestions, Et as CopilotChatProps, F as useDefaultRenderTool, Ft as CopilotChatReasoningMessage, G as ReactHumanInTheLoop, Gt as ToolsMenuItem, H as InterruptHandlerProps, Ht as CopilotChatToolCallsViewProps, I as useRenderTool, It as CopilotChatReasoningMessageProps, J as ReactToolCallRenderer, Jt as CopilotChatConfigurationValue, K as ReactFrontendTool, Kt as CopilotChatConfigurationProvider, L as useComponent, Lt as CopilotChatUserMessage, M as UseAgentUpdate, Mt as CopilotChatSuggestionViewProps, N as useAgent, Nt as CopilotChatSuggestionPill, O as AgentContextInput, Ot as CopilotChatViewProps, P as useHumanInTheLoop, Pt as CopilotChatSuggestionPillProps, Q as useRenderToolCall, Qt as AudioRecorderState, R as useFrontendTool, Rt as CopilotChatUserMessageProps, S as UseThreadsResult, St as CopilotChatToggleButtonProps, T as useInterrupt, Tt as CopilotChat, U as InterruptRenderProps, Ut as CopilotChatInput, V as InterruptEvent, Vt as CopilotChatToolCallsView, W as defineToolCallRenderer, Wt as CopilotChatInputProps, X as ReactCustomMessageRenderer, Xt as useCopilotChatConfiguration, Y as useRenderCustomMessages, Yt as CopilotChatLabels, Z as ReactCustomMessageRendererPosition, Zt as AudioRecorderError, _ as UseAttachmentsProps, _t as CopilotSidebarView, a as A2UIUserAction, at as WildcardToolCallRender, b as Thread, bt as CopilotModalHeaderProps, c as SandboxFunctionsContext, ct as AttachmentsConfig, d as CopilotKitProvider, dt as CopilotPopup, et as MCPAppsActivityContentSchema, f as CopilotKitProviderProps, ft as CopilotPopupProps, g as CopilotKitCoreReactSubscriber, gt as CopilotPopupViewProps, h as CopilotKitCoreReactConfig, ht as CopilotPopupView, i as A2UIMessageRendererOptions, it as CopilotKitInspectorProps, j as useCapabilities, jt as CopilotChatSuggestionView, k as JsonSerializable, kt as CopilotChatMessageView, l as useSandboxFunctions, lt as CopilotChatAttachmentRenderer, m as CopilotKitCoreReact, mt as CopilotSidebarProps, nt as MCPAppsActivityType, o as createA2UIMessageRenderer, ot as Attachment, p as useCopilotKit, pt as CopilotSidebar, q as ReactActivityMessageRenderer, qt as CopilotChatConfigurationProviderProps, r as CopilotKitProps, rt as CopilotKitInspector, s as InspectorAnchor, st as AttachmentModality, t as CopilotKit, tt as MCPAppsActivityRenderer, u as CopilotKitContextValue, ut as CopilotChatAttachmentQueue, v as UseAttachmentsReturn, vt as CopilotSidebarViewProps, w as UseInterruptConfig, wt as DefaultOpenIcon, x as UseThreadsInput, xt as CopilotChatToggleButton, y as useAttachments, yt as CopilotModalHeader, z as useRenderActivityMessage, zt as CopilotChatAssistantMessage } from "../copilotkit-opur-20s.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 A2UIMessageRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, 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, InspectorAnchor, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, JsonSerializable, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
6
+ export { type A2UIMessageRendererOptions, type A2UITheme, type A2UIUserAction, AgentContextInput, Attachment, AttachmentModality, AttachmentsConfig, AudioRecorderError, AudioRecorderState, 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, InspectorAnchor, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, JsonSerializable, MCPAppsActivityContent, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, ReactActivityMessageRenderer, ReactCustomMessageRenderer, ReactCustomMessageRendererPosition, ReactFrontendTool, ReactHumanInTheLoop, ReactToolCallRenderer, SandboxFunction, SandboxFunctionsContext, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseThreadsInput, UseThreadsResult, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, 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 useCopilotKit, A as CopilotChatSuggestionView, B as useConfigureSuggestions, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAssistantMessage_default, G as useComponent, H as useHumanInTheLoop, I as CopilotChatToolCallsView, J as useRenderCustomMessages, K as useFrontendTool, L as useAttachments, M as CopilotChatReasoningMessage_default, N as CopilotChatUserMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatAttachmentRenderer, Q as CopilotKitProvider, R as useThreads, S as CopilotModalHeader, T as DefaultOpenIcon, U as useDefaultRenderTool, V as useSuggestions, W as useRenderTool, X as useAgent, Y as UseAgentUpdate, Z as useRenderToolCall, _ as WildcardToolCallRender, at as useSandboxFunctions, b as CopilotPopupView, ct as MCPAppsActivityType, dt as AudioRecorderError, et as CopilotKitCoreReact, ft as CopilotChatAudioRecorder, it as SandboxFunctionsContext, j as CopilotChatSuggestionPill, k as CopilotChatMessageView, lt as CopilotKitInspector, mt as useCopilotChatConfiguration, nt as defineToolCallRenderer, ot as MCPAppsActivityContentSchema, pt as CopilotChatConfigurationProvider, q as useRenderActivityMessage, rt as createA2UIMessageRenderer, st as MCPAppsActivityRenderer, t as CopilotKit, tt as useAgentContext, ut as CopilotChatInput_default, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useInterrupt } from "../copilotkit-Cd-NrDyp.mjs";
3
+ import { $ as CopilotKitProvider, A as CopilotChatSuggestionView, B as useConfigureSuggestions, C as CopilotChatToggleButton, D as CopilotChatView_default, E as CopilotChat, F as CopilotChatAssistantMessage_default, G as useRenderTool, H as useCapabilities, I as CopilotChatToolCallsView, J as useRenderActivityMessage, K as useComponent, L as useAttachments, M as CopilotChatReasoningMessage_default, N as CopilotChatUserMessage_default, O as CopilotChatAttachmentQueue, P as CopilotChatAttachmentRenderer, Q as useRenderToolCall, R as useThreads, S as CopilotModalHeader, T as DefaultOpenIcon, U as useHumanInTheLoop, V as useSuggestions, W as useDefaultRenderTool, X as UseAgentUpdate, Y as useRenderCustomMessages, Z as useAgent, _ as WildcardToolCallRender, at as SandboxFunctionsContext, b as CopilotPopupView, ct as MCPAppsActivityRenderer, dt as CopilotChatInput_default, et as useCopilotKit, ft as AudioRecorderError, ht as useCopilotChatConfiguration, it as createA2UIMessageRenderer, j as CopilotChatSuggestionPill, k as CopilotChatMessageView, lt as MCPAppsActivityType, mt as CopilotChatConfigurationProvider, nt as useAgentContext, ot as useSandboxFunctions, pt as CopilotChatAudioRecorder, q as useFrontendTool, rt as defineToolCallRenderer, st as MCPAppsActivityContentSchema, t as CopilotKit, tt as CopilotKitCoreReact, ut as CopilotKitInspector, v as CopilotPopup, w as DefaultCloseIcon, x as CopilotSidebarView, y as CopilotSidebar, z as useInterrupt } from "../copilotkit-BzVUuD95.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, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, 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, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads };
@@ -3108,7 +3108,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3108
3108
  }, [value, warningMessage]);
3109
3109
  return value;
3110
3110
  }
3111
- const CopilotKitProvider = ({ children, runtimeUrl, headers = {}, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = {}, agents__unsafe_dev_only: agents = {}, selfManagedAgents = {}, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, showDevConsole = false, useSingleEndpoint, onError, a2ui, defaultThrottleMs, inspectorDefaultAnchor }) => {
3111
+ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = {}, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = {}, agents__unsafe_dev_only: agents = {}, selfManagedAgents = {}, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, showDevConsole = false, useSingleEndpoint, onError, a2ui, defaultThrottleMs, inspectorDefaultAnchor }) => {
3112
3112
  var _openGenerativeUI$des;
3113
3113
  const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
3114
3114
  const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
@@ -3170,6 +3170,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3170
3170
  ...selfManagedAgents
3171
3171
  }), [agents, selfManagedAgents]);
3172
3172
  const hasLocalAgents = mergedAgents && Object.keys(mergedAgents).length > 0;
3173
+ const headers = typeof headersProp === "function" ? headersProp() : headersProp;
3173
3174
  const mergedHeaders = (0, react.useMemo)(() => {
3174
3175
  if (!resolvedPublicKey) return headers;
3175
3176
  if (headers[HEADER_NAME]) return headers;
@@ -3670,6 +3671,17 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3670
3671
  const handlers = {};
3671
3672
  let timerId = null;
3672
3673
  let active = true;
3674
+ let batchScheduled = false;
3675
+ const batchedForceUpdate = () => {
3676
+ if (!active) return;
3677
+ if (!batchScheduled) {
3678
+ batchScheduled = true;
3679
+ queueMicrotask(() => {
3680
+ batchScheduled = false;
3681
+ if (active) forceUpdate();
3682
+ });
3683
+ }
3684
+ };
3673
3685
  if (updateFlags.includes(UseAgentUpdate.OnMessagesChanged)) {
3674
3686
  const ms = effectiveThrottleMs;
3675
3687
  if (ms > 0) {
@@ -3694,11 +3706,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
3694
3706
  handlers.onMessagesChanged = throttledNotify;
3695
3707
  } else handlers.onMessagesChanged = forceUpdate;
3696
3708
  }
3697
- if (updateFlags.includes(UseAgentUpdate.OnStateChanged)) handlers.onStateChanged = forceUpdate;
3709
+ if (updateFlags.includes(UseAgentUpdate.OnStateChanged)) handlers.onStateChanged = batchedForceUpdate;
3698
3710
  if (updateFlags.includes(UseAgentUpdate.OnRunStatusChanged)) {
3699
- handlers.onRunInitialized = forceUpdate;
3700
- handlers.onRunFinalized = forceUpdate;
3701
- handlers.onRunFailed = forceUpdate;
3711
+ handlers.onRunInitialized = batchedForceUpdate;
3712
+ handlers.onRunFinalized = batchedForceUpdate;
3713
+ handlers.onRunFailed = batchedForceUpdate;
3702
3714
  }
3703
3715
  const subscription = agent.subscribe(handlers);
3704
3716
  return () => {
@@ -4240,6 +4252,24 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
4240
4252
  ]);
4241
4253
  }
4242
4254
 
4255
+ //#endregion
4256
+ //#region src/v2/hooks/use-capabilities.tsx
4257
+ /**
4258
+ * Returns the capabilities declared by the given agent (or the default agent).
4259
+ * Capabilities are populated from the runtime `/info` response at connection
4260
+ * time. The hook reads them synchronously from the agent instance — there is
4261
+ * no separate loading state, but the value will be `undefined` until the
4262
+ * runtime handshake completes.
4263
+ *
4264
+ * @param agentId - Optional agent ID. If omitted, uses the default agent.
4265
+ * @returns The agent's capabilities, or `undefined` if the agent doesn't
4266
+ * declare capabilities.
4267
+ */
4268
+ function useCapabilities(agentId) {
4269
+ const { agent } = useAgent({ agentId });
4270
+ if (agent && "capabilities" in agent) return agent.capabilities;
4271
+ }
4272
+
4243
4273
  //#endregion
4244
4274
  //#region src/v2/hooks/use-suggestions.tsx
4245
4275
  function useSuggestions({ agentId } = {}) {
@@ -9227,7 +9257,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
9227
9257
  publicApiKey,
9228
9258
  ...cloud ? { cloud } : {},
9229
9259
  chatApiEndpoint,
9230
- headers: props.headers || {},
9260
+ headers: typeof props.headers === "function" ? props.headers() : props.headers || {},
9231
9261
  properties: props.properties || {},
9232
9262
  transcribeAudioUrl: props.transcribeAudioUrl,
9233
9263
  textToSpeechUrl: props.textToSpeechUrl,
@@ -9644,6 +9674,7 @@ exports.defineToolCallRenderer = defineToolCallRenderer;
9644
9674
  exports.useAgent = useAgent;
9645
9675
  exports.useAgentContext = useAgentContext;
9646
9676
  exports.useAttachments = useAttachments;
9677
+ exports.useCapabilities = useCapabilities;
9647
9678
  exports.useComponent = useComponent;
9648
9679
  exports.useConfigureSuggestions = useConfigureSuggestions;
9649
9680
  exports.useCopilotChatConfiguration = useCopilotChatConfiguration;