Repository navigation
Conversation
8 of 9 tasks
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 21, 2026 06:36
7b64f58 to
0dda0fe
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 21, 2026 06:49
85b137d to
a661c47
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 21, 2026 12:23
0dda0fe to
b851f0f
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 21, 2026 12:23
a661c47 to
1bd0a98
Compare
nwparker
marked this pull request as ready for review
October 21, 2026 12:24
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 21, 2026 20:11
b851f0f to
3b44bbb
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 21, 2026 20:12
1bd0a98 to
cc7d729
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 24, 2026 11:44
3b44bbb to
807ebd2
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 24, 2026 11:44
cc7d729 to
d69e1ec
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
2 times, most recently
from
October 24, 2026 13:32
6cc255d to
73cff50
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 24, 2026 13:32
d69e1ec to
121efa3
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 25, 2026 05:23
73cff50 to
7be720d
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
2 times, most recently
from
October 26, 2026 08:16
470e2bc to
9dcc0f3
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 26, 2026 12:04
7be720d to
cd52e2f
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 26, 2026 12:04
9dcc0f3 to
b90ee35
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 26, 2026 12:32
cd52e2f to
bfff4cc
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 26, 2026 12:32
b90ee35 to
05de5c3
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 28, 2026 04:58
bfff4cc to
f7d30c6
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 28, 2026 04:58
05de5c3 to
4ff3532
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 28, 2026 05:30
f7d30c6 to
3fb7bdc
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 28, 2026 05:31
4ff3532 to
58634a7
Compare
…nts table The manifest's contributes object, the execution-profile derivation and the catalog type list now read one PLUGIN_CONTRIBUTION_POINTS table instead of three hand-kept lists.
Plugin ids and relative paths now validate with a regex first, so a generated JSON Schema can carry them as `pattern`. The predicate only adds what a pattern cannot (reserved names, Windows device names), and a bad value reports one issue instead of two.
Each field now carries a description, examples and the Orca release that first reads it, and each contribution item has a named fragment id. Manifest v2 accepts an optional $schema key for editor completion, and the catalog gains an authoring schema built from the same field definitions.
pnpm generate:plugin-schemas writes schemas/plugins/orca-plugin.schema.json, schemas/plugins/orca-marketplace.v2.schema.json and the matching reference pages under docs/reference from the runtime schemas. A test fails when the committed files drift, when a field lacks a description or since-version, when a documented example does not validate, and when the schema and the runtime disagree on bundled manifests or known-bad inputs.
Manifest and catalog validation now lists up to eight distinct problems as `contributes.themes[0].label: must not be empty` instead of zod's first raw message, and rewrites parser wording (required, unknown keys, allowed values, limits) into what the author should change.
A manifest the strict schema rejects is pre-read for engines.orca and manifestVersion first, so a plugin built for a newer Orca reports "requires Orca >=X (this is Y)" instead of unknown-key noise. A catalog release whose minimumOrca is above this build stays listed but is refused before anything is downloaded.
…lease Schemas move under schemas/plugins/v2/ so a later breaking format can publish beside them without changing what a pinned URL means, and the example plugin authors copy carries its own copy for offline completion. Fields new with manifest v2 cite one constant, PLUGIN_MANIFEST_V2_SINCE (1.4.232, the release after the latest tag), and a test fails once a tag at or above it ships without manifest v2. The reference documents format 1 as legacy.
Dismissing the review dialog records keep-disabled without consent. Turning the plugin's switch back on then only cleared the disable, so it returned to "Needs review" with no dialog. Enabling now opens the review whenever the result is still pending.
Catalog releases may carry a license, repository and homepage (https only), an updatedAt date and a short plain-text changelog; an invalid value is dropped so it never hides the plugin. Manifests may declare license and homepage. Marketplace listings flatten name, version and those details, and installed plugins report license, homepage, repository and the version a rollback would restore. The JSON lint-staged step no longer fails a commit whose only staged JSON files are generated schemas the formatter ignores.
- Parity runs both ways: documented examples also pass their zod field, bundled manifests pass both the schema and the runtime, and manifest and catalog negatives (traversal, oversize, wrong types, duplicates) fail in both. A table lists every rule only the runtime can enforce, and each is named in the description of the field it constrains. - The published files carry the format in their names (orca-plugin.v2.schema.json, orca-marketplace.v2.schema.json); $id stays on main until the v2 release, and a test demands the release tag once it exists. - The v1 since-value is 1.4.160, the first release that read plugins, and a test pins it to the tags. engines.orca documents that format 2 needs at least the release that ships it. - v2 catalog sources strip unknown keys like the rest of the entry, and the v2 runtime schema is derived from the one authoring definition, whose plugins field documents the duplicate-id rule. Contribution types and categories declare uniqueItems; fileTypes items come from the file-type schema itself. - Issue messages no longer depend on zod's English: a missing field is told from the input, and every pattern carries its own message. Unknown-key lists show five keys plus a count, and each line is capped at 200 characters. - A prerelease host (1.5.0-rc.1) now ranks below its release, as in semver.
The plugin list is rebuilt at startup and on every plugin change, and each installed plugin cost a directory read to find the version a rollback would restore. That moves to plugins:getRollbackVersion, which the detail page calls when it shows the action, and a test pins the list build to zero filesystem calls.
The release-tag check caught it: v1.4.232 was cut from main before this stack landed.
With the system off the service discovers nothing, so plugins:list returned an empty list and the settings page could not show what is installed. The client list now reads the install tree on demand in that state and projects every plugin as disabled; nothing is activated or started, and startup with the system off still does no plugin I/O. Older clients that hid the list while off are unaffected. Also for the plugin page: plugins:getInstalledManifest returns one installed plugin's parsed manifest on demand, marketplace installs report the catalog ref beside its URL, and the listing type declares the release record it already carried.
Catalog - The catalog is orca-catalog.json with a required catalogVersion: 2; a client that sees a higher version refuses with "update Orca to browse this catalog". New clients read it first and fall back to the frozen orca-marketplace.json, which export-legacy-plugin-catalog.mjs generates. - Parsing is tolerant at every level: unknown keys are stripped, unreadable entries and releases are skipped, over-limit lists are trimmed, a repeated id keeps the first copy, invalid display-only fields are dropped. pnpm validate:plugin reports each of those as an error for authors and CI. - Entries list releases newest first; Orca offers the first whose minimumOrca it meets, and shows "Needs Orca X" only when none fits. Versioning - engines.orca is the only gate and must cover the newest since-version of every field and enum value used (capabilities, events and built-in actions now carry per-value since tables). The check is part of the v2 schema, so validation, catalog checks and installs all enforce it. - pluginApi is optional in format 2 (defaults to 1) and refused on data and instructional plugins. Format 2 rejects unknown keys at every level, including engines, author and every contribution item. - contributes.agents is reserved for coding-agent definitions and must be empty in format 2 until their format exists. - Plugins are gated against the newer of the app version and the newest since this build defines, so development and local builds, whose package version only moves at release, read the fields they introduce. The policy is written into the generated references and pinned by tests.
… profile on the list installMarketplacePlugin takes an optional enableIfData. Main then turns the plugin on in the same step only when the installed, verified manifest is execution: data, approving exactly the fingerprint it just installed through the normal consent path; anything else comes back needsReview: true, whatever the renderer sends. Older hosts ignore the field and leave the plugin pending. Installed plugins now report their verified execution profile, so the plugin page never infers "content only" from the absence of a worker.
Manifest format 2 gains cover and screenshots (alt text required), and its icon must be a square PNG or WebP. Images are checked at install from their headers only: static PNG, JPEG or WebP, per-kind pixel and byte limits, at most 4096 pixels a side and 8 MB in total, so nothing is ever decoded to decide trust. Catalog releases may carry images stored in the catalog repository and pinned by SHA-256, a summary of what they add, and the capabilities they ask for, so a listing can show the plugin completely before anything is downloaded. All three are dropped when unreadable; the summary and capabilities must match the manifest exactly at install. pnpm validate:plugin checks each image's hash, size and format against the repository files.
Images reach the renderer only as orca-plugin-image URLs, which main serves with nosniff and the type it read from the header: - catalog images are read from the catalog repository at the fetched commit, kept only when their hash, size and format match, and cached by SHA-256; a listing references only those; - preview images are cached by hash before the staging tree is deleted; - installed plugins' images are named by plugin, install hash and slot and re-checked on every read, so listing plugins still reads no files. Listings, previews and installed plugins carry an images field the plugin page can render without fetching anything else.
…verride Catalog releases may list up to four theme palettes (hex colors only) so a listing can draw theme cards before install; they are display-only and dropped when invalid. One-click enable now also refuses when a development override shadows the installed plugin, since those are not the bytes the user just chose.
installMarketplacePlugin takes an optional expectedFingerprint, the preview's consentFingerprint. With enableIfData, main now approves only when the installed fingerprint equals it, so bytes that changed between preview and install stay pending for review instead of being enabled. The release commit is already pinned by resolvedCommit. Older hosts ignore the field.
…chemas v1.4.240 shipped without manifest v2, so the first release that reads it is 1.4.242. The root-directory guard refuses a new top-level schemas/ folder.
…nd break the image validation import cycle
nwparker
force-pushed
the
nwparker/plugins-v2-10-editor-theme
branch
from
October 28, 2026 10:53
3fb7bdc to
5d7f90a
Compare
nwparker
force-pushed
the
nwparker/plugins-v2-11-schema
branch
from
October 28, 2026 10:53
58634a7 to
56640be
Compare
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
Plugin authors write two JSON files:
orca-plugin.json(the manifest, which describes the plugin) and the marketplace catalog (which lists plugins people can install). Orca checks both files, but the rules lived only in Orca's code, so authors had to guess them. Errors showed one cryptic line at a time. A plugin made for a newer Orca failed with a list of "unknown key" errors instead of "update Orca".This PR publishes those rules as JSON Schema files. These are generated from the same code that does the checking, so the two can't drift apart. The PR also adds reference pages for authors, error messages that point at the exact field, and a clear message when a plugin needs a newer Orca.
What Changed
For plugin authors
"$schema": "https://raw.githubusercontent.com/stablyai/orca/main/schemas/plugins/orca-plugin.v2.schema.json"to the manifest and the editor gives completion, hover docs and inline errors. The catalog (orca-catalog.json) has a matchingorca-catalog.v2.schema.json. The format is part of each file name, so a later breaking format publishes beside them without changing what a URL means. The URLs point atmainuntil format 2 ships. A test then requires them to point at that release's tag, so editors only offer fields a shipped Orca reads. The example plugin authors copy (examples/plugins/orca-gleam-syntax) has its own copy, so completion also works offline.$defs).docs/reference/plugin-manifest.mdanddocs/reference/plugin-catalog.mdare generated from the same schemas. Format 1 is documented as legacy.license(SPDX),repositoryandhomepage(https only),updatedAt(ISO date) andchangelog(plain text, at most 2000 characters). Because they're display-only, an invalid value is dropped instead of hiding the plugin.licenseandhomepage.name,versionand these details.license,homepageandrepository.plugins:getRollbackVersioncall returns the version a rollback would restore. It reads on demand, so building the plugin list, which happens at startup and on every change, makes no file reads. A test pins that.Error messages
contributes.themes.0.label: Too small: expected string to have >=1 characters.contributes.themes[0].label: must not be empty; name: is required; (root): unknown key "surprise".pattern, so the editor flags them as you type.Plugins and releases that need a newer Orca
engines.orcaandmanifestVersionleniently. A plugin built for a newer Orca now reportsrequires Orca >=X (this is Y)instead of unknown-key noise.minimumOrcais above this Orca stays listed, but preview and install refuse it before anything is downloaded. The existing "requires a different Orca version" message is shown.Seeing installed plugins while the plugin system is off
plugins:getInstalledManifest). Marketplace installs now report the catalog ref next to the catalog URL, so a client can match an installed plugin to the exact catalog it came from.Enabling a plugin that was never approved
Final format decisions (after review):
orca-catalog.jsonwith a required"catalogVersion": 2, and the file name never changes again. An Orca that sees a higher version says "update Orca to browse this catalog" instead of misreading it. Orca falls back to the frozenorca-marketplace.json, whichconfig/scripts/export-legacy-plugin-catalog.mjsgenerates for older clients.engines,authorand every contribution item. A test pins both rules.pnpm validate:pluginturns every catalog repair into an error, for authors and catalog CI.releases, newest first. Orca offers the newest one it can run, and shows "Needs Orca X" only when none fits.engines.orcais the only gate. It must cover the newest "Since" of every field and value the manifest uses (capabilities, events and built-in actions now carry per-value versions). That check is part of the schema, so validation, catalog checks and install all enforce it.pluginApi. Now optional (it defaults to 1), and refused ondataandinstructionalplugins, which never call the host API.contributes.agents. Reserved for coding-agent definitions, and must be empty until that format exists.Plugin pages (for the plugin experience redesign):
installMarketplacePlugintakes an optionalenableIfData. Main turns the plugin on in the same step only if the installed, verified manifest isexecution: 'data', approving exactly the fingerprint it just installed. Anything else comes backneedsReview: true, whatever the renderer sends.coverandscreenshots, with alt text required.orca-plugin-image://URLs, served by main from verified bytes withnosniff:Mechanism
src/shared/pluginsstay the only definition.pnpm generate:plugin-schemasturns them into JSON Schema using zod's built-in converter, and renders the reference pages from that JSON.Why
engines.orcato use newer fields, and the lenient pre-read turns the resulting failure into "update Orca".source, ignores keys it does not know, so a newer catalog field never makes an older Orca drop the entry. The runtime catalog parser is derived from the same definition the schema is generated from.1.4.160, the first tag that read plugins. A test pins this to the tags.PLUGIN_MANIFEST_V2_SINCE. It is set to1.4.233. It started as 1.4.232, the latest tag plus one patch, but v1.4.232 was then cut from main without format 2. The release-tag check caught that, so the constant moved on.pnpm generate:plugin-schemas. The release-tag test fails until that's done.Linked Issue
Fixes #
Visual Proof
Enabling a plugin that was never approved, on a fresh profile with the bundled Navigation Shortcuts plugin:
There is no "before" screenshot: hot reload made it ambiguous. The new regression test fails without the fix. The rest of this PR is schema and wording; a too-new catalog release reuses Orca's existing "requires a different Orca version" message.
Testing
pnpm test src/shared/plugins src/main/plugins src/main/ipc src/main/startup src/renderer/src/components/settings src/preload: all pass. The exceptions are the release-tag check, which waits for the merge-time bump, and three tests that also fail without this PR: the two filesystem-watcher tests andruntime-environment-preference.New tests:
pnpm tc:node,pnpm tc:webandpnpm tc:cliare clean. oxlint andpnpm run check:code-quality:changedreport 0 findings.Plugin e2e (
tests/e2e/plugin-*.spec.ts, electron-headless, background launch, one worker): 8 of 8 pass.Checked through CDP on a hidden window with an isolated profile and a mock keychain: the consent flow (approve, dismiss, then switch on).
Tested on macOS. The changes are platform-neutral validation code. SSH and remote hosts use the same shared schemas, and the new path pattern matches the existing Windows-portable path rules, with a test comparing them.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
$schemakey.;. The settings UI matches on theinvalid manifestandrequires Orcaprefixes, and both are unchanged.ajv, test-only. It is pinned to the version already in the lockfile.licenseorhomepageshould raiseengines.orcato 1.4.233.1.5.0-rc.1, or an ad-hocx.y.z-adhocbuild) now counts as older than its release, as semver does. A plugin requiring>=1.5.0won't load on1.5.0-rc.1. Before, the suffix was ignored.engines.orca: the reference now says a format 2 manifest needs at least>=1.4.233, the release that ships format 2. Older Orca can't read format 2 at all. This is guidance, not enforced: dev and e2e builds still report 1.4.214, and enforcing it would refuse every format 2 plugin there until the release bumps the version.--no-error-on-unmatched-pattern, so a commit whose only staged JSON files are generated schemas (which the formatter ignores) no longer fails.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)