pi-stereo-view 0.1.17 → 0.1.19
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 +19 -0
- package/README.md +9 -3
- package/package.json +5 -3
- package/src/content.ts +132 -63
- package/src/index.ts +14 -2
- package/src/layout.ts +96 -41
- package/src/native.ts +381 -45
- package/src/preferences.ts +11 -4
- package/src/render-cache.ts +19 -5
- package/src/surface.ts +875 -0
- package/src/timestamps.ts +41 -5
- package/src/tool-groups.ts +5 -3
- package/src/tool-streaming.ts +78 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.19 - 2026-11-19
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Split view uses much less CPU while an agent works: the panels are drawn as one full-width block instead of being merged cell by cell, and only history near each panel's viewport is rendered on every frame.
|
|
10
|
+
- Split view's per-frame work no longer grows with session length: content classification, tool grouping and timestamp checks reuse their results for history that did not change.
|
|
11
|
+
|
|
12
|
+
## 0.1.18 - 2026-11-09
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Stream latest tools: with Compact Activity tools on, new tool calls show in full, then collapse into the compact history after a configurable delay.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- The `[Menu]` button is now `[Settings]`.
|
|
21
|
+
- New installs start side by side with Conversation on the left and Activity on the right, text buttons, Compact Activity tools and Stream latest tools on. Saved settings are kept.
|
|
22
|
+
- Keep the last text button in a panel header one cell away from the right edge.
|
|
23
|
+
|
|
5
24
|
## 0.1.17 - 2026-11-09
|
|
6
25
|
|
|
7
26
|
### Changed
|
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ pi --tui-mode fullscreen
|
|
|
74
74
|
|
|
75
75
|
## Use it
|
|
76
76
|
|
|
77
|
-
Click the toolbar and the buttons in each panel's header. Buttons use
|
|
77
|
+
Click the toolbar and the buttons in each panel's header. Buttons use text labels by default. To use icons instead, open **Stereo View settings** with `[Settings]` or `/stereo-view settings`, then set **Button style** to `icons`. The choice survives restart.
|
|
78
78
|
|
|
79
79
|
| Icons | Text | Action |
|
|
80
80
|
| --- | --- | --- |
|
|
@@ -82,7 +82,7 @@ Click the toolbar and the buttons in each panel's header. Buttons use icons by d
|
|
|
82
82
|
| `[ ▤ ]` / `[ ▥ ]` | `[Rows]` / `[Columns]` | Switch between rows and columns. |
|
|
83
83
|
| `[ ↕ ]` / `[ ↔ ]` | `[Swap]` | Swap the panels. |
|
|
84
84
|
| `[ ↗ ]` / `[ ↙ ]` | `[Maximize]` / `[Restore]` | Zoom a panel / restore the split. |
|
|
85
|
-
| `[ ≡ ]` | `[
|
|
85
|
+
| `[ ≡ ]` | `[Settings]` | Open display and Conversation height settings. |
|
|
86
86
|
| `[ ⌕ ]` | `[Find]` | Search this panel. |
|
|
87
87
|
| `[ ⊟ ]` / `[ ⊞ ]` | `[Compact tools]` / `[Full tools]` | Compact Activity tools / restore full tools. |
|
|
88
88
|
|
|
@@ -104,7 +104,13 @@ Group and call headers show `▸` when collapsed and `▾` when expanded. Each c
|
|
|
104
104
|
|
|
105
105
|
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. You can also click `[ ⊞ ]` or `[Full tools]` in the Activity header to restore full tools. Conversation and combined history keep their normal display.
|
|
106
106
|
|
|
107
|
-
Compact tools work in columns, rows and zoomed Activity. The choice survives restart and defaults to
|
|
107
|
+
Compact tools work in columns, rows and zoomed Activity. The choice survives restart and defaults to on. For keyboard access, run `/stereo-view settings` and change **Compact Activity tools**.
|
|
108
|
+
|
|
109
|
+
### Stream latest tools
|
|
110
|
+
|
|
111
|
+
**Stream latest tools** (on by default, in Settings) lets you watch the current work while keeping history short. With Compact Activity tools on, a new tool call appears as its full card and updates live. When it finishes, it stays fully visible for the **Collapse delay** (1, 2, 3, 5, 10 or 30 seconds; default 5), then collapses in place into a compact row and joins the adjacent identical collapsed calls (`read ×3`).
|
|
112
|
+
|
|
113
|
+
Calls that are still running or waiting to collapse are never grouped. Thinking, answers and other content between calls appear as usual and end a group. Several calls running together collapse separately, each after its own delay. A call you opened yourself stays open. Scroll position is not changed when a call collapses; if you are at the end of Activity, you stay there. A reopened session shows all its calls collapsed. Both options survive restart; streaming defaults to on.
|
|
108
114
|
|
|
109
115
|
## Search history
|
|
110
116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-stereo-view",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Keep Pi conversation separate from tool output and agent activity.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,10 +52,12 @@
|
|
|
52
52
|
"@earendil-works/pi-tui": "*"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@earendil-works/pi-
|
|
56
|
-
"@earendil-works/pi-
|
|
55
|
+
"@earendil-works/pi-ai": "1.5.2",
|
|
56
|
+
"@earendil-works/pi-coding-agent": "1.5.2",
|
|
57
|
+
"@earendil-works/pi-tui": "1.5.2",
|
|
57
58
|
"@types/node": "^24.0.4",
|
|
58
59
|
"pi-coding-agent-test": "0.1.3",
|
|
60
|
+
"typebox": "1.3.27",
|
|
59
61
|
"typescript": "5.9.3",
|
|
60
62
|
"vitest": "4.1.11"
|
|
61
63
|
},
|
package/src/content.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Container, Markdown, Text, stripTerminalSequences, type Component } from "@earendil-works/pi-tui";
|
|
2
2
|
import { searchText, type SearchEntry } from "./search.ts";
|
|
3
3
|
import { NestedCalls } from "./nested-calls.ts";
|
|
4
|
+
import { sameValues } from "./render-cache.ts";
|
|
4
5
|
|
|
5
6
|
export type Pane = "activity" | "chat";
|
|
6
7
|
export type ContentKind = "dialogue" | "system" | "thinking" | "tool" | "shell";
|
|
@@ -49,6 +50,11 @@ export interface ContentEntry {
|
|
|
49
50
|
/** Live execution metadata exists only on calls, never on linked output. */
|
|
50
51
|
tool?(): ToolSummary;
|
|
51
52
|
}
|
|
53
|
+
/** A call's status from Pi's result fields, which Pi updates in place without invalidating the call. */
|
|
54
|
+
export function callStatus(call: Component): ToolSummary["status"] {
|
|
55
|
+
const { result, isPartial } = call as NativeContent;
|
|
56
|
+
return !result || isPartial !== false ? "running" : result.isError ? "error" : "success";
|
|
57
|
+
}
|
|
52
58
|
|
|
53
59
|
const nameOf = (component: Component): string => component.constructor.name;
|
|
54
60
|
const contentText = (content: unknown): string => typeof content === "string" ? content :
|
|
@@ -91,7 +97,31 @@ function forEachRun(source: NativeAssistant, visit: (kind: ContentKind) => void)
|
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
|
-
|
|
100
|
+
/** One non-spacer native history child, its spacing and the entries projected from it. */
|
|
101
|
+
interface Classified {
|
|
102
|
+
component: Component;
|
|
103
|
+
spacing: Component[];
|
|
104
|
+
entries: ContentEntry[];
|
|
105
|
+
/** Native identities that ownership depends on; Pi sets them at construction. */
|
|
106
|
+
toolCallId: unknown;
|
|
107
|
+
parentId: unknown;
|
|
108
|
+
custom: unknown;
|
|
109
|
+
/** Assistant inputs: Pi replaces the content array whenever it rebuilds the message's blocks. */
|
|
110
|
+
content?: Component[];
|
|
111
|
+
contentLength?: number;
|
|
112
|
+
message?: unknown;
|
|
113
|
+
/** Linked panel inputs: its resolved owner and the panel parts shown as nested calls. */
|
|
114
|
+
parent?: { id: string; owner?: NativeContent; parts?: Component[] };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const parentOf = (component: NativeContent): unknown => component.entry?.data?.parentToolCallId ?? component.message?.details?.parentToolCallId;
|
|
118
|
+
|
|
119
|
+
/** The previous entry for the same native block, when every field that renders or searches it is equal. */
|
|
120
|
+
function reuse(entry: ContentEntry, previous: readonly ContentEntry[]): ContentEntry {
|
|
121
|
+
const match = previous.find(candidate => candidate.source === entry.source && candidate.component === entry.component);
|
|
122
|
+
return match && match.owner === entry.owner && match.kind === entry.kind && match.compact === entry.compact &&
|
|
123
|
+
sameValues(match.spacing, entry.spacing) ? match : entry;
|
|
124
|
+
}
|
|
95
125
|
|
|
96
126
|
/** Read supported native execution identities; unrecognized content is system information. */
|
|
97
127
|
const nativeKinds: Record<string, { kind: ContentKind; accepts(content: NativeContent): boolean }> = {
|
|
@@ -139,11 +169,17 @@ function nativePanelParts(source: NativeContent): Component[] | undefined {
|
|
|
139
169
|
}
|
|
140
170
|
/** Shared semantic index for painting and search, independent of wording, severity and lifecycle. */
|
|
141
171
|
export class NativeContentIndex {
|
|
142
|
-
private signature: unknown[] = [];
|
|
143
172
|
private content: ContentEntry[] = [];
|
|
173
|
+
/** History children, source parts and per-block classification from the last verification. */
|
|
174
|
+
private history: Component[] = [];
|
|
175
|
+
private head: Component[] = [];
|
|
176
|
+
private headEntries: ContentEntry[] = [];
|
|
177
|
+
private blocks: Classified[] = [];
|
|
178
|
+
private readonly owners = new Map<string, NativeContent>();
|
|
144
179
|
private panes: Partial<Record<Pane, ContentEntry[]>> = {};
|
|
145
180
|
private readonly expandedPanels = new WeakMap<Component, Component>();
|
|
146
181
|
private readonly views = new WeakMap<NativeAssistant, Partial<Record<Pane, Container>>>();
|
|
182
|
+
private readonly diagnostics = new WeakMap<NativeAssistant, Component[]>();
|
|
147
183
|
|
|
148
184
|
private pass?: { active: boolean; verified?: { children: Component[]; length: number; last?: Component; parts: number; revision: number } };
|
|
149
185
|
|
|
@@ -185,29 +221,6 @@ export class NativeContentIndex {
|
|
|
185
221
|
return group.map(candidate => stripTerminalSequences(candidate.search(width).text)).filter(Boolean).join("\n\n");
|
|
186
222
|
}
|
|
187
223
|
|
|
188
|
-
/** Visit every native identity that classification depends on, in a fixed order. */
|
|
189
|
-
private visitSignature(history: Container, visit: (value: unknown) => boolean): boolean {
|
|
190
|
-
if (!visit(this.nested.revision)) return false;
|
|
191
|
-
for (const component of this.source.children) if (!visit(component)) return false;
|
|
192
|
-
for (const component of history.children) if (!visit(component)) return false;
|
|
193
|
-
for (const component of history.children) {
|
|
194
|
-
const metadata = component as NativeContent;
|
|
195
|
-
if (!visit(metadata.toolCallId) || !visit(metadata.entry?.data?.parentToolCallId) ||
|
|
196
|
-
!visit(metadata.message?.details?.parentToolCallId) || !visit(metadata.customComponent)) return false;
|
|
197
|
-
if (metadata.entry?.data?.parentToolCallId || metadata.message?.details?.parentToolCallId)
|
|
198
|
-
for (const part of nativePanelParts(metadata) ?? []) if (!visit(part)) return false;
|
|
199
|
-
const native = assistant(component);
|
|
200
|
-
if (native) {
|
|
201
|
-
// Streaming replaces the message on every delta; only its block layout affects routing.
|
|
202
|
-
let changed = false;
|
|
203
|
-
forEachRun(native, kind => { if (!changed && !visit(kind)) changed = true; });
|
|
204
|
-
if (changed || !visit(runsEnd)) return false;
|
|
205
|
-
for (const child of native.contentContainer.children) if (!visit(child)) return false;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
224
|
private refresh(): void {
|
|
212
225
|
const history = this.source.children[2] as Container;
|
|
213
226
|
if (!Array.isArray(history?.children)) throw new Error("Pi's history document is not supported");
|
|
@@ -220,52 +233,73 @@ export class NativeContentIndex {
|
|
|
220
233
|
if (pass) pass.verified = { children, length: children.length, last: children.at(-1), parts: this.source.children.length, revision: this.nested.revision };
|
|
221
234
|
}
|
|
222
235
|
|
|
236
|
+
/** Whether a classified block still has the native inputs its entries were built from. */
|
|
237
|
+
private unchanged(block: Classified): boolean {
|
|
238
|
+
const component = block.component as NativeAssistant & NativeContent;
|
|
239
|
+
if (component.toolCallId !== block.toolCallId || parentOf(component) !== block.parentId || component.customComponent !== block.custom) return false;
|
|
240
|
+
if (block.content) {
|
|
241
|
+
const children = component.contentContainer?.children;
|
|
242
|
+
if (component.contentIsStale === true || children !== block.content || children.length !== block.contentLength ||
|
|
243
|
+
component.lastMessage !== block.message) return false;
|
|
244
|
+
}
|
|
245
|
+
if (block.parent) {
|
|
246
|
+
const owner = this.owners.get(block.parent.id);
|
|
247
|
+
if (owner !== block.parent.owner) return false;
|
|
248
|
+
const parts = owner?.toolCallId && this.nested.entries(owner.toolCallId).length ? nativePanelParts(component) : undefined;
|
|
249
|
+
if (parts ? !sameValues(block.parent.parts, parts) : block.parent.parts) return false;
|
|
250
|
+
}
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Reclassify only blocks whose native inputs changed: new or moved children, rebuilt assistant content,
|
|
256
|
+
* and parented panels whose owner or parts changed. Unchanged blocks keep their entry objects, and the
|
|
257
|
+
* content array keeps its identity while no entry changed, so streaming does not rebuild the index.
|
|
258
|
+
*/
|
|
223
259
|
private verify(history: Container): void {
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const owners = new Map<string, NativeContent>();
|
|
234
|
-
for (const component of history.children) {
|
|
260
|
+
const children = history.children;
|
|
261
|
+
const head = this.source.children;
|
|
262
|
+
let same = 0;
|
|
263
|
+
const limit = Math.min(children.length, this.history.length);
|
|
264
|
+
while (same < limit && children[same] === this.history[same]) same++;
|
|
265
|
+
const structural = same !== children.length || same !== this.history.length;
|
|
266
|
+
if (!structural && sameValues(this.head, head) && this.blocks.every(block => this.unchanged(block))) return;
|
|
267
|
+
this.owners.clear();
|
|
268
|
+
for (const component of children) {
|
|
235
269
|
const adapter = nativeKinds[nameOf(component)];
|
|
236
270
|
const native = component as NativeContent;
|
|
237
271
|
if (adapter?.kind === "tool" && adapter.accepts(native) && typeof native.toolCallId === "string") {
|
|
238
|
-
owners.set(native.toolCallId, native);
|
|
272
|
+
this.owners.set(native.toolCallId, native);
|
|
239
273
|
}
|
|
240
274
|
}
|
|
241
|
-
|
|
275
|
+
// Blocks of the unchanged prefix keep their positions; later children may have moved.
|
|
276
|
+
let previous: Map<Component, Classified> | undefined;
|
|
277
|
+
const find = (component: Component, index: number): Classified | undefined => {
|
|
278
|
+
if (this.blocks[index]?.component === component) return this.blocks[index];
|
|
279
|
+
previous ??= new Map(this.blocks.map(block => [block.component, block]));
|
|
280
|
+
return previous.get(component);
|
|
281
|
+
};
|
|
282
|
+
const blocks: Classified[] = [];
|
|
283
|
+
const entries = head.slice(0, 2).map(component => reuse(this.entry(component, "system", [], false), this.headEntries));
|
|
284
|
+
this.headEntries = entries.slice();
|
|
242
285
|
let spacing: Component[] = [];
|
|
243
|
-
for (
|
|
286
|
+
for (let position = 0; position < children.length; position++) {
|
|
287
|
+
const component = children[position];
|
|
244
288
|
if (nameOf(component) === "Spacer") {
|
|
245
289
|
spacing.push(component);
|
|
246
290
|
continue;
|
|
247
291
|
}
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const parentId = native.entry?.data?.parentToolCallId ?? native.message?.details?.parentToolCallId;
|
|
255
|
-
const owner = kind === "system" && typeof parentId === "string" ? owners.get(parentId) : undefined;
|
|
256
|
-
if (owner && this.expandedPanels.get(component) !== owner) {
|
|
257
|
-
native.setExpanded?.(true);
|
|
258
|
-
this.expandedPanels.set(component, owner);
|
|
259
|
-
} else if (!owner) this.expandedPanels.delete(component);
|
|
260
|
-
const parts = owner && this.nested.entries(owner.toolCallId!).length ? nativePanelParts(native) : undefined;
|
|
261
|
-
if (parts) for (const part of parts) {
|
|
262
|
-
const adapter = nativeKinds[nameOf(part)];
|
|
263
|
-
const partKind = adapter?.accepts(part as NativeContent) ? adapter.kind : "system";
|
|
264
|
-
entries.push(this.entry(part, partKind, [], true, owner));
|
|
265
|
-
} else entries.push(this.entry(component, kind, spacing, true, owner));
|
|
266
|
-
}
|
|
292
|
+
const old = find(component, blocks.length);
|
|
293
|
+
// Spacing before a block in the unchanged prefix lies in that prefix too.
|
|
294
|
+
const sameSpacing = old !== undefined && (position < same || sameValues(old.spacing, spacing));
|
|
295
|
+
const block = old && sameSpacing && this.unchanged(old) ? old : this.classify(component, sameSpacing ? old!.spacing : spacing, old);
|
|
296
|
+
blocks.push(block);
|
|
297
|
+
for (const entry of block.entries) entries.push(entry);
|
|
267
298
|
spacing = [];
|
|
268
299
|
}
|
|
300
|
+
this.blocks = blocks;
|
|
301
|
+
this.history = children.slice();
|
|
302
|
+
this.head = head.slice();
|
|
269
303
|
// Project late execution output beside its owner, never reorder native history.
|
|
270
304
|
const linked = new Map<Component, ContentEntry[]>();
|
|
271
305
|
for (const entry of entries) {
|
|
@@ -274,18 +308,51 @@ export class NativeContentIndex {
|
|
|
274
308
|
group.push(entry);
|
|
275
309
|
linked.set(entry.owner, group);
|
|
276
310
|
}
|
|
277
|
-
|
|
278
|
-
? [entry, ...(linked.get(entry.source) ?? [])] : []);
|
|
279
|
-
this.
|
|
311
|
+
const content = linked.size ? entries.flatMap(entry => entry.owner === entry.source
|
|
312
|
+
? [entry, ...(linked.get(entry.source) ?? [])] : []) : entries;
|
|
313
|
+
if (sameValues(this.content, content)) return;
|
|
314
|
+
this.content = content;
|
|
280
315
|
this.panes = {};
|
|
281
316
|
}
|
|
282
317
|
|
|
318
|
+
/** Build the entries of one native history block, keeping previous entry objects that did not change. */
|
|
319
|
+
private classify(component: Component, spacing: Component[], old: Classified | undefined): Classified {
|
|
320
|
+
const native = component as NativeContent;
|
|
321
|
+
const block: Classified = { component, spacing, entries: [], toolCallId: native.toolCallId, parentId: parentOf(native), custom: native.customComponent };
|
|
322
|
+
const message = assistant(component);
|
|
323
|
+
if (message) {
|
|
324
|
+
block.entries = this.assistantEntries(message, spacing);
|
|
325
|
+
block.content = message.contentContainer.children;
|
|
326
|
+
block.contentLength = block.content.length;
|
|
327
|
+
block.message = message.lastMessage;
|
|
328
|
+
} else {
|
|
329
|
+
const adapter = nativeKinds[nameOf(component)];
|
|
330
|
+
const content = component as NativeContent;
|
|
331
|
+
const kind = adapter?.accepts(content) ? adapter.kind : "system";
|
|
332
|
+
const parentId = block.parentId;
|
|
333
|
+
const owner = kind === "system" && typeof parentId === "string" ? this.owners.get(parentId) : undefined;
|
|
334
|
+
if (owner && this.expandedPanels.get(component) !== owner) {
|
|
335
|
+
content.setExpanded?.(true);
|
|
336
|
+
this.expandedPanels.set(component, owner);
|
|
337
|
+
} else if (!owner) this.expandedPanels.delete(component);
|
|
338
|
+
const parts = owner && this.nested.entries(owner.toolCallId!).length ? nativePanelParts(content) : undefined;
|
|
339
|
+
if (kind === "system" && typeof parentId === "string") block.parent = { id: parentId, owner, parts };
|
|
340
|
+
if (parts) for (const part of parts) {
|
|
341
|
+
const adapter = nativeKinds[nameOf(part)];
|
|
342
|
+
const partKind = adapter?.accepts(part as NativeContent) ? adapter.kind : "system";
|
|
343
|
+
block.entries.push(this.entry(part, partKind, [], true, owner));
|
|
344
|
+
} else block.entries.push(this.entry(component, kind, spacing, true, owner));
|
|
345
|
+
}
|
|
346
|
+
if (old) block.entries = block.entries.map(entry => reuse(entry, old.entries));
|
|
347
|
+
return block;
|
|
348
|
+
}
|
|
349
|
+
|
|
283
350
|
private entry(source: Component, kind: ContentKind, spacing: Component[], compact: boolean, owner?: NativeContent): ContentEntry {
|
|
284
351
|
const tool = kind === "tool" ? (): ToolSummary => {
|
|
285
352
|
const native = source as NativeContent;
|
|
286
353
|
return {
|
|
287
354
|
name: native.toolName!, args: native.args,
|
|
288
|
-
status:
|
|
355
|
+
status: callStatus(native),
|
|
289
356
|
};
|
|
290
357
|
} : undefined;
|
|
291
358
|
return { source, owner: owner ?? source, component: source, kind: owner ? "tool" : kind, spacing, compact, tool, search: width => {
|
|
@@ -343,6 +410,8 @@ export class NativeContentIndex {
|
|
|
343
410
|
padding = [];
|
|
344
411
|
}
|
|
345
412
|
if (slot < runs.length) throw new Error("Pi's assistant content layout is not supported");
|
|
413
|
+
// Entries outlive one classification; search reads the current diagnostics.
|
|
414
|
+
this.diagnostics.set(source, diagnostics);
|
|
346
415
|
const views = this.views.get(source) ?? {};
|
|
347
416
|
this.views.set(source, views);
|
|
348
417
|
const result: ContentEntry[] = [];
|
|
@@ -371,7 +440,7 @@ export class NativeContentIndex {
|
|
|
371
440
|
.map(block => kind === "text" ? block.text ?? "" : block.thinking ?? "").join("\n\n");
|
|
372
441
|
return {
|
|
373
442
|
label: pane === "activity" ? "Thinking" : "Assistant",
|
|
374
|
-
text: [saved, ...(pane === "chat" ? diagnostics.map(child => searchText(child.render(width).join("\n"))) : [])].filter(Boolean).join("\n\n"),
|
|
443
|
+
text: [saved, ...(pane === "chat" ? (this.diagnostics.get(source) ?? []).map(child => searchText(child.render(width).join("\n"))) : [])].filter(Boolean).join("\n\n"),
|
|
375
444
|
reveal: pane === "activity" ? () => source.setHideThinkingBlock(false) : undefined,
|
|
376
445
|
};
|
|
377
446
|
},
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { beforeFirstFrame } from "./startup.ts";
|
|
|
8
8
|
import { observeNativeEditor } from "./native-editor.ts";
|
|
9
9
|
import { NestedCalls } from "./nested-calls.ts";
|
|
10
10
|
|
|
11
|
+
const DELAYS = [1, 2, 3, 5, 10, 30];
|
|
12
|
+
|
|
11
13
|
/** Split native fullscreen history without changing message content or the input dock. */
|
|
12
14
|
export default async function transcript(pi: ExtensionAPI): Promise<void> {
|
|
13
15
|
let layout: TranscriptLayout | undefined;
|
|
@@ -68,15 +70,25 @@ export default async function transcript(pi: ExtensionAPI): Promise<void> {
|
|
|
68
70
|
id: "compactTools", label: "Compact Activity tools",
|
|
69
71
|
description: "Group adjacent tools and expand individual calls inline. Full text stays searchable and copyable.",
|
|
70
72
|
currentValue: preferences.compactTools ? "on" : "off", values: ["on", "off"],
|
|
73
|
+
}, {
|
|
74
|
+
id: "streamTools", label: "Stream latest tools",
|
|
75
|
+
description: "In compact Activity, show new tool calls in full and collapse them after the delay.",
|
|
76
|
+
currentValue: preferences.streamTools ? "on" : "off", values: ["on", "off"],
|
|
77
|
+
}, {
|
|
78
|
+
id: "streamDelay", label: "Collapse delay",
|
|
79
|
+
description: "How long a finished streamed tool call stays fully visible before it collapses.",
|
|
80
|
+
currentValue: `${preferences.streamDelay}s`, values: [...new Set([...DELAYS, preferences.streamDelay])].sort((a, b) => a - b).map(seconds => `${seconds}s`),
|
|
71
81
|
}, {
|
|
72
82
|
id: "height", label: "Conversation height",
|
|
73
83
|
description: "Auto grows to half the history area. Drag sets a manual maximum.",
|
|
74
84
|
currentValue: preferences.chatHeight === null ? "auto" : "manual", values: ["auto", "manual"],
|
|
75
|
-
}],
|
|
85
|
+
}], 7, getSettingsListTheme(), (id, value) => {
|
|
76
86
|
if (id === "timestamps") layout?.setTimestamps(value === "on");
|
|
77
87
|
else if (id === "copyButtons") layout?.setCopyButtons(value === "on");
|
|
78
88
|
else if (id === "buttonStyle") layout?.setButtonStyle(value === "text" ? "text" : "icons");
|
|
79
89
|
else if (id === "compactTools") layout?.setCompactTools(value === "on");
|
|
90
|
+
else if (id === "streamTools") layout?.setStreamTools(value === "on");
|
|
91
|
+
else if (id === "streamDelay") layout?.setStreamDelay(Number.parseInt(value, 10));
|
|
80
92
|
else if (id === "height") layout?.setAutomaticHeight(value === "auto");
|
|
81
93
|
tui.requestRender();
|
|
82
94
|
}, () => done());
|
|
@@ -263,7 +275,7 @@ export default async function transcript(pi: ExtensionAPI): Promise<void> {
|
|
|
263
275
|
const choice = await ctx.ui.select("Copy a block from the active panel", blocks.map(block => block.label));
|
|
264
276
|
blocks.find(block => block.label === choice)?.copy();
|
|
265
277
|
} else if (action === "help") {
|
|
266
|
-
ctx.ui.notify("pi-stereo-view: choose icon or text buttons in /stereo-view settings. Buttons: ▣/Combine combines history, ◫/Split separates it, ▤/Rows and ▥/Columns change layout, ↕/↔/Swap exchanges panels, ↗/Maximize and ↙/Restore change panel size, ⌕/Find searches, ⊟/Compact tools and ⊞/Full tools toggle compact tools, ≡/
|
|
278
|
+
ctx.ui.notify("pi-stereo-view: choose icon or text buttons in /stereo-view settings. Buttons: ▣/Combine combines history, ◫/Split separates it, ▤/Rows and ▥/Columns change layout, ↕/↔/Swap exchanges panels, ↗/Maximize and ↙/Restore change panel size, ⌕/Find searches, ⊟/Compact tools and ⊞/Full tools toggle compact tools, ≡/Settings opens settings, ⧉/Copy copies a block. /stereo-view copy chooses a block with the keyboard. Ctrl+F searches and PgUp/PgDn scroll the active panel; Ctrl+Alt+Up/Down switches it. Drag the ═ or ║ divider to resize.", "info");
|
|
267
279
|
} else if (action === "swap") layout.swap();
|
|
268
280
|
else if (action === "width" && /^\d+$/.test(target ?? "")) layout.setWidth(Number(target));
|
|
269
281
|
else if (action === "height" && target === "auto") layout.setHeight(null);
|