pi-subagent-manager 0.25.0 → 0.26.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.
@@ -76,7 +76,7 @@ The fullscreen watcher renders steer and agent messages (including thinking) as
76
76
 
77
77
  - The bottom **Steer** input is focused initially. Type and press **Enter** to send to the inspected agent, including nested descendants, through the same service as `agent_steer`: running agents receive queued input; paused/completed/stopped agents resume their retained session. Empty input is ignored. Sending leaves the viewer open; failures are shown and preserve the draft for retry.
78
78
  - **Tab** switches between steering input and transcript controls. While typing, **c/t/l/r** are ordinary text and **Home/End** move the input cursor. Pasting never submits by itself.
79
- - **Up/Down, PageUp/PageDown** scroll and pause following in either mode. With transcript controls focused, **Home** scrolls to the start; **End** or **l** resumes following the live tail. Scroll/follow state is remembered per agent.
79
+ - **Up/Down, PageUp/PageDown** scroll and pause following in either mode. In pi fullscreen mode (`tuiMode: "fullscreen"`) the **mouse wheel** scrolls the transcript the same way as Up/Down (using pi's `fullscreenWheelScrollLines`; Alt+wheel moves further) when the pointer is over the viewer. With transcript controls focused, **Home** scrolls to the start; **End** or **l** resumes following the live tail. Scroll/follow state is remembered per agent.
80
80
  - **Ctrl+R** (or **r** with transcript controls focused) retries an unavailable observation without starting a turn. Starting threads are watchable; stopped/completed threads remain readable.
81
81
  - Frames are sanitized, viewport-bounded and coalesced during bursts. Exit, root replacement and shutdown release observers/timers. Streaming deltas never enter persisted thread events.
82
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-subagent-manager",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Hierarchical, steerable subagent threads for pi",
5
5
  "type": "module",
6
6
  "engines": {
package/src/ui/dialog.ts CHANGED
@@ -17,6 +17,8 @@ import {
17
17
  wrapTextWithAnsi,
18
18
  type Component,
19
19
  type TUI,
20
+ type TuiMouseEvent,
21
+ type TuiMouseEventResult,
20
22
  } from "@earendil-works/pi-tui";
21
23
 
22
24
  export interface DialogHost {
@@ -31,6 +33,8 @@ export interface DialogRow {
31
33
  label: string;
32
34
  /** Trusted formatter receives sanitized text; generated ANSI styling is kept when clipping. */
33
35
  renderLabel?: (label: string, theme: Theme) => string;
36
+ /** Trusted formatter for a fixed three-cell middle column, styled at render time. */
37
+ renderIndicators?: (theme: Theme) => string;
34
38
  value?: string;
35
39
  valueColor?: Parameters<Theme["fg"]>[0];
36
40
  help?: string;
@@ -178,7 +182,7 @@ export function dialogEditor(
178
182
  );
179
183
  }
180
184
 
181
- /** Bounded, two-column menu shared by settings and agent definitions. */
185
+ /** Bounded menu with an optional indicator column, shared by settings and agent definitions. */
182
186
  export class DialogMenu {
183
187
  private selected = 0;
184
188
  private viewport = 1;
@@ -242,11 +246,18 @@ export class DialogMenu {
242
246
  this.rows.length - this.viewport,
243
247
  ),
244
248
  );
245
- const labelWidth = Math.min(28, Math.max(8, Math.floor(inner * 0.35)));
249
+ const hasIndicators = this.rows.some((row) => row.renderIndicators);
250
+ const indicatorWidth = 3;
251
+ const labelWidth = Math.min(
252
+ 28,
253
+ Math.max(8, Math.floor(inner * 0.35)),
254
+ // Reserve prefix, separators, indicators and at least one value cell at narrow widths.
255
+ hasIndicators ? Math.max(0, inner - 2 - 6 - indicatorWidth - 1) : Infinity,
256
+ );
246
257
  const body = [
247
258
  this.theme.fg(
248
259
  "dim",
249
- ` ${this.rows.length ? this.selected + 1 : 0}/${this.rows.length} · Field / Value`,
260
+ ` ${this.rows.length ? this.selected + 1 : 0}/${this.rows.length} · Field / ${hasIndicators ? "Saved / " : ""}Value`,
250
261
  ),
251
262
  ...this.rows.slice(start, start + this.viewport).map((row, i) => {
252
263
  const selected = start + i === this.selected;
@@ -259,10 +270,13 @@ export class DialogMenu {
259
270
  true,
260
271
  );
261
272
  const padding = " ".repeat(Math.max(0, labelWidth - visibleWidth(label)));
273
+ const indicators = truncateToWidth(row.renderIndicators?.(this.theme) ?? "", indicatorWidth, "", true);
274
+ const indicatorPadding = " ".repeat(Math.max(0, indicatorWidth - visibleWidth(indicators)));
262
275
  const value = dialogText(row.value ?? "");
263
276
  return color(`${selected ? "›" : " "} `)
264
277
  + (row.renderLabel ? label : color(label))
265
278
  + color(`${padding} │ `)
279
+ + (hasIndicators ? indicators + color(`${indicatorPadding} │ `) : "")
266
280
  + (row.valueColor ? this.theme.fg(row.valueColor, value) : color(value));
267
281
  }),
268
282
  "",
@@ -512,6 +526,12 @@ export class DialogSession {
512
526
  this.child?.handleInput?.(data);
513
527
  }
514
528
 
529
+ /** Fullscreen mouse events reach the overlay, so forward them to the active child view. */
530
+ handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {
531
+ if (this.closed || this.inputLocked) return undefined;
532
+ return this.child?.handleMouse?.(event);
533
+ }
534
+
515
535
  invalidate(): void {
516
536
  this.child?.invalidate();
517
537
  }
@@ -8,6 +8,8 @@ import {
8
8
  ScrollView,
9
9
  stripTerminalSequences,
10
10
  truncateToWidth,
11
+ type TuiMouseEvent,
12
+ type TuiMouseEventResult,
11
13
  visibleWidth,
12
14
  wrapTextWithAnsi,
13
15
  } from "@earendil-works/pi-tui";
@@ -292,6 +294,16 @@ export class LiveAgentView {
292
294
  this.host.requestRender();
293
295
  }
294
296
 
297
+ /** Fullscreen wheel events scroll the transcript like Up/Down, even while composing. */
298
+ handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined {
299
+ if (this.disposed || event.type !== "wheel") return undefined;
300
+ const lines = Math.trunc(event.wheelDelta ?? 0);
301
+ if (!Number.isFinite(lines) || lines === 0) return undefined;
302
+ this.scroll.scrollBy(lines);
303
+ this.saveViewport();
304
+ return { handled: true, render: true };
305
+ }
306
+
295
307
  private saveViewport(): void {
296
308
  this.viewport.scrollTop = this.scroll.scrollTop;
297
309
  this.viewport.follow = this.scroll.isFollowingEnd;
@@ -35,7 +35,7 @@ const LOADER_OPTIONS = LOADER_STYLES.map((id) => {
35
35
  id,
36
36
  label: loader.label,
37
37
  value: `${loader.frames.join(" ")} · ${Object.values(loader.states).join(" ")}`,
38
- help: `Each row: all starting/running frames · completed, paused, failed, stopped.\nStarting/running: ${loader.frames.join(" ")}\nCompleted: ${loader.states.completed} · Paused: ${loader.states.paused}\nFailed: ${loader.states.failed} · Stopped: ${loader.states.stopped}\n${loader.requiresNerdFont ? "Requires [labs] Nerd Font icons On." : id === "braille" ? "Standard Unicode Braille; no Nerd Font needed." : "ASCII only; no special font needed."} The loader appears before the role icon when enabled.`,
38
+ help: `Each row: all starting/running frames · completed, paused, failed, stopped.\nStarting/running: ${loader.frames.join(" ")}\nCompleted: ${loader.states.completed} · Paused: ${loader.states.paused}\nFailed: ${loader.states.failed} · Stopped: ${loader.states.stopped}\n${loader.requiresNerdFont ? "Requires [lab] Nerd Font icons On." : id === "braille" ? "Standard Unicode Braille; no Nerd Font needed." : "ASCII only; no special font needed."} The loader appears before the role icon when enabled.`,
39
39
  };
40
40
  });
41
41
 
@@ -160,9 +160,9 @@ function withProvenance(row: DialogRow, keys: (keyof ManagerSettings)[], layers:
160
160
  layers.project[key] !== (layers.global[key] ?? DEFAULT_MANAGER_SETTINGS[key]));
161
161
  return {
162
162
  ...row,
163
- renderLabel: (label, theme) =>
164
- (globalChanged ? theme.fg("accent", "●") + " " : "") +
165
- (projectChanged ? theme.fg("warning", "●") + " " : "") + label.replace(/^\[labs\] /, ""),
163
+ renderIndicators: (theme) =>
164
+ (globalChanged ? theme.fg("accent", "●") : " ") + " " +
165
+ (projectChanged ? theme.fg("warning", "●") : " "),
166
166
  help: `${row.label}\n${row.help ?? ""}`,
167
167
  };
168
168
  }
@@ -177,7 +177,7 @@ function provenanceLegend(theme: Theme): string {
177
177
  async function configureFooterDisplay(ctx: ExtensionCommandContext, draft: ManagerSettings, layers: SettingsLayers): Promise<void> {
178
178
  let selectedId: string | undefined;
179
179
  while (true) {
180
- const action = await dialogMenu(ctx, "[labs] Footer display", ([
180
+ const action = await dialogMenu(ctx, "[lab] Footer display", ([
181
181
  {
182
182
  id: "location",
183
183
  label: "Location",
@@ -194,7 +194,7 @@ async function configureFooterDisplay(ctx: ExtensionCommandContext, draft: Manag
194
194
  id: "icon",
195
195
  label: "Icon",
196
196
  value: `${costIconGlyph(draft.costIcon, draft.nerdFontIcons)} ${COST_ICON_LABELS[draft.costIcon]}`,
197
- help: `Choose a money-related ${draft.nerdFontIcons ? "Nerd Font" : "emoji"} icon. The family follows [labs] Nerd Font icons.`,
197
+ help: `Choose a money-related ${draft.nerdFontIcons ? "Nerd Font" : "emoji"} icon. The family follows [lab] Nerd Font icons.`,
198
198
  },
199
199
  { id: "back", label: "Back", help: "Return to settings. Save and apply there to commit these changes." },
200
200
  ] as DialogRow[]).map((row) => {
@@ -321,31 +321,31 @@ async function configureAgentsDialog(
321
321
  },
322
322
  {
323
323
  id: "costDisplay",
324
- label: "[labs] Footer display",
324
+ label: "[lab] Footer display",
325
325
  value: COST_DISPLAY_OPTIONS.find((mode) => mode.id === draft.costDisplay)!.label,
326
326
  help: "Configure footer location, displayed cost, and money icon in a submenu. Save and apply to update immediately.",
327
327
  },
328
328
  {
329
329
  id: "nerdFontIcons",
330
- label: "[labs] Nerd Font icons",
330
+ label: "[lab] Nerd Font icons",
331
331
  value: draft.nerdFontIcons ? "On" : "Off",
332
332
  help: "Experimental: display each agent type’s optional Nerd Font icon and unlock Nerd Font loader palettes.\nRequires a Nerd Font configured in your terminal; otherwise glyphs may appear as boxes.\nOff by default. Braille and ASCII loaders work with this Off. Save and apply to update immediately.",
333
333
  },
334
334
  {
335
335
  id: "loaderStyle",
336
- label: "[labs] Loader style",
336
+ label: "[lab] Loader style",
337
337
  value: AGENT_LOADERS[effectiveLoaderStyle(draft.loaderStyle, draft.nerdFontIcons)].label,
338
338
  help: "Preview every animation frame and settled state.\nNerd Fonts Off: Braille (standard Unicode), ASCII, ASCII Star and ASCII Pulse. On: all palettes, including Circle and Hourglass.\nNerd-only saved styles fall back to ASCII while Nerd Fonts are off. Save and apply to update immediately.",
339
339
  },
340
340
  {
341
341
  id: "subagentExtensions",
342
- label: "[labs] Enable subagent extensions",
342
+ label: "[lab] Enable subagent extensions",
343
343
  value: draft.subagentExtensions ? "On" : "Off",
344
344
  help: "Experimental: reload configured user/trusted-project extension hooks in separate subagent sessions (not CLI-only or inline extensions). Bugs and unintended consequences may occur if hooks assume main-session state.\nRead limitations: https://github.com/championswimmer/pi-subagent-manager/blob/main/docs/subagent-extension-limitations.md\nOff by default. Save and apply affects newly opened sessions, not already-open agents.",
345
345
  },
346
346
  {
347
347
  id: "finalRecap",
348
- label: "[labs] Final Recap",
348
+ label: "[lab] Final Recap",
349
349
  value: draft.finalRecap ? "On" : "Off",
350
350
  help: "Experimental: when detached agents finish or fail and the main agent is idle, automatically ask the main agent to summarize their results.\nEnabling this may cause extra model turns and uses more tokens and context.\nOff by default. Subagent Mode Off suppresses automatic summaries.",
351
351
  },
@@ -444,7 +444,7 @@ async function configureAgentsDialog(
444
444
  const styles = availableLoaderStyles(draft.nerdFontIcons);
445
445
  const style = await dialogMenu(
446
446
  ctx,
447
- "[labs] Loader style",
447
+ "[lab] Loader style",
448
448
  LOADER_OPTIONS.filter((option) => styles.includes(option.id)),
449
449
  { selectedId: effectiveLoaderStyle(draft.loaderStyle, draft.nerdFontIcons) },
450
450
  );
package/src/ui/ui.ts CHANGED
@@ -882,7 +882,7 @@ const EDIT_FIELD_LABELS: Record<EditMenuAction, string> = {
882
882
  "tools.allow": "Allowed tools",
883
883
  "tools.block": "Blocked tools",
884
884
  color: "Color",
885
- icon: "[labs] Icon",
885
+ icon: "[lab] Icon",
886
886
  systemPrompt: "System prompt",
887
887
  "Save scope": "Save scope",
888
888
  Source: "Source (read-only)",
@@ -908,7 +908,7 @@ const EDIT_FIELD_HELP: Record<EditMenuAction, string> = {
908
908
  "tools.block":
909
909
  "Pick session tools to block. Blocked tools take precedence when the policy uses this list.",
910
910
  color: "Thread widget color with live preview.",
911
- icon: "Paste a single Nerd Font glyph from nerdfonts.com/cheat-sheet (not its name or codepoint).\nLeave blank to remove. Display requires [labs] Nerd Font icons in settings and a Nerd Font in your terminal.",
911
+ icon: "Paste a single Nerd Font glyph from nerdfonts.com/cheat-sheet (not its name or codepoint).\nLeave blank to remove. Display requires [lab] Nerd Font icons in settings and a Nerd Font in your terminal.",
912
912
  systemPrompt: "Edit the Markdown prompt body in a multiline dialog.",
913
913
  "Save scope": "Project definitions override global definitions with the same name.",
914
914
  Source: "Read-only source. Bundled definitions are copied, never overwritten.",