@herbertgao/pi-extensions 2026.11.8 → 2026.11.10

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 (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +9 -9
  3. package/THIRD_PARTY_NOTICES.md +2 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +6 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +8 -6
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +8 -6
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +12 -0
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +36 -13
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +4 -8
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +7 -2
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +115 -6
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +47 -15
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/startup-header.ts +3 -18
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +27 -8
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +6 -1
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +30 -17
  17. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +4 -21
  18. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +13 -0
  19. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +3 -13
  20. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-mode.ts +34 -7
  21. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +25 -0
  22. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/keybindings.ts +75 -0
  23. package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
  24. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  25. package/node_modules/@herbertgao/pi-subagents/README.md +26 -17
  26. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +1 -1
  27. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  28. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +71 -8
  29. package/node_modules/@herbertgao/pi-subagents/src/index.ts +83 -34
  30. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +18 -0
  31. package/node_modules/@herbertgao/pi-subagents/src/types.ts +10 -0
  32. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-tree.ts +47 -0
  33. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +7 -5
  34. package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +211 -47
  35. package/node_modules/@narumitw/pi-btw/CHANGELOG.md +7 -0
  36. package/node_modules/@narumitw/pi-btw/package.json +2 -2
  37. package/node_modules/@narumitw/pi-caffeinate/CHANGELOG.md +7 -0
  38. package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
  39. package/node_modules/pi-commandcode-provider/CHANGELOG.md +5 -0
  40. package/node_modules/pi-commandcode-provider/package.json +1 -1
  41. package/node_modules/pi-commandcode-provider/src/pricing.ts +4 -4
  42. package/package.json +7 -7
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * fleet-list.ts — Claude Code-style "FleetView" list rendered below the editor.
3
3
  *
4
- * Shows `main` + each running/queued subagent as a navigable list. Pressing ↓ (or
5
- * ←) at an empty prompt activates the list; ↑/↓ move the selection (filled ● marker),
6
- * Enter opens the selected agent's live conversation overlay, Esc returns to the prompt.
4
+ * Shows `main` + each running/queued subagent as a navigable list, nested
5
+ * subagents indented under their parent (`├`/`└`). Pressing ↓ (or ←) at an empty
6
+ * prompt activates the list; ↑/↓ move the `❯` cursor, Enter opens the selected
7
+ * agent's live conversation overlay, Esc returns to the prompt. `●` marks the view
8
+ * in front (`main`, or the open overlay's agent). In pi's fullscreen mode the mouse
9
+ * works too: hover moves the cursor, a click opens the row.
7
10
  * A viewer stays open when its agent finishes; finished agents linger briefly in the list.
8
11
  *
9
12
  * Mechanics (see plan): the list is a `belowEditor` widget (render-only), and ALL key
@@ -16,14 +19,22 @@ import {
16
19
  Key,
17
20
  matchesKey,
18
21
  type ScrollViewScrollbar,
22
+ type TuiMouseEvent,
23
+ type TuiMouseEventResult,
19
24
  truncateToWidth,
20
25
  visibleWidth,
21
26
  } from "@earendil-works/pi-tui"
22
27
  import { hasAgentBadge, renderAgentName } from "../agent-color.js"
23
- import { type AgentManager, isTopLevelAgent } from "../agent-manager.js"
28
+ import type { AgentManager } from "../agent-manager.js"
24
29
  import type { AgentRecord, ViewerMarkdownMode } from "../types.js"
25
30
  import { getLifetimeCost, getLifetimeTotal } from "../usage.js"
26
- import { type AgentActivity, formatCost, type Theme } from "./agent-widget.js"
31
+ import { agentTree } from "./agent-tree.js"
32
+ import {
33
+ type AgentActivity,
34
+ buildInvocationTags,
35
+ formatCost,
36
+ type Theme,
37
+ } from "./agent-widget.js"
27
38
  import {
28
39
  ConversationViewer,
29
40
  getConversationOverlayOptions,
@@ -52,6 +63,7 @@ export type FleetUICtx = {
52
63
  render(width: number): string[]
53
64
  invalidate(): void
54
65
  dispose?(): void
66
+ handleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined
55
67
  }),
56
68
  options?: { placement?: "aboveEditor" | "belowEditor" },
57
69
  ): void
@@ -100,10 +112,21 @@ export interface FleetWorkflow {
100
112
  }
101
113
 
102
114
  type MainEntry = { kind: "main" }
103
- type AgentEntry = { kind: "agent"; record: AgentRecord }
115
+ /** `prefix` is the tree glyphs before the dot: `""` at top level, `├ `/`└ ` (plus `│ ` continuations) below. */
116
+ type AgentEntry = { kind: "agent"; record: AgentRecord; prefix: string }
104
117
  type WorkflowEntry = { kind: "workflow"; workflow: FleetWorkflow }
105
118
  type FleetEntry = MainEntry | WorkflowEntry | AgentEntry
106
119
 
120
+ /** A roster row's identity across rebuilds. */
121
+ function entryKey(entry: FleetEntry | undefined): string | undefined {
122
+ if (!entry) return undefined
123
+ return entry.kind === "main"
124
+ ? "main"
125
+ : entry.kind === "agent"
126
+ ? `agent:${entry.record.id}`
127
+ : `workflow:${entry.workflow.id}`
128
+ }
129
+
107
130
  /** `11s` — integer seconds, no decimal/suffix (matches Claude Code, unlike formatMs). */
108
131
  export function formatFleetElapsed(ms: number): string {
109
132
  return `${Math.max(0, Math.round(ms / 1000))}s`
@@ -143,6 +166,17 @@ export class FleetList {
143
166
  private active = false
144
167
  /** 0 = `main`, 1..N = subagents. */
145
168
  private selectedIndex = 0
169
+ /** The row `selectedIndex` pointed at, and that index, as of the last `clampSelection`. */
170
+ private selectedKey: string | undefined
171
+ private selectedKeyIndex = 0
172
+ /**
173
+ * Roster index under the mouse pointer (fullscreen mode only), shown as the
174
+ * `❯` cursor while the keyboard is not navigating. The renderer sends no
175
+ * leave event, so it clears on a move over a non-row line or on any key.
176
+ */
177
+ private hoverIndex: number | undefined
178
+ /** Roster index of each line the last render emitted; `undefined` for non-row lines. */
179
+ private lineRoster: (number | undefined)[] = []
146
180
  /** Set while a conversation overlay is open; calling it closes the overlay. */
147
181
  private viewerClose: (() => void) | undefined
148
182
  private viewingAgentId: string | undefined
@@ -189,6 +223,14 @@ export class FleetList {
189
223
  record: AgentRecord,
190
224
  notify: (message: string) => void,
191
225
  ) => ViewerBackgroundAction,
226
+ /**
227
+ * Read live at render time, like `showCost`. Whether each row names the
228
+ * model driving the run and the thinking level it is running at. Defaults to
229
+ * off — the extension supplies the user's `showModel` setting — because the
230
+ * row is already dense and the same pair is shown unconditionally in the
231
+ * conversation viewer and the `Agent` tool result.
232
+ */
233
+ private showModel: () => boolean = () => false,
192
234
  ) {}
193
235
 
194
236
  // ---- Lifecycle ----
@@ -268,6 +310,7 @@ export class FleetList {
268
310
  }
269
311
  this.active = false
270
312
  this.selectedIndex = 0
313
+ this.selectedKey = undefined
271
314
  return
272
315
  }
273
316
 
@@ -285,6 +328,7 @@ export class FleetList {
285
328
  this.widgetRegistered = false
286
329
  this.tui = undefined
287
330
  },
331
+ handleMouse: (event: TuiMouseEvent) => this.handleMouse(event),
288
332
  }
