@copilotkit/react-core 1.56.5-canary.1777983277 → 1.56.5-canary.1777984472
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-BsmznxTd.cjs → copilotkit-BP4xj-n_.cjs} +25 -23
- package/dist/copilotkit-BP4xj-n_.cjs.map +1 -0
- package/dist/{copilotkit-_0iofF5v.mjs → copilotkit-Bbrd6bmt.mjs} +25 -23
- package/dist/copilotkit-Bbrd6bmt.mjs.map +1 -0
- package/dist/{copilotkit-DzIX4TLs.d.cts → copilotkit-BdvkFjRB.d.cts} +14 -8
- package/dist/{copilotkit-DzIX4TLs.d.cts.map → copilotkit-BdvkFjRB.d.cts.map} +1 -1
- package/dist/{copilotkit-3KTrraC5.d.mts → copilotkit-CDvf9E_O.d.mts} +14 -8
- package/dist/{copilotkit-3KTrraC5.d.mts.map → copilotkit-CDvf9E_O.d.mts.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 +25 -23
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/v2/components/intelligence-indicator/IntelligenceIndicator.tsx +52 -52
- package/dist/copilotkit-BsmznxTd.cjs.map +0 -1
- package/dist/copilotkit-_0iofF5v.mjs.map +0 -1
|
@@ -5654,15 +5654,21 @@ const DEFAULT_TOOL_PATTERNS = [/^bash$/];
|
|
|
5654
5654
|
* again here as a defence)
|
|
5655
5655
|
* 2. The message is an assistant message with at least one tool call
|
|
5656
5656
|
* whose name matches {@link DEFAULT_TOOL_PATTERNS}
|
|
5657
|
-
* 3. The message
|
|
5658
|
-
*
|
|
5659
|
-
*
|
|
5660
|
-
* message exists in the same run. Tool result messages
|
|
5657
|
+
* 3. The message is the *latest* such matching-assistant message
|
|
5658
|
+
* anywhere in `agent.messages` — i.e. no later assistant-with-
|
|
5659
|
+
* matching-tool-call message exists. Tool result messages
|
|
5661
5660
|
* (`role: "tool"`) and prose-only assistant messages do NOT
|
|
5662
5661
|
* invalidate this slot, so the pill stays continuously through a
|
|
5663
|
-
* multi-step
|
|
5664
|
-
* tool
|
|
5665
|
-
*
|
|
5662
|
+
* multi-step tool chain instead of flickering off every time a
|
|
5663
|
+
* tool reply arrives.
|
|
5664
|
+
* 4. The phase machine is not yet `hidden` — once a pill has faded
|
|
5665
|
+
* out it stays gone; a subsequent run on the same chat mounts a
|
|
5666
|
+
* fresh pill on its own assistant message rather than resurrecting
|
|
5667
|
+
* this one.
|
|
5668
|
+
* 5. (Run scoping comes for free from `phase === "hidden"` being
|
|
5669
|
+
* sticky after the previous run's fade-out — no `getRunIdForMessage`
|
|
5670
|
+
* lookup is needed, and the indicator stays robust against gaps
|
|
5671
|
+
* in the SDK's run-tracking map.)
|
|
5666
5672
|
*
|
|
5667
5673
|
* Phase machine (per-instance, all timers local):
|
|
5668
5674
|
* - `spinner` while `agent.isRunning`
|
|
@@ -5699,13 +5705,14 @@ function IntelligenceIndicator(props) {
|
|
|
5699
5705
|
}, [agent]);
|
|
5700
5706
|
const [phase, setPhase] = (0, react.useState)(agent.isRunning ? "spinner" : "check");
|
|
5701
5707
|
(0, react.useEffect)(() => {
|
|
5708
|
+
if (phase === "hidden") return void 0;
|
|
5702
5709
|
if (agent.isRunning) {
|
|
5703
5710
|
setPhase("spinner");
|
|
5704
5711
|
return;
|
|
5705
5712
|
}
|
|
5706
5713
|
const t = setTimeout(() => setPhase("check"), RUN_IDLE_DEBOUNCE_MS);
|
|
5707
5714
|
return () => clearTimeout(t);
|
|
5708
|
-
}, [agent.isRunning]);
|
|
5715
|
+
}, [agent.isRunning, phase]);
|
|
5709
5716
|
(0, react.useEffect)(() => {
|
|
5710
5717
|
if (phase !== "check") return void 0;
|
|
5711
5718
|
const t = setTimeout(() => setPhase("fading"), CHECK_HOLD_MS);
|
|
@@ -5724,24 +5731,19 @@ function IntelligenceIndicator(props) {
|
|
|
5724
5731
|
const name = tc?.function?.name;
|
|
5725
5732
|
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5726
5733
|
})) return null;
|
|
5727
|
-
|
|
5728
|
-
if (!messageRunId) return null;
|
|
5729
|
-
let latestRunId;
|
|
5730
|
-
let latestMatchingAssistantIdInRun;
|
|
5734
|
+
let latestMatchingAssistantId;
|
|
5731
5735
|
for (let i = agent.messages.length - 1; i >= 0; i -= 1) {
|
|
5732
5736
|
const m = agent.messages[i];
|
|
5733
|
-
|
|
5734
|
-
if (
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5737
|
+
if (m.role !== "assistant") continue;
|
|
5738
|
+
if ((Array.isArray(m.toolCalls) ? m.toolCalls : []).some((tc) => {
|
|
5739
|
+
const name = tc?.function?.name;
|
|
5740
|
+
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5741
|
+
})) {
|
|
5742
|
+
latestMatchingAssistantId = m.id;
|
|
5743
|
+
break;
|
|
5740
5744
|
}
|
|
5741
|
-
if (latestRunId !== void 0 && latestMatchingAssistantIdInRun !== void 0) break;
|
|
5742
5745
|
}
|
|
5743
|
-
if (
|
|
5744
|
-
if (latestMatchingAssistantIdInRun !== message.id) return null;
|
|
5746
|
+
if (latestMatchingAssistantId !== message.id) return null;
|
|
5745
5747
|
const showSpinner = phase === "spinner";
|
|
5746
5748
|
const isFading = phase === "fading";
|
|
5747
5749
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -10422,4 +10424,4 @@ Object.defineProperty(exports, 'useToast', {
|
|
|
10422
10424
|
return useToast;
|
|
10423
10425
|
}
|
|
10424
10426
|
});
|
|
10425
|
-
//# sourceMappingURL=copilotkit-
|
|
10427
|
+
//# sourceMappingURL=copilotkit-BP4xj-n_.cjs.map
|