@copilotkit/react-core 1.77.1 → 1.77.2

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.
@@ -1626,7 +1626,7 @@ function useRenderToolCall() {
1626
1626
 
1627
1627
  //#endregion
1628
1628
  //#region package.json
1629
- var version = "1.77.1";
1629
+ var version = "1.77.2";
1630
1630
 
1631
1631
  //#endregion
1632
1632
  //#region src/v2/components/CopilotKitInspector.tsx
@@ -3383,6 +3383,12 @@ const DEFAULT_DESIGN_SKILL = `When generating UI with generateSandboxedUi, follo
3383
3383
  - Use CSS Grid or Flexbox for layout. Ensure the UI looks good at any width.
3384
3384
  - Minimal transitions (150ms) for hover/focus states only. No decorative animations.
3385
3385
  - Keep the UI focused and dense — avoid excessive padding. Use compact spacing (8–12px gaps, 10–14px padding in controls).`;
3386
+ const DEFAULT_LEARNING = Object.freeze({});
3387
+ function toLearningConfig(learning) {
3388
+ if (learning === true) return DEFAULT_LEARNING;
3389
+ if (learning === false) return void 0;
3390
+ return learning;
3391
+ }
3386
3392
  function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
3387
3393
  const empty = useMemo(() => [], []);
3388
3394
  const value = prop ?? empty;
@@ -3393,6 +3399,7 @@ function useStableArrayProp(prop, warningMessage, isMeaningfulChange) {
3393
3399
  return value;
3394
3400
  }
3395
3401
  const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY_HEADERS, credentials, messageFilter, publicApiKey, publicLicenseKey, licenseToken, properties = EMPTY_PROPERTIES, agents__unsafe_dev_only: agents = EMPTY_AGENTS, selfManagedAgents = EMPTY_AGENTS, renderToolCalls, renderActivityMessages, renderCustomMessages, frontendTools, humanInTheLoop, openGenerativeUI, enableInspector, agentId, showIntelligenceIndicator = true, useSingleEndpoint, onError, a2ui, defaultThrottleMs, debug, learning }) => {
3402
+ const learningConfig = toLearningConfig(learning);
3396
3403
  const [shouldRenderInspector, setShouldRenderInspector] = useState(false);
3397
3404
  const [inspectorVisible, setInspectorVisible] = useState(false);
3398
3405
  useEffect(() => {
@@ -3628,7 +3635,7 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3628
3635
  renderActivityMessages: allActivityRenderers,
3629
3636
  renderCustomMessages: renderCustomMessagesList,
3630
3637
  debug,
3631
- learning
3638
+ learning: learningConfig
3632
3639
  });
3633
3640
  if (defaultThrottleMs !== void 0) copilotkitRef.current.setDefaultThrottleMs(defaultThrottleMs);
3634
3641
  }
@@ -3733,17 +3740,21 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3733
3740
  useSingleEndpoint,
3734
3741
  debug
3735
3742
  ]);
