Skip to main content

agent_works/plugin/install/
mod.rs

1//! Plugin install lifecycle: `plugin add` / `plugin remove` (human review before
2//! install → write to disk → pin → uninstall).
3//!
4//! The channels are capped at **path + git + archive**; this does not grow into a
5//! package manager (marketplace / central catalog deferred).
6//!
7//! - **Human review before install**: [`plan_install`] only stages + produces a
8//!   [`ReviewDigest`] (full manifest + capability breakdown); only **after human
9//!   confirmation** does [`commit_install`] write to disk (product-level gate;
10//!   plugins requested by an agent are never allowed through by default);
11//! - **Pinned values**: manifest hash, each .wasm hash, `run`/module/server paths
12//!   absolutized, resolved values for capabilities' paths/hosts — all pinned into
13//!   [`PluginRegistry`] (the authority **outside** the plugin directory);
14//! - **zip-slip**: reject if an archive member path escapes the extraction
15//!   directory;
16//! - **git dependency made explicit** (Windows): the git URL channel depends on a
17//!   `git` executable on `PATH` (may embed gix later);
18//! - **Uninstall cleans all three places**: tool table (identity_keys returned to
19//!   the caller for deregistration) / ledger ([`RemovalReport::sweep_ledger`]) /
20//!   registry entries.
21//!
22//! secret rule: env/headers only flow as `${ENV:VAR}` references; this module
23//! never resolves them and never writes literals.
24
25// Doc-link targets for the module docs above; nothing in this facade uses them.
26#[allow(unused_imports)]
27use super::manifest::ReviewDigest;
28#[allow(unused_imports)]
29use super::registry::PluginRegistry;
30
31mod build;
32mod ops;
33mod source;
34mod types;
35
36pub use ops::*;
37pub use types::*;
38
39#[cfg(test)]
40mod tests;