289
333
  },
290
334
  { placement: "belowEditor" },
@@ -298,28 +342,47 @@ export class FleetList {
298
342
  // ---- Roster ----
299
343
 
300
344
  /**
301
- * Agents shown in the list, ordered earliest-launched first so the ones you
345
+ * Agents shown in the list, as a tree: each top-level agent, then its nested
346
+ * children depth-first under it, siblings earliest-launched first so the ones
302
347
  * started sooner sit at the top. Every row is openable (has a session), so Enter
303
348
  * never dead-ends. Included: running/queued, plus the agent currently being
304
349
  * viewed, plus recently-finished ones (they linger briefly before dropping out).
305
350
  * Pending agents with no session yet are hidden until they start.
306
351
  * (`listAgents()` is newest-first, so we re-sort.)
352
+ *
353
+ * Nested children get rows of their own here (`agentTree`), as in Claude
354
+ * Code's FleetView, so each row shows its own usage rather than a rolled-up total.
355
+ * A child shows only under a visible parent. A workflow's agents stay out —
356
+ * the run's own row and inspector cover them.
307
357
  */
308
- private agentRecords(): AgentRecord[] {
358
+ private agentEntries(): AgentEntry[] {
309
359
  const now = Date.now()
310
- return this.manager
311
- .listAgents()
360
+ const all = this.manager.listAgents()
361
+ // The viewed agent stays listed, and a nested one needs its ancestors to
362
+ // hang from: they settle together (a parent stops its children), so the
363
+ // parent would otherwise drop out first and take the viewed row with it.
364
+ const pinned = new Set<string>()
365
+ for (let id = this.viewingAgentId; id !== undefined && !pinned.has(id);) {
366
+ pinned.add(id)
367
+ id = all.find((a) => a.id === id)?.parentAgentId
368
+ }
369
+ const visible = all
312
370
  .filter(
313
371
  (a) =>
314
- isTopLevelAgent(a) &&
372
+ a.workflowId === undefined &&
315
373
  a.session &&
316
374
  (a.status === "running" ||
317
375
  a.status === "queued" ||
318
- a.id === this.viewingAgentId ||
376
+ pinned.has(a.id) ||
319
377
  (a.completedAt != null &&
320
378
  now - a.completedAt < FINISHED_LINGER_MS)),
321
379
  )
322
380
  .sort((a, b) => a.startedAt - b.startedAt)
381
+ return agentTree(visible).map(({ record, prefix }) => ({
382
+ kind: "agent",
383
+ record,
384
+ prefix,
385
+ }))
323
386
  }
324
387
 
325
388
  /**
@@ -365,17 +428,36 @@ export class FleetList {
365
428
  kind: "workflow" as const,
366
429
  workflow,
367
430
  })),
368
- ...this.agentRecords().map((record) => ({
369
- kind: "agent" as const,
370
- record,
371
- })),
431
+ ...this.agentEntries(),
372
432
  ]
373
433
  }
374
434
 
435
+ /**
436
+ * Re-resolve the selection against the current roster. The cursor follows its
437
+ * row, not its slot: a nested spawn inserts a child mid-list, and a slot-based
438
+ * cursor would then sit on — and Enter open — a different agent. Following
439
+ * applies only while the index is where the last resolve left it; a key or a
440
+ * click since then is a deliberate move and wins. A row that is gone leaves
441
+ * the cursor at its position, clamped, so the next row takes the slot.
442
+ */
375
443
  private clampSelection(): void {
376
- const max = this.roster().length - 1
444
+ const roster = this.roster()
445
+ if (
446
+ this.selectedKey !== undefined &&
447
+ this.selectedIndex === this.selectedKeyIndex
448
+ ) {
449
+ const idx = roster.findIndex(
450
+ (entry) => entryKey(entry) === this.selectedKey,
451
+ )
452
+ if (idx >= 0) this.selectedIndex = idx
453
+ }
454
+ const max = roster.length - 1
377
455
  if (this.selectedIndex > max) this.selectedIndex = Math.max(0, max)
378
456
  if (this.selectedIndex < 0) this.selectedIndex = 0
457
+ if (this.hoverIndex !== undefined && this.hoverIndex > max)
458
+ this.hoverIndex = undefined
459
+ this.selectedKey = entryKey(roster[this.selectedIndex])
460
+ this.selectedKeyIndex = this.selectedIndex
379
461
  }
380
462
 
381
463
  // ---- Key handling ----
@@ -391,6 +473,12 @@ export class FleetList {
391
473
  // test below, which would otherwise read the dialog holding the keyboard as
392
474
  // "the user left the list" and reset the selection out from under it.
393
475
  if (this.viewerClose || this.viewingWorkflowId) return undefined
476
+ // A key means the user went back to the keyboard. While navigating, it acts
477
+ // on the row the `❯` is on, so take the hover over as the selection; either
478
+ // way drop it, or it would sit wherever the pointer last crossed the list.
479
+ if (this.active && this.hoverIndex !== undefined)
480
+ this.selectedIndex = this.hoverIndex
481
+ this.hoverIndex = undefined
394
482
  // Input listeners fire BEFORE the focused component, and dialogs
395
483
  // (ctx.ui.select/confirm/input, pi's own menus) swap the prompt editor out
396
484
  // while getEditorText() still reads the detached — empty — editor. So when
@@ -419,7 +507,9 @@ export class FleetList {
419
507
  return undefined
420
508
  }
421
509
 
422
- // Active — arrows navigate, Enter opens, Esc / Up-past-top exits.
510
+ // Active — arrows navigate, Enter opens, Esc / Up-past-top exits. Resolve
511
+ // first: the roster may have changed since the last tick's update().
512
+ this.clampSelection()
423
513
  if (matchesKey(data, "down")) {
424
514
  const max = this.roster().length - 1
425
515
  this.selectedIndex = Math.min(max, this.selectedIndex + 1)
@@ -449,6 +539,37 @@ export class FleetList {
449
539
  return undefined
450
540
  }
451
541
 
542
+ /**
543
+ * Hover and click on rows. Only reaches us in pi's fullscreen mode, where the
544
+ * renderer captures the mouse and routes an event to the below-editor widget
545
+ * under the pointer; `regular` mode sends none. Guarded like `handleKey`, so
546
+ * a click never acts behind an overlay or a dialog.
547
+ */
548
+ handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {
549
+ if (!this.enabled || !this.ui) return undefined
550
+ if (this.viewerClose || this.viewingWorkflowId) return undefined
551
+ if (!this.editorHasFocus()) return undefined
552
+ const index = this.lineRoster[event.y]
553
+ if (event.type === "move") {
554
+ // Hover never moves `selectedIndex`: that re-windows a scrolled list,
555
+ // which would shift the rows under the pointer. A key adopts the hover.
556
+ if (index === this.hoverIndex) return undefined
557
+ this.hoverIndex = index
558
+ return { handled: true, render: true }
559
+ }
560
+ if (index === undefined || event.button !== "left") return undefined
561
+ // Claim the press: the renderer only sends `click` to the component that
562
+ // handled it, and otherwise starts a text selection.
563
+ if (event.type === "press") return { handled: true }
564
+ if (event.type === "click") {
565
+ this.hoverIndex = undefined
566
+ this.selectedIndex = index
567
+ this.openSelected()
568
+ return { handled: true }
569
+ }
570
+ return undefined
571
+ }
572
+
452
573
  /**
453
574
  * True when pi's prompt editor owns the keyboard. The editor is pluggable
454
575
  * (ui.setEditorComponent) and need not extend `Editor` (#374), so match pi-tui's
@@ -569,18 +690,36 @@ export class FleetList {
569
690
 
570
691
  private renderBar(width: number, theme: Theme): string[] {
571
692
  const rows = this.roster().slice(1) as (WorkflowEntry | AgentEntry)[]
572
- if (rows.length === 0) return []
693
+ if (rows.length === 0) {
694
+ this.lineRoster = []
695
+ return []
696
+ }
573
697
  // Clamp locally so a render between a roster shrink and the next update()
574
698
  // (e.g. on terminal resize) never loses the selection marker.
575
699
  const sel = Math.min(this.selectedIndex, rows.length)
700
+ // The `❯` row: the hover, else the keyboard's selection while it navigates.
701
+ const cursor = this.hoverIndex ?? (this.active ? sel : undefined)
576
702
 
577
703
  const hint = this.active
578
704
  ? "↑↓ select · enter view · esc back"
579
705
  : "esc to interrupt · ← for agents · ↓ to manage"
580
706
  const lines: string[] = []
581
- lines.push(truncateToWidth(" " + theme.fg("dim", hint), width))
582
- lines.push("")
583
- lines.push(truncateToWidth(` ${this.bullet(0, sel, theme)} main`, width))
707
+ const lineRoster: (number | undefined)[] = []
708
+ const push = (line: string, rosterIndex?: number): void => {
709
+ lines.push(line)
710
+ lineRoster.push(rosterIndex)
711
+ }
712
+ push(truncateToWidth(" " + theme.fg("dim", hint), width))
713
+ push("")
714
+ const mainInFront =
715
+ this.viewingAgentId === undefined && this.viewingWorkflowId === undefined
716
+ push(
717
+ truncateToWidth(
718
+ `${this.gutter(0, cursor, theme)}${this.dot(mainInFront, theme)} main`,
719
+ width,
720
+ ),
721
+ 0,
722
+ )
584
723
 
585
724
  // Window the rows so the selected one stays visible.
586
725
  const visible = Math.min(MAX_AGENT_ROWS, rows.length)
@@ -589,45 +728,59 @@ export class FleetList {
589
728
  const hiddenBelow = rows.length - (start + visible)
590
729
 
591
730
  if (start > 0)
592
- lines.push(rightAlign("", theme.fg("dim", `↑ ${start} more`), width))
731
+ push(rightAlign("", theme.fg("dim", `↑ ${start} more`), width))
593
732
  for (let a = start; a < start + visible; a++) {
594
733
  const row = rows[a]
595
- lines.push(
734
+ push(
596
735
  row.kind === "workflow"
597
- ? this.renderWorkflowRow(a + 1, sel, row.workflow, width, theme)
598
- : this.renderAgentRow(a + 1, sel, row.record, width, theme),
736
+ ? this.renderWorkflowRow(a + 1, cursor, row.workflow, width, theme)
737
+ : this.renderAgentRow(a + 1, cursor, row, width, theme),
738
+ a + 1,
599
739
  )
600
740
  }
601
741
  if (hiddenBelow > 0)
602
- lines.push(
603
- rightAlign("", theme.fg("dim", `↓ ${hiddenBelow} more`), width),
604
- )
742
+ push(rightAlign("", theme.fg("dim", `↓ ${hiddenBelow} more`), width))
605
743
  // pi stacks below-editor widgets directly on its footer with no spacer (#351).
606
- lines.push("")
744
+ push("")
607
745
 
746
+ this.lineRoster = lineRoster
608
747
  return lines
609
748
  }
610
749
 
611
- private bullet(rosterIndex: number, sel: number, theme: Theme): string {
612
- return rosterIndex === sel ? theme.fg("accent", "●") : theme.fg("dim", "○")
750
+ /**
751
+ * The two columns every row starts with: Claude Code's `❯` on the cursor row,
752
+ * blank elsewhere — so moving the cursor never shifts a row's width.
753
+ */
754
+ private gutter(
755
+ rosterIndex: number,
756
+ cursor: number | undefined,
757
+ theme: Theme,
758
+ ): string {
759
+ return rosterIndex === cursor ? `${theme.fg("accent", "❯")} ` : " "
760
+ }
761
+
762
+ /** `●` on the view in front — `main`, or the row whose overlay is open — `○` elsewhere. */
763
+ private dot(inFront: boolean, theme: Theme): string {
764
+ return inFront ? theme.fg("accent", "●") : theme.fg("dim", "○")
613
765
  }
614
766
 
615
767
  /**
616
- * A run's row. Shaped like an agent's — bullet, kind, name, stats flush right
617
- * — so the two read as one list, with the agent count where an agent has its
618
- * description and the same elapsed/token tail.
768
+ * A run's row. Shaped like an agent's — gutter, dot, kind, name, stats flush
769
+ * right — so the two read as one list, with the agent count where an agent
770
+ * has its description and the same elapsed/token tail.
619
771
  */
620
772
  private renderWorkflowRow(
621
773
  rosterIndex: number,
622
- sel: number,
774
+ cursor: number | undefined,
623
775
  workflow: FleetWorkflow,
624
776
  width: number,
625
777
  theme: Theme,
626
778
  ): string {
627
- const selected = rosterIndex === sel
779
+ const selected = rosterIndex === cursor
628
780
  const kind = theme.fg(selected ? "text" : "muted", "workflow")
629
781
  const name = selected ? theme.fg("text", workflow.name) : workflow.name
630
- const left = ` ${this.bullet(rosterIndex, sel, theme)} ${kind} ${name}`
782
+ const dot = this.dot(workflow.id === this.viewingWorkflowId, theme)
783
+ const left = `${this.gutter(rosterIndex, cursor, theme)}${dot} ${kind} ${name}`
631
784
  // Frozen once the run settles, exactly as an agent's clock is.
632
785
  const elapsed = (workflow.completedAt ?? Date.now()) - workflow.startedAt
633
786
  const agents = `${workflow.doneCount}/${workflow.totalCount} agent${workflow.totalCount === 1 ? "" : "s"}`
@@ -641,16 +794,17 @@ export class FleetList {
641
794
 
642
795
  private renderAgentRow(
643
796
  rosterIndex: number,
644
- sel: number,
645
- record: AgentRecord,
797
+ cursor: number | undefined,
798
+ entry: AgentEntry,
646
799
  width: number,
647
800
  theme: Theme,
648
801
  ): string {
802
+ const { record, prefix } = entry
649
803
  // The selected row renders in the theme's primary text color so it reads as
650
804
  // one selection (#230). A configured badge survives — Claude Code's FleetView
651
805
  // keeps the agent color on the selected row too and only bolds it — which also
652
806
  // keeps the row's width fixed as the selection moves.
653
- const selected = rosterIndex === sel
807
+ const selected = rosterIndex === cursor
654
808
  const name = renderAgentName(
655
809
  record.type,
656
810
  theme,
@@ -662,14 +816,24 @@ export class FleetList {
662
816
  const description = selected
663
817
  ? theme.fg("text", record.description)
664
818
  : record.description
665
- const left = ` ${this.bullet(rosterIndex, sel, theme)} ${name} ${description}`
666
- // The record, not the activity tracker — see the note in AgentWidget's
667
- // running line: only the record carries a nested child's spend, and only it
668
- // outlives the agent.
669
- const tokens = getLifetimeTotal(record.lifetimeUsage)
819
+ const tree = prefix ? theme.fg("dim", prefix) : ""
820
+ const dot = this.dot(record.id === this.viewingAgentId, theme)
821
+ let left = `${this.gutter(rosterIndex, cursor, theme)}${tree}${dot} ${name} ${description}`
822
+ if (this.showModel()) {
823
+ // After the description, not in the stats: rightAlign truncates only the
824
+ // left side, so here the model is cut first and the name survives. Bare
825
+ // level (`sonnet 4.6 · high`), matching the widget's running line.
826
+ const { modelName, thinking } = buildInvocationTags(record.invocation)
827
+ const model = [modelName, thinking].filter(Boolean).join(" · ")
828
+ if (model) left += theme.fg(selected ? "text" : "dim", ` · ${model}`)
829
+ }
830
+ // The record, not the activity tracker: only the record outlives the agent.
831
+ // Its OWN usage, not `lifetimeUsage` — that one folds in every descendant,
832
+ // and the descendants have rows of their own here.
833
+ const tokens = getLifetimeTotal(record.ownUsage)
670
834
  const elapsedMs = (record.completedAt ?? Date.now()) - record.startedAt // freezes once finished
671
835
  const cost = this.showCost()
672
- ? formatCost(getLifetimeCost(record.lifetimeUsage))
836
+ ? formatCost(getLifetimeCost(record.ownUsage))
673
837
  : ""
674
838
  const stats = `${formatFleetElapsed(elapsedMs)} · ${formatFleetTokens(tokens)}${cost ? ` · ${cost}` : ""}`
675
839
  const right = selected ? theme.fg("text", stats) : theme.fg("dim", stats)
@@ -1,5 +1,12 @@
1
1
  # @narumitw/pi-btw
2
2
 
3
+ ## 0.63.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cf7b63d]
8
+ - @narumitw/pi-tui-kit@0.70.0
9
+
3
10
  ## 0.63.7
4
11
 
5
12
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-btw",
3
- "version": "0.63.7",
3
+ "version": "0.63.8",
4
4
  "description": "Pi extension that adds a /btw side-question command.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "directory": "packages/pi-btw"
46
46
  },
47
47
  "dependencies": {
48
- "@narumitw/pi-tui-kit": "^0.69.1"
48
+ "@narumitw/pi-tui-kit": "^0.70.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@earendil-works/pi-ai": "*",
@@ -1,5 +1,12 @@
1
1
  # @narumitw/pi-caffeinate
2
2
 
3
+ ## 0.49.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cf7b63d]
8
+ - @narumitw/pi-tui-kit@0.70.0
9
+
3
10
  ## 0.49.14
4
11
 
5
12
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-caffeinate",
3
- "version": "0.49.14",
3
+ "version": "0.49.15",
4
4
  "description": "Pi extension that keeps the computer awake while the agent is running.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@earendil-works/pi-coding-agent": "1.5.0",
40
- "@types/node": "26.6.5",
40
+ "@types/node": "26.6.6",
41
41
  "esbuild": "0.28.2",
42
42
  "typescript": "7.0.2"
43
43
  },
@@ -47,7 +47,7 @@
47
47
  "directory": "packages/pi-caffeinate"
48
48
  },
49
49
  "dependencies": {
50
- "@narumitw/pi-tui-kit": "^0.69.0",
50
+ "@narumitw/pi-tui-kit": "^0.70.0",
51
51
  "dbus-native": "^0.16.3"
52
52
  }
53
53
  }
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.8.2 - 2026-11-11
6
+
7
+ - Price the November Provider API additions per million tokens: `claude-fable-5-2` at $8.00 input / $40.00 output / $0.20 cache read / $10.00 cache write, `google/gemini-4-carbon` at $2.00 / $10.00 / $0.10 with no cache-write charge, and `meta/muse-ember` at $0.10 / $0.50 / $0.004 with no cache-write charge. Remove the retired `stealth/crouton-alpha` and `reflection/beam:free` zero prices, and refresh the 97-model API and pricing snapshots to 2026-11-11. The new models were already usable through the live `/provider/v1/models` response with a zero estimate and an unknown-price warning; static capability metadata stays at `command-code@1.88.5`, so they remain text-only without reasoning or effort flags until upstream ships them. ([#211](https://github.com/patlux/pi-commandcode-provider/pull/211))
8
+ - The daily catalog workflow passes its pricing gate again on the same 97-model snapshot, which closes the reopened maintenance incident [#207](https://github.com/patlux/pi-commandcode-provider/issues/207) on the next successful scheduled run.
9
+
5
10
  ## 0.8.1 - 2026-11-09
6
11
 
7
12
  - Refresh the capability snapshot to `command-code@1.88.5`: advertise image input, reasoning and selectable efforts (`off`/`low`/`high`/`max`) for `deepseek/deepseek-v4.1-flash-ultrafast`, and drop the retired `poolside/laguna-s-2.1-free` reasoning flag, effort defaults and 32,768-token output limit. Add reviewed display pricing for the ultrafast model at $2.40 input / $9.60 output / $0.048 cache read per million tokens, with no cache-write charge and a single published rate, and remove the retired free `poolside/laguna-s-2.1-free` price entry. Refresh the 96-model API and pricing snapshots to 2026-11-09. Endpoint routing defaults are unchanged. ([#209](https://github.com/patlux/pi-commandcode-provider/pull/209))
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-commandcode-provider",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "pi custom provider for Command Code API (commandcode.ai)",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -20,7 +20,7 @@ export interface TemporaryPricing {
20
20
  }
21
21
 
22
22
  export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits"
23
- export const PRICING_LAST_VERIFIED = "2026-11-09"
23
+ export const PRICING_LAST_VERIFIED = "2026-11-11"
24
24
 
25
25
  export const ZERO_MODEL_COST: CommandCodeModelCost = {
26
26
  input: 0,
@@ -40,10 +40,7 @@ export const ZERO_MODEL_COST: CommandCodeModelCost = {
40
40
  export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
41
41
  // Free models
42
42
  // Free while the stealth preview lasts; no fixed expiry is published.
43
- "stealth/crouton-alpha": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
44
43
  "stealth/glyph-cluster:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
45
- // Free while capacity lasts; no fixed expiry is published.
46
- "reflection/beam:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
47
44
 
48
45
  // Open and open-weight models
49
46
  "inclusionai/ling-3.1-flash-1019": { input: 0.3, output: 0.9, cacheRead: 0.06, cacheWrite: 0 },
@@ -209,6 +206,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
209
206
  "meta/muse-spark-1.3": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
210
207
  "meta/muse-spark-open": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
211
208
  "meta/muse-wonder-1.0": { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 0 },
209
+ "meta/muse-ember": { input: 0.1, output: 0.5, cacheRead: 0.004, cacheWrite: 0 },
212
210
  "meta/muse-spark-1.2-contributor": {
213
211
  input: 0.1,
214
212
  output: 0.2,
@@ -226,6 +224,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
226
224
  "claude-sonnet-5-5": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 },
227
225
  "claude-sonnet-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
228
226
  "claude-sonnet-4-6": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
227
+ "claude-fable-5-2": { input: 8, output: 40, cacheRead: 0.2, cacheWrite: 10 },
229
228
  "claude-fable-5-1": { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 },
230
229
  "claude-fable-5": { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 },
231
230
  "claude-opus-5-5": { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 },
@@ -327,6 +326,7 @@ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
327
326
  cacheRead: 0.15,
328
327
  cacheWrite: 0.08334,
329
328
  },
329
+ "google/gemini-4-carbon": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 0 },
330
330
  "google/gemini-4-argon": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 0 },
331
331
  "google/gemini-3.8-flash": {
332
332
  input: 1.5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.11.8",
3
+ "version": "2026.11.10",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -41,18 +41,18 @@
41
41
  "@dietrichgebert/ponytail": "5.3.3",
42
42
  "@herbertgao/pi-agency": "0.1.3",
43
43
  "@herbertgao/pi-bark": "0.2.2",
44
- "@herbertgao/pi-cc-extensions": "1.0.16-local.1",
44
+ "@herbertgao/pi-cc-extensions": "1.0.17-local.1",
45
45
  "@herbertgao/pi-impeccable": "0.3.0",
46
- "@herbertgao/pi-subagents": "0.23.2-local.1",
46
+ "@herbertgao/pi-subagents": "0.24.0-local.1",
47
47
  "@herbertgao/sol-pi": "0.4.3",
48
48
  "@juicesharp/rpiv-ask-user-question": "2.15.0",
49
49
  "@juicesharp/rpiv-config": "^2.15.0",
50
50
  "@modelcontextprotocol/sdk": "^1.32.1",
51
51
  "@mozilla/readability": "^0.6.0",
52
52
  "@napi-rs/keyring": "^2.1.0",
53
- "@narumitw/pi-btw": "0.63.7",
54
- "@narumitw/pi-caffeinate": "0.49.14",
55
- "@narumitw/pi-tui-kit": "^0.69.1",
53
+ "@narumitw/pi-btw": "0.63.8",
54
+ "@narumitw/pi-caffeinate": "0.49.15",
55
+ "@narumitw/pi-tui-kit": "^0.70.0",
56
56
  "@pi-plugins/fast-mode": "0.1.15",
57
57
  "@shikijs/cli": "^4.0.2",
58
58
  "@tifan/pi-copy-response": "0.2.7",
@@ -73,7 +73,7 @@
73
73
  "nanoid": "^5.0.0",
74
74
  "p-limit": "^6.1.0",
75
75
  "pi-antigravity": "0.12.0",
76
- "pi-commandcode-provider": "0.8.1",
76
+ "pi-commandcode-provider": "0.8.2",
77
77
  "pi-lens": "4.4.12",
78
78
  "pi-next-cue": "1.0.8",
79
79
  "pi-provider-qoder": "0.6.12",