pi-stereo-view 0.1.20 → 0.1.22

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
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.22 - 2026-11-21
6
+
7
+ ### Fixed
8
+
9
+ - Ctrl+G no longer crashes Pi when opening an external editor from split view. Pi returns to the same layout with the edited draft when the editor closes. Thanks to [@okuuva](https://github.com/okuuva) for the fix ([#120](https://github.com/alexshpunt/pi-stereo-view/pull/120)).
10
+
11
+ ## 0.1.21 - 2026-11-19
12
+
13
+ ### Added
14
+
15
+ - Compact tool rows show how many images a call returned, such as `read (1 image)`, so a collapsed screenshot or image read is not missed. Groups show the total for their calls (#103).
16
+
5
17
  ## 0.1.20 - 2026-11-19
6
18
 
7
19
  ### Added
package/README.md CHANGED
@@ -112,7 +112,7 @@ Click `[ ⊟ ]` or `[Compact tools]` beside Find and Maximize in the Activity he
112
112
 
113
113
  Every failed call stays separate, even beside another failure. Left guides mark each level: members sit inside their group, and an open card and its linked output sit inside their call. Collapse a call or its group independently; reopening the group keeps your expanded calls, and so does turning grouping off and on again. Thinking, Conversation content and different tools end a group.
114
114
 
115
- Group and call headers show `▸` when collapsed and `▾` when expanded. Each call row has a one-cell left gutter, a colored status dot, its tool name and a short argument description. A group shows its shared running or successful state. Failed calls expose their own status and argument preview without opening a group. Long descriptions are truncated, not the saved calls. Verified local MCP forwarding aliases use their native tool's name; foreign, ambiguous and unknown tools keep their original identity.
115
+ Group and call headers show `▸` when collapsed and `▾` when expanded. Each call row has a one-cell left gutter, a colored status dot, its tool name and a short argument description. A group shows its shared running or successful state. Failed calls expose their own status and argument preview without opening a group. A call whose result holds images shows their count, such as `(1 image)`, before its description; a group shows the total for its calls. Open the call to see the images, if your terminal can display them. Long descriptions are truncated, not the saved calls. Verified local MCP forwarding aliases use their native tool's name; foreign, ambiguous and unknown tools keep their original identity.
116
116
 
117
117
  Search and `/stereo-view copy` still include full saved results and linked output. A search match opens its group and call temporarily; clearing the search restores your previous expansion. Conversation and combined history keep their normal display.
118
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-stereo-view",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "Keep Pi conversation separate from tool output and agent activity.",
6
6
  "license": "MIT",
@@ -32,11 +32,11 @@ interface CompactToolOptions {
32
32
  }
33
33
 
34
34
  interface HeaderInputs {
35
- width: number; name: string; args: unknown; status: ToolSummary["status"]; count?: number; expanded?: boolean;
35
+ width: number; name: string; args: unknown; status: ToolSummary["status"]; images: number; count?: number; expanded?: boolean;
36
36
  label: string; theme: Theme;
37
37
  }
38
38
  const sameInputs = (a: HeaderInputs, b: HeaderInputs): boolean => a.width === b.width && a.name === b.name &&
39
- a.args === b.args && a.status === b.status && a.count === b.count && a.expanded === b.expanded && a.label === b.label && a.theme === b.theme;
39
+ a.args === b.args && a.status === b.status && a.images === b.images && a.count === b.count && a.expanded === b.expanded && a.label === b.label && a.theme === b.theme;
40
40
 
41
41
  /** A display-only call or group header; the original renderer owns the body. */
42
42
  export class CompactTool implements Component {
@@ -49,8 +49,8 @@ export class CompactTool implements Component {
49
49
 
50
50
  render(width: number): string[] {
51
51
  width = Math.max(0, width - (this.options.gutter?.() ?? 0));
52
- const { name, args, status } = this.summary();
53
- const inputs: HeaderInputs = { width, name, args, status, count: this.options.count?.(),
52
+ const { name, args, status, images = 0 } = this.summary();
53
+ const inputs: HeaderInputs = { width, name, args, status, images, count: this.options.count?.(),
54
54
  expanded: this.options.toggle ? this.options.expanded?.() : undefined, label: this.options.clock?.() ?? "", theme: this.theme() };
55
55
  // Streamed arguments may be updated in place, so running calls always rebuild.
56
56
  if (this.cached && status !== "running" && sameInputs(this.cached.inputs, inputs)) return this.cached.lines;
@@ -58,11 +58,13 @@ export class CompactTool implements Component {
58
58
  this.cached = { inputs, lines };
59
59
  return lines;
60
60
  }
61
- private header({ width, name, args, status, count, expanded, label, theme }: HeaderInputs): string[] {
61
+ private header({ width, name, args, status, images, count, expanded, label, theme }: HeaderInputs): string[] {
62
62
  const dot = theme.fg(status === "running" ? "warning" : status === "unknown" ? "dim" : status, "●");
63
63
  const description = count ? "" : toolDescription(args);
64
64
  const control = this.options.toggle ? theme.fg("muted", expanded ? "▾" : "▸") + " " : this.options.alignControl ? " " : "";
65
- const text = `${dot} ${control}${singleLine(name)}${count ? ` ×${count}` : ""}${description ? " " + theme.fg("muted", description) : ""}`;
65
+ // Before the description, so truncation keeps it: the collapsed row is the only sign of a hidden image.
66
+ const attachment = images ? " " + theme.fg("accent", `(${images} ${images === 1 ? "image" : "images"})`) : "";
67
+ const text = `${dot} ${control}${singleLine(name)}${count ? ` ×${count}` : ""}${attachment}${description ? " " + theme.fg("muted", description) : ""}`;
66
68
  const clock = label && width >= visibleWidth(label) + 8 ? label : "";
67
69
  const available = Math.max(0, width - 1 - (clock ? visibleWidth(clock) + 1 : 0));
68
70
  const body = truncateToWidth(text, available, "…");
package/src/content.ts CHANGED
@@ -37,6 +37,8 @@ export interface ToolSummary {
37
37
  name: string;
38
38
  args: unknown;
39
39
  status: "running" | "success" | "error" | "unknown";
40
+ /** Image blocks in the call's result, shown on compact rows that hide the native card. */
41
+ images?: number;
40
42
  }
41
43
  /** One native owner and its pane projection; spacing and search retain that same owner. */
42
44
  export interface ContentEntry {
@@ -55,6 +57,13 @@ export function callStatus(call: Component): ToolSummary["status"] {
55
57
  const { result, isPartial } = call as NativeContent;
56
58
  return !result || isPartial !== false ? "running" : result.isError ? "error" : "success";
57
59
  }
60
+ /** Number of image blocks in a tool result's content. */
61
+ export function imageCount(content: unknown): number {
62
+ if (!Array.isArray(content)) return 0;
63
+ let count = 0;
64
+ for (const block of content) if (block?.type === "image") count++;
65
+ return count;
66
+ }
58
67
 
59
68
  const nameOf = (component: Component): string => component.constructor.name;
60
69
  const contentText = (content: unknown): string => typeof content === "string" ? content :
@@ -361,7 +370,7 @@ export class NativeContentIndex {
361
370
  const native = source as NativeContent;
362
371
  return {
363
372
  name: native.toolName!, args: native.args,
364
- status: callStatus(native),
373
+ status: callStatus(native), images: imageCount(native.result?.content),
365
374
  };
366
375
  } : undefined;
367
376
  return { source, owner: owner ?? source, component: source, kind: owner ? "tool" : kind, spacing, compact, tool, search: width => {
package/src/layout.ts CHANGED
@@ -386,6 +386,8 @@ export class TranscriptLayout {
386
386
  return pass.shown;
387
387
  };
388
388
  const evaluate = ({ width, height }: { width: number; height: number }): boolean => {
389
+ // Width-only stack rendering during external-editor handoff has no viewport height bound.
390
+ height = Math.min(height, Math.max(1, host.terminal.rows));
389
391
  const previousHeight = historyHeight;
390
392
  const candidate = !!projectedDock && (widgetsPresent() || dialogPresent()) && dockUnchanged() && !this.failed &&
391
393
  this.preferences.mode === "split" && this.preferences.zoom !== "chat";
@@ -21,7 +21,9 @@ export function toolGroups(entries: readonly ContentEntry[], present: (name: str
21
21
  return groups;
22
22
  }
23
23
 
24
- /** Every group has one state; failed calls always remain individual rows. */
24
+ /** Every group has one state; failed calls always remain individual rows. Images are counted across members. */
25
25
  export function groupSummary(group: ToolGroup): ToolSummary {
26
- return { name: group.name, args: undefined, status: group.status };
26
+ let images = 0;
27
+ for (const call of group.calls) images += call.tool?.().images ?? 0;
28
+ return { name: group.name, args: undefined, status: group.status, images };
27
29
  }