@bismawy/pi-vision-watcher 1.0.14 → 1.0.15
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 +59 -0
- package/LICENSE +0 -0
- package/README.md +64 -56
- package/package.json +5 -2
- package/src/dataloader.ts +0 -0
- package/src/describer.ts +0 -0
- package/src/dispose.ts +0 -0
- package/src/error-log.ts +0 -0
- package/src/image.ts +0 -0
- package/src/index.ts +0 -0
- package/src/prewarm-editor.ts +0 -0
- package/src/usage.ts +0 -0
- package/src/vision-model-selector.ts +626 -600
- package/vision-watcher.ts +0 -0
- package/vitest.config.ts +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.15] - 2026-09-28
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Standard `CHANGELOG.md` tracking repository release history according to Keep a Changelog.
|
|
7
|
+
- Added `dev` script (`pi --extension ./vision-watcher.ts`) to `package.json` for live local testing without installation.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Refreshed README presentation layout, badge aesthetics, and structure to match the standard `pi-arnative` specification.
|
|
11
|
+
- Standardized README banner image syntax (``) for full compatibility with pi.dev markdown sanitization.
|
|
12
|
+
- Updated `pi.image` manifest URL to `assets/banner.webp` with `assets/screenshot.webp` backwards compatibility.
|
|
13
|
+
- Registered `CHANGELOG.md` and `LICENSE` in `package.json` `"files"` packaging list.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Fixed model picker detail pane hanging wrapped values and aligned filter input field with the list gutter.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [1.0.14] - 2026-09-22
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Tightened picker header by removing empty spacing between top border and dialog title.
|
|
24
|
+
- Updated picker footer legend to use clean `[Key] Action` layout with colored accent highlighting for model counter.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## [1.0.13] - 2026-09-22
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- Added `ctrl+shift+q` shortcut to reset the entire fallback model chain in one keystroke.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- Polished picker footer spacing and legend descriptions.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [1.0.12] - 2026-09-22
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- Footer key legend in the interactive picker with clear separator formatting.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## [1.0.11] - 2026-09-12
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
- In-picker failover chain configuration (`ctrl+q` / `f2`) with real-time preview in the detail pane.
|
|
49
|
+
- Auto-healing and detection for GLM 4/5 false-vision and provider HTTP 400 errors.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
- Major model picker architecture overhaul with connected-only provider credentials filtering.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## [1.0.0] - 2026-08-21
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
- Initial standalone release of `pi-vision-watcher` providing intelligent vision handoff to text-only coding models in Pi.
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
# Vision Watcher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Give text-only models vision. Seamless multimodal handoff. Built for Pi.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://pi.dev/packages/@bismawy/pi-vision-watcher)
|
|
6
|
+
[](https://www.npmjs.com/package/@bismawy/pi-vision-watcher)
|
|
7
|
+
[](https://github.com/bismawy/pi-vision-watcher)
|
|
6
8
|
|
|
7
|
-
[
|
|
9
|
+

|
|
8
10
|
|
|
9
|
-
|
|
10
|
-

|
|
11
|
+
## Overview
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
pi-vision-watcher gives text-only pi models vision — images are described in the background by a vision model you pick, then handed off to text-only coding models without interrupting your workflow.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Connected-only picker:** `/vision-watcher` shows only vision-capable models from providers where you actually have credentials.
|
|
21
|
-
- **Batching & cache:** multiple images across parallel tool calls are batched into one describer request; cached images (SHA-256) are never re-described.
|
|
22
|
-
- **False-vision healing:** aggregator providers sometimes flag text-only models as multimodal, causing HTTP 400s. The extension proactively forces handoff for them and auto-heals `models.json` in-process.
|
|
23
|
-
- **Thinking controls:** adjust reasoning effort (`off` – `max`) for reasoning-capable vision models.
|
|
24
|
-
- **Fallback chains:** automatically falls back to backup vision models when the primary is rate-limited or down.
|
|
15
|
+
- Connected-only Picker: `/vision-watcher` shows only vision-capable models from providers where you actually have credentials.
|
|
16
|
+
- Batching & Cache: Multiple images across parallel tool calls are batched into one describer request; cached images (SHA-256) are never re-described.
|
|
17
|
+
- False-Vision Healing: Aggregator providers sometimes flag text-only models as multimodal, causing HTTP 400s. The extension proactively forces handoff for them and auto-heals `models.json` in-process.
|
|
18
|
+
- Thinking Controls: Adjust reasoning effort (`off` – `max`) for reasoning-capable vision models.
|
|
19
|
+
- Fallback Chains: Automatically falls back to backup vision models when the primary is rate-limited or down.
|
|
25
20
|
|
|
26
21
|
## Install
|
|
27
22
|
|
|
@@ -29,46 +24,48 @@ Paste an image, attach a file, or have the agent `read` one — pi-vision-watche
|
|
|
29
24
|
pi install npm:@bismawy/pi-vision-watcher
|
|
30
25
|
```
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
Run `/vision-watcher` to pick your vision model (or set it directly: `/vision-watcher model openai/gpt-4o`). Handoff is on by default — switch to any text-only model and work as usual.
|
|
28
|
+
|
|
29
|
+
To test locally without installing:
|
|
30
|
+
```bash
|
|
31
|
+
pi --extension ./vision-watcher.ts
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Shortcuts
|
|
35
|
+
|
|
36
|
+
| Key | Action |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `space` | Select highlighted model as primary describer (press again to clear) |
|
|
39
|
+
| `ctrl+q` · `f2` | Toggle highlighted model in/out of failover chain (marked 🔗, max 3) |
|
|
40
|
+
| `ctrl+t` | Walk thinking ladder (`off` → `minimal` → `low` → `medium` → `high` → `xhigh` → `max`) |
|
|
41
|
+
| `ctrl+a` | Toggle async paste handoff |
|
|
42
|
+
| `enter` · `ctrl+s` | Save configuration (primary describer and chain) |
|
|
43
|
+
| `esc` | Cancel and exit picker |
|
|
44
|
+
|
|
45
|
+
> **Notes:**
|
|
46
|
+
> - `ctrl+q` toggles backup models safely; `f2` is also available as a fallback key.
|
|
47
|
+
> - While filtering models in search, `space` enters a space character so multi-word queries (e.g. `gemini 3.8`) stay typeable.
|
|
48
|
+
> - The detail pane shows live configuration — primary, chain, thinking, and async handoff — so every keypress previews what will be saved.
|
|
33
49
|
|
|
34
50
|
## Commands
|
|
35
51
|
|
|
36
52
|
| Command | Action |
|
|
37
|
-
|
|
|
53
|
+
| --- | --- |
|
|
38
54
|
| `/vision-watcher` | Interactive picker for connected vision models |
|
|
39
55
|
| `/vision-watcher model <provider/id>` | Set primary vision describer directly |
|
|
40
56
|
| `/vision-watcher status` | View current configuration |
|
|
41
57
|
| `/vision-watcher auto <on\|off>` | Toggle automatic handoff (default: `on`) |
|
|
42
58
|
| `/vision-watcher add <provider/id>` | Force handoff on a specific model |
|
|
43
59
|
| `/vision-watcher remove <provider/id>` | Remove model from forced handoff list |
|
|
44
|
-
| `/vision-watcher thinking <level>` | Configure reasoning effort |
|
|
45
|
-
| `/vision-watcher timeout <ms>` | Set
|
|
60
|
+
| `/vision-watcher thinking <level>` | Configure reasoning effort (`off` – `max`) |
|
|
61
|
+
| `/vision-watcher timeout <ms>` | Set per-image description timeout (default `45000`) |
|
|
46
62
|
| `/vision-watcher prewarm <on\|off>` | Describe pasted images at paste-time (opt-in) |
|
|
47
|
-
| `/vision-watcher async <on\|off>` | Inject pasted-image descriptions asynchronously when no matching `read` wins
|
|
48
|
-
| `/vision-watcher clear` | Clear
|
|
49
|
-
| `/vision-watcher enable`
|
|
63
|
+
| `/vision-watcher async <on\|off>` | Inject pasted-image descriptions asynchronously when no matching `read` wins |
|
|
64
|
+
| `/vision-watcher clear` | Clear configured vision model |
|
|
65
|
+
| `/vision-watcher enable` · `disable` | Toggle extension active state |
|
|
50
66
|
| `/vision-watcher help` | List all subcommands |
|
|
51
67
|
|
|
52
|
-
|
|
53
|
-
`fallbackModels` failover chain.
|
|
54
|
-
|
|
55
|
-
In the picker:
|
|
56
|
-
|
|
57
|
-
| Key | Action |
|
|
58
|
-
|---|---|
|
|
59
|
-
| `space` | Select the highlighted model as the primary describer (press again to clear) |
|
|
60
|
-
| `ctrl+q` | Toggle the highlighted model in/out of the failover chain (marked 🔁, max 3). Not a mnemonic, and that's on purpose: `ctrl+f` is pi's find-text (bound since pi 0.85), `alt+f` is editor word-right, and `ctrl+alt+f` never survives Windows conhost/Windows Terminal. pi 0.85 also binds `ctrl+q` to `app.message.followUp`, which is inert while a picker is open — if it ever double-fires, `f2` is the free fallback (unbound in 0.84 and 0.85) |
|
|
61
|
-
| `ctrl+t` | Walk the thinking ladder: off → minimal → low → medium → high → xhigh → max → off → … |
|
|
62
|
-
| `ctrl+a` | Toggle async paste handoff |
|
|
63
|
-
| `enter` / `ctrl+s` | Save (primary **and** chain together) |
|
|
64
|
-
| `esc` | Cancel |
|
|
65
|
-
|
|
66
|
-
The detail pane always shows the current configuration — primary, chain,
|
|
67
|
-
thinking, async handoff — so every keypress shows exactly what will be saved.
|
|
68
|
-
`space` is left to the search box while a filter query is present, so multi-word
|
|
69
|
-
searches like `gemini 3.8` stay typeable.
|
|
70
|
-
|
|
71
|
-
## How it works
|
|
68
|
+
## Architecture
|
|
72
69
|
|
|
73
70
|
<details>
|
|
74
71
|
<summary><b>Configuration</b> (<code>~/.pi/agent/extensions/pi-vision-watcher.json</code>)</summary>
|
|
@@ -93,29 +90,40 @@ searches like `gemini 3.8` stay typeable.
|
|
|
93
90
|
|
|
94
91
|
Most fields have sane defaults — `visionModel` is the only one you normally set.
|
|
95
92
|
|
|
96
|
-
`fallbackModels` is the failover chain: when the primary describer fails (timeout,
|
|
97
|
-
rate limit, auth), each entry is tried **in order** — fallback 1 fails, fallback 2
|
|
98
|
-
runs, and so on until one returns a description. The picker caps the chain at 3
|
|
99
|
-
entries (`ctrl+q`). Set it from the picker instead of hand-editing the file.
|
|
93
|
+
`fallbackModels` is the failover chain: when the primary describer fails (timeout, rate limit, auth), each entry is tried **in order** until one returns a description. The picker caps the chain at 3 entries (`ctrl+q`). Set it from the picker instead of hand-editing the file.
|
|
100
94
|
|
|
101
95
|
</details>
|
|
102
96
|
|
|
103
97
|
<details>
|
|
104
|
-
<summary><b>Diagnostics &
|
|
98
|
+
<summary><b>Diagnostics & Recovery</b></summary>
|
|
105
99
|
|
|
106
100
|
- Failed vision calls log with stack traces to `~/.pi/agent/logs/pi-vision-watcher/errors.log` and degrade gracefully to `[Image: description unavailable]`.
|
|
107
101
|
- When a model falsely advertises image capability and 400s, the error is captured on `message_end`, `modelOverrides.<model>.input = ["text"]` is written to `models.json`, and the registry refreshes in-process.
|
|
108
102
|
|
|
109
103
|
</details>
|
|
110
104
|
|
|
105
|
+
<details>
|
|
106
|
+
<summary><b>Components</b></summary>
|
|
107
|
+
|
|
108
|
+
| File | Role |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| `vision-watcher.ts` | Extension entry point, lifecycle hooks, and CLI command handlers |
|
|
111
|
+
| `src/vision-model-selector.ts` | Interactive TUI model picker with connected-only filtering |
|
|
112
|
+
| `src/describer.ts` | Vision API request orchestration, multi-image batching, and failover chains |
|
|
113
|
+
| `src/dataloader.ts` | Batched image loader to prevent redundant parallel requests |
|
|
114
|
+
| `src/image.ts` | Image hashing (SHA-256), memory caching, and MIME detection |
|
|
115
|
+
| `src/prewarm-editor.ts` | Paste-time image prewarming and async clipboard injection |
|
|
116
|
+
| `src/error-log.ts` | Structured logging and error capture |
|
|
117
|
+
|
|
118
|
+
</details>
|
|
119
|
+
|
|
111
120
|
<details>
|
|
112
121
|
<summary><b>Development</b></summary>
|
|
113
122
|
|
|
114
123
|
```bash
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
bun run lint:dead
|
|
124
|
+
npm test # Vitest suite (250+ unit tests)
|
|
125
|
+
npm run typecheck # TypeScript checks
|
|
126
|
+
npm run lint:dead # Knip dead code analysis
|
|
119
127
|
```
|
|
120
128
|
|
|
121
129
|
</details>
|
|
@@ -124,6 +132,6 @@ bun run lint:dead
|
|
|
124
132
|
|
|
125
133
|
Distributed under the **MIT** license.
|
|
126
134
|
|
|
127
|
-
##
|
|
135
|
+
## Author
|
|
128
136
|
|
|
129
|
-
|
|
137
|
+
[Bisma](https://github.com/bismawy)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bismawy/pi-vision-watcher",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Give text-only pi models vision — describe images with a vision model you pick via an interactive picker, then hand off the text description to non-vision models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "bismawy",
|
|
@@ -34,10 +34,13 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"*.ts",
|
|
36
36
|
"src/",
|
|
37
|
+
"CHANGELOG.md",
|
|
38
|
+
"LICENSE",
|
|
37
39
|
"README.md"
|
|
38
40
|
],
|
|
39
41
|
"scripts": {
|
|
40
42
|
"test": "vitest run",
|
|
43
|
+
"dev": "pi --extension ./vision-watcher.ts",
|
|
41
44
|
"test:watch": "vitest",
|
|
42
45
|
"test:coverage": "vitest run --coverage",
|
|
43
46
|
"typecheck": "tsc --noEmit",
|
|
@@ -57,7 +60,7 @@
|
|
|
57
60
|
"extensions": [
|
|
58
61
|
"./vision-watcher.ts"
|
|
59
62
|
],
|
|
60
|
-
"image": "https://raw.githubusercontent.com/bismawy/pi-vision-watcher/main/assets/
|
|
63
|
+
"image": "https://raw.githubusercontent.com/bismawy/pi-vision-watcher/main/assets/banner.webp"
|
|
61
64
|
},
|
|
62
65
|
"peerDependencies": {
|
|
63
66
|
"@earendil-works/pi-ai": "*",
|
package/src/dataloader.ts
CHANGED
|
File without changes
|
package/src/describer.ts
CHANGED
|
File without changes
|
package/src/dispose.ts
CHANGED
|
File without changes
|
package/src/error-log.ts
CHANGED
|
File without changes
|
package/src/image.ts
CHANGED
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
package/src/prewarm-editor.ts
CHANGED
|
File without changes
|
package/src/usage.ts
CHANGED
|
File without changes
|