pi-cc-extensions 0.9.1 → 0.9.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.en.md CHANGED
@@ -1,26 +1,16 @@
1
- <p align="center">
2
- <img src="./assets/readme/hero.en.svg" width="100%" alt="pi-cc-extensions: a productivity extension suite for Pi">
3
- </p>
4
-
5
- <p align="center">
6
- <a href="https://pi.dev/packages?name=pi-cc-extensions"><img alt="Pi package catalog" src="https://img.shields.io/badge/Pi-package-58B7FF?style=flat-square"></a>
7
- <a href="https://www.npmjs.com/package/pi-cc-extensions"><img alt="npm version" src="https://img.shields.io/npm/v/pi-cc-extensions?style=flat-square&color=66E3C4"></a>
8
- <a href="#compatibility"><img alt="Node.js 22.19 or newer" src="https://img.shields.io/badge/Node.js-%E2%89%A522.19-66E3C4?style=flat-square"></a>
9
- </p>
10
-
11
- <p align="center">
12
- Claude Code-style TUI output with some personal touches and handy utilities.
13
- </p>
14
-
15
1
  <p align="center">
16
2
  <a href="./README.md">简体中文</a> · <strong>English</strong>
17
3
  </p>
18
4
 
19
- ---
5
+ # pi-cc-extensions
6
+
7
+ > Claude Code-style TUI output with some personal touches and handy utilities.
20
8
 
21
9
  ## Preview
22
10
 
23
- https://github.com/user-attachments/assets/6c858000-fdad-43f9-957f-4d0278648498
11
+ <a href="https://github.com/user-attachments/assets/6c858000-fdad-43f9-957f-4d0278648498"><img src="./assets/readme/preview.webp" alt="pi-cc-extensions UI preview" width="100%"></a>
12
+
13
+ Click the cover to play the demo video
24
14
 
25
15
  ## Quick start
26
16
 
@@ -37,24 +27,43 @@ Run `/reload` after installation.
37
27
 
38
28
  | Feature | Description | Entry point |
39
29
  | --------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
40
- | Claude Code Output | Tool summaries, expand/collapse, rich edit/write diffs, and`on` / `compact` / `off` modes | `/ccstyle` |
41
- | Markdown enhancements | Mermaid art, admonitions, URL linking, and more | Automatic |
42
- | Fullscreen mode | Tool card/group click to expand, double-click to collapse, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
43
- | Settings panel | `Style / Diff / Thinking / UI / Feature` tabs | `/ccstyle` |
30
+ | Claude Code UI | Tool summaries, expand/collapse, rich edit/write diffs, and `on` / `compact` / `off` modes | `/ccstyle` |
31
+ | Markdown enhancements | Mermaid diagrams, admonitions, URL linking, and more | Automatic |
32
+ | Fullscreen mode | Tool card/group expand and collapse, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
33
+ | Settings panel | `Style / Features / UI / Diff / Thinking / Footer` tabs | `/ccstyle` |
44
34
  | Context inspection | Usage breakdown and previews for the system prompt, memory, skills, tools definition, and messages | `/context` |
45
35
  | Session/Subagent references | Search and inject effective context from previous Sessions or existing SubAgents | `@` |
46
- | Status bar | Two-line chips: model, context, cache, cost, git; requires a Nerd Font | `/ccstyle` Feature |
36
+ | Status bar | Shows model, context, cache, cost, and git; also works with `@narumitw/pi-usage` for live quota. Git/cache Nerd Font icons can be turned off | `/ccstyle` |
47
37
  | Theme | Bundled CC Dark and CC Light themes | `/theme` |
48
38
 
39
+ Renderer snapshots for `on` / `compact` modes: [default](./docs/tool-render-examples-default.md) · [compact](./docs/tool-render-examples-compact.md)
40
+
49
41
  ## Configuration
50
42
 
51
43
  `/ccstyle` behavior is configured through `~/.pi/agent/pi-cc-extensions.json`:
52
44
 
