@deathbeam/pi-delegate 0.0.48 → 0.0.49

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/format.ts +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deathbeam/pi-delegate",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "Minimal extension for delegating tasks to subagents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/format.ts CHANGED
@@ -159,9 +159,8 @@ export function toolCallDetail(toolName: string, args: unknown): string {
159
159
  }
160
160
 
161
161
  /** Caps a preview at `maxLines`; callers report the hidden count their own way. */
162
- export function capLines<T>(lines: T[], maxLines: number): { shown: T[]; hidden: number } {
163
- if (lines.length <= maxLines) return { shown: lines, hidden: 0 };
164
- return { shown: lines.slice(0, maxLines), hidden: lines.length - maxLines };
162
+ export function capLines<T>(lines: readonly T[], maxLines: number): { shown: T[]; hidden: number } {
163
+ return { shown: lines.slice(0, maxLines), hidden: Math.max(0, lines.length - maxLines) };
165
164
  }
166
165
 
167
166
  /** Close dangling Markdown fences so collapsed previews render correctly. */