WuYongJie 1b6425b552 feat(desktop): connect native Pi sessions with scoped rules and recovery
Track the fixed PhotoCraft source baseline with the existing native client integration. Use the actual Pi SDK for normal sends, durable session recovery, demand-loaded enterprise rules and checked undoable canvas tools. Retain request identities and never resend unknown inference. Include local packaging and real-call acceptance evidence.
2026-10-22 10:49:58 +08:00
..

Invert: an example PhotoCraft plug-in

A complete WebAssembly filter plug-in in about 70 lines of no_std Rust: no allocator, no imports, under 1 KiB built. It inverts the colour channels and leaves alpha alone, matching Image › Adjustments › Invert. The ABI is documented in docs/plugins.md.

Build

rustup target add wasm32-unknown-unknown
./build.sh

build.sh runs cargo build --release --target wasm32-unknown-unknown and copies the module to crates/plugins/tests/fixtures/invert.wasm, the test fixture the host's tests use. This crate is not a member of the PhotoCraft workspace.

Install

# Into a running app (control channel) or the CLI, as a command:
plugin.install {"path": "examples/plugins/invert-rs/target/wasm32-unknown-unknown/release/photocraft_plugin_invert.wasm"}
plugin.run {"id": "org.photocraft.example.invert"}

Or copy the .wasm into the folder set in Edit › Preferences › Plug-ins (with Use Additional Plug-ins Folder on); it then appears under Filter › Plug-ins.