53
- ```js
45
+ ```jsonc
54
46
  {
47
+ // style
55
48
  "mode": "on", // on / compact / off
56
49
  "excludeRenderers": [], // tools keeping the native renderer; Agent always keeps its dedicated renderer
57
50
 
51
+ // features
52
+ "enableSessionReference": true, // @ session references
53
+ "enableSubagentAutocomplete": true, // @ subagent completion and delegation hints
54
+ "enableContextCommand": true, // /context usage check
55
+ "enableAgentSummary": true, // per-turn tool summary
56
+ "enableWorkingMessage": true, // Working... bottom token/elapsed
57
+ "enableAliases": true, // /clear, /exit aliases
58
+
59
+ // ui
60
+ "expandedInputMaxLines": 5, // expanded tool Input lines; overflow shows a footer hint
61
+ "expandedOutputMaxLines": 10, // expanded tool Output lines; overflow shows a footer hint
62
+ "expandedPreviewMaxLines": 40, // max lines for expanded diff/TaskList bodies
63
+ "inputClip": 100, // tool summary path/command clip length
64
+ "showStartupHeader": true, // startup header (logo + tips) toggle
65
+ "scrollStepLines": 3, // fullscreen wheel scroll step
66
+
58
67
  // diff
59
68
  "diffViewMode": "auto", // layout: auto / split / unified
60
69
  "diffIndicatorMode": "bars", // change indicators: bars / classic / none
@@ -69,28 +78,21 @@ Run `/reload` after installation.
69
78
  "animationIntervalMs": 90, // title animation interval (ms)
70
79
  "dimThinkingText": false, // dim thinking body text
71
80
 
72
- // ui
73
- "expandedInputMaxLines": 5, // expanded tool Input lines; overflow shows a footer hint
74
- "expandedOutputMaxLines": 10, // expanded tool Output lines; overflow shows a footer hint
75
- "expandedPreviewMaxLines": 40, // max lines for expanded diff/TaskList bodies
76
- "inputClip": 100, // tool summary path/command clip length
77
- "showStartupHeader": true, // startup header (logo + tips) toggle
78
- "scrollStepLines": 3, // fullscreen wheel scroll step
79
-
80
- // features
81
- "enableSessionReference": true, // @ session references
82
- "enableSubagentAutocomplete": true, // @ subagent completion and delegation hints
83
- "enableContextCommand": true, // /context usage check
84
- "enableAgentSummary": true, // per-turn tool summary
85
- "enableWorkingMessage": true, // Working... bottom token/elapsed
86
- "enableAliases": true, // /clear, /exit aliases
87
- "enableCustomFooter": true // two-line chips status bar (needs a Nerd Font)
81
+ // footer
82
+ "enableCustomFooter": true, // custom status bar
83
+ "footerNerdIcons": true, // Nerd Font glyphs for git/cache; false = plain text
84
+ "footerHiddenKeys": [], // hidden plugin chip keys
85
+ "footerLine1Keys": ["pi-usage"], // line1 plugin chip order; pi-usage is shown by default, data from @narumitw/pi-usage
86
+ "footerLine2Keys": [], // line2 plugin chip order (after cwd/git)
87
+ "footerLine3Keys": [] // line3 overflow slot; painted only when a chip is visible
88
88
  }
