@each1024/pi-mini-mode 0.9.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.
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/README.zh-CN.md +210 -0
- package/extensions/footer-status.ts +1612 -0
- package/lib/agent-view.ts +518 -0
- package/lib/file-links.ts +80 -0
- package/lib/footer-tidy.ts +75 -0
- package/lib/input-enhancements.ts +622 -0
- package/lib/minimal-markdown.ts +181 -0
- package/lib/minimal-theme.ts +48 -0
- package/lib/settings-web.ts +119 -0
- package/lib/settings.html +209 -0
- package/lib/sticky-tool.ts +100 -0
- package/lib/title-plain.ts +57 -0
- package/lib/transcript-adapter.ts +578 -0
- package/package.json +61 -0
- package/themes/README.md +5 -0
- package/themes/cc-dark.json +91 -0
- package/themes/cc-light.json +91 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 eachann1024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
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
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[中文](README.zh-CN.md) · [Install](#install) · [Features](#features) · [Commands](#commands) · [Reference](#reference)
|
|
6
|
+
|
|
7
|
+
# Pi Mini Mode
|
|
8
|
+
|
|
9
|
+
**Less noise. More focus.**
|
|
10
|
+
|
|
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.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install npm:@each1024/pi-mini-mode
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run `/reload` in Pi. On the first interactive TUI session, choose **Apply recommended setup** to select `cc-dark` or `cc-light` and save the theme plus `tuiMode=fullscreen` globally; restart Pi for fullscreen to take effect. Project settings and CLI flags may override global settings. You can retry later with `/pi-mini-mode-setup`, or configure only Pi Mini Mode with `/pi-mini-mode-settings`.
|
|
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.
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary>Install from GitHub instead</summary>
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pi install git:github.com/eachann1024/pi-mini-mode
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
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.
|
|
43
|
+
|
|
44
|
+
### 02 / Process, quieter
|
|
45
|
+
|
|
46
|
+
Enable **Minimal output** in settings, or run `/pi-mini-mode-minimal on`.
|
|
47
|
+
|
|
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.
|
|
53
|
+
|
|
54
|
+
`/pi-mini-mode-history` opens complete process entries, five at a time. `/pi-mini-mode-minimal off` restores native Pi history.
|
|
55
|
+
|
|
56
|
+
### 03 / Session, in focus
|
|
57
|
+
|
|
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.
|
|
59
|
+
|
|
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.
|
|
61
|
+
|
|
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.
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
74
|
+
|
|
75
|
+
| Command / shortcut | Purpose |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `/pi-mini-mode-settings` | Configure fields, input enhancements and minimal output |
|
|
78
|
+
| `/pi-mini-mode-setup` | Choose the bundled theme and save global fullscreen mode; restart Pi afterward |
|
|
79
|
+
| `/pi-mini-mode-minimal on` / `off` | Enable minimal output / restore native history |
|
|
80
|
+
| `Ctrl+O` | Expand or collapse the complete process tree |
|
|
81
|
+
| `Ctrl+S` | Expand or collapse completed subagent rows; yields to Pi `/model`, `/thinking`, and other selectors |
|
|
82
|
+
| `/pi-mini-mode-prompts` | Select and expand/collapse a user message¹ |
|
|
83
|
+
| `/pi-mini-mode-tools` | Select and expand/collapse saved tool text or thinking¹ |
|
|
84
|
+
| `/pi-mini-mode-history` | Browse full process entries, five at a time |
|
|
85
|
+
| `/reload` | Reload the extension after installation or source changes |
|
|
86
|
+
|
|
87
|
+
¹ Requires fullscreen minimal output. Subagent rows have their own click-to-expand control; supported third-party widgets retain native detail shortcuts.
|
|
88
|
+
|
|
89
|
+
## Compatibility
|
|
90
|
+
|
|
91
|
+
- **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).
|
|
92
|
+
- **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.
|
|
93
|
+
- **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.
|
|
94
|
+
- **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.
|
|
95
|
+
- **Metrics:** costs are estimates, not provider invoices. See the calculation details below.
|
|
96
|
+
|
|
97
|
+
## Reference
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary><strong>First run & configuration</strong> — defaults, controls, and settings file</summary>
|
|
101
|
+
|
|
102
|
+
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:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The first-run picker offers **Keep defaults**, **Configure now**, and **Apply recommended setup**. 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. Applying the recommendation asks you to choose the bundled `cc-dark` or `cc-light` theme, saves that theme and global `tuiMode=fullscreen` through Pi's settings API, applies the theme immediately, and asks you to restart Pi because the fullscreen renderer is chosen at startup. Project settings and CLI flags may override these global values. Escape/cancel leaves onboarding incomplete; retry with `/pi-mini-mode-setup`. Print, JSON, and other non-interactive modes never prompt.
|
|
109
|
+
|
|
110
|
+
Open that settings UI any time with:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
/pi-mini-mode-settings
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The focused option and its corresponding preview field use bold theme `accent` text with a `selectedBg` background. Fullscreen Pi supports hover to focus and click to toggle; regular terminal mode uses keyboard navigation. Hovering never changes a setting.
|
|
117
|
+
|
|
118
|
+
Changes take effect immediately. The command requires Pi's TUI mode. Its preview always uses fixed example data rather than your current session, while reflecting every setting toggle immediately.
|
|
119
|
+
|
|
120
|
+
Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-mini-mode.json`; installations with a different Pi config directory use that directory). A malformed or missing file safely falls back to the defaults.
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"pi-mini-mode-model-show": true,
|
|
125
|
+
"pi-mini-mode-thinking-show": true,
|
|
126
|
+
"pi-mini-mode-ch-show": true,
|
|
127
|
+
"pi-mini-mode-session-tokens-show": true,
|
|
128
|
+
"pi-mini-mode-cache-tokens-show": true,
|
|
129
|
+
"pi-mini-mode-cost-show": true,
|
|
130
|
+
"pi-mini-mode-mcp-show": false,
|
|
131
|
+
"pi-mini-mode-context-show": true,
|
|
132
|
+
"pi-mini-mode-context-dots-show": false,
|
|
133
|
+
"pi-mini-mode-context-percent-show": true,
|
|
134
|
+
"pi-mini-mode-speed-show": true,
|
|
135
|
+
"pi-mini-mode-speed-unit-show": true,
|
|
136
|
+
"pi-mini-mode-minimal-show": true,
|
|
137
|
+
"pi-mini-mode-input-enhancements": true,
|
|
138
|
+
"onboardingCompleted": true
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
| Key | Default | Controls |
|
|
143
|
+
| --- | --- | --- |
|
|
144
|
+
| `pi-mini-mode-model-show` | `true` | Model ID without provider prefix |
|
|
145
|
+
| `pi-mini-mode-thinking-show` | `true` | Thinking level |
|
|
146
|
+
| `pi-mini-mode-ch-show` | `true` | Session cache-hit rate (`CH`) |
|
|
147
|
+
| `pi-mini-mode-session-tokens-show` | `true` | Accumulated session tokens (`Total`) |
|
|
148
|
+
| `pi-mini-mode-cache-tokens-show` | `true` | Accumulated cache read + cache write tokens |
|
|
149
|
+
| `pi-mini-mode-cost-show` | `true` | Estimated session list price |
|
|
150
|
+
| `pi-mini-mode-mcp-show` | `false` | Enabled MCP server count |
|
|
151
|
+
| `pi-mini-mode-context-show` | `true` | Used/total context tokens and progress bar |
|
|
152
|
+
| `pi-mini-mode-context-dots-show` | `false` | Use a single-line dot-matrix bar instead of the default solid bar |
|
|
153
|
+
| `pi-mini-mode-context-percent-show` | `true` | Context-use percentage |
|
|
154
|
+
| `pi-mini-mode-speed-show` | `true` | Generation speed at the far right |
|
|
155
|
+
| `pi-mini-mode-speed-unit-show` | `true` | Generation-speed sub-setting: append `tok/s` to the numeric value |
|
|
156
|
+
| `pi-mini-mode-minimal-show` | `true` | Minimal output; off restores Pi's default conversation history |
|
|
157
|
+
| `pi-mini-mode-input-enhancements` | `true` | Image previews, inline skills, and message file links |
|
|
158
|
+
| `onboardingCompleted` | `false` initially | Internal marker that prevents another first-run prompt |
|
|
159
|
+
|
|
160
|
+
- **Generation speed**
|
|
161
|
+
- **Show tok/s unit** (`pi-mini-mode-speed-unit-show`) is the indented sub-setting shown beneath **Show latest generation speed** in `/pi-mini-mode-settings`. Turning it off keeps the speed number (for example `40.0`) and removes only `tok/s`.
|
|
162
|
+
- The sub-setting is retained when generation speed itself is hidden.
|
|
163
|
+
|
|
164
|
+
</details>
|
|
165
|
+
|
|
166
|
+
<details>
|
|
167
|
+
<summary><strong>How metrics work</strong> — tokens, cache, speed, and estimated price</summary>
|
|
168
|
+
|
|
169
|
+
Session totals are aggregated from each finalized `assistant` and `toolResult` entry on the active session branch. This includes nested LLM work reported by tools (such as a child agent) exactly once. `Total` uses the provider's `totalTokens` when supplied; older/custom results without it fall back to the sum of input, output, cache-read, and cache-write tokens. `Cached` is cache-read + cache-write (included in Total); `CH` is cache-read / (input + cache-read). Only persisted finalized usage is counted, so stream updates cannot double count totals.
|
|
170
|
+
|
|
171
|
+
During an assistant stream, speed is decode TPS: provider `usage.output` divided by elapsed time from the first output token, excluding TTFT/prefill wait. It appears after at least two output tokens and 100ms of decode time, and is refreshed while streaming. The completed rate remains visible while later assistant messages only call tools or wait for output; it is replaced only by a newer measurable main-turn generation. Nested tool LLM usage does not overwrite a measured main-turn rate; it can set the footer only when no main generation has been measured yet. Short or single-token bursts are hidden rather than shown as inflated tok/s. Regressing output samples and non-increasing timestamps are ignored.
|
|
172
|
+
|
|
173
|
+
Before a measurable response exists, the speed field is absent entirely—Pi Mini Mode never displays a `-- tok/s` placeholder. When present, speed is the rightmost footer field (the context percentage, if enabled, is immediately to its left). Its color uses Pi theme semantics: **success** at >=30 tok/s, **warning** at 10–29.9 tok/s, and **error** below 10 tok/s. No colors are hard-coded, so it follows the selected Pi theme.
|
|
174
|
+
|
|
175
|
+
The price is the same finalized active-branch usage and configured per-million-token rates. It is an estimate, not a provider invoice. In narrow terminals, the footer drops/truncates lower-priority content to remain one line without overflow.
|
|
176
|
+
|
|
177
|
+
</details>
|
|
178
|
+
|
|
179
|
+
<details>
|
|
180
|
+
<summary><strong>Development</strong> — local setup and checks</summary>
|
|
181
|
+
|
|
182
|
+
Install only the local copy while developing; installing npm and local copies together double-registers the extension:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pi remove npm:@each1024/pi-mini-mode && pi install /path/to/pi-mini-mode
|
|
186
|
+
npm run check
|
|
187
|
+
npm test
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
</details>
|
|
195
|
+
|
|
196
|
+
<details>
|
|
197
|
+
<summary><strong>Publishing</strong></summary>
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
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.
|
|
202
|
+
|
|
203
|
+
</details>
|
|
204
|
+
|
|
205
|
+
<details>
|
|
206
|
+
<summary><strong>Collaboration guidance</strong></summary>
|
|
207
|
+
|
|
208
|
+
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.
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
[MIT License](LICENSE) · Built for [Pi](https://pi.dev)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<img src="assets/readme-cover.zh-CN.svg" alt="Pi Mini Mode — 少一点干扰,多一点专注。图片输入、可折叠对话、子代理、明暗主题与实时页脚。" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
[English](README.md) · [安装](#安装) · [功能](#功能) · [命令速查](#命令速查) · [参考](#参考)
|
|
6
|
+
|
|
7
|
+
# Pi Mini Mode
|
|
8
|
+
|
|
9
|
+
**少一点干扰。多一点专注。**
|
|
10
|
+
|
|
11
|
+
为 [Pi](https://pi.dev) 的日常工作做一点精细的改进,不止于页脚。光标处预览图片,折叠长消息和过程详情,展开子代理工作,让重要的会话状态始终清晰。
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install npm:@each1024/pi-mini-mode
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
在 Pi 中运行 `/reload`。首次进入交互式 TUI 时,选择 **应用推荐配置**,再选择 `cc-dark` 或 `cc-light`;它会通过 Pi 官方设置 API 保存主题与全局 `tuiMode=fullscreen`,重启 Pi 后全屏模式才会生效。项目设置和命令行参数可能覆盖全局设置。之后可用 `/pi-mini-mode-setup` 重试,或用 `/pi-mini-mode-settings` 只配置 Pi Mini Mode。
|
|
20
|
+
|
|
21
|
+
**需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary>也可以从 GitHub 安装</summary>
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pi install git:github.com/eachann1024/pi-mini-mode
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
## 功能
|
|
33
|
+
|
|
34
|
+
### 01 / 输入,更顺手
|
|
35
|
+
|
|
36
|
+
**图片,随光标浮现。** 编辑光标移入图片路径或紧凑标签,即可预览。全屏编辑器也支持悬停,按 `Esc` 关闭。
|
|
37
|
+
|
|
38
|
+
**收起路径,保留原图。** 输入框和消息中的图片路径收纳为带下划线的 `[image1]` 标签,提交时保留原始路径。使用终端的链接点击手势,即可通过系统默认应用打开原图或其他文件。
|
|
39
|
+
|
|
40
|
+
**技能,就在输入处。** 在输入起点或空白后键入 `/` 搜索技能,在当前光标处插入 `/skill:name`,提交时展开。URL 和文件路径中的斜杠保持原有行为。
|
|
41
|
+
|
|
42
|
+
使用 `Ctrl+V` 粘贴图片,Windows/WSL 使用 `Alt+V`。关闭输入增强不会关闭 Pi 原生剪贴板功能。
|
|
43
|
+
|
|
44
|
+
### 02 / 过程,更安静
|
|
45
|
+
|
|
46
|
+
在设置中开启 **极简输出**,或运行 `/pi-mini-mode-minimal on`。
|
|
47
|
+
|
|
48
|
+
- **长消息,自动折叠。** 全屏极简模式下,长用户消息默认保留前四个显示行。点击折叠控件展开全文,或用 `/pi-mini-mode-prompts` 选择消息。完整代码围栏保持完整。
|
|
49
|
+
- **子代理,清晰可查。** 点击子代理行,展开可用的活动记录与消息/最终输出。任务派发回执或工具调用返回,不等于后台任务已完成。
|
|
50
|
+
- **过程是一棵树,而非满屏输出。** 思考、工具与技能读取汇入同一棵时间顺序树,显示最新十条摘要;`Ctrl+O` 展开/收起完整过程,新问题默认收起。
|
|
51
|
+
- **工具详情,按需展开。** 点击工具/思考条目的折叠控件,或用 `/pi-mini-mode-tools` 选择。工具详情展示保存的文本,不还原原生自定义渲染器或图片输出。
|
|
52
|
+
- **把空间留给答案。** 最终 Markdown 流式呈现,不添加额外标题或背景。失败和中断明确标记;折叠只改变显示,不删除原始会话消息。
|
|
53
|
+
|
|
54
|
+
`/pi-mini-mode-history` 每次浏览五条完整过程记录;`/pi-mini-mode-minimal off` 恢复 Pi 原生历史。
|
|
55
|
+
|
|
56
|
+
### 03 / 状态,更清晰
|
|
57
|
+
|
|
58
|
+
**明暗,皆有章法。** 自带 `cc-light` 与 `cc-dark`,源自 [pi-cc-extensions](https://github.com/minuque/pi-cc-extensions),采用 MIT 许可。用户消息使用主题的用户背景色;Markdown、代码高亮、表格及支持的 Mermaid 图表适配明暗主题。不支持、不完整或过宽的图表保留源文本。
|
|
59
|
+
|
|
60
|
+
**重要指标,一行看清。** 模型与思考级别、会话令牌、缓存总量与命中率、费用估算、上下文用量与生成速度。在 `/pi-mini-mode-settings` 中选择显示字段,即时生效,页脚自动适配窄终端。
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>查看页脚设置截图与演示</summary>
|
|
64
|
+
|
|
65
|
+
[](assets/pi-mini-mode-settings.jpg)
|
|
66
|
+
|
|
67
|
+
[观看页脚设置演示](https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763)
|
|
68
|
+
|
|
69
|
+
这份已有截图和录屏展示页脚配置,不代表新增图片、折叠与子代理功能的当前界面。设置预览使用示例数据。
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## 命令速查
|
|
74
|
+
|
|
75
|
+
| 命令/快捷键 | 用途 |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `/pi-mini-mode-settings` | 配置字段、输入增强和极简输出 |
|
|
78
|
+
| `/pi-mini-mode-setup` | 选择内置主题并保存全局全屏模式;之后需重启 Pi |
|
|
79
|
+
| `/pi-mini-mode-minimal on` / `off` | 开启极简输出/恢复原生历史 |
|
|
80
|
+
| `Ctrl+O` | 展开/收起完整过程树 |
|
|
81
|
+
| `Ctrl+S` | 展开/收起已完成的子代理行;打开 `/model`、`/thinking` 等选择器时交给 Pi |
|
|
82
|
+
| `/pi-mini-mode-prompts` | 选择并展开/收起用户消息¹ |
|
|
83
|
+
| `/pi-mini-mode-tools` | 选择并展开/收起保存的工具文本或思考¹ |
|
|
84
|
+
| `/pi-mini-mode-history` | 浏览完整过程记录,每次五条 |
|
|
85
|
+
| `/reload` | 安装或修改源码后重载扩展 |
|
|
86
|
+
|
|
87
|
+
¹ 需要全屏极简输出。子代理行有独立的点击展开控件;受支持的第三方小组件保留原生详情快捷键。
|
|
88
|
+
|
|
89
|
+
## 兼容性
|
|
90
|
+
|
|
91
|
+
- **图片:** 预览依赖终端图片协议,不支持时显示提示。读取上限 **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)。
|
|
92
|
+
- **极简输出:** 使用私有 Pi 0.85.x 布局适配器,不修改 Pi 安装目录。未知布局会拒绝启用并保留原生输出;升级 Pi 后需重新检查,其他替换 transcript 的扩展可能冲突。
|
|
93
|
+
- **子代理:** pi-subagents 小组件适配仅在极简模式启用,关闭后恢复原状,未知格式原样交给原生处理。可用详情取决于集成提供的状态/输出数据,不是完整子代理会话查看器。
|
|
94
|
+
- **历史:** `/reload` 会重新挂载 transcript,包含原生模式中产生的历史。空进度事件不覆盖已有内容;无输出的工具显示等待时间。旧的极简输出细项不再单独过滤内容。
|
|
95
|
+
- **指标:** 费用是估算,不是 provider 账单。计算方式见下方参考。
|
|
96
|
+
|
|
97
|
+
## 参考
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary><strong>首次使用与配置</strong></summary>
|
|
101
|
+
|
|
102
|
+
首次进入交互式 TUI 会话时,Pi Mini Mode 显示设置预览。页脚指标除 MCP 数量外默认开启,点阵样式默认关闭,极简输出默认开启,例如:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 500/1.0M █░░░░░░░░░ 1% 120 tok/s
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
首次设置会提供 **Keep defaults(保留默认值)**、**Configure now(立即配置)** 和 **Apply recommended setup(应用推荐配置)**。保留默认值会保存默认字段选择、保持极简输出开启,并且不再显示首次设置提示;立即配置会直接打开同一设置列表。应用推荐配置会让你选择内置的 `cc-dark` 或 `cc-light` 主题,通过 Pi 官方设置 API 保存该主题和全局 `tuiMode=fullscreen`,立即应用主题,并提示重启 Pi(全屏渲染器在启动时决定)。项目设置和命令行参数可能覆盖全局设置。按 Esc/取消不会完成首次设置,可稍后用 `/pi-mini-mode-setup` 重试。Print、JSON 等非交互模式不会显示提示。
|
|
109
|
+
|
|
110
|
+
设置保存在 Pi 的 agent 目录中,通常是 `~/.pi/agent/pi-mini-mode.json`;如果 Pi 使用其他配置目录,则保存在对应目录。文件缺失或格式错误时会安全回退到默认设置。设置示例:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"pi-mini-mode-model-show": true,
|
|
115
|
+
"pi-mini-mode-thinking-show": true,
|
|
116
|
+
"pi-mini-mode-ch-show": true,
|
|
117
|
+
"pi-mini-mode-session-tokens-show": true,
|
|
118
|
+
"pi-mini-mode-cache-tokens-show": true,
|
|
119
|
+
"pi-mini-mode-cost-show": true,
|
|
120
|
+
"pi-mini-mode-mcp-show": false,
|
|
121
|
+
"pi-mini-mode-context-show": true,
|
|
122
|
+
"pi-mini-mode-context-dots-show": false,
|
|
123
|
+
"pi-mini-mode-context-percent-show": true,
|
|
124
|
+
"pi-mini-mode-speed-show": true,
|
|
125
|
+
"pi-mini-mode-speed-unit-show": true,
|
|
126
|
+
"pi-mini-mode-minimal-show": true,
|
|
127
|
+
"pi-mini-mode-input-enhancements": true,
|
|
128
|
+
"onboardingCompleted": true
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| 配置项 | 默认值 | 说明 |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `pi-mini-mode-model-show` | `true` | 显示不含 provider 前缀的模型 ID |
|
|
135
|
+
| `pi-mini-mode-thinking-show` | `true` | 显示思考级别 |
|
|
136
|
+
| `pi-mini-mode-ch-show` | `true` | 显示会话缓存命中率(`CH`) |
|
|
137
|
+
| `pi-mini-mode-session-tokens-show` | `true` | 显示会话累计令牌(`Total`) |
|
|
138
|
+
| `pi-mini-mode-cache-tokens-show` | `true` | 显示缓存读取与写入令牌(已包含在 Total 中) |
|
|
139
|
+
| `pi-mini-mode-cost-show` | `true` | 显示会话费用估算 |
|
|
140
|
+
| `pi-mini-mode-mcp-show` | `false` | 显示已启用的 MCP 服务器数量 |
|
|
141
|
+
| `pi-mini-mode-context-show` | `true` | 显示已用/总上下文令牌和进度条 |
|
|
142
|
+
| `pi-mini-mode-context-dots-show` | `false` | 使用单行点阵进度条替代默认实心进度条 |
|
|
143
|
+
| `pi-mini-mode-context-percent-show` | `true` | 显示上下文使用百分比 |
|
|
144
|
+
| `pi-mini-mode-speed-show` | `true` | 显示最新生成速度 |
|
|
145
|
+
| `pi-mini-mode-speed-unit-show` | `true` | 速度子设置:在数字后追加 `tok/s` |
|
|
146
|
+
| `pi-mini-mode-minimal-show` | `true` | 极简输出总开关;关闭则恢复 Pi 默认历史显示 |
|
|
147
|
+
| `pi-mini-mode-input-enhancements` | `true` | 图片预览、行内技能补全与展开、消息文件链接 |
|
|
148
|
+
| `onboardingCompleted` | 初始为 `false` | 防止再次显示首次设置提示的内部标记 |
|
|
149
|
+
|
|
150
|
+
生成速度设置中的 **显示 tok/s 单位** 是 **显示最新生成速度** 下方的缩进子设置。关闭它只会移除 `tok/s`,保留速度数字;即使隐藏生成速度,该子设置仍会保留。
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
设置命令需要 Pi 的 TUI 模式。预览使用固定示例数据而非当前会话,但会即时反映每项开关。选中项及对应预览字段会突出显示;全屏支持悬停聚焦、点击切换,普通终端使用键盘操作,悬停本身不会改变设置。
|
|
154
|
+
|
|
155
|
+
</details>
|
|
156
|
+
|
|
157
|
+
<details>
|
|
158
|
+
<summary><strong>指标如何计算</strong></summary>
|
|
159
|
+
|
|
160
|
+
会话总量来自当前会话分支中每一条已完成的 `assistant` 和 `toolResult` 记录。工具报告的嵌套 LLM 工作(例如子 Agent)会准确计入一次。若 provider 提供 `totalTokens`,`Total` 使用该值;较旧或自定义结果没有该字段时,则使用输入、输出、缓存读取和缓存写入令牌之和。`Cached` 是缓存读取与写入之和(包含在 `Total` 中);`CH` 是缓存读取量除以输入量与缓存读取量之和。只有已持久化的最终用量会计入,因此流式更新不会重复累计。
|
|
161
|
+
|
|
162
|
+
助手生成过程中,速度按 decode TPS 计算:用 provider 的 `usage.output` 除以从第一个输出 token 开始的耗时,不包含 TTFT/预填充等待。至少 2 个输出 token 且解码时长达 100ms 后才显示,并在流式过程中刷新。后续助手消息如果只是调用工具或等待输出,之前完成的速度仍会保留;只有新的可测量主回复才会替换它。嵌套工具里的 LLM 用量不会覆盖已测量的主回复速度;只有还没有主生成速度时,嵌套完成才能写入页脚。过短或单 token 突发不显示,避免虚高的 tok/s。倒退的输出样本和不递增的时间戳会被忽略。
|
|
163
|
+
|
|
164
|
+
在获得可测量响应前,速度字段完全不显示,不会出现 `-- tok/s` 占位符。速度位于页脚最右侧;启用上下文百分比时,百分比紧邻其左侧。颜色遵循 Pi 主题语义:至少 30 tok/s 为成功色,10–29.9 tok/s 为警告色,低于 10 tok/s 为错误色。费用是基于当前分支已完成用量和配置的每百万令牌费率得出的估算,并非 provider 账单。窄终端中,页脚会丢弃或截断优先级较低的内容,确保保持单行且不溢出。
|
|
165
|
+
|
|
166
|
+
</details>
|
|
167
|
+
|
|
168
|
+
<details>
|
|
169
|
+
<summary><strong>开发与检查</strong></summary>
|
|
170
|
+
|
|
171
|
+
开发时只安装本地副本;同时安装 npm 版本和本地版本会导致扩展重复注册:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
pi remove npm:@each1024/pi-mini-mode && pi install /path/to/pi-mini-mode
|
|
175
|
+
npm run check
|
|
176
|
+
npm test
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
修改源码后,在已打开的 Pi 会话中运行 `/reload`。`npm run check` 会执行 TypeScript 检查,`npm test` 会执行页脚、设置和发布自检。真实终端冒烟测试:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
python3 test/minimal-pty.py
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
该测试需要 Python 3、Node 以及已安装依赖中自带的 Pi CLI;会使用临时 fixture,覆盖普通/全屏模式、切换、10 条过程记录、`Ctrl+O` 展开/收起、恢复结果和窄终端,不会调用模型。
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
<summary><strong>发布</strong></summary>
|
|
191
|
+
|
|
192
|
+
推送到 `main` 后,GitHub Actions 会在通过 `npm ci`、`npm run check` 和 `npm test` 后自动发布到 npm;也支持在 `main` 上手动触发。每次发布都会取本地版本基线与 npm 最新稳定版本加一个 patch 中的较高者。版本只在 runner 中变更,不创建版本提交或 tag;发布 major/minor 版本时,应同时提高 `package.json` 和 lockfile 中的基线。已经发布过的提交会跳过。Actions 并发策略可能替换等待中的推送,因此不是每次推送或一次推送中的每个提交都保证生成独立版本。
|
|
193
|
+
|
|
194
|
+
后续发布使用 npm Trusted Publisher、OIDC 和 provenance,无需 npm token。
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
发布前需为该包配置指向此 GitHub 仓库及 `publish.yml` 的 npm Trusted Publisher。
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
<details>
|
|
202
|
+
<summary><strong>协作说明</strong></summary>
|
|
203
|
+
|
|
204
|
+
主会话负责需求对齐、风险调研、完整方案、任务调度、关键决策、整合与总结;执行前应先调查关键风险点、边界、验收标准和解决方案。获得授权后,应积极使用子代理并并行拆分独立任务以节省时间,同时遵守相关性、风险、预算、并发和单一修改负责人约束。绝大部分任务及子代理默认使用 `low` 模型,仅在复杂推理、关键决策或风险审查确有需要时升级。
|
|
205
|
+
|
|
206
|
+
</details>
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
[MIT License](LICENSE) · 为 [Pi](https://pi.dev) 打造
|