pi-studio 0.9.54 → 0.9.56

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
@@ -4,6 +4,28 @@ All notable changes to `pi-studio` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.56] — 2026-09-02
8
+
9
+ ### Added
10
+ - Add a versioned, session-owned **Shared REPL Record** that synchronizes compatible-client code, notes, lifecycle state, and captured output bidirectionally with `pi-repl` while keeping both extensions independently usable.
11
+ - Discover records through first-writer-wins tmux metadata bound to the exact session ID and creation time, with private bounded snapshots, atomic locked updates, stale-lock recovery, and a cross-client send lease held through output capture; timed-out or aborted submissions keep that lease until the runtime completion marker or exact-session shutdown.
12
+ - Import legacy browser-local Studio REPL entries once by stable ID, propagate clear operations, expose shared record details through the browser and `studio_repl_status`, and document direct pane typing as raw-mirror-only activity.
13
+
14
+ ### Changed
15
+ - Rename the compact Studio journal and export surfaces from **Studio REPL Record** to **Shared REPL Record**, identify entry origins, and make browser Markdown output byte-for-byte consistent with the canonical protocol renderer.
16
+
17
+ ### Fixed
18
+ - Prevent compatible Studio and `pi-repl` sends from concurrently attributing the same pane output to different entries.
19
+
20
+ ## [0.9.55] — 2026-09-02
21
+
22
+ ### Changed
23
+ - Let side questions use **X-high** and **Max** thinking when the active model supports them, while retaining **Low** as the default.
24
+
25
+ ### Fixed
26
+ - Open watched previews launched from Files or local Studio links with the preview pane focused, matching `/studio --watch`, and label the exposed raw source clearly as read-only and disk-following.
27
+ - Normalize Studio buttons and dropdown select controls with flat browser-neutral styling and consistent chevrons instead of WebKit's native shaded controls.
28
+
7
29
  ## [0.9.54] — 2026-09-02
8
30
 
9
31
  ### Added
package/README.md CHANGED
@@ -39,7 +39,7 @@ _The video shows an earlier version of the Studio interface. The basic workflow
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
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
- - 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
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 **Shared REPL Record** of compatible-client submissions, 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
@@ -91,6 +91,8 @@ _The video shows an earlier version of the Studio interface. The basic workflow
91
91
  |---|---|
92
92
  | `studio_export_pdf` | Export direct Markdown/LaTeX, a local file, or the last model response to PDF. Defaults to writing a file without opening a viewer. |
93
93
  | `studio_export_html` | Export direct Markdown/LaTeX, a local file, or the last model response to standalone HTML. Defaults to writing a file without opening a viewer. |
94
+ | `studio_repl_status` | Inspect tmux-backed REPL sessions, including shared clean-record identity, compatible-client entries, and raw-mirror details. |
95
+ | `studio_repl_send` | Send code to a visible REPL under the cross-client send lease and add its captured output to the shared clean record. |
94
96
 
95
97
  ## Install
96
98
 
@@ -108,6 +110,16 @@ Run once without installing:
108
110
  pi -e https://github.com/omaclaren/pi-studio
109
111
  ```
110
112
 
113
+ ## Shared REPL record
114
+
115
+ Studio remains a standalone REPL client: it can create and use its own tmux sessions without `pi-repl`. When a compatible `pi-repl` installation uses the same tmux session, both clients automatically discover one session-owned clean record and see each other's code and captured output. No package imports or depends on the other.
116
+
117
+ Compatible clients publish a versioned opaque record ID in tmux and keep the bounded JSON record in a private per-user temporary directory. The record is tied to the exact tmux session ID and creation time, uses atomic locked updates, and serializes compatible sends from pre-capture through output capture so concurrent Studio and `pi-repl` submissions do not claim each other's output. Existing sessions attach lazily; Studio's legacy browser-local entries are imported once with stable IDs.
118
+
119
+ The clean record covers only submissions and notes whose boundaries a compatible client knows. Text typed directly into an attached tmux pane remains in the secondary raw pane/history mirror and is not presented as reliably parsed code/output. **Export record** produces a canonical Markdown representation with origin, mode, status, runtime, timestamp, and this limitation; PDF and HTML exports are derived from that Markdown.
120
+
121
+ See [`shared/REPL_SESSION_RECORD_PROTOCOL.md`](./shared/REPL_SESSION_RECORD_PROTOCOL.md) for protocol, safety, retention, and compatibility details.
122
+
111
123
  ## Side questions and research context
112
124
 
113
125
  Open **Review → Side question**, select **Side questions** in the right pane, or press **Cmd/Ctrl+Alt+Q**. A new side thread captures its starting text while keeping related-file access separate:
@@ -118,6 +130,7 @@ Open **Review → Side question**, select **Side questions** in the right pane,
118
130
  - **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.
119
131
  - 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.
120
132
  - **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.
133
+ - **Thinking** defaults to **Low** for quick asides. **X-high** and **Max** appear when the active model advertises support, for complex side questions where the extra latency is worthwhile.
121
134
  - 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.
122
135
  - **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.
123
136
  - **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.
@@ -151,7 +164,7 @@ caption: Optional caption
151
164
 
152
165
  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.
153
166
 
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.
167
+ 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 with the preview pane focused; leaving pane focus reveals the same disk-following text as **Source** with a visible **Read-only · follows disk** badge rather than as 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
168
 
156
169
  ### Mermaid icons
157
170
 
@@ -186,7 +199,7 @@ Studio only passes icon-pack arguments when a diagram actually references `lucid
186
199
  - Studio is designed as a complement to terminal pi, not a replacement.
