pi-cc-extensions 0.8.30 → 0.8.32

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 (53) hide show
  1. package/README.en.md +164 -174
  2. package/README.md +113 -115
  3. package/extensions/claude-code-style.ts +371 -208
  4. package/extensions/compact-thinking.ts +58 -0
  5. package/extensions/fixed-editor.ts +185 -0
  6. package/extensions/index.ts +10 -4
  7. package/extensions/subagent-notification.ts +30 -23
  8. package/node_modules/@tifan/pi-fixed-editor/README.md +36 -0
  9. package/node_modules/@tifan/pi-fixed-editor/package.json +46 -0
  10. package/node_modules/@tifan/pi-fixed-editor/src/cluster.ts +113 -0
  11. package/node_modules/@tifan/pi-fixed-editor/src/index.ts +259 -0
  12. package/node_modules/@tifan/pi-fixed-editor/src/terminal-split.ts +1337 -0
  13. package/package.json +9 -5
  14. package/extensions/ask-user-question/LICENSE +0 -21
  15. package/extensions/ask-user-question/README.md +0 -63
  16. package/extensions/ask-user-question/ask-user-question.ts +0 -266
  17. package/extensions/ask-user-question/config.ts +0 -79
  18. package/extensions/ask-user-question/events.ts +0 -55
  19. package/extensions/ask-user-question/index.ts +0 -17
  20. package/extensions/ask-user-question/reconcile.ts +0 -47
  21. package/extensions/ask-user-question/rpc-fallback.ts +0 -172
  22. package/extensions/ask-user-question/state/build-questionnaire.ts +0 -314
  23. package/extensions/ask-user-question/state/dialog-height.ts +0 -16
  24. package/extensions/ask-user-question/state/key-router.ts +0 -291
  25. package/extensions/ask-user-question/state/questionnaire-session.ts +0 -193
  26. package/extensions/ask-user-question/state/row-intent.ts +0 -143
  27. package/extensions/ask-user-question/state/selectors/contract.ts +0 -24
  28. package/extensions/ask-user-question/state/selectors/derivations.ts +0 -40
  29. package/extensions/ask-user-question/state/selectors/focus.ts +0 -17
  30. package/extensions/ask-user-question/state/selectors/projections.ts +0 -102
  31. package/extensions/ask-user-question/state/state-reducer.ts +0 -299
  32. package/extensions/ask-user-question/state/state.ts +0 -49
  33. package/extensions/ask-user-question/tool/format-answer.ts +0 -29
  34. package/extensions/ask-user-question/tool/response-envelope.ts +0 -50
  35. package/extensions/ask-user-question/tool/types.ts +0 -149
  36. package/extensions/ask-user-question/tool/validate-questionnaire.ts +0 -64
  37. package/extensions/ask-user-question/view/component-binding.ts +0 -45
  38. package/extensions/ask-user-question/view/components/inline-input.ts +0 -109
  39. package/extensions/ask-user-question/view/components/multi-select-view.ts +0 -198
  40. package/extensions/ask-user-question/view/components/option-list-view.ts +0 -77
  41. package/extensions/ask-user-question/view/components/preview/markdown-content-cache.ts +0 -76
  42. package/extensions/ask-user-question/view/components/preview/preview-block-renderer.ts +0 -114
  43. package/extensions/ask-user-question/view/components/preview/preview-box-renderer.ts +0 -86
  44. package/extensions/ask-user-question/view/components/preview/preview-layout-decider.ts +0 -219
  45. package/extensions/ask-user-question/view/components/preview/preview-pane.ts +0 -230
  46. package/extensions/ask-user-question/view/components/submit-picker.ts +0 -66
  47. package/extensions/ask-user-question/view/components/tab-bar.ts +0 -57
  48. package/extensions/ask-user-question/view/components/wrapping-select.ts +0 -307
  49. package/extensions/ask-user-question/view/dialog-builder.ts +0 -225
  50. package/extensions/ask-user-question/view/props-adapter.ts +0 -123
  51. package/extensions/ask-user-question/view/stateful-view.ts +0 -24
  52. package/extensions/ask-user-question/view/tab-components.ts +0 -16
  53. package/extensions/ask-user-question/view/tab-content-strategy.ts +0 -264
