@copilotkit/react-core 1.56.5-canary.1777983277 → 1.56.5-canary.1777990461
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-_0iofF5v.mjs → copilotkit--McKbFME.mjs} +60 -29
- package/dist/copilotkit--McKbFME.mjs.map +1 -0
- package/dist/{copilotkit-3KTrraC5.d.mts → copilotkit-BMR_j11U.d.mts} +31 -13
- package/dist/{copilotkit-DzIX4TLs.d.cts.map → copilotkit-BMR_j11U.d.mts.map} +1 -1
- package/dist/{copilotkit-BsmznxTd.cjs → copilotkit-DLxvRryA.cjs} +60 -29
- package/dist/copilotkit-DLxvRryA.cjs.map +1 -0
- package/dist/{copilotkit-DzIX4TLs.d.cts → copilotkit-Qi61QzGV.d.cts} +31 -13
- package/dist/{copilotkit-3KTrraC5.d.mts.map → copilotkit-Qi61QzGV.d.cts.map} +1 -1
- 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 -1
- package/dist/v2/index.d.cts +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +63 -31
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/v2/components/intelligence-indicator/IntelligenceIndicator.tsx +113 -61
- package/dist/copilotkit-BsmznxTd.cjs.map +0 -1
- package/dist/copilotkit-_0iofF5v.mjs.map +0 -1
|
@@ -5624,27 +5624,45 @@ const DEFAULT_TOOL_PATTERNS = [/^bash$/];
|
|
|
5624
5624
|
* again here as a defence)
|
|
5625
5625
|
* 2. The message is an assistant message with at least one tool call
|
|
5626
5626
|
* whose name matches {@link DEFAULT_TOOL_PATTERNS}
|
|
5627
|
-
* 3. The message
|
|
5628
|
-
*
|
|
5629
|
-
*
|
|
5630
|
-
* message exists in the same run. Tool result messages
|
|
5627
|
+
* 3. The message is the *latest* such matching-assistant message
|
|
5628
|
+
* anywhere in `agent.messages` — i.e. no later assistant-with-
|
|
5629
|
+
* matching-tool-call message exists. Tool result messages
|
|
5631
5630
|
* (`role: "tool"`) and prose-only assistant messages do NOT
|
|
5632
5631
|
* invalidate this slot, so the pill stays continuously through a
|
|
5633
|
-
* multi-step
|
|
5634
|
-
* tool
|
|
5635
|
-
*
|
|
5632
|
+
* multi-step tool chain instead of flickering off every time a
|
|
5633
|
+
* tool reply arrives.
|
|
5634
|
+
* 4. The phase machine is not yet `hidden` — once a pill has faded
|
|
5635
|
+
* out it stays gone; a subsequent run on the same chat mounts a
|
|
5636
|
+
* fresh pill on its own assistant message rather than resurrecting
|
|
5637
|
+
* this one.
|
|
5638
|
+
* 5. (Run scoping comes for free from `phase === "hidden"` being
|
|
5639
|
+
* sticky after the previous run's fade-out — no `getRunIdForMessage`
|
|
5640
|
+
* lookup is needed, and the indicator stays robust against gaps
|
|
5641
|
+
* in the SDK's run-tracking map.)
|
|
5636
5642
|
*
|
|
5637
5643
|
* Phase machine (per-instance, all timers local):
|
|
5638
|
-
* - `spinner` while
|
|
5639
|
-
* - → `check`
|
|
5640
|
-
*
|
|
5641
|
-
*
|
|
5644
|
+
* - `spinner` while the run is in flight and no prose has started
|
|
5645
|
+
* - → `check` either when a later assistant message in the run
|
|
5646
|
+
* starts emitting prose (early fade — the recall phase is over
|
|
5647
|
+
* from the user's perspective even though `isRunning` is still
|
|
5648
|
+
* true while prose streams) OR when `agent.isRunning` falls
|
|
5649
|
+
* (debounced 500 ms to absorb step-boundary
|
|
5650
|
+
* `RUN_FINISHED → RUN_STARTED` blips inside one user turn) — the
|
|
5651
|
+
* `agent.isRunning` path is the safety net for runs that end
|
|
5652
|
+
* without ever emitting prose (errors, max-step bail-out)
|
|
5642
5653
|
* - → `fading` after a brief hold ({@link CHECK_HOLD_MS})
|
|
5643
5654
|
* - → `hidden` after the fade animation
|
|
5644
5655
|
* ({@link FADE_OUT_ANIMATION_MS})
|
|
5645
5656
|
*
|
|
5657
|
+
* Mounting on a *historical* match (no live run): the indicator skips
|
|
5658
|
+
* the lifecycle entirely and starts in `"hidden"`. Old assistant-with-
|
|
5659
|
+
* tool-call messages in a previously-finished thread still satisfy
|
|
5660
|
+
* gates 2 + 3 when the thread is reopened, but there is no live work
|
|
5661
|
+
* to celebrate; replaying spinner → check → fade on every navigation
|
|
5662
|
+
* would be visual noise.
|
|
5663
|
+
*
|
|
5646
5664
|
* The "exactly one pill at a time" guarantee is structural — only one
|
|
5647
|
-
* message at any moment satisfies gates 2–
|
|
5665
|
+
* message at any moment satisfies gates 2–3 — so no shared coordination
|
|
5648
5666
|
* state is required.
|
|
5649
5667
|
*/
|
|
5650
5668
|
function IntelligenceIndicator(props) {
|
|
@@ -5667,15 +5685,33 @@ function IntelligenceIndicator(props) {
|
|
|
5667
5685
|
}, ISRUNNING_POLL_MS);
|
|
5668
5686
|
return () => clearInterval(interval);
|
|
5669
5687
|
}, [agent]);
|
|
5670
|
-
const [phase, setPhase] = useState(agent.isRunning ? "spinner" : "
|
|
5688
|
+
const [phase, setPhase] = useState(agent.isRunning ? "spinner" : "hidden");
|
|
5671
5689
|
useEffect(() => {
|
|
5690
|
+
if (phase === "hidden") return void 0;
|
|
5672
5691
|
if (agent.isRunning) {
|
|
5673
5692
|
setPhase("spinner");
|
|
5674
5693
|
return;
|
|
5675
5694
|
}
|
|
5676
5695
|
const t = setTimeout(() => setPhase("check"), RUN_IDLE_DEBOUNCE_MS);
|
|
5677
5696
|
return () => clearTimeout(t);
|
|
5678
|
-
}, [agent.isRunning]);
|
|
5697
|
+
}, [agent.isRunning, phase]);
|
|
5698
|
+
useEffect(() => {
|
|
5699
|
+
if (phase !== "spinner") return void 0;
|
|
5700
|
+
const ourIdx = agent.messages.findIndex((m) => m.id === message.id);
|
|
5701
|
+
if (ourIdx < 0) return void 0;
|
|
5702
|
+
if (agent.messages.slice(ourIdx + 1).some((m) => {
|
|
5703
|
+
if (m.role !== "assistant") return false;
|
|
5704
|
+
if (!(typeof m.content === "string" && m.content.trim().length > 0)) return false;
|
|
5705
|
+
return !(Array.isArray(m.toolCalls) ? m.toolCalls : []).some((tc) => {
|
|
5706
|
+
const name = tc?.function?.name;
|
|
5707
|
+
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5708
|
+
});
|
|
5709
|
+
})) setPhase("check");
|
|
5710
|
+
}, [
|
|
5711
|
+
agent.messages,
|
|
5712
|
+
message.id,
|
|
5713
|
+
phase
|
|
5714
|
+
]);
|
|
5679
5715
|
useEffect(() => {
|
|
5680
5716
|
if (phase !== "check") return void 0;
|
|
5681
5717
|
const t = setTimeout(() => setPhase("fading"), CHECK_HOLD_MS);
|
|
@@ -5694,24 +5730,19 @@ function IntelligenceIndicator(props) {
|
|
|
5694
5730
|
const name = tc?.function?.name;
|
|
5695
5731
|
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5696
5732
|
})) return null;
|
|
5697
|
-
|
|
5698
|
-
if (!messageRunId) return null;
|
|
5699
|
-
let latestRunId;
|
|
5700
|
-
let latestMatchingAssistantIdInRun;
|
|
5733
|
+
let latestMatchingAssistantId;
|
|
5701
5734
|
for (let i = agent.messages.length - 1; i >= 0; i -= 1) {
|
|
5702
5735
|
const m = agent.messages[i];
|
|
5703
|
-
|
|
5704
|
-
if (
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5736
|
+
if (m.role !== "assistant") continue;
|
|
5737
|
+
if ((Array.isArray(m.toolCalls) ? m.toolCalls : []).some((tc) => {
|
|
5738
|
+
const name = tc?.function?.name;
|
|
5739
|
+
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5740
|
+
})) {
|
|
5741
|
+
latestMatchingAssistantId = m.id;
|
|
5742
|
+
break;
|
|
5710
5743
|
}
|
|
5711
|
-
if (latestRunId !== void 0 && latestMatchingAssistantIdInRun !== void 0) break;
|
|
5712
5744
|
}
|
|
5713
|
-
if (
|
|
5714
|
-
if (latestMatchingAssistantIdInRun !== message.id) return null;
|
|
5745
|
+
if (latestMatchingAssistantId !== message.id) return null;
|
|
5715
5746
|
const showSpinner = phase === "spinner";
|
|
5716
5747
|
const isFading = phase === "fading";
|
|
5717
5748
|
return /* @__PURE__ */ jsxs("span", {
|
|
@@ -9967,4 +9998,4 @@ function validateProps(props) {
|
|
|
9967
9998
|
|
|
9968
9999
|
//#endregion
|
|
9969
10000
|
export { useRenderToolCall as $, IntelligenceIndicator as A, useInterrupt as B, CopilotChatToggleButton as C, CopilotChatView_default as D, CopilotChat as E, CopilotChatAttachmentRenderer as F, useAgent as G, useSuggestions as H, CopilotChatAssistantMessage_default as I, useRenderTool as J, useHumanInTheLoop as K, CopilotChatToolCallsView as L, CopilotChatSuggestionPill as M, CopilotChatReasoningMessage_default as N, CopilotChatAttachmentQueue as O, CopilotChatUserMessage_default as P, useRenderCustomMessages as Q, useAttachments as R, CopilotModalHeader as S, DefaultOpenIcon as T, useCapabilities as U, useConfigureSuggestions as V, UseAgentUpdate as W, useFrontendTool as X, useComponent as Y, useRenderActivityMessage as Z, WildcardToolCallRender as _, ThreadsProvider as a, createA2UIMessageRenderer as at, CopilotPopupView as b, CoAgentStateRendersProvider as c, MCPAppsActivityContentSchema as ct, shouldShowDevConsole as d, CopilotKitInspector as dt, CopilotKitProvider as et, useToast as f, CopilotChatInput_default as ft, useCopilotContext as g, useCopilotChatConfiguration as gt, CopilotContext as h, CopilotChatConfigurationProvider as ht, ThreadsContext as i, defineToolCallRenderer as it, CopilotChatSuggestionView as j, CopilotChatMessageView as k, useCoAgentStateRenders as l, MCPAppsActivityRenderer as lt, useCopilotMessagesContext as m, CopilotChatAudioRecorder as mt, defaultCopilotContextCategories as n, CopilotKitCoreReact as nt, useThreads as o, SandboxFunctionsContext as ot, CopilotMessagesContext as p, AudioRecorderError as pt, useDefaultRenderTool as q, CoAgentStateRenderBridge as r, useAgentContext as rt, CoAgentStateRendersContext as s, useSandboxFunctions as st, CopilotKit as t, useCopilotKit as tt, useAsyncCallback as u, MCPAppsActivityType as ut, CopilotPopup as v, DefaultCloseIcon as w, CopilotSidebarView as x, CopilotSidebar as y, useThreads$1 as z };
|
|
9970
|
-
//# sourceMappingURL=copilotkit
|
|
10001
|
+
//# sourceMappingURL=copilotkit--McKbFME.mjs.map
|