pi-compact-tools 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +13 -123
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,61 +1,19 @@
1
1
  # pi-compact-tools
2
2
 
3
- Compact, expandable rendering for Pi's built-in tools, with a polished GitHub Dark theme.
3
+ Compact, expandable rendering for Pi's built-in tools, with a GitHub Dark theme.
4
4
 
5
- > Formerly `@nedleeds/pi-compact-ui`. New installations should use `pi-compact-tools`.
6
-
7
- ## Demo
8
-
9
- The UI uses portable Unicode symbols and does not require a Nerd Font.
10
-
11
- ### Compact tool workflow
12
-
13
- Active, successful, and failed tool calls stay compact while preserving useful status and timing information.
14
-
15
- ![Compact tool workflow with Nerd Font](https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/nerd-font-workflow-optimized.gif)
16
-
17
- ### Progress and duration display
18
-
19
- The working label above the prompt uses the Thinking summary color with a soft white light sweep. Every tool state uses the same `⦁` glyph; running tools use a fourteen-frame cosine-eased RGB pulse between dim and bright gray, then settle to green on success or red on failure. Elapsed time remains visible in the neutral control color.
5
+ ![Compact tool workflow](https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/nerd-font-workflow-optimized.gif)
20
6
 
21
7
  ![Spinner and elapsed-time display](https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/spinner-duration-optimized.gif)
22
8
 
23
- ### Code-aware results
24
-
25
- Completed `edit` rows render a syntax-highlighted diff: a line-number and `+`/`-` gutter beside the code, tinted rows for additions and deletions, and `⋮` where context is skipped. Collapsed rows keep one line of context around each change so the edit itself stays visible; expanding with a click or `Ctrl+O` restores the full context the patch carries.
26
-
27
- ```text
28
- ⦁ edit src/load.ts
29
- │ 3 export async function load(path: string): Promise<string> {
30
- │ 4 - const raw = await readFile(path, "utf8");
31
- │ 4 + const raw = await readFile(path, "utf-8");
32
- │ 5 return raw.trim();
33
- └─ Done in 0.012s (2 lines)
34
- ```
35
-
36
- `read` and `write` results use the same numbered, syntax-highlighted layout without the diff signs. `read` line numbers start at the requested `offset`, and Pi's continuation notice (`[Showing lines …]`) is shown as a dim note below the code. Markdown files keep their exact source but style headings, lists, quotes, links, emphasis, and inline code, while fenced blocks are highlighted in their declared language. Files without a recognized language keep the plain output color instead of a guessed highlight.
37
-
38
9
  ![Edit diff](https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/assets/edit-diff.gif)
39
10
 
40
11
  ## Features
41
12
 
42
- - Compact rendering for `read`, `write`, `edit`, `bash`, `powershell`, `grep`, `find`, and `ls`
43
- - One continuously glowing working label above the input prompt across thinking and tool execution
44
- - Semantic built-in progress labels and automatically cleaned custom/MCP tool names; collapsed text-search rows include the searched pattern
45
- - Four-step `Ctrl+T` thinking cycle when provider detail is available: summary, detail, summary, then hidden
46
- - Millisecond-precision duration and completed output line counts with neutral status text
47
- - Per-tool hidden or persistent bounded-preview collapsed state with `auto_compact: true` or `false`
48
- - Primary invocation targets such as paths and patterns stay visible, including common collapsed shell file operations
49
- - Click and `Ctrl+O` follow Pi's built-in expansion state while preview rows collapse back to their preview
50
- - Edit results render as syntax-highlighted diffs with a line-number gutter, tinted change rows, and `⋮` context breaks
51
- - `read` and `write` contents use the same numbered, syntax-highlighted layout, with `read` line numbers following `offset`
52
- - Markdown files keep their exact source but style headings, lists, quotes, links, and inline code, and highlight fenced code blocks in their declared language
53
- - Configurable `previewLines` prevents large diffs, HTML, and shell output from flooding the transcript
54
- - Width-cached expanded results, edit-diff processing, and unchanged result reuse during status animation
55
- - Dark `│` and `└─` visual grouping
56
- - Distinct cool-blue thinking text
57
- - Truecolor and 256-color terminal support, plus Windows, Unix, and classic Mac line endings
58
- - No Nerd Font requirement
13
+ - Compact rows for `read`, `write`, `edit`, `bash`, `powershell`, `grep`, `find`, and `ls`, with status, duration, and line count
14
+ - Syntax-highlighted edit diffs and numbered `read`/`write` code views, including Markdown code fences
15
+ - Animated working label above the prompt and a `Ctrl+T` thinking summary/detail cycle
16
+ - No Nerd Font required
59
17
 