89
89
  ```
90
90
 
91
+ > [!TIP]
91
92
  > **Fullscreen**: click `click to show more` to expand tool cards, thinking, Skill, and compact summaries. When expanded Input/Output exceeds the line cap, the footer `… +N more lines • click to show more` opens a full preview. Double-click an expanded panel to collapse it.
92
- >
93
- > **Tip**: set `markdown.mermaid` to `final` via `~/.pi/agent/settings.json` or the Mermaid diagrams option in `/settings`. Default `streaming` redraws per frame; `final` renders once at completion.
93
+
94
+ > [!NOTE]
95
+ > **Mermaid rendering**: set `markdown.mermaid` to `final` via `~/.pi/agent/settings.json` or the Mermaid diagrams option in `/settings`. Default `streaming` redraws per frame; `final` renders once at completion.
94
96
 
95
97
  ## Local development
96
98
 
@@ -102,7 +104,7 @@ npm run typecheck
102
104
 
103
105
  ## Compatibility
104
106
 
105
- - Node.js `>=22.19.0`, Pi `^0.84.0` (loaded through `pi.extensions` and `pi.themes` in the root `package.json`)
107
+ - Node.js `>=22.19.0`, Pi `^0.84.0`
106
108
 
107
109
  ## Recommended companions
108
110
 
@@ -114,8 +116,11 @@ npm run typecheck
114
116
  | `npm:@ff-labs/pi-fff` | FFF-powered fuzzy file and content search (fffind / ffgrep) |
115
117
  | `npm:pi-web-access` | Web search, URL fetching, GitHub cloning, PDF/video parsing |
116
118
  | `npm:@narumitw/pi-usage` | Current-account usage for Codex / Copilot / OpenRouter |
117
- | `git:github.com/DietrichGebert/ponytail` | Lazy-mode coding: forces the simplest working solution |
118
119
 
119
120
  ## Credits
120
121
 
121
122
  - Rich diffs are adapted from [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display) (MIT). See [`extensions/renderer/tool/diff/ATTRIBUTION.md`](./extensions/renderer/tool/diff/ATTRIBUTION.md).
123
+
124
+ ## License
125
+
126
+ [MIT](./LICENSE) © minuque
package/README.md CHANGED
@@ -1,26 +1,16 @@
1
- <p align="center">
2
- <img src="./assets/readme/hero.svg" width="100%">
3
- </p>
4
-
5
- <p align="center">
6
- <a href="https://pi.dev/packages?name=pi-cc-extensions"><img alt="Pi package catalog" src="https://img.shields.io/badge/Pi-package-58B7FF?style=flat-square"></a>
7
- <a href="https://www.npmjs.com/package/pi-cc-extensions"><img alt="npm version" src="https://img.shields.io/npm/v/pi-cc-extensions?style=flat-square&color=66E3C4"></a>
8
- <a href="#兼容性"><img alt="Node.js 22.19 or newer" src="https://img.shields.io/badge/Node.js-%E2%89%A522.19-66E3C4?style=flat-square"></a>
9
- </p>
10
-
11
- <p align="center">
12
- 类 Claude Code TUI 输出风格,并融入了一些个人喜好,和一些实用小功能。
13
- </p>
14
-
15
1
  <p align="center">
16
2
  <strong>简体中文</strong> · <a href="./README.en.md">English</a>
17
3
  </p>
18
4
 
19
- ---
5
+ # pi-cc-extensions
6
+
7
+ > 类 Claude Code TUI 输出风格,并融入了一些个人喜好,和一些实用小功能。
20
8
 
21
9
  ## 界面预览
22
10
 
23
- https://github.com/user-attachments/assets/6c858000-fdad-43f9-957f-4d0278648498
11
+ <a href="https://github.com/user-attachments/assets/6c858000-fdad-43f9-957f-4d0278648498"><img src="./assets/readme/preview.webp" alt="pi-cc-extensions 界面预览" width="100%"></a>
12
+
13
+ 点击封面播放演示视频
24
14
 
25
15
  ## 快速开始
26
16
 
@@ -40,21 +30,40 @@ pi install git:github.com/minuque/pi-cc-extensions
40
30
  | Claude Code UI | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `compact` / `off` 三种模式 | `/ccstyle` |
41
31
  | Markdown 增强 | Mermaid 图、提示框、URL 链接化等 | 自动生效 |
42
32
  | Fullscreen mode | 工具卡/group 单击展开、双击收起、预览、hover 高亮、回到底部按钮 | `TUIMODE=fullscreen` 或 `--tui-mode fullscreen` |
43
- | 配置面板 | `Style / Diff / Thinking / UI / Feature` 五页签 | `/ccstyle` |
33
+ | 配置面板 | `Style / Features / UI / Diff / Thinking / Footer` 六页签 | `/ccstyle` |
44
34
  | 上下文检查 | 查看上下文占用,并预览 System prompt、Memory、Skills、Tools definition 和消息内容 | `/context` |
45
35
  | Session/Subagent 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@` |
46
- | 状态栏 | 两行 chips:模型、上下文、缓存、费用、git;需要 Nerd Font | `/ccstyle` Feature |
36
+ | 状态栏 | 显示:模型、上下文、缓存、费用、git并适配 @narumitw/pi-usage 实时显示额度;git/缓存图标可关 Nerd Font | `/ccstyle` |
47
37
  | 主题 | 随包提供内置 CC Dark、CC Light 主题 | `/theme` |
48
38
 
39
+ `on` / `compact` 两种模式的渲染样例:[默认模式](./docs/tool-render-examples-default.md) · [紧凑模式](./docs/tool-render-examples-compact.md)
40
+
49
41
  ## 配置
50
42
 
