pi-bar 0.3.17 → 0.3.19

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 CHANGED
@@ -9,7 +9,7 @@
9
9
  claude-opus-4.7 ❯ think:med ❯ 2.6% / 1.0M ❯ Inspecting package structure ❯ plan:active
10
10
  ```
11
11
 
12
- ![pi-bar screenshot, three rows showing green, yellow, and red context usage](https://cdn.jsdelivr.net/npm/pi-bar@0.3.17/assets/screenshot.png)
12
+ ![pi-bar screenshot, three rows showing green, yellow, and red context usage](https://cdn.jsdelivr.net/npm/pi-bar@0.3.19/assets/screenshot.png)
13
13
 
14
14
  ## Why use it?
15
15
 
@@ -48,7 +48,7 @@ Allowed segments are `model`, `thinking`, `context`, `tldr`, and `extensions`. T
48
48
 
49
49
  ### Configure live TLDR
50
50
 
51
- pi-bar shows a concise live TLDR of the current task in the footer. It generates TLDRs from recent prompt, assistant, and deterministic code-compressed tool facts (for example `bash ... ok`, `grep ... 4 matches`, or `edit file`). It resets when you navigate the session tree so stale summaries do not follow you across branches. Set `PI_BAR_SHOW` without `tldr` to hide it.
51
+ pi-bar shows a concise live TLDR of the current task in the footer. It generates TLDRs from recent prompt, assistant, and deterministic code-compressed tool facts (for example `bash ... ok`, `grep ... 4 matches`, `read file`, or `custom_tool key=value ok`). It resets when you navigate the session tree so stale summaries do not follow you across branches. Set `PI_BAR_SHOW` without `tldr` to hide it.
52
52
 
53
53
  Override the TLDR model with:
54
54
 
@@ -308,6 +308,24 @@ function compactValue(value: unknown, maxChars: number): string | undefined {
308
308
  return text ? truncateText(compactText(text), maxChars) : undefined;
309
309
  }
310
310
 
311
+ function compactInputArgs(input: Record<string, unknown>, maxChars: number): string | undefined {
312
+ const args = Object.entries(input)
313
+ .sort(([a], [b]) => a.localeCompare(b))
314
+ .map(([key, value]) => {
315
+ const formatted = compactValue(value, 80);
316
+ return formatted ? `${key}=${formatted}` : undefined;
317
+ })
318
+ .filter((arg): arg is string => Boolean(arg));
319
+
320
+ let result = "";
321
+ for (const arg of args) {
322
+ const next = result ? `${result} ${arg}` : arg;
323
+ if (next.length > maxChars) break;
324
+ result = next;
325
+ }
326
+ return result || undefined;
327
+ }
328
+
311
329
  function compactToolInput(toolName: string, input: Record<string, unknown> | undefined): string {
312
330
  if (!input) return toolName;
313
331
 
@@ -334,14 +352,7 @@ function compactToolInput(toolName: string, input: Record<string, unknown> | und
334
352
  case "ls":
335
353
  return path ? `ls ${path}` : "ls";
336
354
  default: {
337
- const args = Object.entries(input)
338
- .slice(0, 3)
339
- .map(([key, value]) => {
340
- const formatted = compactValue(value, 80);
341
- return formatted ? `${key}=${formatted}` : undefined;
342
- })
343
- .filter(Boolean)
344
- .join(" ");
355
+ const args = compactInputArgs(input, 240);
345
356
  return args ? `${toolName} ${args}` : toolName;
346
357
  }
347
358
  }
@@ -377,7 +388,7 @@ function summarizeToolResult(
377
388
  case "bash":
378
389
  return undefined;
379
390
  case "read":
380
- return path ? `${lineCount || "file"} lines from ${path}` : undefined;
391
+ return path ? `read ${path}` : undefined;
381
392
  case "edit":
382
393
  return path ? `edited ${path}` : undefined;
383
394
  case "write":
@@ -389,7 +400,7 @@ function summarizeToolResult(
389
400
  case "ls":
390
401
  return lineCount ? `${lineCount} entries` : undefined;
391
402
  default:
392
- return lineCount ? `${lineCount} output lines` : undefined;
403
+ return undefined;
393
404
  }
394
405
  }
395
406
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bar",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "Pi footer/statusline showing active model, thinking level, context pressure, live TLDR, and extension statuses.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -51,6 +51,6 @@
51
51
  "extensions": [
52
52
  "./extensions/status-footer.ts"
53
53
  ],
54
- "image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.17/assets/screenshot.png"
54
+ "image": "https://cdn.jsdelivr.net/npm/pi-bar@0.3.19/assets/screenshot.png"
55
55
  }
56
56
  }