@copilotkit/react-core 1.56.5-canary.1777972218 → 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-BGIsblrk.cjs → copilotkit-BP4xj-n_.cjs} +30 -17
- package/dist/copilotkit-BP4xj-n_.cjs.map +1 -0
- package/dist/{copilotkit-BVK_b6St.mjs → copilotkit-Bbrd6bmt.mjs} +30 -17
- package/dist/copilotkit-Bbrd6bmt.mjs.map +1 -0
- package/dist/{copilotkit-Bc7kZ72T.d.cts → copilotkit-BdvkFjRB.d.cts} +18 -6
- package/dist/{copilotkit-Bc7kZ72T.d.cts.map → copilotkit-BdvkFjRB.d.cts.map} +1 -1
- package/dist/{copilotkit-DV9LwRgi.d.mts → copilotkit-CDvf9E_O.d.mts} +18 -6
- package/dist/{copilotkit-DV9LwRgi.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 +30 -16
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/v2/components/intelligence-indicator/IntelligenceIndicator.tsx +57 -28
- package/dist/copilotkit-BGIsblrk.cjs.map +0 -1
- package/dist/copilotkit-BVK_b6St.mjs.map +0 -1
|
@@ -5652,11 +5652,23 @@ const DEFAULT_TOOL_PATTERNS = [/^bash$/];
|
|
|
5652
5652
|
* 1. `copilotkit.intelligence !== undefined` (Intelligence runtime
|
|
5653
5653
|
* is configured; checked by the parent before mounting, and
|
|
5654
5654
|
* again here as a defence)
|
|
5655
|
-
* 2. The message is
|
|
5656
|
-
*
|
|
5657
|
-
*
|
|
5658
|
-
*
|
|
5659
|
-
*
|
|
5655
|
+
* 2. The message is an assistant message with at least one tool call
|
|
5656
|
+
* whose name matches {@link DEFAULT_TOOL_PATTERNS}
|
|
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
|
|
5660
|
+
* (`role: "tool"`) and prose-only assistant messages do NOT
|
|
5661
|
+
* invalidate this slot, so the pill stays continuously through a
|
|
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.)
|
|
5660
5672
|
*
|
|
5661
5673
|
* Phase machine (per-instance, all timers local):
|
|
5662
5674
|
* - `spinner` while `agent.isRunning`
|
|
@@ -5693,13 +5705,14 @@ function IntelligenceIndicator(props) {
|
|
|
5693
5705
|
}, [agent]);
|
|
5694
5706
|
const [phase, setPhase] = (0, react.useState)(agent.isRunning ? "spinner" : "check");
|
|
5695
5707
|
(0, react.useEffect)(() => {
|
|
5708
|
+
if (phase === "hidden") return void 0;
|
|
5696
5709
|
if (agent.isRunning) {
|
|
5697
5710
|
setPhase("spinner");
|
|
5698
5711
|
return;
|
|
5699
5712
|
}
|
|
5700
5713
|
const t = setTimeout(() => setPhase("check"), RUN_IDLE_DEBOUNCE_MS);
|
|
5701
5714
|
return () => clearTimeout(t);
|
|
5702
|
-
}, [agent.isRunning]);
|
|
5715
|
+
}, [agent.isRunning, phase]);
|
|
5703
5716
|
(0, react.useEffect)(() => {
|
|
5704
5717
|
if (phase !== "check") return void 0;
|
|
5705
5718
|
const t = setTimeout(() => setPhase("fading"), CHECK_HOLD_MS);
|
|
@@ -5718,19 +5731,19 @@ function IntelligenceIndicator(props) {
|
|
|
5718
5731
|
const name = tc?.function?.name;
|
|
5719
5732
|
return typeof name === "string" && DEFAULT_TOOL_PATTERNS.some((p) => p.test(name));
|
|
5720
5733
|
})) return null;
|
|
5721
|
-
|
|
5722
|
-
if (!messageRunId) return null;
|
|
5723
|
-
let latestRunId;
|
|
5724
|
-
let lastMessageIdInThisRun;
|
|
5734
|
+
let latestMatchingAssistantId;
|
|
5725
5735
|
for (let i = agent.messages.length - 1; i >= 0; i -= 1) {
|
|
5726
5736
|
const m = agent.messages[i];
|
|
5727
|
-
|
|
5728
|
-
if (
|
|
5729
|
-
|
|
5730
|
-
|
|
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;
|
|
5744
|
+
}
|
|
5731
5745
|
}
|
|
5732
|
-
if (
|
|
5733
|
-
if (lastMessageIdInThisRun !== message.id) return null;
|
|
5746
|
+
if (latestMatchingAssistantId !== message.id) return null;
|
|
5734
5747
|
const showSpinner = phase === "spinner";
|
|
5735
5748
|
const isFading = phase === "fading";
|
|
5736
5749
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -10411,4 +10424,4 @@ Object.defineProperty(exports, 'useToast', {
|
|
|
10411
10424
|
return useToast;
|
|
10412
10425
|
}
|
|
10413
10426
|
});
|
|
10414
|
-
//# sourceMappingURL=copilotkit-
|
|
10427
|
+
//# sourceMappingURL=copilotkit-BP4xj-n_.cjs.map
|