51
43
  `/ccstyle` 的行为由 `~/.pi/agent/pi-cc-extensions.json` 配置:
52
44
 
53
- ```js
45
+ ```jsonc
54
46
  {
47
+ // style
55
48
  "mode": "on", // on / compact / off
56
49
  "excludeRenderers": [], // 走原生渲染的工具名;Agent 始终保留专用渲染器
57
50
 
51
+ // features
52
+ "enableSessionReference": true, // @ session 引用
53
+ "enableSubagentAutocomplete": true, // @ subagent 补全与委派提示
54
+ "enableContextCommand": true, // /context 上下文检查
55
+ "enableAgentSummary": true, // 每回合工具摘要
56
+ "enableWorkingMessage": true, // Working... 底部 token/耗时
57
+ "enableAliases": true, // /clear、/exit 别名
58
+
59
+ // ui
60
+ "expandedInputMaxLines": 5, // 展开工具卡 Input 可见行数,超出在末行显示展开提示
61
+ "expandedOutputMaxLines": 10, // 展开工具卡 Output 可见行数,超出在末行显示展开提示
62
+ "expandedPreviewMaxLines": 40, // 展开 diff/TaskList 正文最大行数
63
+ "inputClip": 100, // 工具摘要 path/command 折叠字符数
64
+ "showStartupHeader": true, // 启动头(logo + tips)开关
65
+ "scrollStepLines": 3, // fullscreen 滚轮步进
66
+
58
67
  // diff
59
68
  "diffViewMode": "auto", // 布局:auto / split / unified
60
69
  "diffIndicatorMode": "bars", // 变更指示:bars / classic / none
@@ -69,28 +78,21 @@ pi install git:github.com/minuque/pi-cc-extensions
69
78
  "animationIntervalMs": 90, // 标题动画间隔(毫秒)
70
79
  "dimThinkingText": false, // thinking 正文用 dim 色
71
80
 
72
- // ui
73
- "expandedInputMaxLines": 5, // 展开工具卡 Input 可见行数,超出在末行显示展开提示
74
- "expandedOutputMaxLines": 10, // 展开工具卡 Output 可见行数,超出在末行显示展开提示
75
- "expandedPreviewMaxLines": 40, // 展开 diff/TaskList 正文最大行数
76
- "inputClip": 100, // 工具摘要 path/command 折叠字符数
77
- "showStartupHeader": true, // 启动头(logo + tips)开关
78
- "scrollStepLines": 3, // fullscreen 滚轮步进
79
-
80
- // features
81
- "enableSessionReference": true, // @ session 引用
82
- "enableSubagentAutocomplete": true, // @ subagent 补全与委派提示
83
- "enableContextCommand": true, // /context 上下文检查
84
- "enableAgentSummary": true, // 每回合工具摘要
85
- "enableWorkingMessage": true, // Working... 底部 token/耗时
86
- "enableAliases": true, // /clear、/exit 别名
87
- "enableCustomFooter": true // 两行 chips 状态栏(需 Nerd Font)
81
+ // footer
82
+ "enableCustomFooter": true, // 自定义状态栏
83
+ "footerNerdIcons": true, // git/缓存用 Nerd Font 图标;false 为纯文本
84
+ "footerHiddenKeys": [], // 隐藏的插件芯片 key
85
+ "footerLine1Keys": ["pi-usage"], // line1 插件芯片顺序;pi-usage 默认显示,数据来自 @narumitw/pi-usage
86
+ "footerLine2Keys": [], // line2 插件芯片顺序(接在 cwd/git 后)
87
+ "footerLine3Keys": [] // line3 备用槽,有可见芯片才占行
88
88
  }
