trusty-agents-common 0.9.0

Stable agent-plugin surface (ToolExecutor, AgentPlugin, ToolResult) shared by trusty-agents and external agent crates.
Documentation
//! Agent compose/deploy/manifest machinery, extracted from `trusty-mpm` (#2892).
//!
//! Why: `trusty-mpm` and `trusty-code` both need to resolve `extends:`
//! inheritance chains, track which deployed agent files a harness owns, and
//! write composed agents into a target directory without clobbering
//! user-owned files. This logic was originally trusty-mpm-only
//! (`crates/trusty-mpm/src/core/{agent_builder,agent_manifest,agent_deployer,
//! agent_metadata,frontmatter}.rs`); moving it here (mirroring the precedent
//! set by `ToolExecutor`/`AgentRunner`) lets both harnesses share one
//! implementation instead of forking it.
//! What: six submodules — [`frontmatter`] (the shared `key: value` line
//! parser, plus the `skills:` list-value grammar), [`builder`] (the
//! `extends:` inheritance-chain composer, filesystem-backed), [`builder_in_memory`]
//! (the disk-free counterpart — resolves `extends:` against an embedded
//! asset map instead of a `source_dir`, issue #2958 Slice E1), [`manifest`]
//! (the checksum + atomic-write ownership ledger), [`deployer`] (writes
//! composed agents into a target directory, consulting the manifest to avoid
//! clobbering user edits, and records each processed agent's declared
//! `skills:` for co-deployment), and [`metadata`] (a read-only projection of
//! a deployed agent's frontmatter for display/diagnostics, used by
//! `deployer` and by trusty-mpm's `tm doctor` / `tm agent` surfaces).
//! `trusty-mpm` re-exports every public item from
//! `crate::core::{agent_builder,agent_manifest,agent_deployer,agent_metadata,
//! frontmatter}` for source compatibility with its existing call sites.
//! Test: `cargo test -p trusty-agents-common agents::` exercises every
//! submodule in place; `cargo test -p trusty-mpm` exercises the re-exported
//! call sites end-to-end.
//!
//! [`frontmatter`]: crate::agents::frontmatter
//! [`builder`]: crate::agents::builder
//! [`builder_in_memory`]: crate::agents::builder_in_memory
//! [`manifest`]: crate::agents::manifest
//! [`deployer`]: crate::agents::deployer
//! [`metadata`]: crate::agents::metadata

pub mod builder;
pub mod builder_in_memory;
// #9011: `builder`'s `metadata:` map, kept out of the at-cap `builder.rs`.
mod builder_metadata;
// #4698: `builder`'s YAML scalar encoding, split out when adding `provenance:`
// pushed `builder.rs` over the 500-SLOC production cap.
mod builder_yaml;
pub mod deployer;
pub mod frontmatter;
pub mod manifest;
pub mod metadata;
// #4442: the shared "is this file outside the canonical tier tm's?" classifier,
// consumed by `tm doctor`'s asset_tier probe and (#4448) its quarantine
// counterpart.
pub mod tier_audit;
// #4448: the quarantine — the REPAIR half of the pair `tier_audit` reports on —
// plus the two gates that make moving a file safe, which `tier_audit` alone
// could not supply: `agent_schema` (is this trusty-mpm's artifact or another
// project's?) and `vcs_claim` (does the repository claim this file?).
pub mod agent_schema;
// #4698: the `provenance:` frontmatter field — which of the three writers
// (framework deploy, tm-agent-manager, the operator's own editor) produced a
// given agent file. Additive: it records authorship, never a tier.
pub mod provenance;
pub mod quarantine;
pub mod quarantine_receipt;
// #7727: the `{{TM_SKILLS}}` placeholder a deploy resolves to the install's
// absolute skills directory, so a no-`Skill` agent can `Read` a skill file.
pub mod skill_root;
pub mod vcs_claim;

#[cfg(test)]
#[path = "skill_root_tests.rs"]
mod skill_root_tests;

// #7683: the deployed-roster `tools:` conformance pin — asserts every agent
// deploys with the allowlist `docs/specs/agent-context-minimization.md` §C
// specifies, so an absent key cannot silently restore the all-tools default.
#[cfg(test)]
#[path = "roster_tools_tests.rs"]
mod roster_tools_tests;