60
18
  ## Install
61
19
 
@@ -63,93 +21,27 @@ Completed `edit` rows render a syntax-highlighted diff: a line-number and `+`/`-
63
21
  pi install npm:pi-compact-tools
64
22
  ```
65
23
 
66
- Or install from GitHub:
67
-
68
- ```bash
69
- pi install git:github.com/nedleeds/pi-compact-tools
70
- ```
71
-
72
- Restart Pi or run `/reload`.
73
-
74
- Migrating from the previous package name:
75
-
76
- ```bash
77
- pi remove npm:@nedleeds/pi-compact-ui
78
- pi install npm:pi-compact-tools
79
- ```
80
-
81
- ## Theme
82
-
83
- Select `github-dark-pro` in Pi's settings, or add it to `~/.pi/agent/settings.json`:
84
-
85
- ```json
86
- {
87
- "theme": "github-dark-pro"
88
- }
89
- ```
24
+ Then restart Pi or run `/reload`. For the bundled theme, set `"theme": "github-dark-pro"` in `~/.pi/agent/settings.json`.
90
25
 
91
26
  ## Configuration
92
27
 
93
- Configuration is optional. Create `~/.pi/agent/compact-tools.json` for global settings or `<project>/.pi/compact-tools.json` for a trusted project.
94
-
95
- Default configuration:
28
+ Optional. Put it in `~/.pi/agent/compact-tools.json` or `<project>/.pi/compact-tools.json`:
96
29
 
97
30
  ```json
98
31
  {
99
- "$schema": "https://raw.githubusercontent.com/nedleeds/pi-compact-tools/main/schemas/compact-tools.schema.json",
100
32
  "tools": ["read", "write", "edit", "bash"],
101
33
  "previewLines": 10,
102
- "auto_compact": {
103
- "read": true,
104
- "write": true,
105
- "edit": false,
106
- "bash": true
107
- }
34
+ "auto_compact": { "read": true, "write": true, "edit": false, "bash": true }
108
35
  }
109
36
  ```
110
37
 
111
- Every tool call title uses `⦁`. Pending calls use dark gray; active calls smoothly pulse through fourteen cosine-eased RGB frames at a 45 ms interval without disappearing. Animation starts while arguments stream, so `write` and `edit` remain visibly active before their filesystem operation begins. Successful titles use green, and failed titles use red. `Done`, `Failed`, elapsed time, and line counts use the same neutral control color without printing inline click or keyboard hints. A single Pi working label animates independently of token arrival and reports `Thinking…`, `Responding…`, semantic built-in states such as `Reading file…`, or cleaned custom states such as `Using jira search…`. Invocation arguments remain in the tool row instead of being duplicated above the prompt. No separate spinner glyph is shown above the prompt.
112
-
113
- `auto_compact` controls each tool's initial result state:
114
-
115
- - `true` starts with the result hidden.
116
- - `false` starts with at most `previewLines` rendered rows visible.
117
- - Clicking or pressing `Ctrl+O` expands the complete result through Pi's built-in expansion state.
118
-
119
- `previewLines` accepts `1`–`100` and defaults to `10`. It limits the collapsed preview; the complete result remains available. Unspecified entries inherit the previous configuration layer. By default, `read`, `write`, and `bash` start hidden, while `edit` starts with a short diff preview centered on the changed lines.
120
-
121
- To enable all Unix-compatible tools:
122
-
123
- ```json
124
- {
125
- "tools": ["read", "write", "edit", "bash", "grep", "find", "ls"]
126
- }
127
- ```
128
-
129
- Add `"powershell"` on Windows if desired.
38
+ - `tools`: tools to render compactly. Also available: `grep`, `find`, `ls`, `powershell`.
39
+ - `auto_compact`: `true` starts hidden, `false` starts with a preview of up to `previewLines` rows (`1`–`100`).
130
40
 
