Skip to main content

Crate stellar_agent_toolsets

Crate stellar_agent_toolsets 

Source
Expand description

Toolset format parsing and capability-manifest validation.

§What this crate does

Parses and validates a toolset directory’s TOOLSET.md (agentskills format) and the wallet capability manifest carried in the frontmatter metadata map. The result is either a validated, typed Toolset value or a typed ToolsetFormatError refusal.

This crate also provides the pre-canonicalisation argument validation guard validate_toolset_tool_args, which must be called at BOTH toolset dispatch sites before serde_json::from_value::<TypedArgs>. The guard and its constants (TOOLSET_ARGS_MAX_DEPTH, TOOLSET_ARGS_MAX_NODES, ARGS_KEY_DENYLIST) are defined here so both the MCP dispatcher and the CLI execution path can consume them without an MCP dependency.

This crate is the FORMAT + PARSE/VALIDATE substrate only. It performs no install, no signing, no runtime enforcement, no MCP/CLI registration, and no network I/O.

§Primary consumers

§What this crate does NOT do

  • Install, uninstall, tarball handling, or publisher-signature verification.
  • Runtime capability enforcement against agent tool invocations.
  • First-invoke gate or attestation gate.
  • Executable scripts/ execution or sandboxing.

§Sibling crates

  • stellar-agent-core — profile management, policy engine, audit log.
  • stellar-agent-network — RPC transport, signing, keyring storage.
  • stellar-agent-mcp — MCP dispatcher that calls validate_toolset_tool_args.

Re-exports§

pub use args_error::ToolsetArgsError;
pub use capability::Capability;
pub use capability::CapabilitySet;
pub use error::ToolsetFormatError;
pub use parse::Toolset;
pub use parse::parse_toolset;
pub use sanitise::sanitise_display;
pub use validate::ARGS_KEY_DENYLIST;
pub use validate::TOOLSET_ARGS_MAX_DEPTH;
pub use validate::TOOLSET_ARGS_MAX_NODES;
pub use validate::validate_toolset_tool_args;

Modules§

args_error
Typed error surface for pre-canonicalisation argument validation failures.
capability
Capability taxonomy and capability-set types.
error
Typed error surface for toolset format parse and validation failures.
parse
TOOLSET.md parse pipeline.
sanitise
Render-time sanitisation for attacker-controlled string fields.
validate
Pre-canonicalisation argument validation for toolset tool dispatch.