@copilotkit/react-core 1.79.1-canary.1792091124 → 1.79.2-canary.1792172552
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-BA0vyDds.d.cts.map +1 -1
- package/dist/{copilotkit-jYAQvLTA.cjs → copilotkit-ConxFSB2.cjs} +85 -12
- package/dist/copilotkit-ConxFSB2.cjs.map +1 -0
- package/dist/{copilotkit-D123rHtg.mjs → copilotkit-DcENKLnJ.mjs} +85 -12
- package/dist/copilotkit-DcENKLnJ.mjs.map +1 -0
- package/dist/copilotkit-kcYN96tM.d.mts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +80 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/headless.cjs +83 -10
- 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 +83 -10
- package/dist/v2/headless.mjs.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +85 -12
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +10 -10
- package/dist/copilotkit-D123rHtg.mjs.map +0 -1
- package/dist/copilotkit-jYAQvLTA.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-ConxFSB2.cjs');
|
|
5
5
|
require("./index.css");
|
|
6
6
|
let _copilotkit_a2ui_renderer = require("@copilotkit/a2ui-renderer");
|
|
7
7
|
let _copilotkit_core = require("@copilotkit/core");
|
package/dist/v2/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { $ as useConfigureSuggestions, $a as ɵselectMemoriesIsLoading, $i as mergeMetadata, $n as MoveOperationSchema, $r as TextMessageContentEventSchema, $t as AudioPartSchema, A as CopilotChatMessageView, Aa as ɵcreateThreadStore, Ai as createActionGroup, An as HttpAgent, Ar as RunFinishedSuccessOutcomeSchema, At as CopilotKitInspector, B as CopilotChatUserMessage_default, Ba as ɵobservePhoenixEvent$, Bi as emitInspectorViewThread, Bn as InputContentUrlSourceSchema, Br as SubagentErrorEventSchema, Bt as AGUI_METADATA_KEY, C as CopilotModalHeader, Ca as ɵCOPILOTKIT_FEATURES, Ci as authoritativeActivityTypes, Cn as EventType, Cr as RoleSchema, Ct as OpenGenerativeUIToolRenderer, D as CopilotChat, Da as ɵTHREAD_REQUEST_TIMEOUT_MS, Di as contentHasMedia, Dn as FilterToolCallsMiddleware, Dr as RunFinishedEventSchema, Dt as MCPAppsActivityRenderer, E as DefaultOpenIcon, Ea as ɵRUNTIME_PROBE_TIMEOUT_MS, Ei as completePartialMarkdown, En as FileSourceSchema, Er as RunFinishedCancelledOutcomeSchema, Et as MCPAppsActivityContentSchema, F as getIntelligenceTurnAnchors, Fa as ɵmapMemoryMetadataEvent, Fi as createSelector, Fn as ImageInputPartSchema, Fr as StateManager, Ft as CopilotChatConfigurationProvider, G as useLearningContainers, Ga as ɵphoenixSocket$, Gi as ensureObjectArgs, Gn as JsonPatchSchema, Gr as SubagentInfoSchema, Gt as AddOperationSchema, H as CopilotChatAssistantMessage_default, Ha as ɵobservePhoenixSocketHealth$, Hi as empty, Hn as IntelligenceReplayFailedError, Hr as SubagentFinishedOutcomeSchema, Ht as ActivityDeltaEventSchema, I as IntelligenceIndicatorView, Ia as ɵmemoryAdapterEvents, Ii as createStore, In as ImagePartSchema, Ir as StateSchema, It as useCopilotChatConfiguration, J as useLearnFromUserAction, Ja as ɵselectIsFetchingNextPage, Ji as isAbortError, Jn as MemoryError, Jr as SuggestionEngine, Jt as AgentThreadLockedError, K as useAttachments, Ka as ɵselectFetchMoreError, Ki as getRunOutcome, Kn as JsonPointerSchema, Kr as SubagentRunIdSchema, Kt as AgentCapabilitiesSchema, L as CopilotChatSuggestionView, La as ɵmemoryDomainEvents, Li as defaultApplyEvents, Ln as InputContentDataSourceSchema, Lr as StateSnapshotEventSchema, Lt as ACTIVITY_HISTORY_METADATA, M as messageRow, Ma as ɵisHttpAgent, Mi as createEffect, Mn as INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, Mr as RunStartedEventSchema, Mt as CopilotChatInput_default, N as INTELLIGENCE_TURN_HEAD, Na as ɵisRetryableMemoryStatus, Ni as createInspectorThreadRequestId, Nn as IdentityCapabilitiesSchema, Nr as StateCapabilitiesSchema, Nt as AudioRecorderError, O as CopilotChatView_default, Oa as ɵcreateMemoryStore, Oi as contentToText, On as FunctionCallSchema, Or as RunFinishedInterruptOutcomeSchema, Ot as MCPAppsActivityType, P as IntelligenceIndicator, Pa as ɵjoinPhoenixChannel$, Pi as createReducer, Pn as ImageInputContentSchema, Pr as StateDeltaEventSchema, Pt as CopilotChatAudioRecorder, Q as INTERRUPT_EVENT_NAME, Qa as ɵselectMemoriesError, Qi as isRunCompletionAware, Qn as Middleware, Qr as TextMessageChunkEventSchema, Qt as AudioInputPartSchema, R as CopilotChatSuggestionPill, Ra as ɵmemoryReducer, Ri as emitInspectorActiveThread, Rn as InputContentSchema, Rr as StepFinishedEventSchema, Rt as AGUIConnectNotImplementedError, S as CopilotSidebarView, Sa as withAuthoritativeActivityTypes, Si as aggregateTokenUsage, Sn as EventSchemas, Sr as ResumeEntrySchema, St as OpenGenerativeUIContentSchema, T as DefaultCloseIcon, Ta as ɵMAX_SOCKET_RETRIES, Ti as compactEvents, Tn as ExecutionCapabilitiesSchema, Tr as RunErrorEventSchema, Tt as useSandboxFunctions, U as CopilotChatToolCallsView, Ua as ɵobservePhoenixSocketSignals$, Ui as enforceEvents, Un as InterruptSchema, Ur as SubagentFinishedSuccessOutcomeSchema, Ut as ActivityMessageSchema, V as CopilotChatAttachmentRenderer, Va as ɵobservePhoenixJoinOutcome$, Vi as emitInspectorViewThreadResult, Vn as IntelligenceAgent, Vr as SubagentFinishedEventSchema, Vt as AbstractAgent, W as useLearningContainersInCurrentThread, Wa as ɵphoenixChannel$, Wi as enforceOutgoingInput, Wn as JsonPatchOperationSchema, Wr as SubagentFinishedSuspendedOutcomeSchema, Wt as ActivitySnapshotEventSchema, X as useThreads, Xa as ɵselectMemories, Xi as isInterruptExpired, Xn as MessagesSnapshotEventSchema, Xr as TestOperationSchema, Xt as AttributableSchema, Y as useMemories, Ya as ɵselectIsMutating, Yi as isInspectorThreadBridgeEnabled, Yn as MessageSchema, Yr as SystemMessageSchema, Yt as AssistantMessageSchema, Z as useInterrupt, Za as ɵselectMemoriesAvailable, Zi as isRecognizedEvent, Zn as MetadataSchema, Zr as TextInputContentSchema, Zt as AudioInputContentSchema, _ as WildcardToolCallRender, _a as tokenUsageFromAiSdkUsage, _i as UserMessageSchema, _n as DeveloperMessageSchema, _r as ReasoningMessageSchema, _t as defineToolCallRenderer, aa as onInspectorViewThread, ai as ToolCallArgsEventSchema, an as CompatibilityBoundary, ao as ɵthreadAdapterEvents, ar as OutputCapabilitiesSchema, at as useHumanInTheLoop, b as CopilotSidebar, ba as transformHttpEventStream, bi as VideoPartSchema, bn as DocumentPartSchema, br as RemoveOperationSchema, bt as OpenGenerativeUIActivityRenderer, ca as parseSSEStream, ci as ToolCallResultEventSchema, cn as ContextStore, cr as ProxiedCopilotRuntimeAgent, ct as useComponent, da as randomUUID, di as ToolCallStatus, dn as CopilotKitCoreRuntimeConnectionStatus, dr as ReasoningEncryptedValueEventSchema, dt as useRenderActivityMessage, ea as ofType, ei as TextMessageEndEventSchema, en as BackwardCompatibility_0_0_39, eo as ɵselectMemoriesIsMutating, er as MultiAgentCapabilitiesSchema, et as useSuggestions, fa as resolveAgentDebugConfig, fi as ToolMessageSchema, fn as CopilotKitHeaderResolutionError, fr as ReasoningEncryptedValueSubtypeSchema, ft as useRenderCustomMessages, ga as structuredClone_, gi as UrlSourceSchema, gn as DebugLogger, gr as ReasoningMessageEndEventSchema, gt as CopilotKitCoreReact, ha as select, hi as TransportCapabilitiesSchema, hn as DataSourceSchema, hr as ReasoningMessageContentEventSchema, ht as useLicenseContext, ia as onInspectorStopViewing, ii as TokenUsageSchema, in as BaseMessageSchema, io as ɵselectThreadsIsLoading, ir as OptionalMetadataSchema, it as useAgent, j as messageGroup, ja as ɵisCopilotKitFeature, ji as createDebugLogger, jn as HumanInTheLoopCapabilitiesSchema, jr as RunHandler, jt as useRenderToolCall, k as CopilotChatAttachmentQueue, ka as ɵcreateThreadSelectors, ki as convertToLegacyEvents, kn as FunctionMiddleware, kr as RunFinishedOutcomeSchema, kt as ɵrunMcpFollowUp, la as parseToolArguments, li as ToolCallSchema, ln as CopilotKitCore, lr as RawEventSchema, lt as useFrontendTools, ma as runHttpRequest, mi as ToolsCapabilitiesSchema, mn as CustomEventSchema, mr as ReasoningMessageChunkEventSchema, mt as useCopilotKit, na as on, ni as TextMessageStartEventSchema, nn as BackwardCompatibility_0_0_57, no as ɵselectThreads, nr as MultimodalInputCapabilitiesSchema, nt as useCapabilities, oa as onInspectorViewThreadResult, oi as ToolCallChunkEventSchema, on as ContentPartSchema, oo as ɵwithHeaderDefaults, or as PROTOCOL_VERSION, ot as useDefaultRenderTool, pa as resolveDebugLogger, pi as ToolSchema, pn as CopyOperationSchema, pr as ReasoningEndEventSchema, pt as CopilotKitProvider, q as useLearnFromUserActionInCurrentThread, qa as ɵselectHasNextPage, qi as getWebMCPModelContext, qn as MEMORY_ERROR_REGISTRY, qr as SubagentStartedEventSchema, qt as AgentRegistry, ra as onInspectorActiveThread, ri as TextPartSchema, rn as BaseEventSchema, ro as ɵselectThreadsError, rr as MultimodalOutputCapabilitiesSchema, rt as UseAgentUpdate, sa as parseProtoStream, si as ToolCallEndEventSchema, sn as ContextSchema, sr as PartSourceSchema, st as useRenderTool, t as CopilotKit, ta as omitOptionalNulls, ti as TextMessageRoleSchema, tn as BackwardCompatibility_0_0_45, to as ɵselectMemoriesRealtimeStatus, tr as MultimodalCapabilitiesSchema, tt as useAgentContext, ua as props, ui as ToolCallStartEventSchema, un as CopilotKitCoreErrorCode, ur as ReasoningCapabilitiesSchema, ut as useFrontendTool, v as CopilotThreadsDrawer, va as tokenUsageFromLangChainMetadata, vi as VideoInputContentSchema, vn as DocumentInputContentSchema, vr as ReasoningMessageStartEventSchema, vt as createA2UIMessageRenderer, w as CopilotChatToggleButton, wa as ɵInterruptState, wi as buildResumeArray, wn as EventTypeSchema, wr as RunAgentInputSchema, wt as SandboxFunctionsContext, x as CopilotPopupView, xa as verifyEvents, xi as WebMCPRegistry, xn as EventSchema, xr as ReplaceOperationSchema, xt as OpenGenerativeUIActivityType, y as CopilotPopup, ya as transformChunks, yi as VideoInputPartSchema, yn as DocumentInputPartSchema, yr as ReasoningStartEventSchema, yt as GenerateSandboxedUiArgsSchema, z as CopilotChatReasoningMessage_default, za as ɵmemoryRestEvents, zi as emitInspectorStopViewing, zn as InputContentSourceSchema, zr as StepStartedEventSchema, zt as AGUIError } from "../copilotkit-
|
|
3
|
+
import { $ as useConfigureSuggestions, $a as ɵselectMemoriesIsLoading, $i as mergeMetadata, $n as MoveOperationSchema, $r as TextMessageContentEventSchema, $t as AudioPartSchema, A as CopilotChatMessageView, Aa as ɵcreateThreadStore, Ai as createActionGroup, An as HttpAgent, Ar as RunFinishedSuccessOutcomeSchema, At as CopilotKitInspector, B as CopilotChatUserMessage_default, Ba as ɵobservePhoenixEvent$, Bi as emitInspectorViewThread, Bn as InputContentUrlSourceSchema, Br as SubagentErrorEventSchema, Bt as AGUI_METADATA_KEY, C as CopilotModalHeader, Ca as ɵCOPILOTKIT_FEATURES, Ci as authoritativeActivityTypes, Cn as EventType, Cr as RoleSchema, Ct as OpenGenerativeUIToolRenderer, D as CopilotChat, Da as ɵTHREAD_REQUEST_TIMEOUT_MS, Di as contentHasMedia, Dn as FilterToolCallsMiddleware, Dr as RunFinishedEventSchema, Dt as MCPAppsActivityRenderer, E as DefaultOpenIcon, Ea as ɵRUNTIME_PROBE_TIMEOUT_MS, Ei as completePartialMarkdown, En as FileSourceSchema, Er as RunFinishedCancelledOutcomeSchema, Et as MCPAppsActivityContentSchema, F as getIntelligenceTurnAnchors, Fa as ɵmapMemoryMetadataEvent, Fi as createSelector, Fn as ImageInputPartSchema, Fr as StateManager, Ft as CopilotChatConfigurationProvider, G as useLearningContainers, Ga as ɵphoenixSocket$, Gi as ensureObjectArgs, Gn as JsonPatchSchema, Gr as SubagentInfoSchema, Gt as AddOperationSchema, H as CopilotChatAssistantMessage_default, Ha as ɵobservePhoenixSocketHealth$, Hi as empty, Hn as IntelligenceReplayFailedError, Hr as SubagentFinishedOutcomeSchema, Ht as ActivityDeltaEventSchema, I as IntelligenceIndicatorView, Ia as ɵmemoryAdapterEvents, Ii as createStore, In as ImagePartSchema, Ir as StateSchema, It as useCopilotChatConfiguration, J as useLearnFromUserAction, Ja as ɵselectIsFetchingNextPage, Ji as isAbortError, Jn as MemoryError, Jr as SuggestionEngine, Jt as AgentThreadLockedError, K as useAttachments, Ka as ɵselectFetchMoreError, Ki as getRunOutcome, Kn as JsonPointerSchema, Kr as SubagentRunIdSchema, Kt as AgentCapabilitiesSchema, L as CopilotChatSuggestionView, La as ɵmemoryDomainEvents, Li as defaultApplyEvents, Ln as InputContentDataSourceSchema, Lr as StateSnapshotEventSchema, Lt as ACTIVITY_HISTORY_METADATA, M as messageRow, Ma as ɵisHttpAgent, Mi as createEffect, Mn as INSPECTOR_THREAD_BRIDGE_PLUGIN_ID, Mr as RunStartedEventSchema, Mt as CopilotChatInput_default, N as INTELLIGENCE_TURN_HEAD, Na as ɵisRetryableMemoryStatus, Ni as createInspectorThreadRequestId, Nn as IdentityCapabilitiesSchema, Nr as StateCapabilitiesSchema, Nt as AudioRecorderError, O as CopilotChatView_default, Oa as ɵcreateMemoryStore, Oi as contentToText, On as FunctionCallSchema, Or as RunFinishedInterruptOutcomeSchema, Ot as MCPAppsActivityType, P as IntelligenceIndicator, Pa as ɵjoinPhoenixChannel$, Pi as createReducer, Pn as ImageInputContentSchema, Pr as StateDeltaEventSchema, Pt as CopilotChatAudioRecorder, Q as INTERRUPT_EVENT_NAME, Qa as ɵselectMemoriesError, Qi as isRunCompletionAware, Qn as Middleware, Qr as TextMessageChunkEventSchema, Qt as AudioInputPartSchema, R as CopilotChatSuggestionPill, Ra as ɵmemoryReducer, Ri as emitInspectorActiveThread, Rn as InputContentSchema, Rr as StepFinishedEventSchema, Rt as AGUIConnectNotImplementedError, S as CopilotSidebarView, Sa as withAuthoritativeActivityTypes, Si as aggregateTokenUsage, Sn as EventSchemas, Sr as ResumeEntrySchema, St as OpenGenerativeUIContentSchema, T as DefaultCloseIcon, Ta as ɵMAX_SOCKET_RETRIES, Ti as compactEvents, Tn as ExecutionCapabilitiesSchema, Tr as RunErrorEventSchema, Tt as useSandboxFunctions, U as CopilotChatToolCallsView, Ua as ɵobservePhoenixSocketSignals$, Ui as enforceEvents, Un as InterruptSchema, Ur as SubagentFinishedSuccessOutcomeSchema, Ut as ActivityMessageSchema, V as CopilotChatAttachmentRenderer, Va as ɵobservePhoenixJoinOutcome$, Vi as emitInspectorViewThreadResult, Vn as IntelligenceAgent, Vr as SubagentFinishedEventSchema, Vt as AbstractAgent, W as useLearningContainersInCurrentThread, Wa as ɵphoenixChannel$, Wi as enforceOutgoingInput, Wn as JsonPatchOperationSchema, Wr as SubagentFinishedSuspendedOutcomeSchema, Wt as ActivitySnapshotEventSchema, X as useThreads, Xa as ɵselectMemories, Xi as isInterruptExpired, Xn as MessagesSnapshotEventSchema, Xr as TestOperationSchema, Xt as AttributableSchema, Y as useMemories, Ya as ɵselectIsMutating, Yi as isInspectorThreadBridgeEnabled, Yn as MessageSchema, Yr as SystemMessageSchema, Yt as AssistantMessageSchema, Z as useInterrupt, Za as ɵselectMemoriesAvailable, Zi as isRecognizedEvent, Zn as MetadataSchema, Zr as TextInputContentSchema, Zt as AudioInputContentSchema, _ as WildcardToolCallRender, _a as tokenUsageFromAiSdkUsage, _i as UserMessageSchema, _n as DeveloperMessageSchema, _r as ReasoningMessageSchema, _t as defineToolCallRenderer, aa as onInspectorViewThread, ai as ToolCallArgsEventSchema, an as CompatibilityBoundary, ao as ɵthreadAdapterEvents, ar as OutputCapabilitiesSchema, at as useHumanInTheLoop, b as CopilotSidebar, ba as transformHttpEventStream, bi as VideoPartSchema, bn as DocumentPartSchema, br as RemoveOperationSchema, bt as OpenGenerativeUIActivityRenderer, ca as parseSSEStream, ci as ToolCallResultEventSchema, cn as ContextStore, cr as ProxiedCopilotRuntimeAgent, ct as useComponent, da as randomUUID, di as ToolCallStatus, dn as CopilotKitCoreRuntimeConnectionStatus, dr as ReasoningEncryptedValueEventSchema, dt as useRenderActivityMessage, ea as ofType, ei as TextMessageEndEventSchema, en as BackwardCompatibility_0_0_39, eo as ɵselectMemoriesIsMutating, er as MultiAgentCapabilitiesSchema, et as useSuggestions, fa as resolveAgentDebugConfig, fi as ToolMessageSchema, fn as CopilotKitHeaderResolutionError, fr as ReasoningEncryptedValueSubtypeSchema, ft as useRenderCustomMessages, ga as structuredClone_, gi as UrlSourceSchema, gn as DebugLogger, gr as ReasoningMessageEndEventSchema, gt as CopilotKitCoreReact, ha as select, hi as TransportCapabilitiesSchema, hn as DataSourceSchema, hr as ReasoningMessageContentEventSchema, ht as useLicenseContext, ia as onInspectorStopViewing, ii as TokenUsageSchema, in as BaseMessageSchema, io as ɵselectThreadsIsLoading, ir as OptionalMetadataSchema, it as useAgent, j as messageGroup, ja as ɵisCopilotKitFeature, ji as createDebugLogger, jn as HumanInTheLoopCapabilitiesSchema, jr as RunHandler, jt as useRenderToolCall, k as CopilotChatAttachmentQueue, ka as ɵcreateThreadSelectors, ki as convertToLegacyEvents, kn as FunctionMiddleware, kr as RunFinishedOutcomeSchema, kt as ɵrunMcpFollowUp, la as parseToolArguments, li as ToolCallSchema, ln as CopilotKitCore, lr as RawEventSchema, lt as useFrontendTools, ma as runHttpRequest, mi as ToolsCapabilitiesSchema, mn as CustomEventSchema, mr as ReasoningMessageChunkEventSchema, mt as useCopilotKit, na as on, ni as TextMessageStartEventSchema, nn as BackwardCompatibility_0_0_57, no as ɵselectThreads, nr as MultimodalInputCapabilitiesSchema, nt as useCapabilities, oa as onInspectorViewThreadResult, oi as ToolCallChunkEventSchema, on as ContentPartSchema, oo as ɵwithHeaderDefaults, or as PROTOCOL_VERSION, ot as useDefaultRenderTool, pa as resolveDebugLogger, pi as ToolSchema, pn as CopyOperationSchema, pr as ReasoningEndEventSchema, pt as CopilotKitProvider, q as useLearnFromUserActionInCurrentThread, qa as ɵselectHasNextPage, qi as getWebMCPModelContext, qn as MEMORY_ERROR_REGISTRY, qr as SubagentStartedEventSchema, qt as AgentRegistry, ra as onInspectorActiveThread, ri as TextPartSchema, rn as BaseEventSchema, ro as ɵselectThreadsError, rr as MultimodalOutputCapabilitiesSchema, rt as UseAgentUpdate, sa as parseProtoStream, si as ToolCallEndEventSchema, sn as ContextSchema, sr as PartSourceSchema, st as useRenderTool, t as CopilotKit, ta as omitOptionalNulls, ti as TextMessageRoleSchema, tn as BackwardCompatibility_0_0_45, to as ɵselectMemoriesRealtimeStatus, tr as MultimodalCapabilitiesSchema, tt as useAgentContext, ua as props, ui as ToolCallStartEventSchema, un as CopilotKitCoreErrorCode, ur as ReasoningCapabilitiesSchema, ut as useFrontendTool, v as CopilotThreadsDrawer, va as tokenUsageFromLangChainMetadata, vi as VideoInputContentSchema, vn as DocumentInputContentSchema, vr as ReasoningMessageStartEventSchema, vt as createA2UIMessageRenderer, w as CopilotChatToggleButton, wa as ɵInterruptState, wi as buildResumeArray, wn as EventTypeSchema, wr as RunAgentInputSchema, wt as SandboxFunctionsContext, x as CopilotPopupView, xa as verifyEvents, xi as WebMCPRegistry, xn as EventSchema, xr as ReplaceOperationSchema, xt as OpenGenerativeUIActivityType, y as CopilotPopup, ya as transformChunks, yi as VideoInputPartSchema, yn as DocumentInputPartSchema, yr as ReasoningStartEventSchema, yt as GenerateSandboxedUiArgsSchema, z as CopilotChatReasoningMessage_default, za as ɵmemoryRestEvents, zi as emitInspectorStopViewing, zn as InputContentSourceSchema, zr as StepStartedEventSchema, zt as AGUIError } from "../copilotkit-DcENKLnJ.mjs";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { defaultTheme as a2uiDefaultTheme } from "@copilotkit/a2ui-renderer";
|
|
6
6
|
|
package/dist/v2/index.umd.js
CHANGED
|
@@ -180,7 +180,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
180
180
|
* Returns true only for plain JS objects (`{}`), excluding arrays, Dates,
|
|
181
181
|
* class instances, and other exotic objects that happen to have typeof "object".
|
|
182
182
|
*/
|
|
183
|
-
function isPlainObject(obj) {
|
|
183
|
+
function isPlainObject$1(obj) {
|
|
184
184
|
return obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
@@ -199,7 +199,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
199
199
|
function useShallowStableRef(value) {
|
|
200
200
|
const ref = (0, react.useRef)(value);
|
|
201
201
|
if (ref.current === value) return ref.current;
|
|
202
|
-
if (isPlainObject(ref.current) && isPlainObject(value)) {
|
|
202
|
+
if (isPlainObject$1(ref.current) && isPlainObject$1(value)) {
|
|
203
203
|
if (shallowEqual(ref.current, value)) return ref.current;
|
|
204
204
|
}
|
|
205
205
|
ref.current = value;
|
|
@@ -1766,7 +1766,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1766
1766
|
|
|
1767
1767
|
//#endregion
|
|
1768
1768
|
//#region package.json
|
|
1769
|
-
var version = "1.79.
|
|
1769
|
+
var version = "1.79.2-canary.1792172552";
|
|
1770
1770
|
|
|
1771
1771
|
//#endregion
|
|
1772
1772
|
//#region src/v2/components/CopilotKitInspector.tsx
|
|
@@ -4035,12 +4035,86 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4035
4035
|
}), [renderActivityMessage, findRenderer]);
|
|
4036
4036
|
}
|
|
4037
4037
|
|
|
4038
|
+
//#endregion
|
|
4039
|
+
//#region src/v2/hooks/tool-registration.ts
|
|
4040
|
+
/**
|
|
4041
|
+
* Deps comparison shared by `useFrontendTool` (and through it
|
|
4042
|
+
* `useHumanInTheLoop` and `useComponent`) and `useRenderTool`. Not part of the
|
|
4043
|
+
* public API.
|
|
4044
|
+
*/
|
|
4045
|
+
const EMPTY_DEPS$1 = [];
|
|
4046
|
+
function isPlainObject(value) {
|
|
4047
|
+
const proto = Object.getPrototypeOf(value);
|
|
4048
|
+
return proto === Object.prototype || proto === null;
|
|
4049
|
+
}
|
|
4050
|
+
/**
|
|
4051
|
+
* Plain data (primitives, plain objects, arrays, dates) compares by value.
|
|
4052
|
+
* Functions always compare equal: these hooks used to compare
|
|
4053
|
+
* `JSON.stringify(deps)`, which turns every function into `null`, and a
|
|
4054
|
+
* function that counted as changed would re-register on every render when it
|
|
4055
|
+
* is written inline (and loop in a component that also reads
|
|
4056
|
+
* `useRenderToolCall`). Everything else (class instances, maps, sets) compares
|
|
4057
|
+
* by identity. A cycle inside plain data is safe: a pair already being
|
|
4058
|
+
* compared counts as equal for that branch.
|
|
4059
|
+
*/
|
|
4060
|
+
function depEqual(a, b, seen) {
|
|
4061
|
+
if (Object.is(a, b)) return true;
|
|
4062
|
+
if (typeof a === "function" && typeof b === "function") return true;
|
|
4063
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
4064
|
+
if (a instanceof Date && b instanceof Date) return Object.is(a.getTime(), b.getTime());
|
|
4065
|
+
const aIsArray = Array.isArray(a);
|
|
4066
|
+
if (aIsArray !== Array.isArray(b)) return false;
|
|
4067
|
+
if (!aIsArray && !(isPlainObject(a) && isPlainObject(b))) return false;
|
|
4068
|
+
if (seen.get(a) === b) return true;
|
|
4069
|
+
seen.set(a, b);
|
|
4070
|
+
if (aIsArray) {
|
|
4071
|
+
const left = a;
|
|
4072
|
+
const right = b;
|
|
4073
|
+
if (left.length !== right.length) return false;
|
|
4074
|
+
for (let i = 0; i < left.length; i++) if (!depEqual(left[i], right[i], seen)) return false;
|
|
4075
|
+
return true;
|
|
4076
|
+
}
|
|
4077
|
+
const left = a;
|
|
4078
|
+
const right = b;
|
|
4079
|
+
const leftKeys = Object.keys(left);
|
|
4080
|
+
if (leftKeys.length !== Object.keys(right).length) return false;
|
|
4081
|
+
for (const key of leftKeys) {
|
|
4082
|
+
if (!Object.prototype.hasOwnProperty.call(right, key)) return false;
|
|
4083
|
+
if (!depEqual(left[key], right[key], seen)) return false;
|
|
4084
|
+
}
|
|
4085
|
+
return true;
|
|
4086
|
+
}
|
|
4087
|
+
/** Whether two deps arrays are equal. A change in length is always a change. */
|
|
4088
|
+
function depsEqual(prev, next) {
|
|
4089
|
+
if (prev.length !== next.length) return false;
|
|
4090
|
+
const seen = /* @__PURE__ */ new Map();
|
|
4091
|
+
for (let i = 0; i < prev.length; i++) if (!depEqual(prev[i], next[i], seen)) return false;
|
|
4092
|
+
return true;
|
|
4093
|
+
}
|
|
4094
|
+
/**
|
|
4095
|
+
* Turns a caller's `deps` array into a number that changes exactly when the
|
|
4096
|
+
* deps change, by the rules of {@link depsEqual}. Put the number, not the
|
|
4097
|
+
* array, in the registration effect's dependency list: that keeps the list a
|
|
4098
|
+
* constant length and never serializes a value.
|
|
4099
|
+
*/
|
|
4100
|
+
function useDepsVersion(deps) {
|
|
4101
|
+
const next = deps ?? EMPTY_DEPS$1;
|
|
4102
|
+
const ref = (0, react.useRef)({
|
|
4103
|
+
deps: next,
|
|
4104
|
+
version: 0
|
|
4105
|
+
});
|
|
4106
|
+
if (ref.current.deps !== next && !depsEqual(ref.current.deps, next)) ref.current = {
|
|
4107
|
+
deps: next,
|
|
4108
|
+
version: ref.current.version + 1
|
|
4109
|
+
};
|
|
4110
|
+
return ref.current.version;
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4038
4113
|
//#endregion
|
|
4039
4114
|
//#region src/v2/hooks/use-frontend-tool.tsx
|
|
4040
|
-
const EMPTY_DEPS$2 = [];
|
|
4041
4115
|
function useFrontendTool(tool, deps) {
|
|
4042
4116
|
const { copilotkit } = useCopilotKit();
|
|
4043
|
-
const
|
|
4117
|
+
const depsVersion = useDepsVersion(deps);
|
|
4044
4118
|
(0, react.useLayoutEffect)(() => {
|
|
4045
4119
|
const name = tool.name;
|
|
4046
4120
|
if (copilotkit.getTool({
|
|
@@ -4064,14 +4138,14 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4064
4138
|
tool.name,
|
|
4065
4139
|
tool.available,
|
|
4066
4140
|
copilotkit,
|
|
4067
|
-
|
|
4141
|
+
depsVersion,
|
|
4068
4142
|
JSON.stringify(tool.webmcp ?? null)
|
|
4069
4143
|
]);
|
|
4070
4144
|
}
|
|
4071
4145
|
|
|
4072
4146
|
//#endregion
|
|
4073
4147
|
//#region src/v2/hooks/use-frontend-tools.tsx
|
|
4074
|
-
const EMPTY_DEPS
|
|
4148
|
+
const EMPTY_DEPS = [];
|
|
4075
4149
|
const EMPTY_TOOLS = [];
|
|
4076
4150
|
/**
|
|
4077
4151
|
* Register a list of frontend tools whose length can change between renders.
|
|
@@ -4125,7 +4199,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4125
4199
|
function useFrontendTools(tools, deps) {
|
|
4126
4200
|
const { copilotkit } = useCopilotKit();
|
|
4127
4201
|
const toolList = tools ?? EMPTY_TOOLS;
|
|
4128
|
-
const extraDeps = deps ?? EMPTY_DEPS
|
|
4202
|
+
const extraDeps = deps ?? EMPTY_DEPS;
|
|
4129
4203
|
(0, react.useLayoutEffect)(() => {
|
|
4130
4204
|
const deduped = /* @__PURE__ */ new Map();
|
|
4131
4205
|
for (const tool of toolList) {
|
|
@@ -4236,8 +4310,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4236
4310
|
|
|
4237
4311
|
//#endregion
|
|
4238
4312
|
//#region src/v2/hooks/use-render-tool.tsx
|
|
4239
|
-
|
|
4240
|
-
/**
|
|
4313
|
+
/**
|
|
4241
4314
|
* Registers a renderer entry in CopilotKit's `renderToolCalls` registry.
|
|
4242
4315
|
*
|
|
4243
4316
|
* Key behavior:
|
|
@@ -4280,7 +4353,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4280
4353
|
*/
|
|
4281
4354
|
function useRenderTool(config, deps) {
|
|
4282
4355
|
const { copilotkit } = useCopilotKit();
|
|
4283
|
-
const
|
|
4356
|
+
const depsVersion = useDepsVersion(deps);
|
|
4284
4357
|
(0, react.useEffect)(() => {
|
|
4285
4358
|
const renderer = config.name === "*" && !config.parameters ? defineToolCallRenderer({
|
|
4286
4359
|
name: "*",
|
|
@@ -4312,7 +4385,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
4312
4385
|
}, [
|
|
4313
4386
|
config.name,
|
|
4314
4387
|
copilotkit,
|
|
4315
|
-
|
|
4388
|
+
depsVersion
|
|
4316
4389
|
]);
|
|
4317
4390
|
}
|
|
4318
4391
|
|