Repository navigation
Conversation
nwparker
force-pushed
the
nwparker/plugins-v2-18-custom-editors
branch
from
October 28, 2026 00:23
b4846e0 to
5663c36
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-16-ship-hardening
branch
from
October 28, 2026 04:59
3fb174f to
66f6cb3
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-18-custom-editors
branch
2 times, most recently
from
October 28, 2026 05:01
ba5e422 to
b48ffe9
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-16-ship-hardening
branch
from
October 28, 2026 05:31
66f6cb3 to
dca9872
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-18-custom-editors
branch
from
October 28, 2026 05:32
b48ffe9 to
de36e57
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-16-ship-hardening
branch
from
October 28, 2026 05:46
dca9872 to
c58df2c
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-18-custom-editors
branch
from
October 28, 2026 05:46
de36e57 to
7f05eec
Compare
A plugin can now declare contributes.customEditors to open files of given types in the editor tab, beside Source. The editor runs in the same sandboxed, no-network panel frame and only exchanges the document's text over a scoped postMessage channel; Orca keeps the buffer, dirty state, saving, external-change banner, read-only tabs and SSH files. The Editor | Source toggle and the 'first scene after load is the baseline' approach follow community PR #27413. Co-authored-by: Roughriver74 <[email protected]>
…itor frame names A theme change used to remount panel and custom editor frames, which reloaded the plugin and lost its state (Excalidraw undo, unsent edits). The host now posts orca-panel-theme and the shell updates the --orca-* tokens and the html class in place. Custom editor frames are named with a random id: window.name is readable inside the frame, and the old name carried the file's absolute path.
A custom editor can now declare "contentKind": "bytes" (with "readonly": true)
to receive the file's raw bytes instead of its text, for formats such as
spreadsheets. Orca pages the bytes from the host that loaded the tab (local,
SSH or a paired runtime, through the existing stat + readChunk calls, so no
wire change), refuses files over 16 MiB with a "too large to open" message,
re-sends on outside changes, and never applies a bytes editor's edits. The frame
gets a transferred ArrayBuffer and the matched suffix, never a path.
Documents are now versioned: { version, readOnly, content: { kind, ... } }.
Text edits may name a baseVersion; an edit against a replaced document is
refused with an orca-editor-edit-rejected conflict. Text documents keep the
legacy text field and unversioned edits still apply, so existing editors work.
"readonly": true on any editor makes the install review say "Opens .x files in
Orca" instead of "Opens and edits".
The file-type suggestion only offered a plugin when a file opened as plain text or as the binary placeholder. It now also offers a catalog custom editor for a file Orca shows with a language (an .excalidraw file opens as JSON): the editor asks main with the `editor` purpose, which matches only release file types the listing's contributions name as custom editors, and only when no installed plugin's editor handles the type. Binary files such as .xlsx keep the existing path, since release fileTypes already include custom-editor types. The banner reads "A plugin adds an editor for .x files: Name"; Not now and Don't suggest work per type as before.
…ning, or change content kind asks again
…lt, and join Markdown, CSV and notebook view toggles as options
… of parsing the display summary
…the pre-release text field
…nd blocks the save instead of vanishing Rate-limited edits are held and applied before the next save; oversized ones are reported to the frame and the user. Every save, from any trigger, first flushes plugin editor frames with a bounded wait and refuses to write while a frame holds edits the buffer lacks.
…only on real key presses Editors see file contents, so they now run as <webview> guests in their own in-memory partition instead of iframes of Orca's renderer. The session routes everything through a dead SOCKS proxy (loopback included), refuses every non-editor request and permission, and each guest gets disable_non_proxied_udp, no popups and no navigation. An Electron test proves fetch, WebSocket, images and TURN-over-TCP all fail from the editor and from its srcdoc and javascript: child frames, while the same page in a plain session reaches every listener. Electron 43 still resolves <link rel=dns-prefetch> names outside the session; the test pins that residual and the docs say so. Save chords now come from main's before-input-event on the guest, which page code cannot synthesize; the shell's keydown forwarder and the orca-editor-keydown message are gone. Guests also run in their own renderer process.
… tab Main reads readonly from the installed manifest (bytes editors always count) and drops every edit such a guest posts before it reaches the renderer. The tab host also refuses them and tells the editor its document is read-only, even on a writable tab.
… the isolated guest
Bytes editors now post `{ baseVersion, content: { kind: 'bytes', bytes } }` full
replacements (a transferable ArrayBuffer). The tab keeps the unsaved bytes beside
the text drafts, marks itself dirty, and the normal save pipeline (frame flush,
Cmd+S, close prompt) writes them: locally through a new `fs:writeFileBytes`
atomic replace guarded by the loaded bytes' SHA-256, and on SSH-served or paired
hosts by uploading chunks with `files.writeBase64Chunk` and swapping them in with
the new capability-negotiated `files.replaceWithUpload`. Older hosts are refused
before anything is written. A stale baseline is a conflict: the edit stays
unsaved and the external-change banner offers Reload or Overwrite. Source stays
the binary placeholder.
Per the product decision, every custom editor may edit: the `readonly` manifest
field, its main-side enforcement and re-approval rule are gone, and an editor
that only views simply never posts edits. Editors run in the normal sandboxed
plugin frame again instead of a network-isolated webview guest; the frame's save
chord is honored only while it carries real user activation. Consent now reads
"Opens and edits .ext files in Orca. It can read the files it opens."
…gents:read to agent:read
…ns with the dot, plus filenames)
…ames rewritten on parse)
…t document Editors that subscribe after their bundle loads (Excalidraw) missed the document that arrived first and stayed blank.
… past 16 MiB The cap covers text and bytes on every route; reads and SSH or paired-host writes are already chunked, so only the shared cap moves. Past 16 MiB the tab shows a small, non-blocking note that the editor may take a moment.
…ggle and access retry
…erywhere) and drop unused plugin locale keys
…y table is the one source of catalog types
…mes, images, capabilities, events, languages, installation and catalog folders
A custom editor may declare an icon; the tab and its hover card show it and the editor title instead of "Editor", falling back to the plugin icon. contributes.newFiles declares untitled file types (title, extension, optional UTF-8 template and icon) offered in the tab bar + menu, its search, the command palette and the plugin page, created at the workspace root through the Markdown untitled-file flow. The install toast's Try it creates one for plugins that declare them.
…ts editor tab icon
Saved false from the old default flips on once (pluginSystemDefaultedOn guard); a later deliberate false is respected. The Turn on plugins off-state is gone, and the official catalog seed is deferred off the startup path (and skipped offline), seeding on demand when the marketplace is opened.
…images The official catalog's newest Midnight, Nord, OLED and Dusk & Ember releases were regenerated without an images block (release-entry only kept images the author pasted), so their cards fell back to drawn art. A catalog that keeps its plugins in its own repository now borrows the manifest's images from the catalog commit, checked like declared images, and the validator's printed release entry includes them so regenerated catalogs keep their covers.
Full-access (trusted-worker) plugins now need only their own per-plugin approval: main no longer gates install, consent, enablement or runtime on a global switch, and the settings menu item, the Turn on in settings card and page states, and the stored key are gone. The consent now says plainly what full access means. Kill list, official review and publisher checks are kept; docs note an enterprise block policy may come later.
nwparker
force-pushed
the
nwparker/plugins-v2-16-ship-hardening
branch
from
October 28, 2026 10:53
c58df2c to
67b5e44
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-18-custom-editors
branch
from
October 28, 2026 10:53
d67350f to
6dbe0d0
Compare
smwbev
added a commit
to smwbev/orca-russian
that referenced
this pull request
Oct 28, 2026
stablyai/orca#34538 moves plugin-translatable-chrome.ts into src/shared/plugins/languages/. build.py used to treat a missing file as an empty allow-list and would have dropped the 34 allowed settings.plugin* translations without a word; it now looks in both places and stops when it finds neither. audit-pack.py does the same. The v5.1.177 catalog builds byte for byte as before.
Drop tests that asserted CSS classes, DOM structure, internal call counts, copy, or duplicated coverage; merge overlapping e2e file-type suggestion specs. Keep security, consent, data-integrity, compatibility and main journey coverage.
Contributor
Author
|
Folded into #35470 (Plugin Alpha), which lands the rest of the plugin stack in one PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Plugins can now add their own editor for a kind of file. The first one is Excalidraw: open a
.excalidrawfile and you get the drawing canvas right in the editor tab, with a toggle to see the raw JSON (Source). Orca still owns the file. The plugin only ever gets the file's text and hands back edited text.A second official plugin, Spreadsheet Viewer, proves the point also works for binary files: an editor can ask for the file's bytes instead of its text (
"contentKind": "bytes"), and open.xlsx,.xlsm,.xlsb,.xlsand.odsworkbooks read-only, with sheet tabs and a grid that handles 50,000 rows.What Changed
Before:
.excalidrawfiles opened as plain text, and a plugin had no way to supply an editor for a file type.After: a plugin with
contributes.customEditors(manifest format 2,sandboxed-ui) opens matching files in the editor tab. The header toggle shows<editor title> | Source | Changes. If several plugins match,defaultpriority comes first and the user can pick another one from the toggle. When the plugin is turned off or removed, the file opens in Source.How it works:
customEditorspoint:{ id, title, fileTypes: ["excalidraw"], entry, priority? }.fileTypesare file-name suffixes without the dot, soexcalidraw.jsononly matches files ending in.excalidraw.json. The point is checked against the format 2 floor (PLUGIN_MANIFEST_V2_SINCE). Duplicate ids or file types are rejected. Schemas and docs are regenerated, and the entry file shares the panel entry's size cap. It is listed as apanelcatalog type, and a single-extension type (excalidraw) also feeds the existing "suggest a plugin for this file type" feature.sandbox="allow-scripts", the host CSP shell (default-src 'none'; connect-src 'none'), the navigation guard and the watchdog. It gets no panel session, so it cannot call any host methods. Its only channel isorca-editor-ready/-document/-edit(full text) /-flush/-flushed. The host checks every message against the frame's window identity and enforces a 16 MiB size cap and a rate limit. It ignores edits on read-only tabs and never echoes an edit back to the frame that sent it.editor.savebinding, Orca asks the frame to flush any edit still waiting in its debounce, then saves. Read-only tabs, binary files, load errors and conflicts stay in raw Source, the same as other rich views.contentKind: "bytes"): an editor may declare"contentKind": "bytes"; it must then also set"readonly": true, because Orca's save pipeline is text-only. Orca reads the file itself, on the same route that loaded the tab (local, SSH or a paired host), using the existingstat+readChunkcalls, so there is no wire change. It refuses files over 16 MiB with " is too large to open in (size; the limit is 16 MB)", re-sends after an outside change, and never applies such an editor's edits. The frame gets the bytes as a transferredArrayBufferplus the matched suffix (fileType), never a path. Source on a binary file is the normal "Binary file — cannot display" placeholder.{ version, readOnly, content: { kind: 'text', text } | { kind: 'bytes', bytes } }. A text edit may namebaseVersion; an edit against a document Orca has since replaced getsorca-editor-edit-rejectedwith error codeconflictinstead of overwriting the outside change. Text documents keep the oldtextfield and unversioned edits still apply, so the Excalidraw plugin works unchanged. The editor messages stay in one module (plugin-custom-editor-bridge.ts) so a later change can move panels and editors to one envelope."readonly": truemakes Orca ignore an editor's edits, and the consent then says "Opens .xlsx, … files in Orca" instead of "Opens and edits".orca-panel-themeand the shell updates the--orca-*variables and thelight/darkclass in place.name(readable aswindow.nameinside the frame) used to contain the file's absolute path. It is now a random id; the navigation guard needs only the prefix..excalidrawfile opens as JSON): "A plugin adds an editor for .excalidraw files: Excalidraw". Only release file types the listing names as custom editors count, and only when no installed plugin's editor handles the type. Binary files such as.xlsxalready got the banner through the release'sfileTypes.The official plugins ship separately in
stablyai/orca-plugins(catalog-v2):plugins/excalidrawbundles Excalidraw and its Latin fonts into one offline HTML file;plugins/spreadsheetbundles SheetJS Community Edition 0.20.3 (Apache-2.0, licence notices included) the same way. Excalidraw's id is nowstablyai.orca-excalidraw: Orca treats a stablyai plugin as official only when its id starts withorca-.Why
contentshape already allow it later without a format change.Catalog side: stablyai/orca-plugins#16 (
catalog-v2at bd8a0a4: Spreadsheet Viewer listed, Excalidraw renamed; its validator is repinned to this branch's head because it must understandcontentKindandreadonly).Huge thanks to @Roughriver74 for #27413 ("open .excalidraw files as an editable diagram"). This PR and the Excalidraw plugin reuse its approach: the Diagram/Source toggle, saving through the existing editor buffer, keeping the scene's original
source, and treating the first scene after load as the clean baseline so opening a file never marks it dirty. Both commits credit them as co-author.Spreadsheet requests from the community shaped the second plugin: #8301 and #20362 (Office files as first-class types), #26514 (a viewer contribution point), and the spreadsheet viewers in #13532 (@SrAlvarado), #20363 (@excellence-wh), #29678 (@nebourocket), #15763 (@ppw-stack), #19741 (@overjt) and #9041 (@siddqamar). The plugin's zip-bomb guard (refuse a workbook that declares over 256 MB uncompressed or 4,000 parts before inflating anything) is adapted from #29678, and that plugin commit credits @nebourocket as co-author. CSV stays with Orca's built-in editable table view.
Linked Issue
N/A (maintainer). Builds on community PR #27413.
Visual Proof
Screenshots from a hidden Electron window, with Excalidraw installed from a local copy of the
catalog-v2catalog:Before:
.excalidrawopened as plain text (no custom editor). After:Spreadsheet Viewer, installed from a local copy of the catalog in a hidden window (multi-sheet workbook with formulas, merged cells, an error cell and a 50,000-row sheet):
Testing
I manually tested these changes locally (macOS, hidden window: install from the catalog, open, draw, save, reopen, Source, dark theme)
Automated tests added/updated
Unit tests: manifest validation, catalog summary and file types, consent binding and update growth (
plugin-custom-editor-contribution.test.ts); routing by file type, priority, user choice, plugin turned off, read-only, binary, conflict, Changes and remote files (custom-editor-routing.test.ts); the document channel, covering round-trip, no echo, opening without dirtying, external reload, read-only, size cap, flush-before-save and frame identity (plugin-custom-editor-host.test.ts,PluginCustomEditorFrame.test.tsx); and entry serving, covering the CSP shell, no session, tampered bytes and no path leakage (plugin-custom-editor-entry.test.ts).Bytes editors: manifest rules (
bytesneedsreadonly), routing (binary files, read-only tabs, remote files, no pageable route), the bytes channel (transferred copy, versions, edits ignored), versioned text edits andconflict, the byte reader (local and remote paging within the 256 KiB chunk cap, 16 MiB refusal, older hosts), the bytes surface (too large, retry, reload after an outside change), the in-place theme message and the random frame name. Suggestions: theeditorpurpose in main and in the banner.E2E, hidden window: a bytes editor receives the file read-only, its edit is ignored, Source shows the placeholder and turning plugins off falls back (
plugin-custom-editor.spec.ts); the editor suggestion on.xlsxand.excalidraw, View plugin opens the page without installing, Not now hides it (plugin-editor-file-type-suggestion.spec.ts).Manual, hidden window, the real Spreadsheet Viewer installed from a local catalog copy: open in under 1 s (776–907 ms to the first grid), switching to the 50,000-row sheet about 30 ms, jump to row 50,001, range status (count, sum, average), dark theme without remount, Source,
.odsand.xls, damaged, encrypted, too large, plugin off. Plugin suite (npm testinplugins/spreadsheet/build): 63 tests including a headless-browser harness.E2E, hidden window (
tests/e2e/plugin-custom-editor.spec.ts): opening does not dirty the file; typing does; a save shortcut pressed inside the frame during the debounce writes the latest text to disk; the frame'sfetchto a local server is blocked and the server sees no request; Source and back; turning plugins off falls back to Source. The existing plugin panel, demo, syntax, theme and file-type-suggestion e2e tests also pass.pnpm tc, the changed-code quality gate, oxlint, localization catalog, extraction and coverage checks, and schema regeneration and parity all pass.Known, unrelated:
plugin-schema-field-docs.test.tsfails on this stack because tagv1.4.242exists without v2. The stack bump ofPLUGIN_MANIFEST_V2_SINCEto 1.4.243 fixes it.Review
Agent skill upstream boundary
Notes
editor.savealone. A plugin can only edit the text of the file the user opened, and it can do that in Source too./and\.customEditorson the plugin list and thereadCustomEditorEntrypreload method are optional, so older hosts or preloads simply show Source. Old clients drop the new catalog summary kind (.catch) and their engine floor refuses the plugin.orca-id prefix.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck, the changed-code gate, touched test suites and the e2e build ran locally; CI covers the full lint and test runs)