@herbertgao/pi-subagents 0.22.0-local.1 → 0.22.0-local.2

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.0-local.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#306](https://github.com/HerbertGao/pi-extensions/pull/306) [`935acc3`](https://github.com/HerbertGao/pi-extensions/commit/935acc38af54c76b6924bb48a0b09d2c59e4997f) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Label a run with its own `name` in the agent widget, the expanded agent block, the fleet list, the conversation header, and the Agent tool row, keeping its type's badge color. `agency_dispatch` now reports per-run duration, tool uses, and tokens in both its text and its structured result, and reports none of them for a run handed off to the background.
8
+
3
9
  ## 0.22.0-local.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-subagents",
3
- "version": "0.22.0-local.1",
3
+ "version": "0.22.0-local.2",
4
4
  "description": "Claude Code-style autonomous subagents and workflow orchestration for Pi, with HerbertGao-maintained UI extensions.",
5
5
  "keywords": [
6
6
  "agent",
@@ -192,8 +192,17 @@ export function renderAgentName(
192
192
  type: string | undefined,
193
193
  theme: AgentNameTheme,
194
194
  style: AgentNameStyle = {},
195
+ /** A run's own name, which outranks its type's label while keeping the type's color. */
196
+ label?: string,
195
197
  ): string {
196
- if (!type) return renderAgentNameLabel("Agent", undefined, theme, style)
198
+ if (!type) {
199
+ return renderAgentNameLabel(label ?? "Agent", undefined, theme, style)
200
+ }
197
201
  const config = getConfig(type)
198
- return renderAgentNameLabel(config.displayName, config.color, theme, style)
202
+ return renderAgentNameLabel(
203
+ label ?? config.displayName,
204
+ config.color,
205
+ theme,
206
+ style,
207
+ )
199
208
  }
package/src/index.ts CHANGED
@@ -2280,11 +2280,16 @@ Terse command-style prompts produce shallow, generic work.
2280
2280
  )
2281
2281
  : ""
2282
2282
  const desc = args.description ?? ""
2283
- const name = renderAgentName(args.subagent_type, theme, {
2284
- fallbackColor: "toolTitle",
2285
- restoreBackground: rowBackground,
2286
- bold: true,
2287
- })
2283
+ const name = renderAgentName(
2284
+ args.subagent_type,
2285
+ theme,
2286
+ {
2287
+ fallbackColor: "toolTitle",
2288
+ restoreBackground: rowBackground,
2289
+ bold: true,
2290
+ },
2291
+ args.name,
2292
+ )
2288
2293
  return new Text(
2289
2294
  rowBackground +
2290
2295
  "▸ " +
@@ -441,6 +441,7 @@ export class AgentWidget {
441
441
  startedAt: number
442
442
  completedAt?: number
443
443
  error?: string
444
+ alias?: string
444
445
  lifetimeUsage?: LifetimeUsage
445
446
  },
446
447
  theme: Theme,
@@ -484,7 +485,7 @@ export class AgentWidget {
484
485
  parts.push(duration)
485
486
 
486
487
  const modeTag = modeLabel ? ` ${theme.fg("dim", `(${modeLabel})`)}` : ""
487
- return `${icon} ${renderAgentName(a.type, theme, { fallbackColor: "dim" })}${modeTag} ${theme.fg("dim", a.description)} ${theme.fg("dim", "·")} ${theme.fg("dim", parts.join(" · "))}${statusText}`
488
+ return `${icon} ${renderAgentName(a.type, theme, { fallbackColor: "dim" }, a.alias)}${modeTag} ${theme.fg("dim", a.description)} ${theme.fg("dim", "·")} ${theme.fg("dim", parts.join(" · "))}${statusText}`
488
489
  }
489
490
 
490
491
  /**
@@ -579,7 +580,7 @@ export class AgentWidget {
579
580
  runningLines.push([
580
581
  truncate(
581
582
  theme.fg("dim", "├─") +
582
- ` ${theme.fg("accent", frame)} ${renderAgentName(a.type, theme, { bold: true })}${modeTag} ${theme.fg("muted", a.description)} ${theme.fg("dim", "·")} ${fgPreservingNestedStyles(theme, "dim", statsText)}`,
583
+ ` ${theme.fg("accent", frame)} ${renderAgentName(a.type, theme, { bold: true }, a.alias)}${modeTag} ${theme.fg("muted", a.description)} ${theme.fg("dim", "·")} ${fgPreservingNestedStyles(theme, "dim", statsText)}`,
583
584
  ),
584
585
  truncate(theme.fg("dim", "│ ") + theme.fg("dim", ` ⎿ ${activity}`)),
585
586
  ])
@@ -594,7 +594,7 @@ export class ConversationViewer implements Component, Focusable {
594
594
 
595
595
  lines.push(
596
596
  row(
597
- `${statusIcon} ${renderAgentName(this.record.type, th, { bold: true })}${modeTag} ${th.fg("muted", this.record.description)} ${th.fg("dim", "·")} ${fgPreservingNestedStyles(th, "dim", headerParts.join(" · "))}`,
597
+ `${statusIcon} ${renderAgentName(this.record.type, th, { bold: true }, this.record.alias)}${modeTag} ${th.fg("muted", this.record.description)} ${th.fg("dim", "·")} ${fgPreservingNestedStyles(th, "dim", headerParts.join(" · "))}`,
598
598
  ),
599
599
  )
600
600
  const invocationLine = this.invocationLine()
@@ -657,6 +657,7 @@ export class FleetList {
657
657
  selected
658
658
  ? { fallbackColor: "text", bold: hasAgentBadge(record.type) }
659
659
  : { fallbackColor: "muted" },
660
+ record.alias,
660
661
  )
661
662
  const description = selected
662
663
  ? theme.fg("text", record.description)