@each1024/pi-mini-mode 1.0.1 → 1.0.3
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 +35 -39
- package/README.zh-CN.md +35 -38
- package/lib/settings-web.ts +7 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
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%">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/eachann1024/pi-mini-mode/main/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
|
-
[中文](README.zh-CN.md) · [Install](#install) · [Features](#features) · [
|
|
5
|
+
[中文](https://github.com/eachann1024/pi-mini-mode/blob/main/README.zh-CN.md) · [Install](#install) · [Features](#features) · [Reference](#reference)
|
|
6
6
|
|
|
7
7
|
# Pi Mini Mode
|
|
8
8
|
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
|
|
11
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
12
|
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
<details>
|
|
14
|
+
<summary>See the full interface</summary>
|
|
16
15
|
|
|
16
|
+
<img width="1698" height="1588" alt="Pi Mini Mode interface" src="https://github.com/user-attachments/assets/9990b080-f82b-4dd0-bc7b-a0cdded72181" />
|
|
17
17
|
|
|
18
|
+
</details>
|
|
18
19
|
|
|
19
20
|
## Install
|
|
20
21
|
|
|
@@ -22,10 +23,18 @@ An everyday refinement for [Pi](https://pi.dev), not just a footer. Preview imag
|
|
|
22
23
|
pi install npm:@each1024/pi-mini-mode
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
In an open Pi session, run Pi's built-in `/reload` command. On first use, choose **Apply recommended setup** for a bundled theme and fullscreen mode, then restart Pi for fullscreen to take effect. Configure this extension any time with `/pi-mini-mode-settings`. Project settings and CLI flags may override global settings.
|
|
26
27
|
|
|
27
28
|
**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.
|
|
28
29
|
|
|
30
|
+
### Update an existing npm installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi update npm:@each1024/pi-mini-mode
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then run `/reload` in Pi and reopen `/pi-mini-mode-settings` (or restart Pi). The HTML settings page ships with the extension; no separate npm command or development server is needed. Publishing does not update users' installed copies or already-open browser tabs automatically. Pinned versions must first be replaced with the unversioned install command above; local development installs continue to use local files.
|
|
37
|
+
|
|
29
38
|
<details>
|
|
30
39
|
<summary>Install from GitHub instead</summary>
|
|
31
40
|
|
|
@@ -39,6 +48,8 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
39
48
|
|
|
40
49
|
### 01 / Input, refined
|
|
41
50
|
|
|
51
|
+
<img width="1092" height="764" alt="Image previews and compact labels in Pi Mini Mode" src="https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445" />
|
|
52
|
+
|
|
42
53
|
**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.
|
|
43
54
|
|
|
44
55
|
**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.
|
|
@@ -47,26 +58,21 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
47
58
|
|
|
48
59
|
Paste images with `Ctrl+V` (`Alt+V` on Windows/WSL). Disabling input enhancements preserves Pi’s native clipboard behavior.
|
|
49
60
|
|
|
50
|
-
<img width="1092" height="764" alt="image" src="https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445" />
|
|
51
|
-
|
|
52
|
-
|
|
53
61
|
### 02 / Process, quieter
|
|
54
62
|
|
|
55
63
|
Enable **Minimal output** in `/pi-mini-mode-settings`.
|
|
56
64
|
|
|
65
|
+
<img width="1092" height="764" alt="Folded process tree in minimal output" src="https://github.com/user-attachments/assets/eb8c88f6-84af-499e-b105-5395b4f02e66" />
|
|
66
|
+
|
|
57
67
|
- **Long prompts, folded.** In fullscreen minimal mode, long user messages show the first four rendered rows. Click the fold control to reveal the rest. Complete fenced code blocks stay intact.
|
|
58
|
-
- **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.
|
|
68
|
+
- **Subagents, in plain sight.** Click a subagent row to expand its available activity and message/final output. In minimal mode, this extension uses `Ctrl+S` to expand or collapse completed subagent summaries; Pi's focused selectors keep their own keys. A dispatch receipt or returned tool call is not a completed background task.
|
|
59
69
|
- **A process tree, not a wall of output.** Thinking, tools and skill reads share one chronological tree. The latest summaries stay visible, including the latest thinking; `Ctrl+O` expands or collapses the full process. New questions start collapsed.
|
|
60
70
|
- **Tool details on demand.** Expand a tool or thinking entry, including the latest thinking, using its fold control. Thinking starts collapsed and only expands or collapses manually, including while running. Tool details show saved text, not the original custom renderer or image output.
|
|
61
71
|
- **Room for the answer.** Final Markdown streams without extra headings or backgrounds. Failures and interruptions stay explicit. Folding changes presentation, not stored session messages.
|
|
62
72
|
|
|
63
73
|
Turn **Minimal output** off in settings to restore native Pi history.
|
|
64
74
|
|
|
65
|
-
|
|
66
|
-
<img width="1092" height="764" alt="image" src="https://github.com/user-attachments/assets/eb8c88f6-84af-499e-b105-5395b4f02e66" />
|
|
67
|
-
<img width="1092" height="764" alt="image" src="https://github.com/user-attachments/assets/53f5aa28-4b96-45db-b02e-0108aa9e68bc" />
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
<img width="1092" height="764" alt="Expanded process details" src="https://github.com/user-attachments/assets/53f5aa28-4b96-45db-b02e-0108aa9e68bc" />
|
|
70
76
|
|
|
71
77
|
### 03 / Session, in focus
|
|
72
78
|
|
|
@@ -77,7 +83,7 @@ Turn **Minimal output** off in settings to restore native Pi history.
|
|
|
77
83
|
<details>
|
|
78
84
|
<summary>See the footer settings and demo</summary>
|
|
79
85
|
|
|
80
|
-
[](assets/pi-mini-mode-settings.jpg)
|
|
86
|
+
[](https://raw.githubusercontent.com/eachann1024/pi-mini-mode/main/assets/pi-mini-mode-settings.jpg)
|
|
81
87
|
|
|
82
88
|
[Watch the footer settings demo](https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763)
|
|
83
89
|
|
|
@@ -85,17 +91,6 @@ This earlier screenshot and recording show footer configuration, not the newer i
|
|
|
85
91
|
|
|
86
92
|
</details>
|
|
87
93
|
|
|
88
|
-
## Commands
|
|
89
|
-
|
|
90
|
-
| Command / shortcut | Purpose |
|
|
91
|
-
| --- | --- |
|
|
92
|
-
| `/pi-mini-mode-settings` | Configure fields, input enhancements and minimal output |
|
|
93
|
-
| `Ctrl+O` | Expand or collapse the complete process tree |
|
|
94
|
-
| `Ctrl+S` | Expand or collapse completed subagent rows; yields to Pi `/model`, `/thinking`, and other selectors |
|
|
95
|
-
| `/reload` | Reload the extension after installation or source changes |
|
|
96
|
-
|
|
97
|
-
Subagent rows have their own click-to-expand control; supported third-party widgets retain native detail shortcuts.
|
|
98
|
-
|
|
99
94
|
## Compatibility
|
|
100
95
|
|
|
101
96
|
- **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).
|
|
@@ -109,7 +104,9 @@ Subagent rows have their own click-to-expand control; supported third-party widg
|
|
|
109
104
|
<details>
|
|
110
105
|
<summary><strong>First run & configuration</strong> — defaults, controls, and settings file</summary>
|
|
111
106
|
|
|
112
|
-
On the first interactive TUI session, Pi Mini Mode shows a preview.
|
|
107
|
+
On the first interactive TUI session, Pi Mini Mode shows a preview. **Branch-only**, **Cached tokens**, and **MCP count** are off by default; branch-only is mutually exclusive with **project & branch**. Change anything later with `/pi-mini-mode-settings`.
|
|
108
|
+
|
|
109
|
+
Example with optional Cached and MCP fields enabled:
|
|
113
110
|
|
|
114
111
|
```text
|
|
115
112
|
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500/1.0M ⣿⣀⣀⣀⣀⣀⣀⣀⣀⣀ 1% 120 tok/s
|
|
@@ -131,13 +128,16 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
|
|
|
131
128
|
|
|
132
129
|
```json
|
|
133
130
|
{
|
|
131
|
+
"pi-mini-mode-project-branch-show": true,
|
|
132
|
+
"pi-mini-mode-branch-show": false,
|
|
134
133
|
"pi-mini-mode-model-show": true,
|
|
135
134
|
"pi-mini-mode-thinking-show": true,
|
|
136
135
|
"pi-mini-mode-ch-show": true,
|
|
137
136
|
"pi-mini-mode-session-tokens-show": true,
|
|
138
|
-
"pi-mini-mode-cache-tokens-show":
|
|
137
|
+
"pi-mini-mode-cache-tokens-show": false,
|
|
138
|
+
"pi-mini-mode-cache-miss-show": true,
|
|
139
139
|
"pi-mini-mode-cost-show": true,
|
|
140
|
-
"pi-mini-mode-mcp-show":
|
|
140
|
+
"pi-mini-mode-mcp-show": false,
|
|
141
141
|
"pi-mini-mode-context-show": true,
|
|
142
142
|
"pi-mini-mode-context-dots-show": true,
|
|
143
143
|
"pi-mini-mode-context-percent-show": true,
|
|
@@ -151,13 +151,16 @@ Settings are stored globally at Pi's agent directory (normally `~/.pi/agent/pi-m
|
|
|
151
151
|
|
|
152
152
|
| Key | Default | Controls |
|
|
153
153
|
| --- | --- | --- |
|
|
154
|
+
| `pi-mini-mode-project-branch-show` | `true` | Project name and branch |
|
|
155
|
+
| `pi-mini-mode-branch-show` | `false` | Branch only, instead of project and branch |
|
|
154
156
|
| `pi-mini-mode-model-show` | `true` | Model ID without provider prefix |
|
|
155
157
|
| `pi-mini-mode-thinking-show` | `true` | Thinking level |
|
|
156
158
|
| `pi-mini-mode-ch-show` | `true` | Session cache-hit rate (`CH`) |
|
|
157
159
|
| `pi-mini-mode-session-tokens-show` | `true` | Accumulated session tokens (`Total`) |
|
|
158
|
-
| `pi-mini-mode-cache-tokens-show` | `
|
|
160
|
+
| `pi-mini-mode-cache-tokens-show` | `false` | Accumulated cache read + cache write tokens |
|
|
161
|
+
| `pi-mini-mode-cache-miss-show` | `true` | Estimated cache misses when detected |
|
|
159
162
|
| `pi-mini-mode-cost-show` | `true` | Estimated session list price |
|
|
160
|
-
| `pi-mini-mode-mcp-show` | `
|
|
163
|
+
| `pi-mini-mode-mcp-show` | `false` | Enabled MCP server count |
|
|
161
164
|
| `pi-mini-mode-context-show` | `true` | Used/total context tokens and progress bar |
|
|
162
165
|
| `pi-mini-mode-context-dots-show` | `true` | Use a single-line dot-matrix bar instead of the solid bar |
|
|
163
166
|
| `pi-mini-mode-context-percent-show` | `true` | Context-use percentage |
|
|
@@ -212,13 +215,6 @@ The backup workflow needs the package’s npm Trusted Publisher configured for t
|
|
|
212
215
|
|
|
213
216
|
</details>
|
|
214
217
|
|
|
215
|
-
<details>
|
|
216
|
-
<summary><strong>Collaboration guidance</strong></summary>
|
|
217
|
-
|
|
218
|
-
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.
|
|
219
|
-
|
|
220
|
-
</details>
|
|
221
|
-
|
|
222
218
|
---
|
|
223
219
|
|
|
224
220
|
[MIT License](LICENSE) · Built for [Pi](https://pi.dev)
|
package/README.zh-CN.md
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
<p>
|
|
2
|
-
<img src="assets/readme-cover.zh-CN.svg" alt="Pi Mini Mode — 少一点干扰,多一点专注。图片输入、可折叠对话、子代理、明暗主题与实时页脚。" width="100%">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/eachann1024/pi-mini-mode/main/assets/readme-cover.zh-CN.svg" alt="Pi Mini Mode — 少一点干扰,多一点专注。图片输入、可折叠对话、子代理、明暗主题与实时页脚。" width="100%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
[English](README.md) · [安装](#安装) · [功能](#功能) · [
|
|
5
|
+
[English](https://github.com/eachann1024/pi-mini-mode/blob/main/README.md) · [安装](#安装) · [功能](#功能) · [参考](#参考)
|
|
6
6
|
|
|
7
7
|
# Pi Mini Mode
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
9
|
**少一点干扰。多一点专注。**
|
|
13
10
|
|
|
14
11
|
为 [Pi](https://pi.dev) 的日常工作做一点精细的改进,不止于页脚。光标处预览图片,折叠长消息和过程详情,展开子代理工作,让重要的会话状态始终清晰。
|
|
15
12
|
|
|
16
|
-
<
|
|
17
|
-
|
|
13
|
+
<details>
|
|
14
|
+
<summary>查看完整界面</summary>
|
|
18
15
|
|
|
16
|
+
<img width="892" height="797" alt="Pi Mini Mode 完整界面" src="https://github.com/user-attachments/assets/8f7abdc8-646e-4ded-8009-b58d2833c1f4" />
|
|
19
17
|
|
|
18
|
+
</details>
|
|
20
19
|
|
|
21
20
|
## 安装
|
|
22
21
|
|
|
@@ -24,10 +23,18 @@
|
|
|
24
23
|
pi install npm:@each1024/pi-mini-mode
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
已打开的 Pi 会话中,运行 Pi 自带的 `/reload`。首次使用选择 **应用推荐配置**,设置内置主题和全屏模式,重启 Pi 后全屏才会生效。之后可用 `/pi-mini-mode-settings` 随时配置本扩展。项目设置和命令行参数可能覆盖全局设置。
|
|
28
27
|
|
|
29
28
|
**需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
|
|
30
29
|
|
|
30
|
+
### 更新已安装的 npm 版本
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi update npm:@each1024/pi-mini-mode
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
然后在 Pi 中运行 `/reload`,重新打开 `/pi-mini-mode-settings`(或重启 Pi)。HTML 设置页随扩展一起更新,不需要另外执行 npm 命令或启动开发服务器。发布本身不会自动更新用户已安装的副本或已打开的浏览器标签页。固定版本用户需先用上面的不带版本号安装命令替换安装;本地开发安装仍读取本地文件。
|
|
37
|
+
|
|
31
38
|
<details>
|
|
32
39
|
<summary>也可以从 GitHub 安装</summary>
|
|
33
40
|
|
|
@@ -41,6 +48,8 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
41
48
|
|
|
42
49
|
### 01 / 输入,更顺手
|
|
43
50
|
|
|
51
|
+
<img width="1092" height="764" alt="图片预览与紧凑标签" src="https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445" />
|
|
52
|
+
|
|
44
53
|
**图片,随光标浮现。** 编辑光标移入图片路径或紧凑标签,即可预览。全屏编辑器也支持悬停,按 `Esc` 关闭。
|
|
45
54
|
|
|
46
55
|
**收起路径,保留原图。** 输入框和消息中的图片路径收纳为带下划线的 `[image1]` 标签,提交时保留原始路径。使用终端的链接点击手势,即可通过系统默认应用打开原图或其他文件。
|
|
@@ -49,23 +58,21 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
49
58
|
|
|
50
59
|
使用 `Ctrl+V` 粘贴图片,Windows/WSL 使用 `Alt+V`。关闭输入增强不会关闭 Pi 原生剪贴板功能。
|
|
51
60
|
|
|
52
|
-
<img width="1092" height="764" alt="image" src="https://github.com/user-attachments/assets/2ea6d037-d3f0-423c-8588-17992a49d445" />
|
|
53
|
-
|
|
54
61
|
### 02 / 过程,更安静
|
|
55
62
|
|
|
56
63
|
在 `/pi-mini-mode-settings` 中开启 **极简输出**。
|
|
57
64
|
|
|
65
|
+
<img width="1092" height="764" alt="极简输出中的过程树" src="https://github.com/user-attachments/assets/eb8c88f6-84af-499e-b105-5395b4f02e66" />
|
|
66
|
+
|
|
58
67
|
- **长消息,自动折叠。** 全屏极简模式下,长用户消息默认保留前四个显示行。点击折叠控件展开全文。完整代码围栏保持完整。
|
|
59
|
-
- **子代理,清晰可查。**
|
|
68
|
+
- **子代理,清晰可查。** 点击子代理行,展开可用的活动记录与消息/最终输出。极简模式下,本扩展用 `Ctrl+S` 展开/收起已完成的子代理摘要;Pi 当前聚焦的选择器保留自己的快捷键。任务派发回执或工具调用返回,不等于后台任务已完成。
|
|
60
69
|
- **过程是一棵树,而非满屏输出。** 思考、工具与技能读取汇入同一棵时间顺序树,显示最新摘要,包括最新一条思考;`Ctrl+O` 展开/收起完整过程,新问题默认收起。
|
|
61
70
|
- **工具详情,按需展开。** 点击工具或思考条目的折叠控件,最新一条思考也可以展开。思考默认收起,进行中与结束后均只由手动操作展开或收起。工具详情展示保存的文本,不还原原生自定义渲染器或图片输出。
|
|
62
71
|
- **把空间留给答案。** 最终 Markdown 流式呈现,不添加额外标题或背景。失败和中断明确标记;折叠只改变显示,不删除原始会话消息。
|
|
63
72
|
|
|
64
73
|
在设置中关闭 **极简输出** 即恢复 Pi 原生历史。
|
|
65
74
|
|
|
66
|
-
<img width="1092" height="764" alt="
|
|
67
|
-
<img width="1092" height="764" alt="image" src="https://github.com/user-attachments/assets/53f5aa28-4b96-45db-b02e-0108aa9e68bc" />
|
|
68
|
-
|
|
75
|
+
<img width="1092" height="764" alt="展开后的过程详情" src="https://github.com/user-attachments/assets/53f5aa28-4b96-45db-b02e-0108aa9e68bc" />
|
|
69
76
|
|
|
70
77
|
### 03 / 状态,更清晰
|
|
71
78
|
|
|
@@ -76,7 +83,7 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
76
83
|
<details>
|
|
77
84
|
<summary>查看页脚设置截图与演示</summary>
|
|
78
85
|
|
|
79
|
-
[](assets/pi-mini-mode-settings.jpg)
|
|
86
|
+
[](https://raw.githubusercontent.com/eachann1024/pi-mini-mode/main/assets/pi-mini-mode-settings.jpg)
|
|
80
87
|
|
|
81
88
|
[观看页脚设置演示](https://github.com/user-attachments/assets/5f2f4816-45ed-4759-b035-d9ee59e8a763)
|
|
82
89
|
|
|
@@ -84,17 +91,6 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
84
91
|
|
|
85
92
|
</details>
|
|
86
93
|
|
|
87
|
-
## 命令速查
|
|
88
|
-
|
|
89
|
-
| 命令/快捷键 | 用途 |
|
|
90
|
-
| --- | --- |
|
|
91
|
-
| `/pi-mini-mode-settings` | 配置字段、输入增强和极简输出 |
|
|
92
|
-
| `Ctrl+O` | 展开/收起完整过程树 |
|
|
93
|
-
| `Ctrl+S` | 展开/收起已完成的子代理行;打开 `/model`、`/thinking` 等选择器时交给 Pi |
|
|
94
|
-
| `/reload` | 安装或修改源码后重载扩展 |
|
|
95
|
-
|
|
96
|
-
子代理行有独立的点击展开控件;受支持的第三方小组件保留原生详情快捷键。
|
|
97
|
-
|
|
98
94
|
## 兼容性
|
|
99
95
|
|
|
100
96
|
- **图片:** 预览依赖终端图片协议,不支持时显示提示。读取上限 **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)。
|
|
@@ -108,7 +104,9 @@ pi install git:github.com/eachann1024/pi-mini-mode
|
|
|
108
104
|
<details>
|
|
109
105
|
<summary><strong>首次使用与配置</strong></summary>
|
|
110
106
|
|
|
111
|
-
首次进入交互式 TUI 会话时,Pi Mini Mode
|
|
107
|
+
首次进入交互式 TUI 会话时,Pi Mini Mode 显示设置预览。「仅显示分支」「缓存 token」「MCP」默认关闭;「仅显示分支」与「项目与分支」互斥。之后可用 `/pi-mini-mode-settings` 再改。
|
|
108
|
+
|
|
109
|
+
以下示例开启了可选的 Cached 和 MCP 字段:
|
|
112
110
|
|
|
113
111
|
```text
|
|
114
112
|
deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500/1.0M ⣿⣀⣀⣀⣀⣀⣀⣀⣀⣀ 1% 120 tok/s
|
|
@@ -120,13 +118,16 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500
|
|
|
120
118
|
|
|
121
119
|
```json
|
|
122
120
|
{
|
|
121
|
+
"pi-mini-mode-project-branch-show": true,
|
|
122
|
+
"pi-mini-mode-branch-show": false,
|
|
123
123
|
"pi-mini-mode-model-show": true,
|
|
124
124
|
"pi-mini-mode-thinking-show": true,
|
|
125
125
|
"pi-mini-mode-ch-show": true,
|
|
126
126
|
"pi-mini-mode-session-tokens-show": true,
|
|
127
|
-
"pi-mini-mode-cache-tokens-show":
|
|
127
|
+
"pi-mini-mode-cache-tokens-show": false,
|
|
128
|
+
"pi-mini-mode-cache-miss-show": true,
|
|
128
129
|
"pi-mini-mode-cost-show": true,
|
|
129
|
-
"pi-mini-mode-mcp-show":
|
|
130
|
+
"pi-mini-mode-mcp-show": false,
|
|
130
131
|
"pi-mini-mode-context-show": true,
|
|
131
132
|
"pi-mini-mode-context-dots-show": true,
|
|
132
133
|
"pi-mini-mode-context-percent-show": true,
|
|
@@ -140,13 +141,16 @@ deepseek-v4-flash high Total 45K Cached 25K CH 40.0% $0.012 ◇ MCP 3 500
|
|
|
140
141
|
|
|
141
142
|
| 配置项 | 默认值 | 说明 |
|
|
142
143
|
| --- | --- | --- |
|
|
144
|
+
| `pi-mini-mode-project-branch-show` | `true` | 显示项目名称与分支 |
|
|
145
|
+
| `pi-mini-mode-branch-show` | `false` | 仅显示分支,代替项目与分支 |
|
|
143
146
|
| `pi-mini-mode-model-show` | `true` | 显示不含 provider 前缀的模型 ID |
|
|
144
147
|
| `pi-mini-mode-thinking-show` | `true` | 显示思考级别 |
|
|
145
148
|
| `pi-mini-mode-ch-show` | `true` | 显示会话缓存命中率(`CH`) |
|
|
146
149
|
| `pi-mini-mode-session-tokens-show` | `true` | 显示会话累计令牌(`Total`) |
|
|
147
|
-
| `pi-mini-mode-cache-tokens-show` | `
|
|
150
|
+
| `pi-mini-mode-cache-tokens-show` | `false` | 显示缓存读取与写入令牌(已包含在 Total 中) |
|
|
151
|
+
| `pi-mini-mode-cache-miss-show` | `true` | 检测到缓存 miss 时显示估算量 |
|
|
148
152
|
| `pi-mini-mode-cost-show` | `true` | 显示会话费用估算 |
|
|
149
|
-
| `pi-mini-mode-mcp-show` | `
|
|
153
|
+
| `pi-mini-mode-mcp-show` | `false` | 显示已启用的 MCP 服务器数量 |
|
|
150
154
|
| `pi-mini-mode-context-show` | `true` | 显示已用/总上下文令牌和进度条 |
|
|
151
155
|
| `pi-mini-mode-context-dots-show` | `true` | 使用单行点阵进度条替代实心进度条 |
|
|
152
156
|
| `pi-mini-mode-context-percent-show` | `true` | 显示上下文使用百分比 |
|
|
@@ -204,13 +208,6 @@ python3 test/minimal-pty.py
|
|
|
204
208
|
|
|
205
209
|
</details>
|
|
206
210
|
|
|
207
|
-
<details>
|
|
208
|
-
<summary><strong>协作说明</strong></summary>
|
|
209
|
-
|
|
210
|
-
主会话负责需求对齐、风险调研、完整方案、任务调度、关键决策、整合与总结;执行前应先调查关键风险点、边界、验收标准和解决方案。获得授权后,应积极使用子代理并并行拆分独立任务以节省时间,同时遵守相关性、风险、预算、并发和单一修改负责人约束。绝大部分任务及子代理默认使用 `low` 模型,仅在复杂推理、关键决策或风险审查确有需要时升级。
|
|
211
|
-
|
|
212
|
-
</details>
|
|
213
|
-
|
|
214
211
|
---
|
|
215
212
|
|
|
216
213
|
[MIT License](LICENSE) · 为 [Pi](https://pi.dev) 打造
|
package/lib/settings-web.ts
CHANGED
|
@@ -26,7 +26,6 @@ function configuredIdleTimeout(override: number | undefined): number {
|
|
|
26
26
|
/** On-demand, loopback-only settings bridge; no polling or third-party runtime. */
|
|
27
27
|
export async function startSettingsWeb(snapshot: () => unknown, update: (value: unknown) => Promise<void>, options: SettingsWebOptions = {}) {
|
|
28
28
|
const token = randomBytes(24).toString("hex");
|
|
29
|
-
const html = await readFile(new URL("./settings.html", import.meta.url));
|
|
30
29
|
const idleTimeoutMs = configuredIdleTimeout(options.idleTimeoutMs);
|
|
31
30
|
let origin = "";
|
|
32
31
|
let queue = Promise.resolve();
|
|
@@ -63,7 +62,13 @@ export async function startSettingsWeb(snapshot: () => unknown, update: (value:
|
|
|
63
62
|
res.writeHead(403).end(); return;
|
|
64
63
|
}
|
|
65
64
|
if (req.url === "/" && req.method === "GET") {
|
|
66
|
-
|
|
65
|
+
try {
|
|
66
|
+
const html = await readFile(new URL("./settings.html", import.meta.url));
|
|
67
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8"); res.end(html);
|
|
68
|
+
} catch {
|
|
69
|
+
res.writeHead(503).end("Settings page unavailable. Reload Pi and reopen settings.");
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
67
72
|
}
|
|
68
73
|
if (req.url !== "/settings" || req.headers.authorization !== `Bearer ${token}`) {
|
|
69
74
|
res.writeHead(403).end(); return;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@each1024/pi-mini-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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/settings-web.mjs && 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"
|
|
8
|
+
"test": "node test/settings-web.mjs && 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 && node test/settings-package.mjs",
|
|
9
|
+
"prepublishOnly": "npm run check && npm test"
|
|
9
10
|
},
|
|
10
11
|
"license": "MIT",
|
|
11
12
|
"author": "eachann1024",
|