@ferris1225/pi-subagents 0.23.0 → 0.24.0

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 +7 -15
  2. package/package.json +1 -1
  3. package/src/index.ts +18 -20
package/README.md CHANGED
@@ -459,25 +459,17 @@ The package has no runtime dependencies beyond pi peer dependencies.
459
459
  ## Acknowledgments
460
460
 
461
461
  - The official [pi subagent example](https://github.com/earendil-works/pi)
462
- (`examples/extensions/subagent`) — this extension's child-process dispatch and
463
- event-stream handling are adapted from it.
464
- - [nicobailon/pi-subagents](https://github.com/nicobailon/pi-subagents) — the most
465
- widely used pi sub-agent extension; its async delegation model and result
466
- truncation/artifact handling directly informed this project.
467
- - [tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) — Claude Code-
468
- style sub-agents for pi with parallel execution and a live widget; this project's
469
- widget and parallel fan-out follow the same ideas.
470
- - [amosblomqvist/pi-subagents](https://github.com/amosblomqvist/pi-subagents) — a
471
- clean, minimal reference for markdown-defined agents in pi.
472
- - [edxeth/pi-subagents](https://github.com/edxeth/pi-subagents) — multi-agent
473
- coordination patterns (background agents, child-to-parent messaging) that are
474
- worth borrowing from.
462
+ (`examples/extensions/subagent`) — the child-process dispatch and
463
+ event-stream handling build on it.
464
+ - [tintinweb/pi-subagents](https://github.com/tintinweb/pi-subagents) — the
465
+ live widget (two lines per run: header + quiet gray activity row) and
466
+ parallel fan-out follow its design.
475
467
  - The sub-agent pattern itself, popularized by
476
468
  [Claude Code](https://github.com/anthropics/claude-code): role-specialized
477
469
  agents that receive self-contained briefs.
478
470
 
479
- The agent prompts and extension code are written independently for this project;
480
- the projects above served as design references.
471
+ The agent prompts and extension code are written independently for this
472
+ project; the projects above served as design references.
481
473
 
482
474
  ## License
483
475
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferris1225/pi-subagents",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Focused sub-agent delegation for pi: explore / worker / reviewer agents in isolated context, with proactive dispatch injection and per-agent model selection.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import { getAgentDir, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
16
- import { Text } from "@earendil-works/pi-tui";
16
+ import { Text, truncateToWidth } from "@earendil-works/pi-tui";
17
17
  import { Type } from "typebox";
18
18
  import { discoverAgents, type AgentConfig } from "./agents.ts";
19
19
  import { BackgroundTaskQueue } from "./background.ts";
@@ -52,7 +52,6 @@ import {
52
52
  formatToolActivity,
53
53
  formatUsageCompact,
54
54
  monitor,
55
- rightAlign,
56
55
  statusIcon,
57
56
  statusLabel,
58
57
  type RunChainMeta,
@@ -799,14 +798,13 @@ export default function (pi: ExtensionAPI): void {
799
798
  // their parent reviewer. Their relationLabel ("fix round 1") is more
800
799
  // distinguishing than the repeated worker/reviewer name.
801
800
  const name = isChain ? (r.relationLabel ?? r.agent) : r.agent;
802
- // Header row stays short: icon, run id, agent name the task summary
803
- // (keys-only fragments: paths, symbols, quoted phrases) gets its own
804
- // line below with a full width budget, so parallel runs of the SAME
805
- // agent are still distinguishable at a glance.
806
- const title = formatTaskSummary(r.task, Math.max(16, Math.floor(width * 0.65)), true);
807
- // Hierarchy: top-level agent names are the visual anchor (accent +
808
- // bold); chain nodes and all metadata stay quiet, so the widget reads
809
- // top-down: roots → their branches → the fine print.
801
+ // Two lines per run: the header row (icon, run id, agent name) and the
802
+ // live activity branch below. The task summary is deliberately not
803
+ // shown the task lives in the tool result, and the agent name plus
804
+ // what it is doing right now is enough to tell runs apart. The header
805
+ // stays exactly as it was (accent name, dim stats), matching the
806
+ // referenced sub-agent widgets (tintinweb): the running indicator
807
+ // uses the accent color, everything else is quiet.
810
808
  if (!isChain && lines.length > 0) lines.push("");
811
809
  const nodeBranch = isChain ? (chainContinues ? "├─ " : "└─ ") : "";
812
810
  const left = `${dim(nodeBranch)}${icon} ${dim(`#${r.id}`)} ${isChain ? name : theme.fg("accent", theme.bold(name))}`;
@@ -827,20 +825,20 @@ export default function (pi: ExtensionAPI): void {
827
825
  const state = deriveActivityState(r, now);
828
826
  if (state) metaParts.push(activityStateLabel(state));
829
827
  if (r.annotation) metaParts.push(r.annotation);
828
+ // Metadata trails the header in dim — quiet, never competing with the
829
+ // accent agent name (the same restraint the referenced widgets use).
830
+ // Trailing with a single " · " chain keeps the row compact (no center
831
+ // gap); compactLine clips on overflow, never the right side on its own.
830
832
  const right = metaParts.length ? dim(` · ${metaParts.join(" · ")}`) : "";
831
833
  lines.push(compactLine(left, right, width));
832
834
 
833
- // Branches hang off the node's content column; chain nodes that still
834
- // have siblings carry a "│" continuation down to the last one.
835
- const continuation = isChain ? (chainContinues ? "│ " : " ") : "";
836
- // Task summary is the first branch; the summary itself is plain text —
837
- // no accent, so it never competes with the agent name or pi's own UI.
838
- lines.push(
839
- rightAlign(`${continuation}${dim(hasActivity ? "├─ " : "└─ ")}${dim("title: ")}${theme.fg("text", title)}`, "", width),
840
- );
841
- // Current activity is the last branch, only while the run is active.
835
+ // Current activity ("read src/index.ts", "bash npm test") is the only
836
+ // branch: gray, so it never competes with the agent name or pi's own
837
+ // UI. Chain nodes that still have siblings carry a "" continuation
838
+ // down to the last one.
842
839
  if (hasActivity) {
843
- lines.push(rightAlign(`${continuation}${dim("└─ ")}${dim(activity)}`, "", width));
840
+ const continuation = isChain ? (chainContinues ? "│ " : " ") : "";
841
+ lines.push(truncateToWidth(`${continuation}${dim("└─ ")}${dim(activity)}`, width));
844
842
  }
845
843
  }
846
844
  return lines;