@yusukeshib/pi-babysit 0.6.11 → 0.6.12

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 (3) hide show
  1. package/README.md +2 -1
  2. package/index.ts +8 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -89,7 +89,8 @@ arrows to page. Collapsed rows occupy one line, previewing the command for
89
89
  processes and the task for agents (with `…` when clipped). Click a row for the
90
90
  complete wrapped command or task; agent rows also show their RPC worker launch
91
91
  argv (bold, readable text rather than a copy-paste shell command), and up to 20
92
- output lines. Opening another row closes the previous
92
+ output lines. Expanded output lines wrap without a 100-character cutoff.
93
+ Opening another row closes the previous
93
94
  one. A session with no available output shows an explicit placeholder when
94
95
  expanded. Mouse clicks
95
96
  require fullscreen mode; `/babysit` works in regular mode. The displayed `age`
package/index.ts CHANGED
@@ -2369,7 +2369,6 @@ function renderWidgetSessionHeader(
2369
2369
  // How many trailing output lines to show per session in the widget.
2370
2370
  const WIDGET_COLLAPSED_TAIL_LINES = 1;
2371
2371
  const WIDGET_EXPANDED_TAIL_LINES = 20;
2372
- const WIDGET_TAIL_WIDTH = 100;
2373
2372
  const WIDGET_SESSION_PAGE_SIZE = 10;
2374
2373
 
2375
2374
  export interface WidgetSessionListState {
@@ -2422,14 +2421,14 @@ export function createWidgetComponent(
2422
2421
  );
2423
2422
  const target = session.expandable ? { type: "session" as const, id: session.id } : undefined;
2424
2423
  const details = session.details ?? [];
2425
- const pushDetail = (detail: string) => {
2426
- const text = detail.startsWith("task: ") ? detail.slice(6) : detail;
2427
- if (width > 6) {
2428
- for (const line of wrapTextWithAnsi(text, width - 6)) push(` ${line}`, target);
2429
- } else {
2430
- push(` ${text}`, target);
2424
+ const pushWrapped = (text: string) => {
2425
+ const indent = width > 6 ? " " : "";
2426
+ for (const line of wrapTextWithAnsi(text, Math.max(1, width - indent.length))) {
2427
+ push(`${indent}${line}`, target);
2431
2428
  }
2432
2429
  };
2430
+ const pushDetail = (detail: string) =>
2431
+ pushWrapped(detail.startsWith("task: ") ? detail.slice(6) : detail);
2433
2432
  if (!expanded && details.length) {
2434
2433
  const preview = details[0].startsWith("task: ") ? details[0].slice(6) : details[0];
2435
2434
  push(`${session.header} ${preview}`, target, "…");
@@ -2438,7 +2437,7 @@ export function createWidgetComponent(
2438
2437
  } else {
2439
2438
  push(session.header, target);
2440
2439
  for (const detail of details) pushDetail(detail);
2441
- for (const line of tail) push(` ${line}`, target);
2440
+ for (const line of tail) pushWrapped(line);
2442
2441
  if (expanded && tail.length === 0) push(" (no output available)", target);
2443
2442
  }
2444
2443
  };
@@ -2524,7 +2523,7 @@ function sanitizeTailLine(s: string): string {
2524
2523
  .replace(/\x1b[@-Z\\-_]|\x1b\[[0-?]*[ -/]*[@-~]/g, "")
2525
2524
  // remaining non-printable control chars (keep tab)
2526
2525
  .replace(/[\x00-\x08\x0b-\x1f\x7f]/g, "");
2527
- return clean.length > WIDGET_TAIL_WIDTH ? `${clean.slice(0, WIDGET_TAIL_WIDTH - 1)}…` : clean;
2526
+ return clean;
2528
2527
  }
2529
2528
 
2530
2529
  function readTailLines(file: string, lines: number, maxBytes = 64_000): string[] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yusukeshib/pi-babysit",
3
- "version": "0.6.11",
3
+ "version": "0.6.12",
4
4
  "description": "Run any shell command and pi subagents under babysit, with context-safe captured output.",
5
5
  "keywords": [
6
6
  "pi-package",