@pi-kaush/pi-tool-call-markers 0.2.5 → 0.2.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Group consecutive tool blocks under one `%` marker with per-tool sub-headings and nested sub-bullets, dropping the blank lines between tool sections (F25's compact goal, with the hierarchy that makes it readable).
5
6
  - Render subagent calls as an unboxed plan — `% subagent` heading with chain/parallel counts and numbered steps as they execute, agent names in accent with emojis scraped from the native plan component (args fallback) — replacing the accent-rail card; failed subagents follow the full-red failure tone.
6
7
  - Strip display sequences and control bytes (notably `\r` from progress writers like git) from collapsed-row text so command output cannot return the cursor to column 0 and overwrite the row.
7
8
  - Color the truncation ellipsis to match its row tone (`muted` settled, `error` failed) instead of the terminal default foreground left by pi-tui's truncation reset.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-kaush/pi-tool-call-markers",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Compact and group Pi tool calls, with a bundled extension for adjacent thinking blocks.",
5
5
  "license": "MIT",
6
6
  "author": "Kaushik Gopal",
package/src/index.ts CHANGED
@@ -1075,8 +1075,9 @@ function compactBulletLine(
1075
1075
  width: number,
1076
1076
  theme: ThemeLike,
1077
1077
  color = "muted",
1078
+ indentSpaces = 2,
1078
1079
  ): string {
1079
- const prefix = ` ${theme.fg(color, "•")} `;
1080
+ const prefix = `${" ".repeat(indentSpaces)}${theme.fg(color, "•")} `;
1080
1081
  const indent = visibleWidth(prefix);
1081
1082
  if (width <= indent) return truncateToWidth(prefix, width, "", false);
1082
1083
  const available = width - indent;
@@ -1094,22 +1095,34 @@ function groupedCallComponent(
1094
1095
  ): ComponentLike {
1095
1096
  return {
1096
1097
  render(width: number): string[] {
1097
- const lines: string[] = [];
1098
+ // One marker for the whole consecutive block; each tool run gets a
1099
+ // sub-heading, and calls nest one level deeper as sub-bullets. No blank
1100
+ // lines inside the block — the hierarchy carries the separation.
1101
+ const lines: string[] = [
1102
+ truncateToWidth(
1103
+ theme.fg("muted", theme.bold(GROUP_MARKER)),
1104
+ width,
1105
+ "",
1106
+ false,
1107
+ ),
1108
+ ];
1098
1109
  let previousToolName: string | undefined;
1099
1110
  for (const row of rows) {
1100
- if (lines.length === 0 || row.toolName !== previousToolName) {
1101
- if (lines.length > 0) lines.push("");
1111
+ if (row.toolName !== previousToolName) {
1102
1112
  const token =
1103
1113
  row.toolName === "bash" ? "$" : (row.toolName ?? "tool");
1104
- const heading = `${theme.fg(
1105
- "muted",
1106
- theme.bold(GROUP_MARKER),
1107
- )} ${theme.fg("muted", theme.bold(token))}`;
1108
- lines.push(truncateToWidth(heading, width, "", false));
1114
+ lines.push(
1115
+ truncateToWidth(
1116
+ ` ${theme.fg("muted", theme.bold(token))}`,
1117
+ width,
1118
+ "",
1119
+ false,
1120
+ ),
1121
+ );
1109
1122
  previousToolName = row.toolName;
1110
1123
  }
1111
1124
  const color = rowHasFailed(row) ? "error" : "muted";
1112
- const call = renderedCallSummary(row, Math.max(1, width - 4), theme);
1125
+ const call = renderedCallSummary(row, Math.max(1, width - 6), theme);
1113
1126
  const outcome = renderedGroupedOutcome(row, theme);
1114
1127
  lines.push(
1115
1128
  compactBulletLine(
@@ -1118,6 +1131,7 @@ function groupedCallComponent(
1118
1131
  width,
1119
1132
  theme,
1120
1133
  color,
1134
+ 4,
1121
1135
  ),
1122
1136
  );
1123
1137
  }