@copilotkit/react-core 1.68.3-canary.1787220377 → 1.68.3

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.
@@ -4613,75 +4613,6 @@ function useAgent({ agentId, threadId, runtimeAgentId, updates, throttleMs } = {
4613
4613
  };
4614
4614
  }
4615
4615
 
4616
- //#endregion
4617
- //#region src/v2/hooks/use-subagent.tsx
4618
- const warnedAmbiguousNames = /* @__PURE__ */ new Set();
4619
- function resolveSubagent(subagents, subagentRunId, subagentName) {
4620
- if (subagentRunId) {
4621
- const match = subagents[subagentRunId];
4622
- return match ? { ...match } : void 0;
4623
- }
4624
- if (subagentName) {
4625
- const matches = Object.values(subagents).filter((s) => s.name === subagentName);
4626
- if (matches.length === 0) return;
4627
- const chosen = matches[matches.length - 1];
4628
- return matches.length > 1 ? {
4629
- ...chosen,
4630
- isAmbiguous: true,
4631
- matchCount: matches.length
4632
- } : { ...chosen };
4633
- }
4634
- }
4635
- /**
4636
- * Read a subagent's live lifecycle state (name, description, running status)
4637
- * from the CopilotKit core subagent registry, by id or by declared name.
4638
- *
4639
- * @example
4640
- * const sub = useSubagent({ subagentRunId: message.subagentRunId });
4641
- * // sub?.name, sub?.description, sub?.status
4642
- */
4643
- function useSubagent(params) {
4644
- const { subagentRunId, subagentName, agentId } = params;
4645
- const { copilotkit } = useCopilotKit();
4646
- const config = useCopilotChatConfiguration();
4647
- const resolvedAgentId = useMemo(() => agentId ?? config?.agentId ?? DEFAULT_AGENT_ID, [agentId, config?.agentId]);
4648
- const [subagent, setSubagent] = useState(() => resolveSubagent(copilotkit.getSubagents(resolvedAgentId), subagentRunId, subagentName));
4649
- useEffect(() => {
4650
- setSubagent(resolveSubagent(copilotkit.getSubagents(resolvedAgentId), subagentRunId, subagentName));
4651
- }, [
4652
- copilotkit,
4653
- resolvedAgentId,
4654
- subagentRunId,
4655
- subagentName
4656
- ]);
4657
- useEffect(() => {
4658
- const subscription = copilotkit.subscribe({ onSubagentsChanged: ({ agentId: changedAgentId, subagents }) => {
4659
- if (changedAgentId !== resolvedAgentId) return;
4660
- setSubagent(resolveSubagent(subagents, subagentRunId, subagentName));
4661
- } });
4662
- return () => {
4663
- subscription.unsubscribe();
4664
- };
4665
- }, [
4666
- copilotkit,
4667
- resolvedAgentId,
4668
- subagentRunId,
4669
- subagentName
4670
- ]);
4671
- useEffect(() => {
4672
- if (process.env.NODE_ENV === "production" || !subagentName || !subagent?.isAmbiguous) return;
4673
- const key = `${subagentName}:${subagent.matchCount}`;
4674
- if (warnedAmbiguousNames.has(key)) return;
4675
- warnedAmbiguousNames.add(key);
4676
- console.warn(`[CopilotKit] useSubagent({ subagentName: ${JSON.stringify(subagentName)} }) matched ${subagent.matchCount} subagents. Returning the most recently started one; pass a subagentRunId for a stable reference.`);
4677
- }, [
4678
- subagentName,
4679
- subagent?.isAmbiguous,
4680
- subagent?.matchCount
4681
- ]);
4682
- return subagent;
4683
- }
4684
-
4685
4616
  //#endregion
4686
4617
  //#region src/v2/hooks/use-capabilities.tsx
