@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.
- package/dist/{copilotkit-CZjzQPdq.d.mts → copilotkit-BUIK5yln.d.mts} +3 -33
- package/dist/copilotkit-BUIK5yln.d.mts.map +1 -0
- package/dist/{copilotkit-EFunREg5.cjs → copilotkit-Bocmlr37.cjs} +1 -76
- package/dist/copilotkit-Bocmlr37.cjs.map +1 -0
- package/dist/{copilotkit-DT2FmOwK.mjs → copilotkit-C4RqjAba.mjs} +2 -71
- package/dist/{copilotkit-DT2FmOwK.mjs.map → copilotkit-C4RqjAba.mjs.map} +1 -1
- package/dist/{copilotkit-B1K0Tgnz.d.cts → copilotkit-DSvKW3SS.d.cts} +3 -33
- package/dist/copilotkit-DSvKW3SS.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/v2/index.cjs +1 -2
- 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 +0 -70
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/skills/react-core/SKILL.md +1 -1
- package/dist/copilotkit-B1K0Tgnz.d.cts.map +0 -1
- package/dist/copilotkit-CZjzQPdq.d.mts.map +0 -1
- package/dist/copilotkit-EFunREg5.cjs.map +0 -1
|
@@ -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,
|
|
12003
|
-
//# sourceMappingURL=copilotkit-
|
|
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
|