3736
- const learningEnabled = learning !== void 0;
3737
- const trajectoryId = learning?.trajectoryId;
3738
- const learningContainerIdsRef = useRef(learning?.learningContainerIds);
3739
- useEffect(() => {
3740
- copilotkit.setLearningConfig(learning);
3741
- learningContainerIdsRef.current = learning?.learningContainerIds;
3742
- if (learning?.sink === void 0 && learning?.trajectoryId === void 0 && learning?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture does not assign Learning Containers; remove learningContainerIds from the capture options.");
3743
- }, [copilotkit, learning]);
3744
- useEffect(() => {
3743
+ const learningEnabled = learningConfig !== void 0;
3744
+ const generatesTrajectoryId = learning === true;
3745
+ const suppliedTrajectoryId = learningConfig?.trajectoryId;
3746
+ const learningContainerIdsRef = useRef(learningConfig?.learningContainerIds);
3747
+ const generatedTrajectoryIdRef = useRef(void 0);
3748
+ useEffect(() => {
3749
+ copilotkit.setLearningConfig(learningConfig);
3750
+ learningContainerIdsRef.current = learningConfig?.learningContainerIds;
3751
+ if (learningConfig?.sink === void 0 && learningConfig?.trajectoryId === void 0 && learningConfig?.learningContainerIds !== void 0) console.warn("[CopilotKit] learningContainerIds is supported only with a custom sink. Authenticated Trajectory capture does not assign Learning Containers; remove learningContainerIds from the capture options.");
3752
+ }, [copilotkit, learningConfig]);
3753
+ useEffect(() => {
3754
+ if (!generatesTrajectoryId) generatedTrajectoryIdRef.current = void 0;
3745
3755
  if (!learningEnabled) return;
3746
3756
  let disposed = false;
3757
+ const trajectoryId = generatesTrajectoryId ? generatedTrajectoryIdRef.current ??= randomUUID$1() : suppliedTrajectoryId;
3747
3758
  if (trajectoryId !== void 0) copilotkit.startTrajectory({
3748
3759
  trajectoryId,
3749
3760
  learningContainerIds: learningContainerIdsRef.current
@@ -3757,7 +3768,8 @@ const CopilotKitProvider = ({ children, runtimeUrl, headers: headersProp = EMPTY
3757
3768
  }, [
3758
3769
  copilotkit,
3759
3770
  learningEnabled,
3760
- trajectoryId
3771
+ generatesTrajectoryId,
3772
+ suppliedTrajectoryId
3761
3773
  ]);
3762
3774
  const didMountRef = useRef(false);
3763
3775
  useEffect(() => {
@@ -12810,4 +12822,4 @@ function validateProps(props) {
12810
12822
 
12811
12823
  //#endregion
12812
12824
  export { useConfigureSuggestions as $, ɵselectMemoriesRealtimeStatus$1 as $a, omitOptionalNulls as $i, MultimodalCapabilitiesSchema as $n, TextMessageRoleSchema as $r, AudioPartSchema as $t, CopilotChatMessageView as A, ɵisHttpAgent$1 as Aa, createEffect as Ai, HumanInTheLoopCapabilitiesSchema as An, RunStartedEventSchema as Ar, CopilotKitInspector as At, CopilotChatUserMessage_default as B, ɵobservePhoenixSocketHealth$ as Ba, empty as Bi, IntelligenceAgent as Bn, SubagentFinishedOutcomeSchema as Br, AGUI_METADATA_KEY as Bt, CopilotModalHeader as C, ɵMAX_SOCKET_RETRIES as Ca, compactEvents as Ci, EventTypeSchema as Cn, RunErrorEventSchema as Cr, OpenGenerativeUIToolRenderer as Ct, CopilotChat as D, ɵcreateThreadSelectors as Da, convertToLegacyEvents as Di, FunctionCallSchema as Dn, RunFinishedOutcomeSchema as Dr, MCPAppsActivityRenderer as Dt, DefaultOpenIcon as E, ɵcreateMemoryStore as Ea, contentToText$1 as Ei, FilterToolCallsMiddleware as En, RunFinishedInterruptOutcomeSchema as Er, MCPAppsActivityContentSchema as Et, getIntelligenceTurnAnchors as F, ɵmemoryDomainEvents as Fa, defaultApplyEvents as Fi, ImagePartSchema as Fn, StateSnapshotEventSchema as Fr, CopilotChatConfigurationProvider as Ft, useLearningContainers as G, ɵselectHasNextPage$1 as Ga, getWebMCPModelContext as Gi, MEMORY_ERROR_REGISTRY as Gn, SubagentStartedEventSchema as Gr, AddOperationSchema as Gt, CopilotChatAssistantMessage_default as H, ɵphoenixChannel$ as Ha, enforceOutgoingInput as Hi, JsonPatchOperationSchema as Hn, SubagentFinishedSuspendedOutcomeSchema as Hr, ActivityDeltaEventSchema as Ht, IntelligenceIndicatorView as I, ɵmemoryReducer as Ia, emitInspectorActiveThread$1 as Ii, InputContentDataSourceSchema as In, StepFinishedEventSchema as Ir, useCopilotChatConfiguration as It, useLearnFromUserAction as J, ɵselectMemories$1 as Ja, isInterruptExpired as Ji, MessagesSnapshotEventSchema as Jn, TestOperationSchema as Jr, AgentThreadLockedError as Jt, useAttachments as K, ɵselectIsFetchingNextPage$1 as Ka, isAbortError as Ki, MemoryError as Kn, SuggestionEngine as Kr, AgentCapabilitiesSchema as Kt, CopilotChatSuggestionView as L, ɵmemoryRestEvents as La, emitInspectorStopViewing as Li, InputContentSchema as Ln, StepStartedEventSchema as Lr, ACTIVITY_HISTORY_METADATA as Lt, messageRow as M, ɵjoinPhoenixChannel$ as Ma, createReducer as Mi, IdentityCapabilitiesSchema as Mn, StateDeltaEventSchema as Mr, CopilotChatInput_default as Mt, INTELLIGENCE_TURN_HEAD as N, ɵmapMemoryMetadataEvent as Na, createSelector as Ni, ImageInputContentSchema as Nn, StateManager as Nr, AudioRecorderError as Nt, CopilotChatView_default as O, ɵcreateThreadStore$1 as Oa, createActionGroup as Oi, FunctionMiddleware as On, RunFinishedSuccessOutcomeSchema as Or, MCPAppsActivityType as Ot, IntelligenceIndicator as P, ɵmemoryAdapterEvents as Pa, createStore as Pi, ImageInputPartSchema as Pn, StateSchema as Pr, CopilotChatAudioRecorder as Pt, INTERRUPT_EVENT_NAME as Q, ɵselectMemoriesIsMutating as Qa, ofType as Qi, MultiAgentCapabilitiesSchema as Qn, TextMessageEndEventSchema as Qr, AudioInputPartSchema as Qt, CopilotChatSuggestionPill as R, ɵobservePhoenixEvent$ as Ra, emitInspectorViewThread as Ri, InputContentSourceSchema as Rn, SubagentErrorEventSchema as Rr, AGUIConnectNotImplementedError$1 as Rt, CopilotSidebarView as S, ɵInterruptState$1 as Sa, buildResumeArray as Si, EventType as Sn, RunAgentInputSchema as Sr, OpenGenerativeUIContentSchema as St, DefaultCloseIcon as T, ɵTHREAD_REQUEST_TIMEOUT_MS as Ta, contentHasMedia as Ti, FileSourceSchema as Tn, RunFinishedEventSchema as Tr, useSandboxFunctions as Tt, CopilotChatToolCallsView as U, ɵphoenixSocket$ as Ua, ensureObjectArgs as Ui, JsonPatchSchema as Un, SubagentInfoSchema as Ur, ActivityMessageSchema as Ut, CopilotChatAttachmentRenderer as V, ɵobservePhoenixSocketSignals$ as Va, enforceEvents as Vi, InterruptSchema as Vn, SubagentFinishedSuccessOutcomeSchema as Vr, AbstractAgent$1 as Vt, useLearningContainersInCurrentThread as W, ɵselectFetchMoreError$1 as Wa, getRunOutcome as Wi, JsonPointerSchema as Wn, SubagentRunIdSchema as Wr, ActivitySnapshotEventSchema as Wt, useThreads$1 as X, ɵselectMemoriesError$1 as Xa, isRunCompletionAware$1 as Xi, Middleware as Xn, TextMessageChunkEventSchema as Xr, AttributableSchema as Xt, useMemories as Y, ɵselectMemoriesAvailable$1 as Ya, isRecognizedEvent as Yi, MetadataSchema as Yn, TextInputContentSchema as Yr, AssistantMessageSchema as Yt, useInterrupt as Z, ɵselectMemoriesIsLoading$1 as Za, mergeMetadata as Zi, MoveOperationSchema as Zn, TextMessageContentEventSchema as Zr, AudioInputContentSchema as Zt, WildcardToolCallRender as _, transformChunks as _a, VideoInputPartSchema as _i, DocumentInputContentSchema as _n, ReasoningStartEventSchema as _r, defineToolCallRenderer as _t, ThreadsProvider as a, parseProtoStream as aa, ToolCallEndEventSchema as ai, CompatibilityBoundary as an, PartSourceSchema as ar, useHumanInTheLoop as at, CopilotSidebar as b, withAuthoritativeActivityTypes as ba, aggregateTokenUsage as bi, EventSchema as bn, ResumeEntrySchema as br, OpenGenerativeUIActivityRenderer as bt, CoAgentStateRendersProvider as c, props as ca, ToolCallStartEventSchema as ci, ContextStore as cn, ReasoningCapabilitiesSchema as cr, useComponent as ct, shouldShowDevConsole as d, resolveDebugLogger as da, ToolSchema as di, CopilotKitCoreRuntimeConnectionStatus$1 as dn, ReasoningEndEventSchema as dr, useRenderActivityMessage as dt, on as ea, TextMessageStartEventSchema as ei, BackwardCompatibility_0_0_39 as en, ɵselectThreads$1 as eo, MultimodalInputCapabilitiesSchema as er, useSuggestions as et, useToast as f, runHttpRequest as fa, ToolsCapabilitiesSchema as fi, CopyOperationSchema as fn, ReasoningMessageChunkEventSchema as fr, useRenderCustomMessages as ft, useCopilotContext as g, tokenUsageFromLangChainMetadata as ga, VideoInputContentSchema as gi, DeveloperMessageSchema as gn, ReasoningMessageStartEventSchema as gr, CopilotKitCoreReact as gt, CopilotContext as h, tokenUsageFromAiSdkUsage as ha, UserMessageSchema as hi, DebugLogger as hn, ReasoningMessageSchema as hr, useLicenseContext$1 as ht, ThreadsContext as i, onInspectorViewThreadResult as ia, ToolCallChunkEventSchema as ii, BaseMessageSchema as in, PROTOCOL_VERSION as ir, useAgent as it, messageGroup as j, ɵisRetryableMemoryStatus as ja, createInspectorThreadRequestId as ji, INSPECTOR_THREAD_BRIDGE_PLUGIN_ID as jn, StateCapabilitiesSchema as jr, useRenderToolCall as jt, CopilotChatAttachmentQueue as k, ɵisCopilotKitFeature as ka, createDebugLogger as ki, HttpAgent as kn, RunHandler as kr, ɵrunMcpFollowUp as kt, useCoAgentStateRenders as l, randomUUID$2 as la, ToolCallStatus$1 as li, CopilotKitCore$1 as ln, ReasoningEncryptedValueEventSchema as lr, useFrontendTools as lt, useCopilotMessagesContext as m, structuredClone_ as ma, UrlSourceSchema as mi, DataSourceSchema as mn, ReasoningMessageEndEventSchema as mr, useCopilotKit$1 as mt, defaultCopilotContextCategories as n, onInspectorStopViewing$1 as na, TokenUsageSchema as ni, BackwardCompatibility_0_0_57 as nn, ɵselectThreadsIsLoading$1 as no, OptionalMetadataSchema as nr, useCapabilities as nt, useThreads as o, parseSSEStream as oa, ToolCallResultEventSchema as oi, ContentPartSchema as on, ProxiedCopilotRuntimeAgent$1 as or, useDefaultRenderTool as ot, CopilotMessagesContext as p, select as pa, TransportCapabilitiesSchema as pi, CustomEventSchema as pn, ReasoningMessageContentEventSchema as pr, CopilotKitProvider as pt, useLearnFromUserActionInCurrentThread as q, ɵselectIsMutating$1 as qa, isInspectorThreadBridgeEnabled$1 as qi, MessageSchema as qn, SystemMessageSchema as qr, AgentRegistry as qt, CoAgentStateRenderBridge as r, onInspectorViewThread$1 as ra, ToolCallArgsEventSchema as ri, BaseEventSchema as rn, ɵthreadAdapterEvents as ro, OutputCapabilitiesSchema as rr, UseAgentUpdate as rt, CoAgentStateRendersContext as s, parseToolArguments as sa, ToolCallSchema as si, ContextSchema as sn, RawEventSchema as sr, useRenderTool as st, CopilotKit as t, onInspectorActiveThread as ta, TextPartSchema as ti, BackwardCompatibility_0_0_45 as tn, ɵselectThreadsError$1 as to, MultimodalOutputCapabilitiesSchema as tr, useAgentContext as tt, useAsyncCallback as u, resolveAgentDebugConfig as ua, ToolMessageSchema as ui, CopilotKitCoreErrorCode$1 as un, ReasoningEncryptedValueSubtypeSchema as ur, useFrontendTool as ut, CopilotThreadsDrawer as v, transformHttpEventStream as va, VideoPartSchema as vi, DocumentInputPartSchema as vn, RemoveOperationSchema as vr, createA2UIMessageRenderer as vt, CopilotChatToggleButton as w, ɵRUNTIME_PROBE_TIMEOUT_MS as wa, completePartialMarkdown as wi, ExecutionCapabilitiesSchema as wn, RunFinishedCancelledOutcomeSchema as wr, SandboxFunctionsContext as wt, CopilotPopupView as x, ɵCOPILOTKIT_FEATURES as xa, authoritativeActivityTypes as xi, EventSchemas as xn, RoleSchema as xr, OpenGenerativeUIActivityType as xt, CopilotPopup as y, verifyEvents as ya, WebMCPRegistry as yi, DocumentPartSchema as yn, ReplaceOperationSchema as yr, GenerateSandboxedUiArgsSchema as yt, CopilotChatReasoningMessage_default as z, ɵobservePhoenixJoinOutcome$ as za, emitInspectorViewThreadResult$1 as zi, InputContentUrlSourceSchema as zn, SubagentFinishedEventSchema as zr, AGUIError as zt };
12813
- //# sourceMappingURL=copilotkit-C_Sy6Cc7.mjs.map
12825
+ //# sourceMappingURL=copilotkit-BI7KSQQw.mjs.map