pi-studio 0.9.55 → 0.9.57
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 +29 -0
- package/README.md +28 -2
- package/ROADMAP.md +31 -1
- package/client/studio-client.js +228 -50
- package/index.ts +914 -220
- package/package.json +1 -1
- package/shared/REPL_SESSION_RECORD_PROTOCOL.md +93 -0
- package/shared/repl-control-files.js +158 -0
- package/shared/repl-session-record.js +623 -0
- package/shared/repl-submission-display.js +227 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.57] — 2026-09-03
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Add deterministic raw-pane submission displays and alignment anchors for Studio browser and `studio_repl_send` submissions across Shell, Python/IPython, Julia, R, GHCi, and Clojure.
|
|
11
|
+
- Add a browser-stored **Pane echo** selector with privacy-conscious **Off** default, adaptive **Summary**, and bounded **Full** modes, plus per-tool `echoMode` and `PI_STUDIO_REPL_ECHO_MODE` support.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Keep ordinary panes quiet by default; opt-in Summary now shows short submissions in full, truncates longer ones after 6 lines or 600 source characters, and uses compact begin/completion anchors with a plain unanchored output divider instead of three metadata-heavy marker lines.
|
|
15
|
+
- Strip each request-specific header, source preview, divider, and footer from captured tool output and the Shared REPL Record while retaining the optional display in raw tmux history for human readability and future transcript alignment.
|
|
16
|
+
- Replace long per-request Studio loader paths with compact collision-resistant files under a private per-user `/tmp/pi-rc-<user-key>` root. Source files use mode `0600`; completed files are removed immediately, timeout/abort files remain only until the submission settles, and crash leftovers older than 24 hours are pruned on a later send.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Send GHCi completion signalling as a separate command so a submitted Haskell runtime error cannot prevent completion capture or leave the cross-client lease waiting until timeout.
|
|
20
|
+
- Persist a final clean-record error through the previously validated exact session identity when a Studio submission's tmux lifetime disappears before output capture, instead of leaving its sidecar entry stuck in `sending`.
|
|
21
|
+
- Strip the new compact loader path from browser-side optimistic capture as well as server capture, and stop later raw transcript refreshes from overwriting an authoritative finalized clean-record entry.
|
|
22
|
+
|
|
23
|
+
## [0.9.56] — 2026-09-02
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- 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.
|
|
27
|
+
- 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.
|
|
28
|
+
- 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.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
- 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.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- Prevent compatible Studio and `pi-repl` sends from concurrently attributing the same pane output to different entries.
|
|
35
|
+
|
|
7
36
|
## [0.9.55] — 2026-09-02
|
|
8
37
|
|
|
9
38
|
### Changed
|
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 **
|
|
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 privacy-conscious Off/Summary/Full pane-echo selector, 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, optionally choose its raw-pane `echoMode`, and add its captured output to the shared clean record. |
|
|
94
96
|
|
|
95
97
|
## Install
|
|
96
98
|
|
|
@@ -108,6 +110,30 @@ 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
|
+
### Submission display and alignment anchors
|
|
122
|
+
|
|
123
|
+
Optional pane echo places submitted code after a compact begin anchor, followed by a plain `── output ──` divider and a completion anchor. The anchors contain a stable 12-character hash derived from the Shared REPL Record entry ID, so compatible clients can align known sends in future derived transcripts without exposing the entry ID itself. Studio strips the exact header, source preview, divider, and footer from captured tool output and the clean record; they remain visible only in the raw pane/history.
|
|
124
|
+
|
|
125
|
+
The REPL footer selector offers:
|
|
126
|
+
|
|
127
|
+
- **Off** (default): no optional submission display or anchors; the runtime's unavoidable temporary-file control command can still be echoed by the REPL.
|
|
128
|
+
- **Summary**: short submissions in full, truncating after 6 lines or 600 source characters, with compact begin/end anchors and a plain output divider.
|
|
129
|
+
- **Full**: up to 40 lines or 4,000 source characters with the same anchors and divider. Full mode writes source code into persistent raw terminal history, so use it only when that is acceptable.
|
|
130
|
+
|
|
131
|
+
The browser choice is stored locally for that Studio origin. `studio_repl_send` accepts the same per-call `echoMode`; `PI_STUDIO_REPL_ECHO_MODE=off|summary|full` changes the tool-send startup default from Off. Display text escapes terminal, line-separator, and bidirectional control characters. The anchors improve raw-history alignment but do not make direct pane activity without instrumentation authoritative or alter protocol-v1 entries.
|
|
132
|
+
|
|
133
|
+
Runtime wrappers use compact request-unique paths such as `/tmp/pi-rc-<user-key>/<token>.py` rather than a long Studio/session directory tree. The per-user root is current-user-owned mode `0700`, source files are mode `0600`, and files are removed after capture or by the timeout/abort watcher once execution settles. This keeps the unavoidable echoed loader command short without reverting to a collision-prone shared filename.
|
|
134
|
+
|
|
135
|
+
See [`shared/REPL_SESSION_RECORD_PROTOCOL.md`](./shared/REPL_SESSION_RECORD_PROTOCOL.md) for protocol, safety, retention, and compatibility details.
|
|
136
|
+
|
|
111
137
|
## Side questions and research context
|
|
112
138
|
|
|
113
139
|
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:
|
|
@@ -187,7 +213,7 @@ Studio only passes icon-pack arguments when a diagram actually references `lucid
|
|
|
187
213
|
- Studio is designed as a complement to terminal pi, not a replacement.
|
|
188
214
|
- 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.
|
|
189
215
|
- 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.
|
|
190
|
-
- 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.
|
|
216
|
+
- 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 runtime completion signal appears or the exact tmux session ends. The visible request-specific completion anchor is separate presentation metadata and stays in raw history when pane echo is enabled.
|
|
191
217
|
- 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.
|
|
192
218
|
- Full preview/PDF quality depends on `pandoc` (and `xelatex` for PDF):
|
|
193
219
|
- `brew install pandoc`
|
package/ROADMAP.md
CHANGED
|
@@ -69,6 +69,34 @@ A browser-neutral UX pass before buffer-first work:
|
|
|
69
69
|
- normalize Studio buttons and dropdown controls across Chromium and WebKit without changing native select interaction;
|
|
70
70
|
- expose X-high and Max side-question thinking only when supported by the active model, while retaining Low as the default.
|
|
71
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
|
+
|
|
86
|
+
## 0.9.57 — REPL submission display and alignment anchors (shipped 2026-09-03)
|
|
87
|
+
|
|
88
|
+
A coordinated presentation and future-alignment increment with `pi-repl` 0.4.1:
|
|
89
|
+
|
|
90
|
+
- keep optional pane echo Off by default, with an adaptive Summary that shows short submissions in full and a separately bounded Full choice;
|
|
91
|
+
- derive collision-resistant human-readable anchors from immutable clean-record entry IDs without exposing those IDs in the pane;
|
|
92
|
+
- retain compact begin/completion anchors and a plain unanchored output divider in raw tmux history while stripping the exact header, source preview, divider, and footer from captured output and protocol-v1 records;
|
|
93
|
+
- sanitize terminal controls, cap all visible source previews, and warn that Full mode persists bounded source code in raw history;
|
|
94
|
+
- cover Shell, Python/IPython, Julia, R, GHCi, and Clojure consistently across browser and tool sends, including error, timeout, abort, and exact-session-disappearance paths;
|
|
95
|
+
- replace verbose or fixed loader paths in both clients with compact request-unique files in a private per-user control root, retaining files through timed-out/aborted execution and cleaning them when the submission settles;
|
|
96
|
+
- treat markers only as presentation and alignment evidence, never as authority for silently promoting inferred direct activity into the clean record.
|
|
97
|
+
|
|
98
|
+
A separate Derived REPL Transcript can use these anchors later, but it remains outside protocol v1 and outside this release.
|
|
99
|
+
|
|
72
100
|
## 0.10.0 — Buffer-first editing
|
|
73
101
|
|
|
74
102
|
The first architectural `0.10` release should add:
|
|
@@ -92,4 +120,6 @@ Cross-environment checks should cover, where relevant:
|
|
|
92
120
|
- local, SSH, and `--no-browser` Pi sessions;
|
|
93
121
|
- paths with spaces, Unicode, traversal attempts, and symlinks;
|
|
94
122
|
- supported and unavailable browser APIs;
|
|
95
|
-
- browser reconstruction, refresh recovery, and clean shutdown
|
|
123
|
+
- browser reconstruction, refresh recovery, and clean shutdown;
|
|
124
|
+
- 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;
|
|
125
|
+
- for REPL submission displays: Summary/Off/Full bounds, raw-versus-clean separation, stable cross-client anchors, compact private collision-resistant control files and cleanup, every supported runtime, runtime errors, timeout/abort lease retention, and exact-session disappearance.
|