@agnishc/edb-compact-tools 0.14.0 → 0.14.1

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
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.14.1] - 2026-05-23
4
+
5
+ ### Changed
6
+ - Remove emoji tool icons from registry. Render tool display name bold in pending shimmer and result top line instead.
7
+
8
+ ### Added
9
+ - `shimmerText` option on `BranchToolBlock` — renders the tool name bold-colored in the top line alongside content.
10
+
3
11
  ## [0.12.0] - 2026-05-22
4
12
 
5
13
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agnishc/edb-compact-tools",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Pi extension: compact outlined tool-call renderers with ctrl+o expansion",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -10,6 +10,7 @@ export class EmptyBlock {
10
10
 
11
11
  export interface BranchToolBlockOptions {
12
12
  pending?: boolean;
13
+ shimmerText?: string;
13
14
  }
14
15
 
15
16
  export class BranchToolBlock {
@@ -51,9 +52,24 @@ export class BranchToolBlock {
51
52
  }
52
53
 
53
54
  private renderTop(content: string, width: number): string {
54
- const prefix = this.options.pending ? this.theme.fg(this.pendingColor(), "● ") : this.color("● ");
55
+ const isPending = this.options.pending;
56
+ const shimmerText = this.options.shimmerText;
57
+ const activeColor = isPending ? this.pendingColor() : undefined;
58
+
59
+ const prefix = activeColor ? this.theme.fg(activeColor, "● ") : this.color("● ");
60
+
61
+ let bodyContent: string;
62
+ if (shimmerText) {
63
+ const coloredName = activeColor
64
+ ? this.theme.fg(activeColor, this.theme.bold(shimmerText))
65
+ : this.color(this.theme.bold(shimmerText));
66
+ bodyContent = `${coloredName} ${content}`;
67
+ } else {
68
+ bodyContent = content;
69
+ }
70
+
55
71
  const contentWidth = Math.max(1, width - visibleWidth("● "));
56
- return `${prefix}${this.fit(content, contentWidth)}`;
72
+ return `${prefix}${this.fit(bodyContent, contentWidth)}`;
57
73
  }
58
74
 
59
75
  private renderBody(content: string, width: number): string {
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { callLabel, isSkillPath, purple, summaryFor, toolColor, toolDisplayName, toolIcon } from "./tool-meta.js";
2
+ import { callLabel, isSkillPath, purple, summaryFor, toolColor, toolDisplayName } from "./tool-meta.js";
3
3
 
4
4
  describe("isSkillPath", () => {
5
5
  it("detects .agents/skills paths", () => {
@@ -68,22 +68,6 @@ describe("toolColor", () => {
68
68
  });
69
69
  });
70
70
 
71
- describe("toolIcon", () => {
72
- it("returns correct icon per tool", () => {
73
- expect(toolIcon("bash")).toBe("⚙️");
74
- expect(toolIcon("read")).toBe("📖");
75
- expect(toolIcon("grep")).toBe("🔎");
76
- expect(toolIcon("find")).toBe("🧭");
77
- expect(toolIcon("ls")).toBe("📁");
78
- expect(toolIcon("edit")).toBe("✏️");
79
- expect(toolIcon("write")).toBe("📝");
80
- });
81
-
82
- it("returns default icon for unknown tools", () => {
83
- expect(toolIcon("unknown")).toBe("🧩");
84
- });
85
- });
86
-
87
71
  describe("toolDisplayName", () => {
88
72
  it("returns polished built-in display names", () => {
89
73
  expect(toolDisplayName("bash")).toBe("Run");
package/src/tool-meta.ts CHANGED
@@ -17,7 +17,6 @@ export function purple(text: string): string {
17
17
 
18
18
  type ToolMeta = {
19
19
  color: string | ((args?: any) => string);
20
- icon: string;
21
20
  displayName: string | ((args?: any) => string);
22
21
  label: (args: any) => string;
23
22
  summary: (result: any) => string;
@@ -26,7 +25,6 @@ type ToolMeta = {
26
25
  const TOOL_REGISTRY: Record<string, ToolMeta> = {
27
26
  bash: {
28
27
  color: "bashMode",
29
- icon: "⚙️",
30
28
  displayName: "Run",
31
29
  label: (args) => clip(oneLine(args?.command), 140),
32
30
  summary: (result) => {
@@ -40,7 +38,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
40
38
  },
41
39
  read: {
42
40
  color: (args) => (isSkillPath(args?.path) ? "purple" : "toolTitle"),
43
- icon: "📖",
44
41
  displayName: "Read",
45
42
  label: (args) => clip(shortenPath(args?.path), 140),
46
43
  summary: (result) => {
@@ -52,7 +49,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
52
49
  },
53
50
  grep: {
54
51
  color: "success",
55
- icon: "🔎",
56
52
  displayName: "Search",
57
53
  label: (args) => {
58
54
  const pattern = oneLine(args?.pattern);
@@ -68,7 +64,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
68
64
  },
69
65
  find: {
70
66
  color: "accent",
71
- icon: "🧭",
72
67
  displayName: "Find",
73
68
  label: (args) => {
74
69
  const pattern = oneLine(args?.pattern);
@@ -84,7 +79,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
84
79
  },
85
80
  ls: {
86
81
  color: "warning",
87
- icon: "📁",
88
82
  displayName: "List",
89
83
  label: (args) => clip(shortenPath(args?.path) || ".", 140),
90
84
  summary: (result) => {
@@ -96,7 +90,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
96
90
  },
97
91
  edit: {
98
92
  color: "toolDiffAdded",
99
- icon: "✏️",
100
93
  displayName: "Edit",
101
94
  label: (args) => {
102
95
  const count = Array.isArray(args?.edits) ? args.edits.length : args?.oldText && args?.newText ? 1 : 0;
@@ -121,7 +114,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
121
114
  },
122
115
  write: {
123
116
  color: "accent",
124
- icon: "📝",
125
117
  displayName: (args) => (pathExists(args?.path ?? args?.file_path) ? "Write" : "Create"),
126
118
  label: (args) => {
127
119
  const bytes = typeof args?.content === "string" ? Buffer.byteLength(args.content, "utf8") : 0;
@@ -138,7 +130,6 @@ const TOOL_REGISTRY: Record<string, ToolMeta> = {
138
130
 
139
131
  const DEFAULT_META: ToolMeta = {
140
132
  color: "accent",
141
- icon: "🧩",
142
133
  displayName: "Tool",
143
134
  label: (args) => {
144
135
  const compactArgs = oneLine(JSON.stringify(args ?? {}));
@@ -161,10 +152,6 @@ export function toolColor(toolName: string, args?: any): string {
161
152
  return typeof color === "function" ? color(args) : color;
162
153
  }
163
154
 
164
- export function toolIcon(toolName: string): string {
165
- return getMeta(toolName).icon;
166
- }
167
-
168
155
  export function toolDisplayName(toolName: string, args?: any): string {
169
156
  const meta = TOOL_REGISTRY[toolName];
170
157
  if (!meta) return toolName;
@@ -3,7 +3,7 @@ import { BranchToolBlock, EmptyBlock } from "./branch-tool-block.js";
3
3
  import { MAX_EXPANDED_LINES } from "./constants.js";
4
4
  import { formatExpandedLines } from "./expanded-lines.js";
5
5
  import { cleanToolOutputText, lineCount, previewLines, textContent } from "./text.js";
6
- import { callLabel, purple, summaryFor, toolColor, toolDisplayName, toolIcon } from "./tool-meta.js";
6
+ import { callLabel, purple, summaryFor, toolColor, toolDisplayName } from "./tool-meta.js";
7
7
  import type { CompactTheme, ToolBlockKind } from "./types.js";
8
8
 
9
9
  // ── Color resolution ─────────────────────────────────────────────
@@ -19,11 +19,8 @@ function makeColorFn(color: string, theme: CompactTheme): (text: string) => stri
19
19
 
20
20
  // ── Line builders ────────────────────────────────────────────────
21
21
 
22
- function topLine(toolName: string, theme: CompactTheme, label: string, args?: any): string {
23
- const color = toolColor(toolName, args);
24
- const title = `${toolIcon(toolName)} ${toolDisplayName(toolName, args)}`;
25
- const coloredTitle = color === "purple" ? purple(theme.bold(title)) : theme.fg(color, theme.bold(title));
26
- return `${coloredTitle} ${theme.fg("toolOutput", label)}`;
22
+ function topLine(_toolName: string, theme: CompactTheme, label: string, _args?: any): string {
23
+ return theme.fg("toolOutput", label);
27
24
  }
28
25
 
29
26
  function midLine(_toolName: string, theme: CompactTheme, text: string): string {
@@ -47,7 +44,7 @@ function toolText(
47
44
  theme: CompactTheme,
48
45
  borderColor: string,
49
46
  args?: any,
50
- options?: { pending?: boolean },
47
+ options?: { pending?: boolean; shimmerText?: string },
51
48
  ): BranchToolBlock {
52
49
  const color = resolveColor(toolName, args, borderColor);
53
50
  return new BranchToolBlock(kind, lines, theme, makeColorFn(color, theme), options);
@@ -79,7 +76,7 @@ export function renderResult(toolName: string, result: any, options: any, theme:
79
76
  theme,
80
77
  "muted",
81
78
  args,
82
- { pending: true },
79
+ { pending: true, shimmerText: toolDisplayName(toolName, args) },
83
80
  );
84
81
  }
85
82
 
@@ -99,7 +96,9 @@ export function renderResult(toolName: string, result: any, options: any, theme:
99
96
  const borderColor = failed ? "error" : toolColor(toolName, args) === "purple" ? "purple" : "success";
100
97
 
101
98
  if (!options?.expanded || !text.trim()) {
102
- return toolText("full", toolName, [top, bottom], theme, borderColor, args);
99
+ return toolText("full", toolName, [top, bottom], theme, borderColor, args, {
100
+ shimmerText: toolDisplayName(toolName, args),
101
+ });
103
102
  }
104
103
 
105
104
  const diff = toolName === "edit" && typeof result?.details?.diff === "string" ? result.details.diff : "";
@@ -111,5 +110,5 @@ export function renderResult(toolName: string, result: any, options: any, theme:
111
110
  }
112
111
  lines.unshift(top);
113
112
  lines.push(bottomLine(toolName, theme, `${theme.fg(statusColor, statusIcon)} ${theme.fg("toolOutput", summary)}`));
114
- return toolText("full", toolName, lines, theme, borderColor, args);
113
+ return toolText("full", toolName, lines, theme, borderColor, args, { shimmerText: toolDisplayName(toolName, args) });
115
114
  }