pi-studio 0.9.52 → 0.9.53
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 +18 -0
- package/README.md +9 -7
- package/ROADMAP.md +14 -1
- package/client/studio-client.js +598 -106
- package/client/studio-preview-resource-helpers.js +61 -12
- package/client/studio.css +130 -3
- package/index.ts +547 -70
- package/package.json +1 -1
- package/shared/studio-resource-grants.js +157 -0
- package/shared/studio-side-question-context.js +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.53] — 2026-08-31
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Add a bounded, session-scoped workspace grant registry that canonicalizes exact-file and directory grants, rejects symlink escapes, automatically records trusted document/workspace locations, and stays separate from the current editor document.
|
|
11
|
+
- When an explicit local preview link crosses the current resource boundary, show an in-page **Allow this file** / **Allow this folder for this Studio session** / **Cancel** decision, identify the path as belonging to the computer running Pi, and retry the original PDF, image, document, copy, reveal, or system-viewer action only after a grant is confirmed.
|
|
12
|
+
- Root the Files view in session directory grants, add an explicit **Allow folder…** action and allowed-location selector, and show exact-file grants without exposing or making their parent folders browsable.
|
|
13
|
+
- Add `Cmd/Ctrl+Alt+F` as a mnemonic shortcut for switching the right pane directly to Files (`Ctrl+Option+F` is accepted on macOS).
|
|
14
|
+
- Keep passive local images and embedded PDFs behind the same server-side session grants: already allowed media loads without interruption, while blocked media stays unloaded and presents an explicit **Allow local image/PDF…** action for choosing an exact-file or containing-folder grant.
|
|
15
|
+
- Require a directory grant before a new Side questions thread can map, search, or read related files, with a trusted outer-Studio confirmation that names the canonical folder and explains the read-only scope.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Check local-link access before presenting its action menu, and route text/office links through that menu, so permission decisions remain visible in the originating Studio page instead of being hidden behind a preliminary waiting tab.
|
|
19
|
+
- Resolve interactive preview media only through authenticated Studio endpoints rather than allowing Pandoc to embed files from a client-supplied resource directory; authored-HTML image blocks are surfaced in trusted outer Studio UI.
|
|
20
|
+
- Revalidate Side questions' selected context root before prompting and before each built-in local context tool call; exact-file grants cannot authorize parent-folder access, and replacement symlinks cannot redirect an active context root.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Keep confirmation-button text legible on hover in the light theme by retaining an accent background instead of inheriting the generic pale button hover state.
|
|
24
|
+
|
|
7
25
|
## [0.9.52] — 2026-08-28
|
|
8
26
|
|
|
9
27
|
### Added
|
package/README.md
CHANGED
|
@@ -35,9 +35,9 @@ _The video shows an earlier version of the Studio interface. The basic workflow
|
|
|
35
35
|
- Includes a global **Zen** mode that hides the Studio header and secondary chrome without changing the current left/right pane layout; the header can also be hidden independently and restored from the top-right edge
|
|
36
36
|
- Runs editor text directly, asks for structured critique (auto/writing/code focus), offers explicit **Show me** actions for a one-turn compact visual or structural explanation of the editor selection/document, displayed response, or current conversation topic, provides a manual **Suggest completion** action for short cursor-aware continuations (`Option/Alt+Tab` where available or `Cmd/Ctrl+Shift+Space` from the editor, `Tab` to insert a visible suggestion) with an optional editor-plus-latest-response context mode, or opens **Quiz me** for a Studio-native active-recall loop over the current editor text, selection, current file, folder, or repo, with optional focus guidance for shaping question selection
|
|
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
|
-
- 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` keep quick mnemonic shortcuts for Response Preview, Editor Preview, and
|
|
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 for
|
|
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
|
|
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
|
|
@@ -54,7 +54,7 @@ _The video shows an earlier version of the Studio interface. The basic workflow
|
|
|
54
54
|
- shows/hides annotation markers in preview
|
|
55
55
|
- strips markers before send (optional)
|
|
56
56
|
- saves `.annotated.md`
|
|
57
|
-
- Renders Markdown/LaTeX/code previews (math + Mermaid) plus lightweight CSV/TSV table previews, theme-synced with pi, with an explicit H1–H6 hierarchy, zoomable images across Studio-owned Markdown surfaces, and copy buttons for code blocks and blockquotes; Mermaid previews include Lucide/Logos icon nodes and accessible label contrast over custom fills
|
|
57
|
+
- Renders Markdown/LaTeX/code previews (math + Mermaid) plus lightweight CSV/TSV table previews, theme-synced with pi, with an explicit H1–H6 hierarchy, zoomable images across Studio-owned Markdown surfaces, and copy buttons for code blocks and blockquotes; already allowed local media loads silently, while blocked images and embedded PDFs remain unloaded behind an explicit per-file or containing-folder allow action; Mermaid previews include Lucide/Logos icon nodes and accessible label contrast over custom fills
|
|
58
58
|
- Adds a contextual **Editor (Quarto Preview)** right-pane view for file-backed `.qmd`, `.md`, and `.markdown` documents. Studio checks Quarto and the document/project configuration before showing an explicit start action, launches a single loopback `quarto preview` process with `--no-execute`, embeds Quarto's authoritative saved-file output without restyling it, and provides open-in-browser, restart, stop, logs, and unsaved-editor warnings. If Quarto is missing, the view remains available with an actionable dependency message.
|
|
59
59
|
- Renders straight, unfenced interactive HTML in preview via a sandboxed browser iframe with zoom controls, while fenced `html` blocks remain source code
|
|
60
60
|
- Embeds local PDFs in Studio Markdown previews via explicit `studio-pdf` fenced blocks and opens existing PDFs directly with `/studio <path.pdf>`, with visible enlarge, browser-tab, system-viewer, show-in-folder, copy-path, manual refresh, and opt-in stable-file auto-refresh actions; true browser fullscreen is offered only when the browser supports it
|
|
@@ -113,10 +113,10 @@ Open **Review → Side question**, select **Side questions** in the right pane,
|
|
|
113
113
|
- **Starting text** controls what unsaved text begins the thread. The compact **Automatic: selection → heading block at cursor → nearby text** disclosure explains the fallback order; when expanded, it defines the heading boundary. The summary below reports the resolved starting text, editor line range when applicable, and character count separately from the related-file scope.
|
|
114
114
|
- Explicit **Editor selection only** no longer falls back to the whole document when no text is selected; the summary instead reports that no editor text is selected.
|
|
115
115
|
- In the initial-question and follow-up boxes, **Cmd/Ctrl+Enter** submits while plain **Enter** adds a new line. The button remains available for pointer and ordinary keyboard activation.
|
|
116
|
-
- **Also use files from** controls the read-only boundary available to the side agent: no other files, the document folder, the current repository, or another chosen folder.
|
|
116
|
+
- **Also use files from** controls the read-only boundary available to the side agent: no other files, the document folder, the current repository, or another chosen folder. Related-file access requires an allowed folder for the current Studio session; if the selected root is not already allowed, Studio names the canonical folder and asks before starting the thread. An exact-file grant never exposes its parent folder.
|
|
117
117
|
- With **Repository** selected, **Include Git context** can capture status, staged and unstaged tracked-file changes, and up to 20 recent commit summaries. The bounded snapshot is frozen when the thread starts and exposed through fixed read-only tools; untracked contents remain available only through the existing root-confined file reader.
|
|
118
118
|
- **Include the current main conversation snapshot** is opt-in. Side questions and answers otherwise never enter the main Pi history; **Bring to main conversation** is the explicit handoff.
|
|
119
|
-
- Local context tools can map filenames, search readable text, and read selected ranges.
|
|
119
|
+
- Local context tools can map filenames, search readable text, and read selected ranges. Studio revalidates the allowed context root before prompts and built-in local tool calls; symlinks, root replacement, and traversal outside that root are rejected. PDF extraction uses `pdftotext`; DOCX, ODT, and EPUB extraction uses Pandoc.
|
|
120
120
|
- **Allow web search** is opt-in and appears when `BRAVE_API_KEY` is available to the Pi process. Model-chosen search queries are sent to Brave Search; the side agent is instructed not to copy private local passages into queries. Web answers cite result URLs and identify when they rely on search-result snippets rather than full page content.
|
|
121
121
|
- **Additional Pi tools** lists eligible tools already registered by the user's installed Pi extensions. Selection is explicit, remembered locally, and frozen when the thread starts. Studio reloads only the extensions owning the selected tools into the isolated side runtime and activates only those tool names; it does not import or depend on any particular third-party extension. Gateway tools are labelled and require an additional confirmation because selecting one may expose further services configured behind it.
|
|
122
122
|
|
|
@@ -124,7 +124,9 @@ The current side thread is ephemeral but survives Studio browser refreshes while
|
|
|
124
124
|
|
|
125
125
|
## Studio Markdown extras
|
|
126
126
|
|
|
127
|
-
Studio previews standard Markdown, code fences, display math, Mermaid, and local images.
|
|
127
|
+
Studio previews standard Markdown, code fences, display math, Mermaid, and local images. The opened document directory and other explicitly allowed folders are available for local preview resources during the current Studio session. Media already inside those locations loads without interruption. An image or embedded PDF outside them stays unloaded and shows **Allow local image/PDF…**; activating that control offers an exact-file grant, a containing-folder grant for the session, or cancellation. Passive rendering itself never opens the permission decision.
|
|
128
|
+
|
|
129
|
+
When adding companion files such as generated plots or PDFs, prefer the project's existing folder convention. If there is no convention, `attachments/` is a reasonable default for newly generated assets. Use relative paths from the opened Markdown file or a folder allowed for the current Studio session, and wrap paths in angle brackets when spaces are possible:
|
|
128
130
|
|
|
129
131
|
```md
|
|
130
132
|