package/README.en.md CHANGED
@@ -1,174 +1,164 @@
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
- | Theme | Includes the GitHub Dark Default theme | `/theme` |
85
-
86
- ### Output modes
87
-
88
-
89
- | Mode | Behavior |
90
- | ----------- | ----------------------------------------------------------------------- |
91
- | `on` | Claude Code-style tool output with rich diffs for`edit` and `write` |
92
- | `off` | Native Pi renderers |
93
- | `compact` | One-line previews, merged repeated calls, duration, and run summaries |
94
-
95
- ```text
96
- /ccstyle on
97
- /ccstyle off
98
- /ccstyle compact
99
- /ccstyle status
100
- ```
101
-
102
- Configuration is stored in `~/.pi/agent/claude-code-style.json`:
103
-
104
- ```json
105
- {
106
- "mode": "on",
107
- "excludeRenderers": [],
108
- "fixedEditorFeatures": true
109
- }
110
- ```
111
-
112
- - `excludeRenderers` uses exact tool names. `Agent` always keeps its dedicated renderer.
113
- - `fixedEditorFeatures: true` enables fixed-editor mouse scrolling, clicks, viewport mapping, and the back-to-bottom indicator.
114
- - Set it to `false` to disable terminal mouse reporting and restore native terminal wheel scrolling. `Ctrl+End` remains available.
115
- - Run `/reload` after editing the file manually.
116
-
117
- ### Structured questionnaires
118
-
119
- 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.
120
-
121
- 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.
122
-
123
- ### `@` references
124
-
125
- - Enter `@session:` to reference a previous Session.
126
- - Enter `@agent-name` to delegate to a custom Agent.
127
- - Compatible with `@bacnh85/pi-fff` and `@tintinweb/pi-subagents`.
128
- - Session context is deduplicated and size-limited before injection.
129
-
130
- ## Other installation methods
131
-
132
- ```bash
133
- # GitHub
134
- pi install git:github.com/minuque/pi-cc-extensions
135
-
136
- # Local repository
137
- pi install /absolute/path/to/pi-cc-extensions
138
- ```
139
-
140
- ## Local development
141
-
142
- ```bash
143
- npm test
144
- npm run typecheck
145
- pi -e .
146
- ```
147
-
148
- Run `/reload` after changing extensions. Changes under `extensions/ask-user-question/`, or reinstalling its dependencies, require a full Pi restart.
149
-
150
- ## Compatibility
151
-
152
- - Node.js `>=22.19.0`
153
- - Loaded through `pi.extensions` and `pi.themes` in the root `package.json`
154
- - If a Pi, TUI, or `pi-zentui` update causes display issues, try `/reload` first
155
-
156
- ## Recommended companions
157
-
158
-
159
- | Extension | Purpose |
160
- | ------------------------------- | -------------------------------------------------------------- |
161
- | `npm:pi-zentui` | Fixed editor, status line, and Git status |
162
- | `npm:@tintinweb/pi-subagents` | Parallel SubAgents, background tasks, and worktree isolation |
163
- | `npm:pi-mcp-adapter` | On-demand MCP tool discovery with lower context usage |
164
- | `npm:pi-theme-picker` | Theme search and live preview |
165
- | `npm:@ayulab/pi-rewind` | Checkpoint-based code or conversation rollback |
166
- | `npm:pi-compact-thinking` | Compact rendering for hidden thinking blocks |
167
-
168
- ## Credits
169
-
170
- - Compact transcript behavior is based on [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2 (MIT).
171
- - 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).
172
- - 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).
173
- - Startup header based on [`EnderLiquid/pi-startup-header`](https://github.com/EnderLiquid/pi-startup-header) (MIT).
174
- - Command aliases based on [`xRyul/pi-aliases`](https://github.com/xRyul/pi-aliases) (MIT).
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, a fixed editor, 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
+ ## Features
73
+
74
+
75
+ | Feature | Description | Entry point |
76
+ | --------------------------- | -------------------------------------------------------------------------------------------------- | --------------------- |
77
+ | Claude Code-style output | Tool summaries, expand/collapse, rich edit/write diffs, and `on` / `off` / `compact` modes | `/ccstyle` |
78
+ | Fixed-editor interaction | Powered by `@tifan/pi-fixed-editor`, with runtime toggling, five-row wheel scrolling, tool clicks, and back-to-bottom control | `/ccstyle` |
79
+ | Context inspection | Usage breakdown and previews for the system prompt, tools, skills, and messages | `/context` |
80
+ | Session references | Search and inject effective context from previous Sessions or existing SubAgents | `@session:` |
81
+ | Theme | Includes the GitHub Dark Default theme | `/theme` |
82
+
83
+ ### Output modes
84
+
85
+
86
+ | Mode | Behavior |
87
+ | ----------- | ----------------------------------------------------------------------- |
88
+ | `on` | Claude Code-style tool output with rich diffs for`edit` and `write` |
89
+ | `off` | Native Pi renderers |
90
+ | `compact` | One-line previews, merged repeated calls, duration, and run summaries |
91
+
92
+ ```text
93
+ /ccstyle on
94
+ /ccstyle off
95
+ /ccstyle compact
96
+ /ccstyle status
97
+ ```
98
+
99
+ Configuration is stored in `~/.pi/agent/claude-code-style.json`:
100
+
101
+ ```json
102
+ {
103
+ "mode": "on",
104
+ "excludeRenderers": [],
105
+ "fixedEditorFeatures": true
106
+ }
107
+ ```
108
+
109
+ - `excludeRenderers` uses exact tool names. `Agent` always keeps its dedicated renderer.
110
+ - `fixedEditorFeatures: true` enables `@tifan/pi-fixed-editor` plus mouse scrolling, clicks, viewport mapping, and the back-to-bottom indicator.
111
+ - Set it to `false`, or toggle **Fixed editor** in `/ccstyle`, to restore Pi's native scrolling editor immediately. `Ctrl+End` remains available.
112
+ - Run `/reload` after editing the file manually.
113
+
114
+ ### `@` references
115
+
116
+ - Enter `@session:` to reference a previous Session.
117
+ - Enter `@agent-name` to delegate to a custom Agent.
118
+ - Compatible with `@bacnh85/pi-fff` and `@tintinweb/pi-subagents`.
119
+ - Session context is deduplicated and size-limited before injection.
120
+
121
+ ## Other installation methods
122
+
123
+ ```bash
124
+ # GitHub
125
+ pi install git:github.com/minuque/pi-cc-extensions
126
+
127
+ # Local repository
128
+ pi install /absolute/path/to/pi-cc-extensions
129
+ ```
130
+
131
+ ## Local development
132
+
133
+ ```bash
134
+ npm test
135
+ npm run typecheck
136
+ pi -e .
137
+ ```
138
+
139
+ Run `/reload` after changing extensions.
140
+
141
+ ## Compatibility
142
+
143
+ - Node.js `>=22.19.0`
144
+ - Loaded through `pi.extensions` and `pi.themes` in the root `package.json`
145
+ - If a Pi, TUI, or `@tifan/pi-fixed-editor` update causes display issues, try `/reload` first
146
+
147
+ ## Recommended companions
148
+
149
+
150
+ | Extension | Purpose |
151
+ | ------------------------------- | -------------------------------------------------------------- |
152
+ | `npm:@tintinweb/pi-subagents` | Parallel SubAgents, background tasks, and worktree isolation |
153
+ | `npm:pi-mcp-adapter` | On-demand MCP tool discovery with lower context usage |
154
+ | `npm:pi-theme-picker` | Theme search and live preview |
155
+ | `npm:@ayulab/pi-rewind` | Checkpoint-based code or conversation rollback |
156
+ | `npm:pi-compact-thinking` | Compact rendering for hidden thinking blocks |
157
+
158
+ ## Credits
159
+
160
+ - Compact transcript behavior is based on [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2 (MIT).
161
+ - Fixed-editor behavior is provided by [`@tifan/pi-fixed-editor`](https://github.com/tifandotme/pi-extensions/tree/master/packages/pi-fixed-editor) (MIT).
162
+ - 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).
163
+ - Startup header based on [`EnderLiquid/pi-startup-header`](https://github.com/EnderLiquid/pi-startup-header) (MIT).
164
+ - Command aliases based on [`xRyul/pi-aliases`](https://github.com/xRyul/pi-aliases) (MIT).
package/README.md CHANGED
@@ -1,115 +1,113 @@
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
- # GitHub
64
- pi install git:github.com/minuque/pi-cc-extensions
65
- ```
66
-
67
- 安装后执行 `/reload`
68
-
69
- ## 功能
70
-
71
-
72
- | 功能 | 说明 | 入口 |
73
- | ------------------------------ | --------------------------------------------------------------------------------- | --------------------- |
74
- | Claude Code 风格输出 | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `off` / `compact` 三种模式 | `/ccstyle` |
75
- | Fixed editor 交互 | 每刻度 5 行滚动、工具点击、收起位置补偿、回到底部按钮与`Ctrl+End` | `/ccstyle` |
76
- | Ask User Question 结构化问卷 | 单选、多选、自定义回答、Markdown 预览及 RPC / ACP 降级 | `ask_user_question` |
77
- | 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容 | `/context` |
78
- | Session 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@session:` |
79
- | 主题 | 随包提供内置 GitHub Dark Default 主题 | `/theme` |
80
-
81
- ## 本地开发
82
-
83
- ```bash
84
- npm test
85
- npm run typecheck
86
- pi -e .
87
- ```
88
-
89
- 修改扩展后执行 `/reload`。修改 `extensions/ask-user-question/` 或重装其依赖后,需要完整重启 Pi。
90
-
91
- ## 兼容性
92
-
93
- - Node.js `>=22.19.0`
94
- - 通过根目录 `package.json` 的 `pi.extensions` 和 `pi.themes` 加载
95
- - `pi-zentui`、Pi 或 TUI 内部实现升级后若显示异常,先执行 `/reload`
96
-
97
- ## 推荐搭配
98
-
99
-
100
- | 扩展 | 用途 |
101
- | ------------------------------- | ------------------------------------- |
102
- | `npm:pi-zentui` | Fixed editor、状态栏和 Git 状态 |
103
- | `npm:@tintinweb/pi-subagents` | 并行 SubAgent、后台任务与工作树隔离 |
104
- | `npm:pi-mcp-adapter` | 按需发现 MCP 工具,减少上下文占用 |
105
- | `npm:pi-theme-picker` | 主题搜索和实时预览 |
106
- | `npm:@ayulab/pi-rewind` | 基于 checkpoint 回退代码或对话 |
107
- | `npm:pi-compact-thinking` | 紧凑显示隐藏的 thinking 块 |
108
-
109
- ## 致谢
110
-
111
- - Compact transcript 基于 [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2(MIT)。
112
- - 结构化问卷基于 [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question) v2.1.0(MIT)。
113
- - Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/tool-diff/ATTRIBUTION.md`](./extensions/tool-diff/ATTRIBUTION.md)。
114
- - 启动头基于 [`EnderLiquid/pi-startup-header`](https://github.com/EnderLiquid/pi-startup-header)(MIT)。
115
- - 命令别名基于 [`xRyul/pi-aliases`](https://github.com/xRyul/pi-aliases)(MIT)。
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
+ # GitHub
64
+ pi install git:github.com/minuque/pi-cc-extensions
65
+ ```
66
+
67
+ 安装后执行 `/reload`
68
+
69
+ ## 功能
70
+
71
+
72
+ | 功能 | 说明 | 入口 |
73
+ | ------------------------------ | --------------------------------------------------------------------------------- | --------------------- |
74
+ | Claude Code 风格输出 | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `off` / `compact` 三种模式 | `/ccstyle` |
75
+ | Fixed editor 交互 | 基于 `@tifan/pi-fixed-editor`,支持动态开关、每刻度 5 行滚动、工具点击与回到底部 | `/ccstyle` |
76
+ | 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容 | `/context` |
77
+ | Session 引用 | 搜索并注入历史 Session 或现有 SubAgent 的有效上下文 | `@session:` |
78
+ | 主题 | 随包提供内置 GitHub Dark Default 主题 | `/theme` |
79
+
80
+ ## 本地开发
81
+
82
+ ```bash
83
+ npm test
84
+ npm run typecheck
85
+ pi -e .
86
+ ```
87
+
88
+ 修改扩展后执行 `/reload`。
89
+
90
+ ## 兼容性
91
+
92
+ - Node.js `>=22.19.0`
93
+ - 通过根目录 `package.json` 的 `pi.extensions` 和 `pi.themes` 加载
94
+ - `@tifan/pi-fixed-editor`、Pi 或 TUI 内部实现升级后若显示异常,先执行 `/reload`
95
+
96
+ ## 推荐搭配
97
+
98
+
99
+ | 扩展 | 用途 |
100
+ | ------------------------------- | ------------------------------------- |
101
+ | `npm:@tintinweb/pi-subagents` | 并行 SubAgent、后台任务与工作树隔离 |
102
+ | `npm:pi-mcp-adapter` | 按需发现 MCP 工具,减少上下文占用 |
103
+ | `npm:pi-theme-picker` | 主题搜索和实时预览 |
104
+ | `npm:@ayulab/pi-rewind` | 基于 checkpoint 回退代码或对话 |
105
+ | `npm:pi-compact-thinking` | 紧凑显示隐藏的 thinking 块 |
106
+
107
+ ## 致谢
108
+
109
+ - Compact transcript 基于 [`avhagedorn/pi-compact-transcript`](https://github.com/avhagedorn/pi-compact-transcript) v0.6.2(MIT)。
110
+ - Fixed editor 由 [`@tifan/pi-fixed-editor`](https://github.com/tifandotme/pi-extensions/tree/master/packages/pi-fixed-editor) 提供(MIT)。
111
+ - Rich diff 改编自 [`MasuRii/pi-tool-display`](https://github.com/MasuRii/pi-tool-display)(MIT);详见 [`extensions/tool-diff/ATTRIBUTION.md`](./extensions/tool-diff/ATTRIBUTION.md)。
112
+ - 启动头基于 [`EnderLiquid/pi-startup-header`](https://github.com/EnderLiquid/pi-startup-header)(MIT)。
113
+ - 命令别名基于 [`xRyul/pi-aliases`](https://github.com/xRyul/pi-aliases)(MIT)。