pi-my-compact-ui 0.3.0 → 0.4.1

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 CHANGED
@@ -24,18 +24,8 @@ glyph is a spinner while the entry is still streaming:
24
24
  └ ⠋ thinking The assertion is off by one…
25
25
  ```
26
26
 
27
- Expand the group to inspect tool arguments, result previews, and more of the
28
- reasoning content:
29
-
30
- ```text
31
- ✓ tools done
32
- ├─ ✓ thinking (1.2k)
33
- │ The validation path now handles expired sessions…
34
- ├─ ✓ read: src/auth.ts (0.1s)
35
- │ export async function authenticate() { …
36
- └─ ✓ edit: src/auth.ts (0.2s)
37
- Updated src/auth.ts
38
- ```
27
+ Groups always stay collapsed. Press `Ctrl+I` to inspect full tool arguments,
28
+ results, or reasoning content in a detail modal.
39
29
 
40
30
  ## Features
41
31
 
@@ -46,14 +36,12 @@ reasoning content:
46
36
  - Removes Pi's native hidden-thinking placeholder components so an empty
47
37
  thinking label cannot leave phantom blank rows in the transcript.
48
38
  - Supports streaming reasoning, streaming tool output, and parallel tool calls.
49
- - Displays tool state, argument summaries, elapsed time, and result previews.
39
+ - Displays tool state, argument summaries, elapsed time, and reasoning summaries.
50
40
  - Shows reasoning-token usage. During streaming it uses an estimate, then
51
41
  prefers provider-reported usage when available.
52
- - Follows Pi's standard `Ctrl+O` expand and collapse behavior.
42
+ - Keeps reasoning and tool groups collapsed, including when Pi toggles `Ctrl+O`.
53
43
  - Press `Ctrl+I` (or run `/compact-inspect`) to interactively select any tool call or thinking run with `↑`/`↓` and press `Enter` to pop up a centered modal showing full details. Press `Esc` or `q` to close.
54
- - Renders fenced code blocks as subtle theme-aware background panels with
55
- syntax highlighting and one character of horizontal padding instead of
56
- decorative top and bottom border rows.
44
+ - Leaves assistant Markdown and code-block rendering to Pi's native theme.
57
45
  - Preserves Pi's native execution semantics for `read`, `bash`, `powershell`, `edit`,
58
46
  `write`, `find`, `grep`, and `ls`.
59
47
  - Gives compaction summaries a distinct, compact presentation.
@@ -88,8 +76,7 @@ Available settings:
88
76
 
89
77
  | Setting | Default | Purpose |
90
78
  |---|---:|---|
91
- | `expandedToolLines` | `5` | Result-preview lines shown for each expanded tool |
92
- | `expandedThinkingLines` | `10` | Reasoning-preview lines shown for each expanded reasoning run |
79
+ | `maxGroupEntries` | `5` | Maximum visible entries in a collapsed group |
93
80
 
94
81
  The configuration is stored at:
95
82
 
@@ -101,8 +88,7 @@ Example:
101
88
 
102
89
  ```json
103
90
  {
104
- "expandedToolLines": 5,
105
- "expandedThinkingLines": 10
91
+ "maxGroupEntries": 5
106
92
  }
107
93
  ```
108
94
 
@@ -110,7 +96,7 @@ Example:
110
96
 
111
97
  | Action | Key |
112
98
  |---|---|
113
- | Expand or collapse reasoning and tool groups | `Ctrl+O` |
99
+ | Inspect reasoning and tool details | `Ctrl+I` or `/compact-inspect` |
114
100
  | Move through the settings menu | `Up` / `Down` |
115
101
  | Adjust a numeric value | `Left` / `Right`, `-` / `+` |
116
102
  | Save a setting | `Enter` |
@@ -136,32 +122,46 @@ Its main responsibilities are:
136
122
  > control their presentation. Actual execution is still delegated to Pi's
137
123
  > native tool implementations.
138
124
 
139
- ## 开发与测试
125
+ ## Development and Testing
140
126
 
141
- 公开入口仍为 `index.ts`,实现按职责拆分在 `src/`:
127
+ The public entry point is `index.ts`; implementations are split by responsibility in `src/`.
128
+ The build produces only the bundled `dist/extension.ts` declared in `pi.extensions`
129
+ and its source map. No JavaScript library entry or type declarations are published.
130
+ The TypeScript extension entry uses Pi's jiti transformation and host virtual
131
+ modules, avoiding a native ESM import of a second Pi installation. External Pi
132
+ dependencies are not bundled.
133
+ Pi packages are optional peers requiring `^1.0.3`, so installing the extension
134
+ does not automatically install another Pi. Local development and tests use the
135
+ same version range through development dependencies.
142
136
 
143
- | 模块 | 职责 |
137
+ | Module | Responsibility |
144
138
  |---|---|
145
- | `config.ts` / `settings.ts` | 配置读写与交互式设置;读写器可注入,测试不写入用户配置 |
146
- | `helpers.ts` / `types.ts` / `constants.ts` | 格式化、流式参数解析、共享类型和常量 |
147
- | `state.ts` | 集中管理运行状态;`createRuntimeState()` 创建独立状态快照 |
148
- | `thinking.ts` / `streaming-tools.ts` | 思考生命周期、工具占位行和执行时间 |
149
- | `tool-group.ts` / `markdown.ts` / `compaction.ts` / `modals.ts` | 分组、代码块、压缩摘要与弹窗渲染 |
150
- | `guards.ts` / `grouping.ts` / `assistant-patches.ts` | 组件识别、分组、正文锚点与 Pi 原生组件适配 |
151
- | `animation.ts` / `extension.ts` | 动画调度、命令与事件接入 |
139
+ | `config.ts` / `settings.ts` | Configuration persistence and interactive settings with injectable filesystem access |
140
+ | `helpers.ts` / `types.ts` / `constants.ts` | Formatting, streaming argument parsing, shared types and constants |
141
+ | `state.ts` | Runtime state; `createRuntimeState()` creates independent state snapshots |
142
+ | `thinking.ts` / `streaming-tools.ts` | Reasoning lifecycle, tool placeholders, and execution timing |
143
+ | `tool-group.ts` / `compaction.ts` / `modals.ts` | Collapsed groups, compaction summaries, and detail modals |
144
+ | `guards.ts` / `grouping.ts` / `assistant-patches.ts` | Component detection, grouping, text anchors, and native Pi integration |
145
+ | `animation.ts` / `extension.ts` | Animation scheduling, commands, and events |
152
146
 
153
147
  ```bash
154
- npm run typecheck # 严格 TypeScript 检查,包含源码和测试
155
- npm test # 编译到 .test-build/,使用 Node 内置测试框架
156
- npm run check # 类型检查 + 全部测试,CI 和发布前自动执行
148
+ npm run typecheck # Strict TypeScript checks for source and tests
149
+ npm test # Build and run the Node.js test suite
150
+ npm run check # Typecheck and all tests; also used by CI and before publishing
157
151
  ```
158
152
 
159
- 测试位于 `tests/`,覆盖纯逻辑、配置与数值编辑器、ANSI/中文代码块、
160
- 分组与弹窗、流式事件顺序、正文封组、历史锚点、热重载,以及 Pi 实际
161
- TypeScript 扩展加载器。测试无需新增依赖;`.test-build/` 不进入版本控制或发布包。
153
+ `npm test` builds the extension before compiling and running the tests. CI and the
154
+ publish workflow therefore use `npm run check` without a separate build step.
155
+
156
+ Tests in `tests/` cover helpers, configuration, numeric editors, collapsed groups,
157
+ modals, streaming event order, text boundaries, historical anchors, hot reload,
158
+ native assistant Markdown, Pi's actual extension loader, and bundled-loader host
159
+ component identity. Tests require no new
160
+ dependencies; `.test-build/` is not committed or published.
162
161
 
163
- 涉及真实终端的改动还需手动验证:通过 `pi -e ./index.ts` 加载,检查流式
164
- 思考与并行工具、正文切换、`Ctrl+O` 展开、`Ctrl+I` 弹窗、设置保存和 `/reload`。
162
+ Terminal changes also require manual verification with `pi -e ./index.ts`: check
163
+ streaming reasoning, parallel tools, text boundaries, groups staying collapsed
164
+ under `Ctrl+O`, `Ctrl+I` modals, settings persistence, and `/reload`.
165
165
 
166
166
  ## License
167
167