Skip to main content

CommandPluginContext

Trait CommandPluginContext 

Source
pub trait CommandPluginContext {
Show 29 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>; fn suggestion_dismissals( &self, ) -> Result<PluginSuggestionDismissals, String>; fn reset_suggestion_dismissals( &mut self, name: Option<&str>, ) -> Result<Vec<String>, String>; // Provided method fn dsh_preview(&self, package: &Path) -> Result<PluginDshPreview, 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§

Source

fn summaries(&self) -> Result<Vec<PluginSummary>, String>

Read-only: registry summaries for list output.

Source

fn detail(&self, selector: &str) -> Result<PluginDetail, String>

Read-only: full portable detail for show/review/validate.

Source

fn registry_diagnostics(&self) -> Vec<PluginDiagnostic>

Read-only: registry-level diagnostics.

Source

fn validation_is_clean(&self) -> bool

Read-only: whether validation reports no errors.

Source

fn len(&self) -> usize

Read-only: registry length (used by list/reload empty branches).

Source

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.

Source

fn is_empty(&self) -> bool

Read-only: whether the registry is empty.

Source

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.

Source

fn state_path(&self) -> Option<PathBuf>

Read-only: persistence store path for marketplace state.

Source

fn suggest(&self, task: &str) -> Result<Vec<PluginSuggestion>, String>

Read-only: recommend installed bundles for a task without side effects.

Source

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.

Source

fn enable(&mut self, selector: &str) -> Result<(), String>

Mutation: enable a bundle. Success means enabled; re-read detail for the post-mutation compatibility note.

Source

fn disable(&mut self, selector: &str) -> Result<(), String>

Mutation: disable a bundle.

Source

fn revoke_trust(&mut self, selector: &str) -> Result<(), String>

Mutation: revoke trust.

Source

fn install( &mut self, source: &str, expected_content_hash: Option<&str>, ) -> Result<PluginMutationReceipt, String>

Async-bridged install; returns a synchronous portable receipt (D11).

Source

fn update(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>

Async-bridged update; returns a synchronous portable receipt (D11).

Source

fn uninstall(&mut self, selector: &str) -> Result<PluginMutationReceipt, String>

Async-bridged uninstall; returns a synchronous portable receipt (D11).

Source

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).

Source

fn export( &self, selector: &str, target: &Path, ) -> Result<PluginExportReceipt, String>

Read-only: export a loaded bundle to a target directory.

Source

fn legacy_scan(&self) -> Result<Option<PluginLegacyScan>, String>

Read-only: scan legacy executable plugin tools.

Source

fn managed_scan( &self, home_override: Option<&Path>, ) -> Result<PluginManagedScan, String>

Read-only: Kimi managed-plugin directory scan.

Source

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.

Source

fn marketplace_state(&self) -> Result<PluginMarketplaceState, String>

Read-only: marketplace state (optional host catalog + stored catalogs).

Source

fn marketplace_add( &mut self, name: &str, path: &Path, ) -> Result<PluginMarketplaceAddReceipt, String>

Mutation: add a local catalog document to the marketplace store.

Source

fn marketplace_remove(&mut self, name: &str) -> Result<bool, String>

Mutation: remove a stored marketplace catalog.

Source

fn marketplace_install( &mut self, catalog: &str, candidate: &str, ) -> Result<PluginMutationReceipt, String>

Mutation: install a marketplace candidate through the reviewed installer.

Source

fn suggestion_dismissals(&self) -> Result<PluginSuggestionDismissals, String>

Read-only: which plugins proactive suggestions currently skip.

Source

fn reset_suggestion_dismissals( &mut self, name: Option<&str>, ) -> Result<Vec<String>, String>

Mutation: let suggestions offer name again (every dismissed plugin when None), in this session and future ones. Returns the names cleared, sorted.

Provided Methods§

Source

fn dsh_preview(&self, package: &Path) -> Result<PluginDshPreview, String>

Read-only: convert a DeepSeek Harness bundle package into scratch and review it without installing anything.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§