@prjct.app/pi-clipboard 0.1.4 → 0.1.6

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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.6](https://github.com/prjct-app/pi-clipboard/compare/v0.1.5...v0.1.6) (2026-09-10)
2
+
3
+ ## [0.1.5](https://github.com/prjct-app/pi-clipboard/compare/v0.1.4...v0.1.5) (2026-09-10)
4
+
5
+ ### Bug Fixes
6
+
7
+ * recognize timestamped Pi clipboard attachments ([f9769f4](https://github.com/prjct-app/pi-clipboard/commit/f9769f46d25cb90a19913b2486d0bbd61f6a4c9d))
8
+
1
9
  ## [0.1.4](https://github.com/prjct-app/pi-clipboard/compare/v0.1.3...v0.1.4) (2026-09-10)
2
10
 
3
11
  ### Bug Fixes
package/README.md CHANGED
@@ -6,6 +6,12 @@ Preview pasted images in PI Agent before sending them, with inline thumbnails an
6
6
 
7
7
  `@prjct.app/pi-clipboard` · Clipboard image previews; one extension.
8
8
 
9
+ ## Demo
10
+
11
+ [![Watch the pi-clipboard promotional demo](media/pi-clipboard-demo/poster.png)](https://github.com/prjct-app/pi-clipboard/raw/refs/heads/main/media/pi-clipboard-demo/pi-clipboard-demo.mp4)
12
+
13
+ [Watch or download the 40-second demo](https://github.com/prjct-app/pi-clipboard/raw/refs/heads/main/media/pi-clipboard-demo/pi-clipboard-demo.mp4). It shows the native PI Agent workflow for pasting, previewing, and reviewing one or several images before sending. The film uses the package's monochrome cover identity and an original instrumental soundtrack with no voice-over or external samples.
14
+
9
15
  ## Install
10
16
 
11
17
  Requires Pi installed separately and Node.js **22.19 or later**. Compatibility is tested with **Pi 0.85.1**; newer versions are not yet verified. This is an independent community package.
@@ -26,7 +32,7 @@ For project-only installation, add `-l`: `pi install -l npm:@prjct.app/pi-clipbo
26
32
 
27
33
  Previews appear automatically; there is no slash command to enable them. Removing an attachment path from the editor removes its preview. Each attachment renders as its own preview.
28
34
 
29
- Only Pi-created temporary clipboard attachments are eligible. Arbitrary image paths do not produce previews. Supported filenames end in PNG, JPEG, WebP, or GIF; individual files over 50 MiB and symbolic links are rejected. Clipboard images stay on disk as the temporary files Pi created; the files this session previewed are deleted when the Pi session ends. Previews render through Pi's native terminal image support; terminals without it show Pi's native `[Image: ...]` text fallback. The extension itself makes no network requests. Submitting an image still follows Pi's normal model-provider attachment flow.
35
+ Only Pi-created temporary clipboard attachments are eligible. The extension recognizes Pi's UUID (`pi-clipboard-<UUID>`) and timestamped (`clipboard-<date>-<time>-<hex>`) temporary filename forms; arbitrary image paths do not produce previews. Supported filenames end in PNG, JPEG, WebP, or GIF; individual files over 50 MiB and symbolic links are rejected. Clipboard images stay on disk as the temporary files Pi created; the files this session previewed are deleted when the Pi session ends. Previews render through Pi's native terminal image support; terminals without it show Pi's native `[Image: ...]` text fallback. The extension itself makes no network requests. Submitting an image still follows Pi's normal model-provider attachment flow.
30
36
 
31
37
 
32
38
  ## Manage the package
package/docs/package.md CHANGED
@@ -35,7 +35,7 @@ Third-party runtime dependencies belong in `dependencies`. Companion extensions
35
35
 
36
36
  ## Public interfaces
37
37
 
38
- Uses `session_start`, `session_shutdown`, `ctx.ui.getEditorText()`, `ctx.ui.setWidget()`, and Pi TUI `Image`/`Container` components. Kitty placements receive PNG payloads through Pi's native `convertToPng`. Clipboard files previewed by the session are deleted on `session_shutdown` after revalidating that they are still Pi-owned temporary files. It retains the native editor and attachment submission flow.
38
+ Uses `session_start`, `session_shutdown`, `ctx.ui.getEditorText()`, `ctx.ui.setWidget()`, and Pi TUI `Image`/`Container` components. It recognizes Pi's UUID and timestamped temporary clipboard filename forms in the system temporary directory. Kitty placements receive PNG payloads through Pi's native `convertToPng`. Clipboard files previewed by the session are deleted on `session_shutdown` after revalidating that they are still Pi-owned temporary files. It retains the native editor and attachment submission flow.
39
39
 
40
40
  ## Published contents
41
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prjct.app/pi-clipboard",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Preview pasted images in PI Agent before sending them, with inline thumbnails and a compact attachment gallery.",
5
5
  "type": "module",
6
6
  "keywords": [
package/src/index.ts CHANGED
@@ -19,7 +19,10 @@ import {
19
19
  type ImageDimensions,
20
20
  } from "@earendil-works/pi-tui";
21
21
 
22
- const CLIPBOARD_IMAGE_NAME_SOURCE = "pi-clipboard-[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\.(?:png|jpe?g|webp|gif)";
22
+ const IMAGE_EXTENSION_SOURCE = "(?:png|jpe?g|webp|gif)";
23
+ const UUID_CLIPBOARD_IMAGE_NAME_SOURCE = `pi-clipboard-[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\.${IMAGE_EXTENSION_SOURCE}`;
24
+ const TIMESTAMPED_CLIPBOARD_IMAGE_NAME_SOURCE = `clipboard-[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])-(?:[01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]-[0-9a-f]{8}\\.${IMAGE_EXTENSION_SOURCE}`;
25
+ const CLIPBOARD_IMAGE_NAME_SOURCE = `(?:${UUID_CLIPBOARD_IMAGE_NAME_SOURCE}|${TIMESTAMPED_CLIPBOARD_IMAGE_NAME_SOURCE})`;
23
26
  const CLIPBOARD_IMAGE_FILENAME = new RegExp(CLIPBOARD_IMAGE_NAME_SOURCE, "gi");
24
27
  const CLIPBOARD_IMAGE_BASENAME = new RegExp(`^${CLIPBOARD_IMAGE_NAME_SOURCE}$`, "i");
25
28
  const IMAGE_MIME_TYPES: Record<string, string> = {
@@ -60,7 +63,7 @@ const systemScheduler: Scheduler = {
60
63
  clearInterval: (handle) => clearInterval(handle),
61
64
  };
62
65
 
63
- /** Resolve only filenames produced by Pi's native clipboard flow. */
66
+ /** Resolve only filenames produced by Pi's native clipboard flows. */
64
67
  export function clipboardImagePaths(editorText: string): string[] {
65
68
  const paths = new Set<string>();
66
69
  const matcher = new RegExp(CLIPBOARD_IMAGE_FILENAME.source, CLIPBOARD_IMAGE_FILENAME.flags);