131
41
  ## Controls
132
42
 
133
- `Ctrl+T` cycles every thinking block through:
134
-
135
- ```text
136
- one-line summary → summary + │-indented detail → one-line summary → Thinking...
137
- ```
138
-
139
- Standalone bold lines and Markdown headings split one provider thinking run into logical sections. Each section gets its own summary and optional `│`-indented detail. Summary-only views stay uncluttered with no control hint; the control row appears only while provider-supplied detail is visible. When no thinking detail exists, `Ctrl+T` falls back to Pi's normal visible/hidden toggle instead of showing a duplicate detail phase. While thinking streams, a slightly faster highlight sweeps from the Thinking summary color to white across Pi's working label at a steady interval rather than depending on token updates. The transcript summary remains visually stable. The transformation is display-only; complete thinking remains unchanged in the session and model context.
140
-
141
- Primary file and search targets stay visible. Collapsed `bash` and `powershell` rows describe intent—such as `Run tests` or `Check repository status`. Text searches retain their primary pattern (for example, `Search text "TODO|FIXME"`), and common file commands retain their operands (for example, `Run rm "build"` or `Find files "*.test.ts" in "src"`). Expanding the row reveals the exact command. After every supported tool completes, the status reports the expanded result size as `Done in …s (N lines)` instead of repeating options such as context and limit. Counts use the returned text for reads, searches, listings, and shell commands, written content for `write`, and only the changed `-`/`+` lines for `edit`. The count is computed once after completion and cached with the row, so streaming and repeated expansion do not add ongoing work. Large payloads represented as results follow the result toggle.
142
-
143
- A mouse click toggles one row using Pi's native result state. `Ctrl+O` remains owned by Pi and expands or collapses all tool rows consistently, including tools not rendered by this extension. A row with `auto_compact: false` cycles predictably between its bounded preview and the complete result, so repeated clicks never remove the row and fall through to a neighboring Thinking block. The extension does not intercept the global keybinding.
144
-
145
- ## Notes
146
-
147
- - Pi `0.85.1+` and Node.js `22.19.0+` are recommended.
148
- - The working indicator and mouse interaction are provided by Pi's TUI; `Ctrl+O` also works in regular mode.
149
- - Duration covers the full rendered tool-call lifecycle, including streamed `write` and `edit` arguments.
150
- - Syntax highlighting is skipped, keeping line numbers, for content over 512 KB, 10,000 lines, or a single 4 KB line. Pi already truncates `read` output to 2,000 lines or 50 KB.
151
- - Highlighting runs per diff hunk or `read` range, so a hunk or `offset` that starts inside a block comment or Markdown code fence may color its first lines as surrounding text.
152
- - Selected tools override definitions with the same names so their compact renderers are restored reliably after `/reload`; other extensions overriding those tools may conflict by load order.
43
+ - Click a row or press `Ctrl+O` to expand or collapse results.
44
+ - `Ctrl+T` cycles thinking: summary → detail → summary → hidden.
153
45
 
154
46
  ## Development
155
47
 
@@ -159,8 +51,6 @@ npm run check
159
51
  pi -e .
160
52
  ```
161
53
 
162
- Pi extensions execute with full system access. Review third-party extension source before installation.
163
-
164
54
  ## License
165
55
 
166
56
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-compact-tools",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Compact, expandable UI for pi's built-in tools, bundled with a polished GitHub Dark theme.",
5
5
  "type": "module",
6
6
  "license": "MIT",