pi-tui-status-beautifier 1.7.4 → 1.7.6
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 +21 -3
- package/README_ja.md +125 -0
- package/README_zh.md +182 -0
- package/assets/hero-en.svg +75 -0
- package/package.json +19 -4
package/README.md
CHANGED
|
@@ -5,12 +5,17 @@ Minimalist status bar formatter & layout engine for Pi TUI.
|
|
|
5
5
|
Clean up fragmented extension status strings. Enjoy adaptive narrow-terminal folding and zero render-loop disk I/O, with zero telemetry hijacking.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
8
|
-
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
9
|
+
[](https://github.com/3ZEROS12/pi-tui-status-beautifier/stargazers)
|
|
9
10
|
[](https://github.com/earendil-works/pi-coding-agent)
|
|
10
11
|
[-brightgreen)](extensions/tui-status-beautifier.spec.ts)
|
|
11
|
-
[](LICENSE)
|
|
12
13
|
|
|
13
|
-
**English** | [简体中文](./README_zh.md)
|
|
14
|
+
**English** | [日本語](./README_ja.md) | [简体中文](./README_zh.md)
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="assets/hero-en.svg" alt="pi-tui-status-beautifier Presets" width="820">
|
|
18
|
+
</p>
|
|
14
19
|
|
|
15
20
|
```text
|
|
16
21
|
┌─ Native Status Bar (Fragmented & Cluttered) ────────────────────────────────────────────────────────┐
|
|
@@ -159,6 +164,19 @@ npm run lint # Zero ESLint warnings
|
|
|
159
164
|
|
|
160
165
|
---
|
|
161
166
|
|
|
167
|
+
## Ecosystem: Pi Terminal Suite
|
|
168
|
+
|
|
169
|
+
Each extension occupies a distinct terminal slot (`aboveEditor`, `belowEditor`, `status-only` footer, and runtime tool hooks) so all four run together with zero widget overlap:
|
|
170
|
+
|
|
171
|
+
| Package | Terminal Slot & Mechanism | Install |
|
|
172
|
+
| :--- | :--- | :--- |
|
|
173
|
+
| **[`pi-lingual`](https://github.com/3ZEROS12/pi-lingual)** | `二 ⇄ two` `aboveEditor` HUD (≤9 lines, UAX #11 tree layout) & prompt-to-English transformer (0 chat history tokens) | `pi install npm:pi-lingual` |
|
|
174
|
+
| **[`toolflow`](https://github.com/3ZEROS12/toolflow)** | `⌬` Runtime tool hooks — stage-gated MCP mounting & >40-line log dehydration to disk (-95% log tokens) | `pi install npm:toolflow` |
|
|
175
|
+
| **[`pi-tui-status-beautifier`](https://github.com/3ZEROS12/pi-tui-status-beautifier)** *(Current)* | `status-only` footer hook — 6 badge presets, `<80`-col idle folding `(+N idle)`, 0 render-loop disk reads | `pi install npm:pi-tui-status-beautifier` |
|
|
176
|
+
| **[`pi-anchor`](https://github.com/3ZEROS12/anchor)** | `⌖` `belowEditor` 1-line sticky strip, 0ms `pin:` intercept, `[■■□□]` step bar & `↪` session jump | `pi install npm:pi-anchor` |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
162
180
|
## License
|
|
163
181
|
|
|
164
182
|
MIT © [Jason](https://github.com/3ZEROS12)
|
package/README_ja.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# pi-tui-status-beautifier
|
|
2
|
+
|
|
3
|
+
Pi TUI 向けのミニマリストなステータスバー整形・レイアウトエンジン。
|
|
4
|
+
|
|
5
|
+
拡張機能ごとにバラバラなステータス文字列を統一。狭い分割ペインでの自動折りたたみ、描画ループ内のディスク I/O ゼロ、そしてシステム本来のテレメトリ(トークン数・Git ブランチ等)を一切奪わない非侵襲設計を備えています。
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
8
|
+
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
9
|
+
[](https://github.com/3ZEROS12/pi-tui-status-beautifier/stargazers)
|
|
10
|
+
[](https://github.com/earendil-works/pi-coding-agent)
|
|
11
|
+
[-brightgreen)](extensions/tui-status-beautifier.spec.ts)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
|
|
14
|
+
[English](./README.md) | **日本語** | [简体中文](./README_zh.md)
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="assets/hero-en.svg" alt="pi-tui-status-beautifier Presets" width="820">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
┌─ ネイティブのステータスバー (表記が不統一で雑然とした状態) ────────────────────────────────────────┐
|
|
22
|
+
│ plannotator: 🟢 3 tasks pi-mcp-adapter: [connected] toolflow: active (2/5) anchor: 3 items │
|
|
23
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
┌─ pi-tui-status-beautifier (正規化・整列・幅に応じた自動折りたたみ) ────────────────────────────────┐
|
|
27
|
+
│ plan ❯ ◆ 3 mcp ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3 chrome ❯ ● connected │
|
|
28
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## クイックスタート
|
|
32
|
+
|
|
33
|
+
Pi 内で直接インストールできます:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pi install npm:pi-tui-status-beautifier
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
インストール後すぐに反映されます。`/beautify` と入力すれば、いつでも対話メニューからスタイルを切り替えられます。
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## コアバリュー:なぜ必要なのか?
|
|
44
|
+
|
|
45
|
+
Pi の拡張機能(`plannotator`, `pi-mcp-adapter`, `toolflow`, `pi-anchor`, `pi-lingual` など)を複数導入すると、下部のステータスバーで 4 つの問題が起きます:
|
|
46
|
+
|
|
47
|
+
### 1. 表記スタイルの不統一と視覚的ノイズ
|
|
48
|
+
各拡張機能が独自のフォーマット(長いパッケージ名プレフィックス、括弧、生の絵文字など)で文字列を出力するため、画面下部の視認性が悪化します。
|
|
49
|
+
`pi-tui-status-beautifier` は冗長なパッケージ接頭辞を取り除き、構造化されたマイクロバッジへ統一します。
|
|
50
|
+
|
|
51
|
+
### 2. 狭い分割ペインでの強制折り返し
|
|
52
|
+
tmux や WezTerm の分割ペイン(`< 80` カラム)では、長すぎるステータス行が複数行に折り返され、入力欄が上下に揺れてタイピングの妨げになります。
|
|
53
|
+
内蔵のカラム幅ガードが画面幅を検知し、狭い画面では待機中のバッジを自動的に `(+3 idle)` に折りたたみ、実行中やエラーのバッジを優先表示します。
|
|
54
|
+
|
|
55
|
+
### 3. システム本来のテレメトリを奪わない(`status-only`)
|
|
56
|
+
`ctx.ui.setFooter` でフッター全体を置き換えるプラグインは、Git ブランチ名、トークン消費量(`↑1.2k ↓3.4k`)、キャッシュ率、思考レベル(`• high`)まで消してしまいます。
|
|
57
|
+
本拡張機能はデフォルトで**非侵襲マイクロフック(`status-only`)**として動作し、ネイティブのシステム指標を 100% 残したまま拡張バッジのみを整形します。
|
|
58
|
+
|
|
59
|
+
### 4. 描画ループ内のディスク I/O ゼロ
|
|
60
|
+
高頻度の TUI 再描画ループ内で設定ファイルを同期読み込み(`fs.readFileSync`)すると、タイピング遅延の原因になります。
|
|
61
|
+
本拡張機能は起動時に設定をメモリへ読み込み、Dirty-Checking キャッシュを用いることで**描画ループ内のファイル読み込みをゼロ**に抑えています。
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## プリセット一覧
|
|
66
|
+
|
|
67
|
+
`/beautify` で以下の 6 スタイルをリアルタイムに切り替えられます:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
1. stream (デフォルト・ミニマリストストリーム)
|
|
71
|
+
chrome ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3 plan ❯ ◆ 1
|
|
72
|
+
|
|
73
|
+
2. powerline (アングルブラケット&幾何学グリフ)
|
|
74
|
+
chrome ‹◆ ready› toolflow ‹◈ 2/5› anchor ‹⌖ 3› plan ‹◆ 1›
|
|
75
|
+
|
|
76
|
+
3. matrix (ドットマトリクス枠&スターアクセント)
|
|
77
|
+
chrome ⦗✦ ready⦘ toolflow ⦗✧ 2/5⦘ anchor ⦗⌖ 3⦘ plan ⦗✦ 1⦘
|
|
78
|
+
|
|
79
|
+
4. glow (高コントラスト反転ピルバッジ)
|
|
80
|
+
chrome [ ● ready ] toolflow [ ⌬ 2/5 ] anchor [ ⌖ 3 ] plan [ ◆ 1 ]
|
|
81
|
+
|
|
82
|
+
5. minimal (10 カラム固定幅整列ストリーム)
|
|
83
|
+
chrome ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3
|
|
84
|
+
|
|
85
|
+
6. custom (AI 協調デザイン)
|
|
86
|
+
好みのスタイルを自然言語で伝えると、3 種類の ASCII モックアップを生成します。
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## コマンド&設定
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
/beautify # 対話型スタイル選択メニューを開く
|
|
95
|
+
/beautify stream # stream プリセットへ直接切り替え
|
|
96
|
+
/beautify off # ネイティブ表示へ戻し、設定ファイルから beautifier キーを物理削除
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 検証とテスト
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm test # Vitest ユニットテスト 18/18 通過
|
|
105
|
+
npm run lint # ESLint 警告ゼロ
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Ecosystem: Pi Terminal Suite
|
|
111
|
+
|
|
112
|
+
4 つの拡張機能はそれぞれ異なるターミナルスロット(`aboveEditor`、`belowEditor`、`status-only` フッター、実行時ツールフック)にマウントされるため、単体でも全種併用でも UI が干渉しません:
|
|
113
|
+
|
|
114
|
+
| パッケージ | ターミナル配置スロットと機構 | インストール |
|
|
115
|
+
| :--- | :--- | :--- |
|
|
116
|
+
| **[`pi-lingual`](https://github.com/3ZEROS12/pi-lingual)** | `二 ⇄ two` `aboveEditor` 二言語 HUD(最大 9 行・UAX #11 ツリーレイアウト)&英語プロンプト変換(履歴トークン消費 0) | `pi install npm:pi-lingual` |
|
|
117
|
+
| **[`toolflow`](https://github.com/3ZEROS12/toolflow)** | `⌬` 実行時ツールフック —— フェーズ別 MCP マウント&40 行超のログ自動ディスク退避(ログトークン 95% 削減) | `pi install npm:toolflow` |
|
|
118
|
+
| **[`pi-tui-status-beautifier`](https://github.com/3ZEROS12/pi-tui-status-beautifier)** *(現在)* | `status-only` フッターフック —— 6 種のバッジプリセット、`<80` 列での待機バッジ折りたたみ `(+N idle)`、描画ループ内ディスク I/O ゼロ | `pi install npm:pi-tui-status-beautifier` |
|
|
119
|
+
| **[`pi-anchor`](https://github.com/3ZEROS12/anchor)** | `⌖` `belowEditor` 1 行常駐付箋バー、0ms `pin:` インターセプト、ミニ進捗バー `[■■□□]` & `↪` セッション復帰 | `pi install npm:pi-anchor` |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## ライセンス
|
|
124
|
+
|
|
125
|
+
MIT © [Jason](https://github.com/3ZEROS12)
|
package/README_zh.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# pi-tui-status-beautifier
|
|
2
|
+
|
|
3
|
+
面向 Pi TUI 的极简状态栏规范化引擎与可定制排版扩展。
|
|
4
|
+
|
|
5
|
+
告别混乱杂乱的终端底栏。统一扩展状态字符串,分屏自动折叠,渲染循环 0 磁盘 I/O 开销,绝不劫持系统原生遥测。
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
8
|
+
[](https://www.npmjs.com/package/pi-tui-status-beautifier)
|
|
9
|
+
[](https://github.com/3ZEROS12/pi-tui-status-beautifier/stargazers)
|
|
10
|
+
[](https://github.com/earendil-works/pi-coding-agent)
|
|
11
|
+
[-brightgreen)](extensions/tui-status-beautifier.spec.ts)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
|
|
14
|
+
[English](./README.md) | [日本語](./README_ja.md) | **简体中文**
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="assets/hero-en.svg" alt="pi-tui-status-beautifier 状态栏预设对比" width="820">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
┌─ 原生底栏(长短不一、缺乏统一规范) ───────────────────────────────────────────────────────────────┐
|
|
22
|
+
│ plannotator: 🟢 3 tasks pi-mcp-adapter: [connected] toolflow: active (2/5) anchor: 3 items │
|
|
23
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
┌─ pi-tui-status-beautifier(规整对齐、自适应折叠、地道终端质感) ────────────────────────────────────┐
|
|
27
|
+
│ plan ❯ ◆ 3 mcp ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3 chrome ❯ ● connected │
|
|
28
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 一键安装
|
|
32
|
+
|
|
33
|
+
在 Pi 终端内直接运行:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pi install npm:pi-tui-status-beautifier
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
安装即可直接生效。输入 `/beautify` 随时交互式切换预设风格。
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 核心价值:为什么需要它?
|
|
44
|
+
|
|
45
|
+
随着 Pi 插件生态日益丰富,开发者通常会安装多个扩展(`plannotator`、`pi-mcp-adapter`、`toolflow`、`pi-anchor`、`pi-lingual` 等)。底栏状态常面临四重困扰:
|
|
46
|
+
|
|
47
|
+
### 1. 命名风格与格式杂乱无章
|
|
48
|
+
各插件作者独立编写状态文本。有的带长包名前缀(`pi-mcp-adapter:`),有的用括号包裹数值(`[2]`),有的输出原生 emoji。长短不一的字符串在屏幕底部不断拉扯视线。
|
|
49
|
+
`pi-tui-status-beautifier` 自动剥离包名后缀,将杂乱状态统一规范为结构清晰的微型徽章。
|
|
50
|
+
|
|
51
|
+
### 2. 窄分屏下强制折行溢出
|
|
52
|
+
在 tmux、WezTerm 等多分屏环境下(列宽 `< 80`),冗长的状态字符串容易被强制折行,把编辑输入框向上挤压,破坏打字心流。
|
|
53
|
+
插件内置列宽预算守卫。当宽度紧张时,自动将闲置状态折叠为 `(+3 idle)`,优先保全报错与执行中状态。
|
|
54
|
+
|
|
55
|
+
### 3. 绝不劫持系统原生遥测数据
|
|
56
|
+
许多底栏美化工具采用粗暴的全局覆盖,把 Pi 原生的 Git 分支、Token 消耗(`↑1.2k ↓3.4k`)、上下文缓存率和思考级别(`• high`)全部冲掉。
|
|
57
|
+
本扩展默认采用**非侵入式微钩子(status-only)**:仅规范化插件状态徽章,Pi 原生的所有底层遥测数据 100% 原样保留。
|
|
58
|
+
|
|
59
|
+
### 4. 渲染循环 0 磁盘 I/O 损耗
|
|
60
|
+
在终端高频重绘动画中读取配置,极易引发磁盘 I/O 争用与打字卡顿。
|
|
61
|
+
本扩展在启动时完成内存装载,并在渲染层执行 Dirty-Checking 缓存,**TUI 重绘循环中 0 次调用同步文件读取**。
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 工作机制:行为-结果矩阵
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
/beautify (随时调出交互式主题切换器)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| 模式 / 场景 | 你做什么 | 插件幕后动作 | 底栏最终呈现 | 适用场景 |
|
|
72
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
73
|
+
| **`stream`** *(默认极简)* | 正常安装各扩展 | 剥离冗长包名与杂乱符号,规范徽章 | `plan ❯ ◆ 3 mcp ❯ ● ready anchor ❯ ⌖ 3` | 干净极简,日常主力推荐 |
|
|
74
|
+
| **窄分屏自适应** | tmux 分屏宽度 `< 80` 列 | 识别活跃状态,自动折叠就绪状态 | `toolflow ❯ ⌬ running (2/5) (+3 idle)` | 多分屏防挤压折行 |
|
|
75
|
+
| **`full-footer`** *(全景)* | 开启全量底栏模式 | 接管两行底栏,第一行系统遥测,第二行徽章 | 行 1: 目录/Git/Token/模型;行 2: 规范徽章 | 极客全景视窗 |
|
|
76
|
+
| **`off`** *(彻底还原)* | 运行 `/beautify off` | 物理删除 `settings.json` 中的 `beautifier` 键 | 100% 还原原生底栏,零残留 | 随时无痛试用与反悔 |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 预设画廊与视觉风格
|
|
81
|
+
|
|
82
|
+
键入 `/beautify` 即可实时交互切换不同风格:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
1. stream (默认极简流式)
|
|
86
|
+
chrome ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3 plan ❯ ◆ 1
|
|
87
|
+
|
|
88
|
+
2. powerline (尖角分界与几何徽记)
|
|
89
|
+
chrome ‹◆ ready› toolflow ‹◈ 2/5› anchor ‹⌖ 3› plan ‹◆ 1›
|
|
90
|
+
|
|
91
|
+
3. matrix (点阵微框与星标)
|
|
92
|
+
chrome ⦗✦ ready⦘ toolflow ⦗✧ 2/5⦘ anchor ⦗⌖ 3⦘ plan ⦗✦ 1⦘
|
|
93
|
+
|
|
94
|
+
4. glow (高对比度反色胶囊)
|
|
95
|
+
chrome [ ● ready ] toolflow [ ⌬ 2/5 ] anchor [ ⌖ 3 ] plan [ ◆ 1 ]
|
|
96
|
+
|
|
97
|
+
5. minimal (10 列等宽排版流)
|
|
98
|
+
chrome ❯ ● ready toolflow ❯ ⌬ 2/5 anchor ❯ ⌖ 3
|
|
99
|
+
|
|
100
|
+
6. custom (与 AI 结对定制)
|
|
101
|
+
用自然语言描述审美需求,由 Agent 提供 3 套 ASCII 视觉样机并自动入库。
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 核心特性与工程机制
|
|
107
|
+
|
|
108
|
+
- 🛡️ **非侵入式双层作用域**:
|
|
109
|
+
* `status-only`(默认推荐):仅规范化插件徽章,100% 完整保留 Pi 原生 Git 分支、Token 遥测与思考级别;
|
|
110
|
+
* `full-footer`(深度一体化):重构底栏为两行式布局,第一行系统状态,第二行插件状态。
|
|
111
|
+
- 📐 **Unicode UAX #11 与代理对安全**:内置独立字符宽度扫描器,精确计算东亚宽字符(2 列)、ASCII(1 列)与 ANSI 控制序列(0 列),彻底消除光标抖动与排版错位。
|
|
112
|
+
- ⚡ **渲染循环 0 磁盘 I/O**:会话启动时将配置加载至内存,重绘循环 0 磁盘读取;对相同状态执行 Dirty-Checking 缓存,避免重复构建字符串。
|
|
113
|
+
- ◐ **动态微型旋转器**:执行中的任务(`running`、`working`)自动触发 300ms 动态旋转器(`◐`、`◓`、`◑`、`◒`)。
|
|
114
|
+
- 🗑️ **零残留物理还原(Zero-Trace Revert)**:选择 `off` 时,不仅即时还原所有插件原生状态,还会从 `settings.json` 中物理删除 `beautifier` 键名,绝不留置废弃配置。
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 常用命令与配置
|
|
119
|
+
|
|
120
|
+
### 交互命令
|
|
121
|
+
```bash
|
|
122
|
+
/beautify # 打开交互式主题选择菜单
|
|
123
|
+
/beautify stream # 直接切换为 stream 风格
|
|
124
|
+
/beautify off # 彻底关闭并清理配置
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 配置文件规范
|
|
128
|
+
配置自动持久化在 `./.pi/settings.json`(项目级)或 `~/.pi/agent/settings.json`(全局):
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"beautifier": {
|
|
133
|
+
"style": "stream",
|
|
134
|
+
"fullFooter": false
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 作者手记
|
|
142
|
+
|
|
143
|
+
做 `pi-tui-status-beautifier` 的初衷,源于敲代码时的视觉烦躁。
|
|
144
|
+
|
|
145
|
+
随着装的 Pi 扩展越来越多,终端底栏逐渐变成了一个杂乱的广告牌。每个插件作者都有自己的标点风格、原生 emoji 和字符宽度。一旦进入 tmux 分屏,底栏经常被挤成两行,整块屏幕不断抖动。
|
|
146
|
+
|
|
147
|
+
市面上有些状态栏插件做法很激进:直接调用 `ctx.ui.setFooter` 把原生底栏整个端掉。结果把最重要的 Token 消耗、缓存命中率、思考级别和 Git 分支全给弄没了,有的甚至在每帧渲染里调用 `readFileSync` 读配置,打字都变钝。
|
|
148
|
+
|
|
149
|
+
这套扩展遵循三条硬约束:
|
|
150
|
+
1. **绝不吞原生遥测**:只修饰插件徽章,系统状态原汁原味;
|
|
151
|
+
2. **渲染循环 0 磁盘读取**:内存缓存,重复状态直接跳过;
|
|
152
|
+
3. **零残留反悔**:关掉时物理删除配置,不留半个孤儿键。
|
|
153
|
+
|
|
154
|
+
一个好的状态栏应当是安静、克制、整齐的,在你不需要它的时候近乎隐形。
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 质量验证
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm test # 物理单元测试套件 (18/18 全部通过)
|
|
162
|
+
npm run lint # ESLint 零警告
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 配套生态套件 (Pi Terminal Suite)
|
|
168
|
+
|
|
169
|
+
四款扩展分别挂载于终端的不同物理槽位(`aboveEditor`、`belowEditor`、`status-only` 底栏与运行时工具钩子),独立运行或组合安装均不产生小部件重叠:
|
|
170
|
+
|
|
171
|
+
| 插件仓库 | 终端挂载槽位与核心机制 | 一键安装 |
|
|
172
|
+
| :--- | :--- | :--- |
|
|
173
|
+
| **[`pi-lingual`](https://github.com/3ZEROS12/pi-lingual)** | `二 ⇄ two` `aboveEditor` 双语伴学视窗(≤9 行 UAX #11 树状排版)与母语提示词转写(0 会话历史 Token 注入) | `pi install npm:pi-lingual` |
|
|
174
|
+
| **[`toolflow`](https://github.com/3ZEROS12/toolflow)** | `⌬` 运行时工具钩子 —— 按阶段动态挂载重型 MCP,>40 行终端长日志自动落盘脱水(削减 95% 日志 Token) | `pi install npm:toolflow` |
|
|
175
|
+
| **[`pi-tui-status-beautifier`](https://github.com/3ZEROS12/pi-tui-status-beautifier)** *(当前)* | `status-only` 底栏微钩子 —— 6 套徽章预设、`<80` 列窄屏折叠 `(+N idle)`、重绘循环 0 磁盘读取 | `pi install npm:pi-tui-status-beautifier` |
|
|
176
|
+
| **[`pi-anchor`](https://github.com/3ZEROS12/anchor)** | `⌖` `belowEditor` 1 行常驻便签条、0ms `pin:` 输入拦截、迷你进度条 `[■■□□]` 与原会话跳转 `↪` | `pi install npm:pi-anchor` |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 开源协议
|
|
181
|
+
|
|
182
|
+
MIT © [Jason](https://github.com/3ZEROS12)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 840 430" width="840" height="430">
|
|
2
|
+
<defs>
|
|
3
|
+
<filter id="shadow" x="-5%" y="-5%" width="110%" height="115%" filterUnits="userSpaceOnUse">
|
|
4
|
+
<feDropShadow dx="0" dy="12" stdDeviation="16" flood-color="#000000" flood-opacity="0.45" />
|
|
5
|
+
</filter>
|
|
6
|
+
<linearGradient id="headerGrad" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
7
|
+
<stop offset="0%" stop-color="#2b3339" />
|
|
8
|
+
<stop offset="100%" stop-color="#232a2e" />
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
|
|
12
|
+
<g filter="url(#shadow)">
|
|
13
|
+
<rect x="20" y="15" width="800" height="390" rx="12" fill="#1e2326" stroke="#343f44" stroke-width="1.2" />
|
|
14
|
+
<path d="M 20,27 A 12,12 0 0,1 32,15 L 808,15 A 12,12 0 0,1 820,27 L 820,52 L 20,52 Z" fill="url(#headerGrad)" stroke="#343f44" stroke-width="1" />
|
|
15
|
+
<line x1="20" y1="52" x2="820" y2="52" stroke="#2d353b" stroke-width="1" />
|
|
16
|
+
<circle cx="42" cy="33.5" r="5.5" fill="#e67e80" />
|
|
17
|
+
<circle cx="60" cy="33.5" r="5.5" fill="#dbbc7f" />
|
|
18
|
+
<circle cx="78" cy="33.5" r="5.5" fill="#a7c080" />
|
|
19
|
+
<text x="420" y="38" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="12" font-weight="500" fill="#859289">
|
|
20
|
+
pi-tui-status-beautifier · 6 Crisp Status Bar Presets
|
|
21
|
+
</text>
|
|
22
|
+
</g>
|
|
23
|
+
|
|
24
|
+
<g font-family="'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace" font-size="13" xml:space="preserve">
|
|
25
|
+
<text x="45" y="88" fill="#859289">Before (Raw unformatted extension badges):</text>
|
|
26
|
+
<rect x="45" y="98" width="750" height="36" rx="6" fill="#292224" stroke="#543a3d" stroke-width="1" />
|
|
27
|
+
<text x="60" y="121" fill="#e67e80">[anchor: 3 active] [toolflow: active stage 2] [lingual: zh->en learn] [subagent: 2 running...]</text>
|
|
28
|
+
|
|
29
|
+
<text x="45" y="164" fill="#a7c080" font-weight="bold">After (Formatted with `/beautify` presets + dynamic width folding):</text>
|
|
30
|
+
|
|
31
|
+
<rect x="45" y="178" width="750" height="42" rx="6" fill="#232a2e" stroke="#3a464c" stroke-width="1" />
|
|
32
|
+
<text x="60" y="204">
|
|
33
|
+
<tspan fill="#7a8478">1. Stream </tspan>
|
|
34
|
+
<tspan fill="#a7c080" font-weight="bold">⌖ 3</tspan>
|
|
35
|
+
<tspan fill="#56635f"> · </tspan>
|
|
36
|
+
<tspan fill="#7fbbb3" font-weight="bold">⌬ impl</tspan>
|
|
37
|
+
<tspan fill="#56635f"> · </tspan>
|
|
38
|
+
<tspan fill="#d699b6" font-weight="bold">⇄ zh⇄en</tspan>
|
|
39
|
+
<tspan fill="#56635f"> · </tspan>
|
|
40
|
+
<tspan fill="#dbbc7f">⠋ 2 agents</tspan>
|
|
41
|
+
</text>
|
|
42
|
+
|
|
43
|
+
<rect x="45" y="232" width="750" height="42" rx="6" fill="#232a2e" stroke="#3a464c" stroke-width="1" />
|
|
44
|
+
<text x="60" y="258">
|
|
45
|
+
<tspan fill="#7a8478">2. Powerline </tspan>
|
|
46
|
+
<tspan fill="#232a2e" font-weight="bold"> ⌖ 3 </tspan>
|
|
47
|
+
<tspan fill="#a7c080"></tspan>
|
|
48
|
+
<tspan fill="#7fbbb3" font-weight="bold"> ⌬ impl </tspan>
|
|
49
|
+
<tspan fill="#7fbbb3"></tspan>
|
|
50
|
+
<tspan fill="#d699b6" font-weight="bold"> ⇄ zh⇄en </tspan>
|
|
51
|
+
<tspan fill="#d699b6"></tspan>
|
|
52
|
+
<tspan fill="#dbbc7f"> ⠋ 2 agents </tspan>
|
|
53
|
+
</text>
|
|
54
|
+
|
|
55
|
+
<rect x="45" y="286" width="750" height="42" rx="6" fill="#232a2e" stroke="#3a464c" stroke-width="1" />
|
|
56
|
+
<text x="60" y="312">
|
|
57
|
+
<tspan fill="#7a8478">3. Matrix </tspan>
|
|
58
|
+
<tspan fill="#a7c080">[⌖:03]</tspan>
|
|
59
|
+
<tspan fill="#56635f"> </tspan>
|
|
60
|
+
<tspan fill="#7fbbb3">[⌬:IMPL]</tspan>
|
|
61
|
+
<tspan fill="#56635f"> </tspan>
|
|
62
|
+
<tspan fill="#d699b6">[⇄:ZH-EN]</tspan>
|
|
63
|
+
<tspan fill="#56635f"> </tspan>
|
|
64
|
+
<tspan fill="#dbbc7f">[⠋:02]</tspan>
|
|
65
|
+
</text>
|
|
66
|
+
|
|
67
|
+
<text x="45" y="362" fill="#859289">
|
|
68
|
+
<tspan>Run </tspan>
|
|
69
|
+
<tspan fill="#7fbbb3" font-weight="bold">`/beautify`</tspan>
|
|
70
|
+
<tspan> to switch presets or </tspan>
|
|
71
|
+
<tspan fill="#7fbbb3" font-weight="bold">`/beautify:ai`</tspan>
|
|
72
|
+
<tspan> to design your own bar in plain language.</tspan>
|
|
73
|
+
</text>
|
|
74
|
+
</g>
|
|
75
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-tui-status-beautifier",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "Clean up your Pi terminal status bar — formats extension badges with crisp presets (Stream, Powerline, Matrix, Glow), folds idle items on narrow screens, and adds live spinners.",
|
|
5
5
|
"main": "extensions/tui-status-beautifier.ts",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"pi-package"
|
|
7
|
+
"pi-package",
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"status-bar",
|
|
10
|
+
"statusbar",
|
|
11
|
+
"tui",
|
|
12
|
+
"theme",
|
|
13
|
+
"powerline",
|
|
14
|
+
"beautifier",
|
|
15
|
+
"footer",
|
|
16
|
+
"hud",
|
|
17
|
+
"terminal-ui",
|
|
18
|
+
"coding-agent"
|
|
8
19
|
],
|
|
9
20
|
"pi": {
|
|
10
21
|
"extensions": [
|
|
11
22
|
"./extensions/tui-status-beautifier.ts"
|
|
12
|
-
]
|
|
23
|
+
],
|
|
24
|
+
"image": "https://raw.githubusercontent.com/3ZEROS12/pi-tui-status-beautifier/master/assets/hero-en.svg"
|
|
13
25
|
},
|
|
14
26
|
"files": [
|
|
15
27
|
"extensions/tui-status-beautifier.ts",
|
|
28
|
+
"assets",
|
|
16
29
|
"README.md",
|
|
30
|
+
"README_ja.md",
|
|
31
|
+
"README_zh.md",
|
|
17
32
|
"CHANGELOG.md",
|
|
18
33
|
"LICENSE"
|
|
19
34
|
],
|
|
20
35
|
"repository": {
|
|
21
36
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/3ZEROS12/pi-tui-status-beautifier.git"
|
|
37
|
+
"url": "git+https://github.com/3ZEROS12/pi-tui-status-beautifier.git"
|
|
23
38
|
},
|
|
24
39
|
"homepage": "https://github.com/3ZEROS12/pi-tui-status-beautifier#readme",
|
|
25
40
|
"bugs": {
|