pi-session-subagents 0.2.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0](https://github.com/rbajaj1997/pi-session-subagents/compare/v0.2.0...v0.3.0) (2026-11-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * show cumulative cost in the subagent inspector ([#6](https://github.com/rbajaj1997/pi-session-subagents/issues/6)) ([40f46ab](https://github.com/rbajaj1997/pi-session-subagents/commit/40f46abfb96218cd51caf50d53f2064a19b08c78))
9
+
3
10
  ## [0.2.0](https://github.com/rbajaj1997/pi-session-subagents/compare/v0.1.1...v0.2.0) (2026-11-16)
4
11
 
5
12
 
package/README.md CHANGED
@@ -133,6 +133,8 @@ For longer results, call `inspect_subagent` with `includeResult: true`, the repo
133
133
 
134
134
  The main widget and the inspector need the interactive TUI. In RPC mode, use `list_subagents` and `inspect_subagent`. The main widget shows worker status and activity. In fullscreen mode, Pi's default, click a worker in the widget to open its inspector. In regular mode the terminal handles the mouse, so use `/subagents:inspect [name]`. The inspector renders the worker's full session branch, including messages before compaction, with Pi's native assistant, user, custom-message, tool, and summary components. Tool cards use registered renderers, including edit diffs. Inline tool images are off in the inspector.
135
135
 
136
+ The header shows elapsed time for the current or most recent assignment in whole minutes (`<1m` for the first minute). The cost at the end, for example `~$0.123 total`, is Pi’s estimate across all assignments in that worker session, not a billing total.
137
+
136
138
  - Arrows or `j`/`k` scroll. PageUp/PageDown page. Home/End jump.
137
139
  - Scrolling up pauses following. End resumes it.
138
140
  - Mouse-wheel scrolling and native click controls work in fullscreen mode.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-session-subagents",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Session-scoped subagents for Pi with idle workers, steering, and native transcript inspection.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@ import {
25
25
  type TuiMouseEventResult,
26
26
  truncateToWidth,
27
27
  } from "@earendil-works/pi-tui";
28
- import { clip, formatDuration, formatTokens, shortModelLabel } from "../text";
28
+ import { clip, formatTokens, shortModelLabel } from "../text";
29
29
  import type { Worker } from "../worker";
30
30
  import { dismissOnOutsideClick } from "./outside-click";
31
31
 
@@ -79,6 +79,7 @@ class ConversationViewer implements Component {
79
79
  private readonly tools = new Map<string, ToolView>();
80
80
  private readonly unsubscribe: () => void;
81
81
  private leafId: string | null | undefined;
82
+ private sessionCost: { entryCount: number; total: number } | undefined;
82
83
  private streaming: AssistantMessageComponent | undefined;
83
84
  private scrollOffset = 0;
84
85
  private autoScroll = true;
@@ -226,13 +227,20 @@ class ConversationViewer implements Component {
226
227
  const maxScroll = Math.max(0, this.contentHeight - this.viewportHeight);
227
228
  this.scrollOffset = this.autoScroll ? maxScroll : Math.min(this.scrollOffset, maxScroll);
228
229
  const run = this.worker.stats();
230
+ const minutes = Math.floor(run.durationMs / 60_000);
231
+ const session = this.worker.session;
232
+ const entryCount = session.sessionManager.getEntryCount();
233
+ // Pi totals cost across all entries, even those outside the current branch.
234
+ if (this.sessionCost?.entryCount !== entryCount) {
235
+ this.sessionCost = { entryCount, total: session.getSessionStats().cost };
236
+ }
229
237
  const stats = [
230
238
  shortModelLabel(this.worker.info.modelLabel),
231
239
  this.worker.status,
232
- `⟳${run.turns}`,
233
240
  `${run.toolUses} tools`,
234
241
  formatTokens(run.tokens),
235
- formatDuration(run.durationMs),
242
+ minutes > 0 ? `${minutes}m` : "<1m",
243
+ `~$${this.sessionCost.total.toFixed(3)} total`,
236
244
  ].join(" · ");
237
245
  const border = (text: string) => this.theme.fg("borderAccent", text);
238
246
  const rule = (left: string, right: string) => border(`${left}${"─".repeat(width - 2)}${right}`);