pub struct PluginManifest {
pub name: String,
pub version: String,
pub description: String,
pub author: String,
pub license: String,
pub plugin_type: String,
pub runtime: String,
pub sdk_version: String,
pub hooks: Vec<String>,
pub config_schema: Option<Value>,
pub capabilities: Option<Capabilities>,
pub homepage: Option<String>,
}Expand description
Plugin manifest — the on-disk .progit-plugin.json.
Backwards compatible with v0.1 manifests: missing fields fall back to
permissive defaults. New plugins should set capabilities explicitly.
Fields§
§name: StringUnique plugin id (also the directory name).
version: StringSemver of the plugin itself.
description: StringOne-line summary, shown in the plugin browser.
Author handle or organisation.
license: StringSPDX identifier (LSL-1.0, LUL-1.0, Apache-2.0, …).
plugin_type: StringFree-form classification: notifier | integration | analytics | …
runtime: Stringlua or wasm.
sdk_version: StringRequired SDK API version (">=0.2", "^0.2", "0.2" exact).
Defaults to ">=0.1.0" for legacy manifests.
hooks: Vec<String>Hooks the plugin claims to implement. Cross-checked against the hooks the Lua / Wasm side actually registers.
config_schema: Option<Value>JSON Schema for the plugin’s slice of .project/config.kdl.
Treated as opaque JSON until a host-side schema validator lands.
capabilities: Option<Capabilities>Capability declaration — what this plugin is allowed to do. Missing = fully permissive (with a deprecation warning).
homepage: Option<String>Optional homepage / source URL for the marketplace.
Implementations§
Source§impl PluginManifest
impl PluginManifest
Sourcepub fn load(path: &Path) -> ManifestResult<Self>
pub fn load(path: &Path) -> ManifestResult<Self>
Load and parse a manifest from disk.
Sourcepub fn from_str(json: &str) -> ManifestResult<Self>
pub fn from_str(json: &str) -> ManifestResult<Self>
Parse a manifest from a JSON string.
Sourcepub fn effective_capabilities(&self) -> Capabilities
pub fn effective_capabilities(&self) -> Capabilities
Effective capabilities — declared block, or the legacy permissive default. Use this everywhere the runtime asks “may I?”.
Sourcepub fn capabilities_implicit(&self) -> bool
pub fn capabilities_implicit(&self) -> bool
Was the capability block omitted? (Used to emit a one-shot deprecation warning on plugin load.)
Sourcepub fn check_sdk_compat(&self, sdk_api_version: &str) -> ManifestResult<()>
pub fn check_sdk_compat(&self, sdk_api_version: &str) -> ManifestResult<()>
Reject the plugin if its sdk_version constraint is incompatible
with the running SDK’s API version.
Sourcepub fn check_hooks(&self, observed: &[&str]) -> ManifestResult<()>
pub fn check_hooks(&self, observed: &[&str]) -> ManifestResult<()>
Confirm every hook implemented by the plugin’s runtime side is also declared in the manifest. Caller passes the hooks observed from the Lua/Wasm side.
Trait Implementations§
Source§impl Clone for PluginManifest
impl Clone for PluginManifest
Source§fn clone(&self) -> PluginManifest
fn clone(&self) -> PluginManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginManifest
impl Debug for PluginManifest
Source§impl<'de> Deserialize<'de> for PluginManifest
impl<'de> Deserialize<'de> for PluginManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PluginManifest
impl RefUnwindSafe for PluginManifest
impl Send for PluginManifest
impl Sync for PluginManifest
impl Unpin for PluginManifest
impl UnsafeUnpin for PluginManifest
impl UnwindSafe for PluginManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more