@copilotkit/react-core 1.62.2-canary.1783457132 → 1.62.2-canary.1785518626
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/{copilotkit-BnaWY11A.d.cts → copilotkit-C-k8T6fY.d.cts} +71 -6
- package/dist/copilotkit-C-k8T6fY.d.cts.map +1 -0
- package/dist/{copilotkit-BpR0k6_Z.d.mts → copilotkit-D6Wy_7iY.d.mts} +71 -6
- package/dist/copilotkit-D6Wy_7iY.d.mts.map +1 -0
- package/dist/{copilotkit-Ces-OkSR.cjs → copilotkit-DLwoVUsE.cjs} +132 -24
- package/dist/copilotkit-DLwoVUsE.cjs.map +1 -0
- package/dist/{copilotkit-BQT2ngSh.mjs → copilotkit-dtSVHJCs.mjs} +128 -26
- package/dist/copilotkit-dtSVHJCs.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +24 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +18 -14
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts +16 -2
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts +16 -2
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +19 -15
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +2 -1
- package/dist/v2/index.d.cts +2 -2
- package/dist/v2/index.d.mts +2 -2
- package/dist/v2/index.mjs +2 -2
- package/dist/v2/index.umd.js +126 -23
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +9 -9
- package/dist/copilotkit-BQT2ngSh.mjs.map +0 -1
- package/dist/copilotkit-BnaWY11A.d.cts.map +0 -1
- package/dist/copilotkit-BpR0k6_Z.d.mts.map +0 -1
- package/dist/copilotkit-Ces-OkSR.cjs.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-
|
|
4
|
+
const require_copilotkit = require('../copilotkit-DLwoVUsE.cjs');
|
|
5
5
|
require("./index.css");
|
|
6
6
|
let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
|
|
7
7
|
|
|
@@ -93,6 +93,7 @@ exports.useRenderCustomMessages = require_copilotkit.useRenderCustomMessages;
|
|
|
93
93
|
exports.useRenderTool = require_copilotkit.useRenderTool;
|
|
94
94
|
exports.useRenderToolCall = require_copilotkit.useRenderToolCall;
|
|
95
95
|
exports.useSandboxFunctions = require_copilotkit.useSandboxFunctions;
|
|
96
|
+
exports.useSubagent = require_copilotkit.useSubagent;
|
|
96
97
|
exports.useSuggestions = require_copilotkit.useSuggestions;
|
|
97
98
|
exports.useThreads = require_copilotkit.useThreads$1;
|
|
98
99
|
var _copilotkit_core = require("@copilotkit/core");
|
package/dist/v2/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as useHumanInTheLoop, $t as DefaultCloseIcon, A as useAttachments, An as CopilotChatConfigurationProvider, At as AttachmentModality, B as UseInterruptConfig, Bt as useThreads, C as NewMemory, Cn as CopilotChatAssistantMessage, Ct as MCPAppsActivityContentSchema, D as useLearningContainers, Dn as CopilotChatInput, Dt as CopilotKitInspectorProps, E as UseLearningContainersArgs, En as CopilotChatToolCallsViewProps, Et as CopilotKitInspector, F as LearnFromUserActionResult, Fn as AudioRecorderError, Ft as CopilotThreadsDrawerProps, G as JsonSerializable, Gt as CopilotPopupView, H as useConfigureSuggestions, Ht as CopilotPopupProps, I as UseLearnFromUserActionRecorder, In as AudioRecorderState, It as CopilotThreadsDrawerRowRenderer, J as SubagentView, Jt as CopilotSidebarViewProps, K as useAgentContext, Kt as CopilotPopupViewProps, L as useLearnFromUserAction, Ln as CopilotChatAudioRecorder, Lt as Thread, M as UseLearnFromUserActionInCurrentThreadRecorder, Mn as CopilotChatConfigurationValue, Mt as CopilotChatAttachmentRenderer, N as useLearnFromUserActionInCurrentThread, Nn as CopilotChatLabels, Nt as CopilotChatAttachmentQueue, O as UseAttachmentsProps, On as CopilotChatInputProps, Ot as WildcardToolCallRender, P as LearnFromUserActionInput, Pn as useCopilotChatConfiguration, Pt as CopilotThreadsDrawer, Q as useAgent, Qt as CopilotChatToggleButtonProps, R as UseMemoriesResult, Rt as UseThreadsInput, S as MemoryScope, Sn as CopilotChatUserMessageProps, St as MCPAppsActivityContent, T as useLearningContainersInCurrentThread, Tn as CopilotChatToolCallsView, Tt as MCPAppsActivityType, U as useSuggestions, Ut as CopilotSidebar, V as useInterrupt, Vt as CopilotPopup, W as AgentContextInput, Wt as CopilotSidebarProps, X as useSubagent, Xt as CopilotModalHeaderProps, Y as UseSubagentParams, Yt as CopilotModalHeader, Z as UseAgentUpdate, Zt as CopilotChatToggleButton, _ as CopilotKitCoreReactConfig, _n as CopilotChatSuggestionPill, _t as ReactToolCallRenderer, a as A2UIMessageRendererOptions, an as AutoScrollMode, at as SandboxFunction, b as MemoryChanges, bn as CopilotChatReasoningMessageProps, bt as ReactCustomMessageRendererPosition, c as InspectorAnchor, cn as INTELLIGENCE_TURN_HEAD, ct as InterruptEvent, d as CopilotKitProvider, dn as getIntelligenceTurnAnchors, dt as InterruptResolveFn, en as DefaultOpenIcon, et as useDefaultRenderTool, f as CopilotKitProviderProps, fn as IntelligenceIndicatorStatus, ft as ResumeEntry, g as CopilotKitCoreReact, gn as CopilotChatSuggestionViewProps, gt as ReactActivityMessageRenderer, h as useCopilotKit, hn as CopilotChatSuggestionView, ht as ReactFrontendTool, i as A2UIActionInterceptor, in as CopilotChatViewProps, it as useRenderActivityMessage, j as LearnFromUserActionInCurrentThreadInput, jn as CopilotChatConfigurationProviderProps, jt as AttachmentsConfig, k as UseAttachmentsReturn, kn as ToolsMenuItem, kt as Attachment, l as SandboxFunctionsContext, ln as IntelligenceIndicator, lt as InterruptHandlerProps, m as CopilotKitContextValue, mn as IntelligenceIndicatorViewProps, mt as ReactHumanInTheLoop, nn as CopilotChatProps, nt as useComponent, o as A2UIUserAction, on as CopilotChatMessageView, ot as Interrupt, p as A2UIRecoveryRendererOptions, pn as IntelligenceIndicatorView, pt as defineToolCallRenderer, q as useCapabilities, qt as CopilotSidebarView, r as CopilotKitProps, rn as CopilotChatView, rt as useFrontendTool, s as createA2UIMessageRenderer, sn as CopilotChatMessageViewProps, st as InterruptCancelFn, t as CopilotKit, tn as CopilotChat, tt as useRenderTool, u as useSandboxFunctions, un as IntelligenceIndicatorProps, ut as InterruptRenderProps, v as CopilotKitCoreReactSubscriber, vn as CopilotChatSuggestionPillProps, vt as useRenderCustomMessages, w as UseLearningContainersInCurrentThreadArgs, wn as CopilotChatAssistantMessageProps, wt as MCPAppsActivityRenderer, x as MemoryKind, xn as CopilotChatUserMessage, xt as useRenderToolCall, y as Memory, yn as CopilotChatReasoningMessage, yt as ReactCustomMessageRenderer, z as useMemories, zt as UseThreadsResult } from "../copilotkit-C-k8T6fY.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, 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 };
|
|
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, SubagentView, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseMemoriesResult, UseSubagentParams, 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, useSubagent, useSuggestions, useThreads };
|
package/dist/v2/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as useHumanInTheLoop, $t as DefaultCloseIcon, A as useAttachments, An as CopilotChatConfigurationProvider, At as AttachmentModality, B as UseInterruptConfig, Bt as useThreads, C as NewMemory, Cn as CopilotChatAssistantMessage, Ct as MCPAppsActivityContentSchema, D as useLearningContainers, Dn as CopilotChatInput, Dt as CopilotKitInspectorProps, E as UseLearningContainersArgs, En as CopilotChatToolCallsViewProps, Et as CopilotKitInspector, F as LearnFromUserActionResult, Fn as AudioRecorderError, Ft as CopilotThreadsDrawerProps, G as JsonSerializable, Gt as CopilotPopupView, H as useConfigureSuggestions, Ht as CopilotPopupProps, I as UseLearnFromUserActionRecorder, In as AudioRecorderState, It as CopilotThreadsDrawerRowRenderer, J as SubagentView, Jt as CopilotSidebarViewProps, K as useAgentContext, Kt as CopilotPopupViewProps, L as useLearnFromUserAction, Ln as CopilotChatAudioRecorder, Lt as Thread, M as UseLearnFromUserActionInCurrentThreadRecorder, Mn as CopilotChatConfigurationValue, Mt as CopilotChatAttachmentRenderer, N as useLearnFromUserActionInCurrentThread, Nn as CopilotChatLabels, Nt as CopilotChatAttachmentQueue, O as UseAttachmentsProps, On as CopilotChatInputProps, Ot as WildcardToolCallRender, P as LearnFromUserActionInput, Pn as useCopilotChatConfiguration, Pt as CopilotThreadsDrawer, Q as useAgent, Qt as CopilotChatToggleButtonProps, R as UseMemoriesResult, Rt as UseThreadsInput, S as MemoryScope, Sn as CopilotChatUserMessageProps, St as MCPAppsActivityContent, T as useLearningContainersInCurrentThread, Tn as CopilotChatToolCallsView, Tt as MCPAppsActivityType, U as useSuggestions, Ut as CopilotSidebar, V as useInterrupt, Vt as CopilotPopup, W as AgentContextInput, Wt as CopilotSidebarProps, X as useSubagent, Xt as CopilotModalHeaderProps, Y as UseSubagentParams, Yt as CopilotModalHeader, Z as UseAgentUpdate, Zt as CopilotChatToggleButton, _ as CopilotKitCoreReactConfig, _n as CopilotChatSuggestionPill, _t as ReactToolCallRenderer, a as A2UIMessageRendererOptions, an as AutoScrollMode, at as SandboxFunction, b as MemoryChanges, bn as CopilotChatReasoningMessageProps, bt as ReactCustomMessageRendererPosition, c as InspectorAnchor, cn as INTELLIGENCE_TURN_HEAD, ct as InterruptEvent, d as CopilotKitProvider, dn as getIntelligenceTurnAnchors, dt as InterruptResolveFn, en as DefaultOpenIcon, et as useDefaultRenderTool, f as CopilotKitProviderProps, fn as IntelligenceIndicatorStatus, ft as ResumeEntry, g as CopilotKitCoreReact, gn as CopilotChatSuggestionViewProps, gt as ReactActivityMessageRenderer, h as useCopilotKit, hn as CopilotChatSuggestionView, ht as ReactFrontendTool, i as A2UIActionInterceptor, in as CopilotChatViewProps, it as useRenderActivityMessage, j as LearnFromUserActionInCurrentThreadInput, jn as CopilotChatConfigurationProviderProps, jt as AttachmentsConfig, k as UseAttachmentsReturn, kn as ToolsMenuItem, kt as Attachment, l as SandboxFunctionsContext, ln as IntelligenceIndicator, lt as InterruptHandlerProps, m as CopilotKitContextValue, mn as IntelligenceIndicatorViewProps, mt as ReactHumanInTheLoop, nn as CopilotChatProps, nt as useComponent, o as A2UIUserAction, on as CopilotChatMessageView, ot as Interrupt, p as A2UIRecoveryRendererOptions, pn as IntelligenceIndicatorView, pt as defineToolCallRenderer, q as useCapabilities, qt as CopilotSidebarView, r as CopilotKitProps, rn as CopilotChatView, rt as useFrontendTool, s as createA2UIMessageRenderer, sn as CopilotChatMessageViewProps, st as InterruptCancelFn, t as CopilotKit, tn as CopilotChat, tt as useRenderTool, u as useSandboxFunctions, un as IntelligenceIndicatorProps, ut as InterruptRenderProps, v as CopilotKitCoreReactSubscriber, vn as CopilotChatSuggestionPillProps, vt as useRenderCustomMessages, w as UseLearningContainersInCurrentThreadArgs, wn as CopilotChatAssistantMessageProps, wt as MCPAppsActivityRenderer, x as MemoryKind, xn as CopilotChatUserMessage, xt as useRenderToolCall, y as Memory, yn as CopilotChatReasoningMessage, yt as ReactCustomMessageRenderer, z as useMemories, zt as UseThreadsResult } from "../copilotkit-D6Wy_7iY.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, 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 };
|
|
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, SubagentView, Thread, ToolsMenuItem, UseAgentUpdate, UseAttachmentsProps, UseAttachmentsReturn, UseInterruptConfig, UseLearnFromUserActionInCurrentThreadRecorder, UseLearnFromUserActionRecorder, UseLearningContainersArgs, UseLearningContainersInCurrentThreadArgs, UseMemoriesResult, UseSubagentParams, 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, useSubagent, useSuggestions, useThreads };
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { $ as useCapabilities, A as CopilotChatMessageView, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as
|
|
3
|
+
import { $ as useCapabilities, A as CopilotChatMessageView, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as AudioRecorderError, D as CopilotChat, E as DefaultOpenIcon, Et as useCopilotChatConfiguration, 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 CopilotChatInput_default, T as DefaultCloseIcon, Tt as CopilotChatConfigurationProvider, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as useConfigureSuggestions, Y as useInterrupt, Z as useSuggestions, _ as WildcardToolCallRender, _t as MCPAppsActivityType, at as useRenderTool, b as CopilotSidebar, bt as useCopilotKit, ct as useRenderActivityMessage, dt as defineToolCallRenderer, et as useSubagent, ft as createA2UIMessageRenderer, gt as MCPAppsActivityRenderer, ht as MCPAppsActivityContentSchema, it as useDefaultRenderTool, j as INTELLIGENCE_TURN_HEAD, k as CopilotChatAttachmentQueue, lt as useRenderCustomMessages, mt as useSandboxFunctions, nt as useAgent, ot as useComponent, pt as SandboxFunctionsContext, q as useMemories, rt as useHumanInTheLoop, st as useFrontendTool, t as CopilotKit, tt as UseAgentUpdate, ut as CopilotKitProvider, v as CopilotThreadsDrawer, vt as CopilotKitInspector, w as CopilotChatToggleButton, wt as CopilotChatAudioRecorder, x as CopilotPopupView, xt as CopilotKitCoreReact, y as CopilotPopup, yt as useRenderToolCall, z as CopilotChatAttachmentRenderer } from "../copilotkit-dtSVHJCs.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, useMemories, 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, useSubagent, useSuggestions, useThreads };
|
package/dist/v2/index.umd.js
CHANGED
|
@@ -4367,57 +4367,58 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4367
4367
|
UseAgentUpdate.OnRunStatusChanged
|
|
4368
4368
|
];
|
|
4369
4369
|
function useAgent({ agentId, updates, throttleMs } = {}) {
|
|
4370
|
-
|
|
4370
|
+
const chatConfig = useCopilotChatConfiguration();
|
|
4371
|
+
const resolvedAgentId = agentId ?? chatConfig?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
|
|
4371
4372
|
const { copilotkit } = useCopilotKit();
|
|
4372
4373
|
const providerThrottleMs = copilotkit.defaultThrottleMs;
|
|
4373
4374
|
const [, forceUpdate] = (0, react.useReducer)((x) => x + 1, 0);
|
|
4374
4375
|
const updateFlags = (0, react.useMemo)(() => updates ?? ALL_UPDATES, [JSON.stringify(updates)]);
|
|
4375
4376
|
const provisionalAgentCache = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
4376
4377
|
const agent = (0, react.useMemo)(() => {
|
|
4377
|
-
const existing = copilotkit.getAgent(
|
|
4378
|
+
const existing = copilotkit.getAgent(resolvedAgentId);
|
|
4378
4379
|
if (existing) {
|
|
4379
|
-
provisionalAgentCache.current.delete(
|
|
4380
|
+
provisionalAgentCache.current.delete(resolvedAgentId);
|
|
4380
4381
|
return existing;
|
|
4381
4382
|
}
|
|
4382
4383
|
const isRuntimeConfigured = copilotkit.runtimeUrl !== void 0;
|
|
4383
4384
|
const status = copilotkit.runtimeConnectionStatus;
|
|
4384
4385
|
if (isRuntimeConfigured && (status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Disconnected || status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connecting)) {
|
|
4385
|
-
const cached = provisionalAgentCache.current.get(
|
|
4386
|
+
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
4386
4387
|
if (cached) {
|
|
4387
4388
|
copilotkit.applyHeadersToAgent(cached);
|
|
4388
4389
|
return cached;
|
|
4389
4390
|
}
|
|
4390
4391
|
const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
|
|
4391
4392
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
4392
|
-
agentId,
|
|
4393
|
+
agentId: resolvedAgentId,
|
|
4393
4394
|
transport: copilotkit.runtimeTransport,
|
|
4394
4395
|
runtimeMode: "pending"
|
|
4395
4396
|
});
|
|
4396
4397
|
copilotkit.applyHeadersToAgent(provisional);
|
|
4397
|
-
provisionalAgentCache.current.set(
|
|
4398
|
+
provisionalAgentCache.current.set(resolvedAgentId, provisional);
|
|
4398
4399
|
return provisional;
|
|
4399
4400
|
}
|
|
4400
4401
|
if (isRuntimeConfigured && status === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Error) {
|
|
4401
|
-
const cached = provisionalAgentCache.current.get(
|
|
4402
|
+
const cached = provisionalAgentCache.current.get(resolvedAgentId);
|
|
4402
4403
|
if (cached) {
|
|
4403
4404
|
copilotkit.applyHeadersToAgent(cached);
|
|
4404
4405
|
return cached;
|
|
4405
4406
|
}
|
|
4406
4407
|
const provisional = new _copilotkit_core.ProxiedCopilotRuntimeAgent({
|
|
4407
4408
|
runtimeUrl: copilotkit.runtimeUrl,
|
|
4408
|
-
agentId,
|
|
4409
|
+
agentId: resolvedAgentId,
|
|
4409
4410
|
transport: copilotkit.runtimeTransport,
|
|
4410
4411
|
runtimeMode: "pending"
|
|
4411
4412
|
});
|
|
4412
4413
|
copilotkit.applyHeadersToAgent(provisional);
|
|
4413
|
-
provisionalAgentCache.current.set(
|
|
4414
|
+
provisionalAgentCache.current.set(resolvedAgentId, provisional);
|
|
4414
4415
|
return provisional;
|
|
4415
4416
|
}
|
|
4416
4417
|
const knownAgents = Object.keys(copilotkit.agents ?? {});
|
|
4417
4418
|
const runtimePart = isRuntimeConfigured ? `runtimeUrl=${copilotkit.runtimeUrl}` : "no runtimeUrl";
|
|
4418
|
-
throw new Error(`useAgent: Agent '${
|
|
4419
|
+
throw new Error(`useAgent: Agent '${resolvedAgentId}' not found after runtime sync (${runtimePart}). ` + (knownAgents.length ? `Known agents: [${knownAgents.join(", ")}]` : "No agents registered.") + " Verify your runtime /info and/or agents__unsafe_dev_only.");
|
|
4419
4420
|
}, [
|
|
4420
|
-
|
|
4421
|
+
resolvedAgentId,
|
|
4421
4422
|
copilotkit.agents,
|
|
4422
4423
|
copilotkit.runtimeConnectionStatus,
|
|
4423
4424
|
copilotkit.runtimeUrl,
|
|
@@ -4462,7 +4463,6 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4462
4463
|
(0, react.useEffect)(() => {
|
|
4463
4464
|
if (agent instanceof _ag_ui_client.HttpAgent) copilotkit.applyHeadersToAgent(agent);
|
|
4464
4465
|
}, [agent, JSON.stringify(copilotkit.headers)]);
|
|
4465
|
-
const chatConfig = useCopilotChatConfiguration();
|
|
4466
4466
|
const configThreadId = chatConfig?.threadId;
|
|
4467
4467
|
const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
|
|
4468
4468
|
(0, react.useEffect)(() => {
|
|
@@ -4476,16 +4476,87 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4476
4476
|
return { agent };
|
|
4477
4477
|
}
|
|
4478
4478
|
|
|
4479
|
+
//#endregion
|
|
4480
|
+
//#region src/v2/hooks/use-subagent.tsx
|
|
4481
|
+
const warnedAmbiguousNames = /* @__PURE__ */ new Set();
|
|
4482
|
+
function resolveSubagent(subagents, subagentId, subagentName) {
|
|
4483
|
+
if (subagentId) {
|
|
4484
|
+
const match = subagents[subagentId];
|
|
4485
|
+
return match ? { ...match } : void 0;
|
|
4486
|
+
}
|
|
4487
|
+
if (subagentName) {
|
|
4488
|
+
const matches = Object.values(subagents).filter((s) => s.name === subagentName);
|
|
4489
|
+
if (matches.length === 0) return;
|
|
4490
|
+
const chosen = matches[matches.length - 1];
|
|
4491
|
+
return matches.length > 1 ? {
|
|
4492
|
+
...chosen,
|
|
4493
|
+
isAmbiguous: true,
|
|
4494
|
+
matchCount: matches.length
|
|
4495
|
+
} : { ...chosen };
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
/**
|
|
4499
|
+
* Read a subagent's live lifecycle state (name, description, running status)
|
|
4500
|
+
* from the CopilotKit core subagent registry, by id or by declared name.
|
|
4501
|
+
*
|
|
4502
|
+
* @example
|
|
4503
|
+
* const sub = useSubagent({ subagentId: message.subagentId });
|
|
4504
|
+
* // sub?.name, sub?.description, sub?.status
|
|
4505
|
+
*/
|
|
4506
|
+
function useSubagent(params) {
|
|
4507
|
+
const { subagentId, subagentName, agentId } = params;
|
|
4508
|
+
const { copilotkit } = useCopilotKit();
|
|
4509
|
+
const config = useCopilotChatConfiguration();
|
|
4510
|
+
const resolvedAgentId = (0, react.useMemo)(() => agentId ?? config?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID, [agentId, config?.agentId]);
|
|
4511
|
+
const [subagent, setSubagent] = (0, react.useState)(() => resolveSubagent(copilotkit.getSubagents(resolvedAgentId), subagentId, subagentName));
|
|
4512
|
+
(0, react.useEffect)(() => {
|
|
4513
|
+
setSubagent(resolveSubagent(copilotkit.getSubagents(resolvedAgentId), subagentId, subagentName));
|
|
4514
|
+
}, [
|
|
4515
|
+
copilotkit,
|
|
4516
|
+
resolvedAgentId,
|
|
4517
|
+
subagentId,
|
|
4518
|
+
subagentName
|
|
4519
|
+
]);
|
|
4520
|
+
(0, react.useEffect)(() => {
|
|
4521
|
+
const subscription = copilotkit.subscribe({ onSubagentsChanged: ({ agentId: changedAgentId, subagents }) => {
|
|
4522
|
+
if (changedAgentId !== resolvedAgentId) return;
|
|
4523
|
+
setSubagent(resolveSubagent(subagents, subagentId, subagentName));
|
|
4524
|
+
} });
|
|
4525
|
+
return () => {
|
|
4526
|
+
subscription.unsubscribe();
|
|
4527
|
+
};
|
|
4528
|
+
}, [
|
|
4529
|
+
copilotkit,
|
|
4530
|
+
resolvedAgentId,
|
|
4531
|
+
subagentId,
|
|
4532
|
+
subagentName
|
|
4533
|
+
]);
|
|
4534
|
+
(0, react.useEffect)(() => {
|
|
4535
|
+
if (process.env.NODE_ENV === "production" || !subagentName || !subagent?.isAmbiguous) return;
|
|
4536
|
+
const key = `${subagentName}:${subagent.matchCount}`;
|
|
4537
|
+
if (warnedAmbiguousNames.has(key)) return;
|
|
4538
|
+
warnedAmbiguousNames.add(key);
|
|
4539
|
+
console.warn(`[CopilotKit] useSubagent({ subagentName: ${JSON.stringify(subagentName)} }) matched ${subagent.matchCount} subagents. Returning the most recently started one; pass a subagentId for a stable reference.`);
|
|
4540
|
+
}, [
|
|
4541
|
+
subagentName,
|
|
4542
|
+
subagent?.isAmbiguous,
|
|
4543
|
+
subagent?.matchCount
|
|
4544
|
+
]);
|
|
4545
|
+
return subagent;
|
|
4546
|
+
}
|
|
4547
|
+
|
|
4479
4548
|
//#endregion
|
|
4480
4549
|
//#region src/v2/hooks/use-capabilities.tsx
|
|
4481
4550
|
/**
|
|
4482
|
-
* Returns the capabilities declared by the given agent (or the
|
|
4551
|
+
* Returns the capabilities declared by the given agent (or the agent resolved
|
|
4552
|
+
* from the surrounding chat configuration, falling back to the default agent).
|
|
4483
4553
|
* Capabilities are populated from the runtime `/info` response at connection
|
|
4484
4554
|
* time. The hook reads them synchronously from the agent instance — there is
|
|
4485
4555
|
* no separate loading state, but the value will be `undefined` until the
|
|
4486
4556
|
* runtime handshake completes.
|
|
4487
4557
|
*
|
|
4488
|
-
* @param agentId - Optional agent ID. If omitted,
|
|
4558
|
+
* @param agentId - Optional agent ID. If omitted, inherits the surrounding
|
|
4559
|
+
* chat configuration's agent, falling back to the default agent.
|
|
4489
4560
|
* @returns The agent's capabilities, or `undefined` if the agent doesn't
|
|
4490
4561
|
* declare capabilities.
|
|
4491
4562
|
*/
|
|
@@ -5058,6 +5129,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5058
5129
|
})), [coreThreads]);
|
|
5059
5130
|
const storeIsLoading = useThreadStoreSelector(store, _copilotkit_core.ɵselectThreadsIsLoading);
|
|
5060
5131
|
const storeError = useThreadStoreSelector(store, _copilotkit_core.ɵselectThreadsError);
|
|
5132
|
+
const fetchMoreError = useThreadStoreSelector(store, _copilotkit_core.ɵselectFetchMoreError);
|
|
5061
5133
|
const hasMoreThreads = useThreadStoreSelector(store, _copilotkit_core.ɵselectHasNextPage);
|
|
5062
5134
|
const isFetchingMoreThreads = useThreadStoreSelector(store, _copilotkit_core.ɵselectIsFetchingNextPage);
|
|
5063
5135
|
const isMutating = useThreadStoreSelector(store, _copilotkit_core.ɵselectIsMutating);
|
|
@@ -5163,6 +5235,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5163
5235
|
isLoading,
|
|
5164
5236
|
error,
|
|
5165
5237
|
listError,
|
|
5238
|
+
fetchMoreError,
|
|
5166
5239
|
hasMoreThreads,
|
|
5167
5240
|
isFetchingMoreThreads,
|
|
5168
5241
|
isMutating,
|
|
@@ -9104,7 +9177,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9104
9177
|
* during prerender to avoid hydration mismatch).
|
|
9105
9178
|
* - Feeds the element domain data: `threads`, `loading`, `error`,
|
|
9106
9179
|
* `activeThreadId`, `licensed`, fetch-more state.
|
|
9107
|
-
* - Routes the element's
|
|
9180
|
+
* - Routes the element's outbound events to core thread operations
|
|
9108
9181
|
* ({@link useThreads}) and chat-configuration changes.
|
|
9109
9182
|
* - Registers with the surrounding chat configuration so the header
|
|
9110
9183
|
* thread-list launcher appears, and binds the element `open` state to the
|
|
@@ -9131,16 +9204,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9131
9204
|
* </CopilotKitProvider>
|
|
9132
9205
|
* ```
|
|
9133
9206
|
*/
|
|
9134
|
-
function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed, licenseUrl, renderRow, label, limit, "data-testid": dataTestId = "copilot-threads-drawer" }) {
|
|
9207
|
+
function CopilotThreadsDrawer({ agentId, onThreadSelect, onNewThread, onLicensed, licenseUrl, renderRow, label, recentLabel, collapsible, onCollapseChange, limit, "data-testid": dataTestId = "copilot-threads-drawer" }) {
|
|
9135
9208
|
const configuration = useCopilotChatConfiguration();
|
|
9136
9209
|
const { status, checkFeature } = useLicenseContext();
|
|
9137
9210
|
const licensePresent = status === "valid" || status === "expiring";
|
|
9138
9211
|
const featureLicensed = checkFeature("threads");
|
|
9139
9212
|
const licensed = licensePresent && featureLicensed;
|
|
9140
9213
|
const licensePending = status === null;
|
|
9141
|
-
const resolvedAgentId = agentId ?? configuration?.agentId ??
|
|
9214
|
+
const resolvedAgentId = agentId ?? configuration?.agentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
|
|
9142
9215
|
const activeThreadId = configuration?.threadId ?? null;
|
|
9143
|
-
const { threads, isLoading, listError, hasMoreThreads, isFetchingMoreThreads, archiveThread, unarchiveThread, deleteThread, fetchMoreThreads, refetchThreads, startNewThread } = useThreads({
|
|
9216
|
+
const { threads, isLoading, listError, fetchMoreError, hasMoreThreads, isFetchingMoreThreads, archiveThread, unarchiveThread, deleteThread, fetchMoreThreads, refetchThreads, startNewThread } = useThreads({
|
|
9144
9217
|
agentId: resolvedAgentId,
|
|
9145
9218
|
includeArchived: true,
|
|
9146
9219
|
enabled: licensed,
|
|
@@ -9221,6 +9294,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9221
9294
|
const handleLoadMore = (0, react.useCallback)(() => {
|
|
9222
9295
|
fetchMoreThreads();
|
|
9223
9296
|
}, [fetchMoreThreads]);
|
|
9297
|
+
const handleCollapseChange = (0, react.useCallback)((collapsed) => {
|
|
9298
|
+
onCollapseChange?.(collapsed);
|
|
9299
|
+
}, [onCollapseChange]);
|
|
9224
9300
|
const handlersRef = (0, react.useRef)({
|
|
9225
9301
|
handleThreadSelected,
|
|
9226
9302
|
handleNewThread,
|
|
@@ -9231,7 +9307,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9231
9307
|
handleRetry,
|
|
9232
9308
|
handleOpenChange,
|
|
9233
9309
|
handleLicensed,
|
|
9234
|
-
handleLoadMore
|
|
9310
|
+
handleLoadMore,
|
|
9311
|
+
handleCollapseChange
|
|
9235
9312
|
});
|
|
9236
9313
|
handlersRef.current = {
|
|
9237
9314
|
handleThreadSelected,
|
|
@@ -9243,7 +9320,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9243
9320
|
handleRetry,
|
|
9244
9321
|
handleOpenChange,
|
|
9245
9322
|
handleLicensed,
|
|
9246
|
-
handleLoadMore
|
|
9323
|
+
handleLoadMore,
|
|
9324
|
+
handleCollapseChange
|
|
9247
9325
|
};
|
|
9248
9326
|
(0, react.useEffect)(() => {
|
|
9249
9327
|
const el = elementRef.current;
|
|
@@ -9278,6 +9356,10 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9278
9356
|
};
|
|
9279
9357
|
const onLicensedEvent = () => handlersRef.current.handleLicensed();
|
|
9280
9358
|
const onLoadMore = () => handlersRef.current.handleLoadMore();
|
|
9359
|
+
const onCollapseChangeEvent = (event) => {
|
|
9360
|
+
const detail = event.detail;
|
|
9361
|
+
handlersRef.current.handleCollapseChange(detail.collapsed);
|
|
9362
|
+
};
|
|
9281
9363
|
el.addEventListener("thread-selected", onThreadSelected);
|
|
9282
9364
|
el.addEventListener("new-thread", onNewThreadEvent);
|
|
9283
9365
|
el.addEventListener("archive", onArchive);
|
|
@@ -9288,6 +9370,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9288
9370
|
el.addEventListener("retry", onRetry);
|
|
9289
9371
|
el.addEventListener("licensed", onLicensedEvent);
|
|
9290
9372
|
el.addEventListener("load-more", onLoadMore);
|
|
9373
|
+
el.addEventListener("collapse-change", onCollapseChangeEvent);
|
|
9291
9374
|
return () => {
|
|
9292
9375
|
el.removeEventListener("thread-selected", onThreadSelected);
|
|
9293
9376
|
el.removeEventListener("new-thread", onNewThreadEvent);
|
|
@@ -9299,6 +9382,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9299
9382
|
el.removeEventListener("retry", onRetry);
|
|
9300
9383
|
el.removeEventListener("licensed", onLicensedEvent);
|
|
9301
9384
|
el.removeEventListener("load-more", onLoadMore);
|
|
9385
|
+
el.removeEventListener("collapse-change", onCollapseChangeEvent);
|
|
9302
9386
|
};
|
|
9303
9387
|
}, [mounted]);
|
|
9304
9388
|
(0, react.useEffect)(() => {
|
|
@@ -9315,9 +9399,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9315
9399
|
el.licensed = licensed || licensePending;
|
|
9316
9400
|
el.hasMore = hasMoreThreads;
|
|
9317
9401
|
el.fetchingMore = isFetchingMoreThreads;
|
|
9402
|
+
el.fetchMoreError = fetchMoreError ? fetchMoreError.message : null;
|
|
9318
9403
|
}, [
|
|
9319
9404
|
isLoading,
|
|
9320
9405
|
listError,
|
|
9406
|
+
fetchMoreError,
|
|
9321
9407
|
activeThreadId,
|
|
9322
9408
|
licensed,
|
|
9323
9409
|
licensePending,
|
|
@@ -9340,6 +9426,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9340
9426
|
if (!el) return;
|
|
9341
9427
|
if (licenseUrl !== void 0) el.licenseUrl = licenseUrl;
|
|
9342
9428
|
}, [licenseUrl, mounted]);
|
|
9429
|
+
(0, react.useEffect)(() => {
|
|
9430
|
+
const el = elementRef.current;
|
|
9431
|
+
if (!el) return;
|
|
9432
|
+
if (collapsible !== void 0) el.collapsible = collapsible;
|
|
9433
|
+
}, [collapsible, mounted]);
|
|
9343
9434
|
const rowChildren = (0, react.useMemo)(() => {
|
|
9344
9435
|
if (!renderRow) return null;
|
|
9345
9436
|
return drawerThreads.map((drawerThread) => {
|
|
@@ -9360,7 +9451,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
9360
9451
|
if (!mounted) return null;
|
|
9361
9452
|
return react.default.createElement(_copilotkit_web_components_threads_drawer.COPILOTKIT_THREADS_DRAWER_TAG, {
|
|
9362
9453
|
ref: elementRef,
|
|
9363
|
-
"data-testid": dataTestId
|
|
9454
|
+
"data-testid": dataTestId,
|
|
9455
|
+
...recentLabel !== void 0 ? { "recent-label": recentLabel } : {}
|
|
9364
9456
|
}, rowChildren);
|
|
9365
9457
|
}
|
|
9366
9458
|
CopilotThreadsDrawer.displayName = "CopilotThreadsDrawer";
|
|
@@ -10899,8 +10991,18 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
10899
10991
|
}, [agent, getSubscriber]);
|
|
10900
10992
|
};
|
|
10901
10993
|
function CopilotListenersAgentSubscription() {
|
|
10902
|
-
const
|
|
10903
|
-
const
|
|
10994
|
+
const { copilotkit } = useCopilotKit();
|
|
10995
|
+
const configAgentId = useCopilotChatConfiguration()?.agentId;
|
|
10996
|
+
const { agent } = useAgent({ agentId: (0, react.useMemo)(() => {
|
|
10997
|
+
const requested = configAgentId ?? _copilotkit_shared.DEFAULT_AGENT_ID;
|
|
10998
|
+
const registered = copilotkit.agents ?? {};
|
|
10999
|
+
if (registered[requested]) return requested;
|
|
11000
|
+
if (requested === _copilotkit_shared.DEFAULT_AGENT_ID) {
|
|
11001
|
+
const firstRegistered = Object.keys(registered)[0];
|
|
11002
|
+
if (firstRegistered) return firstRegistered;
|
|
11003
|
+
}
|
|
11004
|
+
return requested;
|
|
11005
|
+
}, [configAgentId, copilotkit.agents]) });
|
|
10904
11006
|
usePredictStateSubscription(agent);
|
|
10905
11007
|
return null;
|
|
10906
11008
|
}
|
|
@@ -11521,6 +11623,7 @@ exports.useRenderCustomMessages = useRenderCustomMessages;
|
|
|
11521
11623
|
exports.useRenderTool = useRenderTool;
|
|
11522
11624
|
exports.useRenderToolCall = useRenderToolCall;
|
|
11523
11625
|
exports.useSandboxFunctions = useSandboxFunctions;
|
|
11626
|
+
exports.useSubagent = useSubagent;
|
|
11524
11627
|
exports.useSuggestions = useSuggestions;
|
|
11525
11628
|
exports.useThreads = useThreads;
|
|
11526
11629
|
Object.keys(_copilotkit_core).forEach(function (k) {
|