4687
4618
  /**
@@ -11999,5 +11930,5 @@ function validateProps(props) {
11999
11930
  }
12000
11931
 
12001
11932
  //#endregion
12002
- export { useCapabilities as $, CopilotChatMessageView as A, AudioRecorderError as At, CopilotChatAssistantMessage_default as B, CopilotModalHeader as C, MCPAppsActivityContentSchema as Ct, CopilotChat as D, CopilotKitInspector as Dt, DefaultOpenIcon as E, ɵrunMcpFollowUp as Et, CopilotChatSuggestionView as F, useLearnFromUserActionInCurrentThread as G, useLearningContainersInCurrentThread as H, CopilotChatSuggestionPill as I, useThreads$1 as J, useLearnFromUserAction as K, CopilotChatReasoningMessage_default as L, IntelligenceIndicator as M, CopilotChatConfigurationProvider as Mt, getIntelligenceTurnAnchors as N, useCopilotChatConfiguration as Nt, CopilotChatView_default as O, useRenderToolCall as Ot, IntelligenceIndicatorView as P, useAgentContext as Q, CopilotChatUserMessage_default as R, CopilotSidebarView as S, useSandboxFunctions as St, DefaultCloseIcon as T, MCPAppsActivityType as Tt, useLearningContainers as U, CopilotChatToolCallsView as V, useAttachments as W, useConfigureSuggestions as X, useInterrupt as Y, useSuggestions as Z, WildcardToolCallRender as _, OpenGenerativeUIActivityRenderer as _t, ThreadsProvider as a, useRenderTool as at, CopilotSidebar as b, OpenGenerativeUIToolRenderer as bt, CoAgentStateRendersProvider as c, useRenderActivityMessage as ct, shouldShowDevConsole as d, useCopilotKit$1 as dt, useSubagent as et, useToast as f, useLicenseContext$1 as ft, useCopilotContext as g, GenerateSandboxedUiArgsSchema as gt, CopilotContext as h, createA2UIMessageRenderer as ht, ThreadsContext as i, useDefaultRenderTool as it, INTELLIGENCE_TURN_HEAD as j, CopilotChatAudioRecorder as jt, CopilotChatAttachmentQueue as k, CopilotChatInput_default as kt, useCoAgentStateRenders as l, useRenderCustomMessages as lt, useCopilotMessagesContext as m, defineToolCallRenderer as mt, defaultCopilotContextCategories as n, useAgent as nt, useThreads as o, useComponent as ot, CopilotMessagesContext as p, CopilotKitCoreReact as pt, useMemories as q, CoAgentStateRenderBridge as r, useHumanInTheLoop as rt, CoAgentStateRendersContext as s, useFrontendTool as st, CopilotKit as t, UseAgentUpdate as tt, useAsyncCallback as u, CopilotKitProvider as ut, CopilotThreadsDrawer as v, OpenGenerativeUIActivityType as vt, CopilotChatToggleButton as w, MCPAppsActivityRenderer as wt, CopilotPopupView as x, SandboxFunctionsContext as xt, CopilotPopup as y, OpenGenerativeUIContentSchema as yt, CopilotChatAttachmentRenderer as z };
12003
- //# sourceMappingURL=copilotkit-DT2FmOwK.mjs.map
11933
+ export { useCapabilities as $, CopilotChatMessageView as A, CopilotChatAudioRecorder as At, CopilotChatAssistantMessage_default as B, CopilotModalHeader as C, MCPAppsActivityRenderer as Ct, CopilotChat as D, useRenderToolCall as Dt, DefaultOpenIcon as E, CopilotKitInspector as Et, CopilotChatSuggestionView as F, useLearnFromUserActionInCurrentThread as G, useLearningContainersInCurrentThread as H, CopilotChatSuggestionPill as I, useThreads$1 as J, useLearnFromUserAction as K, CopilotChatReasoningMessage_default as L, IntelligenceIndicator as M, useCopilotChatConfiguration as Mt, getIntelligenceTurnAnchors as N, CopilotChatView_default as O, CopilotChatInput_default as Ot, IntelligenceIndicatorView as P, useAgentContext as Q, CopilotChatUserMessage_default as R, CopilotSidebarView as S, MCPAppsActivityContentSchema as St, DefaultCloseIcon as T, ɵrunMcpFollowUp as Tt, useLearningContainers as U, CopilotChatToolCallsView as V, useAttachments as W, useConfigureSuggestions as X, useInterrupt as Y, useSuggestions as Z, WildcardToolCallRender as _, OpenGenerativeUIActivityType as _t, ThreadsProvider as a, useComponent as at, CopilotSidebar as b, SandboxFunctionsContext as bt, CoAgentStateRendersProvider as c, useRenderCustomMessages as ct, shouldShowDevConsole as d, useLicenseContext$1 as dt, UseAgentUpdate as et, useToast as f, CopilotKitCoreReact as ft, useCopilotContext as g, OpenGenerativeUIActivityRenderer as gt, CopilotContext as h, GenerateSandboxedUiArgsSchema as ht, ThreadsContext as i, useRenderTool as it, INTELLIGENCE_TURN_HEAD as j, CopilotChatConfigurationProvider as jt, CopilotChatAttachmentQueue as k, AudioRecorderError as kt, useCoAgentStateRenders as l, CopilotKitProvider as lt, useCopilotMessagesContext as m, createA2UIMessageRenderer as mt, defaultCopilotContextCategories as n, useHumanInTheLoop as nt, useThreads as o, useFrontendTool as ot, CopilotMessagesContext as p, defineToolCallRenderer as pt, useMemories as q, CoAgentStateRenderBridge as r, useDefaultRenderTool as rt, CoAgentStateRendersContext as s, useRenderActivityMessage as st, CopilotKit as t, useAgent as tt, useAsyncCallback as u, useCopilotKit$1 as ut, CopilotThreadsDrawer as v, OpenGenerativeUIContentSchema as vt, CopilotChatToggleButton as w, MCPAppsActivityType as wt, CopilotPopupView as x, useSandboxFunctions as xt, CopilotPopup as y, OpenGenerativeUIToolRenderer as yt, CopilotChatAttachmentRenderer as z };
11934
+ //# sourceMappingURL=copilotkit-C4RqjAba.mjs.map