89
89
  ```
90
90
 
91
- > **Fullscreen**:单击 `click to show more` 展开工具卡、思考、Skill 和 compact 摘要;展开后 Input/Output 超行时,末行 `… +N more lines • click to show more` 打开全量预览。双击展开面板收起。
92
- >
93
- > **建议**:`markdown.mermaid` 设为 `final`(`~/.pi/agent/settings.json` 或 `/settings` 面板的 Mermaid diagrams 选项)。默认 `streaming` 逐帧重绘,`final` 渲染最终版更稳定。
91
+ > [!TIP]
92
+ > **全屏模式**:单击 `click to show more` 展开工具卡、思考、Skill 和 compact 摘要;展开后 Input/Output 超行时,末行 `… +N more lines • click to show more` 打开全量预览,双击展开面板收起。
93
+
94
+ > [!NOTE]
95
+ > **Mermaid 渲染**:建议把 `markdown.mermaid` 设为 `final`(`~/.pi/agent/settings.json` 或 `/settings` 面板的 Mermaid diagrams 选项)。默认 `streaming` 逐帧重绘,`final` 渲染最终版更稳定。
94
96
 
95
97
  ## 本地开发
96
98
 
@@ -114,8 +116,11 @@ npm run typecheck
114
116
  | `npm:@ff-labs/pi-fff` | 模糊文件与内容检索(fffind / ffgrep) |
115
117
  | `npm:pi-web-access` | 网页搜索、URL 抓取、GitHub 克隆、PDF/视频解析 |
116
118
  | `npm:@narumitw/pi-usage` | 查看当前账号用量(Codex / Copilot / OpenRouter) |
117
- | `git:github.com/DietrichGebert/ponytail` | 极简编码:强制最懒但有效的方案 |
118
119
 
119
120
  ## 致谢
120
121
 
121
122
  - Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/renderer/tool/diff/ATTRIBUTION.md`](./extensions/renderer/tool/diff/ATTRIBUTION.md)。
123
+
124
+ ## 许可证
125
+
126
+ [MIT](./LICENSE) © minuque
Binary file
@@ -1,4 +1,9 @@
1
1
  import type { CompactThinkingConfig } from "../feature/compact-thinking.ts";
2
+ import {
3
+ DEFAULT_FOOTER_CHIP_LAYOUT,
4
+ formatFooterChipSummary,
5
+ normalizeFooterChipLayout,
6
+ } from "../feature/shell/footer-layout.ts";
2
7
  import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
8
  import { homedir } from "node:os";
4
9
  import { join } from "node:path";
@@ -65,6 +70,11 @@ export type Config = {
65
70
  enableWorkingMessage: boolean;
66
71
  enableAliases: boolean;
67
72
  enableCustomFooter: boolean;
73
+ footerNerdIcons: boolean;
74
+ footerHiddenKeys: string[];
75
+ footerLine1Keys: string[];
76
+ footerLine2Keys: string[];
77
+ footerLine3Keys: string[];
68
78
  };
69
79
 
70
80
  const AGENT_DIR = process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".pi", "agent");
@@ -92,6 +102,7 @@ export const SCROLL_STEP_LINES_VALUES = ["1", "2", "3", "5", "10"];
92
102
  /** Tools commonly toggled in excludeRenderers via the settings panel. */
93
103
  export const EXCLUDE_RENDERER_CANDIDATES = [
94
104
  "bash",
105
+ "powershell",
95
106
  "read",
96
107
  "edit",
97
108
  "write",
@@ -128,6 +139,8 @@ export const DEFAULT_CONFIG: Config = {
128
139
  enableWorkingMessage: true,
129
140
  enableAliases: true,
130
141
  enableCustomFooter: true,
142
+ footerNerdIcons: true,
143
+ ...DEFAULT_FOOTER_CHIP_LAYOUT,
131
144
  };
132
145
 
133
146
  function pickEnum<T extends string>(value: unknown, allowed: readonly T[], fallback: T): T {
@@ -227,6 +240,8 @@ export function normalizeConfig(input: unknown): Config {
227
240
  enableWorkingMessage: source.enableWorkingMessage !== false,
228
241
  enableAliases: source.enableAliases !== false,
229
242
  enableCustomFooter: source.enableCustomFooter !== false,
243
+ footerNerdIcons: source.footerNerdIcons !== false,
244
+ ...normalizeFooterChipLayout(source),
230
245
  };
231
246
  }
232
247
 
@@ -281,6 +296,8 @@ export function formatConfigStatus(source: Config = config): string {
281
296
  `workingMsg=${source.enableWorkingMessage ? "on" : "off"}`,
282
297
  `aliases=${source.enableAliases ? "on" : "off"}`,
283
298
  `footer=${source.enableCustomFooter ? "on" : "off"}`,
299
+ `footerIcons=${source.footerNerdIcons ? "nerd" : "plain"}`,
300
+ formatFooterChipSummary(source),
284
301
  ].join(" · ");
285
302
  }
286
303