@each1024/pi-mini-mode 1.3.7 → 1.3.9
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 +80 -63
- package/README.zh-CN.md +105 -57
- package/extensions/footer-status.ts +17 -3
- package/lib/footer-tidy.ts +12 -59
- package/lib/transcript-adapter.ts +8 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,40 +1,14 @@
|
|
|
1
|
-
<p
|
|
2
|
-
<img src="assets/
|
|
1
|
+
<p>
|
|
2
|
+
<img src="assets/readme-cover.en.svg" alt="Pi Mini Mode — Less noise. More focus. Image input, foldable conversations, subagents, themes and a live footer." width="100%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
<a href="#install">Install</a> · <a href="#make-it-yours">Settings</a> · <a href="https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763">Watch demo</a> · <a href="README.zh-CN.md">中文</a>
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
A compact, configurable footer for [Pi](https://pi.dev). Your model, usage, cost estimate, context, and generation speed — at a glance.
|
|
10
|
-
|
|
11
|
-
## Minimal output
|
|
12
|
-
|
|
13
|
-
`/pi-mini-mode-settings` has one **Minimal output** switch, off by default. On collapses the process; off restores Pi's native history. Legacy per-item controls are hidden and no longer filter content. Lens settings are unchanged.
|
|
14
|
-
|
|
15
|
-
- `/pi-mini-mode-minimal on` shows the user's Markdown on an accent-tinted surface, a background-free process summary, and the final reply without a heading or extra background. No duplicate dock panel.
|
|
16
|
-
- Each turn uses one shared tree showing the latest **ten summary entries**: available thinking, tool calls, streaming tool output, and skill reads. `Ctrl+O` expands the full Markdown process and toggles it closed again; new questions start collapsed; tools without output show an elapsed wait counter, and empty progress events never overwrite existing content; there are no section headings, collapsed counts, or completion labels. Original session messages remain intact.
|
|
17
|
-
- Agent/subagent calls share the same chronological tree as tools and skills; `Ctrl+O` reveals tasks and Markdown output. A returned call does not imply background completion.
|
|
18
|
-
- The pi-subagents `async subagent` / `Async agents` widget uses a background-free status tree, retaining native detail shortcuts and output paths. This adapter is active only in minimal mode, restores on disable, and passes unknown formats through. Grouping design reference: [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions).
|
|
19
|
-
- `/pi-mini-mode-history` browses complete process entries, five at a time.
|
|
20
|
-
- Final Markdown streams as text events arrive; failures and interruptions are indicated.
|
|
21
|
-
- `/reload` remounts the transcript, including history created in native mode. Expanded tree rails continue through paragraphs, blank lines and code blocks.
|
|
22
|
-
- `/pi-mini-mode-minimal off` restores Pi's default conversation history.
|
|
23
|
-
|
|
24
|
-
The user surface blends the active Pi accent with its user background. Process and answer text have no background. User padding is two terminal columns horizontally and one row vertically. Markdown, highlighted code, tables and Mermaid terminal diagrams work in light/dark themes; incomplete, unsupported or over-wide diagrams retain their source. **Minimal mode uses a private Pi 0.85.x layout adapter**, without patching the Pi installation. Unknown layouts refuse activation and retain native output. Recheck compatibility after Pi upgrades; another extension replacing the transcript may conflict.
|
|
25
|
-
|
|
26
|
-
Checks: `npm run check && npm test`. Real terminal smoke test: `python3 test/minimal-pty.py` (Python 3, Node, and the installed dependency's bundled Pi CLI). It uses temporary fixtures, tests regular/fullscreen, toggling, ten-entry process and Ctrl+O expand/collapse, restored results, and narrow terminals, without model calls.
|
|
27
|
-
|
|
28
|
-
## Input enhancements
|
|
5
|
+
[中文](README.zh-CN.md) · [Install](#install) · [Features](#features) · [Commands](#commands) · [Reference](#reference)
|
|
29
6
|
|
|
30
|
-
|
|
7
|
+
# Pi Mini Mode
|
|
31
8
|
|
|
32
|
-
|
|
33
|
-
- Move the editing cursor into an image path, or hover it in fullscreen, to preview it. Requires a terminal image protocol; otherwise a path hint is shown. Esc dismisses it. Reads are limited to 20 MB.
|
|
34
|
-
- Type `/` at the beginning or after whitespace to select a skill at the current cursor. Inline `/skill:name` tokens expand on submission; URL/path slashes keep native behavior.
|
|
35
|
-
- Images appear as underlined `[image1]` labels in the editor and messages. Cmd+click opens the original file with its default application; other file paths remain clickable too. Fullscreen editor hover requests a link pointer and restores it on exit. Quoted paths support spaces.
|
|
9
|
+
**Less noise. More focus.**
|
|
36
10
|
|
|
37
|
-
|
|
11
|
+
An everyday refinement for [Pi](https://pi.dev), not just a footer. Preview images at the cursor, fold long messages and process details, inspect subagent work, and keep your session’s essential signals in view.
|
|
38
12
|
|
|
39
13
|
## Install
|
|
40
14
|
|
|
@@ -42,7 +16,9 @@ Link modifiers depend on the terminal: usually Cmd+click on macOS and Ctrl+click
|
|
|
42
16
|
pi install npm:@each1024/pi-mini-mode
|
|
43
17
|
```
|
|
44
18
|
|
|
45
|
-
Run `/reload` in Pi
|
|
19
|
+
Run `/reload` in Pi, then open `/pi-mini-mode-settings` to make it yours.
|
|
20
|
+
|
|
21
|
+
**Pi ≥ 0.84.0.** Input enhancements and minimal output are on by default. Minimal mode uses a private **Pi 0.85.x** layout adapter—see [compatibility](#compatibility) before enabling it.
|
|
46
22
|
|
|
47
23
|
<details>
|
|
48
24
|
<summary>Install from GitHub instead</summary>
|
|
@@ -53,55 +29,81 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
53
29
|
|
|
54
30
|
</details>
|
|
55
31
|
|
|
56
|
-
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
### 01 / Input, refined
|
|
35
|
+
|
|
36
|
+
**Images at your cursor.** Move the editing cursor into an image path or compact label to preview it. Fullscreen also supports editor hover. Press `Esc` to dismiss.
|
|
37
|
+
|
|
38
|
+
**Less path clutter. Same image.** Image paths become underlined `[image1]` labels in the editor and messages, preserving the original path when submitted. Open the original image or another linked file in its default app using your terminal’s link gesture.
|
|
39
|
+
|
|
40
|
+
**Skills where you type.** Enter `/` at the start or after whitespace to find a skill and insert `/skill:name` at the cursor. Inline skills expand on submission; URLs and paths keep their normal behavior.
|
|
41
|
+
|
|
42
|
+
Paste images with `Ctrl+V` (`Alt+V` on Windows/WSL). Disabling input enhancements preserves Pi’s native clipboard behavior.
|
|
57
43
|
|
|
58
|
-
|
|
59
|
-
<tr>
|
|
60
|
-
<td width="50%" valign="top">
|
|
44
|
+
### 02 / Process, quieter
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
Enable **Minimal output** in settings, or run `/pi-mini-mode-minimal on`.
|
|
63
47
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- Latest generation speed
|
|
48
|
+
- **Long prompts, folded.** In fullscreen minimal mode, long user messages show the first four rendered rows. Click the fold control to reveal the rest, or select a message with `/pi-mini-mode-prompts`. Complete fenced code blocks stay intact.
|
|
49
|
+
- **Subagents, in plain sight.** Click a subagent row to expand its available activity and message/final output. A dispatch receipt or returned tool call is not a completed background task.
|
|
50
|
+
- **A process tree, not a wall of output.** Thinking, tools and skill reads share one chronological tree. The latest ten summaries stay visible; `Ctrl+O` expands or collapses the full process. New questions start collapsed.
|
|
51
|
+
- **Tool details on demand.** Expand a tool/thinking entry using its fold control or `/pi-mini-mode-tools`. Tool details show saved text, not the original custom renderer or image output.
|
|
52
|
+
- **Room for the answer.** Final Markdown streams without extra headings or backgrounds. Failures and interruptions stay explicit. Folding changes presentation, not stored session messages.
|
|
70
53
|
|
|
71
|
-
|
|
72
|
-
<td width="50%" valign="top">
|
|
54
|
+
`/pi-mini-mode-history` opens complete process entries, five at a time. `/pi-mini-mode-minimal off` restores native Pi history.
|
|
73
55
|
|
|
74
|
-
###
|
|
56
|
+
### 03 / Session, in focus
|
|
75
57
|
|
|
76
|
-
|
|
58
|
+
**Light and dark, considered.** Includes `cc-light` and `cc-dark`, derived from [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions) under MIT. User messages use the theme’s user-message surface; Markdown, highlighted code, tables and supported Mermaid diagrams adapt to the theme. Unsupported, incomplete or over-wide diagrams retain their source.
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
**The useful signals, in one line.** Model and thinking level, session tokens, cache totals and hit rate, estimated cost, context usage and generation speed. Choose your fields in `/pi-mini-mode-settings`; changes take effect immediately, and the footer adapts to narrow terminals.
|
|
79
61
|
|
|
80
|
-
|
|
62
|
+
<details>
|
|
63
|
+
<summary>See the footer settings and demo</summary>
|
|
64
|
+
|
|
65
|
+
[](assets/pi-mini-mode-settings.jpg)
|
|
66
|
+
|
|
67
|
+
[Watch the footer settings demo](https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763)
|
|
68
|
+
|
|
69
|
+
This earlier screenshot and recording show footer configuration, not the newer image, folding or subagent features. Settings previews use sample data.
|
|
81
70
|
|
|
82
|
-
</
|
|
83
|
-
|
|
84
|
-
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
85
74
|
|
|
86
|
-
|
|
75
|
+
| Command / shortcut | Purpose |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `/pi-mini-mode-settings` | Configure fields, input enhancements and minimal output |
|
|
78
|
+
| `/pi-mini-mode-minimal on` / `off` | Enable minimal output / restore native history |
|
|
79
|
+
| `Ctrl+O` | Expand or collapse the complete process tree |
|
|
80
|
+
| `/pi-mini-mode-prompts` | Select and expand/collapse a user message¹ |
|
|
81
|
+
| `/pi-mini-mode-tools` | Select and expand/collapse saved tool text or thinking¹ |
|
|
82
|
+
| `/pi-mini-mode-history` | Browse full process entries, five at a time |
|
|
83
|
+
| `/reload` | Reload the extension after installation or source changes |
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
¹ Requires fullscreen minimal output. Subagent rows have their own click-to-expand control; supported third-party widgets retain native detail shortcuts.
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
## Compatibility
|
|
91
88
|
|
|
89
|
+
- **Images:** previews require a terminal image protocol; unsupported terminals show a hint. Image reads are limited to **20 MB**, and deleted files cannot be reopened. Link gestures depend on the terminal: usually `Cmd+click` on macOS or `Ctrl+click` on Windows/Linux; Ghostty fullscreen may require `Shift+Cmd` / `Shift+Ctrl`. Pi fullscreen also supports direct link clicks. See [Pi terminal setup](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/docs/terminal-setup.md).
|
|
90
|
+
- **Minimal output:** uses a private Pi 0.85.x layout adapter without patching Pi’s installation. Unknown layouts refuse activation and keep native output. Recheck after Pi upgrades; other transcript-replacing extensions can conflict.
|
|
91
|
+
- **Subagents:** the pi-subagents widget adapter runs only in minimal mode, restores on disable, and passes unknown formats through. Available details depend on the integration’s status/output data; this is not a complete subagent transcript viewer.
|
|
92
|
+
- **History:** `/reload` remounts the transcript, including history created in native mode. Empty progress events do not erase existing content; tools without output show elapsed waiting time. Legacy per-item minimal controls no longer filter content.
|
|
93
|
+
- **Metrics:** costs are estimates, not provider invoices. See the calculation details below.
|
|
92
94
|
|
|
93
95
|
## Reference
|
|
94
96
|
|
|
95
97
|
<details>
|
|
96
98
|
<summary><strong>First run & configuration</strong> — defaults, controls, and settings file</summary>
|
|
97
99
|
|
|
98
|
-
On the first interactive TUI session, Pi Mini Mode shows a preview
|
|
100
|
+
On the first interactive TUI session, Pi Mini Mode shows a preview. Footer metrics are on by default except MCP count; the dot-matrix style is off; minimal output is on:
|
|
99
101
|
|
|
100
102
|
```text
|
|
101
103
|
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
|
|
102
104
|
```
|
|
103
105
|
|
|
104
|
-
The first-run picker offers **Keep defaults** and **Configure now**. Keeping defaults
|
|
106
|
+
The first-run picker offers **Keep defaults** and **Configure now**. Keeping defaults saves the default field selection, leaves minimal output on, and prevents the prompt from appearing again; configuring opens the same settings list immediately. Print, JSON, and other non-interactive modes never prompt.
|
|
105
107
|
|
|
106
108
|
Open that settings UI any time with:
|
|
107
109
|
|
|
@@ -123,11 +125,14 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
|
|
|
123
125
|
"pi-mini-mode-session-tokens-show": true,
|
|
124
126
|
"pi-mini-mode-cache-tokens-show": true,
|
|
125
127
|
"pi-mini-mode-cost-show": true,
|
|
128
|
+
"pi-mini-mode-mcp-show": false,
|
|
126
129
|
"pi-mini-mode-context-show": true,
|
|
127
130
|
"pi-mini-mode-context-dots-show": false,
|
|
128
131
|
"pi-mini-mode-context-percent-show": true,
|
|
129
132
|
"pi-mini-mode-speed-show": true,
|
|
130
133
|
"pi-mini-mode-speed-unit-show": true,
|
|
134
|
+
"pi-mini-mode-minimal-show": true,
|
|
135
|
+
"pi-mini-mode-input-enhancements": true,
|
|
131
136
|
"onboardingCompleted": true
|
|
132
137
|
}
|
|
133
138
|
```
|
|
@@ -146,7 +151,7 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
|
|
|
146
151
|
| `pi-mini-mode-context-percent-show` | `true` | Context-use percentage |
|
|
147
152
|
| `pi-mini-mode-speed-show` | `true` | Generation speed at the far right |
|
|
148
153
|
| `pi-mini-mode-speed-unit-show` | `true` | Generation-speed sub-setting: append `tok/s` to the numeric value |
|
|
149
|
-
| `pi-mini-mode-minimal-show` | `
|
|
154
|
+
| `pi-mini-mode-minimal-show` | `true` | Minimal output; off restores Pi's default conversation history |
|
|
150
155
|
| `pi-mini-mode-input-enhancements` | `true` | Image previews, inline skills, and message file links |
|
|
151
156
|
| `onboardingCompleted` | `false` initially | Internal marker that prevents another first-run prompt |
|
|
152
157
|
|
|
@@ -175,20 +180,32 @@ The price is the same finalized active-branch usage and configured per-million-t
|
|
|
175
180
|
Install only the local copy while developing; installing npm and local copies together double-registers the extension:
|
|
176
181
|
|
|
177
182
|
```bash
|
|
178
|
-
pi remove npm:@each1024/pi-mini-mode && pi install /path/to/pi-
|
|
183
|
+
pi remove npm:@each1024/pi-mini-mode && pi install /path/to/pi-mini-mode
|
|
179
184
|
npm run check
|
|
180
185
|
npm test
|
|
181
186
|
```
|
|
182
187
|
|
|
183
|
-
After source changes, run `/reload` in an already-open Pi session. `npm run check` runs TypeScript checking and `npm test` runs the
|
|
188
|
+
After source changes, run `/reload` in an already-open Pi session. `npm run check` runs TypeScript checking and `npm test` runs the project self-checks.
|
|
189
|
+
|
|
190
|
+
For a real terminal smoke test, run `python3 test/minimal-pty.py`. It needs Python 3, Node, and the installed dependency’s bundled Pi CLI. Temporary fixtures cover regular/fullscreen output, toggling, process expansion, restored results, and narrow terminals without model calls.
|
|
184
191
|
|
|
185
192
|
</details>
|
|
186
193
|
|
|
187
|
-
|
|
194
|
+
<details>
|
|
195
|
+
<summary><strong>Publishing</strong></summary>
|
|
188
196
|
|
|
189
197
|
Pushes to `main` automatically publish to npm after `npm ci`, `npm run check`, and `npm test`; the workflow also supports manual dispatch on `main`. Each release uses the higher of the local version baseline and npm's latest stable version plus one patch. Versions change only in the runner, with no version commits or tags; raise the baseline in `package.json` and the lockfile for a major/minor release. Already-published commits are skipped. Actions concurrency can replace pending pushes, so not every push (or every commit within a push) is guaranteed a separate package release.
|
|
190
198
|
|
|
191
|
-
|
|
199
|
+
Releases require the package’s npm Trusted Publisher to be configured for this GitHub repository and `publish.yml`. Subsequent publishing uses OIDC and provenance without an npm token.
|
|
200
|
+
|
|
201
|
+
</details>
|
|
202
|
+
|
|
203
|
+
<details>
|
|
204
|
+
<summary><strong>Collaboration guidance</strong></summary>
|
|
205
|
+
|
|
206
|
+
The main session owns requirement alignment, risk research, the complete solution, task scheduling, key decisions, integration, and the final summary. Before implementation, it should investigate the key risks, boundaries, acceptance criteria, and solution. Once authorized, use subagents aggressively and parallelize independent work to save time, while respecting relevance, risk, budget, concurrency, and single-writer constraints. Use the `low` model by default for most tasks and subagents; upgrade only for complex reasoning, key decisions, or risk reviews when necessary.
|
|
207
|
+
|
|
208
|
+
</details>
|
|
192
209
|
|
|
193
210
|
---
|
|
194
211
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,87 +1,109 @@
|
|
|
1
|
-
|
|
1
|
+
<p>
|
|
2
|
+
<img src="assets/readme-cover.zh-CN.svg" alt="Pi Mini Mode — 少一点干扰,多一点专注。图片输入、可折叠对话、子代理、明暗主题与实时页脚。" width="100%">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
[English](README.md)
|
|
5
|
+
[English](README.md) · [安装](#安装) · [功能](#功能) · [命令速查](#命令速查) · [参考](#参考)
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
<img src="assets/pi-mini-mode-hero.png" alt="Pi Mini Mode:显示模型、令牌、缓存、费用、上下文和生成速度的紧凑页脚" width="100%">
|
|
7
|
-
</p>
|
|
7
|
+
# Pi Mini Mode
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
<a href="#安装">安装</a> · <a href="#按需配置">配置</a> · <a href="https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763">观看演示</a> · <a href="README.md">English</a>
|
|
11
|
-
</p>
|
|
9
|
+
**少一点干扰。多一点专注。**
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
为 [Pi](https://pi.dev) 的日常工作做一点精细的改进,不止于页脚。光标处预览图片,折叠长消息和过程详情,展开子代理工作,让重要的会话状态始终清晰。
|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## 安装
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
```bash
|
|
16
|
+
pi install npm:@each1024/pi-mini-mode
|
|
17
|
+
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
在 Pi 中运行 `/reload`,再用 `/pi-mini-mode-settings` 按你的习惯配置。
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
**需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- 输入起点或空白后输入 `/` 搜索技能,选择后在当前光标处插入 `/skill:name`,提交时展开行内技能;不抢占 URL 或路径中的斜杠。
|
|
26
|
-
- 输入框及消息中的图片显示为 `[image1]` 等带下划线的标签;Cmd+点击图片标签及其他文件路径,使用系统默认应用打开原文件。全屏悬停标签会切换为链接指针,移出恢复。支持绝对路径、相对路径和引号/反引号包裹的含空格路径。
|
|
23
|
+
<details>
|
|
24
|
+
<summary>也可以从 GitHub 安装</summary>
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
```bash
|
|
27
|
+
pi install git:github.com/eachann1024/pi-mini-mode
|
|
28
|
+
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
</details>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
- 每轮使用一棵共享树,显示最新 **10 条摘要**,包括可用的思考、工具调用、流式工具输出和技能读取。按 `Ctrl+O` 可展开完整 Markdown 过程,再按一次收起;新问题默认收起。没有输出的工具会显示已等待时间,空的进度事件不会覆盖已有内容,也不会显示分组标题、折叠数量或完成标签。原始会话消息保持不变。
|
|
34
|
-
- Agent/subagent 调用会按时间顺序与工具、技能共用同一棵树;按 `Ctrl+O` 可查看任务和 Markdown 输出。调用返回并不代表后台任务已经完成。
|
|
35
|
-
- pi-subagents 的 `async subagent` / `Async agents` 小组件使用无背景的状态树,同时保留原生详情快捷键和输出路径。此适配器只在极简模式启用,关闭后恢复原状,未知格式会直接交给原生处理。分组设计参考 [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions)。
|
|
36
|
-
- `/pi-mini-mode-history` 可浏览完整过程记录,每次显示 5 条。
|
|
37
|
-
- 最终 Markdown 会随着文本事件流式显示;失败和中断会明确标记。
|
|
38
|
-
- `/reload` 会重新挂载 transcript,也会包含原生模式中产生的历史记录。展开状态的树形连接线会贯穿段落、空行和代码块。
|
|
39
|
-
- `/pi-mini-mode-minimal off` 恢复 Pi 默认的对话历史显示。
|
|
32
|
+
## 功能
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
### 01 / 输入,更顺手
|
|
42
35
|
|
|
43
|
-
|
|
36
|
+
**图片,随光标浮现。** 编辑光标移入图片路径或紧凑标签,即可预览。全屏编辑器也支持悬停,按 `Esc` 关闭。
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
**收起路径,保留原图。** 输入框和消息中的图片路径收纳为带下划线的 `[image1]` 标签,提交时保留原始路径。使用终端的链接点击手势,即可通过系统默认应用打开原图或其他文件。
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
pi install npm:@each1024/pi-mini-mode
|
|
49
|
-
```
|
|
40
|
+
**技能,就在输入处。** 在输入起点或空白后键入 `/` 搜索技能,在当前光标处插入 `/skill:name`,提交时展开。URL 和文件路径中的斜杠保持原有行为。
|
|
50
41
|
|
|
51
|
-
|
|
42
|
+
使用 `Ctrl+V` 粘贴图片,Windows/WSL 使用 `Alt+V`。关闭输入增强不会关闭 Pi 原生剪贴板功能。
|
|
52
43
|
|
|
53
|
-
|
|
44
|
+
### 02 / 过程,更安静
|
|
54
45
|
|
|
55
|
-
|
|
56
|
-
pi install git:github.com/eachann1024/pi-mini-mode
|
|
57
|
-
```
|
|
46
|
+
在设置中开启 **极简输出**,或运行 `/pi-mini-mode-minimal on`。
|
|
58
47
|
|
|
59
|
-
|
|
48
|
+
- **长消息,自动折叠。** 全屏极简模式下,长用户消息默认保留前四个显示行。点击折叠控件展开全文,或用 `/pi-mini-mode-prompts` 选择消息。完整代码围栏保持完整。
|
|
49
|
+
- **子代理,清晰可查。** 点击子代理行,展开可用的活动记录与消息/最终输出。任务派发回执或工具调用返回,不等于后台任务已完成。
|
|
50
|
+
- **过程是一棵树,而非满屏输出。** 思考、工具与技能读取汇入同一棵时间顺序树,显示最新十条摘要;`Ctrl+O` 展开/收起完整过程,新问题默认收起。
|
|
51
|
+
- **工具详情,按需展开。** 点击工具/思考条目的折叠控件,或用 `/pi-mini-mode-tools` 选择。工具详情展示保存的文本,不还原原生自定义渲染器或图片输出。
|
|
52
|
+
- **把空间留给答案。** 最终 Markdown 流式呈现,不添加额外标题或背景。失败和中断明确标记;折叠只改变显示,不删除原始会话消息。
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
`/pi-mini-mode-history` 每次浏览五条完整过程记录;`/pi-mini-mode-minimal off` 恢复 Pi 原生历史。
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
- 会话令牌总数
|
|
65
|
-
- 缓存令牌与命中率
|
|
66
|
-
- 会话费用估算
|
|
67
|
-
- 上下文用量与进度条
|
|
68
|
-
- 最新生成速度
|
|
56
|
+
### 03 / 状态,更清晰
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
**明暗,皆有章法。** 自带 `cc-light` 与 `cc-dark`,源自 [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions),采用 MIT 许可。用户消息使用主题的用户背景色;Markdown、代码高亮、表格及支持的 Mermaid 图表适配明暗主题。不支持、不完整或过宽的图表保留源文本。
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
**重要指标,一行看清。** 模型与思考级别、会话令牌、缓存总量与命中率、费用估算、上下文用量与生成速度。在 `/pi-mini-mode-settings` 中选择显示字段,即时生效,页脚自动适配窄终端。
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>查看页脚设置截图与演示</summary>
|
|
64
|
+
|
|
65
|
+
[](assets/pi-mini-mode-settings.jpg)
|
|
75
66
|
|
|
76
|
-
|
|
67
|
+
[观看页脚设置演示](https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763)
|
|
77
68
|
|
|
78
|
-
|
|
69
|
+
这份已有截图和录屏展示页脚配置,不代表新增图片、折叠与子代理功能的当前界面。设置预览使用示例数据。
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## 命令速查
|
|
74
|
+
|
|
75
|
+
| 命令/快捷键 | 用途 |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `/pi-mini-mode-settings` | 配置字段、输入增强和极简输出 |
|
|
78
|
+
| `/pi-mini-mode-minimal on` / `off` | 开启极简输出/恢复原生历史 |
|
|
79
|
+
| `Ctrl+O` | 展开/收起完整过程树 |
|
|
80
|
+
| `/pi-mini-mode-prompts` | 选择并展开/收起用户消息¹ |
|
|
81
|
+
| `/pi-mini-mode-tools` | 选择并展开/收起保存的工具文本或思考¹ |
|
|
82
|
+
| `/pi-mini-mode-history` | 浏览完整过程记录,每次五条 |
|
|
83
|
+
| `/reload` | 安装或修改源码后重载扩展 |
|
|
84
|
+
|
|
85
|
+
¹ 需要全屏极简输出。子代理行有独立的点击展开控件;受支持的第三方小组件保留原生详情快捷键。
|
|
86
|
+
|
|
87
|
+
## 兼容性
|
|
88
|
+
|
|
89
|
+
- **图片:** 预览依赖终端图片协议,不支持时显示提示。读取上限 **20 MB**,文件被清理后无法重新打开。点击手势由终端决定:macOS 通常使用 `Cmd+点击`,Windows/Linux 通常使用 `Ctrl+点击`;Ghostty 全屏可能需要 `Shift+Cmd` / `Shift+Ctrl`。Pi 全屏也支持直接点击链接。参见 [Pi 终端设置](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/docs/terminal-setup.md)。
|
|
90
|
+
- **极简输出:** 使用私有 Pi 0.85.x 布局适配器,不修改 Pi 安装目录。未知布局会拒绝启用并保留原生输出;升级 Pi 后需重新检查,其他替换 transcript 的扩展可能冲突。
|
|
91
|
+
- **子代理:** pi-subagents 小组件适配仅在极简模式启用,关闭后恢复原状,未知格式原样交给原生处理。可用详情取决于集成提供的状态/输出数据,不是完整子代理会话查看器。
|
|
92
|
+
- **历史:** `/reload` 会重新挂载 transcript,包含原生模式中产生的历史。空进度事件不覆盖已有内容;无输出的工具显示等待时间。旧的极简输出细项不再单独过滤内容。
|
|
93
|
+
- **指标:** 费用是估算,不是 provider 账单。计算方式见下方参考。
|
|
94
|
+
|
|
95
|
+
## 参考
|
|
96
|
+
|
|
97
|
+
<details>
|
|
98
|
+
<summary><strong>首次使用与配置</strong></summary>
|
|
99
|
+
|
|
100
|
+
首次进入交互式 TUI 会话时,Pi Mini Mode 显示设置预览。页脚指标除 MCP 数量外默认开启,点阵样式默认关闭,极简输出默认开启,例如:
|
|
79
101
|
|
|
80
102
|
```text
|
|
81
103
|
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
|
|
82
104
|
```
|
|
83
105
|
|
|
84
|
-
首次设置会提供 **Keep defaults(保留默认值)** 和 **Configure now
|
|
106
|
+
首次设置会提供 **Keep defaults(保留默认值)** 和 **Configure now(立即配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。Print、JSON 等非交互模式不会显示提示。
|
|
85
107
|
|
|
86
108
|
设置保存在 Pi 的 agent 目录中,通常是 `~/.pi/agent/pi-mini-mode.json`;如果 Pi 使用其他配置目录,则保存在对应目录。文件缺失或格式错误时会安全回退到默认设置。设置示例:
|
|
87
109
|
|
|
@@ -99,6 +121,8 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
|
|
|
99
121
|
"pi-mini-mode-context-percent-show": true,
|
|
100
122
|
"pi-mini-mode-speed-show": true,
|
|
101
123
|
"pi-mini-mode-speed-unit-show": true,
|
|
124
|
+
"pi-mini-mode-minimal-show": true,
|
|
125
|
+
"pi-mini-mode-input-enhancements": true,
|
|
102
126
|
"onboardingCompleted": true
|
|
103
127
|
}
|
|
104
128
|
```
|
|
@@ -117,13 +141,19 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
|
|
|
117
141
|
| `pi-mini-mode-context-percent-show` | `true` | 显示上下文使用百分比 |
|
|
118
142
|
| `pi-mini-mode-speed-show` | `true` | 显示最新生成速度 |
|
|
119
143
|
| `pi-mini-mode-speed-unit-show` | `true` | 速度子设置:在数字后追加 `tok/s` |
|
|
120
|
-
| `pi-mini-mode-minimal-show` | `
|
|
144
|
+
| `pi-mini-mode-minimal-show` | `true` | 极简输出总开关;关闭则恢复 Pi 默认历史显示 |
|
|
121
145
|
| `pi-mini-mode-input-enhancements` | `true` | 图片预览、行内技能补全与展开、消息文件链接 |
|
|
122
146
|
| `onboardingCompleted` | 初始为 `false` | 防止再次显示首次设置提示的内部标记 |
|
|
123
147
|
|
|
124
148
|
生成速度设置中的 **显示 tok/s 单位** 是 **显示最新生成速度** 下方的缩进子设置。关闭它只会移除 `tok/s`,保留速度数字;即使隐藏生成速度,该子设置仍会保留。
|
|
125
149
|
|
|
126
|
-
|
|
150
|
+
|
|
151
|
+
设置命令需要 Pi 的 TUI 模式。预览使用固定示例数据而非当前会话,但会即时反映每项开关。选中项及对应预览字段会突出显示;全屏支持悬停聚焦、点击切换,普通终端使用键盘操作,悬停本身不会改变设置。
|
|
152
|
+
|
|
153
|
+
</details>
|
|
154
|
+
|
|
155
|
+
<details>
|
|
156
|
+
<summary><strong>指标如何计算</strong></summary>
|
|
127
157
|
|
|
128
158
|
会话总量来自当前会话分支中每一条已完成的 `assistant` 和 `toolResult` 记录。工具报告的嵌套 LLM 工作(例如子 Agent)会准确计入一次。若 provider 提供 `totalTokens`,`Total` 使用该值;较旧或自定义结果没有该字段时,则使用输入、输出、缓存读取和缓存写入令牌之和。`Cached` 是缓存读取与写入之和(包含在 `Total` 中);`CH` 是缓存读取量除以输入量与缓存读取量之和。只有已持久化的最终用量会计入,因此流式更新不会重复累计。
|
|
129
159
|
|
|
@@ -131,7 +161,10 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █
|
|
|
131
161
|
|
|
132
162
|
在获得可测量响应前,速度字段完全不显示,不会出现 `-- tok/s` 占位符。速度位于页脚最右侧;启用上下文百分比时,百分比紧邻其左侧。颜色遵循 Pi 主题语义:至少 30 tok/s 为成功色,10–29.9 tok/s 为警告色,低于 10 tok/s 为错误色。费用是基于当前分支已完成用量和配置的每百万令牌费率得出的估算,并非 provider 账单。窄终端中,页脚会丢弃或截断优先级较低的内容,确保保持单行且不溢出。
|
|
133
163
|
|
|
134
|
-
|
|
164
|
+
</details>
|
|
165
|
+
|
|
166
|
+
<details>
|
|
167
|
+
<summary><strong>开发与检查</strong></summary>
|
|
135
168
|
|
|
136
169
|
开发时只安装本地副本;同时安装 npm 版本和本地版本会导致扩展重复注册:
|
|
137
170
|
|
|
@@ -149,12 +182,27 @@ python3 test/minimal-pty.py
|
|
|
149
182
|
|
|
150
183
|
该测试需要 Python 3、Node 以及已安装依赖中自带的 Pi CLI;会使用临时 fixture,覆盖普通/全屏模式、切换、10 条过程记录、`Ctrl+O` 展开/收起、恢复结果和窄终端,不会调用模型。
|
|
151
184
|
|
|
152
|
-
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary><strong>发布</strong></summary>
|
|
153
189
|
|
|
154
190
|
推送到 `main` 后,GitHub Actions 会在通过 `npm ci`、`npm run check` 和 `npm test` 后自动发布到 npm;也支持在 `main` 上手动触发。每次发布都会取本地版本基线与 npm 最新稳定版本加一个 patch 中的较高者。版本只在 runner 中变更,不创建版本提交或 tag;发布 major/minor 版本时,应同时提高 `package.json` 和 lockfile 中的基线。已经发布过的提交会跳过。Actions 并发策略可能替换等待中的推送,因此不是每次推送或一次推送中的每个提交都保证生成独立版本。
|
|
155
191
|
|
|
156
192
|
后续发布使用 npm Trusted Publisher、OIDC 和 provenance,无需 npm token。
|
|
157
193
|
|
|
194
|
+
|
|
195
|
+
发布前需为该包配置指向此 GitHub 仓库及 `publish.yml` 的 npm Trusted Publisher。
|
|
196
|
+
|
|
197
|
+
</details>
|
|
198
|
+
|
|
199
|
+
<details>
|
|
200
|
+
<summary><strong>协作说明</strong></summary>
|
|
201
|
+
|
|
202
|
+
主会话负责需求对齐、风险调研、完整方案、任务调度、关键决策、整合与总结;执行前应先调查关键风险点、边界、验收标准和解决方案。获得授权后,应积极使用子代理并并行拆分独立任务以节省时间,同时遵守相关性、风险、预算、并发和单一修改负责人约束。绝大部分任务及子代理默认使用 `low` 模型,仅在复杂推理、关键决策或风险审查确有需要时升级。
|
|
203
|
+
|
|
204
|
+
</details>
|
|
205
|
+
|
|
158
206
|
---
|
|
159
207
|
|
|
160
208
|
[MIT License](LICENSE) · 为 [Pi](https://pi.dev) 打造
|
|
@@ -52,7 +52,7 @@ export const DEFAULT_SETTINGS: Readonly<MiniLensSettings> = {
|
|
|
52
52
|
"pi-mini-mode-context-percent-show": true,
|
|
53
53
|
"pi-mini-mode-speed-show": true,
|
|
54
54
|
"pi-mini-mode-speed-unit-show": true,
|
|
55
|
-
"pi-mini-mode-minimal-show":
|
|
55
|
+
"pi-mini-mode-minimal-show": true,
|
|
56
56
|
"pi-mini-mode-input-enhancements": true,
|
|
57
57
|
"pi-mini-mode-minimal-thinking-show": true,
|
|
58
58
|
"pi-mini-mode-minimal-tools-show": true,
|
|
@@ -71,7 +71,7 @@ const COPY = {
|
|
|
71
71
|
totalDescription: "Total:当前会话分支上的全部 token,含工具上报的 LLM 用量。", cachedDescription: "Cached:累计 cache-read + cache-write token(包含在 Total 中)。", cacheHitDescription: "CH(cache hit):cache-read / (input + cache-read)。Cache write 不计入此比率。",
|
|
72
72
|
enableMinimalDescription: "开启统一折叠思考、工具和技能过程;关闭恢复 Pi 默认会话历史。",
|
|
73
73
|
inputEnhancementsDescription: "原生 Ctrl+V 粘贴图片(Windows/WSL:Alt+V);图片显示为 [image1] 标签,光标移入或全屏悬停可预览。空白后 / 选择技能并在光标处插入。Cmd+点击带下划线的图片标签或消息文件路径,用系统默认应用打开;预览及点击需终端支持。关闭仅恢复原生行为。",
|
|
74
|
-
tuiRequired: "/pi-mini-mode-settings 需要 TUI 模式", saveFailed: "无法保存 Pi Mini Mode 设置", minimalRequired: "/pi-mini-mode-minimal 需要 TUI 模式", minimalUsage: "用法:/pi-mini-mode-minimal [on|off]", minimalState: "Pi Mini Mode 极简输出:", onboarding: "MCP
|
|
74
|
+
tuiRequired: "/pi-mini-mode-settings 需要 TUI 模式", saveFailed: "无法保存 Pi Mini Mode 设置", minimalRequired: "/pi-mini-mode-minimal 需要 TUI 模式", minimalUsage: "用法:/pi-mini-mode-minimal [on|off]", minimalState: "Pi Mini Mode 极简输出:", onboarding: "MCP 数量和点阵样式默认关闭;极简输出、输入增强及其余项默认开启。", keepDefaults: "保留默认", configureNow: "立即配置",
|
|
75
75
|
} as const;
|
|
76
76
|
|
|
77
77
|
export function settingsPath(agentDir = process.env.PI_MINI_MODE_AGENT_DIR ?? join(homedir(), CONFIG_DIR_NAME, "agent")): string {
|
|
@@ -93,6 +93,12 @@ export function parseSettings(value: unknown): MiniLensSettings {
|
|
|
93
93
|
return settings;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/** Pi /model and other selectors own Ctrl+S; the editor exposes getText. */
|
|
97
|
+
export function focusedSelectorOwnsKeys(tui?: { getFocusedComponent?(): unknown } | null): boolean {
|
|
98
|
+
const focused = tui?.getFocusedComponent?.();
|
|
99
|
+
return !!focused && typeof focused === "object" && typeof (focused as { getText?: unknown }).getText !== "function";
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
export async function loadSettings(path = settingsPath()): Promise<{ settings: MiniLensSettings; exists: boolean }> {
|
|
97
103
|
try {
|
|
98
104
|
return { settings: parseSettings(JSON.parse(await readFile(path, "utf8"))), exists: true };
|
|
@@ -858,6 +864,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
858
864
|
let shortcutTimer: ReturnType<typeof setTimeout> | undefined;
|
|
859
865
|
let waitingTimer: ReturnType<typeof setInterval> | undefined;
|
|
860
866
|
let unsubscribeMinimalInput: (() => void) | undefined;
|
|
867
|
+
let minimalTui: { getFocusedComponent?(): unknown } | undefined;
|
|
861
868
|
let restoreAgentWidgets: (() => void) | undefined;
|
|
862
869
|
let restoreTranscript: (() => void) | undefined;
|
|
863
870
|
let persistAgentStatuses: (() => void) | undefined;
|
|
@@ -902,6 +909,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
902
909
|
if (settings["pi-mini-mode-minimal-show"] && ctx.mode === "tui") unsubscribeMinimalInput = ctx.ui.onTerminalInput?.((data) => {
|
|
903
910
|
const nativeKey = matchesKey(data, "ctrl+alt+o");
|
|
904
911
|
const subAgentKey = matchesKey(data, "ctrl+s");
|
|
912
|
+
if (!nativeKey && focusedSelectorOwnsKeys(minimalTui)) return;
|
|
905
913
|
if (!nativeKey && (!restoreTranscript || (!subAgentKey && !matchesKey(data, "ctrl+o")))) return;
|
|
906
914
|
// Input listeners run before Pi filters Kitty release/repeat events.
|
|
907
915
|
if (isKeyRelease(data) || isKeyRepeat(data)) return { consume: true };
|
|
@@ -914,6 +922,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
914
922
|
return { consume: true };
|
|
915
923
|
});
|
|
916
924
|
if (nativeOutput || !settings["pi-mini-mode-minimal-show"] || ctx.mode !== "tui") {
|
|
925
|
+
minimalTui = undefined;
|
|
917
926
|
lastAttachMode = undefined;
|
|
918
927
|
ctx.ui.setWidget?.("pi-mini-mode-minimal-output", undefined);
|
|
919
928
|
refreshMinimalOutput();
|
|
@@ -921,6 +930,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
921
930
|
return;
|
|
922
931
|
}
|
|
923
932
|
ctx.ui.setWidget("pi-mini-mode-minimal-output", (tui, theme) => {
|
|
933
|
+
minimalTui = tui as unknown as { getFocusedComponent?(): unknown };
|
|
924
934
|
refreshMinimal = () => tui.requestRender();
|
|
925
935
|
// Retain children under their originating user turn, including while idle,
|
|
926
936
|
// after a follow-up user message, and when rebuilding a saved session.
|
|
@@ -949,9 +959,13 @@ export default function (pi: ExtensionAPI) {
|
|
|
949
959
|
handledRunIds.clear();
|
|
950
960
|
return minimalTurns.map((turn, index) => {
|
|
951
961
|
const turnAgents = assigned.get(index) ?? [];
|
|
952
|
-
for (const status of turnAgents)
|
|
962
|
+
for (const status of turnAgents) {
|
|
963
|
+
if (status.runId) handledRunIds.add(String(status.runId));
|
|
964
|
+
if (status.parentWorkflowRunId) handledRunIds.add(String(status.parentWorkflowRunId));
|
|
965
|
+
}
|
|
953
966
|
const withNotices = agentChildren(turnAgents).map(sub => {
|
|
954
967
|
if (sub.runId) handledRunIds.add(String(sub.runId));
|
|
968
|
+
if (sub.parentWorkflowRunId) handledRunIds.add(String(sub.parentWorkflowRunId));
|
|
955
969
|
const n = supervisorNotices.get(String(sub.runId));
|
|
956
970
|
return n ? { ...sub, notice: n.notice, noticeMessages: n.messages } : sub;
|
|
957
971
|
});
|
package/lib/footer-tidy.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
/** Hide noisy footer statuses (LSP / @build / sandbox / write path, etc.). */
|
|
2
2
|
|
|
3
|
-
type FooterData = {
|
|
4
|
-
getExtensionStatuses(): Iterable<[string, string]>;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
3
|
type StatusUi = {
|
|
8
4
|
setStatus(key: string, text: string | undefined): void;
|
|
9
|
-
setFooter(factory: ((tui: unknown, theme: unknown, footerData: FooterData) => { render: () => string[] }) | undefined): void;
|
|
10
5
|
};
|
|
11
6
|
|
|
12
7
|
type ExtensionCtx = {
|
|
@@ -17,6 +12,8 @@ type ExtensionAPILike = {
|
|
|
17
12
|
on(event: string, handler: (...args: any[]) => void): void;
|
|
18
13
|
};
|
|
19
14
|
|
|
15
|
+
const HIDDEN_KEYS = ["pi-lens-lsp", "@build", "build", "sandbox"] as const;
|
|
16
|
+
|
|
20
17
|
function stripAnsi(text: string): string {
|
|
21
18
|
return String(text || "").replace(/\x1b\[[0-9;]*m/g, "");
|
|
22
19
|
}
|
|
@@ -30,7 +27,7 @@ function tidyText(text: string): string {
|
|
|
30
27
|
.trim();
|
|
31
28
|
}
|
|
32
29
|
|
|
33
|
-
function hideStatus(key: string, text: string): boolean {
|
|
30
|
+
export function hideStatus(key: string, text: string): boolean {
|
|
34
31
|
const k = String(key || "").toLowerCase();
|
|
35
32
|
const v = String(text || "").toLowerCase();
|
|
36
33
|
if (k === "pi-lens-lsp" || k.includes("lsp")) return true;
|
|
@@ -62,61 +59,17 @@ function wrapSetStatus(ctx: ExtensionCtx): StatusUi["setStatus"] {
|
|
|
62
59
|
return orig;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
function
|
|
66
|
-
for (const
|
|
67
|
-
if (hideStatus(key, text)) {
|
|
68
|
-
origSet(key, undefined);
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
const visible = stripAnsi(text).replace(/[\r\n\t]/g, " ");
|
|
72
|
-
if (/^[ \t·•|●○]+/.test(visible) || /[ \t·•|●○]+$/.test(visible)) {
|
|
73
|
-
origSet(key, tidyText(text) || undefined);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
origSet("pi-lens-lsp", undefined);
|
|
77
|
-
origSet("@build", undefined);
|
|
78
|
-
origSet("build", undefined);
|
|
79
|
-
origSet("sandbox", undefined);
|
|
62
|
+
function clearKnownNoise(setStatus: StatusUi["setStatus"]): void {
|
|
63
|
+
for (const key of HIDDEN_KEYS) setStatus(key, undefined);
|
|
80
64
|
}
|
|
81
65
|
|
|
82
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Filter noisy setStatus writes.
|
|
68
|
+
* Never call setFooter — swapping the 1-line custom footer with Pi's 2–3 line
|
|
69
|
+
* built-in footer changes height and desyncs differential redraw.
|
|
70
|
+
*/
|
|
83
71
|
export default function attachFooterTidy(pi: ExtensionAPILike): void {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
let capturing = false;
|
|
87
|
-
|
|
88
|
-
const grabFooterData = (ctx: ExtensionCtx) => {
|
|
89
|
-
if (capturing || captured) return;
|
|
90
|
-
capturing = true;
|
|
91
|
-
ctx.ui.setFooter((_tui, _theme, footerData) => {
|
|
92
|
-
captured = footerData;
|
|
93
|
-
queueMicrotask(() => {
|
|
94
|
-
ctx.ui.setFooter(undefined);
|
|
95
|
-
capturing = false;
|
|
96
|
-
});
|
|
97
|
-
return { render: () => [] };
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const start = (_event: unknown, ctx: ExtensionCtx) => {
|
|
102
|
-
const origSet = wrapSetStatus(ctx);
|
|
103
|
-
grabFooterData(ctx);
|
|
104
|
-
if (timer) clearInterval(timer);
|
|
105
|
-
timer = setInterval(() => {
|
|
106
|
-
origSet("pi-lens-lsp", undefined);
|
|
107
|
-
origSet("@build", undefined);
|
|
108
|
-
origSet("build", undefined);
|
|
109
|
-
origSet("sandbox", undefined);
|
|
110
|
-
if (captured) sweep(origSet, captured);
|
|
111
|
-
else grabFooterData(ctx);
|
|
112
|
-
}, 250);
|
|
113
|
-
timer.unref?.();
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
pi.on("session_start", start);
|
|
117
|
-
pi.on("session_shutdown", () => {
|
|
118
|
-
if (timer) clearInterval(timer);
|
|
119
|
-
timer = undefined;
|
|
120
|
-
captured = undefined;
|
|
72
|
+
pi.on("session_start", (_event: unknown, ctx: ExtensionCtx) => {
|
|
73
|
+
clearKnownNoise(wrapSetStatus(ctx));
|
|
121
74
|
});
|
|
122
75
|
}
|
|
@@ -123,10 +123,14 @@ export function supervisorNotice(message: unknown) {
|
|
|
123
123
|
.map(line => line.trim())
|
|
124
124
|
.filter(line => line && !/^Run fan-out:/i.test(line))
|
|
125
125
|
.join(" ");
|
|
126
|
+
const workflowRunId = content.match(/^Workflow run:\s*([0-9a-f-]{36})\s*$/mi)?.[1];
|
|
126
127
|
const childRunId = content.match(/^Child run:\s*([0-9a-f-]{36})\s*$/mi)?.[1];
|
|
128
|
+
const runIds = [...new Set([childRunId, workflowRunId].filter((id): id is string => !!id))];
|
|
127
129
|
return {
|
|
128
|
-
key: childRunId ? JSON.stringify(["incremental-child", childRunId])
|
|
129
|
-
|
|
130
|
+
key: childRunId ? JSON.stringify(["incremental-child", childRunId])
|
|
131
|
+
: workflowRunId ? JSON.stringify(["incremental-child", workflowRunId, header[2]]) : undefined,
|
|
132
|
+
runId: childRunId || workflowRunId,
|
|
133
|
+
runIds,
|
|
130
134
|
internal: false,
|
|
131
135
|
alert: failed,
|
|
132
136
|
state: failed ? "执行失败" : "已完成",
|
|
@@ -144,7 +148,8 @@ export function supervisorNotice(message: unknown) {
|
|
|
144
148
|
const status = header[1];
|
|
145
149
|
const failed = status === "failed" || status === "stopped";
|
|
146
150
|
const attention = status === "paused";
|
|
147
|
-
const workflowRunId = content.match(/^Workflow run:\s*([0-9a-f-]{36})\s*$/mi)?.[1]
|
|
151
|
+
const workflowRunId = content.match(/^Workflow run:\s*([0-9a-f-]{36})\s*$/mi)?.[1]
|
|
152
|
+
?? content.match(/^Workflow receipt:\s*.*?([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/mi)?.[1];
|
|
148
153
|
const childRunIds = content.match(/^Child runs:\s*(.+)$/mi)?.[1]
|
|
149
154
|
?.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi) ?? [];
|
|
150
155
|
const runIds = [...new Set([workflowRunId, ...childRunIds].filter((id): id is string => !!id))];
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@each1024/pi-mini-mode",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "A compact Pi footer with live usage metrics, theme-aware settings previews, and configurable progress bars.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"check": "tsc --noEmit -p tsconfig.json",
|
|
8
|
-
"test": "node test/footer-status-self-check.mjs && node test/settings-interaction.mjs && node test/transcript-adapter.mjs && node test/prompt-folding.mjs && node test/tool-folding.mjs && node test/sticky-tool.mjs && node test/minimal-markdown.mjs && node test/agent-view.mjs && node test/publish-self-check.mjs && node test/compaction-transcript.mjs && node test/input-enhancements.mjs && node test/user-message-surface.mjs"
|
|
8
|
+
"test": "node test/footer-tidy.mjs && node test/footer-status-self-check.mjs && node test/settings-interaction.mjs && node test/transcript-adapter.mjs && node test/prompt-folding.mjs && node test/tool-folding.mjs && node test/sticky-tool.mjs && node test/minimal-markdown.mjs && node test/agent-view.mjs && node test/publish-self-check.mjs && node test/compaction-transcript.mjs && node test/input-enhancements.mjs && node test/user-message-surface.mjs"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "eachann1024",
|