@pi-kaush/pi-tool-call-markers 0.3.3 → 0.3.4
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/README.md +7 -8
- package/package.json +1 -1
- package/src/index.ts +12 -13
package/README.md
CHANGED
|
@@ -15,17 +15,16 @@ Restart Pi or run `/reload`.
|
|
|
15
15
|
Collapsed tool rows use semantic theme colors with no gear, background fill, box padding, or filled blank rows:
|
|
16
16
|
|
|
17
17
|
```text
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
│ Read
|
|
19
|
+
│ src/a.ts 42 lines
|
|
20
|
+
│ src/b.ts 18 lines
|
|
21
|
+
│
|
|
22
|
+
│ Bash
|
|
23
|
+
│ $: npm test → done
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
- **Two-column outer inset.** Tool markers and image output align with an inset conversation surface. Very narrow terminals reduce the decoration before useful content.
|
|
27
|
-
-
|
|
28
|
-
- **`│` grouped children.** A vertical rail — fainter than the call text — spans the members of a multi-call group; singletons carry no rail.
|
|
27
|
+
- **`│` tool-call rail.** Single calls use a rail beside the summary. Multi-call groups extend it through bold tool-name headings, indented call summaries, and separators between tool types.
|
|
29
28
|
- **Semantic, low-contrast status.** Tool names are emphasized, summaries and settled metadata are muted, pending state is warning-colored, and failures remain error-colored. Ordinary tool states have no background.
|
|
30
29
|
- **Width-safe outcome tails.** Long summaries truncate before useful tails such as `→ done`, `→ 42 lines`, `→ +2/-1`, or a `bash` duration.
|
|
31
30
|
- **Stable running groups.** Adjacent calls group as they appear. Pending state and elapsed `bash` time settle into the final outcome without changing the row count.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,6 @@ import { installInfoVisibility } from "./info-visibility.ts";
|
|
|
19
19
|
import { fgCollapsed, fgCollapsedRail } from "./muted.ts";
|
|
20
20
|
|
|
21
21
|
const OUTER_INSET = 2;
|
|
22
|
-
const GROUP_MARKER = "%";
|
|
23
22
|
const SUBAGENT_MARKER = "↪";
|
|
24
23
|
const GROUP_CALL_MARKER = "│";
|
|
25
24
|
const PRESENTATION_PATCHED = Symbol.for("kg.pi.toolPresentation.v3");
|
|
@@ -933,11 +932,10 @@ function collapsedHeadline(
|
|
|
933
932
|
// Failed rows render entirely in error so the row reads as the one that
|
|
934
933
|
// failed, not just its outcome tail. Only the tool name is bold.
|
|
935
934
|
const tone = rowHasFailed(row) ? "error" : "muted";
|
|
936
|
-
const marker =
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
)} `;
|
|
935
|
+
const marker =
|
|
936
|
+
row.toolName === "subagent"
|
|
937
|
+
? `${fgCollapsed(theme, tone, SUBAGENT_MARKER)} `
|
|
938
|
+
: `${fgCollapsedRail(theme, tone, GROUP_CALL_MARKER)} `;
|
|
941
939
|
const budget = Math.max(1, width - visibleWidth(marker));
|
|
942
940
|
const label = collapsedCallLabel(row, budget, theme, tone);
|
|
943
941
|
const outcome = collapsedOutcome(row, budget, theme);
|
|
@@ -1294,19 +1292,20 @@ function renderGroupedCallLines(
|
|
|
1294
1292
|
const lines: string[] = [];
|
|
1295
1293
|
const toolName = row.toolName ?? "tool";
|
|
1296
1294
|
if (toolName !== previousToolName) {
|
|
1297
|
-
//
|
|
1298
|
-
//
|
|
1299
|
-
//
|
|
1300
|
-
|
|
1301
|
-
|
|
1295
|
+
// Keep the rail unbroken across subgroup spacing and put each bold
|
|
1296
|
+
// tool name beside it. The separator belongs to the new row so
|
|
1297
|
+
// click-routing heights stay aligned with the rendered lines.
|
|
1298
|
+
if (previousToolName !== undefined) {
|
|
1299
|
+
lines.push(fgCollapsedRail(theme, "muted", GROUP_CALL_MARKER));
|
|
1300
|
+
}
|
|
1302
1301
|
lines.push(
|
|
1303
|
-
`${
|
|
1302
|
+
`${fgCollapsedRail(theme, "muted", GROUP_CALL_MARKER)} ${fgCollapsed(theme, "toolTitle", toolName, true)}`,
|
|
1304
1303
|
);
|
|
1305
1304
|
previousToolName = toolName;
|
|
1306
1305
|
}
|
|
1307
1306
|
|
|
1308
1307
|
const color = rowHasFailed(row) ? "error" : "muted";
|
|
1309
|
-
const prefix =
|
|
1308
|
+
const prefix = `${fgCollapsedRail(theme, color, GROUP_CALL_MARKER)} `;
|
|
1310
1309
|
const budget = Math.max(1, width - visibleWidth(prefix));
|
|
1311
1310
|
const label = groupedChildLabel(row, budget, theme, color);
|
|
1312
1311
|
const outcome = collapsedOutcome(row, budget, theme);
|