@tmustier/pi-files-widget 0.1.10 → 0.1.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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +15 -7
- package/demo.mp4 +0 -0
- package/index.ts +10 -6
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this extension will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.11] - 2026-01-26
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Require `bat`, `delta`, and `glow` before opening `/files`
|
|
9
|
+
- Add a postinstall reminder for required system tools
|
|
10
|
+
- Document install commands next to the Pi install steps
|
|
11
|
+
|
|
5
12
|
## [0.1.10] - 2026-01-26
|
|
6
13
|
|
|
7
14
|
### Fixed
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thomas Mustier
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
In-terminal file browser and diff viewer widget for Pi. Navigate files, view diffs, select code, and send comments to the agent without leaving the terminal and without interrupting your agent.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<video controls autoplay loop muted playsinline>
|
|
6
|
+
<source src="demo.mp4" type="video/mp4" />
|
|
7
|
+
</video>
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
@@ -12,6 +14,16 @@ In-terminal file browser and diff viewer widget for Pi. Navigate files, view dif
|
|
|
12
14
|
pi install npm:@tmustier/pi-files-widget
|
|
13
15
|
```
|
|
14
16
|
|
|
17
|
+
Required deps (needed for /files):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# macOS (Homebrew)
|
|
21
|
+
brew install bat git-delta glow
|
|
22
|
+
|
|
23
|
+
# Ubuntu/Debian
|
|
24
|
+
sudo apt-get install -y bat git-delta glow
|
|
25
|
+
```
|
|
26
|
+
|
|
15
27
|
```bash
|
|
16
28
|
pi install git:github.com/tmustier/pi-extensions
|
|
17
29
|
```
|
|
@@ -57,17 +69,13 @@ Then reference it in your settings:
|
|
|
57
69
|
}
|
|
58
70
|
```
|
|
59
71
|
|
|
60
|
-
## Dependencies (
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
brew install bat git-delta glow
|
|
64
|
-
```
|
|
72
|
+
## Dependencies (required)
|
|
65
73
|
|
|
66
74
|
- `bat`: syntax highlighting
|
|
67
75
|
- `delta`: formatted diffs
|
|
68
76
|
- `glow`: markdown rendering
|
|
69
77
|
|
|
70
|
-
|
|
78
|
+
The `/files` browser requires these tools and will refuse to open until they are installed.
|
|
71
79
|
|
|
72
80
|
## Commands
|
|
73
81
|
|
package/demo.mp4
ADDED
|
Binary file
|
package/index.ts
CHANGED
|
@@ -17,10 +17,18 @@ import { hasCommand } from "./utils";
|
|
|
17
17
|
export default function editorExtension(pi: ExtensionAPI): void {
|
|
18
18
|
const cwd = process.cwd();
|
|
19
19
|
const agentModifiedFiles = new Set<string>();
|
|
20
|
+
const requiredDeps = ["bat", "delta", "glow"] as const;
|
|
21
|
+
const getMissingDeps = () => requiredDeps.filter((dep) => !hasCommand(dep));
|
|
20
22
|
|
|
21
23
|
pi.registerCommand("files", {
|
|
22
24
|
description: "Open file browser",
|
|
23
25
|
handler: async (_args, ctx) => {
|
|
26
|
+
const missing = getMissingDeps();
|
|
27
|
+
if (missing.length > 0) {
|
|
28
|
+
ctx.ui.notify(`files-widget requires ${missing.join(", ")}. Install: brew install bat git-delta glow`, "error");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
await ctx.ui.custom<void>((tui, theme, _kb, done) => {
|
|
25
33
|
let pollInterval: ReturnType<typeof setInterval> | null = null;
|
|
26
34
|
|
|
@@ -122,13 +130,9 @@ export default function editorExtension(pi: ExtensionAPI): void {
|
|
|
122
130
|
});
|
|
123
131
|
|
|
124
132
|
pi.on("session_start", async (_event, ctx) => {
|
|
125
|
-
const missing
|
|
126
|
-
if (!hasCommand("bat")) missing.push("bat");
|
|
127
|
-
if (!hasCommand("delta")) missing.push("delta");
|
|
128
|
-
if (!hasCommand("glow")) missing.push("glow");
|
|
129
|
-
|
|
133
|
+
const missing = getMissingDeps();
|
|
130
134
|
if (missing.length > 0) {
|
|
131
|
-
ctx.ui.notify(`
|
|
135
|
+
ctx.ui.notify(`files-widget requires ${missing.join(", ")}. Install: brew install bat git-delta glow`, "error");
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
agentModifiedFiles.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmustier/pi-files-widget",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "In-terminal file browser and viewer for Pi.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Thomas Mustier",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"@mariozechner/pi-coding-agent": "^0.50.0",
|
|
19
19
|
"@mariozechner/pi-tui": "^0.50.0"
|
|
20
20
|
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"postinstall": "node -e \"console.log('pi-files-widget: required deps: bat, delta, glow. Install with: brew install bat git-delta glow')\""
|
|
23
|
+
},
|
|
21
24
|
"pi": {
|
|
22
25
|
"extensions": [
|
|
23
26
|
"index.ts"
|