pi-extensions 0.1.13 → 0.1.14

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.
@@ -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
@@ -12,6 +12,16 @@ In-terminal file browser and diff viewer widget for Pi. Navigate files, view dif
12
12
  pi install npm:@tmustier/pi-files-widget
13
13
  ```
14
14
 
15
+ Required deps (needed for /files):
16
+
17
+ ```bash
18
+ # macOS (Homebrew)
19
+ brew install bat git-delta glow
20
+
21
+ # Ubuntu/Debian
22
+ sudo apt-get install -y bat git-delta glow
23
+ ```
24
+
15
25
  ```bash
16
26
  pi install git:github.com/tmustier/pi-extensions
17
27
  ```
@@ -57,17 +67,13 @@ Then reference it in your settings:
57
67
  }
58
68
  ```
59
69
 
60
- ## Dependencies (recommended)
61
-
62
- ```bash
63
- brew install bat git-delta glow
64
- ```
70
+ ## Dependencies (required)
65
71
 
66
72
  - `bat`: syntax highlighting
67
73
  - `delta`: formatted diffs
68
74
  - `glow`: markdown rendering
69
75
 
70
- If any are missing, the extension will notify you at session start and gracefully fall back to plain rendering.
76
+ The `/files` browser requires these tools and will refuse to open until they are installed.
71
77
 
72
78
  ## Commands
73
79
 
@@ -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: string[] = [];
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(`Editor: install ${missing.join(", ")} for better experience`, "info");
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();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmustier/pi-files-widget",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extensions",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "pi-package"