diff --git a/docs/plugins.md b/docs/plugins.md index 1389e43c..b7eae990 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -3,7 +3,8 @@ NyaTerm supports locally installed tool and panel extensions. A plugin can add sandboxed HTML panels, terminal/connection context-menu commands, and an optional persistent native backend. Built-in connection protocols remain managed by -NyaTerm. Connection/filesystem providers and an online marketplace are future APIs. +NyaTerm. Connection/filesystem providers are future APIs. Reviewed plugins are +distributed through the official Plugin Store. ## Install and use @@ -67,6 +68,14 @@ Installed versions persist provenance; switching between local and Store sources requires uninstalling first. Old registry records default to local provenance. The Store lives in [`nyakang/nyaterm-plugins`](https://github.com/nyakang/nyaterm-plugins). +Each extension has a separate listing, per-target review submissions and per-version +release records. Publisher and signing configuration lives under `trust/`; the +client downloads the generated `public/v1/plugins.json` catalog. The previous +catalog endpoint has been removed without a compatibility mirror, so older +clients must upgrade to load the Store. Deploy the Store's new endpoint before +releasing the updated client. Catalog v1, package formats and installed provenance +remain unchanged. + Its records and signing workflow are independent of author plugin source. First rollout requires initializing the official key and configuring the protected `plugin-signing` environment; an empty client trust store rejects every Store install. @@ -358,3 +367,8 @@ pnpm lint cargo test --manifest-path src-tauri/crates/nyaterm-plugin-runtime/Cargo.toml cargo test --manifest-path src-tauri/Cargo.toml --lib core::plugins ``` + +For Store/client interoperability, set `NYATERM_STORE_CATALOGS` to the generated +public catalog and any populated fixture paths (separated by `;` on Windows or +`:` on Unix). The runtime's `store_catalog` test parses each with the client's +catalog validator. See the Store README for exporting the populated fixture. diff --git a/src-tauri/crates/nyaterm-plugin-runtime/src/marketplace.rs b/src-tauri/crates/nyaterm-plugin-runtime/src/marketplace.rs index a46406eb..9b30369e 100644 --- a/src-tauri/crates/nyaterm-plugin-runtime/src/marketplace.rs +++ b/src-tauri/crates/nyaterm-plugin-runtime/src/marketplace.rs @@ -9,7 +9,7 @@ use std::collections::HashSet; pub const REPOSITORY_ID: &str = "nyaterm-official"; pub const CATALOG_URL: &str = - "https://raw.githubusercontent.com/nyakang/nyaterm-plugins/main/catalog/index.json"; + "https://raw.githubusercontent.com/nyakang/nyaterm-plugins/main/public/v1/plugins.json"; pub const MAX_CATALOG_BYTES: usize = 4 * 1024 * 1024; pub const TARGETS: &[&str] = &[ "universal", diff --git a/src-tauri/crates/nyaterm-plugin-runtime/tests/store_catalog.rs b/src-tauri/crates/nyaterm-plugin-runtime/tests/store_catalog.rs new file mode 100644 index 00000000..b8807d3d --- /dev/null +++ b/src-tauri/crates/nyaterm-plugin-runtime/tests/store_catalog.rs @@ -0,0 +1,18 @@ +//! Interoperability check for a generated Store catalog supplied by CI or maintainers. +use nyaterm_plugin_runtime::marketplace::Catalog; + +#[test] +fn parses_generated_store_catalogs() { + let Some(paths) = std::env::var_os("NYATERM_STORE_CATALOGS") else { + return; + }; + let paths = std::env::split_paths(&paths).collect::>(); + assert!(!paths.is_empty(), "Supply at least one generated catalog"); + for path in paths { + let bytes = std::fs::read(&path).expect("Read the generated Store catalog"); + let catalog = + Catalog::parse(&bytes).unwrap_or_else(|error| panic!("{}: {error}", path.display())); + let serialized = serde_json::to_vec(&catalog).unwrap(); + Catalog::parse(&serialized).expect("Catalog survives client serialization"); + } +}