@pi-archimedes/image-paste 2.5.1 → 2.6.3

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 +31 -37
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,62 +1,56 @@
1
1
  # @pi-archimedes/image-paste
2
2
 
3
- Paste images from your clipboard directly into the Pi chat with inline previews.
3
+ **Show the screenshot rather than describing it.**
4
4
 
5
- Paste images directly from clipboard into Pi chats without manually saving files to disk first. Sharing visual context like UI mockups or error screenshots becomes instant, while inline previews keep your prompt clean and predictable.
6
-
7
- ## What you get
8
-
9
- - **Clipboard image paste** — grab a screenshot and paste it straight into the prompt
10
- - **Inline previews** — images render in the TUI so you can see what you attached
11
- - **Marker-based attachment** — placeholder markers (`[Image #1]`) are matched and attached on submit
12
- - **Size guard** — rejects images over 20MB with a clear warning
5
+ "the button above the header and below the nav" is work nobody wants to do. Image-paste puts the image from your clipboard into the prompt as you type: markers land in the text on paste, the matching queued images attach on submit, and a terminal preview shows you what the agent will see.
13
6
 
14
7
  ## Install
15
8
 
9
+ Standalone:
10
+
16
11
  ```bash
17
12
  pi install npm:@pi-archimedes/image-paste
18
13
  ```
19
14
 
20
- Or install full meta package:
15
+ Or the full suite instead:
21
16
 
22
17
  ```bash
23
18
  pi install npm:pi-archimedes
24
19
  ```
25
20
 
26
- ## Usage
21
+ New to Pi? Pi itself is a one-time global install and needs Node.js ≥ 22.19.0. If you need Pi, [its quickstart](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/quickstart.md) starts with `npm install -g --ignore-scripts @earendil-works/pi-coding-agent`. After installing Pi, choose one installation command above, then `cd` into your project, run `pi`, and use `/login` and `/model` inside the session. The [setup section](https://github.com/danielcherubini/pi-archimedes#setup) covers it end to end. `/reload` picks the extension up in a running session.
27
22
 
28
- With Pi focused, press the paste shortcut and any image in your clipboard is attached:
23
+ ## How it works
29
24
 
30
- | Platform | Shortcut |
31
- |----------|----------|
32
- | Linux | `Ctrl+V` |
33
- | macOS | `Ctrl+V` or `Alt+V` |
34
- | Windows | `Alt+V` |
25
+ - **Markers on paste** — pasting inserts a visible `[Image #1]` placeholder at the cursor; each paste gets the next number.
26
+ - **Attachment on submit** — when you send the message, your text is scanned for markers and the matching queued images are attached to it. Delete a marker and its image is not attached — the text is the source of truth.
27
+ - **Inline preview** a preview of the attached images is sent and rendered in the TUI. Previews appear where your terminal renders inline images; on a terminal that can't show them, the image is still attached — only the preview falls back.
28
+ - **Size guard** 20 MiB **per image**, rejected with a clear message before it wastes context or hangs the submit.
29
+ - **Model side** the session's model must support images for the attachment to be usable.
35
30
 
36
- A `[Image #N]` placeholder is inserted into your draft. When you submit, any images referenced by markers are automatically attached to the message. If you remove the markers before submitting, the images are discarded.
31
+ ## Paste shortcuts
37
32
 
38
- ## Settings
33
+ | Platform | Shortcuts |
34
+ |----------|-----------|
35
+ | Linux (X11/Wayland) | `Ctrl+V`, `Alt+V`, `Ctrl+Alt+V` |
36
+ | macOS | `Ctrl+V`, `Alt+V`, `Ctrl+Alt+V` |
37
+ | Windows | `Alt+V`, `Ctrl+Alt+V` |
39
38
 
40
- Uses Pi's core `terminal.showImages` setting to control inline previews. No package-specific settings.
39
+ > [!NOTE]
40
+ > **Pi's built-in `app.clipboard.pasteImage` owns the table's first shortcut on every platform** — `Ctrl+V` on Linux/macOS, `Alt+V` on Windows — so the two conflict everywhere. When both fire on the shared key, the built-in throws warning banners (seen on Linux). Clear the built-in binding in `~/.pi/agent/keybindings.json` so the preview-enhanced handler takes the paste:
41
+ >
42
+ > ```json
43
+ > { "app.clipboard.pasteImage": [] }
44
+ > ```
41
45
 
42
- ## Troubleshooting
46
+ ## Per-platform requirements
43
47
 
44
- ### `ctrl+v` shortcut conflict on Linux
48
+ - **Linux** — a graphical session (`DISPLAY` or `WAYLAND_DISPLAY`) and one of `wl-clipboard` (tried first on Wayland sessions), `xclip` (tried first on X11), or the `@mariozechner/clipboard` native module. Termux is not supported.
49
+ - **macOS** — the only image reader on macOS is the `@mariozechner/clipboard` native module (no other CLI fallback); it ships inside the `pi-coding-agent` installation but must be importable from the extension's location, so if your Pi install's layout puts it out of resolution reach, a read reports the reader as unavailable — make the module resolvable beside the extension and `/reload`.
50
+ - **Windows** — the `@mariozechner/clipboard` native module first, with a PowerShell fallback.
45
51
 
46
- Pi has a built-in `ctrl+v` handler (`app.clipboard.pasteImage`) that conflicts with this extension. You'll see a warning like:
47
-
48
- ```
49
- Extension shortcut conflict: 'ctrl+v' is built-in shortcut for app.clipboard.pasteImage
50
- ```
51
-
52
- **Fix:** Clear the built-in binding in `~/.pi/agent/keybindings.json`:
53
-
54
- ```json
55
- {
56
- "app.clipboard.pasteImage": []
57
- }
58
- ```
52
+ ## Part of the suite
59
53
 
60
- This lets archimedes' handler take over (it does the same thing plus inline previews) without the warning.
54
+ In [pi-archimedes](https://github.com/danielcherubini/pi-archimedes), image-paste works alongside the framed editor, the status bar, and the todo board; on/off is managed by the suite (`/plugins`, `archimedes.imagePaste.enabled`, default on).
61
55
 
62
- ← Back to [pi-archimedes](../../README.md)
56
+ [Back to pi-archimedes](https://github.com/danielcherubini/pi-archimedes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/image-paste",
3
- "version": "2.5.1",
3
+ "version": "2.6.3",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -15,8 +15,8 @@
15
15
  "@earendil-works/pi-tui": ">=0.1.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@earendil-works/pi-coding-agent": "^0.84.4",
19
- "@earendil-works/pi-tui": "^0.84.4",
18
+ "@earendil-works/pi-coding-agent": "^0.85.1",
19
+ "@earendil-works/pi-tui": "^0.85.1",
20
20
  "typescript": "^6.0.0"
21
21
  },
22
22
  "pi": {