@copilotkit/react-core 1.69.2 → 1.70.0
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-BmW2sFH6.mjs → copilotkit-B7aFKfQR.mjs} +138 -77
- package/dist/copilotkit-B7aFKfQR.mjs.map +1 -0
- package/dist/{copilotkit-Ba7qwYt3.cjs → copilotkit-BE76j111.cjs} +142 -75
- package/dist/copilotkit-BE76j111.cjs.map +1 -0
- package/dist/{copilotkit-CF1Pm2VG.d.cts → copilotkit-BuzP0VeG.d.cts} +47 -18
- package/dist/copilotkit-BuzP0VeG.d.cts.map +1 -0
- package/dist/{copilotkit-TdM-5onZ.d.mts → copilotkit-CbZGwElm.d.mts} +47 -18
- package/dist/copilotkit-CbZGwElm.d.mts.map +1 -0
- package/dist/index.cjs +93 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +17 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +93 -21
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +206 -87
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +15 -8
- package/dist/v2/headless.cjs.map +1 -1
- package/dist/v2/headless.d.cts.map +1 -1
- package/dist/v2/headless.d.mts.map +1 -1
- package/dist/v2/headless.mjs +15 -8
- 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 +140 -77
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +9 -10
- package/skills/react-core/SKILL.md +5 -3
- package/skills/react-core/references/agent-access.md +68 -1
- package/skills/react-core/references/debug-mode.md +21 -34
- package/skills/react-core/references/switching-agents-recipes.md +1 -0
- package/skills/react-core/references/switching-agents.md +9 -0
- package/skills/react-core/references/threads.md +65 -0
- package/dist/copilotkit-Ba7qwYt3.cjs.map +0 -1
- package/dist/copilotkit-BmW2sFH6.mjs.map +0 -1
- package/dist/copilotkit-CF1Pm2VG.d.cts.map +0 -1
- package/dist/copilotkit-TdM-5onZ.d.mts.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-BE76j111.cjs');
|
|
5
5
|
require("./index.css");
|
|
6
6
|
let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
|
|
7
7
|
let _copilotkit_react_core_v2_context = require("@copilotkit/react-core/v2/context");
|
|
@@ -56,6 +56,7 @@ Object.defineProperty(exports, 'CopilotSidebarView', {
|
|
|
56
56
|
exports.CopilotThreadsDrawer = require_copilotkit.CopilotThreadsDrawer;
|
|
57
57
|
exports.GenerateSandboxedUiArgsSchema = require_copilotkit.GenerateSandboxedUiArgsSchema;
|
|
58
58
|
exports.INTELLIGENCE_TURN_HEAD = require_copilotkit.INTELLIGENCE_TURN_HEAD;
|
|
59
|
+
exports.INTERRUPT_EVENT_NAME = require_copilotkit.INTERRUPT_EVENT_NAME;
|
|
59
60
|
exports.IntelligenceIndicator = require_copilotkit.IntelligenceIndicator;
|
|
60
61
|
exports.IntelligenceIndicatorView = require_copilotkit.IntelligenceIndicatorView;
|
|
61
62
|
exports.MCPAppsActivityContentSchema = require_copilotkit.MCPAppsActivityContentSchema;
|
package/dist/v2/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as useRenderTool, $t as
|
|
1
|
+
import { $ as useRenderTool, $t as CopilotPopupView, A as UseAttachmentsReturn, An as CopilotChatUserMessageProps, At as MCPAppsActivityRenderer, B as useMemories, Bn as CopilotChatConfigurationProviderProps, Bt as CopilotChatAttachmentRenderer, C as MemoryScope, Cn as CopilotChatSuggestionView, Ct as OpenGenerativeUIActivityRenderer, D as UseLearningContainersArgs, Dn as CopilotChatReasoningMessage, Dt as OpenGenerativeUIToolRenderer, E as useLearningContainersInCurrentThread, En as CopilotChatSuggestionPillProps, Et as OpenGenerativeUIContentSchema, F as LearnFromUserActionInput, Fn as CopilotChatToolCallsViewProps, Ft as CopilotKitInspectorProps, G as AgentContextInput, Gn as AudioRecorderState, Gt as Thread, H as useInterrupt, Hn as CopilotChatLabels, Ht as CopilotThreadsDrawer, I as LearnFromUserActionResult, In as CopilotChatInput, It as WildcardToolCallRender, J as useCapabilities, Jt as useThreads, K as JsonSerializable, Kn as CopilotChatAudioRecorder, Kt as UseThreadsInput, L as UseLearnFromUserActionRecorder, Ln as CopilotChatInputProps, Lt as Attachment, M as LearnFromUserActionInCurrentThreadInput, Mn as CopilotChatAssistantMessageProps, Mt as ɵMcpFollowUpHost, N as UseLearnFromUserActionInCurrentThreadRecorder, Nn as CopilotChatFeedbackMessage, Nt as ɵrunMcpFollowUp, O as useLearningContainers, On as CopilotChatReasoningMessageProps, Ot as MCPAppsActivityContent, P as useLearnFromUserActionInCurrentThread, Pn as CopilotChatToolCallsView, Pt as CopilotKitInspector, Q as useDefaultRenderTool, Qt as CopilotSidebarProps, R as useLearnFromUserAction, Rn as ToolsMenuItem, Rt as AttachmentModality, S as MemoryKind, Sn as IntelligenceIndicatorViewProps, St as GenerateSandboxedUiArgsSchema, T as UseLearningContainersInCurrentThreadArgs, Tn as CopilotChatSuggestionPill, Tt as OpenGenerativeUIContent, U as useConfigureSuggestions, Un as useCopilotChatConfiguration, Ut as CopilotThreadsDrawerProps, V as UseInterruptConfig, Vn as CopilotChatConfigurationValue, Vt as CopilotChatAttachmentQueue, W as useSuggestions, Wn as AudioRecorderError, Wt as CopilotThreadsDrawerRowRenderer, X as useAgent, Xt as CopilotPopupProps, Y as UseAgentUpdate, Yt as CopilotPopup, Z as useHumanInTheLoop, Zt as CopilotSidebar, _ as CopilotKitCoreReact, _n as IntelligenceIndicator, _t as useRenderCustomMessages, a as A2UIMessageRendererOptions, an as CopilotChatToggleButton, at as Interrupt, b as Memory, bn as IntelligenceIndicatorStatus, bt as useRenderToolCall, c as InspectorAnchor, cn as DefaultOpenIcon, ct as InterruptHandlerProps, d as CopilotKitProvider, dn as CopilotChatView, dt as ResumeEntry, en as CopilotPopupViewProps, et as useComponent, f as CopilotKitProviderProps, fn as CopilotChatViewProps, ft as defineToolCallRenderer, g as useLicenseContext, gn as INTELLIGENCE_TURN_HEAD, gt as ReactToolCallRenderer, h as useCopilotKit, hn as CopilotChatMessageViewProps, ht as ReactActivityMessageRenderer, i as A2UIActionInterceptor, in as CopilotModalHeaderProps, it as INTERRUPT_EVENT_NAME, j as useAttachments, jn as CopilotChatAssistantMessage, jt as MCPAppsActivityType, k as UseAttachmentsProps, kn as CopilotChatUserMessage, kt as MCPAppsActivityContentSchema, l as SandboxFunctionsContext, ln as CopilotChat, lt as InterruptRenderProps, m as CopilotKitContextValue, mn as CopilotChatMessageView, mt as ReactFrontendTool, nn as CopilotSidebarViewProps, nt as useRenderActivityMessage, o as A2UIUserAction, on as CopilotChatToggleButtonProps, ot as InterruptCancelFn, p as A2UIRecoveryRendererOptions, pn as AutoScrollMode, pt as ReactHumanInTheLoop, q as useAgentContext, qt as UseThreadsResult, r as CopilotKitProps, rn as CopilotModalHeader, rt as SandboxFunction, s as createA2UIMessageRenderer, sn as DefaultCloseIcon, st as InterruptEvent, t as CopilotKit, tn as CopilotSidebarView, tt as useFrontendTool, u as useSandboxFunctions, un as CopilotChatProps, ut as InterruptResolveFn, v as CopilotKitCoreReactConfig, vn as IntelligenceIndicatorProps, vt as ReactCustomMessageRenderer, w as NewMemory, wn as CopilotChatSuggestionViewProps, wt as OpenGenerativeUIActivityType, x as MemoryChanges, xn as IntelligenceIndicatorView, xt as GenerateSandboxedUiArgs, y as CopilotKitCoreReactSubscriber, yn as getIntelligenceTurnAnchors, yt as ReactCustomMessageRendererPosition, z as UseMemoriesResult, zn as CopilotChatConfigurationProvider, zt as AttachmentsConfig } from "../copilotkit-BuzP0VeG.cjs";
|
|
2
2
|
import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
|
|
3
3
|
export * from "@copilotkit/core";
|
|
4
4
|
export * from "@ag-ui/client";
|
|
5
|
-
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, CopilotChatFeedbackMessage, 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, GenerateSandboxedUiArgs, GenerateSandboxedUiArgsSchema, 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, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContent, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, 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, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵMcpFollowUpHost, ɵrunMcpFollowUp };
|
|
5
|
+
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, CopilotChatFeedbackMessage, 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, GenerateSandboxedUiArgs, GenerateSandboxedUiArgsSchema, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, 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, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContent, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, 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, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵMcpFollowUpHost, ɵrunMcpFollowUp };
|
package/dist/v2/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as useRenderTool, $t as
|
|
1
|
+
import { $ as useRenderTool, $t as CopilotPopupView, A as UseAttachmentsReturn, An as CopilotChatUserMessageProps, At as MCPAppsActivityRenderer, B as useMemories, Bn as CopilotChatConfigurationProviderProps, Bt as CopilotChatAttachmentRenderer, C as MemoryScope, Cn as CopilotChatSuggestionView, Ct as OpenGenerativeUIActivityRenderer, D as UseLearningContainersArgs, Dn as CopilotChatReasoningMessage, Dt as OpenGenerativeUIToolRenderer, E as useLearningContainersInCurrentThread, En as CopilotChatSuggestionPillProps, Et as OpenGenerativeUIContentSchema, F as LearnFromUserActionInput, Fn as CopilotChatToolCallsViewProps, Ft as CopilotKitInspectorProps, G as AgentContextInput, Gn as AudioRecorderState, Gt as Thread, H as useInterrupt, Hn as CopilotChatLabels, Ht as CopilotThreadsDrawer, I as LearnFromUserActionResult, In as CopilotChatInput, It as WildcardToolCallRender, J as useCapabilities, Jt as useThreads, K as JsonSerializable, Kn as CopilotChatAudioRecorder, Kt as UseThreadsInput, L as UseLearnFromUserActionRecorder, Ln as CopilotChatInputProps, Lt as Attachment, M as LearnFromUserActionInCurrentThreadInput, Mn as CopilotChatAssistantMessageProps, Mt as ɵMcpFollowUpHost, N as UseLearnFromUserActionInCurrentThreadRecorder, Nn as CopilotChatFeedbackMessage, Nt as ɵrunMcpFollowUp, O as useLearningContainers, On as CopilotChatReasoningMessageProps, Ot as MCPAppsActivityContent, P as useLearnFromUserActionInCurrentThread, Pn as CopilotChatToolCallsView, Pt as CopilotKitInspector, Q as useDefaultRenderTool, Qt as CopilotSidebarProps, R as useLearnFromUserAction, Rn as ToolsMenuItem, Rt as AttachmentModality, S as MemoryKind, Sn as IntelligenceIndicatorViewProps, St as GenerateSandboxedUiArgsSchema, T as UseLearningContainersInCurrentThreadArgs, Tn as CopilotChatSuggestionPill, Tt as OpenGenerativeUIContent, U as useConfigureSuggestions, Un as useCopilotChatConfiguration, Ut as CopilotThreadsDrawerProps, V as UseInterruptConfig, Vn as CopilotChatConfigurationValue, Vt as CopilotChatAttachmentQueue, W as useSuggestions, Wn as AudioRecorderError, Wt as CopilotThreadsDrawerRowRenderer, X as useAgent, Xt as CopilotPopupProps, Y as UseAgentUpdate, Yt as CopilotPopup, Z as useHumanInTheLoop, Zt as CopilotSidebar, _ as useCopilotKit, _n as IntelligenceIndicator, _t as useRenderCustomMessages, a as A2UIMessageRendererOptions, an as CopilotChatToggleButton, at as Interrupt, b as Memory, bn as IntelligenceIndicatorStatus, bt as useRenderToolCall, c as CopilotKitCoreReact, cn as DefaultOpenIcon, ct as InterruptHandlerProps, d as InspectorAnchor, dn as CopilotChatView, dt as ResumeEntry, en as CopilotPopupViewProps, et as useComponent, f as SandboxFunctionsContext, fn as CopilotChatViewProps, ft as defineToolCallRenderer, g as CopilotKitProviderProps, gn as INTELLIGENCE_TURN_HEAD, gt as ReactToolCallRenderer, h as CopilotKitProvider, hn as CopilotChatMessageViewProps, ht as ReactActivityMessageRenderer, i as A2UIActionInterceptor, in as CopilotModalHeaderProps, it as INTERRUPT_EVENT_NAME, j as useAttachments, jn as CopilotChatAssistantMessage, jt as MCPAppsActivityType, k as UseAttachmentsProps, kn as CopilotChatUserMessage, kt as MCPAppsActivityContentSchema, l as CopilotKitCoreReactConfig, ln as CopilotChat, lt as InterruptRenderProps, m as CopilotKitContextValue, mn as CopilotChatMessageView, mt as ReactFrontendTool, nn as CopilotSidebarViewProps, nt as useRenderActivityMessage, o as A2UIUserAction, on as CopilotChatToggleButtonProps, ot as InterruptCancelFn, p as useSandboxFunctions, pn as AutoScrollMode, pt as ReactHumanInTheLoop, q as useAgentContext, qt as UseThreadsResult, r as CopilotKitProps, rn as CopilotModalHeader, rt as SandboxFunction, s as createA2UIMessageRenderer, sn as DefaultCloseIcon, st as InterruptEvent, t as CopilotKit, tn as CopilotSidebarView, tt as useFrontendTool, u as CopilotKitCoreReactSubscriber, un as CopilotChatProps, ut as InterruptResolveFn, v as useLicenseContext, vn as IntelligenceIndicatorProps, vt as ReactCustomMessageRenderer, w as NewMemory, wn as CopilotChatSuggestionViewProps, wt as OpenGenerativeUIActivityType, x as MemoryChanges, xn as IntelligenceIndicatorView, xt as GenerateSandboxedUiArgs, y as A2UIRecoveryRendererOptions, yn as getIntelligenceTurnAnchors, yt as ReactCustomMessageRendererPosition, z as UseMemoriesResult, zn as CopilotChatConfigurationProvider, zt as AttachmentsConfig } from "../copilotkit-CbZGwElm.mjs";
|
|
2
2
|
import { Theme as A2UITheme, defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
|
|
3
3
|
export * from "@copilotkit/core";
|
|
4
4
|
export * from "@ag-ui/client";
|
|
5
|
-
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, CopilotChatFeedbackMessage, 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, GenerateSandboxedUiArgs, GenerateSandboxedUiArgsSchema, 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, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContent, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, 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, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵMcpFollowUpHost, ɵrunMcpFollowUp };
|
|
5
|
+
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, CopilotChatFeedbackMessage, 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, GenerateSandboxedUiArgs, GenerateSandboxedUiArgsSchema, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, 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, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContent, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, 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, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵMcpFollowUpHost, ɵrunMcpFollowUp };
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as useAgentContext, A as CopilotChatMessageView, At as AudioRecorderError, B as CopilotChatAssistantMessage_default, C as CopilotModalHeader, Ct as MCPAppsActivityContentSchema, D as CopilotChat, Dt as CopilotKitInspector, E as DefaultOpenIcon, Et as ɵrunMcpFollowUp, 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, Mt as CopilotChatConfigurationProvider, N as getIntelligenceTurnAnchors, Nt as useCopilotChatConfiguration, O as CopilotChatView_default, Ot as useRenderToolCall, P as IntelligenceIndicatorView, Q as useSuggestions, R as CopilotChatUserMessage_default, S as CopilotSidebarView, St as useSandboxFunctions, T as DefaultCloseIcon, Tt as MCPAppsActivityType, U as useLearningContainers, V as CopilotChatToolCallsView, W as useAttachments, X as INTERRUPT_EVENT_NAME, Y as useInterrupt, Z as useConfigureSuggestions, _ as WildcardToolCallRender, _t as OpenGenerativeUIActivityRenderer, at as useRenderTool, b as CopilotSidebar, bt as OpenGenerativeUIToolRenderer, ct as useRenderActivityMessage, dt as useCopilotKit, et as useCapabilities, ft as useLicenseContext, gt as GenerateSandboxedUiArgsSchema, ht as createA2UIMessageRenderer, it as useDefaultRenderTool, j as INTELLIGENCE_TURN_HEAD, jt as CopilotChatAudioRecorder, k as CopilotChatAttachmentQueue, kt as CopilotChatInput_default, lt as useRenderCustomMessages, mt as defineToolCallRenderer, nt as useAgent, ot as useComponent, pt as CopilotKitCoreReact, q as useMemories, rt as useHumanInTheLoop, st as useFrontendTool, t as CopilotKit, tt as UseAgentUpdate, ut as CopilotKitProvider, v as CopilotThreadsDrawer, vt as OpenGenerativeUIActivityType, w as CopilotChatToggleButton, wt as MCPAppsActivityRenderer, x as CopilotPopupView, xt as SandboxFunctionsContext, y as CopilotPopup, yt as OpenGenerativeUIContentSchema, z as CopilotChatAttachmentRenderer } from "../copilotkit-B7aFKfQR.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, GenerateSandboxedUiArgsSchema, INTELLIGENCE_TURN_HEAD, IntelligenceIndicator, IntelligenceIndicatorView, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵrunMcpFollowUp };
|
|
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, GenerateSandboxedUiArgsSchema, INTELLIGENCE_TURN_HEAD, INTERRUPT_EVENT_NAME, IntelligenceIndicator, IntelligenceIndicatorView, MCPAppsActivityContentSchema, MCPAppsActivityRenderer, MCPAppsActivityType, OpenGenerativeUIActivityRenderer, OpenGenerativeUIActivityType, OpenGenerativeUIContentSchema, OpenGenerativeUIToolRenderer, SandboxFunctionsContext, UseAgentUpdate, WildcardToolCallRender, a2uiDefaultTheme, createA2UIMessageRenderer, defineToolCallRenderer, getIntelligenceTurnAnchors, useAgent, useAgentContext, useAttachments, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useDefaultRenderTool, useFrontendTool, useHumanInTheLoop, useInterrupt, useLearnFromUserAction, useLearnFromUserActionInCurrentThread, useLearningContainers, useLearningContainersInCurrentThread, useLicenseContext, useMemories, useRenderActivityMessage, useRenderCustomMessages, useRenderTool, useRenderToolCall, useSandboxFunctions, useSuggestions, useThreads, ɵrunMcpFollowUp };
|
package/dist/v2/index.umd.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
(function(global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('./index.css'), require('@copilotkit/core'), require('@ag-ui/client'), require('react'), require('tailwind-merge'), require('lucide-react'), require('@copilotkit/shared'), require('react/jsx-runtime'), require('@radix-ui/react-slot'), require('class-variance-authority'), require('clsx'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-dropdown-menu'), require('streamdown'), require('zod'), require('@
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', './index.css', '@copilotkit/core', '@ag-ui/client', 'react', 'tailwind-merge', 'lucide-react', '@copilotkit/shared', 'react/jsx-runtime', '@radix-ui/react-slot', 'class-variance-authority', 'clsx', '@radix-ui/react-tooltip', '@radix-ui/react-dropdown-menu', 'streamdown', 'zod', '@
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitReactCoreV2 = {}), global.src_v2_index_css,global.CopilotKitCore,global.AgUIClient,global.React,global.tailwindMerge,global.lucideReact,global.CopilotKitShared,global.ReactJsxRuntime,global.RadixReactSlot,global.classVarianceAuthority,global.clsx,global.RadixReactTooltip,global.RadixReactDropdownMenu,global.streamdown,global.Zod,global.
|
|
7
|
-
})(this, function(exports, src_v2_index_css, _copilotkit_core, _ag_ui_client, react, tailwind_merge, lucide_react, _copilotkit_shared, react_jsx_runtime, _radix_ui_react_slot, class_variance_authority, clsx, _radix_ui_react_tooltip, _radix_ui_react_dropdown_menu, streamdown, zod,
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('./index.css'), require('@copilotkit/core'), require('@ag-ui/client'), require('react'), require('tailwind-merge'), require('lucide-react'), require('@copilotkit/shared'), require('react/jsx-runtime'), require('@radix-ui/react-slot'), require('class-variance-authority'), require('clsx'), require('@radix-ui/react-tooltip'), require('@radix-ui/react-dropdown-menu'), require('streamdown'), require('zod'), require('@copilotkit/a2ui-renderer'), require('zod-to-json-schema'), require('react-dom'), require('@tanstack/react-virtual'), require('use-stick-to-bottom'), require('@copilotkit/web-components/threads-drawer')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', './index.css', '@copilotkit/core', '@ag-ui/client', 'react', 'tailwind-merge', 'lucide-react', '@copilotkit/shared', 'react/jsx-runtime', '@radix-ui/react-slot', 'class-variance-authority', 'clsx', '@radix-ui/react-tooltip', '@radix-ui/react-dropdown-menu', 'streamdown', 'zod', '@copilotkit/a2ui-renderer', 'zod-to-json-schema', 'react-dom', '@tanstack/react-virtual', 'use-stick-to-bottom', '@copilotkit/web-components/threads-drawer'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitReactCoreV2 = {}), global.src_v2_index_css,global.CopilotKitCore,global.AgUIClient,global.React,global.tailwindMerge,global.lucideReact,global.CopilotKitShared,global.ReactJsxRuntime,global.RadixReactSlot,global.classVarianceAuthority,global.clsx,global.RadixReactTooltip,global.RadixReactDropdownMenu,global.streamdown,global.Zod,global.CopilotKitA2UIRenderer,global.zod_to_json_schema,global.ReactDOM,global._tanstack_react_virtual,global.useStickToBottom,global._copilotkit_web_components_threads_drawer));
|
|
7
|
+
})(this, function(exports, src_v2_index_css, _copilotkit_core, _ag_ui_client, react, tailwind_merge, lucide_react, _copilotkit_shared, react_jsx_runtime, _radix_ui_react_slot, class_variance_authority, clsx, _radix_ui_react_tooltip, _radix_ui_react_dropdown_menu, streamdown, zod, _copilotkit_a2ui_renderer, zod_to_json_schema, react_dom, _tanstack_react_virtual, use_stick_to_bottom, _copilotkit_web_components_threads_drawer) {
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
9
9
|
//#region \0rolldown/runtime.js
|
|
10
10
|
var __create = Object.create;
|
|
@@ -91,7 +91,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
91
91
|
assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
|
|
92
92
|
assistantMessageToolbarCopyMessageLabel: "Copy",
|
|
93
93
|
assistantMessageToolbarInspectorLabel: "View in Inspector",
|
|
94
|
-
assistantMessageToolbarInspectorLocalOnlyLabel: "
|
|
94
|
+
assistantMessageToolbarInspectorLocalOnlyLabel: "Development Only",
|
|
95
95
|
assistantMessageToolbarThumbsUpLabel: "Good response",
|
|
96
96
|
assistantMessageToolbarThumbsDownLabel: "Bad response",
|
|
97
97
|
assistantMessageToolbarReadAloudLabel: "Read aloud",
|
|
@@ -1367,7 +1367,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1367
1367
|
side: "bottom",
|
|
1368
1368
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1369
1369
|
className: "cpk:flex cpk:items-center cpk:gap-1 cpk:text-xs cpk:font-medium",
|
|
1370
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children:
|
|
1370
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: labels.chatInputToolbarAddButtonLabel }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
1371
1371
|
className: "cpk:rounded cpk:bg-[#4a4a4a] cpk:px-1 cpk:py-[1px] cpk:font-mono cpk:text-[11px] cpk:text-white cpk:dark:bg-[#e0e0e0] cpk:dark:text-black",
|
|
1372
1372
|
children: "/"
|
|
1373
1373
|
})]
|
|
@@ -1636,32 +1636,43 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1636
1636
|
|
|
1637
1637
|
//#endregion
|
|
1638
1638
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
1639
|
-
const CopilotKitInspector = ({ core, openRequest
|
|
1640
|
-
const
|
|
1639
|
+
const CopilotKitInspector = ({ core, openRequest }) => {
|
|
1640
|
+
const mountRef = react.useRef(null);
|
|
1641
1641
|
const inspectorRef = react.useRef(null);
|
|
1642
|
+
const latestCoreRef = react.useRef(core ?? null);
|
|
1643
|
+
const latestOpenRequestRef = react.useRef(openRequest);
|
|
1644
|
+
latestCoreRef.current = core ?? null;
|
|
1645
|
+
latestOpenRequestRef.current = openRequest;
|
|
1642
1646
|
react.useEffect(() => {
|
|
1643
1647
|
let mounted = true;
|
|
1648
|
+
let inspector = null;
|
|
1644
1649
|
import("@copilotkit/web-inspector").then((mod) => {
|
|
1650
|
+
if (!mounted || !mountRef.current) return;
|
|
1645
1651
|
mod.defineWebInspector?.();
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
if (
|
|
1652
|
+
inspector = mountRef.current.ownerDocument.createElement(mod.WEB_INSPECTOR_TAG);
|
|
1653
|
+
mod.configureWebInspectorElement(inspector, latestCoreRef.current);
|
|
1654
|
+
mountRef.current.appendChild(inspector);
|
|
1655
|
+
inspectorRef.current = inspector;
|
|
1656
|
+
const request = latestOpenRequestRef.current;
|
|
1657
|
+
if (request) inspector.openInspector("message_toolbar", request);
|
|
1658
|
+
}).catch((error) => {
|
|
1659
|
+
console.error("Failed to load CopilotKit inspector:", error);
|
|
1652
1660
|
});
|
|
1653
1661
|
return () => {
|
|
1654
1662
|
mounted = false;
|
|
1663
|
+
inspector?.remove();
|
|
1664
|
+
if (inspectorRef.current === inspector) inspectorRef.current = null;
|
|
1655
1665
|
};
|
|
1656
1666
|
}, []);
|
|
1667
|
+
react.useEffect(() => {
|
|
1668
|
+
if (inspectorRef.current) inspectorRef.current.core = core ?? null;
|
|
1669
|
+
}, [core]);
|
|
1657
1670
|
react.useEffect(() => {
|
|
1658
1671
|
if (openRequest) inspectorRef.current?.openInspector("message_toolbar", openRequest);
|
|
1659
|
-
}, [
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
...rest,
|
|
1664
|
-
core: core ?? null
|
|
1672
|
+
}, [openRequest]);
|
|
1673
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1674
|
+
ref: mountRef,
|
|
1675
|
+
style: { display: "contents" }
|
|
1665
1676
|
});
|
|
1666
1677
|
};
|
|
1667
1678
|
CopilotKitInspector.displayName = "CopilotKitInspector";
|
|
@@ -1669,7 +1680,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1669
1680
|
//#endregion
|
|
1670
1681
|
//#region src/v2/components/CopilotKitInspectorContext.tsx
|
|
1671
1682
|
const CopilotKitInspectorContext = react.createContext({
|
|
1672
|
-
|
|
1683
|
+
isInspectorEnabled: false,
|
|
1673
1684
|
openInspector: () => void 0
|
|
1674
1685
|
});
|
|
1675
1686
|
const CopilotKitInspectorContextProvider = CopilotKitInspectorContext.Provider;
|
|
@@ -3523,9 +3534,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3523
3534
|
}, [value, warningMessage]);
|
|
3524
3535
|
return value;
|
|
3525
3536
|
}
|
|
3526
|
-
const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI,
|
|
3537
|
+
const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, useSingleEndpoint, onError, a2ui, defaultThrottleMs, debug }) => {
|
|
3527
3538
|
const [shouldRenderInspector, setShouldRenderInspector] = (0, react.useState)(false);
|
|
3528
|
-
|
|
3539
|
+
(0, react.useEffect)(() => {
|
|
3540
|
+
setShouldRenderInspector((0, _copilotkit_shared.shouldEnableInspector)({
|
|
3541
|
+
enableInspector,
|
|
3542
|
+
isBrowser: true,
|
|
3543
|
+
isDevelopment: process.env.NODE_ENV === "development"
|
|
3544
|
+
}));
|
|
3545
|
+
}, [enableInspector]);
|
|
3529
3546
|
const [inspectorOpenRequest, setInspectorOpenRequest] = (0, react.useState)(null);
|
|
3530
3547
|
const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = (0, react.useState)(false);
|
|
3531
3548
|
const [runtimeOpenGenUIEnabled, setRuntimeOpenGenUIEnabled] = (0, react.useState)(false);
|
|
@@ -3534,32 +3551,15 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3534
3551
|
const a2uiCatalogProvided = !!a2ui?.catalog;
|
|
3535
3552
|
const a2uiActive = runtimeA2UIEnabled || a2uiCatalogProvided;
|
|
3536
3553
|
const [runtimeLicenseStatus, setRuntimeLicenseStatus] = (0, react.useState)(void 0);
|
|
3537
|
-
(0, react.
|
|
3538
|
-
|
|
3539
|
-
const isLocalhost = new Set(["localhost", "127.0.0.1"]).has(window.location?.hostname ?? "");
|
|
3540
|
-
const canShowLocalInspectorAction = process.env.NODE_ENV === "development" && isLocalhost;
|
|
3541
|
-
if (showDevConsole === true) {
|
|
3542
|
-
setShouldRenderInspector(true);
|
|
3543
|
-
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3544
|
-
} else if (showDevConsole === "auto") if (isLocalhost) {
|
|
3545
|
-
setShouldRenderInspector(true);
|
|
3546
|
-
setIsLocalInspectorEnabled(canShowLocalInspectorAction);
|
|
3547
|
-
} else {
|
|
3548
|
-
setShouldRenderInspector(false);
|
|
3549
|
-
setIsLocalInspectorEnabled(false);
|
|
3550
|
-
}
|
|
3551
|
-
else {
|
|
3552
|
-
setShouldRenderInspector(false);
|
|
3553
|
-
setIsLocalInspectorEnabled(false);
|
|
3554
|
-
}
|
|
3555
|
-
}, [showDevConsole]);
|
|
3554
|
+
const [runtimeEntitlements, setRuntimeEntitlements] = (0, react.useState)(void 0);
|
|
3555
|
+
const [runtimeEntitlementRetryPending, setRuntimeEntitlementRetryPending] = (0, react.useState)(false);
|
|
3556
3556
|
const requestInspectorOpen = (0, react.useCallback)((request) => {
|
|
3557
3557
|
setInspectorOpenRequest({ ...request });
|
|
3558
3558
|
}, []);
|
|
3559
3559
|
const inspectorContextValue = (0, react.useMemo)(() => ({
|
|
3560
|
-
|
|
3560
|
+
isInspectorEnabled: shouldRenderInspector,
|
|
3561
3561
|
openInspector: requestInspectorOpen
|
|
3562
|
-
}), [
|
|
3562
|
+
}), [shouldRenderInspector, requestInspectorOpen]);
|
|
3563
3563
|
const renderToolCallsList = useStableArrayProp(renderToolCalls, "renderToolCalls must be a stable array. If you want to dynamically add or remove tools, use `useFrontendTool` instead.", (initial, next) => {
|
|
3564
3564
|
const key = (rc) => `${rc?.agentId ?? ""}:${rc?.name ?? ""}`;
|
|
3565
3565
|
const setFrom = (arr) => new Set(arr.map(key));
|
|
@@ -3743,6 +3743,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3743
3743
|
setRuntimeA2UIEnabled(copilotkit.a2uiEnabled);
|
|
3744
3744
|
setRuntimeOpenGenUIEnabled(copilotkit.openGenerativeUIEnabled);
|
|
3745
3745
|
setRuntimeLicenseStatus(copilotkit.licenseStatus);
|
|
3746
|
+
setRuntimeEntitlements(copilotkit.runtimeEntitlements);
|
|
3747
|
+
setRuntimeEntitlementRetryPending(copilotkit.runtimeEntitlementRetryPending);
|
|
3746
3748
|
};
|
|
3747
3749
|
const subscription = copilotkit.subscribe({ onRuntimeConnectionStatusChanged: syncRuntimeInfo });
|
|
3748
3750
|
syncRuntimeInfo();
|
|
@@ -3883,7 +3885,26 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3883
3885
|
copilotkit,
|
|
3884
3886
|
executingToolCallIds
|
|
3885
3887
|
}), [copilotkit, executingToolCallIds]);
|
|
3886
|
-
const
|
|
3888
|
+
const retryableRuntimeEntitlementFailure = runtimeEntitlements?.status !== "ready" && runtimeEntitlements?.error.retryable === true;
|
|
3889
|
+
const hasNonReadyRuntimeEntitlement = runtimeEntitlements !== void 0 && runtimeEntitlements.status !== "ready";
|
|
3890
|
+
const hasLegacyRuntimeEntitlementFallback = runtimeLicenseStatus === "valid" || runtimeLicenseStatus === "expiring";
|
|
3891
|
+
const runtimeEntitlementRetryInProgress = retryableRuntimeEntitlementFailure && runtimeEntitlementRetryPending && !hasLegacyRuntimeEntitlementFallback;
|
|
3892
|
+
const runtimeEntitlementFailureSettled = hasNonReadyRuntimeEntitlement && !runtimeEntitlementRetryInProgress && !hasLegacyRuntimeEntitlementFallback;
|
|
3893
|
+
const licenseContextValue = (0, react.useMemo)(() => {
|
|
3894
|
+
const runtimeLicenseContext = (0, _copilotkit_shared.createLicenseContextValue)(runtimeEntitlementRetryInProgress ? void 0 : runtimeLicenseStatus, runtimeEntitlements);
|
|
3895
|
+
if (!runtimeEntitlementFailureSettled) return runtimeLicenseContext;
|
|
3896
|
+
return {
|
|
3897
|
+
...runtimeLicenseContext,
|
|
3898
|
+
checkFeature: () => false,
|
|
3899
|
+
getLimit: () => null
|
|
3900
|
+
};
|
|
3901
|
+
}, [
|
|
3902
|
+
runtimeEntitlementFailureSettled,
|
|
3903
|
+
runtimeEntitlementRetryInProgress,
|
|
3904
|
+
runtimeEntitlements,
|
|
3905
|
+
runtimeLicenseStatus
|
|
3906
|
+
]);
|
|
3907
|
+
const runtimeLicenseWarningStatus = runtimeEntitlementRetryInProgress ? void 0 : licenseContextValue.status ?? void 0;
|
|
3887
3908
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SandboxFunctionsContext.Provider, {
|
|
3888
3909
|
value: sandboxFunctionsList,
|
|
3889
3910
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitContext.Provider, {
|
|
@@ -3900,14 +3921,13 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3900
3921
|
value: inspectorContextValue,
|
|
3901
3922
|
children: [children, shouldRenderInspector ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitInspector, {
|
|
3902
3923
|
core: copilotkit,
|
|
3903
|
-
defaultAnchor: inspectorDefaultAnchor,
|
|
3904
3924
|
openRequest: inspectorOpenRequest
|
|
3905
3925
|
}) : null]
|
|
3906
3926
|
}),
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3927
|
+
runtimeLicenseWarningStatus === "none" && !resolvedPublicKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "no_license" }),
|
|
3928
|
+
runtimeLicenseWarningStatus === "expired" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expired" }),
|
|
3929
|
+
runtimeLicenseWarningStatus === "invalid" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "invalid" }),
|
|
3930
|
+
runtimeLicenseWarningStatus === "expiring" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LicenseWarningBanner, { type: "expiring" })
|
|
3911
3931
|
]
|
|
3912
3932
|
})
|
|
3913
3933
|
})
|
|
@@ -4007,7 +4027,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4007
4027
|
function useFrontendTool(tool, deps) {
|
|
4008
4028
|
const { copilotkit } = useCopilotKit();
|
|
4009
4029
|
const extraDeps = deps ?? EMPTY_DEPS$1;
|
|
4010
|
-
(0, react.
|
|
4030
|
+
(0, react.useLayoutEffect)(() => {
|
|
4011
4031
|
const name = tool.name;
|
|
4012
4032
|
if (copilotkit.getTool({
|
|
4013
4033
|
toolName: name,
|
|
@@ -4374,6 +4394,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4374
4394
|
|
|
4375
4395
|
//#endregion
|
|
4376
4396
|
//#region src/v2/hooks/use-human-in-the-loop.tsx
|
|
4397
|
+
/** Registration name of a catch-all tool: handles any otherwise-unhandled call. */
|
|
4398
|
+
const WILDCARD_TOOL_NAME = "*";
|
|
4377
4399
|
function useHumanInTheLoop(tool, deps) {
|
|
4378
4400
|
const { copilotkit } = useCopilotKit();
|
|
4379
4401
|
const resolvePromiseRef = (0, react.useRef)(null);
|
|
@@ -4409,10 +4431,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4409
4431
|
}, []);
|
|
4410
4432
|
const RenderComponent = (0, react.useCallback)((props) => {
|
|
4411
4433
|
const ToolComponent = tool.render;
|
|
4434
|
+
const name = tool.name === WILDCARD_TOOL_NAME ? props.name : tool.name;
|
|
4412
4435
|
if (props.status === _copilotkit_core.ToolCallStatus.InProgress) {
|
|
4413
4436
|
const enhancedProps = {
|
|
4414
4437
|
...props,
|
|
4415
|
-
name
|
|
4438
|
+
name,
|
|
4416
4439
|
description: tool.description || "",
|
|
4417
4440
|
agentId: tool.agentId,
|
|
4418
4441
|
respond: void 0
|
|
@@ -4421,7 +4444,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4421
4444
|
} else if (props.status === _copilotkit_core.ToolCallStatus.Executing) {
|
|
4422
4445
|
const enhancedProps = {
|
|
4423
4446
|
...props,
|
|
4424
|
-
name
|
|
4447
|
+
name,
|
|
4425
4448
|
description: tool.description || "",
|
|
4426
4449
|
agentId: tool.agentId,
|
|
4427
4450
|
respond
|
|
@@ -4430,7 +4453,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4430
4453
|
} else if (props.status === _copilotkit_core.ToolCallStatus.Complete) {
|
|
4431
4454
|
const enhancedProps = {
|
|
4432
4455
|
...props,
|
|
4433
|
-
name
|
|
4456
|
+
name,
|
|
4434
4457
|
description: tool.description || "",
|
|
4435
4458
|
agentId: tool.agentId,
|
|
4436
4459
|
respond: void 0
|
|
@@ -4450,7 +4473,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4450
4473
|
handler,
|
|
4451
4474
|
render: RenderComponent
|
|
4452
4475
|
}, deps);
|
|
4453
|
-
(0, react.
|
|
4476
|
+
(0, react.useLayoutEffect)(() => {
|
|
4454
4477
|
return () => {
|
|
4455
4478
|
copilotkit.removeHookRenderToolCall(tool.name, tool.agentId);
|
|
4456
4479
|
};
|
|
@@ -4915,8 +4938,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4915
4938
|
}
|
|
4916
4939
|
|
|
4917
4940
|
//#endregion
|
|
4918
|
-
//#region src/v2/
|
|
4941
|
+
//#region src/v2/types/interrupt.ts
|
|
4942
|
+
/** Name of the legacy custom event agents emit to signal an interrupt. */
|
|
4919
4943
|
const INTERRUPT_EVENT_NAME = "on_interrupt";
|
|
4944
|
+
|
|
4945
|
+
//#endregion
|
|
4946
|
+
//#region src/v2/hooks/use-interrupt.tsx
|
|
4920
4947
|
function isPromiseLike(value) {
|
|
4921
4948
|
return (typeof value === "object" || typeof value === "function") && value !== null && typeof Reflect.get(value, "then") === "function";
|
|
4922
4949
|
}
|
|
@@ -5253,7 +5280,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5253
5280
|
*/
|
|
5254
5281
|
function useThreads({ agentId, includeArchived, limit, enabled = true }) {
|
|
5255
5282
|
const { copilotkit } = useCopilotKit();
|
|
5256
|
-
const [store] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch:
|
|
5283
|
+
const [store] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: copilotkit.ɵruntimeFetch }));
|
|
5257
5284
|
const coreThreads = useThreadStoreSelector(store, _copilotkit_core.ɵselectThreads);
|
|
5258
5285
|
const threads = (0, react.useMemo)(() => coreThreads.map(({ id, agentId, name, archived, createdAt, updatedAt, lastRunAt }) => ({
|
|
5259
5286
|
id,
|
|
@@ -5952,21 +5979,35 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5952
5979
|
|
|
5953
5980
|
//#endregion
|
|
5954
5981
|
//#region src/v2/components/chat/CopilotChatAssistantMessage.tsx
|
|
5982
|
+
/**
|
|
5983
|
+
* Binds the Inspector action to the active chat without making the full
|
|
5984
|
+
* assistant message subscribe to chat configuration changes.
|
|
5985
|
+
*/
|
|
5986
|
+
function BoundInspectorButton({ inspectorButton, messageId, openInspector, ...props }) {
|
|
5987
|
+
const chatConfiguration = useCopilotChatConfiguration();
|
|
5988
|
+
return renderSlot(inspectorButton, CopilotChatAssistantMessage.InspectorButton, {
|
|
5989
|
+
...props,
|
|
5990
|
+
onClick: () => openInspector({
|
|
5991
|
+
messageId,
|
|
5992
|
+
threadId: chatConfiguration?.threadId,
|
|
5993
|
+
agentId: chatConfiguration?.agentId
|
|
5994
|
+
})
|
|
5995
|
+
});
|
|
5996
|
+
}
|
|
5955
5997
|
function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible = true, markdownRenderer, toolbar, copyButton, inspectorButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }) {
|
|
5956
5998
|
useKatexStyles();
|
|
5957
|
-
const {
|
|
5958
|
-
const chatConfiguration = useCopilotChatConfiguration();
|
|
5999
|
+
const { isInspectorEnabled, openInspector } = useCopilotKitInspector();
|
|
5959
6000
|
const boundMarkdownRenderer = renderSlot(markdownRenderer, CopilotChatAssistantMessage.MarkdownRenderer, { content: message.content || "" });
|
|
5960
6001
|
const boundCopyButton = renderSlot(copyButton, CopilotChatAssistantMessage.CopyButton, { onClick: async () => {
|
|
5961
6002
|
if (message.content) return await (0, _copilotkit_shared.copyToClipboard)(message.content);
|
|
5962
6003
|
return false;
|
|
5963
6004
|
} });
|
|
5964
6005
|
const boundThumbsUpButton = renderSlot(thumbsUpButton, CopilotChatAssistantMessage.ThumbsUpButton, { onClick: onThumbsUp ? () => onThumbsUp(message) : void 0 });
|
|
5965
|
-
const boundInspectorButton =
|
|
6006
|
+
const boundInspectorButton = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BoundInspectorButton, {
|
|
6007
|
+
inspectorButton,
|
|
5966
6008
|
messageId: message.id,
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
}) });
|
|
6009
|
+
openInspector
|
|
6010
|
+
});
|
|
5970
6011
|
const boundThumbsDownButton = renderSlot(thumbsDownButton, CopilotChatAssistantMessage.ThumbsDownButton, { onClick: onThumbsDown ? () => onThumbsDown(message) : void 0 });
|
|
5971
6012
|
const boundReadAloudButton = renderSlot(readAloudButton, CopilotChatAssistantMessage.ReadAloudButton, { onClick: onReadAloud ? () => onReadAloud(message) : void 0 });
|
|
5972
6013
|
const boundRegenerateButton = renderSlot(regenerateButton, CopilotChatAssistantMessage.RegenerateButton, { onClick: onRegenerate ? () => onRegenerate(message) : void 0 });
|
|
@@ -5974,7 +6015,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5974
6015
|
className: "cpk:flex cpk:items-center cpk:gap-1",
|
|
5975
6016
|
children: [
|
|
5976
6017
|
boundCopyButton,
|
|
5977
|
-
|
|
6018
|
+
isInspectorEnabled && boundInspectorButton,
|
|
5978
6019
|
(onThumbsUp || thumbsUpButton) && boundThumbsUpButton,
|
|
5979
6020
|
(onThumbsDown || thumbsDownButton) && boundThumbsDownButton,
|
|
5980
6021
|
(onReadAloud || readAloudButton) && boundReadAloudButton,
|
|
@@ -5988,7 +6029,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
5988
6029
|
});
|
|
5989
6030
|
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
5990
6031
|
const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
|
|
5991
|
-
const shouldShowToolbar = toolbarVisible && (hasContent ||
|
|
6032
|
+
const shouldShowToolbar = toolbarVisible && (hasContent || isInspectorEnabled) && !(isRunning && isLatestAssistantMessage);
|
|
5992
6033
|
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5993
6034
|
"data-copilotkit": true,
|
|
5994
6035
|
style: { display: "contents" },
|
|
@@ -8546,7 +8587,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
8546
8587
|
const startRunActivityReconnectRef = (0, react.useRef)(null);
|
|
8547
8588
|
const runtimeStatus = copilotkit.runtimeConnectionStatus === _copilotkit_core.CopilotKitCoreRuntimeConnectionStatus.Connected ? "Connected" : copilotkit.runtimeConnectionStatus;
|
|
8548
8589
|
const hasNativeIntelligenceRunActivity = hasExplicitThreadId && runtimeStatus === "Connected" && !!copilotkit.intelligence?.wsUrl && copilotkit.threadEndpoints?.realtimeMetadata === true;
|
|
8549
|
-
const [standaloneRunActivityStore] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch:
|
|
8590
|
+
const [standaloneRunActivityStore] = (0, react.useState)(() => (0, _copilotkit_core.ɵcreateThreadStore)({ fetch: copilotkit.ɵruntimeFetch }));
|
|
8550
8591
|
const previousThreadRef = (0, react.useRef)(null);
|
|
8551
8592
|
const hasExplicitThreadIdRef = (0, react.useRef)(hasExplicitThreadId);
|
|
8552
8593
|
hasExplicitThreadIdRef.current = hasExplicitThreadId;
|
|
@@ -11445,20 +11486,42 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11445
11486
|
|
|
11446
11487
|
//#endregion
|
|
11447
11488
|
//#region src/v1-deprecated/components/CopilotListeners.tsx
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
const
|
|
11489
|
+
function isPredictStateTool(value) {
|
|
11490
|
+
if (value === null || typeof value !== "object") return false;
|
|
11491
|
+
const config = value;
|
|
11492
|
+
return typeof config.tool === "string" && typeof config.state_key === "string" && (config.tool_argument === void 0 || typeof config.tool_argument === "string");
|
|
11493
|
+
}
|
|
11494
|
+
function getPredictStateUpdate(config, toolCallName, partialToolCallArgs) {
|
|
11495
|
+
if (config.tool !== toolCallName) return void 0;
|
|
11496
|
+
const emittedState = typeof partialToolCallArgs === "string" ? (0, _copilotkit_shared.partialJSONParse)(partialToolCallArgs) : partialToolCallArgs;
|
|
11497
|
+
if (emittedState === null || typeof emittedState !== "object") return;
|
|
11498
|
+
if (config.tool_argument) {
|
|
11499
|
+
if (!(config.tool_argument in emittedState)) return void 0;
|
|
11500
|
+
return { [config.state_key]: emittedState[config.tool_argument] };
|
|
11501
|
+
}
|
|
11502
|
+
return { [config.state_key]: emittedState };
|
|
11503
|
+
}
|
|
11504
|
+
function createPredictStateSubscriber(agent, predictStateToolsRef) {
|
|
11505
|
+
return {
|
|
11451
11506
|
onCustomEvent: ({ event }) => {
|
|
11452
|
-
if (event.name === "PredictState") predictStateToolsRef.current = event.value;
|
|
11507
|
+
if (event.name === "PredictState") predictStateToolsRef.current = Array.isArray(event.value) ? event.value.filter(isPredictStateTool) : [];
|
|
11453
11508
|
},
|
|
11454
11509
|
onToolCallArgsEvent: ({ partialToolCallArgs, toolCallName }) => {
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
const
|
|
11458
|
-
|
|
11510
|
+
const updates = {};
|
|
11511
|
+
predictStateToolsRef.current.forEach((config) => {
|
|
11512
|
+
const update = getPredictStateUpdate(config, toolCallName, partialToolCallArgs);
|
|
11513
|
+
if (update) Object.assign(updates, update);
|
|
11514
|
+
});
|
|
11515
|
+
if (Object.keys(updates).length > 0) agent.setState({
|
|
11516
|
+
...agent.state,
|
|
11517
|
+
...updates
|
|
11459
11518
|
});
|
|
11460
11519
|
}
|
|
11461
|
-
}
|
|
11520
|
+
};
|
|
11521
|
+
}
|
|
11522
|
+
const usePredictStateSubscription = (agent) => {
|
|
11523
|
+
const predictStateToolsRef = (0, react.useRef)([]);
|
|
11524
|
+
const getSubscriber = (0, react.useCallback)((subscriptionAgent) => createPredictStateSubscriber(subscriptionAgent, predictStateToolsRef), []);
|
|
11462
11525
|
(0, react.useEffect)(() => {
|
|
11463
11526
|
if (!agent) return;
|
|
11464
11527
|
const subscriber = getSubscriber(agent);
|
|
@@ -11517,7 +11580,6 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11517
11580
|
//#region src/v1-deprecated/components/copilot-provider/copilotkit.tsx
|
|
11518
11581
|
function CopilotKit({ children, ...props }) {
|
|
11519
11582
|
const enabled = shouldShowDevConsole(props.showDevConsole);
|
|
11520
|
-
const showInspector = shouldShowDevConsole(props.enableInspector);
|
|
11521
11583
|
const publicApiKey = props.publicApiKey || props.publicLicenseKey;
|
|
11522
11584
|
const renderArr = (0, react.useMemo)(() => [{ render: CoAgentStateRenderBridge }], []);
|
|
11523
11585
|
const { onError: _onError, ...v2Props } = props;
|
|
@@ -11530,7 +11592,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
11530
11592
|
threadId: props.threadId,
|
|
11531
11593
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitProvider, {
|
|
11532
11594
|
...v2Props,
|
|
11533
|
-
|
|
11595
|
+
enableInspector: props.enableInspector,
|
|
11534
11596
|
renderCustomMessages: renderArr,
|
|
11535
11597
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotKitInternal, {
|
|
11536
11598
|
...props,
|
|
@@ -12062,6 +12124,7 @@ Object.defineProperty(exports, 'CopilotSidebarView', {
|
|
|
12062
12124
|
exports.CopilotThreadsDrawer = CopilotThreadsDrawer;
|
|
12063
12125
|
exports.GenerateSandboxedUiArgsSchema = GenerateSandboxedUiArgsSchema;
|
|
12064
12126
|
exports.INTELLIGENCE_TURN_HEAD = INTELLIGENCE_TURN_HEAD;
|
|
12127
|
+
exports.INTERRUPT_EVENT_NAME = INTERRUPT_EVENT_NAME;
|
|
12065
12128
|
exports.IntelligenceIndicator = IntelligenceIndicator;
|
|
12066
12129
|
exports.IntelligenceIndicatorView = IntelligenceIndicatorView;
|
|
12067
12130
|
exports.MCPAppsActivityContentSchema = MCPAppsActivityContentSchema;
|