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 +40 -40
- package/dist/extension.ts +2197 -0
- package/dist/extension.ts.map +7 -0
- package/package.json +19 -10
- package/index.ts +0 -3
- package/src/animation.ts +0 -37
- package/src/assistant-patches.ts +0 -431
- package/src/compaction.ts +0 -75
- package/src/config.ts +0 -31
- package/src/constants.ts +0 -36
- package/src/extension.ts +0 -282
- package/src/grouping.ts +0 -327
- package/src/guards.ts +0 -58
- package/src/helpers.ts +0 -130
- package/src/markdown.ts +0 -98
- package/src/modals.ts +0 -579
- package/src/settings.ts +0 -142
- package/src/state.ts +0 -80
- package/src/streaming-tools.ts +0 -232
- package/src/thinking.ts +0 -62
- package/src/tool-group.ts +0 -449
- package/src/types.ts +0 -52
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
|
-
|
|
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
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
| `
|
|
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
|
-
"
|
|
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
|
-
|
|
|
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
|
-
|
|
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` |
|
|
148
|
-
| `thinking.ts` / `streaming-tools.ts` |
|
|
149
|
-
| `tool-group.ts` / `
|
|
150
|
-
| `guards.ts` / `grouping.ts` / `assistant-patches.ts` |
|
|
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 #
|
|
155
|
-
npm test #
|
|
156
|
-
npm run check #
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
164
|
-
|
|
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
|
|