187
200
  - Installing pi-studio makes the optional `pi-studio-dark` and `pi-studio-light` themes available in pi's theme selector; it does not change your active theme.
188
201
  - Editor/code font uses a best-effort terminal-monospace match when the current terminal config exposes it; set `PI_STUDIO_FONT_MONO` to force a specific CSS `font-family` stack. Use `PI_STUDIO_FONT_UI` or `PI_STUDIO_FONT_PROSE` to override the Studio UI or rendered-preview font stacks.
189
- - The optional REPL view requires `tmux`. Studio can start and stop Studio-owned `pi-studio-repl-*` sessions and can mirror detected `pi-repl-*` sessions, but it will not stop external `pi-repl-*` sessions.
202
+ - The optional REPL view requires `tmux`. Studio can start and stop Studio-owned `pi-studio-repl-*` sessions and can mirror detected `pi-repl-*` sessions, but it will not stop external `pi-repl-*` sessions. Compatible clients synchronize their clean record automatically; direct pane interaction remains available only in the raw mirror. A send timeout or tool abort does not stop submitted runtime code, so Studio keeps that session's cross-client lease until the completion marker appears or the exact tmux session ends.
190
203
  - Side-question web search requires `BRAVE_API_KEY`; without it, local and conversation context still work, and the web option is shown as unavailable. Side sub-sessions are deliberately read-only and can run independently while the main Pi agent is busy.
191
204
  - Full preview/PDF quality depends on `pandoc` (and `xelatex` for PDF):
192
205
  - `brew install pandoc`
package/ROADMAP.md CHANGED
@@ -61,6 +61,28 @@ Builds on the resource-location foundation:
61
61
  - add **Cmd/Ctrl+Shift+S** for Save As and keep autosave opt-in rather than default;
62
62
  - carry the resulting disk identity and revision model forward into `StudioBufferStore`.
63
63
 
64
+ ## 0.9.55 — Watched-preview and control polish (shipped 2026-09-02)
65
+
66
+ A browser-neutral UX pass before buffer-first work:
67
+
68
+ - focus followed previews on their rendered pane and label the exposed source as read-only and disk-following;
69
+ - normalize Studio buttons and dropdown controls across Chromium and WebKit without changing native select interaction;
70
+ - expose X-high and Max side-question thinking only when supported by the active model, while retaining Low as the default.
71
+
72
+ ## 0.9.56 — Shared REPL record (shipped 2026-09-02)
73
+
74
+ A coordinated interoperability release with `pi-repl` 0.4.0:
75
+
76
+ - make the clean structured record belong to the exact tmux session lifetime rather than one browser or extension;
77
+ - discover an opaque versioned record ID through first-writer-wins tmux metadata while keeping bounded content in private user-scoped sidecar storage;
78
+ - synchronize compatible submissions, literate notes, lifecycle status, captured output, clear operations, and bounded legacy Studio migration in both directions;
79
+ - hold one cross-client send lease from pre-send capture through completion capture—including after caller timeout or abort—so compatible clients cannot claim each other's output;
80
+ - preserve raw pane/history output as the honest source for direct attached-pane activity rather than inferring unreliable semantic boundaries;
81
+ - keep Studio and `pi-repl` independently installable and usable, with graceful fallback for unavailable, malformed, stale, or unsupported shared records;
82
+ - produce one canonical Markdown representation across Studio and `pi-repl`.
83
+
84
+ This release does not change Studio's single-buffer architecture or move buffer-first work forward from `0.10.0`.
85
+
64
86
  ## 0.10.0 — Buffer-first editing
65
87
 
66
88
  The first architectural `0.10` release should add:
@@ -84,4 +106,5 @@ Cross-environment checks should cover, where relevant:
84
106
  - local, SSH, and `--no-browser` Pi sessions;
85
107
  - paths with spaces, Unicode, traversal attempts, and symlinks;
86
108
  - supported and unavailable browser APIs;
87
- - browser reconstruction, refresh recovery, and clean shutdown.
109
+ - browser reconstruction, refresh recovery, and clean shutdown;
110
+ - for shared REPL work: bidirectional visibility, compatible-client send contention, output attribution, restart persistence, clear/import behavior, stale or malformed records, and direct attached-pane activity.