mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-06 02:20:50 +00:00
G8: Plug-in Library: install, preview and update community WebAssembly effects (#2524)
* G8: plug-in library Community Plug-in Library for WebAssembly effect plug-ins (#376): one reviewed catalog (index.json), install / update / remove from Settings > Plug-in Library (also Effect > Plug-in Library...), library.* commands, start-up loading of installed packages with SHA-256 checks. Downloads go through the system curl (https, GitHub hosts), as trained models do. Preview before installing (library.preview): the release is downloaded, checked like an install, and rendered in the sandbox on a built-in sample frame at default settings (2 s at 12 fps) with a Before/After split, plus the effect's parameters, "Open on GitHub" and an optional author video link (catalog field preview.video). Authors need to do nothing for it. Hardening: a module that fails to load leaves the installed copy alone, Update All updates every package in one job, minApp also applies to an explicit version, curl ignores ~/.curlrc and URL globbing, unique temp files, percent-decoded file URLs. Plug-in effect slots grow from 64 to 256 with a clearer overflow error. Docs: plugins.md "Plug-in Library", publishing-plugins.md (author guide from zero to listed), gaps.md; examples/plugin-catalog is the starting content of the catalog repository (schema, validation workflow). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * contributors: credit iseemhlyfta * G8: plug-in library: doc comments on the library's functions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: plug-in catalog check: require one object with schema 1 and a packages array An empty file or several JSON values passed jq empty, and with SKIP_SCHEMA=1 nothing else checked the catalog's shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: plug-in library: one preview texture set; catalog schema requires effects The preview kept a texture set per package version previewed (about 6 MB each) for the whole session; it now keeps one, replaced when another package is previewed. Releases in the catalog schema must list at least one effect id, as the author guide says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: plug-in catalog schema: effect ids follow the manifest's id rules Letters, digits, '.', '_' and '-', and not the reserved 'ec.' prefix, so library.missing can match them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: refuse Plug-in Library jobs while automation file access is confined Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: split the Plug-in Library page into toolbar, card, links and actions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: show Plug-in Library toasts without a Roto job; cache preview frame checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: log Plug-in Library packages that fail to load at start-up Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: check an update before replacing a loaded package; Update All past failures - An update to a package that is already loaded is now compiled and its manifest checked (through the previewer, without registering it) before the new file is written and the old version's folder deleted. Before, a release with the right SHA-256 that didn't load replaced the working version and failed at the next start. - Package ids that differ only in case, or end in a dot, would share one folder on Windows and macOS: the catalog keeps the first of them, and ids can't end in a dot (schema too). - Update All: a package that can't be picked or installed no longer stops the others; the result names what was updated and what wasn't. - Downloads: at most 5 redirects, and one that ends off GitHub's hosts is refused, as the module docs say. - A job that panics no longer leaves the library busy; poisoned status locks are used, not dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * G8: rustfmt the update test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
This commit is contained in:
31 files changed
+2579
-6
No files matched your search
+46
-1
@@ -270,7 +270,7 @@ impl EffectPlugin for Swap {
|
||||
register_plugin(Arc::new(Swap(manifest)))?; // before the UI builds its menus
|
||||
```
|
||||
|
||||
`PluginParams` reads values by parameter id (`f`, `b`, `point`, `color`). At most 64 plug-in
|
||||
`PluginParams` reads values by parameter id (`f`, `b`, `point`, `color`). At most 256 plug-in
|
||||
effects can be registered per process.
|
||||
|
||||
### Compatibility
|
||||
@@ -278,3 +278,48 @@ effects can be registered per process.
|
||||
The API version is checked when a plug-in loads: a manifest or module for another version is
|
||||
refused with a message. Within a version the contract above does not change; additions (new
|
||||
parameter types, new optional exports) bump the version.
|
||||
|
||||
## Plug-in Library
|
||||
|
||||
Settings ▸ Plug-in Library (also Effect ▸ Plug-in Library…) lists WebAssembly effect plug-ins
|
||||
published by the community, and installs, updates and removes them without bundling them into
|
||||
the app. Only WebAssembly effects are listed: they run in the same sandbox as any plug-in, so a
|
||||
package can't read files, open the network or crash the app.
|
||||
|
||||
* **One reviewed catalog.** The list comes from one `index.json` in the
|
||||
[`storytold/effectcraft-plugins`](https://github.com/storytold/effectcraft-plugins) repository;
|
||||
packages are added by pull request and reviewed there. The app has no field for another
|
||||
catalog; `library.refresh {catalog}` (for plug-in authors testing an entry) takes an `index.json`
|
||||
on GitHub or a local file, and the page then says it shows a test catalog until Refresh.
|
||||
* **Nothing is downloaded until you ask.** Fetch Catalog (`library.refresh`) reads the catalog;
|
||||
Install (`library.install`) downloads the package's `.wasm`, checks its SHA-256 (and its size, when the
|
||||
catalog gives one) against the catalog and loads it. Downloads use the system's `curl`,
|
||||
`https://` only and starting on GitHub's hosts (redirects stay on `https://`; the SHA-256 check
|
||||
is what guarantees the file).
|
||||
* **Where it goes.** `<Plug-ins>/Library/<id>/<version>/<id>.wasm` (the `Plug-ins` folder next to
|
||||
the settings), listed in `Library/installed.json`. Installed packages load at start-up, each
|
||||
checked against the SHA-256 it was installed with. The catalog last fetched is kept as
|
||||
`Library/catalog.json`, so the list works offline.
|
||||
* **Restart after removing or updating.** Registered effects can't be unloaded: removing or
|
||||
updating a package whose effects are loaded takes effect at the next start, and the list says
|
||||
"Restart EffectCraft to finish".
|
||||
* **Preview before installing.** Preview (`library.preview`) downloads the package's module
|
||||
(checked against the catalog's size and SHA-256) without installing it, and renders its
|
||||
effect in the sandbox on a built-in sample frame with default parameters: 2 seconds at 12 fps,
|
||||
with a Before/After split. The details show it playing, the effects with their parameter names,
|
||||
"Open on GitHub" (the package's `repo`) and, when the package has a `preview.video` link (an
|
||||
`https://` YouTube, Vimeo or GitHub URL), "Watch video".
|
||||
* **Missing effects.** `library.missing` lists the effects a project uses that aren't installed,
|
||||
and the catalog packages that provide them.
|
||||
|
||||
Commands (UI, CLI, control channel and MCP): `library.list {query?, tag?, installed?}`,
|
||||
`library.refresh {catalog?, wait?}`, `library.preview {id, version?, wait?}`,
|
||||
`library.install {id, version?, wait?}`, `library.update {id?, wait?}`, `library.uninstall {id}`,
|
||||
`library.missing`, `library.loadInstalled`. Downloads run in the background; `wait: true` runs
|
||||
them to the end (scripts and tests).
|
||||
|
||||
### Publishing a plug-in
|
||||
|
||||
[publishing-plugins.md](publishing-plugins.md) walks through it from an empty folder to a listed
|
||||
package: build, test, release on GitHub, the catalog entry and its fields, testing the entry with a
|
||||
local `file://` catalog, the pull request and its review, updates and removal.
|
||||
Reference in new issue
Block a user