|
|
@@ -143,7 +145,7 @@ caption: Optional caption
|
|
|
143
145
|
```
|
|
144
146
|
````
|
|
145
147
|
|
|
146
|
-
`path` must point to a local `.pdf
|
|
148
|
+
`path` must point to a local `.pdf`. Relative paths resolve from the opened document's directory, or from Studio's working directory for non-file-backed content; the resolved file must be inside a location allowed for the current Studio session before it loads. `page` is an initial page hint for the browser PDF viewer, `height` controls the embedded frame height in pixels, and `watch: true` enables auto-refresh after Studio observes the changed file in a stable state. Use normal Markdown links for PDFs when embedding is not useful.
|
|
147
149
|
|
|
148
150
|
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.
|
|
149
151
|
|
package/ROADMAP.md
CHANGED
|
@@ -21,7 +21,7 @@ Each release should finish with:
|
|
|
21
21
|
|
|
22
22
|
Publishing, pushing, and tagging remain explicit release actions rather than automatic consequences of merging work.
|
|
23
23
|
|
|
24
|
-
## 0.9.52 — Rendering and media consistency
|
|
24
|
+
## 0.9.52 — Rendering and media consistency (shipped 2026-08-28)
|
|
25
25
|
|
|
26
26
|
A focused portability and affordance pass:
|
|
27
27
|
|
|
@@ -36,6 +36,8 @@ This release must not add Muxy-specific branches or attempt to instrument opaque
|
|
|
36
36
|
|
|
37
37
|
## 0.9.53 — Resource locations
|
|
38
38
|
|
|
39
|
+
Status: implementation and release-candidate validation complete; push, tag, and npm publication await explicit approval. The bounded canonical workspace registry now governs explicit local links, the Files view, passive images/PDFs, and Side questions' related-file roots.
|
|
40
|
+
|
|
39
41
|
Replace the single-root assumption with explicit resource grants:
|
|
40
42
|
|
|
41
43
|
- grant the current document directory automatically;
|
|
@@ -43,11 +45,22 @@ Replace the single-root assumption with explicit resource grants:
|
|
|
43
45
|
- keep grants session-scoped by default;
|
|
44
46
|
- store canonical server-side paths and retain traversal and symlink-escape checks;
|
|
45
47
|
- use the same grants for Markdown resources, local links, PDFs, Files view, and Side questions;
|
|
48
|
+
- keep passive local media unloaded without opening a permission decision, then offer the exact-file/folder choice only through an explicit blocked-media action;
|
|
46
49
|
- explain that paths, Finder/file-manager actions, and system viewers belong to the computer running Pi;
|
|
47
50
|
- offer **Allow this file**, **Allow this folder for this Studio session**, and **Cancel** when an explicit local link crosses the current boundary.
|
|
48
51
|
|
|
49
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.
|
|
50
53
|
|
|
54
|
+
## 0.9.54 — Disk-backed preview and safe save
|
|
55
|
+
|
|
56
|
+
Planned after resource locations stabilize:
|
|
57
|
+
|
|
58
|
+
- distinguish editable buffers, whose in-memory text drives Editor Preview, from read-only watched previews, whose file on disk is authoritative;
|
|
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;
|
|
60
|
+
- retain a canonical disk revision for file-backed editing, save directly with **Cmd/Ctrl+S** only while that revision still matches, and offer an explicit conflict decision when the file changed externally;
|
|
61
|
+
- add **Cmd/Ctrl+Shift+S** for Save As and keep autosave opt-in rather than default;
|
|
62
|
+
- carry the resulting disk identity and revision model forward into `StudioBufferStore`.
|
|
63
|
+
|
|
51
64
|
## 0.10.0 — Buffer-first editing
|
|
52
65
|
|
|
53
66
|
The first architectural `0.10` release should add:
|