pi-studio 0.9.63 → 0.10.1
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/BUFFER-DESIGN.md +197 -0
- package/CHANGELOG.md +31 -0
- package/PRERELEASE-CHECKLIST.md +100 -0
- package/README.md +110 -193
- package/ROADMAP.md +63 -6
- package/WORKFLOW.md +32 -2
- package/assets/screenshots/dark-workspace.png +0 -0
- package/assets/screenshots/light-workspace.png +0 -0
- package/assets/screenshots/theme-zen-code.png +0 -0
- package/client/studio-client.js +6694 -942
- package/client/studio-editor-draft-helpers.js +162 -0
- package/client/studio-navigation-helpers.js +31 -5
- package/client/studio.css +460 -12
- package/index.ts +1178 -79
- package/package.json +5 -3
- package/shared/STUDIO_BUFFER_FOUNDATION.md +164 -0
- package/shared/studio-buffer-client.js +663 -0
- package/shared/studio-buffer-decisions.js +129 -0
- package/shared/studio-buffer-lineage.js +48 -0
- package/shared/studio-buffer-recovery-panel.js +132 -0
- package/shared/studio-buffer-recovery.js +181 -0
- package/shared/studio-buffer-server.js +700 -0
- package/shared/studio-buffer-store.js +227 -0
- package/shared/studio-buffer-switching.js +53 -0
- package/shared/studio-disk-revisions.js +15 -0
- package/shared/studio-document-entrypoints.js +38 -0
- package/shared/studio-document-escrow.js +147 -0
- package/shared/studio-document-file-claims.js +215 -0
- package/shared/studio-document-host-client.js +268 -0
- package/shared/studio-document-hosting.js +319 -0
- package/shared/studio-document-launch-client.js +153 -0
- package/shared/studio-document-open-client.js +96 -0
- package/shared/studio-document-open-storage.js +21 -0
- package/shared/studio-document-paths.js +29 -0
- package/shared/studio-editor-mode.js +48 -0
- package/shared/studio-linked-reader-ui.js +232 -0
- package/shared/studio-linked-reader.js +110 -0
- package/shared/studio-metadata-write-order.js +35 -0
- package/shared/studio-read-only-media.js +24 -0
- package/shared/studio-resource-grants.js +3 -0
- package/shared/studio-run-lifecycle.js +47 -0
- package/shared/studio-system-theme.js +9 -0
- package/assets/screenshots/dark-code-mode.png +0 -0
- package/assets/screenshots/dark-critique.png +0 -0
- package/assets/screenshots/dark-fenced-code.png +0 -0
- package/assets/screenshots/dark-focus-mode.png +0 -0
- package/assets/screenshots/dark-julia-fenced.png +0 -0
- package/assets/screenshots/dark-math.png +0 -0
- package/assets/screenshots/dark-mermaid.png +0 -0
- package/assets/screenshots/dark-zen.png +0 -0
- package/assets/screenshots/light-code-mode.png +0 -0
- package/assets/screenshots/light-fenced-code.png +0 -0
- package/assets/screenshots/light-math.png +0 -0
package/README.md
CHANGED
|
@@ -1,212 +1,127 @@
|
|
|
1
1
|
# pi-studio
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
See [`ROADMAP.md`](./ROADMAP.md) for the current release plan.
|
|
6
|
-
|
|
7
|
-
## Quick demo
|
|
8
|
-
|
|
9
|
-
[Watch the 2-minute demo (MP4, 2x speed, no audio)](https://github.com/omaclaren/pi-studio/releases/latest/download/pi-studio-demo-2min.mp4)
|
|
10
|
-
|
|
11
|
-
_The video shows an earlier version of the Studio interface. The basic workflow is the same, but there have been minor UI changes since it was recorded; the screenshots show the more recent version._
|
|
3
|
+
A browser workspace for [Pi](https://pi.dev). Write and run prompts, read responses with rendered math and diagrams, edit and annotate documents, and follow what Pi is doing, side by side.
|
|
12
4
|
|
|
13
5
|
## Screenshots
|
|
14
6
|
|
|
15
|
-
**
|
|
16
|
-
|
|
17
|
-

|
|
18
|
-
|
|
19
|
-
**Light workspace**
|
|
20
|
-
|
|
21
|
-

|
|
22
|
-
|
|
23
|
-
**Zen mode**
|
|
24
|
-
|
|
25
|
-

|
|
26
|
-
|
|
27
|
-
**Zen mode with a custom theme and rendered code preview**
|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
## What it does
|
|
32
|
-
|
|
33
|
-
- Opens a two-pane browser workspace: **Editor** + **Response/Working/Editor Preview/Quarto Preview/Side questions**, side by side by default
|
|
34
|
-
- Lets you choose a persisted pane layout from **View → Workspace**: side by side, Editor above, or Response above; the same divider resizes width or height and either pane can still be focused independently
|
|
35
|
-
- Supports one canonical full Studio view per Pi session, plus additional editor-only companion views when you want extra editing/preview surfaces; editor-only views can also browse files and use the Studio REPL send controls without taking over the full Studio session view
|
|
36
|
-
- Includes a global **Zen** mode that hides the Studio header and secondary chrome without changing the current pane layout; the header can also be hidden independently and restored from the top-right edge
|
|
37
|
-
- 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
|
|
38
|
-
- Treats text copied from or staged in Pi's terminal input editor as a linked draft: ordinary Studio edits retain the link, and an accepted **Run editor text** clears the terminal draft only when it has not changed in the meantime; a confirmed **Clear Pi editor text…** action remains available explicitly
|
|
39
|
-
- 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.
|
|
40
|
-
- 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; optional browser-stored **Follow activity** (`Cmd/Ctrl+Option/Alt+A`; off by default under **View → Workspace**) switches to Working when the main Pi agent starts generating and to Response Preview when it completes, unless you manually choose another view during that request. When cycling response history, Working follows saved working details for the selected response when available, and `Cmd/Ctrl+Option/Alt+1–8` switches directly between right-pane views while `Cmd/Ctrl+Option/Alt+P` / `Cmd/Ctrl+Option/Alt+E` / `Cmd/Ctrl+Option/Alt+W` / `Cmd/Ctrl+Option/Alt+F` / `Cmd/Ctrl+Option/Alt+R` / `Cmd/Ctrl+Option/Alt+Q` keep quick mnemonic shortcuts for Response Preview, Editor Preview, Working, Files, REPL, and Side questions
|
|
41
|
-
- 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
|
|
42
|
-
- 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
|
|
43
|
-
- 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
|
|
44
|
-
- Includes an optional tmux-backed **REPL** view for Shell, Python, IPython, Julia, R, GHCi, and Clojure sessions, with a scoped **Quick send** composer (`Cmd/Ctrl+Enter`), Raw/Literate editor 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
|
|
45
|
-
- 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
|
|
46
|
-
- 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
|
|
47
|
-
- 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
|
|
48
|
-
- 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.
|
|
49
|
-
- 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
|
|
50
|
-
- 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
|
|
51
|
-
- 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
|
|
52
|
-
- Browses response history (`Prev/Next/Last`) and loads either:
|
|
53
|
-
- response text, with **Annotate response** (`Cmd/Ctrl+Option/Alt+Enter` from either main pane) also opening **Editor (Preview)**; add Shift (`Cmd/Ctrl+Option/Alt+Shift+Enter`) for **Load response into editor** without switching views (choose another view first if file-backed Quarto Preview is active)
|
|
54
|
-
- critique notes/full critique
|
|
55
|
-
- the prompt that generated a selected response
|
|
56
|
-
- Keeps the prompt → accepted Run → **Annotate response** loop confirmation-free when the submitted editor text is unchanged. **Annotate response** and **Load response into editor** ask before replacing unsubmitted edits or unsaved file changes; Cancel preserves the editor and its view so you can save or copy first. A failed submission or late acknowledgement cannot mark later typing as submitted, and sending file text does not save it. This bounded accepted-prompt baseline stays in page memory, is not restored after a page reload, and is separate from Pi-terminal draft cleanup.
|
|
57
|
-
- Supports an annotation workflow for `[an: ...]` markers:
|
|
58
|
-
- inserts/removes the annotated-reply header
|
|
59
|
-
- shows/hides annotation markers in preview
|
|
60
|
-
- strips markers before send (optional)
|
|
61
|
-
- saves `.annotated.md`
|
|
62
|
-
- 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
|
|
63
|
-
- 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.
|
|
64
|
-
- Renders straight, unfenced interactive HTML in preview via a sandboxed browser iframe with zoom controls, while fenced `html` blocks remain source code
|
|
65
|
-
- 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
|
|
66
|
-
- Ships optional `pi-studio-dark` and `pi-studio-light` themes tuned for Studio's browser workspace
|
|
67
|
-
- Exports right-pane preview as PDF (pandoc + LaTeX) or standalone HTML into the source file directory, Studio working directory, or Pi session directory; PDF export can open in a Studio preview tab or the default PDF viewer, and HTML export can open in the default browser or in a new Studio editor tab for inspection/commenting, while preserving authored HTML previews as HTML and rendering CSV/TSV editor previews as tables
|
|
68
|
-
- Exports local files headlessly via `/studio-pdf <path>` to `<name>.studio.pdf` or `/studio-html <path>` to `<name>.studio.html`; without a path, those commands export the last model response to a timestamped file. Agent tools `studio_export_pdf` and `studio_export_html` expose the same export pipeline for remote/Telegram-style sessions.
|
|
69
|
-
- Shows model/session/context usage in the footer, plus compact-context and active-theme controls
|
|
70
|
-
|
|
71
|
-
## Pi input-draft handoff
|
|
72
|
-
|
|
73
|
-
Tools such as [`pi-nvim-context`](https://github.com/omaclaren/pi-nvim-context) deliberately accumulate visible context in Pi's terminal input draft without submitting it. **Load from pi editor** (`Cmd/Ctrl+Shift+L`) copies that draft into Studio without clearing it and records only a transient SHA-256 fingerprint and byte length for the handoff—no additional snapshot copy beyond the text already in Studio. You can then edit the text freely in Studio.
|
|
74
|
-
|
|
75
|
-
When Pi accepts **Run editor text**, Studio clears the linked terminal draft only if its current fingerprint and byte length still match those captured at load time. Terminal typing, additional Neovim context, or another client changing the draft causes Studio to preserve it silently. A failed or rejected run also leaves it intact. **Send current text to Pi editor** establishes the same safe link, while **Clear Pi editor text…** provides a separate confirmed, unconditional cleanup action. Studio never clears terminal history or its own editor through this handoff.
|
|
76
|
-
|
|
77
|
-
## Commands
|
|
7
|
+
**The Prompt: a question, plus a section added from the Document, and its preview:**
|
|
78
8
|
|
|
79
|
-
|
|
80
|
-
|---|---|
|
|
81
|
-
| `/studio` | Open in Muxy or cmux when available, otherwise the system browser, with the last assistant response (fallback: blank) |
|
|
82
|
-
| `/studio <path>` | Open a text file in the editor, or a PDF in a read-only companion preview tab |
|
|
83
|
-
| `/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 |
|
|
84
|
-
| `/studio --last` | Force last response |
|
|
85
|
-
| `/studio --blank` | Force blank editor |
|
|
86
|
-
| `/studio --no-browser` | Start/print the Studio URL without opening a browser, useful for forwarded or phone/browser sessions |
|
|
87
|
-
| `/studio --port <port>` | Bind Studio to a fixed port instead of a random free port; the default host remains localhost |
|
|
88
|
-
| `/studio --listen-all` | Explicitly bind Studio to all IPv4 interfaces (`0.0.0.0`) for a container or trusted private-network workflow |
|
|
89
|
-
| `/studio --status` | Show studio server status, including its listening address |
|
|
90
|
-
| `/studio --stop` | Stop studio server |
|
|
91
|
-
| `/studio --help` | Show help |
|
|
92
|
-
| `/studio-replace [path\|--blank\|--last]` | Replace the current full Studio view with a new full Studio view |
|
|
93
|
-
| `/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 |
|
|
94
|
-
| `/studio-current <path>` | Load a file into currently open Studio tab(s) without opening a new browser window |
|
|
95
|
-
| `/studio-pdf [path] [options]` | Export a local file, or the last model response when no path is given, via the Studio PDF pipeline |
|
|
96
|
-
| `/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 |
|
|
97
|
-
|
|
98
|
-
## Agent tools
|
|
9
|
+

|
|
99
10
|
|
|
100
|
-
|
|
101
|
-
|---|---|
|
|
102
|
-
| `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. |
|
|
103
|
-
| `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. |
|
|
104
|
-
| `studio_repl_status` | Inspect tmux-backed REPL sessions, including shared clean-record identity, compatible-client entries, and raw-mirror details. |
|
|
105
|
-
| `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. |
|
|
11
|
+
**The Document: the file you're working on, with its preview:**
|
|
106
12
|
|
|
107
|
-
|
|
13
|
+

|
|
108
14
|
|
|
109
|
-
|
|
110
|
-
# npm
|
|
111
|
-
pi install npm:pi-studio
|
|
15
|
+
**Zen mode, on the code (rose-pine-dawn theme):**
|
|
112
16
|
|
|
113
|
-
|
|
114
|
-
pi install https://github.com/omaclaren/pi-studio
|
|
115
|
-
```
|
|
17
|
+

|
|
116
18
|
|
|
117
|
-
|
|
19
|
+
There's also a [2-minute demo](https://github.com/omaclaren/pi-studio/releases/latest/download/pi-studio-demo-2min.mp4) (MP4, 2x speed, no audio) of an earlier version; the workflow is the same.
|
|
118
20
|
|
|
119
|
-
|
|
120
|
-
pi -e https://github.com/omaclaren/pi-studio
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Container and network access
|
|
124
|
-
|
|
125
|
-
Studio binds to `127.0.0.1` by default. For a container or sandbox whose port must be published to the host, opt in explicitly and choose a stable port:
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
/studio --no-browser --listen-all --port 4321
|
|
129
|
-
```
|
|
21
|
+
## Features
|
|
130
22
|
|
|
131
|
-
|
|
23
|
+
- **Prompt and Document** — the default, dual editor mode. The Prompt holds what you send to Pi; the Document holds the file you're working on. Each keeps its own edits, preview and place. See [Single and dual editor mode](#single-and-dual-editor-mode).
|
|
24
|
+
- **Run, critique, annotate** — run the Prompt, ask for a critique, or annotate a response with `[an: ...]` markers and send it back.
|
|
25
|
+
- **Response history** — step back through earlier responses, and load a response, its critique or the prompt that produced it.
|
|
26
|
+
- **Working** — follow Pi's thinking and tool use as it happens. **Follow activity** switches to it during a run and back to the response afterwards.
|
|
27
|
+
- **Rendering** — Markdown and LaTeX with math, syntax highlighting, Mermaid diagrams (with Lucide and Logos icons), CSV tables, interactive HTML and embedded PDFs, themed to match Pi.
|
|
28
|
+
- **Files and Changes** — browse folders you've allowed, open or preview files, and see the current git diff.
|
|
29
|
+
- **Comments and scratchpad** — comments anchored to lines or selections, and a scratchpad per document.
|
|
30
|
+
- **Side questions** — ask about the text, a folder or the repository in a separate thread that stays out of the main conversation, optionally with web search.
|
|
31
|
+
- **REPL** — send code to tmux-backed Shell, Python, IPython, Julia, R, GHCi or Clojure sessions, shared with [pi-repl](https://github.com/omaclaren/pi-repl).
|
|
32
|
+
- **Quiz me, Show me, completions** — active-recall quizzes over the text or a folder, one-turn visual explanations, and short completions at the cursor.
|
|
33
|
+
- **Export** — PDF (Pandoc and LaTeX) or standalone HTML, from the preview, a file or the last response.
|
|
34
|
+
- **Careful saving** — a save checks the file hasn't changed on disk since you opened it, and asks if it has.
|
|
35
|
+
- **Quarto** — preview a saved Quarto document through `quarto preview`, without running its code.
|
|
36
|
+
- **Layout** — side by side or stacked panes, and a Zen mode that hides everything but the text.
|
|
132
37
|
|
|
133
|
-
|
|
38
|
+
## Requirements
|
|
134
39
|
|
|
135
|
-
|
|
40
|
+
- [Pi](https://pi.dev)
|
|
41
|
+
- [Pandoc](https://pandoc.org/installing.html) for full previews and exports (`brew install pandoc` on macOS), and LaTeX (TeX Live or MacTeX) for PDF export
|
|
42
|
+
- Optional:
|
|
43
|
+
- `tmux` for the REPL;
|
|
44
|
+
- `quarto` for Quarto previews;
|
|
45
|
+
- Mermaid CLI 11.12+ for diagrams in exported PDFs;
|
|
46
|
+
- `pdftotext` so side questions can read PDFs;
|
|
47
|
+
- `BRAVE_API_KEY` for side-question web search.
|
|
136
48
|
|
|
137
|
-
Studio
|
|
49
|
+
Studio is developed on macOS. It should work on Linux, which has had less testing.
|
|
138
50
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
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.
|
|
142
|
-
|
|
143
|
-
**Quick send** is a small command composer beneath the Shared REPL Record and above the secondary raw mirror, not a second persistent editor or terminal emulator. Its compact target shows the selected session name and doubles as a link back to the session controls; the hover and accessibility label retain the runtime and exact tmux pane details. Plain Enter adds a line, and `Cmd/Ctrl+Enter` submits the exact text through the same cross-client lease, control-file, and Shared REPL Record path as editor sends. Unsaved drafts stay in browser memory per exact tmux lifetime/runtime, survive session switching, and clear only after Studio acknowledges the submission; rejected text remains available to edit or retry.
|
|
144
|
-
|
|
145
|
-
### Submission display and alignment anchors
|
|
146
|
-
|
|
147
|
-
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.
|
|
51
|
+
## Install
|
|
148
52
|
|
|
149
|
-
|
|
53
|
+
```bash
|
|
54
|
+
pi install npm:pi-studio
|
|
55
|
+
```
|
|
150
56
|
|
|
151
|
-
|
|
152
|
-
- **Summary**: short submissions in full, truncating after 6 lines or 600 source characters, with compact begin/end anchors and a plain output divider.
|
|
153
|
-
- **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.
|
|
57
|
+
Or from GitHub, `pi install https://github.com/omaclaren/pi-studio`, or once without installing, `pi -e https://github.com/omaclaren/pi-studio`.
|
|
154
58
|
|
|
155
|
-
|
|
59
|
+
## Usage
|
|
156
60
|
|
|
157
|
-
|
|
61
|
+
| Command | Description |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `/studio` | Open Studio with the last response. In dual editor mode, reopen your last workspace if its tab is gone |
|
|
64
|
+
| `/studio <file>` | Open a text file, or a PDF in a read-only preview |
|
|
65
|
+
| `/studio --watch <file>` | Open a read-only preview that follows changes on disk |
|
|
66
|
+
| `/studio --blank`, `--last` | Start with a blank editor, or the last response |
|
|
67
|
+
| `/studio --single`, `--dual` | Switch editor mode, and remember it |
|
|
68
|
+
| `/studio --no-browser` | Print the URL without opening a browser |
|
|
69
|
+
| `/studio --port <port>` | Use a fixed port |
|
|
70
|
+
| `/studio --listen-all` | Listen on all interfaces, for containers ([see below](#network-and-ssh)) |
|
|
71
|
+
| `/studio --status`, `--stop` | Show the server's status, or stop it |
|
|
72
|
+
| `/studio-replace` | Replace the open Studio view. In dual editor mode, move it to a new tab here |
|
|
73
|
+
| `/studio-editor-only [file]` | Open an extra editor tab (single editor mode) |
|
|
74
|
+
| `/studio-current <file>` | Load a file into the open Studio tab (single editor mode) |
|
|
75
|
+
| `/studio-pdf [file]` | Export a file, or the last response, to PDF |
|
|
76
|
+
| `/studio-html [file]` | Export a file, or the last response, to HTML |
|
|
77
|
+
|
|
78
|
+
Studio opens in Muxy's or cmux's built-in browser when Pi runs there, and otherwise in the system browser. Press `?` in Studio for keyboard shortcuts.
|
|
79
|
+
|
|
80
|
+
Pi's agent can also use these tools:
|
|
158
81
|
|
|
159
|
-
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `studio_export_pdf`, `studio_export_html` | Export Markdown/LaTeX, a file or the last response |
|
|
85
|
+
| `studio_repl_status` | List REPL sessions |
|
|
86
|
+
| `studio_repl_send` | Send code to a REPL and record its output |
|
|
160
87
|
|
|
161
|
-
##
|
|
88
|
+
## Single and dual editor mode
|
|
162
89
|
|
|
163
|
-
|
|
90
|
+
**Dual editor mode** is the default. The left pane has a **Prompt**, which is what Run sends to Pi, and a **Document**, the file you're working on. Switch with the tabs or Cmd/Ctrl+Shift+1 and 2. Selecting the Document never changes what Run sends.
|
|
164
91
|
|
|
165
|
-
- **
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
- **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.
|
|
171
|
-
- **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.
|
|
172
|
-
- 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.
|
|
173
|
-
- **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.
|
|
174
|
-
- **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.
|
|
92
|
+
- **Add to Prompt** copies the Document's selection, or all of it, into the Prompt as a labelled snapshot, with Undo.
|
|
93
|
+
- **File** opens a file in the Document, or in a new Document window. Each file has one editor; opening a file that's already open finds that editor.
|
|
94
|
+
- Unsaved Prompt and Document text survives reloads and dropped connections. If you close the tab, `/studio` reopens the same workspace, asking first if the tab didn't close cleanly. This isn't a backup: save work you want to keep.
|
|
95
|
+
- If Studio opened somewhere you can't find, such as another browser, `/studio-replace` moves it here, or open its URL and choose **Move it here**.
|
|
96
|
+
- `/studio-current`, editable `/studio-editor-only` and Office-to-Markdown conversion aren't available in dual editor mode.
|
|
175
97
|
|
|
176
|
-
|
|
98
|
+
**Single editor mode** is the one-editor Studio of earlier versions, where Run sends the editor's text.
|
|
177
99
|
|
|
178
|
-
|
|
100
|
+
To switch, use the footer button or `/studio --single` and `/studio --dual`. Studio restarts and reopens the tab, carrying over the Prompt's text, and the choice is kept for your Pi profile. The footer button waits, and says why, while there's unsaved text in the Document or a closed Document window, another Studio tab is open, or a run, save or side question is in progress. The commands work even if the page won't load; they disconnect open tabs, which keep their text, and ask before dropping anything only Studio's server holds.
|
|
179
101
|
|
|
180
|
-
|
|
102
|
+
## Details
|
|
181
103
|
|
|
182
|
-
|
|
104
|
+
### Local files
|
|
183
105
|
|
|
184
|
-
|
|
185
|
-

|
|
186
|
-
```
|
|
106
|
+
Studio reads files in the opened document's folder and in folders you allow from **Files**. A link or image elsewhere asks first, offering that file or its folder, for the rest of the session.
|
|
187
107
|
|
|
188
|
-
|
|
108
|
+
Embed a PDF in a Markdown preview with a `studio-pdf` block. `path` is relative to the document; the other fields are optional:
|
|
189
109
|
|
|
190
110
|
````md
|
|
191
111
|
```studio-pdf
|
|
192
112
|
path: attachments/paper.pdf
|
|
193
|
-
title:
|
|
113
|
+
title: A title
|
|
194
114
|
page: 3
|
|
195
115
|
height: 760
|
|
196
116
|
watch: true
|
|
197
|
-
caption: Optional caption
|
|
198
117
|
```
|
|
199
118
|
````
|
|
200
119
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
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+Option/Alt+Shift+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.
|
|
204
|
-
|
|
205
|
-
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.
|
|
120
|
+
To view a PDF, run `/studio report.pdf`; it opens read-only, and `#page=N` picks the page. `/studio --watch report.pdf` also reloads it when the file changes: Studio waits for two matching file-version observations, so it doesn't read a PDF that LaTeX is still writing. This is distinct from `/studio-pdf`, which exports to a new PDF.
|
|
206
121
|
|
|
207
122
|
### Mermaid icons
|
|
208
123
|
|
|
209
|
-
|
|
124
|
+
Diagrams can use `lucide:*` and `logos:*` icons; the icon packs load only when a diagram uses them.
|
|
210
125
|
|
|
211
126
|
````md
|
|
212
127
|
```mermaid
|
|
@@ -217,40 +132,42 @@ flowchart LR
|
|
|
217
132
|
```
|
|
218
133
|
````
|
|
219
134
|
|
|
220
|
-
|
|
135
|
+
Icons in exported PDFs need Mermaid CLI 11.12+ (`npm install -g @mermaid-js/mermaid-cli`, or set `MERMAID_CLI_PATH`).
|
|
221
136
|
|
|
222
|
-
|
|
137
|
+
### Pi's input editor
|
|
223
138
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
139
|
+
**Load from pi editor** (Cmd/Ctrl+Shift+L) copies the draft in Pi's terminal input into Studio, as tools like [pi-nvim-context](https://github.com/omaclaren/pi-nvim-context) build it up. When Studio runs that text, it clears the terminal draft only if the draft hasn't changed since.
|
|
140
|
+
|
|
141
|
+
### REPL
|
|
142
|
+
|
|
143
|
+
The REPL pane runs code in tmux sessions. It can start its own, and it shares a record of submissions and output with [pi-repl](https://github.com/omaclaren/pi-repl) when both use the same session. Pane echo (Off, Summary, Full) controls how much submitted code appears in the raw tmux history; Full writes your code into that history. The record format is in [`shared/REPL_SESSION_RECORD_PROTOCOL.md`](./shared/REPL_SESSION_RECORD_PROTOCOL.md).
|
|
144
|
+
|
|
145
|
+
### Side questions
|
|
146
|
+
|
|
147
|
+
**Review → Side question**, or Cmd/Ctrl+Option/Alt+Q, opens a separate thread. It starts from the selection, the section at the cursor or the whole text, and can read the document's folder, the repository or another folder you allow, including PDF, DOCX, ODT and EPUB text. Its tools are read-only. With `BRAVE_API_KEY` set, it can also search the web; queries go to Brave Search. Nothing enters the main conversation unless you choose **Bring to main conversation**.
|
|
148
|
+
|
|
149
|
+
### Network and SSH
|
|
150
|
+
|
|
151
|
+
Studio listens on `127.0.0.1` only, and every URL carries a token. Over SSH, forward the port and open the printed URL with its token; `/studio --no-browser --port <port>` gives a stable port to forward.
|
|
152
|
+
|
|
153
|
+
For a container, `/studio --no-browser --listen-all --port 4321` listens on all interfaces. Anyone with the full URL can control Studio, including running prompts and reading or writing files, and there's no TLS. Treat the URL like a password, never expose the port to the internet, and bind the host side to loopback (`-p 127.0.0.1:4321:4321`). Quarto previews use a second port, which must be forwarded too.
|
|
154
|
+
|
|
155
|
+
### Environment variables
|
|
156
|
+
|
|
157
|
+
| Variable | Effect |
|
|
158
|
+
|---|---|
|
|
159
|
+
| `PANDOC_PATH`, `PANDOC_PDF_ENGINE` | Pandoc binary, and the LaTeX engine for PDFs (default `xelatex`) |
|
|
160
|
+
| `MERMAID_CLI_PATH` | Mermaid CLI for diagrams in PDFs |
|
|
161
|
+
| `BRAVE_API_KEY` | Enables web search in side questions |
|
|
162
|
+
| `PI_STUDIO_FONT_MONO`, `PI_STUDIO_FONT_UI`, `PI_STUDIO_FONT_PROSE` | CSS font stacks for code, interface and previews |
|
|
163
|
+
| `PI_STUDIO_REPL_ECHO_MODE` | Default pane echo for `studio_repl_send`: `off`, `summary` or `full` |
|
|
164
|
+
| `PI_STUDIO_PANDOC_TIMEOUT_MS`, `PI_STUDIO_LATEX_TIMEOUT_MS`, `PI_STUDIO_MERMAID_TIMEOUT_MS` | Export time limits |
|
|
228
165
|
|
|
229
|
-
|
|
166
|
+
Installing pi-studio also adds `pi-studio-dark` and `pi-studio-light` to Pi's themes, without changing your current theme.
|
|
230
167
|
|
|
231
168
|
## Acknowledgements
|
|
232
169
|
|
|
233
|
-
Thanks to [Hal Gumbert / CampSoftware](https://github.com/campsoftware) for
|
|
234
|
-
|
|
235
|
-
## Notes
|
|
236
|
-
|
|
237
|
-
- The Studio server is localhost-only (`127.0.0.1`) by default and every Studio URL carries a server-lifetime token. The explicit `--listen-all` option changes the listening address to `0.0.0.0` without changing the advertised loopback URL or removing token authentication; `/studio --status` reports the active binding.
|
|
238
|
-
- When Pi runs inside Muxy or cmux, Studio opens in that terminal app’s built-in browser. Muxy is detected from its pane/socket environment without installing global hooks; cmux targets and focuses the caller’s workspace. If the detected terminal browser is unavailable, disabled, or declines the request, Studio falls back once to the system browser.
|
|
239
|
-
- For remote SSH sessions, keep Studio bound to localhost and use SSH local port forwarding; `/studio` and `/studio --status` print the full tokenized localhost URL. The SSH hint repeats the full URL so it is visible even if your terminal only shows the latest notification. Open that URL through the tunnel, preserving the `?token=...` parameter. If SSH is not auto-detected, use `/studio --no-browser`; for stable forwarding, use `/studio --port <port>` or combine them, e.g. `/studio --no-browser --port 3417`.
|
|
240
|
-
- Full Studio is a singleton per Pi session: use `/studio` to open it, `/studio-replace` to explicitly replace it, and `/studio-editor-only` for extra editing/preview tabs that do not take over the full Studio session view.
|
|
241
|
-
- Studio is designed as a complement to terminal pi, not a replacement.
|
|
242
|
-
- 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.
|
|
243
|
-
- 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.
|
|
244
|
-
- 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.
|
|
245
|
-
- 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.
|
|
246
|
-
- Full preview/PDF quality depends on `pandoc` (and `xelatex` for PDF):
|
|
247
|
-
- `brew install pandoc`
|
|
248
|
-
- install TeX Live/MacTeX for PDF export
|
|
249
|
-
- LaTeX browser previews and **Export right preview** are semantic Pandoc conversions rather than authoritative compilation of the original source layout. If a local legacy `.sty` package overrides LaTeX document startup in a way that prevents Pandoc from reading the document, Studio omits that package from the conversion only, preserves local includes, and shows a warning; compile the original source directly with LaTeX for exact package-specific layout.
|
|
250
|
-
- **Editor (Quarto Preview)** is optional and requires the `quarto` CLI on Studio's `PATH`. It supports saved `.qmd`, `.md`, and `.markdown` files, whether standalone or part of a Quarto project. Selecting the view only inspects the saved document; starting the preview is explicit. Studio passes `--no-execute`, which prevents computational cells from running, but trusted Quarto project extensions, filters, configuration, and render hooks are still processed, and Quarto may create or update its normal rendered output files. The preview reflects disk, not unsaved editor text.
|
|
251
|
-
- Quarto serves its embedded page on a second random loopback port. When Studio itself is reached through SSH port forwarding, that Quarto port (shown in **Show log**) must also be forwarded, or the preview should be opened from a Studio process running on the browser's machine.
|
|
252
|
-
- Export subprocess timeouts default to bounded values and can be tuned with `PI_STUDIO_PANDOC_TIMEOUT_MS`, `PI_STUDIO_LATEX_TIMEOUT_MS`, `PI_STUDIO_MERMAID_TIMEOUT_MS`, and `PI_STUDIO_HTML_RENDER_OUTPUT_MAX_BYTES` for unusually large embedded-asset HTML exports.
|
|
253
|
-
- Mermaid diagrams in exported PDFs require Mermaid CLI (`mmdc` / `@mermaid-js/mermaid-cli`) when you want diagram blocks rendered as diagrams rather than left as code; PDF icon nodes require Mermaid CLI 11.12+.
|
|
170
|
+
Thanks to [Hal Gumbert / CampSoftware](https://github.com/campsoftware) for [Pi Studio Activity](https://campsoftware.com/blog/post.php?post=20260507-ai-ollama-pi-studio-activity), which inspired **Follow activity** and the stacked layouts.
|
|
254
171
|
|
|
255
172
|
## License
|
|
256
173
|
|
package/ROADMAP.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This is the current planning source of truth for Studio work. `NEXT-STAGE.md` is historical; `TODO.md` tracks smaller backlog items that are not yet assigned to a release.
|
|
4
4
|
|
|
5
|
+
## Current status (14 Oct 2026)
|
|
6
|
+
|
|
7
|
+
`0.10.0` ships the buffer-first workspace as **dual editor mode** (Prompt and Document), on by default, with **single editor mode** one switch away (footer button, `/studio --single`). It went through real course use as private alpha candidates 49–69. The `PI_STUDIO_*` flags described further down are now development overrides only: when any is set it decides, and the mode switch is hidden. Fixes follow in `0.10.x`. The sections below are the history up to this point.
|
|
8
|
+
|
|
5
9
|
## Release approach
|
|
6
10
|
|
|
7
11
|
Studio development follows two tracks:
|
|
@@ -21,17 +25,64 @@ Each release should finish with:
|
|
|
21
25
|
|
|
22
26
|
Committing, publishing, pushing, and tagging remain explicit actions rather than automatic consequences of implementation or planning approval.
|
|
23
27
|
|
|
24
|
-
##
|
|
28
|
+
## Hosting candidate — 2026-09-27
|
|
29
|
+
|
|
30
|
+
The approved alpha now also includes single-owner Document hosting behind recovery + switching + `PI_STUDIO_DOCUMENT_HOSTING=1`. Move, detached copy, registered blank/text-file editors, existing-owner reuse and atomic file replacement are distinct; Prompt stays anchored. Retained save/metadata decisions, permission checks and uncertain-operation backups remain required. See [README](README.md#additional-opt-in-prototype-single-owner-document-hosting) for deliberate entrypoint restrictions. All flags remain off by default.
|
|
31
|
+
|
|
32
|
+
The source46 checkpoint passed998 full tests, TypeScript, all eight flag combinations and the bounded hosting workflows. Those are historical source-tree results, not a claim that the subsequent copy-warning fix or a new tarball is validated. Finish candidate-specific checks, dependency/content audits and private installation before any release decision. No feature expansion, publication, commit or normal-install change is authorized by this status update.
|
|
33
|
+
|
|
34
|
+
## Earlier toolbar follow-up — 2026-09-23
|
|
35
|
+
|
|
36
|
+
The first exact `0.10.0-alpha.1` artifact passed its fresh-install checks and was tried manually in an isolated runtime through Oliver's existing browser, without browser automation. He then approved a small UI cleanup: group **Add to Prompt → Selection / Whole document**, consolidate **Open / load** with explicit destinations/replacement descriptions, and remove permanent help and duplicate Run-target rows. Keep annotations, the fixed pair and all existing source/copy semantics. This follow-up is uncommitted; rebuild/recheck in new candidate-scoped evidence rather than changing the first tarball. No multiple-document or role-switching work, publication or normal-install change is authorized.
|
|
37
|
+
|
|
38
|
+
## Previous checkpoint — 2026-09-22
|
|
39
|
+
|
|
40
|
+
The opt-in **one Prompt ↔ one Document** runtime/tests are locally committed through `40d4462` on `feature/buffer-recovery-foundation`. Development remains in `pi-studio-buffer-dev`; the original checkout is frozen. Bounded local alpha preparation is approved, with unused version `0.10.0-alpha.1` selected after checking npm. The stable installation remains `0.9.60`. Documentation/package preparation is uncommitted; nothing from this branch has been published or enabled by default.
|
|
41
|
+
|
|
42
|
+
Implemented scope now includes:
|
|
43
|
+
|
|
44
|
+
- independent Prompt/Document editing, previews, temporary recovery and switching during an identified Run;
|
|
45
|
+
- explicit selection and whole-document snapshot appends, without saving, switching or submitting;
|
|
46
|
+
- guarded response/critique loading and a leading-only annotation header in opt-in Prompt, with copied body text left intact;
|
|
47
|
+
- fixes for stale file-open/grant decisions, mixed-input append activation, history rollover and separate response/Working reading positions;
|
|
48
|
+
- the latest fixes preserving an outstanding response-scroll reset across buffer switches and preventing a delayed numeric restore from being adopted by another view.
|
|
49
|
+
|
|
50
|
+
Whole-document and composed-Prompt hands-on trials, prepared-payload checks and rendered-preview checks have been completed. Later review findings were reproduced and fixed in separate local checkpoints. Validation of that committed checkpoint includes **718 recorded full-suite tests** on the same runtime/test bytes, plus **202 focused tests and normal typecheck/static checks freshly passed on 2026-09-20**. The latest browser groups cover **41 cases in Brave**, and the same 41 cases across **29 Chrome-app checks plus 12 Chrome Headless Shell 153 checks**. Those Chrome results span two variants, not one full Chrome-app run. The earlier Safari smoke covers the foundation, not the current switcher. No fresh-package or current live-provider release sign-off is implied.
|
|
51
|
+
|
|
52
|
+
The separate **immediate pane-pointer → view-change scroll race**, whose helper predates this branch, is fixed in approved local commit `40d4462`. Snapshots retain their DOM/view generation and, with recovery enabled, existing buffer/editor consent. Of 38 new VM cases, 29 failed before the fix and 9 controls passed; all 38 now pass. On 2026-09-21, dedicated **Chrome Headless Shell 153** confirmed both stale callback windows in default and two-buffer modes: the old client moves Working from 10259px to 0; the fixed client stays at 10259px. Settled/same-view controls and unaffected-source restoration pass. Timing uses trusted pane input plus deliberately scheduled programmatic view changes, not measured human timing. **240 focused tests, normal typecheck and syntax/whitespace/runtime-boundary checks** freshly pass. The full suite and supplemental check-JS were not rerun; the earlier supplemental baseline was 493 diagnostics, not a passing check.
|
|
53
|
+
|
|
54
|
+
Oliver's reported **Working appearing empty until interacted with** remains unreproduced and is not claimed fixed. Native view/buffer returns retained Working content and visible geometry; inspected screenshots show content before interaction. Headless Shell did not enter a hidden state during tab switching, so background-tab/visible-browser painting remains unverified. No rendering/CSS workaround was added. All six test attempts, including two retained harness-calibration failures, had backup-first disposal and verified process/port cleanup; 25 samples stayed at normal pressure with no per-trial swap growth. Evidence: `context/pane-scroll-native-20260921_225607/`.
|
|
55
|
+
|
|
56
|
+
## Next — bounded opt-in prerelease
|
|
57
|
+
|
|
58
|
+
Follow [PRERELEASE-CHECKLIST.md](PRERELEASE-CHECKLIST.md) for the approved local `0.10.0-alpha.1` preparation. This is a way to try the tested fixed-slot workflow, not a claim that the full architecture below is complete. Eventual npm publication would use `next` and needs separate approval.
|
|
59
|
+
|
|
60
|
+
1. The pane-scroll fix/tests are checkpointed. Keep the unreproduced blank-Working report open as a documented limitation, accepted for local preparation; publication still needs an explicit decision on the exact artifact and its limitations.
|
|
61
|
+
2. Align the public documentation and validate one exact package candidate: full tests, static/dependency checks, package-content/byte audit, isolated fresh installation and a short credential-free workflow smoke. Record fresh results separately from the historical counts above.
|
|
62
|
+
3. Keep recovery/switching/hosting opt-in and the normal `0.9.60` installation untouched. Further commits, publishing, pushing/tagging, live-provider trials, changing the installed source and default activation remain separate decisions.
|
|
63
|
+
|
|
64
|
+
Use a dedicated test-only browser with resource monitoring; do not run browser trials alongside full tests/typecheck on a constrained host. The existing suite includes a browser-launching test, so an unconfigured `npm test` is not a browser-free check. Do not begin another broad review loop unless a concrete finding changes the release decision.
|
|
65
|
+
|
|
66
|
+
After this bounded prerelease, the next proposed functional slice is explicit **Prompt-role switching between the existing buffers**, preserving the previous buffer. Prompt is a submission role an editable document can take; in-place annotation and making a detached prompt copy are distinct operations. This direction is not implemented or approved for execution. Keep annotation/comments in both roles and preserve editor space rather than adding toolbar rows. The separately approved third-flag scope above now covers single-owner Document handoff and independent editor hosts. Linked views, Prompt-role migration and parked prompts remain separate work, not additions to this alpha.
|
|
67
|
+
|
|
68
|
+
## Agreed architecture sequence (2026-09-07)
|
|
25
69
|
|
|
26
70
|
1. Ship **`0.9.60`** as the bounded networking/shortcut release. Do not start buffer architecture in this batch.
|
|
27
71
|
2. After that release, implement **`0.10.0`** around an explicit active Prompt, independently editable documents, context transfer, and parked prompt drafts. The design is in [`BUFFER-DESIGN.md`](https://github.com/omaclaren/pi-studio/blob/main/BUFFER-DESIGN.md).
|
|
28
72
|
3. Keep Derived REPL Transcript, editor-engine migration, and arbitrary pane arrangements outside both batches.
|
|
29
73
|
|
|
30
|
-
|
|
74
|
+
### Historical implementation milestones through 2026-09-11
|
|
75
|
+
|
|
76
|
+
The counts and pending steps below describe those earlier checkpoints; the current status and next actions are above.
|
|
31
77
|
|
|
32
78
|
- `0.9.60` combines the networking fix with Follow activity, Annotate response, and view-preserving Load response shortcuts, plus accurate draft-replacement protection. The published networking RC remains unchanged.
|
|
33
79
|
- The reporter has not replied to the RC invitation on [issue #4](https://github.com/omaclaren/pi-studio/issues/4) as of 2026-09-07. Exact `sbx` validation remains outstanding; the release proceeds with that limitation documented and the issue open for confirmation or a follow-up fix.
|
|
34
|
-
- `0.10.0`
|
|
80
|
+
- After releasing `0.9.60`, Oliver approved starting the `0.10.0` store/recovery foundation with the current UI unchanged. Stage 1a is implemented and tested. Stage 1b now has an isolated, development-flagged single-editor binding, acknowledged v2 server fallback, explicit recovery inspection/export/choice/retry, and locally completed callback/metadata ownership coverage. The isolated host matrix passes in Brave and Google Chrome, with the earlier targeted foundation matrix also passing Safari 26.5. Seven independent Codex safety findings and two later in-session Astra findings have been reproduced, fixed, and regression-tested. The latest fixes protect empty dirty-file comments-prompt replacement and prevent unread saved comments/scratchpads from being overwritten. All 432 tests and the expanded isolated Brave/Chrome checks pass. The current targeted Safari 26.5 smoke also passes after Allow Remote Automation was re-enabled. Oliver approved a local checkpoint commit on `feature/buffer-recovery-foundation` on 2026-09-09. Recovery remains opt-in; default activation, source switching and release still require separate explicit approval.
|
|
81
|
+
|
|
82
|
+
- On 2026-09-09, after the local foundation/header checkpoints and visual guide, Oliver approved a small **Prompt ↔ one document** prototype. It is now implemented locally under a second `PI_STUDIO_BUFFER_SWITCHING=1` flag, requiring recovery and a full editable workspace. All **472 tests**, static checks, and isolated Brave/Chrome switching and foundation-only workflows pass. After the first hands-on trial, a fresh read-only review identified held-Enter submission and queued-Follow defects; both were reproduced and fixed with unit/native regressions. This increment is a local, unreleased checkpoint; installed Studio and defaults remain untouched. General tabs, context transfer and parked drafts are still future work.
|
|
83
|
+
- On 2026-09-10, following the successful isolated hands-on/live-model trial, Oliver approved allowing existing-buffer selection during an identified direct Run. This follow-up is implemented as a local, unreleased checkpoint. It keeps local save/open/recovery locks, submitted-Prompt identity and global Stop; queues completion for Prompt, preserves Document's live preview and rejects stale failure settlement. A fresh read-only review found a queued response surviving an empty tree change and hidden activity ownership surviving a disabled policy. Both were reproduced, then fixed with separate approval and failing regressions first. All **500 tests** and isolated Brave/Chrome Run-switching/regression checks pass. These last two fixes used controlled browser events. The resulting checkpoint subsequently passed an isolated live-model hands-on trial; Oliver confirmed the interaction worked and approved backing up/stopping that trial. Further checkpoint/release/installation changes remain separate decisions.
|
|
84
|
+
- Oliver then separately approved **Add selection to Prompt**, limited to Document editor selections. It is a separately approved local, unreleased checkpoint, with **522 tests /80 focused tests** and credential-free Brave/Chrome checks. The action appends a labelled in-memory snapshot without changing Document, replacing existing Prompt content, transferring metadata/resource authority, saving files or submitting. It stays in Document and can prepare the next draft during an identified Run. A fresh read-only review found a literal-label boundary defect and a held press surviving selection A→B→A. Both were reproduced, then fixed with separate approval and failing regressions first. The actual label failure is reachable through a trailing-backtick imported filename; the reviewer's leading-backtick image example did not reproduce. Nine fix cases and eleven existing selection groups per browser, plus ten prior compatibility runs, pass. Preview/companion copying and general tabs remain deferred; no provider trial or independent post-fix sign-off is claimed for this slice. The committed selection slice subsequently passed Oliver's credential-free hands-on trial; both drafts were backed up before stopping.
|
|
85
|
+
- Oliver separately approved the scoped **Add document to Prompt** follow-up. It is a local, unreleased checkpoint, with **549 tests /107 focused tests** and twenty sequential credential-free Brave/Chrome runs passing. It adds the full in-memory Document from raw-editor view without requiring/changing selection, preserves Prompt text and both buffer owners, displays exact addition/capacity counts, and retains the identified-Run and local-operation safeguards. Eighteen new regressions failed before implementation. A fresh read-only review then found stale-open control state and cancelled-press issues; both were reproduced in Brave/Chrome and fixed with separate approval, adding nine regressions. Native overlap testing also covered completed Space-key cancellation. Click-only assistive activation was simulated, not tested through VoiceOver. At this checkpoint, post-fix review and a hands-on trial were still pending. Subsequent trials, reviews and fixes are reflected in the current checkpoint above; installation/default changes and release remain unapproved.
|
|
35
86
|
|
|
36
87
|
## 0.9.52 — Rendering and media consistency (shipped 2026-08-28)
|
|
37
88
|
|
|
@@ -163,17 +214,23 @@ The networking review and production lifecycle tests support the reported fix; a
|
|
|
163
214
|
|
|
164
215
|
Do not include buffer tabs, context-transfer messages, recovery schema v2, or REPL transcript work in this release.
|
|
165
216
|
|
|
166
|
-
## 0.10.0 — Active Prompt and editable document buffers
|
|
217
|
+
## 0.10.0 — Active Prompt and editable document buffers
|
|
218
|
+
|
|
219
|
+
The first opt-in prerelease is limited to the current two-buffer workflow. The wider architecture and acceptance scenarios remain the target for the full release; see the [prerelease checklist](PRERELEASE-CHECKLIST.md) for the smaller candidate's gates.
|
|
220
|
+
|
|
221
|
+
The local foundation includes the browser-safe store/codec/migration modules plus a `PI_STUDIO_BUFFER_RECOVERY=1` single-editor/server integration, available through the explicit process-scoped recovery flag. With switching off, the default v1 recovery path, successful editor layout, Run's visible-text destination, and browser-opening actions remain unchanged. Native isolated production tests cover reload, file baselines, metadata persistence/ordering, local-resource grants, PDF focus replacement, comments-prompt consent, late save/refresh, reconnect ownership, independent editors/disk conflicts, watched-to-editable browser tabs, reset retention and startup typing. The opt-in **Source & context → Recover unsaved text…** action inspects/exports retained copies, prepares verified fresh namespaces for explicit recovery/reset, and retries current-text persistence without adopting another branch. Focused ownership regressions now cover completion/import/Pi-editor loads, committed preview DOM and focus actions, Quarto request sources, metadata associations, failed writes, unload beacons and initialization/reset races. Metadata POSTs retain only one in-flight and one latest snapshot per key, time out conservatively, preserve intervening autosave timers, and advance same-writer server ordering only after the persistent-state write succeeds. The opt-in comments-prompt action also protects empty or unknown-baseline file edits and rechecks the captured disk baseline/revision after confirmation. Comments and scratchpad editing/persistence wait for the first successful per-document read; failed, malformed or timed-out reads stay protected and reopening the panel retries. Previously loaded page-local notes remain editable during refresh. Additional native regressions cover corrupt/unscoped copies, stale consent, full exports, server-only recovery, reconnect, failed refresh, pending/failed metadata reads and preserved saved notes. See [the foundation contract](shared/STUDIO_BUFFER_FOUNDATION.md) for contracts and the separate switching opt-in. This remains unreleased, not default activation or the complete `0.10.0` architecture.
|
|
222
|
+
|
|
223
|
+
The current second-flag prototype has two fixed entries, **Prompt** and **Document**, not a general tab manager. A fresh/v1 file-backed editor remains the Prompt; older v2 roles require an explicit choice. Opening a separate document preserves the Prompt; Files also offers explicit **Use as Prompt…**. Document view returns to Prompt without sending, including under held Enter; a distinct activation sends its visible text. Both buffers retain independent text, baselines, metadata and reading positions through switching/reload. A Follow-on Prompt catches up with a queued response on return without reusing the old response's scroll offset; paused reading remains preserved. An identified connected direct Run permits selecting kept buffers, without relaxing local save/open/recovery or unresolved Pi-draft locks. Stop remains global; Return through the Prompt tab or Run shortcut does not submit or cancel. Completed responses wait for Prompt's Follow setting, and history notifications do not reconstruct Document's live preview. Local mutating operations still gate switching; stale file reads and background responses cannot replace another buffer or steal its view. Recovery retains the pair, and Reset confirms both. Local selection and whole-document actions now append explicit Document editor snapshots to Prompt; neither copies rendered previews or performs companion handoff. Parked drafts and close/add navigation are not implemented. Review this interaction before expanding the UI; see [the current prototype scope](BUFFER-DESIGN.md#current-prototype--before-general-tabs).
|
|
167
224
|
|
|
168
225
|
Studio's primary loop is prompt construction and response reading. Documents remain useful editable sources, not implicit submission targets or a replacement for Neovim. The design is **one clearly active Prompt, other prompt drafts that can be parked, and independently editable documents**.
|
|
169
226
|
|
|
170
|
-
The
|
|
227
|
+
The full architectural release—not the first opt-in alpha—should add:
|
|
171
228
|
|
|
172
229
|
- a `StudioBufferStore` with stable buffer identity, explicit prompt/document roles, and separate selected-buffer and active-prompt identities;
|
|
173
230
|
- a prominent **Prompt** view with response/Working alongside it, plus editable document tabs with their own previews;
|
|
174
231
|
- recovery schema v2 with non-destructive migration from the single-document schema;
|
|
175
232
|
- buffer-specific text/baseline, dirty state, cursor, selection, scroll, preview context, annotations, and resource directory, preserving existing disk-revision checks;
|
|
176
|
-
- **Add selection to
|
|
233
|
+
- **Add selection to Prompt** and **Add document to Prompt**, including an acknowledged handoff from editable companion views to the full workspace's explicit prompt destination;
|
|
177
234
|
- editable context snapshots of the visible text, including unsaved edits and source labels/ranges where known; no automatic submission, replacement, file write, or later live update of the copied text;
|
|
178
235
|
- a lightweight parked-prompt picker, with one active submission draft at a time and no per-draft conversation forks;
|
|
179
236
|
- tabs at ordinary widths, a compact searchable picker at narrow widths, and MRU/next/previous/close/reopen navigation;
|
package/WORKFLOW.md
CHANGED
|
@@ -19,7 +19,7 @@ Studio uses a **single workspace**:
|
|
|
19
19
|
|
|
20
20
|
## 1) Insert annotated reply header (optional prep)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Toggles an `annotated-reply` compatible scaffold in the editor. Studio's generated opener and metadata wording remain unchanged:
|
|
23
23
|
|
|
24
24
|
```md
|
|
25
25
|
annotated reply: below
|
|
@@ -35,6 +35,36 @@ annotated reply: below
|
|
|
35
35
|
|
|
36
36
|
Studio does **not** auto-send this scaffold; it is an explicit editor transform.
|
|
37
37
|
|
|
38
|
+
### Header recognition contract (local compatibility work; not yet released)
|
|
39
|
+
|
|
40
|
+
The parser accepts these **whole first lines**, case-insensitively:
|
|
41
|
+
|
|
42
|
+
- `annotations below`
|
|
43
|
+
- `annotations below:`
|
|
44
|
+
- `annotated reply: below`
|
|
45
|
+
- `annotated reply below:`
|
|
46
|
+
|
|
47
|
+
Each opener works with the known minimal Neovim block, the full Studio bullet metadata above, or the older plain metadata layout (`original source`, `user annotation syntax`, optional `precedence`, without bullet prefixes or a blank line after the opener). Bullet layouts require a blank line after the opener. Metadata order and the known syntax/precedence wording must match; arbitrary edited instructions are not silently consumed. The accepted syntax examples are `[an: note]` / `[an: your note]`, optionally backticked; the backticked form may carry Neovim's parenthetical below. Full legacy headers remain recognisable when **Strip annotations…** has removed their unbackticked hint.
|
|
48
|
+
|
|
49
|
+
The minimal Neovim block is:
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
annotations below
|
|
53
|
+
|
|
54
|
+
- user annotation syntax: `[an: note]` (user comments on the accompanying selections)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
All layouts require a blank line before the exact `---` divider and a blank line after it. LF and CRLF are accepted without normalising or trimming the remaining body. Source/precedence lines and a footer are not required for the minimal form, whose entire remaining text is body. A backticked syntax example is not an annotation.
|
|
61
|
+
|
|
62
|
+
Detection, toolbar summaries, toggling and header removal share the same parser. Prose mentions, opener prefixes, quoted/indented/fenced examples, and arbitrary later dividers do not count. An exact opener with an unknown or malformed following block prompts a warning and leaves the editor unchanged rather than adding a duplicate header.
|
|
63
|
+
|
|
64
|
+
Full source-bearing legacy wrappers retain their optional footer convention: only the exact terminal `\n\n--- end annotations ---\n\n` suffix (or its all-CRLF equivalent), outside a Markdown backtick/tilde fence, is removed. Quoted/indented/prose marker text and extra trailing whitespace are preserved. Minimal headers never remove a footer. Inserting Studio's usual wrapper preserves any pre-existing body marker; its generated footer is omitted if it would fall inside an unclosed fence, so toggling still preserves the body.
|
|
65
|
+
|
|
66
|
+
This compatibility change does not switch the installed Studio version or change Neovim's emitted wording. Deployment/release is a separate decision.
|
|
67
|
+
|
|
38
68
|
## 2) Run editor text (plain send)
|
|
39
69
|
|
|
40
70
|
Sends current editor text to the model. If `Annotations: Hidden`, `[an: ...]` markers are stripped before send.
|
|
@@ -111,7 +141,7 @@ Rules of thumb:
|
|
|
111
141
|
|
|
112
142
|
1. `/studio --last` opens with editor loaded and no required mode selection.
|
|
113
143
|
2. **Run editor text** respects annotation mode (`On` send as-is, `Off` strip `[an: ...]`) and returns response to right pane.
|
|
114
|
-
3. **
|
|
144
|
+
3. **Annotation header** recognises all supported openers without duplication; toggling preserves the body and refuses malformed leading header blocks.
|
|
115
145
|
4. **Critique editor text** runs on current editor text and returns structured package when model complies.
|
|
116
146
|
5. Structured critique helpers (`Load critique (notes)` / `Load critique (full)`) enable only when critique structure is present.
|
|
117
147
|
6. Loading response/critique back into editor never loses draft unexpectedly.
|