pi-studio 0.9.53 → 0.9.54
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 +14 -0
- package/README.md +7 -3
- package/ROADMAP.md +4 -4
- package/client/studio-client.js +794 -144
- package/client/studio.css +50 -0
- package/index.ts +445 -97
- package/package.json +1 -1
- package/shared/studio-disk-revisions.js +558 -0
- package/shared/studio-file-watcher.js +181 -0
- package/shared/studio-workspace-state.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.54] — 2026-09-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Add read-only **Preview file (follow changes)** tabs from Files, local text links, and `/studio --watch <file>`. Followed previews use canonical disk paths, bounded and expiring path-bound tab capabilities, debounced polling, SHA-256 content revisions, atomic-save replacement handling, staged last-good rendering, and stable-anchor scroll restoration with ratio fallback through temporary read or render failures.
|
|
11
|
+
- Track canonical SHA-256 disk revisions for file-backed editor documents and retain the revision behind dirty recovery state.
|
|
12
|
+
- Add `Cmd/Ctrl+Shift+S` for Save As and explicit Save As replacement confirmation when the target already exists.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Make `Cmd/Ctrl+S` save a file-backed editor directly only while its known disk revision still matches, without routine confirmation; empty documents are valid save content.
|
|
16
|
+
- Use same-directory exclusive temporary files and atomic commits for Studio disk writes, while refusing replacement symlinks and hard-linked targets, preserving ordinary mode/ownership metadata where supported, and revalidating the expected revision immediately before commit. Platform-specific ACLs and extended attributes are not guaranteed to survive replacement.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Preserve dirty editor text when a file changes externally and offer an explicit **Reload / Save As… / Overwrite / Cancel** conflict decision instead of silently replacing either version.
|
|
20
|
+
|
|
7
21
|
## [0.9.53] — 2026-08-31
|
|
8
22
|
|
|
9
23
|
### Added
|
package/README.md
CHANGED
|
@@ -37,12 +37,14 @@ _The video shows an earlier version of the Studio interface. The basic workflow
|
|
|
37
37
|
- Adds a right-pane **Side questions** thread for contextual questions that stay outside the main Pi conversation unless explicitly promoted. It can start with the editor selection, the Markdown/LaTeX heading block at the cursor, nearby unstructured text, the whole editor, the displayed response, or no starting text; independently, it can use read-only tools to map, search, and read the document folder, repository, or another chosen folder—including extracted PDF, DOCX, ODT, and EPUB text—and can optionally search the web through Brave Search.
|
|
38
38
|
- Includes a live **Working** view for following current model/tool activity, with `All` / `Thinking` / `Tools` filters, image previews for image-producing tool outputs, plus **Load visible into editor** and **Copy visible** actions; when cycling response history, Working follows saved working details for the selected response when available, and `Cmd/Ctrl+Alt+1–8` switches directly between right-pane views while `Cmd/Ctrl+Alt+P` / `Cmd/Ctrl+Alt+E` / `Cmd/Ctrl+Alt+W` / `Cmd/Ctrl+Alt+F` / `Cmd/Ctrl+Alt+Q` keep quick mnemonic shortcuts for Response Preview, Editor Preview, Working, Files, and Side questions
|
|
39
39
|
- Includes a right-pane **Changes** view for browsing the current git diff by file, previewing per-file diffs, opening changed files, loading the full diff into the editor, and copying the diff
|
|
40
|
-
- Includes a right-pane **Files** view rooted in folders allowed for the current Studio session, with an **Allow folder…** action and location selector; exact-file grants can still be opened independently without exposing their parent folders. Files supports sorting by name/modified time/size, opening folders or the current root in Finder/the system file manager, loading text/code/CSV/TSV documents into the editor, previewing PDFs/images, opening previews in new Studio tabs, converting DOCX/ODT documents to editable Markdown when Pandoc is available after confirmation, copying paths, setting the current folder as the Studio working directory, and revealing files in the file manager
|
|
40
|
+
- Includes a right-pane **Files** view rooted in folders allowed for the current Studio session, with an **Allow folder…** action and location selector; exact-file grants can still be opened independently without exposing their parent folders. Files supports sorting by name/modified time/size, opening folders or the current root in Finder/the system file manager, loading text/code/CSV/TSV documents into the editor, opening a read-only **Preview (follow)** tab whose disk content is authoritative, previewing PDFs/images, opening previews in new Studio tabs, converting DOCX/ODT documents to editable Markdown when Pandoc is available after confirmation, copying paths, setting the current folder as the Studio working directory, and revealing files in the file manager
|
|
41
41
|
- Imports detached text-file copies either through the browser's file picker or from a path on the computer running Pi, keeping the path option available in embedded and remote browser views; imported copies remain detached until saved or opened as file-backed documents
|
|
42
42
|
- Includes an optional tmux-backed **REPL** view for Shell, Python, IPython, Julia, R, GHCi, and Clojure sessions, with Raw/Literate send modes, `Cmd/Ctrl+Shift+Enter` **Send to REPL**, session start/stop/interrupt controls, a compact refresh-persistent **Studio REPL Record** of user and Pi-sent code, a secondary raw tmux mirror, agent-facing `studio_repl_status` / `studio_repl_send` tools, and Markdown/PDF/HTML export
|
|
43
43
|
- Includes a local persistent scratchpad for quick notes you want to keep out of the main editor until you're ready to copy or insert them, with a **Recent…** picker for recovering scratchpads saved under earlier file/draft identities
|
|
44
44
|
- Includes a docked **Outline** rail for navigating document structure in the current editor text, with clickable entries that jump in the raw editor and reveal matching preview locations when available
|
|
45
45
|
- Restores each browser tab’s editor workspace after refresh or cmux hidden-surface reconstruction, and provides an explicit **Reset editor** action when you want to discard the restored draft and return the tab to a fresh blank draft without changing responses or saved files
|
|
46
|
+
- Tracks an SHA-256 disk revision for file-backed editors: `Cmd/Ctrl+S` checks that revision before staging and again immediately before atomic replacement, external changes produce an explicit **Reload / Save As… / Overwrite / Cancel** decision, and even **Overwrite** / Save As **Replace** must still match the revision Studio reported when confirmation opened. `Cmd/Ctrl+Shift+S` performs no-clobber Save As unless you explicitly confirm the current target. Studio preserves ordinary mode and ownership metadata where the platform permits and refuses to split hard-linked files; file-system-specific ACLs and extended attributes may not survive atomic replacement. As with other file system editors, unrelated writers do not participate in a shared atomic compare-and-swap, so version control remains appropriate for highly concurrent files.
|
|
47
|
+
- Opens text/code documents as read-only followed previews through **Preview file (follow changes)**, Files' **Preview (follow)** action, or `/studio --watch <file>`; updates are debounced and content-hashed, atomic-save replacements are followed, reading position is restored by a stable content anchor with ratio fallback, and temporary read/render failures retain the last good preview
|
|
46
48
|
- Turns local preview links, including links inside sandboxed HTML previews, into Studio actions: PDFs open in the embedded viewer, images open in a zoomable focus viewer, PDF/image links can open in a new Studio preview tab, text/code/CSV/TSV document links can open in a new editor tab, DOCX/ODT links can be converted to editable Markdown, and right-click menus provide **Open here**, **Reveal in file manager**, and **Copy path** for local resources
|
|
47
49
|
- Includes local comments anchored to selections/lines, shown in a docked **Comments** rail, with transient **Comment** / **Jump** actions from raw-editor selections plus editor-preview selections for Markdown, LaTeX, code/text/diff previews, and an opt-in comment mode for editor HTML previews; source-anchored comments can be toggled into inline `[an: ...]` annotations when you want comments reflected in the document text
|
|
48
50
|
- Browses response history (`Prev/Next/Last`) and loads either:
|
|
@@ -69,7 +71,7 @@ _The video shows an earlier version of the Studio interface. The basic workflow
|
|
|
69
71
|
|---|---|
|
|
70
72
|
| `/studio` | Open in Muxy or cmux when available, otherwise the system browser, with the last assistant response (fallback: blank) |
|
|
71
73
|
| `/studio <path>` | Open a text file in the editor, or a PDF in a read-only companion preview tab |
|
|
72
|
-
| `/studio --watch <
|
|
74
|
+
| `/studio --watch <file>` | Open a local text/code file in a read-only preview that follows disk changes, or a PDF with stable-file auto-refresh enabled |
|
|
73
75
|
| `/studio --last` | Force last response |
|
|
74
76
|
| `/studio --blank` | Force blank editor |
|
|
75
77
|
| `/studio --no-browser` | Start/print the Studio URL without opening a browser, useful for forwarded or phone/browser sessions |
|
|
@@ -78,7 +80,7 @@ _The video shows an earlier version of the Studio interface. The basic workflow
|
|
|
78
80
|
| `/studio --stop` | Stop studio server |
|
|
79
81
|
| `/studio --help` | Show help |
|
|
80
82
|
| `/studio-replace [path\|--blank\|--last]` | Replace the current full Studio view with a new full Studio view |
|
|
81
|
-
| `/studio-editor-only [path\|--blank\|--last]` | Open an editor-only view, or a read-only PDF preview;
|
|
83
|
+
| `/studio-editor-only [path\|--blank\|--last]` | Open an editor-only view, or a read-only PDF preview; add `--watch <file>` for a followed text/PDF companion view |
|
|
82
84
|
| `/studio-current <path>` | Load a file into currently open Studio tab(s) without opening a new browser window |
|
|
83
85
|
| `/studio-pdf [path] [options]` | Export a local file, or the last model response when no path is given, via the Studio PDF pipeline |
|
|
84
86
|
| `/studio-html [path]` | Export a local file, or the last model response when no path is given, to standalone HTML via the Studio preview pipeline |
|
|
@@ -149,6 +151,8 @@ caption: Optional caption
|
|
|
149
151
|
|
|
150
152
|
To view an existing PDF directly, run `/studio report.pdf` (or `/studio "path with spaces/report.pdf"`). The PDF opens read-only in a focused companion preview, even when the full Studio workspace is already open. A `#page=N` suffix selects the initial page. Auto-refresh is off by default; use `/studio --watch report.pdf` to start with it on, or toggle **Auto-refresh** in the PDF card or focused viewer. Studio checks only while the tab is visible and waits for two matching file-version observations before reloading, which avoids reading a PDF while LaTeX is still writing it. **Cmd/Ctrl+Alt+R** manually refreshes the focused or visible PDF. This is distinct from `/studio-pdf`, which exports Markdown, LaTeX, code, or the last response to a new PDF.
|
|
151
153
|
|
|
154
|
+
For a disk-authoritative text or code preview, run `/studio --watch notes.md` or choose **Preview file (follow changes)** from a local-link menu / **Preview (follow)** in Files. This opens a transient read-only companion tab rather than an editable buffer. Studio polls the canonical file, debounces change bursts, compares SHA-256 content revisions, accepts ordinary and atomic-replacement saves, and never writes back. Each watcher socket is bound to the exact path in a bounded, expiring server-created tab capability; if that identity expires before a reload or reconnect, the tab stays read-only and asks you to open a fresh watched preview. A missing, unreadable, oversized, binary, or path-replaced source leaves the last good preview visible and automatically recovers when the same canonical file becomes readable again. Render failures likewise retain the last successfully staged document rather than replacing it with partial output. On successful updates, Studio restores a nearby stable content anchor where possible and falls back to the previous scroll ratio.
|
|
155
|
+
|
|
152
156
|
### Mermaid icons
|
|
153
157
|
|
|
154
158
|
Studio's live previews and standalone HTML exports support Mermaid's `lucide:*` and `logos:*` icon nodes. The corresponding Iconify packs load lazily, so Studio does not fetch either pack unless a diagram uses it. Mermaid and the browser icon-pack URLs are pinned to tested versions.
|
package/ROADMAP.md
CHANGED
|
@@ -34,9 +34,9 @@ A focused portability and affordance pass:
|
|
|
34
34
|
|
|
35
35
|
This release must not add Muxy-specific branches or attempt to instrument opaque Quarto/authored-HTML iframe contents.
|
|
36
36
|
|
|
37
|
-
## 0.9.53 — Resource locations
|
|
37
|
+
## 0.9.53 — Resource locations (shipped 2026-08-31)
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The bounded canonical workspace registry governs explicit local links, the Files view, passive images/PDFs, and Side questions' related-file roots.
|
|
40
40
|
|
|
41
41
|
Replace the single-root assumption with explicit resource grants:
|
|
42
42
|
|
|
@@ -51,9 +51,9 @@ Replace the single-root assumption with explicit resource grants:
|
|
|
51
51
|
|
|
52
52
|
The resource-location registry should be workspace-level rather than tied to the current editor document so it remains compatible with multiple buffers. Remembering grants per project can follow after the session-only model is proven.
|
|
53
53
|
|
|
54
|
-
## 0.9.54 — Disk-backed preview and safe save
|
|
54
|
+
## 0.9.54 — Disk-backed preview and safe save (shipped 2026-09-02)
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Builds on the resource-location foundation:
|
|
57
57
|
|
|
58
58
|
- distinguish editable buffers, whose in-memory text drives Editor Preview, from read-only watched previews, whose file on disk is authoritative;
|
|
59
59
|
- add a read-only **Preview file (follow changes)** workflow using the proven debounce, content-hash, atomic-save, preserved-scroll, and last-good-render behaviour from `pandoc-glance` / `pi-markdown-preview` without making Studio depend on another extension;
|