pi-cc-extensions 0.8.11 → 0.8.12

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.
Files changed (3) hide show
  1. package/README.en.md +174 -0
  2. package/README.md +174 -204
  3. package/package.json +3 -2
package/README.en.md ADDED
@@ -0,0 +1,174 @@
1
+ <p align="center">
2
+ <img src="./assets/readme/hero.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
+ <a href="./extensions"><img alt="TypeScript extensions" src="https://img.shields.io/badge/TypeScript-extensions-3178C6?style=flat-square"></a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ Claude Code-style output, structured questionnaires, context inspection, and Agent / Session references.
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="./README.md">简体中文</a> · <strong>English</strong>
18
+ </p>
19
+
20
+ ---
21
+
22
+ ## Preview
23
+
24
+ <table>
25
+ <tr>
26
+ <td colspan="2" align="center">
27
+ <img src="./assets/readme/welcome.webp" width="100%" alt="Pi welcome screen">
28
+ <br>
29
+ <sub><b>Welcome screen</b><br><code>npm:pi-startup-header</code> with <code>npm:pi-zentui</code></sub>
30
+ </td>
31
+ </tr>
32
+ <tr>
33
+ <td width="50%" align="center">
34
+ <img src="./assets/readme/fixed-editor-navigation.webp" width="100%" alt="Tool results, back-to-bottom control, and Ctrl+End in the fixed editor">
35
+ <br>
36
+ <sub><b>Fixed-editor workflow</b><br>Tool summaries, expand/collapse, and keyboard navigation</sub>
37
+ </td>
38
+ <td width="50%" align="center">
39
+ <img src="./assets/readme/session-reference.webp" width="100%" alt="Selecting a previous Session through at-sign completion">
40
+ <br>
41
+ <sub><b>Session references</b><br>Find and inject previous context through completion</sub>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td width="50%" align="center">
46
+ <img src="./assets/readme/context-usage.webp" width="100%" alt="Context window usage breakdown">
47
+ <br>
48
+ <sub><b>Context usage</b><br>Inspect usage by category</sub>
49
+ </td>
50
+ <td width="50%" align="center">
51
+ <img src="./assets/readme/context-preview.webp" width="100%" alt="Previewing injected context">
52
+ <br>
53
+ <sub><b>Context preview</b><br>Inspect the content injected into the model</sub>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+
58
+ ## Quick start
59
+
60
+ ```bash
61
+ pi install npm:pi-cc-extensions
62
+ ```
63
+
64
+ Run `/reload` after installation, then try:
65
+
66
+ ```text
67
+ /ccstyle # Configure output and fixed-editor interaction
68
+ /context # Inspect context usage
69
+ @ # Complete Agents, Sessions, and files
70
+ ```
71
+
72
+ The `ask_user_question` tool is registered automatically.
73
+
74
+ ## Features
75
+
76
+
77
+ | Feature | Description | Entry point |
78
+ | --------------------------- | -------------------------------------------------------------------------------------------------- | --------------------- |
79
+ | Claude Code-style output | Tool summaries, expand/collapse, rich edit/write diffs, and`on` / `off` / `compact` modes | `/ccstyle` |
80
+ | Fixed-editor interaction | Five-row wheel scrolling, tool clicks, collapse anchoring, back-to-bottom control, and`Ctrl+End` | `/ccstyle` |
81
+ | Structured questionnaires | Single choice, multiple choice, custom answers, Markdown previews, and RPC / ACP fallback | `ask_user_question` |
82
+ | Context inspection | Usage breakdown and previews for the system prompt, tools, skills, and messages | `/context` |
83
+ | Session references | Search and inject effective context from previous Sessions or existing SubAgents | `@session:` |
84
+ | Agent completion | Complete and delegate custom Agents from`~/.pi/agent/agents/*.md` | `@agent-name` |
85
+ | Theme | Includes the GitHub Dark Default theme | `/theme` |
86
+
87
+ ### Output modes
88
+
89
+
90
+ | Mode | Behavior |
91
+ | ----------- | ----------------------------------------------------------------------- |
92
+ | `on` | Claude Code-style tool output with rich diffs for`edit` and `write` |
93
+ | `off` | Native Pi renderers |
94
+ | `compact` | One-line previews, merged repeated calls, duration, and run summaries |
95
+
96
+ ```text
97
+ /ccstyle on
98
+ /ccstyle off
99
+ /ccstyle compact
100
+ /ccstyle status
101
+ ```
102
+
103
+ Configuration is stored in `~/.pi/agent/claude-code-style.json`:
104
+
105
+ ```json
106
+ {
107
+ "mode": "on",
108
+ "excludeRenderers": [],
109
+ "fixedEditorFeatures": true
110
+ }
111
+ ```
112
+
113
+ - `excludeRenderers` uses exact tool names. `Agent` always keeps its dedicated renderer.
114
+ - `fixedEditorFeatures: true` enables fixed-editor mouse scrolling, clicks, viewport mapping, and the back-to-bottom indicator.
115
+ - Set it to `false` to disable terminal mouse reporting and restore native terminal wheel scrolling. `Ctrl+End` remains available.
116
+ - Run `/reload` after editing the file manually.
117
+
118
+ ### Structured questionnaires
119
+
120
+ Supports 1–4 questions, 2–4 options per question, single and multiple selection, custom answers, and optional Markdown previews. The TUI preserves transcript space; RPC / ACP environments fall back to native dialogs.
121
+
122
+ Questionnaire configuration is stored at `~/.config/rpiv-ask-user-question/config.json`. See [`extensions/ask-user-question/README.md`](./extensions/ask-user-question/README.md) for shortcuts and detailed behavior.
123
+
124
+ ### `@` references
125
+
126
+ - Enter `@session:` to reference a previous Session.
127
+ - Enter `@agent-name` to delegate to a custom Agent.
128
+ - Compatible with `@bacnh85/pi-fff` and `@tintinweb/pi-subagents`.
129
+ - Session context is deduplicated and size-limited before injection.
130
+
131
+ ## Other installation methods
132
+
133
+ ```bash
134
+ # GitHub
135
+ pi install git:github.com/minuque/pi-cc-extensions
136
+
137
+ # Local repository
138
+ pi install /absolute/path/to/pi-cc-extensions
139
+ ```
140
+
141
+ ## Local development
142
+
143
+ ```bash
144
+ npm test
145
+ npm run typecheck
146
+ pi -e .
147
+ ```
148
+
149
+ Run `/reload` after changing extensions. Changes under `extensions/ask-user-question/`, or reinstalling its dependencies, require a full Pi restart.
150
+
151
+ ## Compatibility
152
+
153
+ - Node.js `>=22.19.0`
154
+ - Loaded through `pi.extensions` and `pi.themes` in the root `package.json`
155
+ - If a Pi, TUI, or `pi-zentui` update causes display issues, try `/reload` first
156
+
157
+ ## Recommended companions
158
+
159
+
160
+ | Extension | Purpose |
161
+ | ------------------------------- | -------------------------------------------------------------- |
162
+ | `npm:pi-zentui` | Fixed editor, status line, and Git status |
163
+ | `npm:@tintinweb/pi-subagents` | Parallel SubAgents, background tasks, and worktree isolation |
164
+ | `npm:pi-mcp-adapter` | On-demand MCP tool discovery with lower context usage |
165
+ | `npm:pi-theme-picker` | Theme search and live preview |
166
+ | `npm:@ayulab/pi-rewind` | Checkpoint-based code or conversation rollback |
167
+ | `npm:pi-compact-thinking` | Compact rendering for hidden thinking blocks |
168
+ | `npm:pi-startup-header` | Theme-aware startup header |
169
+
170
+ ## Credits
171
+
172
+ - Compact transcript behavior is based on [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2 (MIT).
173
+ - Structured questionnaires are based on [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) v2.1.0 (MIT).
174
+ - Rich diffs are adapted from [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display) (MIT). See [`extensions/tool-diff/ATTRIBUTION.md`](./extensions/tool-diff/ATTRIBUTION.md).
package/README.md CHANGED
@@ -1,204 +1,174 @@
1
- <p align="center">
2
- <img src="./assets/readme/hero.svg" width="100%" alt="pi-cc-extensions:集成 Claude Code 风格界面、结构化问卷、上下文检查及 Agent 与 Session 引用的 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="#兼容性"><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
- <a href="./extensions"><img alt="TypeScript extensions" src="https://img.shields.io/badge/TypeScript-extensions-3178C6?style=flat-square"></a>
10
- </p>
11
-
12
- <p align="center">
13
- 面向 Pi 的终端效率扩展套件 · Claude Code 风格界面 · 结构化问卷 · 上下文检查 · Agent 与 Session 引用
14
- </p>
15
-
16
- ---
17
-
18
- ## 界面预览
19
-
20
- <table>
21
- <tr>
22
- <td colspan="2" align="center">
23
- <img src="./assets/readme/welcome.webp" width="100%" alt="Pi 启动后的欢迎界面">
24
- <br>
25
- <sub><b>欢迎界面</b><br> @ <code>npm:pi-startup-header</code> 与 <code>npm:pi-zentui</code></sub>
26
- </td>
27
- </tr>
28
- <tr>
29
- <td width="50%" align="center">
30
- <img src="./assets/readme/fixed-editor-navigation.webp" width="100%" alt="Pi fixed-editor 中的工具结果、回到底部按钮与 Ctrl+End 快捷键">
31
- <br>
32
- <sub><b>固定编辑器工作流</b><br>工具结果摘要、折叠展开与键盘导航</sub>
33
- </td>
34
- <td width="50%" align="center">
35
- <img src="./assets/readme/session-reference.webp" width="100%" alt="在 Pi 中通过 @ 补全选择历史 Session">
36
- <br>
37
- <sub><b>历史 Session 引用</b><br>通过 @ 补全快速找到并引用历史会话</sub>
38
- </td>
39
- </tr>
40
- <tr>
41
- <td width="50%" align="center">
42
- <img src="./assets/readme/context-usage.webp" width="100%" alt="Pi 上下文窗口用量查看器">
43
- <br>
44
- <sub><b>上下文用量</b><br>查看 System prompt、Tools、Skills 等占用分布</sub>
45
- </td>
46
- <td width="50%" align="center">
47
- <img src="./assets/readme/context-preview.webp" width="100%" alt="Pi 中展开查看 System Prompt 内容">
48
- <br>
49
- <sub><b>上下文预览</b><br>按类别展开查看实际注入的上下文内容</sub>
50
- </td>
51
- </tr>
52
- </table>
53
-
54
- ## 功能
55
-
56
- ### Claude Code 风格界面
57
-
58
- `extensions/claude-code-style.ts` 提供:
59
-
60
- - `on`:Claude Code 风格的工具调用行与结果摘要(默认覆盖普通工具 renderer)
61
- - `off`:使用 Pi 原生输出
62
- - `compact`:单行工具预览、运行状态与耗时、连续同名工具合并、失败独立行、运行总结,以及隐藏 thinking 时的标题 ticker
63
- - Pi 默认输入栏
64
- - 通过 `excludeRenderers` 保留指定工具的原生或扩展 renderer;`Agent` 始终保留专用 renderer
65
- - 工具结果的折叠与展开;切换模式会立即重绘已有 transcript
66
- - 类 Claude Code 滚动到底部 button
67
-
68
- 常用命令:
69
-
70
- ```text
71
- /ccstyle # 打开交互式配置面板
72
- /ccstyle on # Claude Code 风格
73
- /ccstyle off # Pi 原生输出
74
- /ccstyle compact # 紧凑 transcript 风格
75
- /ccstyle status # 查看当前模式
76
- ```
77
-
78
- 需要保留指定工具的原生或扩展 renderer 时,编辑 `~/.pi/agent/claude-code-style.json`:
79
-
80
- ```json
81
- {
82
- "mode": "compact",
83
- "excludeRenderers": ["edit", "write"],
84
- "fixedEditorFeatures": true
85
- }
86
- ```
87
-
88
- `mode` 可取 `on`、`off` 或 `compact`。`fixedEditorFeatures` 默认为 `true`,启用 fixed editor 的每刻度 5 行滚动、工具鼠标点击、收起位置补偿、滚动到底部按钮、消息计数和专用 viewport 映射;设为 `false` 后关闭终端鼠标上报及上述功能,让非 fixed editor 恢复终端原生滚轮滚动(工具仍可通过键盘展开)。`Ctrl+End` 在两种模式下均保留。旧版 `enabled: true/false` 会自动迁移为 `on/off`。排除名单使用精确工具名;手动修改配置后执行 `/reload`。`Agent` 的专用 renderer 始终保留。
89
-
90
- Compact transcript 行为改编自 [avhagedorn/pi-compact-transcript](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2(MIT,Alan Hagedorn)。
91
-
92
- ### 结构化问卷
93
-
94
- `extensions/ask-user-question/index.ts` 内置 `ask_user_question` 工具,支持:
95
-
96
- - 单选、多选、2–4 个选项及最多 4 个问题的标签页问卷
97
- - `Type something.` 自定义回答、备注和 Markdown 预览
98
- - RPC / ACP 原生对话框降级;无 UI 时自动移除工具
99
- - TUI 使用 Pi 原生临时 editor component,不替换 editor factory:兼容默认滚动编辑器,也兼容 `pi-zentui` fixed-editor
100
- - 响应式高度预算:常规终端为历史 transcript 至少保留 6 行、约 30% 高度;`Ctrl+]` 可折叠为单行并保留答案
101
- - UI 固定使用英文,不加载国际化套件或语言包
102
-
103
- 配置文件为 `~/.config/rpiv-ask-user-question/config.json`。可通过 `collapseKey` 修改折叠快捷键,详见 [`extensions/ask-user-question/README.md`](./extensions/ask-user-question/README.md)。
104
-
105
- 该扩展基于 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) v2.1.0(MIT)内置,并包含本项目针对默认滚动编辑器、固定编辑器与历史消息视口的兼容优化。
106
-
107
- ### 上下文窗口查看
108
-
109
- `extensions/context.ts` 注册 `/context`,展示当前上下文窗口的使用分布,并可进一步预览:
110
-
111
- - System prompt
112
- - Tools
113
- - Context files
114
- - Skills
115
- - User / assistant messages
116
- - Tool results
117
- - Compaction summaries
118
-
119
- ### 历史 Session 引用
120
-
121
- `extensions/session-reference.ts` 将历史 Session 接入 `@` 补全:
122
-
123
- 1. 在提示词中输入 `@`。
124
- 2. 从 `[Session] ...` 或 `[SubAgent] ...` 补全项中选择要引用的上下文。
125
- 3. 提交时以 `@session:<session-id>` 引用其当前有效上下文。
126
-
127
- Session 模糊查询默认显示 3 个候选,并与文件候选按 1:2 交错排列;路径型查询优先显示文件。若已加载 `pi-subagents`,也可直接引用现有 SubAgent。一次提示词可以引用多个 Session;扩展会自动去重,并限制注入规模以避免上下文无限膨胀。
128
-
129
- ### SubAgent `@` 补全
130
-
131
- `extensions/agent-autocomplete.ts` 将 `~/.pi/agent/agents/*.md` 中定义的 SubAgent 接入 `@` 补全:
132
-
133
- 1. 在提示词中输入 `@agent-name`。
134
- 2. 从补全列表中选择 SubAgent。
135
- 3. 提交后自动注入委托指令;提示词中提到的每个 SubAgent 都会分别交由 Agent 工具处理。
136
-
137
- 该补全不会占用 `@session:` 的历史 Session 引用语法;与 `@bacnh85/pi-fff` 同时启用时,SubAgent、Session 和 FFF 文件候选会合并显示。修改 SubAgent 定义后执行 `/reload` 即可重新加载。
138
-
139
- ## 安装
140
-
141
- 从 npm 安装(推荐):
142
-
143
- ```bash
144
- pi install npm:pi-cc-extensions
145
- ```
146
-
147
- 或从 Git 安装:
148
-
149
- ```bash
150
- pi install git:github.com/minuque/pi-cc-extensions
151
- ```
152
-
153
- 安装后可以先运行:
154
-
155
- ```text
156
- /context
157
- /ccstyle on
158
- # ask_user_question 会自动作为工具提供给模型
159
- ```
160
-
161
- ## 本地开发
162
-
163
- ```bash
164
- npm test
165
- pi -e .
166
- ```
167
-
168
- 也可以把当前仓库作为本地 Pi 包安装:
169
-
170
- ```bash
171
- pi install /absolute/path/to/pi-cc-extensions
172
- ```
173
-
174
- 修改扩展后,在 Pi 中执行:
175
-
176
- ```text
177
- /reload
178
- ```
179
-
180
- `ask-user-question` 的 TUI 模块会被进程缓存;修改该目录或重装依赖后需完整退出并重启 Pi,不能只执行 `/reload`。
181
-
182
- ## 兼容性
183
-
184
- - Node.js `>=22.19.0`
185
- - 作为 Pi package 加载,入口由根目录 `package.json` 的 `pi.extensions` 显式声明
186
-
187
- ## 扩展推荐
188
-
189
-
190
- | 扩展 | 作用 |
191
- | ------------------------------------------ | ------------------------------------------------------------------------------- |
192
- | `npm:pi-theme-picker` | 通过`/theme` 交互式切换 Pi 主题,支持模糊搜索和实时预览 |
193
- | `npm:pi-mcp-adapter` | 将 MCP 服务接入 Pi,并通过代理工具按需发现,减少上下文占用 |
194
- | `npm:@tintinweb/pi-subagents` | Claude Code 风格的并行 SubAgent、后台任务、任务编排、工作树隔离和自定义 Agent |
195
- | `npm:@ayulab/pi-rewind` | 基于 checkpoint 的`/rewind` 回退,支持分别恢复代码、对话或两者 |
196
- | `npm:pi-compact-thinking` | 将隐藏的思考块渲染为紧凑、带动画的推理预览 |
197
- | `npm:pi-startup-header` | 用跟随当前主题配色的渐变 ASCII 标题替换默认启动头 |
198
- | `npm:pi-zentui` | Starship 风格状态栏与 Opencode 风格编辑器,支持固定编辑器和 Git 状态 |
199
-
200
- ### 使用注意
201
-
202
- - 内置问卷采用非 overlay 的临时 editor component,兼容 `pi-zentui` 固定编辑器;常规终端会保留历史消息视口。
203
- - `pi-mcp-adapter` 默认延迟连接 MCP 服务,有助于节省上下文;包含凭据的 MCP 配置不要提交到仓库。
204
- - `pi-compact-thinking` 和 `pi-zentui` 都涉及 Pi 内部 UI 行为,升级 Pi 后若出现异常,优先执行 `/reload` 或暂时停用对应扩展。
1
+ <p align="center">
2
+ <img src="./assets/readme/hero.svg" width="100%" alt="pi-cc-extensions: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="#兼容性"><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
+ <a href="./extensions"><img alt="TypeScript extensions" src="https://img.shields.io/badge/TypeScript-extensions-3178C6?style=flat-square"></a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ Claude Code 风格界面、结构化问卷、上下文检查,以及 Agent / Session 引用。
14
+ </p>
15
+
16
+ <p align="center">
17
+ <strong>简体中文</strong> · <a href="./README.en.md">English</a>
18
+ </p>
19
+
20
+ ---
21
+
22
+ ## 界面预览
23
+
24
+ <table>
25
+ <tr>
26
+ <td colspan="2" align="center">
27
+ <img src="./assets/readme/welcome.webp" width="100%" alt="Pi 启动后的欢迎界面">
28
+ <br>
29
+ <sub><b>欢迎界面</b><br> @ <code>npm:pi-startup-header</code> 与 <code>npm:pi-zentui</code></sub>
30
+ </td>
31
+ </tr>
32
+ <tr>
33
+ <td width="50%" align="center">
34
+ <img src="./assets/readme/fixed-editor-navigation.webp" width="100%" alt="Pi fixed-editor 中的工具结果、回到底部按钮与 Ctrl+End 快捷键">
35
+ <br>
36
+ <sub><b>固定编辑器工作流</b><br>工具结果摘要、折叠展开与键盘导航</sub>
37
+ </td>
38
+ <td width="50%" align="center">
39
+ <img src="./assets/readme/session-reference.webp" width="100%" alt="在 Pi 中通过 @ 补全选择历史 Session">
40
+ <br>
41
+ <sub><b>历史 Session 引用</b><br>通过 @ 补全快速找到并引用历史会话</sub>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td width="50%" align="center">
46
+ <img src="./assets/readme/context-usage.webp" width="100%" alt="Pi 上下文窗口用量查看器">
47
+ <br>
48
+ <sub><b>上下文用量</b><br>查看 System prompt、Tools、Skills 等占用分布</sub>
49
+ </td>
50
+ <td width="50%" align="center">
51
+ <img src="./assets/readme/context-preview.webp" width="100%" alt="Pi 中展开查看 System Prompt 内容">
52
+ <br>
53
+ <sub><b>上下文预览</b><br>按类别展开查看实际注入的上下文内容</sub>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+
58
+ ## 快速开始
59
+
60
+ ```bash
61
+ pi install npm:pi-cc-extensions
62
+ ```
63
+
64
+ 安装后执行 `/reload`,然后可以使用:
65
+
66
+ ```text
67
+ /ccstyle # 配置输出与 fixed editor 交互
68
+ /context # 查看上下文占用
69
+ @ # 补全 Agent、Session 与文件
70
+ ```
71
+
72
+ `ask_user_question` 会自动注册为模型工具。
73
+
74
+ ## 功能
75
+
76
+
77
+ | 功能 | 说明 | 入口 |
78
+ | ------------------------------ | --------------------------------------------------------------------------------- | --------------------- |
79
+ | Claude Code 风格输出 | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `off` / `compact` 三种模式 | `/ccstyle` |
80
+ | Fixed editor 交互 | 每刻度 5 行滚动、工具点击、收起位置补偿、回到底部按钮与`Ctrl+End` | `/ccstyle` |
81
+ | Ask User Question 结构化问卷 | 单选、多选、自定义回答、Markdown 预览及 RPC / ACP 降级 | `ask_user_question` |
82
+ | 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容 | `/context` |
83
+ | Session 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@session:` |
84
+ | Agent 补全 | 从`~/.pi/agent/agents/*.md` 补全并委托自定义 Agent | `@agent-name` |
85
+ | 主题 | 随包提供 GitHub Dark Default 主题 | `/theme` |
86
+
87
+ ### 输出模式
88
+
89
+
90
+ | 模式 | 行为 |
91
+ | ----------- | ----------------------------------------------------------- |
92
+ | `on` | Claude Code 风格工具输出;`edit` / `write` 使用 rich diff |
93
+ | `off` | 使用 Pi 原生 renderer |
94
+ | `compact` | 单行工具预览、同名调用合并、运行耗时与总结 |
95
+
96
+ ```text
97
+ /ccstyle on
98
+ /ccstyle off
99
+ /ccstyle compact
100
+ /ccstyle status
101
+ ```
102
+
103
+ 配置保存在 `~/.pi/agent/claude-code-style.json`:
104
+
105
+ ```json
106
+ {
107
+ "mode": "on",
108
+ "excludeRenderers": [],
109
+ "fixedEditorFeatures": true
110
+ }
111
+ ```
112
+
113
+ - `excludeRenderers` 使用精确工具名;`Agent` 始终保留专用 renderer。
114
+ - `fixedEditorFeatures: true` 启用 fixed editor 鼠标滚动、点击、viewport 映射和回到底部提示。
115
+ - 设为 `false` 会关闭终端鼠标上报,恢复终端原生滚轮;`Ctrl+End` 仍可用。
116
+ - 手动修改配置后执行 `/reload`。
117
+
118
+ ### 结构化问卷
119
+
120
+ 支持 1–4 个问题、每题 2–4 个选项、单选、多选、自定义回答和可选 Markdown 预览。TUI 会保留部分 transcript 空间;RPC / ACP 环境自动降级为原生对话框。
121
+
122
+ 问卷配置位于 `~/.config/rpiv-ask-user-question/config.json`。快捷键与完整行为见 [`extensions/ask-user-question/README.md`](./extensions/ask-user-question/README.md)。
123
+
124
+ ### `@` 引用
125
+
126
+ - 输入 `@session:` 引用历史 Session。
127
+ - 输入 `@agent-name` 委托自定义 Agent。
128
+ - 可与 `@bacnh85/pi-fff` 和 `@tintinweb/pi-subagents` 共存。
129
+ - Session 内容会去重并限制注入规模。
130
+
131
+ ## 其他安装方式
132
+
133
+ ```bash
134
+ # GitHub
135
+ pi install git:github.com/minuque/pi-cc-extensions
136
+
137
+ # 本地仓库
138
+ pi install /absolute/path/to/pi-cc-extensions
139
+ ```
140
+
141
+ ## 本地开发
142
+
143
+ ```bash
144
+ npm test
145
+ npm run typecheck
146
+ pi -e .
147
+ ```
148
+
149
+ 修改扩展后执行 `/reload`。修改 `extensions/ask-user-question/` 或重装其依赖后,需要完整重启 Pi。
150
+
151
+ ## 兼容性
152
+
153
+ - Node.js `>=22.19.0`
154
+ - 通过根目录 `package.json` 的 `pi.extensions` 和 `pi.themes` 加载
155
+ - `pi-zentui`、Pi 或 TUI 内部实现升级后若显示异常,先执行 `/reload`
156
+
157
+ ## 推荐搭配
158
+
159
+
160
+ | 扩展 | 用途 |
161
+ | ------------------------------- | ------------------------------------- |
162
+ | `npm:pi-zentui` | Fixed editor、状态栏和 Git 状态 |
163
+ | `npm:@tintinweb/pi-subagents` | 并行 SubAgent、后台任务与工作树隔离 |
164
+ | `npm:pi-mcp-adapter` | 按需发现 MCP 工具,减少上下文占用 |
165
+ | `npm:pi-theme-picker` | 主题搜索和实时预览 |
166
+ | `npm:@ayulab/pi-rewind` | 基于 checkpoint 回退代码或对话 |
167
+ | `npm:pi-compact-thinking` | 紧凑显示隐藏的 thinking 块 |
168
+ | `npm:pi-startup-header` | 主题自适应启动标题 |
169
+
170
+ ## 致谢
171
+
172
+ - Compact transcript 基于 [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2(MIT)。
173
+ - 结构化问卷基于 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) v2.1.0(MIT)。
174
+ - Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/tool-diff/ATTRIBUTION.md`](./extensions/tool-diff/ATTRIBUTION.md)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cc-extensions",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "A Pi productivity suite with Claude Code-style UI, structured questionnaires, context inspection, and agent/session references",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -22,7 +22,8 @@
22
22
  "extensions",
23
23
  "assets/readme",
24
24
  "themes",
25
- "README.md"
25
+ "README.md",
26
+ "README.en.md"
26
27
  ],
27
28
  "pi": {
28
29
  "extensions": [