pub trait CommandPluginContext {
Show 26 methods
// Required methods
fn summaries(&self) -> Result<Vec<PluginSummary>, String>;
fn detail(&self, selector: &str) -> Result<PluginDetail, String>;
fn registry_diagnostics(&self) -> Vec<PluginDiagnostic>;
fn validation_is_clean(&self) -> bool;
fn len(&self) -> usize;
fn reload(&mut self) -> Result<usize, String>;
fn is_empty(&self) -> bool;
fn reload_nudge(&mut self) -> Option<String>;
fn state_path(&self) -> Option<PathBuf>;
fn suggest(&self, task: &str) -> Result<Vec<PluginSuggestion>, String>;
fn trust(&mut self, selector: &str, token: &str) -> Result<(), String>;
fn enable(&mut self, selector: &str) -> Result<(), String>;
fn disable(&mut self, selector: &str) -> Result<(), String>;
fn revoke_trust(&mut self, selector: &str) -> Result<(), String>;
fn install(
&mut self,
source: &str,
expected_content_hash: Option<&str>,
) -> Result<PluginMutationReceipt, String>;
fn update(
&mut self,
selector: &str,
) -> Result<PluginMutationReceipt, String>;
fn uninstall(
&mut self,
selector: &str,
) -> Result<PluginMutationReceipt, String>;
fn uninstall_path(
&mut self,
name: &str,
plugins_dir: &Path,
) -> Result<(), String>;
fn export(
&self,
selector: &str,
target: &Path,
) -> Result<PluginExportReceipt, String>;
fn legacy_scan(&self) -> Result<Option<PluginLegacyScan>, String>;
fn managed_scan(
&self,
home_override: Option<&Path>,
) -> Result<PluginManagedScan, String>;
fn managed_install(
&mut self,
canonical_path: &Path,
expected_content_hash: &str,
) -> Result<PluginMutationReceipt, String>;
fn marketplace_state(&self) -> Result<PluginMarketplaceState, String>;
fn marketplace_add(
&mut self,
name: &str,
path: &Path,
) -> Result<PluginMarketplaceAddReceipt, String>;
fn marketplace_remove(&mut self, name: &str) -> Result<bool, String>;
fn marketplace_install(
&mut self,
catalog: &str,
candidate: &str,
) -> Result<PluginMutationReceipt, String>;
}Expand description
Host plugin data for the plugin command group (FEAT-020 D1).
One object-safe, synchronous facet exposing the exact-minimum typed
operations the live /plugin branch closure consumes. Registry reads and
mutations, async-bridged install/update/uninstall (returning synchronous
portable receipts), export, legacy executable-tool scan, Kimi managed
import, and marketplace operations are all represented. The handler never
names crate::plugins, PluginRegistry, LoadedPlugin, Config, or
another concrete host service; implementation errors cross as safe text.
Post-mutation side effects (rediscovery, skill-cache refresh, active-skill reset) happen host-side inside the facet implementation; the handler only renders the returned receipt (D11).
Required Methods§
Sourcefn summaries(&self) -> Result<Vec<PluginSummary>, String>
fn summaries(&self) -> Result<Vec<PluginSummary>, String>
Read-only: registry summaries for list output.
Sourcefn detail(&self, selector: &str) -> Result<PluginDetail, String>
fn detail(&self, selector: &str) -> Result<PluginDetail, String>
Read-only: full portable detail for show/review/validate.
Sourcefn registry_diagnostics(&self) -> Vec<PluginDiagnostic>
fn registry_diagnostics(&self) -> Vec<PluginDiagnostic>
Read-only: registry-level diagnostics.
Sourcefn validation_is_clean(&self) -> bool
fn validation_is_clean(&self) -> bool
Read-only: whether validation reports no errors.
Sourcefn reload(&mut self) -> Result<usize, String>
fn reload(&mut self) -> Result<usize, String>
Mutation: rediscover the workspace registry and refresh the skill cache; returns the new registry length for the reload message.
Sourcefn reload_nudge(&mut self) -> Option<String>
fn reload_nudge(&mut self) -> Option<String>
Return the one-shot on-disk-change nudge, if the host detects one. The host owns the mutable catalog-stamp state; handlers only render.
Sourcefn state_path(&self) -> Option<PathBuf>
fn state_path(&self) -> Option<PathBuf>
Read-only: persistence store path for marketplace state.
Sourcefn suggest(&self, task: &str) -> Result<Vec<PluginSuggestion>, String>
fn suggest(&self, task: &str) -> Result<Vec<PluginSuggestion>, String>
Read-only: recommend installed bundles for a task without side effects.
Sourcefn trust(&mut self, selector: &str, token: &str) -> Result<(), String>
fn trust(&mut self, selector: &str, token: &str) -> Result<(), String>
Mutation: trust a bundle by exact review token. Success means the
mutation was applied; the handler renders the action word from its own
dispatch arm and may re-read detail for post-mutation state.
Sourcefn enable(&mut self, selector: &str) -> Result<(), String>
fn enable(&mut self, selector: &str) -> Result<(), String>
Mutation: enable a bundle. Success means enabled; re-read detail for
the post-mutation compatibility note.
Sourcefn install(
&mut self,
source: &str,
expected_content_hash: Option<&str>,
) -> Result<PluginMutationReceipt, String>
fn install( &mut self, source: &str, expected_content_hash: Option<&str>, ) -> Result<PluginMutationReceipt, String>
Async-bridged install; returns a synchronous portable receipt (D11).
Sourcefn update(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>
fn update(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>
Async-bridged update; returns a synchronous portable receipt (D11).
Sourcefn uninstall(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>
fn uninstall(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>
Async-bridged uninstall; returns a synchronous portable receipt (D11).
Sourcefn uninstall_path(
&mut self,
name: &str,
plugins_dir: &Path,
) -> Result<(), String>
fn uninstall_path( &mut self, name: &str, plugins_dir: &Path, ) -> Result<(), String>
File-level removal of a just-installed bundle whose content hash
mismatched (rollback). Unlike Self::uninstall it does not resolve a
registry selector and triggers no rediscovery or skill-cache side
effects; the host adapter owns the crate::plugins call (D1).
Sourcefn export(
&self,
selector: &str,
target: &Path,
) -> Result<PluginExportReceipt, String>
fn export( &self, selector: &str, target: &Path, ) -> Result<PluginExportReceipt, String>
Read-only: export a loaded bundle to a target directory.
Sourcefn legacy_scan(&self) -> Result<Option<PluginLegacyScan>, String>
fn legacy_scan(&self) -> Result<Option<PluginLegacyScan>, String>
Read-only: scan legacy executable plugin tools.
Sourcefn managed_scan(
&self,
home_override: Option<&Path>,
) -> Result<PluginManagedScan, String>
fn managed_scan( &self, home_override: Option<&Path>, ) -> Result<PluginManagedScan, String>
Read-only: Kimi managed-plugin directory scan.
Sourcefn managed_install(
&mut self,
canonical_path: &Path,
expected_content_hash: &str,
) -> Result<PluginMutationReceipt, String>
fn managed_install( &mut self, canonical_path: &Path, expected_content_hash: &str, ) -> Result<PluginMutationReceipt, String>
Mutation: install a Kimi managed candidate by exact content hash.
Sourcefn marketplace_state(&self) -> Result<PluginMarketplaceState, String>
fn marketplace_state(&self) -> Result<PluginMarketplaceState, String>
Read-only: marketplace state (optional host catalog + stored catalogs).
Sourcefn marketplace_add(
&mut self,
name: &str,
path: &Path,
) -> Result<PluginMarketplaceAddReceipt, String>
fn marketplace_add( &mut self, name: &str, path: &Path, ) -> Result<PluginMarketplaceAddReceipt, String>
Mutation: add a local catalog document to the marketplace store.
Sourcefn marketplace_remove(&mut self, name: &str) -> Result<bool, String>
fn marketplace_remove(&mut self, name: &str) -> Result<bool, String>
Mutation: remove a stored marketplace catalog.
Sourcefn marketplace_install(
&mut self,
catalog: &str,
candidate: &str,
) -> Result<PluginMutationReceipt, String>
fn marketplace_install( &mut self, catalog: &str, candidate: &str, ) -> Result<PluginMutationReceipt, String>
Mutation: install a marketplace candidate through the reviewed installer.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".