@aiwayds/pi-think-panel 0.3.1 → 0.3.2
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/README.md +3 -2
- package/extensions/pi-think-panel.ts +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,8 +79,9 @@ The setting is persisted to `~/.pi/agent/think-panel.json` as
|
|
|
79
79
|
(expand tool output) and `ctrl+h` remain pi-native.
|
|
80
80
|
- Lines are **visual lines** after ANSI-aware wrapping to the current terminal
|
|
81
81
|
width — the view reflows on resize.
|
|
82
|
-
- Shows while the model is thinking; the viewport
|
|
83
|
-
|
|
82
|
+
- Shows while the model is thinking; the viewport **auto-hides the moment
|
|
83
|
+
thinking stops** (`thinking_end`) and clears again on turn settle
|
|
84
|
+
(`agent_settled`, safety net) or when thinking is switched off.
|
|
84
85
|
- Completed think blocks within a turn are separated by a blank line.
|
|
85
86
|
|
|
86
87
|
> - 从 `message_update` 事件捕获实时思考,渲染在输入框上方 widget 槽位——
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
* Lines are VISUAL lines after wrapping to the current terminal width
|
|
16
16
|
* (ANSI-aware via pi-tui's wrapTextWithAnsi), so the view reflows on resize.
|
|
17
17
|
*
|
|
18
|
+
* Shows while the model is thinking and **auto-hides the moment thinking
|
|
19
|
+
* stops** (thinking_end); a later block in the same turn re-shows it. The
|
|
20
|
+
* turn settle (agent_settled) remains a safety-net reset.
|
|
21
|
+
*
|
|
18
22
|
* Configuration: /think-panel [1|3|5|7|off] — persisted to
|
|
19
23
|
* ~/.pi/agent/think-panel.json as {"lines": N} (0 = off). With `off` (or no
|
|
20
24
|
* active thinking) the widget renders zero rows and takes no space.
|
|
@@ -182,13 +186,17 @@ export default function (pi: ExtensionAPI): void {
|
|
|
182
186
|
blocks.push(blockText);
|
|
183
187
|
blockText = "";
|
|
184
188
|
}
|
|
189
|
+
thinkActive = true;
|
|
190
|
+
} else if (t === "thinking_end") {
|
|
191
|
+
// Thinking stopped → auto-hide immediately; a later block re-shows.
|
|
192
|
+
resetViewport();
|
|
185
193
|
} else {
|
|
186
194
|
blockText = extractThinking(event.message);
|
|
187
195
|
if (blockText.length > MAX_RETAINED_CHARS) {
|
|
188
196
|
blockText = blockText.slice(-MAX_RETAINED_CHARS);
|
|
189
197
|
}
|
|
198
|
+
thinkActive = true;
|
|
190
199
|
}
|
|
191
|
-
thinkActive = true;
|
|
192
200
|
tui?.requestRender();
|
|
193
201
|
});
|
|
194
202
|
|
package/package.json
CHANGED